|
|
@ -58,21 +58,8 @@ const tableColumns = ref(DemandforecastingMain.allSchemas.tableColumns) |
|
|
|
const updataTableColumns = (val) => { |
|
|
|
orginTableColumns.value = val |
|
|
|
} |
|
|
|
const updateDateTableColumns = ()=>{ |
|
|
|
console.log('tableObjectHead',tableObjectHead) |
|
|
|
let dateColumns = [] |
|
|
|
tableObjectHead.tableList.forEach(item=>{ |
|
|
|
dateColumns.push({ |
|
|
|
field: item, |
|
|
|
label: item, |
|
|
|
table:{ |
|
|
|
width: 120 |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
tableColumns.value = [...orginTableColumns.value,...dateColumns] |
|
|
|
console.log('tableColumns',tableColumns.value) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
|
const searchQueryTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
@ -102,6 +89,24 @@ const { tableObject:tableObjectHead, tableMethods:tableMethodsHead } = useTable( |
|
|
|
// 获得表格的各种操作 |
|
|
|
const { getList:getListHead, setSearchParams:setSearchParamsHead } = tableMethodsHead |
|
|
|
|
|
|
|
watch(()=>tableObjectHead.tableList,()=>{ |
|
|
|
updateDateTableColumns() |
|
|
|
},{deep:true}) |
|
|
|
const updateDateTableColumns = ()=>{ |
|
|
|
console.log('tableObjectHead',tableObjectHead) |
|
|
|
let dateColumns = [] |
|
|
|
tableObjectHead.tableList.forEach(item=>{ |
|
|
|
dateColumns.push({ |
|
|
|
field: item, |
|
|
|
label: item, |
|
|
|
table:{ |
|
|
|
width: 120 |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
tableColumns.value = [...orginTableColumns.value,...dateColumns] |
|
|
|
console.log('tableColumns',tableColumns.value) |
|
|
|
} |
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
|
getListApi: DemandforecastingDetailApi.getDemandforecastingDetailPage // 分页接口 |
|
|
|
}) |
|
|
@ -128,7 +133,7 @@ const buttonBaseClick = async (val, item) => { |
|
|
|
}) |
|
|
|
} else { |
|
|
|
await getListHead() |
|
|
|
updateDateTableColumns() |
|
|
|
// updateDateTableColumns() |
|
|
|
getList() |
|
|
|
|
|
|
|
} |
|
|
@ -143,7 +148,7 @@ const buttonBaseClick = async (val, item) => { |
|
|
|
const searchClick = async (data)=>{ |
|
|
|
console.log('searchClick',data) |
|
|
|
await setSearchParamsHead(data) |
|
|
|
updateDateTableColumns() |
|
|
|
// updateDateTableColumns() |
|
|
|
setSearchParams(data) |
|
|
|
} |
|
|
|
/** 导出按钮操作 */ |
|
|
@ -181,7 +186,7 @@ const searchFormClick = (searchData) => { |
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
await getListHead() |
|
|
|
updateDateTableColumns() |
|
|
|
// updateDateTableColumns() |
|
|
|
getList() |
|
|
|
importTemplateData.templateUrl = await DemandforecastingMainApi.importTemplate() |
|
|
|
}) |
|
|
|