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