fix(系统上设置): 编辑项目缺陷类型和需求没有加载

This commit is contained in:
chenjianxing 2022-12-20 18:01:07 +08:00 committed by jianxing
parent aa8c7db3fc
commit e97fb6027c
2 changed files with 16 additions and 12 deletions

View File

@ -90,7 +90,8 @@ export default {
getPlatformProjectInfo(this.platformKey)
.then(r => {
if (r.data) {
Object.assign(this.form, this.projectConfig);
let form = {};
Object.assign(form, this.projectConfig);
this.handleProjectConfigCompatible();
r.data.formItems.forEach(item => {
@ -98,18 +99,19 @@ export default {
item.options = [];
}
//
if (this.form[item.name]) {
this.$set(item, 'defaultValue', this.form[item.name]);
if (form[item.name]) {
this.$set(item, 'defaultValue', form[item.name]);
}
//
if (item.cascade && this.form[item.name]) {
if (item.cascade && form[item.cascade]) {
this.getCascadeOptions(item, () => {
//
if (this.form[item.name]) {
this.$set(item, 'defaultValue', this.form[item.name]);
if (form[item.name]) {
this.$set(item, 'defaultValue', form[item.name]);
}
});
}
this.form = form;
});
this.config = r.data;
this.rules = getPlatformFormRules(this.config);

View File

@ -89,7 +89,8 @@ export default {
getPlatformProjectInfo(this.platformKey)
.then(r => {
if (r.data) {
Object.assign(this.form, this.projectConfig);
let form = {};
Object.assign(form, this.projectConfig);
this.handleProjectConfigCompatible();
r.data.formItems.forEach(item => {
@ -97,18 +98,19 @@ export default {
item.options = [];
}
//
if (this.form[item.name]) {
this.$set(item, 'defaultValue', this.form[item.name]);
if (form[item.name]) {
this.$set(item, 'defaultValue', form[item.name]);
}
//
if (item.cascade && this.form[item.name]) {
if (item.cascade && form[item.cascade]) {
this.getCascadeOptions(item, () => {
//
if (this.form[item.name]) {
this.$set(item, 'defaultValue', this.form[item.name]);
if (form[item.name]) {
this.$set(item, 'defaultValue', form[item.name]);
}
});
}
this.form = form;
});
this.config = r.data;
this.rules = getPlatformFormRules(this.config);