imatrix-ui 2.9.15-dw-tmp2 → 2.9.16-boe1

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 (193) hide show
  1. package/lib/super-ui.css +1 -1
  2. package/lib/super-ui.umd.min.js +5 -35
  3. package/package.json +2 -2
  4. package/src/api/sso-service.js +19 -1
  5. package/src/assets/nonemessage.png +0 -0
  6. package/src/i18n/i18n.js +1 -1
  7. package/src/i18n/langs/cn.js +18 -6
  8. package/src/i18n/langs/en.js +20 -7
  9. package/src/permission.js +2 -2
  10. package/src/plugins.js +3 -3
  11. package/src/router/index.js +10 -0
  12. package/src/store/modules/tab-content.js +6 -0
  13. package/src/store/modules/user.js +32 -2
  14. package/src/styles/display-layout.scss +1 -1
  15. package/src/styles/index.scss +74 -4
  16. package/src/styles/theme/black/font-style.scss +70 -0
  17. package/src/styles/theme/black/index.scss +6 -30
  18. package/src/styles/theme/blue/font-style.scss +37 -0
  19. package/src/styles/theme/blue/index.scss +2 -18
  20. package/src/styles/theme/blue2/font-style.scss +70 -0
  21. package/src/styles/theme/blue2/index.scss +3 -13
  22. package/src/styles/theme/dark-blue/card.scss +4 -6
  23. package/src/styles/theme/dark-blue/form.scss +7 -4
  24. package/src/styles/theme/dark-blue/index.scss +30 -5
  25. package/src/styles/theme/dark-blue/message.scss +8 -0
  26. package/src/styles/theme/dark-blue/radio.scss +13 -0
  27. package/src/styles/theme/dark-blue/sidebar.scss +7 -37
  28. package/src/styles/theme/dark-blue/tab.scss +4 -1
  29. package/src/styles/theme/dark-blue/table.scss +1 -1
  30. package/src/styles/theme/dark-blue/tree.scss +35 -10
  31. package/src/styles/theme/gray/card-style.scss +13 -1
  32. package/src/styles/theme/gray/font-style.scss +38 -0
  33. package/src/styles/theme/gray/index.scss +13 -25
  34. package/src/styles/theme/gray/scrollbar-style.scss +32 -0
  35. package/src/styles/theme/gray/sidebar.scss +7 -14
  36. package/src/utils/auth-api.js +47 -1
  37. package/src/utils/common-util.js +22 -81
  38. package/src/utils/jump-page-utils.js +3 -6
  39. package/src/utils/range-selector.js +185 -0
  40. package/src/utils/request.js +6 -3
  41. package/src/utils/util.js +13 -11
  42. package/src/utils/workflow-util.js +3 -0
  43. package/src/views/dsc-component/Sidebar/Item.vue +7 -5
  44. package/src/views/dsc-component/Sidebar/SidebarItem.vue +2 -3
  45. package/src/views/dsc-component/Sidebar/index.vue +12 -20
  46. package/src/views/dsc-component/tabs/tab-content.vue +8 -9
  47. package/src/views/layout/EmptyLayout.vue +4 -1
  48. package/src/views/layout/NewLayout.vue +6 -65
  49. package/src/views/layout/components/AppMain.vue +2 -1
  50. package/src/views/layout/components/Menubar/Item.vue +23 -7
  51. package/src/views/layout/components/Menubar/Link.vue +11 -2
  52. package/src/views/layout/components/Menubar/SidebarItem.vue +50 -7
  53. package/src/views/layout/components/Menubar/index.vue +51 -16
  54. package/src/views/layout/components/tabs/tab-content.vue +162 -0
  55. package/src/views/layout/tab-content-iframe-index.vue +31 -0
  56. package/src/views/layout/tab-content-index.vue +85 -0
  57. package/src/views/login/index.vue +1 -1
  58. package/packages/breadcrumb/index.js +0 -6
  59. package/packages/breadcrumb/src/breadcrumb.vue +0 -71
  60. package/packages/department-tree/index.js +0 -6
  61. package/packages/department-tree/src/department-tree.vue +0 -108
  62. package/packages/department-tree-inline/index.js +0 -6
  63. package/packages/department-tree-inline/src/department-multi-tree-inline.vue +0 -408
  64. package/packages/department-tree-inline/src/department-single-tree-inline.vue +0 -290
  65. package/packages/department-tree-inline/src/department-tree-inline.vue +0 -86
  66. package/packages/department-tree-inline/src/department-tree-service.js +0 -273
  67. package/packages/department-tree-inline/src/search-result.vue +0 -176
  68. package/packages/department-user-tree/index.js +0 -6
  69. package/packages/department-user-tree/src/department-user-multiple-tree.vue +0 -116
  70. package/packages/department-user-tree/src/department-user-single-tree.vue +0 -76
  71. package/packages/department-user-tree/src/department-user-tree.vue +0 -101
  72. package/packages/department-user-tree-inline/index.js +0 -6
  73. package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +0 -636
  74. package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +0 -271
  75. package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +0 -79
  76. package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +0 -248
  77. package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -142
  78. package/packages/department-user-tree-inline/src/search-result.vue +0 -197
  79. package/packages/directives/prevent-reclick.js +0 -19
  80. package/packages/dynamic-source-select/index.js +0 -6
  81. package/packages/dynamic-source-select/src/dynamic-source-select-service.js +0 -70
  82. package/packages/dynamic-source-select/src/dynamic-source-select.vue +0 -440
  83. package/packages/dynamic-source-select/src/events.js +0 -55
  84. package/packages/fs-preview/index.js +0 -6
  85. package/packages/fs-preview/src/fs-preview.vue +0 -226
  86. package/packages/fs-upload/index.js +0 -6
  87. package/packages/fs-upload/src/fs-upload-multi.vue +0 -420
  88. package/packages/fs-upload/src/fs-upload-single.vue +0 -312
  89. package/packages/fs-upload/src/fs-upload.vue +0 -189
  90. package/packages/fs-upload/src/see-big-picture.vue +0 -55
  91. package/packages/fs-upload-list/index.js +0 -6
  92. package/packages/fs-upload-list/src/fs-upload-list.vue +0 -287
  93. package/packages/hamburger/index.js +0 -6
  94. package/packages/hamburger/src/hamburger.vue +0 -38
  95. package/packages/index.js +0 -121
  96. package/packages/multipart-upload/index.js +0 -6
  97. package/packages/multipart-upload/src/index.vue +0 -73
  98. package/packages/multipart-upload/src/multipart-upload-form.vue +0 -297
  99. package/packages/multipart-upload/src/multipart-upload-list.vue +0 -378
  100. package/packages/organization-input/index.js +0 -6
  101. package/packages/organization-input/src/organization-input.vue +0 -542
  102. package/packages/plugins/export-data-new.js +0 -466
  103. package/packages/plugins/export-data.js +0 -361
  104. package/packages/plugins/index.js +0 -15
  105. package/packages/plugins/public-method.js +0 -43
  106. package/packages/remove-department/index.js +0 -6
  107. package/packages/remove-department/src/remove-department.vue +0 -172
  108. package/packages/remove-department/src/remove-dept-service.js +0 -20
  109. package/packages/remove-user/index.js +0 -6
  110. package/packages/remove-user/src/remove-user-service.js +0 -20
  111. package/packages/remove-user/src/remove-user.vue +0 -195
  112. package/packages/remove-workgroup/index.js +0 -6
  113. package/packages/remove-workgroup/src/remove-workgroup-service.js +0 -20
  114. package/packages/remove-workgroup/src/remove-workgroup.vue +0 -159
  115. package/packages/rich-editor/index.js +0 -7
  116. package/packages/rich-editor/index.vue +0 -278
  117. package/packages/rich-editor/langs/zh-Hans.js +0 -1
  118. package/packages/rich-editor/viewer.vue +0 -103
  119. package/packages/scan-code-input/index.js +0 -6
  120. package/packages/scan-code-input/src/events.js +0 -33
  121. package/packages/scan-code-input/src/scan-code-input-colse.vue +0 -131
  122. package/packages/scan-code-input/src/scan-code-input.vue +0 -116
  123. package/packages/secret-info/index.js +0 -7
  124. package/packages/secret-info/index.vue +0 -90
  125. package/packages/super-grid/index.js +0 -7
  126. package/packages/super-grid/src/apis.js +0 -820
  127. package/packages/super-grid/src/columns-config.vue +0 -335
  128. package/packages/super-grid/src/custom-formatter.js +0 -278
  129. package/packages/super-grid/src/dynamic-input.vue +0 -1279
  130. package/packages/super-grid/src/eventBus.js +0 -2
  131. package/packages/super-grid/src/events.js +0 -55
  132. package/packages/super-grid/src/formValidatorUtil.js +0 -226
  133. package/packages/super-grid/src/formatter.js +0 -181
  134. package/packages/super-grid/src/group-column.vue +0 -100
  135. package/packages/super-grid/src/header-context-menu.vue +0 -87
  136. package/packages/super-grid/src/index-column.vue +0 -51
  137. package/packages/super-grid/src/normal-column.vue +0 -771
  138. package/packages/super-grid/src/public-methods.js +0 -31
  139. package/packages/super-grid/src/row-operation.vue +0 -161
  140. package/packages/super-grid/src/search-button.vue +0 -66
  141. package/packages/super-grid/src/search-condition-input.vue +0 -61
  142. package/packages/super-grid/src/search-condition-list.vue +0 -59
  143. package/packages/super-grid/src/search-form-advancedQuery.vue +0 -653
  144. package/packages/super-grid/src/search-form-dialog.vue +0 -79
  145. package/packages/super-grid/src/search-form-item.vue +0 -404
  146. package/packages/super-grid/src/search-form-number.vue +0 -38
  147. package/packages/super-grid/src/search-form-open.vue +0 -170
  148. package/packages/super-grid/src/search-form-ordinarySearch.vue +0 -196
  149. package/packages/super-grid/src/search-form.vue +0 -642
  150. package/packages/super-grid/src/search-methods.js +0 -448
  151. package/packages/super-grid/src/selection-column.vue +0 -43
  152. package/packages/super-grid/src/store.js +0 -3
  153. package/packages/super-grid/src/super-grid-service.js +0 -593
  154. package/packages/super-grid/src/super-grid.vue +0 -2882
  155. package/packages/super-grid/src/utils.js +0 -762
  156. package/packages/super-grid/src/view-image-dialog.vue +0 -130
  157. package/packages/super-nine-grid/index.js +0 -7
  158. package/packages/super-nine-grid/src/apis.js +0 -103
  159. package/packages/super-nine-grid/src/custom-formatter.js +0 -66
  160. package/packages/super-nine-grid/src/formatter.js +0 -132
  161. package/packages/super-nine-grid/src/search-form-number.vue +0 -38
  162. package/packages/super-nine-grid/src/search-form.vue +0 -430
  163. package/packages/super-nine-grid/src/search-methods.js +0 -134
  164. package/packages/super-nine-grid/src/store.js +0 -3
  165. package/packages/super-nine-grid/src/super-grid-service.js +0 -91
  166. package/packages/super-nine-grid/src/super-nine-grid.vue +0 -872
  167. package/packages/super-nine-grid/src/utils.js +0 -261
  168. package/packages/svg-icon/index.js +0 -6
  169. package/packages/svg-icon/src/svg-icon.vue +0 -43
  170. package/packages/utils/memory-cache-utils.js +0 -90
  171. package/packages/utils/utils.js +0 -152
  172. package/packages/utils/value-set.js +0 -86
  173. package/packages/valid-code/index.js +0 -7
  174. package/packages/valid-code/src/valid-code.vue +0 -95
  175. package/packages/workflow-button/index.js +0 -6
  176. package/packages/workflow-button/src/workflow-button.vue +0 -325
  177. package/packages/workflow-history-list/index.js +0 -6
  178. package/packages/workflow-history-list/src/api.js +0 -7
  179. package/packages/workflow-history-list/src/workflow-history-list.vue +0 -185
  180. package/packages/workgroup-tree/index.js +0 -6
  181. package/packages/workgroup-tree/src/workgroup-tree.vue +0 -76
  182. package/packages/workgroup-tree-inline/index.js +0 -6
  183. package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +0 -317
  184. package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +0 -43
  185. package/packages/workgroup-user-tree/index.js +0 -6
  186. package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +0 -100
  187. package/packages/workgroup-user-tree-inline/index.js +0 -6
  188. package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +0 -163
  189. package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +0 -436
  190. package/packages/year-range-picker/index.js +0 -6
  191. package/packages/year-range-picker/src/year-range-picker.vue +0 -51
  192. package/src/index.js +0 -93
  193. package/src/styles/theme/gray/form-style.scss +0 -41
