Commit 118743da54ee444f54e3bad954bc9adeacca0207

Authored by 273548560@qq.com
1 parent a74d0ae7

修复bug

trash-ui/src/views/casefile/violationWarningInformation/violationWarningInformationInfo.vue
... ... @@ -138,12 +138,16 @@
138 138 <el-dialog title="预览" :visible.sync="openImg" append-to-body v-if="entryType==0">
139 139 <img :src="img" width="100%" height="750px" />
140 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 144 </el-form>
142 145 </template>
143 146  
144 147 <script>
145 148 import {getViolationWarningInformation} from "@/api/casefile/violationWarningInformation";
146 149 import {listReplyApprovalProcess} from "@/api/casefile/replyApprovalProcess";
  150 +import {getBase64} from "@/api/business/threestep";
147 151 export default {
148 152 name: "violationWarningInformationInfo",
149 153 props: {
... ... @@ -165,6 +169,8 @@ export default {
165 169 replyApprovalProcessList:[],
166 170 openImg:false,
167 171 img:null,
  172 + showPic: null,
  173 + picImage: null,
168 174 }
169 175 },
170 176 created() {
... ... @@ -193,6 +199,17 @@ export default {
193 199 let name = row.name;
194 200 let url = row.url;
195 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 213 a.setAttribute('download', name)
197 214 a.setAttribute('target', '_blank')
198 215 a.setAttribute('href', process.env.VUE_APP_BASE_API + url);
... ...