From 48b1c56336cbc8d87270e5ab2dc4509a256d879a Mon Sep 17 00:00:00 2001 From: zyn Date: Sun, 15 Jan 2023 14:54:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E6=A0=87=E5=88=B6=E4=BF=AE=E8=AE=A2?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E7=AE=A1=E6=8E=A7-=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E8=B5=B7=E8=8D=89-=E4=BC=81=E6=A0=87=E7=B1=BB=E5=88=AB=20?= =?UTF-8?q?=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/creatProcess/qbzxdjhgk/step1.vue | 69 ++++++++++++------- 1 file changed, 46 insertions(+), 23 deletions(-) diff --git a/src/pages/processCenter/pages/creatProcess/qbzxdjhgk/step1.vue b/src/pages/processCenter/pages/creatProcess/qbzxdjhgk/step1.vue index 85134bb16..2fbf2dd7a 100644 --- a/src/pages/processCenter/pages/creatProcess/qbzxdjhgk/step1.vue +++ b/src/pages/processCenter/pages/creatProcess/qbzxdjhgk/step1.vue @@ -11,11 +11,11 @@
- + + @@ -36,7 +36,7 @@ - +
@@ -282,6 +282,7 @@ export default { commentText: "", comName: "establish", qbfsForm: {}, + isTrue:true, formLoading: false, approvalFlag: false, showFlag: true, @@ -378,12 +379,29 @@ export default { }).then(res => { if (res) { const processForm = JSON.parse(res.mesg) - this.getFormFieldList(processForm) + this.getFormFieldList(JSON.parse(JSON.stringify(processForm))) } }).catch(e => { }) }) }, + deepClone(orig) { + var copy = Object.create(Object.getPrototypeOf(orig)) + this.copyOwnPropertiesFrom(copy,orig); + return copy; + }, + copyOwnPropertiesFrom(target, source) { + Object.getOwnPropertyNames(source) + .forEach(ele =>{ + // 获取到每个属性的所有描述,然后重新定义对象的属性并返回此对象。 + var desc = Object.getOwnPropertyDescriptor(source,ele); + Object.defineProperty(target,ele,desc) + }); + return target; + }, + getType(target){ + return Object.prototype.toString.call(target).toLowerCase().slice(8,-1) + }, /** * @description: 动态表单读取 */ @@ -408,25 +426,30 @@ export default { this.comName = "establish" break } - this.qbfsForm = item.qbfsForm || item; - if (this.qbfsForm.bussSort) { - if(this.qbfsForm.bussSort instanceof Array){ - this.qbfsForm.bussSort = this.qbfsForm.bussSort[0] - }else { - let val = this.qbfsForm.bussSort.replace('//',"").replace('["',"").replace('"]',"").toString() - if (val !== '' && val !== null && typeof (val) !== 'undefined') { - if (val instanceof Array) { - this.qbfsForm.bussSort = this.form.bussSort.join(",")[0]; - } else { - this.qbfsForm.bussSort = val - } - } else if (val === '') { - this.qbfsForm.bussSort = "" - } - } - } else { - this.qbfsForm.bussSort = "" - } + this.qbfsForm = item.qbfsForm || JSON.parse(JSON.stringify(item)); + this.isTrue = false + this.$nextTick(()=>{ + this.isTrue = true + }) + // if (this.qbfsForm.bussSort){ + // if(this.qbfsForm.bussSort instanceof Array){ + // // if(this.getType(this.qbfsForm.bussSort) === 'array'){ + // this.qbfsForm.bussSort = this.qbfsForm.bussSort[0] + // }else { + // let val = this.qbfsForm.bussSort.replace('//',"").replace('["',"").replace('"]',"").toString() + // if (val !== '' && val !== null && typeof (val) !== 'undefined') { + // if (val instanceof Array) { + // this.qbfsForm.bussSort = this.form.bussSort.join(",")[0]; + // } else { + // this.qbfsForm.bussSort = val + // } + // } else if (val === '') { + // this.qbfsForm.bussSort = "" + // } + // } + // } else { + // this.qbfsForm.bussSort = "" + // } this.formLoading = false; // this.commentText = item.commentText this.roleForm.dockUser = item.dockUser || item.roleForm.dockUser;