@@ -1,271 +0,0 @@
1
- <template>
2
- <div>
3
- <el-container style="height: 395px">
4
- <el-header style="font-size: 12px;height: 35px">
5
- <el-autocomplete
6
- v-model="filterText"
7
- :fetch-suggestions="querySearch"
8
- :placeholder="$t('departmentUserTree.pleaseEnterUserInformation')"
9
- size="small"
10
- class="inline-input searchDepartmentUser"
11
- @keyup.enter.native="clickSearch"
12
- @select="handleSelect"
13
- >
14
- <el-button slot="append" icon="el-icon-search" @click="clickSearch" />
15
- </el-autocomplete>
16
- </el-header>
17
- <el-main style="padding: 10px;width: 100%">
18
- <div v-if="!searchValue || searchResult.length === 0" style="padding-top:5px;overflow:auto;width: auto;display: inline-block !important;">
19
- <el-tree
20
- ref="deparmentUserTree"
21
- :props="defaultProps"
22
- :load="loadNode"
23
- lazy
24
- node-key="nodeId"
25
- :render-content="renderContent"
26
- @node-click="handleNodeClick"
27
- />
28
- </div>
29
- <div v-if="searchValue && searchValue.length > 0 && searchResult.length > 0" style="height:100%;overflow: hidden;">
30
- <user-result ref="userResult" :grid-data="searchResult" :height="height" :contain-branch="containBranch" :multiple="false" @selectResult="getSelectUser" @resultRowDblclick="resultRowDblclick" />
31
- </div>
32
- </el-main>
33
- </el-container>
34
- </div>
35
- </template>
36
- <style>
37
- .searchResult {
38
- color:red
39
- }
40
- .inline-select-custom {
41
- width : 100px
42
- }
43
- .inline-input-custom {
44
- width : 98%
45
- }
46
- .searchDepartmentUser {
47
- width: 250px
48
- }
49
- </style>
50
- <script>
51
- import localStorage from '../../../src/utils/local-storage'
52
- import UserResult from './search-result'
53
- import utils from '../../utils/utils'
54
- import departmentUserTreeSingleService from './department-user-tree-single-service'
55
- import memoryCacheUtils from '../../utils/memory-cache-utils'
56
- export default {
57
- name: 'InlineDepartmentUserSingleTree',
58
- components: {
59
- UserResult
60
- },
61
- props: {
62
- // 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
63
- departmentInfo: {
64
- type: Array,
65
- default: null
66
- },
67
- // 弹框的高度
68
- height: {
69
- type: String,
70
- default: '300px'
71
- },
72
- // 是否需要显示虚拟用户
73
- isNeedVirtualUser: {
74
- type: Boolean,
75
- default: false
76
- }
77
- },
78
- data() {
79
- return {
80
- filterText: '',
81
- defaultProps: {
82
- id: 'id',
83
- label: 'showName',
84
- children: 'children',
85
- isLeaf: 'leaf'
86
- },
87
- searchParam: {
88
- userField: null,
89
- searchValue: null,
90
- treeType: 'MAN_DEPARTMENT_TREE',
91
- departmentInfo: null
92
- },
93
- count: 0,
94
- containBranch: false, // 当前租户内是否包含分支机构。获得当前选中用户名称时,如果有分支,则需要将分支名称返回给用户,例如:张三(分支1)
95
- tenantNodeId: -1, // 公司节点的id
96
- searchFields: [], // 查询的用户属性集合
97
- searchField: 'name',
98
- restaurants: [], // 查询的备选值
99
- searchValue: null, // 查询条件
100
- searchResult: [], // 用户的查询结果
101
- searchStoreKey: 'searchDepartmentUser',
102
- tenantInfo: {}, // 公司根节点信息
103
- selectUser: null, // 选择的用户原信息
104
- selectNodeInfo: null, // 封装后的用户信息,即用户结果
105
- notMultipleClickNum: null, // 节点没有双击事件,手动实现双击事件,参数用来记录次数
106
- notMultipleClickNode: null, // 节点没有双击事件,手动实现双击事件,参数用来记录节点
107
- memoryCacheKey: 'DEPARTMENT_USER_MEMORY_KEY',
108
- memoryCacheData: [] // 记忆选择数据, 搜索框获得焦点后,下拉显示最近选中的10个人,倒序排列,最后选中的在最上面显示。
109
- }
110
- },
111
- computed: {
112
- },
113
- watch: {
114
- filterText(val) {
115
- if (!val) {
116
- this.searchValue = val
117
- // 清空查询内容时,重新加载整个树
118
- if (this.departmentInfo && this.departmentInfo.length > 0) {
119
- // 加载指定部门时,展开公司节点
120
- this.loadPointDepartments(this)
121
- } else {
122
- // 加载整个组织结构树时,展开公司节点
123
- this.loadDepartment(this.tenantNodeId, this.tenantNodeId + '')
124
- }
125
- }
126
- }
127
- },
128
- created() {
129
- this.searchFields = this.getSearchUserFields()
130
- },
131
- mounted() {
132
- var searchDepartmentUser = localStorage.getObject(this.searchStoreKey)
133
- if (searchDepartmentUser) {
134
- this.restaurants = searchDepartmentUser
135
- } else {
136
- this.restaurants = []
137
- }
138
- this.getMemoryCacheData('departmentUser')
139
- },
140
- methods: {
141
- ...utils,
142
- ...departmentUserTreeSingleService,
143
- ...memoryCacheUtils,
144
- // selectUser(row, column, event) {
145
- // this.packageSelectResult(row)
146
- // },
147
- handleNodeClick(data, node, nodeTree) {
148
- if (this.isUserNode(data)) {
149
- const user = JSON.parse(data.data)
150
- user.tenantName = this.tenantInfo.tenantName
151
- user.tenantCode = this.tenantInfo.code
152
- // 搜索选中记忆
153
- this.setMemoryCacheData(user, 'departmentUser')
154
- // 点击的是用户节点,并且是单选树时,点击部门节点直接关闭弹框
155
- this.packageSelectResult(user)
156
- if (this.notMultipleClickNode && this.notMultipleClickNode.id === node.id) {
157
- this.notMultipleClickNum++
158
- // 表示第二次点击
159
- // 判断次数
160
- if (this.notMultipleClickNum === 2) {
161
- this.notMultipleClickNum = 0
162
- this.notMultipleClickNode = null
163
- // 关闭弹窗
164
- this.$emit('result', this.selectNodeInfo)
165
- }
166
- } else {
167
- this.notMultipleClickNode = node
168
- this.notMultipleClickNum = 1
169
- }
170
- const that = this
171
- setTimeout(function() {
172
- that.notMultipleClickNum = 0
173
- that.notMultipleClickNode = null
174
- }, 300)
175
- }
176
- },
177
- packageSelectResult(user) {
178
- let name = user.name
179
- if (user.enName && user.enName.trim() !== '') {
180
- name = name + '(' + user.enName + ')'
181
- }
182
- if (this.containBranch && user.subCompanyName) {
183
- // 如果包含分支机构,则拼接分支机构名称
184
- // name = name + '(' + user.subCompanyName + ')'
185
- }
186
- const selectNodeInfo = {
187
- id: user.id,
188
- name: name,
189
- zhName: user.name,
190
- loginName: user.loginName,
191
- email: user.email,
192
- telephone: user.telephone,
193
- containBranch: this.containBranch,
194
- user: user,
195
- enName: user.enName,
196
- subCompanyName: user.subCompanyName
197
- }
198
- // 表示是勾选单选按钮或 选中树节点
199
- this.selectNodeInfo = selectNodeInfo
200
- },
201
- isUserNode(data) {
202
- // 当前节点不是公司节点,节点类型是用户类型时,表示点击的是用户节点
203
- return data.id !== this.tenantNodeId && data.nodeType && data.nodeType === 'USER'
204
- },
205
- confirmSelectUser() {
206
- if (this.selectNodeInfo) {
207
- this.$emit('result', this.selectNodeInfo)
208
- } else {
209
- this.$alert(this.$t('imatrixUIMessage.pleaseSelectPersonnel'), this.$t('imatrixUIMessage.tips'), {
210
- confirmButtonText: this.$t('imatrixUIPublicModel.sure')
211
- })
212
- }
213
- },
214
- // 是否选中了公司节点
215
- isSelectTenantNode(dataId) {
216
- return dataId === this.tenantNodeId && (!this.departmentInfo || this.departmentInfo.length === 0)
217
- },
218
- // 初始化树 或 点击三角展开节点时动态加载子节点
219
- loadNode(node, resolve) {
220
- var parentId = 0
221
- var parentNodeId = '0'
222
- if (node.level === 0) {
223
- // 表示初始化树
224
- parentId = 0
225
- parentNodeId = parentId + ''
226
- } else {
227
- parentId = node.data.id
228
- parentNodeId = node.data.nodeId
229
- }
230
- var checkedKeys = []
231
- if (this.$refs.deparmentUserTree) {
232
- checkedKeys = this.$refs.deparmentUserTree.getCheckedKeys()
233
- }
234
- // 初始化部门人员树
235
- this.initLoadDepartment(parentId, node, resolve, checkedKeys, parentNodeId)
236
- },
237
- renderContent(h, { node, data, store }) {
238
- var className
239
- if (node.data.id === -1 || node.data.branch) {
240
- // node.id ===-1表示公司节点,node.branch表示是分支机构节点
241
- className = 'el-icon-menu'
242
- } else if (node.data.id === -2 || node.data.id === -3) {
243
- // node.id ===-2表示集团公司无部门用户节点,node.id ===-3表示是分支机构无部门用户节点
244
- className = 'el-icon-tickets'
245
- } else if (node.data.nodeType === 'USER') {
246
- className = 'el-icon-user'
247
- } else {
248
- className = 'el-icon-date'
249
- }
250
- return (
251
- <span>
252
- <i class={className}></i>
253
- <span title={node.label}>{node.label}</span>
254
- </span>
255
- )
256
- },
257
- getSelectUser(selectUser) {
258
- // console.log('getSelectUser==', selectUser)
259
- this.selectUser = selectUser
260
- // 搜索选中记忆
261
- this.setMemoryCacheData(selectUser, 'departmentUser')
262
- // true参数表示是否是勾选单选框,是勾选单选框时不关闭弹框
263
- this.packageSelectResult(selectUser)
264
- },
265
- resultRowDblclick(user) {
266
- this.packageSelectResult(user)
267
- this.$emit('result', this.selectNodeInfo)
268
- }
269
- }
270
- }
271
- </script>
@@ -1,79 +0,0 @@
1
- <template>
2
- <div>
3
- <inline-department-user-multi-tree
4
- v-if="multiple"
5
- ref="userTree"
6
- :height="height"
7
- :department-info="departmentInfo"
8
- :select-user-info="selectUserInfo"
9
- :search-field="searchField"
10
- :separator="separator"
11
- @result="result"
12
- />
13
- <inline-department-user-single-tree v-if="!multiple" ref="userTree" :height="height" :department-info="departmentInfo" @result="result" />
14
- </div>
15
- </template>
16
- <script>
17
- import InlineDepartmentUserSingleTree from './department-user-single-tree-inline'
18
- import InlineDepartmentUserMultiTree from './department-user-multiple-tree-inline'
19
- export default {
20
- name: 'InlineDepartmentUserTree',
21
- components: {
22
- InlineDepartmentUserSingleTree,
23
- InlineDepartmentUserMultiTree
24
- },
25
- props: {
26
- // 是否是多选树,默认是true
27
- multiple: {
28
- type: Boolean,
29
- default: true
30
- },
31
- // 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
32
- departmentInfo: {
33
- type: Array,
34
- default: null
35
- },
36
- // 弹框的高度
37
- height: {
38
- type: String,
39
- default: '300px'
40
- },
41
- // 是否需要显示虚拟用户
42
- isNeedVirtualUser: {
43
- type: Boolean,
44
- default: false
45
- },
46
- // 多选用户树时,已选择用户id或登录名集合,多个之间以逗号隔开
47
- selectUserInfo: {
48
- type: [String, Number],
49
- default: null
50
- },
51
- // 移除用户时,用户属性名称:id、loginName、email、telephone,默认是loginName
52
- searchField: {
53
- type: String,
54
- default: 'loginName'
55
- },
56
- // 多选树时结果之间的分隔符,默认是逗号分隔
57
- separator: {
58
- type: String,
59
- default: ','
60
- }
61
-
62
- },
63
- data() {
64
- return {
65
- selectNodeInfo: null // 单选时,选择的用户信息
66
- }
67
- },
68
- methods: {
69
- result(selectNodeInfo) {
70
- this.selectNodeInfo = selectNodeInfo
71
- this.$emit('result', selectNodeInfo)
72
- },
73
- // 嵌入树,多选时,点击确定时调用的方法
74
- confirmSelectUser() {
75
- this.$refs.userTree.confirmSelectUser()
76
- }
77
- }
78
- }
79
- </script>
@@ -1,248 +0,0 @@
1
- import Vue from 'vue'
2
- import localStorage from '../../../src/utils/local-storage'
3
- import { getI18n } from '../../../src/utils/util'
4
- const departmentUserTreeMultiService = {
5
- // 后台查询部门,并拼接树节点
6
- filterAppendNodes(value) {
7
- this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/search-users', this.searchParam).then(result => {
8
- if (result) {
9
- if (result.length === 0) {
10
- this.searchResult = []
11
- this.$message({
12
- showClose: true,
13
- type: 'error',
14
- message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
15
- })
16
- return
17
- }
18
- this.searchResult = result
19
- } else {
20
- if (result.length === 0) {
21
- this.$message({
22
- showClose: true,
23
- type: 'error',
24
- message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
25
- })
26
- return
27
- }
28
- }
29
- })
30
- },
31
- querySearch(queryString, cb) {
32
- if (!this.filterText && this.filterText.length === 0) {
33
- this.memorySearch(queryString, cb)
34
- } else {
35
- this.search(this.filterText)
36
- cb([])
37
- }
38
- },
39
- handleSelect(item) {
40
- // this.handleSelectUtil(item, localStorage)
41
- // 查询最新用户信息替换,缓存为历史数据 数据库可能发生变化
42
- this.$http.get(Vue.prototype.baseAPI + '/api/users?loginName=' + item.loginName).then(userDTO => {
43
- if (userDTO !== null) {
44
- for (const dtoKey in userDTO) {
45
- if (item.hasOwnProperty(dtoKey)) {
46
- item[dtoKey] = userDTO[dtoKey]
47
- }
48
- }
49
- }
50
- this.filterText = ''
51
- this.searchValue = ''
52
- this.selectUser(-1, item)
53
- this.setMemoryCacheData(item, 'departmentUser')
54
- })
55
- },
56
- search(value) {
57
- this.searchValue = value
58
- let mySearchValue = value
59
- if (mySearchValue) {
60
- mySearchValue = mySearchValue.trim()
61
- }
62
- this.searchParam.searchValue = mySearchValue
63
- this.searchParam.departmentInfo = this.departmentInfo
64
- // this.searchParam.userField = this.searchField
65
- // 后台查询部门,并拼接树节点
66
- this.filterAppendNodes(value)
67
- },
68
- // 点击查询按钮调用的方法
69
- clickSearch() {
70
- this.selectNodeInfo = null
71
- this.storeSeachValue(localStorage, this.searchStoreKey, this.filterText)
72
- this.search(this.filterText)
73
- },
74
- // 选中非叶子类型的部门节点时,首次加载该节点的子节点,需要动态加载该部门下的用户节点及子部门节点,并展开该部门,且选中用户节点
75
- dynamicCheckedUserNodes(data) {
76
- var param = {
77
- parentId: data.id,
78
- branchId: data.branchId,
79
- needVirtualUser: this.isNeedVirtualUser
80
- }
81
- this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/department-users', param).then(result => {
82
- // 更新当前点击的节点的子节点
83
- this.$refs.deparmentUserTree.updateKeyChildren(data.nodeId, result)
84
- this.$refs.deparmentUserTree.store.nodesMap[data.nodeId].expanded = true
85
- this.staticCheckedUserNodes(data)
86
- })
87
- },
88
- // 初始化部门人员树
89
- initLoadDepartment(parentId, node, resolve, checkedKeys, parentNodeId) {
90
- var children = []
91
- if (node.data && node.data.children) {
92
- children = node.data.children
93
- }
94
- if (children && children.length > 0) {
95
- // 表示加载过该父节点的子节点,只需重新更新一下
96
- resolve(children)
97
- // 表示当前展开的节点是选中状态,则应保持其选中状态,并选中其子节点
98
- if (checkedKeys && checkedKeys.indexOf(parentNodeId) > -1) {
99
- // 点击部门名称前的三角标识展开节点时,保持当前节点的选中状态
100
- // 表示当前展开的节点是选中状态,则应保持其选中状态,并选中其子节点
101
- this.checkedChildrenUserNodes(node.data, node.data.children)
102
- }
103
- } else {
104
- // 表示没有加载过该父节点的子节点集合时
105
- const param = {
106
- parentId: parentId,
107
- needVirtualUser: this.isNeedVirtualUser
108
- }
109
- if (node.data) {
110
- param.branchId = node.data.branchId
111
- }
112
- this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/department-users', param).then(data => {
113
- resolve(data)
114
- // 更新当前点击的节点的子节点,必须加该方法,否则会导致子节点无法选中
115
- this.$refs.deparmentUserTree.updateKeyChildren(parentNodeId, data)
116
- if (parentId === 0) {
117
- // 初始化树时,展开公司节点
118
- const tenantData = data[0].data
119
- this.tenantInfo = JSON.parse(tenantData)
120
- this.containBranch = data[0].containBranch
121
- if (this.departmentInfo && this.departmentInfo.length > 0) {
122
- // 加载指定部门时,展开公司节点
123
- this.loadPointDepartments()
124
- } else {
125
- // 加载整个组织结构树时,展开公司节点
126
- this.loadDepartment(this.tenantNodeId, this.tenantNodeId + '')
127
- }
128
- }
129
- if (this.isClickNode) {
130
- // 点击当前节点时,加载树节点时
131
- // 注意不是点击复选框时
132
- this.isClickNode = false
133
- this.staticCheckedUserNodes(node.data)
134
- } else {
135
- // 表示是点击三角展开节点时
136
- if (checkedKeys && checkedKeys.indexOf(parentNodeId) > -1) {
137
- // 点击部门名称前的三角标识展开节点时,保持当前节点的选中状态
138
- // 表示当前展开的节点是选中状态,则应保持其选中状态,并选中其子节点
139
- this.checkedChildrenUserNodes(node.data, node.data.children)
140
- }
141
- }
142
- })
143
- }
144
- },
145
- // 加载当前节点的子节点
146
- loadDepartment(parentId, parentNodeId, isSearch, searchValue) {
147
- const param = {
148
- parentId: parentId,
149
- needVirtualUser: this.isNeedVirtualUser
150
- }
151
- this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/department-users', param).then(children => {
152
- this.$refs.deparmentUserTree.updateKeyChildren(parentNodeId, children)
153
- if (this.$refs.deparmentUserTree.store.nodesMap[parentNodeId]) {
154
- this.$refs.deparmentUserTree.store.nodesMap[parentNodeId].expanded = true
155
- }
156
- if (isSearch) {
157
- // 查询时处理
158
- if (this.allExpandNodeIds.indexOf(parentNodeId) === -1) {
159
- // allExpandNodeIds集合中是否包含当前parentId节点id
160
- this.allExpandNodeIds.push(parentNodeId)
161
- }
162
- if (this.allExpandNodeIds.length === this.allSearchNodeIds.length) {
163
- // 表示所有节点已展开,执行树的过滤方法
164
- this.$refs.deparmentUserTree.filter(searchValue)
165
- this.allExpandNodeIds = []
166
- this.allSearchNodeIds = []
167
- }
168
- }
169
- })
170
- },
171
- // 加载指定部门节点
172
- loadPointDepartments() {
173
- this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/point-department-users', this.departmentInfo).then(children => {
174
- this.$refs.deparmentUserTree.updateKeyChildren(this.tenantNodeId, children)
175
- if (this.$refs.deparmentUserTree.store.nodesMap[this.tenantNodeId]) {
176
- this.$refs.deparmentUserTree.store.nodesMap[this.tenantNodeId].expanded = true
177
- }
178
- })
179
- },
180
- getChildrenDepartmentUsers(childrenDepartmentIds) {
181
- return new Promise((resolve, reject) => {
182
- this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/user-in-departments', childrenDepartmentIds).then(users => {
183
- resolve(users)
184
- })
185
- })
186
- },
187
- // 根据指定用户信息获得用户集合
188
- getSelectUsers(searchField, selectUserInfo, separator) {
189
- return new Promise((resolve, reject) => {
190
- if (!searchField) {
191
- resolve([])
192
- } else if (!selectUserInfo) {
193
- resolve([])
194
- } else {
195
- Vue.prototype.$http.get(Vue.prototype.baseAPI + '/component/organization-trees/select-users?searchField=' + searchField + '&selectUserInfo=' + selectUserInfo + '&separator=' + separator).then(users => {
196
- resolve(users)
197
- }).catch(error => {
198
- reject(error)
199
- })
200
- }
201
- })
202
- },
203
- // 部门人员树选中了组织结构树的根节点
204
- packageAllUser() {
205
- // 表示集合中不存在该用户,则封装该用户
206
- const tenantNodeId = -1
207
- var allUser = {
208
- id: tenantNodeId,
209
- name: '所有用户'
210
- }
211
- return allUser
212
- },
213
- // 工作组人员树选中了组织结构树的根节点
214
- packageAllWgUser() {
215
- // 表示集合中不存在该用户,则封装该用户
216
- const tenantNodeId = -1
217
- var allUser = {
218
- id: tenantNodeId,
219
- name: '所有工作组人员'
220
- }
221
- return allUser
222
- },
223
- initSelectUsers(searchField, selectUserInfo, separator) {
224
- return new Promise((resolve, reject) => {
225
- const selectDepts = []
226
- if (selectUserInfo) {
227
- if (selectUserInfo === '所有用户') {
228
- // 表示已选择所有用户
229
- selectDepts.push(this.packageAllUser())
230
- resolve(selectDepts)
231
- } else if (selectUserInfo === '所有工作组人员') {
232
- selectDepts.push(this.packageAllWgUser())
233
- resolve(selectDepts)
234
- } else {
235
- // 表示不是选择的所有用户
236
- this.getSelectUsers(searchField, selectUserInfo, separator).then(users => {
237
- resolve(users)
238
- }).catch(error => {
239
- reject(error)
240
- })
241
- }
242
- } else {
243
- resolve(selectDepts)
244
- }
245
- })
246
- }
247
- }
248
- export default departmentUserTreeMultiService