Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzuaa
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzuaa
提交
3b1e9e6b
提交
3b1e9e6b
编写于
5月 09, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibizdev提交
上级
65f55bdd
变更
12
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
2232 行增加
和
4 行删除
+2232
-4
sys-user-role_en_US.ts
...eb/src/locale/lanres/sys-user-role/sys-user-role_en_US.ts
+67
-0
sys-user-role_zh_CN.ts
...eb/src/locale/lanres/sys-user-role/sys-user-role_zh_CN.ts
+67
-0
sys-user-rolecustom-view-base.vue
...ys-user-rolecustom-view/sys-user-rolecustom-view-base.vue
+794
-1
sys-user-rolecustom-view.less
...aa/sys-user-rolecustom-view/sys-user-rolecustom-view.less
+14
-0
sys-user-rolecustom-view.vue
...uaa/sys-user-rolecustom-view/sys-user-rolecustom-view.vue
+6
-0
state.ts
app_web/src/store/modules/view-action/state.ts
+1
-0
sys-roletrees-treeview-base.vue
...le/sys-roletrees-treeview/sys-roletrees-treeview-base.vue
+774
-0
sys-roletrees-treeview-model.ts
...le/sys-roletrees-treeview/sys-roletrees-treeview-model.ts
+46
-0
sys-roletrees-treeview-service.ts
.../sys-roletrees-treeview/sys-roletrees-treeview-service.ts
+413
-0
sys-roletrees-treeview.less
...r-role/sys-roletrees-treeview/sys-roletrees-treeview.less
+33
-0
sys-roletrees-treeview.vue
...er-role/sys-roletrees-treeview/sys-roletrees-treeview.vue
+14
-0
h2_table.xml
ibzuaa-core/src/main/resources/liquibase/h2_table.xml
+3
-3
未找到文件。
app_web/src/locale/lanres/sys-user-role/sys-user-role_en_US.ts
浏览文件 @
3b1e9e6b
...
...
@@ -206,6 +206,64 @@ export default {
tip
:
"Help"
,
},
},
customviewtoolbar_toolbar
:
{
tbitem3
:
{
caption
:
"New"
,
tip
:
"New"
,
},
tbitem4
:
{
caption
:
"Edit"
,
tip
:
"Edit {0}"
,
},
tbitem5
:
{
caption
:
"View"
,
tip
:
"View {0}"
,
},
tbitem6
:
{
caption
:
"Copy"
,
tip
:
"Copy {0}"
,
},
tbitem7
:
{
caption
:
"-"
,
tip
:
""
,
},
tbitem8
:
{
caption
:
"Remove"
,
tip
:
"Remove {0}"
,
},
tbitem9
:
{
caption
:
"-"
,
tip
:
""
,
},
tbitem13
:
{
caption
:
"Export"
,
tip
:
"Export {0} Data To Excel"
,
},
tbitem10
:
{
caption
:
"-"
,
tip
:
""
,
},
tbitem16
:
{
caption
:
"其它"
,
tip
:
"其它"
,
},
tbitem21
:
{
caption
:
"Export Data Model"
,
tip
:
"导出数据模型"
,
},
tbitem23
:
{
caption
:
"数据导入"
,
tip
:
"数据导入"
,
},
tbitem17
:
{
caption
:
"-"
,
tip
:
""
,
},
tbitem18
:
{
caption
:
"Help"
,
tip
:
"Help"
,
},
},
editview2toolbar_toolbar
:
{
tbitem3
:
{
caption
:
"Save"
,
...
...
@@ -272,4 +330,13 @@ export default {
tip
:
"Help"
,
},
},
sys_roletrees_treeview
:
{
nodes
:
{
root
:
'默认根节点'
,
create
:
'实体数据能力'
,
testentity
:
'实体'
,
},
uiactions
:
{
},
},
};
\ No newline at end of file
app_web/src/locale/lanres/sys-user-role/sys-user-role_zh_CN.ts
浏览文件 @
3b1e9e6b
...
...
@@ -205,6 +205,64 @@ export default {
tip
:
'帮助'
,
},
},
customviewtoolbar_toolbar
:
{
tbitem3
:
{
caption
:
'新建'
,
tip
:
'新建'
,
},
tbitem4
:
{
caption
:
'编辑'
,
tip
:
'编辑'
,
},
tbitem5
:
{
caption
:
'查看'
,
tip
:
'查看'
,
},
tbitem6
:
{
caption
:
'拷贝'
,
tip
:
'拷贝'
,
},
tbitem7
:
{
caption
:
'-'
,
tip
:
''
,
},
tbitem8
:
{
caption
:
'删除'
,
tip
:
'删除'
,
},
tbitem9
:
{
caption
:
'-'
,
tip
:
''
,
},
tbitem13
:
{
caption
:
'导出'
,
tip
:
'导出'
,
},
tbitem10
:
{
caption
:
'-'
,
tip
:
''
,
},
tbitem16
:
{
caption
:
'其它'
,
tip
:
'其它'
,
},
tbitem21
:
{
caption
:
'导出数据模型'
,
tip
:
'导出数据模型'
,
},
tbitem23
:
{
caption
:
'数据导入'
,
tip
:
'数据导入'
,
},
tbitem17
:
{
caption
:
'-'
,
tip
:
''
,
},
tbitem18
:
{
caption
:
'帮助'
,
tip
:
'帮助'
,
},
},
editview2toolbar_toolbar
:
{
tbitem3
:
{
caption
:
'保存'
,
...
...
@@ -271,4 +329,13 @@ export default {
tip
:
'帮助'
,
},
},
sys_roletrees_treeview
:
{
nodes
:
{
root
:
'默认根节点'
,
create
:
'实体数据能力'
,
testentity
:
'实体'
,
},
uiactions
:
{
},
},
};
\ No newline at end of file
app_web/src/pages/uaa/sys-user-rolecustom-view/sys-user-rolecustom-view-base.vue
浏览文件 @
3b1e9e6b
<
template
>
<div
class=
"view-container decustomview sys-user-rolecustom-view"
>
<app-studioaction
:viewTitle=
"$t(model.srfTitle)"
viewName=
"sys_user_rolecustomview"
></app-studioaction>
<card
class=
'view-card
view-no-toolbar
'
:disHover=
"true"
:padding=
"0"
:bordered=
"false"
>
<card
class=
'view-card '
:disHover=
"true"
:padding=
"0"
:bordered=
"false"
>
<p
slot=
'title'
>
<span
class=
'caption-info'
>
{{
$t
(
model
.
srfTitle
)
}}
</span>
</p>
<div
class=
'toolbar-container'
>
<tooltip
:transfer=
"true"
:max-width=
"600"
>
<i-button
v-show=
"toolBarModels.tbitem3.visabled"
:disabled=
"toolBarModels.tbitem3.disabled"
class=
''
@
click=
"toolbar_click(
{ tag: 'tbitem3' }, $event)">
<i
class=
'fa fa-file-text-o'
></i>
<span
class=
'caption'
>
{{
$t
(
'entities.sys_user_role.customviewtoolbar_toolbar.tbitem3.caption'
)
}}
</span>
</i-button>
<div
slot=
'content'
>
{{
$t
(
'entities.sys_user_role.customviewtoolbar_toolbar.tbitem3.tip'
)
}}
</div>
</tooltip>
<tooltip
:transfer=
"true"
:max-width=
"600"
>
<i-button
v-show=
"toolBarModels.tbitem4.visabled"
:disabled=
"toolBarModels.tbitem4.disabled"
class=
''
@
click=
"toolbar_click(
{ tag: 'tbitem4' }, $event)">
<i
class=
'fa fa-edit'
></i>
<span
class=
'caption'
>
{{
$t
(
'entities.sys_user_role.customviewtoolbar_toolbar.tbitem4.caption'
)
}}
</span>
</i-button>
<div
slot=
'content'
>
{{
$t
(
'entities.sys_user_role.customviewtoolbar_toolbar.tbitem4.tip'
)
}}
</div>
</tooltip>
<tooltip
:transfer=
"true"
:max-width=
"600"
>
<i-button
v-show=
"toolBarModels.tbitem5.visabled"
:disabled=
"toolBarModels.tbitem5.disabled"
class=
''
@
click=
"toolbar_click(
{ tag: 'tbitem5' }, $event)">
<i
class=
'fa fa-edit'
></i>
<span
class=
'caption'
>
{{
$t
(
'entities.sys_user_role.customviewtoolbar_toolbar.tbitem5.caption'
)
}}
</span>
</i-button>
<div
slot=
'content'
>
{{
$t
(
'entities.sys_user_role.customviewtoolbar_toolbar.tbitem5.tip'
)
}}
</div>
</tooltip>
<tooltip
:transfer=
"true"
:max-width=
"600"
>
<i-button
v-show=
"toolBarModels.tbitem6.visabled"
:disabled=
"toolBarModels.tbitem6.disabled"
class=
''
@
click=
"toolbar_click(
{ tag: 'tbitem6' }, $event)">
<i
class=
'fa fa-copy'
></i>
<span
class=
'caption'
>
{{
$t
(
'entities.sys_user_role.customviewtoolbar_toolbar.tbitem6.caption'
)
}}
</span>
</i-button>
<div
slot=
'content'
>
{{
$t
(
'entities.sys_user_role.customviewtoolbar_toolbar.tbitem6.tip'
)
}}
</div>
</tooltip>
<span
class=
'seperator'
>
|
</span>
<tooltip
:transfer=
"true"
:max-width=
"600"
>
<i-button
v-show=
"toolBarModels.tbitem8.visabled"
:disabled=
"toolBarModels.tbitem8.disabled"
class=
''
@
click=
"toolbar_click(
{ tag: 'tbitem8' }, $event)">
<i
class=
'fa fa-remove'
></i>
<span
class=
'caption'
>
{{
$t
(
'entities.sys_user_role.customviewtoolbar_toolbar.tbitem8.caption'
)
}}
</span>
</i-button>
<div
slot=
'content'
>
{{
$t
(
'entities.sys_user_role.customviewtoolbar_toolbar.tbitem8.tip'
)
}}
</div>
</tooltip>
<span
class=
'seperator'
>
|
</span>
<tooltip
:transfer=
"true"
:max-width=
"600"
>
<app-export-excel
:item=
"toolBarModels.tbitem13"
:caption=
"$t('entities.sys_user_role.customviewtoolbar_toolbar.tbitem13.caption')"
@
exportexcel=
"toolbar_click(
{ tag: 'tbitem13' }, $event)">
</app-export-excel>
<div
slot=
'content'
>
{{
$t
(
'entities.sys_user_role.customviewtoolbar_toolbar.tbitem13.tip'
)
}}
</div>
</tooltip>
<span
class=
'seperator'
>
|
</span>
<dropdown
v-show=
"toolBarModels.tbitem16.visabled"
trigger=
'click'
>
<tooltip
:transfer=
"true"
:max-width=
"600"
>
<i-button
class=
''
>
<i
class=
''
></i>
<span
class=
'caption'
>
{{
$t
(
'entities.sys_user_role.customviewtoolbar_toolbar.tbitem16.caption'
)
}}
</span>
<icon
type=
"ios-arrow-down"
></icon>
</i-button>
<div
slot=
'content'
>
{{
$t
(
'entities.sys_user_role.customviewtoolbar_toolbar.tbitem16.tip'
)
}}
</div>
</tooltip>
<dropdown-menu
slot=
'list'
>
<dropdown-item>
<tooltip
:transfer=
"true"
:max-width=
"600"
>
<i-button
v-show=
"toolBarModels.tbitem21.visabled"
:disabled=
"toolBarModels.tbitem21.disabled"
class=
''
@
click=
"toolbar_click(
{ tag: 'tbitem21' }, $event)">
<i
class=
'fa fa-download'
></i>
<span
class=
'caption'
>
{{
$t
(
'entities.sys_user_role.customviewtoolbar_toolbar.tbitem21.caption'
)
}}
</span>
</i-button>
<div
slot=
'content'
>
{{
$t
(
'entities.sys_user_role.customviewtoolbar_toolbar.tbitem21.tip'
)
}}
</div>
</tooltip>
</dropdown-item>
<dropdown-item>
<tooltip
:transfer=
"true"
:max-width=
"600"
>
<i-button
v-show=
"toolBarModels.tbitem23.visabled"
:disabled=
"toolBarModels.tbitem23.disabled"
class=
''
@
click=
"toolbar_click(
{ tag: 'tbitem23' }, $event)">
<i
class=
'fa fa-upload'
></i>
<span
class=
'caption'
>
{{
$t
(
'entities.sys_user_role.customviewtoolbar_toolbar.tbitem23.caption'
)
}}
</span>
</i-button>
<div
slot=
'content'
>
{{
$t
(
'entities.sys_user_role.customviewtoolbar_toolbar.tbitem23.tip'
)
}}
</div>
</tooltip>
</dropdown-item>
</dropdown-menu>
</dropdown>
<span
class=
'seperator'
>
|
</span>
<tooltip
:transfer=
"true"
:max-width=
"600"
>
<i-button
v-show=
"toolBarModels.tbitem18.visabled"
:disabled=
"toolBarModels.tbitem18.disabled"
class=
''
@
click=
"toolbar_click(
{ tag: 'tbitem18' }, $event)">
<i
class=
'fa fa-question'
></i>
<span
class=
'caption'
>
{{
$t
(
'entities.sys_user_role.customviewtoolbar_toolbar.tbitem18.caption'
)
}}
</span>
</i-button>
<div
slot=
'content'
>
{{
$t
(
'entities.sys_user_role.customviewtoolbar_toolbar.tbitem18.tip'
)
}}
</div>
</tooltip>
</div>
<div
class=
"content-container"
>
<view
_searchform
:viewState=
"viewState"
:viewparams=
"viewparams"
:context=
"context"
:showBusyIndicator=
"true"
loaddraftAction=
"FilterGetDraft"
loadAction=
"FilterGet"
name=
"searchform"
ref=
'searchform'
@
closeview=
"closeView($event)"
>
</view
_searchform
>
<view
_grid
:viewState=
"viewState"
:viewparams=
"viewparams"
:context=
"context"
:isSingleSelect=
"isSingleSelect"
:showBusyIndicator=
"true"
updateAction=
""
removeAction=
"Remove"
loaddraftAction=
""
loadAction=
""
createAction=
""
fetchAction=
"FetchDefault"
name=
"grid"
ref=
'grid'
@
closeview=
"closeView($event)"
>
</view
_grid
>
<view
_treeview
:viewState=
"viewState"
:viewparams=
"viewparams"
:context=
"context"
:showBusyIndicator=
"true"
updateAction=
'Update'
removeAction=
'Remove'
loadAction=
'Get'
createAction=
'Create'
name=
"treeview"
ref=
'treeview'
@
closeview=
"closeView($event)"
>
</view
_treeview
>
</div>
</card>
</div>
...
...
@@ -162,6 +284,10 @@ export default class SYS_USER_ROLECustomViewBase extends Vue {
* @memberof SYS_USER_ROLECustomViewBase
*/
protected
containerModel
:
any
=
{
view_searchform
:
{
name
:
'searchform'
,
type
:
'SEARCHFORM'
},
view_toolbar
:
{
name
:
'toolbar'
,
type
:
'TOOLBAR'
},
view_grid
:
{
name
:
'grid'
,
type
:
'GRID'
},
view_treeview
:
{
name
:
'treeview'
,
type
:
'TREEVIEW'
},
};
/**
...
...
@@ -189,6 +315,40 @@ export default class SYS_USER_ROLECustomViewBase extends Vue {
*/
protected
viewState
:
Subject
<
ViewState
>
=
new
Subject
();
/**
* 工具栏模型
*
* @type {*}
* @memberof SYS_USER_ROLECustomView
*/
public
toolBarModels
:
any
=
{
tbitem3
:
{
name
:
'tbitem3'
,
caption
:
'新建'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'New'
,
target
:
''
}
},
tbitem4
:
{
name
:
'tbitem4'
,
caption
:
'编辑'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Edit'
,
target
:
'SINGLEKEY'
}
},
tbitem5
:
{
name
:
'tbitem5'
,
caption
:
'查看'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'View'
,
target
:
'SINGLEKEY'
}
},
tbitem6
:
{
name
:
'tbitem6'
,
caption
:
'拷贝'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Copy'
,
target
:
'SINGLEKEY'
}
},
tbitem7
:
{
name
:
'tbitem7'
,
type
:
'SEPERATOR'
,
visabled
:
true
,
dataaccaction
:
''
,
uiaction
:
{
}
},
tbitem8
:
{
name
:
'tbitem8'
,
caption
:
'删除'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Remove'
,
target
:
'MULTIKEY'
}
},
tbitem9
:
{
name
:
'tbitem9'
,
type
:
'SEPERATOR'
,
visabled
:
true
,
dataaccaction
:
''
,
uiaction
:
{
}
},
tbitem13
:
{
name
:
'tbitem13'
,
caption
:
'导出'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'ExportExcel'
,
target
:
''
},
MaxRowCount
:
1000
},
tbitem10
:
{
name
:
'tbitem10'
,
type
:
'SEPERATOR'
,
visabled
:
true
,
dataaccaction
:
''
,
uiaction
:
{
}
},
tbitem16
:
{
name
:
'tbitem16'
,
caption
:
'其它'
,
disabled
:
false
,
type
:
'ITEMS'
,
visabled
:
true
,
dataaccaction
:
''
,
uiaction
:
{
}
},
tbitem21
:
{
name
:
'tbitem21'
,
caption
:
'导出数据模型'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'ExportModel'
,
target
:
''
}
},
tbitem23
:
{
name
:
'tbitem23'
,
caption
:
'数据导入'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Import'
,
target
:
''
}
},
tbitem17
:
{
name
:
'tbitem17'
,
type
:
'SEPERATOR'
,
visabled
:
true
,
dataaccaction
:
''
,
uiaction
:
{
}
},
tbitem18
:
{
name
:
'tbitem18'
,
caption
:
'帮助'
,
disabled
:
false
,
type
:
'DEUIACTION'
,
visabled
:
true
,
dataaccaction
:
''
,
uiaction
:
{
tag
:
'Help'
,
target
:
''
}
},
};
/**
...
...
@@ -389,7 +549,640 @@ export default class SYS_USER_ROLECustomViewBase extends Vue {
}
/**
* toolbar 部件 click 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof SYS_USER_ROLECustomViewBase
*/
protected
toolbar_click
(
$event
:
any
,
$event2
?:
any
)
{
if
(
Object
.
is
(
$event
.
tag
,
'tbitem3'
))
{
this
.
toolbar_tbitem3_click
(
$event
,
''
,
$event2
);
}
if
(
Object
.
is
(
$event
.
tag
,
'tbitem4'
))
{
this
.
toolbar_tbitem4_click
(
$event
,
''
,
$event2
);
}
if
(
Object
.
is
(
$event
.
tag
,
'tbitem5'
))
{
this
.
toolbar_tbitem5_click
(
$event
,
''
,
$event2
);
}
if
(
Object
.
is
(
$event
.
tag
,
'tbitem6'
))
{
this
.
toolbar_tbitem6_click
(
$event
,
''
,
$event2
);
}
if
(
Object
.
is
(
$event
.
tag
,
'tbitem24'
))
{
this
.
toolbar_tbitem24_click
(
$event
,
''
,
$event2
);
}
if
(
Object
.
is
(
$event
.
tag
,
'tbitem25'
))
{
this
.
toolbar_tbitem25_click
(
$event
,
''
,
$event2
);
}
if
(
Object
.
is
(
$event
.
tag
,
'tbitem8'
))
{
this
.
toolbar_tbitem8_click
(
$event
,
''
,
$event2
);
}
if
(
Object
.
is
(
$event
.
tag
,
'tbitem13'
))
{
this
.
toolbar_tbitem13_click
(
$event
,
''
,
$event2
);
}
if
(
Object
.
is
(
$event
.
tag
,
'tbitem11'
))
{
this
.
toolbar_tbitem11_click
(
$event
,
''
,
$event2
);
}
if
(
Object
.
is
(
$event
.
tag
,
'tbitem21'
))
{
this
.
toolbar_tbitem21_click
(
$event
,
''
,
$event2
);
}
if
(
Object
.
is
(
$event
.
tag
,
'tbitem23'
))
{
this
.
toolbar_tbitem23_click
(
$event
,
''
,
$event2
);
}
if
(
Object
.
is
(
$event
.
tag
,
'tbitem19'
))
{
this
.
toolbar_tbitem19_click
(
$event
,
''
,
$event2
);
}
if
(
Object
.
is
(
$event
.
tag
,
'tbitem18'
))
{
this
.
toolbar_tbitem18_click
(
$event
,
''
,
$event2
);
}
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
protected
toolbar_tbitem3_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
=
{};
if
(
_this
.
getDatas
&&
_this
.
getDatas
instanceof
Function
)
{
datas
=
[...
_this
.
getDatas
()];
}
// 界面行为
this
.
New
(
datas
,
contextJO
,
paramJO
,
$event
,
xData
,
this
,
"SYS_USER_ROLE"
);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
protected
toolbar_tbitem4_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
=
{};
if
(
_this
.
getDatas
&&
_this
.
getDatas
instanceof
Function
)
{
datas
=
[...
_this
.
getDatas
()];
}
// 界面行为
this
.
Edit
(
datas
,
contextJO
,
paramJO
,
$event
,
xData
,
this
,
"SYS_USER_ROLE"
);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
protected
toolbar_tbitem5_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
=
{};
if
(
_this
.
getDatas
&&
_this
.
getDatas
instanceof
Function
)
{
datas
=
[...
_this
.
getDatas
()];
}
// 界面行为
this
.
View
(
datas
,
contextJO
,
paramJO
,
$event
,
xData
,
this
,
"SYS_USER_ROLE"
);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
protected
toolbar_tbitem6_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
=
{};
if
(
_this
.
getDatas
&&
_this
.
getDatas
instanceof
Function
)
{
datas
=
[...
_this
.
getDatas
()];
}
// 界面行为
this
.
Copy
(
datas
,
contextJO
,
paramJO
,
$event
,
xData
,
this
,
"SYS_USER_ROLE"
);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
protected
toolbar_tbitem24_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
=
{};
if
(
_this
.
getDatas
&&
_this
.
getDatas
instanceof
Function
)
{
datas
=
[...
_this
.
getDatas
()];
}
// 界面行为
this
.
ToggleRowEdit
(
datas
,
contextJO
,
paramJO
,
$event
,
xData
,
this
,
"SYS_USER_ROLE"
);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
protected
toolbar_tbitem25_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
=
{};
if
(
_this
.
getDatas
&&
_this
.
getDatas
instanceof
Function
)
{
datas
=
[...
_this
.
getDatas
()];
}
// 界面行为
this
.
NewRow
(
datas
,
contextJO
,
paramJO
,
$event
,
xData
,
this
,
"SYS_USER_ROLE"
);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
protected
toolbar_tbitem8_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
=
{};
if
(
_this
.
getDatas
&&
_this
.
getDatas
instanceof
Function
)
{
datas
=
[...
_this
.
getDatas
()];
}
// 界面行为
this
.
Remove
(
datas
,
contextJO
,
paramJO
,
$event
,
xData
,
this
,
"SYS_USER_ROLE"
);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
protected
toolbar_tbitem13_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
=
{};
if
(
_this
.
getDatas
&&
_this
.
getDatas
instanceof
Function
)
{
datas
=
[...
_this
.
getDatas
()];
}
// 界面行为
this
.
ExportExcel
(
datas
,
contextJO
,
paramJO
,
$event
,
xData
,
this
,
"SYS_USER_ROLE"
);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
protected
toolbar_tbitem11_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
=
{};
if
(
_this
.
getDatas
&&
_this
.
getDatas
instanceof
Function
)
{
datas
=
[...
_this
.
getDatas
()];
}
// 界面行为
this
.
Print
(
datas
,
contextJO
,
paramJO
,
$event
,
xData
,
this
,
"SYS_USER_ROLE"
);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
protected
toolbar_tbitem21_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
=
{};
if
(
_this
.
getDatas
&&
_this
.
getDatas
instanceof
Function
)
{
datas
=
[...
_this
.
getDatas
()];
}
// 界面行为
this
.
ExportModel
(
datas
,
contextJO
,
paramJO
,
$event
,
xData
,
this
,
"SYS_USER_ROLE"
);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
protected
toolbar_tbitem23_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
=
{};
if
(
_this
.
getDatas
&&
_this
.
getDatas
instanceof
Function
)
{
datas
=
[...
_this
.
getDatas
()];
}
// 界面行为
this
.
Import
(
datas
,
contextJO
,
paramJO
,
$event
,
xData
,
this
,
"SYS_USER_ROLE"
);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
protected
toolbar_tbitem19_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
=
{};
if
(
_this
.
getDatas
&&
_this
.
getDatas
instanceof
Function
)
{
datas
=
[...
_this
.
getDatas
()];
}
// 界面行为
this
.
ToggleFilter
(
datas
,
contextJO
,
paramJO
,
$event
,
xData
,
this
,
"SYS_USER_ROLE"
);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
protected
toolbar_tbitem18_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
=
{};
if
(
_this
.
getDatas
&&
_this
.
getDatas
instanceof
Function
)
{
datas
=
[...
_this
.
getDatas
()];
}
// 界面行为
this
.
Help
(
datas
,
contextJO
,
paramJO
,
$event
,
xData
,
this
,
"SYS_USER_ROLE"
);
}
/**
* 新建
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SYS_USER_ROLECustomViewBase
*/
protected
New
(
args
:
any
[],
contextJO
?:
any
,
params
?:
any
,
$event
?:
any
,
xData
?:
any
,
actionContext
?:
any
,
srfParentDeName
?:
string
)
{
const
_this
:
any
=
this
;
if
(
_this
.
newdata
&&
_this
.
newdata
instanceof
Function
)
{
const
data
:
any
=
{};
_this
.
newdata
([{
...
data
}],[{
...
data
}],
params
,
$event
,
xData
);
}
else
{
_this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'newdata 视图处理逻辑不存在,请添加!'
});
}
}
/**
* 编辑
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SYS_USER_ROLECustomViewBase
*/
protected
Edit
(
args
:
any
[],
contextJO
?:
any
,
params
?:
any
,
$event
?:
any
,
xData
?:
any
,
actionContext
?:
any
,
srfParentDeName
?:
string
)
{
if
(
args
.
length
===
0
)
{
return
;
}
const
_this
:
any
=
this
;
if
(
_this
.
opendata
&&
_this
.
opendata
instanceof
Function
)
{
const
data
:
any
=
{
};
if
(
args
.
length
>
0
)
{
Object
.
assign
(
data
,
{
sys_user_role
:
args
[
0
].
sys_user_role
})
}
_this
.
opendata
([{
...
data
}],
params
,
$event
,
xData
);
}
else
{
_this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'opendata 视图处理逻辑不存在,请添加!'
});
}
}
/**
* 查看
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SYS_USER_ROLECustomViewBase
*/
protected
View
(
args
:
any
[],
contextJO
?:
any
,
params
?:
any
,
$event
?:
any
,
xData
?:
any
,
actionContext
?:
any
,
srfParentDeName
?:
string
)
{
if
(
args
.
length
===
0
)
{
return
;
}
const
_this
:
any
=
this
;
if
(
_this
.
opendata
&&
_this
.
opendata
instanceof
Function
)
{
const
data
:
any
=
{
};
if
(
args
.
length
>
0
)
{
Object
.
assign
(
data
,
{
sys_user_role
:
args
[
0
].
sys_user_role
})
}
_this
.
opendata
([{
...
data
}],
params
,
$event
,
xData
);
}
else
{
_this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'opendata 视图处理逻辑不存在,请添加!'
});
}
}
/**
* 拷贝
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SYS_USER_ROLECustomViewBase
*/
protected
Copy
(
args
:
any
[],
contextJO
?:
any
,
params
?:
any
,
$event
?:
any
,
xData
?:
any
,
actionContext
?:
any
,
srfParentDeName
?:
string
)
{
if
(
args
.
length
===
0
)
{
return
;
}
const
_this
:
any
=
this
;
if
(
_this
.
newdata
&&
_this
.
newdata
instanceof
Function
)
{
const
data
:
any
=
{};
if
(
args
.
length
>
0
)
{
Object
.
assign
(
data
,
{
srfsourcekey
:
args
[
0
].
srfkey
})
}
_this
.
newdata
([{
...
data
}],[{
...
data
}],
params
,
$event
,
xData
);
}
else
if
(
xData
&&
xData
.
copy
instanceof
Function
)
{
const
data2
:
any
=
{};
if
(
args
.
length
>
0
)
{
Object
.
assign
(
data2
,
{
srfsourcekey
:
args
[
0
].
srfkey
})
}
xData
.
copy
(
data2
);
}
else
{
_this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'opendata 视图处理逻辑不存在,请添加!'
});
}
}
/**
* 行编辑
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SYS_USER_ROLECustomViewBase
*/
protected
ToggleRowEdit
(
args
:
any
[],
contextJO
?:
any
,
params
?:
any
,
$event
?:
any
,
xData
?:
any
,
actionContext
?:
any
,
srfParentDeName
?:
string
)
{
xData
.
actualIsOpenEdit
=
!
xData
.
actualIsOpenEdit
;
}
/**
* 新建行
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SYS_USER_ROLECustomViewBase
*/
protected
NewRow
(
args
:
any
[],
contextJO
?:
any
,
params
?:
any
,
$event
?:
any
,
xData
?:
any
,
actionContext
?:
any
,
srfParentDeName
?:
string
)
{
const
_this
:
any
=
this
;
const
data
:
any
=
{};
if
(
_this
.
newRow
&&
_this
.
newRow
instanceof
Function
)
{
_this
.
newRow
([{
...
data
}],
params
,
$event
,
xData
);
}
else
if
(
xData
.
newRow
&&
xData
.
newRow
instanceof
Function
)
{
xData
.
newRow
([{
...
data
}],
params
,
$event
,
xData
);
}
else
{
_this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'newRow 视图处理逻辑不存在,请添加!'
});
}
}
/**
* 删除
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SYS_USER_ROLECustomViewBase
*/
protected
Remove
(
args
:
any
[],
contextJO
?:
any
,
params
?:
any
,
$event
?:
any
,
xData
?:
any
,
actionContext
?:
any
,
srfParentDeName
?:
string
)
{
const
_this
:
any
=
this
;
if
(
!
xData
||
!
(
xData
.
remove
instanceof
Function
))
{
return
;
}
xData
.
remove
(
args
);
}
/**
* 导出
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SYS_USER_ROLECustomViewBase
*/
protected
ExportExcel
(
args
:
any
[],
contextJO
?:
any
,
params
?:
any
,
$event
?:
any
,
xData
?:
any
,
actionContext
?:
any
,
srfParentDeName
?:
string
)
{
const
_this
:
any
=
this
;
if
(
!
xData
||
!
(
xData
.
exportExcel
instanceof
Function
)
||
!
$event
)
{
return
;
}
xData
.
exportExcel
(
$event
.
exportparms
);
}
/**
* 打印
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SYS_USER_ROLECustomViewBase
*/
protected
Print
(
args
:
any
[],
contextJO
?:
any
,
params
?:
any
,
$event
?:
any
,
xData
?:
any
,
actionContext
?:
any
,
srfParentDeName
?:
string
)
{
let
_this
:
any
=
this
;
if
(
!
xData
||
!
(
xData
.
print
instanceof
Function
)
||
!
$event
)
{
return
;
}
xData
.
print
();
}
/**
* 导出数据模型
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SYS_USER_ROLECustomViewBase
*/
protected
ExportModel
(
args
:
any
[],
contextJO
?:
any
,
params
?:
any
,
$event
?:
any
,
xData
?:
any
,
actionContext
?:
any
,
srfParentDeName
?:
string
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'导出数据模型未支持'
});
}
/**
* 数据导入
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SYS_USER_ROLECustomViewBase
*/
protected
Import
(
args
:
any
[],
contextJO
?:
any
,
params
?:
any
,
$event
?:
any
,
xData
?:
any
,
actionContext
?:
any
,
srfParentDeName
?:
string
)
{
const
_this
:
any
=
this
;
if
(
!
xData
||
!
(
xData
.
importExcel
instanceof
Function
)
||
!
$event
)
{
return
;
}
xData
.
importExcel
(
params
);
}
/**
* 过滤
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SYS_USER_ROLECustomViewBase
*/
protected
ToggleFilter
(
args
:
any
[],
contextJO
?:
any
,
params
?:
any
,
$event
?:
any
,
xData
?:
any
,
actionContext
?:
any
,
srfParentDeName
?:
string
)
{
const
_this
:
any
=
this
;
if
(
_this
.
hasOwnProperty
(
'isExpandSearchForm'
))
{
_this
.
isExpandSearchForm
=
!
_this
.
isExpandSearchForm
;
}
}
/**
* 帮助
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SYS_USER_ROLECustomViewBase
*/
protected
Help
(
args
:
any
[],
contextJO
?:
any
,
params
?:
any
,
$event
?:
any
,
xData
?:
any
,
actionContext
?:
any
,
srfParentDeName
?:
string
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'帮助未支持'
});
}
/**
* 关闭视图
...
...
app_web/src/pages/uaa/sys-user-rolecustom-view/sys-user-rolecustom-view.less
浏览文件 @
3b1e9e6b
.sys-user-rolecustom-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/uaa/sys-user-rolecustom-view/sys-user-rolecustom-view.vue
浏览文件 @
3b1e9e6b
...
...
@@ -2,8 +2,14 @@
import
{
Component
}
from
'vue-property-decorator'
;
import
SYS_USER_ROLECustomViewBase
from
'./sys-user-rolecustom-view-base.vue'
;
import
view_searchform
from
'@widgets/sys-user-role/default-searchform/default-searchform.vue'
;
import
view_grid
from
'@widgets/sys-user-role/main-grid/main-grid.vue'
;
import
view_treeview
from
'@widgets/sys-user-role/sys-roletrees-treeview/sys-roletrees-treeview.vue'
;
@
Component
({
components
:
{
view_searchform
,
view_grid
,
view_treeview
,
},
beforeRouteEnter
:
(
to
:
any
,
from
:
any
,
next
:
any
)
=>
{
next
((
vm
:
any
)
=>
{
...
...
app_web/src/store/modules/view-action/state.ts
浏览文件 @
3b1e9e6b
...
...
@@ -256,6 +256,7 @@ export const viewstate: any = {
viewaction
:
''
,
viewdatachange
:
false
,
refviews
:
[
'1ee68b6d5d4c5c9413f6874e0ccabc43'
,
],
},
{
...
...
app_web/src/widgets/sys-user-role/sys-roletrees-treeview/sys-roletrees-treeview-base.vue
0 → 100644
浏览文件 @
3b1e9e6b
<
template
>
<div
class=
"design-tree-container"
>
<context-menu-container>
<el-tree
v-if=
"inited"
ref=
"treeview"
class=
"design-tree"
node-key=
"id"
lazy
:show-checkbox=
"!isSingleSelect"
:check-on-click-node=
"!isSingleSelect"
:default-expanded-keys=
"expandedKeys"
:props=
"
{
label: 'text',
isLeaf: 'leaf',
children: 'children'
}"
:load="load"
:highlight-current="true"
:expand-on-click-node="false"
@check="onCheck"
@current-change="selectionChange"
:filter-node-method="filterNode"
>
<template
slot-scope=
"
{ node, data }">
<context-menu
:contextMenuStyle=
"
{width: '100%'}" :data="node" :renderContent="renderContextMenu">
<tooltip
transfer
style=
"width: 100%;"
max-width=
"2000"
placement=
"right"
>
<div
class=
"tree-node"
@
dblclick=
"doDefaultAction(node)"
>
<span
class=
"icon"
>
<i
v-if=
" data.iconcls && !Object.is(data.iconcls, '')"
:class=
"data.iconcls"
></i>
<img
v-else-if=
"data.icon && !Object.is(data.icon, '')"
:src=
"data.icon"
/>
<icon
v-else-if=
"isOutputIconDefault"
type=
"ios-paper-outline"
></icon>
</span>
<span
class=
"text"
>
<span
v-if=
"data.html"
v-html=
"data.html"
></span>
<span
v-else
>
{{
data
.
isUseLangRes
?
$t
(
data
.
text
)
:
data
.
text
}}
</span>
</span>
</div>
<template
slot=
"content"
>
<span
v-if=
"data.html"
v-html=
"data.html"
></span>
<span
v-else
>
{{
data
.
isUseLangRes
?
$t
(
data
.
text
)
:
data
.
text
}}
</span>
</
template
>
</tooltip>
</context-menu>
</template>
</el-tree>
</context-menu-container>
</div>
</template>
<
script
lang=
'tsx'
>
import
{
Vue
,
Component
,
Prop
,
Provide
,
Emit
,
Watch
,
Model
}
from
'vue-property-decorator'
;
import
{
CreateElement
}
from
'vue'
;
import
{
Subject
,
Subscription
}
from
'rxjs'
;
import
{
ControlInterface
}
from
'@/interface/control'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
SYS_USER_ROLEService
from
'@/service/sys-user-role/sys-user-role-service'
;
import
SYS_ROLETreesService
from
'./sys-roletrees-treeview-service'
;
@
Component
({
components
:
{
}
})
export
default
class
SYS_ROLETreesBase
extends
Vue
implements
ControlInterface
{
/**
* 名称
*
* @type {string}
* @memberof SYS_ROLETrees
*/
@
Prop
()
protected
name
?:
string
;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof SYS_ROLETrees
*/
@
Prop
()
protected
viewState
!
:
Subject
<
ViewState
>
;
/**
* 应用上下文
*
* @type {*}
* @memberof SYS_ROLETrees
*/
@
Prop
()
protected
context
:
any
;
/**
* 视图参数
*
* @type {*}
* @memberof SYS_ROLETrees
*/
@
Prop
()
protected
viewparams
:
any
;
/**
* 视图状态事件
*
* @protected
* @type {(Subscription | undefined)}
* @memberof SYS_ROLETrees
*/
protected
viewStateEvent
:
Subscription
|
undefined
;
/**
* 获取部件类型
*
* @returns {string}
* @memberof SYS_ROLETrees
*/
protected
getControlType
():
string
{
return
'TREEVIEW'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof SYS_ROLETrees
*/
protected
counterServiceArray
:
Array
<
any
>
=
[];
/**
* 建构部件服务对象
*
* @type {SYS_ROLETreesService}
* @memberof SYS_ROLETrees
*/
protected
service
:
SYS_ROLETreesService
=
new
SYS_ROLETreesService
({
$store
:
this
.
$store
});
/**
* 实体服务对象
*
* @type {SYS_USER_ROLEService}
* @memberof SYS_ROLETrees
*/
protected
appEntityService
:
SYS_USER_ROLEService
=
new
SYS_USER_ROLEService
({
$store
:
this
.
$store
});
/**
* 关闭视图
*
* @param {any} args
* @memberof SYS_ROLETrees
*/
protected
closeView
(
args
:
any
):
void
{
let
_this
:
any
=
this
;
_this
.
$emit
(
'closeview'
,
[
args
]);
}
/**
* 计数器刷新
*
* @memberof SYS_ROLETrees
*/
public
counterRefresh
(){
const
_this
:
any
=
this
;
if
(
_this
.
counterServiceArray
&&
_this
.
counterServiceArray
.
length
>
0
){
_this
.
counterServiceArray
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
refreshData
&&
item
.
refreshData
instanceof
Function
){
item
.
refreshData
();
}
})
}
}
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof SYS_ROLETrees
*/
public
getDatas
():
any
[]
{
return
[
this
.
currentselectedNode
];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof SYS_ROLETrees
*/
public
getData
():
any
{
return
this
.
currentselectedNode
;
}
/**
* 是否单选
*
* @type {boolean}
* @memberof SYS_ROLETrees
*/
@
Prop
({
default
:
true
})
protected
isSingleSelect
!
:
boolean
;
/**
* 是否默认选中第一条数据
*
* @type {boolean}
* @memberof SYS_ROLETrees
*/
@
Prop
({
default
:
false
})
protected
isSelectFirstDefault
!
:
boolean
;
/**
* 枝干节点是否可用(具有数据能力,可抛出)
*
* @type {string}
* @memberof SYS_ROLETrees
*/
@
Prop
({
default
:
true
})
protected
isBranchAvailable
!
:
boolean
;
/**
* 显示处理提示
*
* @type {boolean}
* @memberof SYS_ROLETrees
*/
@
Prop
({
default
:
true
})
protected
showBusyIndicator
?:
boolean
;
/**
* 初始化完成
*
* @type {boolean}
* @memberof SYS_ROLETrees
*/
protected
inited
:
boolean
=
false
;
/**
* 已选中数据集合
*
* @type {*}
* @memberof SYS_ROLETrees
*/
protected
selectedNodes
:
any
=
[];
/**
* 当前选中数据项
*
* @type {*}
* @memberof SYS_ROLETrees
*/
protected
currentselectedNode
:
any
=
{};
/**
* 选中数据字符串
*
* @type {string}
* @memberof SYS_ROLETrees
*/
@
Prop
()
protected
selectedData
?:
string
;
/**
* 选中值变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof SYS_ROLETrees
*/
@
Watch
(
'selectedData'
)
public
onValueChange
(
newVal
:
any
,
oldVal
:
any
)
{
this
.
echoselectedNodes
=
newVal
?
this
.
isSingleSelect
?
JSON
.
parse
(
newVal
)[
0
]
:
JSON
.
parse
(
newVal
)
:
[];
this
.
selectedNodes
=
[];
if
(
this
.
echoselectedNodes
.
length
>
0
){
let
AllnodesObj
=
(
this
.
$refs
.
treeexpbar_tree
as
any
).
store
.
nodesMap
;
let
AllnodesArray
:
any
[]
=
[];
for
(
const
key
in
AllnodesObj
)
{
if
(
AllnodesObj
.
hasOwnProperty
(
key
))
{
AllnodesArray
.
push
(
AllnodesObj
[
key
].
data
);
}
}
this
.
setDefaultSelection
(
AllnodesArray
);
}
}
/**
* 回显选中数据集合
*
* @type {*}
* @memberof SYS_ROLETrees
*/
protected
echoselectedNodes
:
any
[]
=
this
.
selectedData
?
(
this
.
isSingleSelect
?
[
JSON
.
parse
(
this
.
selectedData
)[
0
]]
:
JSON
.
parse
(
this
.
selectedData
))
:
[];
/**
* 部件行为--update
*
* @type {string}
* @memberof SYS_ROLETrees
*/
@
Prop
()
protected
updateAction
!
:
string
;
/**
* 部件行为--fetch
*
* @type {string}
* @memberof SYS_ROLETrees
*/
@
Prop
()
protected
fetchAction
!
:
string
;
/**
* 部件行为--remove
*
* @type {string}
* @memberof SYS_ROLETrees
*/
@
Prop
()
protected
removeAction
!
:
string
;
/**
* 部件行为--load
*
* @type {string}
* @memberof SYS_ROLETrees
*/
@
Prop
()
protected
loadAction
!
:
string
;
/**
* 部件行为--create
*
* @type {string}
* @memberof SYS_ROLETrees
*/
@
Prop
()
protected
createAction
!
:
string
;
/**
* 过滤属性
*
* @type {string}
* @memberof SYS_ROLETrees
*/
protected
srfnodefilter
:
string
=
''
;
/**
* 默认输出图标
*
* @type {boolean}
* @memberof SYS_ROLETrees
*/
protected
isOutputIconDefault
:
boolean
=
true
;
/**
* 数据展开主键
*
* @type {string[]}
* @memberof SYS_ROLETrees
*/
@
Provide
()
protected
expandedKeys
:
string
[]
=
[];
/**
* 选中数据变更事件
*
* @private
* @param {*} data
* @param {*} data 当前节点对应传入对象
* @param {*} checkedState 树目前选中状态对象
* @memberof SYS_ROLETrees
*/
private
onCheck
(
data
:
any
,
checkedState
:
any
)
{
// 处理多选数据
if
(
!
this
.
isSingleSelect
){
let
leafNodes
=
checkedState
.
checkedNodes
.
filter
((
item
:
any
)
=>
item
.
leaf
);
this
.
selectedNodes
=
JSON
.
parse
(
JSON
.
stringify
(
leafNodes
));
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
}
}
/**
* 选中数据变更事件
*
* @private
* @param {*} data 节点对应传入对象
* @param {*} node 节点对应node对象
* @memberof SYS_ROLETrees
*/
private
selectionChange
(
data
:
any
,
node
:
any
)
{
// 禁用项处理
if
(
data
.
disabled
){
node
.
isCurrent
=
false
;
return
;
}
// 只处理最底层子节点
if
(
this
.
isBranchAvailable
||
data
.
leaf
){
this
.
currentselectedNode
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
// 单选直接替换
if
(
this
.
isSingleSelect
){
this
.
selectedNodes
=
[
this
.
currentselectedNode
];
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
}
// 多选用check方法
}
}
/**
* Vue声明周期(处理组件的输入属性)
*
* @memberof SYS_ROLETrees
*/
protected
created
()
{
this
.
afterCreated
();
}
/**
* 执行created后的逻辑
*
* @memberof SYS_ROLETrees
*/
protected
afterCreated
(){
if
(
this
.
viewState
)
{
this
.
viewStateEvent
=
this
.
viewState
.
subscribe
(({
tag
,
action
,
data
})
=>
{
if
(
!
Object
.
is
(
tag
,
this
.
name
))
{
return
;
}
if
(
Object
.
is
(
'load'
,
action
))
{
this
.
inited
=
false
;
this
.
$nextTick
(()
=>
{
this
.
inited
=
true
;
});
}
if
(
Object
.
is
(
'filter'
,
action
))
{
this
.
srfnodefilter
=
data
.
srfnodefilter
;
this
.
refresh_all
();
}
if
(
Object
.
is
(
'refresh_parent'
,
action
))
{
this
.
refresh_parent
();
}
});
}
}
/**
* 对树节点进行筛选操作
* @memberof OrderTree
*/
protected
filterNode
(
value
:
any
,
data
:
any
)
{
if
(
!
value
)
return
true
;
return
data
.
text
.
indexOf
(
value
)
!==
-
1
;
}
/**
* vue 生命周期
*
* @memberof SYS_ROLETrees
*/
protected
destroyed
()
{
this
.
afterDestroy
();
}
/**
* 执行destroyed后的逻辑
*
* @memberof SYS_ROLETrees
*/
protected
afterDestroy
()
{
if
(
this
.
viewStateEvent
)
{
this
.
viewStateEvent
.
unsubscribe
();
}
}
/**
* 刷新数据
*
* @memberof SYS_ROLETrees
*/
protected
refresh_all
():
void
{
this
.
inited
=
false
;
this
.
$nextTick
(()
=>
{
this
.
inited
=
true
;
});
}
/**
* 刷新父节点
*
* @memberof SYS_ROLETrees
*/
protected
refresh_parent
():
void
{
if
(
Object
.
keys
(
this
.
currentselectedNode
).
length
===
0
)
{
return
;
}
const
tree
:
any
=
this
.
$refs
.
treeview
;
const
node
:
any
=
tree
.
getNode
(
this
.
currentselectedNode
.
id
);
if
(
!
node
||
!
node
.
parent
)
{
return
;
}
let
curNode
:
any
=
{};
const
{
parent
:
_parent
}
=
node
;
curNode
=
Util
.
deepObjectMerge
(
curNode
,
_parent
);
let
tempContext
:
any
=
{};
if
(
curNode
.
data
&&
curNode
.
data
.
srfappctx
){
Object
.
assign
(
tempContext
,
curNode
.
data
.
srfappctx
);
}
else
{
Object
.
assign
(
tempContext
,
this
.
context
);
}
const
id
:
string
=
_parent
.
key
?
_parent
.
key
:
'#'
;
const
param
:
any
=
{
srfnodeid
:
id
};
this
.
refresh_node
(
tempContext
,
param
,
true
);
}
/**
* 数据加载
*
* @param {*} node
* @memberof SYS_ROLETrees
*/
protected
load
(
node
:
any
=
{},
resolve
?:
any
)
{
if
(
node
.
data
&&
node
.
data
.
children
)
{
resolve
(
node
.
data
.
children
);
return
;
}
const
params
:
any
=
{
srfnodeid
:
node
.
data
&&
node
.
data
.
id
?
node
.
data
.
id
:
"#"
,
srfnodefilter
:
this
.
srfnodefilter
};
Object
.
assign
(
params
,{
viewparams
:
this
.
viewparams
});
let
curNode
:
any
=
{};
curNode
=
Util
.
deepObjectMerge
(
curNode
,
node
);
let
tempContext
:
any
=
this
.
computecurNodeContext
(
curNode
);
this
.
service
.
getNodes
(
tempContext
,
params
).
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
"错误"
,
desc
:
response
.
info
});
resolve
([]);
return
;
}
const
_items
=
response
.
data
;
this
.
formatExpanded
(
_items
);
resolve
([...
_items
]);
let
isRoot
=
Object
.
is
(
node
.
level
,
0
);
let
isSelectedAll
=
node
.
checked
;
this
.
setDefaultSelection
(
_items
,
isRoot
,
isSelectedAll
);
this
.
$emit
(
"load"
,
_items
);
}).
catch
((
response
:
any
)
=>
{
resolve
([]);
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
"错误"
,
desc
:
response
.
info
});
});
}
/**
* 计算当前节点的上下文
*
* @param {*} curNode 当前节点
* @memberof SYS_ROLETrees
*/
protected
computecurNodeContext
(
curNode
:
any
){
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
));
while
(
curNode
){
if
(
curNode
.
data
&&
curNode
.
data
.
id
){
let
strTreeNodeId
:
string
=
curNode
.
data
.
id
;
let
strNodeType
:
string
=
strTreeNodeId
.
substring
(
0
,
strTreeNodeId
.
indexOf
(
";"
)).
toLowerCase
();
let
strRealNodeValue
:
string
=
curNode
.
data
.
srfkey
;
let
strNodeKey
:
string
=
curNode
.
data
.
srfappctxkey
?
curNode
.
data
.
srfappctxkey
:
strNodeType
;
if
(
!
tempContext
[
strNodeKey
]){
Object
.
defineProperty
(
tempContext
,
strNodeKey
,
{
value
:
strRealNodeValue
,
writable
:
true
,
enumerable
:
true
,
configurable
:
true
});
}
if
(
tempContext
[
strNodeKey
]){
curNode
=
null
;
}
}
if
(
curNode
){
curNode
=
curNode
.
parent
;
}
}
return
tempContext
;
}
/**
* 刷新功能
*
* @param {any[]} args
* @memberof SYS_ROLETrees
*/
protected
refresh
(
args
:
any
[]):
void
{
if
(
Object
.
keys
(
this
.
currentselectedNode
).
length
===
0
)
{
return
;
}
const
id
:
string
=
this
.
currentselectedNode
.
id
;
const
param
:
any
=
{
srfnodeid
:
id
};
const
tree
:
any
=
this
.
$refs
.
treeview
;
const
node
:
any
=
tree
.
getNode
(
id
);
if
(
!
node
)
{
return
;
}
let
curNode
:
any
=
{};
curNode
=
Util
.
deepObjectMerge
(
curNode
,
node
);
let
tempContext
:
any
;
if
(
curNode
.
data
&&
curNode
.
data
.
srfappctx
){
Object
.
assign
(
tempContext
,
curNode
.
data
.
srfappctx
);
}
else
{
Object
.
assign
(
tempContext
,
this
.
context
);
}
this
.
refresh_node
(
tempContext
,
param
,
false
);
}
/**
* 刷新节点
*
* @protected
* @param {*} [curContext] 当前节点上下文
* @param {*} [arg={}] 当前节点附加参数
* @param {boolean} parentnode 是否是刷新父节点
* @memberof SYS_ROLETrees
*/
protected
refresh_node
(
curContext
:
any
,
arg
:
any
=
{},
parentnode
:
boolean
):
void
{
const
{
srfnodeid
:
id
}
=
arg
;
Object
.
assign
(
arg
,{
viewparams
:
this
.
viewparams
});
const
get
:
Promise
<
any
>
=
this
.
service
.
getNodes
(
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
);
get
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
info
});
return
;
}
const
_items
=
[...
response
.
data
];
this
.
formatExpanded
(
_items
);
const
tree
:
any
=
this
.
$refs
.
treeview
;
tree
.
updateKeyChildren
(
id
,
_items
);
if
(
parentnode
)
{
this
.
currentselectedNode
=
{};
}
this
.
setDefaultSelection
(
_items
);
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
}
this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
info
});
});
}
/**
* 默认展开节点
*
* @private
* @param {any[]} items
* @returns {any[]}
* @memberof SYS_ROLETrees
*/
protected
formatExpanded
(
items
:
any
[]):
any
[]
{
const
data
:
any
[]
=
[];
items
.
forEach
((
item
)
=>
{
if
(
item
.
expanded
||
(
item
.
children
&&
item
.
children
.
length
>
0
))
{
this
.
expandedKeys
.
push
(
item
.
id
);
}
});
return
data
;
}
/**
* 设置默认选中,回显数项,选中所有子节点
*
* @param {any[]} items 当前节点所有子节点集合
* @param {boolean} isRoot 是否是加载根节点
* @param {boolean} isSelectedAll 是否选中所有子节点
* @memberof MainTree
*/
protected
setDefaultSelection
(
items
:
any
[],
isRoot
:
boolean
=
false
,
isSelectedAll
:
boolean
=
false
):
void
{
if
(
items
.
length
==
0
){
return
;
}
let
defaultData
:
any
;
// 导航中选中第一条配置的默认选中,没有选中第一条
if
(
this
.
isSelectFirstDefault
){
if
(
this
.
isSingleSelect
){
let
index
=
items
.
findIndex
((
item
:
any
)
=>
item
.
selected
);
if
(
index
===
-
1
)
{
if
(
isRoot
){
index
=
0
;
}
else
{
return
;
}
}
defaultData
=
items
[
index
];
this
.
setTreeNodeHighLight
(
defaultData
);
this
.
currentselectedNode
=
JSON
.
parse
(
JSON
.
stringify
(
defaultData
));
if
(
this
.
isBranchAvailable
||
defaultData
.
leaf
){
this
.
selectedNodes
=
[
this
.
currentselectedNode
];
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
}
}
}
// 已选数据的回显
if
(
this
.
echoselectedNodes
&&
this
.
echoselectedNodes
.
length
>
0
){
let
checkedNodes
=
items
.
filter
((
item
:
any
)
=>
{
return
this
.
echoselectedNodes
.
some
((
val
:
any
)
=>
{
if
(
Object
.
is
(
item
.
srfkey
,
val
.
srfkey
)
&&
Object
.
is
(
item
.
srfmajortext
,
val
.
srfmajortext
)){
val
.
used
=
true
;
return
true
;
}
});
});
if
(
checkedNodes
.
length
>
0
){
this
.
echoselectedNodes
=
this
.
echoselectedNodes
.
filter
((
item
:
any
)
=>
!
item
.
used
);
// 父节点选中时,不需要执行这段,会选中所有子节点
if
(
!
isSelectedAll
){
if
(
this
.
isSingleSelect
){
this
.
setTreeNodeHighLight
(
checkedNodes
[
0
]);
this
.
currentselectedNode
=
JSON
.
parse
(
JSON
.
stringify
(
checkedNodes
[
0
]));
this
.
selectedNodes
=
[
this
.
currentselectedNode
];
}
else
{
this
.
selectedNodes
=
this
.
selectedNodes
.
concat
(
checkedNodes
);
const
tree
:
any
=
this
.
$refs
.
treeexpbar_tree
;
tree
.
setCheckedNodes
(
this
.
selectedNodes
);
}
}
}
}
// 父节点选中时,选中所有子节点
if
(
isSelectedAll
){
let
leafNodes
=
items
.
filter
((
item
:
any
)
=>
item
.
leaf
);
this
.
selectedNodes
=
this
.
selectedNodes
.
concat
(
leafNodes
);
this
.
$emit
(
'selectionchange'
,
this
.
selectedNodes
);
}
}
/**
* 绘制右击菜单
*
* @param {*} node
* @returns
* @memberof SYS_ROLETrees
*/
protected
renderContextMenu
(
node
:
any
)
{
let
content
;
if
(
node
&&
node
.
data
)
{
const
data
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
node
.
data
));
this
.
currentselectedNode
=
{
...
data
};
const
tags
:
string
[]
=
data
.
id
.
split
(
';'
);
}
return
content
;
}
/**
* 设置选中高亮
*
* @param {*} data
* @memberof SYS_ROLETrees
*/
protected
setTreeNodeHighLight
(
data
:
any
):
void
{
const
tree
:
any
=
this
.
$refs
.
treeview
;
tree
.
setCurrentKey
(
data
.
id
);
}
/**
* 执行默认界面行为
*
* @param {*} node
* @memberof AppView
*/
protected
doDefaultAction
(
node
:
any
)
{
if
(
node
&&
node
.
data
)
{
const
data
:
any
=
node
.
data
;
const
tags
:
string
[]
=
data
.
id
.
split
(
';'
);
}
}
}
</
script
>
<
style
lang=
'less'
>
@import './sys-roletrees-treeview.less';
</
style
>
\ No newline at end of file
app_web/src/widgets/sys-user-role/sys-roletrees-treeview/sys-roletrees-treeview-model.ts
0 → 100644
浏览文件 @
3b1e9e6b
/**
* SYS_ROLETrees 部件模型
*
* @export
* @class SYS_ROLETreesModel
*/
export
default
class
SYS_ROLETreesModel
{
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof SYS_ROLETreesModel
*/
public
getDataItems
():
any
[]
{
return
[
{
name
:
'sys_user_role'
,
prop
:
'userroleid'
,
},
{
name
:
'userrolename'
,
},
{
name
:
'roleid'
,
},
{
name
:
'rolename'
,
},
{
name
:
'userid'
,
},
{
name
:
'personname'
,
},
{
name
:
'createdate'
,
},
{
name
:
'updatedate'
,
},
]
}
}
\ No newline at end of file
app_web/src/widgets/sys-user-role/sys-roletrees-treeview/sys-roletrees-treeview-service.ts
0 → 100644
浏览文件 @
3b1e9e6b
import
{
Http
,
Util
,
Errorlog
}
from
'@/utils'
;
import
ControlService
from
'@/widgets/control-service'
;
import
SYS_USER_ROLEService
from
'@/service/sys-user-role/sys-user-role-service'
;
import
SYS_ROLETreesModel
from
'./sys-roletrees-treeview-model'
;
import
CodeListService
from
'@service/app/codelist-service'
;
import
i18n
from
'@/locale'
;
/**
* SYS_ROLETrees 部件服务对象
*
* @export
* @class SYS_ROLETreesService
*/
export
default
class
SYS_ROLETreesService
extends
ControlService
{
/**
* 用户角色关系服务对象
*
* @type {SYS_USER_ROLEService}
* @memberof SYS_ROLETreesService
*/
public
appEntityService
:
SYS_USER_ROLEService
=
new
SYS_USER_ROLEService
({
$store
:
this
.
getStore
()
});
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof SYS_ROLETreesService
*/
public
setTempMode
(){
this
.
isTempMode
=
false
;
}
/**
* Creates an instance of SYS_ROLETreesService.
*
* @param {*} [opts={}]
* @memberof SYS_ROLETreesService
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
this
.
model
=
new
SYS_ROLETreesModel
();
}
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof SYS_ROLETreesService
*/
public
codeListService
:
CodeListService
=
new
CodeListService
({
$store
:
this
.
getStore
()
});
/**
* 节点分隔符号
*
* @private
* @type {string}
* @memberof SYS_ROLETreesService
*/
private
TREENODE_SEPARATOR
:
string
=
';'
;
/**
* 默认根节点节点分隔符号
*
* @private
* @type {string}
* @memberof SYS_ROLETreesService
*/
private
TREENODE_ROOT
:
string
=
'ROOT'
;
/**
* 实体数据能力节点分隔符号
*
* @private
* @type {string}
* @memberof SYS_ROLETreesService
*/
private
TREENODE_CREATE
:
string
=
'CREATE'
;
/**
* 实体节点分隔符号
*
* @private
* @type {string}
* @memberof SYS_ROLETreesService
*/
private
TREENODE_TESTENTITY
:
string
=
'TESTENTITY'
;
/**
* 获取节点数据
*
* @param {string} action
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_ROLETreesService
*/
@
Errorlog
public
async
getNodes
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
{
srfparentkey
,
srfcat
,
srfnodeid
,
srfnodefilter
,
query
}:
{
srfparentkey
:
string
,
srfcat
:
string
,
srfnodeid
:
string
,
srfnodefilter
:
string
,
query
:
string
}
=
data
;
srfnodefilter
=
query
?
query
:
srfnodefilter
;
let
list
:
any
[]
=
[];
let
filter
:
any
=
{};
if
(
!
srfnodeid
||
Object
.
is
(
srfnodeid
,
'#'
))
{
srfnodeid
=
this
.
TREENODE_ROOT
;
}
let
strTreeNodeId
:
string
=
srfnodeid
;
let
strRealNodeId
:
string
=
''
;
let
bRootSelect
:
boolean
=
false
;
let
strNodeType
:
string
|
null
=
null
;
let
strRootSelectNode
:
string
=
''
;
if
(
Object
.
is
(
strTreeNodeId
,
this
.
TREENODE_ROOT
))
{
strNodeType
=
this
.
TREENODE_ROOT
;
if
(
srfparentkey
)
{
strRealNodeId
=
srfparentkey
;
}
}
else
{
let
nPos
=
strTreeNodeId
.
indexOf
(
this
.
TREENODE_SEPARATOR
);
if
(
nPos
===
-
1
)
{
return
Promise
.
reject
({
status
:
500
,
data
:
{
title
:
'失败'
,
message
:
`树节点
${
strTreeNodeId
}
标识无效`
}
});
}
strNodeType
=
strTreeNodeId
.
substring
(
0
,
nPos
);
strRealNodeId
=
strTreeNodeId
.
substring
(
nPos
+
1
);
}
Object
.
assign
(
filter
,
{
srfparentkey
:
srfparentkey
,
srfcat
:
srfcat
,
srfnodefilter
:
srfnodefilter
,
strRealNodeId
:
strRealNodeId
,
srfnodeid
:
srfnodeid
,
strNodeType
:
strNodeType
}
);
// 分解节点标识
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_ROOT
))
{
await
this
.
fillRootNodeChilds
(
context
,
filter
,
list
);
return
Promise
.
resolve
({
status
:
200
,
data
:
list
});
}
if
(
Object
.
is
(
strNodeType
,
this
.
TREENODE_CREATE
))
{
await
this
.
fillCreateNodeChilds
(
context
,
filter
,
list
);
return
Promise
.
resolve
({
status
:
200
,
data
:
list
});
}
if
(
Object
.
is
(
strNodeType
,
this
.
TREENODE_TESTENTITY
))
{
await
this
.
fillTestentityNodeChilds
(
context
,
filter
,
list
);
return
Promise
.
resolve
({
status
:
200
,
data
:
list
});
}
return
Promise
.
resolve
({
status
:
500
,
data
:
{
title
:
'失败'
,
message
:
`树节点
${
strTreeNodeId
}
标识无效`
}
});
}
/**
* 填充 树视图节点[默认根节点]
*
* @private
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof SYS_ROLETreesService
*/
@
Errorlog
private
fillRootNodes
(
context
:
any
=
{},
filter
:
any
,
list
:
any
[]):
Promise
<
any
>
{
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
treeNode
:
any
=
{};
Object
.
assign
(
treeNode
,
{
text
:
'entities.sys_user_role.sys_roletrees_treeview.nodes.root'
});
Object
.
assign
(
treeNode
,
{
isUseLangRes
:
true
});
Object
.
assign
(
treeNode
,{
srfappctx
:
context
});
Object
.
assign
(
treeNode
,
{
srfmajortext
:
treeNode
.
text
});
let
strNodeId
:
string
=
'ROOT'
;
Object
.
assign
(
treeNode
,
{
srfkey
:
'root'
});
strNodeId
+=
this
.
TREENODE_SEPARATOR
;
strNodeId
+=
'root'
;
Object
.
assign
(
treeNode
,
{
id
:
strNodeId
});
Object
.
assign
(
treeNode
,
{
expanded
:
filter
.
isAutoexpand
});
Object
.
assign
(
treeNode
,
{
leaf
:
false
});
Object
.
assign
(
treeNode
,
{
navparams
:
'{}'
});
Object
.
assign
(
treeNode
,
{
nodeid
:
treeNode
.
srfkey
});
Object
.
assign
(
treeNode
,
{
nodeid2
:
filter
.
strRealNodeId
});
list
.
push
(
treeNode
);
resolve
(
list
);
});
}
/**
* 填充 树视图节点[默认根节点]子节点
*
* @private
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof SYS_ROLETreesService
*/
@
Errorlog
private
async
fillRootNodeChilds
(
context
:
any
=
{},
filter
:
any
,
list
:
any
[]):
Promise
<
any
>
{
if
(
filter
.
srfnodefilter
&&
!
Object
.
is
(
filter
.
srfnodefilter
,
""
))
{
// 填充实体
await
this
.
fillTestentityNodes
(
context
,
filter
,
list
);
}
else
{
// 填充实体
await
this
.
fillTestentityNodes
(
context
,
filter
,
list
);
}
}
/**
* 填充 树视图节点[实体数据能力]
*
* @private
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof SYS_ROLETreesService
*/
@
Errorlog
private
fillCreateNodes
(
context
:
any
=
{},
filter
:
any
,
list
:
any
[]):
Promise
<
any
>
{
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
treeNode
:
any
=
{};
Object
.
assign
(
treeNode
,
{
text
:
'entities.sys_user_role.sys_roletrees_treeview.nodes.create'
});
Object
.
assign
(
treeNode
,
{
isUseLangRes
:
true
});
Object
.
assign
(
treeNode
,{
srfappctx
:
context
});
Object
.
assign
(
treeNode
,
{
srfmajortext
:
treeNode
.
text
});
let
strNodeId
:
string
=
'CREATE'
;
Object
.
assign
(
treeNode
,
{
srfkey
:
'CREATE'
});
strNodeId
+=
this
.
TREENODE_SEPARATOR
;
strNodeId
+=
'CREATE'
;
Object
.
assign
(
treeNode
,
{
id
:
strNodeId
});
Object
.
assign
(
treeNode
,
{
expanded
:
filter
.
isAutoexpand
});
Object
.
assign
(
treeNode
,
{
leaf
:
true
});
Object
.
assign
(
treeNode
,
{
navparams
:
'{}'
});
Object
.
assign
(
treeNode
,
{
nodeid
:
treeNode
.
srfkey
});
Object
.
assign
(
treeNode
,
{
nodeid2
:
filter
.
strRealNodeId
});
list
.
push
(
treeNode
);
resolve
(
list
);
});
}
/**
* 填充 树视图节点[实体数据能力]子节点
*
* @private
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof SYS_ROLETreesService
*/
@
Errorlog
private
async
fillCreateNodeChilds
(
context
:
any
=
{},
filter
:
any
,
list
:
any
[]):
Promise
<
any
>
{
if
(
filter
.
srfnodefilter
&&
!
Object
.
is
(
filter
.
srfnodefilter
,
""
))
{
}
else
{
}
}
/**
* 填充 树视图节点[实体]
*
* @private
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof SYS_ROLETreesService
*/
@
Errorlog
private
fillTestentityNodes
(
context
:
any
=
{},
filter
:
any
,
list
:
any
[]):
Promise
<
any
>
{
return
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
treeNode
:
any
=
{};
Object
.
assign
(
treeNode
,
{
text
:
'entities.sys_user_role.sys_roletrees_treeview.nodes.testentity'
});
Object
.
assign
(
treeNode
,
{
isUseLangRes
:
true
});
Object
.
assign
(
treeNode
,{
srfappctx
:
context
});
Object
.
assign
(
treeNode
,
{
srfmajortext
:
treeNode
.
text
});
let
strNodeId
:
string
=
'TESTENTITY'
;
Object
.
assign
(
treeNode
,
{
srfkey
:
'TESTENTITY'
});
strNodeId
+=
this
.
TREENODE_SEPARATOR
;
strNodeId
+=
'TESTENTITY'
;
Object
.
assign
(
treeNode
,
{
id
:
strNodeId
});
Object
.
assign
(
treeNode
,
{
expanded
:
filter
.
isAutoexpand
});
Object
.
assign
(
treeNode
,
{
leaf
:
false
});
Object
.
assign
(
treeNode
,
{
navparams
:
'{}'
});
Object
.
assign
(
treeNode
,
{
nodeid
:
treeNode
.
srfkey
});
Object
.
assign
(
treeNode
,
{
nodeid2
:
filter
.
strRealNodeId
});
list
.
push
(
treeNode
);
resolve
(
list
);
});
}
/**
* 填充 树视图节点[实体]子节点
*
* @private
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof SYS_ROLETreesService
*/
@
Errorlog
private
async
fillTestentityNodeChilds
(
context
:
any
=
{},
filter
:
any
,
list
:
any
[]):
Promise
<
any
>
{
if
(
filter
.
srfnodefilter
&&
!
Object
.
is
(
filter
.
srfnodefilter
,
""
))
{
// 填充实体数据能力
await
this
.
fillCreateNodes
(
context
,
filter
,
list
);
}
else
{
// 填充实体数据能力
await
this
.
fillCreateNodes
(
context
,
filter
,
list
);
}
}
/**
* 处理代码表返回数据(树状结构)
*
* @param result 返回数组
* @param context 应用上下文
* @param callBack 回调
* @memberof SYS_ROLETreesService
*/
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 SYS_ROLETreesService
*/
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 SYS_ROLETreesService
*/
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
);
})
}
}
\ No newline at end of file
app_web/src/widgets/sys-user-role/sys-roletrees-treeview/sys-roletrees-treeview.less
0 → 100644
浏览文件 @
3b1e9e6b
.tree-right-menu {
.ivu-divider-horizontal {
width: calc(100% - 32px);
min-width: calc(100% - 32px);
margin: 0 auto;
}
.ivu-dropdown-item {
position: relative;
padding-left: 32px;
> i {
position: absolute;
left: 16px;
top: 10px;
}
.ivu-icon-ios-arrow-forward {
left: initial;
right: 4px;
}
}
.ivu-dropdown {
.ivu-select-dropdown {
margin: 0;
}
}
}
.el-tree .context-menu-component .tree-node{
width: calc(100% - 15px);
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
// this is less
app_web/src/widgets/sys-user-role/sys-roletrees-treeview/sys-roletrees-treeview.vue
0 → 100644
浏览文件 @
3b1e9e6b
<
script
lang=
'tsx'
>
import
{
Component
}
from
'vue-property-decorator'
;
import
SYS_ROLETreesBase
from
'./sys-roletrees-treeview-base.vue'
;
@
Component
({
components
:
{
}
})
export
default
class
SYS_ROLETrees
extends
SYS_ROLETreesBase
{
}
</
script
>
\ No newline at end of file
ibzuaa-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
3b1e9e6b
...
...
@@ -94,7 +94,7 @@
</createTable>
</changeSet>
<!--输出实体[SYS_USER_ROLE]数据结构 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-sys_user_role-4
3
-5"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-sys_user_role-4
4
-5"
>
<createTable
tableName=
"IBZUSER_ROLE"
>
<column
name=
"SYS_USER_ROLEID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_USER_ROLE_SYS_USER_ROLE"
/>
...
...
@@ -200,10 +200,10 @@
<!--输出实体[SYS_USER]外键关系 -->
<!--输出实体[SYS_PSSYSUNIRES]外键关系 -->
<!--输出实体[SYS_USER_ROLE]外键关系 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-sys_user_role-4
3
-12"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-sys_user_role-4
4
-12"
>
<addForeignKeyConstraint
baseColumnNames=
"SYS_ROLEID"
baseTableName=
"IBZUSER_ROLE"
constraintName=
"DER1N_SYS_USER_ROLE_SYS_ROLE_S"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"SYS_ROLEID"
referencedTableName=
"IBZROLE"
validate=
"true"
/>
</changeSet>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-sys_user_role-4
3
-13"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-sys_user_role-4
4
-13"
>
<addForeignKeyConstraint
baseColumnNames=
"SYS_USERID"
baseTableName=
"IBZUSER_ROLE"
constraintName=
"DER1N_SYS_USER_ROLE_SYS_USER_S"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"USERID"
referencedTableName=
"IBZUSER"
validate=
"true"
/>
</changeSet>
<!--输出实体[SYS_PERMISSION]外键关系 -->
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录