feat: 列表冲突处理

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

@ -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) {

Loading…
Cancel
Save