agilebuilder-ui 1.1.36-sit4 → 1.1.36-tmp1
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/{401-d4decb58.js → 401-c55bdcf2.js} +1 -1
- package/lib/{404-74cc4843.js → 404-c1dbd5e1.js} +1 -1
- package/lib/{iframe-page-c7973b9d.js → iframe-page-917912ae.js} +1 -1
- package/lib/{index-c739d5d5.js → index-6ec53ef7.js} +8463 -8490
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +1 -1
- package/lib/super-ui.umd.cjs +99 -99
- package/lib/{tab-content-iframe-index-18ef0e35.js → tab-content-iframe-index-46a76242.js} +1 -1
- package/lib/{tab-content-index-72db2984.js → tab-content-index-132379e6.js} +1 -1
- package/lib/{tache-subprocess-history-4d3623ca.js → tache-subprocess-history-384455d6.js} +1 -1
- package/package.json +1 -1
- package/packages/department-tree/src/department-tree.vue +123 -130
- package/packages/department-tree-inline/src/department-multi-tree-inline.vue +466 -435
- package/packages/department-tree-inline/src/department-single-tree-inline.vue +342 -335
- package/packages/department-tree-inline/src/department-tree-inline.vue +11 -18
- package/packages/department-tree-inline/src/department-tree-service.js +11 -10
- package/packages/department-tree-mobile/src/department-tree-app.vue +75 -103
- package/packages/department-tree-mobile/src/department-tree-inline-app.vue +225 -256
- package/packages/department-tree-mobile/src/department-tree-service.ts +75 -98
- package/packages/department-user-tree/src/department-user-multiple-tree.vue +115 -112
- package/packages/department-user-tree/src/department-user-single-tree.vue +88 -85
- package/packages/department-user-tree/src/department-user-tree.vue +119 -127
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +1 -6
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +0 -5
- package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +11 -18
- package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +51 -26
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +45 -25
- package/packages/department-user-tree-inline/src/group-user/group-list.vue +90 -97
- package/packages/department-user-tree-inline/src/group-user/group-user.vue +32 -28
- package/packages/department-user-tree-mobile/src/department-user-tree-app.vue +75 -103
- package/packages/department-user-tree-mobile/src/department-user-tree-inline-app.vue +224 -282
- package/packages/department-user-tree-mobile/src/department-user-tree-service.ts +51 -58
- package/packages/fs-preview/src/fs-preview.vue +2 -20
- package/packages/fs-upload-list/src/fs-upload-list.vue +7 -30
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +1 -1
- package/packages/fs-upload-new/src/fs-preview-new.vue +15 -27
- package/packages/index.js +4 -4
- package/packages/organization-input/src/organization-input.vue +12 -34
- package/packages/super-grid/src/apis.js +4 -21
- package/packages/super-grid/src/dynamic-input.vue +12 -1
- package/packages/super-grid/src/normal-column-content.vue +1 -2
- package/packages/super-grid/src/row-operation.vue +13 -23
- package/packages/super-grid/src/super-grid.vue +42 -51
- package/packages/super-grid/src/utils.js +8 -13
- package/packages/super-icon/src/index.vue +1 -4
- package/packages/workgroup-tree/src/workgroup-tree.vue +110 -117
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +1 -6
- package/packages/workgroup-tree-mobile/src/workgroup-tree-app.vue +75 -103
- package/packages/workgroup-tree-mobile/src/workgroup-tree-inline-app.vue +208 -229
- package/src/api/sso-service.js +5 -6
- package/src/directives/permission/index.js +4 -4
- package/src/index.js +3 -38
- package/src/store/modules/table.js +1 -0
- package/src/styles/theme/dark-blue/sidebar.scss +0 -9
- package/src/styles/theme/gray/sidebar.scss +8 -9
- package/src/styles/theme/green/sidebar.scss +0 -10
- package/src/styles/theme/ocean-blue/sidebar.scss +0 -9
- package/src/styles/theme/tiffany-blue-mobile/sidebar.scss +0 -9
- package/src/utils/insert_css.js +1 -1
- package/src/views/dsc-component/Sidebar/SidebarItem.vue +2 -2
- package/src/views/dsc-component/Sidebar/index.vue +18 -36
- package/src/views/layout/components/Menubar/Item.vue +9 -0
- package/src/views/layout/components/Menubar/SidebarItem.vue +2 -2
- package/src/views/layout/components/Sidebar/Item.vue +1 -4
- package/src/views/layout/components/Sidebar/SidebarItem.vue +2 -2
- package/vite.config.js +1 -1
|
@@ -2,140 +2,112 @@
|
|
|
2
2
|
<div>
|
|
3
3
|
<el-card class="card-content" style="height: 50px">
|
|
4
4
|
<el-row class="item-row item-row-all">
|
|
5
|
-
<el-col style="width: 100
|
|
5
|
+
<el-col style="width: 100%;">
|
|
6
6
|
<div style="display: flex">
|
|
7
|
-
<div style="flex: 0 0 20%;
|
|
8
|
-
<el-checkbox
|
|
9
|
-
v-if="multiple"
|
|
10
|
-
v-model="checkAll"
|
|
11
|
-
:label="$t('departmentTreeInline.allCheck')"
|
|
12
|
-
value="all"
|
|
13
|
-
@change="changeAllCheck"
|
|
14
|
-
/>
|
|
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" />
|
|
15
9
|
</div>
|
|
16
|
-
<div style="flex: 0 0 80%;
|
|
17
|
-
<el-input
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
@clear="filterAppendNodes"
|
|
21
|
-
@keyup.enter="filterAppendNodes"
|
|
22
|
-
@blur="filterAppendNodes"
|
|
23
|
-
clearable
|
|
24
|
-
>
|
|
25
|
-
<template v-slot:suffix>
|
|
26
|
-
<el-icon @click="filterAppendNodes"><Search /></el-icon>
|
|
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>
|
|
27
14
|
</template>
|
|
28
15
|
</el-input>
|
|
29
16
|
</div>
|
|
30
17
|
</div>
|
|
31
|
-
|
|
18
|
+
</el-col>
|
|
32
19
|
</el-row>
|
|
33
20
|
</el-card>
|
|
34
|
-
<el-card
|
|
21
|
+
<el-card v-if="tenantName" class="card-content" >
|
|
35
22
|
<el-row class="item-row item-row-all">
|
|
36
|
-
<el-col class="item-label dept-path"
|
|
37
|
-
><deptPath :tenantName="tenantName" :clickDepts="clickDepts" @clickBreadcrumb="clickBreadcrumb"
|
|
38
|
-
/></el-col>
|
|
23
|
+
<el-col class="item-label dept-path"><deptPath :tenantName="tenantName" :clickDepts="clickDepts" @clickBreadcrumb="clickBreadcrumb"/></el-col>
|
|
39
24
|
</el-row>
|
|
40
25
|
</el-card>
|
|
41
|
-
<el-card class="card-content org-tree" style="overflow: auto">
|
|
26
|
+
<el-card class="card-content org-tree" style="overflow: auto;">
|
|
42
27
|
<el-tree
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
</div>
|
|
28
|
+
ref="orgTreeRef"
|
|
29
|
+
:data="departments"
|
|
30
|
+
:show-checkbox="multiple"
|
|
31
|
+
node-key="nodeId"
|
|
32
|
+
check-on-click-node
|
|
33
|
+
:default-checked-keys="defaultCheckedKeys"
|
|
34
|
+
@check-change="handleCheckNode"
|
|
35
|
+
@node-click="handleClickNode"
|
|
36
|
+
>
|
|
37
|
+
<template #default="{ node, data }">
|
|
38
|
+
<div class="item-row">
|
|
39
|
+
<div class="item-label">{{ data.showName }}</div>
|
|
40
|
+
<div v-if="!data.leaf" class="item-side" @click="loadChildren(data,false)">
|
|
41
|
+
<el-icon><ArrowRight /></el-icon>
|
|
58
42
|
</div>
|
|
59
|
-
</
|
|
60
|
-
</
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
</el-tree>
|
|
61
46
|
</el-card>
|
|
62
|
-
<el-card
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<span style="padding-left: 10px"
|
|
71
|
-
><el-icon><ArrowUpBold /></el-icon
|
|
72
|
-
></span>
|
|
73
|
-
</span>
|
|
74
|
-
</span>
|
|
75
|
-
<span v-else-if="selectDepts.length > 0">
|
|
76
|
-
{{ $t('departmentTreeInline.selectResultInfoHasSelect') }}{{ selectDepts[0].showName
|
|
77
|
-
}}<span v-if="selectDepts[0].parentNodeId !== '-1' && getDeptNamePath(selectDepts[0])" style="color: #999"
|
|
78
|
-
>({{ getDeptNamePath(selectDepts[0]) }})</span
|
|
79
|
-
>
|
|
47
|
+
<el-card class="card-footer">
|
|
48
|
+
<div style="display: flex;">
|
|
49
|
+
<div class="select-result" @click="showResult">
|
|
50
|
+
<!-- 已选择:6人,其中有一个部门(含子部门) -->
|
|
51
|
+
<span v-if="multiple" @click="showResult">
|
|
52
|
+
<span v-if="selectDepts.length > 0">
|
|
53
|
+
{{$t('departmentTreeInline.selectResultInfoHasSelect')}}{{$t('departmentTreeInline.selectResultInfo',{num: selectDepts.length })}}
|
|
54
|
+
<span style="padding-left: 10px"><el-icon><ArrowUpBold /></el-icon></span>
|
|
80
55
|
</span>
|
|
81
|
-
</
|
|
82
|
-
<
|
|
83
|
-
<
|
|
84
|
-
</
|
|
56
|
+
</span>
|
|
57
|
+
<span v-else-if="selectDepts.length > 0">
|
|
58
|
+
{{$t('departmentTreeInline.selectResultInfoHasSelect')}}{{selectDepts[0].showName }}<span v-if="selectDepts[0].parentNodeId !== '-1' && getDeptNamePath(selectDepts[0])" style="color:#999">({{ getDeptNamePath(selectDepts[0]) }})</span>
|
|
59
|
+
</span>
|
|
60
|
+
</div>
|
|
61
|
+
<div class="button-area">
|
|
62
|
+
<el-button size="large" type="primary" @click="saveDept">{{$t('imatrixUIPublicModel.sure')}}</el-button>
|
|
85
63
|
</div>
|
|
64
|
+
</div>
|
|
86
65
|
</el-card>
|
|
87
|
-
<deptResult ref="deptResultRef" :selectDepts="selectDepts" @removeDept="removeResultDept"
|
|
66
|
+
<deptResult ref="deptResultRef" :selectDepts="selectDepts" @removeDept="removeResultDept"/>
|
|
88
67
|
</div>
|
|
89
68
|
</template>
|
|
90
69
|
|
|
91
|
-
<script
|
|
92
|
-
import { reactive,
|
|
93
|
-
import { ArrowRight, Search, ArrowUpBold } from '@element-plus/icons-vue'
|
|
70
|
+
<script setup lang="ts">
|
|
71
|
+
import { reactive,ref,onMounted, defineEmits,Ref } from 'vue'
|
|
94
72
|
import {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
} from '
|
|
101
|
-
import { resizeScrollTargetHeightUtil, getDeptNamePath } from '../../utils/organization.ts'
|
|
73
|
+
ArrowRight,
|
|
74
|
+
Search,
|
|
75
|
+
ArrowUpBold
|
|
76
|
+
} from '@element-plus/icons-vue'
|
|
77
|
+
import {getTenant, getTenantChildren, checkedDeptDefault, loadDepartment, initSelectDepts} from './department-tree-service.ts'
|
|
78
|
+
import {resizeScrollTargetHeightUtil, getDeptNamePath} from '../../utils/organization.ts'
|
|
102
79
|
import deptPath from './dept-path.vue'
|
|
103
80
|
import deptResult from './dept-result.vue'
|
|
104
|
-
import {
|
|
105
|
-
import {
|
|
81
|
+
import {ElMessage} from 'element-plus'
|
|
82
|
+
import {useI18n} from "vue-i18n"
|
|
106
83
|
const props = defineProps<{
|
|
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
|
-
type: String
|
|
135
|
-
default: 'code'
|
|
136
|
-
}
|
|
137
|
-
}>()
|
|
138
|
-
const emits = defineEmits(['close'])
|
|
84
|
+
// 是否是多选树,默认是true
|
|
85
|
+
multiple: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: true,
|
|
88
|
+
},
|
|
89
|
+
// 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
|
|
90
|
+
departmentInfo: {
|
|
91
|
+
type: Array<any>,
|
|
92
|
+
default: null,
|
|
93
|
+
},
|
|
94
|
+
// 多选部门树时,已选择部门id或部门名称或编码集合,多个之间以逗号隔开
|
|
95
|
+
selectDepartmentInfo: {
|
|
96
|
+
type: [String, Number],
|
|
97
|
+
default: null,
|
|
98
|
+
},
|
|
99
|
+
// 移除部门时,部门属性名称:id、name、code,默认是id
|
|
100
|
+
searchField: {
|
|
101
|
+
type: String,
|
|
102
|
+
default: 'id',
|
|
103
|
+
},
|
|
104
|
+
// 多选树时结果之间的分隔符,默认是逗号分隔
|
|
105
|
+
separator: {
|
|
106
|
+
type: String,
|
|
107
|
+
default: ','
|
|
108
|
+
}
|
|
109
|
+
}>()
|
|
110
|
+
const emits = defineEmits(["close"])
|
|
139
111
|
const orgTreeRef = ref(null)
|
|
140
112
|
let tenantInfo = ref(null)
|
|
141
113
|
let containBranch = ref(false)
|
|
@@ -147,7 +119,7 @@ let selectDepts = ref([])
|
|
|
147
119
|
let selectDeptNodeIds = ref([])
|
|
148
120
|
let clickDepts = ref([])
|
|
149
121
|
let defaultCheckedKeys = ref([])
|
|
150
|
-
let deptResultRef:
|
|
122
|
+
let deptResultRef:Ref<any> = ref(null)
|
|
151
123
|
let checkAll = ref(false)
|
|
152
124
|
let searchParam = ref({
|
|
153
125
|
userField: 'name',
|
|
@@ -155,16 +127,16 @@ let searchParam = ref({
|
|
|
155
127
|
treeType: 'DEPARTMENT_TREE',
|
|
156
128
|
departmentInfo: null
|
|
157
129
|
})
|
|
158
|
-
const {
|
|
159
|
-
onMounted(()
|
|
160
|
-
initSelectDepts(props.selectDepartmentInfo, tenantNodeId, props.searchField, props.separator).then((departments)
|
|
130
|
+
const {t} = useI18n()
|
|
131
|
+
onMounted(()=>{
|
|
132
|
+
initSelectDepts(props.selectDepartmentInfo, tenantNodeId, props.searchField, props.separator ).then((departments)=>{
|
|
161
133
|
selectDepts.value = departments
|
|
162
134
|
getTenantInfo()
|
|
163
135
|
})
|
|
164
136
|
resizeScrollTargetHeight()
|
|
165
137
|
})
|
|
166
138
|
function getTenantInfo() {
|
|
167
|
-
getTenant().then(
|
|
139
|
+
getTenant().then(data=>{
|
|
168
140
|
const tenantData = data[0].data
|
|
169
141
|
tenantInfo.value = JSON.parse(tenantData)
|
|
170
142
|
containBranch.value = data[0].containBranch
|
|
@@ -174,76 +146,77 @@ function getTenantInfo() {
|
|
|
174
146
|
}
|
|
175
147
|
|
|
176
148
|
function getTenantChildrenDept() {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
149
|
+
getTenantChildren(props.departmentInfo, tenantNodeId).then(children=>{
|
|
150
|
+
departments.value = children
|
|
151
|
+
checkedDeptDefault(selectDepts.value, defaultCheckedKeys.value)
|
|
152
|
+
})
|
|
181
153
|
}
|
|
182
154
|
|
|
183
|
-
function
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
155
|
+
function resizeScrollTargetHeight () {
|
|
156
|
+
const scrollTarget = document.querySelector('.org-tree')
|
|
157
|
+
let height = resizeScrollTargetHeightUtil(scrollTarget)
|
|
158
|
+
const titleArea = 110
|
|
159
|
+
const deptPathArea = 60
|
|
160
|
+
const allCheckArea = 60
|
|
161
|
+
const buttonArea = 60
|
|
162
|
+
height = height - titleArea - deptPathArea - allCheckArea - buttonArea
|
|
163
|
+
scrollTarget['style'].height = height + 'px'
|
|
164
|
+
scrollTarget['style'].minHeight = '300px'
|
|
165
|
+
// scrollTarget.style.maxHeight = height + 'px'
|
|
194
166
|
}
|
|
195
167
|
// 点击复选框时处理
|
|
196
168
|
function handleCheckNode(data, check, isChildrenCheck) {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
169
|
+
if(props.multiple) {
|
|
170
|
+
if(check) {
|
|
171
|
+
// 表示选择节点时
|
|
172
|
+
addToSelectDept(data)
|
|
173
|
+
} else {
|
|
174
|
+
// 表示取消选择
|
|
175
|
+
removeSelectDept(data)
|
|
176
|
+
}
|
|
204
177
|
}
|
|
205
|
-
}
|
|
206
178
|
}
|
|
207
179
|
|
|
208
180
|
function handleClickNode(data, node, treenode, events) {
|
|
209
|
-
if
|
|
181
|
+
if(!props.multiple && data.nodeType && data.nodeType === 'DEPARTMENT') {
|
|
210
182
|
selectDepts.value = [data]
|
|
211
183
|
}
|
|
212
184
|
}
|
|
213
185
|
|
|
186
|
+
|
|
214
187
|
function addToSelectDept(dept) {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
188
|
+
if(dept.nodeType && dept.nodeType === 'DEPARTMENT') {
|
|
189
|
+
const filterValue = selectDepts.value.filter(item=> (item.nodeId === dept.nodeId))
|
|
190
|
+
if(!filterValue || filterValue.length === 0) {
|
|
191
|
+
// 表示集合中没有该记录,需要记录到结果集合中
|
|
192
|
+
selectDepts.value.push(JSON.parse(JSON.stringify(dept)))
|
|
193
|
+
}
|
|
220
194
|
}
|
|
221
|
-
}
|
|
222
195
|
}
|
|
223
196
|
|
|
224
197
|
function removeSelectDept(dept) {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
198
|
+
const index = selectDepts.value.findIndex(selectItem=> (selectItem.nodeId === dept.nodeId))
|
|
199
|
+
// 删除指定元素
|
|
200
|
+
selectDepts.value.splice(index, 1)
|
|
201
|
+
checkAll.value =false
|
|
229
202
|
}
|
|
230
203
|
function changeAllCheck(value: boolean) {
|
|
231
204
|
console.log('changeCheck====value=', value)
|
|
232
|
-
if
|
|
205
|
+
if(props.multiple) {
|
|
233
206
|
// 表示是复选组织树
|
|
234
|
-
if
|
|
207
|
+
if(value){
|
|
235
208
|
// 表示全选时
|
|
236
|
-
const allNodeIds = departments.value.map((item)
|
|
237
|
-
|
|
209
|
+
const allNodeIds = departments.value.map((item)=>{
|
|
210
|
+
return item['nodeId'];
|
|
238
211
|
})
|
|
239
212
|
orgTreeRef.value.setCheckedKeys(allNodeIds, false)
|
|
240
|
-
departments.value.forEach(
|
|
213
|
+
departments.value.forEach(item=>{
|
|
241
214
|
addToSelectDept(item)
|
|
242
215
|
})
|
|
243
216
|
} else {
|
|
244
217
|
// 表示取消全选时
|
|
245
|
-
departments.value.forEach(
|
|
246
|
-
|
|
218
|
+
departments.value.forEach(item=>{
|
|
219
|
+
removeSelectDept(item)
|
|
247
220
|
})
|
|
248
221
|
orgTreeRef.value.setCheckedKeys([], false)
|
|
249
222
|
}
|
|
@@ -251,25 +224,26 @@ function changeAllCheck(value: boolean) {
|
|
|
251
224
|
}
|
|
252
225
|
|
|
253
226
|
function loadChildrenDept(dept) {
|
|
254
|
-
loadDepartment(dept.id).then(
|
|
227
|
+
loadDepartment(dept.id).then(children=>{
|
|
255
228
|
departments.value = children
|
|
256
|
-
checkedDeptDefault(selectDepts.value,
|
|
229
|
+
checkedDeptDefault(selectDepts.value, defaultCheckedKeys.value)
|
|
230
|
+
|
|
257
231
|
})
|
|
258
232
|
}
|
|
259
|
-
function
|
|
260
|
-
|
|
261
|
-
|
|
233
|
+
function loadChildren (dept, isBreadcrumb) {
|
|
234
|
+
clickDepts.value.push(dept)
|
|
235
|
+
loadChildrenDept(dept)
|
|
262
236
|
}
|
|
263
237
|
|
|
264
238
|
function clickBreadcrumb(item, isTenant, index) {
|
|
265
|
-
if
|
|
239
|
+
if(isTenant) {
|
|
266
240
|
// 表示点击的时公司节点
|
|
267
241
|
clickDepts.value = []
|
|
268
242
|
getTenantChildrenDept()
|
|
269
243
|
} else {
|
|
270
244
|
// 表示点击的是部门节点
|
|
271
245
|
// 删除指定元素
|
|
272
|
-
clickDepts.value.splice(index
|
|
246
|
+
clickDepts.value.splice(index+1, clickDepts.value.length - (index + 1) )
|
|
273
247
|
loadChildrenDept(item)
|
|
274
248
|
}
|
|
275
249
|
}
|
|
@@ -279,12 +253,12 @@ function showResult() {
|
|
|
279
253
|
}
|
|
280
254
|
|
|
281
255
|
function removeResultDept(dept) {
|
|
282
|
-
const removeDeptInDepts = selectDepts.value.filter(
|
|
283
|
-
if
|
|
256
|
+
const removeDeptInDepts = selectDepts.value.filter(item=>item.nodeId === dept.nodeId)
|
|
257
|
+
if(removeDeptInDepts && removeDeptInDepts.length > 0) {
|
|
284
258
|
// departments结果存在当前移除的节点时,check-change事件会走removeSelectDept的逻辑
|
|
285
259
|
const selectNodeIds = []
|
|
286
|
-
selectDepts.value.forEach(
|
|
287
|
-
if
|
|
260
|
+
selectDepts.value.forEach(item=>{
|
|
261
|
+
if(item.nodeId !== dept.nodeId) {
|
|
288
262
|
selectNodeIds.push(item.nodeId)
|
|
289
263
|
}
|
|
290
264
|
})
|
|
@@ -294,111 +268,106 @@ function removeResultDept(dept) {
|
|
|
294
268
|
}
|
|
295
269
|
|
|
296
270
|
function saveDept() {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
271
|
+
if (props.multiple) {
|
|
272
|
+
let leafSelectNodeInfo = {
|
|
273
|
+
ids: [],
|
|
274
|
+
names: [],
|
|
275
|
+
zhNames: [],
|
|
276
|
+
enNames: [],
|
|
277
|
+
codes: [],
|
|
278
|
+
departments: []
|
|
279
|
+
}
|
|
280
|
+
// const parentIds = []
|
|
281
|
+
selectDepts.value.forEach(node => {
|
|
282
|
+
// node.data是部门对象的json字符串信息,通过JSON.parse(node.data)将json字符串转为对象
|
|
283
|
+
let departmentData
|
|
284
|
+
// 点开initSelectDepts 查询的数据只有一层
|
|
285
|
+
if (node.data !== null && node.data !== undefined) {
|
|
286
|
+
departmentData = JSON.parse(node.data)
|
|
287
|
+
} else {
|
|
288
|
+
departmentData = node
|
|
289
|
+
}
|
|
290
|
+
addSelectedDepartmentInfo(leafSelectNodeInfo, node, departmentData)
|
|
291
|
+
})
|
|
292
|
+
let selectNodeInfo = {
|
|
293
|
+
ids: [],
|
|
294
|
+
names: [],
|
|
295
|
+
zhNames: [],
|
|
296
|
+
enNames: [],
|
|
297
|
+
codes: [],
|
|
298
|
+
departments: []
|
|
299
|
+
}
|
|
300
|
+
Object.assign(selectNodeInfo, leafSelectNodeInfo)
|
|
301
|
+
if (selectNodeInfo.ids.length > 0) {
|
|
302
|
+
emits('close', selectNodeInfo)
|
|
303
|
+
} else {
|
|
304
|
+
ElMessage({
|
|
305
|
+
message: t('imatrixUIMessage.pleaseSelectDepartment'),
|
|
306
|
+
type: 'warning',
|
|
307
|
+
})
|
|
308
|
+
}
|
|
313
309
|
} else {
|
|
314
|
-
|
|
310
|
+
const dept = selectDepts.value[0]
|
|
311
|
+
const department = JSON.parse(dept.data)
|
|
312
|
+
const showName = dept.showName
|
|
313
|
+
// if (this.containBranch && dept.branchName) {
|
|
314
|
+
// // 如果包含分支机构,则拼接分支机构名称
|
|
315
|
+
// name = name + '(' + dept.branchName + ')'
|
|
316
|
+
// }
|
|
317
|
+
department.tenantName = tenantInfo.value.tenantName
|
|
318
|
+
department.tenantCode = tenantInfo.value.code
|
|
319
|
+
const selectNodeInfo = {
|
|
320
|
+
id: dept.id,
|
|
321
|
+
name: showName,
|
|
322
|
+
zhName: department.name,
|
|
323
|
+
enName: department.enName,
|
|
324
|
+
code: department.code,
|
|
325
|
+
containBranch: containBranch.value,
|
|
326
|
+
department: department
|
|
327
|
+
}
|
|
328
|
+
emits('close', selectNodeInfo)
|
|
315
329
|
}
|
|
316
|
-
addSelectedDepartmentInfo(leafSelectNodeInfo, node, departmentData)
|
|
317
|
-
})
|
|
318
|
-
let selectNodeInfo = {
|
|
319
|
-
ids: [],
|
|
320
|
-
names: [],
|
|
321
|
-
zhNames: [],
|
|
322
|
-
enNames: [],
|
|
323
|
-
codes: [],
|
|
324
|
-
departments: []
|
|
325
330
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
// }
|
|
343
|
-
department.tenantName = tenantInfo.value.tenantName
|
|
344
|
-
department.tenantCode = tenantInfo.value.code
|
|
345
|
-
const selectNodeInfo = {
|
|
346
|
-
id: dept.id,
|
|
347
|
-
name: showName,
|
|
348
|
-
zhName: department.name,
|
|
349
|
-
enName: department.enName,
|
|
350
|
-
code: department.code,
|
|
351
|
-
containBranch: containBranch.value,
|
|
352
|
-
department: department
|
|
331
|
+
// 将选中的部门节点添加到结果集合中
|
|
332
|
+
function addSelectedDepartmentInfo (result, node, department) {
|
|
333
|
+
result.ids.push(node.id)
|
|
334
|
+
result.codes.push(department.code)
|
|
335
|
+
result.containBranch = containBranch.value
|
|
336
|
+
department.tenantCode = tenantInfo.value.code
|
|
337
|
+
department.tenantName = tenantInfo.value.tenantName
|
|
338
|
+
result.departments.push(department)
|
|
339
|
+
const showName = department.showName
|
|
340
|
+
// if (this.containBranch && node.branchName) {
|
|
341
|
+
// // 如果包含分支机构,则拼接分支机构名称
|
|
342
|
+
// name = name + '(' + node.branchName + ')'
|
|
343
|
+
// }
|
|
344
|
+
result.names.push(showName)
|
|
345
|
+
result.zhNames.push(department.name)
|
|
346
|
+
result.enNames.push(department.enName ? department.enName : '')
|
|
353
347
|
}
|
|
354
|
-
emits('close', selectNodeInfo)
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
// 将选中的部门节点添加到结果集合中
|
|
358
|
-
function addSelectedDepartmentInfo(result, node, department) {
|
|
359
|
-
result.ids.push(node.id)
|
|
360
|
-
result.codes.push(department.code)
|
|
361
|
-
result.containBranch = containBranch.value
|
|
362
|
-
department.tenantCode = tenantInfo.value.code
|
|
363
|
-
department.tenantName = tenantInfo.value.tenantName
|
|
364
|
-
result.departments.push(department)
|
|
365
|
-
const showName = department.showName
|
|
366
|
-
// if (this.containBranch && node.branchName) {
|
|
367
|
-
// // 如果包含分支机构,则拼接分支机构名称
|
|
368
|
-
// name = name + '(' + node.branchName + ')'
|
|
369
|
-
// }
|
|
370
|
-
result.names.push(showName)
|
|
371
|
-
result.zhNames.push(department.name)
|
|
372
|
-
result.enNames.push(department.enName ? department.enName : '')
|
|
373
|
-
}
|
|
374
348
|
|
|
375
|
-
function filterAppendNodes() {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
.post(
|
|
381
|
-
window['$vueApp'].config.globalProperties.baseAPI + '/component/organization-trees/search-depts',
|
|
382
|
-
searchParam.value
|
|
383
|
-
)
|
|
384
|
-
.then((result) => {
|
|
349
|
+
function filterAppendNodes ( ) {
|
|
350
|
+
if (searchParam.value.searchValue) {
|
|
351
|
+
searchParam.value.searchValue = searchParam.value.searchValue.trim()
|
|
352
|
+
searchParam.value.departmentInfo = props.departmentInfo
|
|
353
|
+
window['$vueApp'].config.globalProperties.$http.post(window['$vueApp'].config.globalProperties.baseAPI + '/component/organization-trees/search-depts', searchParam.value).then(result => {
|
|
385
354
|
if (result) {
|
|
386
355
|
if (result.length === 0) {
|
|
387
356
|
ElMessage({
|
|
388
357
|
message: t('imatrixUIMessage.queryResultIsEmpty'),
|
|
389
|
-
type: 'warning'
|
|
358
|
+
type: 'warning',
|
|
390
359
|
})
|
|
391
360
|
}
|
|
392
361
|
departments.value = result
|
|
393
362
|
} else {
|
|
394
363
|
ElMessage({
|
|
395
364
|
message: t('imatrixUIMessage.queryResultIsEmpty'),
|
|
396
|
-
type: 'warning'
|
|
365
|
+
type: 'warning',
|
|
397
366
|
})
|
|
398
367
|
}
|
|
399
368
|
})
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
369
|
+
} else {
|
|
370
|
+
getTenantChildrenDept()
|
|
371
|
+
}
|
|
403
372
|
}
|
|
404
|
-
</script>
|
|
373
|
+
</script>
|