From 7fc578dc2032fac935267e92208f7f11384e3800 Mon Sep 17 00:00:00 2001
From: feige <791364011@qq.com>
Date: 星期四, 28 十一月 2024 08:36:36 +0800
Subject: [PATCH] 修改了相关bug

---
 ruoyi-ui/src/views/search/index.vue |  503 +++++++++++--------------------------------------------
 1 files changed, 104 insertions(+), 399 deletions(-)

diff --git a/ruoyi-ui/src/views/search/index.vue b/ruoyi-ui/src/views/search/index.vue
index f8d3ae5..f99cc28 100644
--- a/ruoyi-ui/src/views/search/index.vue
+++ b/ruoyi-ui/src/views/search/index.vue
@@ -1,18 +1,13 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
-      <el-form-item label="" prop="phone wx qq twitter isAlways remark" >
+    <el-form  ref="queryForm" size="small" :inline="true" v-show="showSearch">
+      <el-form-item label="鍏抽敭瀛�" prop="keyword" >
         <el-input
-          v-model:phone="queryParams.phone"
-          v-model:wx="queryParams.wx"
-          v-model:qq="queryParams.qq"
-          v-model:twitter="queryParams.twitter"
-          v-model:isAlways="queryParams.isAlways"
-          v-model:remark="queryParams.remark"
-          placeholder=" "
+          v-model="keyword"
+          placeholder="璇疯緭鍏ユ悳绱㈠叧閿瓧"
           clearable
           style="width: 240px"
-          @keyup.enter.native="handleQuery">
+          @keyup.enter.native="getList">
           <i slot="prefix" class="el-input__icon el-icon-search"></i>
         </el-input>
 
@@ -20,7 +15,7 @@
       <el-form-item label="鏃堕棿" prop="happenTime">
         <el-date-picker
           v-model="dateRange"
-          style="width:  197px;
+          style="width:  240px;
           height: 30px;
           background: #FFFFFF;
           border-radius: 14px 14px 14px 14px;
@@ -43,42 +38,34 @@
     </el-form>
     <span style="font-size:16px">鎼滅储缁撴灉濡備笅锛�</span>
     <el-divider />
-
-    <el-table v-loading="loading" :data="searchList" :row-key="getRowId" ref="multipleTable" @selection-change="handleSelectionChange"  :row-class-name="tableRowClassName" style="background: #FFEFF2;  border-radius: 14px 14px 14px 14px;">
+    <!-- 鑳屾櫙鍥剧墖 -->
+    <div class="background-image"><img src="../../assets/images/searchEmpty.png" v-if="showContent === 'image'" ></div>
+    <el-table v-loading="loading"  v-if="showContent === 'table'" :data="searchList" :row-key="getRowId" ref="multipleTable" @selection-change="handleSelectionChange"  :row-class-name="tableRowClassName" style="background: #FFEFF2;  border-radius: 14px 14px 14px 14px;">
 <!--      <el-table-column type="selection" :reserve-selection="true" width="55"  align="center" />-->
       <el-table-column fixed label="搴忓彿" sortable type="index" align="center" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="60"/>
-      <el-table-column label="鏍囪瘑" prop="type" sortable :show-overflow-tooltip="true" width="120" align="center" >
-        <template slot-scope="scope">{{scope.row.type? scope.row.type: '鈥斺�斺�斺��'}}</template>
+      <el-table-column label="鎵�鍦ㄦā鍧�" prop="ctTableName" sortable :show-overflow-tooltip="true" width="120" align="center" >
+        <template slot-scope="scope">{{scope.row.ctTableName? scope.row.ctTableName: '鈥斺�斺�斺��'}}</template>
         <!--        <template slot-scope="scope">{{ getSrc1(scope.row.type) }}</template>-->
       </el-table-column>
