imatrix-ui 2.8.97-dw-tmp36 → 2.8.97-dw-tmp38

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 (180) hide show
  1. package/lib/super-ui.common.1.js +368 -0
  2. package/lib/super-ui.css +1 -0
  3. package/lib/super-ui.umd.1.js +368 -0
  4. package/lib/super-ui.umd.min.1.js +2 -0
  5. package/lib/super-ui.umd.min.js +67 -0
  6. package/package.json +1 -1
  7. package/src/views/dsc-component/Sidebar/index.vue +2 -2
  8. package/src/views/dsc-component/tabs/tab-content.vue +5 -1
  9. package/gulpfile.js +0 -20
  10. package/lib/breadcrumb.js +0 -1
  11. package/lib/department-tree-inline.js +0 -1
  12. package/lib/department-tree.js +0 -1
  13. package/lib/department-user-tree-inline.js +0 -1
  14. package/lib/department-user-tree.js +0 -1
  15. package/lib/dynamic-source-select.js +0 -1
  16. package/lib/fs-preview.js +0 -1
  17. package/lib/fs-upload-list.js +0 -1
  18. package/lib/fs-upload.js +0 -1
  19. package/lib/hamburger.js +0 -1
  20. package/lib/index.js +0 -58
  21. package/lib/index.js.gz +0 -0
  22. package/lib/multipart-upload.js +0 -1
  23. package/lib/organization-input.js +0 -1
  24. package/lib/plugins.js +0 -58
  25. package/lib/plugins.js.gz +0 -0
  26. package/lib/remove-department.js +0 -1
  27. package/lib/remove-user.js +0 -1
  28. package/lib/remove-workgroup.js +0 -1
  29. package/lib/rich-editor.js +0 -1
  30. package/lib/scan-code-input.js +0 -1
  31. package/lib/secret-info.js +0 -1
  32. package/lib/super-grid.js +0 -1
  33. package/lib/super-nine-grid.js +0 -1
  34. package/lib/svg-icon.js +0 -1
  35. package/lib/valid-code.js +0 -1
  36. package/lib/workflow-button.js +0 -1
  37. package/lib/workflow-history-list.js +0 -1
  38. package/lib/workgroup-tree-inline.js +0 -1
  39. package/lib/workgroup-tree.js +0 -1
  40. package/lib/workgroup-user-tree-inline.js +0 -1
  41. package/lib/workgroup-user-tree.js +0 -1
  42. package/lib/year-range-picker.js +0 -1
  43. package/packages/breadcrumb/index.js +0 -6
  44. package/packages/breadcrumb/src/breadcrumb.vue +0 -71
  45. package/packages/department-tree/index.js +0 -6
  46. package/packages/department-tree/src/department-tree.vue +0 -108
  47. package/packages/department-tree-inline/index.js +0 -6
  48. package/packages/department-tree-inline/src/department-multi-tree-inline.vue +0 -402
  49. package/packages/department-tree-inline/src/department-single-tree-inline.vue +0 -284
  50. package/packages/department-tree-inline/src/department-tree-inline.vue +0 -86
  51. package/packages/department-tree-inline/src/department-tree-service.js +0 -245
  52. package/packages/department-tree-inline/src/search-result.vue +0 -176
  53. package/packages/department-user-tree/index.js +0 -6
  54. package/packages/department-user-tree/src/department-user-multiple-tree.vue +0 -116
  55. package/packages/department-user-tree/src/department-user-single-tree.vue +0 -76
  56. package/packages/department-user-tree/src/department-user-tree.vue +0 -101
  57. package/packages/department-user-tree-inline/index.js +0 -6
  58. package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +0 -626
  59. package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +0 -269
  60. package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +0 -79
  61. package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +0 -230
  62. package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -122
  63. package/packages/department-user-tree-inline/src/search-result.vue +0 -197
  64. package/packages/directives/prevent-reclick.js +0 -19
  65. package/packages/dynamic-source-select/index.js +0 -6
  66. package/packages/dynamic-source-select/src/dynamic-source-select-service.js +0 -70
  67. package/packages/dynamic-source-select/src/dynamic-source-select.vue +0 -440
  68. package/packages/dynamic-source-select/src/events.js +0 -55
  69. package/packages/fs-preview/index.js +0 -6
  70. package/packages/fs-preview/src/fs-preview.vue +0 -226
  71. package/packages/fs-upload/index.js +0 -6
  72. package/packages/fs-upload/src/fs-upload-multi.vue +0 -420
  73. package/packages/fs-upload/src/fs-upload-single.vue +0 -312
  74. package/packages/fs-upload/src/fs-upload.vue +0 -189
  75. package/packages/fs-upload/src/see-big-picture.vue +0 -55
  76. package/packages/fs-upload-list/index.js +0 -6
  77. package/packages/fs-upload-list/src/fs-upload-list.vue +0 -287
  78. package/packages/hamburger/index.js +0 -6
  79. package/packages/hamburger/src/hamburger.vue +0 -38
  80. package/packages/index.js +0 -90
  81. package/packages/multipart-upload/index.js +0 -6
  82. package/packages/multipart-upload/src/index.vue +0 -73
  83. package/packages/multipart-upload/src/multipart-upload-form.vue +0 -297
  84. package/packages/multipart-upload/src/multipart-upload-list.vue +0 -378
  85. package/packages/organization-input/index.js +0 -6
  86. package/packages/organization-input/src/organization-input.vue +0 -542
  87. package/packages/plugins/export-data-new.js +0 -453
  88. package/packages/plugins/export-data.js +0 -361
  89. package/packages/plugins/index.js +0 -15
  90. package/packages/plugins/public-method.js +0 -43
  91. package/packages/remove-department/index.js +0 -6
  92. package/packages/remove-department/src/remove-department.vue +0 -172
  93. package/packages/remove-department/src/remove-dept-service.js +0 -20
  94. package/packages/remove-user/index.js +0 -6
  95. package/packages/remove-user/src/remove-user-service.js +0 -20
  96. package/packages/remove-user/src/remove-user.vue +0 -195
  97. package/packages/remove-workgroup/index.js +0 -6
  98. package/packages/remove-workgroup/src/remove-workgroup-service.js +0 -20
  99. package/packages/remove-workgroup/src/remove-workgroup.vue +0 -159
  100. package/packages/rich-editor/index.js +0 -7
  101. package/packages/rich-editor/index.vue +0 -278
  102. package/packages/rich-editor/langs/zh-Hans.js +0 -1
  103. package/packages/rich-editor/viewer.vue +0 -103
  104. package/packages/scan-code-input/index.js +0 -6
  105. package/packages/scan-code-input/src/events.js +0 -33
  106. package/packages/scan-code-input/src/scan-code-input-colse.vue +0 -131
  107. package/packages/scan-code-input/src/scan-code-input.vue +0 -116
  108. package/packages/secret-info/index.js +0 -7
  109. package/packages/secret-info/index.vue +0 -90
  110. package/packages/super-grid/index.js +0 -7
  111. package/packages/super-grid/src/apis.js +0 -763
  112. package/packages/super-grid/src/columns-config.vue +0 -335
  113. package/packages/super-grid/src/custom-formatter.js +0 -250
  114. package/packages/super-grid/src/dynamic-input.vue +0 -1279
  115. package/packages/super-grid/src/eventBus.js +0 -2
  116. package/packages/super-grid/src/events.js +0 -55
  117. package/packages/super-grid/src/formValidatorUtil.js +0 -226
  118. package/packages/super-grid/src/formatter.js +0 -181
  119. package/packages/super-grid/src/group-column.vue +0 -100
  120. package/packages/super-grid/src/header-context-menu.vue +0 -87
  121. package/packages/super-grid/src/index-column.vue +0 -51
  122. package/packages/super-grid/src/normal-column copy.vue +0 -769
  123. package/packages/super-grid/src/normal-column.vue +0 -769
  124. package/packages/super-grid/src/public-methods.js +0 -31
  125. package/packages/super-grid/src/row-operation.vue +0 -161
  126. package/packages/super-grid/src/search-button.vue +0 -66
  127. package/packages/super-grid/src/search-condition-input.vue +0 -61
  128. package/packages/super-grid/src/search-condition-list.vue +0 -59
  129. package/packages/super-grid/src/search-form-advancedQuery.vue +0 -653
  130. package/packages/super-grid/src/search-form-dialog.vue +0 -79
  131. package/packages/super-grid/src/search-form-item.vue +0 -386
  132. package/packages/super-grid/src/search-form-number.vue +0 -38
  133. package/packages/super-grid/src/search-form-open.vue +0 -162
  134. package/packages/super-grid/src/search-form-ordinarySearch.vue +0 -188
  135. package/packages/super-grid/src/search-form.vue +0 -634
  136. package/packages/super-grid/src/search-methods.js +0 -387
  137. package/packages/super-grid/src/selection-column.vue +0 -43
  138. package/packages/super-grid/src/store.js +0 -3
  139. package/packages/super-grid/src/super-grid-service-static.js +0 -1313
  140. package/packages/super-grid/src/super-grid-service.js +0 -561
  141. package/packages/super-grid/src/super-grid-static.vue +0 -3229
  142. package/packages/super-grid/src/super-grid.vue +0 -2793
  143. package/packages/super-grid/src/utils.js +0 -763
  144. package/packages/super-grid/src/view-image-dialog.vue +0 -130
  145. package/packages/super-nine-grid/index.js +0 -7
  146. package/packages/super-nine-grid/src/apis.js +0 -103
  147. package/packages/super-nine-grid/src/custom-formatter.js +0 -66
  148. package/packages/super-nine-grid/src/formatter.js +0 -132
  149. package/packages/super-nine-grid/src/search-form-number.vue +0 -38
  150. package/packages/super-nine-grid/src/search-form.vue +0 -430
  151. package/packages/super-nine-grid/src/search-methods.js +0 -134
  152. package/packages/super-nine-grid/src/store.js +0 -3
  153. package/packages/super-nine-grid/src/super-grid-service.js +0 -91
  154. package/packages/super-nine-grid/src/super-nine-grid.vue +0 -872
  155. package/packages/super-nine-grid/src/utils.js +0 -261
  156. package/packages/svg-icon/index.js +0 -6
  157. package/packages/svg-icon/src/svg-icon.vue +0 -43
  158. package/packages/utils/utils.js +0 -152
  159. package/packages/utils/value-set.js +0 -86
  160. package/packages/valid-code/index.js +0 -7
  161. package/packages/valid-code/src/valid-code.vue +0 -95
  162. package/packages/workflow-button/index.js +0 -6
  163. package/packages/workflow-button/src/workflow-button.vue +0 -325
  164. package/packages/workflow-history-list/index.js +0 -6
  165. package/packages/workflow-history-list/src/api.js +0 -7
  166. package/packages/workflow-history-list/src/workflow-history-list.vue +0 -185
  167. package/packages/workgroup-tree/index.js +0 -6
  168. package/packages/workgroup-tree/src/workgroup-tree.vue +0 -76
  169. package/packages/workgroup-tree-inline/index.js +0 -6
  170. package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +0 -317
  171. package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +0 -43
  172. package/packages/workgroup-user-tree/index.js +0 -6
  173. package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +0 -100
  174. package/packages/workgroup-user-tree-inline/index.js +0 -6
  175. package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +0 -163
  176. package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +0 -436
  177. package/packages/year-range-picker/index.js +0 -6
  178. package/packages/year-range-picker/src/year-range-picker.vue +0 -51
  179. package/webpack.commonjs.js +0 -60
  180. package/webpack.components.js +0 -75
