imatrix-ui 2.8.97-dw-tmp26 → 2.8.97-dw-tmp29

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.
Files changed (172) hide show
  1. package/gulpfile.js +20 -0
  2. package/lib/breadcrumb.js +136 -0
  3. package/lib/department-tree-inline.js +136 -0
  4. package/lib/department-tree.js +136 -0
  5. package/lib/department-user-tree-inline.js +136 -0
  6. package/lib/department-user-tree.js +136 -0
  7. package/lib/dynamic-source-select.js +136 -0
  8. package/lib/fs-preview.js +136 -0
  9. package/lib/fs-upload-list.js +136 -0
  10. package/lib/fs-upload.js +136 -0
  11. package/lib/hamburger.js +136 -0
  12. package/lib/index.js +3672 -0
  13. package/lib/multipart-upload.js +136 -0
  14. package/lib/organization-input.js +136 -0
  15. package/lib/plugins.js +2928 -0
  16. package/lib/remove-department.js +136 -0
  17. package/lib/remove-user.js +136 -0
  18. package/lib/remove-workgroup.js +136 -0
  19. package/lib/rich-editor.js +136 -0
  20. package/lib/scan-code-input.js +136 -0
  21. package/lib/secret-info.js +136 -0
  22. package/lib/super-grid.js +136 -0
  23. package/lib/super-nine-grid.js +136 -0
  24. package/lib/svg-icon.js +136 -0
  25. package/lib/valid-code.js +136 -0
  26. package/lib/workflow-button.js +136 -0
  27. package/lib/workflow-history-list.js +136 -0
  28. package/lib/workgroup-tree-inline.js +136 -0
  29. package/lib/workgroup-tree.js +136 -0
  30. package/lib/workgroup-user-tree-inline.js +136 -0
  31. package/lib/workgroup-user-tree.js +136 -0
  32. package/lib/year-range-picker.js +136 -0
  33. package/package.json +5 -3
  34. package/packages/breadcrumb/index.js +6 -0
  35. package/packages/breadcrumb/src/breadcrumb.vue +71 -0
  36. package/packages/department-tree/index.js +6 -0
  37. package/packages/department-tree/src/department-tree.vue +108 -0
  38. package/packages/department-tree-inline/index.js +6 -0
  39. package/packages/department-tree-inline/src/department-multi-tree-inline.vue +402 -0
  40. package/packages/department-tree-inline/src/department-single-tree-inline.vue +284 -0
  41. package/packages/department-tree-inline/src/department-tree-inline.vue +86 -0
  42. package/packages/department-tree-inline/src/department-tree-service.js +245 -0
  43. package/packages/department-tree-inline/src/search-result.vue +176 -0
  44. package/packages/department-user-tree/index.js +6 -0
  45. package/packages/department-user-tree/src/department-user-multiple-tree.vue +116 -0
  46. package/packages/department-user-tree/src/department-user-single-tree.vue +76 -0
  47. package/packages/department-user-tree/src/department-user-tree.vue +101 -0
  48. package/packages/department-user-tree-inline/index.js +6 -0
  49. package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +626 -0
  50. package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +269 -0
  51. package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +79 -0
  52. package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +230 -0
  53. package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +122 -0
  54. package/packages/department-user-tree-inline/src/search-result.vue +197 -0
  55. package/packages/directives/prevent-reclick.js +19 -0
  56. package/packages/dynamic-source-select/index.js +6 -0
  57. package/packages/dynamic-source-select/src/dynamic-source-select-service.js +70 -0
  58. package/packages/dynamic-source-select/src/dynamic-source-select.vue +440 -0
  59. package/packages/dynamic-source-select/src/events.js +55 -0
  60. package/packages/fs-preview/index.js +6 -0
  61. package/packages/fs-preview/src/fs-preview.vue +226 -0
  62. package/packages/fs-upload/index.js +6 -0
  63. package/packages/fs-upload/src/fs-upload-multi.vue +420 -0
  64. package/packages/fs-upload/src/fs-upload-single.vue +312 -0
  65. package/packages/fs-upload/src/fs-upload.vue +189 -0
  66. package/packages/fs-upload/src/see-big-picture.vue +55 -0
  67. package/packages/fs-upload-list/index.js +6 -0
  68. package/packages/fs-upload-list/src/fs-upload-list.vue +287 -0
  69. package/packages/hamburger/index.js +6 -0
  70. package/packages/hamburger/src/hamburger.vue +38 -0
  71. package/packages/index.js +90 -0
  72. package/packages/multipart-upload/index.js +6 -0
  73. package/packages/multipart-upload/src/index.vue +73 -0
  74. package/packages/multipart-upload/src/multipart-upload-form.vue +297 -0
  75. package/packages/multipart-upload/src/multipart-upload-list.vue +378 -0
  76. package/packages/organization-input/index.js +6 -0
  77. package/packages/organization-input/src/organization-input.vue +542 -0
  78. package/packages/plugins/export-data-new.js +453 -0
  79. package/packages/plugins/export-data.js +361 -0
  80. package/packages/plugins/index.js +15 -0
  81. package/packages/plugins/public-method.js +43 -0
  82. package/packages/remove-department/index.js +6 -0
  83. package/packages/remove-department/src/remove-department.vue +172 -0
  84. package/packages/remove-department/src/remove-dept-service.js +20 -0
  85. package/packages/remove-user/index.js +6 -0
  86. package/packages/remove-user/src/remove-user-service.js +20 -0
  87. package/packages/remove-user/src/remove-user.vue +195 -0
  88. package/packages/remove-workgroup/index.js +6 -0
  89. package/packages/remove-workgroup/src/remove-workgroup-service.js +20 -0
  90. package/packages/remove-workgroup/src/remove-workgroup.vue +159 -0
  91. package/packages/rich-editor/index.js +7 -0
  92. package/packages/rich-editor/index.vue +288 -0
  93. package/packages/rich-editor/langs/zh-Hans.js +1 -0
  94. package/packages/rich-editor/viewer.vue +103 -0
  95. package/packages/scan-code-input/index.js +6 -0
  96. package/packages/scan-code-input/src/events.js +33 -0
  97. package/packages/scan-code-input/src/scan-code-input-colse.vue +131 -0
  98. package/packages/scan-code-input/src/scan-code-input.vue +116 -0
  99. package/packages/secret-info/index.js +7 -0
  100. package/packages/secret-info/index.vue +90 -0
  101. package/packages/super-grid/index.js +7 -0
  102. package/packages/super-grid/src/apis.js +763 -0
  103. package/packages/super-grid/src/columns-config.vue +335 -0
  104. package/packages/super-grid/src/custom-formatter.js +250 -0
  105. package/packages/super-grid/src/dynamic-input.vue +1279 -0
  106. package/packages/super-grid/src/eventBus.js +2 -0
  107. package/packages/super-grid/src/events.js +55 -0
  108. package/packages/super-grid/src/formValidatorUtil.js +226 -0
  109. package/packages/super-grid/src/formatter.js +181 -0
  110. package/packages/super-grid/src/group-column.vue +100 -0
  111. package/packages/super-grid/src/header-context-menu.vue +87 -0
  112. package/packages/super-grid/src/index-column.vue +51 -0
  113. package/packages/super-grid/src/normal-column copy.vue +769 -0
  114. package/packages/super-grid/src/normal-column.vue +769 -0
  115. package/packages/super-grid/src/public-methods.js +31 -0
  116. package/packages/super-grid/src/row-operation.vue +161 -0
  117. package/packages/super-grid/src/search-button.vue +66 -0
  118. package/packages/super-grid/src/search-condition-input.vue +61 -0
  119. package/packages/super-grid/src/search-condition-list.vue +59 -0
  120. package/packages/super-grid/src/search-form-advancedQuery.vue +653 -0
  121. package/packages/super-grid/src/search-form-dialog.vue +79 -0
  122. package/packages/super-grid/src/search-form-item.vue +386 -0
  123. package/packages/super-grid/src/search-form-number.vue +38 -0
  124. package/packages/super-grid/src/search-form-open.vue +162 -0
  125. package/packages/super-grid/src/search-form-ordinarySearch.vue +188 -0
  126. package/packages/super-grid/src/search-form.vue +634 -0
  127. package/packages/super-grid/src/search-methods.js +387 -0
  128. package/packages/super-grid/src/selection-column.vue +43 -0
  129. package/packages/super-grid/src/store.js +3 -0
  130. package/packages/super-grid/src/super-grid-service-static.js +1313 -0
  131. package/packages/super-grid/src/super-grid-service.js +561 -0
  132. package/packages/super-grid/src/super-grid-static.vue +3229 -0
  133. package/packages/super-grid/src/super-grid.vue +2793 -0
  134. package/packages/super-grid/src/utils.js +763 -0
  135. package/packages/super-grid/src/view-image-dialog.vue +130 -0
  136. package/packages/super-nine-grid/index.js +7 -0
  137. package/packages/super-nine-grid/src/apis.js +103 -0
  138. package/packages/super-nine-grid/src/custom-formatter.js +66 -0
  139. package/packages/super-nine-grid/src/formatter.js +132 -0
  140. package/packages/super-nine-grid/src/search-form-number.vue +38 -0
  141. package/packages/super-nine-grid/src/search-form.vue +430 -0
  142. package/packages/super-nine-grid/src/search-methods.js +134 -0
  143. package/packages/super-nine-grid/src/store.js +3 -0
  144. package/packages/super-nine-grid/src/super-grid-service.js +91 -0
  145. package/packages/super-nine-grid/src/super-nine-grid.vue +872 -0
  146. package/packages/super-nine-grid/src/utils.js +261 -0
  147. package/packages/svg-icon/index.js +6 -0
  148. package/packages/svg-icon/src/svg-icon.vue +43 -0
  149. package/packages/utils/utils.js +152 -0
  150. package/packages/utils/value-set.js +86 -0
  151. package/packages/valid-code/index.js +7 -0
  152. package/packages/valid-code/src/valid-code.vue +95 -0
  153. package/packages/workflow-button/index.js +6 -0
  154. package/packages/workflow-button/src/workflow-button.vue +325 -0
  155. package/packages/workflow-history-list/index.js +6 -0
  156. package/packages/workflow-history-list/src/api.js +7 -0
  157. package/packages/workflow-history-list/src/workflow-history-list.vue +185 -0
  158. package/packages/workgroup-tree/index.js +6 -0
  159. package/packages/workgroup-tree/src/workgroup-tree.vue +76 -0
  160. package/packages/workgroup-tree-inline/index.js +6 -0
  161. package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +317 -0
  162. package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +43 -0
  163. package/packages/workgroup-user-tree/index.js +6 -0
  164. package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +100 -0
  165. package/packages/workgroup-user-tree-inline/index.js +6 -0
  166. package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +163 -0
  167. package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +436 -0
  168. package/packages/year-range-picker/index.js +6 -0
  169. package/packages/year-range-picker/src/year-range-picker.vue +51 -0
  170. package/webpack.components.js +70 -0
  171. package/lib/super-ui.css +0 -1
  172. package/lib/super-ui.umd.min.js +0 -67
