| | |
| | | v-if="row.imgurlFull" |
| | | style="width: 80px; height: 40px" |
| | | :src="row.imgurlFull" |
| | | :preview-src-list="[row.imgurlFull]" |
| | | fit="contain" |
| | | ></el-image> |
| | | <span v-else>-</span> |
| | |
| | | <el-table-column prop="updateTime" label="修改时间" min-width="160px"></el-table-column> |
| | | <el-table-column label="操作" min-width="150" fixed="right"> |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="handleEdit(row)">编辑</el-button> |
| | | <el-button type="text" @click="deleteById(row.id)">删除</el-button> |
| | | <el-button type="text" @click="$refs.operaBannerEditWindow.open('编辑轮播图', row,searchForm.type)" >编辑</el-button> |
| | | <el-button type="text" style="color: red;" @click="deleteById(row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | :pagination="tableData.pagination" |
| | | ></pagination> |
| | | </template> |
| | | <OperaBannerEditWindow ref="operaBannerEditWindow" @success="search" /> |
| | | <OperaBannerEditWindow ref="operaBannerEditWindow" @success="handlePageChange" /> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaBannerEditWindow from '@/components/business/OperaBannerEditWindow' |
| | | import { updateById, deleteById } from '@/api/business/banner' |
| | | |
| | | export default { |
| | | name: 'BannerList', |
| | | extends: BaseTable, |
| | |
| | | data () { |
| | | return { |
| | | positionOptions: { |
| | | 0: '首页', |
| | | 1: '店铺首页' |
| | | 0: '会员端首页轮播', |
| | | 1: '司机APP引导页' |
| | | }, |
| | | jumpTypeOptions: { |
| | | 0: '无', |
| | | 1: '会员端首页轮播', |
| | | 2: '司机APP引导页' |
| | | 1: '富文本', |
| | | 2: '外链' |
| | | }, |
| | | searchForm: { |
| | | title: '' |
| | |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | loadTableData (resolve) { |
| | | this.isWorking.search = true |
| | | list(this.getTableParams()) |
| | | .then(data => { |
| | | this.tableData.list = data.list || [] |
| | | this.tableData.pagination.total = data.total || 0 |
| | | if (resolve) resolve(data) |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e, '加载失败') |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking.search = false |
| | | }) |
| | | }, |
| | | handleEdit (row) { |
| | | this.$refs.operaBannerEditWindow.open('编辑轮播图', row) |
| | | }, |
| | | handleStatusChange (val, row) { |
| | | updateStatus({ id: row.id, status: val }).then(res => { |
| | | this.api.updateStatus({ id: row.id, status: val }).then(res => { |
| | | this.$tip.apiSuccess(res || '修改成功') |
| | | }).catch(e => { |
| | | row.status = val === 1 ? 0 : 1 |