Browse Source

字段设置完善

master
陈薪名 1 year ago
parent
commit
d29b78e8b0
  1. 55
      src/components/rowDrop/index.vue

55
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)
})
}

Loading…
Cancel
Save