imatrix-ui 2.8.21 → 2.8.22-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 (176) hide show
  1. package/lib/super-ui.css +1 -1
  2. package/lib/super-ui.umd.min.js +5 -5
  3. package/package.json +2 -2
  4. package/src/api/sso-service.js +19 -1
  5. package/src/i18n/langs/cn.js +13 -3
  6. package/src/i18n/langs/en.js +15 -4
  7. package/src/router/index.js +10 -0
  8. package/src/store/modules/tab-content.js +6 -0
  9. package/src/store/modules/user.js +19 -0
  10. package/src/styles/index.scss +72 -2
  11. package/src/styles/theme/black/font-style.scss +70 -0
  12. package/src/styles/theme/black/index.scss +6 -30
  13. package/src/styles/theme/blue/font-style.scss +37 -0
  14. package/src/styles/theme/blue/index.scss +2 -18
  15. package/src/styles/theme/blue2/font-style.scss +70 -0
  16. package/src/styles/theme/blue2/index.scss +3 -13
  17. package/src/styles/theme/dark-blue/index.scss +26 -5
  18. package/src/styles/theme/dark-blue/sidebar.scss +7 -37
  19. package/src/styles/theme/dark-blue/table.scss +1 -1
  20. package/src/styles/theme/gray/card-style.scss +13 -1
  21. package/src/styles/theme/gray/font-style.scss +38 -0
  22. package/src/styles/theme/gray/index.scss +13 -25
  23. package/src/styles/theme/gray/scrollbar-style.scss +32 -0
  24. package/src/styles/theme/gray/sidebar.scss +5 -0
  25. package/src/utils/auth-api.js +45 -1
  26. package/src/utils/common-util.js +11 -0
  27. package/src/utils/range-selector.js +185 -0
  28. package/src/utils/request.js +5 -2
  29. package/src/utils/util.js +7 -5
  30. package/src/views/dsc-component/Sidebar/Item.vue +4 -2
  31. package/src/views/dsc-component/Sidebar/SidebarItem.vue +1 -2
  32. package/src/views/dsc-component/Sidebar/index.vue +12 -20
  33. package/src/views/dsc-component/tabs/tab-content.vue +1 -5
  34. package/src/views/layout/NewLayout.vue +6 -65
  35. package/src/views/layout/components/Menubar/Item.vue +23 -7
  36. package/src/views/layout/components/Menubar/Link.vue +11 -2
  37. package/src/views/layout/components/Menubar/SidebarItem.vue +50 -7
  38. package/src/views/layout/components/Menubar/index.vue +51 -16
  39. package/src/views/layout/components/tabs/tab-content.vue +160 -0
  40. package/src/views/layout/tab-content-iframe-index.vue +31 -0
  41. package/src/views/layout/tab-content-index.vue +85 -0
  42. package/packages/breadcrumb/index.js +0 -6
  43. package/packages/breadcrumb/src/breadcrumb.vue +0 -71
  44. package/packages/department-tree/index.js +0 -6
  45. package/packages/department-tree/src/department-tree.vue +0 -108
  46. package/packages/department-tree-inline/index.js +0 -6
  47. package/packages/department-tree-inline/src/department-multi-tree-inline.vue +0 -402
  48. package/packages/department-tree-inline/src/department-single-tree-inline.vue +0 -284
  49. package/packages/department-tree-inline/src/department-tree-inline.vue +0 -86
  50. package/packages/department-tree-inline/src/department-tree-service.js +0 -245
  51. package/packages/department-tree-inline/src/search-result.vue +0 -176
  52. package/packages/department-user-tree/index.js +0 -6
  53. package/packages/department-user-tree/src/department-user-multiple-tree.vue +0 -116
  54. package/packages/department-user-tree/src/department-user-single-tree.vue +0 -76
  55. package/packages/department-user-tree/src/department-user-tree.vue +0 -101
  56. package/packages/department-user-tree-inline/index.js +0 -6
  57. package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +0 -626
  58. package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +0 -269
  59. package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +0 -79
  60. package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +0 -230
  61. package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -122
  62. package/packages/department-user-tree-inline/src/search-result.vue +0 -197
  63. package/packages/directives/prevent-reclick.js +0 -19
  64. package/packages/dynamic-source-select/index.js +0 -6
  65. package/packages/dynamic-source-select/src/dynamic-source-select-service.js +0 -70
  66. package/packages/dynamic-source-select/src/dynamic-source-select.vue +0 -440
  67. package/packages/dynamic-source-select/src/events.js +0 -55
  68. package/packages/fs-preview/index.js +0 -6
  69. package/packages/fs-preview/src/fs-preview.vue +0 -226
  70. package/packages/fs-upload/index.js +0 -6
  71. package/packages/fs-upload/src/fs-upload-multi.vue +0 -420
  72. package/packages/fs-upload/src/fs-upload-single.vue +0 -312
  73. package/packages/fs-upload/src/fs-upload.vue +0 -189
  74. package/packages/fs-upload/src/see-big-picture.vue +0 -55
  75. package/packages/fs-upload-list/index.js +0 -6
  76. package/packages/fs-upload-list/src/fs-upload-list.vue +0 -287
  77. package/packages/hamburger/index.js +0 -6
  78. package/packages/hamburger/src/hamburger.vue +0 -38
  79. package/packages/index.js +0 -121
  80. package/packages/multipart-upload/index.js +0 -6
  81. package/packages/multipart-upload/src/index.vue +0 -73
  82. package/packages/multipart-upload/src/multipart-upload-form.vue +0 -297
  83. package/packages/multipart-upload/src/multipart-upload-list.vue +0 -378
  84. package/packages/organization-input/index.js +0 -6
  85. package/packages/organization-input/src/organization-input.vue +0 -542
  86. package/packages/plugins/export-data-new.js +0 -453
  87. package/packages/plugins/export-data.js +0 -361
  88. package/packages/plugins/index.js +0 -15
  89. package/packages/plugins/public-method.js +0 -43
  90. package/packages/remove-department/index.js +0 -6
  91. package/packages/remove-department/src/remove-department.vue +0 -172
  92. package/packages/remove-department/src/remove-dept-service.js +0 -20
  93. package/packages/remove-user/index.js +0 -6
  94. package/packages/remove-user/src/remove-user-service.js +0 -20
  95. package/packages/remove-user/src/remove-user.vue +0 -195
  96. package/packages/remove-workgroup/index.js +0 -6
  97. package/packages/remove-workgroup/src/remove-workgroup-service.js +0 -20
  98. package/packages/remove-workgroup/src/remove-workgroup.vue +0 -159
  99. package/packages/rich-editor/index.js +0 -7
  100. package/packages/rich-editor/index.vue +0 -278
  101. package/packages/rich-editor/langs/zh-Hans.js +0 -1
  102. package/packages/rich-editor/viewer.vue +0 -103
  103. package/packages/scan-code-input/index.js +0 -6
  104. package/packages/scan-code-input/src/events.js +0 -33
  105. package/packages/scan-code-input/src/scan-code-input-colse.vue +0 -131
  106. package/packages/scan-code-input/src/scan-code-input.vue +0 -116
  107. package/packages/secret-info/index.js +0 -7
  108. package/packages/secret-info/index.vue +0 -90
  109. package/packages/super-grid/index.js +0 -7
  110. package/packages/super-grid/src/apis.js +0 -763
  111. package/packages/super-grid/src/columns-config.vue +0 -335
  112. package/packages/super-grid/src/custom-formatter.js +0 -250
  113. package/packages/super-grid/src/dynamic-input.vue +0 -1279
  114. package/packages/super-grid/src/eventBus.js +0 -2
  115. package/packages/super-grid/src/events.js +0 -55
  116. package/packages/super-grid/src/formValidatorUtil.js +0 -226
  117. package/packages/super-grid/src/formatter.js +0 -181
  118. package/packages/super-grid/src/group-column.vue +0 -100
  119. package/packages/super-grid/src/header-context-menu.vue +0 -87
  120. package/packages/super-grid/src/index-column.vue +0 -51
  121. package/packages/super-grid/src/normal-column.vue +0 -769
  122. package/packages/super-grid/src/public-methods.js +0 -31
  123. package/packages/super-grid/src/row-operation.vue +0 -161
  124. package/packages/super-grid/src/search-button.vue +0 -66
  125. package/packages/super-grid/src/search-condition-input.vue +0 -61
  126. package/packages/super-grid/src/search-condition-list.vue +0 -59
  127. package/packages/super-grid/src/search-form-advancedQuery.vue +0 -653
  128. package/packages/super-grid/src/search-form-dialog.vue +0 -79
  129. package/packages/super-grid/src/search-form-item.vue +0 -386
  130. package/packages/super-grid/src/search-form-number.vue +0 -38
  131. package/packages/super-grid/src/search-form-open.vue +0 -162
  132. package/packages/super-grid/src/search-form-ordinarySearch.vue +0 -188
  133. package/packages/super-grid/src/search-form.vue +0 -634
  134. package/packages/super-grid/src/search-methods.js +0 -387
  135. package/packages/super-grid/src/selection-column.vue +0 -43
  136. package/packages/super-grid/src/store.js +0 -3
  137. package/packages/super-grid/src/super-grid-service.js +0 -561
  138. package/packages/super-grid/src/super-grid.vue +0 -2793
  139. package/packages/super-grid/src/utils.js +0 -763
  140. package/packages/super-grid/src/view-image-dialog.vue +0 -130
  141. package/packages/super-nine-grid/index.js +0 -7
  142. package/packages/super-nine-grid/src/apis.js +0 -103
  143. package/packages/super-nine-grid/src/custom-formatter.js +0 -66
  144. package/packages/super-nine-grid/src/formatter.js +0 -132
  145. package/packages/super-nine-grid/src/search-form-number.vue +0 -38
  146. package/packages/super-nine-grid/src/search-form.vue +0 -430
  147. package/packages/super-nine-grid/src/search-methods.js +0 -134
  148. package/packages/super-nine-grid/src/store.js +0 -3
  149. package/packages/super-nine-grid/src/super-grid-service.js +0 -91
  150. package/packages/super-nine-grid/src/super-nine-grid.vue +0 -872
  151. package/packages/super-nine-grid/src/utils.js +0 -261
  152. package/packages/svg-icon/index.js +0 -6
  153. package/packages/svg-icon/src/svg-icon.vue +0 -43
  154. package/packages/utils/utils.js +0 -152
  155. package/packages/utils/value-set.js +0 -86
  156. package/packages/valid-code/index.js +0 -7
  157. package/packages/valid-code/src/valid-code.vue +0 -95
  158. package/packages/workflow-button/index.js +0 -6
  159. package/packages/workflow-button/src/workflow-button.vue +0 -325
  160. package/packages/workflow-history-list/index.js +0 -6
  161. package/packages/workflow-history-list/src/api.js +0 -7
  162. package/packages/workflow-history-list/src/workflow-history-list.vue +0 -185
  163. package/packages/workgroup-tree/index.js +0 -6
  164. package/packages/workgroup-tree/src/workgroup-tree.vue +0 -76
  165. package/packages/workgroup-tree-inline/index.js +0 -6
  166. package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +0 -317
  167. package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +0 -43
  168. package/packages/workgroup-user-tree/index.js +0 -6
  169. package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +0 -100
  170. package/packages/workgroup-user-tree-inline/index.js +0 -6
  171. package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +0 -163
  172. package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +0 -436
  173. package/packages/year-range-picker/index.js +0 -6
  174. package/packages/year-range-picker/src/year-range-picker.vue +0 -51
  175. package/src/index.js +0 -93
  176. package/src/styles/theme/gray/form-style.scss +0 -41
