fast-crud-ui3 1.5.16-tsc-beta → 1.5.16
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/fast-crud-ui3.cjs.js +7 -7
- package/lib/fast-crud-ui3.es.js +1960 -2003
- package/lib/fast-crud-ui3.umd.js +7 -7
- package/lib/style.css +1 -1
- package/package.json +5 -18
- package/lib/assets/fonts/iconfont.d.ts +0 -0
- package/lib/components/checkbox-group/index.d.ts +0 -2
- package/lib/components/checkbox-group/src/fast-checkbox-group.d.ts +0 -72
- package/lib/components/content-dialog/index.d.ts +0 -2
- package/lib/components/content-dialog/src/fast-cell-content.d.ts +0 -83
- package/lib/components/json-viewer/index.d.ts +0 -2
- package/lib/components/json-viewer/src/fast-json-viewer.d.ts +0 -48
- package/lib/components/mapping.d.ts +0 -5
- package/lib/components/object-picker/index.d.ts +0 -2
- package/lib/components/object-picker/src/fast-object-picker.d.ts +0 -132
- package/lib/components/select/index.d.ts +0 -2
- package/lib/components/select/src/fast-select.d.ts +0 -83
- package/lib/components/table/index.d.ts +0 -2
- package/lib/components/table/src/RowConfirm.d.ts +0 -39
- package/lib/components/table/src/dynamic-filter-form.d.ts +0 -118
- package/lib/components/table/src/dynamic-filter-list.d.ts +0 -57
- package/lib/components/table/src/easy-filter.d.ts +0 -118
- package/lib/components/table/src/export-confirm.d.ts +0 -12
- package/lib/components/table/src/quick-filter-form.d.ts +0 -42
- package/lib/components/table/src/row-form.d.ts +0 -33
- package/lib/components/table/src/stored-filter-manager.d.ts +0 -55
- package/lib/components/table/src/stored-filter.d.ts +0 -37
- package/lib/components/table/src/table-head-cell.d.ts +0 -9
- package/lib/components/table/src/table.d.ts +0 -497
- package/lib/components/table/src/util.d.ts +0 -77
- package/lib/components/table-column/config.d.ts +0 -5
- package/lib/components/table-column/index.d.ts +0 -2
- package/lib/components/table-column/src/table-column.d.ts +0 -256
- package/lib/components/table-column-date-picker/config.d.ts +0 -5
- package/lib/components/table-column-date-picker/index.d.ts +0 -2
- package/lib/components/table-column-date-picker/src/table-column-date-picker.d.ts +0 -173
- package/lib/components/table-column-file/config.d.ts +0 -5
- package/lib/components/table-column-file/index.d.ts +0 -2
- package/lib/components/table-column-file/src/table-column-file.d.ts +0 -285
- package/lib/components/table-column-img/config.d.ts +0 -5
- package/lib/components/table-column-img/index.d.ts +0 -2
- package/lib/components/table-column-img/src/table-column-img.d.ts +0 -285
- package/lib/components/table-column-input/config.d.ts +0 -5
- package/lib/components/table-column-input/index.d.ts +0 -2
- package/lib/components/table-column-input/src/table-column-input.d.ts +0 -173
- package/lib/components/table-column-number/config.d.ts +0 -5
- package/lib/components/table-column-number/index.d.ts +0 -2
- package/lib/components/table-column-number/src/table-column-number.d.ts +0 -173
- package/lib/components/table-column-object/config.d.ts +0 -5
- package/lib/components/table-column-object/index.d.ts +0 -2
- package/lib/components/table-column-object/src/table-column-object.d.ts +0 -315
- package/lib/components/table-column-select/config.d.ts +0 -5
- package/lib/components/table-column-select/index.d.ts +0 -2
- package/lib/components/table-column-select/src/table-column-select.d.ts +0 -276
- package/lib/components/table-column-switch/config.d.ts +0 -5
- package/lib/components/table-column-switch/index.d.ts +0 -2
- package/lib/components/table-column-switch/src/table-column-switch.d.ts +0 -175
- package/lib/components/table-column-textarea/config.d.ts +0 -5
- package/lib/components/table-column-textarea/index.d.ts +0 -2
- package/lib/components/table-column-textarea/src/table-column-textarea.d.ts +0 -173
- package/lib/components/table-column-time-picker/config.d.ts +0 -5
- package/lib/components/table-column-time-picker/index.d.ts +0 -2
- package/lib/components/table-column-time-picker/src/table-column-time-picker.d.ts +0 -173
- package/lib/components/upload/index.d.ts +0 -2
- package/lib/components/upload/src/fast-upload.d.ts +0 -120
- package/lib/global.d.ts +0 -42
- package/lib/index.d.ts +0 -56
- package/lib/mixins/table-column.d.ts +0 -104
- package/lib/mixins/upload.d.ts +0 -15
- package/lib/model/cond.d.ts +0 -25
- package/lib/model/editComponentConfig.d.ts +0 -25
- package/lib/model/fastTableOption.d.ts +0 -355
- package/lib/model/filterComponentConfig.d.ts +0 -57
- package/lib/model/opt.d.ts +0 -20
- package/lib/model/order.d.ts +0 -7
- package/lib/model/pageQuery.d.ts +0 -23
- package/lib/model/query.d.ts +0 -33
- package/lib/model/rel.d.ts +0 -5
- package/lib/util/cache.d.ts +0 -17
- package/lib/util/dialog.d.ts +0 -49
- package/lib/util/escape.d.ts +0 -7
- package/lib/util/http.d.ts +0 -8
- package/lib/util/pick.d.ts +0 -14
- package/lib/util/util.d.ts +0 -252
- package/packages/assets/fonts/iconfont.css +0 -163
- package/packages/assets/fonts/iconfont.js +0 -1
- package/packages/assets/fonts/iconfont.ttf +0 -0
- package/packages/assets/fonts/iconfont.woff +0 -0
- package/packages/assets/fonts/iconfont.woff2 +0 -0
- package/packages/components/checkbox-group/index.js +0 -7
- package/packages/components/checkbox-group/src/fast-checkbox-group.vue +0 -83
- package/packages/components/content-dialog/index.js +0 -7
- package/packages/components/content-dialog/src/fast-cell-content.vue +0 -115
- package/packages/components/json-viewer/index.js +0 -7
- package/packages/components/json-viewer/src/fast-json-viewer.vue +0 -54
- package/packages/components/mapping.js +0 -95
- package/packages/components/object-picker/index.js +0 -7
- package/packages/components/object-picker/src/fast-object-picker.vue +0 -170
- package/packages/components/select/index.js +0 -7
- package/packages/components/select/src/fast-select.vue +0 -89
- package/packages/components/table/index.js +0 -7
- package/packages/components/table/src/RowConfirm.vue +0 -87
- package/packages/components/table/src/dynamic-filter-form.vue +0 -253
- package/packages/components/table/src/dynamic-filter-list.vue +0 -172
- package/packages/components/table/src/easy-filter.vue +0 -129
- package/packages/components/table/src/export-confirm.vue +0 -55
- package/packages/components/table/src/quick-filter-form.vue +0 -140
- package/packages/components/table/src/row-form.vue +0 -137
- package/packages/components/table/src/stored-filter-manager.vue +0 -240
- package/packages/components/table/src/stored-filter.vue +0 -180
- package/packages/components/table/src/table-head-cell.vue +0 -41
- package/packages/components/table/src/table.vue +0 -1309
- package/packages/components/table/src/util.js +0 -496
- package/packages/components/table-column/config.js +0 -64
- package/packages/components/table-column/index.js +0 -7
- package/packages/components/table-column/src/table-column.vue +0 -44
- package/packages/components/table-column-date-picker/config.js +0 -139
- package/packages/components/table-column-date-picker/index.js +0 -7
- package/packages/components/table-column-date-picker/src/table-column-date-picker.vue +0 -54
- package/packages/components/table-column-file/config.js +0 -83
- package/packages/components/table-column-file/index.js +0 -7
- package/packages/components/table-column-file/src/table-column-file.vue +0 -79
- package/packages/components/table-column-img/config.js +0 -83
- package/packages/components/table-column-img/index.js +0 -7
- package/packages/components/table-column-img/src/table-column-img.vue +0 -82
- package/packages/components/table-column-input/config.js +0 -77
- package/packages/components/table-column-input/index.js +0 -7
- package/packages/components/table-column-input/src/table-column-input.vue +0 -60
- package/packages/components/table-column-number/config.js +0 -89
- package/packages/components/table-column-number/index.js +0 -7
- package/packages/components/table-column-number/src/table-column-number.vue +0 -54
- package/packages/components/table-column-object/config.js +0 -66
- package/packages/components/table-column-object/index.js +0 -7
- package/packages/components/table-column-object/src/table-column-object.vue +0 -75
- package/packages/components/table-column-select/config.js +0 -66
- package/packages/components/table-column-select/index.js +0 -7
- package/packages/components/table-column-select/src/table-column-select.vue +0 -101
- package/packages/components/table-column-switch/config.js +0 -55
- package/packages/components/table-column-switch/index.js +0 -7
- package/packages/components/table-column-switch/src/table-column-switch.vue +0 -82
- package/packages/components/table-column-textarea/config.js +0 -77
- package/packages/components/table-column-textarea/index.js +0 -7
- package/packages/components/table-column-textarea/src/table-column-textarea.vue +0 -56
- package/packages/components/table-column-time-picker/config.js +0 -62
- package/packages/components/table-column-time-picker/index.js +0 -7
- package/packages/components/table-column-time-picker/src/table-column-time-picker.vue +0 -53
- package/packages/components/upload/index.js +0 -7
- package/packages/components/upload/src/fast-upload.vue +0 -272
- package/packages/global.d.ts +0 -42
- package/packages/index.js +0 -145
- package/packages/mixins/table-column.js +0 -133
- package/packages/mixins/upload.js +0 -14
- package/packages/model/cond.js +0 -65
- package/packages/model/editComponentConfig.js +0 -72
- package/packages/model/fastTableOption.js +0 -538
- package/packages/model/filterComponentConfig.js +0 -185
- package/packages/model/opt.js +0 -21
- package/packages/model/order.js +0 -16
- package/packages/model/pageQuery.js +0 -31
- package/packages/model/query.js +0 -93
- package/packages/model/rel.js +0 -5
- package/packages/style.scss +0 -5
- package/packages/util/cache.js +0 -92
- package/packages/util/dialog.js +0 -133
- package/packages/util/escape.js +0 -34
- package/packages/util/http.js +0 -18
- package/packages/util/pick.js +0 -92
- package/packages/util/util.js +0 -833
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="fc-dynamic-filter-form">
|
|
3
|
-
<div class="fc-dynamic-filter-sort-btn">
|
|
4
|
-
<el-radio v-model="asc" label="" border :size="size">不排序</el-radio>
|
|
5
|
-
<el-radio v-model="asc" :label="true" border :size="size">升序</el-radio>
|
|
6
|
-
<el-radio v-model="asc" :label="false" border :size="size">降序</el-radio>
|
|
7
|
-
</div>
|
|
8
|
-
<div class="fc-dynamic-filter-component-wrapper">
|
|
9
|
-
<div class="title">输入过滤:</div>
|
|
10
|
-
<div class="fc-dynamic-filter-component">
|
|
11
|
-
<component :is="localFilter.component" v-model="localFilter.val" v-bind="localFilter.props"/>
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
14
|
-
<div class="fc-dynamic-filter-distinct-wrapper">
|
|
15
|
-
<div class="title">
|
|
16
|
-
<div>
|
|
17
|
-
<span>去重筛选:</span>
|
|
18
|
-
<el-checkbox size="small" type="info" v-model="reuseCond" @change="distinctLoad">复用已生效的条件
|
|
19
|
-
</el-checkbox>
|
|
20
|
-
</div>
|
|
21
|
-
<el-button link
|
|
22
|
-
:style="{'color': distinctOptionAsc === '' ? 'gray': '#409EFF', 'padding': 0}"
|
|
23
|
-
:icon="distinctOptionsAscIcon"
|
|
24
|
-
@click="() => distinctOptionAsc = !distinctOptionAsc"
|
|
25
|
-
v-if="distinctLoaded"></el-button>
|
|
26
|
-
</div>
|
|
27
|
-
<!-- 由于distinct查询可能比较慢, 因此由用户点击触发展示 -->
|
|
28
|
-
<div class="fc-dynamic-filter-distinct" v-loading="distinctLoading">
|
|
29
|
-
<!-- distinct 勾选项 -->
|
|
30
|
-
<el-input size="small" v-model="distinctOptionFilterKeyword" :clearable="true" placeholder="输入过滤.."
|
|
31
|
-
v-if="distinctLoaded"></el-input>
|
|
32
|
-
<fast-checkbox-group :options="distinctFilteredOptions" :show-chose-all="false"
|
|
33
|
-
class="fc-dynamic-filter-distinct-options"
|
|
34
|
-
v-model="distinctCheckedValue"
|
|
35
|
-
v-if="distinctLoaded"></fast-checkbox-group>
|
|
36
|
-
<div style="display: flex; justify-content: center;" v-if="!distinctLoaded">
|
|
37
|
-
<el-button link style="color: gray;" @click="distinctLoad">请点击加载</el-button>
|
|
38
|
-
</div>
|
|
39
|
-
<el-empty v-if="distinctLoaded && distinctOptions.length === 0">
|
|
40
|
-
<template #image><span></span></template>
|
|
41
|
-
</el-empty>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
<div class="fc-dynamic-filter-form-btn">
|
|
45
|
-
<el-button :size="size" @click="getEmpty">查空值</el-button>
|
|
46
|
-
<el-button :size="size" @click="getNotEmpty">查非空值</el-button>
|
|
47
|
-
<span style="flex: 1;"></span>
|
|
48
|
-
<el-button type="primary" :size="size" @click="ok">确认</el-button>
|
|
49
|
-
<el-button :size="size" @click="close">关闭</el-button>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
</template>
|
|
53
|
-
|
|
54
|
-
<script>
|
|
55
|
-
import FastTableOption from '../../../model/fastTableOption.js'
|
|
56
|
-
import FilterComponentConfig from '../../../model/filterComponentConfig.js'
|
|
57
|
-
import Query from '../../../model/query.js'
|
|
58
|
-
import Opt from '../../../model/opt.js'
|
|
59
|
-
import {escapeValToLabel} from "../../../util/escape.js"
|
|
60
|
-
import {isEmpty, isObject, toStr} from "../../../util/util"
|
|
61
|
-
import FastCheckboxGroup from "../../checkbox-group/src/fast-checkbox-group.vue"
|
|
62
|
-
import {Sort, SortUp, SortDown} from "@element-plus/icons-vue"
|
|
63
|
-
|
|
64
|
-
export default {
|
|
65
|
-
name: "dynamic-filter-form",
|
|
66
|
-
components: {FastCheckboxGroup},
|
|
67
|
-
emits: ['ok', 'cancel'],
|
|
68
|
-
props: {
|
|
69
|
-
option: FastTableOption,
|
|
70
|
-
filter: FilterComponentConfig,
|
|
71
|
-
order: [String],
|
|
72
|
-
conds: {
|
|
73
|
-
type: Array,
|
|
74
|
-
default: () => []
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
mounted() {
|
|
78
|
-
console.log(this.localFilter)
|
|
79
|
-
},
|
|
80
|
-
computed: {
|
|
81
|
-
size() {
|
|
82
|
-
return this.option.style.size
|
|
83
|
-
},
|
|
84
|
-
distinctOptionsAscIcon() {
|
|
85
|
-
return this.distinctOptionAsc === '' ? Sort : (this.distinctOptionAsc === true ? SortUp : SortDown)
|
|
86
|
-
},
|
|
87
|
-
distinctFilteredOptions() {
|
|
88
|
-
const {distinctOptionFilterKeyword, distinctOptionAsc} = this
|
|
89
|
-
return this.distinctOptions.filter(item => isEmpty(distinctOptionFilterKeyword) || toStr(item.label).indexOf(distinctOptionFilterKeyword) !== -1)
|
|
90
|
-
.sort((a, b) => {
|
|
91
|
-
const label1 = toStr(a.label), label2 = toStr(b.label);
|
|
92
|
-
return distinctOptionAsc ? label1.localeCompare(label2) : label2.localeCompare(label1)
|
|
93
|
-
})
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
data() {
|
|
97
|
-
const localFilter = new FilterComponentConfig({...this.filter})
|
|
98
|
-
return {
|
|
99
|
-
localFilter: localFilter,
|
|
100
|
-
asc: this.order === 'asc' ? true : (this.order === 'desc' ? false : ''),
|
|
101
|
-
reuseCond: true, // 复用已生效的条件
|
|
102
|
-
distinctLoaded: false, // 是否distinct query loaded
|
|
103
|
-
distinctLoading: false, // 是否distinct query loading中
|
|
104
|
-
distinctOptions: [], // 检索出的distinct选项
|
|
105
|
-
distinctOptionAsc: '', // distinct选项排序, 默认不排序
|
|
106
|
-
distinctOptionFilterKeyword: null, // distinct选项过滤关键词
|
|
107
|
-
distinctCheckedValue: [], // 勾选的distinct值
|
|
108
|
-
distinctAbortCtrl: null // distinct请求终止控制器
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
methods: {
|
|
112
|
-
distinctLoad() {
|
|
113
|
-
this.distinctLoading = true;
|
|
114
|
-
this.distinctAbortCtrl = new AbortController();
|
|
115
|
-
const {col, component, props} = this.localFilter;
|
|
116
|
-
|
|
117
|
-
const distinctQuery = new Query().setDistinct().setCols([col]);
|
|
118
|
-
if (this.reuseCond) {
|
|
119
|
-
distinctQuery.setConds(this.conds);
|
|
120
|
-
}
|
|
121
|
-
this.option._list(distinctQuery, {signal: this.distinctAbortCtrl.signal}).then((res) => {
|
|
122
|
-
if (res.length > 1000) { // 为防止页面卡死, 最多显示1000个
|
|
123
|
-
res.splice(1001);
|
|
124
|
-
}
|
|
125
|
-
const distinctValues = res.filter(item => isObject(item) && item.hasOwnProperty(col)).map(item => item[col])
|
|
126
|
-
this.distinctOptions.length = 0 // 清空
|
|
127
|
-
distinctValues.map((v) => {
|
|
128
|
-
escapeValToLabel(component, v, props).then(label => {
|
|
129
|
-
this.distinctOptions.push({
|
|
130
|
-
value: v,
|
|
131
|
-
label: label
|
|
132
|
-
})
|
|
133
|
-
}).catch(err => {
|
|
134
|
-
console.error(err)
|
|
135
|
-
this.distinctOptions.push({
|
|
136
|
-
value: v,
|
|
137
|
-
label: v
|
|
138
|
-
})
|
|
139
|
-
})
|
|
140
|
-
})
|
|
141
|
-
this.distinctLoaded = true;
|
|
142
|
-
}).catch(err => {
|
|
143
|
-
console.error(err)
|
|
144
|
-
}).finally(() => {
|
|
145
|
-
this.distinctLoading = false;
|
|
146
|
-
})
|
|
147
|
-
},
|
|
148
|
-
getEmpty() {
|
|
149
|
-
this.$emit('ok', {
|
|
150
|
-
filter: new FilterComponentConfig({...this.localFilter, opt: Opt.EMPTY}),
|
|
151
|
-
order: {
|
|
152
|
-
col: this.localFilter.col,
|
|
153
|
-
asc: this.asc
|
|
154
|
-
}
|
|
155
|
-
})
|
|
156
|
-
},
|
|
157
|
-
getNotEmpty() {
|
|
158
|
-
this.$emit('ok', {
|
|
159
|
-
filter: new FilterComponentConfig({...this.localFilter, opt: Opt.NEMPTY}),
|
|
160
|
-
order: {
|
|
161
|
-
col: this.localFilter.col,
|
|
162
|
-
asc: this.asc
|
|
163
|
-
}
|
|
164
|
-
})
|
|
165
|
-
},
|
|
166
|
-
ok() {
|
|
167
|
-
let filterConfig;
|
|
168
|
-
if (this.distinctCheckedValue.length > 0) {
|
|
169
|
-
filterConfig = {
|
|
170
|
-
component: 'fast-checkbox-group',
|
|
171
|
-
col: this.localFilter.col,
|
|
172
|
-
label: this.localFilter.label,
|
|
173
|
-
opt: 'in',
|
|
174
|
-
val: this.distinctCheckedValue,
|
|
175
|
-
disabled: false,
|
|
176
|
-
props: {
|
|
177
|
-
options: this.distinctOptions,
|
|
178
|
-
labelKey: 'label',
|
|
179
|
-
valKey: 'value',
|
|
180
|
-
showChoseAll: true
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
} else {
|
|
184
|
-
filterConfig = {...this.localFilter};
|
|
185
|
-
}
|
|
186
|
-
this.$emit('ok', {
|
|
187
|
-
filter: new FilterComponentConfig(filterConfig),
|
|
188
|
-
order: {
|
|
189
|
-
col: this.localFilter.col,
|
|
190
|
-
asc: this.asc
|
|
191
|
-
}
|
|
192
|
-
})
|
|
193
|
-
},
|
|
194
|
-
close() {
|
|
195
|
-
this.$emit('cancel')
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
beforeUnmount() {
|
|
199
|
-
if (this.distinctAbortCtrl) {
|
|
200
|
-
this.distinctAbortCtrl.abort()
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
</script>
|
|
205
|
-
|
|
206
|
-
<style scoped lang="scss">
|
|
207
|
-
.fc-dynamic-filter-form {
|
|
208
|
-
& > * {
|
|
209
|
-
margin-bottom: 10px;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
& .title {
|
|
213
|
-
margin-bottom: 5px;
|
|
214
|
-
font-size: 13px;
|
|
215
|
-
display: flex;
|
|
216
|
-
align-items: center;
|
|
217
|
-
justify-content: space-between;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.fc-dynamic-filter-sort-btn, .fc-dynamic-filter-component {
|
|
221
|
-
display: flex;
|
|
222
|
-
justify-content: space-between;
|
|
223
|
-
|
|
224
|
-
& > * {
|
|
225
|
-
flex: 1;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
.fc-dynamic-filter-component-wrapper {
|
|
230
|
-
margin: 20px 0;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
.fc-dynamic-filter-distinct {
|
|
234
|
-
border: 1px solid #e1e1e1;
|
|
235
|
-
padding: 10px;
|
|
236
|
-
overflow: auto;
|
|
237
|
-
max-height: 300px;
|
|
238
|
-
|
|
239
|
-
.fc-dynamic-filter-distinct-options {
|
|
240
|
-
margin-top: 10px;
|
|
241
|
-
|
|
242
|
-
:deep(.el-checkbox) {
|
|
243
|
-
display: block;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
.fc-dynamic-filter-form-btn {
|
|
249
|
-
display: flex;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
</style>
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="fc-dynamic-filter-list">
|
|
3
|
-
<el-popover v-for="(f, index) in filters" popper-style="max-width: none; width: auto;" :key="f.col + '.' + index">
|
|
4
|
-
<template v-slot:reference>
|
|
5
|
-
<div class="fc-dynamic-filter-btns">
|
|
6
|
-
<el-button link class="fc-dynamic-filter-open-btn" :class="{'strikethrough': f.disabled}">
|
|
7
|
-
{{ ellipsis(f.condMsg, 30) }}
|
|
8
|
-
</el-button>
|
|
9
|
-
<el-button link class="fc-dynamic-filter-del-btn" :icon="Close"
|
|
10
|
-
@click.stop="delConfig(index)"></el-button>
|
|
11
|
-
</div>
|
|
12
|
-
</template>
|
|
13
|
-
<component class="component" :is="f.component" v-model="f.val" v-bind="f.props" :teleported="false" @change="onChange(f)"
|
|
14
|
-
v-if="f.opt !== Opt.NULL && f.opt !== Opt.NNULL && f.opt !== Opt.EMPTY && f.opt !== Opt.NEMPTY"/>
|
|
15
|
-
<div class="fc-dynamic-filter-footer">
|
|
16
|
-
<el-button type="primary" size="small" :icon="Search" @click="confirm">查询</el-button>
|
|
17
|
-
<el-button :type="f.disabled ? 'primary' : 'info'" plain size="small" @click="toggleFilter(f)">
|
|
18
|
-
{{ f.disabled ? '启用' : '禁用' }}
|
|
19
|
-
</el-button>
|
|
20
|
-
</div>
|
|
21
|
-
</el-popover>
|
|
22
|
-
<template v-if="filters.length > 1">
|
|
23
|
-
<el-button class="fc-dynamic-filter-clear-btn" link style="padding: 0; color: #d37c84" @click="clearFilters">
|
|
24
|
-
清空
|
|
25
|
-
</el-button>
|
|
26
|
-
<el-button class="fc-dynamic-filter-clear-btn" type="info" link style="padding: 0;" @click="toggleAllFilters">
|
|
27
|
-
{{ allDisabled ? '全启' : '全禁' }}
|
|
28
|
-
</el-button>
|
|
29
|
-
</template>
|
|
30
|
-
</div>
|
|
31
|
-
</template>
|
|
32
|
-
|
|
33
|
-
<script>
|
|
34
|
-
import Opt from "../../../model/opt.js";
|
|
35
|
-
import {ellipsis} from '../../../util/util'
|
|
36
|
-
import {Close, Search} from "@element-plus/icons-vue"
|
|
37
|
-
|
|
38
|
-
export default {
|
|
39
|
-
name: "dynamic-filter-list",
|
|
40
|
-
emits: ['search'],
|
|
41
|
-
props: {
|
|
42
|
-
filters: {
|
|
43
|
-
type: Array,
|
|
44
|
-
default: () => []
|
|
45
|
-
},
|
|
46
|
-
size: {
|
|
47
|
-
type: String,
|
|
48
|
-
default: () => 'small'
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
computed: {
|
|
52
|
-
Search() {
|
|
53
|
-
return Search
|
|
54
|
-
},
|
|
55
|
-
Close() {
|
|
56
|
-
return Close
|
|
57
|
-
},
|
|
58
|
-
allDisabled() {
|
|
59
|
-
return this.filters.every(f => f.disabled)
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
data() {
|
|
63
|
-
return {
|
|
64
|
-
Opt: Opt
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
watch: {
|
|
68
|
-
'filters' : function (filters) {
|
|
69
|
-
this.$nextTick(() => {
|
|
70
|
-
filters.forEach(f => f.updateCondMsg())
|
|
71
|
-
})
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
methods: {
|
|
75
|
-
ellipsis,
|
|
76
|
-
delConfig(index) {
|
|
77
|
-
this.filters.splice(index, 1)
|
|
78
|
-
this.confirm()
|
|
79
|
-
},
|
|
80
|
-
confirm(/*filter*/) {
|
|
81
|
-
this.$emit('search')
|
|
82
|
-
},
|
|
83
|
-
toggleFilter(filter) {
|
|
84
|
-
filter.disabled = !filter.disabled
|
|
85
|
-
this.confirm()
|
|
86
|
-
},
|
|
87
|
-
clearFilters() {
|
|
88
|
-
this.filters.splice(0, this.filters.length);
|
|
89
|
-
this.confirm()
|
|
90
|
-
},
|
|
91
|
-
toggleAllFilters() {
|
|
92
|
-
const {allDisabled} = this
|
|
93
|
-
this.filters.forEach(f => f.disabled = !allDisabled)
|
|
94
|
-
this.confirm()
|
|
95
|
-
},
|
|
96
|
-
onChange(filter) {
|
|
97
|
-
filter.updateCondMsg()
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
</script>
|
|
102
|
-
|
|
103
|
-
<style scoped lang="scss">
|
|
104
|
-
.fc-dynamic-filter-list {
|
|
105
|
-
display: flex;
|
|
106
|
-
flex-wrap: wrap;
|
|
107
|
-
column-gap: 5px;
|
|
108
|
-
|
|
109
|
-
.fc-dynamic-filter-btns {
|
|
110
|
-
&:hover {
|
|
111
|
-
.fc-dynamic-filter-open-btn {
|
|
112
|
-
text-decoration: underline;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.fc-dynamic-filter-del-btn {
|
|
116
|
-
//display: inline-block;
|
|
117
|
-
visibility: visible;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.strikethrough {
|
|
123
|
-
text-decoration: line-through !important;
|
|
124
|
-
color: #acacac !important;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.fc-dynamic-filter-open-btn {
|
|
128
|
-
color: gray;
|
|
129
|
-
padding: 3px 5px;
|
|
130
|
-
border: 1px solid #cacaca;
|
|
131
|
-
border-radius: 3px;
|
|
132
|
-
font-size: 13px !important;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.fc-dynamic-filter-del-btn {
|
|
136
|
-
visibility: hidden;
|
|
137
|
-
margin-left: 5px;
|
|
138
|
-
padding: 5px 0;
|
|
139
|
-
color: #8d4343;
|
|
140
|
-
font-size: 13px !important;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.fc-dynamic-filter-clear-btn {
|
|
144
|
-
font-size: 13px !important;
|
|
145
|
-
margin-left: 3px;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// 针对distinct后的checkbox调整样式
|
|
150
|
-
.component.fc-fast-checkbox-group {
|
|
151
|
-
margin: 10px 0;
|
|
152
|
-
max-width: 420px;
|
|
153
|
-
max-height: 300px;
|
|
154
|
-
overflow: auto;
|
|
155
|
-
|
|
156
|
-
:deep(.fc-checkbox-group) {
|
|
157
|
-
display: block;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
:deep(.fc-checkbox-group .el-checkbox) {
|
|
161
|
-
display: block;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.fc-dynamic-filter-footer {
|
|
167
|
-
display: flex;
|
|
168
|
-
justify-content: center;
|
|
169
|
-
margin-top: 10px;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
</style>
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="fc-easy-filter">
|
|
3
|
-
<template v-if="activeFilter">
|
|
4
|
-
<fast-select class="fc-easy-filter-column" :options="filters" v-model="activeFilterCol" label-key="label"
|
|
5
|
-
val-key="col"
|
|
6
|
-
:size="size"
|
|
7
|
-
:filterable="true"
|
|
8
|
-
@change="changeField"/>
|
|
9
|
-
<component ref="easyFilterComp" class="fc-easy-filter-value" :is="activeFilter.component"
|
|
10
|
-
v-model="activeFilter.val"
|
|
11
|
-
v-bind="activeFilter.props"
|
|
12
|
-
:size="size"
|
|
13
|
-
@clear="handleClear"
|
|
14
|
-
@keydown.enter="handleEnter"/>
|
|
15
|
-
</template>
|
|
16
|
-
</div>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<script>
|
|
20
|
-
import {nextTick} from "vue";
|
|
21
|
-
import FastSelect from "../../select/src/fast-select.vue";
|
|
22
|
-
import {RefreshLeft, Search} from "@element-plus/icons-vue";
|
|
23
|
-
import {isEmpty, isFunction, isUndefined} from "../../../util/util.js";
|
|
24
|
-
|
|
25
|
-
export default {
|
|
26
|
-
name: "easy-filter",
|
|
27
|
-
components: {FastSelect},
|
|
28
|
-
emits: ['search'],
|
|
29
|
-
props: {
|
|
30
|
-
filters: {
|
|
31
|
-
type: Array,
|
|
32
|
-
default: () => []
|
|
33
|
-
},
|
|
34
|
-
size: {
|
|
35
|
-
type: String,
|
|
36
|
-
default: () => 'small'
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
computed: {
|
|
40
|
-
RefreshLeft() {
|
|
41
|
-
return RefreshLeft
|
|
42
|
-
},
|
|
43
|
-
Search() {
|
|
44
|
-
return Search
|
|
45
|
-
},
|
|
46
|
-
activeFilter() {
|
|
47
|
-
if (this.filters.length === 0 || isEmpty(this.activeFilterCol)) {
|
|
48
|
-
return null
|
|
49
|
-
}
|
|
50
|
-
const activeFilter = this.filters.find(filter => filter.col === this.activeFilterCol)
|
|
51
|
-
activeFilter.disabled = false // 启用此列
|
|
52
|
-
return activeFilter
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
data() {
|
|
56
|
-
return {
|
|
57
|
-
activeFilterCol: null
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
created() {
|
|
61
|
-
this.initActiveFilterCol()
|
|
62
|
-
},
|
|
63
|
-
mounted() {
|
|
64
|
-
this.$nextTick(() => {
|
|
65
|
-
if (this.$refs.easyFilterComp && isFunction(this.$refs.easyFilterComp.focus)) {
|
|
66
|
-
setTimeout(() => {
|
|
67
|
-
this.$refs.easyFilterComp.focus()
|
|
68
|
-
}, 50) // 如果当前FastTable在ElDialog中,会因为visible之后的动画二导致渲染会稍晚一点, 只nextTick不够,这里稍等会会
|
|
69
|
-
}
|
|
70
|
-
})
|
|
71
|
-
},
|
|
72
|
-
watch: {
|
|
73
|
-
'filters.length': function () {
|
|
74
|
-
this.initActiveFilterCol()
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
methods: {
|
|
78
|
-
initActiveFilterCol() {
|
|
79
|
-
if (!isEmpty(this.filters)) {
|
|
80
|
-
const activeFilter = this.filters.find(f => f.disabled === false)
|
|
81
|
-
this.activeFilterCol = isUndefined(activeFilter) ? this.filters[0].col : activeFilter.col
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
changeField() {
|
|
85
|
-
this.filters.map(filter => {
|
|
86
|
-
filter.disabled = (filter.col !== this.activeFilterCol) // 保证只有activeFilter生效, 这样就不用清理切换之前的控件值了,使用体验更好
|
|
87
|
-
})
|
|
88
|
-
},
|
|
89
|
-
handleClear() {
|
|
90
|
-
nextTick(() => {
|
|
91
|
-
this.$emit('search')
|
|
92
|
-
})
|
|
93
|
-
},
|
|
94
|
-
handleEnter() {
|
|
95
|
-
nextTick(() => {
|
|
96
|
-
this.$emit('search')
|
|
97
|
-
})
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
</script>
|
|
102
|
-
|
|
103
|
-
<style scoped lang="scss">
|
|
104
|
-
.fc-easy-filter {
|
|
105
|
-
display: flex;
|
|
106
|
-
|
|
107
|
-
.fc-easy-filter-column {
|
|
108
|
-
width: 100px;
|
|
109
|
-
|
|
110
|
-
:deep(.el-select__wrapper),
|
|
111
|
-
:deep(.el-input__wrapper) {
|
|
112
|
-
box-shadow: inset 0 1px 0 0 #DCDFE6, inset 0 -1px 0 0 #DCDFE6, inset 1px 0 0 0 #DCDFE6; // 阴影模拟边框, 无"右边框"
|
|
113
|
-
border-top-right-radius: 0;
|
|
114
|
-
border-bottom-right-radius: 0;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.fc-easy-filter-value {
|
|
119
|
-
width: 280px;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.fc-easy-filter-value :deep(.el-input__wrapper),
|
|
123
|
-
:deep(.fc-easy-filter-value.el-input__wrapper),
|
|
124
|
-
:deep(.fc-easy-filter-value .el-select__wrapper) {
|
|
125
|
-
border-top-left-radius: 0 !important;
|
|
126
|
-
border-bottom-left-radius: 0 !important;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
</style>
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="export-confirm">
|
|
3
|
-
<el-table :data="columns">
|
|
4
|
-
<!-- <el-table-column prop="col" label="字段"/>-->
|
|
5
|
-
<el-table-column prop="label" label="标题行">
|
|
6
|
-
<template #default="{row}">
|
|
7
|
-
<el-input v-model="row.label" size="default" placeholder="请输入名称"></el-input>
|
|
8
|
-
</template>
|
|
9
|
-
</el-table-column>
|
|
10
|
-
<el-table-column prop="exportable" label="是否导出">
|
|
11
|
-
<template #default="{row}">
|
|
12
|
-
<el-switch v-model="row.exportable"></el-switch>
|
|
13
|
-
</template>
|
|
14
|
-
</el-table-column>
|
|
15
|
-
</el-table>
|
|
16
|
-
<div class="footer">
|
|
17
|
-
<span class="flex"></span>
|
|
18
|
-
<el-button :icon="Download" size="default" type="primary" plain @click="exportData(false)">导出当前页</el-button>
|
|
19
|
-
<el-button :icon="Download" size="default" type="primary" @click="exportData(true)">导出全部</el-button>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
</template>
|
|
23
|
-
|
|
24
|
-
<script>
|
|
25
|
-
import {Download} from "@element-plus/icons-vue";
|
|
26
|
-
|
|
27
|
-
export default {
|
|
28
|
-
name: "export-confirm",
|
|
29
|
-
computed: {
|
|
30
|
-
Download() {
|
|
31
|
-
return Download
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
emits: ['ok'],
|
|
35
|
-
props: {
|
|
36
|
-
columns: Array
|
|
37
|
-
},
|
|
38
|
-
methods: {
|
|
39
|
-
exportData(all) {
|
|
40
|
-
this.$emit('ok', { columns: this.columns, all: all })
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
</script>
|
|
45
|
-
|
|
46
|
-
<style scoped lang="scss">
|
|
47
|
-
.footer {
|
|
48
|
-
display: flex;
|
|
49
|
-
margin-top: 10px;
|
|
50
|
-
|
|
51
|
-
.flex {
|
|
52
|
-
flex: 1;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
</style>
|