Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
iBiz企业中心
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz企业套件
iBiz企业中心
提交
f20a6d3b
提交
f20a6d3b
编写于
7月 07, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xignzi006 发布系统代码
上级
deb96ce4
变更
17
显示空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
1627 行增加
和
2 行删除
+1627
-2
view-config.json
app_CRM/public/assets/json/view-config.json
+10
-0
account_en_US.ts
app_CRM/src/locale/lanres/entities/account/account_en_US.ts
+6
-0
account_zh_CN.ts
app_CRM/src/locale/lanres/entities/account/account_zh_CN.ts
+13
-0
viewconfig.ts
app_CRM/src/mock/viewconfig/viewconfig.ts
+8
-0
account-tree-grid-ex-view-base.tsx
...ount-tree-grid-ex-view/account-tree-grid-ex-view-base.tsx
+89
-0
account-tree-grid-ex-view.html
.../account-tree-grid-ex-view/account-tree-grid-ex-view.html
+16
-0
account-tree-grid-ex-view.vue
...e/account-tree-grid-ex-view/account-tree-grid-ex-view.vue
+22
-0
page-register.ts
app_CRM/src/pages/ungroup/central/page-register.ts
+1
-0
router.ts
app_CRM/src/pages/ungroup/central/router.ts
+14
-0
state.ts
app_CRM/src/store/modules/view-action/state.ts
+11
-1
account-ui-service-base.ts
app_CRM/src/uiservice/account/account-ui-service-base.ts
+1
-0
gradation-treegridex-base.tsx
...ccount/gradation-treegridex/gradation-treegridex-base.tsx
+529
-0
gradation-treegridex-model.ts
...ccount/gradation-treegridex/gradation-treegridex-model.ts
+69
-0
gradation-treegridex-service.ts
...ount/gradation-treegridex/gradation-treegridex-service.ts
+802
-0
gradation-treegridex.html
...ts/account/gradation-treegridex/gradation-treegridex.html
+13
-0
gradation-treegridex.vue
...ets/account/gradation-treegridex/gradation-treegridex.vue
+22
-0
status-tab-viewtabviewpanel-tabviewpanel.html
...abviewpanel/status-tab-viewtabviewpanel-tabviewpanel.html
+1
-1
未找到文件。
app_CRM/public/assets/json/view-config.json
浏览文件 @
f20a6d3b
...
@@ -1249,6 +1249,16 @@
...
@@ -1249,6 +1249,16 @@
"viewtag"
:
"7FCD2E75-E34A-493C-922E-8AE47BCE08CA"
,
"viewtag"
:
"7FCD2E75-E34A-493C-922E-8AE47BCE08CA"
,
"memo"
:
""
"memo"
:
""
},
},
"accounttreegridexview"
:
{
"title"
:
"客户树表格视图"
,
"caption"
:
"客户"
,
"viewtype"
:
"DETREEGRIDEXVIEW"
,
"viewmodule"
:
"Base"
,
"viewname"
:
"AccountTreeGridExView"
,
"viewfilename"
:
"account-tree-grid-ex-view"
,
"viewtag"
:
"8199e26c05058f9a505c39d85fcf1d46"
,
"memo"
:
""
},
"campaignquickcreateview"
:
{
"campaignquickcreateview"
:
{
"title"
:
"快速新建"
,
"title"
:
"快速新建"
,
"caption"
:
"市场活动"
,
"caption"
:
"市场活动"
,
...
...
app_CRM/src/locale/lanres/entities/account/account_en_US.ts
浏览文件 @
f20a6d3b
...
@@ -222,6 +222,10 @@ export default {
...
@@ -222,6 +222,10 @@ export default {
caption
:
"客户"
,
caption
:
"客户"
,
title
:
"客户编辑视图"
,
title
:
"客户编辑视图"
,
},
},
treegridexview
:
{
caption
:
"客户"
,
title
:
"客户树表格视图"
,
},
edit_introduction
:
{
edit_introduction
:
{
caption
:
"简介信息"
,
caption
:
"简介信息"
,
title
:
"简介信息"
,
title
:
"简介信息"
,
...
@@ -730,6 +734,8 @@ export default {
...
@@ -730,6 +734,8 @@ export default {
tip
:
"关闭"
,
tip
:
"关闭"
,
},
},
},
},
treegridexviewtoolbar_toolbar
:
{
},
usablegridviewtoolbar_toolbar
:
{
usablegridviewtoolbar_toolbar
:
{
tbitem1_openquickcreateview
:
{
tbitem1_openquickcreateview
:
{
caption
:
"新建"
,
caption
:
"新建"
,
...
...
app_CRM/src/locale/lanres/entities/account/account_zh_CN.ts
浏览文件 @
f20a6d3b
...
@@ -221,6 +221,10 @@ export default {
...
@@ -221,6 +221,10 @@ export default {
caption
:
"客户"
,
caption
:
"客户"
,
title
:
"客户编辑视图"
,
title
:
"客户编辑视图"
,
},
},
treegridexview
:
{
caption
:
"客户"
,
title
:
"客户树表格视图"
,
},
edit_introduction
:
{
edit_introduction
:
{
caption
:
"简介信息"
,
caption
:
"简介信息"
,
title
:
"简介信息"
,
title
:
"简介信息"
,
...
@@ -729,6 +733,8 @@ export default {
...
@@ -729,6 +733,8 @@ export default {
tip
:
"关闭"
,
tip
:
"关闭"
,
},
},
},
},
treegridexviewtoolbar_toolbar
:
{
},
usablegridviewtoolbar_toolbar
:
{
usablegridviewtoolbar_toolbar
:
{
tbitem1_openquickcreateview
:
{
tbitem1_openquickcreateview
:
{
caption
:
"新建"
,
caption
:
"新建"
,
...
@@ -839,4 +845,11 @@ export default {
...
@@ -839,4 +845,11 @@ export default {
account_remove
:
"删除"
,
account_remove
:
"删除"
,
},
},
},
},
gradation_treegridex
:
{
uiactions
:
{
account_openmaineditview
:
"编辑"
,
account_inactive
:
"停用"
,
account_remove
:
"删除"
,
},
},
};
};
\ No newline at end of file
app_CRM/src/mock/viewconfig/viewconfig.ts
浏览文件 @
f20a6d3b
...
@@ -1007,6 +1007,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
...
@@ -1007,6 +1007,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname"
:
"CenteralPortal"
,
"viewname"
:
"CenteralPortal"
,
"viewtag"
:
"7FCD2E75-E34A-493C-922E-8AE47BCE08CA"
"viewtag"
:
"7FCD2E75-E34A-493C-922E-8AE47BCE08CA"
},
},
"accounttreegridexview"
:
{
"title"
:
"客户树表格视图"
,
"caption"
:
"客户"
,
"viewtype"
:
"DETREEGRIDEXVIEW"
,
"viewmodule"
:
"Base"
,
"viewname"
:
"AccountTreeGridExView"
,
"viewtag"
:
"8199e26c05058f9a505c39d85fcf1d46"
},
"campaignquickcreateview"
:
{
"campaignquickcreateview"
:
{
"title"
:
"快速新建"
,
"title"
:
"快速新建"
,
"caption"
:
"市场活动"
,
"caption"
:
"市场活动"
,
...
...
app_CRM/src/pages/base/account-tree-grid-ex-view/account-tree-grid-ex-view-base.tsx
0 → 100644
浏览文件 @
f20a6d3b
import
{
Subject
}
from
'rxjs'
;
import
{
TreeGridExViewBase
}
from
'@/studio-core'
;
import
AccountService
from
'@/service/account/account-service'
;
/**
* 客户树表格视图视图基类
*
* @export
* @class AccountTreeGridExViewBase
* @extends {TreeGridExViewBase}
*/
export
class
AccountTreeGridExViewBase
extends
TreeGridExViewBase
{
/**
* 实体服务对象
*
* @type {AccountService}
* @memberof AccountTreeGridExViewBase
*/
protected
appEntityService
:
AccountService
=
new
AccountService
;
/**
* 计数器服务对象集合
*
* @protected
* @type {Array<*>}
* @memberof AccountTreeGridExViewBase
*/
protected
counterServiceArray
:
Array
<
any
>
=
[];
/**
* 视图模型数据
*
* @protected
* @type {*}
* @memberof AccountTreeGridExViewBase
*/
protected
model
:
any
=
{
srfCaption
:
'entities.account.views.treegridexview.caption'
,
srfTitle
:
'entities.account.views.treegridexview.title'
,
srfSubTitle
:
'entities.account.views.treegridexview.subtitle'
,
dataInfo
:
''
}
/**
* 容器模型
*
* @protected
* @type {*}
* @memberof AccountTreeGridExViewBase
*/
protected
containerModel
:
any
=
{
view_toolbar
:
{
name
:
'toolbar'
,
type
:
'TOOLBAR'
},
view_treegridex
:
{
name
:
'treegridex'
,
type
:
'TREEGRIDEX'
},
};
/**
* 工具栏模型
*
* @type {*}
* @memberof AccountTreeGridExView
*/
public
toolBarModels
:
any
=
{
};
/**
* 视图唯一标识
*
* @protected
* @type {string}
* @memberof ViewBase
*/
protected
viewtag
:
string
=
'8199e26c05058f9a505c39d85fcf1d46'
;
/**
* 引擎初始化
*
* @public
* @memberof AccountTreeGridExViewBase
*/
public
engineInit
():
void
{
}
}
\ No newline at end of file
app_CRM/src/pages/base/account-tree-grid-ex-view/account-tree-grid-ex-view.html
0 → 100644
浏览文件 @
f20a6d3b
<studio-view-style2
viewName=
"accounttreegridexview"
viewTitle=
"客户树表格视图"
class=
'detreegridexview account-tree-grid-ex-view'
>
<template
slot=
'title'
>
<span
class=
'caption-info'
>
{{$t(model.srfTitle)}}
</span>
</template>
<template
slot=
"toolbar"
>
<view-toolbar
mode=
"STYLE2"
:model=
"toolBarModels"
@
item-click=
"toolbar_click($event)"
/>
</template>
<view
_treegridex
:viewState=
"viewState"
:viewparams=
"viewparams"
:context=
"context"
:showBusyIndicator=
"true"
name=
"treegridex"
ref=
'treegridex'
@
closeview=
"closeView($event)"
>
</view
_treegridex
>
</studio-view-style2>
\ No newline at end of file
app_CRM/src/pages/base/account-tree-grid-ex-view/account-tree-grid-ex-view.vue
0 → 100644
浏览文件 @
f20a6d3b
<
template
src=
"./account-tree-grid-ex-view.html"
/>
<script
lang=
'tsx'
>
import
{ Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { AccountTreeGridExViewBase } from './account-tree-grid-ex-view-base';
import view_treegridex from '@widgets/account/gradation-treegridex/gradation-treegridex.vue';
/**
* 客户树表格视图视图
*
* @export
* @class AccountTreeGridExView
* @extends {AccountTreeGridExViewBase}
*/
@Component({
components: {
view_treegridex,
}
})
@VueLifeCycleProcessing()
export default class AccountTreeGridExView extends AccountTreeGridExViewBase { }
</script>
app_CRM/src/pages/ungroup/central/page-register.ts
浏览文件 @
f20a6d3b
...
@@ -152,6 +152,7 @@ export const PageComponents = {
...
@@ -152,6 +152,7 @@ export const PageComponents = {
Vue
.
component
(
'sales-order-detail-soproduct-grid-view'
,
()
=>
import
(
'@pages/sales/sales-order-detail-soproduct-grid-view/sales-order-detail-soproduct-grid-view.vue'
));
Vue
.
component
(
'sales-order-detail-soproduct-grid-view'
,
()
=>
import
(
'@pages/sales/sales-order-detail-soproduct-grid-view/sales-order-detail-soproduct-grid-view.vue'
));
Vue
.
component
(
'account-info-all'
,
()
=>
import
(
'@pages/base/account-info-all/account-info-all.vue'
));
Vue
.
component
(
'account-info-all'
,
()
=>
import
(
'@pages/base/account-info-all/account-info-all.vue'
));
Vue
.
component
(
'opportunity-competitor-edit-view'
,
()
=>
import
(
'@pages/sales/opportunity-competitor-edit-view/opportunity-competitor-edit-view.vue'
));
Vue
.
component
(
'opportunity-competitor-edit-view'
,
()
=>
import
(
'@pages/sales/opportunity-competitor-edit-view/opportunity-competitor-edit-view.vue'
));
Vue
.
component
(
'account-tree-grid-ex-view'
,
()
=>
import
(
'@pages/base/account-tree-grid-ex-view/account-tree-grid-ex-view.vue'
));
Vue
.
component
(
'incident-info-incident-view'
,
()
=>
import
(
'@pages/service/incident-info-incident-view/incident-info-incident-view.vue'
));
Vue
.
component
(
'incident-info-incident-view'
,
()
=>
import
(
'@pages/service/incident-info-incident-view/incident-info-incident-view.vue'
));
Vue
.
component
(
'contact-stop-grid-view'
,
()
=>
import
(
'@pages/base/contact-stop-grid-view/contact-stop-grid-view.vue'
));
Vue
.
component
(
'contact-stop-grid-view'
,
()
=>
import
(
'@pages/base/contact-stop-grid-view/contact-stop-grid-view.vue'
));
Vue
.
component
(
'competitor-sales-literature-sal-lit-comp-edit-view'
,
()
=>
import
(
'@pages/sales/competitor-sales-literature-sal-lit-comp-edit-view/competitor-sales-literature-sal-lit-comp-edit-view.vue'
));
Vue
.
component
(
'competitor-sales-literature-sal-lit-comp-edit-view'
,
()
=>
import
(
'@pages/sales/competitor-sales-literature-sal-lit-comp-edit-view/competitor-sales-literature-sal-lit-comp-edit-view.vue'
));
...
...
app_CRM/src/pages/ungroup/central/router.ts
浏览文件 @
f20a6d3b
...
@@ -4469,6 +4469,20 @@ const router = new Router({
...
@@ -4469,6 +4469,20 @@ const router = new Router({
},
},
component
:
()
=>
import
(
'@pages/sales/opportunity-competitor-edit-view/opportunity-competitor-edit-view.vue'
),
component
:
()
=>
import
(
'@pages/sales/opportunity-competitor-edit-view/opportunity-competitor-edit-view.vue'
),
},
},
{
path
:
'accounts/:account?/treegridexview/:treegridexview?'
,
meta
:
{
caption
:
'entities.account.views.treegridexview.title'
,
info
:
''
,
parameters
:
[
{
pathName
:
'central'
,
parameterName
:
'central'
},
{
pathName
:
'accounts'
,
parameterName
:
'account'
},
{
pathName
:
'treegridexview'
,
parameterName
:
'treegridexview'
},
],
requireAuth
:
true
,
},
component
:
()
=>
import
(
'@pages/base/account-tree-grid-ex-view/account-tree-grid-ex-view.vue'
),
},
{
{
path
:
'incidents/:incident?/info_incidentview/:info_incidentview?'
,
path
:
'incidents/:incident?/info_incidentview/:info_incidentview?'
,
meta
:
{
meta
:
{
...
...
app_CRM/src/store/modules/view-action/state.ts
浏览文件 @
f20a6d3b
...
@@ -331,7 +331,7 @@ export const viewstate: any = {
...
@@ -331,7 +331,7 @@ export const viewstate: any = {
viewaction
:
''
,
viewaction
:
''
,
viewdatachange
:
false
,
viewdatachange
:
false
,
refviews
:
[
refviews
:
[
'
5c7e90ccfaeb49b5bd84ae6c17b479e3
'
,
'
8199e26c05058f9a505c39d85fcf1d46
'
,
'6d920bddee09ffdf2e18a0701ab9e9e7'
,
'6d920bddee09ffdf2e18a0701ab9e9e7'
,
'9433b49c4e43a15dfc8bbd91bdd4c27f'
,
'9433b49c4e43a15dfc8bbd91bdd4c27f'
,
],
],
...
@@ -1092,6 +1092,16 @@ export const viewstate: any = {
...
@@ -1092,6 +1092,16 @@ export const viewstate: any = {
refviews
:
[
refviews
:
[
],
],
},
},
{
viewtag
:
'8199e26c05058f9a505c39d85fcf1d46'
,
viewmodule
:
'Base'
,
viewname
:
'AccountTreeGridExView'
,
viewaction
:
''
,
viewdatachange
:
false
,
refviews
:
[
'6e18ac74e5685439110f9b4e534ee005'
,
],
},
{
{
viewtag
:
'8206069d9567cbc0a06e441869343819'
,
viewtag
:
'8206069d9567cbc0a06e441869343819'
,
viewmodule
:
'Marketing'
,
viewmodule
:
'Marketing'
,
...
...
app_CRM/src/uiservice/account/account-ui-service-base.ts
浏览文件 @
f20a6d3b
...
@@ -93,6 +93,7 @@ export default class AccountUIServiceBase extends UIService {
...
@@ -93,6 +93,7 @@ export default class AccountUIServiceBase extends UIService {
this
.
allViewMap
.
set
(
'EDITVIEW:'
,{
viewname
:
'editview'
,
srfappde
:
'accounts'
});
this
.
allViewMap
.
set
(
'EDITVIEW:'
,{
viewname
:
'editview'
,
srfappde
:
'accounts'
});
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'innerpickupgridview'
,
srfappde
:
'accounts'
});
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'innerpickupgridview'
,
srfappde
:
'accounts'
});
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'info_introduction'
,
srfappde
:
'accounts'
});
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'info_introduction'
,
srfappde
:
'accounts'
});
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'treegridexview'
,
srfappde
:
'accounts'
});
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'edit_introduction'
,
srfappde
:
'accounts'
});
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'edit_introduction'
,
srfappde
:
'accounts'
});
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'info_address'
,
srfappde
:
'accounts'
});
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'info_address'
,
srfappde
:
'accounts'
});
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'stopgridview'
,
srfappde
:
'accounts'
});
this
.
allViewMap
.
set
(
':'
,{
viewname
:
'stopgridview'
,
srfappde
:
'accounts'
});
...
...
app_CRM/src/widgets/account/gradation-treegridex/gradation-treegridex-base.tsx
0 → 100644
浏览文件 @
f20a6d3b
import
{
Prop
,
Provide
,
Emit
,
Model
}
from
'vue-property-decorator'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
{
Watch
,
MainControlBase
}
from
'@/studio-core'
;
import
AccountService
from
'@/service/account/account-service'
;
import
GradationService
from
'./gradation-treegridex-service'
;
import
AccountUIService
from
'@/uiservice/account/account-ui-service'
;
/**
* treegridex部件基类
*
* @export
* @class MainControlBase
* @extends {GradationTreegridexBase}
*/
export
class
GradationTreegridexBase
extends
MainControlBase
{
/**
* 建构部件服务对象
*
* @type {GradationService}
* @memberof GradationTreegridexBase
*/
public
service
:
GradationService
=
new
GradationService
({
$store
:
this
.
$store
});
/**
* 实体服务对象
*
* @type {AccountService}
* @memberof GradationTreegridexBase
*/
public
appEntityService
:
AccountService
=
new
AccountService
({
$store
:
this
.
$store
});
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof GradationTreegridexBase
*/
protected
appDeName
:
string
=
'account'
;
/**
* childaccount_cm 部件 click 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof GradationTreegridexBase
*/
public
childaccount_cm_click
(
$event
:
any
,
$event2
?:
any
)
{
if
(
Object
.
is
(
$event
.
tag
,
'deuiaction1'
))
{
this
.
childaccount_cm_deuiaction1_click
(
null
,
'childaccount_cm'
,
$event2
);
}
if
(
Object
.
is
(
$event
.
tag
,
'deuiaction3'
))
{
this
.
childaccount_cm_deuiaction3_click
(
null
,
'childaccount_cm'
,
$event2
);
}
if
(
Object
.
is
(
$event
.
tag
,
'deuiaction2'
))
{
this
.
childaccount_cm_deuiaction2_click
(
null
,
'childaccount_cm'
,
$event2
);
}
}
/**
* rootaccount_cm 部件 click 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof GradationTreegridexBase
*/
public
rootaccount_cm_click
(
$event
:
any
,
$event2
?:
any
)
{
if
(
Object
.
is
(
$event
.
tag
,
'deuiaction1'
))
{
this
.
rootaccount_cm_deuiaction1_click
(
null
,
'rootaccount_cm'
,
$event2
);
}
if
(
Object
.
is
(
$event
.
tag
,
'deuiaction3'
))
{
this
.
rootaccount_cm_deuiaction3_click
(
null
,
'rootaccount_cm'
,
$event2
);
}
if
(
Object
.
is
(
$event
.
tag
,
'deuiaction2'
))
{
this
.
rootaccount_cm_deuiaction2_click
(
null
,
'rootaccount_cm'
,
$event2
);
}
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public
rootaccount_cm_deuiaction1_click
(
params
:
any
=
{},
tag
?:
any
,
$event
?:
any
)
{
// 参数
// 取数
let
datas
:
any
[]
=
[];
let
xData
:
any
=
null
;
// _this 指向容器对象
const
_this
:
any
=
this
;
let
paramJO
:
any
=
{};
let
contextJO
:
any
=
{};
xData
=
this
;
if
(
_this
.
getDatas
&&
_this
.
getDatas
instanceof
Function
)
{
datas
=
[...
_this
.
getDatas
()];
}
if
(
params
){
datas
=
[
params
];
}
// 界面行为
const
curUIService
:
AccountUIService
=
new
AccountUIService
();
curUIService
.
Account_OpenMainEditView
(
datas
,
contextJO
,
paramJO
,
$event
,
xData
,
this
,
"Account"
);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public
rootaccount_cm_deuiaction3_click
(
params
:
any
=
{},
tag
?:
any
,
$event
?:
any
)
{
// 参数
// 取数
let
datas
:
any
[]
=
[];
let
xData
:
any
=
null
;
// _this 指向容器对象
const
_this
:
any
=
this
;
let
paramJO
:
any
=
{};
let
contextJO
:
any
=
{};
xData
=
this
;
if
(
_this
.
getDatas
&&
_this
.
getDatas
instanceof
Function
)
{
datas
=
[...
_this
.
getDatas
()];
}
if
(
params
){
datas
=
[
params
];
}
// 界面行为
const
curUIService
:
AccountUIService
=
new
AccountUIService
();
curUIService
.
Account_Inactive
(
datas
,
contextJO
,
paramJO
,
$event
,
xData
,
this
,
"Account"
);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public
rootaccount_cm_deuiaction2_click
(
params
:
any
=
{},
tag
?:
any
,
$event
?:
any
)
{
// 参数
// 取数
let
datas
:
any
[]
=
[];
let
xData
:
any
=
null
;
// _this 指向容器对象
const
_this
:
any
=
this
;
let
paramJO
:
any
=
{};
let
contextJO
:
any
=
{};
xData
=
this
;
if
(
_this
.
getDatas
&&
_this
.
getDatas
instanceof
Function
)
{
datas
=
[...
_this
.
getDatas
()];
}
if
(
params
){
datas
=
[
params
];
}
// 界面行为
const
curUIService
:
AccountUIService
=
new
AccountUIService
();
curUIService
.
Account_Remove
(
datas
,
contextJO
,
paramJO
,
$event
,
xData
,
this
,
"Account"
);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public
childaccount_cm_deuiaction1_click
(
params
:
any
=
{},
tag
?:
any
,
$event
?:
any
)
{
// 参数
// 取数
let
datas
:
any
[]
=
[];
let
xData
:
any
=
null
;
// _this 指向容器对象
const
_this
:
any
=
this
;
let
paramJO
:
any
=
{};
let
contextJO
:
any
=
{};
xData
=
this
;
if
(
_this
.
getDatas
&&
_this
.
getDatas
instanceof
Function
)
{
datas
=
[...
_this
.
getDatas
()];
}
if
(
params
){
datas
=
[
params
];
}
// 界面行为
const
curUIService
:
AccountUIService
=
new
AccountUIService
();
curUIService
.
Account_OpenMainEditView
(
datas
,
contextJO
,
paramJO
,
$event
,
xData
,
this
,
"Account"
);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public
childaccount_cm_deuiaction3_click
(
params
:
any
=
{},
tag
?:
any
,
$event
?:
any
)
{
// 参数
// 取数
let
datas
:
any
[]
=
[];
let
xData
:
any
=
null
;
// _this 指向容器对象
const
_this
:
any
=
this
;
let
paramJO
:
any
=
{};
let
contextJO
:
any
=
{};
xData
=
this
;
if
(
_this
.
getDatas
&&
_this
.
getDatas
instanceof
Function
)
{
datas
=
[...
_this
.
getDatas
()];
}
if
(
params
){
datas
=
[
params
];
}
// 界面行为
const
curUIService
:
AccountUIService
=
new
AccountUIService
();
curUIService
.
Account_Inactive
(
datas
,
contextJO
,
paramJO
,
$event
,
xData
,
this
,
"Account"
);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public
childaccount_cm_deuiaction2_click
(
params
:
any
=
{},
tag
?:
any
,
$event
?:
any
)
{
// 参数
// 取数
let
datas
:
any
[]
=
[];
let
xData
:
any
=
null
;
// _this 指向容器对象
const
_this
:
any
=
this
;
let
paramJO
:
any
=
{};
let
contextJO
:
any
=
{};
xData
=
this
;
if
(
_this
.
getDatas
&&
_this
.
getDatas
instanceof
Function
)
{
datas
=
[...
_this
.
getDatas
()];
}
if
(
params
){
datas
=
[
params
];
}
// 界面行为
const
curUIService
:
AccountUIService
=
new
AccountUIService
();
curUIService
.
Account_Remove
(
datas
,
contextJO
,
paramJO
,
$event
,
xData
,
this
,
"Account"
);
}
/**
* 显示处理提示
*
* @type {boolean}
* @memberof Gradation
*/
@
Prop
({
default
:
true
})
public
showBusyIndicator
?:
boolean
;
/**
* 部件行为--load
*
* @type {string}
* @memberof Gradation
*/
@
Prop
()
public
loadAction
!
:
string
;
/**
* 是否单选
*
* @type {boolean}
* @memberof Gradation
*/
@
Prop
({
default
:
true
})
public
isSingleSelect
!
:
boolean
;
/**
* 部件样式名
*
* @public
* @type {any[]}
* @memberof Gradation
*/
public
controlClass
:
string
=
"treegridex"
;
/**
* 数据集合
*
* @public
* @type {any[]}
* @memberof Gradation
*/
public
items
:
any
[]
=
[];
/**
* 默认展开节点集合
*
* @memberof Gradation
*/
public
defExpands
:
any
=
[];
/**
* 行节点下标
*
* @memberof Gradation
*/
public
itemNum
:
any
=
{};
/**
* 计数下标
*
* @memberof Gradation
*/
public
num
:
number
=
0
;
/**
* 获取列属性值
*
* @public
* @memberof Gradation
*/
public
getColumnValue
(
task
:
any
,
field
:
string
)
{
if
(
Object
.
is
(
task
.
id
.
split
(
';'
)[
0
],
'RootAccount'
))
{
return
task
[
field
];
}
if
(
Object
.
is
(
task
.
id
.
split
(
';'
)[
0
],
'ROOT'
))
{
return
task
[
field
];
}
if
(
Object
.
is
(
task
.
id
.
split
(
';'
)[
0
],
'ChildAccount'
))
{
return
task
[
field
];
}
}
/**
* 获取代码项
*
* @public
* @memberof Gradation
*/
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 Gradation
*/
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
=
{};
this
.
$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
:
"错误"
,
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
:
"错误"
,
desc
:
response
.
info
});
});
}
/**
* 加载节点
*
* @memberof TreeTable
*/
public
loadTreeNode
(
tree
:
any
,
treeNode
:
any
,
resolve
:
any
)
{
this
.
load
(
tree
,
resolve
);
}
/**
* 计算当前节点的上下文
*
* @param {*} curNode 当前节点
* @memberof Gradation
*/
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 Gradation
*/
public
itemExpand
(
item
:
any
)
{
}
/**
* 刷新
*
* @memberof Gradation
*/
public
refresh
()
{
this
.
load
();
}
/**
* 选中的数据
*
* @returns {any[]}
* @memberof Gradation
*/
public
selections
:
any
[]
=
[];
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof Gradation
*/
public
getDatas
():
any
[]
{
return
this
.
selections
;
}
/**
* 获取单项树
*
* @returns {*}
* @memberof Gradation
*/
public
getData
():
any
{
return
null
;
}
/**
* vue 生命周期
*
* @returns
* @memberof Gradation
*/
public
created
()
{
this
.
load
();
}
/**
* 设置行Class
*
* @returns
* @memberof Gradation
*/
public
setRowClass
({
row
,
rowIndex
}:
{
row
:
any
,
rowIndex
:
number
})
{
return
'treegrid'
+
this
.
itemNum
[
row
.
id
];
}
/**
* 展开默认节点
*
* @returns
* @memberof Gradation
*/
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 Gradation
*/
public
select
(
$event
:
any
)
{
if
(
!
$event
)
{
return
;
}
this
.
selections
=
[
JSON
.
parse
(
JSON
.
stringify
(
$event
))];
this
.
$emit
(
'selectionchange'
,
this
.
selections
);
}
}
\ No newline at end of file
app_CRM/src/widgets/account/gradation-treegridex/gradation-treegridex-model.ts
0 → 100644
浏览文件 @
f20a6d3b
/**
* Gradation 部件模型
*
* @export
* @class GradationModel
*/
export
default
class
GradationModel
{
/**
* 日历项类型
*
* @returns {any[]}
* @memberof GradationTreegridexMode
*/
public
itemType
:
string
=
""
;
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof GradationTreegridexMode
*/
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
"RootAccount"
:
dataItems
=
[...
dataItems
,
{
name
:
'id'
,
prop
:
'accountid'
},
];
break
;
case
"ChildAccount"
:
dataItems
=
[...
dataItems
,
{
name
:
'id'
,
prop
:
'accountid'
},
];
break
;
}
return
dataItems
;
}
}
\ No newline at end of file
app_CRM/src/widgets/account/gradation-treegridex/gradation-treegridex-service.ts
0 → 100644
浏览文件 @
f20a6d3b
import
{
Http
,
Util
,
Errorlog
}
from
'@/utils'
;
import
ControlService
from
'@/widgets/control-service'
;
import
AccountService
from
'@/service/account/account-service'
;
import
GradationModel
from
'./gradation-treegridex-model'
;
import
CodeListService
from
'@service/app/codelist-service'
;
import
i18n
from
'@/locale'
;
/**
* Gradation 部件服务对象
*
* @export
* @class GradationService
*/
export
default
class
GradationService
extends
ControlService
{
/**
* 客户服务对象
*
* @type {AccountService}
* @memberof GradationService
*/
public
appEntityService
:
AccountService
=
new
AccountService
({
$store
:
this
.
getStore
()
});
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof GradationService
*/
public
setTempMode
(){
this
.
isTempMode
=
false
;
}
/**
* Creates an instance of GradationService.
*
* @param {*} [opts={}]
* @memberof GradationService
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
this
.
model
=
new
GradationModel
();
}
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof GradationService
*/
public
codeListService
:
CodeListService
=
new
CodeListService
({
$store
:
this
.
getStore
()
});
/**
* 节点分隔符号
*
* @public
* @type {string}
* @memberof GradationService
*/
public
TREENODE_SEPARATOR
:
string
=
';'
;
/**
* RootAccount节点分隔符号
*
* @public
* @type {string}
* @memberof GradationService
*/
public
TREENODE_ROOTACCOUNT
:
string
=
'RootAccount'
;
/**
* 全部客户节点分隔符号
*
* @public
* @type {string}
* @memberof GradationService
*/
public
TREENODE_ROOT
:
string
=
'ROOT'
;
/**
* ChildAccount节点分隔符号
*
* @public
* @type {string}
* @memberof GradationService
*/
public
TREENODE_CHILDACCOUNT
:
string
=
'ChildAccount'
;
/**
* 商品类别节点分隔符号
*
* @public
* @type {*}
* @memberof GradationService
*/
public
dataModel
:
any
=
{
RootAccount
:
{
},
ROOT
:
{
},
ChildAccount
:
{
},
}
/**
* 获取节点数据
*
* @param {string} action
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof GradationService
*/
@
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
,
'#'
))
{
await
this
.
fillRootNodes
(
context
,
filter
,
list
);
return
Promise
.
resolve
({
status
:
200
,
data
:
list
});
}
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_ROOTACCOUNT
))
{
await
this
.
fillRootaccountNodeChilds
(
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
});
}
if
(
Object
.
is
(
strNodeType
,
this
.
TREENODE_CHILDACCOUNT
))
{
await
this
.
fillChildaccountNodeChilds
(
context
,
filter
,
list
);
return
Promise
.
resolve
({
status
:
200
,
data
:
list
});
}
return
Promise
.
resolve
({
status
:
500
,
data
:
{
title
:
'失败'
,
message
:
`树节点
${
strTreeNodeId
}
标识无效`
}
});
}
/**
* 填充 树视图节点[RootAccount]
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @param {*} rsNavContext
* @param {*} rsNavParams
* @param {*} rsParams
* @returns {Promise<any>}
* @memberof GradationService
*/
@
Errorlog
public
fillRootaccountNodes
(
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
});
Object
.
assign
(
searchFilter
,
{
query
:
filter
.
srfnodefilter
});
let
bFirst
:
boolean
=
true
;
let
records
:
any
[]
=
[];
try
{
this
.
searchRootaccount
(
context
,
searchFilter
,
filter
).
then
((
records
:
any
)
=>
{
if
(
records
&&
records
.
length
>
0
){
records
.
forEach
((
entity
:
any
)
=>
{
let
treeNode
:
any
=
{};
// 整理context
let
strId
:
string
=
entity
.
accountid
;
let
strText
:
string
=
entity
.
accountname
;
Object
.
assign
(
treeNode
,{
srfparentdename
:
'Account'
,
srfparentkey
:
entity
.
accountid
});
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
Object
.
assign
(
tempContext
,{
srfparentdename
:
'Account'
,
srfparentkey
:
entity
.
accountid
,
account
:
strId
})
Object
.
assign
(
treeNode
,{
srfappctx
:
tempContext
});
Object
.
assign
(
treeNode
,{
'account'
:
strId
});
Object
.
assign
(
treeNode
,
{
srfkey
:
strId
});
Object
.
assign
(
treeNode
,
{
text
:
strText
,
srfmajortext
:
strText
});
let
strNodeId
:
string
=
'RootAccount'
;
strNodeId
+=
this
.
TREENODE_SEPARATOR
;
strNodeId
+=
strId
;
Object
.
assign
(
treeNode
,
{
id
:
strNodeId
+
'_#_'
+
filter
.
srfnodeid
});
Object
.
assign
(
treeNode
,
{
collapsed
:
true
});
Object
.
assign
(
treeNode
,
{
leaf
:
true
});
let
objLeafFlag
=
entity
.
childaccountcount
;
if
(
objLeafFlag
!=
null
)
{
let
strLeafFlag
:
string
=
objLeafFlag
.
toString
().
toLowerCase
();
if
(
Object
.
is
(
strLeafFlag
,
'1'
)
||
Object
.
is
(
strLeafFlag
,
'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
.
RootAccount
)
{
let
item
=
this
.
dataModel
.
RootAccount
[
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
searchRootaccount
(
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
});
}
Object
.
assign
(
searchFilter
,{
sort
:
'accountname,asc'
})
const
_appEntityService
:
any
=
this
.
appEntityService
;
let
list
:
any
[]
=
[];
if
(
_appEntityService
[
'FetchRoot'
]
&&
_appEntityService
[
'FetchRoot'
]
instanceof
Function
)
{
const
response
:
Promise
<
any
>
=
_appEntityService
[
'FetchRoot'
](
context
,
searchFilter
,
false
);
response
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
resolve
([]);
console
.
log
(
JSON
.
stringify
(
context
));
console
.
error
(
'查询FetchRoot数据集异常!'
);
}
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
(
'查询FetchRoot数据集异常!'
);
});
}
})
}
/**
* 填充 树视图节点[RootAccount]子节点
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof GradationService
*/
@
Errorlog
public
async
fillRootaccountNodeChilds
(
context
:
any
=
{},
filter
:
any
,
list
:
any
[]):
Promise
<
any
>
{
if
(
filter
.
srfnodefilter
&&
!
Object
.
is
(
filter
.
srfnodefilter
,
""
))
{
// 填充ChildAccount
let
ChildaccountRsNavContext
:
any
=
{};
let
ChildaccountRsNavParams
:
any
=
{};
let
ChildaccountRsParams
:
any
=
{};
await
this
.
fillChildaccountNodes
(
context
,
filter
,
list
,
ChildaccountRsNavContext
,
ChildaccountRsNavParams
,
ChildaccountRsParams
);
}
else
{
// 填充ChildAccount
let
ChildaccountRsNavContext
:
any
=
{};
let
ChildaccountRsNavParams
:
any
=
{};
let
ChildaccountRsParams
:
any
=
{};
await
this
.
fillChildaccountNodes
(
context
,
filter
,
list
,
ChildaccountRsNavContext
,
ChildaccountRsNavParams
,
ChildaccountRsParams
);
}
}
/**
* 填充 树视图节点[全部客户]
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @param {*} rsNavContext
* @param {*} rsNavParams
* @param {*} rsParams
* @returns {Promise<any>}
* @memberof GradationService
*/
@
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.account.gradation_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
:
false
});
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 GradationService
*/
@
Errorlog
public
async
fillRootNodeChilds
(
context
:
any
=
{},
filter
:
any
,
list
:
any
[]):
Promise
<
any
>
{
if
(
filter
.
srfnodefilter
&&
!
Object
.
is
(
filter
.
srfnodefilter
,
""
))
{
// 填充RootAccount
let
RootaccountRsNavContext
:
any
=
{};
let
RootaccountRsNavParams
:
any
=
{};
let
RootaccountRsParams
:
any
=
{};
await
this
.
fillRootaccountNodes
(
context
,
filter
,
list
,
RootaccountRsNavContext
,
RootaccountRsNavParams
,
RootaccountRsParams
);
}
else
{
// 填充RootAccount
let
RootaccountRsNavContext
:
any
=
{};
let
RootaccountRsNavParams
:
any
=
{};
let
RootaccountRsParams
:
any
=
{};
await
this
.
fillRootaccountNodes
(
context
,
filter
,
list
,
RootaccountRsNavContext
,
RootaccountRsNavParams
,
RootaccountRsParams
);
}
}
/**
* 填充 树视图节点[ChildAccount]
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @param {*} rsNavContext
* @param {*} rsNavParams
* @param {*} rsParams
* @returns {Promise<any>}
* @memberof GradationService
*/
@
Errorlog
public
fillChildaccountNodes
(
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_ROOTACCOUNT
))
{
Object
.
assign
(
searchFilter
,
{
n_parentaccountid_eq
:
filter
.
nodeid
});
}
if
(
Object
.
is
(
filter
.
strNodeType
,
this
.
TREENODE_CHILDACCOUNT
))
{
Object
.
assign
(
searchFilter
,
{
n_parentaccountid_eq
:
filter
.
nodeid
});
}
Object
.
assign
(
searchFilter
,
{
total
:
false
});
let
bFirst
:
boolean
=
true
;
let
records
:
any
[]
=
[];
try
{
this
.
searchChildaccount
(
context
,
searchFilter
,
filter
).
then
((
records
:
any
)
=>
{
if
(
records
&&
records
.
length
>
0
){
records
.
forEach
((
entity
:
any
)
=>
{
let
treeNode
:
any
=
{};
// 整理context
let
strId
:
string
=
entity
.
accountid
;
let
strText
:
string
=
entity
.
accountname
;
Object
.
assign
(
treeNode
,{
srfparentdename
:
'Account'
,
srfparentkey
:
entity
.
accountid
});
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
Object
.
assign
(
tempContext
,{
srfparentdename
:
'Account'
,
srfparentkey
:
entity
.
accountid
,
account
:
strId
})
Object
.
assign
(
treeNode
,{
srfappctx
:
tempContext
});
Object
.
assign
(
treeNode
,{
'account'
:
strId
});
Object
.
assign
(
treeNode
,
{
srfkey
:
strId
});
Object
.
assign
(
treeNode
,
{
text
:
strText
,
srfmajortext
:
strText
});
let
strNodeId
:
string
=
'ChildAccount'
;
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
.
ChildAccount
)
{
let
item
=
this
.
dataModel
.
ChildAccount
[
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
searchChildaccount
(
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
});
}
Object
.
assign
(
searchFilter
,{
sort
:
'accountname,asc'
})
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数据集异常!'
);
});
}
})
}
/**
* 填充 树视图节点[ChildAccount]子节点
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof GradationService
*/
@
Errorlog
public
async
fillChildaccountNodeChilds
(
context
:
any
=
{},
filter
:
any
,
list
:
any
[]):
Promise
<
any
>
{
if
(
filter
.
srfnodefilter
&&
!
Object
.
is
(
filter
.
srfnodefilter
,
""
))
{
// 填充ChildAccount
let
ChildaccountRsNavContext
:
any
=
{};
let
ChildaccountRsNavParams
:
any
=
{};
let
ChildaccountRsParams
:
any
=
{};
await
this
.
fillChildaccountNodes
(
context
,
filter
,
list
,
ChildaccountRsNavContext
,
ChildaccountRsNavParams
,
ChildaccountRsParams
);
}
else
{
// 填充ChildAccount
let
ChildaccountRsNavContext
:
any
=
{};
let
ChildaccountRsNavParams
:
any
=
{};
let
ChildaccountRsParams
:
any
=
{};
await
this
.
fillChildaccountNodes
(
context
,
filter
,
list
,
ChildaccountRsNavContext
,
ChildaccountRsNavParams
,
ChildaccountRsParams
);
}
}
/**
* 处理代码表返回数据(树状结构)
*
* @param result 返回数组
* @param context 应用上下文
* @param callBack 回调
* @memberof GradationService
*/
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 GradationService
*/
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 GradationService
*/
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 GradationService
*/
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 GradationService
*/
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 GradationService
*/
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
()]){
Object
.
defineProperty
(
tempData
,
item
.
toLowerCase
(),
{
value
:
context
[(
curNavData
.
value
).
toLowerCase
()],
writable
:
true
,
enumerable
:
true
,
configurable
:
true
});
}
else
{
if
(
viewparams
[(
curNavData
.
value
).
toLowerCase
()]){
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_CRM/src/widgets/account/gradation-treegridex/gradation-treegridex.html
0 → 100644
浏览文件 @
f20a6d3b
<el-table
ref=
"treegridex"
:data=
"items"
row-key=
"id"
border
lazy
height=
"100%"
:row-class-name=
"setRowClass"
:load=
"loadTreeNode.bind(_self)"
:tree-props=
"{ children: 'children', hasChildren: 'leaf' }"
:select-on-indeterminate=
"isSingleSelect"
@
current-change=
"select.apply(_self, arguments)"
>
</el-table>
\ No newline at end of file
app_CRM/src/widgets/account/gradation-treegridex/gradation-treegridex.vue
0 → 100644
浏览文件 @
f20a6d3b
<
template
src=
"./gradation-treegridex.html"
/>
<script
lang=
'tsx'
>
import
{ Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { GradationTreegridexBase } from './gradation-treegridex-base';
/**
* treegridex部件
*
* @export
* @class GradationTreegridex
* @extends {GradationTreegridexBase}
*/
@Component({
components: {
}
})
@VueLifeCycleProcessing()
export default class GradationTreegridex extends GradationTreegridexBase { }
</script>
app_CRM/src/widgets/account/status-tab-viewtabviewpanel-tabviewpanel/status-tab-viewtabviewpanel-tabviewpanel.html
浏览文件 @
f20a6d3b
<div
class=
'tabviewpanel'
v-if=
'isActivied'
>
<div
class=
'tabviewpanel'
v-if=
'isActivied'
>
<account-
grid
-view
<account-
tree-grid-ex
-view
class=
'viewcontainer2'
class=
'viewcontainer2'
:viewdata=
"viewdata"
:viewdata=
"viewdata"
:viewparam=
"viewparam"
:viewparam=
"viewparam"
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录