cnhis-design-vue 2.1.79 → 2.1.81
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/CHANGELOG.md +52 -4
- package/es/affix/index.js +8 -8
- package/es/age/index.js +10 -10
- package/es/alert/index.js +8 -8
- package/es/anchor/index.js +8 -8
- package/es/auto-complete/index.js +8 -8
- package/es/avatar/index.js +8 -8
- package/es/back-top/index.js +8 -8
- package/es/badge/index.js +8 -8
- package/es/base/index.js +8 -8
- package/es/big-table/index.js +115 -95
- package/es/big-table/style.css +1 -1
- package/es/breadcrumb/index.js +8 -8
- package/es/button/index.js +22 -22
- package/es/calendar/index.js +8 -8
- package/es/captcha/index.js +3 -3
- package/es/card/index.js +8 -8
- package/es/carousel/index.js +8 -8
- package/es/cascader/index.js +8 -8
- package/es/checkbox/index.js +9 -9
- package/es/col/index.js +8 -8
- package/es/collapse/index.js +8 -8
- package/es/color-picker/index.js +1 -1
- package/es/comment/index.js +8 -8
- package/es/config-provider/index.js +8 -8
- package/es/date-picker/index.js +8 -8
- package/es/descriptions/index.js +8 -8
- package/es/divider/index.js +8 -8
- package/es/drag-layout/index.js +3 -3
- package/es/drawer/index.js +8 -8
- package/es/dropdown/index.js +8 -8
- package/es/editor/index.js +1 -1
- package/es/ellipsis/index.js +1 -1
- package/es/empty/index.js +8 -8
- package/es/fabric-chart/index.js +9 -9
- package/es/form/index.js +8 -8
- package/es/form-model/index.js +8 -8
- package/es/form-table/index.js +66 -66
- package/es/index/index.js +4328 -1795
- package/es/index/style.css +1 -1
- package/es/input/index.js +9 -9
- package/es/input-number/index.js +8 -8
- package/es/layout/index.js +8 -8
- package/es/list/index.js +8 -8
- package/es/locale-provider/index.js +8 -8
- package/es/map/index.js +9 -9
- package/es/mentions/index.js +8 -8
- package/es/menu/index.js +8 -8
- package/es/message/index.js +8 -8
- package/es/multi-chat/index.js +76 -76
- package/es/multi-chat-client/index.js +70 -70
- package/es/multi-chat-history/index.js +4 -4
- package/es/multi-chat-record/index.js +14 -14
- package/es/multi-chat-setting/index.js +22 -22
- package/es/multi-chat-sip/index.js +1 -1
- package/es/notification/index.js +8 -8
- package/es/page-header/index.js +8 -8
- package/es/pagination/index.js +8 -8
- package/es/popconfirm/index.js +8 -8
- package/es/popover/index.js +8 -8
- package/es/progress/index.js +8 -8
- package/es/radio/index.js +9 -9
- package/es/rate/index.js +8 -8
- package/es/result/index.js +8 -8
- package/es/row/index.js +8 -8
- package/es/scale-container/index.js +1 -1
- package/es/scale-view/index.js +52 -50
- package/es/scale-view/style.css +1 -1
- package/es/select/index.js +12 -12
- package/es/select-label/index.js +36 -34
- package/es/select-label/style.css +1 -1
- package/es/select-person/index.js +2 -2
- package/es/select-tag/index.js +4248 -0
- package/es/select-tag/style.css +1 -0
- package/es/shortcut-setter/index.js +10 -10
- package/es/skeleton/index.js +8 -8
- package/es/slider/index.js +8 -8
- package/es/space/index.js +8 -8
- package/es/spin/index.js +8 -8
- package/es/statistic/index.js +8 -8
- package/es/steps/index.js +8 -8
- package/es/switch/index.js +8 -8
- package/es/table-filter/index.js +3158 -1350
- package/es/table-filter/style.css +1 -1
- package/es/tabs/index.js +8 -8
- package/es/tag/index.js +9 -9
- package/es/time-picker/index.js +8 -8
- package/es/timeline/index.js +8 -8
- package/es/tooltip/index.js +8 -8
- package/es/transfer/index.js +8 -8
- package/es/tree/index.js +8 -8
- package/es/tree-select/index.js +8 -8
- package/es/upload/index.js +8 -8
- package/es/verification-code/index.js +2 -2
- package/lib/cui.common.js +4369 -1699
- package/lib/cui.umd.js +4369 -1699
- package/lib/cui.umd.min.js +82 -82
- package/package.json +1 -1
- package/packages/big-table/src/BigTable.vue +15 -3
- package/packages/big-table/src/assets/style/table-base.less +7 -4
- package/packages/index.js +3 -0
- package/packages/select-label/select-label.vue +18 -2
- package/packages/select-tag/index.js +14 -0
- package/packages/select-tag/label-classify.vue +133 -0
- package/packages/select-tag/labelFormContent.vue +295 -0
- package/packages/select-tag/select-label.vue +274 -0
- package/packages/table-filter/src/base-search-com/BaseSearch.vue +11 -15
- package/packages/table-filter/src/components/TextOverTooltip.vue +24 -11
- package/packages/table-filter/src/components/age-com/index.vue +3 -3
- package/packages/table-filter/src/components/checkbox-group/CheckboxGroup.vue +53 -0
- package/packages/table-filter/src/components/multi-select/multi-select.vue +7 -1
- package/packages/table-filter/src/components/out-quick-search/out-quick-search.vue +5 -119
- package/packages/table-filter/src/components/range-age/index.vue +11 -12
- package/packages/table-filter/src/components/render-widget/components/DateRangeQuick.vue +216 -0
- package/packages/table-filter/src/components/render-widget/components/Label.vue +209 -0
- package/packages/table-filter/src/components/render-widget/components/NumberRange.vue +147 -0
- package/packages/table-filter/src/components/render-widget/components/SelectDynamic.vue +280 -0
- package/packages/table-filter/src/components/render-widget/components/SelectLabel.vue +80 -0
- package/packages/table-filter/src/components/render-widget/components/index.js +6 -4
- package/packages/table-filter/src/components/render-widget/enums.js +29 -22
- package/packages/table-filter/src/components/render-widget/index.vue +45 -5
- package/packages/table-filter/src/components/render-widget/mixins/dynamic-method.js +164 -0
- package/packages/table-filter/src/components/render-widget/mixins/label-method.js +23 -0
- package/packages/table-filter/src/components/render-widget/widgetCfgMaps.js +194 -46
- package/packages/table-filter/src/components/search-filter/SearchFilter.vue +3 -1
- package/packages/table-filter/src/components/search-modal/set-classification.vue +5 -1
- package/packages/table-filter/src/mixins/mixins.js +192 -133
- package/packages/table-filter/src/mixins/out-quick-method.js +123 -0
- package/packages/table-filter/src/mixins/renderWidget.js +21 -13
- package/packages/table-filter/src/quick-search/QuickSearch.vue +201 -133
|
@@ -1,26 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<a-input-group>
|
|
3
|
-
<a-row :gutter="8">
|
|
4
|
-
<a-col :span="11">
|
|
2
|
+
<a-input-group class="rang-age-input-group">
|
|
5
3
|
<age-com
|
|
6
4
|
:disabled="disabled"
|
|
7
5
|
:format="format"
|
|
8
6
|
@change="ageStartOnChange"
|
|
9
7
|
:defaultValue="startValue"
|
|
10
|
-
></age-com
|
|
11
|
-
</a-col>
|
|
12
|
-
<a-col :span="1">
|
|
13
|
-
<div class="middle-tips">—</div>
|
|
14
|
-
</a-col>
|
|
15
|
-
<a-col :span="11">
|
|
16
|
-
<age-com
|
|
8
|
+
></age-com><div class="middle-tips">—</div><age-com
|
|
17
9
|
:disabled="disabled"
|
|
18
10
|
:format="format"
|
|
19
11
|
@change="ageEndOnChange"
|
|
20
12
|
:defaultValue="endValue"
|
|
21
13
|
></age-com>
|
|
22
|
-
</a-col>
|
|
23
|
-
</a-row>
|
|
24
14
|
</a-input-group>
|
|
25
15
|
</template>
|
|
26
16
|
|
|
@@ -164,7 +154,16 @@ export default {
|
|
|
164
154
|
</script>
|
|
165
155
|
|
|
166
156
|
<style lang="less" scoped>
|
|
157
|
+
.rang-age-input-group {
|
|
158
|
+
display: inline-flex;
|
|
159
|
+
width: 100%;
|
|
160
|
+
/deep/ .age-com {
|
|
161
|
+
max-width: calc(50% - 16px);
|
|
162
|
+
width: unset;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
167
165
|
.middle-tips {
|
|
166
|
+
width: 32px;
|
|
168
167
|
height: 30px;
|
|
169
168
|
line-height: 30px;
|
|
170
169
|
text-align: center;
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="filter-date-range">
|
|
3
|
+
<a-radio-group v-model="con" buttonStyle="solid">
|
|
4
|
+
<a-radio-button
|
|
5
|
+
v-for="date in dateTeam0"
|
|
6
|
+
v-show="!showDate"
|
|
7
|
+
@click="clickRadioGroup(date.con)"
|
|
8
|
+
:key="date.con"
|
|
9
|
+
:value="date.con"
|
|
10
|
+
>
|
|
11
|
+
{{ getI18nText(date.title, date.name) }}
|
|
12
|
+
</a-radio-button>
|
|
13
|
+
<span :class="['check-date-btn', marginx]" @click="checkDate">
|
|
14
|
+
{{ checkText }}
|
|
15
|
+
</span>
|
|
16
|
+
<div class="check-date" v-show="showDate">
|
|
17
|
+
<a-date-picker
|
|
18
|
+
v-model="value_start"
|
|
19
|
+
:format="format"
|
|
20
|
+
:show-time="showTimeStart"
|
|
21
|
+
:placeholder="placeholderS"
|
|
22
|
+
style="width: 200px;min-width: 195px;"
|
|
23
|
+
allowClear
|
|
24
|
+
:disabledDate="current => disabledDatePicker(current, 'start')"
|
|
25
|
+
@change="dateChangeStr"
|
|
26
|
+
/>
|
|
27
|
+
|
|
28
|
+
<a-date-picker
|
|
29
|
+
v-model="value_end"
|
|
30
|
+
:format="format"
|
|
31
|
+
:show-time="showTimeEnd"
|
|
32
|
+
:placeholder="placeholderE"
|
|
33
|
+
style="width: 200px;min-width: 195px;"
|
|
34
|
+
allowClear
|
|
35
|
+
:disabledDate="current => disabledDatePicker(current, 'end')"
|
|
36
|
+
@change="dateChangeEnd"
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
</a-radio-group>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script>
|
|
44
|
+
import { Radio, DatePicker } from 'ant-design-vue';
|
|
45
|
+
import { dataOptions } from '~/table-filter/src/const/dataOptions';
|
|
46
|
+
import moment from 'moment';
|
|
47
|
+
|
|
48
|
+
export default {
|
|
49
|
+
inheritAttrs: false,
|
|
50
|
+
components: {
|
|
51
|
+
[DatePicker.name]: DatePicker,
|
|
52
|
+
[Radio.Button.name]: Radio.Button,
|
|
53
|
+
[Radio.Group.name]: Radio.Group,
|
|
54
|
+
},
|
|
55
|
+
props: {
|
|
56
|
+
value: {
|
|
57
|
+
type: [Array, String, Number],
|
|
58
|
+
},
|
|
59
|
+
componentCfg: { type: Object },
|
|
60
|
+
placeholderS: String,
|
|
61
|
+
placeholderE: String,
|
|
62
|
+
fieldType: String
|
|
63
|
+
},
|
|
64
|
+
data(){
|
|
65
|
+
return {
|
|
66
|
+
showDate: false,
|
|
67
|
+
marginx: 'ml',
|
|
68
|
+
con: null,
|
|
69
|
+
value_start: null,
|
|
70
|
+
value_end: null,
|
|
71
|
+
...dataOptions
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
model: {
|
|
75
|
+
prop: "value",
|
|
76
|
+
event: "update:value"
|
|
77
|
+
},
|
|
78
|
+
computed: {
|
|
79
|
+
checkText() {
|
|
80
|
+
if(this.fieldType === 'DATE') return '选择日期'
|
|
81
|
+
return '选择时间'
|
|
82
|
+
},
|
|
83
|
+
showTimeStart(){
|
|
84
|
+
if(this.fieldType === 'DATE') return false;
|
|
85
|
+
return { defaultValue: moment('00:00:00', 'HH:mm:ss') }
|
|
86
|
+
},
|
|
87
|
+
showTimeEnd(){
|
|
88
|
+
if(this.fieldType === 'DATE') return false;
|
|
89
|
+
return { defaultValue: moment('23:59:59', 'HH:mm:ss') }
|
|
90
|
+
},
|
|
91
|
+
format(){
|
|
92
|
+
if(this.fieldType === 'DATE') return 'YYYY-MM-DD';
|
|
93
|
+
return 'YYYY-MM-DD HH:mm:ss'
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
watch: {
|
|
97
|
+
value: {
|
|
98
|
+
immediate: true,
|
|
99
|
+
handler(val) {
|
|
100
|
+
if(!val && !this.componentCfg?.con) {
|
|
101
|
+
this.clearData()
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
created(){
|
|
107
|
+
this.init();
|
|
108
|
+
},
|
|
109
|
+
methods: {
|
|
110
|
+
handleMoment(val) {
|
|
111
|
+
if(!val || !val._isAMomentObject) return null;
|
|
112
|
+
return val.format(this.format) || null;
|
|
113
|
+
},
|
|
114
|
+
init(){
|
|
115
|
+
if(!this.value) return;
|
|
116
|
+
let resVal = this.value
|
|
117
|
+
if (
|
|
118
|
+
resVal?.length === 1 &&
|
|
119
|
+
resVal[0] &&
|
|
120
|
+
typeof resVal[0] === "string" &&
|
|
121
|
+
resVal[0].includes("~")
|
|
122
|
+
) {
|
|
123
|
+
resVal = resVal[0].split("~");
|
|
124
|
+
}
|
|
125
|
+
if(!Array.isArray(resVal)) return;
|
|
126
|
+
this.value_start = resVal[0];
|
|
127
|
+
this.value_end = resVal[1];
|
|
128
|
+
},
|
|
129
|
+
// 单选按钮组合点击取消选中状态
|
|
130
|
+
clickRadioGroup(con) {
|
|
131
|
+
this.$emit("update:value", []);
|
|
132
|
+
this.value_start = null;
|
|
133
|
+
this.value_end = null;
|
|
134
|
+
if (this.con == con) {
|
|
135
|
+
this.con = null;
|
|
136
|
+
} else {
|
|
137
|
+
this.con = con;
|
|
138
|
+
}
|
|
139
|
+
this.$emit('setCfgCon', this.con);
|
|
140
|
+
},
|
|
141
|
+
checkDate() {
|
|
142
|
+
this.showDate = !this.showDate;
|
|
143
|
+
this.showDate ? (this.marginx = "mr") : (this.marginx = "ml");
|
|
144
|
+
},
|
|
145
|
+
clearData(){
|
|
146
|
+
this.con = null;
|
|
147
|
+
this.value_start = null;
|
|
148
|
+
this.value_end = null;
|
|
149
|
+
this.marginx = 'ml';
|
|
150
|
+
this.showDate = false;
|
|
151
|
+
this.$emit('setCfgCon', this.con);
|
|
152
|
+
},
|
|
153
|
+
dateChangeStr(date){
|
|
154
|
+
this.$emit('setCfgCon', 'EQ')
|
|
155
|
+
let str = `${this.handleMoment(date) || ''}~${this.handleMoment(this.value_end) || ''}`
|
|
156
|
+
this.$emit("update:value", str);
|
|
157
|
+
},
|
|
158
|
+
dateChangeEnd(date){
|
|
159
|
+
this.$emit('setCfgCon', 'EQ')
|
|
160
|
+
let str = `${this.handleMoment(this.value_start) || ''}~${this.handleMoment(date) || ''}`
|
|
161
|
+
this.$emit("update:value", str);
|
|
162
|
+
},
|
|
163
|
+
/**
|
|
164
|
+
* 限制日期填写
|
|
165
|
+
*/
|
|
166
|
+
disabledDatePicker(current, t){
|
|
167
|
+
let f = false;
|
|
168
|
+
if(t=== 'start'){
|
|
169
|
+
const end_val = this.value_end;
|
|
170
|
+
f = end_val && current.valueOf() > end_val.valueOf();
|
|
171
|
+
} else if(t=== 'end') {
|
|
172
|
+
const start_val = this.value_start;
|
|
173
|
+
f = start_val && current.valueOf() <= start_val.valueOf();
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* 2 过去时间
|
|
177
|
+
* 3 未来时间
|
|
178
|
+
*/
|
|
179
|
+
let type = String(this.componentCfg?.advanceOptionSetting);
|
|
180
|
+
if(!['2','3'].includes(type)) return f;
|
|
181
|
+
if(type === '2'){
|
|
182
|
+
return current >= moment().endOf('day') || f;
|
|
183
|
+
} else if(type==='3'){
|
|
184
|
+
return current && current < moment().startOf('day') || f;
|
|
185
|
+
}
|
|
186
|
+
return f
|
|
187
|
+
},
|
|
188
|
+
getI18nText(i, d) {
|
|
189
|
+
if (Array.isArray(i)) {
|
|
190
|
+
return this.$t ? this.$t.apply(this, i) : d;
|
|
191
|
+
}
|
|
192
|
+
return this.$t ? this.$t(i) : d;
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
}
|
|
196
|
+
</script>
|
|
197
|
+
<style lang='less' scoped>
|
|
198
|
+
.check-date-btn {
|
|
199
|
+
display: inline-block;
|
|
200
|
+
line-height: 32px;
|
|
201
|
+
height: 32px;
|
|
202
|
+
padding: 0 10px;
|
|
203
|
+
background-color: #ddd;
|
|
204
|
+
cursor: pointer;
|
|
205
|
+
&.ml {
|
|
206
|
+
margin-left: 12px;
|
|
207
|
+
}
|
|
208
|
+
&.mr {
|
|
209
|
+
margin-right: 12px;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
.check-date {
|
|
213
|
+
display: inline-block;
|
|
214
|
+
line-height: 33px;
|
|
215
|
+
}
|
|
216
|
+
</style>
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="label-attr-filter-container">
|
|
3
|
+
<div class="edit-labels-content"
|
|
4
|
+
v-for="categoryItem in categoryList"
|
|
5
|
+
:key="categoryItem.classifyId"
|
|
6
|
+
>
|
|
7
|
+
<span class="edit-f-label">{{ categoryItem.classifyName }}:</span>
|
|
8
|
+
<div
|
|
9
|
+
class="edit-f-content"
|
|
10
|
+
:class="{
|
|
11
|
+
'label-select-height': !categoryItem.isUnfold && categoryItem.labelList && categoryItem.isShowBtn
|
|
12
|
+
}"
|
|
13
|
+
>
|
|
14
|
+
<div class="label-f-content" v-resize="el => onResize(el, categoryItem)">
|
|
15
|
+
<a-checkable-tag
|
|
16
|
+
v-for="item in categoryItem.labelList"
|
|
17
|
+
:key="item.labelCode"
|
|
18
|
+
v-model="item.isSelect"
|
|
19
|
+
@change="handleLabelChange($event, item, categoryItem)"
|
|
20
|
+
:style="formatStyle(item)"
|
|
21
|
+
>
|
|
22
|
+
<a-tooltip placement="topLeft" :mouseEnterDelay="0.5" :mouseLeaveDelay="0">
|
|
23
|
+
<template slot="title">
|
|
24
|
+
<span>{{ item.labelShowText }}</span>
|
|
25
|
+
</template>
|
|
26
|
+
{{ item.labelShowText }}
|
|
27
|
+
</a-tooltip>
|
|
28
|
+
</a-checkable-tag>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<div class="label-f-unfold-btn" v-if="categoryItem.labelList && categoryItem.isShowBtn">
|
|
32
|
+
<span @click.stop="handleLabelUpfold(categoryItem)">
|
|
33
|
+
<template v-if="categoryItem.isUnfold">
|
|
34
|
+
<span>收起</span>
|
|
35
|
+
<a-icon
|
|
36
|
+
type="up-square"
|
|
37
|
+
/>
|
|
38
|
+
</template>
|
|
39
|
+
<template v-else>
|
|
40
|
+
<span>展开</span>
|
|
41
|
+
<a-icon
|
|
42
|
+
type="down-square"
|
|
43
|
+
/>
|
|
44
|
+
</template>
|
|
45
|
+
</span>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script>
|
|
52
|
+
import { Tag, Icon, Tooltip } from 'ant-design-vue';
|
|
53
|
+
import resize from 'vue-resize-directive';
|
|
54
|
+
|
|
55
|
+
const baseActiveColor = 'rgb(85, 133, 245)';
|
|
56
|
+
export default {
|
|
57
|
+
inheritAttrs: false,
|
|
58
|
+
components: {
|
|
59
|
+
[Icon.name]: Icon,
|
|
60
|
+
[Tag.name]: Tag,
|
|
61
|
+
[Tag.CheckableTag.name]: Tag.CheckableTag,
|
|
62
|
+
[Tooltip.name]: Tooltip,
|
|
63
|
+
},
|
|
64
|
+
directives: { resize },
|
|
65
|
+
props: {
|
|
66
|
+
componentCfg: { type: Object },
|
|
67
|
+
value: {
|
|
68
|
+
type: [Array, String, Number],
|
|
69
|
+
},
|
|
70
|
+
getLabelListMethodRender: Function,
|
|
71
|
+
},
|
|
72
|
+
model: {
|
|
73
|
+
prop: "value",
|
|
74
|
+
event: "update:value"
|
|
75
|
+
},
|
|
76
|
+
data() {
|
|
77
|
+
return {
|
|
78
|
+
// 选中项
|
|
79
|
+
selectedList: [],
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
computed: {
|
|
83
|
+
categoryList() {
|
|
84
|
+
const {
|
|
85
|
+
tagList = []
|
|
86
|
+
} = this.componentCfg;
|
|
87
|
+
if (tagList && tagList.length > 0) {
|
|
88
|
+
return tagList.map(category => {
|
|
89
|
+
category.labelList.map(label => {
|
|
90
|
+
const valueList = this.value ? this.value.split('|#|') : [];
|
|
91
|
+
this.selectedList = valueList;
|
|
92
|
+
// 初始化isSelect的状态
|
|
93
|
+
if (valueList.length > 0) {
|
|
94
|
+
label.isSelect = valueList.includes(label.labelShowText);
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
return category
|
|
98
|
+
})
|
|
99
|
+
}
|
|
100
|
+
return []
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
created() {
|
|
104
|
+
this.getLabelListMethodRender(this.componentCfg)
|
|
105
|
+
},
|
|
106
|
+
methods: {
|
|
107
|
+
onResize(el, categoryItem) {
|
|
108
|
+
this.$nextTick(() => {
|
|
109
|
+
let height = el.offsetHeight || 0;
|
|
110
|
+
if (!height) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (height > 80) {
|
|
114
|
+
this.$set(categoryItem, 'isShowBtn', true);
|
|
115
|
+
} else {
|
|
116
|
+
this.$set(categoryItem, 'isShowBtn', false);
|
|
117
|
+
this.$set(categoryItem, 'isUnfold', false);
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
},
|
|
121
|
+
handleLabelUpfold(categoryItem) {
|
|
122
|
+
this.$set(categoryItem, 'isUnfold', !categoryItem.isUnfold);
|
|
123
|
+
},
|
|
124
|
+
formatStyle(item) {
|
|
125
|
+
return item.isSelect ? {
|
|
126
|
+
background: item.backgroundColor || baseActiveColor,
|
|
127
|
+
borderColor: item.backgroundColor || baseActiveColor
|
|
128
|
+
} : {}
|
|
129
|
+
},
|
|
130
|
+
handleLabelChange(isSelect, item) {
|
|
131
|
+
item.isSelect = isSelect;
|
|
132
|
+
if (isSelect) {
|
|
133
|
+
this.selectedList.push(item.labelShowText)
|
|
134
|
+
} else {
|
|
135
|
+
const index = this.selectedList.findIndex(labelText => labelText === item.labelShowText);
|
|
136
|
+
if (index > -1) {
|
|
137
|
+
this.selectedList.splice(index, 1);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// 将数据向外抛出
|
|
141
|
+
this.$emit("update:value", this.selectedList.join('|#|'));
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
</script>
|
|
146
|
+
|
|
147
|
+
<style lang='less' scoped>
|
|
148
|
+
.label-attr-filter-container {
|
|
149
|
+
.edit-labels-content{
|
|
150
|
+
.edit-f-label {
|
|
151
|
+
color: #000;
|
|
152
|
+
font-size: 14px;
|
|
153
|
+
line-height: 32px;
|
|
154
|
+
padding-left: 0;
|
|
155
|
+
}
|
|
156
|
+
.edit-f-content{
|
|
157
|
+
padding: 0 !important;
|
|
158
|
+
&.label-select-height{
|
|
159
|
+
overflow: hidden;
|
|
160
|
+
height: 74px;
|
|
161
|
+
flex: none !important;
|
|
162
|
+
}
|
|
163
|
+
.label-f-content{
|
|
164
|
+
display: flex;
|
|
165
|
+
flex-wrap: wrap;
|
|
166
|
+
line-height: 34px;
|
|
167
|
+
.ant-tag-checkable{
|
|
168
|
+
cursor: pointer;
|
|
169
|
+
position: relative;
|
|
170
|
+
height: 32px;
|
|
171
|
+
line-height: 32px;
|
|
172
|
+
text-align: center;
|
|
173
|
+
min-width: 108px;
|
|
174
|
+
max-width: 108px;
|
|
175
|
+
color: rgba(33, 33, 33, 0.6);
|
|
176
|
+
background: rgb(250, 250, 250);
|
|
177
|
+
border-color: rgba(213, 213, 213, 0.8);
|
|
178
|
+
font-size: 14px;
|
|
179
|
+
border-radius: 4px;
|
|
180
|
+
margin-bottom: 8px;
|
|
181
|
+
box-sizing: border-box;
|
|
182
|
+
span {
|
|
183
|
+
display: inline-block;
|
|
184
|
+
width: 80px;
|
|
185
|
+
height: 100%;
|
|
186
|
+
line-height: 30px;
|
|
187
|
+
overflow: hidden;
|
|
188
|
+
text-overflow: ellipsis;
|
|
189
|
+
white-space: nowrap;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
.ant-tag-checkable-checked {
|
|
193
|
+
color: #fff !important;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
.label-f-unfold-btn{
|
|
198
|
+
margin: 8px 0;
|
|
199
|
+
color: rgba(0, 0, 0, 0.6);
|
|
200
|
+
cursor: pointer;
|
|
201
|
+
.anticon{
|
|
202
|
+
font-size: 16px;
|
|
203
|
+
margin-left: 8px;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
</style>
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="filter-number-range">
|
|
3
|
+
<span
|
|
4
|
+
class="ant-calendar-picker-input ant-input num-picker"
|
|
5
|
+
:class="{ 'num-picker-unit': componentCfg.inputUnit }"
|
|
6
|
+
>
|
|
7
|
+
<input
|
|
8
|
+
v-model="lessValue"
|
|
9
|
+
:title="placeholderS"
|
|
10
|
+
:placeholder="placeholderS"
|
|
11
|
+
@keyup.enter="changeFilterNumber"
|
|
12
|
+
@change="changeFilterNumber"
|
|
13
|
+
class="ant-calendar-range-picker-input"/>
|
|
14
|
+
<span class="ant-calendar-range-picker-separator"> ~ </span>
|
|
15
|
+
<input
|
|
16
|
+
v-model="bigValue"
|
|
17
|
+
:title="placeholderE"
|
|
18
|
+
:placeholder="placeholderE"
|
|
19
|
+
@keyup.enter="changeFilterNumber"
|
|
20
|
+
@change="changeFilterNumber"
|
|
21
|
+
class="ant-calendar-range-picker-input"/>
|
|
22
|
+
<template v-if="componentCfg.inputUnit"> {{ componentCfg.inputUnit }}</template>
|
|
23
|
+
<span
|
|
24
|
+
class="ant-input-suffix clear-number-icon"
|
|
25
|
+
v-if="lessValue || bigValue"
|
|
26
|
+
@click="clearFilterNumber"
|
|
27
|
+
><i
|
|
28
|
+
aria-label="图标: close-circle"
|
|
29
|
+
tabindex="-1"
|
|
30
|
+
class="anticon anticon-close-circle ant-input-clear-icon"
|
|
31
|
+
><svg
|
|
32
|
+
viewBox="64 64 896 896"
|
|
33
|
+
data-icon="close-circle"
|
|
34
|
+
width="1em"
|
|
35
|
+
height="1em"
|
|
36
|
+
fill="currentColor"
|
|
37
|
+
aria-hidden="true"
|
|
38
|
+
focusable="false"
|
|
39
|
+
class=""
|
|
40
|
+
>
|
|
41
|
+
<path
|
|
42
|
+
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 0 1-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
|
43
|
+
></path></svg></i></span
|
|
44
|
+
></span>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script>
|
|
49
|
+
import { Select } from 'ant-design-vue';
|
|
50
|
+
|
|
51
|
+
export default {
|
|
52
|
+
inheritAttrs: false,
|
|
53
|
+
components: {
|
|
54
|
+
Select,
|
|
55
|
+
},
|
|
56
|
+
props: {
|
|
57
|
+
value: {
|
|
58
|
+
type: [Array, String, Number],
|
|
59
|
+
},
|
|
60
|
+
componentCfg: {
|
|
61
|
+
type: Object
|
|
62
|
+
},
|
|
63
|
+
placeholderS: String,
|
|
64
|
+
placeholderE: String,
|
|
65
|
+
},
|
|
66
|
+
watch: {
|
|
67
|
+
value: {
|
|
68
|
+
immediate: true,
|
|
69
|
+
handler(val) {
|
|
70
|
+
if(!val) {
|
|
71
|
+
this.clearFilterNumber()
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
data(){
|
|
77
|
+
return {
|
|
78
|
+
lessValue: undefined,
|
|
79
|
+
bigValue: undefined
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
model: {
|
|
83
|
+
prop: "value",
|
|
84
|
+
event: "update:value"
|
|
85
|
+
},
|
|
86
|
+
computed: {},
|
|
87
|
+
created(){
|
|
88
|
+
this.init();
|
|
89
|
+
},
|
|
90
|
+
methods: {
|
|
91
|
+
init(){
|
|
92
|
+
// 参数查询会被处理为["1~22"]
|
|
93
|
+
if(!this.value || !Array.isArray(this.value)) {
|
|
94
|
+
this.clearFilterNumber();
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
let resVal = this.value[0]
|
|
98
|
+
if(!resVal || typeof resVal !== 'string' || !resVal.includes('~')) {
|
|
99
|
+
this.clearFilterNumber();
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
this.lessValue = resVal.split('~')?.[0] ?? undefined;
|
|
103
|
+
this.bigValue = resVal.split('~')?.[1] ?? undefined;
|
|
104
|
+
},
|
|
105
|
+
changeFilterNumber() {
|
|
106
|
+
let res = `${this.lessValue ?? ''}~${this.bigValue ?? ''}`
|
|
107
|
+
if (this.lessValue && this.bigValue && this.lessValue > this.bigValue) {
|
|
108
|
+
res = `${this.bigValue}~${this.lessValue}`
|
|
109
|
+
}
|
|
110
|
+
this.$emit("update:value", res);
|
|
111
|
+
},
|
|
112
|
+
clearFilterNumber() {
|
|
113
|
+
this.lessValue = undefined;
|
|
114
|
+
this.bigValue = undefined;
|
|
115
|
+
this.$emit("update:value", '');
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
}
|
|
119
|
+
</script>
|
|
120
|
+
<style lang='less' scoped>
|
|
121
|
+
/deep/ .num-picker {
|
|
122
|
+
position: relative;
|
|
123
|
+
display: flex;
|
|
124
|
+
&.num-picker-unit {
|
|
125
|
+
padding-right: 20px;
|
|
126
|
+
}
|
|
127
|
+
input {
|
|
128
|
+
text-align: left !important;
|
|
129
|
+
}
|
|
130
|
+
&:hover {
|
|
131
|
+
.clear-number-icon {
|
|
132
|
+
display: block;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/deep/ .ant-calendar-range-picker-input {
|
|
136
|
+
text-align: left;
|
|
137
|
+
}
|
|
138
|
+
.clear-number-icon {
|
|
139
|
+
position: absolute;
|
|
140
|
+
right: 5px;
|
|
141
|
+
top: 6px;
|
|
142
|
+
display: none;
|
|
143
|
+
cursor: pointer;
|
|
144
|
+
z-index: 1000;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
</style>
|