agilebuilder-ui 1.0.80 → 1.0.82-tmp1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +21688 -20318
- package/lib/super-ui.umd.cjs +74 -74
- package/package.json +1 -1
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +61 -26
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +64 -22
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -6
- package/packages/department-user-tree-inline/src/group-user/group-input.vue +153 -0
- package/packages/department-user-tree-inline/src/group-user/group-list.vue +96 -0
- package/packages/department-user-tree-inline/src/group-user/group-user.vue +42 -0
- package/packages/department-user-tree-inline/src/group-user-multiple-tree.vue +304 -0
- package/packages/department-user-tree-inline/src/group-user-single-tree.vue +155 -0
- package/packages/department-user-tree-inline/src/group-user-tree-service.js +75 -0
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +2 -2
- package/packages/rich-editor/index.vue +29 -0
- package/packages/secret-info/index.vue +2 -2
- package/packages/super-grid/src/dynamic-input.vue +15 -8
- package/packages/super-grid/src/formValidatorUtil.js +5 -0
- package/packages/super-grid/src/group-column.vue +5 -0
- package/packages/super-grid/src/normal-column.vue +23 -7
- package/packages/super-grid/src/row-operation.vue +19 -10
- package/packages/super-grid/src/super-grid-service.js +7 -4
- package/packages/super-grid/src/super-grid.vue +30 -3
- package/packages/super-grid/src/utils.js +36 -118
- package/packages/workflow-button/src/workflow-button.vue +6 -1
- package/src/i18n/langs/cn.js +7 -1
- package/src/i18n/langs/en.js +7 -1
- package/src/utils/calculator/calculator-util.js +14 -0
- package/src/utils/permission.js +7 -1
- package/src/utils/permissionAuth.js +47 -1
- package/src/views/layout/components/Menubar/SidebarItem.vue +1 -1
- package/src/views/layout/tab-content-index.vue +1 -1
package/package.json
CHANGED
|
@@ -28,31 +28,45 @@
|
|
|
28
28
|
display: inline-block !important;
|
|
29
29
|
"
|
|
30
30
|
>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
31
|
+
<el-tabs v-model="activeTab" class="boe">
|
|
32
|
+
<el-tab-pane :label="$t('departmentUserTreeInline.orgTree')" name="orgTree">
|
|
33
|
+
<el-tree
|
|
34
|
+
ref="deparmentUserTree"
|
|
35
|
+
:props="defaultProps"
|
|
36
|
+
:load="loadNode"
|
|
37
|
+
:check-on-click-node="true"
|
|
38
|
+
lazy
|
|
39
|
+
show-checkbox
|
|
40
|
+
node-key="nodeId"
|
|
41
|
+
@check="handleCheckNode"
|
|
42
|
+
@check-change="handleCheckChange"
|
|
43
|
+
>
|
|
44
|
+
<template #default="{ node, data }">
|
|
45
|
+
<span>
|
|
46
|
+
<el-icon>
|
|
47
|
+
<Menu v-if="node.data.id === -1 || node.data.branch"/>
|
|
48
|
+
<Tickets v-else-if="node.data.id === -2 || node.data.id === -3"/>
|
|
49
|
+
<User v-else-if="node.data.nodeType === 'USER'"/>
|
|
50
|
+
<Calendar v-else/>
|
|
51
|
+
</el-icon>
|
|
52
|
+
<span :title="node.label">
|
|
53
|
+
{{ node.label }}
|
|
54
|
+
</span>
|
|
55
|
+
</span>
|
|
56
|
+
</template>
|
|
57
|
+
</el-tree>
|
|
58
|
+
</el-tab-pane>
|
|
59
|
+
<el-tab-pane name="groupTree">
|
|
60
|
+
<div slot="label">
|
|
61
|
+
<span>{{$t('departmentUserTreeInline.group')}}</span>
|
|
62
|
+
<span><GroupUser :active-tab="activeTab" @update-group-tree="updateGroupTree" /></span>
|
|
63
|
+
</div>
|
|
64
|
+
<GroupUserMultipleTree
|
|
65
|
+
v-if="isShowGroupTree"
|
|
66
|
+
@result="getGroupUserResult"
|
|
67
|
+
/>
|
|
68
|
+
</el-tab-pane>
|
|
69
|
+
</el-tabs>
|
|
56
70
|
<!-- @node-click="handleNodeClick" 移除节点点击,不然会造成节点不可选择时,点击也会选择节点 -->
|
|
57
71
|
</div>
|
|
58
72
|
|
|
@@ -117,6 +131,8 @@ import UserResult from './search-result.vue'
|
|
|
117
131
|
import utils from '../../utils/utils'
|
|
118
132
|
import departmentUserTreeMultiService from './department-user-tree-multi-service'
|
|
119
133
|
import memoryCacheUtils from '../../utils/memory-cache-utils'
|
|
134
|
+
import GroupUserMultipleTree from './group-user-multiple-tree'
|
|
135
|
+
import GroupUser from './group-user/group-user.vue'
|
|
120
136
|
|
|
121
137
|
export default {
|
|
122
138
|
data() {
|
|
@@ -156,6 +172,8 @@ export default {
|
|
|
156
172
|
searchStoreKey: 'searchDepartmentUser',
|
|
157
173
|
// 公司根节点信息
|
|
158
174
|
tenantInfo: {},
|
|
175
|
+
activeTab: 'orgTree', // 当前页签
|
|
176
|
+
isShowGroupTree: true,
|
|
159
177
|
memoryCacheKey: 'DEPARTMENT_USER_MEMORY_KEY',
|
|
160
178
|
// 记忆选择数据, 搜索框获得焦点后,下拉显示最近选中的10个人,倒序排列,最后选中的在最上面显示。
|
|
161
179
|
memoryCacheData: [],
|
|
@@ -168,7 +186,9 @@ export default {
|
|
|
168
186
|
Menu,
|
|
169
187
|
Tickets,
|
|
170
188
|
User,
|
|
171
|
-
Calendar
|
|
189
|
+
Calendar,
|
|
190
|
+
GroupUserMultipleTree,
|
|
191
|
+
GroupUser
|
|
172
192
|
},
|
|
173
193
|
props: {
|
|
174
194
|
// 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
|
|
@@ -729,6 +749,21 @@ export default {
|
|
|
729
749
|
// // </span>`
|
|
730
750
|
// // )
|
|
731
751
|
// },
|
|
752
|
+
getGroupUserResult(selectUser) {
|
|
753
|
+
if (selectUser) {
|
|
754
|
+
const result = this.selectResult.filter(user => user.id === selectUser.id)
|
|
755
|
+
if (!result || result.length === 0) {
|
|
756
|
+
this.selectResult.push(selectUser)
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
},
|
|
760
|
+
updateGroupTree() {
|
|
761
|
+
this.isShowGroupTree = false
|
|
762
|
+
const that = this
|
|
763
|
+
setTimeout(() => {
|
|
764
|
+
that.isShowGroupTree = true
|
|
765
|
+
}, 10)
|
|
766
|
+
}
|
|
732
767
|
},
|
|
733
768
|
emits: ['result'],
|
|
734
769
|
}
|
|
@@ -27,28 +27,43 @@
|
|
|
27
27
|
display: inline-block !important;
|
|
28
28
|
"
|
|
29
29
|
>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
30
|
+
<el-tabs v-model="activeTab" class="boe">
|
|
31
|
+
<el-tab-pane :label="$t('departmentUserTreeInline.orgTree')" name="orgTree">
|
|
32
|
+
<el-tree
|
|
33
|
+
ref="deparmentUserTree"
|
|
34
|
+
:load="loadNode"
|
|
35
|
+
:props="defaultProps"
|
|
36
|
+
lazy
|
|
37
|
+
node-key="nodeId"
|
|
38
|
+
@node-click="handleNodeClick"
|
|
39
|
+
>
|
|
40
|
+
<template #default="{ node, data }">
|
|
41
|
+
<span>
|
|
42
|
+
<el-icon>
|
|
43
|
+
<Menu v-if="node.data.id === -1 || node.data.branch"/>
|
|
44
|
+
<Tickets v-else-if="node.data.id === -2 || node.data.id === -3"/>
|
|
45
|
+
<User v-else-if="node.data.nodeType === 'USER'"/>
|
|
46
|
+
<Calendar v-else/>
|
|
47
|
+
</el-icon>
|
|
48
|
+
<span :title="node.label">
|
|
49
|
+
{{ node.label }}
|
|
50
|
+
</span>
|
|
51
|
+
</span>
|
|
52
|
+
</template>
|
|
53
|
+
</el-tree>
|
|
54
|
+
</el-tab-pane>
|
|
55
|
+
<el-tab-pane name="groupTree">
|
|
56
|
+
<div slot="label">
|
|
57
|
+
<span>{{ $t('departmentUserTreeInline.group') }}</span>
|
|
58
|
+
<span><GroupUser :active-tab="activeTab" @update-group-tree="updateGroupTree" /></span>
|
|
59
|
+
</div>
|
|
60
|
+
<GroupUserSingleTree
|
|
61
|
+
v-if="isShowGroupTree"
|
|
62
|
+
@singleClick="getGroupUserResult"
|
|
63
|
+
@dblClick="dblClickGroupUserResult"
|
|
64
|
+
/>
|
|
65
|
+
</el-tab-pane>
|
|
66
|
+
</el-tabs>
|
|
52
67
|
</div>
|
|
53
68
|
<div
|
|
54
69
|
v-if="
|
|
@@ -79,6 +94,8 @@ import UserResult from './search-result.vue'
|
|
|
79
94
|
import utils from '../../utils/utils'
|
|
80
95
|
import departmentUserTreeSingleService from './department-user-tree-single-service'
|
|
81
96
|
import memoryCacheUtils from '../../utils/memory-cache-utils'
|
|
97
|
+
import GroupUserSingleTree from './group-user-single-tree.vue'
|
|
98
|
+
import GroupUser from './group-user/group-user.vue'
|
|
82
99
|
|
|
83
100
|
export default {
|
|
84
101
|
data() {
|
|
@@ -125,11 +142,15 @@ export default {
|
|
|
125
142
|
// 记忆选择数据, 搜索框获得焦点后,下拉显示最近选中的10个人,倒序排列,最后选中的在最上面显示。
|
|
126
143
|
memoryCacheData: [],
|
|
127
144
|
ElIconSearch,
|
|
145
|
+
activeTab: 'orgTree', // 当前页签
|
|
146
|
+
isShowGroupTree: true
|
|
128
147
|
}
|
|
129
148
|
},
|
|
130
149
|
name: 'InlineDepartmentUserSingleTree',
|
|
131
150
|
components: {
|
|
132
151
|
UserResult,
|
|
152
|
+
GroupUserSingleTree,
|
|
153
|
+
GroupUser
|
|
133
154
|
},
|
|
134
155
|
props: {
|
|
135
156
|
// 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
|
|
@@ -330,6 +351,27 @@ export default {
|
|
|
330
351
|
this.packageSelectResult(user)
|
|
331
352
|
$emit(this, 'result', this.selectNodeInfo)
|
|
332
353
|
},
|
|
354
|
+
getGroupUserResult(selectNodeInof) {
|
|
355
|
+
console.log('getGroupUserResult----selectNodeInof=', selectNodeInof)
|
|
356
|
+
if (selectNodeInof) {1
|
|
357
|
+
this.selectNodeInfo = selectNodeInof
|
|
358
|
+
// this.$emit('result', this.selectNodeInfo)
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
updateGroupTree() {
|
|
362
|
+
this.isShowGroupTree = false
|
|
363
|
+
const that = this
|
|
364
|
+
setTimeout(() => {
|
|
365
|
+
that.isShowGroupTree = true
|
|
366
|
+
}, 10)
|
|
367
|
+
},
|
|
368
|
+
dblClickGroupUserResult(selectNodeInof) {
|
|
369
|
+
console.log('dblClickGroupUserResult----selectNodeInof=', selectNodeInof)
|
|
370
|
+
if (selectNodeInof) {
|
|
371
|
+
this.selectNodeInfo = selectNodeInof
|
|
372
|
+
this.$emit('result', this.selectNodeInfo)
|
|
373
|
+
}
|
|
374
|
+
}
|
|
333
375
|
},
|
|
334
376
|
emits: ['result'],
|
|
335
377
|
}
|
|
@@ -96,12 +96,6 @@ const departmentUserTreeSingleService = {
|
|
|
96
96
|
if (children && children.length > 0) {
|
|
97
97
|
// 表示加载过该父节点的子节点,只需重新更新一下
|
|
98
98
|
resolve(children)
|
|
99
|
-
// 表示当前展开的节点是选中状态,则应保持其选中状态,并选中其子节点
|
|
100
|
-
if (checkedKeys && checkedKeys.indexOf(parentNodeId) > -1) {
|
|
101
|
-
// 点击部门名称前的三角标识展开节点时,保持当前节点的选中状态
|
|
102
|
-
// 表示当前展开的节点是选中状态,则应保持其选中状态,并选中其子节点
|
|
103
|
-
this.checkedChildrenUserNodes(node.data, node.data.children)
|
|
104
|
-
}
|
|
105
99
|
} else {
|
|
106
100
|
// 表示没有加载过该父节点的子节点集合时
|
|
107
101
|
const param = {
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog
|
|
3
|
+
visible
|
|
4
|
+
:title="$t('departmentUserTreeInline.groupForm')"
|
|
5
|
+
:close-on-click-modal="false"
|
|
6
|
+
append-to-body
|
|
7
|
+
width="30%"
|
|
8
|
+
@open="$emit('openDialog')"
|
|
9
|
+
@opend="$emit('opendDialog')"
|
|
10
|
+
@close="closeInput"
|
|
11
|
+
@closed="$emit('closedDialog')"
|
|
12
|
+
>
|
|
13
|
+
<div>
|
|
14
|
+
<el-form
|
|
15
|
+
ref="ruleFormRef"
|
|
16
|
+
:model="group"
|
|
17
|
+
label-width="auto"
|
|
18
|
+
status-icon
|
|
19
|
+
>
|
|
20
|
+
<el-form-item
|
|
21
|
+
:label="$t('departmentUserTreeInline.groupName')"
|
|
22
|
+
prop="name"
|
|
23
|
+
:rules="[
|
|
24
|
+
{ required: true, message: $t('departmentUserTreeInline.groupNameNotEmpty'), trigger: 'blur' }
|
|
25
|
+
]"
|
|
26
|
+
>
|
|
27
|
+
<el-input
|
|
28
|
+
v-model="group.name"
|
|
29
|
+
/>
|
|
30
|
+
</el-form-item>
|
|
31
|
+
</el-form>
|
|
32
|
+
<div v-if="myGroupId">
|
|
33
|
+
<div style="padding-bottom: 5px">
|
|
34
|
+
<el-button size="small" @click="showDeptMultipleTree=true">
|
|
35
|
+
{{ $t('imatrixUIPublicModel.add') }}
|
|
36
|
+
</el-button>
|
|
37
|
+
</div>
|
|
38
|
+
<el-table :data="tableData" border style="width: 100%" max-height="350">
|
|
39
|
+
<el-table-column prop="name" :label="$t('departmentUserTreeInline.name')" />
|
|
40
|
+
<el-table-column prop="loginName" :label="$t('departmentUserTreeInline.loginName')" />
|
|
41
|
+
<el-table-column :label="$t('imatrixUIPublicModel.edit')" align="center" width="60px">
|
|
42
|
+
<template slot-scope="scope">
|
|
43
|
+
<div>
|
|
44
|
+
<el-button type="danger" size="mini" icon="el-icon-delete" circle @click="removeUser(scope.$index, scope.row)" />
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
</el-table-column>
|
|
48
|
+
</el-table>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<department-user-tree v-if="showDeptMultipleTree" width="60%" :multiple="true" @close="closeDeptMultiple" />
|
|
52
|
+
</div>
|
|
53
|
+
<div slot="footer" class="dialog-footer">
|
|
54
|
+
<el-button size="small" @click="closeInput">
|
|
55
|
+
{{ $t('imatrixUIPublicModel.cancel') }}
|
|
56
|
+
</el-button>
|
|
57
|
+
<el-button size="small" type="primary" @click="saveGroup">
|
|
58
|
+
{{ $t('imatrixUIPublicModel.sure') }}
|
|
59
|
+
</el-button>
|
|
60
|
+
</div>
|
|
61
|
+
</el-dialog>
|
|
62
|
+
</template>
|
|
63
|
+
<script>
|
|
64
|
+
import groupUserTreeSevice from '../group-user-tree-service'
|
|
65
|
+
import utils from '../../../utils/utils'
|
|
66
|
+
export default {
|
|
67
|
+
name: 'GroupInput',
|
|
68
|
+
props: {
|
|
69
|
+
groupId: {
|
|
70
|
+
type: Number,
|
|
71
|
+
default: null
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
data() {
|
|
75
|
+
return {
|
|
76
|
+
group: {
|
|
77
|
+
|
|
78
|
+
},
|
|
79
|
+
showDeptMultipleTree: false,
|
|
80
|
+
loginNames: null,
|
|
81
|
+
tableData: [],
|
|
82
|
+
myGroupId: this.groupId
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
created() {
|
|
86
|
+
if (this.myGroupId) {
|
|
87
|
+
this.getGroupById(this.myGroupId).then((result) => {
|
|
88
|
+
this.group = result
|
|
89
|
+
this.tableData = result.users
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
methods: {
|
|
94
|
+
...utils,
|
|
95
|
+
...groupUserTreeSevice,
|
|
96
|
+
saveGroup() {
|
|
97
|
+
this.$refs['ruleFormRef'].validate((valid) => {
|
|
98
|
+
if (valid) {
|
|
99
|
+
this.saveUserGroup(this.group).then((data) => {
|
|
100
|
+
this.group = data
|
|
101
|
+
this.myGroupId = data.id
|
|
102
|
+
this.$message({
|
|
103
|
+
showClose: true,
|
|
104
|
+
type: 'success',
|
|
105
|
+
message: this.$t('imatrixUIMessage.saveSuccessfully')
|
|
106
|
+
})
|
|
107
|
+
if (this.tableData.length > 0) {
|
|
108
|
+
this.$emit('closeDialog')
|
|
109
|
+
}
|
|
110
|
+
})
|
|
111
|
+
} else {
|
|
112
|
+
return false
|
|
113
|
+
}
|
|
114
|
+
})
|
|
115
|
+
},
|
|
116
|
+
// 多选树关闭方法
|
|
117
|
+
closeDeptMultiple(selectNodeInfo) {
|
|
118
|
+
if (selectNodeInfo) {
|
|
119
|
+
this.loginNames = selectNodeInfo.loginNames
|
|
120
|
+
if (this.myGroupId) {
|
|
121
|
+
this.saveUserGroupLinks(this.myGroupId, this.loginNames).then(() => {
|
|
122
|
+
this.getUserGroupLinks(this.myGroupId).then((data) => {
|
|
123
|
+
this.tableData = data
|
|
124
|
+
this.showDeptMultipleTree = false
|
|
125
|
+
})
|
|
126
|
+
})
|
|
127
|
+
}
|
|
128
|
+
} else {
|
|
129
|
+
this.showDeptMultipleTree = false
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
removeUser(rowindex, row) {
|
|
133
|
+
if (this.myGroupId) {
|
|
134
|
+
this.deleteGroupUserLink(this.myGroupId, row.loginName).then(() => {
|
|
135
|
+
this.$message({
|
|
136
|
+
showClose: true,
|
|
137
|
+
type: 'success',
|
|
138
|
+
message: this.$t('superGrid.deleteSuccessful')
|
|
139
|
+
})
|
|
140
|
+
this.getUserGroupLinks(this.myGroupId).then((data) => {
|
|
141
|
+
this.tableData = data
|
|
142
|
+
})
|
|
143
|
+
})
|
|
144
|
+
} else {
|
|
145
|
+
this.removeUser(this.tableData, row)
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
closeInput() {
|
|
149
|
+
this.$emit('closeDialog')
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
</script>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-dialog
|
|
4
|
+
visible
|
|
5
|
+
:title="$t('departmentUserTreeInline.groupList')"
|
|
6
|
+
:close-on-click-modal="false"
|
|
7
|
+
append-to-body
|
|
8
|
+
width="30%"
|
|
9
|
+
@open="$emit('openDialog')"
|
|
10
|
+
@opend="$emit('opendDialog')"
|
|
11
|
+
@close="$emit('closeDialog')"
|
|
12
|
+
@closed="$emit('closedDialog')"
|
|
13
|
+
>
|
|
14
|
+
<div>
|
|
15
|
+
<div style="padding-bottom: 5px">
|
|
16
|
+
<el-button size="small" @click="addGroup()">
|
|
17
|
+
{{ $t('imatrixUIPublicModel.add') }}
|
|
18
|
+
</el-button>
|
|
19
|
+
</div>
|
|
20
|
+
<el-table :data="tableData" border style="width: 100%" max-height="350">
|
|
21
|
+
<el-table-column :label="$t('superGrid.index')" align="center" width="60">
|
|
22
|
+
<template slot-scope="scope">
|
|
23
|
+
{{ scope.$index+1 }}
|
|
24
|
+
</template>
|
|
25
|
+
</el-table-column>
|
|
26
|
+
<el-table-column prop="name" :label="$t('departmentUserTreeInline.groupName')" />
|
|
27
|
+
<el-table-column :label="$t('imatrixUIPublicModel.edit')" align="center" width="130">
|
|
28
|
+
<template slot-scope="scope">
|
|
29
|
+
<div>
|
|
30
|
+
<el-button type="primary" size="mini" icon="el-icon-edit" circle @click="updateGroup(scope.$index, scope.row)" />
|
|
31
|
+
<el-button type="danger" size="mini" icon="el-icon-delete" circle @click="removeGroup(scope.$index, scope.row)" />
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
</el-table-column>
|
|
35
|
+
</el-table>
|
|
36
|
+
</div>
|
|
37
|
+
</el-dialog>
|
|
38
|
+
<GroupInput
|
|
39
|
+
v-if="isShowInput2"
|
|
40
|
+
:group-id="groupId"
|
|
41
|
+
@closeDialog="closeGroupInput"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
<script>
|
|
46
|
+
import GroupInput from './group-input'
|
|
47
|
+
import groupUserTreeSevice from '../group-user-tree-service'
|
|
48
|
+
export default {
|
|
49
|
+
name: 'GroupList',
|
|
50
|
+
components: {
|
|
51
|
+
GroupInput
|
|
52
|
+
},
|
|
53
|
+
props: {
|
|
54
|
+
},
|
|
55
|
+
data() {
|
|
56
|
+
return {
|
|
57
|
+
tableData: [],
|
|
58
|
+
isShowInput2: false,
|
|
59
|
+
groupId: null
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
created() {
|
|
63
|
+
this.listGroups()
|
|
64
|
+
},
|
|
65
|
+
methods: {
|
|
66
|
+
...groupUserTreeSevice,
|
|
67
|
+
listGroups() {
|
|
68
|
+
this.getUserGroupList().then((data) => {
|
|
69
|
+
this.tableData = data
|
|
70
|
+
})
|
|
71
|
+
},
|
|
72
|
+
updateGroup(rowindex, row) {
|
|
73
|
+
this.groupId = row.id
|
|
74
|
+
this.isShowInput2 = true
|
|
75
|
+
},
|
|
76
|
+
removeGroup(rowindex, row) {
|
|
77
|
+
this.deleteUserGroup(row.id).then(() => {
|
|
78
|
+
this.$message({
|
|
79
|
+
showClose: true,
|
|
80
|
+
type: 'success',
|
|
81
|
+
message: this.$t('superGrid.deleteSuccessful')
|
|
82
|
+
})
|
|
83
|
+
this.listGroups()
|
|
84
|
+
})
|
|
85
|
+
},
|
|
86
|
+
closeGroupInput() {
|
|
87
|
+
this.isShowInput2 = false
|
|
88
|
+
this.listGroups()
|
|
89
|
+
},
|
|
90
|
+
addGroup() {
|
|
91
|
+
this.groupId = null
|
|
92
|
+
this.isShowInput2 = true
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
</script>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span style="padding-left: 10px">
|
|
3
|
+
<el-icon @click="isShowInput = true"><CirclePlus /></el-icon>
|
|
4
|
+
<GroupList
|
|
5
|
+
v-if="isShowList"
|
|
6
|
+
@closeDialog="closeList()"
|
|
7
|
+
/>
|
|
8
|
+
</span>
|
|
9
|
+
</template>
|
|
10
|
+
<script>
|
|
11
|
+
import GroupList from './group-list'
|
|
12
|
+
import groupUserTreeService from '../group-user-tree-service'
|
|
13
|
+
import { CirclePlus } from '@element-plus/icons-vue'
|
|
14
|
+
export default {
|
|
15
|
+
name: 'GroupUser',
|
|
16
|
+
components: {
|
|
17
|
+
GroupList,
|
|
18
|
+
CirclePlus
|
|
19
|
+
},
|
|
20
|
+
props: {
|
|
21
|
+
activeTab: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: null
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
data() {
|
|
27
|
+
return {
|
|
28
|
+
isShowList: false,
|
|
29
|
+
groupId: null
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
created() {
|
|
33
|
+
},
|
|
34
|
+
methods: {
|
|
35
|
+
...groupUserTreeService,
|
|
36
|
+
closeList() {
|
|
37
|
+
this.isShowList = false
|
|
38
|
+
this.$emit('update-group-tree')
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
</script>
|