From 9474fadca23df051af1789b2078aca9c3163a017 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期一, 05 六月 2023 17:05:54 +0800
Subject: [PATCH] 合并代码,解决代码冲突
---
Source/UBCS-WEB/src/components/FormTemplate/index.vue | 54 ++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 40 insertions(+), 14 deletions(-)
diff --git a/Source/UBCS-WEB/src/components/FormTemplate/index.vue b/Source/UBCS-WEB/src/components/FormTemplate/index.vue
index 8a1c2d1..d04ed50 100644
--- a/Source/UBCS-WEB/src/components/FormTemplate/index.vue
+++ b/Source/UBCS-WEB/src/components/FormTemplate/index.vue
@@ -7,19 +7,26 @@
class="avue-dialog avue-dialog--top"
:width="width"
append-to-body
+ @opened="openDialog"
>
<FormTempalte
v-bind="$attrs"
- :dialogOpen="visible"
+ :visible="visible"
:type="type"
+ v-if="dialogVisible"
+ ref="FormTempalte"
@getFormTemplateEnd="getFormTemplate"
@getFormData="getFormData"
></FormTempalte>
- <div class="tab_box">
- <el-tabs v-model="activeName" type="card">
+ <div class="tab_box" v-if="type !== 'detail' && dialogVisible && (showCodeApply || showResembleQuery)">
+ <el-tabs v-model="activeName" type="border-card">
<el-tab-pane label="鐮佸�肩敵璇�" name="codeApply" v-if="showCodeApply">
- <CodeApply v-bind="$attrs"></CodeApply>
+ <CodeApply
+ ref="CodeApply"
+ v-bind="$attrs"
+ @getCodeRuleOid="getCodeRuleOid"
+ ></CodeApply>
</el-tab-pane>
<el-tab-pane
label="鐩镐技椤规煡璇�"
@@ -38,10 +45,10 @@
</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 @click="submit()" type="primary" :loading="submitBtnLoading"
>纭� 瀹�</el-button
>
- <el-button @click="resembleQuerySubmit" type="primary" v-if="hasResemble"
+ <el-button @click="resembleQuerySubmit" type="primary" v-if="showResembleQuery"
>鐩镐技鍍忔煡璇�</el-button
>
</div>
@@ -66,7 +73,7 @@
},
title: {
type: String,
- default: "琛ㄥ崟妯℃澘",
+ default: "缂栫爜鐢宠",
},
width: {
type: String,
@@ -79,8 +86,8 @@
submitBtnLoading: false,
hasResemble: false,
resembleTableColumn: [],
- activeName: "resembleQuery",
- form: {}
+ secVOList: [],
+ form: {},
};
},
created() {},
@@ -95,24 +102,36 @@
},
showCodeApply() {
if (this.type === "add") {
- if (this.hasResemble && this.resembleTableColumn.length === 0) {
+ if (this.hasResemble && this.secVOList.length === 0) {
return false;
}
} else {
- if (this.hasResemble) {
- return false;
- }
+ return false;
}
return true;
},
showResembleQuery() {
return this.hasResemble;
},
+ activeName() {
+ return (
+ (this.showCodeApply && "codeApply") ||
+ (this.showResembleQuery && "resembleQuery")
+ );
+ },
},
methods: {
+ openDialog() {
+ this.$nextTick(() => {
+ this.$refs.FormTempalte.init();
+ });
+ },
close() {
this.dialogVisible = false;
},
+ getCodeRuleOid(data) {
+ this.secVOList = data.secVOList;
+ },
getFormTemplate(data) {
this.hasResemble =
data.resembleTableVO &&
@@ -121,11 +140,18 @@
this.resembleTableColumn = data.resembleTableVO.cols || [];
},
getFormData(form) {
- this.form = form
+ this.form = form;
},
resembleQuerySubmit() {
this.$refs.resembleQueryRef.resembleQuery(this.form);
},
+ async submit() {
+ const formValidate = await this.$refs.FormTempalte.validate();
+ if (this.showCodeApply) {
+ const codeValidate = this.$refs.CodeApply.validate();
+ console.log(formValidate, codeValidate);
+ }
+ },
},
};
</script>
--
Gitblit v1.10.0