From bcac500a760877dc9140f1f381739793706c1af6 Mon Sep 17 00:00:00 2001 From: feige <feige@qq.com> Date: 星期五, 10 十一月 2023 10:29:38 +0800 Subject: [PATCH] 修改图片大小 --- ruoyi-ui/src/views/economy/index.vue | 157 +++++++++++++++++++++++++++++----------------------- 1 files changed, 88 insertions(+), 69 deletions(-) diff --git a/ruoyi-ui/src/views/economy/index.vue b/ruoyi-ui/src/views/economy/index.vue index 88d62f6..32f6914 100644 --- a/ruoyi-ui/src/views/economy/index.vue +++ b/ruoyi-ui/src/views/economy/index.vue @@ -2,11 +2,14 @@ <div class="app-container" style="opacity: 1;"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"> - <el-form-item label="鏃堕棿" > + <el-form-item label="鏃堕棿" prop="createTime"> <el-date-picker v-model="dateRange" - style="width: 240px;" - value-format="yyyy-MM-dd HH-MM" + style="width: 200px; + height: 35px; + border-radius: 16px 16px 16px 16px; + opacity: 0.5;" + value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="寮�濮嬫棩鏈�" @@ -18,26 +21,24 @@ v-model="queryParams.usePeople" placeholder="璇疯緭鍏ヤ娇鐢ㄤ汉" clearable - style="width: 240px" + style="width: 200px; + height: 35px; + border-radius: 16px 16px 16px 16px; + opacity: 0.5;" @keyup.enter.native="handleQuery" /> </el-form-item> - <el-form-item label="绫诲瀷" prop="type"> - <el-input - v-model="queryParams.type" - placeholder="璇疯緭鍏ョ被鍨�" - clearable - style="width: 240px" - @keyup.enter.native="handleQuery" - /> - </el-form-item> + <el-form-item label="鐢ㄩ��" prop="useFor"> <el-input v-model="queryParams.useFor" placeholder="璇疯緭鍏ョ敤閫�" clearable - style="width: 240px" + style="width: 200px; + height: 35px; + border-radius: 16px 16px 16px 16px; + opacity: 0.5;" @keyup.enter.native="handleQuery" /> </el-form-item> @@ -86,7 +87,7 @@ plain icon="el-icon-download" size="mini" - @click="handleExportTemplate" + @click="handleExport" v-hasPermi="['family:note:export']" >瀵煎叆妯℃澘涓嬭浇</el-button> </el-col> @@ -99,7 +100,7 @@ > <el-button size="mini" type="primary" plain - icon="el-icon-plus" >瀵煎叆</el-button> + icon="el-icon-top" >瀵煎叆</el-button> </el-upload> </el-col> @@ -109,47 +110,53 @@ <!-- 杩欓噷鏈変釜familyList鏁扮粍 鏄湪data()涓畾涔夌殑 --> <el-table v-loading="loading" :data="economyList" @selection-change="handleSelectionChange" @row-click="handleCheck" :row-class-name="tableRowClassName" style="background: #FFEFF2; border-radius: 14px 14px 14px 14px;"> <el-table-column type="selection" width="55" align="center" /> - <el-table-column label="搴忓彿" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="120"/> + <el-table-column fixed label="搴忓彿" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="80"/> - <el-table-column label="鍙戠敓鏃堕棿" prop="createTime" sortable width="100" align="center"> + <el-table-column label="鍙戠敓鏃堕棿" prop="createTime" sortable width="150" align="center"> <template slot-scope="scope">{{scope.row.createTime? scope.row.createTime: '鈥斺�斺�斺��'}}</template> </el-table-column> <el-table-column label="鍙拌处" prop="type" sortable width="100" /> <el-table-column label="鏀跺叆/鏀嚭" prop="price" sortable width="100" > </el-table-column> + <el-table-column label="閲戦" prop="balance" sortable width="100" /> <el-table-column label="鐢ㄩ��" prop="useFor" sortable width="100" /> <el-table-column label="浣跨敤浜�" prop="usePeople" sortable width="100" /> <el-table-column label="鐜伴噾/鑷姩鎵e垝" prop="kind" sortable width="130" > <template slot-scope="scope">{{scope.row.kind? scope.row.kind: '鈥斺�斺�斺��'}}</template> </el-table-column> - <el-table-column label="浣欓" prop="balance" sortable width="100" /> + <el-table-column label="鏄惁鏄湰瀹跺涵璁板綍" prop="ownData" sortable width="150px" > + <template slot-scope="scope">{{scope.row.ownData === 0 ? '鍚�': '鏄�'}}</template> + </el-table-column> <el-table-column label="鐢靛瓙鏂囦欢" prop="url" align="center" sortable width="110" > <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="100" > <template slot-scope="scope">{{scope.row.remark? scope.row.remark: '鈥斺�斺�斺��'}}</template> </el-table-column> - <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> + <el-table-column label="鎿嶄綔" align="center" width="250" class-name="small-padding fixed-width"> <template slot-scope="scope" v-if="scope.row.roleId !== 1"> + <div class="button-container"> <el-button size="mini" type="text" @@ -168,9 +175,11 @@ <el-button size="mini" type="text" icon="el-icon-d-arrow-right" @click="handleCheck(scope.row)">鏌ョ湅璇︽儏</el-button> </el-dropdown> + </div> </template> </el-table-column> </el-table> + <pagination v-show="total>0" :total="total" @@ -188,11 +197,9 @@ <el-input v-model="formDat.type" 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-form-item label="鍙戠敓鏃堕棿" prop="creatTime"> + <el-date-picker v-model="formDat.createTime" type="date" placeholder="璇烽�夋嫨鏃ユ湡" + :editable="false" :clearable="false" :style="{width: '100%'}" value-format="yyyy-MM-dd" ></el-date-picker> </el-form-item> <el-form-item label="鏀跺叆/鏀嚭" prop="price"> @@ -202,7 +209,7 @@ </el-select> </el-form-item> <el-form-item label="閲戦" prop="balance"> - <el-input v-model="formDat.balance" placeholder="璇疯緭鍏ヤ綑棰�" clearable :style="{width: '100%'}" > + <el-input v-model="formDat.balance" placeholder="璇疯緭鍏ラ噾棰�" clearable :style="{width: '100%'}" > </el-input> </el-form-item> <el-form-item label="鐢ㄩ��" prop="useFor"> @@ -217,6 +224,8 @@ <el-input v-model="formDat.kind" placeholder="璇疯緭鍏ユ敮浠樻柟寮�" clearable :style="{width: '100%'}" > </el-input> </el-form-item> + + <el-form-item label="澶囨敞" prop="remark"> <el-input v-model="formDat.remark" placeholder="璇疯緭鍏ュ娉�" clearable :style="{width: '100%'}" ></el-input> </el-form-item> @@ -266,11 +275,12 @@ class="upload-demo" multiple - :on-remove="handleRemove" + :on-remove="handleRemoveFile" :http-request="requestUpload" :show-file-list="true" > - <el-button type="primary">涓婁紶</el-button> + <el-button type="primary">鐐瑰嚮涓婁紶</el-button> + <div v-if="uploading" class="upload-status">姝e湪涓婁紶...</div> <template #tip> <div class="el-upload__tip"> </div> @@ -301,7 +311,7 @@ //鍦╯ystem/note/index.js涓鍏ユ帴鍙e嚱鏁� --鎺ュソ浜� -import {listEconomy,enload,getEconomyInfo,delEconomy, addEconomy, uploadPic} from "@/api/economy/index"; +import {listEconomy,enload,delEconomy, addEconomy, uploadPic} from "@/api/economy/index"; export default { name: "Role", @@ -345,6 +355,7 @@ ], dsb:true, btn:false, + uploading: false, formDat: { type: undefined, createTime: undefined, @@ -365,7 +376,8 @@ type:undefined, useFor:undefined, usePeople:undefined, - createTime:undefined, + + createTime:undefined }, // 琛ㄥ崟鍙傛暟 @@ -421,7 +433,8 @@ { value: '鏀嚭', label: '鏀嚭', - }], + } + ], typeOptions1: [ { value: '0', @@ -495,6 +508,13 @@ ); }, 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) @@ -515,10 +535,6 @@ cancel() { this.open = false; this.reset(); - }, - getRowId(row) - { - return row.id }, // 鍙栨秷鎸夐挳锛堟暟鎹潈闄愶級 cancelDataScope() { @@ -618,6 +634,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) { @@ -625,10 +652,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}) @@ -645,7 +673,7 @@ /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { const Ids = row.id || this.ids; - this.$modal.confirm('鏄惁纭鍒犻櫎搴忓彿涓�"' + Ids + '"鐨勬暟鎹」锛�').then(function() { + this.$modal.confirm('鏄惁纭鍒犻櫎鎵�閫夋暟鎹」锛�').then(function() { return delEconomy(Ids); }).then(() => { this.getList(); @@ -654,24 +682,10 @@ }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { - const Ids = this.ids; - - if(Ids.length==0) - { this.download('/zfEconomy/export', { ...this.queryParams }, `zfEconomy_${new Date().getTime()}.xlsx`) - }else - { - this.download('/zfEconomy/export1/'+Ids, { - }, `zfEconomy_${new Date().getTime()}.xlsx`) - } } - , - handleExportTemplate(){ - this.download('/zfEconomy/model', { - - }, `zfEconomy_${new Date().getTime()}.xlsx`) }, /** 瀵煎叆鎿嶄綔*/ handleEnport(params){ @@ -690,7 +704,6 @@ } } - } }; </script> @@ -704,4 +717,10 @@ background: #FFEFF2; } +.el-table__cell { + font-size: 14px; /* 璁剧疆瀛椾綋澶у皬 */ +} +.button-container { + display: inline-flex; /* 璁剧疆鎸夐挳瀹瑰櫒涓鸿鍐呭厓绱� */ +} </style> -- Gitblit v1.9.1