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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
| <template>
| <el-dialog
| :visible.sync="dialogVisible"
| v-dialogDrag
| top="0vh"
| :title="title"
| class="avue-dialog avue-dialog--top"
| :width="width"
| append-to-body
| >
| <FormTempalte
| v-bind="$attrs"
| :dialogOpen="visible"
| :type="type"
| @getFormTemplateEnd="getFormTemplate"
| @getFormData="getFormData"
| ></FormTempalte>
|
| <div class="tab_box">
| <el-tabs v-model="activeName" type="card">
| <el-tab-pane label="码值申请" name="codeApply" v-if="showCodeApply">
| <CodeApply v-bind="$attrs"></CodeApply>
| </el-tab-pane>
| <el-tab-pane
| label="相似项查询"
| name="resembleQuery"
| v-if="showResembleQuery"
| >
| <ResembleQuery
| v-bind="$attrs"
| ref="resembleQueryRef"
| :hasResemble="this.hasResemble"
| :column="this.resembleTableColumn"
| :form="this.form"
| ></ResembleQuery>
| </el-tab-pane>
| </el-tabs>
| </div>
| <div class="avue-dialog__footer" v-if="type !== 'detail'">
| <el-button @click="close()">取 消</el-button>
| <el-button @click="close()" type="primary" :loading="submitBtnLoading"
| >确 定</el-button
| >
| <el-button @click="resembleQuerySubmit" type="primary" v-if="hasResemble"
| >相似像查询</el-button
| >
| </div>
| </el-dialog>
| </template>
|
| <script>
| import FormTempalte from "./FormTempalte";
| import ResembleQuery from "./ResembleQuery";
| import CodeApply from "./CodeApply";
| export default {
| name: "FormTemplateDialog",
| components: { ResembleQuery, FormTempalte, CodeApply },
| props: {
| visible: {
| type: Boolean,
| default: false,
| },
| type: {
| type: String,
| default: "add",
| },
| title: {
| type: String,
| default: "表单模板",
| },
| width: {
| type: String,
| default: "80%",
| },
| },
| data() {
| return {
| loading: false,
| submitBtnLoading: false,
| hasResemble: false,
| resembleTableColumn: [],
| activeName: "resembleQuery",
| form: {}
| };
| },
| created() {},
| computed: {
| dialogVisible: {
| get() {
| return this.visible;
| },
| set(val) {
| this.$emit("update:visible", val);
| },
| },
| showCodeApply() {
| if (this.type === "add") {
| if (this.hasResemble && this.resembleTableColumn.length === 0) {
| return false;
| }
| } else {
| if (this.hasResemble) {
| return false;
| }
| }
| return true;
| },
| showResembleQuery() {
| return this.hasResemble;
| },
| },
| methods: {
| close() {
| this.dialogVisible = false;
| },
| getFormTemplate(data) {
| this.hasResemble =
| data.resembleTableVO &&
| data.resembleTableVO.cols &&
| data.resembleTableVO.cols.length > 0;
| this.resembleTableColumn = data.resembleTableVO.cols || [];
| },
| getFormData(form) {
| this.form = form
| },
| resembleQuerySubmit() {
| this.$refs.resembleQueryRef.resembleQuery(this.form);
| },
| },
| };
| </script>
|
| <style lang="scss" scoped>
| .key_attr_icon {
| font-size: 24px;
| position: relative;
| top: 2px;
| color: red;
| }
| // 解决swich组件不垂直居中的问题
| /deep/ .el-switch {
| vertical-align: baseline;
| }
| </style>
|
|