-      <el-table-column label="瀛楁" prop="name" sortable  width="120" align="center" >
-        <template slot-scope="scope">{{scope.row.name? scope.row.name: '鈥斺�斺�斺��'}}</template>
+      <el-table-column label=" " prop="by1" sortable  width="120" align="center" >
+        <template slot-scope="scope">{{scope.row.by1? scope.row.by1: '鈥斺�斺�斺��'}}</template>
       </el-table-column>
-      <el-table-column label="鏃堕棿" prop="getDate" sortable width="170" align="center" >
-        <template slot-scope="scope">{{scope.row.getDate? scope.row.getDate: '鈥斺�斺�斺��'}}</template>
+      <el-table-column label=" " prop="by2" sortable width="170" align="center" >
+        <template slot-scope="scope">{{scope.row.by2? scope.row.by2: '鈥斺�斺�斺��'}}</template>
       </el-table-column>
-      <el-table-column label="浣嶇疆" prop="location" sortable width="170" align="center" >
-        <template slot-scope="scope">{{scope.row.location? scope.row.location: '鈥斺�斺�斺��'}}</template>
+      <el-table-column label=" " prop="by3" sortable width="170" align="center" >
+        <template slot-scope="scope">{{scope.row.by3 ? scope.row.by3: '鈥斺�斺�斺��'}}</template>
+      </el-table-column>
+      <el-table-column label=" " prop="by4" sortable width="170" align="center" >
+        <template slot-scope="scope">{{scope.row.by4? scope.row.by4: '鈥斺�斺�斺��'}}</template>
+      </el-table-column>
+      <el-table-column label=" " prop="by6" sortable width="170" align="center" >
+        <template slot-scope="scope">{{scope.row.by6 ? scope.row.by6: '鈥斺�斺�斺��'}}</template>
       </el-table-column>
 
       <!--      </el-table-column>-->
       <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope" v-if="scope.row.roleId !== 1">
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['system:role:edit']"
-          >淇敼</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['system:role:remove']"
-          >鍒犻櫎</el-button>
-
           <el-button
             size="mini"
             type="text"
@@ -89,21 +76,15 @@
       </el-table-column>
     </el-table>
 
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      style="background: #FEF7FC;"
-      @pagination="getList"
-    />
+<!--    <pagination-->
+<!--      v-show="total>0"-->
+<!--      :total="total"-->
+<!--      :page.sync="queryParams.pageNum"-->
+<!--      :limit.sync="queryParams.pageSize"-->
+<!--      style="background: #FEF7FC;"-->
+<!--      @pagination="getList"-->
+<!--    />-->
 
-
-
-    <!-- 鍒嗛厤瑙掕壊鏁版嵁鏉冮檺瀵硅瘽妗� -->
-    <el-dialog :title="title" :visible.sync="openDataScope" width="500px" append-to-body>
-
-    </el-dialog>
 
   </div>
 </template>
@@ -115,19 +96,24 @@
 
 
 //瀵煎叆鎺ュ彛鍑芥暟
