agilebuilder-ui 1.0.621 → 1.0.962
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +115880 -110424
- package/lib/super-ui.umd.cjs +103 -95
- package/package.json +6 -3
- package/packages/department-tree/src/department-tree.vue +27 -10
- package/packages/department-tree-inline/src/department-tree-service.js +20 -41
- package/packages/department-tree-mobile/src/department-tree-app.vue +6 -6
- package/packages/department-tree-mobile/src/department-tree-inline-app.vue +15 -15
- package/packages/department-user-tree/src/department-user-tree.vue +17 -2
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +61 -26
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +64 -22
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -6
- package/packages/department-user-tree-inline/src/group-user/group-input.vue +162 -0
- package/packages/department-user-tree-inline/src/group-user/group-list.vue +99 -0
- package/packages/department-user-tree-inline/src/group-user/group-user.vue +42 -0
- package/packages/department-user-tree-inline/src/group-user-multiple-tree.vue +304 -0
- package/packages/department-user-tree-inline/src/group-user-single-tree.vue +155 -0
- package/packages/department-user-tree-inline/src/group-user-tree-service.js +74 -0
- package/packages/department-user-tree-inline/src/search-result.vue +34 -36
- package/packages/department-user-tree-mobile/src/department-user-tree-app.vue +6 -6
- package/packages/department-user-tree-mobile/src/department-user-tree-inline-app.vue +17 -19
- package/packages/department-user-tree-mobile/src/department-user-tree-service.ts +0 -11
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +795 -799
- package/packages/dynamic-source-select/src/events.js +11 -16
- package/packages/fs-upload-list/src/fs-upload-list.vue +183 -122
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-app.vue +246 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +480 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-component.vue +127 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-input.vue +246 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload.vue +255 -0
- package/packages/fs-upload-new/src/fs-button-upload.vue +10 -13
- package/packages/fs-upload-new/src/fs-drag-upload.vue +4 -8
- package/packages/fs-upload-new/src/fs-preview-new.vue +103 -36
- package/packages/fs-upload-new/src/fs-upload-new.vue +160 -13
- package/packages/index.js +11 -2
- package/packages/organization-input/src/organization-input.vue +493 -539
- package/packages/plugins/export-data-new.js +34 -1
- package/packages/rich-editor/index.vue +29 -0
- package/packages/row-form/index.js +7 -0
- package/packages/row-form/index.vue +211 -0
- package/packages/scan-code-input/src/scan-code-input.vue +136 -104
- package/packages/scan-code-input-browser/index.js +6 -0
- package/packages/{scan-code-input/src/scan-code-input-colse.vue → scan-code-input-browser/src/scan-code-input.vue} +1 -28
- package/packages/secret-info/index.vue +2 -2
- package/packages/super-grid/src/apis.js +158 -10
- package/packages/super-grid/src/components/grid-icon.vue +7 -14
- package/packages/super-grid/src/components/hyperlinks.vue +24 -8
- package/packages/super-grid/src/custom-formatter.js +312 -380
- package/packages/super-grid/src/dynamic-input.vue +346 -43
- package/packages/super-grid/src/formValidatorUtil.js +79 -15
- package/packages/super-grid/src/group-column.vue +5 -0
- package/packages/super-grid/src/normal-column-content.vue +1056 -0
- package/packages/super-grid/src/normal-column.vue +57 -740
- package/packages/super-grid/src/row-detail.vue +50 -0
- package/packages/super-grid/src/row-operation.vue +19 -10
- package/packages/super-grid/src/scan-util.ts +243 -0
- package/packages/super-grid/src/search-button.vue +18 -14
- package/packages/super-grid/src/search-form-advancedQuery.vue +9 -2
- package/packages/super-grid/src/search-form-item.vue +10 -3
- package/packages/super-grid/src/search-form-mobile.vue +250 -0
- package/packages/super-grid/src/search-form.vue +159 -82
- package/packages/super-grid/src/super-grid-service.js +51 -6
- package/packages/super-grid/src/super-grid.vue +657 -761
- package/packages/super-grid/src/utils.js +126 -170
- package/packages/super-nine-grid/src/super-nine-grid.vue +1032 -1141
- package/packages/workflow-button/src/workflow-button.vue +6 -1
- package/packages/workgroup-tree/src/workgroup-tree.vue +31 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +28 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +26 -0
- package/packages/workgroup-tree-mobile/index.js +6 -0
- package/packages/workgroup-tree-mobile/src/dept-result.vue +51 -0
- package/packages/workgroup-tree-mobile/src/workgroup-tree-app.vue +120 -0
- package/packages/workgroup-tree-mobile/src/workgroup-tree-inline-app.vue +375 -0
- package/packages/workgroup-tree-mobile/src/workgroup-tree-service.ts +62 -0
- package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +15 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +27 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +11 -0
- package/packages/workgroup-user-tree-mobile/index.js +6 -0
- package/packages/workgroup-user-tree-mobile/src/dept-path.vue +36 -0
- package/packages/workgroup-user-tree-mobile/src/dept-result.vue +58 -0
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-app.vue +119 -0
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-inline-app.vue +394 -0
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-service.ts +41 -0
- package/src/api/sso-service.js +44 -15
- package/src/directives/permission/permission.js +4 -3
- package/src/i18n/langs/cn.js +19 -3
- package/src/i18n/langs/en.js +18 -2
- package/src/permission.js +114 -122
- package/src/store/modules/user.js +32 -33
- package/src/styles/index.scss +1 -0
- package/src/styles/table.scss +12 -0
- package/src/styles/theme/dark-blue/button.scss +2 -2
- package/src/styles/theme/dark-blue/index.scss +1 -1
- package/src/styles/theme/dark-blue/sidebar.scss +10 -0
- package/src/styles/theme/dark-blue/table.scss +8 -52
- package/src/styles/theme/green/button.scss +2 -2
- package/src/styles/theme/green/green.scss +1 -1
- package/src/styles/theme/green/index.scss +1 -1
- package/src/styles/theme/green/sidebar.scss +20 -0
- package/src/styles/theme/green/table.scss +7 -51
- package/src/styles/theme/ocean-blue/button.scss +2 -2
- package/src/styles/theme/ocean-blue/index.scss +1 -1
- package/src/styles/theme/ocean-blue/ocean-blue.scss +1 -1
- package/src/styles/theme/ocean-blue/sidebar.scss +10 -0
- package/src/styles/theme/ocean-blue/table.scss +7 -52
- package/src/utils/auth.js +23 -3
- package/src/utils/calculator/calculator-factory.js +4 -4
- package/src/utils/calculator/calculator-util.js +14 -0
- package/src/utils/common-util.js +270 -124
- package/src/utils/i18n-util.js +145 -0
- package/src/utils/jump-page-utils.js +245 -314
- package/src/utils/permission.js +7 -1
- package/src/utils/permissionAuth.js +155 -37
- package/src/utils/request.js +10 -11
- package/src/utils/util.js +154 -205
- package/src/views/layout/EmptyLayout.vue +1 -1
- package/src/views/layout/components/Menubar/Item.vue +27 -4
- package/src/views/layout/components/Menubar/SidebarItem.vue +7 -3
- package/src/views/layout/components/Menubar/index.vue +14 -2
- package/src/views/layout/tab-content-index.vue +1 -1
|
@@ -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/api/sso-service.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import request from '../utils/request'
|
|
2
2
|
import {getLanguage, getTheme} from '../utils/auth'
|
|
3
3
|
import * as Vue from 'vue'
|
|
4
|
+
import { isMobileBrowser } from '../utils/common-util'
|
|
4
5
|
function login(username, password, language) {
|
|
5
6
|
const usernamePasswordToken = {
|
|
6
7
|
username,
|
|
@@ -60,22 +61,27 @@ function logout() {
|
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
function getCurrentUserPermissionsBySystem(loginName, systemCode) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
console.log('getCurrentUserPermissionsBySystem----loginName=', loginName, isMobileBrowser())
|
|
65
|
+
if(isMobileBrowser()){
|
|
66
|
+
return getCurrentUserMobilePermissions(loginName)
|
|
67
|
+
} else {
|
|
68
|
+
if (!systemCode || systemCode+'' === 'null') {
|
|
69
|
+
if (window.$vueApp.config.globalProperties.customSystem) {
|
|
70
|
+
systemCode = window.$vueApp.config.globalProperties.customSystem
|
|
71
|
+
} else {
|
|
72
|
+
systemCode = window.$vueApp.config.globalProperties.systemCode
|
|
73
|
+
}
|
|
68
74
|
}
|
|
75
|
+
return request.get(
|
|
76
|
+
window.$vueApp.config.globalProperties.baseAPI +
|
|
77
|
+
'/sso/current-users/permissions/with-system?loginName=' +
|
|
78
|
+
encodeURI(loginName) +
|
|
79
|
+
'&systemCode=' +
|
|
80
|
+
systemCode +
|
|
81
|
+
'&_t=' +
|
|
82
|
+
new Date().getTime()
|
|
83
|
+
)
|
|
69
84
|
}
|
|
70
|
-
return request.get(
|
|
71
|
-
window.$vueApp.config.globalProperties.baseAPI +
|
|
72
|
-
'/sso/current-users/permissions/with-system?loginName=' +
|
|
73
|
-
encodeURI(loginName) +
|
|
74
|
-
'&systemCode=' +
|
|
75
|
-
systemCode +
|
|
76
|
-
'&_t=' +
|
|
77
|
-
new Date().getTime()
|
|
78
|
-
)
|
|
79
85
|
}
|
|
80
86
|
|
|
81
87
|
function isPasswordExpired(username, password) {
|
|
@@ -89,6 +95,20 @@ function isPasswordExpired(username, password) {
|
|
|
89
95
|
)
|
|
90
96
|
}
|
|
91
97
|
|
|
98
|
+
function isPasswordExpiredWithValidateCode(username, password, validateCode, imageCodeKey) {
|
|
99
|
+
const usernamePasswordToken = {
|
|
100
|
+
username,
|
|
101
|
+
password,
|
|
102
|
+
validateCode,
|
|
103
|
+
imageCodeKey
|
|
104
|
+
}
|
|
105
|
+
return request.post(
|
|
106
|
+
window.$vueApp.config.globalProperties.baseAPI + '/sso/is-password-expired-with-validate-code',
|
|
107
|
+
usernamePasswordToken
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
|
|
92
112
|
/** 更新密码 */
|
|
93
113
|
function updatePassword(data) {
|
|
94
114
|
return request.put(
|
|
@@ -198,6 +218,14 @@ function getDevPlatformPermissions(roleCodes) {
|
|
|
198
218
|
)
|
|
199
219
|
}
|
|
200
220
|
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
function getCurrentUserMobilePermissions (loginName) {
|
|
224
|
+
|
|
225
|
+
console.log('getCurrentUserMobilePermissions----loginName=', loginName, 'window.$vueApp.config.globalProperties.baseAPI=', window.$vueApp.config.globalProperties.baseAPI)
|
|
226
|
+
return request.get(window.$vueApp.config.globalProperties.baseAPI + '/sso/current-users/mobile-permissions?loginName=' + encodeURI(loginName) + '&_t=' + new Date().getTime())
|
|
227
|
+
}
|
|
228
|
+
|
|
201
229
|
export default {
|
|
202
230
|
login,
|
|
203
231
|
getCurrentUser,
|
|
@@ -213,5 +241,6 @@ export default {
|
|
|
213
241
|
isLoginTimeOut,
|
|
214
242
|
getUserPermissionMenusBySystemCode,
|
|
215
243
|
loginWithValidateCode,
|
|
216
|
-
getDevPlatformPermissions
|
|
244
|
+
getDevPlatformPermissions,
|
|
245
|
+
isPasswordExpiredWithValidateCode
|
|
217
246
|
}
|
|
@@ -12,9 +12,10 @@ export default {
|
|
|
12
12
|
el.parentNode && el.parentNode.removeChild(el)
|
|
13
13
|
}
|
|
14
14
|
} else {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
console.log( `need permission1! Like v-permission="acs.department.save"`)
|
|
16
|
+
// throw new Error(
|
|
17
|
+
// `need permission1! Like v-permission="acs.department.save"`
|
|
18
|
+
// )
|
|
18
19
|
}
|
|
19
20
|
},
|
|
20
21
|
}
|