update
This commit is contained in:
parent
3656a92f63
commit
9dc580ddd2
4
.env.dev
4
.env.dev
@ -5,9 +5,9 @@ ENV = 'development'
|
|||||||
VUE_APP_TITLE = 芋道管理系统
|
VUE_APP_TITLE = 芋道管理系统
|
||||||
|
|
||||||
# 芋道管理系统/开发环境
|
# 芋道管理系统/开发环境
|
||||||
# VUE_APP_BASE_API = 'http://192.168.1.49:48080'
|
VUE_APP_BASE_API = 'http://192.168.1.49:48080'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.1.8:48080'
|
# VUE_APP_BASE_API = 'http://192.168.1.8:48080'
|
||||||
VUE_APP_BASE_API = 'http://192.168.0.33:48080'
|
# VUE_APP_BASE_API = 'http://192.168.0.33:48080'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.1.188:48080'
|
# VUE_APP_BASE_API = 'http://192.168.1.188:48080'
|
||||||
|
|
||||||
# 路由懒加载
|
# 路由懒加载
|
||||||
|
@ -114,6 +114,7 @@ export default {
|
|||||||
formLoading: true,
|
formLoading: true,
|
||||||
optionListOf: {},
|
optionListOf: {},
|
||||||
uploadedFileList: [],
|
uploadedFileList: [],
|
||||||
|
dataLoaded: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -125,7 +126,8 @@ export default {
|
|||||||
},
|
},
|
||||||
form: {
|
form: {
|
||||||
get() {
|
get() {
|
||||||
return this.dataForm;
|
if (this.dataLoaded) return this.dataForm;
|
||||||
|
else return {}
|
||||||
},
|
},
|
||||||
set(val) {
|
set(val) {
|
||||||
console.log('set form', val);
|
console.log('set form', val);
|
||||||
@ -162,7 +164,7 @@ export default {
|
|||||||
return response.data;
|
return response.data;
|
||||||
},
|
},
|
||||||
async handleOptions(trigger = 'monuted') {
|
async handleOptions(trigger = 'monuted') {
|
||||||
console.log("[dialogForm:handleOptions]")
|
console.log('[dialogForm:handleOptions]');
|
||||||
const promiseList = [];
|
const promiseList = [];
|
||||||
this.rows.forEach((cols) => {
|
this.rows.forEach((cols) => {
|
||||||
cols.forEach((opt) => {
|
cols.forEach((opt) => {
|
||||||
@ -176,11 +178,12 @@ export default {
|
|||||||
} else if (opt.url) {
|
} else if (opt.url) {
|
||||||
// 如果有 depends,则暂时先不获取,注册一个watcher
|
// 如果有 depends,则暂时先不获取,注册一个watcher
|
||||||
if (opt.depends) {
|
if (opt.depends) {
|
||||||
console.log("[handleOptions] setting watch")
|
console.log('[handleOptions] setting watch');
|
||||||
this.$watch(
|
this.$watch(
|
||||||
() => this.form[opt.depends],
|
() => this.form[opt.depends],
|
||||||
(id) => {
|
(id) => {
|
||||||
console.log(opt.depends, 'changed')
|
console.log('<', opt.depends, '>', 'changed', id);
|
||||||
|
if (id == null) return;
|
||||||
// 清空原有选项
|
// 清空原有选项
|
||||||
this.form[opt.prop] = null;
|
this.form[opt.prop] = null;
|
||||||
// 获取新的选项
|
// 获取新的选项
|
||||||
@ -196,6 +199,9 @@ export default {
|
|||||||
}))
|
}))
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
@ -231,6 +237,8 @@ export default {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log('[dialogForm:handleOptions] done!');
|
||||||
|
|
||||||
// 如果是 watch 触发的,不需要执行进一步的请求
|
// 如果是 watch 触发的,不需要执行进一步的请求
|
||||||
if (trigger == 'watch') {
|
if (trigger == 'watch') {
|
||||||
this.formLoading = false;
|
this.formLoading = false;
|
||||||
@ -239,6 +247,7 @@ export default {
|
|||||||
try {
|
try {
|
||||||
await Promise.all(promiseList.map((fn) => fn()));
|
await Promise.all(promiseList.map((fn) => fn()));
|
||||||
this.formLoading = false;
|
this.formLoading = false;
|
||||||
|
this.dataLoaded = true;
|
||||||
// console.log("[dialogForm:handleOptions:optionListOf]", this.optionListOf)
|
// console.log("[dialogForm:handleOptions:optionListOf]", this.optionListOf)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('[dialogForm:handleOptions:error]', error);
|
console.log('[dialogForm:handleOptions:error]', error);
|
||||||
|
Loading…
Reference in New Issue
Block a user