| | |
| | | <template> |
| | | <div class="mod-sysPictureBase-sysPictureBase fa-card-a"> |
| | | <zt-table-wraper query-url="/sysPictureBase/page" delete-url="/sysPictureBase/" |
| | | <zt-table-wraper ref="tableObj" query-url="/sysPictureBase/page" delete-url="/sysPictureBase/" |
| | | :paging='false' |
| | | v-slot="{ table }"> |
| | | <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()"> |
| | |
| | | |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <zt-dict v-model="dataForm.productType" dict="product" placeholder="请选择产品类型" clearable></zt-dict> |
| | | <zt-dict v-model="dataForm.productType" dict="product" :additional=additional placeholder="请选择产品类型" clearable></zt-dict> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <zt-button type="query" @click="table.query()"/> |
| | | <zt-button type="add" @click="table.editHandle()"/> |
| | | <zt-button type="delete" @click="table.deleteHandle()"/> |
| | | <!-- <zt-button type="delete" @click="deleteSVG"/>--> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" v-adaptive="{bottomOffset:30}" |
| | |
| | | <el-table-column type="selection" width="40" align="center"/> |
| | | <el-table-column prop="name" label="图片名称"/> |
| | | <zt-table-column-dict prop="isDefault" label="是否默认" dict="is_or_not"/> |
| | | <el-table-column label="图片" align="center"> |
| | | <el-table-column label="图片" align="center" prop="svgContent"> |
| | | <template v-slot="{ row }"> |
| | | <el-image v-if="row.id" :src="url+row.id" style="height: 50px;width: 50px"></el-image> |
| | | <div v-if="row.id" class="custom-svg-container" v-html = row.svgContent></div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="contentType" label="检索关键字"/> |
| | | <zt-table-column-dict prop="productType" label="产品类型" dict="product"/> |
| | | <zt-table-column-handle :table="table" |
| | | delete-perm="sysPictureBase::delete"/> |
| | | <zt-table-column-dict prop="productType" label="产品类型" dict="product" :additional=additional /> |
| | | <zt-table-column-handle :table="table" edit-perm="sysPictureBase::delete" |
| | | delete-perm="sysPictureBase::delete"> |
| | | <template slot-scope="scope"> |
| | | <zt-table-button size="small" type="primary" @click="edit(scope.row)">修改 |
| | | </zt-table-button> |
| | | </template> |
| | | </zt-table-column-handle> |
| | | </el-table> |
| | | <!-- 弹窗, 新增 / 修改 --> |
| | | <add-or-update @refreshDataList="table.query"/> |
| | | <add-or-update ref="addOrUpdate" @refreshDataList="table.query"/> |
| | | </zt-table-wraper> |
| | | </div> |
| | | </template> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | additional: [{dictValue: '20', dictLabel: '运算图元', remark: ''}], |
| | | url: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getProductImg?token=${Cookies.get('token')}&id=`, |
| | | dataForm: { |
| | | contentType: '', |
| | |
| | | }, |
| | | mounted() { |
| | | }, |
| | | methods: {} |
| | | methods: { |
| | | async deleteSVG() { |
| | | let dataSelectedList = this.$refs.tableObj.dataSelectedList |
| | | console.log(dataSelectedList, 'dataSelectedList') |
| | | if(dataSelectedList.length === 0){ |
| | | this.$message({message: '请先勾选数据', type: 'warning'}) |
| | | return false |
| | | } |
| | | let res = await this.$http.delete('/sysPictureBase/', dataSelectedList) |
| | | if (res.success) { |
| | | await this.$tip.success() |
| | | this.$refs.tableObj.query() |
| | | } |
| | | }, |
| | | edit(row){ |
| | | this.$refs.addOrUpdate.$refs.dialog.init(row.id,row) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style> |
| | | .custom-svg-container svg { |
| | | width: 60px; /* 设置SVG图片的宽度为60 */ |
| | | height: 60px; /* 设置SVG图片的高度为60 */ |
| | | } |
| | | </style> |