From d29b78e8b0260747fbdb7288286a0695e248ed7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=96=AA=E5=90=8D?= <942005050@qq.com> Date: Sun, 22 Oct 2023 19:02:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E6=AE=B5=E8=AE=BE=E7=BD=AE=E5=AE=8C?= =?UTF-8?q?=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/rowDrop/index.vue | 55 +++++++++++++++++++------------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/src/components/rowDrop/index.vue b/src/components/rowDrop/index.vue index e595fa21c..4a05cf525 100644 --- a/src/components/rowDrop/index.vue +++ b/src/components/rowDrop/index.vue @@ -94,23 +94,21 @@ const formatData = (val) => { // 保存 const save = () => { - let saveDate = tableColumnsFun[props.routeName].allSchemas.tableColumns - sort(saveDate, allData) - console.log(99, saveDate) - - // // 默认列表第一列(弹出详情用) - // saveDate.push(tableColumnsFun[props.routeName].allSchemas.tableColumns[0]) - // // 默认列表最后一列(操作) - // saveDate.push(tableColumnsFun[props.routeName].allSchemas.tableColumns[tableColumnsFun[props.routeName].allSchemas.tableColumns.length-1]) - // checkedDataList.value.forEach((item,index) => { - // item.isTable = false - // if (tableColumnsFun[props.routeName].allSchemas.tableColumns.indexOf(item) > 0) { - // item.isTable = true - // saveDate.push(item) - // } else { - - // } - // }) + let saveDate = [] + // 默认列表第一列(弹出详情用) + saveDate.push(tableColumnsFun[props.routeName].allSchemas.tableColumns[0]) + console.log(101, allData.value) + allData.value.forEach((item,index) => { + const _item = tableColumnsFun[props.routeName].allSchemas.tableColumns.find(itemColumns => (itemColumns.label == item )) + _item.isTable = false + if (checkedDataList.value.indexOf(_item.label) > 0) { + _item.isTable = true + } + saveDate.push(_item) + }) + // 默认操作列 + saveDate.push(tableColumnsFun[props.routeName].allSchemas.tableColumns[tableColumnsFun[props.routeName].allSchemas.tableColumns.length-1]) + console.log(115,saveDate) // tableColumnsFun[props.routeName].allSchemas.tableColumns.forEach((item,index) => { // if (index == 0) { // saveDate.push(item) @@ -126,11 +124,11 @@ const save = () => { // } // }) - // updataTableColumns(saveDate) - // RedisApi.addRedis({key: props.routeName,value: JSON.stringify(saveDate)}).then(res => { - // }).catch(err => { - // console.log(err) - // }) + updataTableColumns(saveDate) + RedisApi.addRedis({key: props.routeName,value: JSON.stringify(saveDate)}).then(res => { + }).catch(err => { + console.log(err) + }) } // 记录移动过程中信息 @@ -213,6 +211,19 @@ const initSelectSta = () => { } }).catch(err => { console.log(err) + checkedDataList.value = [] + allData.value = [] + dataList.value.forEach((item, index) => { + // 列表字段第一个不能参与排序及显隐操作(详情弹窗必备) + if (index != 0) { + if (item.field != 'action') { + checkedDataList.value.push(item.label) + allData.value.push(item.label) + } + } + }) + checkAll.value = true + updataTableColumns(dataList.value) }) }