szh_zidingyibiaoti
张同海 2 years ago
commit eb42f304c9

@ -787,19 +787,33 @@ export default {
typeArr: ['booking_list_cond', 'booking_list_column'] typeArr: ['booking_list_cond', 'booking_list_column']
} }
DjyUserConfigMulti(this.$qs.stringify(query, { arrayFormat: 'repeat' })).then(res => { DjyUserConfigMulti(this.$qs.stringify(query, { arrayFormat: 'repeat' })).then(res => {
const $data = {}
res.data.map((item, index) => { res.data.map((item, index) => {
switch (item.type) { switch (item.type) {
case 'booking_list_cond': case 'booking_list_cond':
this.setFormData(item, false, true) this.$set($data, 'booking_list_cond', item)
// this.setFormData(item, false, true)
break break
case 'booking_list_column': case 'booking_list_column':
this.setTableList(item) this.$set($data, 'booking_list_column', item)
// this.setTableList(item)
break break
// case 'booking_list_page': // case 'booking_list_page':
// this.setPageSize(item) // this.setPageSize(item)
// break // break
} }
}) })
console.log('获取到自定义数据', $data)
if (Object.keys($data).includes('booking_list_cond')) {
this.setFormData($data.booking_list_cond, false, true)
} else {
this.setFormData({}, false, true)
}
if (Object.keys($data).includes('booking_list_column')) {
this.setTableList($data.booking_list_column)
} else {
this.setTableList({})
}
}) })
}, },
// - start // - start
@ -863,7 +877,7 @@ export default {
}) })
}, },
setFormData (data, isReset = false, isInit = false) { setFormData (data, isReset = false, isInit = false) {
if (data && JSON.parse(data.configJson).length) { if (Object.keys(data).length > 0 && JSON.parse(data.configJson).length) {
const arr = JSON.parse(data.configJson) const arr = JSON.parse(data.configJson)
const nowData = [] const nowData = []
const moreData = [] const moreData = []
@ -917,7 +931,7 @@ export default {
this.$forceUpdate() this.$forceUpdate()
}, },
setTableList (data) { setTableList (data) {
if (data && JSON.parse(data.configJson).length) { if (Object.keys(data).length > 0 && JSON.parse(data.configJson).length) {
this.formTableData = JSON.parse(data.configJson) this.formTableData = JSON.parse(data.configJson)
const nowTableArr = this.formTableData.map((item, index) => { const nowTableArr = this.formTableData.map((item, index) => {
if (item.field === 'operate') { if (item.field === 'operate') {

Loading…
Cancel
Save