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,119 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-drawer v-model="isShowForm" direction="btt" size="100%" class="organization-tree" @close="closeTree()">
|
|
3
|
+
<template #header>
|
|
4
|
+
<div style="text-align: center;">
|
|
5
|
+
{{$t('imatrixUIMessage.pleaseSelect')}}
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
<template #default>
|
|
9
|
+
<InlineWorkgroupUserTreeApp v-if="isShowForm" :multiple="multiple" :branchInfo="branchInfo" :selectUserInfo="selectUserInfo" :searchField="searchField" :separator="separator" @close="closeTree"/>
|
|
10
|
+
</template>
|
|
11
|
+
</el-drawer>
|
|
12
|
+
|
|
13
|
+
</template>
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
export default {
|
|
16
|
+
name: 'DepartmentUserTreeMobile'
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import InlineWorkgroupUserTreeApp from './workgroup-user-tree-inline-app.vue'
|
|
21
|
+
import { reactive,ref,onMounted, defineEmits } from 'vue'
|
|
22
|
+
const props = defineProps<{
|
|
23
|
+
// 是否是多选树,默认是true
|
|
24
|
+
multiple: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: true,
|
|
27
|
+
},
|
|
28
|
+
// 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
|
|
29
|
+
branchInfo: {
|
|
30
|
+
type: Array<any>,
|
|
31
|
+
default: null,
|
|
32
|
+
},
|
|
33
|
+
// 多选用户树时,已选择用户id或登录名集合,多个之间以逗号隔开
|
|
34
|
+
selectUserInfo: {
|
|
35
|
+
type: [String, Number],
|
|
36
|
+
default: null,
|
|
37
|
+
},
|
|
38
|
+
// 移除用户时,用户属性名称:id、loginName、email、telephone,默认是loginName
|
|
39
|
+
searchField: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: 'loginName',
|
|
42
|
+
},
|
|
43
|
+
// 多选树时结果之间的分隔符,默认是逗号分隔
|
|
44
|
+
separator: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: ','
|
|
47
|
+
}
|
|
48
|
+
}>()
|
|
49
|
+
const emits = defineEmits(['close'])
|
|
50
|
+
let isShowForm = ref(true)
|
|
51
|
+
// function showTree() {
|
|
52
|
+
// isShowForm.value = true
|
|
53
|
+
// }
|
|
54
|
+
function closeTree(selectNodeInfo) {
|
|
55
|
+
emits('close', selectNodeInfo)
|
|
56
|
+
isShowForm.value = false
|
|
57
|
+
}
|
|
58
|
+
function selectDepartment() {
|
|
59
|
+
// this.$refs.inlineDeparmentTree.selectDepartment()
|
|
60
|
+
}
|
|
61
|
+
// defineExpose({showTree})
|
|
62
|
+
</script>
|
|
63
|
+
<style>
|
|
64
|
+
.organization-tree, .organization-tree .el-checkbox__label,.organization-tree .el-breadcrumb__inner,.organization-tree .el-tree {
|
|
65
|
+
font-size: 17px;
|
|
66
|
+
font-weight: 700;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.organization-tree .el-breadcrumb__item:last-child .el-breadcrumb__inner, .el-breadcrumb__item:last-child .el-breadcrumb__inner a, .el-breadcrumb__item:last-child .el-breadcrumb__inner a:hover, .el-breadcrumb__item:last-child .el-breadcrumb__inner:hover {
|
|
70
|
+
font-size: 17px;
|
|
71
|
+
font-weight: 700;
|
|
72
|
+
}
|
|
73
|
+
.organization-tree .el-card__body {
|
|
74
|
+
padding-top: 10px;
|
|
75
|
+
}
|
|
76
|
+
.organization-tree .card-content {
|
|
77
|
+
margin-top: 10px;
|
|
78
|
+
}
|
|
79
|
+
.organization-tree .item-row-all {
|
|
80
|
+
margin-bottom: 10px;
|
|
81
|
+
}
|
|
82
|
+
.organization-tree .item-row {
|
|
83
|
+
display: flex;
|
|
84
|
+
width: 100%;
|
|
85
|
+
}
|
|
86
|
+
.organization-tree .item-label {
|
|
87
|
+
flex: 0 0 90%;
|
|
88
|
+
text-align: left;
|
|
89
|
+
}
|
|
90
|
+
.organization-tree .item-side {
|
|
91
|
+
flex: 0 0 10%;
|
|
92
|
+
text-align: right;
|
|
93
|
+
}
|
|
94
|
+
.organization-tree .el-tree-node {
|
|
95
|
+
margin-bottom: 10px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.organization-tree .el-tree-node__content>.el-tree-node__expand-icon {
|
|
99
|
+
padding: 0;
|
|
100
|
+
display: none;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.organization-tree .card-footer {
|
|
104
|
+
padding: 20px;
|
|
105
|
+
}
|
|
106
|
+
.organization-tree .card-footer .select-result {
|
|
107
|
+
color: #409EFF;
|
|
108
|
+
flex:1 1 75%;
|
|
109
|
+
text-align: left;
|
|
110
|
+
}
|
|
111
|
+
.organization-tree .card-footer .button-area {
|
|
112
|
+
flex:0 0 20%;
|
|
113
|
+
text-align: right;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.organization-tree .dept-path .breadcrumb-label-link{
|
|
117
|
+
color:#409EFF
|
|
118
|
+
}
|
|
119
|
+
</style>
|
|
@@ -0,0 +1,394 @@
|
|
|
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('departmentUserTree.pleaseEnterUserInformation')" @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">
|
|
22
|
+
<el-row class="item-row item-row-all">
|
|
23
|
+
<el-col class="item-label dept-path"><deptPath :tenantName="tenantName" :clickDepts="clickDepts" @clickBreadcrumb="clickBreadcrumb"/></el-col>
|
|
24
|
+
</el-row>
|
|
25
|
+
</el-card>
|
|
26
|
+
<el-card class="card-content org-tree" style="overflow: auto;">
|
|
27
|
+
<el-tree
|
|
28
|
+
ref="orgTreeRef"
|
|
29
|
+
:data="departments"
|
|
30
|
+
:show-checkbox="multiple"
|
|
31
|
+
node-key="nodeId"
|
|
32
|
+
:props="defaultProps"
|
|
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 v-if="data.nodeType && data.nodeType === 'USER'" class="item-label">{{ data.showName }}
|
|
40
|
+
<span style="color:#999">({{ data.loginName }}{{ getUserMainDeptName(data) ? '/'+getUserMainDeptName(data): ''}})</span>
|
|
41
|
+
</div>
|
|
42
|
+
<div v-else class="item-label">{{ data.name }}</div>
|
|
43
|
+
<div v-if="!data.nodeType || data.nodeType !== 'USER'" class="item-side" @click="loadChildren(data,false)">
|
|
44
|
+
<el-icon><ArrowRight /></el-icon>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
48
|
+
</el-tree>
|
|
49
|
+
</el-card>
|
|
50
|
+
<el-card class="card-footer">
|
|
51
|
+
<div style="display: flex;">
|
|
52
|
+
<div class="select-result" >
|
|
53
|
+
<!-- 已选择:{useNum}个用户,{deptNum}个部门(含子部门) -->
|
|
54
|
+
<!-- {{$t('departmentUserTree.selectResultInfo',{userNum: selectUsers.length, deptNum: selectDepts.length})}} -->
|
|
55
|
+
<span v-if="multiple" @click="showResult">
|
|
56
|
+
<span v-if="selectUsers.length > 0 && selectDepts.length > 0">{{$t('departmentTreeInline.selectResultInfoHasSelect')}}{{$t('departmentUserTree.selectUserResultInfo',{userNum: selectUsers.length })}}, {{$t('departmentUserTree.selectDeptResultInfo',{deptNum: selectDepts.length })}}</span>
|
|
57
|
+
<span v-else-if="selectUsers.length > 0">{{$t('departmentTreeInline.selectResultInfoHasSelect')}}{{$t('departmentUserTree.selectUserResultInfo',{userNum: selectUsers.length })}}</span>
|
|
58
|
+
<span v-else-if="selectDepts.length > 0">{{$t('departmentTreeInline.selectResultInfoHasSelect')}}{{$t('departmentUserTree.selectDeptResultInfo',{deptNum: selectDepts.length })}}</span>
|
|
59
|
+
<span v-if="selectUsers.length > 0 || selectDepts.length > 0" style="padding-left: 10px"><el-icon><ArrowUpBold /></el-icon></span>
|
|
60
|
+
</span>
|
|
61
|
+
<span v-else-if="selectUsers.length > 0">
|
|
62
|
+
{{$t('departmentTreeInline.selectResultInfoHasSelect')}}{{selectUsers[0].showName }}<span style="color:#999">({{ selectUsers[0].loginName }}{{ getUserMainDeptName(selectUsers[0]) ? '/'+getUserMainDeptName(selectUsers[0]): ''}})</span>
|
|
63
|
+
</span>
|
|
64
|
+
|
|
65
|
+
</div>
|
|
66
|
+
<div class="button-area">
|
|
67
|
+
<el-button size="large" type="primary" @click="saveDept">{{$t('imatrixUIPublicModel.sure')}}</el-button>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
</el-card>
|
|
71
|
+
<deptResult ref="deptResultRef" :selectUsers="selectUsers.concat(selectDepts)" @removeResult="removeResultDept"/>
|
|
72
|
+
</div>
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<script setup lang="ts">
|
|
76
|
+
import { reactive,ref,onMounted, defineEmits,Ref } from 'vue'
|
|
77
|
+
import {
|
|
78
|
+
ArrowRight,
|
|
79
|
+
Search,
|
|
80
|
+
ArrowUpBold
|
|
81
|
+
} from '@element-plus/icons-vue'
|
|
82
|
+
import {getTenant, getTenantChildren, checkedDeptDefault, loadChildNodes, getUserInWorkgroups} from './workgroup-user-tree-service.ts'
|
|
83
|
+
import {resizeScrollTargetHeightUtil, getUserMainDeptName, getDeptNamePath,initSelectUsers, addSelectedUserInfo, packageSelectResult} from '../../utils/organization.ts'
|
|
84
|
+
import deptPath from './dept-path.vue'
|
|
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
|
+
selectUserInfo: {
|
|
101
|
+
type: [String, Number],
|
|
102
|
+
default: null,
|
|
103
|
+
},
|
|
104
|
+
// 移除用户时,用户属性名称:id、loginName、email、telephone,默认是loginName
|
|
105
|
+
searchField: {
|
|
106
|
+
type: String,
|
|
107
|
+
default: 'loginName',
|
|
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 selectUsers = ref([])
|
|
124
|
+
let selectDepts = ref([])
|
|
125
|
+
let selectDeptNodeIds = ref([])
|
|
126
|
+
let clickDepts = ref([])
|
|
127
|
+
let defaultCheckedKeys = ref([])
|
|
128
|
+
let deptResultRef:Ref<any> = ref(null)
|
|
129
|
+
let checkAll = ref(false)
|
|
130
|
+
let searchParam = ref({
|
|
131
|
+
searchValue: null,
|
|
132
|
+
treeType: 'MAN_GROUP_TREE',
|
|
133
|
+
departmentInfo: null
|
|
134
|
+
})
|
|
135
|
+
let defaultProps = ref({
|
|
136
|
+
disabled: 'disable'
|
|
137
|
+
|
|
138
|
+
})
|
|
139
|
+
let loading = ref(false)
|
|
140
|
+
const {t} = useI18n()
|
|
141
|
+
onMounted(()=>{
|
|
142
|
+
initSelectUsers(props.searchField, props.selectUserInfo, props.separator ).then((departments)=>{
|
|
143
|
+
selectUsers.value = departments
|
|
144
|
+
getTenantInfo()
|
|
145
|
+
})
|
|
146
|
+
resizeScrollTargetHeight()
|
|
147
|
+
})
|
|
148
|
+
function getTenantInfo() {
|
|
149
|
+
getTenant().then(data=>{
|
|
150
|
+
const tenantData = data[0].data
|
|
151
|
+
tenantInfo.value = JSON.parse(tenantData)
|
|
152
|
+
containBranch.value = data[0].containBranch
|
|
153
|
+
tenantName.value = data[0].name
|
|
154
|
+
getTenantChildrenDept()
|
|
155
|
+
})
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function getTenantChildrenDept() {
|
|
159
|
+
getTenantChildren(props.branchInfo, tenantNodeId).then(children=>{
|
|
160
|
+
departments.value = children
|
|
161
|
+
checkedDeptDefault(selectUsers.value, defaultCheckedKeys.value)
|
|
162
|
+
})
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function resizeScrollTargetHeight () {
|
|
166
|
+
const scrollTarget = document.querySelector('.org-tree')
|
|
167
|
+
let height = resizeScrollTargetHeightUtil(scrollTarget)
|
|
168
|
+
const titleArea = 110
|
|
169
|
+
const deptPathArea = 60
|
|
170
|
+
const allCheckArea = 60
|
|
171
|
+
const buttonArea = 60
|
|
172
|
+
height = height - titleArea - deptPathArea - allCheckArea - buttonArea
|
|
173
|
+
scrollTarget['style'].height = height + 'px'
|
|
174
|
+
scrollTarget['style'].minHeight = '300px'
|
|
175
|
+
// scrollTarget.style.maxHeight = height + 'px'
|
|
176
|
+
}
|
|
177
|
+
// 点击复选框时处理
|
|
178
|
+
function handleCheckNode(data, check, isChildrenCheck) {
|
|
179
|
+
if(props.multiple) {
|
|
180
|
+
if(check) {
|
|
181
|
+
// 表示选择节点时
|
|
182
|
+
if(props.multiple) {
|
|
183
|
+
// 表示是复选组织树
|
|
184
|
+
addToSelectDept(data)
|
|
185
|
+
}
|
|
186
|
+
} else {
|
|
187
|
+
// 表示取消选择
|
|
188
|
+
if(props.multiple || (data.nodeType && data.nodeType === 'USER')) {
|
|
189
|
+
removeSelectDept(data)
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function handleClickNode(data, node, treenode, events) {
|
|
196
|
+
if(!props.multiple && data.nodeType && data.nodeType === 'USER') {
|
|
197
|
+
selectUsers.value = [data]
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
function addToSelectDept(dept) {
|
|
201
|
+
if(dept.nodeType && dept.nodeType === 'USER') {
|
|
202
|
+
// 表示是用户
|
|
203
|
+
const filterValue = selectUsers.value.filter(item=> item.nodeId === dept.nodeId)
|
|
204
|
+
if(!filterValue || filterValue.length === 0) {
|
|
205
|
+
// 表示集合中没有该记录,需要记录到结果集合中
|
|
206
|
+
selectUsers.value.push(JSON.parse(JSON.stringify(dept)))
|
|
207
|
+
}
|
|
208
|
+
} else {
|
|
209
|
+
// 表示是部门
|
|
210
|
+
const filterValue = selectDepts.value.filter(item=> item.nodeId === dept.nodeId)
|
|
211
|
+
if(!filterValue || filterValue.length === 0) {
|
|
212
|
+
// 表示集合中没有该记录,需要记录到结果集合中
|
|
213
|
+
selectDepts.value.push(JSON.parse(JSON.stringify(dept)))
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function removeSelectDept(dept) {
|
|
219
|
+
if(dept.nodeType && dept.nodeType === 'USER') {
|
|
220
|
+
const index = selectUsers.value.findIndex(selectItem=> selectItem.nodeId === dept.nodeId)
|
|
221
|
+
// 删除指定元素
|
|
222
|
+
selectUsers.value.splice(index, 1)
|
|
223
|
+
} else {
|
|
224
|
+
const index = selectDepts.value.findIndex(selectItem=> selectItem.nodeId === dept.nodeId)
|
|
225
|
+
// 删除指定元素
|
|
226
|
+
selectDepts.value.splice(index, 1)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
checkAll.value =false
|
|
230
|
+
}
|
|
231
|
+
function changeAllCheck(value: boolean) {
|
|
232
|
+
console.log('changeCheck====value=', value)
|
|
233
|
+
if(props.multiple) {
|
|
234
|
+
// 表示是复选组织树
|
|
235
|
+
if(value){
|
|
236
|
+
// 表示全选时
|
|
237
|
+
const allNodeIds = departments.value.map((item)=>{
|
|
238
|
+
return item['nodeId'];
|
|
239
|
+
})
|
|
240
|
+
orgTreeRef.value.setCheckedKeys(allNodeIds, false)
|
|
241
|
+
departments.value.forEach(item=>{
|
|
242
|
+
addToSelectDept(item)
|
|
243
|
+
})
|
|
244
|
+
} else {
|
|
245
|
+
// 表示取消全选时
|
|
246
|
+
departments.value.forEach(item=>{
|
|
247
|
+
removeSelectDept(item)
|
|
248
|
+
})
|
|
249
|
+
orgTreeRef.value.setCheckedKeys([], false)
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
function loadChildrenDept(dept) {
|
|
255
|
+
loadChildNodes(props.branchInfo, dept.id).then(children=>{
|
|
256
|
+
departments.value = children
|
|
257
|
+
checkedDeptDefault(selectUsers.value, defaultCheckedKeys.value)
|
|
258
|
+
})
|
|
259
|
+
}
|
|
260
|
+
function loadChildren (dept, isBreadcrumb) {
|
|
261
|
+
clickDepts.value.push(dept)
|
|
262
|
+
loadChildrenDept(dept)
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
function clickBreadcrumb(item, isTenant, index) {
|
|
266
|
+
if(isTenant) {
|
|
267
|
+
// 表示点击的时公司节点
|
|
268
|
+
clickDepts.value = []
|
|
269
|
+
getTenantChildrenDept()
|
|
270
|
+
} else {
|
|
271
|
+
// 表示点击的是部门节点
|
|
272
|
+
// 删除指定元素
|
|
273
|
+
clickDepts.value.splice(index+1, clickDepts.value.length - (index + 1) )
|
|
274
|
+
loadChildrenDept(item)
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function showResult() {
|
|
279
|
+
deptResultRef.value.showResult()
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function removeResultDept(dept) {
|
|
283
|
+
const removeDeptInDepts = departments.value.filter(item=>item.nodeId === dept.nodeId)
|
|
284
|
+
if(removeDeptInDepts && removeDeptInDepts.length > 0) {
|
|
285
|
+
// departments结果存在当前移除的节点时,check-change事件会走removeSelectDept的逻辑
|
|
286
|
+
const selectNodeIds = []
|
|
287
|
+
selectUsers.value.forEach(item=>{
|
|
288
|
+
if(item.nodeId !== dept.nodeId) {
|
|
289
|
+
selectNodeIds.push(item.nodeId)
|
|
290
|
+
}
|
|
291
|
+
})
|
|
292
|
+
selectDepts.value.forEach(item=>{
|
|
293
|
+
if(item.nodeId !== dept.nodeId) {
|
|
294
|
+
selectNodeIds.push(item.nodeId)
|
|
295
|
+
}
|
|
296
|
+
})
|
|
297
|
+
orgTreeRef.value.setCheckedKeys(selectNodeIds, true)
|
|
298
|
+
}
|
|
299
|
+
removeSelectDept(dept)
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function saveDept () {
|
|
303
|
+
if (selectDepts.value.length === 0 && selectUsers.value.length === 0 ) {
|
|
304
|
+
ElMessage({
|
|
305
|
+
message: t('imatrixUIMessage.pleaseSelectPersonnel'),
|
|
306
|
+
type: 'warning',
|
|
307
|
+
})
|
|
308
|
+
return
|
|
309
|
+
}
|
|
310
|
+
if (props.multiple) {
|
|
311
|
+
const selectNodeInfo = {
|
|
312
|
+
userIds: [],
|
|
313
|
+
userNames: [],
|
|
314
|
+
loginNames: [],
|
|
315
|
+
userZhNames: [],
|
|
316
|
+
userEnNames: [],
|
|
317
|
+
emails: [],
|
|
318
|
+
telephones: [],
|
|
319
|
+
users: []
|
|
320
|
+
}
|
|
321
|
+
const departmentIds = []
|
|
322
|
+
selectDepts.value.forEach(node => {
|
|
323
|
+
// 部门集合,最后确定时会使用该集合去后台获得用户集合
|
|
324
|
+
departmentIds.push(node.id)
|
|
325
|
+
})
|
|
326
|
+
selectUsers.value.forEach(node => {
|
|
327
|
+
// 用户集合
|
|
328
|
+
// node.data是部门对象的json字符串信息,通过JSON.parse(node.data)将json字符串转为对象
|
|
329
|
+
const userData = JSON.parse(node.data)
|
|
330
|
+
addSelectedUserInfo(selectNodeInfo, userData, containBranch.value)
|
|
331
|
+
})
|
|
332
|
+
loading.value = true
|
|
333
|
+
if (departmentIds.length > 0) {
|
|
334
|
+
getUserInWorkgroups(departmentIds).then(users => {
|
|
335
|
+
if (users) {
|
|
336
|
+
users.forEach(user => {
|
|
337
|
+
addSelectedUserInfo(selectNodeInfo, user, containBranch.value)
|
|
338
|
+
})
|
|
339
|
+
}
|
|
340
|
+
loading.value = false
|
|
341
|
+
if (selectNodeInfo.userIds.length > 0) {
|
|
342
|
+
emits('close', selectNodeInfo)
|
|
343
|
+
} else {
|
|
344
|
+
ElMessage({
|
|
345
|
+
message: t('imatrixUIMessage.pleaseSelectPersonnel'),
|
|
346
|
+
type: 'warning',
|
|
347
|
+
})
|
|
348
|
+
}
|
|
349
|
+
}).catch(() => {
|
|
350
|
+
loading.value = false
|
|
351
|
+
})
|
|
352
|
+
} else {
|
|
353
|
+
loading.value = false
|
|
354
|
+
if (selectNodeInfo.userIds.length > 0) {
|
|
355
|
+
emits('close', selectNodeInfo)
|
|
356
|
+
} else {
|
|
357
|
+
ElMessage({
|
|
358
|
+
message: t('imatrixUIMessage.pleaseSelectPersonnel'),
|
|
359
|
+
type: 'warning',
|
|
360
|
+
})
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
} else {
|
|
364
|
+
const user = JSON.parse(selectUsers.value[0].data)
|
|
365
|
+
const selectNodeInfo = packageSelectResult(user, containBranch.value)
|
|
366
|
+
emits('close', selectNodeInfo)
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
function filterAppendNodes ( ) {
|
|
371
|
+
if (searchParam.value.searchValue) {
|
|
372
|
+
searchParam.value.searchValue = searchParam.value.searchValue.trim()
|
|
373
|
+
searchParam.value.departmentInfo = props.branchInfo
|
|
374
|
+
window['$vueApp'].config.globalProperties.$http.post(window['$vueApp'].config.globalProperties.baseAPI + '/component/organization-trees/search-users-mobile', searchParam.value).then(result => {
|
|
375
|
+
if (result) {
|
|
376
|
+
if (result.length === 0) {
|
|
377
|
+
ElMessage({
|
|
378
|
+
message: t('imatrixUIMessage.queryResultIsEmpty'),
|
|
379
|
+
type: 'warning',
|
|
380
|
+
})
|
|
381
|
+
}
|
|
382
|
+
departments.value = result
|
|
383
|
+
} else {
|
|
384
|
+
ElMessage({
|
|
385
|
+
message: t('imatrixUIMessage.queryResultIsEmpty'),
|
|
386
|
+
type: 'warning',
|
|
387
|
+
})
|
|
388
|
+
}
|
|
389
|
+
})
|
|
390
|
+
} else {
|
|
391
|
+
getTenantChildrenDept()
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
</script>
|
|
@@ -0,0 +1,41 @@
|
|
|
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 loadChildNodes(branchInfo, tenantNodeId)
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// 加载当前节点的子节点
|
|
14
|
+
export function loadChildNodes (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/workgroup-users',
|
|
23
|
+
param
|
|
24
|
+
)
|
|
25
|
+
.then(children => {
|
|
26
|
+
resolve(children)
|
|
27
|
+
})
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
export function checkedDeptDefault (selectDepts, defaultCheckedKeys) {
|
|
33
|
+
defaultCheckedKeys = []
|
|
34
|
+
selectDepts.forEach(dept => {
|
|
35
|
+
defaultCheckedKeys.push(dept.nodeId)
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function getUserInWorkgroups (workgroupIds) {
|
|
40
|
+
return window['$vueApp'].config.globalProperties.$http.post(window['$vueApp'].config.globalProperties.baseAPI + '/component/organization-trees/user-in-workgroups', workgroupIds)
|
|
41
|
+
}
|
package/src/i18n/langs/cn.js
CHANGED
|
@@ -82,7 +82,8 @@ const cn = {
|
|
|
82
82
|
selectedWorkingGroup: '已选工作组',
|
|
83
83
|
forbiddenExceptionLinkUrl: '请点击进行权限申请',
|
|
84
84
|
forbiddenExceptionLinkUser: '如有疑问请联系',
|
|
85
|
-
uploadFileTip: '上传的文件不超过{fileSize}M'
|
|
85
|
+
uploadFileTip: '上传的文件不超过{fileSize}M',
|
|
86
|
+
asyncExportJumpMsg: '或点击我跳转到下载页面'
|
|
86
87
|
},
|
|
87
88
|
// 列表组件
|
|
88
89
|
superGrid: {
|
|
@@ -175,6 +176,7 @@ const cn = {
|
|
|
175
176
|
workingGroupName: '工作组名称',
|
|
176
177
|
workingGroupNumber: '工作组编号',
|
|
177
178
|
workgroupDescription: '工作组描述',
|
|
179
|
+
selectResultInfo: '{num}个工作组'
|
|
178
180
|
},
|
|
179
181
|
// 流程按钮组件。save、submit等属性名不能随便改,和后台的ButtonType枚举名保持一致
|
|
180
182
|
workflowButton: {
|
package/src/i18n/langs/en.js
CHANGED
|
@@ -84,7 +84,8 @@ const en = {
|
|
|
84
84
|
selectedWorkingGroup: 'Selected working group',
|
|
85
85
|
forbiddenExceptionLinkUrl: 'please click to apply',
|
|
86
86
|
forbiddenExceptionLinkUser: 'if you have any questions,please contact',
|
|
87
|
-
uploadFileTip: 'The file size should lower {fileSize}M'
|
|
87
|
+
uploadFileTip: 'The file size should lower {fileSize}M',
|
|
88
|
+
asyncExportJumpMsg: 'Or click me to jump to download page.'
|
|
88
89
|
},
|
|
89
90
|
superGrid: {
|
|
90
91
|
columnConfig: 'Column Config',
|
|
@@ -177,6 +178,7 @@ const en = {
|
|
|
177
178
|
workingGroupName: 'Working Group Name',
|
|
178
179
|
workingGroupNumber: 'Working Group Number',
|
|
179
180
|
workgroupDescription: 'Workgroup Description',
|
|
181
|
+
selectResultInfo: '{num} workgroups'
|
|
180
182
|
},
|
|
181
183
|
// 流程按钮组件。save、submit等属性名不能随便改,和后台的ButtonType枚举名保持一致
|
|
182
184
|
workflowButton: {
|
package/src/utils/common-util.js
CHANGED
|
@@ -124,12 +124,28 @@ export function getLoginUrl() {
|
|
|
124
124
|
routerPath = suffix.substring(0, suffix.indexOf('?'))
|
|
125
125
|
param = suffix.substring(suffix.indexOf('?') + 1)
|
|
126
126
|
}
|
|
127
|
+
} else {
|
|
128
|
+
systemPath = null
|
|
127
129
|
}
|
|
128
130
|
getPortalFrontendUrl()
|
|
129
131
|
.then((portalUrl) => {
|
|
130
|
-
let loginUrl = portalUrl + '#/login
|
|
132
|
+
let loginUrl = portalUrl + '#/login'
|
|
133
|
+
if (systemPath) {
|
|
134
|
+
loginUrl = loginUrl + '?systemPath=' + systemPath
|
|
135
|
+
}
|
|
136
|
+
if (routerPath) {
|
|
137
|
+
if (loginUrl.indexOf('?') > 0) {
|
|
138
|
+
loginUrl = loginUrl + '&routerPath=' + routerPath
|
|
139
|
+
} else {
|
|
140
|
+
loginUrl = loginUrl + '?routerPath=' + routerPath
|
|
141
|
+
}
|
|
142
|
+
}
|
|
131
143
|
if (param) {
|
|
132
|
-
loginUrl
|
|
144
|
+
if (loginUrl.indexOf('?') > 0) {
|
|
145
|
+
loginUrl = loginUrl + '&' + param
|
|
146
|
+
} else {
|
|
147
|
+
loginUrl = loginUrl + '?' + param
|
|
148
|
+
}
|
|
133
149
|
}
|
|
134
150
|
loginUrl = replacePrefix(loginUrl)
|
|
135
151
|
resolve(loginUrl)
|
|
@@ -71,7 +71,7 @@ export function getTotalPermissions() {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
const b = new Date().getTime()
|
|
74
|
-
if(runPermissionsObj || sysetemPermissionsObj) {
|
|
74
|
+
if(runPermissionsObj || sysetemPermissionsObj || mobilePermissionsObj) {
|
|
75
75
|
let permissions = {}
|
|
76
76
|
if(runPermissionsObj){
|
|
77
77
|
Object.assign(permissions, runPermissionsObj)
|
|
@@ -1,46 +1,3 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<router-view />
|
|
3
|
-
</template>
|
|
4
|
-
<script>
|
|
5
|
-
import eventBus from '../../../src/utils/eventBus'
|
|
6
|
-
export default {
|
|
7
|
-
created(){
|
|
8
|
-
window.addEventListener('message', this.receiveMessage, false)
|
|
9
|
-
},
|
|
10
|
-
destroyed () {
|
|
11
|
-
window.removeEventListener('message', this.receiveMessage, false)
|
|
12
|
-
},
|
|
13
|
-
methods: {
|
|
14
|
-
receiveMessage (event) {
|
|
15
|
-
const result = event.data
|
|
16
|
-
console.log('receiveMessage-----result111=', result)
|
|
17
|
-
if (result && typeof result === 'string') {
|
|
18
|
-
console.log('receiveMessage-----result2222=', result)
|
|
19
|
-
// console.log('接收手机端传过来的信息--receiveMessage===', result)
|
|
20
|
-
try {
|
|
21
|
-
const data = JSON.parse(result)
|
|
22
|
-
// console.log('接收手机端传过来的信息--data=', data)
|
|
23
|
-
const type = data.type // 'pickFileDone' 选择文件完成,'uploadFileDone' 上传文件完成
|
|
24
|
-
console.log('receiveMessage-----result3333=', type, 'data.files=', data.files)
|
|
25
|
-
// console.log('接收手机端传过来的信息--type=', type)
|
|
26
|
-
if (type && type === 'onResize') {
|
|
27
|
-
// 横竖屏切换时重新计算高度
|
|
28
|
-
eventBus.$emit('onResize')
|
|
29
|
-
} else if (type && type === 'pickFileDone') {
|
|
30
|
-
// 选择文件完成
|
|
31
|
-
console.log('receiveMessage-----result4444=', type)
|
|
32
|
-
// fileNames:[{name:'xx',base64Path:'xxx'},{name:'xxx',base64Path:'xxxxx'}]
|
|
33
|
-
eventBus.$emit('pickFileDone', data)
|
|
34
|
-
} else if (type && type === 'uploadFileDone') {
|
|
35
|
-
eventBus.$emit('uploadFileDone', data)
|
|
36
|
-
} else if (type && type === 'scan') {
|
|
37
|
-
eventBus.$emit('scan', data)
|
|
38
|
-
}
|
|
39
|
-
} catch (error) {
|
|
40
|
-
console.log(error)
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
</script>
|
|
3
|
+
</template>
|