@@ -1,402 +0,0 @@
1
- <template>
2
- <div>
3
- <el-container style="height: 395px">
4
- <el-aside width="350px">
5
- <el-container style="height: 390px">
6
- <el-header style="text-align: right; font-size: 12px;height: 35px">
7
- <el-autocomplete
8
- v-model="filterText"
9
- size="small"
10
- select-when-unmatched
11
- class="inline-input inline-input-custom"
12
- :fetch-suggestions="querySearch"
13
- :placeholder="$t('departmentTreeInline.pleaseEnterDepartmentName')"
14
- :trigger-on-focus="false"
15
- @keyup.enter.native="clickSearch"
16
- @select="handleSelect"
17
- >
18
- <el-button slot="append" icon="el-icon-search" @click="clickSearch" />
19
- </el-autocomplete>
20
- </el-header>
21
- <el-main style="padding: 10px">
22
- <div v-if="!searchValue" style="padding-top:5px;overflow:auto;width: auto;display: inline-block !important;">
23
- <el-tree
24
- ref="deparmentTree"
25
- :props="defaultProps"
26
- :load="loadNode"
27
- lazy
28
- :show-checkbox="true"
29
- node-key="id"
30
- check-strictly
31
- :render-content="renderContent"
32
- :filter-node-method="filterNode"
33
- @check-change="handleCheckChange"
34
- @node-expand="handleNodeExpand"
35
- @check="handleCheckNode"
36
- @node-click="handleNodeClick"
37
- />
38
- </div>
39
-
40
- <div v-if="searchValue && searchValue.length > 0" style="height:100%;overflow: hidden;">
41
- <user-result :grid-data="searchResult" :select-result="selectResult" :height="height" :multiple="true" :is-search-result="true" @addUser="selectUser" />
42
- </div>
43
- </el-main>
44
- </el-container>
45
- </el-aside>
46
-
47
- <el-container>
48
- <el-aside width="2px">
49
- <table border="1px" cellpadding="0" cellspacing="0" style="height:100%;border-left-style:solid; border-bottom-style:none;border-right-style:none;border-top-style:none;border-left-color: #cccccc" />
50
- </el-aside>
51
- <el-main style="padding: 10px">
52
- <div style="text-align:left;font-size:16px">
53
- {{ $t('departmentTreeInline.selectedDept') }}:
54
- </div>
55
- <div :style="'padding-top: 5px;height:90%;overflow: hidden;'">
56
- <user-result v-loading="isloading" :grid-data="selectResult" :height="height" :multiple="true" :is-search-result="false" @removeUser="removeUser" />
57
- </div>
58
- </el-main>
59
- </el-container>
60
- </el-container>
61
- </div>
62
- </template>
63
- <style>
64
- .searchResult {
65
- color:red
66
- }
67
- .inline-input-custom {
68
- width : 90%
69
- }
70
- </style>
71
-
72
- <script>
73
- import localStorage from '../../../src/utils/local-storage'
74
- import utils from '../../utils/utils'
75
- import departmentTreeService from './department-tree-service'
76
- import UserResult from './search-result.vue'
77
- export default {
78
- name: 'InlineDepartmentMultiTree',
79
- components: {
80
- UserResult
81
- },
82
- props: {
83
- checkStrictly: {
84
- type: Boolean,
85
- default: false
86
- },
87
- // 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
88
- departmentInfo: {
89
- type: Array,
90
- default: null
91
- },
92
- // 弹框的高度
93
- height: {
94
- type: String,
95
- default: '300px'
96
- },
97
- // 多选部门树时,已选择部门id或部门名称或编码集合,多个之间以逗号隔开
98
- selectDepartmentInfo: {
99
- type: [String, Number],
100
- default: null
101
- },
102
- // 移除部门时,部门属性名称:id、name、code,默认是id
103
- searchField: {
104
- type: String,
105
- default: 'id'
106
- },
107
- // 多选树时结果之间的分隔符,默认是逗号分隔
108
- separator: {
109
- type: String,
110
- default: ','
111
- }
112
- },
113
- data() {
114
- return {
115
- filterText: '',
116
- defaultProps: {
117
- id: 'id',
118
- label: 'showName',
119
- children: 'childDepartments',
120
- isLeaf: 'leaf'
121
- },
122
- searchParam: {
123
- searchValue: null,
124
- treeType: 'DEPARTMENT_TREE',
125
- departmentInfo: null
126
- },
127
- count: 0,
128
- containBranch: false, // 当前租户内是否包含分支机构。获得当前选中部门名称时,如果有分支,则需要将分支名称返回给用户,例如:部门1(分支1)
129
- tenantNodeId: -1, // 公司节点的id
130
- allSearchNodeIds: [], // 用于保存所有查询出的节点id
131
- allExpandNodeIds: [], // 用于保存allSearchNodeIds中所有已加载子节点的id集合
132
- isClickNode: false,
133
- restaurants: [], // 查询的备选值
134
- searchValue: null, // 查询条件
135
- searchStoreKey: 'searchDepartment',
136
- selectNodeInfo: null, // 单选时,选择的部门信息
137
- tenantInfo: {}, // 公司根节点信息
138
- searchResult: [],
139
- selectResult: [],
140
- isloading: false // 控制右侧选择区的loading状态
141
- }
142
- },
143
- computed: {
144
- },
145
- watch: {
146
- filterText(val) {
147
- if (!val) {
148
- this.searchValue = val
149
- // 清空查询内容时,重新加载整个树
150
- if (this.departmentInfo && this.departmentInfo.length > 0) {
151
- // 加载指定部门时,展开公司节点
152
- this.loadPointDepartments()
153
- } else {
154
- // 加载整个组织结构树时,展开公司节点
155
- this.loadDepartment(this.tenantNodeId)
156
- }
157
- }
158
- }
159
- },
160
- created() {
161
- this.initSelectDepts(this.searchField, this.selectDepartmentInfo, this.separator).then(selectUsers => {
162
- if (selectUsers) {
163
- this.selectResult = selectUsers
164
- }
165
- })
166
- },
167
- mounted() {
168
- var searchDepartment = localStorage.getObject(this.searchStoreKey)
169
- if (searchDepartment) {
170
- this.restaurants = searchDepartment
171
- } else {
172
- this.restaurants = []
173
- }
174
- },
175
- methods: {
176
- ...utils,
177
- ...departmentTreeService,
178
- filterNode(value, data, node) {
179
- if (!value) {
180
- return true
181
- } else {
182
- return data.name.indexOf(value) !== -1
183
- }
184
- },
185
- // 选中当前节点及其子节点
186
- checkedNodeAndChildren(data) {
187
- // 取消选中状态时,保持节点是展开的状态,不要折叠
188
- // this.$refs.deparmentTree.store.nodesMap[data.id].expanded = true
189
- let department = data
190
- if (data.data) {
191
- department = JSON.parse(data.data)
192
- }
193
- this.selectUser(null, department)
194
- // 获得所有应该选中的节点
195
- this.$refs.deparmentTree.setChecked(data.id, true)
196
- const childDepartments = data.childDepartments
197
- if (childDepartments && !this.checkStrictly) {
198
- // 递归设置子子节点的选中状态
199
- childDepartments.forEach(nodeData => {
200
- this.checkedNodeAndChildren(nodeData)
201
- })
202
- }
203
- },
204
- // 取消当前节点的子节点的选中状态
205
- cancelChildCheckedNodes(data) {
206
- const department = JSON.parse(data.data)
207
- this.selectResult = this.removeRow(this.selectResult, department)
208
- if (data.id !== this.tenantNodeId) {
209
- // 如果当前节点不是公司节点,需要将公司节点的选中状态去掉
210
- this.$refs.deparmentTree.setChecked(this.tenantNodeId, false)
211
- }
212
- const childDepartments = data.childDepartments
213
- if (childDepartments && !this.checkStrictly) {
214
- childDepartments.forEach(nodeData => {
215
- // 取消节点的选中状态
216
- this.$refs.deparmentTree.setChecked(nodeData.id, false)
217
- // 递归取消子子节点的选中状态
218
- this.cancelChildCheckedNodes(nodeData)
219
- })
220
- }
221
- },
222
- handleCheckChange(data, checked, indeterminate) {
223
-
224
- },
225
- handleNodeExpand(data, node, nodeTree) {
226
- },
227
- handleNodeClick(data, node, nodeTree) {
228
- // 多选部门树时,处理点击节点事件
229
- this.clickNodeWhenMultiple(data)
230
- },
231
- // 多选树时,点击节点处理复选框的选中状态
232
- clickNodeWhenMultiple(data) {
233
- var checkedKeys = []
234
- if (this.$refs.deparmentTree) {
235
- checkedKeys = this.$refs.deparmentTree.getCheckedKeys()
236
- }
237
- if (checkedKeys && checkedKeys.indexOf(data.id) > -1) {
238
- // 表示当前节点是选中状态,则需要取消其选中状态
239
- // 取消当前节点的勾选状态
240
- this.$refs.deparmentTree.setChecked(data.id, false)
241
- // 取消当前节点的子节点的勾选状态
242
- if (!this.checkStrictly) {
243
- this.cancelChildCheckedNodes(data)
244
- }
245
- // 取消选中状态时,保持节点是展开的状态,不要折叠
246
- this.$refs.deparmentTree.store.nodesMap[data.id].expanded = true
247
- } else {
248
- // 表示当前节点不是选中的状态,需要勾选该节点
249
- if (data.nodeType && data.nodeType === 'DEPARTMENT' && data.data) {
250
- // 表示当前选中的节点是部门
251
- const department = JSON.parse(data.data)
252
- this.selectUser(null, department)
253
- }
254
- this.$refs.deparmentTree.setChecked(data.id, true)
255
- // 点击树节点时添加并展开节点会走loadNode方法,因为设置了树组件的expand-on-click-node属性为true
256
- const children = data.childDepartments
257
- if (children && children.length > 0) {
258
- // 表示加载过该节点,直接选中即可
259
- if (!this.checkStrictly) {
260
- this.checkedNodeAndChildren(data)
261
- }
262
- } else {
263
- // 表示没有加载过该节点,是首次加载,需要走后台
264
- // 会走loadNode方法,因为设置了树组件的expand-on-click-node属性为true
265
- this.isClickNode = true
266
- }
267
- }
268
- },
269
- isDepartmentNode(data) {
270
- // 当前节点不是公司节点,也不是分支机构节点,表示是部门节点
271
- return data.id !== this.tenantNodeId && data.nodeType && data.nodeType === 'DEPARTMENT' && !data.branch
272
- },
273
- selectDepartment() {
274
- // 是否需要显示提示框,默认不显示
275
- var showTip = false
276
- var leafSelectNodeInfo = {
277
- ids: [],
278
- names: [],
279
- codes: [],
280
- zhNames: [],
281
- enNames: [],
282
- departments: []
283
- }
284
- if (this.selectResult.length === 0) {
285
- // 没有选择任何节点
286
- showTip = true
287
- } else {
288
- for (var i = 0; i < this.selectResult.length; i++) {
289
- var userData = this.selectResult[i]
290
- // 不存在该用户则放到结果集合中,去掉重复使用
291
- leafSelectNodeInfo.ids.push(userData.id)
292
- leafSelectNodeInfo.codes.push(userData.code)
293
- if(userData.enName) {
294
- leafSelectNodeInfo.enNames.push(userData.enName)
295
- } else {
296
- leafSelectNodeInfo.enNames.push('')
297
- }
298
- if (userData.department) {
299
- leafSelectNodeInfo.departments.push(userData.department)
300
- } else {
301
- leafSelectNodeInfo.departments.push(userData)
302
- }
303
- let name = userData.showName
304
- leafSelectNodeInfo.names.push(name)
305
- leafSelectNodeInfo.zhNames.push(userData.name)
306
- }
307
- }
308
- if (leafSelectNodeInfo.ids.length > 0) {
309
- leafSelectNodeInfo.containBranch = this.containBranch
310
- this.$emit('result', leafSelectNodeInfo)
311
- } else {
312
- showTip = true
313
- }
314
- if (showTip) {
315
- this.$alert(this.$t('imatrixUIMessage.pleaseSelectDepartment'), this.$t('imatrixUIMessage.tips'), {
316
- confirmButtonText: this.$t('imatrixUIPublicModel.sure')
317
- })
318
- }
319
- },
320
- // 是否选中了公司节点
321
- isSelectTenantNode(dataId) {
322
- return dataId === this.tenantNodeId && (!this.departmentInfo || this.departmentInfo.length === 0)
323
- },
324
- // 给节点添加自定义图标
325
- renderContent(h, { node, data, store }) {
326
- var className
327
- if (node.data.id === -1 || node.data.branch) {
328
- // node.id ===-1表示公司节点,node.branch表示是分支机构节点
329
- className = 'el-icon-menu'
330
- } else if (node.data.id === -2 || node.data.id === -3) {
331
- // node.id ===-2表示集团公司无部门用户节点,node.id ===-3表示是分支机构无部门用户节点
332
- className = 'el-icon-tickets'
333
- } else {
334
- // 表示是部门节点
335
- className = 'el-icon-date'
336
- }
337
- return (
338
- <span>
339
- <i class={className}></i>
340
- <span title={node.label}>{node.label}</span>
341
- </span>
342
- )
343
- },
344
- // 将查询结果中指定用户添加到已选择用户集合中
345
- selectUser(index, dept) {
346
- // if (!this.isContainAllUser()) {
347
- const containUsers = this.selectResult.filter(this.filterDept(dept))
348
- if (containUsers && containUsers.length === 0) {
349
- // 如果已选结果中不包含当前用户,则添加
350
- // 将查询结果中的用户复制到已选择用户集合中
351
- dept.tenantCode = this.tenantInfo.code
352
- dept.tenantName = this.tenantInfo.tenantName
353
- this.selectResult.push(dept)
354
- }
355
- // } else {
356
- // this.alertByAllUser()
357
- // }
358
- },
359
- // 判断用户是否存在的过滤器
360
- filterDept(queryDept) {
361
- return (dept) => {
362
- return (dept.id === queryDept.id)
363
- }
364
- },
365
- filterDeptNode(queryDept) {
366
- return (deptNodeId) => {
367
- return (deptNodeId + '' === queryDept.id + '')
368
- }
369
- },
370
- // 从已选择用户集合中移除指定用户,并添加到查询结果集合中
371
- removeUser(index, dept) {
372
- // 表示是在组织结构树页面,需要将树的人员节点的选中状态去掉
373
- if (dept.nodeId) {
374
- const nodeId = dept.nodeId
375
- if (this.$refs.deparmentTree && nodeId) {
376
- this.$refs.deparmentTree.setChecked(nodeId, false)
377
- }
378
- } else {
379
- if (this.$refs.deparmentTree) {
380
- // 通过查询结果添加的用户,在返回到组织结构树时,也选中了该用户,在移除该用户时,需要去掉复选框的选中状态
381
- const checkedKeys = this.$refs.deparmentTree.getCheckedKeys()
382
- const currentCheckedUserNodeIds = checkedKeys.filter(this.filterDeptNode(dept))
383
- if (currentCheckedUserNodeIds.length > 0) {
384
- // 表示当前用户是选中的状态,需要去掉
385
- currentCheckedUserNodeIds.forEach(userNodeId => {
386
- this.$refs.deparmentTree.setChecked(userNodeId, false)
387
- })
388
- }
389
- }
390
- }
391
- this.selectResult = this.removeRow(this.selectResult, dept)
392
- if (!this.selectResult || this.selectResult.length === 0) {
393
- // 已选结果面板没有内容,则左侧树节点也不要有选中节点了
394
- if (this.$refs.deparmentTree) {
395
- this.$refs.deparmentTree.setCheckedKeys([])
396
- }
397
- }
398
- }
399
-
400
- }
401
- }
402
- </script>
@@ -1,284 +0,0 @@
1
- <template>
2
- <div>
3
- <el-container style="height: 395px">
4
- <el-header style="text-align: right; font-size: 12px;height: 35px">
5
- <el-autocomplete
6
- v-model="filterText"
7
- size="small"
8
- select-when-unmatched
9
- class="inline-input inline-input-custom"
10
- :fetch-suggestions="querySearch"
11
- :placeholder="$t('departmentTreeInline.pleaseEnterDepartmentName')"
12
- :trigger-on-focus="false"
13
- @keyup.enter.native="clickSearch"
14
- @select="handleSelect"
15
- >
16
- <el-button slot="append" icon="el-icon-search" @click="clickSearch" />
17
- </el-autocomplete>
18
- </el-header>
19
- <el-main style="padding: 10px">
20
- <div v-if="!searchValue" style="padding-top:5px;overflow:auto;width: auto;display: inline-block !important;">
21
- <el-tree
22
- ref="deparmentTree"
23
- :props="defaultProps"
24
- :load="loadNode"
25
- lazy
26
- :show-checkbox="false"
27
- node-key="id"
28
- check-strictly
29
- :render-content="renderContent"
30
- :filter-node-method="filterNode"
31
- @check-change="handleCheckChange"
32
- @node-expand="handleNodeExpand"
33
- @node-click="handleNodeClick"
34
- />
35
- </div>
36
- <div v-if="searchValue && searchValue.length > 0" style="height:100%;overflow: hidden;">
37
- <user-result :grid-data="searchResult" :height="height" :multiple="false" :is-search-result="true" @selectResult="getSelectUser" @resultRowDblclick="resultRowDblclick" />
38
- </div>
39
- </el-main>
40
- </el-container>
41
- </div>
42
- </template>
43
- <style>
44
- .searchResult {
45
- color:red
46
- }
47
- .inline-input-custom {
48
- width : 90%
49
- }
50
- </style>
51
-
52
- <script>
53
- import localStorage from '../../../src/utils/local-storage'
54
- import utils from '../../utils/utils'
55
- import departmentTreeService from './department-tree-service'
56
- import UserResult from './search-result.vue'
57
- export default {
58
- name: 'InlineDepartmentSingleTree',
59
- components: {
60
- UserResult
61
- },
62
- props: {
63
- // 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
64
- departmentInfo: {
65
- type: Array,
66
- default: null
67
- },
68
- // 弹框的高度
69
- height: {
70
- type: String,
71
- default: '300px'
72
- },
73
- // 多选部门树时,已选择部门id或部门名称或编码集合,多个之间以逗号隔开
74
- selectDepartmentInfo: {
75
- type: [String, Number],
76
- default: null
77
- },
78
- // 移除部门时,部门属性名称:id、name、code,默认是id
79
- searchField: {
80
- type: String,
81
- default: 'id'
82
- },
83
- // 多选树时结果之间的分隔符,默认是逗号分隔
84
- separator: {
85
- type: String,
86
- default: ','
87
- }
88
- },
89
- data() {
90
- return {
91
- filterText: '',
92
- defaultProps: {
93
- id: 'id',
94
- label: 'showName',
95
- children: 'childDepartments',
96
- isLeaf: 'leaf'
97
- },
98
- searchParam: {
99
- searchValue: null,
100
- treeType: 'DEPARTMENT_TREE',
101
- departmentInfo: null
102
- },
103
- count: 0,
104
- containBranch: false, // 当前租户内是否包含分支机构。获得当前选中部门名称时,如果有分支,则需要将分支名称返回给用户,例如:部门1(分支1)
105
- tenantNodeId: -1, // 公司节点的id
106
- allSearchNodeIds: [], // 用于保存所有查询出的节点id
107
- allExpandNodeIds: [], // 用于保存allSearchNodeIds中所有已加载子节点的id集合
108
- isClickNode: false,
109
- restaurants: [], // 查询的备选值
110
- searchValue: null, // 查询条件
111
- searchStoreKey: 'searchDepartment',
112
- selectNodeInfo: null, // 单选时,选择的部门信息
113
- tenantInfo: {}, // 公司根节点信息
114
- searchResult: []
115
- }
116
- },
117
- computed: {
118
- },
119
- watch: {
120
- filterText(val) {
121
- if (!val) {
122
- this.searchValue = val
123
- // 清空查询内容时,重新加载整个树
124
- if (this.departmentInfo && this.departmentInfo.length > 0) {
125
- // 加载指定部门时,展开公司节点
126
- this.loadPointDepartments()
127
- } else {
128
- // 加载整个组织结构树时,展开公司节点
129
- this.loadDepartment(this.tenantNodeId)
130
- }
131
- }
132
- }
133
- },
134
- mounted() {
135
- var searchDepartment = localStorage.getObject(this.searchStoreKey)
136
- if (searchDepartment) {
137
- this.restaurants = searchDepartment
138
- } else {
139
- this.restaurants = []
140
- }
141
- },
142
- methods: {
143
- ...utils,
144
- ...departmentTreeService,
145
- filterNode(value, data, node) {
146
- if (!value) {
147
- return true
148
- } else {
149
- return data.name.indexOf(value) !== -1
150
- }
151
- },
152
- // 选中当前节点及其子节点
153
- checkedNodeAndChildren(data) {
154
- // 取消选中状态时,保持节点是展开的状态,不要折叠
155
- // this.$refs.deparmentTree.store.nodesMap[data.id].expanded = true
156
- // 获得所有应该选中的节点
157
- this.$refs.deparmentTree.setChecked(data.id, true)
158
- const childDepartments = data.childDepartments
159
- if (childDepartments) {
160
- // 递归设置子子节点的选中状态
161
- childDepartments.forEach(nodeData => {
162
- this.checkedNodeAndChildren(nodeData)
163
- })
164
- }
165
- },
166
- // 取消当前节点的子节点的选中状态
167
- cancelChildCheckedNodes(data) {
168
- if (data.id !== this.tenantNodeId) {
169
- // 如果当前节点不是公司节点,需要将公司节点的选中状态去掉
170
- this.$refs.deparmentTree.setChecked(this.tenantNodeId, false)
171
- }
172
- const childDepartments = data.childDepartments
173
- if (childDepartments) {
174
- childDepartments.forEach(nodeData => {
175
- // 取消节点的选中状态
176
- this.$refs.deparmentTree.setChecked(nodeData.id, false)
177
- // 递归取消子子节点的选中状态
178
- this.cancelChildCheckedNodes(nodeData)
179
- })
180
- }
181
- },
182
- handleCheckChange(data, checked, indeterminate) {
183
-
184
- },
185
- handleNodeExpand(data, node, nodeTree) {
186
- },
187
- handleNodeClick(data, node, nodeTree) {
188
- this.selectSingleNode(data, false)
189
- },
190
- selectSingleNode(data, isClickOkBtn) {
191
- // 表示是部门树节点
192
- if (this.isDepartmentNode(data)) {
193
- // 点击的是部门节点,并且是单选树时,点击部门节点直接关闭弹框
194
- const department = JSON.parse(data.data)
195
- this.packageSelectResult(department)
196
- // if (this.selectNodeInfo && isClickOkBtn === true) {
197
- // // 点击确定按钮时才需要调result回调事件,关闭弹框
198
- // this.$emit('result', this.selectNodeInfo)
199
- // }
200
- }
201
- },
202
- packageSelectResult(department) {
203
- department.tenantName = this.tenantInfo.tenantName
204
- department.tenantCode = this.tenantInfo.code
205
- var selectNodeInfo = {
206
- id: department.id,
207
- name: department.showName,
208
- code: department.code,
209
- containBranch: this.containBranch,
210
- zhName: department.name,
211
- enName: department.enName,
212
- department: department
213
- }
214
- this.selectNodeInfo = selectNodeInfo
215
- },
216
- isDepartmentNode(data) {
217
- // 当前节点不是公司节点,也不是分支机构节点,表示是部门节点
218
- return data.id !== this.tenantNodeId && data.nodeType && data.nodeType === 'DEPARTMENT' && !data.branch
219
- },
220
- selectDepartment() {
221
- // 是否需要显示提示框,默认不显示
222
- var showTip = false
223
- // const data = this.$refs.deparmentTree.getCurrentNode()
224
- if (this.selectNodeInfo) {
225
- // this.selectSingleNode(data, true)
226
- this.$emit('result', this.selectNodeInfo)
227
- } else {
228
- showTip = true
229
- }
230
-
231
- if (showTip) {
232
- this.$alert(this.$t('imatrixUIMessage.pleaseSelectDepartment'), this.$t('imatrixUIMessage.tips'), {
233
- confirmButtonText: this.$t('imatrixUIPublicModel.sure')
234
- })
235
- }
236
- },
237
- // 是否选中了公司节点
238
- isSelectTenantNode(dataId) {
239
- return dataId === this.tenantNodeId && (!this.departmentInfo || this.departmentInfo.length === 0)
240
- },
241
- // 给节点添加自定义图标
242
- renderContent(h, { node, data, store }) {
243
- var className
244
- if (node.data.id === -1 || node.data.branch) {
245
- // node.id ===-1表示公司节点,node.branch表示是分支机构节点
246
- className = 'el-icon-menu'
247
- } else if (node.data.id === -2 || node.data.id === -3) {
248
- // node.id ===-2表示集团公司无部门用户节点,node.id ===-3表示是分支机构无部门用户节点
249
- className = 'el-icon-tickets'
250
- } else {
251
- // 表示是部门节点
252
- className = 'el-icon-date'
253
- }
254
- if (data.nodeType && data.nodeType === 'DEPARTMENT' &&
255
- this.searchValue && data.name.indexOf(this.searchValue) > -1) {
256
- // 如果是查询条件
257
- return (
258
- <span>
259
- <i class={className}></i>
260
- <span class='searchResult' title={node.label}>{node.label}</span>
261
- </span>
262
- )
263
- }
264
- return (
265
- <span>
266
- <i class={className}></i>
267
- <span title={node.label}>{node.label}</span>
268
- </span>
269
- )
270
- },
271
- getSelectUser(selectUser) {
272
- // console.log('getSelectUser==', selectUser)
273
- // this.selectUser = selectUser
274
- // true参数表示是否是勾选单选框,是勾选单选框时不关闭弹框
275
- this.packageSelectResult(selectUser)
276
- },
277
- resultRowDblclick(user) {
278
- this.packageSelectResult(user)
279
- this.$emit('result', this.selectNodeInfo)
280
- }
281
-
282
- }
283
- }
284
- </script>