doctor-admin-components 1.0.14-beta.88 → 1.0.14-beta.89
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/README.md +17 -14
- package/package.json +1 -1
- package/packages/index.js +6 -5
- package/packages/src/index.js +43 -38
- package/packages/src/views/biz/SendGroupSelect/index.vue +492 -0
package/README.md
CHANGED
|
@@ -16,12 +16,13 @@ npm install
|
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
#### 1 把公共模块链接到全局
|
|
19
|
+
|
|
19
20
|
```
|
|
20
21
|
sudo npm link
|
|
21
22
|
```
|
|
22
23
|
|
|
24
|
+
#### 2 把公共模块链接到项目中
|
|
23
25
|
|
|
24
|
-
#### 2 把公共模块链接到项目中
|
|
25
26
|
```
|
|
26
27
|
npm link doctor-admin-components --legacy-peer-deps
|
|
27
28
|
```
|
|
@@ -34,15 +35,15 @@ npm unlink doctor-admin-components --legacy-peer-deps
|
|
|
34
35
|
|
|
35
36
|
### 发布包
|
|
36
37
|
|
|
37
|
-
1登录npm账号
|
|
38
|
-
确保是npm镜像
|
|
39
|
-
nrm ls 查看镜像列表
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
1 登录 npm 账号
|
|
39
|
+
确保是 npm 镜像
|
|
40
|
+
nrm ls 查看镜像列表
|
|
41
|
+
npm ---------- https://registry.npmjs.org/
|
|
42
|
+
yarn --------- https://registry.yarnpkg.com/
|
|
43
|
+
tencent ------ https://mirrors.cloud.tencent.com/npm/
|
|
44
|
+
cnpm --------- https://r.cnpmjs.org/
|
|
45
|
+
taobao ------- https://registry.npmmirror.com/
|
|
46
|
+
npmMirror ---- https://skimdb.npmjs.com/registry/
|
|
46
47
|
nrm use npm
|
|
47
48
|
|
|
48
49
|
npm login
|
|
@@ -51,12 +52,13 @@ Username: xizaozao
|
|
|
51
52
|
Password: 15839493300abc
|
|
52
53
|
Email: (this IS public) 3316756985@qq.com
|
|
53
54
|
如果出现这个:联系我
|
|
54
|
-
Enter one-time password:
|
|
55
|
+
Enter one-time password:
|
|
55
56
|
|
|
56
57
|
2 发布
|
|
57
|
-
修改package.json里的 version
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
修改 package.json 里的 version
|
|
59
|
+
调试版本格式:"1.0.0-beta.11"
|
|
60
|
+
npm publish --tag=beta
|
|
61
|
+
|
|
60
62
|
```
|
|
61
63
|
|
|
62
64
|
|
|
@@ -85,3 +87,4 @@ https://www.npmjs.com/auth/cli/4e0a2c7a-6e12-4ca1-9462-5f8ec27e418e
|
|
|
85
87
|
Press ENTER to open in the browser...
|
|
86
88
|
|
|
87
89
|
+ doctor-admin-components@1.0.14-beta.86
|
|
90
|
+
```
|
package/package.json
CHANGED
package/packages/index.js
CHANGED
|
@@ -57,9 +57,8 @@ import {
|
|
|
57
57
|
FileShow,
|
|
58
58
|
ShipmentPurchaseAmount,
|
|
59
59
|
ContractClause,
|
|
60
|
-
ContractInfo
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
ContractInfo,
|
|
61
|
+
SendGroupSelect
|
|
63
62
|
} from "./src";
|
|
64
63
|
// 组件列表
|
|
65
64
|
const components = [
|
|
@@ -76,7 +75,8 @@ const components = [
|
|
|
76
75
|
FileShow,
|
|
77
76
|
ShipmentPurchaseAmount,
|
|
78
77
|
ContractClause,
|
|
79
|
-
ContractInfo
|
|
78
|
+
ContractInfo,
|
|
79
|
+
SendGroupSelect
|
|
80
80
|
];
|
|
81
81
|
|
|
82
82
|
// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,那么所有的组件都会被注册
|
|
@@ -152,5 +152,6 @@ export default {
|
|
|
152
152
|
FileShow,
|
|
153
153
|
ShipmentPurchaseAmount,
|
|
154
154
|
ContractClause,
|
|
155
|
-
ContractInfo
|
|
155
|
+
ContractInfo,
|
|
156
|
+
SendGroupSelect
|
|
156
157
|
};
|
package/packages/src/index.js
CHANGED
|
@@ -13,70 +13,74 @@
|
|
|
13
13
|
// export { default as ContractTracingDetail } from './views/biz/contractTracing/contractTracingDetail.vue';
|
|
14
14
|
// // export { default as Test } from './views/test.vue111111111111';
|
|
15
15
|
|
|
16
|
-
import ContractTracingDetail from
|
|
17
|
-
import Claim from
|
|
18
|
-
import PurchaseInvoiceUpload from
|
|
19
|
-
import BizShipmentAdd from
|
|
20
|
-
import ContractChangeLog from
|
|
21
|
-
import EditBill from
|
|
22
|
-
import CompanyBanks from
|
|
23
|
-
import VDistpicker from
|
|
24
|
-
import ContractFileDragUpload from '../src/components/FileUpload/contract-drag-new.vue'
|
|
25
|
-
import FileShow from
|
|
16
|
+
import ContractTracingDetail from './views/biz/contractTracing/contractTracingDetail.vue'
|
|
17
|
+
import Claim from './views/biz/claim/Claim.vue'
|
|
18
|
+
import PurchaseInvoiceUpload from './views/biz/contractTracing/purchaseInvoiceUpload.vue'
|
|
19
|
+
import BizShipmentAdd from './views/biz/bizShipment/add.vue'
|
|
20
|
+
import ContractChangeLog from './views/biz/contractTracing/contractChangeLog.vue'
|
|
21
|
+
import EditBill from './views/biz/contractTracing/editBill.vue'
|
|
22
|
+
import CompanyBanks from './views/biz/contractTracing/companyBanks.vue'
|
|
23
|
+
import VDistpicker from './views/components/RegionPicker/Distpicker.vue'
|
|
24
|
+
import ContractFileDragUpload from '../src/components/FileUpload/contract-drag-new.vue'
|
|
25
|
+
import FileShow from '../src/views/biz/bizFileInfo/fileShow.vue'
|
|
26
26
|
import ShipmentPurchaseAmount from '../src/views/biz/contractTracing/shipmentPurchaseAmount.vue'
|
|
27
27
|
import ContractClause from '../src/views/biz/contractTracing/contractClause.vue'
|
|
28
28
|
import ContractInfo from '../src/views/biz/contractTracing/info.vue'
|
|
29
|
+
import SendGroupSelect from '../src/views/biz/SendGroupSelect/index.vue'
|
|
29
30
|
|
|
30
31
|
// 为组件提供 install 安装方法,供按需引入
|
|
31
32
|
|
|
32
33
|
ContractTracingDetail.install = function (Vue) {
|
|
33
|
-
Vue.component(ContractTracingDetail.name, ContractTracingDetail)
|
|
34
|
-
}
|
|
34
|
+
Vue.component(ContractTracingDetail.name, ContractTracingDetail)
|
|
35
|
+
}
|
|
35
36
|
|
|
36
37
|
Claim.install = function (Vue) {
|
|
37
|
-
Vue.component(Claim.name, Claim)
|
|
38
|
-
}
|
|
38
|
+
Vue.component(Claim.name, Claim)
|
|
39
|
+
}
|
|
39
40
|
|
|
40
41
|
PurchaseInvoiceUpload.install = function (Vue) {
|
|
41
|
-
Vue.component(PurchaseInvoiceUpload.name, PurchaseInvoiceUpload)
|
|
42
|
-
}
|
|
42
|
+
Vue.component(PurchaseInvoiceUpload.name, PurchaseInvoiceUpload)
|
|
43
|
+
}
|
|
43
44
|
|
|
44
45
|
BizShipmentAdd.install = function (Vue) {
|
|
45
|
-
Vue.component(BizShipmentAdd.name, BizShipmentAdd)
|
|
46
|
-
}
|
|
46
|
+
Vue.component(BizShipmentAdd.name, BizShipmentAdd)
|
|
47
|
+
}
|
|
47
48
|
|
|
48
49
|
ContractChangeLog.install = function (Vue) {
|
|
49
|
-
Vue.component(ContractChangeLog.name, ContractChangeLog)
|
|
50
|
-
}
|
|
50
|
+
Vue.component(ContractChangeLog.name, ContractChangeLog)
|
|
51
|
+
}
|
|
51
52
|
|
|
52
53
|
EditBill.install = function (Vue) {
|
|
53
|
-
Vue.component(EditBill.name, EditBill)
|
|
54
|
-
}
|
|
54
|
+
Vue.component(EditBill.name, EditBill)
|
|
55
|
+
}
|
|
55
56
|
|
|
56
57
|
CompanyBanks.install = function (Vue) {
|
|
57
|
-
Vue.component(CompanyBanks.name, CompanyBanks)
|
|
58
|
-
}
|
|
58
|
+
Vue.component(CompanyBanks.name, CompanyBanks)
|
|
59
|
+
}
|
|
59
60
|
|
|
60
61
|
VDistpicker.install = function (Vue) {
|
|
61
|
-
Vue.component(CompanyBanks.name, CompanyBanks)
|
|
62
|
-
}
|
|
62
|
+
Vue.component(CompanyBanks.name, CompanyBanks)
|
|
63
|
+
}
|
|
63
64
|
ContractFileDragUpload.install = function (Vue) {
|
|
64
|
-
Vue.component(ContractFileDragUpload.name, ContractFileDragUpload)
|
|
65
|
-
}
|
|
65
|
+
Vue.component(ContractFileDragUpload.name, ContractFileDragUpload)
|
|
66
|
+
}
|
|
66
67
|
|
|
67
68
|
FileShow.install = function (Vue) {
|
|
68
|
-
Vue.component(FileShow.name, FileShow)
|
|
69
|
-
}
|
|
69
|
+
Vue.component(FileShow.name, FileShow)
|
|
70
|
+
}
|
|
70
71
|
|
|
71
72
|
ShipmentPurchaseAmount.install = function (Vue) {
|
|
72
|
-
Vue.component(ShipmentPurchaseAmount.name, ShipmentPurchaseAmount)
|
|
73
|
-
}
|
|
73
|
+
Vue.component(ShipmentPurchaseAmount.name, ShipmentPurchaseAmount)
|
|
74
|
+
}
|
|
74
75
|
ContractClause.install = function (Vue) {
|
|
75
|
-
Vue.component(ContractClause.name, ContractClause)
|
|
76
|
-
}
|
|
76
|
+
Vue.component(ContractClause.name, ContractClause)
|
|
77
|
+
}
|
|
77
78
|
ContractInfo.install = function (Vue) {
|
|
78
|
-
Vue.component(ContractInfo.name, ContractInfo)
|
|
79
|
-
}
|
|
79
|
+
Vue.component(ContractInfo.name, ContractInfo)
|
|
80
|
+
}
|
|
81
|
+
SendGroupSelect.install = function (Vue) {
|
|
82
|
+
Vue.component(SendGroupSelect.name, SendGroupSelect)
|
|
83
|
+
}
|
|
80
84
|
|
|
81
85
|
// 导出组件
|
|
82
86
|
export {
|
|
@@ -92,5 +96,6 @@ export {
|
|
|
92
96
|
FileShow,
|
|
93
97
|
ShipmentPurchaseAmount,
|
|
94
98
|
ContractClause,
|
|
95
|
-
ContractInfo
|
|
96
|
-
|
|
99
|
+
ContractInfo,
|
|
100
|
+
SendGroupSelect
|
|
101
|
+
}
|
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="send-group-select">
|
|
3
|
+
<div class="section-title">
|
|
4
|
+
<span>{{ title }}</span>
|
|
5
|
+
<el-tag size="small" type="info">已选 {{ selectedGroupIds.length }} 个</el-tag>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<div class="group-select-row">
|
|
9
|
+
<el-row :gutter="16" type="flex" align="stretch">
|
|
10
|
+
<el-col v-if="filterable" :span="6">
|
|
11
|
+
<div class="filter-panel">
|
|
12
|
+
<div v-for="filter in normalizedFilters" :key="filter.key" class="filter-block">
|
|
13
|
+
<div class="filter-label">{{ filter.label }}</div>
|
|
14
|
+
<template v-if="filter.options.length > 3">
|
|
15
|
+
<el-select
|
|
16
|
+
v-if="!filter.isTree"
|
|
17
|
+
v-model="localSelectedFilters[filter.key]"
|
|
18
|
+
:multiple="true"
|
|
19
|
+
placeholder="请选择"
|
|
20
|
+
@change="onFilterChange"
|
|
21
|
+
class="filter-select"
|
|
22
|
+
>
|
|
23
|
+
<el-option v-for="item in filter.options" :key="item.value" :label="item.label" :value="item.value" />
|
|
24
|
+
</el-select>
|
|
25
|
+
<el-cascader
|
|
26
|
+
v-else
|
|
27
|
+
v-model="localSelectedFilters[filter.key]"
|
|
28
|
+
:options="filter.options"
|
|
29
|
+
:props="{
|
|
30
|
+
multiple: true,
|
|
31
|
+
label: 'dictLabel',
|
|
32
|
+
value: 'id',
|
|
33
|
+
children: 'children',
|
|
34
|
+
emitPath: false
|
|
35
|
+
}"
|
|
36
|
+
placeholder="请选择"
|
|
37
|
+
:show-all-levels="false"
|
|
38
|
+
clearable
|
|
39
|
+
filterable
|
|
40
|
+
@change="onFilterChange"
|
|
41
|
+
class="filter-select"
|
|
42
|
+
/>
|
|
43
|
+
</template>
|
|
44
|
+
<template v-else>
|
|
45
|
+
<el-checkbox
|
|
46
|
+
v-for="item in filter.options"
|
|
47
|
+
:key="item.value"
|
|
48
|
+
:value="localSelectedFilters[filter.key] && localSelectedFilters[filter.key].includes(item.value)"
|
|
49
|
+
@change="toggleFilter(filter.key, item.value)"
|
|
50
|
+
>
|
|
51
|
+
{{ item.label }}
|
|
52
|
+
</el-checkbox>
|
|
53
|
+
</template>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<div class="filter-footer">
|
|
57
|
+
<el-button type="text" @click="clearFilters">清空筛选</el-button>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</el-col>
|
|
61
|
+
|
|
62
|
+
<el-col :span="filterable ? 18 : 24">
|
|
63
|
+
<div v-loading="groupLoading" class="transfer-container">
|
|
64
|
+
<el-transfer
|
|
65
|
+
v-model="selectedGroupIds"
|
|
66
|
+
:data="transferGroups"
|
|
67
|
+
:titles="['可选群', '已选群']"
|
|
68
|
+
:filterable="true"
|
|
69
|
+
filter-placeholder="搜索群"
|
|
70
|
+
:filter-method="handleTransferFilter"
|
|
71
|
+
:props="{
|
|
72
|
+
key: 'groupId',
|
|
73
|
+
label: 'toolsName'
|
|
74
|
+
}"
|
|
75
|
+
>
|
|
76
|
+
<span slot-scope="{ option }">
|
|
77
|
+
<span class="group-name">{{ option.toolsName }}</span>
|
|
78
|
+
<el-tag v-for="tag in option.filterTags" :key="tag.type" size="mini" class="group-tag" :type="getTagType(tag.type)">
|
|
79
|
+
{{ tag.label }}
|
|
80
|
+
</el-tag>
|
|
81
|
+
</span>
|
|
82
|
+
</el-transfer>
|
|
83
|
+
</div>
|
|
84
|
+
</el-col>
|
|
85
|
+
</el-row>
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
<div class="group-footer">
|
|
89
|
+
<span>匹配到 {{ transferGroups.length }} 个群,共 {{ groupTotal }} 个群</span>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</template>
|
|
93
|
+
|
|
94
|
+
<script>
|
|
95
|
+
import request from '@/utils/request'
|
|
96
|
+
|
|
97
|
+
export default {
|
|
98
|
+
name: 'SendGroupSelect',
|
|
99
|
+
dicts: ['customer_grade', 'group_type'],
|
|
100
|
+
props: {
|
|
101
|
+
value: {
|
|
102
|
+
type: Array,
|
|
103
|
+
default: () => []
|
|
104
|
+
},
|
|
105
|
+
url: {
|
|
106
|
+
type: String,
|
|
107
|
+
required: true
|
|
108
|
+
},
|
|
109
|
+
filters: {
|
|
110
|
+
type: Array,
|
|
111
|
+
default: () => []
|
|
112
|
+
},
|
|
113
|
+
title: {
|
|
114
|
+
type: String,
|
|
115
|
+
default: '发送群'
|
|
116
|
+
},
|
|
117
|
+
pageSize: {
|
|
118
|
+
type: Number,
|
|
119
|
+
default: 1000000
|
|
120
|
+
},
|
|
121
|
+
requestMethod: {
|
|
122
|
+
type: String,
|
|
123
|
+
default: 'post'
|
|
124
|
+
},
|
|
125
|
+
requestParams: {
|
|
126
|
+
type: Object,
|
|
127
|
+
default: () => ({})
|
|
128
|
+
},
|
|
129
|
+
filterValues: {
|
|
130
|
+
type: Object,
|
|
131
|
+
default: () => ({})
|
|
132
|
+
},
|
|
133
|
+
filterable: {
|
|
134
|
+
type: Boolean,
|
|
135
|
+
default: true
|
|
136
|
+
},
|
|
137
|
+
groupTypeFilter: {
|
|
138
|
+
type: Function,
|
|
139
|
+
default: null
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
data() {
|
|
143
|
+
return {
|
|
144
|
+
selectedGroupIds: [...this.value],
|
|
145
|
+
localSelectedFilters: {},
|
|
146
|
+
groupLoading: false,
|
|
147
|
+
groupTotal: 0,
|
|
148
|
+
allGroups: [],
|
|
149
|
+
groups: []
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
computed: {
|
|
153
|
+
selectedFilters() {
|
|
154
|
+
if (Object.keys(this.filterValues).length > 0) {
|
|
155
|
+
return this.filterValues
|
|
156
|
+
}
|
|
157
|
+
return this.localSelectedFilters
|
|
158
|
+
},
|
|
159
|
+
normalizedFilters() {
|
|
160
|
+
return this.filters
|
|
161
|
+
.map((filter) => {
|
|
162
|
+
let options = filter.options || []
|
|
163
|
+
if (!filter.isTree) {
|
|
164
|
+
options = options.map((item) => (typeof item === 'object' ? item : { label: item, value: item }))
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
...filter,
|
|
168
|
+
key: filter.key,
|
|
169
|
+
label: filter.label,
|
|
170
|
+
options
|
|
171
|
+
}
|
|
172
|
+
})
|
|
173
|
+
.sort((a, b) => {
|
|
174
|
+
const aLen = a.options.length
|
|
175
|
+
const bLen = b.options.length
|
|
176
|
+
const aLess3 = aLen <= 3
|
|
177
|
+
const bLess3 = bLen <= 3
|
|
178
|
+
if (aLess3 && !bLess3) return -1
|
|
179
|
+
if (!aLess3 && bLess3) return 1
|
|
180
|
+
return 0
|
|
181
|
+
})
|
|
182
|
+
},
|
|
183
|
+
transferGroups() {
|
|
184
|
+
return this.groups.map((group) => ({
|
|
185
|
+
groupId: group.groupId,
|
|
186
|
+
toolsName: group.toolsName,
|
|
187
|
+
filterTags: this.getFilterTagsForGroup(group)
|
|
188
|
+
}))
|
|
189
|
+
},
|
|
190
|
+
selectedGroups() {
|
|
191
|
+
return this.allGroups.filter((item) => this.selectedGroupIds.includes(item.groupId))
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
watch: {
|
|
195
|
+
value: {
|
|
196
|
+
handler(val) {
|
|
197
|
+
if (this.isSameList(val || [], this.selectedGroupIds)) {
|
|
198
|
+
return
|
|
199
|
+
}
|
|
200
|
+
this.selectedGroupIds = [...(val || [])]
|
|
201
|
+
this.applyFilters()
|
|
202
|
+
},
|
|
203
|
+
deep: true
|
|
204
|
+
},
|
|
205
|
+
selectedGroupIds: {
|
|
206
|
+
handler(val) {
|
|
207
|
+
this.$emit('input', val)
|
|
208
|
+
this.emitSelectedGroups()
|
|
209
|
+
this.applyFilters()
|
|
210
|
+
},
|
|
211
|
+
deep: true
|
|
212
|
+
},
|
|
213
|
+
filterValues: {
|
|
214
|
+
handler() {
|
|
215
|
+
this.applyFilters()
|
|
216
|
+
},
|
|
217
|
+
deep: true
|
|
218
|
+
},
|
|
219
|
+
filters: {
|
|
220
|
+
handler() {
|
|
221
|
+
this.initSelectedFilters()
|
|
222
|
+
this.applyFilters()
|
|
223
|
+
},
|
|
224
|
+
deep: true
|
|
225
|
+
},
|
|
226
|
+
url() {
|
|
227
|
+
this.loadGroupList()
|
|
228
|
+
},
|
|
229
|
+
requestParams: {
|
|
230
|
+
handler() {
|
|
231
|
+
this.loadGroupList()
|
|
232
|
+
},
|
|
233
|
+
deep: true
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
created() {
|
|
237
|
+
this.initSelectedFilters()
|
|
238
|
+
this.loadGroupList()
|
|
239
|
+
},
|
|
240
|
+
methods: {
|
|
241
|
+
isSameList(left, right) {
|
|
242
|
+
if (left.length !== right.length) {
|
|
243
|
+
return false
|
|
244
|
+
}
|
|
245
|
+
return left.every((item, index) => item === right[index])
|
|
246
|
+
},
|
|
247
|
+
initSelectedFilters() {
|
|
248
|
+
const next = {}
|
|
249
|
+
this.normalizedFilters.forEach((filter) => {
|
|
250
|
+
next[filter.key] = this.localSelectedFilters[filter.key] || []
|
|
251
|
+
})
|
|
252
|
+
this.localSelectedFilters = next
|
|
253
|
+
},
|
|
254
|
+
loadGroupList() {
|
|
255
|
+
this.groupLoading = true
|
|
256
|
+
this.allGroups = []
|
|
257
|
+
this.groups = []
|
|
258
|
+
this.groupTotal = 0
|
|
259
|
+
|
|
260
|
+
const params = {
|
|
261
|
+
pageNum: 1,
|
|
262
|
+
pageSize: this.pageSize,
|
|
263
|
+
orderByColumn: 'toolsGroupId',
|
|
264
|
+
isAsc: 'desc',
|
|
265
|
+
...this.requestParams
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
return request({
|
|
269
|
+
url: this.buildRequestUrl(params),
|
|
270
|
+
method: this.requestMethod,
|
|
271
|
+
data: params,
|
|
272
|
+
params: this.requestMethod.toLowerCase() === 'get' ? params : undefined
|
|
273
|
+
})
|
|
274
|
+
.then((response) => {
|
|
275
|
+
const data = response.data || {}
|
|
276
|
+
this.allGroups = data.rows
|
|
277
|
+
this.groupTotal = Number(data.total) || 0
|
|
278
|
+
this.applyFilters()
|
|
279
|
+
this.emitSelectedGroups()
|
|
280
|
+
})
|
|
281
|
+
.catch(() => {})
|
|
282
|
+
.finally(() => {
|
|
283
|
+
this.groupLoading = false
|
|
284
|
+
})
|
|
285
|
+
},
|
|
286
|
+
buildRequestUrl(params) {
|
|
287
|
+
if (this.requestMethod.toLowerCase() !== 'post') {
|
|
288
|
+
return this.url
|
|
289
|
+
}
|
|
290
|
+
const joiner = this.url.includes('?') ? '&' : '?'
|
|
291
|
+
return `${this.url}${joiner}pageNum=${params.pageNum}&pageSize=${params.pageSize}&orderByColumn=${params.orderByColumn}&isAsc=${params.isAsc}`
|
|
292
|
+
},
|
|
293
|
+
applyFilters() {
|
|
294
|
+
const filteredGroups = this.allGroups.filter((group) => {
|
|
295
|
+
return this.normalizedFilters.every((filter) => this.matchFilter(group, filter))
|
|
296
|
+
})
|
|
297
|
+
|
|
298
|
+
const selectedGroups = this.allGroups.filter((group) => this.selectedGroupIds.includes(group.groupId))
|
|
299
|
+
this.groups = [...new Map([...selectedGroups, ...filteredGroups].map((item) => [item.groupId, item])).values()]
|
|
300
|
+
},
|
|
301
|
+
matchFilter(group, filter) {
|
|
302
|
+
const selected = this.selectedFilters[filter.key] || []
|
|
303
|
+
if (selected.length === 0) {
|
|
304
|
+
return true
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
if (filter.key === 'groupTypeList' && this.groupTypeFilter) {
|
|
308
|
+
return this.groupTypeFilter(group, selected)
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
const rawField = filter.field || filter.key
|
|
312
|
+
const groupValue = group[rawField]
|
|
313
|
+
|
|
314
|
+
if (filter.isTree) {
|
|
315
|
+
const selectedIds = selected.map(String)
|
|
316
|
+
const groupIds = Array.isArray(groupValue) ? groupValue.map(String) : [String(groupValue)]
|
|
317
|
+
return selectedIds.some((id) => groupIds.includes(id))
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
if (Array.isArray(groupValue)) {
|
|
321
|
+
return groupValue.some((val) => selected.includes(val))
|
|
322
|
+
}
|
|
323
|
+
return selected.includes(groupValue)
|
|
324
|
+
},
|
|
325
|
+
toggleFilter(key, value) {
|
|
326
|
+
const list = [...(this.localSelectedFilters[key] || [])]
|
|
327
|
+
const index = list.indexOf(value)
|
|
328
|
+
if (index > -1) {
|
|
329
|
+
list.splice(index, 1)
|
|
330
|
+
} else {
|
|
331
|
+
list.push(value)
|
|
332
|
+
}
|
|
333
|
+
this.$set(this.localSelectedFilters, key, list)
|
|
334
|
+
this.onFilterChange()
|
|
335
|
+
},
|
|
336
|
+
clearFilters() {
|
|
337
|
+
Object.keys(this.localSelectedFilters).forEach((key) => {
|
|
338
|
+
this.$set(this.localSelectedFilters, key, [])
|
|
339
|
+
})
|
|
340
|
+
this.onFilterChange()
|
|
341
|
+
},
|
|
342
|
+
onFilterChange() {
|
|
343
|
+
this.applyFilters()
|
|
344
|
+
this.$emit('filter-change', this.selectedFilters)
|
|
345
|
+
},
|
|
346
|
+
handleTransferFilter(query, item) {
|
|
347
|
+
return item.toolsName.toLowerCase().includes(query.toLowerCase())
|
|
348
|
+
},
|
|
349
|
+
emitSelectedGroups() {
|
|
350
|
+
this.$emit('selected-change', this.selectedGroups)
|
|
351
|
+
},
|
|
352
|
+
getTagType(filterKey) {
|
|
353
|
+
const typeMap = {
|
|
354
|
+
language: '',
|
|
355
|
+
groupChannel: 'success',
|
|
356
|
+
department: 'warning',
|
|
357
|
+
groupTypeList: 'danger'
|
|
358
|
+
}
|
|
359
|
+
return typeMap[filterKey] || ''
|
|
360
|
+
},
|
|
361
|
+
getFilterTagsForGroup(group) {
|
|
362
|
+
const tags = []
|
|
363
|
+
const checkboxFilters = this.normalizedFilters.filter((filter) => !filter.isTree && filter.options.length <= 3)
|
|
364
|
+
checkboxFilters.forEach((filter) => {
|
|
365
|
+
const rawField = filter.field || filter.key
|
|
366
|
+
const groupValue = group[rawField]
|
|
367
|
+
if (Array.isArray(groupValue)) {
|
|
368
|
+
groupValue.forEach((val) => {
|
|
369
|
+
const option = filter.options.find((opt) => opt.value === val)
|
|
370
|
+
if (option) {
|
|
371
|
+
tags.push({ label: option.label, type: filter.key })
|
|
372
|
+
}
|
|
373
|
+
})
|
|
374
|
+
} else if (groupValue) {
|
|
375
|
+
const option = filter.options.find((opt) => opt.value === groupValue)
|
|
376
|
+
if (option) {
|
|
377
|
+
tags.push({ label: option.label, type: filter.key })
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
})
|
|
381
|
+
|
|
382
|
+
return tags
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
</script>
|
|
387
|
+
|
|
388
|
+
<style scoped>
|
|
389
|
+
.section-title {
|
|
390
|
+
display: flex;
|
|
391
|
+
align-items: center;
|
|
392
|
+
justify-content: space-between;
|
|
393
|
+
margin-bottom: 16px;
|
|
394
|
+
font-size: 16px;
|
|
395
|
+
font-weight: 600;
|
|
396
|
+
color: #303133;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.group-select-row {
|
|
400
|
+
margin-bottom: 12px;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.transfer-container {
|
|
404
|
+
min-height: 400px;
|
|
405
|
+
height: 100%;
|
|
406
|
+
overflow-x: auto;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.transfer-container ::v-deep .el-transfer {
|
|
410
|
+
display: flex !important;
|
|
411
|
+
flex-direction: row !important;
|
|
412
|
+
flex-wrap: nowrap !important;
|
|
413
|
+
align-items: center !important;
|
|
414
|
+
min-width: 600px;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.transfer-container ::v-deep .el-transfer-panel {
|
|
418
|
+
width: 45%;
|
|
419
|
+
min-width: 220px;
|
|
420
|
+
height: 400px;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.transfer-container ::v-deep .el-transfer-panel__body {
|
|
424
|
+
height: calc(100% - 60px);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.transfer-container ::v-deep .el-transfer-panel__list {
|
|
428
|
+
height: calc(100% - 40px);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
.transfer-container ::v-deep .el-transfer__buttons {
|
|
432
|
+
padding: 0 10px;
|
|
433
|
+
display: flex !important;
|
|
434
|
+
flex-direction: column !important;
|
|
435
|
+
align-items: center !important;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.transfer-container ::v-deep .el-transfer__buttons .el-button {
|
|
439
|
+
margin: 5px 0;
|
|
440
|
+
padding: 8px 10px;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.filter-panel {
|
|
444
|
+
width: 100%;
|
|
445
|
+
border: 1px solid #ebeef5;
|
|
446
|
+
background: #fafafa;
|
|
447
|
+
border-radius: 8px;
|
|
448
|
+
padding: 14px 16px 10px;
|
|
449
|
+
min-height: 400px;
|
|
450
|
+
display: flex;
|
|
451
|
+
flex-direction: column;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.filter-block + .filter-block {
|
|
455
|
+
margin-top: 14px;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.filter-label {
|
|
459
|
+
margin-bottom: 8px;
|
|
460
|
+
font-size: 12px;
|
|
461
|
+
font-weight: 600;
|
|
462
|
+
color: #909399;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.filter-select {
|
|
466
|
+
width: 100%;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.filter-footer {
|
|
470
|
+
margin-top: 12px;
|
|
471
|
+
display: flex;
|
|
472
|
+
justify-content: center;
|
|
473
|
+
align-items: center;
|
|
474
|
+
font-size: 12px;
|
|
475
|
+
color: #909399;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.group-footer {
|
|
479
|
+
margin-top: 12px;
|
|
480
|
+
text-align: center;
|
|
481
|
+
color: #909399;
|
|
482
|
+
font-size: 12px;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
.group-name {
|
|
486
|
+
margin-right: 6px;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.group-tag {
|
|
490
|
+
margin-left: 4px;
|
|
491
|
+
}
|
|
492
|
+
</style>
|