소스 검색

优化动态表单选择逻辑

hubin 1 년 전
부모
커밋
5199d400f5
1개의 변경된 파일13개의 추가작업 그리고 9개의 파일을 삭제
  1. 13 9
      src/components/scWorkflow/nodes/approver.vue

+ 13 - 9
src/components/scWorkflow/nodes/approver.vue

@@ -205,16 +205,20 @@ export default {
 	},
 	methods: {
 		show() {
-			const _initOperateTable = JSON.parse(this.processForm)
-			const initOperateTable = _initOperateTable.map(item => {
-				return { title: item.title, opera: '0' }
-			})
 			this.form = JSON.parse(JSON.stringify(this.nodeConfig))
-			console.log('===this.form===', this.form)
-			console.log('===this.form===', initOperateTable)
-			if (!this.form.extendConfig) {
-				this.form.extendConfig = { formConfig: initOperateTable }
-			}
+			const formConfig = this.form.extendConfig.formConfig
+			const operateTable = JSON.parse(this.processForm).map(item => {
+				let opera = '0'
+				if (formConfig) {
+					formConfig.map(i => {
+						if (item.title === i.title) {
+							opera = i.opera
+						}
+					})
+				}
+				return { title: item.title, opera: opera }
+			})
+			this.form.extendConfig = { formConfig: operateTable }
 			this.drawer = true
 		},
 		editTitle() {