imatrix-ui 2.8.21-dw → 2.8.21
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.umd.min.js +5 -35
- package/package.json +4 -2
- package/packages/breadcrumb/index.js +6 -0
- package/packages/breadcrumb/src/breadcrumb.vue +71 -0
- package/packages/department-tree/index.js +6 -0
- package/packages/department-tree/src/department-tree.vue +108 -0
- package/packages/department-tree-inline/index.js +6 -0
- package/packages/department-tree-inline/src/department-multi-tree-inline.vue +402 -0
- package/packages/department-tree-inline/src/department-single-tree-inline.vue +284 -0
- package/packages/department-tree-inline/src/department-tree-inline.vue +86 -0
- package/packages/department-tree-inline/src/department-tree-service.js +245 -0
- package/packages/department-tree-inline/src/search-result.vue +176 -0
- package/packages/department-user-tree/index.js +6 -0
- package/packages/department-user-tree/src/department-user-multiple-tree.vue +116 -0
- package/packages/department-user-tree/src/department-user-single-tree.vue +76 -0
- package/packages/department-user-tree/src/department-user-tree.vue +101 -0
- package/packages/department-user-tree-inline/index.js +6 -0
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +626 -0
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +269 -0
- package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +79 -0
- package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +230 -0
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +122 -0
- package/packages/department-user-tree-inline/src/search-result.vue +197 -0
- package/packages/directives/prevent-reclick.js +19 -0
- package/packages/dynamic-source-select/index.js +6 -0
- package/packages/dynamic-source-select/src/dynamic-source-select-service.js +70 -0
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +440 -0
- package/packages/dynamic-source-select/src/events.js +55 -0
- package/packages/fs-preview/index.js +6 -0
- package/packages/fs-preview/src/fs-preview.vue +226 -0
- package/packages/fs-upload/index.js +6 -0
- package/packages/fs-upload/src/fs-upload-multi.vue +420 -0
- package/packages/fs-upload/src/fs-upload-single.vue +312 -0
- package/packages/fs-upload/src/fs-upload.vue +189 -0
- package/packages/fs-upload/src/see-big-picture.vue +55 -0
- package/packages/fs-upload-list/index.js +6 -0
- package/packages/fs-upload-list/src/fs-upload-list.vue +287 -0
- package/packages/hamburger/index.js +6 -0
- package/packages/hamburger/src/hamburger.vue +38 -0
- package/packages/index.js +121 -0
- package/packages/multipart-upload/index.js +6 -0
- package/packages/multipart-upload/src/index.vue +73 -0
- package/packages/multipart-upload/src/multipart-upload-form.vue +297 -0
- package/packages/multipart-upload/src/multipart-upload-list.vue +378 -0
- package/packages/organization-input/index.js +6 -0
- package/packages/organization-input/src/organization-input.vue +542 -0
- package/packages/plugins/export-data-new.js +453 -0
- package/packages/plugins/export-data.js +361 -0
- package/packages/plugins/index.js +15 -0
- package/packages/plugins/public-method.js +43 -0
- package/packages/remove-department/index.js +6 -0
- package/packages/remove-department/src/remove-department.vue +172 -0
- package/packages/remove-department/src/remove-dept-service.js +20 -0
- package/packages/remove-user/index.js +6 -0
- package/packages/remove-user/src/remove-user-service.js +20 -0
- package/packages/remove-user/src/remove-user.vue +195 -0
- package/packages/remove-workgroup/index.js +6 -0
- package/packages/remove-workgroup/src/remove-workgroup-service.js +20 -0
- package/packages/remove-workgroup/src/remove-workgroup.vue +159 -0
- package/packages/rich-editor/index.js +7 -0
- package/packages/rich-editor/index.vue +278 -0
- package/packages/rich-editor/langs/zh-Hans.js +1 -0
- package/packages/rich-editor/viewer.vue +103 -0
- package/packages/scan-code-input/index.js +6 -0
- package/packages/scan-code-input/src/events.js +33 -0
- package/packages/scan-code-input/src/scan-code-input-colse.vue +131 -0
- package/packages/scan-code-input/src/scan-code-input.vue +116 -0
- package/packages/secret-info/index.js +7 -0
- package/packages/secret-info/index.vue +90 -0
- package/packages/super-grid/index.js +7 -0
- package/packages/super-grid/src/apis.js +763 -0
- package/packages/super-grid/src/columns-config.vue +335 -0
- package/packages/super-grid/src/custom-formatter.js +250 -0
- package/packages/super-grid/src/dynamic-input.vue +1279 -0
- package/packages/super-grid/src/eventBus.js +2 -0
- package/packages/super-grid/src/events.js +55 -0
- package/packages/super-grid/src/formValidatorUtil.js +226 -0
- package/packages/super-grid/src/formatter.js +181 -0
- package/packages/super-grid/src/group-column.vue +100 -0
- package/packages/super-grid/src/header-context-menu.vue +87 -0
- package/packages/super-grid/src/index-column.vue +51 -0
- package/packages/super-grid/src/normal-column.vue +769 -0
- package/packages/super-grid/src/public-methods.js +31 -0
- package/packages/super-grid/src/row-operation.vue +161 -0
- package/packages/super-grid/src/search-button.vue +66 -0
- package/packages/super-grid/src/search-condition-input.vue +61 -0
- package/packages/super-grid/src/search-condition-list.vue +59 -0
- package/packages/super-grid/src/search-form-advancedQuery.vue +653 -0
- package/packages/super-grid/src/search-form-dialog.vue +79 -0
- package/packages/super-grid/src/search-form-item.vue +386 -0
- package/packages/super-grid/src/search-form-number.vue +38 -0
- package/packages/super-grid/src/search-form-open.vue +162 -0
- package/packages/super-grid/src/search-form-ordinarySearch.vue +188 -0
- package/packages/super-grid/src/search-form.vue +634 -0
- package/packages/super-grid/src/search-methods.js +387 -0
- package/packages/super-grid/src/selection-column.vue +43 -0
- package/packages/super-grid/src/store.js +3 -0
- package/packages/super-grid/src/super-grid-service.js +561 -0
- package/packages/super-grid/src/super-grid.vue +2793 -0
- package/packages/super-grid/src/utils.js +763 -0
- package/packages/super-grid/src/view-image-dialog.vue +130 -0
- package/packages/super-nine-grid/index.js +7 -0
- package/packages/super-nine-grid/src/apis.js +103 -0
- package/packages/super-nine-grid/src/custom-formatter.js +66 -0
- package/packages/super-nine-grid/src/formatter.js +132 -0
- package/packages/super-nine-grid/src/search-form-number.vue +38 -0
- package/packages/super-nine-grid/src/search-form.vue +430 -0
- package/packages/super-nine-grid/src/search-methods.js +134 -0
- package/packages/super-nine-grid/src/store.js +3 -0
- package/packages/super-nine-grid/src/super-grid-service.js +91 -0
- package/packages/super-nine-grid/src/super-nine-grid.vue +872 -0
- package/packages/super-nine-grid/src/utils.js +261 -0
- package/packages/svg-icon/index.js +6 -0
- package/packages/svg-icon/src/svg-icon.vue +43 -0
- package/packages/utils/utils.js +152 -0
- package/packages/utils/value-set.js +86 -0
- package/packages/valid-code/index.js +7 -0
- package/packages/valid-code/src/valid-code.vue +95 -0
- package/packages/workflow-button/index.js +6 -0
- package/packages/workflow-button/src/workflow-button.vue +325 -0
- package/packages/workflow-history-list/index.js +6 -0
- package/packages/workflow-history-list/src/api.js +7 -0
- package/packages/workflow-history-list/src/workflow-history-list.vue +185 -0
- package/packages/workgroup-tree/index.js +6 -0
- package/packages/workgroup-tree/src/workgroup-tree.vue +76 -0
- package/packages/workgroup-tree-inline/index.js +6 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +317 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +43 -0
- package/packages/workgroup-user-tree/index.js +6 -0
- package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +100 -0
- package/packages/workgroup-user-tree-inline/index.js +6 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +163 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +436 -0
- package/packages/year-range-picker/index.js +6 -0
- package/packages/year-range-picker/src/year-range-picker.vue +51 -0
- package/src/i18n/i18n.js +1 -1
- package/src/i18n/langs/cn.js +4 -2
- package/src/i18n/langs/en.js +4 -2
- package/src/index.js +93 -0
- package/src/permission.js +7 -3
- package/src/plugins.js +3 -3
- package/src/router/index.js +24 -0
- package/src/store/getters.js +2 -1
- package/src/store/modules/app.js +10 -1
- package/src/styles/display-layout.scss +34 -0
- package/src/styles/index.scss +32 -4
- package/src/styles/theme/dark-blue/button.scss +9 -0
- package/src/styles/theme/dark-blue/card.scss +64 -0
- package/src/styles/theme/dark-blue/checkbox.scss +10 -0
- package/src/styles/theme/dark-blue/dark-blue-var.scss +8 -0
- package/src/styles/theme/dark-blue/dialog.scss +21 -0
- package/src/styles/theme/dark-blue/element-variables.scss +7 -0
- package/src/styles/theme/dark-blue/font.scss +71 -0
- package/src/styles/theme/dark-blue/form.scss +51 -0
- package/src/styles/theme/dark-blue/index.scss +247 -0
- package/src/styles/theme/dark-blue/input.scss +15 -0
- package/src/styles/theme/dark-blue/pagination.scss +14 -0
- package/src/styles/theme/dark-blue/scrollbar-style.scss +32 -0
- package/src/styles/theme/dark-blue/sidebar.scss +296 -0
- package/src/styles/theme/dark-blue/tab.scss +83 -0
- package/src/styles/theme/dark-blue/table.scss +60 -0
- package/src/styles/theme/dark-blue/tree.scss +31 -0
- package/src/styles/theme/dark-blue/var.scss +1028 -0
- package/src/styles/theme/gray/form-style.scss +2 -2
- package/src/styles/theme/gray/input-style.scss +8 -0
- package/src/utils/auth-api.js +115 -0
- package/src/utils/auth.js +34 -42
- package/src/utils/calculator/calculator-factory.js +2 -2
- package/src/utils/common-util.js +34 -0
- package/src/utils/jump-page-utils.js +29 -5
- package/src/utils/menu.js +19 -0
- package/src/utils/permission.js +4 -0
- package/src/utils/request.js +18 -2
- package/src/utils/util.js +7 -3
- package/src/views/dsc-component/Sidebar/Item.vue +4 -4
- package/src/views/dsc-component/Sidebar/Link.vue +11 -2
- package/src/views/dsc-component/Sidebar/SidebarItem.vue +36 -20
- package/src/views/dsc-component/Sidebar/index.vue +24 -12
- package/src/views/dsc-component/tabs/tab-content.vue +16 -1
- package/src/views/login/index.vue +1 -1
|
@@ -0,0 +1,542 @@
|
|
|
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>
|