From 0edf2cc107cd03e8e007f97f38387d66f480cd3d Mon Sep 17 00:00:00 2001
From: linwenling <3256558519@qq.com>
Date: 星期二, 26 九月 2023 16:54:53 +0800
Subject: [PATCH] 修改家大事记 的图片文件上传 直调接口

---
 ruoyi-ui/src/views/wish/index.vue |  233 ++++++++++++++++++++++++++++-----------------------------
 1 files changed, 115 insertions(+), 118 deletions(-)

diff --git a/ruoyi-ui/src/views/wish/index.vue b/ruoyi-ui/src/views/wish/index.vue
index ed74568..1c5b5e1 100644
--- a/ruoyi-ui/src/views/wish/index.vue
+++ b/ruoyi-ui/src/views/wish/index.vue
@@ -1,125 +1,96 @@
 <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-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="鍦ㄢ�滅櫨骞村績鎰库�濅腑鎼滅储"
-          clearable
-          style="width: 240px"
-          @keyup.enter.native="handleQuery">
-          <i slot="prefix" class="el-input__icon el-icon-search"></i>
-        </el-input>
-        <!--        <el-input
-                  v-model="searchVal"
-                  placeholder="鍦ㄢ�滈�氳褰曗�濅腑鎼滅储"
-                  clearable
-                  style="width: 240px"
-                  @input="inputChange">
-                  <i slot="prefix" class="el-input__icon el-icon-search"></i>
-                </el-input>
-                <div class="outer-table">
-                   姝ょ埗缁勪欢寮曠敤瀛愮粍浠秚ablemax
-                  <tablemax label="myLabel" :tableData="contactList">
-                    <template v-slot:table>
-                      <el-table-column label="鎿嶄綔" width="180">
-                        <template slot-scope="scope">
-                          <el-button @click="handleCheck(scope.row)" type="text" size="small"
-                          >璋冪敤</el-button
-                          >
-                        </template>
-                      </el-table-column>
-                    </template>
-                  </tablemax>
-                </div>-->
-
-
-        <!--        v-model="queryParams.id"
-
-                  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"
-                  @keyup.enter.native="handleQuery"
-                  -->
-      </el-form-item>
-
-      <el-form-item label="鏃堕棿">
+      <el-form-item label="鏃堕棿" prop="happenTime">
         <el-date-picker
           v-model="dateRange"
           style="width:  197px;
           height: 30px;
           background: #FFFFFF;
           border-radius: 14px 14px 14px 14px;
-          opacity: 0.5;
-          border: 1px solid rgba(0,0,0,0.25);"
+          opacity: 0.5;"
           value-format="yyyy-MM-dd"
           type="daterange"
           range-separator="-"
           start-placeholder="寮�濮嬫棩鏈�"
           end-placeholder="缁撴潫鏃ユ湡"
+          @keyup.enter.native="handleQuery"
         ></el-date-picker>
       </el-form-item>
-
       <el-form-item label="鐞嗘兂鏍囬" prop="title">
         <el-input
           v-model="queryParams.title"
           placeholder="璇疯緭鍏ョ悊鎯虫爣棰�"
           clearable
-          style="width: 240px"
+          style="width: 200px;
+                   height: 35px;
+                   border-radius: 16px 16px 16px 16px;
+                   opacity: 0.5;"
           @keyup.enter.native="handleQuery">
           <i slot="prefix" class="el-input__icon el-icon-search"></i>
         </el-input>
       </el-form-item>
-
       <el-form-item label="鍙楁儬浜�" prop="beneficiary" >
         <el-input
           v-model="queryParams.beneficiary"
           placeholder="璇疯緭鍏ュ彈鎯犱汉"
           clearable
-          style="width: 240px"
+          style="width: 200px;
+                   height: 35px;
+                   border-radius: 16px 16px 16px 16px;
+                   opacity: 0.5;"
           @keyup.enter.native="handleQuery">
           <i slot="prefix" class="el-input__icon el-icon-search"></i>
         </el-input>
       </el-form-item>
