|
@@ -20,6 +20,7 @@
|
|
|
import toolbar from './toolbar';
|
|
|
import mxFilterList from '@/mixins/filterList';
|
|
|
import { getList, delItem } from '@/api/base/banner';
|
|
|
+import { getList as getDict } from '@/api/dict';
|
|
|
|
|
|
export default {
|
|
|
name: 'BannerManagement',
|
|
@@ -38,7 +39,7 @@ export default {
|
|
|
{
|
|
|
key: 'imgUrl',
|
|
|
name: '图片',
|
|
|
- width: '160',
|
|
|
+ width: this.$col.b,
|
|
|
render: (h, { row }) =>
|
|
|
h('img', {
|
|
|
style: {
|
|
@@ -59,28 +60,35 @@ export default {
|
|
|
{
|
|
|
key: 'type',
|
|
|
name: '位置',
|
|
|
- width: '80'
|
|
|
+ minWidth: this.$col.s,
|
|
|
+ render: (h, { row }) => {
|
|
|
+ const item = this.options.find(x => x.value === row.type);
|
|
|
+ if (item) {
|
|
|
+ return h('span', item.label);
|
|
|
+ }
|
|
|
+ return h('span', '-');
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
key: 'name',
|
|
|
name: '标题',
|
|
|
- minWidth: '100'
|
|
|
+ minWidth: this.$col.s
|
|
|
},
|
|
|
{
|
|
|
key: 'link',
|
|
|
name: '链接',
|
|
|
- minWidth: '180',
|
|
|
+ minWidth: this.$col.m,
|
|
|
showOverflowTooltip: true
|
|
|
},
|
|
|
{
|
|
|
key: 'sort',
|
|
|
name: '排序',
|
|
|
- width: '80'
|
|
|
+ width: this.$col.s
|
|
|
},
|
|
|
{
|
|
|
key: 'isShow',
|
|
|
name: '状态',
|
|
|
- width: '80',
|
|
|
+ width: this.$col.s,
|
|
|
type: 'tag',
|
|
|
fetchTagType: val => (val ? 'success' : 'info'),
|
|
|
tagName: row => (row.isShow ? '显示' : '隐藏')
|
|
@@ -129,12 +137,14 @@ export default {
|
|
|
return h('div', action);
|
|
|
}
|
|
|
}
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ options: []
|
|
|
};
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
this.$g_on('banner_reload', this.reload);
|
|
|
+ this.loadDict();
|
|
|
},
|
|
|
|
|
|
beforeDestroy() {
|
|
@@ -142,6 +152,15 @@ export default {
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ async loadDict() {
|
|
|
+ const { data } = await getDict({
|
|
|
+ dictCode: this.$dict.BANNER_TYPE
|
|
|
+ });
|
|
|
+ this.options = data.map(x => ({
|
|
|
+ value: x.value,
|
|
|
+ label: x.name
|
|
|
+ }));
|
|
|
+ },
|
|
|
handleAdd() {
|
|
|
this.$BannerItemModal();
|
|
|
},
|