feat: 列表冲突处理

bak
刘释隆 1 year ago
parent 5744f7de5c
commit 661a1f222e

@ -156,8 +156,8 @@ async function getColumns() {
const useList = res.data; const useList = res.data;
const userFieldFixed = useList.userFieldFixed?.split(","); const userFieldFixed = useList.userFieldFixed?.split(",");
const userFieldUnFixed = useList.userFieldUnFixed?.split(","); const userFieldUnFixed = useList.userFieldUnFixed?.split(",");
console.log(userFieldFixed,userFieldUnFixed,'userFieldUnFixed') console.log(userFieldFixed, userFieldUnFixed, "userFieldUnFixed");
console.log(allList,'allList') console.log(allList, "allList");
allList?.map((v) => { allList?.map((v) => {
if (!userFieldFixed?.length && !userFieldUnFixed?.length) { if (!userFieldFixed?.length && !userFieldUnFixed?.length) {
if (v.isrequired == 2) { if (v.isrequired == 2) {
@ -201,7 +201,10 @@ async function getColumns() {
}); });
}, },
}); });
formatColumns();
}
async function formatColumns() {
// TODO // TODO
let index; let index;
index = columnsRef.value.findIndex((v) => v.title == "任务名称"); index = columnsRef.value.findIndex((v) => v.title == "任务名称");
@ -220,7 +223,7 @@ async function getColumns() {
if (index > -1) { if (index > -1) {
columnsRef.value[index] = { columnsRef.value[index] = {
title: "审批状态", title: "审批状态",
key: "states", key: columnsRef.value[index]["key"],
width: 100, width: 100,
sorter: "default", sorter: "default",
renderSorterIcon: ({ order }) => { renderSorterIcon: ({ order }) => {
@ -240,7 +243,7 @@ async function getColumns() {
if (index > -1) { if (index > -1) {
columnsRef.value[index] = { columnsRef.value[index] = {
title: "图片相似度", title: "图片相似度",
key: "similarityscore", key: columnsRef.value[index]["key"],
width: 150, width: 150,
sorter: "default", sorter: "default",
renderSorterIcon: ({ order }) => { renderSorterIcon: ({ order }) => {
@ -257,7 +260,7 @@ async function getColumns() {
if (index > -1) { if (index > -1) {
columnsRef.value[index] = { columnsRef.value[index] = {
title: "提报时间", title: "提报时间",
key: "createdate", key: columnsRef.value[index]["key"],
width: 200, width: 200,
sorter: "default", sorter: "default",
renderSorterIcon: ({ order }) => { renderSorterIcon: ({ order }) => {
@ -275,7 +278,7 @@ async function getColumns() {
if (index > -1) { if (index > -1) {
columnsRef.value[index] = { columnsRef.value[index] = {
title: "更新时间", title: "更新时间",
key: "updatetime", key: columnsRef.value[index]["key"],
width: 200, width: 200,
render(row: any) { render(row: any) {
return row.updatetime ? formatToDateHMS(row.updatetime) : ""; return row.updatetime ? formatToDateHMS(row.updatetime) : "";
@ -462,7 +465,6 @@ function sucessHandler(excelData) {
} }
function commitHandler(columns) { function commitHandler(columns) {
console.log(columns, "commitHandler");
columnsRef.value = [ columnsRef.value = [
...columns, ...columns,
{ {
@ -481,6 +483,7 @@ function commitHandler(columns) {
}, },
}, },
]; ];
formatColumns();
} }
function actionHandler(action: any, row: any) { function actionHandler(action: any, row: any) {

Loading…
Cancel
Save