-
       <el-form-item label="缁ф壙浜�" prop="heir">
         <el-input
           v-model="queryParams.heir"
           placeholder="璇疯緭鍏ョ户鎵夸汉"
           clearable
-          style="width: 240px"
+          style="width: 200px;
+                   height: 35px;
+                   border-radius: 16px 16px 16px 16px;
+                   opacity: 0.5;"
           @keyup.enter.native="handleQuery">
           <i slot="prefix" class="el-input__icon el-icon-search"></i>
         </el-input>
       </el-form-item>
-      <el-cntainer>
-        <el-col :span="9" >
-          <el-form-item>
-            <el-button size="mini" @click="handleQuery" style=" width: 67px;height: 27px;background: #FFDDE3;
-            border-radius: 7px 7px 7px 7px;opacity: 1; " >鎼滅储</el-button>
-            <el-button  size="mini" @click="resetQuery" style=" width: 67px;height: 27px;background: #FFDDE3;
-            border-radius: 7px 7px 7px 7px;opacity: 1; ">閲嶇疆</el-button>
-          </el-form-item>
-        </el-col>
-      </el-cntainer>
+      <el-form-item label="濮嬩簬浣曞洜" prop="cause">
+        <el-input
+          v-model="queryParams.cause"
+          placeholder="璇疯緭鍏ュ師鍥�"
+          clearable
+          style="width: 200px;
+                   height: 35px;
+                   border-radius: 16px 16px 16px 16px;
+                   opacity: 0.5;"
+          @keyup.enter.native="handleQuery">
+          <i slot="prefix" class="el-input__icon el-icon-search"></i>
+        </el-input>
+      </el-form-item>
+      <el-form-item label="鏄惁鏈夋晥" prop="isEffective">
+        <el-select v-model="queryParams.isEffective" placeholder="璇烽�夋嫨鏄惁鏈夋晥" clearable
+                   style="width: 200px;
+                   height: 35px;
+                   border-radius: 16px 16px 16px 16px;
+                   opacity: 0.5;" @keyup.enter.native="handleQuery">
+          <el-option v-for="item in typeOptions"
+                     :key="item.value" :label="item.label" :value="item.value"/>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item>
+        <el-button size="mini" @click="handleQuery" style=" width: 67px;height: 27px;background: #FFDDE3;
+        border-radius: 7px 7px 7px 7px;opacity: 1; " >鎼滅储</el-button>
+        <el-button  size="mini" @click="resetQuery" style=" width: 67px;height: 27px;background: #FFDDE3;
+        border-radius: 7px 7px 7px 7px;opacity: 1; ">閲嶇疆</el-button>
+      </el-form-item>
+
+
     </el-form>
+
     <div>
-      <!--      <div style="width: 100px;-->
-      <!--      height: 24px;-->
-      <!--      font-size: 18px;-->
-      <!--      font-family: Microsoft YaHei-Regular, Microsoft YaHei;-->
-      <!--      font-weight: 400;-->
-      <!--      color: #000000;-->
-      <!--      line-height: 21px;-->
-      <!--      ">鏀惰棌鍜岃崳瑾�</div>-->
 
       <el-row :gutter="10" class="mb8">
         <el-col :span="1.5">
@@ -182,21 +153,21 @@
       </el-row>
     </div>
     <el-table v-loading="loading" :data="wishList" :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="25"  align="center" />
+      <el-table-column type="selection" :reserve-selection="true" width="55"  align="center" />
       <el-table-column fixed label="搴忓彿" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="60"/>
-      <el-table-column label="鏃堕棿" prop="happenTime" sortable width="100" align="center">
+      <el-table-column label="鏃堕棿" prop="happenTime" sortable width="150" align="center">
         <template slot-scope="scope">{{scope.row.happenTime? scope.row.happenTime: '鈥斺�斺�斺��'}}</template>
       </el-table-column>
