fujunling
2023-06-05 fbaa314196992bdd683be9f412c20961c0a443ef
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<template>
  <el-dialog
    :visible.sync="dialogVisible"
    v-dialogDrag
    top="0vh"
    title="相似项查询"
    :width="width"
    append-to-body
    @opened="openDialog"
    class="avue-dialog avue-dialog--top"
  >
    <ResembleQuery
      v-loading="loading"
      ref="ResembleQuery"
      v-bind="$attrs"
      :column="column"
      :templateOid="templateOid"
      :codeRuleOid="codeRuleOid"
      :codeClassifyOid="codeClassifyOid"
    ></ResembleQuery>
  </el-dialog>
</template>
 
<script>
import { getFormTemplate } from "@/api/formTemplate";
import ResembleQuery from "./ResembleQuery";
export default {
  name: "ResembleQueryDialog",
  components: { ResembleQuery },
  props: {
    visible: {
      type: Boolean,
      default: false,
    },
    codeClassifyOid: {
      type: String,
      default: "",
    },
    templateOid: {
      type: String,
      default: "",
    },
    codeRuleOid: {
      type: String,
      default: "",
    },
    type: {
      type: String,
      default: "add",
    },
    form: {
      type: Object,
      default: () => ({}),
    },
  },
  data() {
    return {
      column: [],
      loading: false
    };
  },
  computed: {
    dialogVisible: {
      get() {
        return this.visible;
      },
      set(val) {
        this.$emit("update:visible", val);
      },
    },
  },
  methods: {
    openDialog() {
      this.loading = true
      getFormTemplate({
        templateOid: this.templateOid,
        codeClassifyOid: this.codeClassifyOid,
      }).then((res) => {
        this.loading = false
        if (
          res.data &&
          res.data.resembleTableVO.cols &&
          res.data.resembleTableVO.cols.length > 0
        ) {
          this.column = res.data.resembleTableVO.cols;
          this.$refs.ResembleQuery.resembleQuery();
        } else {
          this.column = [];
        }
      });
    },
  },
};
</script>
 
<style lang="less" scoped></style>