fujunling
2023-06-26 a4e4026aee8c5e6d12c1065ce71efee81a2b5518
Source/UBCS-WEB/src/components/FormTemplate/CodeApply.vue
@@ -1,28 +1,16 @@
<template>
  <FormTempalte
    ref="FormTempalte"
    :visible="visible"
  <FormTemplate
    ref="FormTemplate"
    :selfColumnType="selfColumnType"
    :selfColumnConfig="selfColumnConfig"
    :columnList="columnList"
  ></FormTempalte>
  ></FormTemplate>
</template>
<script>
import { getCodeRule } from "@/api/formTemplate.js";
import FormTempalte from "./FormTempalte.vue";
export default {
  name: "CodeApply",
  components: { FormTempalte },
  components: { FormTemplate: () => import('./FormTemplate.vue') },
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    codeClassifyOid: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
@@ -59,7 +47,6 @@
          },
        },
      },
      columnList: [],
    };
  },
  created() {
@@ -69,23 +56,6 @@
  methods: {
    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)
          })
        }
      });
    },
    handleResize() {
      let windowWidth = document.body.clientWidth;
      this.trendsSpan = 24 / Math.floor(windowWidth / 500);
    },
    isRequired(item) {
      return item.nullableFlag != "true";
@@ -113,12 +83,20 @@
        return [];
      }
    },
    init(columnList) {
      this.$refs.FormTemplate.templateRender(columnList);
    },
    handleResize() {
      let windowWidth = document.body.clientWidth;
      this.trendsSpan = 24 / Math.floor(windowWidth / 500);
    },
    async validate() {
      return await this.$refs.FormTempalte.validate()
    }
      return await this.$refs.FormTemplate.validate();
    },
  },
  watch: {
  },
  watch: {},
};
</script>