web-component-gallery 2.2.28 → 2.2.31
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/js.umd.js +1 -1
- package/lib/descriptions-list/index.jsx +23 -16
- package/lib/form-comp/ARangePicker.vue +13 -10
- package/package.json +1 -1
|
@@ -76,27 +76,34 @@ const DescriptionsList = {
|
|
|
76
76
|
|
|
77
77
|
},
|
|
78
78
|
mounted() {
|
|
79
|
-
|
|
79
|
+
this.setDescContentWidth()
|
|
80
80
|
this.$bus.$onWindow(this, 'resize', this.setDescContentWidth)
|
|
81
81
|
},
|
|
82
82
|
methods: {
|
|
83
83
|
setDescContentWidth() {
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
84
|
+
const retry = () => {
|
|
85
|
+
const elementG = this.$refs.Descriptions.querySelectorAll('.ant-descriptions-item-content')
|
|
86
|
+
const width = document.querySelector('.ant-descriptions-view').offsetWidth
|
|
87
|
+
const labelWidth = document.querySelector('.ant-descriptions-item-label').offsetWidth
|
|
88
|
+
const { column, descSettings } = this
|
|
89
|
+
if (width === 0) {
|
|
90
|
+
setTimeout(retry, 100) // 重试间隔100ms
|
|
91
|
+
return
|
|
92
|
+
}
|
|
93
|
+
for (let i = 0; i < elementG.length; i++) {
|
|
94
|
+
const contentWidth = (
|
|
95
|
+
descSettings[i].span ?
|
|
96
|
+
width * (descSettings[i].span / column) :
|
|
97
|
+
width / column ) - labelWidth + 'px'
|
|
98
|
+
const element = elementG[i]
|
|
99
|
+
element.style = `
|
|
100
|
+
width: ${contentWidth};
|
|
101
|
+
min-width: ${contentWidth};
|
|
102
|
+
max-width: ${contentWidth};
|
|
103
|
+
`
|
|
104
|
+
}
|
|
99
105
|
}
|
|
106
|
+
retry() // 初始调用
|
|
100
107
|
}
|
|
101
108
|
}
|
|
102
109
|
}
|
|
@@ -55,13 +55,16 @@ export default {
|
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
watch: {
|
|
58
|
-
value
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
value: {
|
|
59
|
+
handler(newVal, oldVal) {
|
|
60
|
+
if (newVal.toString() === oldVal.toString()) return
|
|
61
|
+
this.date = [...newVal]
|
|
62
|
+
},
|
|
63
|
+
immediate: true
|
|
61
64
|
},
|
|
62
|
-
|
|
63
|
-
handler(
|
|
64
|
-
this.$emit('update:rangePicker',
|
|
65
|
+
date: {
|
|
66
|
+
handler(newVal) {
|
|
67
|
+
this.$emit('update:rangePicker', newVal.length === 2 ? [...newVal] : [])
|
|
65
68
|
},
|
|
66
69
|
deep: true
|
|
67
70
|
}
|
|
@@ -72,7 +75,7 @@ export default {
|
|
|
72
75
|
return {
|
|
73
76
|
...defaultConfig,
|
|
74
77
|
placeholder: '开始日期',
|
|
75
|
-
disabledDate: this.disabledStartDate,
|
|
78
|
+
// disabledDate: this.disabledStartDate,
|
|
76
79
|
...this.startConfig
|
|
77
80
|
}
|
|
78
81
|
},
|
|
@@ -81,7 +84,7 @@ export default {
|
|
|
81
84
|
return {
|
|
82
85
|
...defaultConfig,
|
|
83
86
|
placeholder: '结束日期',
|
|
84
|
-
disabledDate: this.disabledEndDate,
|
|
87
|
+
// disabledDate: this.disabledEndDate,
|
|
85
88
|
...this.endConfig
|
|
86
89
|
}
|
|
87
90
|
}
|
|
@@ -103,10 +106,10 @@ export default {
|
|
|
103
106
|
}
|
|
104
107
|
const startDate = moment(startValue, this.startPickerAttrs.valueFormat)
|
|
105
108
|
const endDate = moment(endValue, this.endPickerAttrs.valueFormat)
|
|
106
|
-
return
|
|
109
|
+
return endDate.valueOf() < startDate.valueOf()
|
|
107
110
|
},
|
|
108
111
|
handleStartOpenChange(open) {
|
|
109
|
-
if (!open) {
|
|
112
|
+
if (!open) {
|
|
110
113
|
this.endOpen = true
|
|
111
114
|
}
|
|
112
115
|
},
|