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,197 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="height: 100%">
|
|
3
|
+
<el-table
|
|
4
|
+
ref="superGrid"
|
|
5
|
+
:data="gridData"
|
|
6
|
+
row-key="id"
|
|
7
|
+
:row-class-name="tableRowClassName"
|
|
8
|
+
:max-height="myHeight"
|
|
9
|
+
border
|
|
10
|
+
fit
|
|
11
|
+
@row-click="rowClick"
|
|
12
|
+
@row-dblclick="rowDblclick"
|
|
13
|
+
>
|
|
14
|
+
<el-table-column v-if="multiple === false" width="60" fixed>
|
|
15
|
+
<template slot-scope="scope">
|
|
16
|
+
<el-radio v-model="singleUserIndex" :label="scope.$index" @change="selectWorkgroupUser">
|
|
17
|
+
{{ scope.$index+1 }}
|
|
18
|
+
</el-radio>
|
|
19
|
+
</template>
|
|
20
|
+
</el-table-column>
|
|
21
|
+
<el-table-column v-if="multiple && isSearchResult" fixed :label="$t('imatrixUIPublicModel.edit')" align="center" width="60px">
|
|
22
|
+
<template slot-scope="scope">
|
|
23
|
+
<div>
|
|
24
|
+
<el-button type="primary" size="mini" icon="el-icon-plus" :disabled="isDisable(scope.row)" circle @click="addWorkgroupUser(scope.$index, scope.row)" />
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
</el-table-column>
|
|
28
|
+
<el-table-column v-if="multiple && !isSearchResult" fixed :label="$t('imatrixUIPublicModel.edit')" align="center" width="60px">
|
|
29
|
+
<template slot-scope="scope">
|
|
30
|
+
<div>
|
|
31
|
+
<el-button type="danger" size="mini" icon="el-icon-delete" circle @click="removeWorkgroupUser(scope.$index, scope.row)" />
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
</el-table-column>
|
|
35
|
+
<el-table-column v-if="multiple" :label="$t('superGrid.index')" align="center" width="60px">
|
|
36
|
+
<template slot-scope="scope">
|
|
37
|
+
{{ scope.$index+1 }}
|
|
38
|
+
</template>
|
|
39
|
+
</el-table-column>
|
|
40
|
+
<el-table-column
|
|
41
|
+
:label="$t('departmentUserTreeInline.name')"
|
|
42
|
+
:width="130"
|
|
43
|
+
prop="name"
|
|
44
|
+
>
|
|
45
|
+
<template slot-scope="scope">
|
|
46
|
+
<span v-if="scope.row.enName && scope.row.enName.trim() !== ''" class="ellipsis cell--span" :title="scope.row.name+'('+scope.row.enName+')'">{{ scope.row.name+'('+scope.row.enName+')' }}</span>
|
|
47
|
+
<span v-else class="ellipsis cell--span" :title="scope.row.name">{{ scope.row.name }}</span>
|
|
48
|
+
</template>
|
|
49
|
+
</el-table-column>
|
|
50
|
+
<el-table-column
|
|
51
|
+
:label="$t('departmentUserTreeInline.loginName')"
|
|
52
|
+
:width="110"
|
|
53
|
+
prop="loginName"
|
|
54
|
+
>
|
|
55
|
+
<template slot-scope="scope">
|
|
56
|
+
<span class="ellipsis cell--span" :title="scope.row.loginName">{{ scope.row.loginName }}</span>
|
|
57
|
+
</template>
|
|
58
|
+
</el-table-column>
|
|
59
|
+
<el-table-column
|
|
60
|
+
:label="$t('departmentUserTreeInline.department')"
|
|
61
|
+
:min-width="160"
|
|
62
|
+
prop="mainDepartmentName"
|
|
63
|
+
>
|
|
64
|
+
<template slot-scope="scope">
|
|
65
|
+
<span class="ellipsis cell--span" :title="language && language !== 'cn' && scope.row.mainDepartmentEnName ? scope.row.mainDepartmentEnName : scope.row.mainDepartmentName">{{ language && language !== 'cn' && scope.row.mainDepartmentEnName ? scope.row.mainDepartmentEnName : scope.row.mainDepartmentName }}</span>
|
|
66
|
+
</template>
|
|
67
|
+
</el-table-column>
|
|
68
|
+
<!--由于保密要求,邮箱不能显示,需要脱敏处理,暂时注释掉,不显示-->
|
|
69
|
+
<!-- <el-table-column
|
|
70
|
+
:label="$t('departmentUserTreeInline.email')"
|
|
71
|
+
:width="130"
|
|
72
|
+
prop="email"
|
|
73
|
+
>
|
|
74
|
+
<template slot-scope="scope">
|
|
75
|
+
<span class="ellipsis cell--span" :title="scope.row.email">{{ scope.row.email }}</span>
|
|
76
|
+
</template>
|
|
77
|
+
</el-table-column> -->
|
|
78
|
+
<el-table-column
|
|
79
|
+
v-if="containBranch"
|
|
80
|
+
:label="$t('departmentUserTreeInline.branch')"
|
|
81
|
+
:width="130"
|
|
82
|
+
prop="subCompanyName"
|
|
83
|
+
>
|
|
84
|
+
<template slot-scope="scope">
|
|
85
|
+
<span class="ellipsis cell--span" :title="scope.row.subCompanyName">{{ scope.row.subCompanyName }}</span>
|
|
86
|
+
</template>
|
|
87
|
+
</el-table-column>
|
|
88
|
+
</el-table>
|
|
89
|
+
</div>
|
|
90
|
+
</template>
|
|
91
|
+
<style>
|
|
92
|
+
.searchResult {
|
|
93
|
+
color:red
|
|
94
|
+
}
|
|
95
|
+
.inline-select-custom {
|
|
96
|
+
width : 100px
|
|
97
|
+
}
|
|
98
|
+
.inline-input-custom {
|
|
99
|
+
width : 98%
|
|
100
|
+
}
|
|
101
|
+
</style>
|
|
102
|
+
<script>
|
|
103
|
+
export default {
|
|
104
|
+
name: 'UserResult',
|
|
105
|
+
props: {
|
|
106
|
+
gridData: {
|
|
107
|
+
type: Array,
|
|
108
|
+
default: null
|
|
109
|
+
},
|
|
110
|
+
containBranch: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
default: false
|
|
113
|
+
},
|
|
114
|
+
multiple: {
|
|
115
|
+
type: Boolean,
|
|
116
|
+
default: false
|
|
117
|
+
},
|
|
118
|
+
// 多选树时是否是查询结果列表,用于控制“操作”列按钮的显示
|
|
119
|
+
isSearchResult: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
default: true
|
|
122
|
+
},
|
|
123
|
+
height: {
|
|
124
|
+
type: String,
|
|
125
|
+
default: '300px'
|
|
126
|
+
},
|
|
127
|
+
selectResult: {
|
|
128
|
+
type: Array,
|
|
129
|
+
default: function() {
|
|
130
|
+
return []
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
},
|
|
135
|
+
data() {
|
|
136
|
+
let tableHeight = this.height
|
|
137
|
+
tableHeight = tableHeight.substring(0, tableHeight.indexOf('px'))
|
|
138
|
+
const myHeight = (parseInt(tableHeight) + 30) + 'px'
|
|
139
|
+
return {
|
|
140
|
+
singleUserIndex: null, // 选中的用户序号
|
|
141
|
+
selectedUser: null,
|
|
142
|
+
myHeight,
|
|
143
|
+
language: !window.$locale ? 'cn' : window.$locale
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
created() {
|
|
147
|
+
},
|
|
148
|
+
methods: {
|
|
149
|
+
// 单选树时,点击行事件
|
|
150
|
+
// rowClick(row, column, event) {
|
|
151
|
+
// this.selectedUser = row
|
|
152
|
+
// // this.$emit('rowClick', row, column, event)
|
|
153
|
+
// },
|
|
154
|
+
// 移除工作组
|
|
155
|
+
removeWorkgroupUser(index, row) {
|
|
156
|
+
this.$emit('removeWorkgroupUser', index, row)
|
|
157
|
+
},
|
|
158
|
+
// 添加工作组
|
|
159
|
+
addWorkgroupUser(index, row) {
|
|
160
|
+
this.$emit('addWorkgroupUser', index, row)
|
|
161
|
+
},
|
|
162
|
+
// 选中工作组
|
|
163
|
+
selectWorkgroupUser(selectVal) {
|
|
164
|
+
this.$emit('selectResult', this.gridData[selectVal])
|
|
165
|
+
},
|
|
166
|
+
rowClick(row, column, event) {
|
|
167
|
+
this.singleUserIndex = row.row_index
|
|
168
|
+
this.$emit('selectResult', row)
|
|
169
|
+
},
|
|
170
|
+
tableRowClassName({ row, rowIndex }) {
|
|
171
|
+
row.row_index = rowIndex
|
|
172
|
+
},
|
|
173
|
+
rowDblclick(row, column, event) {
|
|
174
|
+
if (this.multiple) {
|
|
175
|
+
this.$emit('addWorkgroupUser', null, row)
|
|
176
|
+
} else {
|
|
177
|
+
this.$emit('resultRowDblclick', row)
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
isDisable(row) {
|
|
181
|
+
if (this.selectResult) {
|
|
182
|
+
const containUsers = this.selectResult.filter(this.filterDept(row))
|
|
183
|
+
if (containUsers && containUsers.length > 0) {
|
|
184
|
+
return true
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return false
|
|
188
|
+
},
|
|
189
|
+
// 判断用户是否存在的过滤器
|
|
190
|
+
filterDept(queryDept) {
|
|
191
|
+
return (dept) => {
|
|
192
|
+
return (dept.id === queryDept.id)
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
</script>
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
import { getI18n } from '../../../src/utils/util'
|
|
3
|
+
const workgroupTreeInlineService = {
|
|
4
|
+
// 后台查询部门,并拼接树节点
|
|
5
|
+
filterAppendNodes(value) {
|
|
6
|
+
this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/searches', this.searchParam).then(result => {
|
|
7
|
+
if (result) {
|
|
8
|
+
if (result.length === 0) {
|
|
9
|
+
this.$message({
|
|
10
|
+
showClose: true,
|
|
11
|
+
type: 'error',
|
|
12
|
+
message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
|
|
13
|
+
})
|
|
14
|
+
return
|
|
15
|
+
}
|
|
16
|
+
// result的格式为[WORKGROUP~1,WORKGROUP~4,WORKGROUP~10]
|
|
17
|
+
result.forEach(nodeId => {
|
|
18
|
+
var dataId = nodeId
|
|
19
|
+
// 节点类型和数据id的分隔符
|
|
20
|
+
var nodeTypeAndDataIdSeparator = '~'
|
|
21
|
+
// nodeId格式为WORKGROUP~4
|
|
22
|
+
if (nodeId.indexOf(nodeTypeAndDataIdSeparator) > -1) {
|
|
23
|
+
dataId = nodeId.substring(nodeId.indexOf('~') + 1)
|
|
24
|
+
}
|
|
25
|
+
if (this.allSearchNodeIds.indexOf(nodeId) === -1) {
|
|
26
|
+
// 表示没有加载过该节点,需要放到allSearchNodeIds集合中,并加载该节点内容
|
|
27
|
+
this.allSearchNodeIds.push(nodeId)
|
|
28
|
+
this.loadWorkgroup(dataId, nodeId, true, value)
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
} else {
|
|
32
|
+
this.$message({
|
|
33
|
+
showClose: true,
|
|
34
|
+
type: 'error',
|
|
35
|
+
message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
},
|
|
40
|
+
// 选中节点时
|
|
41
|
+
checkedNode(data, isClickNode) {
|
|
42
|
+
const children = data.children
|
|
43
|
+
if (children && children.length > 0) {
|
|
44
|
+
// 展开当前选中的节点
|
|
45
|
+
this.$refs.workgroupUserTree.store.nodesMap[data.nodeId].expanded = true
|
|
46
|
+
// 选中当前节点及其子节点
|
|
47
|
+
this.checkedNodeAndChildren(data)
|
|
48
|
+
} else {
|
|
49
|
+
if (!data.leaf) {
|
|
50
|
+
// 不是叶子节点,并且没有加载过该父节点的子节点时,需要走后台展开子节点
|
|
51
|
+
if (!isClickNode) {
|
|
52
|
+
var param = {
|
|
53
|
+
parentId: data.id,
|
|
54
|
+
departmentInfo: this.branchInfo
|
|
55
|
+
}
|
|
56
|
+
this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/workgroup-users', param).then(result => {
|
|
57
|
+
// 更新当前点击的节点的子节点
|
|
58
|
+
this.$refs.workgroupUserTree.updateKeyChildren(data.nodeId, result)
|
|
59
|
+
// 展开当前选中的节点
|
|
60
|
+
this.$refs.workgroupUserTree.store.nodesMap[data.nodeId].expanded = true
|
|
61
|
+
// 获得所有应该选中的节点
|
|
62
|
+
this.checkedNodeAndChildren(data)
|
|
63
|
+
})
|
|
64
|
+
} else {
|
|
65
|
+
this.isClickNode = true
|
|
66
|
+
}
|
|
67
|
+
} else {
|
|
68
|
+
this.addWorkgroupUser(null, JSON.parse(data.data))
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
// 获得所有指定工作组下的用户信息
|
|
73
|
+
getAllSelectedWorkgroupUsers(parentIds, selectNodeInfo) {
|
|
74
|
+
this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/user-in-workgroups', parentIds).then(users => {
|
|
75
|
+
users.forEach(user => {
|
|
76
|
+
this.addSelectedUserInfo(selectNodeInfo, user)
|
|
77
|
+
})
|
|
78
|
+
if (selectNodeInfo.userIds.length > 0) {
|
|
79
|
+
this.$emit('result', selectNodeInfo)
|
|
80
|
+
} else {
|
|
81
|
+
this.$alert(getI18n().t('imatrixUIMessage.pleaseSelectPersonnel'), getI18n().t('imatrixUIMessage.tips'), {
|
|
82
|
+
confirmButtonText: getI18n().t('imatrixUIPublicModel.sure')
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
},
|
|
87
|
+
// 初始化树 或 点击三角展开节点时动态加载子节点
|
|
88
|
+
loadNode(node, resolve) {
|
|
89
|
+
var parentId = 0
|
|
90
|
+
var parentNodeId = '0'
|
|
91
|
+
if (node.level === 0) {
|
|
92
|
+
// 表示初始化树
|
|
93
|
+
parentId = 0
|
|
94
|
+
parentNodeId = '0'
|
|
95
|
+
} else {
|
|
96
|
+
parentId = node.data.id
|
|
97
|
+
parentNodeId = node.data.nodeId
|
|
98
|
+
}
|
|
99
|
+
var checkedKeys = []
|
|
100
|
+
if (this.$refs.workgroupUserTree) {
|
|
101
|
+
checkedKeys = this.$refs.workgroupUserTree.getCheckedKeys()
|
|
102
|
+
}
|
|
103
|
+
// 初始化部门树
|
|
104
|
+
this.initLoad(parentId, parentNodeId, node, resolve, checkedKeys)
|
|
105
|
+
},
|
|
106
|
+
// 初始化部门树
|
|
107
|
+
initLoad(parentId, parentNodeId, node, resolve, checkedKeys) {
|
|
108
|
+
const param = {
|
|
109
|
+
parentId: parentId,
|
|
110
|
+
departmentInfo: this.branchInfo
|
|
111
|
+
}
|
|
112
|
+
this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/workgroup-users', param).then(data => {
|
|
113
|
+
resolve(data)
|
|
114
|
+
// 更新当前点击的节点的子节点
|
|
115
|
+
this.$refs.workgroupUserTree.updateKeyChildren(parentNodeId, data)
|
|
116
|
+
if (parentId === 0) {
|
|
117
|
+
// 初始化树时,展开公司节点
|
|
118
|
+
const tenantData = data[0].data
|
|
119
|
+
this.tenantInfo = JSON.parse(tenantData)
|
|
120
|
+
this.containBranch = data[0].containBranch
|
|
121
|
+
// 加载整个组织结构树时,展开公司节点
|
|
122
|
+
this.loadWorkgroup(this.tenantNodeId, this.tenantNodeId + '')
|
|
123
|
+
}
|
|
124
|
+
if (this.isClickNode) {
|
|
125
|
+
// 表示点击工作组节点选中时展开
|
|
126
|
+
this.isClickNode = false
|
|
127
|
+
this.checkedNode(node.data)
|
|
128
|
+
} else {
|
|
129
|
+
// 表示是点击三角展开节点时
|
|
130
|
+
if (checkedKeys && checkedKeys.indexOf(parentNodeId) > -1) {
|
|
131
|
+
// 点击公司名称前的三角标识展开节点时,保持当前节点的选中状态
|
|
132
|
+
// 表示当前展开的节点是选中状态,则应保持其选中状态,并选中其子节点
|
|
133
|
+
this.checkedNode(node.data)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
},
|
|
138
|
+
// 加载当前节点的子节点
|
|
139
|
+
loadWorkgroup(parentId, parentNodeId, isSearch, searchValue) {
|
|
140
|
+
const param = {
|
|
141
|
+
parentId: parentId,
|
|
142
|
+
departmentInfo: this.branchInfo
|
|
143
|
+
}
|
|
144
|
+
this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/workgroup-users', param).then(children => {
|
|
145
|
+
this.$refs.workgroupUserTree.updateKeyChildren(parentNodeId, children)
|
|
146
|
+
if (this.$refs.workgroupUserTree.store.nodesMap[parentNodeId]) {
|
|
147
|
+
this.$refs.workgroupUserTree.store.nodesMap[parentNodeId].expanded = true
|
|
148
|
+
}
|
|
149
|
+
if (isSearch) {
|
|
150
|
+
// 查询时处理
|
|
151
|
+
if (this.allExpandNodeIds.indexOf(parentNodeId) === -1) {
|
|
152
|
+
// allExpandNodeIds集合中是否包含当前parentId节点id
|
|
153
|
+
this.allExpandNodeIds.push(parentNodeId)
|
|
154
|
+
}
|
|
155
|
+
if (this.allExpandNodeIds.length === this.allSearchNodeIds.length) {
|
|
156
|
+
// 表示所有节点已展开,执行树的过滤方法
|
|
157
|
+
this.$refs.workgroupUserTree.filter(searchValue)
|
|
158
|
+
this.allExpandNodeIds = []
|
|
159
|
+
this.allSearchNodeIds = []
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
})
|
|
163
|
+
},
|
|
164
|
+
querySearch(queryString, cb) {
|
|
165
|
+
this.searchValue = queryString
|
|
166
|
+
this.searchResult = []
|
|
167
|
+
this.selectNodeInfo = null
|
|
168
|
+
if (queryString && queryString.length > 0) {
|
|
169
|
+
this.searchWorkgroupUsers(queryString)
|
|
170
|
+
cb([])
|
|
171
|
+
} else {
|
|
172
|
+
cb([])
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
searchWorkgroupUsers(value) {
|
|
176
|
+
const param = {
|
|
177
|
+
searchValue: value
|
|
178
|
+
}
|
|
179
|
+
this.$http.post(Vue.prototype.baseAPI + '/component/organization-trees/search-workgroup-users', param).then(result => {
|
|
180
|
+
this.searchResult = result
|
|
181
|
+
if (this.searchResult.length === 0) {
|
|
182
|
+
this.$message({
|
|
183
|
+
showClose: true,
|
|
184
|
+
type: 'error',
|
|
185
|
+
message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
|
|
186
|
+
})
|
|
187
|
+
return
|
|
188
|
+
}
|
|
189
|
+
})
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
export default workgroupTreeInlineService
|