|
@@ -28,10 +28,19 @@
|
|
|
@delRemove="delRemove"
|
|
|
>
|
|
|
<div class="diacont">
|
|
|
- <el-form :model="tableForm">
|
|
|
+ <el-form
|
|
|
+ :model="tableForm"
|
|
|
+ :rules="formRules"
|
|
|
+ ref="queryTemplateColumnForm"
|
|
|
+ >
|
|
|
<el-row :gutter="24">
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="名称" size="default">
|
|
|
+ <el-form-item
|
|
|
+ label="名称"
|
|
|
+ size="default"
|
|
|
+ prop="columnName"
|
|
|
+ :rules="formRules.isNotNull"
|
|
|
+ >
|
|
|
<el-input
|
|
|
v-model="tableForm.columnName"
|
|
|
placeholder="请输入名称"
|
|
@@ -39,7 +48,12 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="标签" size="default">
|
|
|
+ <el-form-item
|
|
|
+ label="标签"
|
|
|
+ size="default"
|
|
|
+ prop="columnLabel"
|
|
|
+ :rules="formRules.isNotNull"
|
|
|
+ >
|
|
|
<el-input
|
|
|
v-model="tableForm.columnLabel"
|
|
|
placeholder="请输入标签"
|
|
@@ -223,6 +237,7 @@ import Dialog from "@/components/dialog/index.vue";
|
|
|
import { Query, GeneralDataReception } from "@/api/webApi";
|
|
|
import { ElMessage } from "element-plus";
|
|
|
const route = useRoute();
|
|
|
+const formRules = useElement().formRules;
|
|
|
const page = ref<number>(0); //分页参数
|
|
|
const dataContent = ref<object>({});
|
|
|
const noMore = ref<Boolean>(false);
|
|
@@ -348,7 +363,7 @@ const btnClick = (row, index, param) => {
|
|
|
index.listqueryTemplateID === "需要" ? "1" : "0";
|
|
|
tableForm.needCount = index.needCount === "需要" ? "1" : "0";
|
|
|
tableForm.orderNumber = index.orderNumber === "需要" ? "1" : "0";
|
|
|
- tableForm.needSearch = index.needSearch;
|
|
|
+ tableForm.needSearch = index.needSearch === "需要" ? "1" : "0";
|
|
|
} else if (param === 3) {
|
|
|
msgTitle.value = "删除查询项";
|
|
|
flag.value = true;
|
|
@@ -421,8 +436,15 @@ const getQuery = async () => {
|
|
|
}
|
|
|
};
|
|
|
//确认提交
|
|
|
+const queryTemplateColumnForm: any = ref(null);
|
|
|
const submitForm = () => {
|
|
|
- generalDataReception(tableForm);
|
|
|
+ queryTemplateColumnForm.value.validate((valid: any) => {
|
|
|
+ if (valid) {
|
|
|
+ generalDataReception(tableForm);
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
};
|
|
|
const resetTable = () => {
|
|
|
page.value = 0;
|