|
|
|
@ -7,6 +7,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
key: undefined,
|
|
|
|
|
config: undefined,
|
|
|
|
|
status: {},
|
|
|
|
|
labelCol: { span: 4 },
|
|
|
|
@ -31,10 +32,10 @@ export default {
|
|
|
|
|
this.status = this.$status
|
|
|
|
|
|
|
|
|
|
const config = await this.$api.config.reload()
|
|
|
|
|
this.$set(this, 'config', config)
|
|
|
|
|
this.setConfig(config)
|
|
|
|
|
this.systemPlatform = await this.$api.info.getSystemPlatform()
|
|
|
|
|
console.log('config', this.config, this.systemPlatform)
|
|
|
|
|
// eslint-disable-next-line no-debugger
|
|
|
|
|
|
|
|
|
|
this.printConfig()
|
|
|
|
|
|
|
|
|
|
if (this.ready) {
|
|
|
|
|
return this.ready(this.config)
|
|
|
|
@ -74,8 +75,11 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
saveConfig () {
|
|
|
|
|
return this.$api.config.save(this.config).then(() => {
|
|
|
|
|
return this.$api.config.save(this.config).then((ret) => {
|
|
|
|
|
this.$message.info('设置已保存')
|
|
|
|
|
this.setConfig(ret.allConfig)
|
|
|
|
|
this.printConfig('after saveConfig(), ')
|
|
|
|
|
return ret
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
getConfig (key) {
|
|
|
|
@ -85,6 +89,12 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
return value
|
|
|
|
|
},
|
|
|
|
|
setConfig (newConfig) {
|
|
|
|
|
this.$set(this, 'config', newConfig)
|
|
|
|
|
},
|
|
|
|
|
printConfig (prefix = '') {
|
|
|
|
|
console.log(`${prefix}${this.key} page config:`, this.config, this.systemPlatform)
|
|
|
|
|
},
|
|
|
|
|
getStatus (key) {
|
|
|
|
|
const value = lodash.get(this.status, key)
|
|
|
|
|
if (value == null) {
|
|
|
|
|