显示隐藏

main
fanfan 4 months ago
parent a87fc697d4
commit 6c50ea5f12
  1. 36
      src/views/store/channel.vue
  2. 15
      src/views/store/modules/channelEdit.vue

@ -2,6 +2,9 @@
<a-card :bordered="false">
<div class="card-title">{{ $route.meta.title }}</div>
<s-table ref="table" size="default" rowKey="store_id" :columns="columns" :data="loadData" :pagination="pagination">
<span slot="status" slot-scope="text">
<a-tag :color="text ? 'green' : ''">{{ text ? '显示' : '隐藏' }}</a-tag>
</span>
<span slot="logoImage" slot-scope="text, item">
<a v-if="item.logoImage" title="点击查看原图" :href="item.logoImage.external_url" target="_blank">
<img width="50" height="50" :src="item.logoImage.external_url" alt="商户logo" />
@ -25,7 +28,7 @@ import EditForm from './modules/channelEdit.vue'
export default {
components: {
STable,
EditForm
EditForm,
},
data() {
return {
@ -35,46 +38,49 @@ export default {
{
title: '商户logo',
dataIndex: 'logoImage',
scopedSlots: { customRender: 'logoImage' }
scopedSlots: { customRender: 'logoImage' },
},
{
title: '商户名称',
dataIndex: 'shop_name'
dataIndex: 'shop_name',
},
{
title: '商户标签',
dataIndex: 'shop_label'
dataIndex: 'shop_label',
},
{
title: '渠道名称',
dataIndex: 'name'
dataIndex: 'name',
},
{
title: '渠道别名',
dataIndex: 'alias'
dataIndex: 'alias',
},
{
title: '状态',
dataIndex: 'status',
scopedSlots: { customRender: 'status' },
},
{
title: '添加时间',
dataIndex: 'create_time'
dataIndex: 'create_time',
},
{
title: '操作',
dataIndex: 'action',
width: '180px',
scopedSlots: { customRender: 'action' }
}
scopedSlots: { customRender: 'action' },
},
],
// Promise
loadData: param => {
return Api.channelList(param)
.then(response => {
loadData: (param) => {
return Api.channelList(param).then((response) => {
return response.data.list
})
},
}
},
created() {
},
created() {},
methods: {
/**
* 刷新列表
@ -88,6 +94,6 @@ export default {
//
this.$refs.EditForm.add(record)
},
}
},
}
</script>

@ -38,6 +38,12 @@
v-decorator="['license_img_id', { rules: [{ required: true, message: '请上传营业执照' }] }]"
/>
</a-form-item>
<a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group v-decorator="['status', { initialValue: 1, rules: [{ required: true }] }]">
<a-radio :value="1">显示</a-radio>
<a-radio :value="0">隐藏</a-radio>
</a-radio-group>
</a-form-item>
</a-form>
</a-spin>
</a-modal>
@ -96,14 +102,7 @@ export default {
this.$nextTick(() => {
setFieldsValue(
// eslint-disable-next-line no-undef
_.pick(this.info, [
'logo',
'shop_name',
'shop_label',
'logo_image_id',
'name',
'alias',
])
_.pick(this.info, ['logo', 'shop_name', 'shop_label', 'logo_image_id', 'name', 'alias', 'status'])
)
})
},

Loading…
Cancel
Save