evui 2.1.0 → 2.1.3
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/dist/{adac9fa4f723f9d2cb5b6640517114a9.png → 0b8d1200e71cae8d747dce4e69c4efb6.png} +0 -0
- package/dist/1.css +4 -0
- package/dist/1.css.map +1 -0
- package/dist/1.evui.min.js +2 -0
- package/dist/1.evui.min.js.map +1 -0
- package/dist/1ba679c05036b34bf359aa2e6c450faa.ttf +0 -0
- package/dist/2.css +4 -0
- package/dist/2.css.map +1 -0
- package/dist/2.evui.min.js +2 -0
- package/dist/2.evui.min.js.map +1 -0
- package/dist/{e8c322de9658cbeb8a774b6624167c2c.woff2 → 278156e41e0ad908cf7f841b17130502.woff2} +0 -0
- package/dist/3.evui.min.js +2 -0
- package/dist/3.evui.min.js.map +1 -0
- package/dist/32be89b11725274cd3e801192ba88361.ttf +0 -0
- package/dist/{0ab54153eeeca0ce03978cc463b257f7.woff2 → 38c6d8bab26db77d8c806813e1497763.woff2} +0 -0
- package/dist/4.evui.min.js +2 -0
- package/dist/4.evui.min.js.map +1 -0
- package/dist/{faff92145777a3cbaf8e7367b4807987.woff → 425399f81e4ce7cbd967685402ba0260.woff} +0 -0
- package/dist/4730076470a665bbc7b783c56d29a72e.svg +261 -0
- package/dist/52e9a7f6ff3af5ad261e5292d07ebdca.eot +0 -0
- package/dist/{ad97afd3337e8cda302d10ff5a4026b8.ttf → 5367103510b27b78482794590e1ce3b0.ttf} +0 -0
- package/dist/{65363c4d55617bbeb57d8ce6dcd46099.svg → 57e963e3d6dd0a9cf05150b40eebf69b.svg} +0 -0
- package/dist/{c5ebe0b32dc1b5cc449a76c4204d13bb.ttf → 65a2fb6d9aaa164b41a039302093995b.ttf} +0 -0
- package/dist/{cd6c777f1945164224dee082abaea03a.woff2 → 687a4990ea22bb1a49d469a5d9319790.woff2} +0 -0
- package/dist/{7583da5c07275cd5eb364507616f998f.ttf → 6c1d906bf5ba48676f65b2d65e935e1a.ttf} +0 -0
- package/dist/6dafca5a4f1e31f2bdf11939b24ff422.ttf +0 -0
- package/dist/{701ae6abd4719e9c2ada3535a497b341.eot → 752905fa5edf21fc52a10a0c1ca9c7a4.eot} +0 -0
- package/dist/76c05d80dda67cdc5d03f345b7bd063f.ttf +0 -0
- package/dist/{b551b554a67e86a840bc80cbb8066c30.svg → 7d62eb50e7bb05eedb2a4656f7fe8f3b.svg} +0 -0
- package/dist/{8e3c7f5520f5ae906c6cf6d7f3ddcd19.eot → a01e3f2d6c83dc3aee175e2482b3f777.eot} +0 -0
- package/dist/{448f2aaa315fa9dce7b2cf6ce31caed6.svg → b30fd8419d7e6d5918856c7531d33482.svg} +0 -0
- package/dist/c57dd55fa982e8940f69ca1d69a8a999.woff +0 -0
- package/dist/{b87b9ba532ace76ae9f6edfe9f72ded2.ttf → c656b8caa454ed19b9a2ef7f4f5b8fea.ttf} +0 -0
- package/dist/{a046592bac8f2fd96e994733faf3858c.woff → cac87dc00c87a5d74711d0276713808a.woff} +0 -0
- package/dist/{13db00b7a34fee4d819ab7f9838cc428.eot → d68fa3e67dbb653a13cec44b1bcabcfe.eot} +0 -0
- package/dist/{ef60a4f6c25ef7f39f2d25a748dbecfe.woff → ddae9b1ba9b0b42f58809904b0b21349.woff} +0 -0
- package/dist/evui.min.js +6 -86054
- package/dist/evui.min.js.gz +0 -0
- package/dist/evui.min.js.map +1 -1
- package/dist/main.css +43 -5541
- package/dist/main.css.gz +0 -0
- package/dist/main.css.map +1 -1
- package/package.json +56 -76
- package/src/common/emitter.js +20 -0
- package/src/common/utils.debounce.js +223 -0
- package/src/common/utils.js +51 -17
- package/src/common/utils.throttle.js +83 -0
- package/src/common/utils.tree.js +18 -0
- package/src/components/button/button.vue +317 -241
- package/src/components/chart/chart.core.js +378 -85
- package/src/components/chart/chart.vue +133 -115
- package/src/components/chart/element/element.bar.js +219 -25
- package/src/components/chart/element/element.bar.time.js +115 -0
- package/src/components/chart/element/element.line.js +172 -21
- package/src/components/chart/element/element.pie.js +86 -0
- package/src/components/chart/element/element.scatter.js +9 -2
- package/src/components/chart/element/element.tip.js +356 -0
- package/src/components/chart/helpers/helpers.canvas.js +94 -0
- package/src/components/chart/helpers/helpers.constant.js +25 -6
- package/src/components/chart/helpers/helpers.util.js +83 -38
- package/src/components/chart/index.js +0 -1
- package/src/components/chart/model/model.series.js +43 -14
- package/src/components/chart/model/model.store.js +440 -46
- package/src/components/chart/plugins/plugins.interaction.js +324 -0
- package/src/components/chart/plugins/plugins.legend.js +233 -91
- package/src/components/chart/plugins/plugins.pie.js +179 -0
- package/src/components/chart/plugins/plugins.title.js +25 -2
- package/src/components/chart/plugins/plugins.tooltip.js +384 -0
- package/src/components/chart/scale/scale.js +91 -29
- package/src/components/chart/scale/scale.linear.js +12 -0
- package/src/components/chart/scale/scale.logarithmic.js +25 -0
- package/src/components/chart/scale/scale.step.js +89 -52
- package/src/components/chart/scale/scale.time.category.js +204 -0
- package/src/components/chart/scale/scale.time.js +19 -1
- package/src/components/checkbox/checkbox-group.vue +15 -11
- package/src/components/checkbox/checkbox.vue +210 -138
- package/src/components/codeview/code.vue +42 -29
- package/src/components/contextmenu/contextmenu.child.vue +79 -0
- package/src/components/contextmenu/contextmenu.vue +276 -0
- package/src/components/contextmenu/contextmenu.wrap.vue +189 -0
- package/src/components/contextmenu/index.js +3 -0
- package/src/components/datepicker/calendar.core.js +588 -492
- package/src/components/datepicker/calendar.vue +0 -3
- package/src/components/datepicker/datepicker.vue +43 -15
- package/src/components/datepicker/index.js +5 -1
- package/src/components/grid/grid.filter.vue +290 -0
- package/src/components/grid/grid.filter.window.vue +411 -0
- package/src/components/grid/grid.render.vue +45 -0
- package/src/components/grid/grid.vue +1338 -0
- package/src/components/icon/icon.vue +23 -7
- package/src/components/input/input.number.vue +309 -277
- package/src/components/label/label.vue +2 -2
- package/src/components/loadingmask/loadingmask.vue +6 -13
- package/src/components/loginfield/loginfield.vue +46 -37
- package/src/components/markdown/index.js +3 -0
- package/src/components/markdown/markdown.vue +1001 -0
- package/src/components/menu/index.js +1 -3
- package/src/components/menu/menu.nav.item.vue +115 -0
- package/src/components/menu/menu.nav.sub.vue +42 -0
- package/src/components/menu/menu.nav.vue +71 -98
- package/src/components/message/index.js +3 -0
- package/src/components/message/message.js +63 -0
- package/src/components/message/message.vue +191 -0
- package/src/components/message-box/index.js +7 -0
- package/src/components/message-box/message-box.js +32 -0
- package/src/components/message-box/message-box.vue +291 -0
- package/src/components/notification/index.js +3 -0
- package/src/components/notification/notification.js +75 -0
- package/src/components/notification/notification.vue +242 -0
- package/src/components/radio/radio-group.vue +6 -2
- package/src/components/radio/radio.vue +156 -76
- package/src/components/selectbox/dropdown.vue +86 -40
- package/src/components/selectbox/listbox.vue +47 -18
- package/src/components/selectbox/option.vue +1 -1
- package/src/components/selectbox/selectbox.vue +304 -316
- package/src/components/slider/slider-tooltip.vue +7 -7
- package/src/components/slider/slider.vue +20 -25
- package/src/components/splitter/splitter.vue +104 -94
- package/src/components/table/table.black.css +1 -1
- package/src/components/table/table.filter.lite.vue +7 -7
- package/src/components/table/table.filter.vue +1 -1
- package/src/components/table/table.grey.css +5 -6
- package/src/components/table/table.navy.css +1 -1
- package/src/components/table/table.vue +55 -48
- package/src/components/tabs/tab-panel.vue +19 -5
- package/src/components/tabs/tabs.vue +182 -87
- package/src/components/textfield/textfield.vue +110 -87
- package/src/components/timepicker/index.js +2 -2
- package/src/components/timepicker/spinner.vue +15 -17
- package/src/components/timepicker/timepicker.vue +98 -53
- package/src/components/toggle/toggle.vue +148 -109
- package/src/components/tree/index.js +2 -6
- package/src/components/tree/render.js +17 -0
- package/src/components/tree/tree-node.vue +214 -0
- package/src/components/tree/tree.vue +296 -0
- package/src/components/tree-table/index.js +7 -0
- package/src/components/{tree → tree-table}/tree.table.black.css +0 -0
- package/src/components/{tree → tree-table}/tree.table.grey.css +0 -0
- package/src/components/{tree → tree-table}/tree.table.vue +36 -41
- package/src/components/{tree → tree-table}/tree.util.js +0 -0
- package/src/components/window/window.vue +238 -191
- package/src/index.js +28 -12
- package/src/styles/base/base.scss +50 -0
- package/src/styles/base/index.scss +1 -0
- package/src/styles/default.scss +5 -0
- package/src/styles/{codemirror.css → lib/codemirror.css} +0 -0
- package/src/styles/{all.css → lib/fontawesome.css} +1 -1
- package/src/styles/lib/icon.css +792 -0
- package/src/styles/themes/index.scss +2 -0
- package/src/styles/themes/mixin.scss +33 -0
- package/src/styles/themes/variables.scss +206 -0
- package/src/styles/utils/colors.scss +222 -0
- package/src/styles/utils/index.scss +2 -0
- package/src/styles/utils/mixins.scss +34 -0
- package/src/styles/utils/variables.scss +27 -0
- package/src/webfonts/EVUI.eot +0 -0
- package/src/webfonts/EVUI.svg +251 -173
- package/src/webfonts/EVUI.ttf +0 -0
- package/src/webfonts/EVUI.woff +0 -0
- package/src/webfonts/Roboto-Bold.ttf +0 -0
- package/src/webfonts/Roboto-Medium.ttf +0 -0
- package/src/webfonts/Roboto-Regular.ttf +0 -0
- package/dist/3c9453211570a4ede66a4b4954a32bbb.ttf +0 -0
- package/dist/8634884f932627fc43782e6963b64ccd.svg +0 -183
- package/dist/b9e64d9b5fa6b500eb5df6fa980d3e5b.eot +0 -0
- package/dist/f0ac0c8b3c9cd3ef9002749985ae546f.woff +0 -0
- package/src/components/chart/charts/chart.bar.js +0 -334
- package/src/components/chart/charts/chart.base.js +0 -1075
- package/src/components/chart/charts/chart.line.js +0 -262
- package/src/components/chart/charts/chart.pie.js +0 -383
- package/src/components/chart/charts/chart.scatter.js +0 -349
- package/src/components/chart/charts/chart.sunburst.js +0 -193
- package/src/components/chart/core/axis/axis.js +0 -217
- package/src/components/chart/core/axis/axis.scale.auto.js +0 -69
- package/src/components/chart/core/axis/axis.scale.fixed.js +0 -65
- package/src/components/chart/core/axis/axis.scale.steps.js +0 -149
- package/src/components/chart/core/core.constant.js +0 -116
- package/src/components/chart/core/core.legend.js +0 -473
- package/src/components/chart/core/core.util.js +0 -66
- package/src/components/chart/core/data/data.js +0 -412
- package/src/components/chart/core/data/data.pie.js +0 -70
- package/src/components/chart/core/data/data.stack.js +0 -222
- package/src/components/chart/core/data/data.sunburst.js +0 -172
- package/src/components/menu/menu.context.children.vue +0 -201
- package/src/components/menu/menu.context.vue +0 -144
- package/src/components/tabs/jun/tab.vue +0 -123
- package/src/components/tabs/jun/tabs.vue +0 -484
- package/src/styles/evui.css +0 -386
- package/src/styles/icon.css +0 -557
|
@@ -23,15 +23,12 @@
|
|
|
23
23
|
</template>
|
|
24
24
|
|
|
25
25
|
<script>
|
|
26
|
-
import Calendar from '@/components/datepicker/calendar.core';
|
|
27
26
|
import moment from 'moment';
|
|
27
|
+
import Calendar from '@/components/datepicker/calendar.core';
|
|
28
28
|
|
|
29
|
-
const prefixCls = '
|
|
29
|
+
const prefixCls = 'ev-input-text';
|
|
30
30
|
|
|
31
31
|
export default {
|
|
32
|
-
components: {
|
|
33
|
-
moment,
|
|
34
|
-
},
|
|
35
32
|
directives: {
|
|
36
33
|
// 해당 element 외의 클릭 시
|
|
37
34
|
'click-outside': {
|
|
@@ -87,6 +84,7 @@
|
|
|
87
84
|
return {
|
|
88
85
|
localeType: 'YYYY-MM-DD',
|
|
89
86
|
initSelectDay: this.value ? new Date(moment(this.value)) : new Date(),
|
|
87
|
+
theme: 'light',
|
|
90
88
|
};
|
|
91
89
|
},
|
|
92
90
|
},
|
|
@@ -103,6 +101,7 @@
|
|
|
103
101
|
inputTextMaxLength: 10, // default: YYYY-MM-DD
|
|
104
102
|
inputNumberMaxLength: 8, // default: YYYYMMDD
|
|
105
103
|
cursorPosition: 0,
|
|
104
|
+
onceSetDateTime: true,
|
|
106
105
|
};
|
|
107
106
|
},
|
|
108
107
|
computed: {
|
|
@@ -127,6 +126,7 @@
|
|
|
127
126
|
// localeType이 없는 경우 YYYY-MM-DD가 default
|
|
128
127
|
localeType: this.options.localeType
|
|
129
128
|
? this.options.localeType : 'YYYY-MM-DD',
|
|
129
|
+
theme: this.options.theme,
|
|
130
130
|
});
|
|
131
131
|
},
|
|
132
132
|
computedValue() {
|
|
@@ -179,6 +179,7 @@
|
|
|
179
179
|
}
|
|
180
180
|
let preText = '';
|
|
181
181
|
let postText = '';
|
|
182
|
+
// 8칸보다 오버해서 숫자를 입력하는 경우
|
|
182
183
|
if (numberValueLength > vm.inputNumberMaxLength) {
|
|
183
184
|
// 인풋박스 마지막에 글씨 쓰는 경우
|
|
184
185
|
if (numberValueLength - vm.inputNumberMaxLength === 1) {
|
|
@@ -197,12 +198,13 @@
|
|
|
197
198
|
// '-', ' ', ':' 특수문자 전에 값을 입력하면 +1칸 커서 왼쪽 자동이동 후 값이 변환됨
|
|
198
199
|
beforeSpecialSymbolTerm = 1;
|
|
199
200
|
}
|
|
200
|
-
preText = numberValue.slice(0, numberValueCursor);
|
|
201
|
+
preText = numberValue.slice(0, numberValueCursor + beforeSpecialSymbolTerm);
|
|
201
202
|
postText = numberValue.slice(numberValueCursor + beforeSpecialSymbolTerm + 1,
|
|
202
203
|
numberValueLength);
|
|
203
204
|
setValue = vm.addSpecialSymbols(vm.validNumber(preText + postText));
|
|
204
205
|
vm.calendar.setDateTime(moment(setValue, vm.options.localeType));
|
|
205
206
|
vm.$refs.datepickerText.value = setValue;
|
|
207
|
+
vm.dataValue = setValue;
|
|
206
208
|
vm.$refs.datepickerText.selectionStart = (currCursor + afterSpecialSymbolTerm)
|
|
207
209
|
+ beforeSpecialSymbolTerm;
|
|
208
210
|
vm.$refs.datepickerText.selectionEnd = (currCursor + afterSpecialSymbolTerm)
|
|
@@ -213,14 +215,18 @@
|
|
|
213
215
|
postText = numberValue.slice(numberValueCursor + 1, numberValueLength);
|
|
214
216
|
setValue = vm.addSpecialSymbols(vm.validNumber(preText + postText));
|
|
215
217
|
vm.$refs.datepickerText.value = setValue;
|
|
218
|
+
vm.dataValue = setValue;
|
|
216
219
|
vm.$refs.datepickerText.selectionStart = currCursor;
|
|
217
220
|
vm.$refs.datepickerText.selectionEnd = currCursor;
|
|
218
221
|
}
|
|
219
222
|
}
|
|
220
223
|
} else {
|
|
221
|
-
//
|
|
224
|
+
// 숫자 입력 값이 max이거나 그보다 작은 경우
|
|
222
225
|
setValue = vm.addSpecialSymbols(vm.validNumber(targetValue));
|
|
223
226
|
vm.$refs.datepickerText.value = setValue;
|
|
227
|
+
if (numberValueLength === vm.inputNumberMaxLength) {
|
|
228
|
+
vm.dataValue = setValue;
|
|
229
|
+
}
|
|
224
230
|
vm.$refs.datepickerText.selectionStart = currCursor;
|
|
225
231
|
vm.$refs.datepickerText.selectionEnd = currCursor;
|
|
226
232
|
let specialSymbolTerm = 0;
|
|
@@ -238,12 +244,20 @@
|
|
|
238
244
|
if (numberValueLength > 3 && numberValueLength !== 5 && numberValueLength !== 7) {
|
|
239
245
|
vm.calendar.setDateTime(moment(setValue, vm.options.localeType));
|
|
240
246
|
}
|
|
247
|
+
if (!numberValueLength) {
|
|
248
|
+
vm.calendar.setDateTime(null);
|
|
249
|
+
vm.dataValue = null;
|
|
250
|
+
}
|
|
241
251
|
}
|
|
242
252
|
},
|
|
243
253
|
});
|
|
244
254
|
},
|
|
245
255
|
},
|
|
246
256
|
watch: {
|
|
257
|
+
value(v) {
|
|
258
|
+
this.calendar.setDateTime(moment(v));
|
|
259
|
+
this.dataValue = v;
|
|
260
|
+
},
|
|
247
261
|
computedValue(v) {
|
|
248
262
|
this.$emit('input', v);
|
|
249
263
|
},
|
|
@@ -259,6 +273,7 @@
|
|
|
259
273
|
this.inputNumberMaxLength = this.removeSpecialSymbols(this.options.localeType).length;
|
|
260
274
|
},
|
|
261
275
|
beforeDestroy() {
|
|
276
|
+
this.calendar.removeListeners();
|
|
262
277
|
this.calendar.removeDropdown();
|
|
263
278
|
},
|
|
264
279
|
methods: {
|
|
@@ -591,29 +606,42 @@
|
|
|
591
606
|
};
|
|
592
607
|
</script>
|
|
593
608
|
|
|
594
|
-
<style
|
|
609
|
+
<style lang="scss">
|
|
610
|
+
@import '~@/styles/default';
|
|
611
|
+
|
|
595
612
|
.ev-datepicker {
|
|
596
613
|
width: 235px;
|
|
614
|
+
|
|
615
|
+
@include evThemify() {
|
|
616
|
+
color: evThemed('font-color-base');
|
|
617
|
+
}
|
|
597
618
|
}
|
|
619
|
+
|
|
598
620
|
.ev-datepicker-input-wrapper {
|
|
599
|
-
width:
|
|
621
|
+
width: 100%;
|
|
600
622
|
height: 32px;
|
|
601
623
|
}
|
|
624
|
+
|
|
602
625
|
.ev-datepicker-input {
|
|
603
|
-
width:
|
|
626
|
+
width: 100%;
|
|
604
627
|
height: 32px;
|
|
605
628
|
line-height: 32px;
|
|
606
|
-
border:
|
|
607
|
-
border-radius: 4px;
|
|
608
|
-
color: #606266;
|
|
629
|
+
border-radius: $border-radius-base;
|
|
609
630
|
padding: 0 5px 0 5px;
|
|
631
|
+
background-color: transparent;
|
|
632
|
+
|
|
633
|
+
@include evThemify() {
|
|
634
|
+
color: evThemed('font-color-base');
|
|
635
|
+
border: $border-solid evThemed('datepicker-input-border');
|
|
636
|
+
}
|
|
610
637
|
}
|
|
638
|
+
|
|
611
639
|
.fit10,
|
|
612
640
|
.fit13,
|
|
613
641
|
.fit16,
|
|
614
642
|
.fit19 {
|
|
615
|
-
height:
|
|
616
|
-
line-height:
|
|
643
|
+
height: 25px;
|
|
644
|
+
line-height: 25px;
|
|
617
645
|
}
|
|
618
646
|
.fit10 {
|
|
619
647
|
width: 85px;
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-click-outside="onHide"
|
|
4
|
+
:style="`top: ${value.top || 0}px; left: ${value.left || 0}px;`"
|
|
5
|
+
class="evui-table-filter"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
class="evui-table-filter-row"
|
|
9
|
+
@mouseover.stop="showFilterCondition = false"
|
|
10
|
+
@click="$emit('sort', value.field)"
|
|
11
|
+
>
|
|
12
|
+
<ev-icon
|
|
13
|
+
:cls="'sort-icon ei-s ei-descending'"
|
|
14
|
+
/>
|
|
15
|
+
<span>Sort By Descending</span>
|
|
16
|
+
</div>
|
|
17
|
+
<div
|
|
18
|
+
class="evui-table-filter-row"
|
|
19
|
+
@mouseover.stop="showFilterCondition = false"
|
|
20
|
+
@click="$emit('sort', value.field)"
|
|
21
|
+
>
|
|
22
|
+
<ev-icon
|
|
23
|
+
:cls="'sort-icon ei-s ei-ascending'"
|
|
24
|
+
/>
|
|
25
|
+
<span>Sort By Ascending</span>
|
|
26
|
+
</div>
|
|
27
|
+
<div
|
|
28
|
+
class="evui-table-filter-row"
|
|
29
|
+
@mouseover.stop="onFilter"
|
|
30
|
+
>
|
|
31
|
+
<ev-checkbox
|
|
32
|
+
v-model="value.use"
|
|
33
|
+
:type="`square`"
|
|
34
|
+
:size="'small'"
|
|
35
|
+
/>
|
|
36
|
+
<span>Filter</span>
|
|
37
|
+
<ev-icon
|
|
38
|
+
:cls="'ei-s ei-s-play'"
|
|
39
|
+
style="margin-left: auto; font-size: 14px"
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
42
|
+
<div
|
|
43
|
+
v-show="showFilterCondition"
|
|
44
|
+
ref="filterCondition"
|
|
45
|
+
class="filter-condition"
|
|
46
|
+
>
|
|
47
|
+
<div class="create-condition">
|
|
48
|
+
<ev-radio-group
|
|
49
|
+
v-model="value.method"
|
|
50
|
+
:size="`small`"
|
|
51
|
+
>
|
|
52
|
+
<ev-radio
|
|
53
|
+
:value="'or'"
|
|
54
|
+
style="font-size: 12px;"
|
|
55
|
+
>
|
|
56
|
+
OR
|
|
57
|
+
</ev-radio>
|
|
58
|
+
<ev-radio
|
|
59
|
+
:value="'and'"
|
|
60
|
+
style="font-size: 12px;"
|
|
61
|
+
>
|
|
62
|
+
AND
|
|
63
|
+
</ev-radio>
|
|
64
|
+
</ev-radio-group>
|
|
65
|
+
<ev-button
|
|
66
|
+
:type="'primary'"
|
|
67
|
+
:size="'small'"
|
|
68
|
+
@click="onAdd"
|
|
69
|
+
>
|
|
70
|
+
Add Condition
|
|
71
|
+
</ev-button>
|
|
72
|
+
</div>
|
|
73
|
+
<div class="condition-list">
|
|
74
|
+
<div
|
|
75
|
+
v-for="(item, index) in conditions"
|
|
76
|
+
:key="item.id"
|
|
77
|
+
class="condition-item"
|
|
78
|
+
>
|
|
79
|
+
<ev-checkbox
|
|
80
|
+
v-model="item.use"
|
|
81
|
+
:value="item.id"
|
|
82
|
+
:type="`square`"
|
|
83
|
+
:size="'small'"
|
|
84
|
+
@on-click="onClick(index)"
|
|
85
|
+
/>
|
|
86
|
+
<ev-selectbox
|
|
87
|
+
v-model="item.type"
|
|
88
|
+
:items="defaultCondition[value.type]"
|
|
89
|
+
style="width: 100px;"
|
|
90
|
+
/>
|
|
91
|
+
<ev-text-field
|
|
92
|
+
v-model="item.value"
|
|
93
|
+
:type="'text'"
|
|
94
|
+
style="width: 100px;"
|
|
95
|
+
@input="inputFn(index)"
|
|
96
|
+
/>
|
|
97
|
+
<ev-icon
|
|
98
|
+
:cls="'ei-s-close'"
|
|
99
|
+
@click="onRemove(index)"
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
</template>
|
|
106
|
+
<script>
|
|
107
|
+
import { cloneDeep } from 'lodash-es';
|
|
108
|
+
import debounce from '@/common/utils.debounce';
|
|
109
|
+
|
|
110
|
+
export default {
|
|
111
|
+
directives: {
|
|
112
|
+
'click-outside': {
|
|
113
|
+
bind(el, binding) {
|
|
114
|
+
const selectBoxEl = el;
|
|
115
|
+
const bubble = binding.modifiers.bubble;
|
|
116
|
+
const handler = (e) => {
|
|
117
|
+
if (bubble || (selectBoxEl !== e.target && !selectBoxEl.contains(e.target))) {
|
|
118
|
+
binding.value(e);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
selectBoxEl.vueClickOutside = handler;
|
|
122
|
+
|
|
123
|
+
document.addEventListener('click', handler);
|
|
124
|
+
},
|
|
125
|
+
unbind(el) {
|
|
126
|
+
const selectBoxEl = el;
|
|
127
|
+
document.removeEventListener('click', selectBoxEl.vueClickOutside);
|
|
128
|
+
selectBoxEl.vueClickOutside = null;
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
props: {
|
|
133
|
+
value: {
|
|
134
|
+
type: Object,
|
|
135
|
+
default: null,
|
|
136
|
+
},
|
|
137
|
+
show: {
|
|
138
|
+
type: Boolean,
|
|
139
|
+
default: false,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
data() {
|
|
143
|
+
return {
|
|
144
|
+
itemSeq: 0,
|
|
145
|
+
prefixClass: 'evui-table-filter',
|
|
146
|
+
showFilterCondition: false,
|
|
147
|
+
conditions: [],
|
|
148
|
+
defaultCondition: {
|
|
149
|
+
string: [
|
|
150
|
+
{ name: 'Equal', value: 'equal' },
|
|
151
|
+
{ name: 'Not equal', value: 'notEqual' },
|
|
152
|
+
{ name: 'Like', value: 'like' },
|
|
153
|
+
{ name: 'Not Like', value: 'notLike' },
|
|
154
|
+
],
|
|
155
|
+
number: [
|
|
156
|
+
{ name: '>', value: 'greaterThan' },
|
|
157
|
+
{ name: '<', value: 'lessThan' },
|
|
158
|
+
{ name: '=', value: 'equal' },
|
|
159
|
+
],
|
|
160
|
+
},
|
|
161
|
+
inputFn: debounce(this.onInput, 250),
|
|
162
|
+
};
|
|
163
|
+
},
|
|
164
|
+
watch: {
|
|
165
|
+
conditions() {
|
|
166
|
+
this.$set(this.value, 'conditions', this.conditions.filter(condition => !condition.isInit));
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
mounted() {
|
|
170
|
+
if (this.value.conditions.length) {
|
|
171
|
+
this.conditions = cloneDeep(this.value.conditions);
|
|
172
|
+
this.itemSeq = this.conditions.reduce((maxSeq, condition) => {
|
|
173
|
+
const seq = parseInt(condition.id.split('-')[1], 10);
|
|
174
|
+
if (maxSeq < seq) {
|
|
175
|
+
maxSeq = seq; // eslint-disable-line no-param-reassign
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return maxSeq;
|
|
179
|
+
}, 0);
|
|
180
|
+
} else {
|
|
181
|
+
this.conditions.push({
|
|
182
|
+
id: `item-${this.itemSeq++}`,
|
|
183
|
+
use: true,
|
|
184
|
+
type: this.value.type === 'string' ? 'like' : 'greaterThan',
|
|
185
|
+
value: '',
|
|
186
|
+
isInit: true,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
methods: {
|
|
191
|
+
onInput(index) {
|
|
192
|
+
const condition = this.conditions[index];
|
|
193
|
+
|
|
194
|
+
if (condition.isInit) {
|
|
195
|
+
condition.isInit = false;
|
|
196
|
+
if (!this.value.use) {
|
|
197
|
+
this.value.use = true;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
this.conditions.splice(index, 1, condition);
|
|
202
|
+
},
|
|
203
|
+
onHide() {
|
|
204
|
+
this.$emit('update:show', false);
|
|
205
|
+
},
|
|
206
|
+
onFilter({ currentTarget }) {
|
|
207
|
+
this.showFilterCondition = true;
|
|
208
|
+
this.$refs.filterCondition.style.cssText = `
|
|
209
|
+
top: ${currentTarget.offsetTop + 1}px;
|
|
210
|
+
left: ${currentTarget.offsetLeft + currentTarget.offsetWidth + 2}px;`;
|
|
211
|
+
},
|
|
212
|
+
onAdd() {
|
|
213
|
+
this.conditions.push({
|
|
214
|
+
id: `item-${this.itemSeq++}`,
|
|
215
|
+
use: true,
|
|
216
|
+
type: this.value.type === 'string' ? 'like' : 'greaterThan',
|
|
217
|
+
value: '',
|
|
218
|
+
isInit: true,
|
|
219
|
+
});
|
|
220
|
+
},
|
|
221
|
+
onRemove(index) {
|
|
222
|
+
if (index) {
|
|
223
|
+
this.conditions.splice(index, 1);
|
|
224
|
+
} else {
|
|
225
|
+
this.itemSeq = 0;
|
|
226
|
+
this.$set(this.conditions, 0, {
|
|
227
|
+
id: `item-${this.itemSeq++}`,
|
|
228
|
+
use: false,
|
|
229
|
+
type: this.value.type === 'string' ? 'like' : 'greaterThan',
|
|
230
|
+
value: '',
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
onClick(index) {
|
|
235
|
+
const condition = this.conditions[index];
|
|
236
|
+
condition.use = !condition.use;
|
|
237
|
+
this.conditions.splice(index, 1, condition);
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
};
|
|
241
|
+
</script>
|
|
242
|
+
<style scoped>
|
|
243
|
+
.evui-table-filter {
|
|
244
|
+
position: absolute;
|
|
245
|
+
background-color: #f0f0f0;
|
|
246
|
+
padding: 2px 0;
|
|
247
|
+
}
|
|
248
|
+
.evui-table-filter-row {
|
|
249
|
+
display: flex;
|
|
250
|
+
align-items: center;
|
|
251
|
+
line-height: 16px;
|
|
252
|
+
font-size: 12px;
|
|
253
|
+
padding: 3px 5px;
|
|
254
|
+
}
|
|
255
|
+
.evui-table-filter-row:hover{
|
|
256
|
+
padding: 2px;
|
|
257
|
+
margin: 0 2px;
|
|
258
|
+
background-color: #e6e6e6;
|
|
259
|
+
border: 1px solid #9d9d9d;
|
|
260
|
+
border-radius: 3px;
|
|
261
|
+
cursor: pointer;
|
|
262
|
+
}
|
|
263
|
+
.sort-icon {
|
|
264
|
+
margin: 0 7px 0 2px;
|
|
265
|
+
font-size: 14px;
|
|
266
|
+
}
|
|
267
|
+
.filter-condition {
|
|
268
|
+
display: flex;
|
|
269
|
+
flex-direction: column;
|
|
270
|
+
position: absolute;
|
|
271
|
+
background-color: white;
|
|
272
|
+
box-shadow: 1px 1px 2px 2px #9d9d9d;
|
|
273
|
+
padding: 3px;
|
|
274
|
+
}
|
|
275
|
+
.create-condition {
|
|
276
|
+
display: flex;
|
|
277
|
+
justify-content: space-between;
|
|
278
|
+
align-items: center;
|
|
279
|
+
padding-bottom: 3px;
|
|
280
|
+
font-size: 12px;
|
|
281
|
+
}
|
|
282
|
+
.condition-list {
|
|
283
|
+
display: flex;
|
|
284
|
+
flex-direction: column;
|
|
285
|
+
}
|
|
286
|
+
.condition-item {
|
|
287
|
+
display: flex;
|
|
288
|
+
align-items: center;
|
|
289
|
+
}
|
|
290
|
+
</style>>
|