Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
功
功能演示系统
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
示例
功能演示系统
提交
dfe3779a
提交
dfe3779a
编写于
12月 04, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tony001 发布系统代码 [后台服务,演示应用]
上级
932b0827
变更
14
显示空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
2257 行增加
和
67 行删除
+2257
-67
main-menu-appmenu.ts
app_Web/src/mock/app/main-menu-appmenu/main-menu-appmenu.ts
+1
-1
ibizorder-tree-grid-ex-view-base.vue
...er-tree-grid-ex-view/ibizorder-tree-grid-ex-view-base.vue
+715
-0
ibizorder-tree-grid-ex-view.less
...zorder-tree-grid-ex-view/ibizorder-tree-grid-ex-view.less
+19
-0
ibizorder-tree-grid-ex-view.vue
...izorder-tree-grid-ex-view/ibizorder-tree-grid-ex-view.vue
+22
-0
page-register.ts
app_Web/src/pages/sample/index/page-register.ts
+1
-1
router.ts
app_Web/src/pages/sample/index/router.ts
+27
-27
state.ts
app_Web/src/store/modules/view-action/state.ts
+10
-11
main-menu-appmenu-base.vue
.../widgets/app/main-menu-appmenu/main-menu-appmenu-base.vue
+26
-26
main-menu-appmenu-model.ts
.../widgets/app/main-menu-appmenu/main-menu-appmenu-model.ts
+1
-1
order-tree-grid-treegridex-base.vue
...-tree-grid-treegridex/order-tree-grid-treegridex-base.vue
+511
-0
order-tree-grid-treegridex-model.ts
...-tree-grid-treegridex/order-tree-grid-treegridex-model.ts
+93
-0
order-tree-grid-treegridex-service.ts
...ree-grid-treegridex/order-tree-grid-treegridex-service.ts
+810
-0
order-tree-grid-treegridex.less
...rder-tree-grid-treegridex/order-tree-grid-treegridex.less
+7
-0
order-tree-grid-treegridex.vue
...order-tree-grid-treegridex/order-tree-grid-treegridex.vue
+14
-0
未找到文件。
app_Web/src/mock/app/main-menu-appmenu/main-menu-appmenu.ts
浏览文件 @
dfe3779a
...
...
@@ -1083,7 +1083,7 @@ mock.onGet('v7/main-menuappmenu').reply((config: any) => {
iconcls
:
''
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
'AppFunc
30
'
,
appfunctag
:
'AppFunc
73
'
,
resourcetag
:
''
,
},
{
...
...
app_Web/src/pages/sample/ibizorder-tree-grid-ex-view/ibizorder-tree-grid-ex-view-base.vue
0 → 100644
浏览文件 @
dfe3779a
<
template
>
<div
class=
'view-container detreegridexview ibizorder-tree-grid-ex-view'
>
<app-studioaction
:viewTitle=
"$t(model.srfCaption)"
viewName=
"ibizordertreegridexview"
></app-studioaction>
<card
class=
'view-card '
:dis-hover=
"true"
:bordered=
"false"
>
<div
slot=
'title'
class=
"header-container"
>
<span
class=
'caption-info'
>
{{
$t
(
model
.
srfCaption
)
}}
</span>
</div>
<div
class=
'view-top-messages'
>
</div>
<div
class=
'content-container'
>
<div
style=
'margin-bottom: 6px;'
>
<div
class=
'pull-right'
>
<div
class=
'toolbar-container'
>
</div>
</div>
</div>
<div
class=
'view-body-messages'
>
</div>
<view
_treegridex
:viewState=
"viewState"
:viewparams=
"viewparams"
:context=
"context"
:showBusyIndicator=
"true"
name=
"treegridex"
ref=
'treegridex'
@
selectionchange=
"treegridex_selectionchange($event)"
@
beforeload=
"treegridex_beforeload($event)"
@
rowdblclick=
"treegridex_rowdblclick($event)"
@
remove=
"treegridex_remove($event)"
@
load=
"treegridex_load($event)"
@
closeview=
"closeView($event)"
>
</view
_treegridex
>
</div>
<div
class=
'view-bottom-messages'
>
</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
IBIZOrderService
from
'@/service/ibizorder/ibizorder-service'
;
import
IBIZOrderAuthService
from
'@/authservice/ibizorder/ibizorder-auth-service'
;
import
TreeGridExViewEngine
from
'@engine/view/tree-grid-ex-view-engine'
;
import
IBIZOrderUIService
from
'@/uiservice/ibizorder/ibizorder-ui-service'
;
@
Component
({
components
:
{
},
})
export
default
class
IBIZOrderTreeGridExViewBase
extends
Vue
{
/**
* 实体服务对象
*
* @type {IBIZOrderService}
* @memberof IBIZOrderTreeGridExViewBase
*/
public
appEntityService
:
IBIZOrderService
=
new
IBIZOrderService
;
/**
* 实体UI服务对象
*
* @type IBIZOrderUIService
* @memberof IBIZOrderTreeGridExViewBase
*/
public
appUIService
:
IBIZOrderUIService
=
new
IBIZOrderUIService
(
this
.
$store
);
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof IBIZOrderTreeGridExViewBase
*/
@
Emit
()
public
viewDatasChange
(
val
:
any
):
any
{
return
val
;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof IBIZOrderTreeGridExViewBase
*/
@
Prop
()
public
viewdata
!
:
string
;
/**
* 传入视图参数
*
* @type {string}
* @memberof IBIZOrderTreeGridExViewBase
*/
@
Prop
()
public
viewparam
!
:
string
;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof IBIZOrderTreeGridExViewBase
*/
@
Prop
({
default
:
true
})
public
viewDefaultUsage
!
:
boolean
;
/**
* 视图默认使用
*
* @type {string}
* @memberof IBIZOrderTreeGridExViewBase
*/
@
Inject
({
from
:
'navModel'
,
default
:
'tab'
})
public
navModel
!
:
string
;
/**
* 视图标识
*
* @type {string}
* @memberof IBIZOrderTreeGridExViewBase
*/
public
viewtag
:
string
=
'17c2991a0bd88cfd2bd6f8651537450b'
;
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof IBIZOrderTreeGridExViewBase
*/
public
customViewNavContexts
:
any
=
{
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof IBIZOrderTreeGridExViewBase
*/
public
customViewParams
:
any
=
{
};
/**
* 视图模型数据
*
* @type {*}
* @memberof IBIZOrderTreeGridExViewBase
*/
public
model
:
any
=
{
srfCaption
:
'entities.ibizorder.views.treegridexview.caption'
,
srfTitle
:
'entities.ibizorder.views.treegridexview.title'
,
srfSubTitle
:
'entities.ibizorder.views.treegridexview.subtitle'
,
dataInfo
:
''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof IBIZOrderTreeGridExViewBase
*/
@
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 IBIZOrderTreeGridExViewBase
*/
@
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 IBIZOrderTreeGridExViewBase
*/
public
containerModel
:
any
=
{
view_toolbar
:
{
name
:
'toolbar'
,
type
:
'TOOLBAR'
},
view_treegridex
:
{
name
:
'treegridex'
,
type
:
'TREEGRIDEX'
},
wflinks
:
[],
};
/**
* 视图刷新
*
* @param {*} args
* @memberof IBIZOrderTreeGridExViewBase
*/
public
refresh
(
args
?:
any
):
void
{
const
refs
:
any
=
this
.
$refs
;
if
(
refs
&&
refs
.
treegridex
)
{
refs
.
treegridex
.
refresh
();
}
}
/**
* 计数器刷新
*
* @memberof IBIZOrderTreeGridExViewBase
*/
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 IBIZOrderTreeGridExViewBase
*/
public
viewState
:
Subject
<
ViewState
>
=
new
Subject
();
/**
* 工具栏模型
*
* @type {*}
* @memberof IBIZOrderTreeGridExView
*/
public
toolBarModels
:
any
=
{
};
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof IBIZOrderTreeGridExViewBase
*/
public
engine
:
TreeGridExViewEngine
=
new
TreeGridExViewEngine
();
/**
* 引擎初始化
*
* @public
* @memberof IBIZOrderTreeGridExViewBase
*/
public
engineInit
():
void
{
this
.
engine
.
init
({
view
:
this
,
treegridex
:
this
.
$refs
.
treegridex
,
keyPSDEField
:
'ibizorder'
,
majorPSDEField
:
'ibizordername'
,
isLoadDefault
:
true
,
});
}
/**
* 应用导航服务
*
* @type {*}
* @memberof IBIZOrderTreeGridExViewBase
*/
public
navDataService
=
NavDataService
.
getInstance
(
this
.
$store
);
/**
* 导航服务事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZOrderTreeGridExViewBase
*/
public
serviceStateEvent
:
Subscription
|
undefined
;
/**
* 门户部件状态对象
*
* @type {*}
* @memberof IBIZOrderTreeGridExViewBase
*/
@
Prop
()
public
portletState
?:
any
;
/**
* 门户部件状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZOrderTreeGridExViewBase
*/
public
portletStateEvent
:
Subscription
|
undefined
;
/**
* 应用上下文
*
* @type {*}
* @memberof IBIZOrderTreeGridExViewBase
*/
public
context
:
any
=
{};
/**
* 视图参数
*
* @type {*}
* @memberof IBIZOrderTreeGridExViewBase
*/
public
viewparams
:
any
=
{};
/**
* 视图缓存数据
*
* @type {*}
* @memberof IBIZOrderTreeGridExViewBase
*/
public
viewCacheData
:
any
;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof IBIZOrderTreeGridExViewBase
*/
public
counterServiceArray
:
Array
<
any
>
=
[];
/**
* 解析视图参数
*
* @public
* @memberof IBIZOrderTreeGridExViewBase
*/
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
,{
'ibizorder'
:
inputvalue
});
}
//初始化视图唯一标识
Object
.
assign
(
this
.
context
,{
srfsessionid
:
this
.
$util
.
createUUID
()});
this
.
handleCustomViewData
();
//初始化导航数据
this
.
initNavDataWithRoute
();
}
/**
* 处理自定义视图数据
*
* @memberof IBIZOrderTreeGridExViewBase
*/
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 IBIZOrderTreeGridExViewBase
*/
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 IBIZOrderTreeGridExViewBase
*/
public
initNavDataWithRoute
(
data
:
any
=
null
,
isNew
:
boolean
=
false
,
isAlways
:
boolean
=
false
){
if
(
isAlways
||
(
this
.
viewDefaultUsage
&&
Object
.
is
(
this
.
navModel
,
"route"
))
){
this
.
navDataService
.
addNavData
({
id
:
'ibizorder-tree-grid-ex-view'
,
tag
:
this
.
viewtag
,
srfkey
:
isNew
?
null
:
this
.
context
.
ibizorder
,
title
:
this
.
$t
(
this
.
model
.
srfCaption
),
data
:
data
,
context
:
this
.
context
,
viewparams
:
this
.
viewparams
,
path
:
this
.
$route
.
fullPath
});
}
}
/**
* 初始化导航数据(分页模式)
*
* @memberof IBIZOrderTreeGridExViewBase
*/
public
initNavDataWithTab
(
data
:
any
=
null
,
isOnlyAdd
:
boolean
=
true
,
isAlways
:
boolean
=
false
){
if
(
isAlways
||
(
this
.
viewDefaultUsage
&&
!
Object
.
is
(
this
.
navModel
,
"route"
))
){
this
.
navDataService
.
addNavDataByOnly
({
id
:
'ibizorder-tree-grid-ex-view'
,
tag
:
this
.
viewtag
,
srfkey
:
this
.
context
.
ibizorder
,
title
:
this
.
$t
(
this
.
model
.
srfCaption
),
data
:
data
,
context
:
this
.
context
,
viewparams
:
this
.
viewparams
,
path
:
this
.
$route
.
fullPath
},
isOnlyAdd
);
}
}
/**
* Vue声明周期
*
* @memberof IBIZOrderTreeGridExViewBase
*/
public
created
()
{
this
.
afterCreated
();
}
/**
* 执行created后的逻辑
*
* @memberof IBIZOrderTreeGridExViewBase
*/
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
,
'ibizorder-tree-grid-ex-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
,
'IBIZOrderTreeGridExView'
)){
return
;
}
if
(
Object
.
is
(
res
.
action
,
'refresh'
)
&&
_this
.
refresh
&&
_this
.
refresh
instanceof
Function
){
_this
.
refresh
();
}
})
}
}
/**
* 销毁之前
*
* @memberof IBIZOrderTreeGridExViewBase
*/
public
beforeDestroy
()
{
this
.
$store
.
commit
(
'viewaction/removeView'
,
this
.
viewtag
);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof IBIZOrderTreeGridExViewBase
*/
public
mounted
()
{
this
.
afterMounted
();
}
/**
* 执行mounted后的逻辑
*
* @memberof IBIZOrderTreeGridExViewBase
*/
public
afterMounted
(){
const
_this
:
any
=
this
;
_this
.
engineInit
();
if
(
_this
.
loadModel
&&
_this
.
loadModel
instanceof
Function
)
{
_this
.
loadModel
();
}
}
/**
* treegridex 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZOrderTreeGridExViewBase
*/
public
treegridex_selectionchange
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'treegridex'
,
'selectionchange'
,
$event
);
}
/**
* treegridex 部件 beforeload 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZOrderTreeGridExViewBase
*/
public
treegridex_beforeload
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'treegridex'
,
'beforeload'
,
$event
);
}
/**
* treegridex 部件 rowdblclick 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZOrderTreeGridExViewBase
*/
public
treegridex_rowdblclick
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'treegridex'
,
'rowdblclick'
,
$event
);
}
/**
* treegridex 部件 remove 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZOrderTreeGridExViewBase
*/
public
treegridex_remove
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'treegridex'
,
'remove'
,
$event
);
}
/**
* treegridex 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZOrderTreeGridExViewBase
*/
public
treegridex_load
(
$event
:
any
,
$event2
?:
any
)
{
this
.
engine
.
onCtrlEvent
(
'treegridex'
,
'load'
,
$event
);
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof IBIZOrderTreeGridExViewBase
*/
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 IBIZOrderTreeGridExViewBase
*/
public
destroyed
(){
this
.
afterDestroyed
();
}
/**
* 执行destroyed后的逻辑
*
* @memberof IBIZOrderTreeGridExViewBase
*/
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
();
}
}
/**
* 打开编辑数据
*
* @memberof IBIZOrderTreeGridExViewBase
*/
public
opendata
(
args
:
any
[],
params
?:
any
,
$event
?:
any
,
xData
?:
any
)
{
if
(
xData
&&
xData
.
opendata
instanceof
Function
)
{
xData
.
opendata
(
args
);
}
}
}
</
script
>
<
style
lang=
'less'
>
@import './ibizorder-tree-grid-ex-view.less';
</
style
>
\ No newline at end of file
app_Web/src/pages/sample/ibizorder-tree-grid-ex-view/ibizorder-tree-grid-ex-view.less
0 → 100644
浏览文件 @
dfe3779a
.ibizorder-tree-grid-ex-view{
position: relative;
}
.toolbar-container {
button {
margin: 6px 0px 4px 4px;
.caption {
margin-left: 4px;
}
}
.seperator {
color: #dcdee2;
margin: 0 0px 0 4px;
}
}
// this is less
app_Web/src/pages/sample/ibizorder-tree-grid-ex-view/ibizorder-tree-grid-ex-view.vue
0 → 100644
浏览文件 @
dfe3779a
<
script
lang=
'tsx'
>
import
{
Component
}
from
'vue-property-decorator'
;
import
IBIZOrderTreeGridExViewBase
from
'./ibizorder-tree-grid-ex-view-base.vue'
;
import
view_treegridex
from
'@widgets/ibizorder/order-tree-grid-treegridex/order-tree-grid-treegridex.vue'
;
@
Component
({
components
:
{
view_treegridex
,
},
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
IBIZOrderTreeGridExView
extends
IBIZOrderTreeGridExViewBase
{
}
</
script
>
\ No newline at end of file
app_Web/src/pages/sample/index/page-register.ts
浏览文件 @
dfe3779a
...
...
@@ -29,7 +29,6 @@ export const PageComponents = {
Vue
.
component
(
'ibizbookcalendar-view'
,
()
=>
import
(
'@pages/sample/ibizbookcalendar-view/ibizbookcalendar-view.vue'
));
Vue
.
component
(
'ibizhardware-index-pickup-data-view'
,
()
=>
import
(
'@pages/sample/ibizhardware-index-pickup-data-view/ibizhardware-index-pickup-data-view.vue'
));
Vue
.
component
(
'ibizorder-sgrid-view2'
,
()
=>
import
(
'@pages/sample/ibizorder-sgrid-view2/ibizorder-sgrid-view2.vue'
));
Vue
.
component
(
'ibizbooktree-grid-ex-view'
,
()
=>
import
(
'@pages/sample/ibizbooktree-grid-ex-view/ibizbooktree-grid-ex-view.vue'
));
Vue
.
component
(
'ibizcustomer-mpickup-view'
,
()
=>
import
(
'@pages/sample/ibizcustomer-mpickup-view/ibizcustomer-mpickup-view.vue'
));
Vue
.
component
(
'ibizuniproduct-pickup-grid-view'
,
()
=>
import
(
'@pages/sample/ibizuniproduct-pickup-grid-view/ibizuniproduct-pickup-grid-view.vue'
));
Vue
.
component
(
'ibizorder-odsp-wfexp-view'
,
()
=>
import
(
'@pages/sample/ibizorder-odsp-wfexp-view/ibizorder-odsp-wfexp-view.vue'
));
...
...
@@ -123,6 +122,7 @@ export const PageComponents = {
Vue
.
component
(
'ibizorder-sedit-view4'
,
()
=>
import
(
'@pages/sample/ibizorder-sedit-view4/ibizorder-sedit-view4.vue'
));
Vue
.
component
(
'ibizsoftware-suit-grid-view9'
,
()
=>
import
(
'@pages/sample/ibizsoftware-suit-grid-view9/ibizsoftware-suit-grid-view9.vue'
));
Vue
.
component
(
'ibizbookhas-panel-list-view'
,
()
=>
import
(
'@pages/sample/ibizbookhas-panel-list-view/ibizbookhas-panel-list-view.vue'
));
Vue
.
component
(
'ibizorder-tree-grid-ex-view'
,
()
=>
import
(
'@pages/sample/ibizorder-tree-grid-ex-view/ibizorder-tree-grid-ex-view.vue'
));
Vue
.
component
(
'ibizorder-sf6-grid-view'
,
()
=>
import
(
'@pages/sample/ibizorder-sf6-grid-view/ibizorder-sf6-grid-view.vue'
));
Vue
.
component
(
'ibizorder-detail-edit-view'
,
()
=>
import
(
'@pages/sample/ibizorder-detail-edit-view/ibizorder-detail-edit-view.vue'
));
Vue
.
component
(
'ibizbookusr8-grid-view'
,
()
=>
import
(
'@pages/sample/ibizbookusr8-grid-view/ibizbookusr8-grid-view.vue'
));
...
...
app_Web/src/pages/sample/index/router.ts
浏览文件 @
dfe3779a
...
...
@@ -531,20 +531,6 @@ const router = new Router({
},
component
:
()
=>
import
(
'@pages/sample/ibizorder-sgrid-view2/ibizorder-sgrid-view2.vue'
),
},
{
path
:
'ibizbooks/:ibizbook?/treegridexview/:treegridexview?'
,
meta
:
{
caption
:
'entities.ibizbook.views.treegridexview.caption'
,
info
:
''
,
parameters
:
[
{
pathName
:
'index'
,
parameterName
:
'index'
},
{
pathName
:
'ibizbooks'
,
parameterName
:
'ibizbook'
},
{
pathName
:
'treegridexview'
,
parameterName
:
'treegridexview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/sample/ibizbooktree-grid-ex-view/ibizbooktree-grid-ex-view.vue'
),
},
{
path
:
'ibizcustomers/:ibizcustomer?/mpickupview/:mpickupview?'
,
meta
:
{
...
...
@@ -1967,6 +1953,20 @@ const router = new Router({
},
component
:
()
=>
import
(
'@pages/sample/ibizbookhas-panel-list-view/ibizbookhas-panel-list-view.vue'
),
},
{
path
:
'ibizorders/:ibizorder?/treegridexview/:treegridexview?'
,
meta
:
{
caption
:
'entities.ibizorder.views.treegridexview.caption'
,
info
:
''
,
parameters
:
[
{
pathName
:
'index'
,
parameterName
:
'index'
},
{
pathName
:
'ibizorders'
,
parameterName
:
'ibizorder'
},
{
pathName
:
'treegridexview'
,
parameterName
:
'treegridexview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/sample/ibizorder-tree-grid-ex-view/ibizorder-tree-grid-ex-view.vue'
),
},
{
path
:
'ibizorders/:ibizorder?/sf6gridview/:sf6gridview?'
,
meta
:
{
...
...
@@ -3148,6 +3148,19 @@ const router = new Router({
},
component
:
()
=>
import
(
'@pages/sample/ibizorder-pickup-view/ibizorder-pickup-view.vue'
),
},
{
path
:
'/ibizorders/:ibizorder?/treegridexview/:treegridexview?'
,
meta
:
{
caption
:
'entities.ibizorder.views.treegridexview.caption'
,
info
:
''
,
parameters
:
[
{
pathName
:
'ibizorders'
,
parameterName
:
'ibizorder'
},
{
pathName
:
'treegridexview'
,
parameterName
:
'treegridexview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/sample/ibizorder-tree-grid-ex-view/ibizorder-tree-grid-ex-view.vue'
),
},
{
path
:
'/ibizsample0003s/:ibizsample0003?/sf4editview/:sf4editview?'
,
meta
:
{
...
...
@@ -3372,19 +3385,6 @@ const router = new Router({
},
component
:
()
=>
import
(
'@pages/sample/ibizbookrules-edit-view/ibizbookrules-edit-view.vue'
),
},
{
path
:
'/ibizbooks/:ibizbook?/treegridexview/:treegridexview?'
,
meta
:
{
caption
:
'entities.ibizbook.views.treegridexview.caption'
,
info
:
''
,
parameters
:
[
{
pathName
:
'ibizbooks'
,
parameterName
:
'ibizbook'
},
{
pathName
:
'treegridexview'
,
parameterName
:
'treegridexview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/sample/ibizbooktree-grid-ex-view/ibizbooktree-grid-ex-view.vue'
),
},
{
path
:
'/ibizorders/:ibizorder?/f13editview/:f13editview?'
,
meta
:
{
...
...
app_Web/src/store/modules/view-action/state.ts
浏览文件 @
dfe3779a
...
...
@@ -165,6 +165,15 @@ export const viewstate: any = {
'ab95605c916465005585241e9e74c009'
,
],
},
{
viewtag
:
'17c2991a0bd88cfd2bd6f8651537450b'
,
viewmodule
:
'Sample'
,
viewname
:
'IBIZOrderTreeGridExView'
,
viewaction
:
''
,
viewdatachange
:
false
,
refviews
:
[
],
},
{
viewtag
:
'19d36909f837de28880553dc9a190922'
,
viewmodule
:
'Sample'
,
...
...
@@ -201,7 +210,6 @@ export const viewstate: any = {
'fdb297cd4b12374534413c3053aec1b8'
,
'f4c5c766fd5755b694e0401dddc4d1ad'
,
'e7441fa67d425df343d996c745fb5d6b'
,
'2ccd29eeaeded3ea5a713a19cd67a83e'
,
'aa68a83577209ff0ec3864aec4e194f2'
,
'692ede21641dfdb7075ede69d7c4ad33'
,
'd69d223e4d3aeb8d947ac9b9ddc60a7e'
,
...
...
@@ -257,6 +265,7 @@ export const viewstate: any = {
'7f65e6161c444d29e1f53f1cb76e92de'
,
'756fecec409c3a955f0cd737259d27c7'
,
'490f607f17e7cc8ceccc77f2d0b9a70d'
,
'17c2991a0bd88cfd2bd6f8651537450b'
,
'13ed6c02918e612bac45715a6f300f2f'
,
'9c8e1b12e5e55164c2ec0e5617e1574b'
,
'e9b54ef29b192ecd2da05ff9570eb4d5'
,
...
...
@@ -419,16 +428,6 @@ export const viewstate: any = {
refviews
:
[
],
},
{
viewtag
:
'2ccd29eeaeded3ea5a713a19cd67a83e'
,
viewmodule
:
'Sample'
,
viewname
:
'IBIZBOOKTreeGridExView'
,
viewaction
:
''
,
viewdatachange
:
false
,
refviews
:
[
'b3429ecc4d89a02bc5f5279f1bd7f620'
,
],
},
{
viewtag
:
'2cd3a77cbd2aad4551b7a6a009419d52'
,
viewmodule
:
'Sample'
,
...
...
app_Web/src/widgets/app/main-menu-appmenu/main-menu-appmenu-base.vue
浏览文件 @
dfe3779a
...
...
@@ -596,6 +596,9 @@ export default class MainMenuBase extends Vue implements ControlInterface {
case
'Auto375'
:
this
.
clickAuto375
(
item
);
return
;
case
'AppFunc73'
:
this
.
clickAppFunc73
(
item
);
return
;
case
'Auto106'
:
this
.
clickAuto106
(
item
);
return
;
...
...
@@ -764,9 +767,6 @@ export default class MainMenuBase extends Vue implements ControlInterface {
case
'Auto243'
:
this
.
clickAuto243
(
item
);
return
;
case
'AppFunc30'
:
this
.
clickAppFunc30
(
item
);
return
;
case
'AppFunc66'
:
this
.
clickAppFunc66
(
item
);
return
;
...
...
@@ -1482,6 +1482,29 @@ export default class MainMenuBase extends Vue implements ControlInterface {
})
}
/**
* 树表格(增强)
*
* @param {*} [item={}]
* @memberof MainMenu
*/
public
clickAppFunc73
(
item
:
any
=
{})
{
const
viewparam
:
any
=
{};
Object
.
assign
(
viewparam
,
{});
const
deResParameters
:
any
[]
=
[];
const
parameters
:
any
[]
=
[
{
pathName
:
'ibizorders'
,
parameterName
:
'ibizorder'
},
{
pathName
:
'treegridexview'
,
parameterName
:
'treegridexview'
},
];
const
path
:
string
=
this
.
$viewTool
.
buildUpRoutePath
(
this
.
$route
,
{},
deResParameters
,
parameters
,
[],
viewparam
);
if
(
Object
.
is
(
this
.
$route
.
fullPath
,
path
)){
return
;
}
this
.
$nextTick
(
function
(){
this
.
$router
.
push
(
path
);
})
}
/**
* 表单项值重置
*
...
...
@@ -2770,29 +2793,6 @@ export default class MainMenuBase extends Vue implements ControlInterface {
})
}
/**
* 图书实体树表格
*
* @param {*} [item={}]
* @memberof MainMenu
*/
public
clickAppFunc30
(
item
:
any
=
{})
{
const
viewparam
:
any
=
{};
Object
.
assign
(
viewparam
,
{});
const
deResParameters
:
any
[]
=
[];
const
parameters
:
any
[]
=
[
{
pathName
:
'ibizbooks'
,
parameterName
:
'ibizbook'
},
{
pathName
:
'treegridexview'
,
parameterName
:
'treegridexview'
},
];
const
path
:
string
=
this
.
$viewTool
.
buildUpRoutePath
(
this
.
$route
,
{},
deResParameters
,
parameters
,
[],
viewparam
);
if
(
Object
.
is
(
this
.
$route
.
fullPath
,
path
)){
return
;
}
this
.
$nextTick
(
function
(){
this
.
$router
.
push
(
path
);
})
}
/**
* 应用门户视图
*
...
...
app_Web/src/widgets/app/main-menu-appmenu/main-menu-appmenu-model.ts
浏览文件 @
dfe3779a
...
...
@@ -1145,7 +1145,7 @@ export default class MainMenuModel {
iconcls
:
''
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
'AppFunc
30
'
,
appfunctag
:
'AppFunc
73
'
,
resourcetag
:
''
,
authtag
:
'Web-MainMenu-menuitem110'
,
},
...
...
app_Web/src/widgets/ibizorder/order-tree-grid-treegridex/order-tree-grid-treegridex-base.vue
0 → 100644
浏览文件 @
dfe3779a
<
template
>
<el-table
ref=
"treegridex"
:data=
"items"
row-key=
"id"
border
lazy
height=
"100%"
:row-class-name=
"setRowClass"
:load=
"loadTreeNode"
:tree-props=
"
{ children: 'children', hasChildren: 'leaf' }"
:select-on-indeterminate="isSingleSelect"
:highlight-current-row="isSingleSelect"
@current-change="select"
>
<template
slot=
"empty"
>
{{
$t
(
'entities.ibizorder.ordertreegrid_treegridex.nodata'
)
}}
</
template
>
<el-table-column
show-overflow-tooltip
prop=
"name"
label=
"名称"
:width=
"180"
:align=
"''"
>
<
template
v-slot=
"{ row }"
>
<span>
{{
getColumnValue
(
row
,
'name'
)
}}
</span>
</
template
>
</el-table-column>
<el-table-column
show-overflow-tooltip
prop=
"id"
label=
"标识"
:width=
"180"
:align=
"''"
>
<
template
v-slot=
"{ row }"
>
<span>
{{
getColumnValue
(
row
,
'id'
)
}}
</span>
</
template
>
</el-table-column>
<el-table-column
show-overflow-tooltip
prop=
"updatedate"
label=
"更新日期"
:width=
"180"
:align=
"''"
>
<
template
v-slot=
"{ row }"
>
<span>
{{
getColumnValue
(
row
,
'updatedate'
)
}}
</span>
</
template
>
</el-table-column>
</el-table>
</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
IBIZOrderService
from
'@/service/ibizorder/ibizorder-service'
;
import
OrderTreeGridService
from
'./order-tree-grid-treegridex-service'
;
import
IBIZOrderUIService
from
'@/uiservice/ibizorder/ibizorder-ui-service'
;
@
Component
({
components
:
{
}
})
export
default
class
OrderTreeGridBase
extends
Vue
implements
ControlInterface
{
/**
* 名称
*
* @type {string}
* @memberof OrderTreeGridBase
*/
@
Prop
()
public
name
?:
string
;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof OrderTreeGridBase
*/
@
Prop
()
public
viewState
!
:
Subject
<
ViewState
>
;
/**
* 应用上下文
*
* @type {*}
* @memberof OrderTreeGridBase
*/
@
Prop
()
public
context
!
:
any
;
/**
* 视图参数
*
* @type {*}
* @memberof OrderTreeGridBase
*/
@
Prop
()
public
viewparams
!
:
any
;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof OrderTreeGridBase
*/
public
viewStateEvent
:
Subscription
|
undefined
;
/**
* 获取部件类型
*
* @returns {string}
* @memberof OrderTreeGridBase
*/
public
getControlType
():
string
{
return
'TREEGRIDEX'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof OrderTreeGridBase
*/
public
counterServiceArray
:
Array
<
any
>
=
[];
/**
* 建构部件服务对象
*
* @type {OrderTreeGridService}
* @memberof OrderTreeGridBase
*/
public
service
:
OrderTreeGridService
=
new
OrderTreeGridService
({
$store
:
this
.
$store
});
/**
* 实体服务对象
*
* @type {IBIZOrderService}
* @memberof OrderTreeGridBase
*/
public
appEntityService
:
IBIZOrderService
=
new
IBIZOrderService
({
$store
:
this
.
$store
});
/**
* 转化数据
*
* @param {any} args
* @memberof OrderTreeGridBase
*/
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 OrderTreeGridBase
*/
public
closeView
(
args
:
any
):
void
{
let
_this
:
any
=
this
;
_this
.
$emit
(
'closeview'
,
[
args
]);
}
/**
* 计数器刷新
*
* @memberof OrderTreeGridBase
*/
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 {boolean}
* @memberof OrderTreeGridBase
*/
@
Prop
({
default
:
true
})
public
showBusyIndicator
?:
boolean
;
/**
* 部件行为--load
*
* @type {string}
* @memberof OrderTreeGridBase
*/
@
Prop
()
public
loadAction
!
:
string
;
/**
* 是否单选
*
* @type {boolean}
* @memberof OrderTreeGridBase
*/
@
Prop
({
default
:
true
})
public
isSingleSelect
!
:
boolean
;
/**
* 部件样式名
*
* @public
* @type {any[]}
* @memberof OrderTreeGridBase
*/
public
controlClass
:
string
=
"treegridex"
;
/**
* 数据集合
*
* @public
* @type {any[]}
* @memberof OrderTreeGridBase
*/
public
items
:
any
[]
=
[];
/**
* 默认展开节点集合
*
* @memberof OrderTreeGridBase
*/
public
defExpands
:
any
=
[];
/**
* 行节点下标
*
* @memberof OrderTreeGridBase
*/
public
itemNum
:
any
=
{};
/**
* 计数下标
*
* @memberof OrderTreeGridBase
*/
public
num
:
number
=
0
;
/**
* 获取列属性值
*
* @public
* @memberof OrderTreeGridBase
*/
public
getColumnValue
(
task
:
any
,
field
:
string
)
{
if
(
Object
.
is
(
task
.
id
.
split
(
';'
)[
0
],
'orderData'
))
{
return
task
[
field
];
}
if
(
Object
.
is
(
task
.
id
.
split
(
';'
)[
0
],
'orderDetailData'
))
{
return
task
[
field
];
}
if
(
Object
.
is
(
task
.
id
.
split
(
';'
)[
0
],
'ROOT'
))
{
return
task
[
field
];
}
}
/**
* 获取代码项
*
* @public
* @memberof OrderTreeGridBase
*/
public
getCodeListItem
(
codelist
:
any
,
val
:
any
)
{
for
(
let
i
=
0
;
i
<
codelist
.
items
.
length
;
i
++
)
{
if
(
Object
.
is
(
codelist
.
items
[
i
].
value
,
val
))
{
return
codelist
.
items
[
i
].
text
;
}
}
return
codelist
.
emptytext
;
}
/**
* 搜索获取日程事件
*
* @param {*} $event 日期信息
* @memberof OrderTreeGridBase
*/
public
load
(
task
:
any
=
{},
resolve
?:
any
)
{
const
params
:
any
=
{
srfnodeid
:
task
&&
task
.
id
?
task
.
id
:
"#"
,
srfnodefilter
:
''
};
let
tempViewParams
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
));
let
curNode
:
any
=
{};
Util
.
deepObjectMerge
(
curNode
,
task
);
let
tempContext
:
any
=
this
.
computecurNodeContext
(
curNode
);
if
(
curNode
&&
curNode
.
srfparentdename
)
{
Object
.
assign
(
tempContext
,{
srfparentdename
:
curNode
.
srfparentdename
});
Object
.
assign
(
tempViewParams
,{
srfparentdename
:
curNode
.
srfparentdename
});
}
if
(
curNode
&&
curNode
.
srfparentkey
)
{
Object
.
assign
(
tempContext
,{
srfparentkey
:
curNode
.
srfparentkey
});
Object
.
assign
(
tempViewParams
,{
srfparentkey
:
curNode
.
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
});
return
;
}
response
.
data
.
forEach
((
item
:
any
)
=>
{
this
.
itemNum
[
item
.
id
]
=
this
.
num
++
;
if
(
!
item
.
collapsed
)
{
this
.
defExpands
.
push
(
item
);
}
})
if
(
resolve
&&
resolve
instanceof
Function
)
{
resolve
(
response
.
data
);
}
else
{
this
.
items
=
[...
response
.
data
];
}
this
.
$nextTick
(()
=>
{
this
.
expandDefNode
();
})
this
.
$emit
(
"load"
,
this
.
items
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
info
});
});
}
/**
* 加载节点
*
* @memberof TreeTable
*/
public
loadTreeNode
(
tree
:
any
,
treeNode
:
any
,
resolve
:
any
)
{
this
.
load
(
tree
,
resolve
);
}
/**
* 计算当前节点的上下文
*
* @param {*} curNode 当前节点
* @memberof OrderTreeGridBase
*/
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 {*} item 当前节点
* @memberof OrderTreeGridBase
*/
public
itemExpand
(
item
:
any
)
{
}
/**
* 刷新
*
* @memberof OrderTreeGridBase
*/
public
refresh
(
args
?:
any
)
{
this
.
load
();
}
/**
* 选中的数据
*
* @returns {any[]}
* @memberof OrderTreeGridBase
*/
public
selections
:
any
[]
=
[];
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof OrderTreeGridBase
*/
public
getDatas
():
any
[]
{
return
this
.
selections
;
}
/**
* 获取单项树
*
* @returns {*}
* @memberof OrderTreeGridBase
*/
public
getData
():
any
{
return
this
.
selections
.
length
>
0
?
this
.
selections
[
0
]
:
null
;
}
/**
* vue 生命周期
*
* @returns
* @memberof OrderTreeGridBase
*/
public
created
()
{
this
.
afterCreated
();
}
/**
* 执行created后的逻辑
*
* @memberof OrderTreeGridBase
*/
public
afterCreated
()
{
this
.
viewStateEvent
=
this
.
viewState
.
subscribe
(({
tag
,
action
,
data
})
=>
{
if
(
!
Object
.
is
(
tag
,
this
.
name
))
{
return
;
}
if
(
Object
.
is
(
'load'
,
action
))
{
this
.
load
(
data
);
}
});
}
/**
* 设置行Class
*
* @returns
* @memberof OrderTreeGridBase
*/
public
setRowClass
({
row
,
rowIndex
}:
{
row
:
any
,
rowIndex
:
number
})
{
return
'treegrid'
+
this
.
itemNum
[
row
.
id
];
}
/**
* 展开默认节点
*
* @returns
* @memberof OrderTreeGridBase
*/
public
expandDefNode
()
{
if
(
this
.
defExpands
.
length
>
0
)
{
let
item
:
any
=
this
.
defExpands
[
0
];
this
.
defExpands
.
splice
(
0
,
1
);
let
trs
:
any
=
this
.
$el
.
getElementsByClassName
(
'treegrid'
+
this
.
itemNum
[
item
.
id
]);
if
(
trs
)
{
let
icons
:
any
=
trs
[
0
].
getElementsByClassName
(
'el-table__expand-icon'
);
icons
[
0
].
click
();
}
}
}
/**
* 选中变化
*
* @returns
* @memberof OrderTreeGridBase
*/
public
select
(
$event
:
any
)
{
if
(
!
$event
)
{
return
;
}
this
.
selections
=
[
JSON
.
parse
(
JSON
.
stringify
(
$event
))];
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
}
/**
* 打开编辑数据
*
* @returns
* @memberof OrderTreeGridBase
*/
public
opendata
(
args
:
any
)
{
if
(
this
.
selections
.
length
===
0
)
{
return
;
}
if
(
Object
.
is
(
this
.
selections
[
0
].
id
.
split
(
';'
)[
0
],
'orderData'
))
{
}
if
(
Object
.
is
(
this
.
selections
[
0
].
id
.
split
(
';'
)[
0
],
'orderDetailData'
))
{
}
if
(
Object
.
is
(
this
.
selections
[
0
].
id
.
split
(
';'
)[
0
],
'ROOT'
))
{
}
}
/**
* vue 生命周期
*
* @memberof OrderTreeGridBase
*/
public
destroyed
()
{
this
.
afterDestroy
();
}
/**
* 执行destroyed后的逻辑
*
* @memberof OrderTreeGridBase
*/
public
afterDestroy
()
{
if
(
this
.
viewStateEvent
)
{
this
.
viewStateEvent
.
unsubscribe
();
}
}
}
</
script
>
<
style
lang=
'less'
>
@import './order-tree-grid-treegridex.less';
</
style
>
\ No newline at end of file
app_Web/src/widgets/ibizorder/order-tree-grid-treegridex/order-tree-grid-treegridex-model.ts
0 → 100644
浏览文件 @
dfe3779a
/**
* OrderTreeGrid 部件模型
*
* @export
* @class OrderTreeGridModel
*/
export
default
class
OrderTreeGridModel
{
/**
* 日历项类型
*
* @returns {any[]}
* @memberof OrderTreeGridTreegridexMode
*/
public
itemType
:
string
=
""
;
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof OrderTreeGridTreegridexMode
*/
public
getDataItems
():
any
[]
{
let
dataItems
:
any
=
[
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name
:
'srffrontuf'
,
prop
:
'srffrontuf'
,
dataType
:
'TEXT'
,
},
{
name
:
'style'
,
},
{
name
:
'textColor'
,
},
{
name
:
'itemType'
,
},
{
name
:
'parentId'
},
{
name
:
'query'
,
prop
:
'query'
,
},
];
switch
(
this
.
itemType
){
case
"orderData"
:
dataItems
=
[...
dataItems
,
{
name
:
'id'
,
prop
:
'ibizorderid'
},
{
name
:
'name'
,
prop
:
'ibizordername'
},
{
name
:
'id'
,
prop
:
'orderuid'
},
{
name
:
'updatedate'
,
prop
:
'updatedate'
},
];
break
;
case
"orderDetailData"
:
dataItems
=
[...
dataItems
,
{
name
:
'id'
,
prop
:
'ibizorderdetailid'
},
{
name
:
'updatedate'
,
prop
:
'updatedate'
},
{
name
:
'id'
,
prop
:
'ibizorderdetailid'
},
{
name
:
'name'
,
prop
:
'ibizorderdetailname'
},
];
break
;
}
return
dataItems
;
}
}
\ No newline at end of file
app_Web/src/widgets/ibizorder/order-tree-grid-treegridex/order-tree-grid-treegridex-service.ts
0 → 100644
浏览文件 @
dfe3779a
import
{
Http
,
Util
,
Errorlog
}
from
'@/utils'
;
import
ControlService
from
'@/widgets/control-service'
;
import
IBIZOrderService
from
'@/service/ibizorder/ibizorder-service'
;
import
OrderTreeGridModel
from
'./order-tree-grid-treegridex-model'
;
import
CodeListService
from
"@/codelist/codelist-service"
;
import
i18n
from
'@/locale'
;
import
IBIZOrderDetailService
from
'@service/ibizorder-detail/ibizorder-detail-service'
;
/**
* OrderTreeGrid 部件服务对象
*
* @export
* @class OrderTreeGridService
*/
export
default
class
OrderTreeGridService
extends
ControlService
{
/**
* 订单服务对象
*
* @type {IBIZOrderService}
* @memberof OrderTreeGridService
*/
public
appEntityService
:
IBIZOrderService
=
new
IBIZOrderService
({
$store
:
this
.
getStore
()
});
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof OrderTreeGridService
*/
public
setTempMode
(){
this
.
isTempMode
=
false
;
}
/**
* Creates an instance of OrderTreeGridService.
*
* @param {*} [opts={}]
* @memberof OrderTreeGridService
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
this
.
model
=
new
OrderTreeGridModel
();
}
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof OrderTreeGridService
*/
public
codeListService
:
CodeListService
=
new
CodeListService
({
$store
:
this
.
getStore
()
});
/**
* 订单明细服务对象
*
* @type {IBIZOrderDetailService}
* @memberof OrderTreeGridService
*/
public
ibizorderdetailService
:
IBIZOrderDetailService
=
new
IBIZOrderDetailService
({
$store
:
this
.
getStore
()
});
/**
* 节点分隔符号
*
* @public
* @type {string}
* @memberof OrderTreeGridService
*/
public
TREENODE_SEPARATOR
:
string
=
';'
;
/**
* 订单数据节点分隔符号
*
* @public
* @type {string}
* @memberof OrderTreeGridService
*/
public
TREENODE_ORDERDATA
:
string
=
'orderData'
;
/**
* 订单明细数据节点分隔符号
*
* @public
* @type {string}
* @memberof OrderTreeGridService
*/
public
TREENODE_ORDERDETAILDATA
:
string
=
'orderDetailData'
;
/**
* 默认根节点节点分隔符号
*
* @public
* @type {string}
* @memberof OrderTreeGridService
*/
public
TREENODE_ROOT
:
string
=
'ROOT'
;
/**
* 商品类别节点分隔符号
*
* @public
* @type {*}
* @memberof OrderTreeGridService
*/
public
dataModel
:
any
=
{
orderData
:
{
name
:
{
prop
:
'ibizordername'
,
default
:
null
},
id
:
{
prop
:
'orderuid'
,
default
:
null
},
updatedate
:
{
prop
:
'updatedate'
,
default
:
null
},
},
orderDetailData
:
{
updatedate
:
{
prop
:
'updatedate'
,
default
:
null
},
id
:
{
prop
:
'ibizorderdetailid'
,
default
:
null
},
name
:
{
prop
:
'ibizorderdetailname'
,
default
:
null
},
},
ROOT
:
{
},
}
/**
* 获取节点数据
*
* @param {string} action
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof OrderTreeGridService
*/
@
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
=
{};
let
srfotherkey
:
string
=
''
;
if
(
!
srfnodeid
||
Object
.
is
(
srfnodeid
,
'#'
))
{
srfnodeid
=
this
.
TREENODE_ROOT
;
}
else
{
srfotherkey
=
srfnodeid
;
srfnodeid
=
srfnodeid
.
split
(
'_#_'
)[
0
];
}
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
,
srfotherkey
:
srfotherkey
,
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_ORDERDATA
))
{
await
this
.
fillOrderdataNodeChilds
(
context
,
filter
,
list
);
return
Promise
.
resolve
({
status
:
200
,
data
:
list
});
}
if
(
Object
.
is
(
strNodeType
,
this
.
TREENODE_ORDERDETAILDATA
))
{
await
this
.
fillOrderdetaildataNodeChilds
(
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 OrderTreeGridService
*/
@
Errorlog
public
fillOrderdataNodes
(
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
searchFilter
:
any
=
{};
Object
.
assign
(
searchFilter
,
{
total
:
false
});
let
bFirst
:
boolean
=
true
;
let
records
:
any
[]
=
[];
try
{
this
.
searchOrderdata
(
context
,
searchFilter
,
filter
).
then
((
records
:
any
)
=>
{
if
(
records
&&
records
.
length
>
0
){
records
.
forEach
((
entity
:
any
)
=>
{
let
treeNode
:
any
=
{};
// 整理context
let
strId
:
string
=
entity
.
ibizorderid
;
let
strText
:
string
=
entity
.
ibizordername
;
Object
.
assign
(
treeNode
,{
srfparentdename
:
'IBIZOrder'
,
srfparentkey
:
entity
.
ibizorderid
});
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
Object
.
assign
(
tempContext
,{
srfparentdename
:
'IBIZOrder'
,
srfparentkey
:
entity
.
ibizorderid
,
ibizorder
:
strId
})
Object
.
assign
(
treeNode
,{
srfappctx
:
tempContext
});
Object
.
assign
(
treeNode
,{
'ibizorder'
:
strId
});
Object
.
assign
(
treeNode
,
{
srfkey
:
strId
});
Object
.
assign
(
treeNode
,
{
text
:
strText
,
srfmajortext
:
strText
});
let
strNodeId
:
string
=
'orderData'
;
strNodeId
+=
this
.
TREENODE_SEPARATOR
;
strNodeId
+=
strId
;
Object
.
assign
(
treeNode
,
{
id
:
strNodeId
+
'_#_'
+
filter
.
srfnodeid
});
Object
.
assign
(
treeNode
,
{
collapsed
:
true
});
Object
.
assign
(
treeNode
,
{
leaf
:
true
});
Object
.
assign
(
treeNode
,
{
navparams
:
'{}'
});
Object
.
assign
(
treeNode
,
{
nodeid
:
treeNode
.
srfkey
});
Object
.
assign
(
treeNode
,
{
nodeid2
:
filter
.
strRealNodeId
});
if
(
!
Object
.
is
(
filter
.
srfnodeid
,
this
.
TREENODE_ROOT
))
{
Object
.
assign
(
treeNode
,
{
parentId
:
filter
.
srfotherkey
});
}
for
(
let
key
in
this
.
dataModel
.
orderData
)
{
let
item
=
this
.
dataModel
.
orderData
[
key
];
let
propVal
:
any
=
entity
[
item
.
prop
];
try
{
let
def
:
any
=
JSON
.
parse
(
item
.
default
);
propVal
=
propVal
!=
null
?
propVal
:
def
.
value
;
if
(
def
.
hasOwnProperty
(
'bkcolor'
))
{
Object
.
assign
(
treeNode
.
style
,
{
base
:
{
fill
:
def
.
bkcolor
,
stroke
:
def
.
bkcolor
}});
}
if
(
def
.
hasOwnProperty
(
'color'
))
{
Object
.
assign
(
treeNode
.
style
,
{
text
:
{
color
:
def
.
color
}});
}
}
catch
(
e
)
{
propVal
=
propVal
!=
null
?
propVal
:
item
.
default
}
treeNode
[
key
]
=
propVal
}
list
.
push
(
treeNode
);
resolve
(
list
);
bFirst
=
false
;
});
}
else
{
resolve
(
list
);
}
});
}
catch
(
error
)
{
console
.
error
(
error
);
}
});
}
/**
* 获取查询集合
*
* @public
* @param {any{}} context
* @param {*} searchFilter
* @param {*} filter
* @returns {any[]}
* @memberof TestEnetityDatasService
*/
@
Errorlog
public
searchOrderdata
(
context
:
any
=
{},
searchFilter
:
any
,
filter
:
any
):
Promise
<
any
>
{
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
if
(
filter
.
viewparams
){
Object
.
assign
(
searchFilter
,
filter
.
viewparams
);
}
if
(
!
searchFilter
.
page
){
Object
.
assign
(
searchFilter
,{
page
:
0
});
}
if
(
!
searchFilter
.
size
){
Object
.
assign
(
searchFilter
,{
size
:
1000
});
}
if
(
context
&&
context
.
srfparentdename
){
Object
.
assign
(
searchFilter
,{
srfparentdename
:
JSON
.
parse
(
JSON
.
stringify
(
context
)).
srfparentdename
});
}
if
(
context
&&
context
.
srfparentkey
){
Object
.
assign
(
searchFilter
,{
srfparentkey
:
JSON
.
parse
(
JSON
.
stringify
(
context
)).
srfparentkey
});
}
const
_appEntityService
:
any
=
this
.
appEntityService
;
let
list
:
any
[]
=
[];
if
(
_appEntityService
[
'FetchDefault'
]
&&
_appEntityService
[
'FetchDefault'
]
instanceof
Function
)
{
const
response
:
Promise
<
any
>
=
_appEntityService
[
'FetchDefault'
](
context
,
searchFilter
,
false
);
response
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
resolve
([]);
console
.
log
(
JSON
.
stringify
(
context
));
console
.
error
(
'查询FetchDefault数据集异常!'
);
}
const
data
:
any
=
response
.
data
;
if
(
Object
.
keys
(
data
).
length
>
0
)
{
list
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
resolve
(
list
);
}
else
{
resolve
([]);
}
}).
catch
((
response
:
any
)
=>
{
resolve
([]);
console
.
log
(
JSON
.
stringify
(
context
));
console
.
error
(
'查询FetchDefault数据集异常!'
);
});
}
})
}
/**
* 填充 树视图节点[订单数据]子节点
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof OrderTreeGridService
*/
@
Errorlog
public
async
fillOrderdataNodeChilds
(
context
:
any
=
{},
filter
:
any
,
list
:
any
[]):
Promise
<
any
>
{
if
(
filter
.
srfnodefilter
&&
!
Object
.
is
(
filter
.
srfnodefilter
,
""
))
{
// 填充订单明细数据
let
OrderdetaildataRsNavContext
:
any
=
{};
let
OrderdetaildataRsNavParams
:
any
=
{};
let
OrderdetaildataRsParams
:
any
=
{};
await
this
.
fillOrderdetaildataNodes
(
context
,
filter
,
list
,
OrderdetaildataRsNavContext
,
OrderdetaildataRsNavParams
,
OrderdetaildataRsParams
);
}
else
{
// 填充订单明细数据
let
OrderdetaildataRsNavContext
:
any
=
{};
let
OrderdetaildataRsNavParams
:
any
=
{};
let
OrderdetaildataRsParams
:
any
=
{};
await
this
.
fillOrderdetaildataNodes
(
context
,
filter
,
list
,
OrderdetaildataRsNavContext
,
OrderdetaildataRsNavParams
,
OrderdetaildataRsParams
);
}
}
/**
* 填充 树视图节点[订单明细数据]
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @param {*} rsNavContext
* @param {*} rsNavParams
* @param {*} rsParams
* @returns {Promise<any>}
* @memberof OrderTreeGridService
*/
@
Errorlog
public
fillOrderdetaildataNodes
(
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
searchFilter
:
any
=
{};
if
(
Object
.
is
(
filter
.
strNodeType
,
this
.
TREENODE_ORDERDATA
))
{
Object
.
assign
(
searchFilter
,
{
n_ibizorderid_eq
:
filter
.
nodeid
});
}
Object
.
assign
(
searchFilter
,
{
total
:
false
});
let
bFirst
:
boolean
=
true
;
let
records
:
any
[]
=
[];
try
{
this
.
searchOrderdetaildata
(
context
,
searchFilter
,
filter
).
then
((
records
:
any
)
=>
{
if
(
records
&&
records
.
length
>
0
){
records
.
forEach
((
entity
:
any
)
=>
{
let
treeNode
:
any
=
{};
// 整理context
let
strId
:
string
=
entity
.
ibizorderdetailid
;
let
strText
:
string
=
entity
.
ibizorderdetailname
;
Object
.
assign
(
treeNode
,{
srfparentdename
:
'IBIZOrderDetail'
,
srfparentkey
:
entity
.
ibizorderdetailid
});
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
Object
.
assign
(
tempContext
,{
srfparentdename
:
'IBIZOrderDetail'
,
srfparentkey
:
entity
.
ibizorderdetailid
,
ibizorderdetail
:
strId
})
Object
.
assign
(
treeNode
,{
srfappctx
:
tempContext
});
Object
.
assign
(
treeNode
,{
'ibizorderdetail'
:
strId
});
Object
.
assign
(
treeNode
,
{
srfkey
:
strId
});
Object
.
assign
(
treeNode
,
{
text
:
strText
,
srfmajortext
:
strText
});
let
strNodeId
:
string
=
'orderDetailData'
;
strNodeId
+=
this
.
TREENODE_SEPARATOR
;
strNodeId
+=
strId
;
Object
.
assign
(
treeNode
,
{
id
:
strNodeId
+
'_#_'
+
filter
.
srfnodeid
});
Object
.
assign
(
treeNode
,
{
collapsed
:
true
});
Object
.
assign
(
treeNode
,
{
leaf
:
false
});
Object
.
assign
(
treeNode
,
{
navparams
:
'{}'
});
Object
.
assign
(
treeNode
,
{
nodeid
:
treeNode
.
srfkey
});
Object
.
assign
(
treeNode
,
{
nodeid2
:
filter
.
strRealNodeId
});
if
(
!
Object
.
is
(
filter
.
srfnodeid
,
this
.
TREENODE_ROOT
))
{
Object
.
assign
(
treeNode
,
{
parentId
:
filter
.
srfotherkey
});
}
for
(
let
key
in
this
.
dataModel
.
orderDetailData
)
{
let
item
=
this
.
dataModel
.
orderDetailData
[
key
];
let
propVal
:
any
=
entity
[
item
.
prop
];
try
{
let
def
:
any
=
JSON
.
parse
(
item
.
default
);
propVal
=
propVal
!=
null
?
propVal
:
def
.
value
;
if
(
def
.
hasOwnProperty
(
'bkcolor'
))
{
Object
.
assign
(
treeNode
.
style
,
{
base
:
{
fill
:
def
.
bkcolor
,
stroke
:
def
.
bkcolor
}});
}
if
(
def
.
hasOwnProperty
(
'color'
))
{
Object
.
assign
(
treeNode
.
style
,
{
text
:
{
color
:
def
.
color
}});
}
}
catch
(
e
)
{
propVal
=
propVal
!=
null
?
propVal
:
item
.
default
}
treeNode
[
key
]
=
propVal
}
list
.
push
(
treeNode
);
resolve
(
list
);
bFirst
=
false
;
});
}
else
{
resolve
(
list
);
}
});
}
catch
(
error
)
{
console
.
error
(
error
);
}
});
}
/**
* 获取查询集合
*
* @public
* @param {any{}} context
* @param {*} searchFilter
* @param {*} filter
* @returns {any[]}
* @memberof TestEnetityDatasService
*/
@
Errorlog
public
searchOrderdetaildata
(
context
:
any
=
{},
searchFilter
:
any
,
filter
:
any
):
Promise
<
any
>
{
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
if
(
filter
.
viewparams
){
Object
.
assign
(
searchFilter
,
filter
.
viewparams
);
}
if
(
!
searchFilter
.
page
){
Object
.
assign
(
searchFilter
,{
page
:
0
});
}
if
(
!
searchFilter
.
size
){
Object
.
assign
(
searchFilter
,{
size
:
1000
});
}
if
(
context
&&
context
.
srfparentdename
){
Object
.
assign
(
searchFilter
,{
srfparentdename
:
JSON
.
parse
(
JSON
.
stringify
(
context
)).
srfparentdename
});
}
if
(
context
&&
context
.
srfparentkey
){
Object
.
assign
(
searchFilter
,{
srfparentkey
:
JSON
.
parse
(
JSON
.
stringify
(
context
)).
srfparentkey
});
}
const
_appEntityService
:
any
=
this
.
ibizorderdetailService
;
let
list
:
any
[]
=
[];
if
(
_appEntityService
[
'FetchDefault'
]
&&
_appEntityService
[
'FetchDefault'
]
instanceof
Function
)
{
const
response
:
Promise
<
any
>
=
_appEntityService
[
'FetchDefault'
](
context
,
searchFilter
,
false
);
response
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
resolve
([]);
console
.
log
(
JSON
.
stringify
(
context
));
console
.
error
(
'查询FetchDefault数据集异常!'
);
}
const
data
:
any
=
response
.
data
;
if
(
Object
.
keys
(
data
).
length
>
0
)
{
list
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
resolve
(
list
);
}
else
{
resolve
([]);
}
}).
catch
((
response
:
any
)
=>
{
resolve
([]);
console
.
log
(
JSON
.
stringify
(
context
));
console
.
error
(
'查询FetchDefault数据集异常!'
);
});
}
})
}
/**
* 填充 树视图节点[订单明细数据]子节点
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof OrderTreeGridService
*/
@
Errorlog
public
async
fillOrderdetaildataNodeChilds
(
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 OrderTreeGridService
*/
@
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
:
'entities.ibizorder.ordertreegrid_treegridex.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
+
'_#_'
+
filter
.
srfnodeid
});
Object
.
assign
(
treeNode
,
{
collapsed
:
true
});
Object
.
assign
(
treeNode
,
{
leaf
:
false
});
Object
.
assign
(
treeNode
,
{
navparams
:
'{}'
});
Object
.
assign
(
treeNode
,
{
nodeid
:
treeNode
.
srfkey
});
Object
.
assign
(
treeNode
,
{
nodeid2
:
filter
.
strRealNodeId
});
if
(
!
Object
.
is
(
filter
.
srfnodeid
,
this
.
TREENODE_ROOT
))
{
Object
.
assign
(
treeNode
,
{
parentId
:
filter
.
srfotherkey
});
}
list
.
push
(
treeNode
);
resolve
(
list
);
});
}
/**
* 填充 树视图节点[默认根节点]子节点
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof OrderTreeGridService
*/
@
Errorlog
public
async
fillRootNodeChilds
(
context
:
any
=
{},
filter
:
any
,
list
:
any
[]):
Promise
<
any
>
{
if
(
filter
.
srfnodefilter
&&
!
Object
.
is
(
filter
.
srfnodefilter
,
""
))
{
// 填充订单数据
let
OrderdataRsNavContext
:
any
=
{};
let
OrderdataRsNavParams
:
any
=
{};
let
OrderdataRsParams
:
any
=
{};
await
this
.
fillOrderdataNodes
(
context
,
filter
,
list
,
OrderdataRsNavContext
,
OrderdataRsNavParams
,
OrderdataRsParams
);
}
else
{
// 填充订单数据
let
OrderdataRsNavContext
:
any
=
{};
let
OrderdataRsNavParams
:
any
=
{};
let
OrderdataRsParams
:
any
=
{};
await
this
.
fillOrderdataNodes
(
context
,
filter
,
list
,
OrderdataRsNavContext
,
OrderdataRsNavParams
,
OrderdataRsParams
);
}
}
/**
* 处理代码表返回数据(树状结构)
*
* @param result 返回数组
* @param context 应用上下文
* @param callBack 回调
* @memberof OrderTreeGridService
*/
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 OrderTreeGridService
*/
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 OrderTreeGridService
*/
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 OrderTreeGridService
*/
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 OrderTreeGridService
*/
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 OrderTreeGridService
*/
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/ibizorder/order-tree-grid-treegridex/order-tree-grid-treegridex.less
0 → 100644
浏览文件 @
dfe3779a
.gantt {
height: 100%;
.gantt-elastic__main-view-container {
flex-grow: 1;
}
}
// this is less
app_Web/src/widgets/ibizorder/order-tree-grid-treegridex/order-tree-grid-treegridex.vue
0 → 100644
浏览文件 @
dfe3779a
<
script
lang=
'tsx'
>
import
{
Component
}
from
'vue-property-decorator'
;
import
OrderTreeGridBase
from
'./order-tree-grid-treegridex-base.vue'
;
@
Component
({
components
:
{
}
})
export
default
class
OrderTreeGrid
extends
OrderTreeGridBase
{
}
</
script
>
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录