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,290 +0,0 @@
1
- <template>
2
- <div>
3
- <el-container style="height: 395px">
4
- <el-header style="text-align: right; font-size: 12px;height: 35px">
5
- <el-autocomplete
6
- v-model="filterText"
7
- size="small"
8
- class="inline-input inline-input-custom"
9
- :fetch-suggestions="querySearch"
10
- :placeholder="$t('departmentTreeInline.pleaseEnterDepartmentName')"
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">
18
- <div v-if="!searchValue" style="padding-top:5px;overflow:auto;width: auto;display: inline-block !important;">
19
- <el-tree
20
- ref="deparmentTree"
21
- :props="defaultProps"
22
- :load="loadNode"
23
- lazy
24
- :show-checkbox="false"
25
- node-key="id"
26
- check-strictly
27
- :render-content="renderContent"
28
- :filter-node-method="filterNode"
29
- @check-change="handleCheckChange"
30
- @node-expand="handleNodeExpand"
31
- @node-click="handleNodeClick"
32
- />
33
- </div>
34
- <div v-if="searchValue && searchValue.length > 0" style="height:100%;overflow: hidden;">
35
- <user-result :grid-data="searchResult" :height="height" :multiple="false" :is-search-result="true" @selectResult="getSelectUser" @resultRowDblclick="resultRowDblclick" />
36
- </div>
37
- </el-main>
38
- </el-container>
39
- </div>
40
- </template>
41
- <style>
42
- .searchResult {
43
- color:red
44
- }
45
- .inline-input-custom {
46
- width : 90%
47
- }
48
- </style>
49
-
50
- <script>
51
- import localStorage from '../../../src/utils/local-storage'
52
- import utils from '../../utils/utils'
53
- import departmentTreeService from './department-tree-service'
54
- import memoryCacheUtils from '../../utils/memory-cache-utils'
55
- import UserResult from './search-result.vue'
56
- export default {
57
- name: 'InlineDepartmentSingleTree',
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
- // 多选部门树时,已选择部门id或部门名称或编码集合,多个之间以逗号隔开
73
- selectDepartmentInfo: {
74
- type: [String, Number],
75
- default: null
76
- },
77
- // 移除部门时,部门属性名称:id、name、code,默认是id
78
- searchField: {
79
- type: String,
80
- default: 'id'
81
- },
82
- // 多选树时结果之间的分隔符,默认是逗号分隔
83
- separator: {
84
- type: String,
85
- default: ','
86
- }
87
- },
88
- data() {
89
- return {
90
- filterText: '',
91
- defaultProps: {
92
- id: 'id',
93
- label: 'showName',
94
- children: 'childDepartments',
95
- isLeaf: 'leaf'
96
- },
97
- searchParam: {
98
- searchValue: null,
99
- treeType: 'DEPARTMENT_TREE',
100
- departmentInfo: null
101
- },
102
- count: 0,
103
- containBranch: false, // 当前租户内是否包含分支机构。获得当前选中部门名称时,如果有分支,则需要将分支名称返回给用户,例如:部门1(分支1)
104
- tenantNodeId: -1, // 公司节点的id
105
- allSearchNodeIds: [], // 用于保存所有查询出的节点id
106
- allExpandNodeIds: [], // 用于保存allSearchNodeIds中所有已加载子节点的id集合
107
- isClickNode: false,
108
- restaurants: [], // 查询的备选值
109
- searchValue: null, // 查询条件
110
- searchStoreKey: 'searchDepartment',
111
- selectNodeInfo: null, // 单选时,选择的部门信息
112
- tenantInfo: {}, // 公司根节点信息
113
- searchResult: [],
114
- memoryCacheKey: 'DEPARTMENT_MEMORY_KEY',
115
- memoryCacheData: [] // 记忆选择数据, 搜索框获得焦点后,下拉显示最近选中的10个人,倒序排列,最后选中的在最上面显示。
116
- }
117
- },
118
- computed: {
119
- },
120
- watch: {
121
- filterText(val) {
122
- if (!val) {
123
- this.searchValue = val
124
- // 清空查询内容时,重新加载整个树
125
- if (this.departmentInfo && this.departmentInfo.length > 0) {
126
- // 加载指定部门时,展开公司节点
127
- this.loadPointDepartments()
128
- } else {
129
- // 加载整个组织结构树时,展开公司节点
130
- this.loadDepartment(this.tenantNodeId)
131
- }
132
- }
133
- }
134
- },
135
- mounted() {
136
- var searchDepartment = localStorage.getObject(this.searchStoreKey)
137
- if (searchDepartment) {
138
- this.restaurants = searchDepartment
139
- } else {
140
- this.restaurants = []
141
- }
142
- this.getMemoryCacheData('department')
143
- },
144
- methods: {
145
- ...utils,
146
- ...departmentTreeService,
147
- ...memoryCacheUtils,
148
- filterNode(value, data, node) {
149
- if (!value) {
150
- return true
151
- } else {
152
- return data.name.indexOf(value) !== -1
153
- }
154
- },
155
- // 选中当前节点及其子节点
156
- checkedNodeAndChildren(data) {
157
- // 取消选中状态时,保持节点是展开的状态,不要折叠
158
- // this.$refs.deparmentTree.store.nodesMap[data.id].expanded = true
159
- // 获得所有应该选中的节点
160
- this.$refs.deparmentTree.setChecked(data.id, true)
161
- const childDepartments = data.childDepartments
162
- if (childDepartments) {
163
- // 递归设置子子节点的选中状态
164
- childDepartments.forEach(nodeData => {
165
- this.checkedNodeAndChildren(nodeData)
166
- })
167
- }
168
- },
169
- // 取消当前节点的子节点的选中状态
170
- cancelChildCheckedNodes(data) {
171
- if (data.id !== this.tenantNodeId) {
172
- // 如果当前节点不是公司节点,需要将公司节点的选中状态去掉
173
- this.$refs.deparmentTree.setChecked(this.tenantNodeId, false)
174
- }
175
- const childDepartments = data.childDepartments
176
- if (childDepartments) {
177
- childDepartments.forEach(nodeData => {
178
- // 取消节点的选中状态
179
- this.$refs.deparmentTree.setChecked(nodeData.id, false)
180
- // 递归取消子子节点的选中状态
181
- this.cancelChildCheckedNodes(nodeData)
182
- })
183
- }
184
- },
185
- handleCheckChange(data, checked, indeterminate) {
186
-
187
- },
188
- handleNodeExpand(data, node, nodeTree) {
189
- },
190
- handleNodeClick(data, node, nodeTree) {
191
- this.selectSingleNode(data, false)
192
- },
193
- selectSingleNode(data, isClickOkBtn) {
194
- // 表示是部门树节点
195
- if (this.isDepartmentNode(data)) {
196
- // 点击的是部门节点,并且是单选树时,点击部门节点直接关闭弹框
197
- const department = JSON.parse(data.data)
198
- this.packageSelectResult(department)
199
- this.setMemoryCacheData(department, 'department')
200
- // if (this.selectNodeInfo && isClickOkBtn === true) {
201
- // // 点击确定按钮时才需要调result回调事件,关闭弹框
202
- // this.$emit('result', this.selectNodeInfo)
203
- // }
204
- }
205
- },
206
- packageSelectResult(department) {
207
- department.tenantName = this.tenantInfo.tenantName
208
- department.tenantCode = this.tenantInfo.code
209
- var selectNodeInfo = {
210
- id: department.id,
211
- name: department.showName,
212
- code: department.code,
213
- containBranch: this.containBranch,
214
- zhName: department.name,
215
- enName: department.enName,
216
- department: department
217
- }
218
- this.selectNodeInfo = selectNodeInfo
219
- },
220
- isDepartmentNode(data) {
221
- // 当前节点不是公司节点,也不是分支机构节点,表示是部门节点
222
- return data.id !== this.tenantNodeId && data.nodeType && data.nodeType === 'DEPARTMENT' && !data.branch
223
- },
224
- selectDepartment() {
225
- // 是否需要显示提示框,默认不显示
226
- var showTip = false
227
- // const data = this.$refs.deparmentTree.getCurrentNode()
228
- if (this.selectNodeInfo) {
229
- // this.selectSingleNode(data, true)
230
- this.$emit('result', this.selectNodeInfo)
231
- } else {
232
- showTip = true
233
- }
234
-
235
- if (showTip) {
236
- this.$alert(this.$t('imatrixUIMessage.pleaseSelectDepartment'), this.$t('imatrixUIMessage.tips'), {
237
- confirmButtonText: this.$t('imatrixUIPublicModel.sure')
238
- })
239
- }
240
- },
241
- // 是否选中了公司节点
242
- isSelectTenantNode(dataId) {
243
- return dataId === this.tenantNodeId && (!this.departmentInfo || this.departmentInfo.length === 0)
244
- },
245
- // 给节点添加自定义图标
246
- renderContent(h, { node, data, store }) {
247
- var className
248
- if (node.data.id === -1 || node.data.branch) {
249
- // node.id ===-1表示公司节点,node.branch表示是分支机构节点
250
- className = 'el-icon-menu'
251
- } else if (node.data.id === -2 || node.data.id === -3) {
252
- // node.id ===-2表示集团公司无部门用户节点,node.id ===-3表示是分支机构无部门用户节点
253
- className = 'el-icon-tickets'
254
- } else {
255
- // 表示是部门节点
256
- className = 'el-icon-date'
257
- }
258
- if (data.nodeType && data.nodeType === 'DEPARTMENT' &&
259
- this.searchValue && data.name.indexOf(this.searchValue) > -1) {
260
- // 如果是查询条件
261
- return (
262
- <span>
263
- <i class={className}></i>
264
- <span class='searchResult' title={node.label}>{node.label}</span>
265
- </span>
266
- )
267
- }
268
- return (
269
- <span>
270
- <i class={className}></i>
271
- <span title={node.label}>{node.label}</span>
272
- </span>
273
- )
274
- },
275
- getSelectUser(selectUser) {
276
- // console.log('getSelectUser==', selectUser)
277
- // this.selectUser = selectUser
278
- // true参数表示是否是勾选单选框,是勾选单选框时不关闭弹框
279
- this.packageSelectResult(selectUser)
280
- // 搜索选中记忆
281
- this.setMemoryCacheData(selectUser, 'department')
282
- },
283
- resultRowDblclick(user) {
284
- this.packageSelectResult(user)
285
- this.$emit('result', this.selectNodeInfo)
286
- }
287
-
288
- }
289
- }
290
- </script>
@@ -1,86 +0,0 @@
1
- <template>
2
- <div>
3
- <inline-department-multi-tree
4
- v-if="multiple"
5
- ref="inlineDeparmentTree"
6
- :height="height"
7
- :check-strictly="checkStrictly"
8
- :department-info="departmentInfo"
9
- :select-department-info="selectDepartmentInfo"
10
- :search-field="searchField"
11
- :separator="separator"
12
- @result="result"
13
- />
14
- <inline-department-single-tree
15
- v-if="!multiple"
16
- ref="inlineDeparmentTree"
17
- :department-info="departmentInfo"
18
- @result="result"
19
- />
20
- </div>
21
- </template>
22
-
23
- <script>
24
- import InlineDepartmentMultiTree from './department-multi-tree-inline.vue'
25
- import InlineDepartmentSingleTree from './department-single-tree-inline.vue'
26
- export default {
27
- name: 'InlineDepartmentTree',
28
- components: {
29
- InlineDepartmentMultiTree,
30
- InlineDepartmentSingleTree
31
- },
32
- props: {
33
- // 是否是多选树,默认是true
34
- multiple: {
35
- type: Boolean,
36
- default: true
37
- },
38
- checkStrictly: {
39
- type: Boolean,
40
- default: false
41
- },
42
- // 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
43
- departmentInfo: {
44
- type: Array,
45
- default: null
46
- },
47
- // 弹框的高度
48
- height: {
49
- type: String,
50
- default: '300px'
51
- },
52
- // 多选部门树时,已选择部门id或部门名称或编码集合,多个之间以逗号隔开
53
- selectDepartmentInfo: {
54
- type: [String, Number],
55
- default: null
56
- },
57
- // 移除部门时,部门属性名称:id、name、code,默认是id
58
- searchField: {
59
- type: String,
60
- default: 'id'
61
- },
62
- // 多选树时结果之间的分隔符,默认是逗号分隔
63
- separator: {
64
- type: String,
65
- default: ','
66
- }
67
- },
68
- data() {
69
- return {
70
- selectNodeInfo: null // 单选时,选择的用户信息
71
- }
72
- },
73
- mounted() {
74
- },
75
- methods: {
76
- result(selectNodeInfo) {
77
- this.selectNodeInfo = selectNodeInfo
78
- this.$emit('result', selectNodeInfo)
79
- },
80
- selectDepartment() {
81
- this.$refs.inlineDeparmentTree.selectDepartment()
82
- }
83
-
84
- }
85
- }
86
- </script>
@@ -1,273 +0,0 @@
1
- import Vue from 'vue'
2
- import { getI18n } from '../../../src/utils/util'
3
- const departmentTreeService = {
4
- // 后台查询部门,并拼接树节点
5
- filterAppendNodes(value) {
6
- this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/search-pc-depts', this.searchParam).then(result => {
7
- if (result) {
8
- if (result.length === 0) {
9
- this.searchResult = []
10
- this.$message({
11
- showClose: true,
12
- type: 'error',
13
- message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
14
- })
15
- return
16
- }
17
- this.searchResult = result
18
- // result的格式为[DEPARTMENT~1,DEPARTMENT~1/DEPARTMENT~4,DEPARTMENT~10]
19
- // result.forEach(nodeIds => {
20
- // // nodeId的分隔符
21
- // var nodeIdSeparator = '/'
22
- // const nodeIdArr = nodeIds.split(nodeIdSeparator)
23
- // if (nodeIdArr.length > 0) {
24
- // this.loadDepartmentWhenSearch(0, nodeIdArr)
25
- // }
26
- // })
27
- } else {
28
- this.$message({
29
- showClose: true,
30
- type: 'error',
31
- message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
32
- })
33
- }
34
- })
35
- },
36
- search(value) {
37
- this.searchValue = value
38
- let mySearchValue = value
39
- if (mySearchValue) {
40
- mySearchValue = mySearchValue.trim()
41
- }
42
- this.searchParam.searchValue = mySearchValue
43
- this.searchParam.departmentInfo = this.departmentInfo
44
- // 后台查询部门,并拼接树节点
45
- this.filterAppendNodes(value)
46
- },
47
- handleSelect(item) {
48
- // this.handleSelectUtil(item, localStorage)
49
- // 查询最新部门信息替换,缓存为历史数据 数据库可能发生变化
50
- this.$http.get(Vue.prototype.baseAPI + '/api/departments?departmentCode=' + item.code).then(departmentDTO => {
51
- if (departmentDTO !== null) {
52
- for (const dtoKey in departmentDTO) {
53
- if (item.hasOwnProperty(dtoKey)) {
54
- item[dtoKey] = departmentDTO[dtoKey]
55
- }
56
- }
57
- }
58
- this.filterText = ''
59
- this.searchValue = ''
60
- this.setMemoryCacheData(item, 'department')
61
- if (this.multiple) {
62
- const index = this.selectResult.findIndex(selectEntity => selectEntity.code === item.code)
63
- if (index < 0) {
64
- this.selectResult.push(item)
65
- }
66
- } else {
67
- this.packageSelectResult(item)
68
- // 关闭弹窗
69
- this.$emit('result', this.selectNodeInfo)
70
- }
71
- })
72
- },
73
- querySearch(queryString, cb) {
74
- if (!this.filterText && this.filterText.length === 0) {
75
- this.memorySearch(queryString, cb)
76
- } else {
77
- this.search(this.filterText)
78
- cb([])
79
- }
80
- },
81
- // 点击查询按钮调用的方法
82
- clickSearch() {
83
- this.storeSeachValue()
84
- this.search(this.filterText)
85
- },
86
- loadDepartmentWhenSearch(n, nodeIdArr) {
87
- return new Promise((resolve, reject) => {
88
- if (nodeIdArr.length === n) {
89
- resolve()
90
- } else {
91
- const nodeId = nodeIdArr[n]
92
- let dataId = nodeId
93
- // 节点类型和数据id的分隔符
94
- const nodeTypeAndDataIdSeparator = '~'
95
- // nodeId格式为DEPARTMENT~4
96
- if (nodeId.indexOf(nodeTypeAndDataIdSeparator) > -1) {
97
- dataId = nodeId.substring(nodeId.indexOf('~') + 1)
98
- }
99
- this.loadDepartment(dataId).then(() => {
100
- this.loadDepartmentWhenSearch(++n, nodeIdArr)
101
- }).catch((error) => {
102
- reject(error)
103
- })
104
- }
105
- })
106
- },
107
- // 点击复选框时处理
108
- handleCheckNode(data, checkObj) {
109
- if (checkObj.checkedKeys.indexOf(data.id) > -1) {
110
- // 表示正选中data节点
111
- this.isloading = true
112
- if (data.nodeType && data.nodeType === 'DEPARTMENT' && data.data) {
113
- // 表示当前选中的节点是部门
114
- const department = JSON.parse(data.data)
115
- this.selectUser(null, department)
116
- this.isloading = false
117
- }
118
- if (data.childDepartments) {
119
- // 如果已展开,不需要再走后台获得其子节点。只需要选中已有子节点
120
- // 展开当前选中的节点
121
- this.$refs.deparmentTree.store.nodesMap[data.id].expanded = true
122
- // 选中当前节点及其子节点
123
- this.checkedNodeAndChildren(data)
124
- this.isloading = false
125
- } else {
126
- // 当前节点未展开。需要走后台获得当前节点的子节点,然后展开当前节点,然后选中这些子节点
127
- if (!data.leaf) {
128
- // 不是叶子节点,并且没有加载过该父节点的子节点时,需要走后台展开子节点
129
- this.$http.get(Vue.prototype.baseAPI + '/component/organization-trees/departments/' + data.id).then(result => {
130
- // 更新当前点击的节点的子节点
131
- this.$refs.deparmentTree.updateKeyChildren(data.id, result)
132
- // 展开当前选中的节点
133
- this.$refs.deparmentTree.store.nodesMap[data.id].expanded = true
134
- // 获得所有应该选中的节点
135
- this.checkedNodeAndChildren(data)
136
- })
137
- this.$http.get(Vue.prototype.baseAPI + '/component/organization-trees/child-departments/' + data.id).then(childDepts => {
138
- if (childDepts && !this.checkStrictly) {
139
- childDepts.forEach(item => {
140
- this.selectUser(null, item)
141
- })
142
- this.isloading = false
143
- }
144
- })
145
- }
146
- }
147
- } else {
148
- // 表示正取消选中data节点,同时要取消其子节点的选中状态
149
- this.cancelChildCheckedNodes(data)
150
- }
151
- },
152
- // 初始化树 或 点击三角展开节点时动态加载子节点
153
- loadNode(node, resolve) {
154
- var parentId = 0
155
- if (node.level === 0) {
156
- // 表示初始化树
157
- parentId = 0
158
- } else {
159
- parentId = node.data.id
160
- }
161
- var checkedKeys = []
162
- if (this.$refs.deparmentTree) {
163
- checkedKeys = this.$refs.deparmentTree.getCheckedKeys()
164
- }
165
- // 初始化部门树
166
- this.initLoadDepartment(parentId, node, resolve, checkedKeys)
167
- },
168
- // 初始化部门树
169
- initLoadDepartment(parentId, node, resolve, checkedKeys) {
170
- this.$http.get(Vue.prototype.baseAPI + '/component/organization-trees/departments/' + parentId).then(data => {
171
- resolve(data)
172
- // 更新当前点击的节点的子节点
173
- this.$refs.deparmentTree.updateKeyChildren(parentId, data)
174
- if (parentId === 0) {
175
- // 初始化树时,展开公司节点
176
- const tenantData = data[0].data
177
- data[0].disable = true
178
- this.tenantInfo = JSON.parse(tenantData)
179
- this.containBranch = data[0].containBranch
180
- if (this.departmentInfo && this.departmentInfo.length > 0) {
181
- // 加载指定部门时,展开公司节点
182
- this.loadPointDepartments()
183
- } else {
184
- // 加载整个组织结构树时,展开公司节点
185
- this.loadDepartment(this.tenantNodeId)
186
- }
187
- }
188
-
189
- if (this.isClickNode) {
190
- // 点击当前节点时,加载树节点时
191
- // 注意不是点击复选框时
192
- this.isClickNode = false
193
- this.checkedNodeAndChildren(node.data)
194
- } else {
195
- // 表示是点击三角展开节点时
196
- if (checkedKeys && checkedKeys.indexOf(parentId) > -1) {
197
- // 点击部门名称前的三角标识展开节点时,保持当前节点的选中状态
198
- // 表示当前展开的节点是选中状态,则应保持其选中状态,并选中其子节点
199
- this.checkedNodeAndChildren(node.data)
200
- }
201
- }
202
- })
203
- },
204
- // 加载当前节点的子节点
205
- loadDepartment(parentId, isSearch, searchValue) {
206
- return new Promise((resolve, reject) => {
207
- this.$http.get(Vue.prototype.baseAPI + '/component/organization-trees/departments/' + parentId).then(children => {
208
- this.$refs.deparmentTree.updateKeyChildren(parentId, children)
209
- if (this.$refs.deparmentTree.store.nodesMap[parentId]) {
210
- this.$refs.deparmentTree.store.nodesMap[parentId].expanded = true
211
- }
212
- resolve()
213
- }).catch((error) => {
214
- console.log('error', error)
215
- })
216
- })
217
- },
218
- // 加载指定部门节点
219
- loadPointDepartments() {
220
- this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/point-departments', this.departmentInfo).then(children => {
221
- this.$refs.deparmentTree.updateKeyChildren(this.tenantNodeId, children)
222
- if (this.$refs.deparmentTree.store.nodesMap[this.tenantNodeId]) {
223
- this.$refs.deparmentTree.store.nodesMap[this.tenantNodeId].expanded = true
224
- }
225
- })
226
- },
227
- getSelectDepts(searchField, selectDeptInfo, separator) {
228
- return new Promise((resolve, reject) => {
229
- if (!searchField) {
230
- resolve([])
231
- } else if (!selectDeptInfo) {
232
- resolve([])
233
- } else {
234
- this.$http.get(Vue.prototype.baseAPI + '/component/organization-trees/select-departments?searchField=' + searchField + '&selectDeptInfo=' + selectDeptInfo + '&separator=' + separator).then(departments => {
235
- resolve(departments)
236
- }).catch(error => {
237
- reject(error)
238
- })
239
- }
240
- })
241
- },
242
- // 选中了组织结构树的根节点
243
- packageAllDept() {
244
- // 表示集合中不存在该用户,则封装该用户
245
- var allDept = {
246
- id: this.tenantNodeId,
247
- name: '所有部门'
248
- }
249
- return allDept
250
- },
251
- initSelectDepts() {
252
- return new Promise((resolve, reject) => {
253
- const selectDepts = []
254
- if (this.selectDepartmentInfo) {
255
- if (this.selectDepartmentInfo === this.tenantNodeId || this.selectDepartmentInfo === '所有部门') {
256
- // 表示已选择所有用户
257
- selectDepts.push(this.packageAllDept())
258
- resolve(selectDepts)
259
- } else {
260
- // 表示不是选择的所有用户
261
- this.getSelectDepts(this.searchField, this.selectDepartmentInfo, this.separator).then(departments => {
262
- resolve(departments)
263
- }).catch(error => {
264
- reject(error)
265
- })
266
- }
267
- } else {
268
- resolve(selectDepts)
269
- }
270
- })
271
- }
272
- }
273
- export default departmentTreeService