|
|
@ -24,19 +24,18 @@ import draggable from "vuedraggable"; |
|
|
|
|
|
|
|
defineOptions({ name: 'RowDrop' }) |
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
|
HeadButttondata: { |
|
|
|
type: Array, |
|
|
|
default: () => { |
|
|
|
return [] |
|
|
|
} |
|
|
|
}, |
|
|
|
routeName: { |
|
|
|
type: String, |
|
|
|
default: null |
|
|
|
} |
|
|
|
}) |
|
|
|
// const props = defineProps({ |
|
|
|
// HeadButttondata: { |
|
|
|
// type: Array, |
|
|
|
// default: () => { |
|
|
|
// return [] |
|
|
|
// } |
|
|
|
// } |
|
|
|
// }) |
|
|
|
const popoverVisible = ref(false) |
|
|
|
const route = useRoute() // 路由信息 |
|
|
|
const routeName = ref(route.name) |
|
|
|
|
|
|
|
|
|
|
|
const isIndeterminate = ref(true) |
|
|
|
const allData = ref([]) // 字段设置列表展现字段 除操作外 |
|
|
@ -60,7 +59,7 @@ const reset = () => { |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
RedisApi.deleteRedis(props.routeName).then(() => { |
|
|
|
RedisApi.deleteRedis(routeName.value).then(() => { |
|
|
|
initSelectSta() |
|
|
|
closeRowDrop() |
|
|
|
}).catch(err => { |
|
|
@ -78,9 +77,9 @@ const closeRowDrop = () => { |
|
|
|
const save = () => { |
|
|
|
let saveDate:any[] = [] |
|
|
|
// 默认列表第一列(弹出详情用) |
|
|
|
saveDate.push(tableColumnsFun[props.routeName].allSchemas.tableColumns[0]) |
|
|
|
saveDate.push(tableColumnsFun[routeName.value].allSchemas.tableColumns[0]) |
|
|
|
allData.value.forEach((item) => { |
|
|
|
const _item:any = tableColumnsFun[props.routeName].allSchemas.tableColumns.find(itemColumns => (itemColumns.label == item )) |
|
|
|
const _item:any = tableColumnsFun[routeName.value].allSchemas.tableColumns.find(itemColumns => (itemColumns.label == item )) |
|
|
|
_item.isTable = false |
|
|
|
if (checkedDataList.value.indexOf(_item.label) > -1) { |
|
|
|
_item.isTable = true |
|
|
@ -88,10 +87,10 @@ const save = () => { |
|
|
|
} |
|
|
|
}) |
|
|
|
// 默认操作列 |
|
|
|
saveDate.push(tableColumnsFun[props.routeName].allSchemas.tableColumns[tableColumnsFun[props.routeName].allSchemas.tableColumns.length-1]) |
|
|
|
saveDate.push(tableColumnsFun[routeName.value].allSchemas.tableColumns[tableColumnsFun[routeName.value].allSchemas.tableColumns.length-1]) |
|
|
|
updataTableColumns(saveDate) |
|
|
|
console.log(99, saveDate) |
|
|
|
RedisApi.addRedis({key: props.routeName,value: JSON.stringify(saveDate)}).then(() => { |
|
|
|
RedisApi.addRedis({key: routeName.value,value: JSON.stringify(saveDate)}).then(() => { |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
@ -121,8 +120,8 @@ const dragover = (e) => { |
|
|
|
|
|
|
|
// 初始化当前全选状态 |
|
|
|
const initSelectSta = () => { |
|
|
|
RedisApi.getRedis(props.routeName).then(res => { |
|
|
|
const _myTableColumns = tableColumnsFun[props.routeName].allSchemas.tableColumns |
|
|
|
RedisApi.getRedis(routeName.value).then(res => { |
|
|
|
const _myTableColumns = tableColumnsFun[routeName.value].allSchemas.tableColumns |
|
|
|
// 有缓存 |
|
|
|
if (res) { |
|
|
|
checkedDataList.value = [] |
|
|
|