whj před 11 měsíci
rodič
revize
31d89a6e3b
2 změnil soubory, kde provedl 55 přidání a 14 odebrání
  1. 17 3
      src/api/custom/className.js
  2. 38 11
      src/views/test/modules/BaseForm.vue

+ 17 - 3
src/api/custom/className.js

@@ -133,13 +133,27 @@ export function exportCustomClassName (parameter) {
  * @param parameter :
  * @returns {*}
  */
-export function getCustomClassNameList(parameter) {
+export function getCustomCodeList(parameter) {
   return axios({
       url: '/custom/className/switch/handler?' + stringify(parameter),
       method: 'get',
       headers: {
           'Content-Type': 'application/json;charset=UTF-8'
       },
-      responseType: 'blob'
   })
-}
+}
+/**
+ * export file
+ * parameter: { }
+ * @param parameter :
+ * @returns {*}
+ */
+export function getCustomClassNameList(parameter) {
+  return axios({
+      url: '/custom/className?' + stringify(parameter),
+      method: 'get',
+      headers: {
+          'Content-Type': 'application/json;charset=UTF-8'
+      },
+  })
+}

+ 38 - 11
src/views/test/modules/BaseForm.vue

@@ -14,15 +14,25 @@
           </a-select-option>
         </a-select>
       </a-form-item>
-      <a-form-item label="配置类型">
-        <a-select v-decorator="['reflect', {rules: [{required: true, message: '配置类型不能为空'}]}]" placeholder="请选择" @change="handleReflect">
-          <a-select-option v-for="(label,value) in classNameCodeMap" :key="value" :label="label" :value="value">{{ label }}
+      <a-form-item label="配置类型" v-show="false">
+        <a-input v-decorator="['reflect', {initialValue:'reflect'}]">
+        </a-input>
+      </a-form-item>
+      <a-form-item label="条件类">
+        <a-select v-decorator="['titleCode', {rules: [{required: true, message: '条件类不能为空'}]}]" placeholder="请选择" @change="handleTitleCode">
+          <a-select-option v-for="{title, titleCode} in customCodeList" :key="titleCode" :label="title" :value="titleCode">{{ title }}
           </a-select-option>
         </a-select>
       </a-form-item>
-      <a-form-item label="条件类">
-        <a-select v-decorator="['customClassName', {rules: [{required: true, message: '条件类不能为空'}]}]" placeholder="请选择">
-          <a-select-option v-for="{titleName, titleCode} in customClassNameList" :key="titleCode" :label="titleName" :value="titleCode">{{ titleName }}
+      <a-form-item label="条件名称">
+        <a-select v-decorator="['titleColumnCode', {rules: [{required: true, message: '条件名称不能为空'}]}]" placeholder="请选择" @change="handleTitleColumnCode">
+          <a-select-option v-for="{titleColumnName, titleColumnCode} in customClassNameList" :key="titleColumnCode" :label="titleColumnName" :value="titleColumnCode">{{ titleColumnName }}
+          </a-select-option>
+        </a-select>
+      </a-form-item>
+      <a-form-item label="处理类">
+        <a-select v-decorator="['handleNameId', {rules: [{required: true, message: '条件类不能为空'}]}]" placeholder="请选择">
+          <a-select-option v-for="{handleName, id} in handleNameList" :key="id" :label="handleName" :value="id">{{ handleName }}
           </a-select-option>
         </a-select>
       </a-form-item>
@@ -41,7 +51,7 @@
 import pick from 'lodash.pick'
 import { getDeptTree } from '@/api/upms/dept'
 import { queryUserByDept } from '@/api/upms/user'
-import { getCustomClassNameList } from '@/api/custom/className'
+import { getCustomClassNameList, getCustomCodeList } from '@/api/custom/className'
 export default {
   data() {
     return {
@@ -55,14 +65,17 @@ export default {
       verifierList: [],
       treeData: [],
       classNameCodeMap: {},
-      customClassNameList: {},
+      customCodeList: [],
+      customClassNameList: [],
     }
   },
   created() {
     getDeptTree().then((res) => {
       this.treeData = this.setTree(res.data)
     })
-    this.classNameCodeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CLASS_NAME_CODE)
+    getCustomCodeList({ code: 'reflect' }).then((res) => {
+      this.customCodeList = res.data
+    })
   },
   methods: {
     setTree(list) {
@@ -80,11 +93,25 @@ export default {
         this.verifierList = res.data
       })
     },
-    handleReflect(code) {
-      getCustomClassNameList({ code }).then((res) => {
+    handleTitleCode(val) {
+      this._titleCode = val
+      getCustomClassNameList({
+        code: 'reflect',
+        titleCode: val,
+      }).then((res) => {
         this.customClassNameList = res.data
       })
     },
+    handleTitleColumnCode(val) {
+      this._titleCode = val
+      getCustomClassNameList({
+        code: 'reflect',
+        titleColumnCode: this._titleCode,
+        titleCode: val,
+      }).then((res) => {
+        this.handleNameList = res.data
+      })
+    },
     base(record) {
       this.visible = true
       this.record = record