From e33eb0eb98aa0a88d2b3a7163abf92e4e028fb31 Mon Sep 17 00:00:00 2001
From: YM <479443481@qq.com>
Date: 星期五, 17 五月 2024 21:09:39 +0800
Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/TCM_CharacterLibrary

---
 src/pages/knowledgeBase/knowledgeBase.vue |   54 ++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 34 insertions(+), 20 deletions(-)

diff --git a/src/pages/knowledgeBase/knowledgeBase.vue b/src/pages/knowledgeBase/knowledgeBase.vue
index 227ad41..4562450 100644
--- a/src/pages/knowledgeBase/knowledgeBase.vue
+++ b/src/pages/knowledgeBase/knowledgeBase.vue
@@ -47,7 +47,7 @@
         class="advancedSeaTrue1"
       >
         <h3>楂樼骇鎼滅储</h3>
-        <MyForm @submit="onSubmit" :from="from" />
+        <MyForm @submit="onSubmit" @reset="resetForm" :from="from" />
       </view>
     </view>
     <uni-row
@@ -375,11 +375,19 @@
       dataTable: [],
       option: {},
       keywords: "",
+      submitData: {
+        name: "",
+        alias: "",
+        nativePlace: "",
+        tagId: "",
+        official: "",
+        genderType: "",
+      },
     };
   },
   onLoad(options) {
-    this.onSearch({ text: options.name });
-    this.keywords = options.name;
+    console.log(options.keyword);
+    this.onSearch({ text: options.keyword });
   },
   mounted() {
     // 淇敼涓ゆ鐨勯珮搴︿繚鎸佷竴鑷�
@@ -388,10 +396,12 @@
       box1Height + box1Height / 18 + "px";
     console.log(box1Height, "box1Height");
     this.getStatistics();
-    // 榛樿鍏堣皟鐢ㄦ悳绱竴娆�
-    this.onSearch("");
   },
   methods: {
+    //閲嶇疆鎼滅储缁撴灉
+    resetForm() {
+      this.tableData = [];
+    },
     // ExportJsonExcel瀹炰緥
     Ture() {
       //   鍒涘缓ExportJsonExcel瀹炰緥瀵硅薄
@@ -402,24 +412,27 @@
     // 涓嬭浇鎸夐挳
     async exportClick() {
       const dataList = this.tableData;
+      console.log(this.keywords, "keywords");
       let Obj = {
-        keywords: "", //鎼滅储妗嗘绱�
-        name: "", //濮撳悕
-        alias: "", //鍒悕
-        nativePlace: "", //鏈哄叧
-        tagId: null, //鑱屼笟id
-        official: null, //鑱屽畼
-        genderType: null, //鎬у埆
-        dynasty: null, //鏈濅唬id
-        dynastyId: null, //鏈濅唬id
-        institution: null, //鏈烘瀯
+        keywords: "妤�", //鎼滅储妗嗘绱�
+        // keywords: this.keywords, //鎼滅储妗嗘绱�
+        name: this.submitData.name, //濮撳悕
+        alias: this.submitData.alias, //鍒悕
+        nativePlace: this.submitData.nativePlace, //鏈哄叧
+        tagId: this.profession.id !== 0 ? Number(this.profession.id) : null, //鑱屼笟id
+        official: this.submitData.official, //鑱屽畼
+        genderType:
+          this.submitData.genderType !== "" ? this.submitData.genderType : null, //鎬у埆
+        dynasty: this.dynasty.id !== "" ? Number(this.dynasty.id) : null, //鏈濅唬id
+        institution: "", //鏈烘瀯
         bookId: null, //鏉ユ簮id
         page: 1,
-        pageSize: 9999,
+        pageSize: 1,
       };
+      console.log(Obj, "Obj");
       // // 鎼滅储
-      await getPersonList(Obj).then((res) => {
-        console.log(res);
+      await getPDownload(Obj).then((res) => {
+        console.log(res, "exportClick");
         // if (res.success) {
         //   console.log(res, "鎼滅储鎺ュ彛");
         //   this.tableData = res.list;
@@ -579,7 +592,6 @@
         var box1Height = document.querySelector(".fbox").offsetHeight;
         // let box2Height= document.querySelector('.fbox1').style.height = box1Height + 'px';
         let box2Height = document.querySelector(".fbox1").offsetHeight;
-        console.log(box1Height, box2Height);
         if (box1Height <= box2Height) {
           document.querySelector(".fbox1").style.height = box1Height + "px";
         }
@@ -597,7 +609,7 @@
         this.dynasty.index = currentDynasty.dynastyId;
         this.dynasty.id = currentDynasty.dynastyId;
       }
-
+      this.submitData = val;
       this.CurrentPage = 1;
       let Obj = {
         keywords: "", //鎼滅储妗嗘绱�
@@ -628,6 +640,7 @@
     },
     // 鍩虹鎼滅储
     async onSearch(val) {
+      this.keywords = val.text;
       let Obj = {
         keywords: val.text, //鎼滅储妗嗘绱�
         name: "", //濮撳悕
@@ -643,6 +656,7 @@
         page: this.CurrentPage,
         pageSize: this.pageSize,
       };
+      console.log(Obj,"ObjObjObj");
       // // 鎼滅储
       await getPersonList(Obj).then((res) => {
         if (res.success) {

--
Gitblit v1.9.1