meixioacomponent 1.1.49 → 1.1.51
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/meixioacomponent.common.js +337 -52
- package/lib/meixioacomponent.umd.js +337 -52
- package/lib/meixioacomponent.umd.min.js +7 -7
- package/package.json +1 -1
- package/packages/components/base/baseArea/api.js +7 -0
- package/packages/components/base/baseArea/areaConfig.js +4 -3
- package/packages/components/base/baseArea/baseAreaV2.vue +157 -0
- package/packages/components/base/baseArea/index.js +2 -1
- package/packages/components/base/elDatePicker/basic/date-table.vue +441 -441
- package/packages/components/base/elDatePicker/basic/month-table.vue +269 -269
- package/packages/components/base/elDatePicker/basic/time-spinner.vue +304 -304
- package/packages/components/base/elDatePicker/basic/year-table.vue +111 -111
- package/packages/components/base/elDatePicker/index.js +6 -6
- package/packages/components/base/elDatePicker/index.vue +27 -27
- package/packages/components/base/elDatePicker/panel/date-range.vue +680 -680
- package/packages/components/base/elDatePicker/panel/date.vue +609 -609
- package/packages/components/base/elDatePicker/panel/month-range.vue +289 -289
- package/packages/components/base/elDatePicker/panel/time-range.vue +248 -248
- package/packages/components/base/elDatePicker/panel/time-select.vue +178 -178
- package/packages/components/base/elDatePicker/panel/time.vue +186 -186
- package/packages/components/base/elDatePicker/picker/date-picker.js +55 -55
- package/packages/components/base/elDatePicker/picker/time-picker.js +39 -39
- package/packages/components/base/elDatePicker/picker/time-select.js +21 -21
- package/packages/components/base/elDatePicker/picker.vue +956 -956
- package/packages/components/proForm/proForm/pro_form.vue +6 -4
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<table @click="handleYearTableClick" class="el-year-table">
|
|
3
|
-
<tbody>
|
|
4
|
-
<tr>
|
|
5
|
-
<td class="available" :class="getCellStyle(startYear + 0)">
|
|
6
|
-
<a class="cell">{{ startYear }}</a>
|
|
7
|
-
</td>
|
|
8
|
-
<td class="available" :class="getCellStyle(startYear + 1)">
|
|
9
|
-
<a class="cell">{{ startYear + 1 }}</a>
|
|
10
|
-
</td>
|
|
11
|
-
<td class="available" :class="getCellStyle(startYear + 2)">
|
|
12
|
-
<a class="cell">{{ startYear + 2 }}</a>
|
|
13
|
-
</td>
|
|
14
|
-
<td class="available" :class="getCellStyle(startYear + 3)">
|
|
15
|
-
<a class="cell">{{ startYear + 3 }}</a>
|
|
16
|
-
</td>
|
|
17
|
-
</tr>
|
|
18
|
-
<tr>
|
|
19
|
-
<td class="available" :class="getCellStyle(startYear + 4)">
|
|
20
|
-
<a class="cell">{{ startYear + 4 }}</a>
|
|
21
|
-
</td>
|
|
22
|
-
<td class="available" :class="getCellStyle(startYear + 5)">
|
|
23
|
-
<a class="cell">{{ startYear + 5 }}</a>
|
|
24
|
-
</td>
|
|
25
|
-
<td class="available" :class="getCellStyle(startYear + 6)">
|
|
26
|
-
<a class="cell">{{ startYear + 6 }}</a>
|
|
27
|
-
</td>
|
|
28
|
-
<td class="available" :class="getCellStyle(startYear + 7)">
|
|
29
|
-
<a class="cell">{{ startYear + 7 }}</a>
|
|
30
|
-
</td>
|
|
31
|
-
</tr>
|
|
32
|
-
<tr>
|
|
33
|
-
<td class="available" :class="getCellStyle(startYear + 8)">
|
|
34
|
-
<a class="cell">{{ startYear + 8 }}</a>
|
|
35
|
-
</td>
|
|
36
|
-
<td class="available" :class="getCellStyle(startYear + 9)">
|
|
37
|
-
<a class="cell">{{ startYear + 9 }}</a>
|
|
38
|
-
</td>
|
|
39
|
-
<td></td>
|
|
40
|
-
<td></td>
|
|
41
|
-
</tr>
|
|
42
|
-
</tbody>
|
|
43
|
-
</table>
|
|
44
|
-
</template>
|
|
45
|
-
|
|
46
|
-
<script type="text/babel">
|
|
47
|
-
import { hasClass } from 'element-ui/src/utils/dom';
|
|
48
|
-
import { isDate, range, nextDate, getDayCountOfYear } from 'element-ui/src/utils/date-util';
|
|
49
|
-
import { arrayFindIndex, coerceTruthyValueToArray } from 'element-ui/src/utils/util';
|
|
50
|
-
|
|
51
|
-
const datesInYear = year => {
|
|
52
|
-
const numOfDays = getDayCountOfYear(year);
|
|
53
|
-
const firstDay = new Date(year, 0, 1);
|
|
54
|
-
return range(numOfDays).map(n => nextDate(firstDay, n));
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export default {
|
|
58
|
-
props: {
|
|
59
|
-
disabledDate: {},
|
|
60
|
-
value: {},
|
|
61
|
-
defaultValue: {
|
|
62
|
-
validator(val) {
|
|
63
|
-
// null or valid Date Object
|
|
64
|
-
return val === null || (val instanceof Date && isDate(val));
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
date: {},
|
|
68
|
-
selectionMode: {}
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
computed: {
|
|
72
|
-
startYear() {
|
|
73
|
-
return Math.floor(this.date.getFullYear() / 10) * 10;
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
methods: {
|
|
78
|
-
getCellStyle(year) {
|
|
79
|
-
const style = {};
|
|
80
|
-
const today = new Date();
|
|
81
|
-
|
|
82
|
-
style.disabled = typeof this.disabledDate === 'function'
|
|
83
|
-
? datesInYear(year).every(this.disabledDate)
|
|
84
|
-
: false;
|
|
85
|
-
style.current = arrayFindIndex(coerceTruthyValueToArray(this.value), date => date.getFullYear() === year) >= 0;
|
|
86
|
-
style.today = today.getFullYear() === year;
|
|
87
|
-
style.default = this.defaultValue && this.defaultValue.getFullYear() === year;
|
|
88
|
-
|
|
89
|
-
return style;
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
handleYearTableClick(event) {
|
|
93
|
-
const target = event.target;
|
|
94
|
-
if (target.tagName === 'A') {
|
|
95
|
-
if (hasClass(target.parentNode, 'disabled')) return;
|
|
96
|
-
const year = target.textContent || target.innerText;
|
|
97
|
-
if (this.selectionMode === 'years') {
|
|
98
|
-
const value = this.value || [];
|
|
99
|
-
const idx = arrayFindIndex(value, date => date.getFullYear() === Number(year));
|
|
100
|
-
const newValue = idx > -1
|
|
101
|
-
? [...value.slice(0, idx), ...value.slice(idx + 1)]
|
|
102
|
-
: [...value, new Date(year)];
|
|
103
|
-
this.$emit('pick', newValue);
|
|
104
|
-
} else {
|
|
105
|
-
this.$emit('pick', Number(year));
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<table @click="handleYearTableClick" class="el-year-table">
|
|
3
|
+
<tbody>
|
|
4
|
+
<tr>
|
|
5
|
+
<td class="available" :class="getCellStyle(startYear + 0)">
|
|
6
|
+
<a class="cell">{{ startYear }}</a>
|
|
7
|
+
</td>
|
|
8
|
+
<td class="available" :class="getCellStyle(startYear + 1)">
|
|
9
|
+
<a class="cell">{{ startYear + 1 }}</a>
|
|
10
|
+
</td>
|
|
11
|
+
<td class="available" :class="getCellStyle(startYear + 2)">
|
|
12
|
+
<a class="cell">{{ startYear + 2 }}</a>
|
|
13
|
+
</td>
|
|
14
|
+
<td class="available" :class="getCellStyle(startYear + 3)">
|
|
15
|
+
<a class="cell">{{ startYear + 3 }}</a>
|
|
16
|
+
</td>
|
|
17
|
+
</tr>
|
|
18
|
+
<tr>
|
|
19
|
+
<td class="available" :class="getCellStyle(startYear + 4)">
|
|
20
|
+
<a class="cell">{{ startYear + 4 }}</a>
|
|
21
|
+
</td>
|
|
22
|
+
<td class="available" :class="getCellStyle(startYear + 5)">
|
|
23
|
+
<a class="cell">{{ startYear + 5 }}</a>
|
|
24
|
+
</td>
|
|
25
|
+
<td class="available" :class="getCellStyle(startYear + 6)">
|
|
26
|
+
<a class="cell">{{ startYear + 6 }}</a>
|
|
27
|
+
</td>
|
|
28
|
+
<td class="available" :class="getCellStyle(startYear + 7)">
|
|
29
|
+
<a class="cell">{{ startYear + 7 }}</a>
|
|
30
|
+
</td>
|
|
31
|
+
</tr>
|
|
32
|
+
<tr>
|
|
33
|
+
<td class="available" :class="getCellStyle(startYear + 8)">
|
|
34
|
+
<a class="cell">{{ startYear + 8 }}</a>
|
|
35
|
+
</td>
|
|
36
|
+
<td class="available" :class="getCellStyle(startYear + 9)">
|
|
37
|
+
<a class="cell">{{ startYear + 9 }}</a>
|
|
38
|
+
</td>
|
|
39
|
+
<td></td>
|
|
40
|
+
<td></td>
|
|
41
|
+
</tr>
|
|
42
|
+
</tbody>
|
|
43
|
+
</table>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script type="text/babel">
|
|
47
|
+
import { hasClass } from 'element-ui/src/utils/dom';
|
|
48
|
+
import { isDate, range, nextDate, getDayCountOfYear } from 'element-ui/src/utils/date-util';
|
|
49
|
+
import { arrayFindIndex, coerceTruthyValueToArray } from 'element-ui/src/utils/util';
|
|
50
|
+
|
|
51
|
+
const datesInYear = year => {
|
|
52
|
+
const numOfDays = getDayCountOfYear(year);
|
|
53
|
+
const firstDay = new Date(year, 0, 1);
|
|
54
|
+
return range(numOfDays).map(n => nextDate(firstDay, n));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export default {
|
|
58
|
+
props: {
|
|
59
|
+
disabledDate: {},
|
|
60
|
+
value: {},
|
|
61
|
+
defaultValue: {
|
|
62
|
+
validator(val) {
|
|
63
|
+
// null or valid Date Object
|
|
64
|
+
return val === null || (val instanceof Date && isDate(val));
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
date: {},
|
|
68
|
+
selectionMode: {}
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
computed: {
|
|
72
|
+
startYear() {
|
|
73
|
+
return Math.floor(this.date.getFullYear() / 10) * 10;
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
methods: {
|
|
78
|
+
getCellStyle(year) {
|
|
79
|
+
const style = {};
|
|
80
|
+
const today = new Date();
|
|
81
|
+
|
|
82
|
+
style.disabled = typeof this.disabledDate === 'function'
|
|
83
|
+
? datesInYear(year).every(this.disabledDate)
|
|
84
|
+
: false;
|
|
85
|
+
style.current = arrayFindIndex(coerceTruthyValueToArray(this.value), date => date.getFullYear() === year) >= 0;
|
|
86
|
+
style.today = today.getFullYear() === year;
|
|
87
|
+
style.default = this.defaultValue && this.defaultValue.getFullYear() === year;
|
|
88
|
+
|
|
89
|
+
return style;
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
handleYearTableClick(event) {
|
|
93
|
+
const target = event.target;
|
|
94
|
+
if (target.tagName === 'A') {
|
|
95
|
+
if (hasClass(target.parentNode, 'disabled')) return;
|
|
96
|
+
const year = target.textContent || target.innerText;
|
|
97
|
+
if (this.selectionMode === 'years') {
|
|
98
|
+
const value = this.value || [];
|
|
99
|
+
const idx = arrayFindIndex(value, date => date.getFullYear() === Number(year));
|
|
100
|
+
const newValue = idx > -1
|
|
101
|
+
? [...value.slice(0, idx), ...value.slice(idx + 1)]
|
|
102
|
+
: [...value, new Date(year)];
|
|
103
|
+
this.$emit('pick', newValue);
|
|
104
|
+
} else {
|
|
105
|
+
this.$emit('pick', Number(year));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
</script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import datePicker from "./picker/date-picker";
|
|
2
|
-
|
|
3
|
-
datePicker.install = function (Vue) {
|
|
4
|
-
Vue.component(datePicker.name, datePicker)
|
|
5
|
-
}
|
|
6
|
-
export default datePicker
|
|
1
|
+
import datePicker from "./picker/date-picker";
|
|
2
|
+
|
|
3
|
+
datePicker.install = function (Vue) {
|
|
4
|
+
Vue.component(datePicker.name, datePicker)
|
|
5
|
+
}
|
|
6
|
+
export default datePicker
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<DatePicker v-bind="$attrs" :type="type"></DatePicker>
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script lang="ts">
|
|
6
|
-
import DatePicker from "./picker/date-picker.js"
|
|
7
|
-
import {defineComponent} from 'vue'
|
|
8
|
-
|
|
9
|
-
export default defineComponent({
|
|
10
|
-
name: "ElDatePicker",
|
|
11
|
-
data() {
|
|
12
|
-
return {}
|
|
13
|
-
},
|
|
14
|
-
props: {
|
|
15
|
-
type: {
|
|
16
|
-
default:'date'
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
methods: {},
|
|
20
|
-
components: {
|
|
21
|
-
DatePicker
|
|
22
|
-
}
|
|
23
|
-
})
|
|
24
|
-
</script>
|
|
25
|
-
|
|
26
|
-
<style lang="less" scoped>
|
|
27
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<DatePicker v-bind="$attrs" :type="type"></DatePicker>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import DatePicker from "./picker/date-picker.js"
|
|
7
|
+
import {defineComponent} from 'vue'
|
|
8
|
+
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
name: "ElDatePicker",
|
|
11
|
+
data() {
|
|
12
|
+
return {}
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
type: {
|
|
16
|
+
default:'date'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
methods: {},
|
|
20
|
+
components: {
|
|
21
|
+
DatePicker
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<style lang="less" scoped>
|
|
27
|
+
|
|
28
28
|
</style>
|