update SearchForm
This commit is contained in:
@@ -50,6 +50,7 @@ import BaseListTable from "@/components/BaseListTable.vue";
|
||||
import BaseSearchForm from "@/components/BaseSearchForm.vue";
|
||||
import DialogWithMenu from "@/components/DialogWithMenu.vue";
|
||||
import DialogJustForm from "@/components/DialogJustForm.vue";
|
||||
import moment from 'moment'
|
||||
|
||||
const DIALOG_WITH_MENU = "DialogWithMenu";
|
||||
const DIALOG_JUST_FORM = "DialogJustForm";
|
||||
@@ -309,6 +310,20 @@ export default {
|
||||
break;
|
||||
case "查询": {
|
||||
const params = {};
|
||||
|
||||
/** 处理 payload 里的数据 */
|
||||
if (typeof payload === 'object') {
|
||||
// BaseSearchForm 给这个组件传递了数据
|
||||
Object.assign(params, payload)
|
||||
if ('timerange' in params && !!params.timerange) {
|
||||
const [startTime, endTime] = params['timerange']
|
||||
delete params.timerange
|
||||
params.startTime = moment(startTime).format('YYYY-MM-DD HH:mm:ss')
|
||||
params.endTime = moment(endTime).format('YYYY-MM-DD HH:mm:ss')
|
||||
}
|
||||
}
|
||||
|
||||
/** 处理 listQueryExtra 里的数据 */
|
||||
this.listQueryExtra?.map((cond) => {
|
||||
if (typeof cond === "string") {
|
||||
if (!!payload[cond]) {
|
||||
|
||||
Reference in New Issue
Block a user