fix: 复制模板没有复制关联的字段
This commit is contained in:
parent
5fe9234da6
commit
a2ea71614f
|
@ -89,17 +89,16 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open(data) {
|
open(data, isCopy) {
|
||||||
if (data) {
|
if (data) {
|
||||||
Object.assign(this.form, data);
|
Object.assign(this.form, data);
|
||||||
if (!(data.options instanceof Array)) {
|
if (!(data.options instanceof Array)) {
|
||||||
this.form.options = data.options ? JSON.parse(data.options) : [];
|
this.form.options = data.options ? JSON.parse(data.options) : [];
|
||||||
}
|
}
|
||||||
if (data.id) {
|
if (isCopy) {
|
||||||
this.url = 'field/template/issue/update';
|
|
||||||
} else {
|
|
||||||
//copy
|
|
||||||
this.url = 'field/template/issue/add';
|
this.url = 'field/template/issue/add';
|
||||||
|
} else {
|
||||||
|
this.url = 'field/template/issue/update';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.form = {
|
this.form = {
|
||||||
|
|
|
@ -152,9 +152,8 @@ export default {
|
||||||
handleCopy(data) {
|
handleCopy(data) {
|
||||||
let copyData = {};
|
let copyData = {};
|
||||||
Object.assign(copyData, data);
|
Object.assign(copyData, data);
|
||||||
copyData.id = null;
|
|
||||||
copyData.name = data.name + '_copy';
|
copyData.name = data.name + '_copy';
|
||||||
this.$refs.templateEdit.open(copyData);
|
this.$refs.templateEdit.open(copyData, true);
|
||||||
},
|
},
|
||||||
handleDelete(data) {
|
handleDelete(data) {
|
||||||
this.result = this.$get('field/template/issue/delete/' + data.id, () => {
|
this.result = this.$get('field/template/issue/delete/' + data.id, () => {
|
||||||
|
|
|
@ -93,17 +93,16 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open(data) {
|
open(data, isCopy) {
|
||||||
if (data) {
|
if (data) {
|
||||||
Object.assign(this.form, data);
|
Object.assign(this.form, data);
|
||||||
if (!(data.options instanceof Array)) {
|
if (!(data.options instanceof Array)) {
|
||||||
this.form.options = data.options ? JSON.parse(data.options) : [];
|
this.form.options = data.options ? JSON.parse(data.options) : [];
|
||||||
}
|
}
|
||||||
if (data.id) {
|
if (isCopy) {
|
||||||
this.url = 'field/template/case/update';
|
|
||||||
} else {
|
|
||||||
//copy
|
|
||||||
this.url = 'field/template/case/add';
|
this.url = 'field/template/case/add';
|
||||||
|
} else {
|
||||||
|
this.url = 'field/template/case/update';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.form = {
|
this.form = {
|
||||||
|
|
|
@ -161,9 +161,8 @@ export default {
|
||||||
handleCopy(data) {
|
handleCopy(data) {
|
||||||
let copyData = {};
|
let copyData = {};
|
||||||
Object.assign(copyData, data);
|
Object.assign(copyData, data);
|
||||||
copyData.id = null;
|
|
||||||
copyData.name = data.name + '_copy';
|
copyData.name = data.name + '_copy';
|
||||||
this.$refs.templateEdit.open(copyData);
|
this.$refs.templateEdit.open(copyData, true);
|
||||||
},
|
},
|
||||||
handleDelete(data) {
|
handleDelete(data) {
|
||||||
this.result = this.$get('field/template/case/delete/' + data.id, () => {
|
this.result = this.$get('field/template/case/delete/' + data.id, () => {
|
||||||
|
|
Loading…
Reference in New Issue