Commit 118743da54ee444f54e3bad954bc9adeacca0207

Authored by 273548560@qq.com
1 parent a74d0ae7

修复bug

trash-ui/src/views/casefile/violationWarningInformation/violationWarningInformationInfo.vue
@@ -138,12 +138,16 @@ @@ -138,12 +138,16 @@
138 <el-dialog title="预览" :visible.sync="openImg" append-to-body v-if="entryType==0"> 138 <el-dialog title="预览" :visible.sync="openImg" append-to-body v-if="entryType==0">
139 <img :src="img" width="100%" height="750px" /> 139 <img :src="img" width="100%" height="750px" />
140 </el-dialog> 140 </el-dialog>
  141 + <el-dialog title="" :visible.sync="showPic" append-to-body width="400px">
  142 + <img :src="picImage" width="100%" height="400px"/>
  143 + </el-dialog>
141 </el-form> 144 </el-form>
142 </template> 145 </template>
143 146
144 <script> 147 <script>
145 import {getViolationWarningInformation} from "@/api/casefile/violationWarningInformation"; 148 import {getViolationWarningInformation} from "@/api/casefile/violationWarningInformation";
146 import {listReplyApprovalProcess} from "@/api/casefile/replyApprovalProcess"; 149 import {listReplyApprovalProcess} from "@/api/casefile/replyApprovalProcess";
  150 +import {getBase64} from "@/api/business/threestep";
147 export default { 151 export default {
148 name: "violationWarningInformationInfo", 152 name: "violationWarningInformationInfo",
149 props: { 153 props: {
@@ -165,6 +169,8 @@ export default { @@ -165,6 +169,8 @@ export default {
165 replyApprovalProcessList:[], 169 replyApprovalProcessList:[],
166 openImg:false, 170 openImg:false,
167 img:null, 171 img:null,
  172 + showPic: null,
  173 + picImage: null,
168 } 174 }
169 }, 175 },
170 created() { 176 created() {
@@ -193,6 +199,17 @@ export default { @@ -193,6 +199,17 @@ export default {
193 let name = row.name; 199 let name = row.name;
194 let url = row.url; 200 let url = row.url;
195 const a = document.createElement('a') 201 const a = document.createElement('a')
  202 + if (url.indexOf(".jpg") > -1 || url.indexOf(".png") > -1 || url.indexOf(".jpeg") > -1 || url.indexOf(".jpg") > -1) {
  203 + const fileType = url.substring(url.lastIndexOf('.') + 1).toLowerCase();
  204 + getBase64({"path": url}).then(res => {
  205 + if (res) {
  206 + this.picImage = "data:image/" + fileType + ";base64," + res;
  207 + this.showPic = true;
  208 + }
  209 + });
  210 +
  211 + return;
  212 + }
196 a.setAttribute('download', name) 213 a.setAttribute('download', name)
197 a.setAttribute('target', '_blank') 214 a.setAttribute('target', '_blank')
198 a.setAttribute('href', process.env.VUE_APP_BASE_API + url); 215 a.setAttribute('href', process.env.VUE_APP_BASE_API + url);