whj 11 сар өмнө
parent
commit
b4d7d6bd9e

+ 10 - 3
src/views/custom/form/modules/BaseForm.vue

@@ -61,9 +61,9 @@
     </a-form>
     <a-form v-show="current===3">
       <a-form-item label="绑定流程" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
-        <a-select v-model="flowId">
-          <a-select-option v-for="(label,value) in categoryMap" :value="value" :key="value">
-            {{ label }}
+        <a-select v-model="formValue.flowId">
+          <a-select-option v-for="{name,id} in workFlowList" :value="id" :key="id">
+            {{ name }}
           </a-select-option>
         </a-select>
       </a-form-item>
@@ -74,6 +74,7 @@
 <script>
 import pick from 'lodash.pick'
 import { addCustomForm, updateCustomForm } from '@/api/custom/form'
+import { queryWorkflow } from '@/api/workflow/workflow'
 import FormComponent from './component/index.vue'
 export default {
   name: 'BaseCustomForm',
@@ -93,11 +94,13 @@ export default {
       childrenMaps: [],
       formValue: {
         queryFields: [],
+        flowId: '',
       },
       queryFields: [],
       formComponentConfig: {
         components: [],
       },
+      workFlowList: [],
     }
   },
 
@@ -120,6 +123,9 @@ export default {
     this.DictCache.getChildrenList(this.DictCache.TYPE.CATEGORY_TYPE).forEach((item) => {
       this.childrenMaps[item.value] = this.DictCache.getLabelByValueMapByType(item.code)
     })
+    queryWorkflow().then((res) => {
+      this.workFlowList = res.data
+    })
   },
   methods: {
     base(record) {
@@ -208,6 +214,7 @@ export default {
       this.confirmLoading = false
       this.type = 0
       this.current = 0
+      this.formValue = { queryFields: [] }
       this.form.resetFields()
       if (this.BaseTool.Object.isNotBlank(values)) {
         this.$emit('ok', values)