Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzou
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzou
提交
6cf4afbe
提交
6cf4afbe
编写于
6月 23, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lab_qyk 部署微服务应用
上级
f2fbc2d7
变更
13
显示空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
1910 行增加
和
0 行删除
+1910
-0
ibzpost-pickup-grid-view-base.vue
...bzpost-pickup-grid-view/ibzpost-pickup-grid-view-base.vue
+719
-0
ibzpost-pickup-grid-view.less
...ou/ibzpost-pickup-grid-view/ibzpost-pickup-grid-view.less
+8
-0
ibzpost-pickup-grid-view.vue
.../ou/ibzpost-pickup-grid-view/ibzpost-pickup-grid-view.vue
+24
-0
ibzpost-pickup-view-base.vue
...pages/ou/ibzpost-pickup-view/ibzpost-pickup-view-base.vue
+662
-0
ibzpost-pickup-view.less
...src/pages/ou/ibzpost-pickup-view/ibzpost-pickup-view.less
+17
-0
ibzpost-pickup-view.vue
.../src/pages/ou/ibzpost-pickup-view/ibzpost-pickup-view.vue
+22
-0
router.ts
app_web/src/pages/ou/ouindex-view/router.ts
+26
-0
state.ts
app_web/src/store/modules/view-action/state.ts
+19
-0
pickup-viewpickupviewpanel-pickupviewpanel-base.vue
...panel/pickup-viewpickupviewpanel-pickupviewpanel-base.vue
+347
-0
pickup-viewpickupviewpanel-pickupviewpanel-model.ts
...panel/pickup-viewpickupviewpanel-pickupviewpanel-model.ts
+37
-0
pickup-viewpickupviewpanel-pickupviewpanel-service.ts
...nel/pickup-viewpickupviewpanel-pickupviewpanel-service.ts
+11
-0
pickup-viewpickupviewpanel-pickupviewpanel.less
...viewpanel/pickup-viewpickupviewpanel-pickupviewpanel.less
+4
-0
pickup-viewpickupviewpanel-pickupviewpanel.vue
...pviewpanel/pickup-viewpickupviewpanel-pickupviewpanel.vue
+14
-0
未找到文件。
app_web/src/pages/ou/ibzpost-pickup-grid-view/ibzpost-pickup-grid-view-base.vue
0 → 100644
浏览文件 @
6cf4afbe
<
template
>
<div
class=
'view-container depickupgridview ibzpost-pickup-grid-view'
>
<app-studioaction
:viewTitle=
"$t(model.srfTitle)"
viewName=
"ibzpostpickupgridview"
></app-studioaction>
<card
class=
'view-card view-no-caption view-no-toolbar'
:dis-hover=
"true"
:bordered=
"false"
>
<div
class=
'content-container pickup-grid-view'
>
<view
_searchform
:viewState=
"viewState"
:viewparams=
"viewparams"
:context=
"context"
:showBusyIndicator=
"true"
v-show=
"isExpandSearchForm"
loaddraftAction=
"FilterGetDraft"
loadAction=
"FilterGet"
name=
"searchform"
ref=
'searchform'
@
save=
"searchform_save($event)"
@
search=
"searchform_search($event)"
@
load=
"searchform_load($event)"
@
closeview=
"closeView($event)"
>
</view
_searchform
>
<view
_grid
:viewState=
"viewState"
:viewparams=
"viewparams"
:context=
"context"
:isSingleSelect=
"isSingleSelect"
:selectedData=
"selectedData"
:showBusyIndicator=
"true"
updateAction=
""
removeAction=
"Remove"
loaddraftAction=
""
loadAction=
""
createAction=
""
fetchAction=
"FetchDefault"
name=
"grid"
ref=
'grid'
@
selectionchange=
"grid_selectionchange($event)"
@
beforeload=
"grid_beforeload($event)"
@
rowdblclick=
"grid_rowdblclick($event)"
@
load=
"grid_load($event)"
@
closeview=
"closeView($event)"
>
</view
_grid
>
</div>
</card>
</div>
</
template
>
<
script
lang=
'tsx'
>
import
{
Vue
,
Component
,
Prop
,
Provide
,
Emit
,
Watch
,
Inject
}
from
'vue-property-decorator'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
NavDataService
from
'@/service/app/navdata-service'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
IBZPostService
from
'@/service/ibzpost/ibzpost-service'
;
import
PickupGridViewEngine
from
'@engine/view/pickup-grid-view-engine'
;
@
Component
({
components
:
{
},
})
export
default
class
IBZPostPickupGridViewBase
extends
Vue
{
/**
* 实体服务对象
*
* @type {IBZPostService}
* @memberof IBZPostPickupGridViewBase
*/
public
appEntityService
:
IBZPostService
=
new
IBZPostService
;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof IBZPostPickupGridViewBase
*/
public
counterServiceArray
:
Array
<
any
>
=
[];
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof IBZPostPickupGridViewBase
*/
@
Emit
()
public
viewDatasChange
(
val
:
any
):
any
{
return
val
;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof IBZPostPickupGridViewBase
*/
@
Prop
()
public
viewdata
!
:
string
;
/**
* 传入视图参数
*
* @type {string}
* @memberof IBZPostPickupGridViewBase
*/
@
Prop
()
public
viewparam
!
:
string
;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof IBZPostPickupGridViewBase
*/
@
Prop
({
default
:
true
})
public
viewDefaultUsage
!
:
boolean
;
/**
* 视图默认使用
*
* @type {string}
* @memberof IBZPostPickupGridViewBase
*/
@
Inject
(
'navModel'
)
public
navModel
!
:
string
;
/**
* 视图标识
*
* @type {string}
* @memberof IBZPostPickupGridViewBase
*/
public
viewtag
:
string
=
'395d443de520bbaee17c18ea0747abce'
;
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof IBZPostPickupGridViewBase
*/
public
customViewNavContexts
:
any
=
{
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof IBZPostPickupGridViewBase
*/
public
customViewParams
:
any
=
{
};
/**
* 视图模型数据
*
* @type {*}
* @memberof IBZPostPickupGridViewBase
*/
public
model
:
any
=
{
srfCaption
:
'entities.ibzpost.views.pickupgridview.caption'
,
srfTitle
:
'entities.ibzpost.views.pickupgridview.title'
,
srfSubTitle
:
'entities.ibzpost.views.pickupgridview.subtitle'
,
dataInfo
:
''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof IBZPostPickupGridViewBase
*/
@
Watch
(
'viewparam'
,{
immediate
:
true
,
deep
:
true
})
onParamData
(
newVal
:
any
,
oldVal
:
any
)
{
if
(
newVal
){
for
(
let
key
in
this
.
viewparams
){
delete
this
.
viewparams
[
key
];
}
Object
.
assign
(
this
.
viewparams
,
JSON
.
parse
(
this
.
viewparam
));
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof IBZPostPickupGridViewBase
*/
@
Watch
(
'viewdata'
)
onViewData
(
newVal
:
any
,
oldVal
:
any
)
{
const
_this
:
any
=
this
;
if
(
!
Object
.
is
(
newVal
,
oldVal
)
&&
_this
.
engine
)
{
this
.
$nextTick
(()
=>
{
_this
.
parseViewParam
();
_this
.
engine
.
load
();
});
}
}
/**
* 容器模型
*
* @type {*}
* @memberof IBZPostPickupGridViewBase
*/
public
containerModel
:
any
=
{
view_grid
:
{
name
:
'grid'
,
type
:
'GRID'
},
view_searchform
:
{
name
:
'searchform'
,
type
:
'SEARCHFORM'
},
};
/**
* 计数器刷新
*
* @memberof IBZPostPickupGridViewBase
*/
public
counterRefresh
(){
const
_this
:
any
=
this
;
if
(
_this
.
counterServiceArray
&&
_this
.
counterServiceArray
.
length
>
0
){
_this
.
counterServiceArray
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
refreshData
&&
item
.
refreshData
instanceof
Function
){
item
.
refreshData
();
}
})
}
}
/**
* 视图状态订阅对象
*
* @public
* @type {Subject<{action: string, data: any}>}
* @memberof IBZPostPickupGridViewBase
*/
public
viewState
:
Subject
<
ViewState
>
=
new
Subject
();
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof IBZPostPickupGridViewBase
*/
public
engine
:
PickupGridViewEngine
=
new
PickupGridViewEngine
();
/**
* 引擎初始化
*
* @public
* @memberof IBZPostPickupGridViewBase
*/
public
engineInit
():
void
{
this
.
engine
.
init
({
view
:
this
,
grid
:
this
.
$refs
.
grid
,
searchform
:
this
.
$refs
.
searchform
,
keyPSDEField
:
'ibzpost'
,
majorPSDEField
:
'postname'
,
isLoadDefault
:
true
,
});
}
/**
* 应用导航服务
*
* @type {*}
* @memberof IBZPostPickupGridViewBase
*/
public
navDataService
=
NavDataService
.
getInstance
(
this
.
$store
);
/**
* 导航服务事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBZPostPickupGridViewBase
*/
public
serviceStateEvent
:
Subscription
|
undefined
;
/**
* 应用上下文
*
* @type {*}
* @memberof IBZPostPickupGridViewBase
*/
public
context
:
any
=
{};
/**
* 视图参数
*
* @type {*}
* @memberof IBZPostPickupGridViewBase
*/
public
viewparams
:
any
=
{};
/**
* 视图缓存数据
*
* @type {*}
* @memberof IBZPostPickupGridViewBase
*/
public
viewCacheData
:
any
;
/**
* 解析视图参数
*
* @public
* @memberof IBZPostPickupGridViewBase
*/
public
parseViewParam
(
inputvalue
:
any
=
null
):
void
{
for
(
let
key
in
this
.
context
){
delete
this
.
context
[
key
];
}
if
(
!
this
.
viewDefaultUsage
&&
this
.
viewdata
&&
!
Object
.
is
(
this
.
viewdata
,
''
))
{
Object
.
assign
(
this
.
context
,
JSON
.
parse
(
this
.
viewdata
));
if
(
this
.
context
&&
this
.
context
.
srfparentdename
){
Object
.
assign
(
this
.
viewparams
,{
srfparentdename
:
this
.
context
.
srfparentdename
});
}
if
(
this
.
context
&&
this
.
context
.
srfparentkey
){
Object
.
assign
(
this
.
viewparams
,{
srfparentkey
:
this
.
context
.
srfparentkey
});
}
if
(
this
.
$store
.
getters
.
getAppData
()
&&
this
.
$store
.
getters
.
getAppData
().
context
){
Object
.
assign
(
this
.
context
,
this
.
$store
.
getters
.
getAppData
().
context
);
}
this
.
handleCustomViewData
();
return
;
}
const
path
=
(
this
.
$route
.
matched
[
this
.
$route
.
matched
.
length
-
1
]).
path
;
const
keys
:
Array
<
any
>
=
[];
const
curReg
=
this
.
$pathToRegExp
.
pathToRegexp
(
path
,
keys
);
const
matchArray
=
curReg
.
exec
(
this
.
$route
.
path
);
let
tempValue
:
Object
=
{};
keys
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
.
name
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
this
.
$viewTool
.
formatRouteParams
(
tempValue
,
this
.
$route
,
this
.
context
,
this
.
viewparams
);
if
(
inputvalue
){
Object
.
assign
(
this
.
context
,{
'ibzpost'
:
inputvalue
});
}
if
(
this
.
$store
.
getters
.
getAppData
()
&&
this
.
$store
.
getters
.
getAppData
().
context
){
Object
.
assign
(
this
.
context
,
this
.
$store
.
getters
.
getAppData
().
context
);
}
//初始化视图唯一标识
Object
.
assign
(
this
.
context
,{
srfsessionid
:
this
.
$util
.
createUUID
()});
this
.
handleCustomViewData
();
//初始化导航数据
this
.
initNavDataWithRoute
();
}
/**
* 处理自定义视图数据
*
* @memberof IBZPostPickupGridViewBase
*/
public
handleCustomViewData
(){
if
(
Object
.
keys
(
this
.
customViewNavContexts
).
length
>
0
){
Object
.
keys
(
this
.
customViewNavContexts
).
forEach
((
item
:
any
)
=>
{
let
tempContext
:
any
=
{};
let
curNavContext
:
any
=
this
.
customViewNavContexts
[
item
];
this
.
handleCustomDataLogic
(
curNavContext
,
tempContext
,
item
);
Object
.
assign
(
this
.
context
,
tempContext
);
})
}
if
(
Object
.
keys
(
this
.
customViewParams
).
length
>
0
){
Object
.
keys
(
this
.
customViewParams
).
forEach
((
item
:
any
)
=>
{
let
tempParam
:
any
=
{};
let
curNavParam
:
any
=
this
.
customViewParams
[
item
];
this
.
handleCustomDataLogic
(
curNavParam
,
tempParam
,
item
);
Object
.
assign
(
this
.
viewparams
,
tempParam
);
})
}
}
/**
* 处理自定义视图数据逻辑
*
* @memberof IBZPostPickupGridViewBase
*/
public
handleCustomDataLogic
(
curNavData
:
any
,
tempData
:
any
,
item
:
string
){
// 直接值直接赋值
if
(
curNavData
.
isRawValue
){
if
(
Object
.
is
(
curNavData
.
value
,
"null"
)
||
Object
.
is
(
curNavData
.
value
,
""
)){
Object
.
defineProperty
(
tempData
,
item
.
toLowerCase
(),
{
value
:
null
,
writable
:
true
,
enumerable
:
true
,
configurable
:
true
});
}
else
{
Object
.
defineProperty
(
tempData
,
item
.
toLowerCase
(),
{
value
:
curNavData
.
value
,
writable
:
true
,
enumerable
:
true
,
configurable
:
true
});
}
}
else
{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if
(
this
.
context
[(
curNavData
.
value
).
toLowerCase
()]){
Object
.
defineProperty
(
tempData
,
item
.
toLowerCase
(),
{
value
:
this
.
context
[(
curNavData
.
value
).
toLowerCase
()],
writable
:
true
,
enumerable
:
true
,
configurable
:
true
});
}
else
{
if
(
this
.
viewparams
[(
curNavData
.
value
).
toLowerCase
()]){
Object
.
defineProperty
(
tempData
,
item
.
toLowerCase
(),
{
value
:
this
.
viewparams
[(
curNavData
.
value
).
toLowerCase
()],
writable
:
true
,
enumerable
:
true
,
configurable
:
true
});
}
else
{
Object
.
defineProperty
(
tempData
,
item
.
toLowerCase
(),
{
value
:
null
,
writable
:
true
,
enumerable
:
true
,
configurable
:
true
});
}
}
}
}
/**
* 初始化导航数据(路由模式)
*
* @memberof IBZPostPickupGridViewBase
*/
public
initNavDataWithRoute
(
data
:
any
=
null
,
isNew
:
boolean
=
false
){
if
(
this
.
viewDefaultUsage
&&
Object
.
is
(
this
.
navModel
,
"route"
)){
this
.
navDataService
.
addNavData
({
id
:
'ibzpost-pickup-grid-view'
,
tag
:
this
.
viewtag
,
srfkey
:
isNew
?
null
:
this
.
context
.
ibzpost
,
title
:
this
.
$t
(
this
.
model
.
srfTitle
),
data
:
data
,
context
:
this
.
context
,
viewparams
:
this
.
viewparams
,
path
:
this
.
$route
.
fullPath
});
}
}
/**
* 初始化导航数据(分页模式)
*
* @memberof IBZPostPickupGridViewBase
*/
public
initNavDataWithTab
(
data
:
any
=
null
,
isOnlyAdd
:
boolean
=
true
){
if
(
this
.
viewDefaultUsage
&&
!
Object
.
is
(
this
.
navModel
,
"route"
)){
this
.
navDataService
.
addNavDataByOnly
({
id
:
'ibzpost-pickup-grid-view'
,
tag
:
this
.
viewtag
,
srfkey
:
this
.
context
.
ibzpost
,
title
:
this
.
$t
(
this
.
model
.
srfTitle
),
data
:
data
,
context
:
this
.
context
,
viewparams
:
this
.
viewparams
,
path
:
this
.
$route
.
fullPath
},
isOnlyAdd
);
}
}
/**
* Vue声明周期
*
* @memberof IBZPostPickupGridViewBase
*/
public
created
()
{
this
.
afterCreated
();
}
/**
* 执行created后的逻辑
*
* @memberof IBZPostPickupGridViewBase
*/
public
afterCreated
(){
let
_this
:
any
=
this
;
const
secondtag
=
_this
.
$util
.
createUUID
();
_this
.
$store
.
commit
(
'viewaction/createdView'
,
{
viewtag
:
_this
.
viewtag
,
secondtag
:
secondtag
});
_this
.
viewtag
=
secondtag
;
_this
.
parseViewParam
();
_this
.
serviceStateEvent
=
_this
.
navDataService
.
serviceState
.
subscribe
(({
action
,
name
,
data
}:{
action
:
string
,
name
:
any
,
data
:
any
})
=>
{
if
(
!
Object
.
is
(
name
,
'ibzpost-pickup-grid-view'
)){
return
;
}
if
(
Object
.
is
(
action
,
'viewrefresh'
))
{
_this
.
$nextTick
(()
=>
{
_this
.
parseViewParam
(
data
);
if
(
_this
.
engine
){
_this
.
engine
.
load
();
}
});
}
});
}
/**
* 销毁之前
*
* @memberof IBZPostPickupGridViewBase
*/
public
beforeDestroy
()
{
this
.
$store
.
commit
(
'viewaction/removeView'
,
this
.
viewtag
);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof IBZPostPickupGridViewBase
*/
public
mounted
()
{
this
.
afterMounted
();
}
/**
* 执行mounted后的逻辑
*
* @memberof IBZPostPickupGridViewBase
*/
public
afterMounted
(){
const
_this
:
any
=
this
;
_this
.
engineInit
();
if
(
_this
.
loadModel
&&
_this
.
loadModel
instanceof
Function
)
{
_this
.
loadModel
();
}
}
/**
* grid 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBZPostPickupGridViewBase
*/
public
grid_selectionchange
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'grid'
,
'selectionchange'
,
$event
);
}
/**
* grid 部件 beforeload 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBZPostPickupGridViewBase
*/
public
grid_beforeload
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'grid'
,
'beforeload'
,
$event
);
}
/**
* grid 部件 rowdblclick 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBZPostPickupGridViewBase
*/
public
grid_rowdblclick
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'grid'
,
'rowdblclick'
,
$event
);
}
/**
* grid 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBZPostPickupGridViewBase
*/
public
grid_load
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'grid'
,
'load'
,
$event
);
}
/**
* searchform 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBZPostPickupGridViewBase
*/
public
searchform_save
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'searchform'
,
'save'
,
$event
);
}
/**
* searchform 部件 search 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBZPostPickupGridViewBase
*/
public
searchform_search
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'searchform'
,
'search'
,
$event
);
}
/**
* searchform 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBZPostPickupGridViewBase
*/
public
searchform_load
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'searchform'
,
'load'
,
$event
);
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof IBZPostPickupGridViewBase
*/
public
closeView
(
args
:
any
[]):
void
{
let
_view
:
any
=
this
;
if
(
_view
.
viewdata
)
{
_view
.
$emit
(
'viewdataschange'
,
[
args
]);
_view
.
$emit
(
'close'
,
[
args
]);
}
else
if
(
_view
.
$tabPageExp
)
{
_view
.
$tabPageExp
.
onClose
(
_view
.
$route
.
fullPath
);
}
}
/**
* 销毁视图回调
*
* @memberof IBZPostPickupGridViewBase
*/
public
destroyed
(){
this
.
afterDestroyed
();
}
/**
* 执行destroyed后的逻辑
*
* @memberof IBZPostPickupGridViewBase
*/
public
afterDestroyed
(){
if
(
this
.
viewDefaultUsage
){
let
localStoreLength
=
Object
.
keys
(
localStorage
);
if
(
localStoreLength
.
length
>
0
){
localStoreLength
.
forEach
((
item
:
string
)
=>
{
if
(
item
.
startsWith
(
this
.
context
.
srfsessionid
)){
localStorage
.
removeItem
(
item
);
}
})
}
if
(
Object
.
is
(
this
.
navModel
,
"tab"
)){
this
.
navDataService
.
removeNavDataByTag
(
this
.
viewtag
);
}
if
(
this
.
serviceStateEvent
)
{
this
.
serviceStateEvent
.
unsubscribe
();
}
}
}
/**
* 选中数据字符串
*
* @type {string}
* @memberof IBZPostPickupGridViewBase
*/
@
Prop
()
public
selectedData
?:
string
;
/**
* 是否单选
*
* @type {boolean}
* @memberof IBZPostPickupGridViewBase
*/
@
Prop
()
public
isSingleSelect
?:
boolean
;
/**
* 搜索值
*
* @type {string}
* @memberof IBZPostPickupGridViewBase
*/
public
query
:
string
=
''
;
/**
* 是否展开搜索表单
*
* @type {boolean}
* @memberof IBZPostPickupGridViewBase
*/
public
isExpandSearchForm
:
boolean
=
true
;
/**
* 表格行数据默认激活模式
* 0 不激活
* 1 单击激活
* 2 双击激活
*
* @type {(number | 0 | 1 | 2)}
* @memberof IBZPostPickupGridViewBase
*/
public
gridRowActiveMode
:
number
|
0
|
1
|
2
=
2
;
/**
* 快速搜索
*
* @param {*} $event
* @memberof IBZPostPickupGridViewBase
*/
public
onSearch
(
$event
:
any
):
void
{
const
refs
:
any
=
this
.
$refs
;
if
(
refs
.
grid
)
{
refs
.
grid
.
load
({});
}
}
}
</
script
>
<
style
lang=
'less'
>
@import './ibzpost-pickup-grid-view.less';
</
style
>
\ No newline at end of file
app_web/src/pages/ou/ibzpost-pickup-grid-view/ibzpost-pickup-grid-view.less
0 → 100644
浏览文件 @
6cf4afbe
.ibzpost-pickup-grid-view{
position: relative;
}
.ibzpost-pickup-grid-view{
display: block;
}
\ No newline at end of file
app_web/src/pages/ou/ibzpost-pickup-grid-view/ibzpost-pickup-grid-view.vue
0 → 100644
浏览文件 @
6cf4afbe
<
script
lang=
'tsx'
>
import
{
Component
}
from
'vue-property-decorator'
;
import
IBZPostPickupGridViewBase
from
'./ibzpost-pickup-grid-view-base.vue'
;
import
view_grid
from
'@widgets/ibzpost/main-grid/main-grid.vue'
;
import
view_searchform
from
'@widgets/ibzpost/default-searchform/default-searchform.vue'
;
@
Component
({
components
:
{
view_grid
,
view_searchform
,
},
beforeRouteEnter
:
(
to
:
any
,
from
:
any
,
next
:
any
)
=>
{
next
((
vm
:
any
)
=>
{
if
(
!
Object
.
is
(
vm
.
navModel
,
"route"
)){
vm
.
initNavDataWithTab
(
vm
.
viewCacheData
);
}
vm
.
$store
.
commit
(
'addCurPageViewtag'
,
{
fullPath
:
to
.
fullPath
,
viewtag
:
vm
.
viewtag
});
});
},
})
export
default
class
IBZPostPickupGridView
extends
IBZPostPickupGridViewBase
{
}
</
script
>
\ No newline at end of file
app_web/src/pages/ou/ibzpost-pickup-view/ibzpost-pickup-view-base.vue
0 → 100644
浏览文件 @
6cf4afbe
<
template
>
<div
class=
"view-container depickupview ibzpost-pickup-view"
>
<app-studioaction
:viewTitle=
"$t(model.srfTitle)"
viewName=
"ibzpostpickupview"
></app-studioaction>
<card
class=
'view-card view-no-caption view-no-toolbar'
:dis-hover=
"true"
:padding=
"0"
:bordered=
"false"
>
<div
class=
"content-container pickup-view"
>
<view
_pickupviewpanel
:viewState=
"viewState"
:viewparams=
"JSON.parse(JSON.stringify(viewparams))"
:context=
"JSON.parse(JSON.stringify(context))"
:isSingleSelect=
"isSingleSelect"
:selectedData=
"selectedData"
:isShowButton=
"isShowButton"
name=
"pickupviewpanel"
ref=
'pickupviewpanel'
@
selectionchange=
"pickupviewpanel_selectionchange($event)"
@
activated=
"pickupviewpanel_activated($event)"
@
load=
"pickupviewpanel_load($event)"
@
closeview=
"closeView($event)"
>
</view
_pickupviewpanel
>
<card
v-if=
"isShowButton"
:dis-hover=
"true"
:bordered=
"false"
class=
"footer"
>
<row
:style=
"
{ textAlign: 'right' }">
<i-button
type=
"primary"
:disabled=
"this.viewSelections.length > 0 ? false : true"
@
click=
"onClickOk"
>
{{
this
.
containerModel
.
view_okbtn
.
text
}}
</i-button>
<i-button
@
click=
"onClickCancel"
>
{{
this
.
containerModel
.
view_cancelbtn
.
text
}}
</i-button>
</row>
</card>
</div>
</card>
</div>
</
template
>
<
script
lang=
'tsx'
>
import
{
Vue
,
Component
,
Prop
,
Provide
,
Emit
,
Watch
,
Inject
}
from
'vue-property-decorator'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
NavDataService
from
'@/service/app/navdata-service'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
IBZPostService
from
'@/service/ibzpost/ibzpost-service'
;
import
PickupViewEngine
from
'@engine/view/pickup-view-engine'
;
@
Component
({
components
:
{
},
})
export
default
class
IBZPostPickupViewBase
extends
Vue
{
/**
* 实体服务对象
*
* @type {IBZPostService}
* @memberof IBZPostPickupViewBase
*/
public
appEntityService
:
IBZPostService
=
new
IBZPostService
;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof IBZPostPickupViewBase
*/
public
counterServiceArray
:
Array
<
any
>
=
[];
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof IBZPostPickupViewBase
*/
@
Emit
()
public
viewDatasChange
(
val
:
any
):
any
{
return
val
;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof IBZPostPickupViewBase
*/
@
Prop
()
public
viewdata
!
:
string
;
/**
* 传入视图参数
*
* @type {string}
* @memberof IBZPostPickupViewBase
*/
@
Prop
()
public
viewparam
!
:
string
;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof IBZPostPickupViewBase
*/
@
Prop
({
default
:
true
})
public
viewDefaultUsage
!
:
boolean
;
/**
* 视图默认使用
*
* @type {string}
* @memberof IBZPostPickupViewBase
*/
@
Inject
(
'navModel'
)
public
navModel
!
:
string
;
/**
* 视图标识
*
* @type {string}
* @memberof IBZPostPickupViewBase
*/
public
viewtag
:
string
=
'0581848a24a829f706252c15c641e154'
;
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof IBZPostPickupViewBase
*/
public
customViewNavContexts
:
any
=
{
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof IBZPostPickupViewBase
*/
public
customViewParams
:
any
=
{
};
/**
* 视图模型数据
*
* @type {*}
* @memberof IBZPostPickupViewBase
*/
public
model
:
any
=
{
srfCaption
:
'entities.ibzpost.views.pickupview.caption'
,
srfTitle
:
'entities.ibzpost.views.pickupview.title'
,
srfSubTitle
:
'entities.ibzpost.views.pickupview.subtitle'
,
dataInfo
:
''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof IBZPostPickupViewBase
*/
@
Watch
(
'viewparam'
,{
immediate
:
true
,
deep
:
true
})
onParamData
(
newVal
:
any
,
oldVal
:
any
)
{
if
(
newVal
){
for
(
let
key
in
this
.
viewparams
){
delete
this
.
viewparams
[
key
];
}
Object
.
assign
(
this
.
viewparams
,
JSON
.
parse
(
this
.
viewparam
));
if
(
this
.
viewparams
.
selectedData
){
this
.
selectedData
=
JSON
.
stringify
(
this
.
viewparams
.
selectedData
);
}
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof IBZPostPickupViewBase
*/
@
Watch
(
'viewdata'
)
onViewData
(
newVal
:
any
,
oldVal
:
any
)
{
const
_this
:
any
=
this
;
if
(
!
Object
.
is
(
newVal
,
oldVal
)
&&
_this
.
engine
)
{
this
.
$nextTick
(()
=>
{
_this
.
parseViewParam
();
_this
.
engine
.
load
();
});
}
}
/**
* 容器模型
*
* @type {*}
* @memberof IBZPostPickupViewBase
*/
public
containerModel
:
any
=
{
view_pickupviewpanel
:
{
name
:
'pickupviewpanel'
,
type
:
'PICKUPVIEWPANEL'
},
view_okbtn
:
{
name
:
'okbtn'
,
type
:
'button'
,
text
:
'确定'
,
disabled
:
true
},
view_cancelbtn
:
{
name
:
'cancelbtn'
,
type
:
'button'
,
text
:
'取消'
,
disabled
:
false
},
view_leftbtn
:
{
name
:
'leftbtn'
,
type
:
'button'
,
text
:
'左移'
,
disabled
:
true
},
view_rightbtn
:
{
name
:
'rightbtn'
,
type
:
'button'
,
text
:
'右移'
,
disabled
:
true
},
view_allleftbtn
:
{
name
:
'allleftbtn'
,
type
:
'button'
,
text
:
'全部左移'
,
disabled
:
true
},
view_allrightbtn
:
{
name
:
'allrightbtn'
,
type
:
'button'
,
text
:
'全部右移'
,
disabled
:
true
},
};
/**
* 计数器刷新
*
* @memberof IBZPostPickupViewBase
*/
public
counterRefresh
(){
const
_this
:
any
=
this
;
if
(
_this
.
counterServiceArray
&&
_this
.
counterServiceArray
.
length
>
0
){
_this
.
counterServiceArray
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
refreshData
&&
item
.
refreshData
instanceof
Function
){
item
.
refreshData
();
}
})
}
}
/**
* 视图状态订阅对象
*
* @public
* @type {Subject<{action: string, data: any}>}
* @memberof IBZPostPickupViewBase
*/
public
viewState
:
Subject
<
ViewState
>
=
new
Subject
();
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof IBZPostPickupViewBase
*/
public
engine
:
PickupViewEngine
=
new
PickupViewEngine
();
/**
* 引擎初始化
*
* @public
* @memberof IBZPostPickupViewBase
*/
public
engineInit
():
void
{
this
.
engine
.
init
({
view
:
this
,
pickupviewpanel
:
this
.
$refs
.
pickupviewpanel
,
keyPSDEField
:
'ibzpost'
,
majorPSDEField
:
'postname'
,
isLoadDefault
:
true
,
});
}
/**
* 应用导航服务
*
* @type {*}
* @memberof IBZPostPickupViewBase
*/
public
navDataService
=
NavDataService
.
getInstance
(
this
.
$store
);
/**
* 导航服务事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBZPostPickupViewBase
*/
public
serviceStateEvent
:
Subscription
|
undefined
;
/**
* 应用上下文
*
* @type {*}
* @memberof IBZPostPickupViewBase
*/
public
context
:
any
=
{};
/**
* 视图参数
*
* @type {*}
* @memberof IBZPostPickupViewBase
*/
public
viewparams
:
any
=
{};
/**
* 视图缓存数据
*
* @type {*}
* @memberof IBZPostPickupViewBase
*/
public
viewCacheData
:
any
;
/**
* 解析视图参数
*
* @public
* @memberof IBZPostPickupViewBase
*/
public
parseViewParam
(
inputvalue
:
any
=
null
):
void
{
for
(
let
key
in
this
.
context
){
delete
this
.
context
[
key
];
}
if
(
!
this
.
viewDefaultUsage
&&
this
.
viewdata
&&
!
Object
.
is
(
this
.
viewdata
,
''
))
{
Object
.
assign
(
this
.
context
,
JSON
.
parse
(
this
.
viewdata
));
if
(
this
.
context
&&
this
.
context
.
srfparentdename
){
Object
.
assign
(
this
.
viewparams
,{
srfparentdename
:
this
.
context
.
srfparentdename
});
}
if
(
this
.
context
&&
this
.
context
.
srfparentkey
){
Object
.
assign
(
this
.
viewparams
,{
srfparentkey
:
this
.
context
.
srfparentkey
});
}
if
(
this
.
$store
.
getters
.
getAppData
()
&&
this
.
$store
.
getters
.
getAppData
().
context
){
Object
.
assign
(
this
.
context
,
this
.
$store
.
getters
.
getAppData
().
context
);
}
this
.
handleCustomViewData
();
return
;
}
const
path
=
(
this
.
$route
.
matched
[
this
.
$route
.
matched
.
length
-
1
]).
path
;
const
keys
:
Array
<
any
>
=
[];
const
curReg
=
this
.
$pathToRegExp
.
pathToRegexp
(
path
,
keys
);
const
matchArray
=
curReg
.
exec
(
this
.
$route
.
path
);
let
tempValue
:
Object
=
{};
keys
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
.
name
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
this
.
$viewTool
.
formatRouteParams
(
tempValue
,
this
.
$route
,
this
.
context
,
this
.
viewparams
);
if
(
inputvalue
){
Object
.
assign
(
this
.
context
,{
'ibzpost'
:
inputvalue
});
}
if
(
this
.
$store
.
getters
.
getAppData
()
&&
this
.
$store
.
getters
.
getAppData
().
context
){
Object
.
assign
(
this
.
context
,
this
.
$store
.
getters
.
getAppData
().
context
);
}
//初始化视图唯一标识
Object
.
assign
(
this
.
context
,{
srfsessionid
:
this
.
$util
.
createUUID
()});
this
.
handleCustomViewData
();
//初始化导航数据
this
.
initNavDataWithRoute
();
}
/**
* 处理自定义视图数据
*
* @memberof IBZPostPickupViewBase
*/
public
handleCustomViewData
(){
if
(
Object
.
keys
(
this
.
customViewNavContexts
).
length
>
0
){
Object
.
keys
(
this
.
customViewNavContexts
).
forEach
((
item
:
any
)
=>
{
let
tempContext
:
any
=
{};
let
curNavContext
:
any
=
this
.
customViewNavContexts
[
item
];
this
.
handleCustomDataLogic
(
curNavContext
,
tempContext
,
item
);
Object
.
assign
(
this
.
context
,
tempContext
);
})
}
if
(
Object
.
keys
(
this
.
customViewParams
).
length
>
0
){
Object
.
keys
(
this
.
customViewParams
).
forEach
((
item
:
any
)
=>
{
let
tempParam
:
any
=
{};
let
curNavParam
:
any
=
this
.
customViewParams
[
item
];
this
.
handleCustomDataLogic
(
curNavParam
,
tempParam
,
item
);
Object
.
assign
(
this
.
viewparams
,
tempParam
);
})
}
}
/**
* 处理自定义视图数据逻辑
*
* @memberof IBZPostPickupViewBase
*/
public
handleCustomDataLogic
(
curNavData
:
any
,
tempData
:
any
,
item
:
string
){
// 直接值直接赋值
if
(
curNavData
.
isRawValue
){
if
(
Object
.
is
(
curNavData
.
value
,
"null"
)
||
Object
.
is
(
curNavData
.
value
,
""
)){
Object
.
defineProperty
(
tempData
,
item
.
toLowerCase
(),
{
value
:
null
,
writable
:
true
,
enumerable
:
true
,
configurable
:
true
});
}
else
{
Object
.
defineProperty
(
tempData
,
item
.
toLowerCase
(),
{
value
:
curNavData
.
value
,
writable
:
true
,
enumerable
:
true
,
configurable
:
true
});
}
}
else
{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if
(
this
.
context
[(
curNavData
.
value
).
toLowerCase
()]){
Object
.
defineProperty
(
tempData
,
item
.
toLowerCase
(),
{
value
:
this
.
context
[(
curNavData
.
value
).
toLowerCase
()],
writable
:
true
,
enumerable
:
true
,
configurable
:
true
});
}
else
{
if
(
this
.
viewparams
[(
curNavData
.
value
).
toLowerCase
()]){
Object
.
defineProperty
(
tempData
,
item
.
toLowerCase
(),
{
value
:
this
.
viewparams
[(
curNavData
.
value
).
toLowerCase
()],
writable
:
true
,
enumerable
:
true
,
configurable
:
true
});
}
else
{
Object
.
defineProperty
(
tempData
,
item
.
toLowerCase
(),
{
value
:
null
,
writable
:
true
,
enumerable
:
true
,
configurable
:
true
});
}
}
}
}
/**
* 初始化导航数据(路由模式)
*
* @memberof IBZPostPickupViewBase
*/
public
initNavDataWithRoute
(
data
:
any
=
null
,
isNew
:
boolean
=
false
){
if
(
this
.
viewDefaultUsage
&&
Object
.
is
(
this
.
navModel
,
"route"
)){
this
.
navDataService
.
addNavData
({
id
:
'ibzpost-pickup-view'
,
tag
:
this
.
viewtag
,
srfkey
:
isNew
?
null
:
this
.
context
.
ibzpost
,
title
:
this
.
$t
(
this
.
model
.
srfTitle
),
data
:
data
,
context
:
this
.
context
,
viewparams
:
this
.
viewparams
,
path
:
this
.
$route
.
fullPath
});
}
}
/**
* 初始化导航数据(分页模式)
*
* @memberof IBZPostPickupViewBase
*/
public
initNavDataWithTab
(
data
:
any
=
null
,
isOnlyAdd
:
boolean
=
true
){
if
(
this
.
viewDefaultUsage
&&
!
Object
.
is
(
this
.
navModel
,
"route"
)){
this
.
navDataService
.
addNavDataByOnly
({
id
:
'ibzpost-pickup-view'
,
tag
:
this
.
viewtag
,
srfkey
:
this
.
context
.
ibzpost
,
title
:
this
.
$t
(
this
.
model
.
srfTitle
),
data
:
data
,
context
:
this
.
context
,
viewparams
:
this
.
viewparams
,
path
:
this
.
$route
.
fullPath
},
isOnlyAdd
);
}
}
/**
* Vue声明周期
*
* @memberof IBZPostPickupViewBase
*/
public
created
()
{
this
.
afterCreated
();
}
/**
* 执行created后的逻辑
*
* @memberof IBZPostPickupViewBase
*/
public
afterCreated
(){
let
_this
:
any
=
this
;
const
secondtag
=
_this
.
$util
.
createUUID
();
_this
.
$store
.
commit
(
'viewaction/createdView'
,
{
viewtag
:
_this
.
viewtag
,
secondtag
:
secondtag
});
_this
.
viewtag
=
secondtag
;
_this
.
parseViewParam
();
_this
.
serviceStateEvent
=
_this
.
navDataService
.
serviceState
.
subscribe
(({
action
,
name
,
data
}:{
action
:
string
,
name
:
any
,
data
:
any
})
=>
{
if
(
!
Object
.
is
(
name
,
'ibzpost-pickup-view'
)){
return
;
}
if
(
Object
.
is
(
action
,
'viewrefresh'
))
{
_this
.
$nextTick
(()
=>
{
_this
.
parseViewParam
(
data
);
if
(
_this
.
engine
){
_this
.
engine
.
load
();
}
});
}
});
}
/**
* 销毁之前
*
* @memberof IBZPostPickupViewBase
*/
public
beforeDestroy
()
{
this
.
$store
.
commit
(
'viewaction/removeView'
,
this
.
viewtag
);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof IBZPostPickupViewBase
*/
public
mounted
()
{
this
.
afterMounted
();
}
/**
* 执行mounted后的逻辑
*
* @memberof IBZPostPickupViewBase
*/
public
afterMounted
(){
const
_this
:
any
=
this
;
_this
.
engineInit
();
if
(
_this
.
loadModel
&&
_this
.
loadModel
instanceof
Function
)
{
_this
.
loadModel
();
}
if
(
this
.
viewparams
.
selectedData
){
this
.
engine
.
onCtrlEvent
(
'pickupviewpanel'
,
'selectionchange'
,
this
.
viewparams
.
selectedData
);
}
}
/**
* pickupviewpanel 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBZPostPickupViewBase
*/
public
pickupviewpanel_selectionchange
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'pickupviewpanel'
,
'selectionchange'
,
$event
);
}
/**
* pickupviewpanel 部件 activated 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBZPostPickupViewBase
*/
public
pickupviewpanel_activated
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'pickupviewpanel'
,
'activated'
,
$event
);
}
/**
* pickupviewpanel 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBZPostPickupViewBase
*/
public
pickupviewpanel_load
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'pickupviewpanel'
,
'load'
,
$event
);
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof IBZPostPickupViewBase
*/
public
closeView
(
args
:
any
[]):
void
{
let
_view
:
any
=
this
;
if
(
_view
.
viewdata
)
{
_view
.
$emit
(
'viewdataschange'
,
[
args
]);
_view
.
$emit
(
'close'
,
[
args
]);
}
else
if
(
_view
.
$tabPageExp
)
{
_view
.
$tabPageExp
.
onClose
(
_view
.
$route
.
fullPath
);
}
}
/**
* 销毁视图回调
*
* @memberof IBZPostPickupViewBase
*/
public
destroyed
(){
this
.
afterDestroyed
();
}
/**
* 执行destroyed后的逻辑
*
* @memberof IBZPostPickupViewBase
*/
public
afterDestroyed
(){
if
(
this
.
viewDefaultUsage
){
let
localStoreLength
=
Object
.
keys
(
localStorage
);
if
(
localStoreLength
.
length
>
0
){
localStoreLength
.
forEach
((
item
:
string
)
=>
{
if
(
item
.
startsWith
(
this
.
context
.
srfsessionid
)){
localStorage
.
removeItem
(
item
);
}
})
}
if
(
Object
.
is
(
this
.
navModel
,
"tab"
)){
this
.
navDataService
.
removeNavDataByTag
(
this
.
viewtag
);
}
if
(
this
.
serviceStateEvent
)
{
this
.
serviceStateEvent
.
unsubscribe
();
}
}
}
/**
* 选中数据的字符串
*
* @type {string}
* @memberof IBZPostPickupViewBase
*/
public
selectedData
:
string
=
""
;
/**
* 视图选中数据
*
* @type {any[]}
* @memberof IBZPostPickupViewBase
*/
public
viewSelections
:
any
[]
=
[];
/**
* 是否显示按钮
*
* @type {boolean}
* @memberof IBZPostPickupViewBase
*/
@
Prop
({
default
:
true
})
public
isShowButton
!
:
boolean
;
/**
* 是否单选
*
* @type {boolean}
* @memberof IBZPostPickupViewBase
*/
public
isSingleSelect
:
boolean
=
true
;
/**
* 确定
*
* @memberof IBZPostPickupViewBase
*/
public
onClickOk
():
void
{
this
.
$emit
(
'viewdataschange'
,
this
.
viewSelections
);
this
.
$emit
(
'close'
,
null
);
}
/**
* 取消
*
* @memberof IBZPostPickupViewBase
*/
public
onClickCancel
():
void
{
this
.
$emit
(
'close'
,
null
);
}
}
</
script
>
<
style
lang=
'less'
>
@import './ibzpost-pickup-view.less';
</
style
>
\ No newline at end of file
app_web/src/pages/ou/ibzpost-pickup-view/ibzpost-pickup-view.less
0 → 100644
浏览文件 @
6cf4afbe
.ibzpost-pickup-view{
position: relative;
}
.pickup-view {
>.pickupviewpanel {
flex-grow: 1;
display: flex;
justify-content: flex-end;
height: calc(100% - 64px);
}
>.footer {
height: 64px;
}
}
\ No newline at end of file
app_web/src/pages/ou/ibzpost-pickup-view/ibzpost-pickup-view.vue
0 → 100644
浏览文件 @
6cf4afbe
<
script
lang=
'tsx'
>
import
{
Component
}
from
'vue-property-decorator'
;
import
IBZPostPickupViewBase
from
'./ibzpost-pickup-view-base.vue'
;
import
view_pickupviewpanel
from
'@widgets/ibzpost/pickup-viewpickupviewpanel-pickupviewpanel/pickup-viewpickupviewpanel-pickupviewpanel.vue'
;
@
Component
({
components
:
{
view_pickupviewpanel
,
},
beforeRouteEnter
:
(
to
:
any
,
from
:
any
,
next
:
any
)
=>
{
next
((
vm
:
any
)
=>
{
if
(
!
Object
.
is
(
vm
.
navModel
,
"route"
)){
vm
.
initNavDataWithTab
(
vm
.
viewCacheData
);
}
vm
.
$store
.
commit
(
'addCurPageViewtag'
,
{
fullPath
:
to
.
fullPath
,
viewtag
:
vm
.
viewtag
});
});
},
})
export
default
class
IBZPostPickupView
extends
IBZPostPickupViewBase
{
}
</
script
>
\ No newline at end of file
app_web/src/pages/ou/ouindex-view/router.ts
浏览文件 @
6cf4afbe
...
...
@@ -1173,6 +1173,19 @@ const router = new Router({
...
indexRoutes
,
],
},
{
path
:
'/ibzposts/:ibzpost?/pickupview/:pickupview?'
,
meta
:
{
caption
:
'entities.ibzpost.views.pickupview.title'
,
info
:
''
,
parameters
:
[
{
pathName
:
'ibzposts'
,
parameterName
:
'ibzpost'
},
{
pathName
:
'pickupview'
,
parameterName
:
'pickupview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/ou/ibzpost-pickup-view/ibzpost-pickup-view.vue'
),
},
{
path
:
'/ibzorganizations/:ibzorganization?/editview/:editview?'
,
meta
:
{
...
...
@@ -1465,6 +1478,19 @@ const router = new Router({
},
component
:
()
=>
import
(
'@pages/ou/ibzteam-grid-view/ibzteam-grid-view.vue'
),
},
{
path
:
'/ibzposts/:ibzpost?/pickupgridview/:pickupgridview?'
,
meta
:
{
caption
:
'entities.ibzpost.views.pickupgridview.title'
,
info
:
''
,
parameters
:
[
{
pathName
:
'ibzposts'
,
parameterName
:
'ibzpost'
},
{
pathName
:
'pickupgridview'
,
parameterName
:
'pickupgridview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/ou/ibzpost-pickup-grid-view/ibzpost-pickup-grid-view.vue'
),
},
{
path
:
'/ibzorganizations/:ibzorganization?/pickupgridview/:pickupgridview?'
,
meta
:
{
...
...
app_web/src/store/modules/view-action/state.ts
浏览文件 @
6cf4afbe
...
...
@@ -3,6 +3,16 @@
*/
export
const
viewstate
:
any
=
{
appviews
:
[
{
viewtag
:
'0581848a24a829f706252c15c641e154'
,
viewmodule
:
'ou'
,
viewname
:
'IBZPostPickupView'
,
viewaction
:
''
,
viewdatachange
:
false
,
refviews
:
[
'395d443de520bbaee17c18ea0747abce'
,
],
},
{
viewtag
:
'12cffa053a1d3e22ab397b1164338cfb'
,
viewmodule
:
'ou'
,
...
...
@@ -89,6 +99,15 @@ export const viewstate: any = {
'7eef7d5d59785f49c66786ad4ba827b0'
,
],
},
{
viewtag
:
'395d443de520bbaee17c18ea0747abce'
,
viewmodule
:
'ou'
,
viewname
:
'IBZPostPickupGridView'
,
viewaction
:
''
,
viewdatachange
:
false
,
refviews
:
[
],
},
{
viewtag
:
'4c3fc434585ac656b753c26c1f10482b'
,
viewmodule
:
'ou'
,
...
...
app_web/src/widgets/ibzpost/pickup-viewpickupviewpanel-pickupviewpanel/pickup-viewpickupviewpanel-pickupviewpanel-base.vue
0 → 100644
浏览文件 @
6cf4afbe
<
template
>
<div
class=
'pickupviewpanel'
>
<component
v-if=
"inited && view.viewname && !Object.is(view.viewname, '')"
:is=
"view.viewname"
class=
"viewcontainer3"
:viewdata=
"viewdata"
:viewparam=
"viewparam"
:viewDefaultUsage=
"false"
:isSingleSelect=
"isSingleSelect"
:selectedData=
"selectedData"
:isShowButton=
"isShowButton"
@
viewdataschange=
"onViewDatasChange"
@
viewdatasactivated=
"viewDatasActivated"
@
viewload=
"onViewLoad"
>
</component>
</div>
</
template
>
<
script
lang=
'tsx'
>
import
{
Vue
,
Component
,
Prop
,
Provide
,
Emit
,
Watch
,
Model
,
Inject
}
from
'vue-property-decorator'
;
import
{
CreateElement
}
from
'vue'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
{
ControlInterface
}
from
'@/interface/control'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
NavDataService
from
'@/service/app/navdata-service'
;
import
IBZPostService
from
'@/service/ibzpost/ibzpost-service'
;
import
PickupViewpickupviewpanelService
from
'./pickup-viewpickupviewpanel-pickupviewpanel-service'
;
import
PickupViewpickupviewpanelModel
from
'./pickup-viewpickupviewpanel-pickupviewpanel-model'
;
@
Component
({
components
:
{
}
})
export
default
class
PickupViewpickupviewpanelBase
extends
Vue
implements
ControlInterface
{
/**
* 名称
*
* @type {string}
* @memberof PickupViewpickupviewpanelBase
*/
@
Prop
()
public
name
?:
string
;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof PickupViewpickupviewpanelBase
*/
@
Prop
()
public
viewState
!
:
Subject
<
ViewState
>
;
/**
* 应用上下文
*
* @type {*}
* @memberof PickupViewpickupviewpanelBase
*/
@
Prop
()
public
context
:
any
;
/**
* 视图参数
*
* @type {*}
* @memberof PickupViewpickupviewpanelBase
*/
@
Prop
()
public
viewparams
:
any
;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof PickupViewpickupviewpanelBase
*/
public
viewStateEvent
:
Subscription
|
undefined
;
/**
* 获取部件类型
*
* @returns {string}
* @memberof PickupViewpickupviewpanelBase
*/
public
getControlType
():
string
{
return
'PICKUPVIEWPANEL'
}
/**
* 建构部件服务对象
*
* @type {PickupViewpickupviewpanelService}
* @memberof PickupViewpickupviewpanelBase
*/
public
service
:
PickupViewpickupviewpanelService
=
new
PickupViewpickupviewpanelService
({
$store
:
this
.
$store
});
/**
* 实体服务对象
*
* @type {IBZPostService}
* @memberof PickupViewpickupviewpanelBase
*/
public
appEntityService
:
IBZPostService
=
new
IBZPostService
({
$store
:
this
.
$store
});
/**
* 关闭视图
*
* @param {any} args
* @memberof PickupViewpickupviewpanelBase
*/
public
closeView
(
args
:
any
):
void
{
let
_this
:
any
=
this
;
_this
.
$emit
(
'closeview'
,
[
args
]);
}
/**
* 计数器刷新
*
* @memberof PickupViewpickupviewpanelBase
*/
public
counterRefresh
(){
const
_this
:
any
=
this
;
if
(
_this
.
counterServiceArray
&&
_this
.
counterServiceArray
.
length
>
0
){
_this
.
counterServiceArray
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
refreshData
&&
item
.
refreshData
instanceof
Function
){
item
.
refreshData
();
}
})
}
}
/**
* 选中数据字符串
*
* @type {string}
* @memberof PickupViewpickupviewpanelBase
*/
@
Prop
()
public
selectedData
?:
string
;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof PickupViewpickupviewpanelBase
*/
public
getDatas
():
any
[]
{
return
[];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof PickupViewpickupviewpanelBase
*/
public
getData
():
any
{
return
{};
}
/**
* 视图名称
*
* @type {*}
* @memberof PickupViewpickupviewpanelBase
*/
public
view
:
any
=
{
viewname
:
'ibzpost-pickup-grid-view'
,
data
:
{},
}
/**
* 局部上下文
*
* @type {*}
* @memberof PickupViewpickupviewpanelBase
*/
public
localContext
:
any
=
null
;
/**
* 局部视图参数
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public
localViewParam
:
any
=
null
;
/**
* 视图数据
*
* @type {*}
* @memberof PickupViewpickupviewpanelBase
*/
public
viewdata
:
string
=
JSON
.
stringify
(
this
.
context
);
/**
* 视图参数
*
* @type {*}
* @memberof PickupViewpickupviewpanel
*/
public
viewparam
:
string
=
JSON
.
stringify
(
this
.
viewparams
);
/**
* 是否显示按钮
*
* @type {boolean}
* @memberof PickupViewpickupviewpanelBase
*/
@
Prop
({
default
:
true
})
public
isShowButton
!
:
boolean
;
/**
* 是否单选
*
* @type {boolean}
* @memberof PickupViewpickupviewpanelBase
*/
@
Prop
()
public
isSingleSelect
?:
boolean
;
/**
* 初始化完成
*
* @type {boolean}
* @memberof PickupViewpickupviewpanelBase
*/
public
inited
:
boolean
=
false
;
/**
* 视图数据变化
*
* @param {*} $event
* @memberof PickupViewpickupviewpanelBase
*/
public
onViewDatasChange
(
$event
:
any
):
void
{
if
(
$event
.
length
>
0
){
$event
.
forEach
((
item
:
any
,
index
:
any
)
=>
{
let
srfmajortext
=
item
[
'postname'
];
if
(
srfmajortext
){
Object
.
assign
(
$event
[
index
],{
srfmajortext
:
srfmajortext
});
}
});
}
this
.
$emit
(
'selectionchange'
,
$event
);
}
/**
* 视图数据被激活
*
* @param {*} $event
* @memberof PickupViewpickupviewpanelBase
*/
public
viewDatasActivated
(
$event
:
any
):
void
{
this
.
$emit
(
'activated'
,
$event
);
}
/**
* 视图加载完成
*
* @param {*} $event
* @memberof PickupViewpickupviewpanelBase
*/
public
onViewLoad
(
$event
:
any
):
void
{
this
.
$emit
(
'load'
,
$event
);
}
/**
* vue 生命周期
*
* @memberof PickupViewpickupviewpanelBase
*/
public
created
()
{
this
.
afterCreated
();
}
/**
* 执行created后的逻辑
*
* @memberof PickupViewpickupviewpanelBase
*/
public
afterCreated
(){
this
.
initNavParam
();
if
(
this
.
viewState
)
{
this
.
viewStateEvent
=
this
.
viewState
.
subscribe
(({
tag
,
action
,
data
})
=>
{
if
(
!
Object
.
is
(
tag
,
this
.
name
))
{
return
;
}
if
(
Object
.
is
(
'load'
,
action
))
{
this
.
viewdata
=
JSON
.
stringify
(
this
.
context
);
this
.
viewparam
=
JSON
.
stringify
(
Object
.
assign
(
data
,
this
.
viewparams
));
this
.
inited
=
true
;
}
});
}
}
/**
* 初始化导航参数
*
* @memberof PickupViewpickupviewpanelBase
*/
public
initNavParam
(){
if
(
this
.
localContext
&&
Object
.
keys
(
this
.
localContext
).
length
>
0
){
let
_context
:
any
=
this
.
$util
.
computedNavData
({},
this
.
context
,
this
.
viewparams
,
this
.
localContext
);
Object
.
assign
(
this
.
context
,
_context
);
}
if
(
this
.
localViewParam
&&
Object
.
keys
(
this
.
localViewParam
).
length
>
0
){
let
_param
:
any
=
this
.
$util
.
computedNavData
({},
this
.
context
,
this
.
viewparams
,
this
.
localViewParam
);
Object
.
assign
(
this
.
viewparams
,
_param
);
}
this
.
viewdata
=
JSON
.
stringify
(
this
.
context
);
this
.
viewparam
=
JSON
.
stringify
(
this
.
viewparams
);
}
/**
* vue 生命周期
*
* @memberof PickupViewpickupviewpanelBase
*/
public
destroyed
()
{
this
.
afterDestroy
();
}
/**
* 执行destroyed后的逻辑
*
* @memberof PickupViewpickupviewpanelBase
*/
public
afterDestroy
()
{
if
(
this
.
viewStateEvent
)
{
this
.
viewStateEvent
.
unsubscribe
();
}
}
}
</
script
>
<
style
lang=
'less'
>
@import './pickup-viewpickupviewpanel-pickupviewpanel.less';
</
style
>
\ No newline at end of file
app_web/src/widgets/ibzpost/pickup-viewpickupviewpanel-pickupviewpanel/pickup-viewpickupviewpanel-pickupviewpanel-model.ts
0 → 100644
浏览文件 @
6cf4afbe
/**
* PickupViewpickupviewpanel 部件模型
*
* @export
* @class PickupViewpickupviewpanelModel
*/
export
default
class
PickupViewpickupviewpanelModel
{
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof PickupViewpickupviewpanelModel
*/
public
getDataItems
():
any
[]
{
return
[
{
name
:
'ibzpost'
,
prop
:
'postid'
,
},
{
name
:
'postcode'
,
},
{
name
:
'postname'
,
},
{
name
:
'domains'
,
},
{
name
:
'memo'
,
},
]
}
}
\ No newline at end of file
app_web/src/widgets/ibzpost/pickup-viewpickupviewpanel-pickupviewpanel/pickup-viewpickupviewpanel-pickupviewpanel-service.ts
0 → 100644
浏览文件 @
6cf4afbe
import
{
Http
}
from
'@/utils'
;
import
ControlService
from
'@/widgets/control-service'
;
/**
* PickupViewpickupviewpanel 部件服务对象
*
* @export
* @class PickupViewpickupviewpanelService
*/
export
default
class
PickupViewpickupviewpanelService
extends
ControlService
{
}
\ No newline at end of file
app_web/src/widgets/ibzpost/pickup-viewpickupviewpanel-pickupviewpanel/pickup-viewpickupviewpanel-pickupviewpanel.less
0 → 100644
浏览文件 @
6cf4afbe
// this is less
.pickupviewpanel{
width: 100%;
}
\ No newline at end of file
app_web/src/widgets/ibzpost/pickup-viewpickupviewpanel-pickupviewpanel/pickup-viewpickupviewpanel-pickupviewpanel.vue
0 → 100644
浏览文件 @
6cf4afbe
<
script
lang=
'tsx'
>
import
{
Component
}
from
'vue-property-decorator'
;
import
PickupViewpickupviewpanelBase
from
'./pickup-viewpickupviewpanel-pickupviewpanel-base.vue'
;
@
Component
({
components
:
{
}
})
export
default
class
PickupViewpickupviewpanel
extends
PickupViewpickupviewpanelBase
{
}
</
script
>
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录