chenrui  2 年之前
父節點
當前提交
efab007763
共有 2 個文件被更改,包括 37 次插入2 次删除
  1. 4 0
      src/components/minheader/index.vue
  2. 33 2
      src/views/systemSettings/queryTemplate/index.vue

+ 4 - 0
src/components/minheader/index.vue

@@ -167,15 +167,19 @@ const emits = defineEmits([
   "addslotForm",
   "showForm",
   "searchForm",
+  "searchForms",
+  "clearForm",
 ]);
 const addBbut = () => {
   emits("addForm");
 };
 const search = (val) => {
   emits("searchForm", [startTime, endTime, val]);
+  emits("searchForms", val);
   // ElMessage.success(`搜索成功:${val}`);
 };
 const clear = () => {
+  emits("clearForm");
   ElMessage.success(`清除`);
 };
 //保存

+ 33 - 2
src/views/systemSettings/queryTemplate/index.vue

@@ -1,7 +1,14 @@
 <template>
   <div class="airportInfo scroll-y">
     <div class="wrap">
-      <Minheader :is-auth="true" :is-statuser="true" @addForm="addForm">
+      <Minheader
+        :is-auth="true"
+        :is-statuser="true"
+        :is-Search="true"
+        @addForm="addForm"
+        @searchForms="searchForms"
+        @clearForm="clearForm"
+      >
         <template #header>
           <div class="status flex-wrap">
             <div class="manageTitle">查询模板</div>
@@ -37,7 +44,8 @@ import Minheader from "@/components/minheader/index.vue";
 import Dialog from "@/components/dialog/index.vue";
 import { Query, GeneralDataReception } from "@/api/webApi";
 import { ElMessage } from "element-plus";
-const width = ref('200px')
+import { el } from "element-plus/es/locale";
+const width = ref("200px");
 const router = useRouter();
 const dataId = ref<String>("4"); //请求id
 const page = ref<number>(0); //分页参数
@@ -65,6 +73,7 @@ const tableForm = reactive({
 }); //弹窗内容
 //列表
 const tableData = ref([]);
+const tableDatcopy = ref([]);
 //表头
 const state = reactive({
   list: [
@@ -185,6 +194,7 @@ const getQuery = async () => {
         rowTitle.value = titleColumn.columnName;
       }
       tableData.value.push(...returnData.listValues);
+      tableDatcopy.value.push(...returnData.listValues);
       tableCols.value = returnData.columnSet;
       tableCols.value.forEach((element) => {
         element.label = element.columnLabel;
@@ -245,6 +255,27 @@ const generalDataReception = async (data) => {
     resetForm();
   }
 };
+//搜索
+const searchForms = (data) => {
+  if (data) {
+    tableData.value = [];
+    tableDatcopy.value.forEach((element) => {
+      if (element.queryTemplateID == data) {
+        tableData.value.push(element);
+      }
+    });
+  } else {
+    tableData.value = [];
+    page.value = 0;
+    getQuery();
+  }
+};
+//清除
+const clearForm = () => {
+  tableData.value = [];
+  page.value = 0;
+  getQuery();
+};
 onMounted(() => {
   getQuery();
 });