imatrix-ui 2.8.39-dw → 2.8.39-pvtmp
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.umd.min.js +5 -35
- package/package.json +6 -4
- package/packages/breadcrumb/index.js +6 -0
- package/packages/breadcrumb/src/breadcrumb.vue +71 -0
- package/packages/department-tree/index.js +6 -0
- package/packages/department-tree/src/department-tree.vue +108 -0
- package/packages/department-tree-inline/index.js +6 -0
- package/packages/department-tree-inline/src/department-multi-tree-inline.vue +411 -0
- package/packages/department-tree-inline/src/department-single-tree-inline.vue +293 -0
- package/packages/department-tree-inline/src/department-tree-inline.vue +86 -0
- package/packages/department-tree-inline/src/department-tree-service.js +275 -0
- package/packages/department-tree-inline/src/search-result.vue +176 -0
- package/packages/department-user-tree/index.js +6 -0
- package/packages/department-user-tree/src/department-user-multiple-tree.vue +116 -0
- package/packages/department-user-tree/src/department-user-single-tree.vue +76 -0
- package/packages/department-user-tree/src/department-user-tree.vue +101 -0
- package/packages/department-user-tree-inline/index.js +6 -0
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +639 -0
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +274 -0
- package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +79 -0
- package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +248 -0
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +142 -0
- package/packages/department-user-tree-inline/src/search-result.vue +197 -0
- package/packages/directives/prevent-reclick.js +19 -0
- package/packages/dynamic-source-select/index.js +6 -0
- package/packages/dynamic-source-select/src/dynamic-source-select-service.js +75 -0
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +586 -0
- package/packages/dynamic-source-select/src/events.js +55 -0
- package/packages/fs-preview/index.js +6 -0
- package/packages/fs-preview/src/fs-preview.vue +226 -0
- package/packages/fs-upload/index.js +6 -0
- package/packages/fs-upload/src/fs-upload-multi.vue +420 -0
- package/packages/fs-upload/src/fs-upload-single.vue +312 -0
- package/packages/fs-upload/src/fs-upload.vue +189 -0
- package/packages/fs-upload/src/see-big-picture.vue +55 -0
- package/packages/fs-upload-list/index.js +6 -0
- package/packages/fs-upload-list/src/fs-upload-list.vue +287 -0
- package/packages/hamburger/index.js +6 -0
- package/packages/hamburger/src/hamburger.vue +38 -0
- package/packages/index.js +121 -0
- package/packages/multipart-upload/index.js +6 -0
- package/packages/multipart-upload/src/index.vue +73 -0
- package/packages/multipart-upload/src/multipart-upload-form.vue +297 -0
- package/packages/multipart-upload/src/multipart-upload-list.vue +378 -0
- package/packages/organization-input/index.js +6 -0
- package/packages/organization-input/src/organization-input.vue +542 -0
- package/packages/plugins/export-data-new.js +468 -0
- package/packages/plugins/export-data.js +361 -0
- package/packages/plugins/index.js +15 -0
- package/packages/plugins/public-method.js +43 -0
- package/packages/remove-department/index.js +6 -0
- package/packages/remove-department/src/remove-department.vue +172 -0
- package/packages/remove-department/src/remove-dept-service.js +20 -0
- package/packages/remove-user/index.js +6 -0
- package/packages/remove-user/src/remove-user-service.js +20 -0
- package/packages/remove-user/src/remove-user.vue +195 -0
- package/packages/remove-workgroup/index.js +6 -0
- package/packages/remove-workgroup/src/remove-workgroup-service.js +20 -0
- package/packages/remove-workgroup/src/remove-workgroup.vue +159 -0
- package/packages/rich-editor/index.js +7 -0
- package/packages/rich-editor/index.vue +278 -0
- package/packages/rich-editor/langs/zh-Hans.js +1 -0
- package/packages/rich-editor/viewer.vue +103 -0
- package/packages/scan-code-input/index.js +6 -0
- package/packages/scan-code-input/src/events.js +33 -0
- package/packages/scan-code-input/src/scan-code-input-colse.vue +131 -0
- package/packages/scan-code-input/src/scan-code-input.vue +116 -0
- package/packages/secret-info/index.js +7 -0
- package/packages/secret-info/index.vue +90 -0
- package/packages/super-grid/index.js +7 -0
- package/packages/super-grid/src/apis.js +825 -0
- package/packages/super-grid/src/columns-config.vue +335 -0
- package/packages/super-grid/src/custom-formatter.js +280 -0
- package/packages/super-grid/src/dynamic-input.vue +1286 -0
- package/packages/super-grid/src/eventBus.js +2 -0
- package/packages/super-grid/src/events.js +55 -0
- package/packages/super-grid/src/formValidatorUtil.js +226 -0
- package/packages/super-grid/src/formatter.js +181 -0
- package/packages/super-grid/src/group-column.vue +100 -0
- package/packages/super-grid/src/header-context-menu.vue +87 -0
- package/packages/super-grid/src/index-column.vue +51 -0
- package/packages/super-grid/src/normal-column.vue +775 -0
- package/packages/super-grid/src/public-methods.js +31 -0
- package/packages/super-grid/src/row-operation.vue +161 -0
- package/packages/super-grid/src/search-button.vue +66 -0
- package/packages/super-grid/src/search-condition-input.vue +61 -0
- package/packages/super-grid/src/search-condition-list.vue +59 -0
- package/packages/super-grid/src/search-form-advancedQuery.vue +654 -0
- package/packages/super-grid/src/search-form-dialog.vue +79 -0
- package/packages/super-grid/src/search-form-item.vue +405 -0
- package/packages/super-grid/src/search-form-number.vue +38 -0
- package/packages/super-grid/src/search-form-open.vue +170 -0
- package/packages/super-grid/src/search-form-ordinarySearch.vue +196 -0
- package/packages/super-grid/src/search-form.vue +642 -0
- package/packages/super-grid/src/search-methods.js +448 -0
- package/packages/super-grid/src/selection-column.vue +43 -0
- package/packages/super-grid/src/store.js +3 -0
- package/packages/super-grid/src/super-grid-service.js +595 -0
- package/packages/super-grid/src/super-grid.vue +2936 -0
- package/packages/super-grid/src/utils.js +782 -0
- package/packages/super-grid/src/view-image-dialog.vue +130 -0
- package/packages/super-nine-grid/index.js +7 -0
- package/packages/super-nine-grid/src/apis.js +103 -0
- package/packages/super-nine-grid/src/custom-formatter.js +66 -0
- package/packages/super-nine-grid/src/formatter.js +131 -0
- package/packages/super-nine-grid/src/search-form-number.vue +38 -0
- package/packages/super-nine-grid/src/search-form.vue +430 -0
- package/packages/super-nine-grid/src/search-methods.js +134 -0
- package/packages/super-nine-grid/src/store.js +3 -0
- package/packages/super-nine-grid/src/super-grid-service.js +93 -0
- package/packages/super-nine-grid/src/super-nine-grid.vue +883 -0
- package/packages/super-nine-grid/src/utils.js +261 -0
- package/packages/svg-icon/index.js +6 -0
- package/packages/svg-icon/src/svg-icon.vue +43 -0
- package/packages/utils/memory-cache-utils.js +90 -0
- package/packages/utils/utils.js +152 -0
- package/packages/utils/value-set.js +86 -0
- package/packages/valid-code/index.js +7 -0
- package/packages/valid-code/src/valid-code.vue +95 -0
- package/packages/workflow-button/index.js +6 -0
- package/packages/workflow-button/src/workflow-button.vue +325 -0
- package/packages/workflow-history-list/index.js +6 -0
- package/packages/workflow-history-list/src/api.js +7 -0
- package/packages/workflow-history-list/src/workflow-history-list.vue +197 -0
- package/packages/workgroup-tree/index.js +6 -0
- package/packages/workgroup-tree/src/workgroup-tree.vue +77 -0
- package/packages/workgroup-tree-inline/index.js +6 -0
- package/packages/workgroup-tree-inline/src/search-result.vue +168 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +458 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +71 -0
- package/packages/workgroup-user-tree/index.js +6 -0
- package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +100 -0
- package/packages/workgroup-user-tree-inline/index.js +6 -0
- package/packages/workgroup-user-tree-inline/src/search-result.vue +197 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +192 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +584 -0
- package/packages/year-range-picker/index.js +6 -0
- package/packages/year-range-picker/src/year-range-picker.vue +51 -0
- package/src/api/sso-service.js +9 -1
- package/src/api/tab.js +3 -3
- package/src/i18n/i18n.js +1 -1
- package/src/i18n/langs/cn.js +15 -5
- package/src/i18n/langs/en.js +15 -5
- package/src/index.js +93 -0
- package/src/permission.js +51 -17
- package/src/plugins.js +3 -3
- package/src/store/getters.js +2 -1
- package/src/store/modules/app.js +10 -1
- package/src/store/modules/user.js +11 -18
- package/src/styles/display-layout.scss +34 -0
- package/src/styles/index.scss +32 -4
- package/src/styles/theme/dark-blue/button.scss +9 -0
- package/src/styles/theme/dark-blue/card.scss +64 -0
- package/src/styles/theme/dark-blue/checkbox.scss +10 -0
- package/src/styles/theme/dark-blue/dark-blue-var.scss +8 -0
- package/src/styles/theme/dark-blue/dialog.scss +21 -0
- package/src/styles/theme/dark-blue/element-variables.scss +7 -0
- package/src/styles/theme/dark-blue/font.scss +71 -0
- package/src/styles/theme/dark-blue/form.scss +51 -0
- package/src/styles/theme/dark-blue/index.scss +247 -0
- package/src/styles/theme/dark-blue/input.scss +15 -0
- package/src/styles/theme/dark-blue/pagination.scss +14 -0
- package/src/styles/theme/dark-blue/scrollbar-style.scss +32 -0
- package/src/styles/theme/dark-blue/sidebar.scss +296 -0
- package/src/styles/theme/dark-blue/tab.scss +83 -0
- package/src/styles/theme/dark-blue/table.scss +60 -0
- package/src/styles/theme/dark-blue/tree.scss +31 -0
- package/src/styles/theme/dark-blue/var.scss +1028 -0
- package/src/styles/theme/gray/input-style.scss +8 -0
- package/src/styles/theme/gray/sidebar.scss +14 -2
- package/src/utils/auth-api.js +171 -0
- package/src/utils/auth.js +75 -41
- package/src/utils/calculator/calculator-factory.js +2 -2
- package/src/utils/calculator/calculator-util.js +7 -7
- package/src/utils/common-util.js +134 -1
- package/src/utils/jump-page-utils.js +36 -10
- package/src/utils/menu.js +19 -0
- package/src/utils/permission.js +4 -0
- package/src/utils/permissionAuth.js +46 -25
- package/src/utils/request.js +65 -8
- package/src/utils/util.js +77 -29
- package/src/views/dsc-component/Sidebar/Item.vue +5 -5
- package/src/views/dsc-component/Sidebar/Link.vue +11 -2
- package/src/views/dsc-component/Sidebar/SidebarItem.vue +37 -21
- package/src/views/dsc-component/Sidebar/index.vue +24 -12
- package/src/views/dsc-component/tabs/tab-content.vue +18 -2
- package/src/views/layout/components/Breadcrumb/index.vue +1 -1
- package/src/views/login/index.vue +1 -1
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-container style="height: 395px">
|
|
4
|
+
<el-aside width="430px">
|
|
5
|
+
<el-container style="height: 390px">
|
|
6
|
+
<el-header style="text-align: right; font-size: 12px">
|
|
7
|
+
<el-autocomplete
|
|
8
|
+
v-model="filterText"
|
|
9
|
+
select-when-unmatched
|
|
10
|
+
class="inline-input inline-input-custom"
|
|
11
|
+
:fetch-suggestions="querySearch"
|
|
12
|
+
:placeholder="$t('imatrixUIMessage.pleaseEnterTeamName')"
|
|
13
|
+
:trigger-on-focus="false"
|
|
14
|
+
@select="handleSelect"
|
|
15
|
+
@keyup.enter.native="clickSearch"
|
|
16
|
+
>
|
|
17
|
+
<el-button slot="append" icon="el-icon-search" @click="clickSearch" />
|
|
18
|
+
</el-autocomplete>
|
|
19
|
+
</el-header>
|
|
20
|
+
<el-main>
|
|
21
|
+
<div v-if="!searchValue" style="padding-top:5px;overflow:auto;width: auto;display: inline-block !important;">
|
|
22
|
+
<el-tree
|
|
23
|
+
ref="workgroupTree"
|
|
24
|
+
:props="defaultProps"
|
|
25
|
+
:load="loadNode"
|
|
26
|
+
lazy
|
|
27
|
+
:show-checkbox="multiple"
|
|
28
|
+
node-key="id"
|
|
29
|
+
:render-content="renderContent"
|
|
30
|
+
:filter-node-method="filterNode"
|
|
31
|
+
@check="handleCheckNode"
|
|
32
|
+
@node-click="handleNodeClick"
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
<div v-if="searchValue && searchValue.length > 0" style="height:100%;overflow: hidden;">
|
|
36
|
+
<workgroup-result
|
|
37
|
+
ref="workgroupResult"
|
|
38
|
+
:grid-data="searchResult"
|
|
39
|
+
:select-result="selectResult"
|
|
40
|
+
:height="height"
|
|
41
|
+
:multiple="multiple"
|
|
42
|
+
:is-search-result="true"
|
|
43
|
+
@selectResult="getSelectWorkgroup"
|
|
44
|
+
@resultRowDblclick="resultRowDblclick"
|
|
45
|
+
@addWorkgroup="addWorkgroup"
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
</el-main>
|
|
49
|
+
</el-container>
|
|
50
|
+
</el-aside>
|
|
51
|
+
<el-container v-if="multiple">
|
|
52
|
+
<el-aside width="2px">
|
|
53
|
+
<table border="1px" cellpadding="0" cellspacing="0" style="height:100%;border-left-style:solid; border-bottom-style:none;border-right-style:none;border-top-style:none;border-left-color: #cccccc" />
|
|
54
|
+
</el-aside>
|
|
55
|
+
<el-main style="padding: 10px">
|
|
56
|
+
<div style="text-align:left;font-size:16px">
|
|
57
|
+
{{ $t('imatrixUIMessage.selectedWorkingGroup') }}:
|
|
58
|
+
</div>
|
|
59
|
+
<div :style="'padding-top: 5px;height:90%;overflow: hidden;'">
|
|
60
|
+
<workgroup-result
|
|
61
|
+
:grid-data="selectResult"
|
|
62
|
+
:height="height"
|
|
63
|
+
:multiple="multiple"
|
|
64
|
+
:is-search-result="false"
|
|
65
|
+
@selectResult="getSelectWorkgroup"
|
|
66
|
+
@resultRowDblclick="resultRowDblclick"
|
|
67
|
+
@removeWorkgroup="removeWorkgroup"
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
70
|
+
</el-main>
|
|
71
|
+
</el-container>
|
|
72
|
+
</el-container>
|
|
73
|
+
</div>
|
|
74
|
+
</template>
|
|
75
|
+
<style>
|
|
76
|
+
.searchResult {
|
|
77
|
+
color:red
|
|
78
|
+
}
|
|
79
|
+
.inline-input-custom {
|
|
80
|
+
width : 90%
|
|
81
|
+
}
|
|
82
|
+
</style>
|
|
83
|
+
|
|
84
|
+
<script>
|
|
85
|
+
import localStorage from '../../../src/utils/local-storage'
|
|
86
|
+
import utils from '../../utils/utils'
|
|
87
|
+
import workgroupTreeService from './workgroup-tree-service'
|
|
88
|
+
import WorkgroupResult from './search-result.vue'
|
|
89
|
+
export default {
|
|
90
|
+
name: 'InlineWorkgroupTree',
|
|
91
|
+
components: {
|
|
92
|
+
WorkgroupResult
|
|
93
|
+
},
|
|
94
|
+
props: {
|
|
95
|
+
// 是否是多选树,默认是true
|
|
96
|
+
multiple: {
|
|
97
|
+
type: Boolean,
|
|
98
|
+
default: true
|
|
99
|
+
},
|
|
100
|
+
// 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
|
|
101
|
+
branchInfo: {
|
|
102
|
+
type: Array,
|
|
103
|
+
default: null
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
},
|
|
107
|
+
data() {
|
|
108
|
+
return {
|
|
109
|
+
filterText: '',
|
|
110
|
+
defaultProps: {
|
|
111
|
+
id: 'id',
|
|
112
|
+
label: 'name',
|
|
113
|
+
children: 'children',
|
|
114
|
+
isLeaf: 'leaf'
|
|
115
|
+
},
|
|
116
|
+
containBranch: false, // 当前租户内是否包含分支机构。获得当前选中部门名称时,如果有分支,则需要将分支名称返回给工作组,例如:部门1(分支1)
|
|
117
|
+
tenantNodeId: -1, // 公司节点的id
|
|
118
|
+
restaurants: [], // 查询的备选值
|
|
119
|
+
searchValue: null, // 查询条件
|
|
120
|
+
searchResult: [], // 工作组的查询结果
|
|
121
|
+
selectResult: [], // 工作组的选中结果
|
|
122
|
+
searchStoreKey: 'searchWorkgroup',
|
|
123
|
+
selectNodeInfo: null, // 单选时,选择的工作组信息
|
|
124
|
+
selectWorkgroupData: null,
|
|
125
|
+
tenantInfo: {} // 公司根节点信息
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
computed: {
|
|
129
|
+
},
|
|
130
|
+
watch: {
|
|
131
|
+
filterText(val) {
|
|
132
|
+
if (!val) {
|
|
133
|
+
this.searchValue = val
|
|
134
|
+
// 清空查询内容时,重新加载整个树
|
|
135
|
+
this.loadWorkgroup(this.tenantNodeId)
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
mounted() {
|
|
140
|
+
var searchWorkgroup = localStorage.getObject(this.searchStoreKey)
|
|
141
|
+
if (searchWorkgroup) {
|
|
142
|
+
this.restaurants = searchWorkgroup
|
|
143
|
+
} else {
|
|
144
|
+
this.restaurants = []
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
methods: {
|
|
148
|
+
...utils,
|
|
149
|
+
...workgroupTreeService,
|
|
150
|
+
// 将查询结果中指定工作组添加到已选择工作组集合中
|
|
151
|
+
addWorkgroup(index, workgroup) {
|
|
152
|
+
const containWorkgroups = this.selectResult.filter(this.filterWorkgroup(workgroup))
|
|
153
|
+
if (containWorkgroups && containWorkgroups.length === 0) {
|
|
154
|
+
this.selectResult.push(workgroup)
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
filterWorkgroup(queryWorkgroup) {
|
|
158
|
+
return (workgroup) => {
|
|
159
|
+
return (workgroup.id === queryWorkgroup.id)
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
removeWorkgroup(index, workgroup) {
|
|
163
|
+
if (this.$refs.workgroupTree) {
|
|
164
|
+
// 通过查询结果添加的工作组,在返回到组织结构树时,也选中了该工作组,在移除该工作组时,需要去掉复选框的选中状态
|
|
165
|
+
const checkedKeys = this.$refs.workgroupTree.getCheckedKeys()
|
|
166
|
+
const currentCheckedWorkgroupNodeIds = checkedKeys.filter(this.filterWorkgroupNode(workgroup))
|
|
167
|
+
if (currentCheckedWorkgroupNodeIds.length > 0) {
|
|
168
|
+
// 表示当前工作组是选中的状态,需要去掉
|
|
169
|
+
currentCheckedWorkgroupNodeIds.forEach(workgroupNodeId => {
|
|
170
|
+
this.$refs.workgroupTree.setChecked(workgroupNodeId, false)
|
|
171
|
+
})
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
this.selectResult = this.removeRow(this.selectResult, workgroup)
|
|
175
|
+
if (!this.selectResult || this.selectResult.length === 0) {
|
|
176
|
+
// 已选结果面板没有内容,则左侧树节点也不要有选中节点了
|
|
177
|
+
if (this.$refs.workgroupTree) {
|
|
178
|
+
this.$refs.workgroupTree.setCheckedKeys([])
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
filterWorkgroupNode(queryWorkgroup) {
|
|
183
|
+
return (workgroupNodeId) => {
|
|
184
|
+
return (workgroupNodeId === queryWorkgroup.id)
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
getSelectWorkgroup(workgroup) {
|
|
188
|
+
this.packageSelectResult(workgroup)
|
|
189
|
+
},
|
|
190
|
+
resultRowDblclick(workgroup) {
|
|
191
|
+
this.packageSelectResult(workgroup)
|
|
192
|
+
this.$emit('result', this.selectNodeInfo)
|
|
193
|
+
},
|
|
194
|
+
packageSelectResult(workgroup) {
|
|
195
|
+
workgroup.tenantCode = this.tenantInfo.code
|
|
196
|
+
workgroup.tenantName = this.tenantInfo.tenantName
|
|
197
|
+
const selectNodeInfo = {
|
|
198
|
+
id: workgroup.id,
|
|
199
|
+
name: workgroup.name,
|
|
200
|
+
code: workgroup.code,
|
|
201
|
+
subCompanyName: workgroup.subCompanyName,
|
|
202
|
+
workgroup: workgroup
|
|
203
|
+
}
|
|
204
|
+
// 表示是勾选单选按钮或 选中树节点
|
|
205
|
+
this.selectNodeInfo = selectNodeInfo
|
|
206
|
+
},
|
|
207
|
+
handleSelect(item) {
|
|
208
|
+
this.handleSelectUtil(item, localStorage)
|
|
209
|
+
},
|
|
210
|
+
search(value) {
|
|
211
|
+
this.searchValue = value
|
|
212
|
+
this.$refs.workgroupTree.filter(value)
|
|
213
|
+
},
|
|
214
|
+
// 点击查询按钮调用的方法
|
|
215
|
+
clickSearch() {
|
|
216
|
+
this.storeSeachValue(localStorage, this.searchStoreKey, this.filterText)
|
|
217
|
+
this.search(this.filterText)
|
|
218
|
+
},
|
|
219
|
+
filterNode(value, data, node) {
|
|
220
|
+
if (!value) {
|
|
221
|
+
return true
|
|
222
|
+
} else {
|
|
223
|
+
var workgroupName = data.name
|
|
224
|
+
if (data.id === this.tenantNodeId) {
|
|
225
|
+
// 表示是根节点公司节点
|
|
226
|
+
return false
|
|
227
|
+
} else if (this.containBranch) {
|
|
228
|
+
// 如果包含分支,工作组节点显示的格式为:工作组名称(分支名称)
|
|
229
|
+
workgroupName = workgroupName.substring(0, workgroupName.lastIndexOf('('))
|
|
230
|
+
}
|
|
231
|
+
return workgroupName.indexOf(value) !== -1
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
// 点击复选框时处理
|
|
235
|
+
handleCheckNode(data, checkObj) {
|
|
236
|
+
if (checkObj.checkedKeys.indexOf(data.id) > -1) {
|
|
237
|
+
// 表示正选中data节点
|
|
238
|
+
if (data.id === this.tenantNodeId) {
|
|
239
|
+
// 表示选中了公司节点
|
|
240
|
+
this.checkedAllWorkgroups(data)
|
|
241
|
+
} else {
|
|
242
|
+
this.selectResult.push(JSON.parse(data.data))
|
|
243
|
+
}
|
|
244
|
+
} else {
|
|
245
|
+
// 表示正取消选中data节点,同时要取消其子节点的选中状态
|
|
246
|
+
if (data.id === this.tenantNodeId) {
|
|
247
|
+
// 表示取消公司节点的选中状态,即取消所有节点的勾选状态
|
|
248
|
+
this.$refs.workgroupTree.setCheckedKeys([])
|
|
249
|
+
} else {
|
|
250
|
+
this.selectResult = this.removeRow(this.selectResult, JSON.parse(data.data))
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
// 选中了根节点公司节点时,选中所有工作组
|
|
255
|
+
checkedAllWorkgroups(root) {
|
|
256
|
+
const children = root.children
|
|
257
|
+
if (children) {
|
|
258
|
+
children.forEach(workgroupNode => {
|
|
259
|
+
this.$refs.workgroupTree.setChecked(workgroupNode.id, true)
|
|
260
|
+
})
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
handleNodeClick(data, node, nodeTree) {
|
|
264
|
+
if (this.multiple) {
|
|
265
|
+
// 多选部门树时,处理点击节点事件
|
|
266
|
+
this.clickNodeWhenMultiple(data)
|
|
267
|
+
}
|
|
268
|
+
this.selectSingleNode(data, false)
|
|
269
|
+
},
|
|
270
|
+
selectSingleNode(data, isClickOkBtn) {
|
|
271
|
+
if (this.isWorkgroupNode(data) && !this.multiple) {
|
|
272
|
+
// 点击的是工作组节点,并且是单选树时,点击部门节点直接关闭弹框
|
|
273
|
+
const workgroup = JSON.parse(data.data)
|
|
274
|
+
workgroup.tenantCode = this.tenantInfo.code
|
|
275
|
+
workgroup.tenantName = this.tenantInfo.tenantName
|
|
276
|
+
var selectNodeInfo = {
|
|
277
|
+
id: data.id,
|
|
278
|
+
name: data.name,
|
|
279
|
+
code: workgroup.code,
|
|
280
|
+
containBranch: this.containBranch,
|
|
281
|
+
workgroup: workgroup
|
|
282
|
+
}
|
|
283
|
+
this.selectNodeInfo = selectNodeInfo
|
|
284
|
+
if (isClickOkBtn === true) {
|
|
285
|
+
// 点击确定按钮时才需要调result回调事件,关闭弹框
|
|
286
|
+
this.$emit('result', selectNodeInfo)
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
// 多选树时,点击节点处理复选框的选中状态
|
|
291
|
+
clickNodeWhenMultiple(data) {
|
|
292
|
+
var checkedKeys = []
|
|
293
|
+
if (this.$refs.workgroupTree) {
|
|
294
|
+
checkedKeys = this.$refs.workgroupTree.getCheckedKeys()
|
|
295
|
+
}
|
|
296
|
+
// 取消选中状态时,保持节点是展开的状态,不要折叠
|
|
297
|
+
this.$refs.workgroupTree.store.nodesMap[data.id].expanded = true
|
|
298
|
+
if (checkedKeys.indexOf(data.id) > -1) {
|
|
299
|
+
// 表示当前节点是选中状态,则需要取消其选中状态
|
|
300
|
+
// 取消当前节点的勾选状态
|
|
301
|
+
this.$refs.workgroupTree.setChecked(data.id, false)
|
|
302
|
+
if (data.id === this.tenantNodeId) {
|
|
303
|
+
// 表示取消公司节点的选中状态,即取消所有节点的勾选状态
|
|
304
|
+
this.$refs.workgroupTree.setCheckedKeys([])
|
|
305
|
+
} else {
|
|
306
|
+
this.selectResult = this.removeRow(this.selectResult, JSON.parse(data.data))
|
|
307
|
+
}
|
|
308
|
+
} else {
|
|
309
|
+
// 表示当前节点不是选中的状态,需要勾选该节点
|
|
310
|
+
this.$refs.workgroupTree.setChecked(data.id, true)
|
|
311
|
+
if (data.id === this.tenantNodeId) {
|
|
312
|
+
// 表示当前正选中根节点公司节点,则需要勾选所有节点的选中状态
|
|
313
|
+
this.checkedAllWorkgroups(data)
|
|
314
|
+
} else {
|
|
315
|
+
this.selectResult.push(JSON.parse(data.data))
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
isWorkgroupNode(data) {
|
|
320
|
+
// 当前节点不是公司节点,也不是分支机构节点,表示是部门节点
|
|
321
|
+
return data.id !== this.tenantNodeId && data.nodeType && data.nodeType === 'WORKGROUP'
|
|
322
|
+
},
|
|
323
|
+
singleSetValue() {
|
|
324
|
+
let showTip = false
|
|
325
|
+
if (this.searchValue) {
|
|
326
|
+
if (this.selectNodeInfo) {
|
|
327
|
+
this.$emit('result', this.selectNodeInfo)
|
|
328
|
+
} else {
|
|
329
|
+
showTip = true
|
|
330
|
+
}
|
|
331
|
+
} else {
|
|
332
|
+
const data = this.$refs.workgroupTree.getCurrentNode()
|
|
333
|
+
if ((data && data !== null) && this.isWorkgroupNode(data)) {
|
|
334
|
+
this.selectSingleNode(data, true)
|
|
335
|
+
} else {
|
|
336
|
+
showTip = true
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
this.showTip(showTip)
|
|
340
|
+
},
|
|
341
|
+
multipleSetValue() {
|
|
342
|
+
let showTip = false
|
|
343
|
+
var selectNodeInfo = {
|
|
344
|
+
ids: [],
|
|
345
|
+
names: [],
|
|
346
|
+
codes: [],
|
|
347
|
+
workgroups: []
|
|
348
|
+
}
|
|
349
|
+
if (this.searchValue) {
|
|
350
|
+
if (this.selectResult.length > 0) {
|
|
351
|
+
this.selectResult.forEach(workgroupData => {
|
|
352
|
+
const node = { id: workgroupData.id, name: workgroupData.name, code: workgroupData.code }
|
|
353
|
+
this.addSelectedWorkgroupInfo(selectNodeInfo, node, workgroupData)
|
|
354
|
+
})
|
|
355
|
+
this.$emit('result', selectNodeInfo)
|
|
356
|
+
} else {
|
|
357
|
+
showTip = true
|
|
358
|
+
}
|
|
359
|
+
} else {
|
|
360
|
+
var nodes = this.$refs.workgroupTree.getCheckedNodes()
|
|
361
|
+
if (nodes) {
|
|
362
|
+
if (nodes.length === 0) {
|
|
363
|
+
// 没有选择任何节点
|
|
364
|
+
showTip = true
|
|
365
|
+
} else {
|
|
366
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
367
|
+
var node = nodes[i]
|
|
368
|
+
if (node.id !== this.tenantNodeId) {
|
|
369
|
+
// 不是公司根节点,表示是工作组节点,直接存到结果集合中
|
|
370
|
+
// node.data是部门对象的json字符串信息,通过JSON.parse(node.data)将json字符串转为对象
|
|
371
|
+
const workgroupData = JSON.parse(node.data)
|
|
372
|
+
this.addSelectedWorkgroupInfo(selectNodeInfo, node, workgroupData)
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
if (selectNodeInfo.ids.length > 0) {
|
|
376
|
+
this.$emit('result', selectNodeInfo)
|
|
377
|
+
} else {
|
|
378
|
+
showTip = true
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
} else {
|
|
382
|
+
showTip = true
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
this.showTip(showTip)
|
|
386
|
+
},
|
|
387
|
+
selectWorkgroup() {
|
|
388
|
+
if (this.multiple) {
|
|
389
|
+
this.multipleSetValue()
|
|
390
|
+
} else {
|
|
391
|
+
this.singleSetValue()
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
showTip(showTip) {
|
|
395
|
+
// 是否需要显示提示框,默认不显示
|
|
396
|
+
if (showTip) {
|
|
397
|
+
this.$alert(this.$t('imatrixUIMessage.pleaseSelectATeam'), this.$t('imatrixUIMessage.tips'), {
|
|
398
|
+
confirmButtonText: this.$t('imatrixUIPublicModel.sure')
|
|
399
|
+
})
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
// 将选中的部门节点添加到结果集合中
|
|
403
|
+
addSelectedWorkgroupInfo(result, node, workgroup) {
|
|
404
|
+
workgroup.tenantCode = this.tenantInfo.code
|
|
405
|
+
workgroup.tenantName = this.tenantInfo.tenantName
|
|
406
|
+
result.containBranch = this.containBranch
|
|
407
|
+
result.ids.push(node.id)
|
|
408
|
+
result.workgroups.push(workgroup)
|
|
409
|
+
result.codes.push(workgroup.code)
|
|
410
|
+
result.names.push(node.name)
|
|
411
|
+
},
|
|
412
|
+
// 初始化树 或 点击三角展开节点时动态加载子节点
|
|
413
|
+
loadNode(node, resolve) {
|
|
414
|
+
var parentId = 0
|
|
415
|
+
if (node.level === 0) {
|
|
416
|
+
// 表示初始化树
|
|
417
|
+
parentId = 0
|
|
418
|
+
} else {
|
|
419
|
+
parentId = node.data.id
|
|
420
|
+
}
|
|
421
|
+
var checkedKeys = []
|
|
422
|
+
if (this.$refs.workgroupTree) {
|
|
423
|
+
checkedKeys = this.$refs.workgroupTree.getCheckedKeys()
|
|
424
|
+
}
|
|
425
|
+
// 初始化部门树
|
|
426
|
+
this.initLoad(parentId, node, resolve, checkedKeys)
|
|
427
|
+
},
|
|
428
|
+
// 给节点添加自定义图标
|
|
429
|
+
renderContent(h, { node, data, store }) {
|
|
430
|
+
var className
|
|
431
|
+
if (node.data.id === -1) {
|
|
432
|
+
// node.id ===-1表示公司节点,node.branch表示是分支机构节点
|
|
433
|
+
className = 'el-icon-menu'
|
|
434
|
+
} else {
|
|
435
|
+
// 表示是工作组节点
|
|
436
|
+
className = 'el-icon-date'
|
|
437
|
+
}
|
|
438
|
+
if (data.nodeType && data.nodeType === 'WORKGROUP' &&
|
|
439
|
+
this.searchValue && data.name.indexOf(this.searchValue) > -1) {
|
|
440
|
+
// 如果是查询条件
|
|
441
|
+
return (
|
|
442
|
+
<span>
|
|
443
|
+
<i class={className}></i>
|
|
444
|
+
<span class='searchResult' title={node.label}>{node.label}</span>
|
|
445
|
+
</span>
|
|
446
|
+
)
|
|
447
|
+
}
|
|
448
|
+
return (
|
|
449
|
+
<span>
|
|
450
|
+
<i class={className}></i>
|
|
451
|
+
<span title={node.label}>{node.label}</span>
|
|
452
|
+
</span>
|
|
453
|
+
)
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
</script>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
import { getI18n } from '../../../src/utils/util'
|
|
3
|
+
const workgroupTreeService = {
|
|
4
|
+
// 初始化部门树
|
|
5
|
+
initLoad(parentId, node, resolve, checkedKeys) {
|
|
6
|
+
const param = {
|
|
7
|
+
parentId: parentId,
|
|
8
|
+
departmentInfo: this.branchInfo
|
|
9
|
+
}
|
|
10
|
+
this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/workgroups', param).then(data => {
|
|
11
|
+
resolve(data)
|
|
12
|
+
// 更新当前点击的节点的子节点
|
|
13
|
+
this.$refs.workgroupTree.updateKeyChildren(parentId, data)
|
|
14
|
+
if (parentId === 0) {
|
|
15
|
+
// 初始化树时,展开公司节点
|
|
16
|
+
const tenantData = data[0].data
|
|
17
|
+
this.tenantInfo = JSON.parse(tenantData)
|
|
18
|
+
this.containBranch = data[0].containBranch
|
|
19
|
+
// 加载整个组织结构树时,展开公司节点
|
|
20
|
+
this.loadWorkgroup(this.tenantNodeId)
|
|
21
|
+
}
|
|
22
|
+
// 表示是点击三角展开节点时
|
|
23
|
+
if (checkedKeys && checkedKeys.indexOf(parentId) > -1 && parentId === this.tenantNodeId) {
|
|
24
|
+
// 点击公司名称前的三角标识展开节点时,保持当前节点的选中状态
|
|
25
|
+
// 表示当前展开的节点是选中状态,则应保持其选中状态,并选中其子节点
|
|
26
|
+
this.checkedAllWorkgroups(node.data)
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
},
|
|
30
|
+
// 加载当前节点的子节点
|
|
31
|
+
loadWorkgroup(parentId) {
|
|
32
|
+
const param = {
|
|
33
|
+
parentId: parentId,
|
|
34
|
+
departmentInfo: this.branchInfo
|
|
35
|
+
}
|
|
36
|
+
this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/workgroups', param).then(children => {
|
|
37
|
+
this.$refs.workgroupTree.updateKeyChildren(parentId, children)
|
|
38
|
+
if (this.$refs.workgroupTree.store.nodesMap[parentId]) {
|
|
39
|
+
this.$refs.workgroupTree.store.nodesMap[parentId].expanded = true
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
},
|
|
43
|
+
querySearch(queryString, cb) {
|
|
44
|
+
this.searchValue = queryString
|
|
45
|
+
this.searchResult = []
|
|
46
|
+
this.selectNodeInfo = null
|
|
47
|
+
if (queryString && queryString.length > 0) {
|
|
48
|
+
this.filterAppendNodes(queryString)
|
|
49
|
+
cb([])
|
|
50
|
+
} else {
|
|
51
|
+
cb([])
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
filterAppendNodes(value) {
|
|
55
|
+
const param = {
|
|
56
|
+
searchValue: value
|
|
57
|
+
}
|
|
58
|
+
this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/search-workgroups', param).then(result => {
|
|
59
|
+
this.searchResult = result
|
|
60
|
+
if (this.searchResult.length === 0) {
|
|
61
|
+
this.$message({
|
|
62
|
+
showClose: true,
|
|
63
|
+
type: 'error',
|
|
64
|
+
message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
|
|
65
|
+
})
|
|
66
|
+
return
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
export default workgroupTreeService
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-dialog
|
|
4
|
+
class="user-tree"
|
|
5
|
+
visible
|
|
6
|
+
:title="myTitle"
|
|
7
|
+
:close-on-click-modal="false"
|
|
8
|
+
append-to-body
|
|
9
|
+
:width="multiple?'60%':'40%'"
|
|
10
|
+
@open="$emit('open')"
|
|
11
|
+
@opend="$emit('opend')"
|
|
12
|
+
@close="$emit('close')"
|
|
13
|
+
@closed="$emit('closed')"
|
|
14
|
+
>
|
|
15
|
+
<inline-workgroup-user-tree
|
|
16
|
+
ref="workgroupUserTree"
|
|
17
|
+
:multiple="multiple"
|
|
18
|
+
:branch-info="branchInfo"
|
|
19
|
+
:select-user-info="selectUserInfo"
|
|
20
|
+
:search-field="searchField"
|
|
21
|
+
:separator="separator"
|
|
22
|
+
@result="result"
|
|
23
|
+
/>
|
|
24
|
+
<div slot="footer" class="dialog-footer">
|
|
25
|
+
<el-button size="small" @click="$emit('close')">
|
|
26
|
+
{{ $t('imatrixUIPublicModel.cancel') }}
|
|
27
|
+
</el-button>
|
|
28
|
+
<el-button size="small" type="primary" @click="selectWorkgroupUser">
|
|
29
|
+
{{ $t('imatrixUIPublicModel.sure') }}
|
|
30
|
+
</el-button>
|
|
31
|
+
</div>
|
|
32
|
+
</el-dialog>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script>
|
|
37
|
+
import InlineWorkgroupUserTree from '../../workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue'
|
|
38
|
+
export default {
|
|
39
|
+
name: 'WorkgroupUserTree',
|
|
40
|
+
components: {
|
|
41
|
+
InlineWorkgroupUserTree
|
|
42
|
+
},
|
|
43
|
+
props: {
|
|
44
|
+
// 是否是多选树,默认是true
|
|
45
|
+
multiple: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: true
|
|
48
|
+
},
|
|
49
|
+
// 显示指定部门节点及其子节点,不传该属性,表示显示整个组织结构树
|
|
50
|
+
branchInfo: {
|
|
51
|
+
type: Array,
|
|
52
|
+
default: null
|
|
53
|
+
},
|
|
54
|
+
// 弹框的标题
|
|
55
|
+
title: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: null
|
|
58
|
+
},
|
|
59
|
+
// 弹框的宽度
|
|
60
|
+
width: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: '30%'
|
|
63
|
+
},
|
|
64
|
+
// 多选用户树时,已选择用户id或登录名集合,多个之间以逗号隔开
|
|
65
|
+
selectUserInfo: {
|
|
66
|
+
type: [String, Number],
|
|
67
|
+
default: null
|
|
68
|
+
},
|
|
69
|
+
// 移除用户时,用户属性名称:id、loginName、email、telephone,默认是loginName
|
|
70
|
+
searchField: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: 'loginName'
|
|
73
|
+
},
|
|
74
|
+
// 多选树时结果之间的分隔符,默认是逗号分隔
|
|
75
|
+
separator: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: ','
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
},
|
|
81
|
+
data() {
|
|
82
|
+
let myTitle = this.$t('imatrixUIMessage.pleaseSelectATeam')
|
|
83
|
+
if (this.title) {
|
|
84
|
+
myTitle = this.title
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
myTitle
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
methods: {
|
|
91
|
+
result(selectNodeInfo) {
|
|
92
|
+
this.$emit('close', selectNodeInfo)
|
|
93
|
+
},
|
|
94
|
+
// 嵌入树,多选时,点击确定时调用的方法
|
|
95
|
+
selectWorkgroupUser() {
|
|
96
|
+
this.$refs.workgroupUserTree.selectWorkgroupUser()
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
</script>
|