From 661a1f222e02df50cb81bc4a6a996a33d29ba754 Mon Sep 17 00:00:00 2001 From: liushilong <2224574157@qq.com> Date: Wed, 20 Mar 2024 10:14:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=97=E8=A1=A8=E5=86=B2=E7=AA=81?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/final/content/Content.vue | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/views/final/content/Content.vue b/src/views/final/content/Content.vue index 429f307..a8fa697 100644 --- a/src/views/final/content/Content.vue +++ b/src/views/final/content/Content.vue @@ -156,8 +156,8 @@ async function getColumns() { const useList = res.data; const userFieldFixed = useList.userFieldFixed?.split(","); const userFieldUnFixed = useList.userFieldUnFixed?.split(","); - console.log(userFieldFixed,userFieldUnFixed,'userFieldUnFixed') - console.log(allList,'allList') + console.log(userFieldFixed, userFieldUnFixed, "userFieldUnFixed"); + console.log(allList, "allList"); allList?.map((v) => { if (!userFieldFixed?.length && !userFieldUnFixed?.length) { if (v.isrequired == 2) { @@ -201,7 +201,10 @@ async function getColumns() { }); }, }); + formatColumns(); +} +async function formatColumns() { // TODO处理特殊字段 let index; index = columnsRef.value.findIndex((v) => v.title == "任务名称"); @@ -220,7 +223,7 @@ async function getColumns() { if (index > -1) { columnsRef.value[index] = { title: "审批状态", - key: "states", + key: columnsRef.value[index]["key"], width: 100, sorter: "default", renderSorterIcon: ({ order }) => { @@ -240,7 +243,7 @@ async function getColumns() { if (index > -1) { columnsRef.value[index] = { title: "图片相似度", - key: "similarityscore", + key: columnsRef.value[index]["key"], width: 150, sorter: "default", renderSorterIcon: ({ order }) => { @@ -257,7 +260,7 @@ async function getColumns() { if (index > -1) { columnsRef.value[index] = { title: "提报时间", - key: "createdate", + key: columnsRef.value[index]["key"], width: 200, sorter: "default", renderSorterIcon: ({ order }) => { @@ -275,7 +278,7 @@ async function getColumns() { if (index > -1) { columnsRef.value[index] = { title: "更新时间", - key: "updatetime", + key: columnsRef.value[index]["key"], width: 200, render(row: any) { return row.updatetime ? formatToDateHMS(row.updatetime) : ""; @@ -462,7 +465,6 @@ function sucessHandler(excelData) { } function commitHandler(columns) { - console.log(columns, "commitHandler"); columnsRef.value = [ ...columns, { @@ -481,6 +483,7 @@ function commitHandler(columns) { }, }, ]; + formatColumns(); } function actionHandler(action: any, row: any) {