From b478c02ebb4b5eb28858bac8f3b7fc0539b23ede Mon Sep 17 00:00:00 2001
From: linwenling <3256558519@qq.com>
Date: 星期四, 10 八月 2023 14:39:03 +0800
Subject: [PATCH] 完善新增后表单清空问题

---
 ruoyi-ui/src/views/wish/index.vue |   84 +++++++++++++++++++++++++----------------
 1 files changed, 51 insertions(+), 33 deletions(-)

diff --git a/ruoyi-ui/src/views/wish/index.vue b/ruoyi-ui/src/views/wish/index.vue
index bf9e2ff..7f6704e 100644
--- a/ruoyi-ui/src/views/wish/index.vue
+++ b/ruoyi-ui/src/views/wish/index.vue
@@ -51,7 +51,7 @@
                   -->
       </el-form-item>
 
-      <el-form-item label="鏃堕棿">
+      <el-form-item label="鏃堕棿" prop="happenTime">
         <el-date-picker
           v-model="dateRange"
           style="width:  197px;
@@ -65,6 +65,7 @@
           range-separator="-"
           start-placeholder="寮�濮嬫棩鏈�"
           end-placeholder="缁撴潫鏃ユ湡"
+          @keyup.enter.native="handleQuery"
         ></el-date-picker>
       </el-form-item>
 
@@ -182,12 +183,12 @@
       </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">
         <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" >
@@ -212,22 +213,23 @@
 
         <template slot-scope="scope" >
           <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 !== ',' "
-          >
-          <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>
+            <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">
@@ -282,7 +284,7 @@
         <!--          <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-input v-model="formDat.happenTime" type='date' placeholder='閫夋嫨鏃ユ湡' clearable :style="{width: '100%'}" ></el-input>
         </el-form-item>
         <el-form-item label="鐞嗘兂鏍囬/鐧惧勾蹇冩効" prop="title">
           <el-input v-model="formDat.title" placeholder="璇疯緭鍏ョ悊鎯虫爣棰�/鐧惧勾蹇冩効" clearable :style="{width: '100%'}" >
@@ -360,7 +362,7 @@
           class="upload-demo"
           multiple
 
-          :on-remove="handleRemove"
+          :on-remove="handleRemoveFile"
           :http-request="requestUpload"
           :show-file-list="true"
         >
@@ -395,8 +397,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,12 +437,10 @@
       // 鏃ユ湡鑼冨洿
       dateRange: [],
       // 鏁版嵁鑼冨洿閫夐」
-      fot:[".jpg",".jif"],
-      fileList:[
-      ],
-      fileListOther:[
-
-      ],
+      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'],
@@ -567,7 +567,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]
 
@@ -614,7 +614,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() {
@@ -730,6 +741,13 @@
       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)
     {
@@ -770,11 +788,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