| | |
| | | @click="handleDownload(scope.row)" |
| | | >下载 |
| | | </el-button> |
| | | <el-button |
| | | type="text" |
| | | icon="el-icon-picture-outline-round" |
| | | size="small" |
| | | v-show="!fileFormat(scope.row)" |
| | | @click="seeImages(scope.row)" |
| | | >预览 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{ row }" slot="attachSize"> |
| | | <el-tag>{{ `${row.attachSize} KB` }}</el-tag> |
| | |
| | | :upload-after="uploadAfter" |
| | | > |
| | | </avue-form> |
| | | </el-dialog> |
| | | |
| | | <el-dialog |
| | | title="预览" |
| | | append-to-body |
| | | :visible.sync="imgSee" |
| | | class="see-img-box" |
| | | > |
| | | <div class="img" :style="{ background: imgUrl }"></div> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | |
| | | ], |
| | | }, |
| | | { |
| | | label: "所属公司", |
| | | prop: "enterprisename", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入所属公司", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件预览", |
| | | prop: "link", |
| | | type: "img", |
| | |
| | | // trigger: "blur", |
| | | // }, |
| | | // ], |
| | | }, |
| | | { |
| | | label: "所属公司", |
| | | prop: "enterprisename", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入所属公司", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件大小", |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | imgSee: false, |
| | | imgUrl: "", |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | |
| | | seeImages(row) { |
| | | this.imgUrl = ""; |
| | | this.imgUrl = "url(" + row.link + ") center center / contain no-repeat"; |
| | | |
| | | this.imgSee = true; |
| | | }, |
| | | |
| | | fileFormat(row) { |
| | | var index = row.link.lastIndexOf("."); |
| | | var ext = row.link.substr(index + 1); |
| | | |
| | | return ( |
| | | [ |
| | | "png", |
| | | "jpg", |
| | | "jpeg", |
| | | "bmp", |
| | | "gif", |
| | | "webp", |
| | | "psd", |
| | | "svg", |
| | | "tiff", |
| | | ].indexOf(ext.toLowerCase()) == -1 |
| | | ); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |