Browse Source

字段设置修改重置功能

ZhengKaiFa
陈薪名 2 years ago
parent
commit
4b9755ecf5
  1. 64
      WZC2/fe/PC/src/components/rowDrop/index.vue

64
WZC2/fe/PC/src/components/rowDrop/index.vue

@ -60,7 +60,6 @@
newData: null, newData: null,
// checked: false, // checked: false,
dataList: [], dataList: [],
dataListReset: []
} }
}, },
props: { props: {
@ -81,39 +80,42 @@
this.formatData(this.tableColumns) this.formatData(this.tableColumns)
}, },
methods: { methods: {
reset() { reset() {
this.$confirm('重置后,字段设置将恢复初始设置,是否继续?', '提示', { this.$confirm('重置后,字段设置将恢复初始设置,是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
cancelButtonClass:'rowDropNotHideItem' cancelButtonClass:'rowDropNotHideItem'
}).then(() => { }).then(() => {
localStorage.removeItem(this.$store.getters.name.userName + '_' + this.$route.name) localStorage.removeItem(this.$store.getters.name.userName + '_' + this.$route.name)
this.formatData(this.$isTableColumns[this.$route.name]) let _resetCol = this.$isTableColumns[this.$route.name]
this.$emit('radio',this.$isTableColumns[this.$route.name]) _resetCol.forEach(item => {
this.close() item.isture = true
}).catch(() => { })
this.dataList = _resetCol
this.$emit('radio',_resetCol)
this.close()
}).catch(() => {
}); });
}, },
close() { close() {
this.$emit('closeRowDrop') this.$emit('closeRowDrop')
}, },
// save () { // save () {
// this.$emit('closeRowDrop') // this.$emit('closeRowDrop')
// this.$emit('radio',this.dataList) // this.$emit('radio',this.dataList)
// // + // // +
// localStorage.setItem(this.$store.getters.name.userName + '_' + this.$route.name, JSON.stringify(this.dataList)) // localStorage.setItem(this.$store.getters.name.userName + '_' + this.$route.name, JSON.stringify(this.dataList))
// }, // },
// //
formatData (val) { formatData (val) {
this.dataList = JSON.parse(JSON.stringify(val)) this.dataList = JSON.parse(JSON.stringify(val))
this.dataList.forEach(item => { this.dataList.forEach(item => {
if (item.isture == undefined) { if (item.isture == undefined) {
item.isture = true item.isture = true
} }
}) })
this.dataListReset = JSON.parse(JSON.stringify(this.dataList))
}, },
// //
handleEdit(index, row) { handleEdit(index, row) {

Loading…
Cancel
Save