update SearchForm
This commit is contained in:
부모
d906ac949a
커밋
c012bf7675
@ -92,7 +92,6 @@ export default {
|
||||
"select",
|
||||
res.data.list.map((item) => ({ label: item.name, value: item.id }))
|
||||
);
|
||||
console.log("[update] 更新选项列表", res, field.select);
|
||||
}
|
||||
} else {
|
||||
this.$message({
|
||||
|
@ -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]) {
|
||||
|
@ -32,7 +32,7 @@ export default function () {
|
||||
|
||||
const headFormFields = [
|
||||
{
|
||||
prop: 'materialID',
|
||||
prop: 'materialId',
|
||||
label: "物料",
|
||||
// default: { value: "" },
|
||||
select: [],
|
||||
@ -59,7 +59,10 @@ export default function () {
|
||||
prop: 'timerange', // 应该是个数组,在提交数据时需单独处理
|
||||
label: '时间段',
|
||||
bind: {
|
||||
placeholder: '选择日期时间'
|
||||
placeholder: '选择日期时间',
|
||||
type: 'datetimerange',
|
||||
"start-placeholder": "开始时间",
|
||||
"end-placeholder": "结束时间",
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<ListViewWithHead :table-config="tableConfig" :head-config="headFormConfigs" :dialog-configs="dialogConfigs" :listQueryExtra="['name']" />
|
||||
<ListViewWithHead :table-config="tableConfig" :head-config="headFormConfigs" :dialog-configs="dialogConfigs" :listQueryExtra="[]" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
불러오는 중...
Reference in New Issue
Block a user