-      <el-table-column label="鐞嗘兂鏍囬/鐧惧勾蹇冩効" prop="title" sortable width="150" align="center">
+      <el-table-column label="鐞嗘兂鏍囬/鐧惧勾蹇冩効" prop="title" sortable width="160" align="center">
         <template slot-scope="scope">{{scope.row.title? scope.row.title: '鈥斺�斺�斺��'}}</template>
       </el-table-column>
-      <el-table-column label="濮嬩簬浣曞洜" prop="cause" sortable :show-overflow-tooltip="true" width="120" align="center" >
+      <el-table-column label="濮嬩簬浣曞洜" prop="cause" sortable :show-overflow-tooltip="true" width="140" align="center" >
         <template slot-scope="scope">{{scope.row.cause? scope.row.cause: '鈥斺�斺�斺��'}}</template>
       </el-table-column>
-      <el-table-column label="鍙楁儬浜�" prop="beneficiary" sortable width="120" align="center" >
+      <el-table-column label="鍙楁儬浜�" prop="beneficiary" sortable width="140" align="center" >
         <template slot-scope="scope">{{scope.row.beneficiary? scope.row.beneficiary: '鈥斺�斺�斺��'}}</template>
       </el-table-column>
-      <el-table-column label="缁ф壙浜�" prop="heir" sortable width="110" align="center">
+      <el-table-column label="缁ф壙浜�" prop="heir" sortable width="140" align="center">
         <template slot-scope="scope">{{scope.row.heir? scope.row.heir: '鈥斺�斺�斺��'}}</template>
       </el-table-column>
       <el-table-column label="瀹炵幇闅惧害" prop="difficulty" sortable width="120" align="center">
@@ -211,22 +182,24 @@
       <el-table-column label="鐢靛瓙鏂囦欢" prop="url" width="180" align="center">
 
         <template slot-scope="scope" >
-          <img
-            class="el-upload-list__item-thumbnail"
-            src="../../assets/images/deviceLis.png"
-            alt=""
-            style="width: 35px; height: 35px;"
-            fit="cover"
-            v-if="scope.row.url !== ',' "
-          >
-          <img
-            class="el-upload-list__item-thumbnail"
-            src="../../assets/images/deviceA.png"
-            alt=""
-            style="width: 35px; height: 35px;"
-            fit="cover"
-            v-if="scope.row.url === ','"
-          >
+          <div  @click="handleCheck(scope.row)">
+            <img
+              class="el-upload-list__item-thumbnail"
+              src="../../assets/images/deviceLis.png"
+              alt=""
+              style="width: 35px; height: 35px;"
+              fit="cover"
+              v-if="!(scope.row.url === '' || scope.row.url === ',' || scope.row.url === null)"
+            >
+            <img
+              v-else
+              class="el-upload-list__item-thumbnail"
+              src="../../assets/images/deviceA.png"
+              alt=""
+              style="width: 35px; height: 35px;"
+              fit="cover"
+
+            ></div>
         </template>
       </el-table-column>
       <el-table-column label="澶囨敞" prop="remark" sortable width="90" align="center">
@@ -281,8 +254,9 @@
         <!--          <el-input v-model="formDat.happenTime" placeholder="璇疯緭鍏ヨ幏寰楁椂闂�" clearable :style="{width: '100%'}" ></el-input>-->
         <!--        </el-form-item>-->
         <el-form-item label="鏃堕棿" prop="happenTime">
-          <el-date-picker v-model='formDat.happenTime' type='date' placeholder='閫夋嫨鏃ユ湡'></el-date-picker>
-        </el-form-item>
+          <el-date-picker v-model="formDat.happenTime" type="date" placeholder="璇烽�夋嫨鏃ユ湡"
+                          :editable="false" :style="{width: '100%'}"  value-format="yyyy-MM-dd"
+          ></el-date-picker></el-form-item>
         <el-form-item label="鐞嗘兂鏍囬/鐧惧勾蹇冩効" prop="title">
           <el-input v-model="formDat.title" placeholder="璇疯緭鍏ョ悊鎯虫爣棰�/鐧惧勾蹇冩効" clearable :style="{width: '100%'}" >
           </el-input>
