imatrix-ui 2.9.13-dw → 2.9.14-boe2

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