ludc
2023-06-06 6cd820835b3e65076b7925ca9a698161a763f918
Source/UBCS-WEB/src/components/FormTemplate/CodeApply.vue
@@ -1,28 +1,16 @@
<template>
  <FormTempalte
    ref="FormTempalte"
    :visible="visible"
    :selfColumnType="selfColumnType"
    :selfColumnConfig="selfColumnConfig"
    :columnList="columnList"
  ></FormTempalte>
</template>
<script>
import { getCodeRule } from "@/api/formTemplate.js";
import FormTempalte from "./FormTempalte.vue";
export default {
  name: "CodeApply",
  components: { FormTempalte },
  components: { FormTempalte: () => import('./FormTempalte.vue') },
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    codeClassifyOid: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
@@ -59,7 +47,6 @@
          },
        },
      },
      columnList: [],
    };
  },
  created() {
@@ -70,18 +57,8 @@
    getType(item) {
      return this.selfColumnType[item.sectype];
    },
    getCodeRule() {
      getCodeRule({ codeClassifyOid: this.codeClassifyOid }).then((res) => {
        if (res.data && res.data.code === 200) {
          this.defaultValue = res.data.data;
          this.columnList = res.data.data.secVOList || [];
          console.log(res.data.data.secVOList, 'res.data.data.secVOList');
          this.codeRuleOid = res.data.data.oid;
          this.$nextTick(() => {
            this.$refs.FormTempalte.init(res.data.data.secVOList)
          })
        }
      });
    init(columnList) {
      this.$refs.FormTempalte.templateRender(columnList);
    },
    handleResize() {
      let windowWidth = document.body.clientWidth;
@@ -114,11 +91,10 @@
      }
    },
    async validate() {
      return await this.$refs.FormTempalte.validate()
    }
      return await this.$refs.FormTempalte.validate();
    },
  },
  watch: {
  },
  watch: {},
};
</script>