@@ -0,0 +1,86 @@
1
+ <template>
2
+ <div>
3
+ <inline-department-multi-tree
4
+ v-if="multiple"
5
+ ref="inlineDeparmentTree"
6
+ :height="height"
7
+ :check-strictly="checkStrictly"
8
+ :department-info="departmentInfo"
9
+ :select-department-info="selectDepartmentInfo"
10
+ :search-field="searchField"
11
+ :separator="separator"
12
+ @result="result"
13
+ />
14
+ <inline-department-single-tree
15
+ v-if="!multiple"
16
+ ref="inlineDeparmentTree"
17
+ :department-info="departmentInfo"
18
+ @result="result"
19
+ />
20
+ </div>
21
+ </template>
22
+
23
+ <script>
24
+ import InlineDepartmentMultiTree from './department-multi-tree-inline.vue'
25
+ import InlineDepartmentSingleTree from './department-single-tree-inline.vue'
26
+ export default {
27
+ name: 'InlineDepartmentTree',
28
+ components: {
29
+ InlineDepartmentMultiTree,
30
+ InlineDepartmentSingleTree
31
+ },
32
+ props: {
33
+ // 是否是多选树,默认是true
34
+ multiple: {
35
+ type: Boolean,
36
+ default: true
37
+ },
38
+ checkStrictly: {
39
+ type: Boolean,
40
+ default: false
41
+ },
42
+ // 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
43
+ departmentInfo: {
44
+ type: Array,
45
+ default: null
46
+ },
47
+ // 弹框的高度
48
+ height: {
49
+ type: String,
50
+ default: '300px'
51
+ },
52
+ // 多选部门树时,已选择部门id或部门名称或编码集合,多个之间以逗号隔开
53
+ selectDepartmentInfo: {
54
+ type: [String, Number],
55
+ default: null
56
+ },
57
+ // 移除部门时,部门属性名称:id、name、code,默认是id
58
+ searchField: {
59
+ type: String,
60
+ default: 'id'
61
+ },
62
+ // 多选树时结果之间的分隔符,默认是逗号分隔
63
+ separator: {
64
+ type: String,
65
+ default: ','
66
+ }
67
+ },
68
+ data() {
69
+ return {
70
+ selectNodeInfo: null // 单选时,选择的用户信息
71
+ }
72
+ },
73
+ mounted() {
74
+ },
75
+ methods: {
76
+ result(selectNodeInfo) {
77
+ this.selectNodeInfo = selectNodeInfo
78
+ this.$emit('result', selectNodeInfo)
79
+ },
80
+ selectDepartment() {
81
+ this.$refs.inlineDeparmentTree.selectDepartment()
82
+ }
83
+
84
+ }
85
+ }
86
+ </script>
@@ -0,0 +1,245 @@
1
+ import Vue from 'vue'
2
+ import { getI18n } from '../../../src/utils/util'
3
+ const departmentTreeService = {
4
+ // 后台查询部门,并拼接树节点
5
+ filterAppendNodes(value) {
6
+ this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/search-pc-depts', this.searchParam).then(result => {
7
+ if (result) {
8
+ if (result.length === 0) {
9
+ this.searchResult = []
10
+ this.$message({
11
+ showClose: true,
12
+ type: 'error',
13
+ message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
14
+ })
15
+ return
16
+ }
17
+ this.searchResult = result
18
+ // result的格式为[DEPARTMENT~1,DEPARTMENT~1/DEPARTMENT~4,DEPARTMENT~10]
19
+ // result.forEach(nodeIds => {
20
+ // // nodeId的分隔符
21
+ // var nodeIdSeparator = '/'
22
+ // const nodeIdArr = nodeIds.split(nodeIdSeparator)
23
+ // if (nodeIdArr.length > 0) {
24
+ // this.loadDepartmentWhenSearch(0, nodeIdArr)
25
+ // }
26
+ // })
27
+ } else {
28
+ this.$message({
29
+ showClose: true,
30
+ type: 'error',
31
+ message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
32
+ })
33
+ }
34
+ })
35
+ },
36
+ search(value) {
37
+ this.searchValue = value
38
+ let mySearchValue = value
39
+ if (mySearchValue) {
40
+ mySearchValue = mySearchValue.trim()
41
+ }
42
+ this.searchParam.searchValue = mySearchValue
43
+ this.searchParam.departmentInfo = this.departmentInfo
44
+ // 后台查询部门,并拼接树节点
45
+ this.filterAppendNodes(value)
46
+ },
47
+ handleSelect(item) {
48
+ this.handleSelectUtil(item, localStorage)
49
+ },
50
+ querySearch(queryString, cb) {
51
+ this.search(this.filterText)
52
+ cb([])
53
+ },
54
+ // 点击查询按钮调用的方法
55
+ clickSearch() {
56
+ this.storeSeachValue()
57
+ this.search(this.filterText)
58
+ },
59
+ loadDepartmentWhenSearch(n, nodeIdArr) {
60
+ return new Promise((resolve, reject) => {
61
+ if (nodeIdArr.length === n) {
62
+ resolve()
63
+ } else {
64
+ const nodeId = nodeIdArr[n]
65
+ let dataId = nodeId
66
+ // 节点类型和数据id的分隔符
67
+ const nodeTypeAndDataIdSeparator = '~'
68
+ // nodeId格式为DEPARTMENT~4
69
+ if (nodeId.indexOf(nodeTypeAndDataIdSeparator) > -1) {
70
+ dataId = nodeId.substring(nodeId.indexOf('~') + 1)
71
+ }
72
+ this.loadDepartment(dataId).then(() => {
73
+ this.loadDepartmentWhenSearch(++n, nodeIdArr)
74
+ }).catch((error) => {
75
+ reject(error)
76
+ })
77
+ }
78
+ })
79
+ },
80
+ // 点击复选框时处理
81
+ handleCheckNode(data, checkObj) {
82
+ if (checkObj.checkedKeys.indexOf(data.id) > -1) {
83
+ // 表示正选中data节点
84
+ this.isloading = true
85
+ if (data.nodeType && data.nodeType === 'DEPARTMENT' && data.data) {
86
+ // 表示当前选中的节点是部门
87
+ const department = JSON.parse(data.data)
88
+ this.selectUser(null, department)
89
+ }
90
+ if (data.childDepartments) {
91
+ // 如果已展开,不需要再走后台获得其子节点。只需要选中已有子节点
92
+ // 展开当前选中的节点
93
+ this.$refs.deparmentTree.store.nodesMap[data.id].expanded = true
94
+ // 选中当前节点及其子节点
95
+ this.checkedNodeAndChildren(data)
96
+ this.isloading = false
97
+ } else {
98
+ // 当前节点未展开。需要走后台获得当前节点的子节点,然后展开当前节点,然后选中这些子节点
99
+ if (!data.leaf) {
100
+ // 不是叶子节点,并且没有加载过该父节点的子节点时,需要走后台展开子节点
101
+ this.$http.get(Vue.prototype.baseAPI + '/component/organization-trees/departments/' + data.id).then(result => {
102
+ // 更新当前点击的节点的子节点
103
+ this.$refs.deparmentTree.updateKeyChildren(data.id, result)
104
+ // 展开当前选中的节点
105
+ this.$refs.deparmentTree.store.nodesMap[data.id].expanded = true
106
+ // 获得所有应该选中的节点
107
+ this.checkedNodeAndChildren(data)
108
+ })
109
+ this.$http.get(Vue.prototype.baseAPI + '/component/organization-trees/child-departments/' + data.id).then(childDepts => {
110
+ if (childDepts && !this.checkStrictly) {
111
+ childDepts.forEach(item => {
112
+ this.selectUser(null, item)
113
+ })
114
+ this.isloading = false
115
+ }
116
+ })
117
+ }
118
+ }
119
+ } else {
120
+ // 表示正取消选中data节点,同时要取消其子节点的选中状态
121
+ this.cancelChildCheckedNodes(data)
122
+ }
123
+ },
124
+ // 初始化树 或 点击三角展开节点时动态加载子节点
125
+ loadNode(node, resolve) {
126
+ var parentId = 0
127
+ if (node.level === 0) {
128
+ // 表示初始化树
129
+ parentId = 0
130
+ } else {
131
+ parentId = node.data.id
132
+ }
133
+ var checkedKeys = []
134
+ if (this.$refs.deparmentTree) {
135
+ checkedKeys = this.$refs.deparmentTree.getCheckedKeys()
136
+ }
137
+ // 初始化部门树
138
+ this.initLoadDepartment(parentId, node, resolve, checkedKeys)
139
+ },
140
+ // 初始化部门树
141
+ initLoadDepartment(parentId, node, resolve, checkedKeys) {
142
+ this.$http.get(Vue.prototype.baseAPI + '/component/organization-trees/departments/' + parentId).then(data => {
143
+ resolve(data)
144
+ // 更新当前点击的节点的子节点
145
+ this.$refs.deparmentTree.updateKeyChildren(parentId, data)
146
+ if (parentId === 0) {
147
+ // 初始化树时,展开公司节点
148
+ const tenantData = data[0].data
149
+ data[0].disable = true
150
+ this.tenantInfo = JSON.parse(tenantData)
151
+ this.containBranch = data[0].containBranch
152
+ if (this.departmentInfo && this.departmentInfo.length > 0) {
153
+ // 加载指定部门时,展开公司节点
154
+ this.loadPointDepartments()
155
+ } else {
156
+ // 加载整个组织结构树时,展开公司节点
157
+ this.loadDepartment(this.tenantNodeId)
158
+ }
159
+ }
160
+
161
+ if (this.isClickNode) {
162
+ // 点击当前节点时,加载树节点时
163
+ // 注意不是点击复选框时
164
+ this.isClickNode = false
165
+ this.checkedNodeAndChildren(node.data)
166
+ } else {
167
+ // 表示是点击三角展开节点时
168
+ if (checkedKeys && checkedKeys.indexOf(parentId) > -1) {
169
+ // 点击部门名称前的三角标识展开节点时,保持当前节点的选中状态
170
+ // 表示当前展开的节点是选中状态,则应保持其选中状态,并选中其子节点
171
+ this.checkedNodeAndChildren(node.data)
172
+ }
173
+ }
174
+ })
175
+ },
176
+ // 加载当前节点的子节点
177
+ loadDepartment(parentId, isSearch, searchValue) {
178
+ return new Promise((resolve, reject) => {
179
+ this.$http.get(Vue.prototype.baseAPI + '/component/organization-trees/departments/' + parentId).then(children => {
180
+ this.$refs.deparmentTree.updateKeyChildren(parentId, children)
181
+ if (this.$refs.deparmentTree.store.nodesMap[parentId]) {
182
+ this.$refs.deparmentTree.store.nodesMap[parentId].expanded = true
183
+ }
184
+ resolve()
185
+ }).catch((error) => {
186
+ console.log('error', error)
187
+ })
188
+ })
189
+ },
190
+ // 加载指定部门节点
191
+ loadPointDepartments() {
192
+ this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/point-departments', this.departmentInfo).then(children => {
193
+ this.$refs.deparmentTree.updateKeyChildren(this.tenantNodeId, children)
194
+ if (this.$refs.deparmentTree.store.nodesMap[this.tenantNodeId]) {
195
+ this.$refs.deparmentTree.store.nodesMap[this.tenantNodeId].expanded = true
196
+ }
197
+ })
198
+ },
199
+ getSelectDepts(searchField, selectDeptInfo, separator) {
200
+ return new Promise((resolve, reject) => {
201
+ if (!searchField) {
202
+ resolve([])
203
+ } else if (!selectDeptInfo) {
204
+ resolve([])
205
+ } else {
206
+ this.$http.get(Vue.prototype.baseAPI + '/component/organization-trees/select-departments?searchField=' + searchField + '&selectDeptInfo=' + selectDeptInfo + '&separator=' + separator).then(departments => {
207
+ resolve(departments)
208
+ }).catch(error => {
209
+ reject(error)
210
+ })
211
+ }
212
+ })
213
+ },
214
+ // 选中了组织结构树的根节点
215
+ packageAllDept() {
216
+ // 表示集合中不存在该用户,则封装该用户
217
+ var allDept = {
218
+ id: this.tenantNodeId,
219
+ name: '所有部门'
220
+ }
221
+ return allDept
222
+ },
223
+ initSelectDepts() {
224
+ return new Promise((resolve, reject) => {
225
+ const selectDepts = []
226
+ if (this.selectDepartmentInfo) {
227
+ if (this.selectDepartmentInfo === this.tenantNodeId || this.selectDepartmentInfo === '所有部门') {
228
+ // 表示已选择所有用户
229
+ selectDepts.push(this.packageAllDept())
230
+ resolve(selectDepts)
231
+ } else {
232
+ // 表示不是选择的所有用户
233
+ this.getSelectDepts(this.searchField, this.selectDepartmentInfo, this.separator).then(departments => {
234
+ resolve(departments)
235
+ }).catch(error => {
236
+ reject(error)
237
+ })
238
+ }
239
+ } else {
240
+ resolve(selectDepts)
241
+ }
242
+ })
243
+ }
244
+ }
245
+ export default departmentTreeService
@@ -0,0 +1,176 @@
1
+ <template>
2
+ <div style="height: 100%">
3
+ <el-table
4
+ ref="superGrid"
5
+ :data="gridData"
6
+ row-key="id"
7
+ :row-class-name="tableRowClassName"
8
+ :max-height="myHeight"
9
+ border
10
+ fit
11
+ @row-click="rowClick"
12
+ @row-dblclick="rowDblclick"
13
+ >
14
+ <el-table-column v-if="multiple === false" width="60">
15
+ <template slot-scope="scope">
16
+ <el-radio v-model="singleUserIndex" :label="scope.$index" @change="selectUser">
17
+ {{ scope.$index+1 }}
18
+ </el-radio>
19
+ </template>
20
+ </el-table-column>
21
+ <el-table-column v-if="multiple && isSearchResult" fixed :label="$t('imatrixUIPublicModel.edit')" align="center" width="60px">
22
+ <template slot-scope="scope">
23
+ <div>
24
+ <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="isDisable(scope.row)" circle @click="addUser(scope.$index, scope.row)" />
25
+ </div>
26
+ </template>
27
+ </el-table-column>
28
+ <el-table-column v-if="multiple" :label="$t('superGrid.index')" align="center" width="60px">
29
+ <template slot-scope="scope">
30
+ {{ scope.$index+1 }}
31
+ </template>
32
+ </el-table-column>
33
+ <el-table-column v-if="multiple && !isSearchResult" fixed :label="$t('imatrixUIPublicModel.edit')" align="center" width="60px">
34
+ <template slot-scope="scope">
35
+ <div>
36
+ <el-button type="danger" size="mini" icon="el-icon-delete" circle @click="removeUser(scope.$index, scope.row)" />
37
+ </div>
38
+ </template>
39
+ </el-table-column>
40
+ <el-table-column
41
+ :label="$t('departmentTreeInline.name')"
42
+ :width="170"
43
+ prop="name"
44
+ >
45
+ <template slot-scope="scope">
46
+ <span class="ellipsis cell--span" :title="scope.row.showName">{{ scope.row.showName }}</span>
47
+ </template>
48
+ </el-table-column>
49
+ <el-table-column
50
+ :label="$t('departmentTreeInline.code')"
51
+ :width="140"
52
+ prop="code"
53
+ >
54
+ <template slot-scope="scope">
55
+ <span class="ellipsis cell--span" :title="scope.row.code">{{ scope.row.code }}</span>
56
+ </template>
57
+ </el-table-column>
58
+ <el-table-column
59
+ :label="$t('departmentTreeInline.namePath')"
60
+ :width="140"
61
+ prop="namePath"
62
+ >
63
+ <template slot-scope="scope">
64
+ <span class="ellipsis cell--span" :title="scope.row.namePath">{{ scope.row.namePath }}</span>
65
+ </template>
66
+ </el-table-column>
67
+ </el-table>
68
+ </div>
69
+ </template>
70
+ <style>
71
+ .searchResult {
72
+ color:red
73
+ }
74
+ .inline-select-custom {
75
+ width : 100px
76
+ }
77
+ .inline-input-custom {
78
+ width : 98%
79
+ }
80
+ </style>
81
+ <script>
82
+ export default {
83
+ name: 'UserResult',
84
+ props: {
85
+ gridData: {
86
+ type: Array,
87
+ default: null
88
+ },
89
+ containBranch: {
90
+ type: Boolean,
91
+ default: false
92
+ },
93
+ multiple: {
94
+ type: Boolean,
95
+ default: false
96
+ },
97
+ // 多选树时是否是查询结果列表,用于控制“操作”列按钮的显示
98
+ isSearchResult: {
99
+ type: Boolean,
100
+ default: true
101
+ },
102
+ height: {
103
+ type: String,
104
+ default: '300px'
105
+ },
106
+ selectResult: {
107
+ type: Array,
108
+ default: function() {
109
+ return []
110
+ }
111
+ }
112
+
113
+ },
114
+ data() {
115
+ let tableHeight = this.height
116
+ tableHeight = tableHeight.substring(0, tableHeight.indexOf('px'))
117
+ const myHeight = (parseInt(tableHeight) + 30) + 'px'
118
+ return {
119
+ singleUserIndex: null, // 选中的用户序号
120
+ selectedUser: null,
121
+ myHeight
122
+ }
123
+ },
124
+ created() {
125
+ console.log('search-result---', this.gridData)
126
+ },
127
+ methods: {
128
+ // 单选树时,点击行事件
129
+ // rowClick(row, column, event) {
130
+ // this.selectedUser = row
131
+ // // this.$emit('rowClick', row, column, event)
132
+ // },
133
+ // 移除用户
134
+ removeUser(index, row) {
135
+ this.$emit('removeUser', index, row)
136
+ },
137
+ // 添加用户
138
+ addUser(index, row) {
139
+ this.$emit('addUser', index, row)
140
+ },
141
+ selectUser(selectVal) {
142
+ // console.log('selectUser', selectVal)
143
+ this.$emit('selectResult', this.gridData[selectVal])
144
+ },
145
+ rowClick(row, column, event) {
146
+ this.singleUserIndex = row.row_index
147
+ this.$emit('selectResult', row)
148
+ },
149
+ tableRowClassName({ row, rowIndex }) {
150
+ row.row_index = rowIndex
151
+ },
152
+ rowDblclick(row, column, event) {
153
+ if (this.multiple) {
154
+ this.$emit('addUser', null, row)
155
+ } else {
156
+ this.$emit('resultRowDblclick', row)
157
+ }
158
+ },
159
+ isDisable(row) {
160
+ if (this.selectResult) {
161
+ const containUsers = this.selectResult.filter(this.filterDept(row))
162
+ if (containUsers && containUsers.length > 0) {
163
+ return true
164
+ }
165
+ }
166
+ return false
167
+ },
168
+ // 判断用户是否存在的过滤器
169
+ filterDept(queryDept) {
170
+ return (dept) => {
171
+ return (dept.id === queryDept.id)
172
+ }
173
+ }
174
+ }
175
+ }
176
+ </script>
@@ -0,0 +1,6 @@
1
+ import DepartmentUserTree from './src/department-user-tree.vue'
2
+ DepartmentUserTree.install = function(Vue) {
3
+ Vue.component(DepartmentUserTree.name, DepartmentUserTree)
4
+ }
5
+
6
+ export default DepartmentUserTree
@@ -0,0 +1,116 @@
1
+ <template>
2
+ <div>
3
+ <el-dialog
4
+ ref="userDialog"
5
+ class="user-tree"
6
+ visible
7
+ :title="myTitle"
8
+ append-to-body
9
+ :close-on-click-modal="false"
10
+ :width="width"
11
+ @open="$emit('openDialog')"
12
+ @opend="$emit('opendDialog')"
13
+ @close="$emit('closeDialog')"
14
+ @closed="$emit('closedDialog')"
15
+ >
16
+ <inline-department-user-multi-tree
17
+ ref="inlineDepartmentUser"
18
+ :department-info="departmentInfo"
19
+ :is-need-virtual-user="isNeedVirtualUser"
20
+ :height="height"
21
+ :select-user-info="selectUserInfo"
22
+ :search-field="searchField"
23
+ :separator="separator"
24
+ @result="result"
25
+ />
26
+ <div slot="footer" class="dialog-footer">
27
+ <el-button size="small" @click="$emit('closeDialog')">
28
+ {{ $t('imatrixUIPublicModel.cancel') }}
29
+ </el-button>
30
+ <el-button size="small" type="primary" @click="confirmSelectUser">
31
+ {{ $t('imatrixUIPublicModel.sure') }}
32
+ </el-button>
33
+ </div>
34
+ </el-dialog>
35
+ </div>
36
+ </template>
37
+ <style>
38
+ .searchResult {
39
+ color:red
40
+ }
41
+ .inline-select-custom {
42
+ width : 100px
43
+ }
44
+ .inline-input-custom {
45
+ width : 98%
46
+ }
47
+ </style>
48
+ <script>
49
+ import InlineDepartmentUserMultiTree from '../../department-user-tree-inline/src/department-user-multiple-tree-inline.vue'
50
+ export default {
51
+ name: 'DepartmentUserMultiTree',
52
+ components: {
53
+ InlineDepartmentUserMultiTree
54
+ },
55
+ props: {
56
+ // 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
57
+ departmentInfo: {
58
+ type: Array,
59
+ default: null
60
+ },
61
+ // 弹框的标题
62
+ title: {
63
+ type: String,
64
+ default: null
65
+ },
66
+ // 弹框的宽度
67
+ width: {
68
+ type: String,
69
+ default: '60%'
70
+ },
71
+ // 弹框的高度
72
+ height: {
73
+ type: String,
74
+ default: '300px'
75
+ },
76
+ // 是否需要显示虚拟用户
77
+ isNeedVirtualUser: {
78
+ type: Boolean,
79
+ default: false
80
+ },
81
+ // 多选用户树时,已选择用户id或登录名集合,多个之间以逗号隔开
82
+ selectUserInfo: {
83
+ type: [String, Number],
84
+ default: null
85
+ },
86
+ // 移除用户时,用户属性名称:id、loginName、email、telephone,默认是loginName
87
+ searchField: {
88
+ type: String,
89
+ default: 'loginName'
90
+ },
91
+ // 多选树时结果之间的分隔符,默认是逗号分隔
92
+ separator: {
93
+ type: String,
94
+ default: ','
95
+ }
96
+ },
97
+ data() {
98
+ let myTitle = this.$t('imatrixUIMessage.pleaseSelectPersonnel')
99
+ if (this.title) {
100
+ myTitle = this.title
101
+ }
102
+ return {
103
+ myTitle
104
+ }
105
+ },
106
+ methods: {
107
+ result(selectNodeInfo) {
108
+ this.$emit('closeDialog', selectNodeInfo)
109
+ },
110
+ confirmSelectUser() {
111
+ this.$refs.inlineDepartmentUser.confirmSelectUser()
112
+ }
113
+
114
+ }
115
+ }
116
+ </script>