Browse Source

字段设置组件修改

master
陈薪名 11 months 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' }) 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 = []

Loading…
Cancel
Save