因为使用的是同一个prop值
1.将俩个值修改成不同的
2.给其中一个设置hide:true
{
label: "建设日期",
prop: "buildDaterange",
type: "daterange",
format: 'yyyy-MM-dd',
searchRange: true,
valueFormat: 'yyyy-MM-dd',
search: true,
hide: true,
addDisplay: false,
editDisplay: false
},
{
label: "建设日期",
prop: "buildDate",
type: "date",
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
},
3.在onload中修改请求参数
onLoad(page, params = {}) {
this.loading = true
if (this.query.buildDaterange) {
this.query.buildDateStart = this.query.buildDaterange[0];
this.query.buildDateEnd = this.query.buildDaterange[1];
delete this.query.buildDaterange;
}
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data
this.page.total = data.total
this.data = data.records
this.loading = false
this.selectionClear()
})
}