imatrix-ui 2.9.18-dw → 2.9.19-boe02

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 (199) hide show
  1. package/lib/super-ui.css +1 -1
  2. package/lib/super-ui.umd.min.js +5 -35
  3. package/package.json +4 -3
  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 +25 -6
  8. package/src/i18n/langs/en.js +27 -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/input.scss +4 -1
  26. package/src/styles/theme/dark-blue/message.scss +8 -0
  27. package/src/styles/theme/dark-blue/radio.scss +13 -0
  28. package/src/styles/theme/dark-blue/scrollbar-style.scss +8 -3
  29. package/src/styles/theme/dark-blue/sidebar.scss +7 -37
  30. package/src/styles/theme/dark-blue/tab.scss +4 -1
  31. package/src/styles/theme/dark-blue/table.scss +2 -2
  32. package/src/styles/theme/dark-blue/tree.scss +35 -10
  33. package/src/styles/theme/gray/card-style.scss +13 -1
  34. package/src/styles/theme/gray/font-style.scss +38 -0
  35. package/src/styles/theme/gray/index.scss +13 -25
  36. package/src/styles/theme/gray/scrollbar-style.scss +37 -0
  37. package/src/styles/theme/gray/sidebar.scss +7 -14
  38. package/src/utils/auth-api.js +47 -1
  39. package/src/utils/calculator/calculator-util.js +14 -0
  40. package/src/utils/common-util.js +22 -81
  41. package/src/utils/jump-page-utils.js +12 -9
  42. package/src/utils/preview-util.js +32 -0
  43. package/src/utils/range-selector.js +185 -0
  44. package/src/utils/request.js +20 -12
  45. package/src/utils/util.js +13 -11
  46. package/src/utils/workflow-util.js +3 -0
  47. package/src/views/dsc-component/Sidebar/Item.vue +7 -5
  48. package/src/views/dsc-component/Sidebar/SidebarItem.vue +2 -3
  49. package/src/views/dsc-component/Sidebar/index.vue +14 -22
  50. package/src/views/dsc-component/tabs/tab-content.vue +8 -9
  51. package/src/views/layout/EmptyLayout.vue +4 -1
  52. package/src/views/layout/NewLayout.vue +6 -65
  53. package/src/views/layout/components/AppMain.vue +2 -1
  54. package/src/views/layout/components/Breadcrumb/index.vue +1 -1
  55. package/src/views/layout/components/Menubar/Item.vue +23 -7
  56. package/src/views/layout/components/Menubar/Link.vue +11 -2
  57. package/src/views/layout/components/Menubar/SidebarItem.vue +50 -7
  58. package/src/views/layout/components/Menubar/index.vue +51 -16
  59. package/src/views/layout/components/Sidebar/index.vue +2 -2
  60. package/src/views/layout/components/tabs/tab-content.vue +162 -0
  61. package/src/views/layout/tab-content-iframe-index.vue +31 -0
  62. package/src/views/layout/tab-content-index.vue +84 -0
  63. package/src/views/login/index.vue +1 -1
  64. package/packages/breadcrumb/index.js +0 -6
  65. package/packages/breadcrumb/src/breadcrumb.vue +0 -71
  66. package/packages/department-tree/index.js +0 -6
  67. package/packages/department-tree/src/department-tree.vue +0 -108
  68. package/packages/department-tree-inline/index.js +0 -6
  69. package/packages/department-tree-inline/src/department-multi-tree-inline.vue +0 -411
  70. package/packages/department-tree-inline/src/department-single-tree-inline.vue +0 -293
  71. package/packages/department-tree-inline/src/department-tree-inline.vue +0 -86
  72. package/packages/department-tree-inline/src/department-tree-service.js +0 -275
  73. package/packages/department-tree-inline/src/search-result.vue +0 -176
  74. package/packages/department-user-tree/index.js +0 -6
  75. package/packages/department-user-tree/src/department-user-multiple-tree.vue +0 -116
  76. package/packages/department-user-tree/src/department-user-single-tree.vue +0 -76
  77. package/packages/department-user-tree/src/department-user-tree.vue +0 -101
  78. package/packages/department-user-tree-inline/index.js +0 -6
  79. package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +0 -639
  80. package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +0 -274
  81. package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +0 -79
  82. package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +0 -248
  83. package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -142
  84. package/packages/department-user-tree-inline/src/search-result.vue +0 -197
  85. package/packages/directives/prevent-reclick.js +0 -19
  86. package/packages/dynamic-source-select/index.js +0 -6
  87. package/packages/dynamic-source-select/src/dynamic-source-select-service.js +0 -70
  88. package/packages/dynamic-source-select/src/dynamic-source-select.vue +0 -440
  89. package/packages/dynamic-source-select/src/events.js +0 -55
  90. package/packages/fs-preview/index.js +0 -6
  91. package/packages/fs-preview/src/fs-preview.vue +0 -226
  92. package/packages/fs-upload/index.js +0 -6
  93. package/packages/fs-upload/src/fs-upload-multi.vue +0 -420
  94. package/packages/fs-upload/src/fs-upload-single.vue +0 -312
  95. package/packages/fs-upload/src/fs-upload.vue +0 -189
  96. package/packages/fs-upload/src/see-big-picture.vue +0 -55
  97. package/packages/fs-upload-list/index.js +0 -6
  98. package/packages/fs-upload-list/src/fs-upload-list.vue +0 -287
  99. package/packages/hamburger/index.js +0 -6
  100. package/packages/hamburger/src/hamburger.vue +0 -38
  101. package/packages/index.js +0 -121
  102. package/packages/multipart-upload/index.js +0 -6
  103. package/packages/multipart-upload/src/index.vue +0 -73
  104. package/packages/multipart-upload/src/multipart-upload-form.vue +0 -297
  105. package/packages/multipart-upload/src/multipart-upload-list.vue +0 -378
  106. package/packages/organization-input/index.js +0 -6
  107. package/packages/organization-input/src/organization-input.vue +0 -542
  108. package/packages/plugins/export-data-new.js +0 -466
  109. package/packages/plugins/export-data.js +0 -361
  110. package/packages/plugins/index.js +0 -15
  111. package/packages/plugins/public-method.js +0 -43
  112. package/packages/remove-department/index.js +0 -6
  113. package/packages/remove-department/src/remove-department.vue +0 -172
  114. package/packages/remove-department/src/remove-dept-service.js +0 -20
  115. package/packages/remove-user/index.js +0 -6
  116. package/packages/remove-user/src/remove-user-service.js +0 -20
  117. package/packages/remove-user/src/remove-user.vue +0 -195
  118. package/packages/remove-workgroup/index.js +0 -6
  119. package/packages/remove-workgroup/src/remove-workgroup-service.js +0 -20
  120. package/packages/remove-workgroup/src/remove-workgroup.vue +0 -159
  121. package/packages/rich-editor/index.js +0 -7
  122. package/packages/rich-editor/index.vue +0 -278
  123. package/packages/rich-editor/langs/zh-Hans.js +0 -1
  124. package/packages/rich-editor/viewer.vue +0 -103
  125. package/packages/scan-code-input/index.js +0 -6
  126. package/packages/scan-code-input/src/events.js +0 -33
  127. package/packages/scan-code-input/src/scan-code-input-colse.vue +0 -131
  128. package/packages/scan-code-input/src/scan-code-input.vue +0 -116
  129. package/packages/secret-info/index.js +0 -7
  130. package/packages/secret-info/index.vue +0 -90
  131. package/packages/super-grid/index.js +0 -7
  132. package/packages/super-grid/src/apis.js +0 -820
  133. package/packages/super-grid/src/columns-config.vue +0 -335
  134. package/packages/super-grid/src/custom-formatter.js +0 -278
  135. package/packages/super-grid/src/dynamic-input.vue +0 -1279
  136. package/packages/super-grid/src/eventBus.js +0 -2
  137. package/packages/super-grid/src/events.js +0 -55
  138. package/packages/super-grid/src/formValidatorUtil.js +0 -226
  139. package/packages/super-grid/src/formatter.js +0 -181
  140. package/packages/super-grid/src/group-column.vue +0 -100
  141. package/packages/super-grid/src/header-context-menu.vue +0 -87
  142. package/packages/super-grid/src/index-column.vue +0 -51
  143. package/packages/super-grid/src/normal-column.vue +0 -775
  144. package/packages/super-grid/src/public-methods.js +0 -31
  145. package/packages/super-grid/src/row-operation.vue +0 -161
  146. package/packages/super-grid/src/search-button.vue +0 -66
  147. package/packages/super-grid/src/search-condition-input.vue +0 -61
  148. package/packages/super-grid/src/search-condition-list.vue +0 -59
  149. package/packages/super-grid/src/search-form-advancedQuery.vue +0 -654
  150. package/packages/super-grid/src/search-form-dialog.vue +0 -79
  151. package/packages/super-grid/src/search-form-item.vue +0 -405
  152. package/packages/super-grid/src/search-form-number.vue +0 -38
  153. package/packages/super-grid/src/search-form-open.vue +0 -170
  154. package/packages/super-grid/src/search-form-ordinarySearch.vue +0 -196
  155. package/packages/super-grid/src/search-form.vue +0 -642
  156. package/packages/super-grid/src/search-methods.js +0 -448
  157. package/packages/super-grid/src/selection-column.vue +0 -43
  158. package/packages/super-grid/src/store.js +0 -3
  159. package/packages/super-grid/src/super-grid-service.js +0 -593
  160. package/packages/super-grid/src/super-grid.vue +0 -2873
  161. package/packages/super-grid/src/utils.js +0 -772
  162. package/packages/super-grid/src/view-image-dialog.vue +0 -130
  163. package/packages/super-nine-grid/index.js +0 -7
  164. package/packages/super-nine-grid/src/apis.js +0 -103
  165. package/packages/super-nine-grid/src/custom-formatter.js +0 -66
  166. package/packages/super-nine-grid/src/formatter.js +0 -132
  167. package/packages/super-nine-grid/src/search-form-number.vue +0 -38
  168. package/packages/super-nine-grid/src/search-form.vue +0 -430
  169. package/packages/super-nine-grid/src/search-methods.js +0 -134
  170. package/packages/super-nine-grid/src/store.js +0 -3
  171. package/packages/super-nine-grid/src/super-grid-service.js +0 -91
  172. package/packages/super-nine-grid/src/super-nine-grid.vue +0 -872
  173. package/packages/super-nine-grid/src/utils.js +0 -261
  174. package/packages/svg-icon/index.js +0 -6
  175. package/packages/svg-icon/src/svg-icon.vue +0 -43
  176. package/packages/utils/memory-cache-utils.js +0 -90
  177. package/packages/utils/utils.js +0 -152
  178. package/packages/utils/value-set.js +0 -86
  179. package/packages/valid-code/index.js +0 -7
  180. package/packages/valid-code/src/valid-code.vue +0 -95
  181. package/packages/workflow-button/index.js +0 -6
  182. package/packages/workflow-button/src/workflow-button.vue +0 -325
  183. package/packages/workflow-history-list/index.js +0 -6
  184. package/packages/workflow-history-list/src/api.js +0 -7
  185. package/packages/workflow-history-list/src/workflow-history-list.vue +0 -185
  186. package/packages/workgroup-tree/index.js +0 -6
  187. package/packages/workgroup-tree/src/workgroup-tree.vue +0 -76
  188. package/packages/workgroup-tree-inline/index.js +0 -6
  189. package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +0 -317
  190. package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +0 -43
  191. package/packages/workgroup-user-tree/index.js +0 -6
  192. package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +0 -100
  193. package/packages/workgroup-user-tree-inline/index.js +0 -6
  194. package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +0 -163
  195. package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +0 -436
  196. package/packages/year-range-picker/index.js +0 -6
  197. package/packages/year-range-picker/src/year-range-picker.vue +0 -51
  198. package/src/index.js +0 -93
  199. package/src/styles/theme/gray/form-style.scss +0 -41