@@ -322,7 +296,7 @@
           :http-request="requestUpload"
           :file-list="fileList"
         >
-          <i slot="default" class="el-icon-plus"></i>
+          <i  slot="default" class="el-icon-plus"></i>
           <div slot="file" slot-scope="{file}">
             <img
               class="el-upload-list__item-thumbnail"
@@ -359,11 +333,12 @@
           class="upload-demo"
           multiple
 
-          :on-remove="handleRemove"
+          :on-remove="handleRemoveFile"
           :http-request="requestUpload"
           :show-file-list="true"
         >
           <el-button type="primary">鐐瑰嚮涓婁紶</el-button>
+          <div v-if="uploading" class="upload-status">姝e湪涓婁紶...</div>
           <template #tip>
             <div class="el-upload__tip">
             </div>
@@ -394,8 +369,8 @@
 
 
 //瀵煎叆鎺ュ彛鍑芥暟
-import {listWish, getWish, addWish,updateWish, delWish,uploadPic,downloadModel} from "@/api/wish/index";
-import {enload} from "@/api/doctor";
+import {listWish, getWish, addWish,updateWish, delWish,uploadPic,downloadModel,enload} from "@/api/wish/index";
+
 import {Message} from "element-ui";
 
 
@@ -435,15 +410,12 @@
       dateRange: [],
       // 鏁版嵁鑼冨洿閫夐」
       fot:[".jpg",".jif"],
-      fileList:[
-      ],
-      fileListOther:[
-
-      ],
+      fileList:[],
+      fileListOther:[],
       dsb:true,
       btn:false,
       fit:['fill'],
-
+      uploading: false,
       formDat: {
         //鐧惧勾蹇冩効璁板綍
         id:undefined,
@@ -469,6 +441,8 @@
         title:undefined,
         heir:undefined,
         beneficiary:undefined,
+        cause:undefined,
+        isEffective:undefined
         // happenTime:undefined,
       },
       // searchVal:"",
@@ -531,7 +505,7 @@
   },
   created() {
     this.getList();
-    this.getCateInfor()
+    // this.getCateInfor()
     // for (let i = 0; i < this.contactList.length; i++) {
     //   this.formDat[i] = this.contactList[i];
     // }
@@ -566,7 +540,7 @@
     /** 鏌ヨ璁板綍鍒楄〃 */
     getList() {
       this.loading = true;
-      console.log(this.queryParams)
+      // console.log(this.queryParams)
       this.queryParams.happenStartTime = this.dateRange.length > 0 && this.dateRange[0]
       this.queryParams.happenEndTime = this.dateRange.length > 0 && this.dateRange[1]
 
@@ -613,7 +587,18 @@
     //   }
     // },
     handleRemove(file) {
-      alert(323)
+      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() {
@@ -725,6 +710,17 @@
           });
         }
       });
+      // 娓呯┖formDat瀵硅薄鐨勬暟鎹�
+      Object.keys(this.formDat).forEach(key => {
+        this.formDat[key] = '';
+      });
+      for(let i = 0; i <= this.fileList.length; i++)
+      {
+        this.handleRemove(this.fileList[0]);
+      }
+      for(let i = 0; i < this.fileListOther.length; i++){
+        this.handleRemoveFile(this.fileListOther[0]);
+      }
     },
     requestUpload(params)
     {
@@ -732,10 +728,11 @@
       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})
@@ -765,11 +762,11 @@
 
       if(Ids.length==0)
       {
-        this.download('zIdea/export', {
+        this.download('/zIdea/export', {
           ...this.queryParams
         }, `zIdea_${new Date().getTime()}.xlsx`)
       }else{
-        this.download('zIdea/export1/'+Ids, {
+        this.download('/zIdea/export1/'+Ids, {
         }, `zIdea_${new Date().getTime()}.xlsx`)
       }
     },

--
Gitblit v1.9.1