fix: 复制模板没有复制关联的字段

This commit is contained in:
chenjianxing 2021-04-23 10:12:58 +08:00 committed by jianxing
parent 5fe9234da6
commit a2ea71614f
4 changed files with 10 additions and 14 deletions

View File

@ -89,17 +89,16 @@ export default {
}
},
methods: {
open(data) {
open(data, isCopy) {
if (data) {
Object.assign(this.form, data);
if (!(data.options instanceof Array)) {
this.form.options = data.options ? JSON.parse(data.options) : [];
}
if (data.id) {
this.url = 'field/template/issue/update';
} else {
//copy
if (isCopy) {
this.url = 'field/template/issue/add';
} else {
this.url = 'field/template/issue/update';
}
} else {
this.form = {

View File

@ -152,9 +152,8 @@ export default {
handleCopy(data) {
let copyData = {};
Object.assign(copyData, data);
copyData.id = null;
copyData.name = data.name + '_copy';
this.$refs.templateEdit.open(copyData);
this.$refs.templateEdit.open(copyData, true);
},
handleDelete(data) {
this.result = this.$get('field/template/issue/delete/' + data.id, () => {

View File

@ -93,17 +93,16 @@ export default {
}
},
methods: {
open(data) {
open(data, isCopy) {
if (data) {
Object.assign(this.form, data);
if (!(data.options instanceof Array)) {
this.form.options = data.options ? JSON.parse(data.options) : [];
}
if (data.id) {
this.url = 'field/template/case/update';
} else {
//copy
if (isCopy) {
this.url = 'field/template/case/add';
} else {
this.url = 'field/template/case/update';
}
} else {
this.form = {

View File

@ -161,9 +161,8 @@ export default {
handleCopy(data) {
let copyData = {};
Object.assign(copyData, data);
copyData.id = null;
copyData.name = data.name + '_copy';
this.$refs.templateEdit.open(copyData);
this.$refs.templateEdit.open(copyData, true);
},
handleDelete(data) {
this.result = this.$get('field/template/case/delete/' + data.id, () => {