Browse Source

字段设置组件修改

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

37
src/components/rowDrop/index.vue

@ -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 = []

Loading…
Cancel
Save