@@ -1,542 +0,0 @@
1
- <template>
2
- <span
3
- style="width:100%"
4
- >
5
-
6
- <template v-if="disabled">
7
- <el-input
8
- :value="value"
9
- type="text"
10
- :size="size"
11
- :readonly="true"
12
- :disabled="true"
13
- >
14
- <template slot="append">
15
- <i
16
- slot="suffix"
17
- class="el-input__icon el-icon-search"
18
- />
19
- <i
20
- slot="suffix"
21
- class="el-input__icon el-icon-delete"
22
- />
23
- </template>
24
-
25
- </el-input>
26
- </template>
27
- <template v-else>
28
- <el-input
29
- :value="value"
30
- type="text"
31
- :size="size"
32
- :readonly="true"
33
- @focus="showOrganizationTree(false)"
34
- >
35
- <template slot="append">
36
- <i
37
- class="el-input__icon el-icon-search"
38
- @click="showOrganizationTree(false)"
39
- />
40
- <i
41
- class="el-input__icon el-icon-delete"
42
- @click="emptyOrganizationResult()"
43
- />
44
- </template>
45
-
46
- </el-input>
47
- </template>
48
- <!-- 部门人员树 -->
49
- <department-user-tree
50
- v-if="treeType && treeType === 'DeptUserTree' && showOrganizationTreeFlag"
51
- :multiple="typeof(multiple)==='undefined'?false:multiple"
52
- :department-info="departmentInfo"
53
- :select-user-info="selectOrganizationInfo"
54
- :search-field="searchField"
55
- :separator="separator"
56
- @close="closeOrganizationTree"
57
- />
58
- <!-- 部门树 -->
59
- <department-tree
60
- v-if="treeType && treeType === 'DeptTree' && showOrganizationTreeFlag"
61
- width="30%"
62
- :check-strictly="typeof(checkStrictly)==='undefined'?false:checkStrictly"
63
- :multiple="typeof(multiple)==='undefined'?false:multiple"
64
- :select-department-info="selectOrganizationInfo"
65
- :search-field="searchField"
66
- :separator="separator"
67
- @close="closeOrganizationTree"
68
- />
69
- <!-- 工作组树 -->
70
- <workgroup-tree
71
- v-if="treeType && treeType === 'WgTree' && showOrganizationTreeFlag"
72
- width="30%"
73
- :multiple="typeof(multiple)==='undefined'?false:multiple"
74
- :select-workgroup-info="selectOrganizationInfo"
75
- :search-field="searchField"
76
- :separator="separator"
77
- @close="closeOrganizationTree"
78
- />
79
- <!-- 工作组人员树 -->
80
- <workgroup-user-tree
81
- v-if="treeType && treeType === 'WgUserTree' && showOrganizationTreeFlag"
82
- width="30%"
83
- :multiple="typeof(multiple)==='undefined'?false:multiple"
84
- :branch-info="departmentInfo"
85
- :select-user-info="selectOrganizationInfo"
86
- :search-field="searchField"
87
- :separator="separator"
88
- @close="closeOrganizationTree"
89
- />
90
- <!-- <remove-user
91
- v-if="treeType && (treeType === 'DeptUserTree' || treeType === 'WgUserTree') && showRemoveComponent"
92
- :select-user-info="selectOrganizationInfo"
93
- :search-field="searchField"
94
- :separator="separator"
95
- @close="closeRemoveComponent"
96
- />
97
- <remove-department
98
- v-if="treeType && treeType === 'DeptTree' && showRemoveComponent"
99
- :select-department-info="selectOrganizationInfo"
100
- :search-field="searchField"
101
- :separator="separator"
102
- @close="closeRemoveComponent"
103
- /> -->
104
- <!-- <remove-workgroup
105
- v-if="treeType && treeType === 'WgTree' && showRemoveComponent"
106
- :select-workgroup-info="selectOrganizationInfo"
107
- :search-field="searchField"
108
- :separator="separator"
109
- @close="closeRemoveComponent"
110
- /> -->
111
- </span>
112
- </template>
113
-
114
- <script>
115
- // import Vue from 'vue'
116
- import { getPropNameWhenJoinTable, setEntityFieldValue } from '../../../src/utils/util'
117
- export default {
118
- name: 'OrganizationInput',
119
- components: {
120
- },
121
- model: {
122
- prop: 'value',
123
- event: 'input'
124
- },
125
- props: {
126
- value: {
127
- type: String,
128
- default: ''
129
- },
130
- // 是否多选
131
- multiple: {
132
- type: Boolean,
133
- default: false
134
- },
135
- // 是否 “不选中” 子部门
136
- checkStrictly: {
137
- type: Boolean,
138
- default: false
139
- },
140
- // 树类型 部门人员树DeptUserTree、部门树DeptTree、工作组树WgTree、工作组人员树WgUserTree
141
- treeType: {
142
- type: String,
143
- default: 'DeptUserTree'
144
- },
145
- // 是否禁用
146
- disabled: {
147
- type: Boolean,
148
- default: false
149
- },
150
- // 字段与组织结构对应信息集合,格式为:[{type:'loginName',model:'字段名'}]
151
- // 人员树时,type的可选值有:id、name、loginName、email、telephone、mainDeptName、mainDeptId、subCompanyName、subCompanyId
152
- // 部门/工作组树时:type的可选值有:id、name、code
153
- fields: {
154
- type: Array,
155
- default: null
156
- },
157
- // 当前表单数据信息
158
- models: {
159
- type: Object,
160
- default: null
161
- },
162
- // 文本框大小large/medium/small/mini
163
- size: {
164
- type: String,
165
- default: ''
166
- },
167
- // 列表组件行编辑使用,sql查询时数据表名称,用于自定义系统中列表组件中字段多表查询带有别名时,将点"."改成两个下划线"__"时使用
168
- tableName: {
169
- type: String,
170
- default: null
171
- },
172
- // 列表组件行编辑使用,是否是关联表,用于确定属性名是否需要拼接tableName
173
- isJoinTable: {
174
- type: Boolean,
175
- default: false
176
- },
177
- // 指定部门或者工作组
178
- departmentInfo: {
179
- type: Array,
180
- default: null
181
- },
182
- // 多选树时结果之间的分隔符,默认是逗号分隔
183
- separator: {
184
- type: String,
185
- default: ','
186
- }
187
- },
188
- data() {
189
- return {
190
- showOrganizationTreeFlag: false, // 选择组织树所用
191
- isAppendResult: false, // 是否添加用户、部门、工作组,默认是替换,false表示替换选择的结果,true表示追加选择的结果
192
- showRemoveComponent: false, // 实现显示移除用户、部门、工作组组件
193
- selectOrganizationInfo: null, // 已选择集合,多个信息之间以逗号隔开
194
- searchField: null, // 已选的集合是什么内容,id、loginName(登录名)、name(用户名称/部门名称/工作组名称)、code(部门编码/工作组编码)、email(邮箱)、telephone(电话)等等
195
- selectOrganizationAllInfo: {} // 选择的所有信息,{id:'xx',name:'xx',loginName:'xx',code:'xx',email:'xx',telephone:'xx'}
196
- }
197
- },
198
- created() {
199
-
200
- },
201
- methods: {
202
- // 打开组织树
203
- showOrganizationTree() {
204
- let isMulti = this.multiple
205
- if (typeof (isMulti) === 'undefined') {
206
- isMulti = false
207
- }
208
- if (isMulti === true) {
209
- // 多选时才需要显示结果集合
210
- this.getSelectInfo()
211
- }
212
- this.$emit('focus')
213
- this.showOrganizationTreeFlag = true
214
- },
215
- getPropName(prop, isJoinTable, tableName) {
216
- return getPropNameWhenJoinTable(prop, isJoinTable, tableName)
217
- },
218
- // 清空已选的结果
219
- emptyOrganizationResult() {
220
- const orgFields = this.fields
221
- if (orgFields && orgFields.length > 0) {
222
- orgFields.forEach(orgField => {
223
- // orgDataType的值:
224
- // 人员时:id、name、loginName、email、telephone
225
- // 部门或工作组时:id、name
226
- const model = this.getPropName(orgField.model)
227
- this.setValue(model, null)
228
- })
229
- this.selectOrganizationAllInfo = {}
230
- this.selectOrganizationInfo = null
231
- this.searchField = null
232
- }
233
- },
234
- // 关闭组织树
235
- closeOrganizationTree(selectNodeInfo) {
236
- if (selectNodeInfo) {
237
- // 是否是多选树
238
- this.setOrganizationData(selectNodeInfo)
239
- }
240
- this.showOrganizationTreeFlag = false
241
- },
242
- setOrganizationData(orgData, isRemove, removeItems) {
243
- let isMulti = this.multiple
244
- if (typeof (isMulti) === 'undefined') {
245
- isMulti = false
246
- }
247
- const treeType = this.treeType
248
- const orgFields = this.fields
249
- if (orgFields && orgFields.length > 0) {
250
- orgFields.forEach(orgField => {
251
- // orgDataType的值:
252
- // 人员时:id、name、loginName、email、telephone
253
- // 部门或工作组时:id、name、code
254
- const orgDataType = orgField.type
255
- const orgSelectData = this.getOrgSelectData(orgDataType, orgData, this.isUserTree(treeType), isMulti)
256
- const model = this.getPropName(orgField.model)
257
- this.getOrgDataModel(model, orgSelectData, isMulti, orgDataType, isRemove, removeItems)
258
- })
259
- }
260
- },
261
- /**
262
- * @param orgDataType 字段属性:id、name、loginName、code、email、telephone
263
- */
264
- getOrgDataModel(model, orgSelectData, isMulti, orgDataType, isRemove, removeItems) {
265
- if (isMulti) {
266
- // 表示是替换或添加操作
267
- const orgResult = this.getModelValue(model)
268
- // 表示替换结果
269
- this.selectOrganizationAllInfo[orgDataType] = orgSelectData
270
- this.setValue(model, orgSelectData)
271
- // 参数分别为:属性名、原来的值、新替换的值
272
- this.$emit('replace', model, orgResult, orgSelectData)
273
- } else {
274
- this.setValue(model, orgSelectData)
275
- }
276
- },
277
- getModelValue(model) {
278
- let modelValue = ''
279
- if (this.isJoinTable === false && model && model.indexOf('.') > 0) {
280
- const parentObj = this.getParentObject(model, this.models)
281
- modelValue = parentObj[model.substring(model.lastIndexOf('.') + 1)]
282
- } else {
283
- model = this.getPropName(model)
284
- modelValue = this.models[model]
285
- }
286
- return modelValue
287
- },
288
- // 是否是人员树
289
- isUserTree(treeType) {
290
- return treeType === 'DeptUserTree' || treeType === 'WgUserTree'
291
- },
292
- // 获得组织树选择的结果
293
- getOrgSelectData(orgDataType, selectNodeInfo, isUserTree, isMulti) {
294
- if (isMulti === true) {
295
- // 多选树时
296
- if (orgDataType === 'id') {
297
- if (isUserTree) {
298
- return selectNodeInfo.userIds.join(this.separator)
299
- } else {
300
- return selectNodeInfo.ids.join(this.separator)
301
- }
302
- } else if (orgDataType === 'name') {
303
- if (isUserTree) {
304
- return selectNodeInfo.userNames.join(this.separator)
305
- } else {
306
- return selectNodeInfo.names.join(this.separator)
307
- }
308
- } else if (orgDataType === 'code') {
309
- if (!isUserTree) {
310
- return selectNodeInfo.codes.join(this.separator)
311
- }
312
- } else if (orgDataType === 'loginName') {
313
- return selectNodeInfo.loginNames.join(this.separator)
314
- } else if (orgDataType === 'email') {
315
- return selectNodeInfo.emails.join(this.separator)
316
- } else if (orgDataType === 'telephone') {
317
- return selectNodeInfo.telephones.join(this.separator)
318
- } else if (orgDataType === 'mainDeptName') {
319
- // 正职部门名称
320
- const mainDeptNames = []
321
- if (isUserTree) {
322
- const users = selectNodeInfo.users
323
- if (users) {
324
- users.forEach(user => {
325
- mainDeptNames.push(user.mainDepartmentName)
326
- })
327
- }
328
- }
329
- return mainDeptNames.join(this.separator)
330
- } else if (orgDataType === 'mainDeptId') {
331
- // 正职部门id
332
- const mainDeptIds = []
333
- if (isUserTree) {
334
- const users = selectNodeInfo.users
335
- if (users) {
336
- users.forEach(user => {
337
- if (user.mainDepartmentId) {
338
- mainDeptIds.push(user.mainDepartmentId)
339
- }
340
- })
341
- }
342
- }
343
- return mainDeptIds.join(this.separator)
344
- } else if (orgDataType === 'mainDeptCode') {
345
- // 正职部门code
346
- const mainDeptCodes = []
347
- if (isUserTree) {
348
- const users = selectNodeInfo.users
349
- if (users) {
350
- users.forEach(user => {
351
- if (user.mainDepartmentCode) {
352
- mainDeptCodes.push(user.mainDepartmentCode)
353
- }
354
- })
355
- }
356
- }
357
- return mainDeptCodes.join(this.separator)
358
- } else if (orgDataType === 'subCompanyName') {
359
- // 分支名称
360
- const branchNames = []
361
- if (isUserTree) {
362
- const users = selectNodeInfo.users
363
- if (users) {
364
- users.forEach(user => {
365
- if (user.subCompanyName) {
366
- branchNames.push(user.subCompanyName)
367
- }
368
- })
369
- }
370
- }
371
- return branchNames.join(this.separator)
372
- } else if (orgDataType === 'subCompanyId') {
373
- // 分支id
374
- const branchDeptIds = []
375
- if (isUserTree) {
376
- const users = selectNodeInfo.users
377
- if (users) {
378
- users.forEach(user => {
379
- if (user.subCompanyId) {
380
- branchDeptIds.push(user.subCompanyId)
381
- }
382
- })
383
- }
384
- }
385
- return branchDeptIds.join(this.separator)
386
- }
387
- } else {
388
- // 单选树时
389
- if (orgDataType === 'mainDeptName') {
390
- // 正职部门名称
391
- let mainDeptName = null
392
- if (isUserTree) {
393
- const user = selectNodeInfo.user
394
- if (user) {
395
- mainDeptName = user.mainDepartmentName
396
- }
397
- }
398
- return mainDeptName
399
- } else if (orgDataType === 'mainDeptId') {
400
- // 正职部门id
401
- let mainDeptId = null
402
- if (isUserTree) {
403
- const user = selectNodeInfo.user
404
- if (user) {
405
- mainDeptId = user.mainDepartmentId
406
- }
407
- }
408
- return mainDeptId
409
- } else if (orgDataType === 'mainDeptCode') {
410
- // 正职部门code
411
- let mainDeptCode = null
412
- if (isUserTree) {
413
- const user = selectNodeInfo.user
414
- if (user) {
415
- mainDeptCode = user.mainDepartmentCode
416
- }
417
- }
418
- return mainDeptCode
419
- } else if (orgDataType === 'subCompanyName') {
420
- // 分支名称
421
- let branchName = null
422
- if (isUserTree) {
423
- const user = selectNodeInfo.user
424
- if (user) {
425
- branchName = user.subCompanyName
426
- }
427
- }
428
- return branchName
429
- } else if (orgDataType === 'subCompanyId') {
430
- // 分支id
431
- let branchId = null
432
- if (isUserTree) {
433
- const user = selectNodeInfo.user
434
- if (user) {
435
- branchId = user.subCompanyId
436
- }
437
- }
438
- return branchId
439
- } else {
440
- return selectNodeInfo[orgDataType]
441
- }
442
- }
443
- },
444
- // 显示移除用户、部门、工作组组件
445
- showMyRemoveComponent() {
446
- this.getSelectInfo()
447
- if (!this.selectOrganizationInfo || this.selectOrganizationInfo === null || this.selectOrganizationInfo === '') {
448
- this.$message({
449
- showClose: true,
450
- type: 'warning',
451
- message: this.$t('imatrixUIMessage.organizationTreeNoResultNotRemove')
452
- })
453
- } else {
454
- this.showRemoveComponent = true
455
- }
456
- },
457
- getSelectInfo() {
458
- debugger
459
- const searchFields = ['id', 'code', 'loginName', 'email', 'telephone', 'name']
460
- const keys = Object.keys(this.selectOrganizationAllInfo)
461
- if (keys.length === 0) {
462
- // 表示是初始化时,从表单对象中获得信息
463
- for (let i = 0; i < searchFields.length; i++) {
464
- const prop = searchFields[i]
465
- const fieldSettings = this.fields.filter((field) => { return field.type === prop })
466
- if (fieldSettings && fieldSettings.length > 0) {
467
- const fieldSetting = fieldSettings[0]
468
- if (fieldSetting) {
469
- const model = this.getPropName(fieldSetting.model)
470
- const selectInfo = this.getModelValue(model)
471
- if (selectInfo && selectInfo !== null && selectInfo !== '') {
472
- this.selectOrganizationInfo = selectInfo
473
- this.searchField = prop
474
- break
475
- }
476
- }
477
- }
478
- }
479
- } else {
480
- // 表示是选择用户后
481
- for (let i = 0; i < searchFields.length; i++) {
482
- const prop = searchFields[i]
483
- const selectInfo = this.selectOrganizationAllInfo[prop]
484
- if (selectInfo && selectInfo !== null && selectInfo !== '') {
485
- this.selectOrganizationInfo = selectInfo
486
- this.searchField = prop
487
- break
488
- }
489
- }
490
- }
491
- },
492
- setValue(model, finallyOrgResult) {
493
- if (this.models) {
494
- if (this.isJoinTable === false && model && model.indexOf('.') > 0) {
495
- const parentObj = this.getParentObject(model, this.models)
496
- if (parentObj) {
497
- setEntityFieldValue(parentObj, model.substring(model.lastIndexOf('.') + 1), finallyOrgResult)
498
- // Vue.set(parentObj, model.substring(model.lastIndexOf('.') + 1), finallyOrgResult)
499
- }
500
- } else {
501
- model = this.getPropName(model)
502
- setEntityFieldValue(this.models, model, finallyOrgResult)
503
- // Vue.set(this.models, model, finallyOrgResult)
504
- }
505
- console.log('this.value', this.models)
506
- // 调用setValue事件
507
- this.$emit('setValue', model, finallyOrgResult)
508
- if (finallyOrgResult === undefined || finallyOrgResult === null || finallyOrgResult === '') {
509
- this.$emit('clear', model)
510
- }
511
- }
512
- },
513
- getParentObject(prop, models) {
514
- const nestedProp = prop.split('.')
515
- // 属性只有一个时父对象就是models
516
- if (nestedProp.length === 1) {
517
- return models
518
- } else {
519
- let parentObject
520
- // 属性超过2个时先找到最后一层属性的父对象
521
- for (let i = 0; i < nestedProp.length - 1; i++) {
522
- if (i === 0) {
523
- parentObject = this.getParentModelProp(nestedProp[i], models)
524
- } else {
525
- parentObject = this.getParentModelProp(nestedProp[i], parentObject)
526
- }
527
- }
528
- return parentObject
529
- }
530
- },
531
- getParentModelProp(prop, parentObj) {
532
- if (!parentObj) {
533
- parentObj = {}
534
- }
535
- if (!parentObj[prop]) {
536
- parentObj[prop] = {}
537
- }
538
- return parentObj[prop]
539
- }
540
- }
541
- }
542
- </script>