| | |
| | | title: '图片', |
| | | dataIndex: 'bannerUrl', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'bannerUrl' }, |
| | | scopedSlots: { customRender: 'bannerUrl' } |
| | | }, |
| | | { |
| | | title: '排序', |
| | | dataIndex: 'isOrder', |
| | | align: 'center', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'PC是否显示', |
| | | dataIndex: 'isPc', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'isPc' }, |
| | | scopedSlots: { customRender: 'isPc' } |
| | | }, |
| | | { |
| | | title: '移动端是否显示', |
| | | dataIndex: 'isM', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'isM' }, |
| | | scopedSlots: { customRender: 'isM' } |
| | | }, |
| | | { |
| | | title: '添加时间', |
| | |
| | | width: 180, |
| | | customRender: (text, row, index) => { |
| | | return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '' |
| | | }, |
| | | } |
| | | }, |
| | | { |
| | | title: '操作', |
| | |
| | | align: 'center', |
| | | fixed: 'right', |
| | | width: 200, |
| | | scopedSlots: { customRender: 'action' }, |
| | | }, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | // 表头 |
| | | pagination: { |
| | |
| | | pageSizeOptions: ['10', '20', '50', '100'], // 每页中显示的数据 |
| | | onShowSizeChange: (current, pageSize) => this.onSizeChange(current, pageSize), // 改变每页数量时更新显示 |
| | | onChange: (page, pageSize) => this.onPageChange(page, pageSize), // 点击页码事件 |
| | | showTotal: (total) => `共有 ${total} 条数据`, // 分页中显示总的数据 |
| | | showTotal: (total) => `共有 ${total} 条数据` // 分页中显示总的数据 |
| | | }, |
| | | loading: false, |
| | | queryParam: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | pageSize: 10 |
| | | }, |
| | | datalist: [], |
| | | |
| | |
| | | addUserform: this.$form.createForm(this), |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | sm: { span: 5 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 18 }, |
| | | sm: { span: 18 } |
| | | }, |
| | | fields: ['bannerUrl', 'isOrder', 'isPc', 'isM', 'banDesc', 'banTitle', 'targetUrl'], |
| | | currentDetails: '', |
| | | bannerUrl: '', |
| | | imgloading: false, |
| | | imgloading: false |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | content: '确认删除轮播图?此操作不可恢复', |
| | | onOk() { |
| | | var data = { |
| | | id: val, |
| | | id: val |
| | | } |
| | | bannersdelete(data).then((res) => { |
| | | if (res.status == 0) { |
| | |
| | | }, |
| | | onCancel() { |
| | | console.log('Cancel') |
| | | }, |
| | | } |
| | | }) |
| | | }, |
| | | customRequest(data) { |
| | |
| | | if (res.status == 0) { |
| | | this.bannerUrl = res.data.url |
| | | this.addUserform.setFieldsValue({ |
| | | bannerUrl: res.data.url, |
| | | bannerUrl: res.data.url |
| | | }) |
| | | } else { |
| | | this.$message.error({ content: '上传失败请检查图片类型!' }) |
| | |
| | | this.queryParam.pageNum = current |
| | | this.queryParam.pageSize = pageSize |
| | | this.getlist() |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped lang="less"> |