| | |
| | | height: calc(100% - 62px); |
| | | } |
| | | |
| | | img { |
| | | div.img { |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | margin: auto; |
| | | width: calc(100% - 8px); |
| | | height: calc(100% - 8px); |
| | | max-width: calc(100% - 8px); |
| | | max-height: calc(100% - 8px); |
| | | overflow: hidden; |
| | | } |
| | | } |
| | | |
| | |
| | | @click="handleDownload(scope.row)">下载222 |
| | | </el-button> |
| | | <el-button type="text" |
| | | icon="el-icon-download" |
| | | icon="el-icon-picture-outline-round" |
| | | size="small" |
| | | v-show="!fileFormat(scope.row)" |
| | | @click="seeImages(scope.row)">图片预览 |
| | | @click="seeImages(scope.row)">预览 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{ row }" |
| | |
| | | </avue-form> |
| | | </el-dialog> |
| | | |
| | | <el-dialog title="图片预览" |
| | | <el-dialog title="预览" |
| | | append-to-body |
| | | :visible.sync="imgSee" |
| | | class="see-img-box"> |
| | | <img :src="imgUrl" |
| | | alt=""> |
| | | |
| | | <div class="img" |
| | | :style="{background: imgUrl}"> |
| | | |
| | | </div> |
| | | |
| | | </el-dialog> |
| | | |
| | | </basic-container> |
| | |
| | | |
| | | seeImages (row) { |
| | | this.imgUrl = ""; |
| | | this.imgUrl = row.link; |
| | | this.imgUrl = "url(" + row.link + ") center center / contain no-repeat"; |
| | | |
| | | this.imgSee = true; |
| | | }, |
| | |
| | | <template> |
| | | <basic-container class="hasButTwo"> |
| | | <avue-crud |
| | | :option="option" |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | > |
| | | @on-load="onLoad"> |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | | type="primary" |
| | | <el-button type="primary" |
| | | size="small" |
| | | plain |
| | | v-if="permission.attach_upload" |
| | | icon="el-icon-upload2" |
| | | @click="handleUpload" |
| | | >上 传 |
| | | @click="handleUpload">上 传 |
| | | </el-button> |
| | | <el-button |
| | | type="danger" |
| | | <el-button type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.attach_delete" |
| | | @click="handleDelete" |
| | | >删 除 |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button |
| | | type="text" |
| | | <template slot-scope="scope" |
| | | slot="menu"> |
| | | <el-button type="text" |
| | | icon="el-icon-download" |
| | | size="small" |
| | | v-if="permission.attach_download" |
| | | @click="handleDownload(scope.row)" |
| | | >下载 |
| | | @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"> |
| | | <template slot-scope="{ row }" |
| | | slot="attachSize"> |
| | | <el-tag>{{ `${row.attachSize} KB` }}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog |
| | | title="附件管理" |
| | | <el-dialog title="附件管理" |
| | | append-to-body |
| | | :visible.sync="attachBox" |
| | | width="555px" |
| | | > |
| | | <avue-form |
| | | ref="form" |
| | | width="555px"> |
| | | <avue-form ref="form" |
| | | :option="attachOption" |
| | | v-model="attachForm" |
| | | :upload-after="uploadAfter" |
| | | > |
| | | :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> |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | 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> |
| | |
| | | <template> |
| | | <basic-container class="hasButTwo"> |
| | | <avue-crud |
| | | :option="option" |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | > |
| | | @on-load="onLoad"> |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | | type="primary" |
| | | <el-button type="primary" |
| | | size="small" |
| | | plain |
| | | v-if="permission.attach_upload" |
| | | icon="el-icon-upload2" |
| | | @click="handleUpload" |
| | | >上 传 |
| | | @click="handleUpload">上 传 |
| | | </el-button> |
| | | <el-button |
| | | type="danger" |
| | | <el-button type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.attach_delete" |
| | | @click="handleDelete" |
| | | >删 除 |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button |
| | | type="text" |
| | | <template slot-scope="scope" |
| | | slot="menu"> |
| | | <el-button type="text" |
| | | icon="el-icon-download" |
| | | size="small" |
| | | v-if="permission.attach_download" |
| | | @click="handleDownload(scope.row)" |
| | | >下载 |
| | | @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"> |
| | | <template slot-scope="{ row }" |
| | | slot="attachSize"> |
| | | <el-tag>{{ `${row.attachSize} KB` }}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog |
| | | title="附件管理" |
| | | <el-dialog title="附件管理" |
| | | append-to-body |
| | | :visible.sync="attachBox" |
| | | width="555px" |
| | | > |
| | | <avue-form |
| | | ref="form" |
| | | width="555px"> |
| | | <avue-form ref="form" |
| | | :option="attachOption" |
| | | v-model="attachForm" |
| | | :upload-after="uploadAfter" |
| | | > |
| | | :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: "link", |
| | | dataType: "string", |
| | | type: "img", |
| | | }, |
| | | { |
| | | label: "附件拓展名", |
| | | prop: "extension", |
| | | rules: [ |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | 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> |