Przeglądaj źródła

add:文件类型级联选择

liujiayin 2 lat temu
rodzic
commit
2fce3c77fe
1 zmienionych plików z 54 dodań i 0 usunięć
  1. 54 0
      src/views/component/selectType.vue

+ 54 - 0
src/views/component/selectType.vue

@@ -0,0 +1,54 @@
+<template>
+  <el-cascader :props="props"
+               @change="handleChange">
+  </el-cascader>
+</template>
+  
+  <script>
+import curdPost from "@/business/platform/form/utils/custom/joinCURD.js";
+export default {
+  data() {
+    return {
+      props: {
+        lazy: true,
+        lazyLoad(node, resolve) {
+          const { level, value } = node;
+          let sqlString1 = "";
+          if (level == 0) {
+            sqlString1 = "select *FROM `ibps_cat_type` WHERE parent_id_='286814138233389357' ORDER BY sn_ ASC";
+          } else {
+            sqlString1 = `select *FROM ibps_cat_type WHERE parent_id_ in (select id_ from ibps_cat_type where NAME_= '${value}'  AND category_key_ ='FLOW_TYPE') ORDER BY sn_ ASC`;
+          }
+          curdPost("sql", sqlString1).then((res1) => {
+            let datas1 = res1.variables.data;
+            setTimeout(() => {
+              let nodes = datas1.map(item => ({
+                value: item.NAME_,
+                label: item.NAME_,
+              }));
+              // 通过调用resolve将子节点数据返回,通知组件数据加载完成
+              resolve(nodes);
+            }, 100);
+          })
+        }
+      }
+    };
+  },
+  mounted() {
+  },
+  methods: {
+    handleChange(v) {
+      const name = "wenJianLeiXing"; // 文件类型
+      const value = v; //字段的值
+      this.$emit("change-data", name, value);
+    },
+
+  },
+  watch: {
+
+  },
+};
+</script>
+  
+<style lang="scss" scoped>
+</style>