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