|
@@ -3,7 +3,7 @@
|
|
<toolbar @onSearch="filterData" />
|
|
<toolbar @onSearch="filterData" />
|
|
|
|
|
|
<div class="m-10 bg-w p-20 br-10">
|
|
<div class="m-10 bg-w p-20 br-10">
|
|
- <el-button type="primary" icon="el-icon-plus" @click="handleSubmit"
|
|
|
|
|
|
+ <el-button type="primary" icon="el-icon-plus" @click="handleAdd"
|
|
>新增</el-button
|
|
>新增</el-button
|
|
>
|
|
>
|
|
<base-table
|
|
<base-table
|
|
@@ -19,6 +19,7 @@
|
|
<script>
|
|
<script>
|
|
import toolbar from './toolbar';
|
|
import toolbar from './toolbar';
|
|
import mxFilterList from '@/mixins/filterList';
|
|
import mxFilterList from '@/mixins/filterList';
|
|
|
|
+import { getList } from '@/api/base/banner';
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'BannerManagement',
|
|
name: 'BannerManagement',
|
|
@@ -27,7 +28,7 @@ export default {
|
|
|
|
|
|
mixins: [
|
|
mixins: [
|
|
mxFilterList({
|
|
mxFilterList({
|
|
- // fetchList: iGetList // 在下方data再声明一个 fetchList: iGetList 同等效果
|
|
|
|
|
|
+ fetchList: getList // 在下方data再声明一个 fetchList: iGetList 同等效果
|
|
})
|
|
})
|
|
],
|
|
],
|
|
|
|
|
|
@@ -40,43 +41,118 @@ export default {
|
|
width: '60'
|
|
width: '60'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- key: 'photo',
|
|
|
|
|
|
+ key: 'imgUrl',
|
|
name: '图片',
|
|
name: '图片',
|
|
- width: '240'
|
|
|
|
|
|
+ width: '240',
|
|
|
|
+ render: (h, { row }) =>
|
|
|
|
+ h('image', {
|
|
|
|
+ style: {
|
|
|
|
+ width: '160px',
|
|
|
|
+ height: '90px'
|
|
|
|
+ },
|
|
|
|
+ attrs: {
|
|
|
|
+ src: row.imgUrl
|
|
|
|
+ },
|
|
|
|
+ on: {
|
|
|
|
+ click: () =>
|
|
|
|
+ this.$AdvanceViewImageModal({
|
|
|
|
+ items: [{ src: row.imgUrl }]
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- key: 'region',
|
|
|
|
|
|
+ key: 'type',
|
|
name: '位置',
|
|
name: '位置',
|
|
minWidth: '120'
|
|
minWidth: '120'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- key: 'region',
|
|
|
|
|
|
+ key: 'name',
|
|
name: '标题',
|
|
name: '标题',
|
|
minWidth: '180'
|
|
minWidth: '180'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- key: 'region',
|
|
|
|
|
|
+ key: 'link',
|
|
name: '链接',
|
|
name: '链接',
|
|
minWidth: '240',
|
|
minWidth: '240',
|
|
showOverflowTooltip: true
|
|
showOverflowTooltip: true
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- key: 'region',
|
|
|
|
|
|
+ key: 'sort',
|
|
name: '排序',
|
|
name: '排序',
|
|
width: '60'
|
|
width: '60'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- key: 'region',
|
|
|
|
|
|
+ key: 'isShow',
|
|
name: '状态',
|
|
name: '状态',
|
|
- width: '80'
|
|
|
|
|
|
+ width: '80',
|
|
|
|
+ type: 'tag',
|
|
|
|
+ fetchTagType: val => (val ? 'success' : 'info'),
|
|
|
|
+ tagName: row => (row.isShow ? '显示' : '隐藏')
|
|
},
|
|
},
|
|
{
|
|
{
|
|
key: 'action',
|
|
key: 'action',
|
|
name: '操作',
|
|
name: '操作',
|
|
- width: '120'
|
|
|
|
|
|
+ width: '120',
|
|
|
|
+ render: (h, { row }) => {
|
|
|
|
+ const action = [];
|
|
|
|
+ action.push(
|
|
|
|
+ h(
|
|
|
|
+ 'el-button',
|
|
|
|
+ {
|
|
|
|
+ props: {
|
|
|
|
+ type: 'text'
|
|
|
|
+ },
|
|
|
|
+ on: {
|
|
|
|
+ click: () =>
|
|
|
|
+ this.$BannerItemModal({
|
|
|
|
+ id: row.id,
|
|
|
|
+ parentId: row.parentId
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ '编辑'
|
|
|
|
+ )
|
|
|
|
+ );
|
|
|
|
+ action.push(
|
|
|
|
+ h(
|
|
|
|
+ 'BaseBtn',
|
|
|
|
+ {
|
|
|
|
+ props: {
|
|
|
|
+ popip: true,
|
|
|
|
+ txt: '删除',
|
|
|
|
+ type: 'text'
|
|
|
|
+ },
|
|
|
|
+ class: 'ml-10',
|
|
|
|
+ on: {
|
|
|
|
+ ok: () => this.handleDelItem(row)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ '删除'
|
|
|
|
+ )
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ return h('div', action);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
]
|
|
]
|
|
};
|
|
};
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ methods: {
|
|
|
|
+ handleAdd() {
|
|
|
|
+ this.$BannerItemModal();
|
|
|
|
+ },
|
|
|
|
+ async handleDelItem(item) {
|
|
|
|
+ const { success, msg } = await delItem({
|
|
|
|
+ id: item.id
|
|
|
|
+ });
|
|
|
|
+ if (success) {
|
|
|
|
+ this.$success('删除成功!');
|
|
|
|
+ } else {
|
|
|
|
+ this.$error(msg);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|