@@ -1,274 +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
- .el-autocomplete-suggestion.el-popper {
50
- min-width: 300px;
51
- }
52
- </style>
53
- <script>
54
- import localStorage from '../../../src/utils/local-storage'
55
- import UserResult from './search-result'
56
- import utils from '../../utils/utils'
57
- import departmentUserTreeSingleService from './department-user-tree-single-service'
58
- import memoryCacheUtils from '../../utils/memory-cache-utils'
59
- export default {
60
- name: 'InlineDepartmentUserSingleTree',
61
- components: {
62
- UserResult
63
- },
64
- props: {
65
- // 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
66
- departmentInfo: {
67
- type: Array,
68
- default: null
69
- },
70
- // 弹框的高度
71
- height: {
72
- type: String,
73
- default: '300px'
74
- },
75
- // 是否需要显示虚拟用户
76
- isNeedVirtualUser: {
77
- type: Boolean,
78
- default: false
79
- }
80
- },
81
- data() {
82
- return {
83
- filterText: '',
84
- defaultProps: {
85
- id: 'id',
86
- label: 'showName',
87
- children: 'children',
88
- isLeaf: 'leaf'
89
- },
90
- searchParam: {
91
- userField: null,
92
- searchValue: null,
93
- treeType: 'MAN_DEPARTMENT_TREE',
94
- departmentInfo: null
95
- },
96
- count: 0,
97
- containBranch: false, // 当前租户内是否包含分支机构。获得当前选中用户名称时,如果有分支,则需要将分支名称返回给用户,例如:张三(分支1)
98
- tenantNodeId: -1, // 公司节点的id
99
- searchFields: [], // 查询的用户属性集合
100
- searchField: 'name',
101
- restaurants: [], // 查询的备选值
102
- searchValue: null, // 查询条件
103
- searchResult: [], // 用户的查询结果
104
- searchStoreKey: 'searchDepartmentUser',
105
- tenantInfo: {}, // 公司根节点信息
106
- selectUser: null, // 选择的用户原信息
107
- selectNodeInfo: null, // 封装后的用户信息,即用户结果
108
- notMultipleClickNum: null, // 节点没有双击事件,手动实现双击事件,参数用来记录次数
109
- notMultipleClickNode: null, // 节点没有双击事件,手动实现双击事件,参数用来记录节点
110
- memoryCacheKey: 'DEPARTMENT_USER_MEMORY_KEY',
111
- memoryCacheData: [] // 记忆选择数据, 搜索框获得焦点后,下拉显示最近选中的10个人,倒序排列,最后选中的在最上面显示。
112
- }
113
- },
114
- computed: {
115
- },
116
- watch: {
117
- filterText(val) {
118
- if (!val) {
119
- this.searchValue = val
120
- // 清空查询内容时,重新加载整个树
121
- if (this.departmentInfo && this.departmentInfo.length > 0) {
122
- // 加载指定部门时,展开公司节点
123
- this.loadPointDepartments(this)
124
- } else {
125
- // 加载整个组织结构树时,展开公司节点
126
- this.loadDepartment(this.tenantNodeId, this.tenantNodeId + '')
127
- }
128
- }
129
- }
130
- },
131
- created() {
132
- this.searchFields = this.getSearchUserFields()
133
- },
134
- mounted() {
135
- var searchDepartmentUser = localStorage.getObject(this.searchStoreKey)
136
- if (searchDepartmentUser) {
137
- this.restaurants = searchDepartmentUser
138
- } else {
139
- this.restaurants = []
140
- }
141
- this.getMemoryCacheData('departmentUser')
142
- },
143
- methods: {
144
- ...utils,
145
- ...departmentUserTreeSingleService,
146
- ...memoryCacheUtils,
147
- // selectUser(row, column, event) {
148
- // this.packageSelectResult(row)
149
- // },
150
- handleNodeClick(data, node, nodeTree) {
151
- if (this.isUserNode(data)) {
152
- const user = JSON.parse(data.data)
153
- user.tenantName = this.tenantInfo.tenantName
154
- user.tenantCode = this.tenantInfo.code
155
- // 搜索选中记忆
156
- this.setMemoryCacheData(user, 'departmentUser')
157
- // 点击的是用户节点,并且是单选树时,点击部门节点直接关闭弹框
158
- this.packageSelectResult(user)
159
- if (this.notMultipleClickNode && this.notMultipleClickNode.id === node.id) {
160
- this.notMultipleClickNum++
161
- // 表示第二次点击
162
- // 判断次数
163
- if (this.notMultipleClickNum === 2) {
164
- this.notMultipleClickNum = 0
165
- this.notMultipleClickNode = null
166
- // 关闭弹窗
167
- this.$emit('result', this.selectNodeInfo)
168
- }
169
- } else {
170
- this.notMultipleClickNode = node
171
- this.notMultipleClickNum = 1
172
- }
173
- const that = this
174
- setTimeout(function() {
175
- that.notMultipleClickNum = 0
176
- that.notMultipleClickNode = null
177
- }, 300)
178
- }
179
- },
180
- packageSelectResult(user) {
181
- let name = user.name
182
- if (user.enName && user.enName.trim() !== '') {
183
- name = name + '(' + user.enName + ')'
184
- }
185
- if (this.containBranch && user.subCompanyName) {
186
- // 如果包含分支机构,则拼接分支机构名称
187
- // name = name + '(' + user.subCompanyName + ')'
188
- }
189
- const selectNodeInfo = {
190
- id: user.id,
191
- name: name,
192
- zhName: user.name,
193
- loginName: user.loginName,
194
- email: user.email,
195
- telephone: user.telephone,
196
- containBranch: this.containBranch,
197
- user: user,
198
- enName: user.enName,
199
- subCompanyName: user.subCompanyName
200
- }
201
- // 表示是勾选单选按钮或 选中树节点
202
- this.selectNodeInfo = selectNodeInfo
203
- },
204
- isUserNode(data) {
205
- // 当前节点不是公司节点,节点类型是用户类型时,表示点击的是用户节点
206
- return data.id !== this.tenantNodeId && data.nodeType && data.nodeType === 'USER'
207
- },
208
- confirmSelectUser() {
209
- if (this.selectNodeInfo) {
210
- this.$emit('result', this.selectNodeInfo)
211
- } else {
212
- this.$alert(this.$t('imatrixUIMessage.pleaseSelectPersonnel'), this.$t('imatrixUIMessage.tips'), {
213
- confirmButtonText: this.$t('imatrixUIPublicModel.sure')
214
- })
215
- }
216
- },
217
- // 是否选中了公司节点
218
- isSelectTenantNode(dataId) {
219
- return dataId === this.tenantNodeId && (!this.departmentInfo || this.departmentInfo.length === 0)
220
- },
221
- // 初始化树 或 点击三角展开节点时动态加载子节点
222
- loadNode(node, resolve) {
223
- var parentId = 0
224
- var parentNodeId = '0'
225
- if (node.level === 0) {
226
- // 表示初始化树
227
- parentId = 0
228
- parentNodeId = parentId + ''
229
- } else {
230
- parentId = node.data.id
231
- parentNodeId = node.data.nodeId
232
- }
233
- var checkedKeys = []
234
- if (this.$refs.deparmentUserTree) {
235
- checkedKeys = this.$refs.deparmentUserTree.getCheckedKeys()
236
- }
237
- // 初始化部门人员树
238
- this.initLoadDepartment(parentId, node, resolve, checkedKeys, parentNodeId)
239
- },
240
- renderContent(h, { node, data, store }) {
241
- var className
242
- if (node.data.id === -1 || node.data.branch) {
243
- // node.id ===-1表示公司节点,node.branch表示是分支机构节点
244
- className = 'el-icon-menu'
245
- } else if (node.data.id === -2 || node.data.id === -3) {
246
- // node.id ===-2表示集团公司无部门用户节点,node.id ===-3表示是分支机构无部门用户节点
247
- className = 'el-icon-tickets'
248
- } else if (node.data.nodeType === 'USER') {
249
- className = 'el-icon-user'
250
- } else {
251
- className = 'el-icon-date'
252
- }
253
- return (
254
- <span>
255
- <i class={className}></i>
256
- <span title={node.label}>{node.label}</span>
257
- </span>
258
- )
259
- },
260
- getSelectUser(selectUser) {
261
- // console.log('getSelectUser==', selectUser)
262
- this.selectUser = selectUser
263
- // 搜索选中记忆
264
- this.setMemoryCacheData(selectUser, 'departmentUser')
265
- // true参数表示是否是勾选单选框,是勾选单选框时不关闭弹框
266
- this.packageSelectResult(selectUser)
267
- },
268
- resultRowDblclick(user) {
269
- this.packageSelectResult(user)
270
- this.$emit('result', this.selectNodeInfo)
271
- }
272
- }
273
- }
274
- </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