-import {listHonor,listType,enload, addHonor,updateHonor, delHonor,uploadPic,getCategory} from "@/api/honor/index";
+import {getSearch} from "@/api/search/index";
 
 import { Notification, MessageBox, Message, Loading } from 'element-ui'
 export default {
+  computed: {
+    showContent() {
+      if (this.keyword ==='') {
+        return 'image';
+      } else {
+        return 'table';
+      }
+    },
+  },
   name: "index",
   dicts: ['sys_normal_disable'],
   data() {
     return {
-      // 閬僵灞�
-      disabled: false,
-
-      loading: true,
-      formData:[],
+      loading: false,
       // 閫変腑鏁扮粍
       ids: [],
       // 闈炲崟涓鐢�
@@ -138,9 +124,9 @@
       showSearch: true,
       // 鎬绘潯鏁�
       total: 0,
-      // 鑽h獕琛ㄦ牸鏁版嵁
+      // 鎼滅储琛ㄦ牸鏁版嵁
       searchList: [],
-      typeList:[],
+      keyword:'',
       // 寮瑰嚭灞傛爣棰�
       title: "",
       // 鏄惁鏄剧ず寮瑰嚭灞�
@@ -153,113 +139,35 @@
       deptNodeAll: false,
       // 鏃ユ湡鑼冨洿
       dateRange: [],
-      // 鏁版嵁鑼冨洿閫夐」
-      fot:['.bmp','.jpg','.jpeg','.png','.tif','.gif','.pcx','.tga','.exif','.fpx',
-        '.svg','.psd','.cdr','.pcd','.dxf','.ufo','.eps','.ai','.aw','.WMF','.webp','.apng'],
-      fileList:[],
-      fileListOther:[],
-      dsb:true,
-      btn:false,
-      fit:['fill'],
-      uploading: false,
       formDat: {
-        //鑽h獕璇佷功璁板綍
-        id:undefined,
-        type:undefined,
+        ctTableName:undefined,
         createTime:undefined,
-        name:undefined,
-        idNo:undefined,
-        grade:undefined,
-        validityDate:undefined,
-        getDate:undefined,
-        location:undefined,
+        by1:undefined,
+        by2:undefined,
+        by3:undefined,
+        by4:undefined,
+        by5:undefined,
+        by6:undefined,
         remark:undefined,
-        url: undefined,
-
+        location:undefined,
+        ctId:undefined
       },
-      // 鑿滃崟鍒楄〃
-      menuOptions: [],
-      // 閮ㄩ棬鍒楄〃
-      deptOptions: [],
       // 鏌ヨ鍙傛暟
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        type:undefined,
-        grade:undefined,
-        name:undefined,
+        remark:undefined
       },
-      // searchVal:"",
-
       // 琛ㄥ崟鍙傛暟
       form: {},
-      defaultProps: {
-        children: "children",
-        label: "label"
-      },
-      // 琛ㄥ崟鏍¢獙
-      rules: {
-        createTime: [{
-          required: true,
-          message: '璇疯緭鍏ュ垱寤烘椂闂�',
-          trigger: 'blur'
-        }],
-        type: [{
-          required: true,
-          message: '璇疯緭鍏ョ被鍨�',
-          trigger: 'blur'
-        }],
-        name: [{
-          // required: true,
-          message: '璇疯緭鍏ュ悕绉�',
-          trigger: 'blur'
-        }],
-        grade: [{
-          required: true,
-          message: '璇疯緭鍏ョ骇鍒�',
-          trigger: 'blur'
-        }],
-        idNo: [{
-          required: true,
-          message: '璇疯緭鍏ヨ瘉浠跺彿/涓撲笟',
-          trigger: 'blur'
-        }],
-        validityDate: [{
-          // required: true,
-          message: '璇疯緭鍏ユ湁鏁堟椂闂�',
-          trigger: 'blur'
-        }],
-        getDate: [{
-          // required: true,
-          message: '璇疯緭鍏ヨ幏寰楁椂闂�',
-          trigger: 'blur'
-        }],
-        location: [{
-          // required: true,
-          message: '璇疯緭鍏ュ瓨鏀句綅缃�',
-          trigger: 'blur'
-        }],
-        remark: [{
-          // required: true,
-          message: '璇疯緭鍏ュ娉�',
-          trigger: 'blur'
-        }],
-      },
-      selected:'',
-      typeOptions: [],
-      newOption: undefined,
-      showInput: true,
-      typeOption:[
-        {value:'璇佷欢',label:'璇佷欢'},
-        {value:'鑽h獕',label:'鑽h獕'},
-        {value:'璧勮川',label:'璧勮川'},]
+      showTable: false,
 
     };
   },
-  created() {
-    this.getList();
-    this.getTypeOptions();
-  },
+  // created() {
+  //   // this.getList();
+  // },
+
   methods: {
     // 鍙栨秷鎸夐挳
     cancelData() {
@@ -275,120 +183,21 @@
         return "statistics-warning-row";
       }
     },
