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