n20-common-lib 2.6.1 → 2.6.2-beta
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/package.json +5 -4
- package/src/assets/css/cl-file-upload-table.scss +2 -2
- package/src/assets/css/cl-layout-header.scss +34 -5
- package/src/assets/css/cl-message.scss +55 -1
- package/src/assets/css/filter.scss +1 -1
- package/src/components/AdvancedFilter/formItemRender.vue +8 -4
- package/src/components/AdvancedFilter/index.vue +37 -13
- package/src/components/AdvancedFilter/utils.js +8 -0
- package/src/components/Anchor/index.vue +5 -1
- package/src/components/ApprovalButtons/showAppOpi.vue +1 -0
- package/src/components/DateSelect/index.vue +29 -4
- package/src/components/DragList/index.vue +6 -2
- package/src/components/ElectronicArchive/index.vue +766 -0
- package/src/components/FileImport/index.vue +6 -0
- package/src/components/FileUploadTable/index.vue +1 -1
- package/src/components/Filters/index.vue +1 -1
- package/src/components/InputNumber/numberRange.vue +2 -0
- package/src/components/Layout/HeaderWrap/changePwd.vue +16 -9
- package/src/components/Layout/HeaderWrap/index.vue +10 -0
- package/src/components/Layout/HeaderWrap/indexN.vue +19 -4
- package/src/components/LoginTemporary/form.vue +8 -0
- package/src/components/SelectDatePickerPro/index.vue +13 -13
- package/src/components/ShowColumn/index.vue +3 -3
- package/src/components/TablePro/filterContent.vue +279 -0
- package/src/components/TablePro/filterContent_tree.vue +172 -0
- package/src/components/TablePro/index.js +30 -0
- package/src/components/TablePro/index.vue +3 -2
- package/src/components/Tree/index.vue +6 -1
- package/src/components/Upload/index.vue +5 -0
- package/src/components/Upload/uploadMsg.vue +7 -5
- package/src/components/operatingStatus/index.vue +5 -3
- package/src/directives/watermark/index.js +69 -0
- package/src/i18n.json +3 -0
- package/src/index.js +117 -109
- package/src/utils/amountInWords.js +17 -100
- package/src/utils/numberPor.js +24 -27
- package/style/index.css +1 -1
- package/theme/blue.css +1 -1
- package/theme/cctcRed.css +1 -1
- package/theme/green.css +1 -1
- package/theme/lightBlue.css +1 -1
- package/theme/orange.css +1 -1
- package/theme/purple.css +1 -1
- package/theme/red.css +1 -1
- package/theme/yellow.css +1 -1
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
v-if="!uploadHttpRequest"
|
|
13
13
|
v-bind="uploadProps"
|
|
14
14
|
:width="width"
|
|
15
|
+
:showErrorExport="showErrorExport"
|
|
15
16
|
:validate-result="validateResult"
|
|
16
17
|
:validate-confirm="validateConfirm"
|
|
17
18
|
:pagination="pagination"
|
|
@@ -24,6 +25,7 @@
|
|
|
24
25
|
:title="'导入文件' | $lc"
|
|
25
26
|
:visible.sync="errorV"
|
|
26
27
|
:width="width"
|
|
28
|
+
:showErrorExport="showErrorExport"
|
|
27
29
|
:validate-result="validateResult"
|
|
28
30
|
:hide-percent="true"
|
|
29
31
|
:footer-btn="footer"
|
|
@@ -77,6 +79,10 @@ export default {
|
|
|
77
79
|
type: Boolean,
|
|
78
80
|
default: false
|
|
79
81
|
},
|
|
82
|
+
showErrorExport: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: false
|
|
85
|
+
},
|
|
80
86
|
validateDialog: {
|
|
81
87
|
type: Boolean,
|
|
82
88
|
default: false
|
|
@@ -484,7 +484,7 @@ export default {
|
|
|
484
484
|
}
|
|
485
485
|
} else {
|
|
486
486
|
// 下载
|
|
487
|
-
let blob = await
|
|
487
|
+
let blob = await axios.get(`/api/neams/eamsbaserecord/download/${row[this.keys.url]}`, null, {
|
|
488
488
|
responseType: 'blob'
|
|
489
489
|
})
|
|
490
490
|
let name = row[this.keys.name] || blob.name
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<el-button icon="n20-icon-iconfontshaixuan" plain onlyicon size="mini" @click="clickBtn" />
|
|
14
14
|
</template>
|
|
15
15
|
<el-form
|
|
16
|
-
v-
|
|
16
|
+
v-show="showPopC"
|
|
17
17
|
v-click-outside="clickOut"
|
|
18
18
|
class="n20-filter p-a-s p-b-0"
|
|
19
19
|
:label-width="labelWidth ? labelWidth : labelWidthAs + 'px'"
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
:type="type"
|
|
8
8
|
style="width: calc(50% - 8px)"
|
|
9
9
|
@input="startChange"
|
|
10
|
+
@clear="$emit('clear')"
|
|
10
11
|
@blur="blurFn"
|
|
11
12
|
/>
|
|
12
13
|
<span class="numbre-range text-c" style="display: inline-block; width: 16px">-</span>
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
:type="type"
|
|
18
19
|
style="width: calc(50% - 8px)"
|
|
19
20
|
@input="endChange"
|
|
21
|
+
@clear="$emit('clear')"
|
|
20
22
|
@blur="blurFn"
|
|
21
23
|
/>
|
|
22
24
|
</div>
|
|
@@ -49,9 +49,10 @@
|
|
|
49
49
|
</template>
|
|
50
50
|
|
|
51
51
|
<script>
|
|
52
|
-
import { $lc } from '../../../utils/i18n/index'
|
|
53
|
-
import auth from '../../../utils/auth'
|
|
54
|
-
import axios from '../../../utils/axios'
|
|
52
|
+
import { $lc } from '../../../utils/i18n/index.js'
|
|
53
|
+
import auth from '../../../utils/auth.js'
|
|
54
|
+
import axios from '../../../utils/axios.js'
|
|
55
|
+
|
|
55
56
|
export default {
|
|
56
57
|
props: {
|
|
57
58
|
visible: {
|
|
@@ -97,17 +98,23 @@ export default {
|
|
|
97
98
|
this.pwdMin = minLength
|
|
98
99
|
this.pwdMax = maxLength
|
|
99
100
|
switch (passwordStrength) {
|
|
100
|
-
case '
|
|
101
|
+
case '1':
|
|
101
102
|
this.pwdRE = [/[A-z0-9]+/]
|
|
102
103
|
this.pwdReMsg = $lc(`密码只能为字母数字`)
|
|
103
104
|
break
|
|
104
|
-
case '
|
|
105
|
+
case '2':
|
|
105
106
|
this.pwdRE = [/[A-z]+/, /[0-9]+/]
|
|
106
|
-
this.pwdReMsg = $lc(
|
|
107
|
+
this.pwdReMsg = $lc(`密码需包含数字、字母`)
|
|
107
108
|
break
|
|
108
|
-
case '
|
|
109
|
+
case '3':
|
|
109
110
|
this.pwdRE = [/[A-Z]+/, /[a-z]+/, /[0-9]+/]
|
|
110
|
-
this.pwdReMsg = $lc(
|
|
111
|
+
this.pwdReMsg = $lc(`密码需包含数字、大小写字母`)
|
|
112
|
+
break
|
|
113
|
+
case '4':
|
|
114
|
+
this.pwdRE = [
|
|
115
|
+
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!#$%^&*()_+\-=\[\]{};':"\\|,.。!?,¥……‘’;”“、【】<>\/?])[A-Za-z\d!#$%^&*()_+\-=\[\]{};':"\\|,.。!?,¥……‘’;”“【】、<>\/?]{8,}$/
|
|
116
|
+
]
|
|
117
|
+
this.pwdReMsg = $lc(`密码需包含数字、大小写字母、除@外的特殊字符`)
|
|
111
118
|
break
|
|
112
119
|
}
|
|
113
120
|
})
|
|
@@ -191,7 +198,7 @@ export default {
|
|
|
191
198
|
},
|
|
192
199
|
confirmFnThen() {
|
|
193
200
|
this.$message({
|
|
194
|
-
message: '密码修改成功!',
|
|
201
|
+
message: $lc('密码修改成功!'),
|
|
195
202
|
type: 'success'
|
|
196
203
|
})
|
|
197
204
|
axios.delete('/bems/prod_1.0/uas/api/authorization/logout', null, { loading: false }).then(() => {
|
|
@@ -98,6 +98,9 @@
|
|
|
98
98
|
</div>
|
|
99
99
|
</template>
|
|
100
100
|
<el-dropdown-item command="changePassword" divided>{{ '修改密码' | $lc }}</el-dropdown-item>
|
|
101
|
+
<el-dropdown-item v-if="customOpt.personalInfo" command="changeUserInfo" divided>{{
|
|
102
|
+
'修改人员信息' | $lc
|
|
103
|
+
}}</el-dropdown-item>
|
|
101
104
|
<el-dropdown-item v-if="customOpt.mydeal" command="myDeal" divided>{{ '我的交易' | $lc }}</el-dropdown-item>
|
|
102
105
|
<el-dropdown-item v-if="customOpt.switchuser" command="switchUser" divided>{{
|
|
103
106
|
'身份切换' | $lc
|
|
@@ -351,6 +354,10 @@ export default {
|
|
|
351
354
|
case 'changePassword':
|
|
352
355
|
this.changePassword()
|
|
353
356
|
break
|
|
357
|
+
|
|
358
|
+
case 'changeUserInfo':
|
|
359
|
+
this.personalInfo()
|
|
360
|
+
break
|
|
354
361
|
case 'logOut':
|
|
355
362
|
this.logOut()
|
|
356
363
|
break
|
|
@@ -368,6 +375,9 @@ export default {
|
|
|
368
375
|
break
|
|
369
376
|
}
|
|
370
377
|
},
|
|
378
|
+
personalInfo() {
|
|
379
|
+
linkPush(`/user-web/user/editUserInfo?uno=${JSON.parse(sessionStorage.getItem('userInfo')).uno}&oneself=true`)
|
|
380
|
+
},
|
|
371
381
|
setLang() {
|
|
372
382
|
this.langV = false
|
|
373
383
|
window.localStorage.setItem('pageLang', this.langVal)
|
|
@@ -156,6 +156,12 @@
|
|
|
156
156
|
<i class="el-icon-caret-right m-l-auto m-r-0"></i>
|
|
157
157
|
</div>
|
|
158
158
|
</el-dropdown-item>
|
|
159
|
+
<el-dropdown-item v-if="customOpt.personalInfo" command="changeUserInfo">
|
|
160
|
+
<div class="flex-box flex-v">
|
|
161
|
+
<span>{{ '修改人员信息' | $lc }} </span>
|
|
162
|
+
<i class="el-icon-caret-right m-l-auto m-r-0"></i>
|
|
163
|
+
</div>
|
|
164
|
+
</el-dropdown-item>
|
|
159
165
|
<el-dropdown-item v-if="customOpt.agency" command="myAgency">
|
|
160
166
|
<div class="flex-box flex-v">
|
|
161
167
|
<span>{{ '工作代理' | $lc }}</span>
|
|
@@ -199,7 +205,7 @@
|
|
|
199
205
|
</el-dropdown>
|
|
200
206
|
</el-dropdown-item>
|
|
201
207
|
<!-- 系统切换 -->
|
|
202
|
-
<el-dropdown-item v-if="systemChange">
|
|
208
|
+
<el-dropdown-item v-if="systemChange && systemList && systemList.length">
|
|
203
209
|
<el-dropdown trigger="hover" size="medium" placement="left-start" style="width: 100%">
|
|
204
210
|
<div class="flex-box flex-v">
|
|
205
211
|
<span>{{ '系统切换' | $lc }}</span>
|
|
@@ -457,14 +463,20 @@ export default {
|
|
|
457
463
|
this.$refs.userDrop.show()
|
|
458
464
|
}
|
|
459
465
|
},
|
|
460
|
-
//
|
|
466
|
+
// 跳转打开人员页面
|
|
461
467
|
goMdmUser() {
|
|
462
|
-
|
|
468
|
+
axios
|
|
469
|
+
.get(`/bems/user/mdmWfPersonalMid/validateOne/${JSON.parse(sessionStorage.getItem('userInfo')).uno}`)
|
|
470
|
+
.then(({ code, msg }) => {
|
|
471
|
+
if (code !== 200) {
|
|
472
|
+
return this.$message.error(msg)
|
|
473
|
+
}
|
|
474
|
+
linkPush(`/user-web/user/editUserInfo?uno=${JSON.parse(sessionStorage.getItem('userInfo')).uno}&oneself=true`)
|
|
475
|
+
})
|
|
463
476
|
},
|
|
464
477
|
setUserVisible(v) {
|
|
465
478
|
if (v) {
|
|
466
479
|
this.customOpt.agency && this.getProxyAuthIing()
|
|
467
|
-
|
|
468
480
|
let loginTime = sessionStorage.getItem('loginTime')
|
|
469
481
|
if (loginTime) {
|
|
470
482
|
this.setDurationTime(loginTime)
|
|
@@ -513,6 +525,9 @@ export default {
|
|
|
513
525
|
case 'changePassword':
|
|
514
526
|
this.changePassword()
|
|
515
527
|
break
|
|
528
|
+
case 'changeUserInfo':
|
|
529
|
+
this.goMdmUser()
|
|
530
|
+
break
|
|
516
531
|
case 'logOut':
|
|
517
532
|
this.logOut()
|
|
518
533
|
break
|
|
@@ -241,6 +241,14 @@ export default {
|
|
|
241
241
|
loginTypes() {
|
|
242
242
|
this.theType = this.loginTypes[0]
|
|
243
243
|
},
|
|
244
|
+
showImageCode: {
|
|
245
|
+
handler(val) {
|
|
246
|
+
if (val) {
|
|
247
|
+
this.getImgCode()
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
immediate: true
|
|
251
|
+
},
|
|
244
252
|
theType: {
|
|
245
253
|
handler() {
|
|
246
254
|
this.getImgCode()
|
|
@@ -115,10 +115,10 @@ export default {
|
|
|
115
115
|
},
|
|
116
116
|
set(value) {
|
|
117
117
|
if (value) {
|
|
118
|
-
|
|
118
|
+
this.$emit('input', { startDate: value[0], endDate: value[1], typeDate: this.type })
|
|
119
119
|
this.$emit('change', { startDate: value[0], endDate: value[1], typeDate: this.type })
|
|
120
120
|
} else {
|
|
121
|
-
|
|
121
|
+
this.$emit('input', { startDate: '', endDate: '', typeDate: this.type })
|
|
122
122
|
this.$emit('change', { startDate: '', endDate: '', typeDate: this.type })
|
|
123
123
|
}
|
|
124
124
|
}
|
|
@@ -146,14 +146,14 @@ export default {
|
|
|
146
146
|
typeDate: this.value.typeDate
|
|
147
147
|
} // 选择的范围
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
this.$emit('input', weekTime)
|
|
150
150
|
this.$emit('change', weekTime)
|
|
151
151
|
} else {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
152
|
+
this.$emit('input', {
|
|
153
|
+
startDate: '',
|
|
154
|
+
endDate: '',
|
|
155
|
+
typeDate: this.value.typeDate
|
|
156
|
+
})
|
|
157
157
|
this.$emit('change', {
|
|
158
158
|
startDate: '',
|
|
159
159
|
endDate: '',
|
|
@@ -177,7 +177,7 @@ export default {
|
|
|
177
177
|
endDate: dayjs(value).endOf('month').format('YYYY-MM-DD'),
|
|
178
178
|
typeDate: this.value.typeDate
|
|
179
179
|
}
|
|
180
|
-
|
|
180
|
+
this.$emit('input', IMonth)
|
|
181
181
|
this.$emit('change', IMonth)
|
|
182
182
|
} else {
|
|
183
183
|
let IMonth = {
|
|
@@ -185,7 +185,7 @@ export default {
|
|
|
185
185
|
endDate: '',
|
|
186
186
|
typeDate: this.value.typeDate
|
|
187
187
|
}
|
|
188
|
-
|
|
188
|
+
this.$emit('input', IMonth)
|
|
189
189
|
this.$emit('change', IMonth)
|
|
190
190
|
}
|
|
191
191
|
}
|
|
@@ -195,7 +195,7 @@ export default {
|
|
|
195
195
|
return this.value
|
|
196
196
|
},
|
|
197
197
|
set(value) {
|
|
198
|
-
|
|
198
|
+
this.$emit('input', Object.assign(value, { typeDate: this.type }))
|
|
199
199
|
this.$emit('change', Object.assign(value, { typeDate: this.type }))
|
|
200
200
|
}
|
|
201
201
|
},
|
|
@@ -214,7 +214,7 @@ export default {
|
|
|
214
214
|
endDate: dayjs(value).endOf('year').format('YYYY-MM-DD'),
|
|
215
215
|
typeDate: this.value.typeDate
|
|
216
216
|
}
|
|
217
|
-
|
|
217
|
+
this.$emit('input', iYear)
|
|
218
218
|
this.$emit('change', iYear)
|
|
219
219
|
} else {
|
|
220
220
|
let iYear = {
|
|
@@ -222,7 +222,7 @@ export default {
|
|
|
222
222
|
endDate: '',
|
|
223
223
|
typeDate: this.value.typeDate
|
|
224
224
|
}
|
|
225
|
-
|
|
225
|
+
this.$emit('input', iYear)
|
|
226
226
|
this.$emit('change', iYear)
|
|
227
227
|
}
|
|
228
228
|
}
|
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
</el-checkbox-group>
|
|
58
58
|
</div>
|
|
59
59
|
</div>
|
|
60
|
-
<div class="right-c flex-column p-t-m"
|
|
60
|
+
<div v-if="!hasPX" class="right-c flex-column p-t-m">
|
|
61
61
|
<div class="m-b">
|
|
62
62
|
{{ '当前选定项' | $lc }}
|
|
63
63
|
<el-link type="primary" style="visibility: hidden">{{ '当前选定项' | $lc }}</el-link>
|
|
64
64
|
</div>
|
|
65
65
|
<div class="flex-1 overflow-y">
|
|
66
|
-
<drag-list :list="dragList" :label-key="labelKey" :in-show-column="true"
|
|
66
|
+
<drag-list :list="dragList" :label-key="labelKey" :in-show-column="true" />
|
|
67
67
|
</div>
|
|
68
68
|
</div>
|
|
69
69
|
<div v-else class="right-tree flex-column p-t-m">
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
<el-link
|
|
100
100
|
class="n20-icon-shanchu"
|
|
101
101
|
:underline="false"
|
|
102
|
-
@click.stop="() => removeMenu(node, data)"
|
|
103
102
|
:disabled="data.checked"
|
|
103
|
+
@click.stop="() => removeMenu(node, data)"
|
|
104
104
|
/>
|
|
105
105
|
</span>
|
|
106
106
|
</el-tree>
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="my-filter-content">
|
|
3
|
+
<div class="my-fc-search">
|
|
4
|
+
<div v-if="filterMultiple" class="my-fc-search-content">
|
|
5
|
+
<template v-if="filters.length">
|
|
6
|
+
<div class="my-fc-search-top">
|
|
7
|
+
<el-input v-model="searchVal" placeholder="输入关键字进行过滤" />
|
|
8
|
+
</div>
|
|
9
|
+
<div>
|
|
10
|
+
<el-checkbox v-model="allCheck" :label="true" :indeterminate="indeterminate">{{
|
|
11
|
+
'全部' | $lc
|
|
12
|
+
}}</el-checkbox>
|
|
13
|
+
</div>
|
|
14
|
+
<el-checkbox-group v-model="filteredValue" class="input-w p-b-s" style="max-height: 226px; overflow: auto">
|
|
15
|
+
<template v-for="filter in filters">
|
|
16
|
+
<el-checkbox
|
|
17
|
+
v-if="filter.label.includes(searchVal)"
|
|
18
|
+
:key="filter.value"
|
|
19
|
+
class="m-t-s m-r-0"
|
|
20
|
+
:label="filter.value"
|
|
21
|
+
style="display: block"
|
|
22
|
+
>
|
|
23
|
+
<span class="align-bottom">{{ filter.label }}</span>
|
|
24
|
+
<span>{{ filter | countF }}</span>
|
|
25
|
+
</el-checkbox>
|
|
26
|
+
</template>
|
|
27
|
+
</el-checkbox-group>
|
|
28
|
+
<div class="flex-box flex-c m-t-s">
|
|
29
|
+
<el-button
|
|
30
|
+
type="primary"
|
|
31
|
+
size="mini"
|
|
32
|
+
@click="
|
|
33
|
+
() => {
|
|
34
|
+
filteredValue.length ? confirmFilterEvent() : resetFilterEvent()
|
|
35
|
+
}
|
|
36
|
+
"
|
|
37
|
+
>
|
|
38
|
+
{{ '确认' | $lc }}
|
|
39
|
+
</el-button>
|
|
40
|
+
<el-button plain size="mini" @click="resetFilterEvent">{{ '清空' | $lc }}</el-button>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
43
|
+
<template v-else>
|
|
44
|
+
<div class="my-fc-search-empty">无匹配项</div>
|
|
45
|
+
</template>
|
|
46
|
+
</div>
|
|
47
|
+
<div v-else class="my-fc-search-content">
|
|
48
|
+
<div class="my-fc-search-top">
|
|
49
|
+
<el-input v-model="searchVal" placeholder="输入关键字进行过滤" />
|
|
50
|
+
</div>
|
|
51
|
+
<ul class="el-table-filter__list">
|
|
52
|
+
<li
|
|
53
|
+
class="el-table-filter__list-item"
|
|
54
|
+
:class="{
|
|
55
|
+
'is-active': filterValue === undefined || filterValue === null
|
|
56
|
+
}"
|
|
57
|
+
@click="handleSelect(null)"
|
|
58
|
+
>
|
|
59
|
+
{{ '全部' | $lc }}
|
|
60
|
+
</li>
|
|
61
|
+
</ul>
|
|
62
|
+
<ul class="el-table-filter__list" style="max-height: 226px; overflow: auto">
|
|
63
|
+
<template v-for="filter in filters">
|
|
64
|
+
<li
|
|
65
|
+
v-if="filter.label.includes(searchVal)"
|
|
66
|
+
:key="filter.value"
|
|
67
|
+
class="el-table-filter__list-item"
|
|
68
|
+
:label="filter.value"
|
|
69
|
+
:class="{ 'is-active': filter.value === filterValue }"
|
|
70
|
+
@click="handleSelect(filter.value)"
|
|
71
|
+
>
|
|
72
|
+
<!-- v-title="filter.text" :show-overflow-tooltip="true" -->
|
|
73
|
+
<span class="text-ellipsis align-bottom" style="display: inline-block; max-width: 12em">{{
|
|
74
|
+
filter.label
|
|
75
|
+
}}</span>
|
|
76
|
+
<span>{{ filter | countF }}</span>
|
|
77
|
+
</li>
|
|
78
|
+
</template>
|
|
79
|
+
</ul>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
</template>
|
|
84
|
+
|
|
85
|
+
<script>
|
|
86
|
+
export default {
|
|
87
|
+
name: 'FilterContent',
|
|
88
|
+
filters: {
|
|
89
|
+
countF(item) {
|
|
90
|
+
if (item.count === undefined) {
|
|
91
|
+
return ''
|
|
92
|
+
} else {
|
|
93
|
+
return ' (' + item.count + ')'
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
alltextF(list = []) {
|
|
97
|
+
if (list.some((c) => c.count !== undefined)) {
|
|
98
|
+
let total = 0
|
|
99
|
+
list.forEach((c) => {
|
|
100
|
+
if (!isNaN(c.count)) {
|
|
101
|
+
total = total + Number(c.count)
|
|
102
|
+
}
|
|
103
|
+
})
|
|
104
|
+
return ' (' + total + ')'
|
|
105
|
+
} else {
|
|
106
|
+
return ''
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
props: {
|
|
111
|
+
params: {
|
|
112
|
+
type: Object,
|
|
113
|
+
default: () => {
|
|
114
|
+
return {}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
data() {
|
|
119
|
+
return {
|
|
120
|
+
demo1: {
|
|
121
|
+
isAll: false,
|
|
122
|
+
option: null,
|
|
123
|
+
colValList: [],
|
|
124
|
+
valList: []
|
|
125
|
+
},
|
|
126
|
+
searchVal: '',
|
|
127
|
+
column: null,
|
|
128
|
+
filteredValue: [],
|
|
129
|
+
filterValue: null,
|
|
130
|
+
allCheck: false
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
computed: {
|
|
134
|
+
filters() {
|
|
135
|
+
return this.params.column && this.params.column.filters
|
|
136
|
+
},
|
|
137
|
+
filterMultiple() {
|
|
138
|
+
return this.params.column && this.params.column.filterMultiple
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
indeterminate() {
|
|
142
|
+
return this.filteredValue.length > 0 && this.filteredValue.length !== this.filters.length
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
multiple() {
|
|
146
|
+
if (this.column) {
|
|
147
|
+
return this.column.filterMultiple
|
|
148
|
+
}
|
|
149
|
+
return true
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
watch: {
|
|
153
|
+
filteredValue: {
|
|
154
|
+
immediate: true,
|
|
155
|
+
deep: true,
|
|
156
|
+
handler() {
|
|
157
|
+
if (this.filteredValue.length === this.filters.length) {
|
|
158
|
+
this.allCheck = true
|
|
159
|
+
} else if (this.filteredValue.length === 0) {
|
|
160
|
+
this.allCheck = false
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
allCheck: {
|
|
165
|
+
deep: true,
|
|
166
|
+
handler(val) {
|
|
167
|
+
if (val) {
|
|
168
|
+
this.filteredValue = this.filters.map((item) => {
|
|
169
|
+
return item.value
|
|
170
|
+
})
|
|
171
|
+
} else {
|
|
172
|
+
this.filteredValue = []
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
mounted() {
|
|
178
|
+
this.column = this.params.column
|
|
179
|
+
// 初始化 取出已选选项
|
|
180
|
+
const checked = this.column.filters
|
|
181
|
+
.filter((item) => {
|
|
182
|
+
return item.checked
|
|
183
|
+
})
|
|
184
|
+
.map((item2) => {
|
|
185
|
+
return item2.value
|
|
186
|
+
})
|
|
187
|
+
this.filteredValue = checked
|
|
188
|
+
this.filterValue = checked && checked[0]
|
|
189
|
+
},
|
|
190
|
+
methods: {
|
|
191
|
+
isActive(filter) {
|
|
192
|
+
return filter.value === this.filteredValue
|
|
193
|
+
},
|
|
194
|
+
handleSelect(filterValue) {
|
|
195
|
+
this.filterValue = filterValue
|
|
196
|
+
if (typeof filterValue !== 'undefined' && filterValue !== null) {
|
|
197
|
+
this.confirmFilterEventDx([this.filterValue])
|
|
198
|
+
} else {
|
|
199
|
+
this.confirmFilterEventDx([])
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
// 单选
|
|
203
|
+
confirmFilterEventDx(filterValue = []) {
|
|
204
|
+
const { $panel, column } = this.params
|
|
205
|
+
column.filters.map((item) => {
|
|
206
|
+
item.data = { vals: filterValue }
|
|
207
|
+
if (filterValue.includes(item.value)) {
|
|
208
|
+
item.checked = true
|
|
209
|
+
item._checked = true
|
|
210
|
+
} else {
|
|
211
|
+
item.checked = false
|
|
212
|
+
item._checked = false
|
|
213
|
+
}
|
|
214
|
+
return item
|
|
215
|
+
})
|
|
216
|
+
$panel.confirmFilter()
|
|
217
|
+
},
|
|
218
|
+
// 多选
|
|
219
|
+
confirmFilterEvent() {
|
|
220
|
+
const { $panel, column } = this.params
|
|
221
|
+
column.filters.map((item) => {
|
|
222
|
+
item.data = { vals: this.filteredValue }
|
|
223
|
+
if (this.filteredValue.includes(item.value)) {
|
|
224
|
+
item.checked = true
|
|
225
|
+
item._checked = true
|
|
226
|
+
} else {
|
|
227
|
+
item.checked = false
|
|
228
|
+
item._checked = false
|
|
229
|
+
}
|
|
230
|
+
return item
|
|
231
|
+
})
|
|
232
|
+
$panel.confirmFilter()
|
|
233
|
+
},
|
|
234
|
+
resetFilterEvent() {
|
|
235
|
+
this.filteredValue = []
|
|
236
|
+
const { $panel, column } = this.params
|
|
237
|
+
column.filters.map((item) => {
|
|
238
|
+
item.data = { vals: this.filteredValue }
|
|
239
|
+
if (this.filteredValue.includes(item.value)) {
|
|
240
|
+
item.checked = true
|
|
241
|
+
item._checked = true
|
|
242
|
+
} else {
|
|
243
|
+
item.checked = false
|
|
244
|
+
item._checked = false
|
|
245
|
+
}
|
|
246
|
+
return item
|
|
247
|
+
})
|
|
248
|
+
$panel.confirmFilter()
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
</script>
|
|
253
|
+
|
|
254
|
+
<style>
|
|
255
|
+
/*
|
|
256
|
+
table-pro表头筛选框样式
|
|
257
|
+
*/
|
|
258
|
+
.my-filter-content {
|
|
259
|
+
padding: 10px;
|
|
260
|
+
user-select: none;
|
|
261
|
+
}
|
|
262
|
+
.my-filter-content .my-fc-search .my-fc-search-top {
|
|
263
|
+
position: relative;
|
|
264
|
+
padding: 5px 0;
|
|
265
|
+
}
|
|
266
|
+
.my-filter-content .my-fc-search .my-fc-search-top > input {
|
|
267
|
+
border: 1px solid #ababab;
|
|
268
|
+
padding: 0 20px 0 2px;
|
|
269
|
+
width: 200px;
|
|
270
|
+
height: 22px;
|
|
271
|
+
line-height: 22px;
|
|
272
|
+
}
|
|
273
|
+
.my-filter-content .my-fc-search .my-fc-search-content {
|
|
274
|
+
padding: 2px 10px;
|
|
275
|
+
}
|
|
276
|
+
.my-filter-content .my-fc-search .my-fc-search-content .el-table-filter__list-item {
|
|
277
|
+
text-align: left;
|
|
278
|
+
}
|
|
279
|
+
</style>
|