-    //鍚嶇О
-    addNewOption() {
-      const newOption = this.newOption.trim();
-      if (newOption && !this.typeOptions.includes(newOption)) {
-        this.typeOptions.push(newOption);
-        this.$set(this.formDat, 'name', newOption); // 鏇存柊formDat.type鐨勫�间负鏂扮殑閫夐」
-      }
-    },
     /** 鏌ヨ璁板綍鍒楄〃 */
     getList() {
-      this.loading = true;
-      console.log(this.queryParams)
+      console.log("1")
       this.queryParams.happenStartTime = this.dateRange.length > 0 && this.dateRange[0]
       this.queryParams.happenEndTime = this.dateRange.length > 0 && this.dateRange[1]
-      //  listProperty(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
-      listHonor(this.queryParams).then(response => {
+
+      const keyword = this.keyword
+      getSearch({keyword}).then(response => {
           //  alert(123)
-          //   console.log(response.data)
-          this.honorList = response.data.data;
-
-          this.total = response.data.total;
+        console.log("鎺ュ彛杩斿洖鐨勬暟鎹細", response.data);
+          this.searchList = response.data;
+        console.log("璧嬪�煎悗鐨剆earchList锛�", this.searchList);
           this.loading = false;
         }
       );
-      listType(this.queryParams).then(response => {
-          this.typeList = response.data;
-          this.total = response.data.total;
-          // console.log( this.typeList )
-          // 鍦ㄥ洖璋冨嚱鏁颁腑璋冪敤 getTypeOptions()
-          this.getTypeOptions();
-          this.loading = false;
-        }
-      );
-    },
-    getTypeOptions() {
-      const filteredOptions = this.typeList.filter(item => typeof item === 'string' && item !== '');
-
-      const uniqueOptions = {};
-
-      this.typeOptions = filteredOptions.reduce((options, option) => {
-        if (!uniqueOptions[option]) {
-          uniqueOptions[option] = true;
-          options.push({
-            label: option,
-            value: option
-          });
-        }
-        return options;
-      }, []);
-
-    },
-    /** 鏌ヨ绫诲埆淇℃伅 */
-    // getCateInfor()
-    // {
-    //   let _this = this
-    //   getCategory().then(response=>{
-    //
-    //     // response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{
-    //     //   _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]})
-    //     response.data.itemValues.replace("{", "").replace("}", "").split(",").map(elem => {
-    //       const label = elem.split(":")[0].trim();
-    //       const value = parseInt(elem.split(":")[1].trim());
-    //       _this.typeOptions.push({ "label": label, "value": value });
-    //     })
-    //   })
-    // },
-    //绫诲埆閫夋嫨
-    getSrc1(type){
-      if(type===0){
-        return '璇佷欢'
-      }else if(type===1){
-        return '鑽h獕'
-      }else if(type===2){
-        return '璧勮川'
-      }
-    },
-    //鍚嶇О閫夋嫨
-    getSrc(name) {
-      if (name === 1){
-        return '鍑虹敓璇�'
-      }else if(name === 2){
-        return '瀛︾敓璇�'
-      }else if(name === 3){
-        return '姣曚笟璇�'
-      }else if(name === 4){
-        return '缁撳璇�'
-      }else if(name === 5){
-        return '鎴峰彛绨�'
-      }else if(name === 6){
-        return '鐙敓瀛愬コ璇�'
-      }else if(name === 7){
-        return '楂樼骇鑱岀О'
-      }else if(name === 8){
-        return '鎶ょ収'
-      }else if(name === 9){
-        return '閫氳璇�'
-      }else {
-        return '鍏跺畠'
-      }
-    },
-
-    handleRemove(file) {
-      for(let i = 0; i < this.fileList.length; i++)
-      {
-        if(this.fileList[i].url==file.url)
-          this.$delete(this.fileList,i);
-      }
-    },
-    handleRemoveFile(file) {
-      for(let i = 0; i < this.fileListOther.length; i++)
-      {
-        if(this.fileListOther[i].url==file.url)
-          this.$delete(this.fileListOther,i);
-      }
     },
     // 鍙栨秷鎸夐挳
     cancel() {
@@ -403,8 +212,7 @@
     cancelDataScope() {
       this.openDataScope = false;
       this.reset();
-    },
-    // 琛ㄥ崟閲嶇疆
+    },// 琛ㄥ崟閲嶇疆
     reset() {
       if (this.$refs.menu != undefined) {
         this.$refs.menu.setCheckedKeys([]);
@@ -425,19 +233,23 @@
           deptCheckStrictly: true,
           remark: undefined
         };
-      this.resetForm("form");
+      this.resetForm("elForm");
     },
+
     /** 鎼滅储鎸夐挳鎿嶄綔 */
     handleQuery() {
       this.queryParams.pageNum = 1;
 
-      this.getList();
+	  if(this.keyword!=''||this.dateRange.length!=0)
+		this.getList();
     },
     /** 閲嶇疆鎸夐挳鎿嶄綔 */
     resetQuery() {
       this.dateRange = [];
-      this.resetForm("queryForm");
-      this.handleQuery();
+      this.keyword = '';
+	  this.queryParams.pageNum = 1;
+	         this.searchList = []
+     // this.getList();
     },
     // 澶氶�夋閫変腑鏁版嵁
     handleSelectionChange(selection) {
@@ -446,156 +258,46 @@
       this.single = selection.length!=1
       this.multiple = !selection.length
     },
-    // //姣忔鏀瑰彉input妗嗗�兼椂灏辨敼鍙榯his.myTableData鐨勫��
-    // inputChange() { //寰幆姣忎竴椤� 鍙content鐨勫�煎惈鏈夎緭鍏ョ殑searchVal鍊硷紝灏卞姞杩沶ewList锛涘弽涔嬶紝灏辨棤涓滆タ鍔犺繘newList
-    //   let newlist = this.formDat.filter(
-    //     (item) => item.content.indexOf(this.searchVal) > -1
-    //   );
-    //   this.contactList = newlist;
-    // },
-
-
-    /** 鏂板鎸夐挳鎿嶄綔 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "娣诲姞璇佷欢/鑽h獕/璧勮川淇℃伅";
-    },
     /** 鏌ョ湅璇︾粏淇℃伅 */
     handleCheck(row){
-      const id = row.id;
-      this.$router.push("/self/Honor/honorInfo/" + id);
-    },
-    /** 淇敼鎸夐挳鎿嶄綔 */
-    handleUpdate(row) {
-      const id = row.id;
-      let jd = true
+      // const id = row.id;
+      console.log(row.by5 +'/' + row.ctId);
+      var path = row.by5
+      if (row.by5=="/family/zfEvent" ){ //瀹跺ぇ浜嬭
+        path = "/familymodel/bignote/familyeventInfo/"
 
-      this.$router.push({
-        path:"/self/Honor/honorInfo/" + id,
-        query:{
-          detail:jd
-        }
-      });
-    },
+      }else if(row.by5=="/family/zfProperty"){//瀹跺涵璧勪骇绠$悊
+        path ="/familymodel/property/propertyInfo/"
 
+      }else if(row.by5=="/family/zfEquipment"){//瀹跺涵璁惧
+        path ="/familymodel/Device/equipmentInfo/"
 
-    handlePictureCardPreview(file) {
-      this.dialogImageUrl = file.url;
-      this.dialogVisible = true;
-    },
-    /** 鎻愪氦鎸夐挳锛堟暟鎹潈闄愶級 */
-    submitDataScope: function() {
+      }else if(row.by5=="/family/zfCollection"){//鏀惰棌鍜岃崳瑾�
+        path = "/familymodel/collection/collectionInfo/"
 
+      }else if(row.by5=="/family/zfDoctor"){//瀹跺涵灏忓尰鐢�
+        path ="/familymodel/Doctor/doctorInfo/"
 
-      let ul = this.fileList.map(function (elem){
-        return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
-      }).join(",")
-      let uls = this.fileListOther.map(function (elem){
-        return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
-      }).join(",")
-      this.formDat.url = ul+","+uls
-      this.$refs["elForm"].validate(valid => {
-        if (valid) {
+      }else if(row.by5=="/family/zfClean"){ // 淇濇磥鏀剁撼  -----------鏈夐棶棰�----宸茶В鍐�
+        path = "/familymodel/clean/cleanInfo/"
 
-          addHonor(this.formDat).then(response => {
-            this.$modal.msgSuccess("鏂板鎴愬姛");
-            this.open = false;
-            this.getList();
-          });
-        }
-      });
-      // 娓呯┖formDat瀵硅薄鐨勬暟鎹�
-      Object.keys(this.formDat).forEach(key => {
-        this.formDat[key] = '';
-      });
-      for(let i = 0; i <= this.fileList.length; i++)
-      {
-        this.handleRemove(this.fileList[0]);
+      }else if(row.by5=="/family/zfContact"){  //閫氳褰�
+        path ="/familymodel/Contact/contactsInfo/"
+
+      }else if(row.by5=="/familymodel/zfPet"){ // 榄呭疇
+        path = "/familymodel/pet/petInfo/"
+
+      }else if(row.by5=="/family/zfEconomy"){ // 瀹跺涵鏀舵敮鍙拌处
+        path = "/familymodel/economy/economyInfo/"
       }
-      for(let i = 0; i < this.fileListOther.length; i++){
-        this.handleRemoveFile(this.fileListOther[0]);
-      }
-    },
-    requestUpload(params)
-    {
-      var file = params.file;
-      var formData = new FormData();
-      formData.append('uploadFile', file);
-      let _this = this
-      this.uploading = true;
-      uploadPic(formData).then(response => {
-        let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length)
-        this.uploading = false;
-        this.$modal.msgSuccess("涓婁紶鎴愬姛");
-        if(_this.fot.includes(pth) === true)
-        {
-          _this.fileList.push({name:response.data.fileName, "url":response.data.url})
 
-        }
+      this.$router.push(path + row.ctId);
 
-        else{
-          _this.fileListOther.push({name:response.data.fileName, url:response.data.url})
-
-        }
-      })
 
     },
-    /** 鍒犻櫎鎸夐挳鎿嶄綔 */
-    handleDelete(row) {
-      const Ids = row.id || this.ids;
-      this.$modal.confirm('鏄惁纭鍒犻櫎鏁版嵁椤癸紵').then(function() {
-        return delHonor(Ids);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-      }).catch(() => {});
-    },
-    /** 瀵煎嚭鎸夐挳鎿嶄綔 */
-    handleExport() {
-      const Ids = this.ids;
 
-      if(Ids.length==0)
-      {
-        this.download('/zHonor/export', {
-          ...this.queryParams
-        }, `zHonor_${new Date().getTime()}.xlsx`)
-      }else{
-        this.download('/zHonor/export1/'+Ids, {
-
-        }, `zHonor_${new Date().getTime()}.xlsx`)
-      }
-    },
-
-    handleExportTemplate(){
-      this.download('/zHonor/model', {
-
-      }, `zHonor_${new Date().getTime()}.xlsx`)
-    },
-    /** 瀵煎叆鎿嶄綔*/
-    handleEnport(params){
-      var file = params.file;
-      var formData = new FormData();
-      formData.append('excelImport', file);
-      let _this = this
-
-      enload(formData).then(response => {
-        _this.getList();
-        Message({ message: "瀵煎叆鎴愬姛", type: 'warning' })
-
-      }).catch(() => { Message({ message: "瀵煎叆澶辫触", type: 'error' })});
-
-    }
   },
-  watch: {
-    type(value) {
-      if (value === '') {
-        this.showInput = true;
-      } else {
-        this.showInput = false;
-      }
-    }
-  }
+
 };
 </script>
 <style>
@@ -610,7 +312,10 @@
   background: #FFEFF2;
 
 }
-
+.background-image img {
+  width: 100%;
+  height: 100%;
+}
 
 </style>
 

--
Gitblit v1.9.1