This commit is contained in:
花有清香月有阴
2021-12-31 11:11:56 +08:00
5 changed files with 16 additions and 20 deletions

View File

@@ -192,11 +192,6 @@ export default {
}
})
},
onShow () {
localStorage.removeItem("toFiledConfig")
},
methods: {
toSetting() {
let {formConfig} = this

View File

@@ -146,9 +146,12 @@ import {components} from './components/config'
export default {
data() {
let params = localStorage.getItem("toFiledConfig")
params && (params = JSON.parse(params))
params.config = params.index > -1 ? params.filed : components.filter(v => v.type === params.filedType)[0]
let params = localStorage.getItem("toFiledConfig") || {}
if (params) {
params = JSON.parse(params)
params.config = params.index > -1 ? params.filed : JSON.parse(JSON.stringify(components.filter(v => v.type === params.filedType)[0]))
localStorage.removeItem("toFiledConfig")
}
return {
...params,
isShowType: false,
@@ -250,7 +253,7 @@ export default {
this.config.options.splice(index, 1)
},
back() {
back() {
uni.navigateBack({})
},

View File

@@ -164,14 +164,14 @@ export default {
},
goDetail(item, hint) {
console.log('详情', hint)
console.log('详情',hint)
if (hint == 1) {
uni.navigateTo({ url: `./detail?id=${item.id}` })
}
},
toAdd(item, hint) {
console.log('编辑', hint)
console.log('编辑',hint)
if (hint == 2) {
uni.navigateTo({ url: `./add?id=${item.id}` })
} else {

View File

@@ -192,11 +192,6 @@ export default {
}
})
},
onShow () {
localStorage.removeItem("toFiledConfig")
},
methods: {
toSetting() {
let {formConfig} = this

View File

@@ -146,9 +146,12 @@ import {components} from './components/config'
export default {
data() {
let params = localStorage.getItem("toFiledConfig")
params && (params = JSON.parse(params))
params.config = params.index > -1 ? params.filed : components.filter(v => v.type === params.filedType)[0]
let params = localStorage.getItem("toFiledConfig") || {}
if (params) {
params = JSON.parse(params)
params.config = params.index > -1 ? params.filed : JSON.parse(JSON.stringify(components.filter(v => v.type === params.filedType)[0]))
localStorage.removeItem("toFiledConfig")
}
return {
...params,
isShowType: false,
@@ -250,7 +253,7 @@ export default {
this.config.options.splice(index, 1)
},
back() {
back() {
uni.navigateBack({})
},