mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-04 13:09:28 +08:00
fix: 修复高级搜索时间控件不能正确重置的bug
This commit is contained in:
parent
dfde0171dd
commit
323b341113
@ -22,23 +22,25 @@
|
||||
name: "MsTableSearchDatePicker",
|
||||
components: {MsTableSearchComponent},
|
||||
props: ['component'],
|
||||
data() {
|
||||
return {
|
||||
type: "daterange"
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
change(value) {
|
||||
if (value === OPERATORS.BETWEEN.value) {
|
||||
if (!Array.isArray(this.component.value)) {
|
||||
this.component.value = [];
|
||||
}
|
||||
this.type = "daterange";
|
||||
} else {
|
||||
if (Array.isArray(this.component.value)) {
|
||||
this.component.value = "";
|
||||
}
|
||||
this.type = "date";
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
type() {
|
||||
if (this.component.operator.value === OPERATORS.BETWEEN.value) {
|
||||
return "daterange";
|
||||
} else {
|
||||
return "date";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,23 +21,25 @@
|
||||
name: "MsTableSearchDateTimePicker",
|
||||
components: {MsTableSearchComponent},
|
||||
props: ['component'],
|
||||
data() {
|
||||
return {
|
||||
type: "datetimerange"
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
change(value) {
|
||||
if (value === OPERATORS.BETWEEN.value) {
|
||||
if (!Array.isArray(this.component.value)) {
|
||||
this.component.value = [];
|
||||
}
|
||||
this.type = "datetimerange";
|
||||
} else {
|
||||
if (Array.isArray(this.component.value)) {
|
||||
this.component.value = "";
|
||||
}
|
||||
this.type = "datetime";
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
type() {
|
||||
if (this.component.operator.value === OPERATORS.BETWEEN.value) {
|
||||
return "datetimerange";
|
||||
} else {
|
||||
return "datetime";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user