vxe-table 4.2.2-beta.0 → 4.2.3-beta.0
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/es/edit/src/hook.js +4 -2
- package/es/filter/src/hook.js +2 -1
- package/es/footer/src/footer.js +5 -5
- package/es/form/src/form.js +7 -4
- package/es/grid/src/grid.js +1 -1
- package/es/header/src/header.js +6 -6
- package/es/header/style.css +1 -5
- package/es/input/src/input.js +125 -27
- package/es/input/style.css +42 -13
- package/es/keyboard/src/hook.js +5 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/body.js +15 -11
- package/es/table/src/table.js +59 -48
- package/es/tools/log.js +1 -1
- package/es/v-x-e-table/index.js +1 -1
- package/helper/vetur/attributes.json +31 -19
- package/helper/vetur/tags.json +3 -0
- package/lib/edit/src/hook.js +6 -4
- package/lib/edit/src/hook.min.js +1 -1
- package/lib/filter/src/hook.js +2 -1
- package/lib/filter/src/hook.min.js +1 -1
- package/lib/footer/src/footer.js +5 -5
- package/lib/footer/src/footer.min.js +1 -1
- package/lib/form/src/form.js +11 -9
- package/lib/form/src/form.min.js +1 -1
- package/lib/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/header/src/header.js +6 -6
- package/lib/header/src/header.min.js +1 -1
- package/lib/header/style/style.css +1 -5
- package/lib/header/style/style.min.css +1 -1
- package/lib/index.umd.js +347 -128
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +166 -29
- package/lib/input/src/input.min.js +1 -1
- package/lib/input/style/style.css +42 -13
- package/lib/input/style/style.min.css +1 -1
- package/lib/keyboard/src/hook.js +7 -1
- package/lib/keyboard/src/hook.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +15 -11
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/table.js +66 -56
- package/lib/table/src/table.min.js +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/package.json +1 -1
- package/packages/edit/src/hook.ts +4 -2
- package/packages/filter/src/hook.ts +3 -2
- package/packages/footer/src/footer.ts +5 -5
- package/packages/form/src/form.ts +7 -5
- package/packages/grid/src/grid.ts +1 -1
- package/packages/header/src/header.ts +6 -6
- package/packages/input/src/input.ts +128 -27
- package/packages/keyboard/src/hook.ts +6 -2
- package/packages/table/src/body.ts +15 -11
- package/packages/table/src/table.ts +58 -46
- package/packages/tools/dom.ts +1 -1
- package/styles/header.scss +1 -1
- package/styles/input.scss +16 -4
- package/types/input.d.ts +2 -0
- package/types/table.d.ts +3 -1
|
@@ -350,7 +350,7 @@ export default defineComponent({
|
|
|
350
350
|
|
|
351
351
|
let showErrTime: number
|
|
352
352
|
|
|
353
|
-
const beginValidate = (itemList: VxeFormDefines.ItemInfo[], type?: string, callback?: any) => {
|
|
353
|
+
const beginValidate = (itemList: VxeFormDefines.ItemInfo[], type?: string, callback?: any): Promise<any> => {
|
|
354
354
|
const { data, rules: formRules } = props
|
|
355
355
|
const validOpts = computeValidOpts.value
|
|
356
356
|
const validRest: any = {}
|
|
@@ -424,10 +424,12 @@ export default defineComponent({
|
|
|
424
424
|
evnt.preventDefault()
|
|
425
425
|
if (!props.preventSubmit) {
|
|
426
426
|
clearValidate()
|
|
427
|
-
beginValidate(getItems()).then(() => {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
427
|
+
beginValidate(getItems()).then((errMap) => {
|
|
428
|
+
if (errMap) {
|
|
429
|
+
formMethods.dispatchEvent('submit-invalid', { data: props.data, errMap }, evnt)
|
|
430
|
+
} else {
|
|
431
|
+
formMethods.dispatchEvent('submit', { data: props.data }, evnt)
|
|
432
|
+
}
|
|
431
433
|
})
|
|
432
434
|
}
|
|
433
435
|
}
|
|
@@ -772,7 +772,7 @@ export default defineComponent({
|
|
|
772
772
|
if (rest) {
|
|
773
773
|
if (isEnableConf(pagerConfig)) {
|
|
774
774
|
const total = XEUtils.get(rest, proxyProps.total || 'page.total') || 0
|
|
775
|
-
tablePage.total = total
|
|
775
|
+
tablePage.total = XEUtils.toNumber(total)
|
|
776
776
|
reactData.tableData = XEUtils.get(rest, proxyProps.result || 'result') || []
|
|
777
777
|
// 检验当前页码,不能超出当前最大页数
|
|
778
778
|
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1)
|
|
@@ -136,12 +136,12 @@ export default defineComponent({
|
|
|
136
136
|
const { internalData } = $xetable
|
|
137
137
|
const { elemStore } = internalData
|
|
138
138
|
const prefix = `${fixedType || 'main'}-header-`
|
|
139
|
-
elemStore[`${prefix}wrapper`] = refElem
|
|
140
|
-
elemStore[`${prefix}table`] = refHeaderTable
|
|
141
|
-
elemStore[`${prefix}colgroup`] = refHeaderColgroup
|
|
142
|
-
elemStore[`${prefix}list`] = refHeaderTHead
|
|
143
|
-
elemStore[`${prefix}xSpace`] = refHeaderXSpace
|
|
144
|
-
elemStore[`${prefix}repair`] = refHeaderBorderRepair
|
|
139
|
+
elemStore[`${prefix}wrapper`] = refElem
|
|
140
|
+
elemStore[`${prefix}table`] = refHeaderTable
|
|
141
|
+
elemStore[`${prefix}colgroup`] = refHeaderColgroup
|
|
142
|
+
elemStore[`${prefix}list`] = refHeaderTHead
|
|
143
|
+
elemStore[`${prefix}xSpace`] = refHeaderXSpace
|
|
144
|
+
elemStore[`${prefix}repair`] = refHeaderBorderRepair
|
|
145
145
|
uploadColumn()
|
|
146
146
|
})
|
|
147
147
|
})
|
|
@@ -12,8 +12,10 @@ import { VNodeStyle, VxeInputConstructor, VxeInputEmits, InputReactData, InputMe
|
|
|
12
12
|
|
|
13
13
|
interface DateYearItem {
|
|
14
14
|
date: Date;
|
|
15
|
+
isPrev: boolean;
|
|
15
16
|
isCurrent: boolean;
|
|
16
17
|
isNow: boolean;
|
|
18
|
+
isNext: boolean;
|
|
17
19
|
year: number;
|
|
18
20
|
}
|
|
19
21
|
|
|
@@ -50,7 +52,7 @@ interface DateHourMinuteSecondItem {
|
|
|
50
52
|
label: string;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
const yearSize =
|
|
55
|
+
const yearSize = 12
|
|
54
56
|
const monthSize = 20
|
|
55
57
|
const quarterSize = 8
|
|
56
58
|
|
|
@@ -71,6 +73,7 @@ export default defineComponent({
|
|
|
71
73
|
form: String as PropType<VxeInputPropTypes.Form>,
|
|
72
74
|
className: String as PropType<VxeInputPropTypes.ClassName>,
|
|
73
75
|
size: { type: String as PropType<VxeInputPropTypes.Size>, default: () => GlobalConfig.input.size || GlobalConfig.size },
|
|
76
|
+
multiple: Boolean as PropType<VxeInputPropTypes.Multiple>,
|
|
74
77
|
|
|
75
78
|
// number、integer、float
|
|
76
79
|
min: { type: [String, Number] as PropType<VxeInputPropTypes.Min>, default: null },
|
|
@@ -232,6 +235,38 @@ export default defineComponent({
|
|
|
232
235
|
return props.maxDate ? XEUtils.toStringDate(props.maxDate) : null
|
|
233
236
|
})
|
|
234
237
|
|
|
238
|
+
const computeSupportMultiples = computed(() => {
|
|
239
|
+
return ['date', 'week', 'month', 'quarter', 'year'].includes(props.type)
|
|
240
|
+
})
|
|
241
|
+
|
|
242
|
+
const computeDateListValue = computed(() => {
|
|
243
|
+
const { modelValue, multiple } = props
|
|
244
|
+
const isDatePickerType = computeIsDatePickerType.value
|
|
245
|
+
const dateValueFormat = computeDateValueFormat.value
|
|
246
|
+
if (multiple && modelValue && isDatePickerType) {
|
|
247
|
+
return XEUtils.toValueString(modelValue).split(',').map(item => {
|
|
248
|
+
const date = parseDate(item, dateValueFormat)
|
|
249
|
+
if (XEUtils.isValidDate(date)) {
|
|
250
|
+
return date
|
|
251
|
+
}
|
|
252
|
+
return null
|
|
253
|
+
})
|
|
254
|
+
}
|
|
255
|
+
return []
|
|
256
|
+
})
|
|
257
|
+
|
|
258
|
+
const computeDateMultipleValue = computed(() => {
|
|
259
|
+
const dateListValue = computeDateListValue.value
|
|
260
|
+
const dateValueFormat = computeDateValueFormat.value
|
|
261
|
+
return dateListValue.map(date => XEUtils.toDateString(date, dateValueFormat))
|
|
262
|
+
})
|
|
263
|
+
|
|
264
|
+
const computeDateMultipleLabel = computed(() => {
|
|
265
|
+
const dateListValue = computeDateListValue.value
|
|
266
|
+
const dateLabelFormat = computeDateLabelFormat.value
|
|
267
|
+
return dateListValue.map(date => XEUtils.toDateString(date, dateLabelFormat)).join(', ')
|
|
268
|
+
})
|
|
269
|
+
|
|
235
270
|
const computeDateValueFormat = computed(() => {
|
|
236
271
|
const { type } = props
|
|
237
272
|
return type === 'time' ? 'HH:mm:ss' : (props.valueFormat || (type === 'datetime' ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM-dd'))
|
|
@@ -296,14 +331,17 @@ export default defineComponent({
|
|
|
296
331
|
const years: DateYearItem[] = []
|
|
297
332
|
if (selectMonth && currentDate) {
|
|
298
333
|
const currFullYear = currentDate.getFullYear()
|
|
299
|
-
const
|
|
300
|
-
|
|
301
|
-
|
|
334
|
+
const selectFullYear = selectMonth.getFullYear()
|
|
335
|
+
const startYearDate = new Date(selectFullYear - selectFullYear % yearSize, 0, 1)
|
|
336
|
+
for (let index = -4; index < yearSize + 4; index++) {
|
|
337
|
+
const date = XEUtils.getWhatYear(startYearDate, index, 'first')
|
|
302
338
|
const itemFullYear = date.getFullYear()
|
|
303
339
|
years.push({
|
|
304
340
|
date,
|
|
305
341
|
isCurrent: true,
|
|
342
|
+
isPrev: index < 0,
|
|
306
343
|
isNow: currFullYear === itemFullYear,
|
|
344
|
+
isNext: index >= yearSize,
|
|
307
345
|
year: itemFullYear
|
|
308
346
|
})
|
|
309
347
|
}
|
|
@@ -536,8 +574,8 @@ export default defineComponent({
|
|
|
536
574
|
})
|
|
537
575
|
|
|
538
576
|
const computeInpReadonly = computed(() => {
|
|
539
|
-
const { type, readonly, editable } = props
|
|
540
|
-
return readonly || !editable || type === 'week' || type === 'quarter'
|
|
577
|
+
const { type, readonly, editable, multiple } = props
|
|
578
|
+
return readonly || multiple || !editable || type === 'week' || type === 'quarter'
|
|
541
579
|
})
|
|
542
580
|
|
|
543
581
|
const computeInputType = computed(() => {
|
|
@@ -711,7 +749,7 @@ export default defineComponent({
|
|
|
711
749
|
const { inputValue } = reactData
|
|
712
750
|
if (isDatePickerType) {
|
|
713
751
|
dateParseValue(inputValue)
|
|
714
|
-
reactData.inputValue = reactData.datePanelLabel
|
|
752
|
+
reactData.inputValue = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel
|
|
715
753
|
}
|
|
716
754
|
}
|
|
717
755
|
|
|
@@ -744,7 +782,7 @@ export default defineComponent({
|
|
|
744
782
|
}
|
|
745
783
|
|
|
746
784
|
const dateRevert = () => {
|
|
747
|
-
reactData.inputValue = reactData.datePanelLabel
|
|
785
|
+
reactData.inputValue = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel
|
|
748
786
|
}
|
|
749
787
|
|
|
750
788
|
const dateCheckMonth = (date: Date) => {
|
|
@@ -755,7 +793,7 @@ export default defineComponent({
|
|
|
755
793
|
}
|
|
756
794
|
|
|
757
795
|
const dateChange = (date: Date) => {
|
|
758
|
-
const { modelValue } = props
|
|
796
|
+
const { modelValue, multiple } = props
|
|
759
797
|
const { datetimePanelValue } = reactData
|
|
760
798
|
const isDateTimeType = computeIsDateTimeType.value
|
|
761
799
|
const dateValueFormat = computeDateValueFormat.value
|
|
@@ -770,8 +808,36 @@ export default defineComponent({
|
|
|
770
808
|
}
|
|
771
809
|
const inpVal = XEUtils.toDateString(date, dateValueFormat, { firstDay: firstDayOfWeek })
|
|
772
810
|
dateCheckMonth(date)
|
|
773
|
-
if (
|
|
774
|
-
|
|
811
|
+
if (multiple) {
|
|
812
|
+
// 如果为多选
|
|
813
|
+
const dateMultipleValue = computeDateMultipleValue.value
|
|
814
|
+
if (isDateTimeType) {
|
|
815
|
+
// 如果是datetime特殊类型
|
|
816
|
+
const dateListValue = computeDateListValue.value
|
|
817
|
+
const datetimeRest = []
|
|
818
|
+
dateListValue.forEach(item => {
|
|
819
|
+
if (item && !XEUtils.isDateSame(date, item, 'yyyyMMdd')) {
|
|
820
|
+
item.setHours(datetimePanelValue.getHours())
|
|
821
|
+
item.setMinutes(datetimePanelValue.getMinutes())
|
|
822
|
+
item.setSeconds(datetimePanelValue.getSeconds())
|
|
823
|
+
datetimeRest.push(item)
|
|
824
|
+
}
|
|
825
|
+
})
|
|
826
|
+
datetimeRest.push(date)
|
|
827
|
+
emitModel(datetimeRest.map(date => XEUtils.toDateString(date, dateValueFormat)).join(','), { type: 'update' })
|
|
828
|
+
} else {
|
|
829
|
+
// 如果是日期类型
|
|
830
|
+
if (dateMultipleValue.some(val => XEUtils.isEqual(val, inpVal))) {
|
|
831
|
+
emitModel(dateMultipleValue.filter(val => !XEUtils.isEqual(val, inpVal)).join(','), { type: 'update' })
|
|
832
|
+
} else {
|
|
833
|
+
emitModel(dateMultipleValue.concat([inpVal]).join(','), { type: 'update' })
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
} else {
|
|
837
|
+
// 如果为单选
|
|
838
|
+
if (!XEUtils.isEqual(modelValue, inpVal)) {
|
|
839
|
+
emitModel(inpVal, { type: 'update' })
|
|
840
|
+
}
|
|
775
841
|
}
|
|
776
842
|
}
|
|
777
843
|
|
|
@@ -1048,8 +1114,10 @@ export default defineComponent({
|
|
|
1048
1114
|
|
|
1049
1115
|
const dateTodayMonthEvent = (evnt: Event) => {
|
|
1050
1116
|
dateNowHandle()
|
|
1051
|
-
|
|
1052
|
-
|
|
1117
|
+
if (!props.multiple) {
|
|
1118
|
+
dateChange(reactData.currentDate)
|
|
1119
|
+
hidePanel()
|
|
1120
|
+
}
|
|
1053
1121
|
inputMethods.dispatchEvent('date-today', { type: props.type }, evnt)
|
|
1054
1122
|
}
|
|
1055
1123
|
|
|
@@ -1086,7 +1154,7 @@ export default defineComponent({
|
|
|
1086
1154
|
}
|
|
1087
1155
|
|
|
1088
1156
|
const dateSelectItem = (date: Date) => {
|
|
1089
|
-
const { type } = props
|
|
1157
|
+
const { type, multiple } = props
|
|
1090
1158
|
const { datePanelType } = reactData
|
|
1091
1159
|
if (type === 'month') {
|
|
1092
1160
|
if (datePanelType === 'year') {
|
|
@@ -1094,18 +1162,24 @@ export default defineComponent({
|
|
|
1094
1162
|
dateCheckMonth(date)
|
|
1095
1163
|
} else {
|
|
1096
1164
|
dateChange(date)
|
|
1097
|
-
|
|
1165
|
+
if (!multiple) {
|
|
1166
|
+
hidePanel()
|
|
1167
|
+
}
|
|
1098
1168
|
}
|
|
1099
1169
|
} else if (type === 'year') {
|
|
1100
1170
|
dateChange(date)
|
|
1101
|
-
|
|
1171
|
+
if (!multiple) {
|
|
1172
|
+
hidePanel()
|
|
1173
|
+
}
|
|
1102
1174
|
} else if (type === 'quarter') {
|
|
1103
1175
|
if (datePanelType === 'year') {
|
|
1104
1176
|
reactData.datePanelType = 'quarter'
|
|
1105
1177
|
dateCheckMonth(date)
|
|
1106
1178
|
} else {
|
|
1107
1179
|
dateChange(date)
|
|
1108
|
-
|
|
1180
|
+
if (!multiple) {
|
|
1181
|
+
hidePanel()
|
|
1182
|
+
}
|
|
1109
1183
|
}
|
|
1110
1184
|
} else {
|
|
1111
1185
|
if (datePanelType === 'month') {
|
|
@@ -1116,7 +1190,9 @@ export default defineComponent({
|
|
|
1116
1190
|
dateCheckMonth(date)
|
|
1117
1191
|
} else {
|
|
1118
1192
|
dateChange(date)
|
|
1119
|
-
|
|
1193
|
+
if (!multiple) {
|
|
1194
|
+
hidePanel()
|
|
1195
|
+
}
|
|
1120
1196
|
}
|
|
1121
1197
|
}
|
|
1122
1198
|
}
|
|
@@ -1201,8 +1277,11 @@ export default defineComponent({
|
|
|
1201
1277
|
}
|
|
1202
1278
|
|
|
1203
1279
|
const dateConfirmEvent = () => {
|
|
1280
|
+
const { type } = props
|
|
1204
1281
|
const dateValue = computeDateValue.value
|
|
1205
|
-
|
|
1282
|
+
if (type === 'datetime') {
|
|
1283
|
+
dateChange(dateValue || reactData.currentDate)
|
|
1284
|
+
}
|
|
1206
1285
|
hidePanel()
|
|
1207
1286
|
}
|
|
1208
1287
|
|
|
@@ -1590,10 +1669,12 @@ export default defineComponent({
|
|
|
1590
1669
|
}
|
|
1591
1670
|
|
|
1592
1671
|
const renderDateDayTable = () => {
|
|
1672
|
+
const { multiple } = props
|
|
1593
1673
|
const { datePanelType, datePanelValue } = reactData
|
|
1594
1674
|
const dateValue = computeDateValue.value
|
|
1595
1675
|
const dateHeaders = computeDateHeaders.value
|
|
1596
1676
|
const dayDatas = computeDayDatas.value
|
|
1677
|
+
const dateListValue = computeDateListValue.value
|
|
1597
1678
|
const matchFormat = 'yyyyMMdd'
|
|
1598
1679
|
return [
|
|
1599
1680
|
h('table', {
|
|
@@ -1616,7 +1697,7 @@ export default defineComponent({
|
|
|
1616
1697
|
'is--now': item.isNow,
|
|
1617
1698
|
'is--next': item.isNext,
|
|
1618
1699
|
'is--disabled': isDateDisabled(item),
|
|
1619
|
-
'is--selected': XEUtils.isDateSame(dateValue, item.date, matchFormat),
|
|
1700
|
+
'is--selected': multiple ? dateListValue.some(val => XEUtils.isDateSame(val, item.date, matchFormat)) : XEUtils.isDateSame(dateValue, item.date, matchFormat),
|
|
1620
1701
|
'is--hover': XEUtils.isDateSame(datePanelValue, item.date, matchFormat)
|
|
1621
1702
|
},
|
|
1622
1703
|
onClick: () => dateSelectEvent(item),
|
|
@@ -1629,10 +1710,12 @@ export default defineComponent({
|
|
|
1629
1710
|
}
|
|
1630
1711
|
|
|
1631
1712
|
const renderDateWeekTable = () => {
|
|
1713
|
+
const { multiple } = props
|
|
1632
1714
|
const { datePanelType, datePanelValue } = reactData
|
|
1633
1715
|
const dateValue = computeDateValue.value
|
|
1634
1716
|
const weekHeaders = computeWeekHeaders.value
|
|
1635
1717
|
const weekDates = computeWeekDates.value
|
|
1718
|
+
const dateListValue = computeDateListValue.value
|
|
1636
1719
|
const matchFormat = 'yyyyMMdd'
|
|
1637
1720
|
return [
|
|
1638
1721
|
h('table', {
|
|
@@ -1647,7 +1730,7 @@ export default defineComponent({
|
|
|
1647
1730
|
}))
|
|
1648
1731
|
]),
|
|
1649
1732
|
h('tbody', weekDates.map((rows) => {
|
|
1650
|
-
const isSelected = rows.some((item) => XEUtils.isDateSame(dateValue, item.date, matchFormat))
|
|
1733
|
+
const isSelected = multiple ? rows.some((item) => dateListValue.some(val => XEUtils.isDateSame(val, item.date, matchFormat))) : rows.some((item) => XEUtils.isDateSame(dateValue, item.date, matchFormat))
|
|
1651
1734
|
const isHover = rows.some((item) => XEUtils.isDateSame(datePanelValue, item.date, matchFormat))
|
|
1652
1735
|
return h('tr', rows.map((item) => {
|
|
1653
1736
|
return h('td', {
|
|
@@ -1671,9 +1754,11 @@ export default defineComponent({
|
|
|
1671
1754
|
}
|
|
1672
1755
|
|
|
1673
1756
|
const renderDateMonthTable = () => {
|
|
1757
|
+
const { multiple } = props
|
|
1674
1758
|
const { datePanelType, datePanelValue } = reactData
|
|
1675
1759
|
const dateValue = computeDateValue.value
|
|
1676
1760
|
const monthDatas = computeMonthDatas.value
|
|
1761
|
+
const dateListValue = computeDateListValue.value
|
|
1677
1762
|
const matchFormat = 'yyyyMM'
|
|
1678
1763
|
return [
|
|
1679
1764
|
h('table', {
|
|
@@ -1691,7 +1776,7 @@ export default defineComponent({
|
|
|
1691
1776
|
'is--now': item.isNow,
|
|
1692
1777
|
'is--next': item.isNext,
|
|
1693
1778
|
'is--disabled': isDateDisabled(item),
|
|
1694
|
-
'is--selected': XEUtils.isDateSame(dateValue, item.date, matchFormat),
|
|
1779
|
+
'is--selected': multiple ? dateListValue.some(val => XEUtils.isDateSame(val, item.date, matchFormat)) : XEUtils.isDateSame(dateValue, item.date, matchFormat),
|
|
1695
1780
|
'is--hover': XEUtils.isDateSame(datePanelValue, item.date, matchFormat)
|
|
1696
1781
|
},
|
|
1697
1782
|
onClick: () => dateSelectEvent(item),
|
|
@@ -1704,9 +1789,11 @@ export default defineComponent({
|
|
|
1704
1789
|
}
|
|
1705
1790
|
|
|
1706
1791
|
const renderDateQuarterTable = () => {
|
|
1792
|
+
const { multiple } = props
|
|
1707
1793
|
const { datePanelType, datePanelValue } = reactData
|
|
1708
1794
|
const dateValue = computeDateValue.value
|
|
1709
1795
|
const quarterDatas = computeQuarterDatas.value
|
|
1796
|
+
const dateListValue = computeDateListValue.value
|
|
1710
1797
|
const matchFormat = 'yyyyq'
|
|
1711
1798
|
return [
|
|
1712
1799
|
h('table', {
|
|
@@ -1724,7 +1811,7 @@ export default defineComponent({
|
|
|
1724
1811
|
'is--now': item.isNow,
|
|
1725
1812
|
'is--next': item.isNext,
|
|
1726
1813
|
'is--disabled': isDateDisabled(item),
|
|
1727
|
-
'is--selected': XEUtils.isDateSame(dateValue, item.date, matchFormat),
|
|
1814
|
+
'is--selected': multiple ? dateListValue.some(val => XEUtils.isDateSame(val, item.date, matchFormat)) : XEUtils.isDateSame(dateValue, item.date, matchFormat),
|
|
1728
1815
|
'is--hover': XEUtils.isDateSame(datePanelValue, item.date, matchFormat)
|
|
1729
1816
|
},
|
|
1730
1817
|
onClick: () => dateSelectEvent(item),
|
|
@@ -1737,9 +1824,11 @@ export default defineComponent({
|
|
|
1737
1824
|
}
|
|
1738
1825
|
|
|
1739
1826
|
const renderDateYearTable = () => {
|
|
1827
|
+
const { multiple } = props
|
|
1740
1828
|
const { datePanelType, datePanelValue } = reactData
|
|
1741
1829
|
const dateValue = computeDateValue.value
|
|
1742
1830
|
const yearDatas = computeYearDatas.value
|
|
1831
|
+
const dateListValue = computeDateListValue.value
|
|
1743
1832
|
const matchFormat = 'yyyy'
|
|
1744
1833
|
return [
|
|
1745
1834
|
h('table', {
|
|
@@ -1752,10 +1841,12 @@ export default defineComponent({
|
|
|
1752
1841
|
return h('tr', rows.map((item) => {
|
|
1753
1842
|
return h('td', {
|
|
1754
1843
|
class: {
|
|
1755
|
-
'is--
|
|
1844
|
+
'is--prev': item.isPrev,
|
|
1756
1845
|
'is--current': item.isCurrent,
|
|
1757
1846
|
'is--now': item.isNow,
|
|
1758
|
-
'is--
|
|
1847
|
+
'is--next': item.isNext,
|
|
1848
|
+
'is--disabled': isDateDisabled(item),
|
|
1849
|
+
'is--selected': multiple ? dateListValue.some(val => XEUtils.isDateSame(val, item.date, matchFormat)) : XEUtils.isDateSame(dateValue, item.date, matchFormat),
|
|
1759
1850
|
'is--hover': XEUtils.isDateSame(datePanelValue, item.date, matchFormat)
|
|
1760
1851
|
},
|
|
1761
1852
|
onClick: () => dateSelectEvent(item),
|
|
@@ -1783,6 +1874,7 @@ export default defineComponent({
|
|
|
1783
1874
|
}
|
|
1784
1875
|
|
|
1785
1876
|
const renderDatePanel = () => {
|
|
1877
|
+
const { multiple } = props
|
|
1786
1878
|
const { datePanelType } = reactData
|
|
1787
1879
|
const isDisabledPrevDateBtn = computeIsDisabledPrevDateBtn.value
|
|
1788
1880
|
const isDisabledNextDateBtn = computeIsDisabledNextDateBtn.value
|
|
@@ -1831,7 +1923,16 @@ export default defineComponent({
|
|
|
1831
1923
|
h('i', {
|
|
1832
1924
|
class: 'vxe-icon--caret-right'
|
|
1833
1925
|
})
|
|
1834
|
-
])
|
|
1926
|
+
]),
|
|
1927
|
+
multiple && computeSupportMultiples.value ? h('span', {
|
|
1928
|
+
class: 'vxe-input--date-picker-btn vxe-input--date-picker-confirm-btn'
|
|
1929
|
+
}, [
|
|
1930
|
+
h('button', {
|
|
1931
|
+
class: 'vxe-input--date-picker-confirm',
|
|
1932
|
+
type: 'button',
|
|
1933
|
+
onClick: dateConfirmEvent
|
|
1934
|
+
}, GlobalConfig.i18n('vxe.button.confirm'))
|
|
1935
|
+
]) : null
|
|
1835
1936
|
])
|
|
1836
1937
|
]),
|
|
1837
1938
|
h('div', {
|
|
@@ -2138,7 +2239,7 @@ export default defineComponent({
|
|
|
2138
2239
|
const isDatePickerType = computeIsDatePickerType.value
|
|
2139
2240
|
if (isDatePickerType) {
|
|
2140
2241
|
dateParseValue(reactData.datePanelValue)
|
|
2141
|
-
reactData.inputValue = reactData.datePanelLabel
|
|
2242
|
+
reactData.inputValue = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel
|
|
2142
2243
|
}
|
|
2143
2244
|
})
|
|
2144
2245
|
|
|
@@ -66,8 +66,12 @@ const tableKeyboardHook: VxeGlobalHooksHandles.HookOptions = {
|
|
|
66
66
|
const { elemStore } = internalData
|
|
67
67
|
const disX = evnt.clientX
|
|
68
68
|
const disY = evnt.clientY
|
|
69
|
-
const
|
|
70
|
-
const
|
|
69
|
+
const bodyWrapperRef = elemStore[`${column.fixed || 'main'}-body-wrapper`] || elemStore['main-body-wrapper']
|
|
70
|
+
const bodyWrapperElem = bodyWrapperRef ? bodyWrapperRef.value : null
|
|
71
|
+
if (!bodyWrapperElem) {
|
|
72
|
+
return
|
|
73
|
+
}
|
|
74
|
+
const checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range') as HTMLElement
|
|
71
75
|
const domMousemove = document.onmousemove
|
|
72
76
|
const domMouseup = document.onmouseup
|
|
73
77
|
const trElem = cell.parentNode
|
|
@@ -480,8 +480,10 @@ export default defineComponent({
|
|
|
480
480
|
const bodyElem = tableBody.$el as XEBodyScrollElement
|
|
481
481
|
const leftElem = leftBody ? leftBody.$el as XEBodyScrollElement : null
|
|
482
482
|
const rightElem = rightBody ? rightBody.$el as XEBodyScrollElement : null
|
|
483
|
-
const
|
|
484
|
-
const
|
|
483
|
+
const bodyYRef = elemStore['main-body-ySpace']
|
|
484
|
+
const bodyYElem = bodyYRef ? bodyYRef.value : null
|
|
485
|
+
const bodyXRef = elemStore['main-body-xSpace']
|
|
486
|
+
const bodyXElem = bodyXRef ? bodyXRef.value : null
|
|
485
487
|
const bodyHeight = scrollYLoad && bodyYElem ? bodyYElem.clientHeight : bodyElem.clientHeight
|
|
486
488
|
const bodyWidth = scrollXLoad && bodyXElem ? bodyXElem.clientWidth : bodyElem.clientWidth
|
|
487
489
|
let scrollTop = scrollBodyElem.scrollTop
|
|
@@ -554,8 +556,10 @@ export default defineComponent({
|
|
|
554
556
|
const leftElem = leftBody ? leftBody.$el as HTMLDivElement : null
|
|
555
557
|
const rightElem = rightBody ? rightBody.$el as HTMLDivElement : null
|
|
556
558
|
const bodyElem = tableBody.$el as HTMLDivElement
|
|
557
|
-
const
|
|
558
|
-
const
|
|
559
|
+
const bodyYRef = elemStore['main-body-ySpace']
|
|
560
|
+
const bodyYElem = bodyYRef ? bodyYRef.value : null
|
|
561
|
+
const bodyXRef = elemStore['main-body-xSpace']
|
|
562
|
+
const bodyXElem = bodyXRef ? bodyXRef.value : null
|
|
559
563
|
const bodyHeight = scrollYLoad && bodyYElem ? bodyYElem.clientHeight : bodyElem.clientHeight
|
|
560
564
|
const bodyWidth = scrollXLoad && bodyXElem ? bodyXElem.clientWidth : bodyElem.clientWidth
|
|
561
565
|
const remainSize = isPrevWheelTop === isTopWheel ? Math.max(0, wheelYSize - wheelYTotal) : 0
|
|
@@ -649,13 +653,13 @@ export default defineComponent({
|
|
|
649
653
|
const { elemStore } = tableInternalData
|
|
650
654
|
const prefix = `${fixedType || 'main'}-body-`
|
|
651
655
|
const el = refElem.value
|
|
652
|
-
elemStore[`${prefix}wrapper`] = refElem
|
|
653
|
-
elemStore[`${prefix}table`] = refBodyTable
|
|
654
|
-
elemStore[`${prefix}colgroup`] = refBodyColgroup
|
|
655
|
-
elemStore[`${prefix}list`] = refBodyTBody
|
|
656
|
-
elemStore[`${prefix}xSpace`] = refBodyXSpace
|
|
657
|
-
elemStore[`${prefix}ySpace`] = refBodyYSpace
|
|
658
|
-
elemStore[`${prefix}emptyBlock`] = refBodyEmptyBlock
|
|
656
|
+
elemStore[`${prefix}wrapper`] = refElem
|
|
657
|
+
elemStore[`${prefix}table`] = refBodyTable
|
|
658
|
+
elemStore[`${prefix}colgroup`] = refBodyColgroup
|
|
659
|
+
elemStore[`${prefix}list`] = refBodyTBody
|
|
660
|
+
elemStore[`${prefix}xSpace`] = refBodyXSpace
|
|
661
|
+
elemStore[`${prefix}ySpace`] = refBodyYSpace
|
|
662
|
+
elemStore[`${prefix}emptyBlock`] = refBodyEmptyBlock
|
|
659
663
|
el.onscroll = scrollEvent
|
|
660
664
|
el._onscroll = scrollEvent
|
|
661
665
|
})
|