Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
功
功能演示系统
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
示例
功能演示系统
提交
0557abf9
提交
0557abf9
编写于
12月 03, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ShineKOT 发布系统代码 [后台服务,演示应用]
上级
82d506f2
变更
20
隐藏空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
2573 行增加
和
8 行删除
+2573
-8
view-config.json
app_Web/public/assets/json/view-config.json
+8
-0
ibizbook_en_US.ts
...Web/src/locale/lanres/entities/ibizbook/ibizbook_en_US.ts
+13
-0
ibizbook_zh_CN.ts
...Web/src/locale/lanres/entities/ibizbook/ibizbook_zh_CN.ts
+13
-0
viewconfig.ts
app_Web/src/mock/viewconfig/viewconfig.ts
+8
-0
ibizbookpickup-tree-view-base.vue
...bizbookpickup-tree-view/ibizbookpickup-tree-view-base.vue
+703
-0
ibizbookpickup-tree-view.less
...le/ibizbookpickup-tree-view/ibizbookpickup-tree-view.less
+17
-0
ibizbookpickup-tree-view.vue
...ple/ibizbookpickup-tree-view/ibizbookpickup-tree-view.vue
+22
-0
page-register.ts
app_Web/src/pages/sample/index/page-register.ts
+1
-0
router.ts
app_Web/src/pages/sample/index/router.ts
+27
-0
ibizbook-service-base.ts
app_Web/src/service/ibizbook/ibizbook-service-base.ts
+1
-0
init-data-logic-base.ts
app_Web/src/service/ibizbook/init-data-logic-base.ts
+83
-0
init-data-logic.ts
app_Web/src/service/ibizbook/init-data-logic.ts
+22
-0
state.ts
app_Web/src/store/modules/view-action/state.ts
+10
-0
ibizbook-ui-service-base.ts
app_Web/src/uiservice/ibizbook/ibizbook-ui-service-base.ts
+1
-0
book-type-select-treeview-base.vue
...k-type-select-treeview/book-type-select-treeview-base.vue
+909
-0
book-type-select-treeview-model.ts
...k-type-select-treeview/book-type-select-treeview-model.ts
+79
-0
book-type-select-treeview-service.ts
...type-select-treeview/book-type-select-treeview-service.ts
+589
-0
book-type-select-treeview.less
.../book-type-select-treeview/book-type-select-treeview.less
+36
-0
book-type-select-treeview.vue
...k/book-type-select-treeview/book-type-select-treeview.vue
+14
-0
inter-func-form-2-form-base.vue
...ok/inter-func-form-2-form/inter-func-form-2-form-base.vue
+17
-8
未找到文件。
app_Web/public/assets/json/view-config.json
浏览文件 @
0557abf9
...
@@ -1111,6 +1111,14 @@
...
@@ -1111,6 +1111,14 @@
"viewname"
:
"IBIZBOOKEditView"
,
"viewname"
:
"IBIZBOOKEditView"
,
"viewtag"
:
"b3429ecc4d89a02bc5f5279f1bd7f620"
"viewtag"
:
"b3429ecc4d89a02bc5f5279f1bd7f620"
},
},
"ibizbookpickuptreeview"
:
{
"title"
:
"图书选择树视图"
,
"caption"
:
"图书"
,
"viewtype"
:
"DEPICKUPTREEVIEW"
,
"viewmodule"
:
"Sample"
,
"viewname"
:
"IBIZBOOKPickupTreeView"
,
"viewtag"
:
"b3a27af7c6e3cea3b600057793da2bd1"
},
"ibizorderdetailsgridview9"
:
{
"ibizorderdetailsgridview9"
:
{
"title"
:
"订单明细表格视图"
,
"title"
:
"订单明细表格视图"
,
"caption"
:
"订单明细"
,
"caption"
:
"订单明细"
,
...
...
app_Web/src/locale/lanres/entities/ibizbook/ibizbook_en_US.ts
浏览文件 @
0557abf9
...
@@ -130,6 +130,10 @@ export default {
...
@@ -130,6 +130,10 @@ export default {
caption
:
"图书"
,
caption
:
"图书"
,
title
:
"图书编辑视图"
,
title
:
"图书编辑视图"
,
},
},
pickuptreeview
:
{
caption
:
"图书"
,
title
:
"图书选择树视图"
,
},
roweditgridview
:
{
roweditgridview
:
{
caption
:
"表格行编辑"
,
caption
:
"表格行编辑"
,
title
:
"表格行编辑"
,
title
:
"表格行编辑"
,
...
@@ -1494,6 +1498,15 @@ export default {
...
@@ -1494,6 +1498,15 @@ export default {
},
},
haspanellistviewtoolbar_toolbar
:
{
haspanellistviewtoolbar_toolbar
:
{
},
},
booktypeselect_treeview
:
{
nodata
:
""
,
nodes
:
{
ibizbooktype
:
"图书类型"
,
root
:
"默认根节点"
,
},
uiactions
:
{
},
},
tree_treeview
:
{
tree_treeview
:
{
nodata
:
""
,
nodata
:
""
,
nodes
:
{
nodes
:
{
...
...
app_Web/src/locale/lanres/entities/ibizbook/ibizbook_zh_CN.ts
浏览文件 @
0557abf9
...
@@ -129,6 +129,10 @@ export default {
...
@@ -129,6 +129,10 @@ export default {
caption
:
"图书"
,
caption
:
"图书"
,
title
:
"图书编辑视图"
,
title
:
"图书编辑视图"
,
},
},
pickuptreeview
:
{
caption
:
"图书"
,
title
:
"图书选择树视图"
,
},
roweditgridview
:
{
roweditgridview
:
{
caption
:
"表格行编辑"
,
caption
:
"表格行编辑"
,
title
:
"表格行编辑"
,
title
:
"表格行编辑"
,
...
@@ -1493,6 +1497,15 @@ export default {
...
@@ -1493,6 +1497,15 @@ export default {
},
},
haspanellistviewtoolbar_toolbar
:
{
haspanellistviewtoolbar_toolbar
:
{
},
},
booktypeselect_treeview
:
{
nodata
:
""
,
nodes
:
{
ibizbooktype
:
"图书类型"
,
root
:
"默认根节点"
,
},
uiactions
:
{
},
},
tree_treeview
:
{
tree_treeview
:
{
nodata
:
""
,
nodata
:
""
,
nodes
:
{
nodes
:
{
...
...
app_Web/src/mock/viewconfig/viewconfig.ts
浏览文件 @
0557abf9
...
@@ -1119,6 +1119,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
...
@@ -1119,6 +1119,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname"
:
"IBIZBOOKEditView"
,
"viewname"
:
"IBIZBOOKEditView"
,
"viewtag"
:
"b3429ecc4d89a02bc5f5279f1bd7f620"
"viewtag"
:
"b3429ecc4d89a02bc5f5279f1bd7f620"
},
},
"ibizbookpickuptreeview"
:
{
"title"
:
"图书选择树视图"
,
"caption"
:
"图书"
,
"viewtype"
:
"DEPICKUPTREEVIEW"
,
"viewmodule"
:
"Sample"
,
"viewname"
:
"IBIZBOOKPickupTreeView"
,
"viewtag"
:
"b3a27af7c6e3cea3b600057793da2bd1"
},
"ibizorderdetailsgridview9"
:
{
"ibizorderdetailsgridview9"
:
{
"title"
:
"订单明细表格视图"
,
"title"
:
"订单明细表格视图"
,
"caption"
:
"订单明细"
,
"caption"
:
"订单明细"
,
...
...
app_Web/src/pages/sample/ibizbookpickup-tree-view/ibizbookpickup-tree-view-base.vue
0 → 100644
浏览文件 @
0557abf9
<
template
>
<div
class=
'view-container depickuptreeview ibizbookpickup-tree-view'
>
<app-studioaction
:viewTitle=
"$t(model.srfCaption)"
viewName=
"ibizbookpickuptreeview"
></app-studioaction>
<card
class=
'view-card view-no-caption view-no-toolbar'
:dis-hover=
"true"
:bordered=
"false"
>
<div
class=
'content-container'
>
<div
class=
"tree-contant"
>
<view
_tree
:viewState=
"viewState"
:viewparams=
"viewparams"
:context=
"context"
:showBusyIndicator=
"true"
updateAction=
'Update'
removeAction=
'Remove'
loadAction=
'Get'
createAction=
'Create'
:isSingleSelect=
"isSingleSelect"
:selectedData=
"selectedData"
@
nodedblclick=
"tree_nodedblclick($event)"
name=
"tree"
ref=
'tree'
@
selectionchange=
"tree_selectionchange($event)"
@
load=
"tree_load($event)"
@
closeview=
"closeView($event)"
>
</view
_tree
>
</div>
</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
IBIZBOOKService
from
'@/service/ibizbook/ibizbook-service'
;
import
IBIZBOOKAuthService
from
'@/authservice/ibizbook/ibizbook-auth-service'
;
import
PickupTreeViewEngine
from
'@engine/view/pickup-tree-view-engine'
;
import
IBIZBOOKUIService
from
'@/uiservice/ibizbook/ibizbook-ui-service'
;
@
Component
({
components
:
{
},
})
export
default
class
IBIZBOOKPickupTreeViewBase
extends
Vue
{
/**
* 实体服务对象
*
* @type {IBIZBOOKService}
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
appEntityService
:
IBIZBOOKService
=
new
IBIZBOOKService
;
/**
* 实体UI服务对象
*
* @type IBIZBOOKUIService
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
appUIService
:
IBIZBOOKUIService
=
new
IBIZBOOKUIService
(
this
.
$store
);
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof IBIZBOOKPickupTreeViewBase
*/
@
Emit
()
public
viewDatasChange
(
val
:
any
):
any
{
return
val
;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof IBIZBOOKPickupTreeViewBase
*/
@
Prop
()
public
viewdata
!
:
string
;
/**
* 传入视图参数
*
* @type {string}
* @memberof IBIZBOOKPickupTreeViewBase
*/
@
Prop
()
public
viewparam
!
:
string
;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof IBIZBOOKPickupTreeViewBase
*/
@
Prop
({
default
:
true
})
public
viewDefaultUsage
!
:
boolean
;
/**
* 视图默认使用
*
* @type {string}
* @memberof IBIZBOOKPickupTreeViewBase
*/
@
Inject
({
from
:
'navModel'
,
default
:
'tab'
})
public
navModel
!
:
string
;
/**
* 视图标识
*
* @type {string}
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
viewtag
:
string
=
'b3a27af7c6e3cea3b600057793da2bd1'
;
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
customViewNavContexts
:
any
=
{
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
customViewParams
:
any
=
{
};
/**
* 视图模型数据
*
* @type {*}
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
model
:
any
=
{
srfCaption
:
'entities.ibizbook.views.pickuptreeview.caption'
,
srfTitle
:
'entities.ibizbook.views.pickuptreeview.title'
,
srfSubTitle
:
'entities.ibizbook.views.pickuptreeview.subtitle'
,
dataInfo
:
''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof IBIZBOOKPickupTreeViewBase
*/
@
Watch
(
'viewparam'
,{
immediate
:
true
,
deep
:
true
})
onParamData
(
newVal
:
any
,
oldVal
:
any
)
{
if
(
newVal
){
this
.
viewparams
=
{};
if
(
typeof
newVal
==
'string'
)
{
Object
.
assign
(
this
.
viewparams
,
JSON
.
parse
(
this
.
viewparam
));
}
else
{
this
.
viewparams
=
Util
.
deepCopy
(
this
.
viewparam
);
}
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof IBIZBOOKPickupTreeViewBase
*/
@
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
();
});
}
else
if
(
!
Object
.
is
(
newVal
,
oldVal
)
&&
_this
.
refresh
&&
_this
.
refresh
instanceof
Function
)
{
_this
.
refresh
();
}
}
/**
* 容器模型
*
* @type {*}
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
containerModel
:
any
=
{
view_tree
:
{
name
:
'tree'
,
type
:
'TREEVIEW'
},
};
/**
* 视图刷新
*
* @param {*} args
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
refresh
(
args
?:
any
):
void
{
const
refs
:
any
=
this
.
$refs
;
if
(
refs
&&
refs
.
tree
)
{
refs
.
tree
.
refresh
();
}
}
/**
* 计数器刷新
*
* @memberof IBIZBOOKPickupTreeViewBase
*/
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 IBIZBOOKPickupTreeViewBase
*/
public
viewState
:
Subject
<
ViewState
>
=
new
Subject
();
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
engine
:
PickupTreeViewEngine
=
new
PickupTreeViewEngine
();
/**
* 引擎初始化
*
* @public
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
engineInit
():
void
{
this
.
engine
.
init
({
view
:
this
,
tree
:
this
.
$refs
.
tree
,
keyPSDEField
:
'ibizbook'
,
majorPSDEField
:
'ibizbookname'
,
isLoadDefault
:
true
,
});
}
/**
* 应用导航服务
*
* @type {*}
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
navDataService
=
NavDataService
.
getInstance
(
this
.
$store
);
/**
* 导航服务事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
serviceStateEvent
:
Subscription
|
undefined
;
/**
* 门户部件状态对象
*
* @type {*}
* @memberof IBIZBOOKPickupTreeViewBase
*/
@
Prop
()
public
portletState
?:
any
;
/**
* 门户部件状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
portletStateEvent
:
Subscription
|
undefined
;
/**
* 应用上下文
*
* @type {*}
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
context
:
any
=
{};
/**
* 视图参数
*
* @type {*}
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
viewparams
:
any
=
{};
/**
* 视图缓存数据
*
* @type {*}
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
viewCacheData
:
any
;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
counterServiceArray
:
Array
<
any
>
=
[];
/**
* 解析视图参数
*
* @public
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
parseViewParam
(
inputvalue
:
any
=
null
):
void
{
for
(
let
key
in
this
.
context
){
delete
this
.
context
[
key
];
}
if
(
this
.
$store
.
getters
.
getAppData
()
&&
this
.
$store
.
getters
.
getAppData
().
context
){
Object
.
assign
(
this
.
context
,
this
.
$store
.
getters
.
getAppData
().
context
);
}
if
(
!
this
.
viewDefaultUsage
&&
this
.
viewdata
&&
!
Object
.
is
(
this
.
viewdata
,
''
))
{
if
(
typeof
this
.
viewdata
==
'string'
)
{
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
});
}
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
,{
'ibizbook'
:
inputvalue
});
}
//初始化视图唯一标识
Object
.
assign
(
this
.
context
,{
srfsessionid
:
this
.
$util
.
createUUID
()});
this
.
handleCustomViewData
();
//初始化导航数据
this
.
initNavDataWithRoute
();
}
/**
* 处理自定义视图数据
*
* @memberof IBIZBOOKPickupTreeViewBase
*/
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 IBIZBOOKPickupTreeViewBase
*/
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
()]
!=
null
){
Object
.
defineProperty
(
tempData
,
item
.
toLowerCase
(),
{
value
:
this
.
context
[(
curNavData
.
value
).
toLowerCase
()],
writable
:
true
,
enumerable
:
true
,
configurable
:
true
});
}
else
{
if
(
this
.
viewparams
[(
curNavData
.
value
).
toLowerCase
()]
!=
null
){
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 IBIZBOOKPickupTreeViewBase
*/
public
initNavDataWithRoute
(
data
:
any
=
null
,
isNew
:
boolean
=
false
,
isAlways
:
boolean
=
false
){
if
(
isAlways
||
(
this
.
viewDefaultUsage
&&
Object
.
is
(
this
.
navModel
,
"route"
))
){
this
.
navDataService
.
addNavData
({
id
:
'ibizbookpickup-tree-view'
,
tag
:
this
.
viewtag
,
srfkey
:
isNew
?
null
:
this
.
context
.
ibizbook
,
title
:
this
.
$t
(
this
.
model
.
srfCaption
),
data
:
data
,
context
:
this
.
context
,
viewparams
:
this
.
viewparams
,
path
:
this
.
$route
.
fullPath
});
}
}
/**
* 初始化导航数据(分页模式)
*
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
initNavDataWithTab
(
data
:
any
=
null
,
isOnlyAdd
:
boolean
=
true
,
isAlways
:
boolean
=
false
){
if
(
isAlways
||
(
this
.
viewDefaultUsage
&&
!
Object
.
is
(
this
.
navModel
,
"route"
))
){
this
.
navDataService
.
addNavDataByOnly
({
id
:
'ibizbookpickup-tree-view'
,
tag
:
this
.
viewtag
,
srfkey
:
this
.
context
.
ibizbook
,
title
:
this
.
$t
(
this
.
model
.
srfCaption
),
data
:
data
,
context
:
this
.
context
,
viewparams
:
this
.
viewparams
,
path
:
this
.
$route
.
fullPath
},
isOnlyAdd
);
}
}
/**
* Vue声明周期
*
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
created
()
{
this
.
afterCreated
();
}
/**
* 执行created后的逻辑
*
* @memberof IBIZBOOKPickupTreeViewBase
*/
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
,
'ibizbookpickup-tree-view'
)){
return
;
}
if
(
Object
.
is
(
action
,
'viewrefresh'
))
{
_this
.
$nextTick
(()
=>
{
_this
.
parseViewParam
(
data
);
if
(
_this
.
engine
){
_this
.
engine
.
load
();
}
});
}
});
if
(
_this
.
portletState
){
_this
.
portletStateEvent
=
_this
.
portletState
.
subscribe
((
res
:
any
)
=>
{
if
(
!
Object
.
is
(
res
.
name
,
'IBIZBOOKPickupTreeView'
)){
return
;
}
if
(
Object
.
is
(
res
.
action
,
'refresh'
)
&&
_this
.
refresh
&&
_this
.
refresh
instanceof
Function
){
_this
.
refresh
();
}
})
}
}
/**
* 销毁之前
*
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
beforeDestroy
()
{
this
.
$store
.
commit
(
'viewaction/removeView'
,
this
.
viewtag
);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
mounted
()
{
this
.
afterMounted
();
}
/**
* 执行mounted后的逻辑
*
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
afterMounted
(){
const
_this
:
any
=
this
;
_this
.
engineInit
();
if
(
_this
.
loadModel
&&
_this
.
loadModel
instanceof
Function
)
{
_this
.
loadModel
();
}
}
/**
* tree 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
tree_selectionchange
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'tree'
,
'selectionchange'
,
$event
);
}
/**
* tree 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
tree_load
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'tree'
,
'load'
,
$event
);
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof IBIZBOOKPickupTreeViewBase
*/
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 IBIZBOOKPickupTreeViewBase
*/
public
destroyed
(){
this
.
afterDestroyed
();
}
/**
* 执行destroyed后的逻辑
*
* @memberof IBIZBOOKPickupTreeViewBase
*/
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
();
}
}
// 销毁计数器定时器
if
(
this
.
counterServiceArray
&&
this
.
counterServiceArray
.
length
>
0
){
this
.
counterServiceArray
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
destroyCounter
&&
item
.
destroyCounter
instanceof
Function
){
item
.
destroyCounter
();
}
})
}
if
(
this
.
portletStateEvent
){
this
.
portletStateEvent
.
unsubscribe
();
}
}
/**
* 选中数据字符串
*
* @type {string}
* @memberof IBIZBOOKPickupTreeViewBase
*/
@
Prop
()
public
selectedData
?:
string
;
/**
* 是否单选
*
* @type {boolean}
* @memberof IBIZBOOKPickupTreeViewBase
*/
@
Prop
()
public
isSingleSelect
?:
boolean
;
/**
* 是否显示按钮
*
* @type {boolean}
* @memberof IBIZBOOKPickupTreeViewBase
*/
@
Prop
({
default
:
true
})
public
isShowButton
!
:
boolean
;
/**
* 节点过滤值
*
* @type {string}
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
srfnodefilter
:
string
=
''
;
/**
* 快速搜索
*
* @returns {void}
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
onSearch
():
void
{
if
(
!
this
.
viewState
)
{
return
;
}
this
.
viewState
.
next
({
tag
:
'tree'
,
action
:
'filter'
,
data
:
{
srfnodefilter
:
this
.
srfnodefilter
}
});
}
/**
* tree 部件 nodedblclick 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKPickupTreeViewBase
*/
public
tree_nodedblclick
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'tree'
,
'nodedblclick'
,
$event
);
}
}
</
script
>
<
style
lang=
'less'
>
@import './ibizbookpickup-tree-view.less';
</
style
>
\ No newline at end of file
app_Web/src/pages/sample/ibizbookpickup-tree-view/ibizbookpickup-tree-view.less
0 → 100644
浏览文件 @
0557abf9
.ibizbookpickup-tree-view{
position: relative;
}
.search-contant {
height: 40px;
.ivu-input-wrapper {
max-width: 400px;
padding-top: 6px;
}
}
.tree-contant {
height: 100%;
margin: 0px 0px 16px 0;
overflow: auto;
}
\ No newline at end of file
app_Web/src/pages/sample/ibizbookpickup-tree-view/ibizbookpickup-tree-view.vue
0 → 100644
浏览文件 @
0557abf9
<
script
lang=
'tsx'
>
import
{
Component
}
from
'vue-property-decorator'
;
import
IBIZBOOKPickupTreeViewBase
from
'./ibizbookpickup-tree-view-base.vue'
;
import
view_tree
from
'@widgets/ibizbook/book-type-select-treeview/book-type-select-treeview.vue'
;
@
Component
({
components
:
{
view_tree
,
},
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
IBIZBOOKPickupTreeView
extends
IBIZBOOKPickupTreeViewBase
{
}
</
script
>
\ No newline at end of file
app_Web/src/pages/sample/index/page-register.ts
浏览文件 @
0557abf9
...
@@ -133,6 +133,7 @@ export const PageComponents = {
...
@@ -133,6 +133,7 @@ export const PageComponents = {
Vue
.
component
(
'ibizorder-detail-f6-edit-view'
,
()
=>
import
(
'@pages/sample/ibizorder-detail-f6-edit-view/ibizorder-detail-f6-edit-view.vue'
));
Vue
.
component
(
'ibizorder-detail-f6-edit-view'
,
()
=>
import
(
'@pages/sample/ibizorder-detail-f6-edit-view/ibizorder-detail-f6-edit-view.vue'
));
Vue
.
component
(
'ibizbookusr4-grid-view'
,
()
=>
import
(
'@pages/sample/ibizbookusr4-grid-view/ibizbookusr4-grid-view.vue'
));
Vue
.
component
(
'ibizbookusr4-grid-view'
,
()
=>
import
(
'@pages/sample/ibizbookusr4-grid-view/ibizbookusr4-grid-view.vue'
));
Vue
.
component
(
'ibizbookusr2-medit-view9'
,
()
=>
import
(
'@pages/sample/ibizbookusr2-medit-view9/ibizbookusr2-medit-view9.vue'
));
Vue
.
component
(
'ibizbookusr2-medit-view9'
,
()
=>
import
(
'@pages/sample/ibizbookusr2-medit-view9/ibizbookusr2-medit-view9.vue'
));
Vue
.
component
(
'ibizbookpickup-tree-view'
,
()
=>
import
(
'@pages/sample/ibizbookpickup-tree-view/ibizbookpickup-tree-view.vue'
));
Vue
.
component
(
'ibizorder-sedit-view3'
,
()
=>
import
(
'@pages/sample/ibizorder-sedit-view3/ibizorder-sedit-view3.vue'
));
Vue
.
component
(
'ibizorder-sedit-view3'
,
()
=>
import
(
'@pages/sample/ibizorder-sedit-view3/ibizorder-sedit-view3.vue'
));
Vue
.
component
(
'ibizorder-odsp-d10-wfgrid-view'
,
()
=>
import
(
'@pages/sample/ibizorder-odsp-d10-wfgrid-view/ibizorder-odsp-d10-wfgrid-view.vue'
));
Vue
.
component
(
'ibizorder-odsp-d10-wfgrid-view'
,
()
=>
import
(
'@pages/sample/ibizorder-odsp-d10-wfgrid-view/ibizorder-odsp-d10-wfgrid-view.vue'
));
Vue
.
component
(
'ibizbookinternal-func-grid-view'
,
()
=>
import
(
'@pages/sample/ibizbookinternal-func-grid-view/ibizbookinternal-func-grid-view.vue'
));
Vue
.
component
(
'ibizbookinternal-func-grid-view'
,
()
=>
import
(
'@pages/sample/ibizbookinternal-func-grid-view/ibizbookinternal-func-grid-view.vue'
));
...
...
app_Web/src/pages/sample/index/router.ts
浏览文件 @
0557abf9
...
@@ -2137,6 +2137,20 @@ const router = new Router({
...
@@ -2137,6 +2137,20 @@ const router = new Router({
},
},
component
:
()
=>
import
(
'@pages/sample/ibizbookusr2-medit-view9/ibizbookusr2-medit-view9.vue'
),
component
:
()
=>
import
(
'@pages/sample/ibizbookusr2-medit-view9/ibizbookusr2-medit-view9.vue'
),
},
},
{
path
:
'ibizbooks/:ibizbook?/pickuptreeview/:pickuptreeview?'
,
meta
:
{
caption
:
'entities.ibizbook.views.pickuptreeview.caption'
,
info
:
''
,
parameters
:
[
{
pathName
:
'index'
,
parameterName
:
'index'
},
{
pathName
:
'ibizbooks'
,
parameterName
:
'ibizbook'
},
{
pathName
:
'pickuptreeview'
,
parameterName
:
'pickuptreeview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/sample/ibizbookpickup-tree-view/ibizbookpickup-tree-view.vue'
),
},
{
{
path
:
'ibizorders/:ibizorder?/seditview3/:seditview3?'
,
path
:
'ibizorders/:ibizorder?/seditview3/:seditview3?'
,
meta
:
{
meta
:
{
...
@@ -4457,6 +4471,19 @@ const router = new Router({
...
@@ -4457,6 +4471,19 @@ const router = new Router({
},
},
component
:
()
=>
import
(
'@pages/sample/ibizbookedit-view/ibizbookedit-view.vue'
),
component
:
()
=>
import
(
'@pages/sample/ibizbookedit-view/ibizbookedit-view.vue'
),
},
},
{
path
:
'/ibizbooks/:ibizbook?/pickuptreeview/:pickuptreeview?'
,
meta
:
{
caption
:
'entities.ibizbook.views.pickuptreeview.caption'
,
info
:
''
,
parameters
:
[
{
pathName
:
'ibizbooks'
,
parameterName
:
'ibizbook'
},
{
pathName
:
'pickuptreeview'
,
parameterName
:
'pickuptreeview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/sample/ibizbookpickup-tree-view/ibizbookpickup-tree-view.vue'
),
},
{
{
path
:
'/ibizorders/:ibizorder?/ibizorderdetails/:ibizorderdetail?/sgridview9/:sgridview9?'
,
path
:
'/ibizorders/:ibizorder?/ibizorderdetails/:ibizorderdetail?/sgridview9/:sgridview9?'
,
meta
:
{
meta
:
{
...
...
app_Web/src/service/ibizbook/ibizbook-service-base.ts
浏览文件 @
0557abf9
import
{
Http
,
Util
}
from
'@/utils'
;
import
{
Http
,
Util
}
from
'@/utils'
;
import
EntityService
from
'../entity-service'
;
import
EntityService
from
'../entity-service'
;
import
InitDataLogic
from
'@/service/ibizbook/init-data-logic'
;
...
...
app_Web/src/service/ibizbook/init-data-logic-base.ts
0 → 100644
浏览文件 @
0557abf9
import
{
Verify
}
from
'@/utils/verify/verify'
;
/**
* 图书初始化
*
* @export
* @class InitDataLogicBase
*/
export
default
class
InitDataLogicBase
{
/**
* 名称
*
* @memberof InitDataLogicBase
*/
private
name
:
string
=
"initData"
;
/**
* 唯一标识
*
* @memberof InitDataLogicBase
*/
private
id
:
string
=
"75C65A74-51D9-436A-AD72-3F67FAC34810"
;
/**
* 默认参数名称
*
* @memberof InitDataLogicBase
*/
private
defaultParamName
:
string
=
"Default"
;
/**
* 参数集合
*
* @memberof InitDataLogicBase
*/
private
paramsMap
:
Map
<
string
,
any
>
=
new
Map
();
/**
* Creates an instance of InitDataLogicBase.
*
* @param {*} [opts={}]
* @memberof InitDataLogicBase
*/
constructor
(
opts
:
any
=
{})
{
this
.
initParams
(
opts
);
}
/**
* 初始化参数集合
*
* @param {*} [opts={}]
* @memberof InitDataLogicBase
*/
public
initParams
(
opts
:
any
){
this
.
paramsMap
.
set
(
'Default'
,
opts
);
}
/**
* 执行逻辑
*
* @param context 应用上下文
* @param params 传入参数
*/
public
onExecute
(
context
:
any
,
params
:
any
,
isloading
:
boolean
){
return
this
.
executeBegin
(
context
,
params
,
isloading
);
}
/**
* 开始
*
* @param params 传入参数
*/
private
async
executeBegin
(
context
:
any
,
params
:
any
,
isloading
:
boolean
){
//开始节点
return
this
.
paramsMap
.
get
(
this
.
defaultParamName
).
data
;
}
}
\ No newline at end of file
app_Web/src/service/ibizbook/init-data-logic.ts
0 → 100644
浏览文件 @
0557abf9
import
{
Http
,
Util
}
from
'@/utils'
;
import
InitDataLogicBase
from
'./init-data-logic-base'
;
/**
* 图书初始化
*
* @export
* @class InitDataLogic
*/
export
default
class
InitDataLogic
extends
InitDataLogicBase
{
/**
* Creates an instance of InitDataLogic
*
* @param {*} [opts={}]
* @memberof InitDataLogic
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
}
}
\ No newline at end of file
app_Web/src/store/modules/view-action/state.ts
浏览文件 @
0557abf9
...
@@ -524,6 +524,7 @@ export const viewstate: any = {
...
@@ -524,6 +524,7 @@ export const viewstate: any = {
viewaction
:
''
,
viewaction
:
''
,
viewdatachange
:
false
,
viewdatachange
:
false
,
refviews
:
[
refviews
:
[
'b3a27af7c6e3cea3b600057793da2bd1'
,
],
],
},
},
{
{
...
@@ -1337,6 +1338,15 @@ export const viewstate: any = {
...
@@ -1337,6 +1338,15 @@ export const viewstate: any = {
refviews
:
[
refviews
:
[
],
],
},
},
{
viewtag
:
'b3a27af7c6e3cea3b600057793da2bd1'
,
viewmodule
:
'Sample'
,
viewname
:
'IBIZBOOKPickupTreeView'
,
viewaction
:
''
,
viewdatachange
:
false
,
refviews
:
[
],
},
{
{
viewtag
:
'b4db5cb272d2da535285852bc436e9de'
,
viewtag
:
'b4db5cb272d2da535285852bc436e9de'
,
viewmodule
:
'Sample'
,
viewmodule
:
'Sample'
,
...
...
app_Web/src/uiservice/ibizbook/ibizbook-ui-service-base.ts
浏览文件 @
0557abf9
...
@@ -123,6 +123,7 @@ export default class IBIZBOOKUIServiceBase extends UIService {
...
@@ -123,6 +123,7 @@ export default class IBIZBOOKUIServiceBase extends UIService {
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'listview'
,
srfappde
:
'ibizbooks'
,
component
:
'ibizbooklist-view'
});
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'listview'
,
srfappde
:
'ibizbooks'
,
component
:
'ibizbooklist-view'
});
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'customview'
,
srfappde
:
'ibizbooks'
,
component
:
'ibizbookcustom-view'
});
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'customview'
,
srfappde
:
'ibizbooks'
,
component
:
'ibizbookcustom-view'
});
this
.
allViewMap
.
set
(
'EDITVIEW:'
,{
viewname
:
'editview'
,
srfappde
:
'ibizbooks'
,
component
:
'ibizbookedit-view'
});
this
.
allViewMap
.
set
(
'EDITVIEW:'
,{
viewname
:
'editview'
,
srfappde
:
'ibizbooks'
,
component
:
'ibizbookedit-view'
});
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'pickuptreeview'
,
srfappde
:
'ibizbooks'
,
component
:
'ibizbookpickup-tree-view'
});
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'roweditgridview'
,
srfappde
:
'ibizbooks'
,
component
:
'ibizbookrow-edit-grid-view'
});
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'roweditgridview'
,
srfappde
:
'ibizbooks'
,
component
:
'ibizbookrow-edit-grid-view'
});
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'usr6gridview'
,
srfappde
:
'ibizbooks'
,
component
:
'ibizbookusr6-grid-view'
});
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'usr6gridview'
,
srfappde
:
'ibizbooks'
,
component
:
'ibizbookusr6-grid-view'
});
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'usr4dataview'
,
srfappde
:
'ibizbooks'
,
component
:
'ibizbookusr4-data-view'
});
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'usr4dataview'
,
srfappde
:
'ibizbooks'
,
component
:
'ibizbookusr4-data-view'
});
...
...
app_Web/src/widgets/ibizbook/book-type-select-treeview/book-type-select-treeview-base.vue
0 → 100644
浏览文件 @
0557abf9
<
template
>
<div
class=
"design-tree-container"
>
<context-menu-container>
<el-tree
v-if=
"inited"
ref=
"tree"
class=
"design-tree"
node-key=
"id"
lazy
:show-checkbox=
"!isSingleSelect"
:check-on-click-node=
"!isSingleSelect"
:default-expanded-keys=
"expandedKeys"
:props=
"
{
label: 'text',
isLeaf: 'leaf',
children: 'children'
}"
:load="load"
:highlight-current="true"
:expand-on-click-node="false"
@check="onCheck"
@current-change="selectionChange"
:filter-node-method="filterNode"
:empty-text="$t('entities.ibizbook.booktypeselect_treeview.nodata')"
>
<template
slot-scope=
"
{ node, data }">
<context-menu
:ref=
'data.id'
:isBlocked=
"true"
:contextMenuStyle=
"
{width: '100%'}" :data="node" :renderContent="renderContextMenu" @showContext="showContext(data,$event)">
<tooltip
transfer
style=
"width: 100%;"
max-width=
"2000"
placement=
"right"
>
<div
class=
"tree-node"
@
dblclick=
"doDefaultAction(node)"
>
<span
class=
"icon"
>
<i
v-if=
" data.iconcls && !Object.is(data.iconcls, '')"
:class=
"data.iconcls"
></i>
<img
v-else-if=
"data.icon && !Object.is(data.icon, '')"
:src=
"data.icon"
/>
<icon
v-else-if=
"isOutputIconDefault"
type=
"ios-paper-outline"
></icon>
</span>
<span
class=
"text"
>
<span
v-if=
"data.html"
v-html=
"data.html"
></span>
<span
v-else
>
{{
data
.
isUseLangRes
?
$t
(
data
.
text
)
:
data
.
text
}}
</span>
</span>
</div>
<template
slot=
"content"
>
<span
v-if=
"data.html"
v-html=
"data.html"
></span>
<span
v-else
>
{{
data
.
isUseLangRes
?
$t
(
data
.
text
)
:
data
.
text
}}
</span>
</
template
>
</tooltip>
</context-menu>
</template>
</el-tree>
</context-menu-container>
</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
,
ViewTool
}
from
'@/utils'
;
import
NavDataService
from
'@/service/app/navdata-service'
;
import
AppCenterService
from
"@service/app/app-center-service"
;
import
IBIZBOOKService
from
'@/service/ibizbook/ibizbook-service'
;
import
BookTypeSelectService
from
'./book-type-select-treeview-service'
;
import
IBIZBOOKUIService
from
'@/uiservice/ibizbook/ibizbook-ui-service'
;
import
{
Environment
}
from
'@/environments/environment'
;
import
UIService
from
'@/uiservice/ui-service'
;
@
Component
({
components
:
{
}
})
export
default
class
BookTypeSelectBase
extends
Vue
implements
ControlInterface
{
/**
* 名称
*
* @type {string}
* @memberof BookTypeSelectBase
*/
@
Prop
()
public
name
?:
string
;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof BookTypeSelectBase
*/
@
Prop
()
public
viewState
!
:
Subject
<
ViewState
>
;
/**
* 应用上下文
*
* @type {*}
* @memberof BookTypeSelectBase
*/
@
Prop
()
public
context
!
:
any
;
/**
* 视图参数
*
* @type {*}
* @memberof BookTypeSelectBase
*/
@
Prop
()
public
viewparams
!
:
any
;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof BookTypeSelectBase
*/
public
viewStateEvent
:
Subscription
|
undefined
;
/**
* 获取部件类型
*
* @returns {string}
* @memberof BookTypeSelectBase
*/
public
getControlType
():
string
{
return
'TREEVIEW'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof BookTypeSelectBase
*/
public
counterServiceArray
:
Array
<
any
>
=
[];
/**
* 建构部件服务对象
*
* @type {BookTypeSelectService}
* @memberof BookTypeSelectBase
*/
public
service
:
BookTypeSelectService
=
new
BookTypeSelectService
({
$store
:
this
.
$store
});
/**
* 实体服务对象
*
* @type {IBIZBOOKService}
* @memberof BookTypeSelectBase
*/
public
appEntityService
:
IBIZBOOKService
=
new
IBIZBOOKService
({
$store
:
this
.
$store
});
/**
* 转化数据
*
* @param {any} args
* @memberof BookTypeSelectBase
*/
public
transformData
(
args
:
any
)
{
let
_this
:
any
=
this
;
if
(
_this
.
service
&&
_this
.
service
.
handleRequestData
instanceof
Function
&&
_this
.
service
.
handleRequestData
(
'transform'
,
_this
.
context
,
args
)){
return
_this
.
service
.
handleRequestData
(
'transform'
,
_this
.
context
,
args
)[
'data'
];
}
}
/**
* 关闭视图
*
* @param {any} args
* @memberof BookTypeSelectBase
*/
public
closeView
(
args
:
any
):
void
{
let
_this
:
any
=
this
;
_this
.
$emit
(
'closeview'
,
[
args
]);
}
/**
* 计数器刷新
*
* @memberof BookTypeSelectBase
*/
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
();
}
})
}
}
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof BookTypeSelectBase
*/
public
getDatas
():
any
[]
{
return
[
this
.
currentselectedNode
];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof BookTypeSelectBase
*/
public
getData
():
any
{
return
this
.
currentselectedNode
;
}
/**
* 是否单选
*
* @type {boolean}
* @memberof BookTypeSelectBase
*/
@
Prop
({
default
:
true
})
public
isSingleSelect
!
:
boolean
;
/**
* 是否默认选中第一条数据
*
* @type {boolean}
* @memberof BookTypeSelectBase
*/
@
Prop
({
default
:
false
})
public
isSelectFirstDefault
!
:
boolean
;
/**
* 枝干节点是否可用(具有数据能力,可抛出)
*
* @type {string}
* @memberof BookTypeSelectBase
*/
@
Prop
({
default
:
true
})
public
isBranchAvailable
!
:
boolean
;
/**
* 显示处理提示
*
* @type {boolean}
* @memberof BookTypeSelectBase
*/
@
Prop
({
default
:
true
})
public
showBusyIndicator
?:
boolean
;
/**
* 初始化完成
*
* @type {boolean}
* @memberof BookTypeSelectBase
*/
public
inited
:
boolean
=
false
;
/**
* 已选中数据集合
*
* @type {*}
* @memberof BookTypeSelectBase
*/
public
selectedNodes
:
any
=
[];
/**
* 当前选中数据项
*
* @type {*}
* @memberof BookTypeSelectBase
*/
public
currentselectedNode
:
any
=
{};
/**
* 选中数据字符串
*
* @type {string}
* @memberof BookTypeSelectBase
*/
@
Prop
()
public
selectedData
!
:
string
;
/**
* 选中值变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof BookTypeSelectBase
*/
@
Watch
(
'selectedData'
)
public
onValueChange
(
newVal
:
any
,
oldVal
:
any
)
{
this
.
echoselectedNodes
=
newVal
?
this
.
isSingleSelect
?
[
JSON
.
parse
(
newVal
)[
0
]]
:
JSON
.
parse
(
newVal
)
:
[];
this
.
selectedNodes
=
[];
if
(
this
.
echoselectedNodes
.
length
>
0
){
let
AllnodesObj
=
(
this
.
$refs
.
treeexpbar_tree
as
any
).
store
.
nodesMap
;
let
AllnodesArray
:
any
[]
=
[];
for
(
const
key
in
AllnodesObj
)
{
if
(
AllnodesObj
.
hasOwnProperty
(
key
))
{
AllnodesArray
.
push
(
AllnodesObj
[
key
].
data
);
}
}
this
.
setDefaultSelection
(
AllnodesArray
);
}
}
/**
* 回显选中数据集合
*
* @type {*}
* @memberof BookTypeSelectBase
*/
public
echoselectedNodes
:
any
[]
=
this
.
selectedData
?
(
this
.
isSingleSelect
?
[
JSON
.
parse
(
this
.
selectedData
)[
0
]]
:
JSON
.
parse
(
this
.
selectedData
))
:
[];
/**
* 部件行为--update
*
* @type {string}
* @memberof BookTypeSelectBase
*/
@
Prop
()
public
updateAction
!
:
string
;
/**
* 部件行为--fetch
*
* @type {string}
* @memberof BookTypeSelectBase
*/
@
Prop
()
public
fetchAction
!
:
string
;
/**
* 部件行为--remove
*
* @type {string}
* @memberof BookTypeSelectBase
*/
@
Prop
()
public
removeAction
!
:
string
;
/**
* 部件行为--load
*
* @type {string}
* @memberof BookTypeSelectBase
*/
@
Prop
()
public
loadAction
!
:
string
;
/**
* 部件行为--create
*
* @type {string}
* @memberof BookTypeSelectBase
*/
@
Prop
()
public
createAction
!
:
string
;
/**
* 过滤属性
*
* @type {string}
* @memberof BookTypeSelectBase
*/
public
srfnodefilter
:
string
=
''
;
/**
* 默认输出图标
*
* @type {boolean}
* @memberof BookTypeSelectBase
*/
public
isOutputIconDefault
:
boolean
=
true
;
/**
* 数据展开主键
*
* @type {string[]}
* @memberof BookTypeSelectBase
*/
@
Provide
()
public
expandedKeys
:
string
[]
=
[];
/**
* 应用状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof BookTypeSelectBase
*/
public
appStateEvent
:
Subscription
|
undefined
;
/**
* 树节点上下文菜单集合
*
* @type {string[]}
* @memberof BookTypeSelectBase
*/
public
actionModel
:
any
=
{
}
/**
* 备份树节点上下文菜单
*
* @type any
* @memberof MainTreeBase
*/
public
copyActionModel
:
any
;
/**
* 选中数据变更事件
*
* @public
* @param {*} data
* @param {*} data 当前节点对应传入对象
* @param {*} checkedState 树目前选中状态对象
* @memberof BookTypeSelectBase
*/
public
onCheck
(
data
:
any
,
checkedState
:
any
)
{
// 处理多选数据
if
(
!
this
.
isSingleSelect
){
let
leafNodes
=
checkedState
.
checkedNodes
.
filter
((
item
:
any
)
=>
item
.
leaf
);
this
.
selectedNodes
=
JSON
.
parse
(
JSON
.
stringify
(
leafNodes
));
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
}
}
/**
* 选中数据变更事件
*
* @public
* @param {*} data 节点对应传入对象
* @param {*} node 节点对应node对象
* @memberof BookTypeSelectBase
*/
public
selectionChange
(
data
:
any
,
node
:
any
)
{
// 禁用项处理
if
(
data
.
disabled
){
node
.
isCurrent
=
false
;
return
;
}
// 只处理最底层子节点
if
(
this
.
isBranchAvailable
||
data
.
leaf
){
this
.
currentselectedNode
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
// 单选直接替换
if
(
this
.
isSingleSelect
){
this
.
selectedNodes
=
[
this
.
currentselectedNode
];
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
}
// 多选用check方法
}
}
/**
* Vue声明周期(处理组件的输入属性)
*
* @memberof BookTypeSelectBase
*/
public
created
()
{
this
.
afterCreated
();
}
/**
* 执行created后的逻辑
*
* @memberof BookTypeSelectBase
*/
public
afterCreated
(){
if
(
this
.
viewState
)
{
this
.
viewStateEvent
=
this
.
viewState
.
subscribe
(({
tag
,
action
,
data
})
=>
{
if
(
!
Object
.
is
(
tag
,
this
.
name
))
{
return
;
}
if
(
Object
.
is
(
'load'
,
action
))
{
this
.
inited
=
false
;
this
.
$nextTick
(()
=>
{
this
.
inited
=
true
;
});
}
if
(
Object
.
is
(
'filter'
,
action
))
{
this
.
srfnodefilter
=
data
.
srfnodefilter
;
this
.
refresh_all
();
}
if
(
Object
.
is
(
'refresh_parent'
,
action
))
{
this
.
refresh_parent
();
}
if
(
Object
.
is
(
'refresh_current'
,
action
))
{
this
.
refresh_current
();
}
});
}
if
(
AppCenterService
&&
AppCenterService
.
getMessageCenter
()){
this
.
appStateEvent
=
AppCenterService
.
getMessageCenter
().
subscribe
(({
name
,
action
,
data
})
=>
{
if
(
!
Object
.
is
(
name
,
"IBIZBOOK"
)){
return
;
}
if
(
Object
.
is
(
action
,
'appRefresh'
)){
this
.
refresh
([
data
]);
}
})
}
}
/**
* 对树节点进行筛选操作
* @memberof OrderTree
*/
public
filterNode
(
value
:
any
,
data
:
any
)
{
if
(
!
value
)
return
true
;
return
data
.
text
.
indexOf
(
value
)
!==
-
1
;
}
/**
* vue 生命周期
*
* @memberof BookTypeSelectBase
*/
public
destroyed
()
{
this
.
afterDestroy
();
}
/**
* 执行destroyed后的逻辑
*
* @memberof BookTypeSelectBase
*/
public
afterDestroy
()
{
if
(
this
.
viewStateEvent
)
{
this
.
viewStateEvent
.
unsubscribe
();
}
if
(
this
.
appStateEvent
){
this
.
appStateEvent
.
unsubscribe
();
}
}
/**
* 刷新数据
*
* @memberof BookTypeSelectBase
*/
public
refresh_all
():
void
{
this
.
inited
=
false
;
this
.
$nextTick
(()
=>
{
this
.
inited
=
true
;
});
}
/**
* 刷新当前节点
*
* @memberof BookTypeSelectBase
*/
public
refresh_current
():
void
{
if
(
Object
.
keys
(
this
.
currentselectedNode
).
length
===
0
)
{
return
;
}
const
tree
:
any
=
this
.
$refs
.
tree
;
const
node
:
any
=
tree
.
getNode
(
this
.
currentselectedNode
.
id
);
if
(
!
node
||
!
node
.
parent
)
{
return
;
}
let
curNode
:
any
=
{};
curNode
=
Util
.
deepObjectMerge
(
curNode
,
node
);
let
tempContext
:
any
=
{};
if
(
curNode
.
data
&&
curNode
.
data
.
srfappctx
){
Object
.
assign
(
tempContext
,
curNode
.
data
.
srfappctx
);
}
else
{
Object
.
assign
(
tempContext
,
this
.
context
);
}
const
id
:
string
=
node
.
key
?
node
.
key
:
'#'
;
const
param
:
any
=
{
srfnodeid
:
id
};
this
.
refresh_node
(
tempContext
,
param
,
false
);
}
/**
* 刷新父节点
*
* @memberof BookTypeSelectBase
*/
public
refresh_parent
():
void
{
if
(
Object
.
keys
(
this
.
currentselectedNode
).
length
===
0
)
{
return
;
}
const
tree
:
any
=
this
.
$refs
.
tree
;
const
node
:
any
=
tree
.
getNode
(
this
.
currentselectedNode
.
id
);
if
(
!
node
||
!
node
.
parent
)
{
return
;
}
let
curNode
:
any
=
{};
const
{
parent
:
_parent
}
=
node
;
curNode
=
Util
.
deepObjectMerge
(
curNode
,
_parent
);
let
tempContext
:
any
=
{};
if
(
curNode
.
data
&&
curNode
.
data
.
srfappctx
){
Object
.
assign
(
tempContext
,
curNode
.
data
.
srfappctx
);
}
else
{
Object
.
assign
(
tempContext
,
this
.
context
);
}
const
id
:
string
=
_parent
.
key
?
_parent
.
key
:
'#'
;
const
param
:
any
=
{
srfnodeid
:
id
};
this
.
refresh_node
(
tempContext
,
param
,
true
);
}
/**
* 数据加载
*
* @param {*} node
* @memberof BookTypeSelectBase
*/
public
load
(
node
:
any
=
{},
resolve
?:
any
)
{
if
(
node
.
data
&&
node
.
data
.
children
)
{
resolve
(
node
.
data
.
children
);
return
;
}
const
params
:
any
=
{
srfnodeid
:
node
.
data
&&
node
.
data
.
id
?
node
.
data
.
id
:
"#"
,
srfnodefilter
:
this
.
srfnodefilter
};
let
tempViewParams
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
));
let
curNode
:
any
=
{};
curNode
=
Util
.
deepObjectMerge
(
curNode
,
node
);
let
tempContext
:
any
=
this
.
computecurNodeContext
(
curNode
);
if
(
curNode
.
data
&&
curNode
.
data
.
srfparentdename
){
Object
.
assign
(
tempContext
,{
srfparentdename
:
curNode
.
data
.
srfparentdename
});
Object
.
assign
(
tempViewParams
,{
srfparentdename
:
curNode
.
data
.
srfparentdename
});
}
if
(
curNode
.
data
&&
curNode
.
data
.
srfparentkey
){
Object
.
assign
(
tempContext
,{
srfparentkey
:
curNode
.
data
.
srfparentkey
});
Object
.
assign
(
tempViewParams
,{
srfparentkey
:
curNode
.
data
.
srfparentkey
});
}
Object
.
assign
(
params
,{
viewparams
:
tempViewParams
});
this
.
service
.
getNodes
(
tempContext
,
params
).
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
resolve
([]);
return
;
}
const
_items
=
response
.
data
;
this
.
formatExpanded
(
_items
);
resolve
([...
_items
]);
let
isRoot
=
Object
.
is
(
node
.
level
,
0
);
let
isSelectedAll
=
node
.
checked
;
this
.
setDefaultSelection
(
_items
,
isRoot
,
isSelectedAll
);
this
.
$emit
(
"load"
,
_items
);
}).
catch
((
response
:
any
)
=>
{
resolve
([]);
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
});
}
/**
* 计算当前节点的上下文
*
* @param {*} curNode 当前节点
* @memberof BookTypeSelectBase
*/
public
computecurNodeContext
(
curNode
:
any
){
let
tempContext
:
any
=
{};
if
(
curNode
&&
curNode
.
data
&&
curNode
.
data
.
srfappctx
){
tempContext
=
JSON
.
parse
(
JSON
.
stringify
(
curNode
.
data
.
srfappctx
));
}
else
{
tempContext
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
}
return
tempContext
;
}
/**
* 刷新功能
*
* @param {any} args
* @memberof BookTypeSelectBase
*/
public
refresh
(
args
?:
any
):
void
{
this
.
refresh_all
();
}
/**
* 刷新节点
*
* @public
* @param {*} [curContext] 当前节点上下文
* @param {*} [arg={}] 当前节点附加参数
* @param {boolean} parentnode 是否是刷新父节点
* @memberof BookTypeSelectBase
*/
public
refresh_node
(
curContext
:
any
,
arg
:
any
=
{},
parentnode
:
boolean
):
void
{
const
{
srfnodeid
:
id
}
=
arg
;
Object
.
assign
(
arg
,{
viewparams
:
this
.
viewparams
});
const
get
:
Promise
<
any
>
=
this
.
service
.
getNodes
(
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
);
get
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
return
;
}
const
_items
=
[...
response
.
data
];
this
.
formatExpanded
(
_items
);
const
tree
:
any
=
this
.
$refs
.
tree
;
tree
.
updateKeyChildren
(
id
,
_items
);
if
(
parentnode
)
{
this
.
currentselectedNode
=
{};
}
this
.
$forceUpdate
();
this
.
setDefaultSelection
(
_items
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
});
}
/**
* 默认展开节点
*
* @public
* @param {any[]} items
* @returns {any[]}
* @memberof BookTypeSelectBase
*/
public
formatExpanded
(
items
:
any
[]):
any
[]
{
const
data
:
any
[]
=
[];
items
.
forEach
((
item
)
=>
{
if
(
item
.
expanded
||
(
item
.
children
&&
item
.
children
.
length
>
0
))
{
this
.
expandedKeys
.
push
(
item
.
id
);
}
});
return
data
;
}
/**
* 设置默认选中,回显数项,选中所有子节点
*
* @param {any[]} items 当前节点所有子节点集合
* @param {boolean} isRoot 是否是加载根节点
* @param {boolean} isSelectedAll 是否选中所有子节点
* @memberof BookTypeSelectBase
*/
public
setDefaultSelection
(
items
:
any
[],
isRoot
:
boolean
=
false
,
isSelectedAll
:
boolean
=
false
):
void
{
if
(
items
.
length
==
0
){
return
;
}
let
defaultData
:
any
;
//在导航视图中,如已有选中数据,则右侧展开已选中数据的视图,如无选中数据则默认选中第一条
if
(
this
.
isSelectFirstDefault
){
if
(
this
.
isSingleSelect
){
let
index
:
number
=
-
1
;
if
(
this
.
selectedNodes
&&
this
.
selectedNodes
.
length
>
0
){
this
.
selectedNodes
.
forEach
((
select
:
any
)
=>
{
index
=
items
.
findIndex
((
item
:
any
)
=>
Object
.
is
(
select
.
srfkey
,
item
.
srfkey
));
});
}
if
(
index
===
-
1
)
{
if
(
isRoot
){
index
=
0
;
}
else
{
return
;
}
}
defaultData
=
items
[
index
];
this
.
setTreeNodeHighLight
(
defaultData
);
this
.
currentselectedNode
=
JSON
.
parse
(
JSON
.
stringify
(
defaultData
));
if
(
this
.
isBranchAvailable
||
defaultData
.
leaf
){
this
.
selectedNodes
=
[
this
.
currentselectedNode
];
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
}
}
}
// 已选数据的回显
if
(
this
.
echoselectedNodes
&&
this
.
echoselectedNodes
.
length
>
0
){
let
checkedNodes
=
items
.
filter
((
item
:
any
)
=>
{
return
this
.
echoselectedNodes
.
some
((
val
:
any
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
val
.
srfkey
)
&&
Object
.
is
(
item
.
srfmajortext
,
val
.
srfmajortext
)){
val
.
used
=
true
;
this
.
selectedNodes
.
push
(
val
);
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
return
true
;
}
});
});
if
(
checkedNodes
.
length
>
0
){
this
.
echoselectedNodes
=
this
.
echoselectedNodes
.
filter
((
item
:
any
)
=>
!
item
.
used
);
// 父节点选中时,不需要执行这段,会选中所有子节点
if
(
!
isSelectedAll
){
if
(
this
.
isSingleSelect
){
this
.
setTreeNodeHighLight
(
checkedNodes
[
0
]);
this
.
currentselectedNode
=
JSON
.
parse
(
JSON
.
stringify
(
checkedNodes
[
0
]));
this
.
selectedNodes
=
[
this
.
currentselectedNode
];
}
else
{
this
.
selectedNodes
=
this
.
selectedNodes
.
concat
(
checkedNodes
);
const
tree
:
any
=
this
.
$refs
.
treeexpbar_tree
;
tree
.
setCheckedNodes
(
this
.
selectedNodes
);
}
}
}
}
// 父节点选中时,选中所有子节点
if
(
isSelectedAll
){
let
leafNodes
=
items
.
filter
((
item
:
any
)
=>
item
.
leaf
);
this
.
selectedNodes
=
this
.
selectedNodes
.
concat
(
leafNodes
);
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
}
}
/**
* 绘制右击菜单
*
* @param {*} node
* @returns
* @memberof BookTypeSelectBase
*/
public
renderContextMenu
(
node
:
any
)
{
let
content
;
if
(
node
&&
node
.
data
)
{
const
data
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
node
.
data
));
this
.
currentselectedNode
=
{
...
data
};
const
tags
:
string
[]
=
data
.
id
.
split
(
';'
);
let
copyActionModel
:
any
=
Util
.
deepCopy
(
this
.
actionModel
);
}
return
content
;
}
/**
* 显示上下文菜单
*
* @param data 节点数据
* @param event 事件源
* @memberof BookTypeSelectBase
*/
public
showContext
(
data
:
any
,
event
:
any
){
let
_this
:
any
=
this
;
this
.
copyActionModel
=
{};
const
tags
:
string
[]
=
data
.
id
.
split
(
';'
);
Object
.
values
(
this
.
actionModel
).
forEach
((
item
:
any
)
=>
{
if
(
Object
.
is
(
item
.
nodeOwner
,
tags
[
0
])){
this
.
copyActionModel
[
item
.
name
]
=
item
;
}
})
if
(
Object
.
keys
(
this
.
copyActionModel
).
length
===
0
){
return
;
}
this
.
computeNodeState
(
data
,
data
.
nodeType
,
data
.
appEntityName
).
then
((
result
:
any
)
=>
{
let
flag
:
boolean
=
false
;
if
(
Object
.
values
(
result
).
length
>
0
){
flag
=
Object
.
values
(
result
).
some
((
item
:
any
)
=>
{
return
item
.
visabled
===
true
;
})
}
if
(
flag
){
(
_this
.
$refs
[
data
.
id
]
as
any
).
showContextMenu
(
event
.
clientX
,
event
.
clientY
);
}
});
}
/**
* 计算节点右键权限
*
* @param {*} node 节点数据
* @param {*} nodeType 节点类型
* @param {*} appEntityName 应用实体名称
* @returns
* @memberof BookTypeSelectBase
*/
public
async
computeNodeState
(
node
:
any
,
nodeType
:
string
,
appEntityName
:
string
)
{
if
(
Object
.
is
(
nodeType
,
"STATIC"
)){
return
this
.
copyActionModel
;
}
let
service
:
any
=
await
this
.
appEntityService
.
getService
(
appEntityName
);
if
(
this
.
copyActionModel
&&
Object
.
keys
(
this
.
copyActionModel
).
length
>
0
)
{
if
(
service
[
'Get'
]
&&
service
[
'Get'
]
instanceof
Function
){
let
tempContext
:
any
=
Util
.
deepCopy
(
this
.
context
);
tempContext
[
appEntityName
]
=
node
.
srfkey
;
let
targetData
=
await
service
.
Get
(
tempContext
,{},
false
);
let
uiservice
:
any
=
await
new
UIService
().
getService
(
appEntityName
);
let
result
:
any
[]
=
ViewTool
.
calcActionItemAuthState
(
targetData
.
data
,
this
.
copyActionModel
,
uiservice
);
return
this
.
copyActionModel
;
}
else
{
console
.
warn
(
"获取数据异常"
);
return
this
.
copyActionModel
;
}
}
}
/**
* 设置选中高亮
*
* @param {*} data
* @memberof BookTypeSelectBase
*/
public
setTreeNodeHighLight
(
data
:
any
):
void
{
const
tree
:
any
=
this
.
$refs
.
tree
;
tree
.
setCurrentKey
(
data
.
id
);
}
/**
* 执行默认界面行为
*
* @param {*} node
* @memberof BookTypeSelectBase
*/
public
doDefaultAction
(
node
:
any
)
{
if
(
node
&&
node
.
data
)
{
const
data
:
any
=
node
.
data
;
const
tags
:
string
[]
=
data
.
id
.
split
(
';'
);
}
this
.
$emit
(
'nodedblclick'
,
this
.
selectedNodes
);
}
}
</
script
>
<
style
lang=
'less'
>
@import './book-type-select-treeview.less';
</
style
>
\ No newline at end of file
app_Web/src/widgets/ibizbook/book-type-select-treeview/book-type-select-treeview-model.ts
0 → 100644
浏览文件 @
0557abf9
/**
* BookTypeSelect 部件模型
*
* @export
* @class BookTypeSelectModel
*/
export
default
class
BookTypeSelectModel
{
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof BookTypeSelectModel
*/
public
getDataItems
():
any
[]
{
return
[
{
name
:
'createman'
,
},
{
name
:
'ibizbookname'
,
},
{
name
:
'ibizbook'
,
prop
:
'ibizbookid'
,
},
{
name
:
'createdate'
,
},
{
name
:
'updateman'
,
},
{
name
:
'updatedate'
,
},
{
name
:
'author'
,
},
{
name
:
'price'
,
},
{
name
:
'press'
,
},
{
name
:
'type'
,
},
{
name
:
'booknumber'
,
},
{
name
:
'subtext'
,
},
{
name
:
'lendouttime'
,
},
{
name
:
'returntime'
,
},
{
name
:
'icon'
,
},
{
name
:
'sailstate'
,
},
{
name
:
'borrowstatus'
,
},
{
name
:
'stepstatus'
,
},
{
name
:
'borrower'
,
},
]
}
}
\ No newline at end of file
app_Web/src/widgets/ibizbook/book-type-select-treeview/book-type-select-treeview-service.ts
0 → 100644
浏览文件 @
0557abf9
import
{
Http
,
Util
,
Errorlog
}
from
'@/utils'
;
import
ControlService
from
'@/widgets/control-service'
;
import
IBIZBOOKService
from
'@/service/ibizbook/ibizbook-service'
;
import
BookTypeSelectModel
from
'./book-type-select-treeview-model'
;
import
CodeListService
from
"@/codelist/codelist-service"
;
import
i18n
from
'@/locale'
;
/**
* BookTypeSelect 部件服务对象
*
* @export
* @class BookTypeSelectService
*/
export
default
class
BookTypeSelectService
extends
ControlService
{
/**
* 图书服务对象
*
* @type {IBIZBOOKService}
* @memberof BookTypeSelectService
*/
public
appEntityService
:
IBIZBOOKService
=
new
IBIZBOOKService
({
$store
:
this
.
getStore
()
});
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof BookTypeSelectService
*/
public
setTempMode
(){
this
.
isTempMode
=
false
;
}
/**
* Creates an instance of BookTypeSelectService.
*
* @param {*} [opts={}]
* @memberof BookTypeSelectService
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
this
.
model
=
new
BookTypeSelectModel
();
}
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof BookTypeSelectService
*/
public
codeListService
:
CodeListService
=
new
CodeListService
({
$store
:
this
.
getStore
()
});
/**
* 节点分隔符号
*
* @public
* @type {string}
* @memberof BookTypeSelectService
*/
public
TREENODE_SEPARATOR
:
string
=
';'
;
/**
* 图书类型节点分隔符号
*
* @public
* @type {string}
* @memberof BookTypeSelectService
*/
public
TREENODE_IBIZBOOKTYPE
:
string
=
'IbizBookType'
;
/**
* 图书类型代码表节点分隔符号
*
* @public
* @type {string}
* @memberof BookTypeSelectService
*/
public
TREENODE_IBIZBOOKTYPECODELIST
:
string
=
'IbizBookTypeCodelist'
;
/**
* 默认根节点节点分隔符号
*
* @public
* @type {string}
* @memberof BookTypeSelectService
*/
public
TREENODE_ROOT
:
string
=
'ROOT'
;
/**
* 获取节点数据
*
* @param {string} action
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof BookTypeSelectService
*/
@
Errorlog
public
async
getNodes
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
{
srfparentkey
,
srfcat
,
srfnodeid
,
srfnodefilter
,
query
}:
{
srfparentkey
:
string
,
srfcat
:
string
,
srfnodeid
:
string
,
srfnodefilter
:
string
,
query
:
string
}
=
data
;
srfnodefilter
=
query
?
query
:
srfnodefilter
;
let
list
:
any
[]
=
[];
let
filter
:
any
=
{};
if
(
!
srfnodeid
||
Object
.
is
(
srfnodeid
,
'#'
))
{
srfnodeid
=
this
.
TREENODE_ROOT
;
}
let
strTreeNodeId
:
string
=
srfnodeid
;
let
strRealNodeId
:
string
=
''
;
let
bRootSelect
:
boolean
=
false
;
let
strNodeType
:
string
|
null
=
null
;
let
strRootSelectNode
:
string
=
''
;
if
(
Object
.
is
(
strTreeNodeId
,
this
.
TREENODE_ROOT
))
{
strNodeType
=
this
.
TREENODE_ROOT
;
if
(
srfparentkey
)
{
strRealNodeId
=
srfparentkey
;
}
}
else
{
let
nPos
=
strTreeNodeId
.
indexOf
(
this
.
TREENODE_SEPARATOR
);
if
(
nPos
===
-
1
)
{
return
Promise
.
reject
({
status
:
500
,
data
:
{
title
:
'失败'
,
message
:
`树节点
${
strTreeNodeId
}
标识无效`
}
});
}
strNodeType
=
strTreeNodeId
.
substring
(
0
,
nPos
);
strRealNodeId
=
strTreeNodeId
.
substring
(
nPos
+
1
);
}
Object
.
assign
(
filter
,
{
srfparentkey
:
srfparentkey
,
srfcat
:
srfcat
,
srfnodefilter
:
srfnodefilter
,
strRealNodeId
:
strRealNodeId
,
srfnodeid
:
srfnodeid
,
strNodeType
:
strNodeType
,
viewparams
:
JSON
.
parse
(
JSON
.
stringify
(
data
)).
viewparams
}
);
// 分解节点标识
let
nodeid
:
string
[]
=
strRealNodeId
.
split
(
this
.
TREENODE_SEPARATOR
);
for
(
let
i
=
0
;
i
<
nodeid
.
length
;
i
++
)
{
switch
(
i
)
{
case
0
:
Object
.
assign
(
filter
,
{
nodeid
:
nodeid
[
0
]
});
break
;
case
1
:
Object
.
assign
(
filter
,
{
nodeid2
:
nodeid
[
1
]
});
break
;
case
2
:
Object
.
assign
(
filter
,
{
nodeid3
:
nodeid
[
2
]
});
break
;
case
3
:
Object
.
assign
(
filter
,
{
nodeid4
:
nodeid
[
3
]
});
break
;
default
:
break
;
}
}
if
(
Object
.
is
(
strNodeType
,
this
.
TREENODE_IBIZBOOKTYPE
))
{
await
this
.
fillIbizbooktypeNodeChilds
(
context
,
filter
,
list
);
return
Promise
.
resolve
({
status
:
200
,
data
:
list
});
}
if
(
Object
.
is
(
strNodeType
,
this
.
TREENODE_IBIZBOOKTYPECODELIST
))
{
await
this
.
fillIbizbooktypecodelistNodeChilds
(
context
,
filter
,
list
);
return
Promise
.
resolve
({
status
:
200
,
data
:
list
});
}
if
(
Object
.
is
(
strNodeType
,
this
.
TREENODE_ROOT
))
{
await
this
.
fillRootNodeChilds
(
context
,
filter
,
list
);
return
Promise
.
resolve
({
status
:
200
,
data
:
list
});
}
return
Promise
.
resolve
({
status
:
500
,
data
:
{
title
:
'失败'
,
message
:
`树节点
${
strTreeNodeId
}
标识无效`
}
});
}
/**
* 填充 树视图节点[图书类型]
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @param {*} rsNavContext
* @param {*} rsNavParams
* @param {*} rsParams
* @returns {Promise<any>}
* @memberof BookTypeSelectService
*/
@
Errorlog
public
fillIbizbooktypeNodes
(
context
:
any
=
{},
filter
:
any
,
list
:
any
[],
rsNavContext
?:
any
,
rsNavParams
?:
any
,
rsParams
?:
any
):
Promise
<
any
>
{
context
=
this
.
handleResNavContext
(
context
,
filter
,
rsNavContext
);
filter
=
this
.
handleResNavParams
(
context
,
filter
,
rsNavParams
,
rsParams
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
treeNode
:
any
=
{};
Object
.
assign
(
treeNode
,
{
text
:
i18n
.
t
(
'entities.ibizbook.booktypeselect_treeview.nodes.ibizbooktype'
)
});
Object
.
assign
(
treeNode
,
{
isUseLangRes
:
true
});
Object
.
assign
(
treeNode
,{
srfappctx
:
context
});
Object
.
assign
(
treeNode
,
{
srfmajortext
:
treeNode
.
text
});
let
strNodeId
:
string
=
'IbizBookType'
;
// 没有指定节点值,直接使用父节点值
Object
.
assign
(
treeNode
,
{
srfkey
:
filter
.
strRealNodeId
});
strNodeId
+=
this
.
TREENODE_SEPARATOR
;
strNodeId
+=
filter
.
strRealNodeId
;
Object
.
assign
(
treeNode
,
{
id
:
strNodeId
});
Object
.
assign
(
treeNode
,
{
expanded
:
filter
.
isAutoexpand
});
Object
.
assign
(
treeNode
,
{
leaf
:
false
});
Object
.
assign
(
treeNode
,
{
nodeid
:
treeNode
.
srfkey
});
Object
.
assign
(
treeNode
,
{
nodeid2
:
filter
.
strRealNodeId
});
Object
.
assign
(
treeNode
,
{
nodeType
:
"STATIC"
});
list
.
push
(
treeNode
);
resolve
(
list
);
});
}
/**
* 填充 树视图节点[图书类型]子节点
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof BookTypeSelectService
*/
@
Errorlog
public
async
fillIbizbooktypeNodeChilds
(
context
:
any
=
{},
filter
:
any
,
list
:
any
[]):
Promise
<
any
>
{
if
(
filter
.
srfnodefilter
&&
!
Object
.
is
(
filter
.
srfnodefilter
,
""
))
{
// 填充图书类型代码表
let
IbizbooktypecodelistRsNavContext
:
any
=
{};
let
IbizbooktypecodelistRsNavParams
:
any
=
{};
let
IbizbooktypecodelistRsParams
:
any
=
{};
await
this
.
fillIbizbooktypecodelistNodes
(
context
,
filter
,
list
,
IbizbooktypecodelistRsNavContext
,
IbizbooktypecodelistRsNavParams
,
IbizbooktypecodelistRsParams
);
}
else
{
// 填充图书类型代码表
let
IbizbooktypecodelistRsNavContext
:
any
=
{};
let
IbizbooktypecodelistRsNavParams
:
any
=
{};
let
IbizbooktypecodelistRsParams
:
any
=
{};
await
this
.
fillIbizbooktypecodelistNodes
(
context
,
filter
,
list
,
IbizbooktypecodelistRsNavContext
,
IbizbooktypecodelistRsNavParams
,
IbizbooktypecodelistRsParams
);
}
}
/**
* 填充 树视图节点[图书类型代码表]
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @param {*} rsNavContext
* @param {*} rsNavParams
* @param {*} rsParams
* @returns {Promise<any>}
* @memberof BookTypeSelectService
*/
@
Errorlog
public
fillIbizbooktypecodelistNodes
(
context
:
any
=
{},
filter
:
any
,
list
:
any
[],
rsNavContext
?:
any
,
rsNavParams
?:
any
,
rsParams
?:
any
):
Promise
<
any
>
{
context
=
this
.
handleResNavContext
(
context
,
filter
,
rsNavContext
);
filter
=
this
.
handleResNavParams
(
context
,
filter
,
rsNavParams
,
rsParams
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
codeListIems
:
Array
<
any
>
=
[];
if
(
this
.
getStore
())
{
codeListIems
=
(
this
.
getStore
()
as
any
).
getters
.
getCodeListItems
(
'BookType'
);
}
if
(
codeListIems
&&
codeListIems
.
length
>
0
){
const
handleChildData
=
(
context
:
any
,
item
:
any
,)
=>
{
Object
.
assign
(
item
,{
srfappctx
:
context
});
Object
.
assign
(
item
,
{
text
:
i18n
.
t
(
'codelist.BookType.'
+
item
.
value
)
});
Object
.
assign
(
item
,
{
isUseLangRes
:
true
});
Object
.
assign
(
item
,
{
srfmajortext
:
item
.
text
});
let
strNodeId
:
string
=
"IbizBookTypeCodelist"
;
Object
.
assign
(
item
,
{
srfkey
:
item
.
value
});
strNodeId
+=
this
.
TREENODE_SEPARATOR
;
strNodeId
+=
item
.
value
;
Object
.
assign
(
item
,
{
id
:
strNodeId
});
Object
.
assign
(
item
,
{
expanded
:
filter
.
isautoexpand
});
Object
.
assign
(
item
,
{
nodeid
:
item
.
srfkey
});
Object
.
assign
(
item
,
{
nodeid2
:
item
.
pvalue
});
Object
.
assign
(
item
,
{
nodeType
:
'STATIC'
});
}
codeListIems
=
this
.
handleDataSet
(
JSON
.
parse
(
JSON
.
stringify
(
codeListIems
)),
context
,
handleChildData
);
codeListIems
.
forEach
((
item
:
any
)
=>
{
let
treeNode
:
any
=
{};
Object
.
assign
(
treeNode
,{
srfappctx
:
context
});
Object
.
assign
(
treeNode
,
{
text
:
i18n
.
t
(
'codelist.BookType.'
+
item
.
value
)
});
Object
.
assign
(
treeNode
,
{
isUseLangRes
:
true
});
Object
.
assign
(
treeNode
,
{
srfmajortext
:
treeNode
.
text
});
let
strNodeId
:
string
=
"IbizBookTypeCodelist"
;
Object
.
assign
(
treeNode
,
{
srfkey
:
item
.
value
});
strNodeId
+=
this
.
TREENODE_SEPARATOR
;
strNodeId
+=
item
.
value
;
Object
.
assign
(
treeNode
,
{
id
:
strNodeId
});
Object
.
assign
(
treeNode
,
{
expanded
:
filter
.
isautoexpand
});
Object
.
assign
(
treeNode
,
{
leaf
:
true
});
if
(
item
.
children
&&
item
.
children
.
length
>
0
){
Object
.
assign
(
treeNode
,
{
children
:
item
.
children
});
}
Object
.
assign
(
treeNode
,
{
nodeid
:
treeNode
.
srfkey
});
Object
.
assign
(
treeNode
,
{
nodeid2
:
filter
.
strRealNodeId
});
Object
.
assign
(
treeNode
,
{
nodeType
:
'STATIC'
});
list
.
push
(
treeNode
);
resolve
(
list
);
})
}
else
{
resolve
(
list
);
}
});
}
/**
* 填充 树视图节点[图书类型代码表]子节点
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof BookTypeSelectService
*/
@
Errorlog
public
async
fillIbizbooktypecodelistNodeChilds
(
context
:
any
=
{},
filter
:
any
,
list
:
any
[]):
Promise
<
any
>
{
if
(
filter
.
srfnodefilter
&&
!
Object
.
is
(
filter
.
srfnodefilter
,
""
))
{
}
else
{
}
}
/**
* 填充 树视图节点[默认根节点]
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @param {*} rsNavContext
* @param {*} rsNavParams
* @param {*} rsParams
* @returns {Promise<any>}
* @memberof BookTypeSelectService
*/
@
Errorlog
public
fillRootNodes
(
context
:
any
=
{},
filter
:
any
,
list
:
any
[],
rsNavContext
?:
any
,
rsNavParams
?:
any
,
rsParams
?:
any
):
Promise
<
any
>
{
context
=
this
.
handleResNavContext
(
context
,
filter
,
rsNavContext
);
filter
=
this
.
handleResNavParams
(
context
,
filter
,
rsNavParams
,
rsParams
);
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
treeNode
:
any
=
{};
Object
.
assign
(
treeNode
,
{
text
:
i18n
.
t
(
'entities.ibizbook.booktypeselect_treeview.nodes.root'
)
});
Object
.
assign
(
treeNode
,
{
isUseLangRes
:
true
});
Object
.
assign
(
treeNode
,{
srfappctx
:
context
});
Object
.
assign
(
treeNode
,
{
srfmajortext
:
treeNode
.
text
});
let
strNodeId
:
string
=
'ROOT'
;
Object
.
assign
(
treeNode
,
{
srfkey
:
'root'
});
strNodeId
+=
this
.
TREENODE_SEPARATOR
;
strNodeId
+=
'root'
;
Object
.
assign
(
treeNode
,
{
id
:
strNodeId
});
Object
.
assign
(
treeNode
,
{
expanded
:
filter
.
isAutoexpand
});
Object
.
assign
(
treeNode
,
{
leaf
:
false
});
Object
.
assign
(
treeNode
,
{
nodeid
:
treeNode
.
srfkey
});
Object
.
assign
(
treeNode
,
{
nodeid2
:
filter
.
strRealNodeId
});
Object
.
assign
(
treeNode
,
{
nodeType
:
"STATIC"
});
list
.
push
(
treeNode
);
resolve
(
list
);
});
}
/**
* 填充 树视图节点[默认根节点]子节点
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof BookTypeSelectService
*/
@
Errorlog
public
async
fillRootNodeChilds
(
context
:
any
=
{},
filter
:
any
,
list
:
any
[]):
Promise
<
any
>
{
if
(
filter
.
srfnodefilter
&&
!
Object
.
is
(
filter
.
srfnodefilter
,
""
))
{
// 填充图书类型
let
IbizbooktypeRsNavContext
:
any
=
{};
let
IbizbooktypeRsNavParams
:
any
=
{};
let
IbizbooktypeRsParams
:
any
=
{};
await
this
.
fillIbizbooktypeNodes
(
context
,
filter
,
list
,
IbizbooktypeRsNavContext
,
IbizbooktypeRsNavParams
,
IbizbooktypeRsParams
);
}
else
{
// 填充图书类型
let
IbizbooktypeRsNavContext
:
any
=
{};
let
IbizbooktypeRsNavParams
:
any
=
{};
let
IbizbooktypeRsParams
:
any
=
{};
await
this
.
fillIbizbooktypeNodes
(
context
,
filter
,
list
,
IbizbooktypeRsNavContext
,
IbizbooktypeRsNavParams
,
IbizbooktypeRsParams
);
}
}
/**
* 处理代码表返回数据(树状结构)
*
* @param result 返回数组
* @param context 应用上下文
* @param callBack 回调
* @memberof BookTypeSelectService
*/
public
handleDataSet
(
result
:
Array
<
any
>
,
context
:
any
,
callBack
:
any
){
let
list
:
Array
<
any
>
=
[];
if
(
result
.
length
===
0
){
return
list
;
}
result
.
forEach
((
codeItem
:
any
)
=>
{
if
(
!
codeItem
.
pvalue
){
let
valueField
:
string
=
codeItem
.
value
;
this
.
setChildCodeItems
(
valueField
,
result
,
codeItem
);
list
.
push
(
codeItem
);
}
})
this
.
setNodeData
(
list
,
context
,
callBack
);
return
list
;
}
/**
* 处理非根节点数据
*
* @param result 返回数组
* @param context 应用上下文
* @param callBack 回调
* @memberof BookTypeSelectService
*/
public
setChildCodeItems
(
pValue
:
string
,
result
:
Array
<
any
>
,
codeItem
:
any
){
result
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
pvalue
==
pValue
){
let
valueField
:
string
=
item
.
value
;
this
.
setChildCodeItems
(
valueField
,
result
,
item
);
if
(
!
codeItem
.
children
){
codeItem
.
children
=
[];
}
codeItem
.
children
.
push
(
item
);
}
})
}
/**
* 设置节点UI数据
*
* @param result 返回数组
* @param context 应用上下文
* @param callBack 回调
* @memberof BookTypeSelectService
*/
public
setNodeData
(
result
:
Array
<
any
>
,
context
:
any
,
callBack
:
any
){
result
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
children
){
item
.
leaf
=
false
;
this
.
setNodeData
(
item
.
children
,
context
,
callBack
);
}
else
{
item
.
leaf
=
true
;
}
callBack
(
context
,
item
);
})
}
/**
* 处理节点关系导航上下文
*
* @param context 应用上下文
* @param filter 参数
* @param resNavContext 节点关系导航上下文
*
* @memberof BookTypeSelectService
*/
public
handleResNavContext
(
context
:
any
,
filter
:
any
,
resNavContext
:
any
){
if
(
resNavContext
&&
Object
.
keys
(
resNavContext
).
length
>
0
){
let
tempContextData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
tempViewParams
:
any
=
{};
if
(
filter
&&
filter
.
viewparams
){
tempViewParams
=
filter
.
viewparams
;
}
Object
.
keys
(
resNavContext
).
forEach
((
item
:
any
)
=>
{
let
curDataObj
:
any
=
resNavContext
[
item
];
this
.
handleCustomDataLogic
(
context
,
tempViewParams
,
curDataObj
,
tempContextData
,
item
);
})
return
tempContextData
;
}
else
{
return
context
;
}
}
/**
* 处理关系导航参数
*
* @param context 应用上下文
* @param filter 参数
* @param resNavParams 节点关系导航参数
* @param resParams 节点关系参数
*
* @memberof BookTypeSelectService
*/
public
handleResNavParams
(
context
:
any
,
filter
:
any
,
resNavParams
:
any
,
resParams
:
any
){
if
((
resNavParams
&&
Object
.
keys
(
resNavParams
).
length
>
0
)
||
(
resParams
&&
Object
.
keys
(
resParams
).
length
>
0
)){
let
tempViewParamData
:
any
=
{};
let
tempViewParams
:
any
=
{};
if
(
filter
&&
filter
.
viewparams
){
tempViewParams
=
filter
.
viewparams
;
tempViewParamData
=
JSON
.
parse
(
JSON
.
stringify
(
filter
.
viewparams
));
}
if
(
Object
.
keys
(
resNavParams
).
length
>
0
){
Object
.
keys
(
resNavParams
).
forEach
((
item
:
any
)
=>
{
let
curDataObj
:
any
=
resNavParams
[
item
];
this
.
handleCustomDataLogic
(
context
,
tempViewParams
,
curDataObj
,
tempViewParamData
,
item
);
})
}
if
(
Object
.
keys
(
resParams
).
length
>
0
){
Object
.
keys
(
resParams
).
forEach
((
item
:
any
)
=>
{
let
curDataObj
:
any
=
resParams
[
item
];
tempViewParamData
[
item
.
toLowerCase
()]
=
curDataObj
.
value
;
})
}
Object
.
assign
(
filter
,{
viewparams
:
tempViewParamData
});
return
filter
;
}
else
{
return
filter
;
}
}
/**
* 处理自定义节点关系导航数据
*
* @param context 应用上下文
* @param viewparams 参数
* @param curNavData 节点关系导航参数对象
* @param tempData 返回数据
* @param item 节点关系导航参数键值
*
* @memberof BookTypeSelectService
*/
public
handleCustomDataLogic
(
context
:
any
,
viewparams
:
any
,
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
(
context
[(
curNavData
.
value
).
toLowerCase
()]
!=
null
){
Object
.
defineProperty
(
tempData
,
item
.
toLowerCase
(),
{
value
:
context
[(
curNavData
.
value
).
toLowerCase
()],
writable
:
true
,
enumerable
:
true
,
configurable
:
true
});
}
else
{
if
(
viewparams
[(
curNavData
.
value
).
toLowerCase
()]
!=
null
){
Object
.
defineProperty
(
tempData
,
item
.
toLowerCase
(),
{
value
:
viewparams
[(
curNavData
.
value
).
toLowerCase
()],
writable
:
true
,
enumerable
:
true
,
configurable
:
true
});
}
else
{
Object
.
defineProperty
(
tempData
,
item
.
toLowerCase
(),
{
value
:
null
,
writable
:
true
,
enumerable
:
true
,
configurable
:
true
});
}
}
}
}
}
\ No newline at end of file
app_Web/src/widgets/ibizbook/book-type-select-treeview/book-type-select-treeview.less
0 → 100644
浏览文件 @
0557abf9
.tree-right-menu {
.ivu-divider-horizontal {
width: 100%;
min-width: 100%;
margin: 0 auto;
}
.ivu-dropdown-item {
position: relative;
padding-left: 32px;
> i {
position: absolute;
left: 16px;
top: 10px;
}
.ivu-icon-ios-arrow-forward {
left: initial;
right: 4px;
}
}
.ivu-dropdown {
.ivu-select-dropdown {
margin: 0;
}
}
}
.el-tree .context-menu-component .tree-node{
width: calc(100% - 15px);
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
.icon{
padding-right: 10px;
}
}
// this is less
app_Web/src/widgets/ibizbook/book-type-select-treeview/book-type-select-treeview.vue
0 → 100644
浏览文件 @
0557abf9
<
script
lang=
'tsx'
>
import
{
Component
}
from
'vue-property-decorator'
;
import
BookTypeSelectBase
from
'./book-type-select-treeview-base.vue'
;
@
Component
({
components
:
{
}
})
export
default
class
BookTypeSelect
extends
BookTypeSelectBase
{
}
</
script
>
\ No newline at end of file
app_Web/src/widgets/ibizbook/inter-func-form-2-form/inter-func-form-2-form-base.vue
浏览文件 @
0557abf9
...
@@ -75,14 +75,23 @@
...
@@ -75,14 +75,23 @@
</i-col>
</i-col>
<i-col
v-show=
"detailsModel.type.visible"
:style=
"
{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<i-col
v-show=
"detailsModel.type.visible"
:style=
"
{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<app-form-item
name=
'type'
:itemRules=
"this.rules().type"
class=
''
:caption=
"$t('entities.ibizbook.interfuncform_2_form.details.type')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.type.error"
:isEmptyCaption=
"false"
labelPos=
"LEFT"
>
<app-form-item
name=
'type'
:itemRules=
"this.rules().type"
class=
''
:caption=
"$t('entities.ibizbook.interfuncform_2_form.details.type')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.type.error"
:isEmptyCaption=
"false"
labelPos=
"LEFT"
>
<input-box
v-model=
"data.type"
<app-picker
@
enter=
"onEnter($event)"
:formState=
"formState"
unit=
""
:data=
"data"
:disabled=
"detailsModel.type.disabled"
:context=
"context"
type=
'text'
:viewparams=
"viewparams"
style=
""
>
:localContext =
'
{ }'
</input-box>
:localParam ='{ }'
:disabled="detailsModel.type.disabled"
name='type'
valueitem=''
:value="data.type"
editortype="pickup-no-ac"
:pickupView="{ viewname: 'ibizbookpickup-tree-view', title: $t('entities.ibizbook.views.pickuptreeview.title'), deResParameters: [], parameters: [{ pathName: 'ibizbooks', parameterName: 'ibizbook' }, { pathName: 'pickuptreeview', parameterName: 'pickuptreeview' } ], placement:'' }"
style=""
@formitemvaluechange="onFormItemValueChange">
</app-picker>
</app-form-item>
</app-form-item>
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录