agilebuilder-ui 1.0.76 → 1.0.78
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 +80259 -78822
- package/lib/super-ui.umd.cjs +103 -103
- package/package.json +1 -1
- package/packages/department-tree/src/department-tree.vue +0 -1
- package/packages/department-tree-mobile/src/department-tree-inline-app.vue +15 -15
- package/packages/department-user-tree/src/department-user-tree.vue +1 -0
- 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 +5 -5
- package/packages/fs-upload-list/src/fs-upload-list.vue +179 -119
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-app.vue +2 -6
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +2 -6
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-component.vue +2 -2
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-input.vue +1 -6
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload.vue +0 -6
- package/packages/fs-upload-new/src/fs-upload-new.vue +15 -13
- package/packages/index.js +8 -2
- package/packages/organization-input/src/organization-input.vue +3 -0
- package/packages/plugins/export-data-new.js +34 -1
- 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/super-grid/src/apis.js +12 -0
- package/packages/super-grid/src/dynamic-input.vue +236 -14
- package/packages/super-grid/src/normal-column.vue +37 -2
- package/packages/super-grid/src/scan-util.ts +243 -0
- package/packages/super-grid/src/search-form-advancedQuery.vue +3 -1
- package/packages/super-grid/src/search-form-item.vue +4 -2
- package/packages/super-grid/src/super-grid-service.js +2 -1
- package/packages/super-grid/src/super-grid.vue +19 -0
- package/packages/super-grid/src/utils.js +9 -0
- 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/i18n/langs/cn.js +3 -1
- package/src/i18n/langs/en.js +3 -1
- package/src/utils/common-util.js +18 -2
- package/src/utils/permissionAuth.js +1 -1
- package/src/views/layout/EmptyLayout.vue +1 -44
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-card class="card-content" style="height: 50px">
|
|
4
|
+
<el-row class="item-row item-row-all">
|
|
5
|
+
<el-col style="width: 100%;">
|
|
6
|
+
<div style="display: flex">
|
|
7
|
+
<div style="flex: 0 0 20%;text-align:left">
|
|
8
|
+
<el-checkbox v-if="multiple" v-model="checkAll" :label="$t('departmentTreeInline.allCheck')" value="all" @change="changeAllCheck" />
|
|
9
|
+
</div>
|
|
10
|
+
<div style="flex: 0 0 80%;text-align:right">
|
|
11
|
+
<el-input v-model="searchParam.searchValue" :placeholder="$t('departmentTreeInline.pleaseInputNameOrCode')" @clear="filterAppendNodes" @keyup.enter="filterAppendNodes" @blur="filterAppendNodes" clearable>
|
|
12
|
+
<template v-slot:suffix>
|
|
13
|
+
<el-icon @click="filterAppendNodes"><Search /></el-icon>
|
|
14
|
+
</template>
|
|
15
|
+
</el-input>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</el-col>
|
|
19
|
+
</el-row>
|
|
20
|
+
</el-card>
|
|
21
|
+
<el-card v-if="tenantName" class="card-content" style="height: 40px">
|
|
22
|
+
<el-row class="item-row item-row-all">
|
|
23
|
+
<el-col class="item-label dept-path">
|
|
24
|
+
<el-breadcrumb separator="/">
|
|
25
|
+
<el-breadcrumb-item>
|
|
26
|
+
<span>{{tenantName}}</span>
|
|
27
|
+
</el-breadcrumb-item>
|
|
28
|
+
</el-breadcrumb>
|
|
29
|
+
</el-col>
|
|
30
|
+
</el-row>
|
|
31
|
+
</el-card>
|
|
32
|
+
<el-card class="card-content org-tree" style="overflow: auto;">
|
|
33
|
+
<el-tree
|
|
34
|
+
ref="orgTreeRef"
|
|
35
|
+
:data="departments"
|
|
36
|
+
:show-checkbox="multiple"
|
|
37
|
+
node-key="nodeId"
|
|
38
|
+
check-on-click-node
|
|
39
|
+
:default-checked-keys="defaultCheckedKeys"
|
|
40
|
+
@check-change="handleCheckNode"
|
|
41
|
+
@node-click="handleClickNode"
|
|
42
|
+
>
|
|
43
|
+
<template #default="{ node, data }">
|
|
44
|
+
<div class="item-row">
|
|
45
|
+
<div class="item-label">{{ data.name }}</div>
|
|
46
|
+
<!-- <div v-if="!data.leaf" class="item-side" @click="loadChildren(data,false)">
|
|
47
|
+
<el-icon><ArrowRight /></el-icon>
|
|
48
|
+
</div> -->
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
</el-tree>
|
|
52
|
+
</el-card>
|
|
53
|
+
<el-card class="card-footer" style="height: 40px">
|
|
54
|
+
<div style="display: flex;">
|
|
55
|
+
<div class="select-result" @click="showResult">
|
|
56
|
+
<!-- 已选择:6人,其中有一个部门(含子部门) -->
|
|
57
|
+
<span v-if="multiple" @click="showResult">
|
|
58
|
+
<span v-if="selectDepts.length > 0">
|
|
59
|
+
{{$t('departmentTreeInline.selectResultInfoHasSelect')}}{{$t('departmentTreeInline.workgroupTree',{num: selectDepts.length })}}
|
|
60
|
+
<span style="padding-left: 10px"><el-icon><ArrowUpBold /></el-icon></span>
|
|
61
|
+
</span>
|
|
62
|
+
</span>
|
|
63
|
+
<span v-else-if="selectDepts.length > 0">
|
|
64
|
+
{{$t('departmentTreeInline.selectResultInfoHasSelect')}}{{selectDepts[0].name }}
|
|
65
|
+
</span>
|
|
66
|
+
</div>
|
|
67
|
+
<div class="button-area">
|
|
68
|
+
<el-button size="large" type="primary" @click="saveDept">{{$t('imatrixUIPublicModel.sure')}}</el-button>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</el-card>
|
|
72
|
+
<deptResult ref="deptResultRef" :selectDepts="selectDepts" @removeDept="removeResultDept"/>
|
|
73
|
+
</div>
|
|
74
|
+
</template>
|
|
75
|
+
|
|
76
|
+
<script setup lang="ts">
|
|
77
|
+
import { reactive,ref,onMounted, defineEmits,Ref } from 'vue'
|
|
78
|
+
import {
|
|
79
|
+
ArrowRight,
|
|
80
|
+
Search,
|
|
81
|
+
ArrowUpBold
|
|
82
|
+
} from '@element-plus/icons-vue'
|
|
83
|
+
import {getTenant, getTenantChildren, checkedDeptDefault, initSelectGroups} from './workgroup-tree-service.ts'
|
|
84
|
+
import {resizeScrollTargetHeightUtil, getDeptNamePath} from '../../utils/organization.ts'
|
|
85
|
+
import deptResult from './dept-result.vue'
|
|
86
|
+
import {ElMessage} from 'element-plus'
|
|
87
|
+
import {useI18n} from "vue-i18n"
|
|
88
|
+
const props = defineProps<{
|
|
89
|
+
// 是否是多选树,默认是true
|
|
90
|
+
multiple: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: true,
|
|
93
|
+
},
|
|
94
|
+
// 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
|
|
95
|
+
branchInfo: {
|
|
96
|
+
type: Array<any>,
|
|
97
|
+
default: null,
|
|
98
|
+
},
|
|
99
|
+
// 多选部门树时,已选择部门id或部门名称或编码集合,多个之间以逗号隔开
|
|
100
|
+
selectWorkgroupInfo: {
|
|
101
|
+
type: [String, Number],
|
|
102
|
+
default: null,
|
|
103
|
+
},
|
|
104
|
+
// 移除部门时,部门属性名称:id、name、code,默认是id
|
|
105
|
+
searchField: {
|
|
106
|
+
type: String,
|
|
107
|
+
default: 'code',
|
|
108
|
+
},
|
|
109
|
+
// 多选树时结果之间的分隔符,默认是逗号分隔
|
|
110
|
+
separator: {
|
|
111
|
+
type: String,
|
|
112
|
+
default: ','
|
|
113
|
+
}
|
|
114
|
+
}>()
|
|
115
|
+
const emits = defineEmits(["close"])
|
|
116
|
+
const orgTreeRef = ref(null)
|
|
117
|
+
let tenantInfo = ref(null)
|
|
118
|
+
let containBranch = ref(false)
|
|
119
|
+
let tenantName = ref(null)
|
|
120
|
+
let tenantNodeId = -1
|
|
121
|
+
let departments = ref([])
|
|
122
|
+
let checkedKeys = ref([])
|
|
123
|
+
let selectDepts = ref([])
|
|
124
|
+
let selectDeptNodeIds = ref([])
|
|
125
|
+
let clickDepts = ref([])
|
|
126
|
+
let defaultCheckedKeys = ref([])
|
|
127
|
+
let deptResultRef:Ref<any> = ref(null)
|
|
128
|
+
let checkAll = ref(false)
|
|
129
|
+
let searchParam = ref({
|
|
130
|
+
searchValue: null,
|
|
131
|
+
treeType: 'GROUP_TREE',
|
|
132
|
+
departmentInfo: null
|
|
133
|
+
})
|
|
134
|
+
const {t} = useI18n()
|
|
135
|
+
onMounted(()=>{
|
|
136
|
+
initSelectGroups(props.searchField, props.selectWorkgroupInfo, props.separator ).then((departments)=>{
|
|
137
|
+
selectDepts.value = departments
|
|
138
|
+
getTenantInfo()
|
|
139
|
+
})
|
|
140
|
+
resizeScrollTargetHeight()
|
|
141
|
+
})
|
|
142
|
+
function getTenantInfo() {
|
|
143
|
+
getTenant().then(data=>{
|
|
144
|
+
const tenantData = data[0].data
|
|
145
|
+
tenantInfo.value = JSON.parse(tenantData)
|
|
146
|
+
containBranch.value = data[0].containBranch
|
|
147
|
+
tenantName.value = data[0].name
|
|
148
|
+
getTenantChildrenDept()
|
|
149
|
+
})
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function getTenantChildrenDept() {
|
|
153
|
+
getTenantChildren(props.branchInfo, tenantNodeId).then(children=>{
|
|
154
|
+
departments.value = children
|
|
155
|
+
checkedDeptDefault(selectDepts.value, defaultCheckedKeys.value)
|
|
156
|
+
})
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function resizeScrollTargetHeight () {
|
|
160
|
+
const scrollTarget = document.querySelector('.org-tree')
|
|
161
|
+
let height = resizeScrollTargetHeightUtil(scrollTarget)
|
|
162
|
+
const titleArea = 110
|
|
163
|
+
const deptPathArea = 60
|
|
164
|
+
const allCheckArea = 60
|
|
165
|
+
const buttonArea = 60
|
|
166
|
+
height = height - titleArea - deptPathArea - allCheckArea - buttonArea
|
|
167
|
+
scrollTarget['style'].height = height + 'px'
|
|
168
|
+
scrollTarget['style'].minHeight = '300px'
|
|
169
|
+
// scrollTarget.style.maxHeight = height + 'px'
|
|
170
|
+
}
|
|
171
|
+
// 点击复选框时处理
|
|
172
|
+
function handleCheckNode(data, check, isChildrenCheck) {
|
|
173
|
+
if(props.multiple){
|
|
174
|
+
if(check) {
|
|
175
|
+
// 表示选择节点时
|
|
176
|
+
addToSelectDept(data)
|
|
177
|
+
} else {
|
|
178
|
+
// 表示取消选择
|
|
179
|
+
removeSelectDept(data)
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function handleClickNode(data, node, treenode, events) {
|
|
185
|
+
if(!props.multiple && data.nodeType && data.nodeType === 'WORKGROUP') {
|
|
186
|
+
selectDepts.value = [data]
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
function addToSelectDept(dept) {
|
|
192
|
+
console.log('addToSelectDept---selectDepts.value=', selectDepts.value, 'dept=', dept)
|
|
193
|
+
if(dept.nodeType && dept.nodeType === 'WORKGROUP') {
|
|
194
|
+
const filterValue = selectDepts.value.filter(item=> item.nodeId === dept.nodeId)
|
|
195
|
+
if(!filterValue || filterValue.length === 0) {
|
|
196
|
+
// 表示集合中没有该记录,需要记录到结果集合中
|
|
197
|
+
selectDepts.value.push(JSON.parse(JSON.stringify(dept)))
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function removeSelectDept(dept) {
|
|
203
|
+
const index = selectDepts.value.findIndex(selectItem=> selectItem.nodeId === dept.nodeId)
|
|
204
|
+
console.log('removeSelectDept---selectDepts.value=', selectDepts.value, 'dept=', dept, 'index=', index)
|
|
205
|
+
if(index !== undefined && index !== -1) {
|
|
206
|
+
// 删除指定元素
|
|
207
|
+
selectDepts.value.splice(index, 1)
|
|
208
|
+
}
|
|
209
|
+
checkAll.value =false
|
|
210
|
+
}
|
|
211
|
+
function changeAllCheck(value: boolean) {
|
|
212
|
+
console.log('changeCheck====value=', value)
|
|
213
|
+
if(props.multiple) {
|
|
214
|
+
// 表示是复选组织树
|
|
215
|
+
if(value){
|
|
216
|
+
// 表示全选时
|
|
217
|
+
const allNodeIds = departments.value.map((item)=>{
|
|
218
|
+
return item['nodeId'];
|
|
219
|
+
})
|
|
220
|
+
orgTreeRef.value.setCheckedKeys(allNodeIds, false)
|
|
221
|
+
departments.value.forEach(item=>{
|
|
222
|
+
addToSelectDept(item)
|
|
223
|
+
})
|
|
224
|
+
} else {
|
|
225
|
+
// 表示取消全选时
|
|
226
|
+
departments.value.forEach(item=>{
|
|
227
|
+
removeSelectDept(item)
|
|
228
|
+
})
|
|
229
|
+
orgTreeRef.value.setCheckedKeys([], false)
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// function loadChildrenDept(dept) {
|
|
235
|
+
// loadDepartment(dept.id).then(children=>{
|
|
236
|
+
// departments.value = children
|
|
237
|
+
// checkedDeptDefault(selectDepts.value, defaultCheckedKeys.value)
|
|
238
|
+
|
|
239
|
+
// })
|
|
240
|
+
// }
|
|
241
|
+
// function loadChildren (dept, isBreadcrumb) {
|
|
242
|
+
// clickDepts.value.push(dept)
|
|
243
|
+
// loadChildrenDept(dept)
|
|
244
|
+
// }
|
|
245
|
+
|
|
246
|
+
// function clickBreadcrumb(item, isTenant, index) {
|
|
247
|
+
// if(isTenant) {
|
|
248
|
+
// // 表示点击的时公司节点
|
|
249
|
+
// clickDepts.value = []
|
|
250
|
+
// getTenantChildrenDept()
|
|
251
|
+
// } else {
|
|
252
|
+
// // 表示点击的是部门节点
|
|
253
|
+
// // 删除指定元素
|
|
254
|
+
// clickDepts.value.splice(index+1, clickDepts.value.length - (index + 1) )
|
|
255
|
+
// loadChildrenDept(item)
|
|
256
|
+
// }
|
|
257
|
+
// }
|
|
258
|
+
|
|
259
|
+
function showResult() {
|
|
260
|
+
deptResultRef.value.showResult()
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
function removeResultDept(dept) {
|
|
264
|
+
const removeDeptInDepts = selectDepts.value.filter(item=>item.nodeId === dept.nodeId)
|
|
265
|
+
console.log('removeResultDept-----removeDeptInDepts=', removeDeptInDepts)
|
|
266
|
+
if(removeDeptInDepts && removeDeptInDepts.length > 0) {
|
|
267
|
+
// departments结果存在当前移除的节点时,check-change事件会走removeSelectDept的逻辑
|
|
268
|
+
const selectNodeIds = []
|
|
269
|
+
selectDepts.value.forEach(item=>{
|
|
270
|
+
if(item.nodeId !== dept.nodeId) {
|
|
271
|
+
selectNodeIds.push(item.nodeId)
|
|
272
|
+
}
|
|
273
|
+
})
|
|
274
|
+
console.log('removeResultDept-----selectNodeIds=', selectNodeIds)
|
|
275
|
+
orgTreeRef.value.setCheckedKeys(selectNodeIds, true)
|
|
276
|
+
}
|
|
277
|
+
removeSelectDept(dept)
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function saveDept() {
|
|
281
|
+
if (props.multiple) {
|
|
282
|
+
let leafSelectNodeInfo = {
|
|
283
|
+
ids: [],
|
|
284
|
+
names: [],
|
|
285
|
+
codes: [],
|
|
286
|
+
workgroups: []
|
|
287
|
+
}
|
|
288
|
+
// const parentIds = []
|
|
289
|
+
selectDepts.value.forEach(node => {
|
|
290
|
+
// node.data是部门对象的json字符串信息,通过JSON.parse(node.data)将json字符串转为对象
|
|
291
|
+
let departmentData
|
|
292
|
+
// 点开initSelectDepts 查询的数据只有一层
|
|
293
|
+
if (node.data !== null && node.data !== undefined) {
|
|
294
|
+
departmentData = JSON.parse(node.data)
|
|
295
|
+
} else {
|
|
296
|
+
departmentData = node
|
|
297
|
+
}
|
|
298
|
+
addSelectedDepartmentInfo(leafSelectNodeInfo, node, departmentData)
|
|
299
|
+
})
|
|
300
|
+
let selectNodeInfo = {
|
|
301
|
+
ids: [],
|
|
302
|
+
names: [],
|
|
303
|
+
codes: [],
|
|
304
|
+
workgroups: []
|
|
305
|
+
}
|
|
306
|
+
Object.assign(selectNodeInfo, leafSelectNodeInfo)
|
|
307
|
+
if (selectNodeInfo.ids.length > 0) {
|
|
308
|
+
emits('close', selectNodeInfo)
|
|
309
|
+
} else {
|
|
310
|
+
ElMessage({
|
|
311
|
+
message: t('imatrixUIMessage.pleaseSelectDepartment'),
|
|
312
|
+
type: 'warning',
|
|
313
|
+
})
|
|
314
|
+
}
|
|
315
|
+
} else {
|
|
316
|
+
const dept = selectDepts.value[0]
|
|
317
|
+
const department = JSON.parse(dept.data)
|
|
318
|
+
const showName = dept.name
|
|
319
|
+
// if (this.containBranch && dept.branchName) {
|
|
320
|
+
// // 如果包含分支机构,则拼接分支机构名称
|
|
321
|
+
// name = name + '(' + dept.branchName + ')'
|
|
322
|
+
// }
|
|
323
|
+
department.tenantName = tenantInfo.value.tenantName
|
|
324
|
+
department.tenantCode = tenantInfo.value.code
|
|
325
|
+
const selectNodeInfo = {
|
|
326
|
+
id: dept.id,
|
|
327
|
+
name: showName,
|
|
328
|
+
code: department.code,
|
|
329
|
+
containBranch: containBranch.value,
|
|
330
|
+
workgroup: department
|
|
331
|
+
}
|
|
332
|
+
emits('close', selectNodeInfo)
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
// 将选中的部门节点添加到结果集合中
|
|
336
|
+
function addSelectedDepartmentInfo (result, node, department) {
|
|
337
|
+
result.ids.push(node.id)
|
|
338
|
+
result.codes.push(department.code)
|
|
339
|
+
result.containBranch = containBranch.value
|
|
340
|
+
department.tenantCode = tenantInfo.value.code
|
|
341
|
+
department.tenantName = tenantInfo.value.tenantName
|
|
342
|
+
result.workgroups.push(department)
|
|
343
|
+
const showName = department.name
|
|
344
|
+
// if (this.containBranch && node.branchName) {
|
|
345
|
+
// // 如果包含分支机构,则拼接分支机构名称
|
|
346
|
+
// name = name + '(' + node.branchName + ')'
|
|
347
|
+
// }
|
|
348
|
+
result.names.push(showName)
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
function filterAppendNodes ( ) {
|
|
352
|
+
if (searchParam.value.searchValue) {
|
|
353
|
+
searchParam.value.searchValue = searchParam.value.searchValue.trim()
|
|
354
|
+
searchParam.value.departmentInfo = props.branchInfo
|
|
355
|
+
window['$vueApp'].config.globalProperties.$http.post(window['$vueApp'].config.globalProperties.baseAPI + '/component/organization-trees/search-mobile-workgroups', searchParam.value).then(result => {
|
|
356
|
+
if (result) {
|
|
357
|
+
if (result.length === 0) {
|
|
358
|
+
ElMessage({
|
|
359
|
+
message: t('imatrixUIMessage.queryResultIsEmpty'),
|
|
360
|
+
type: 'warning',
|
|
361
|
+
})
|
|
362
|
+
}
|
|
363
|
+
departments.value = result
|
|
364
|
+
} else {
|
|
365
|
+
ElMessage({
|
|
366
|
+
message: t('imatrixUIMessage.queryResultIsEmpty'),
|
|
367
|
+
type: 'warning',
|
|
368
|
+
})
|
|
369
|
+
}
|
|
370
|
+
})
|
|
371
|
+
} else {
|
|
372
|
+
getTenantChildrenDept()
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
</script>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export function getTenant () {
|
|
2
|
+
const parentId = 0
|
|
3
|
+
return window['$vueApp'].config.globalProperties.$http.get(window['$vueApp'].config.globalProperties.baseAPI + '/component/organization-trees/departments/' + parentId)
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
// 获得公司节点的孩子节点
|
|
7
|
+
export function getTenantChildren (branchInfo, tenantNodeId ) {
|
|
8
|
+
// 加载整个组织结构树时,展开公司节点
|
|
9
|
+
return loadGroupNodes(branchInfo, tenantNodeId)
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// 加载当前节点的子节点
|
|
14
|
+
function loadGroupNodes (branchInfo, parentId) {
|
|
15
|
+
const param = {
|
|
16
|
+
parentId: parentId,
|
|
17
|
+
departmentInfo: branchInfo,
|
|
18
|
+
}
|
|
19
|
+
return new Promise((resolve,reject)=>{
|
|
20
|
+
window['$vueApp'].config.globalProperties.$http.post(
|
|
21
|
+
window.$vueApp.config.globalProperties.baseAPI +
|
|
22
|
+
'/component/organization-trees/workgroups',
|
|
23
|
+
param
|
|
24
|
+
)
|
|
25
|
+
.then(children => {
|
|
26
|
+
resolve(children)
|
|
27
|
+
})
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function checkedDeptDefault (selectDepts, defaultCheckedKeys) {
|
|
32
|
+
defaultCheckedKeys = []
|
|
33
|
+
selectDepts.forEach(dept => {
|
|
34
|
+
defaultCheckedKeys.push(dept.nodeId)
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
export function initSelectGroups(searchField, selectGroupInfo, separator) {
|
|
38
|
+
return new Promise((resolve, reject) => {
|
|
39
|
+
if (!searchField) {
|
|
40
|
+
resolve([])
|
|
41
|
+
} else if (!selectGroupInfo) {
|
|
42
|
+
resolve([])
|
|
43
|
+
} else {
|
|
44
|
+
window['$vueApp'].config.globalProperties.$http
|
|
45
|
+
.get(
|
|
46
|
+
window.$vueApp.config.globalProperties.baseAPI +
|
|
47
|
+
'/component/organization-trees/select-workgroups?searchField=' +
|
|
48
|
+
searchField +
|
|
49
|
+
'&selectWorkgroupInfo=' +
|
|
50
|
+
selectGroupInfo +
|
|
51
|
+
'&separator=' +
|
|
52
|
+
separator
|
|
53
|
+
)
|
|
54
|
+
.then((groups) => {
|
|
55
|
+
resolve(groups)
|
|
56
|
+
})
|
|
57
|
+
.catch((error) => {
|
|
58
|
+
reject(error)
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
+
<WorkgroupMobileUserTree
|
|
4
|
+
v-if="isMobile"
|
|
5
|
+
:multiple="multiple"
|
|
6
|
+
:branch-info="branchInfo"
|
|
7
|
+
:search-field="searchField"
|
|
8
|
+
:select-user-info="selectUserInfo"
|
|
9
|
+
:separator="separator"
|
|
10
|
+
@close="result"
|
|
11
|
+
/>
|
|
3
12
|
<el-dialog
|
|
13
|
+
v-else
|
|
4
14
|
:close-on-click-modal="false"
|
|
5
15
|
:title="myTitle"
|
|
6
16
|
:width="multiple ? '60%' : '40%'"
|
|
@@ -38,11 +48,14 @@
|
|
|
38
48
|
<script>
|
|
39
49
|
import {$on, $off, $once, $emit} from '../../utils/gogocodeTransfer'
|
|
40
50
|
import InlineWorkgroupUserTree from '../../workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue'
|
|
51
|
+
import WorkgroupMobileUserTree from '../../workgroup-user-tree-mobile/src/workgroup-user-tree-app.vue'
|
|
52
|
+
import {isMobileBrowser} from '../../../src/utils/common-util'
|
|
41
53
|
|
|
42
54
|
export default {
|
|
43
55
|
name: 'WorkgroupUserTree',
|
|
44
56
|
components: {
|
|
45
57
|
InlineWorkgroupUserTree,
|
|
58
|
+
WorkgroupMobileUserTree
|
|
46
59
|
},
|
|
47
60
|
props: {
|
|
48
61
|
// 是否是多选树,默认是true
|
|
@@ -86,8 +99,10 @@ export default {
|
|
|
86
99
|
if (this.title) {
|
|
87
100
|
myTitle = this.title
|
|
88
101
|
}
|
|
102
|
+
const isMobile = isMobileBrowser()
|
|
89
103
|
return {
|
|
90
104
|
myTitle,
|
|
105
|
+
isMobile
|
|
91
106
|
}
|
|
92
107
|
},
|
|
93
108
|
methods: {
|
|
@@ -235,5 +235,32 @@ const workgroupTreeInlineService = {
|
|
|
235
235
|
}
|
|
236
236
|
})
|
|
237
237
|
},
|
|
238
|
+
// 根据指定用户信息获得用户集合
|
|
239
|
+
initSelectUsers(searchField, selectUserInfo, separator) {
|
|
240
|
+
return new Promise((resolve, reject) => {
|
|
241
|
+
if (!searchField) {
|
|
242
|
+
resolve([])
|
|
243
|
+
} else if (!selectUserInfo) {
|
|
244
|
+
resolve([])
|
|
245
|
+
} else {
|
|
246
|
+
window.$vueApp.config.globalProperties.$http
|
|
247
|
+
.get(
|
|
248
|
+
window.$vueApp.config.globalProperties.baseAPI +
|
|
249
|
+
'/component/organization-trees/select-users?searchField=' +
|
|
250
|
+
searchField +
|
|
251
|
+
'&selectUserInfo=' +
|
|
252
|
+
selectUserInfo +
|
|
253
|
+
'&separator=' +
|
|
254
|
+
separator
|
|
255
|
+
)
|
|
256
|
+
.then((users) => {
|
|
257
|
+
resolve(users)
|
|
258
|
+
})
|
|
259
|
+
.catch((error) => {
|
|
260
|
+
reject(error)
|
|
261
|
+
})
|
|
262
|
+
}
|
|
263
|
+
})
|
|
264
|
+
}
|
|
238
265
|
}
|
|
239
266
|
export default workgroupTreeInlineService
|
|
@@ -201,6 +201,17 @@ export default {
|
|
|
201
201
|
},
|
|
202
202
|
},
|
|
203
203
|
created() {
|
|
204
|
+
if(this.multiple){
|
|
205
|
+
this.initSelectUsers(
|
|
206
|
+
this.searchField,
|
|
207
|
+
this.selectUserInfo,
|
|
208
|
+
this.separator
|
|
209
|
+
).then((users) => {
|
|
210
|
+
if (users) {
|
|
211
|
+
this.selectResult = users
|
|
212
|
+
}
|
|
213
|
+
})
|
|
214
|
+
}
|
|
204
215
|
},
|
|
205
216
|
mounted() {
|
|
206
217
|
var searchWorkgroup = localStorage.getObject(this.searchStoreKey)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
<template>
|
|
3
|
+
<el-breadcrumb separator="/">
|
|
4
|
+
<el-breadcrumb-item>
|
|
5
|
+
<span class="breadcrumb-label-link" v-if="clickDepts.length > 0" @click="clickBreadcrumb(null, true)">{{myTenantName}}</span>
|
|
6
|
+
<span v-else>{{myTenantName}}</span>
|
|
7
|
+
</el-breadcrumb-item>
|
|
8
|
+
<el-breadcrumb-item
|
|
9
|
+
v-for="(dept,index) in clickDepts"
|
|
10
|
+
:key="dept.id"
|
|
11
|
+
>
|
|
12
|
+
<span class="breadcrumb-label-link" v-if="index < clickDepts.length - 1" @click="clickBreadcrumb(dept,false, index )" >{{dept.showName}}</span>
|
|
13
|
+
<span v-else>{{dept.showName}}</span>
|
|
14
|
+
</el-breadcrumb-item>
|
|
15
|
+
</el-breadcrumb>
|
|
16
|
+
</template>
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
import { reactive,ref,onMounted, defineEmits } from 'vue'
|
|
19
|
+
const props = defineProps({
|
|
20
|
+
tenantName:{
|
|
21
|
+
type: String,
|
|
22
|
+
default: null
|
|
23
|
+
},
|
|
24
|
+
clickDepts: {
|
|
25
|
+
type: Array<any>,
|
|
26
|
+
default: null
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
const emits = defineEmits(['clickBreadcrumb'])
|
|
30
|
+
|
|
31
|
+
let myTenantName = ref(props.tenantName)
|
|
32
|
+
|
|
33
|
+
function clickBreadcrumb (item, isTenant, index) {
|
|
34
|
+
emits('clickBreadcrumb', item, isTenant, index )
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
|
|
2
|
+
<template>
|
|
3
|
+
<el-drawer v-model="isShowForm" direction="btt" size="80%" class="organization-tree">
|
|
4
|
+
<template #header>
|
|
5
|
+
<div style="text-align: center;">
|
|
6
|
+
{{$t('departmentTreeInline.selectResultTitle')}}
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
<template #default>
|
|
10
|
+
<el-tree
|
|
11
|
+
v-if="isShowForm"
|
|
12
|
+
ref="orgResultTreeRef"
|
|
13
|
+
:data="selectUsers"
|
|
14
|
+
node-key="nodeId"
|
|
15
|
+
>
|
|
16
|
+
<template #default="{ node, data }">
|
|
17
|
+
<div class="item-row">
|
|
18
|
+
<div class="item-label">{{ data.showName }}
|
|
19
|
+
<span v-if="data.nodeType && data.nodeType ==='USER'" style="color:#999">({{ data.loginName }}{{ getUserMainDeptName(data) ? '/'+getUserMainDeptName(data): ''}})</span>
|
|
20
|
+
<span v-if="data.parentNodeId !== '-1' && getDeptNamePath(data)" style="color:#999">({{ getDeptNamePath(data) }})</span>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="item-side" @click="removeDept(data)">
|
|
23
|
+
<el-icon><DeleteFilled /></el-icon>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
</el-tree>
|
|
28
|
+
</template>
|
|
29
|
+
</el-drawer>
|
|
30
|
+
</template>
|
|
31
|
+
<script setup lang="ts">
|
|
32
|
+
import {
|
|
33
|
+
DeleteFilled
|
|
34
|
+
} from '@element-plus/icons-vue'
|
|
35
|
+
import { reactive,ref,onMounted, defineEmits } from 'vue'
|
|
36
|
+
import { getUserMainDeptName, getDeptNamePath} from '../../utils/organization.ts'
|
|
37
|
+
const props = defineProps({
|
|
38
|
+
selectUsers: {
|
|
39
|
+
type: Array<any>,
|
|
40
|
+
default: null
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
let isShowForm = ref(false)
|
|
44
|
+
// onMounted(()=>{
|
|
45
|
+
// treeData.value = props.selectUsers.concat(props.selectDepts)
|
|
46
|
+
// })
|
|
47
|
+
const emits = defineEmits(['removeResult'])
|
|
48
|
+
function removeDept (item) {
|
|
49
|
+
emits('removeResult', item )
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function showResult() {
|
|
53
|
+
isShowForm.value = true
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
defineExpose({showResult})
|
|
57
|
+
|
|
58
|
+
</script>
|