显示隐藏

master
fanfan 5 months ago
parent 8e9a096515
commit 6a4a2c0837
  1. 10
      src/views/dataCenter/course/index.vue
  2. 6
      src/views/dataCenter/course/modules/AddForm.vue
  3. 8
      src/views/dataCenter/course/modules/EditForm.vue

@ -5,6 +5,9 @@
<a-button type="primary" icon="plus" @click="handleAdd">新增</a-button>
</div>
<s-table ref="table" rowKey="course_id" :columns="columns" :data="loadData" :pagination="pagination">
<span slot="status" slot-scope="text">
<a-tag :color="text ? 'green' : ''">{{ text ? '显示' : '隐藏' }}</a-tag>
</span>
<span slot="action" slot-scope="text, item">
<a style="margin-right: 8px" @click="handleEdit(item)">编辑</a>
<a @click="handleDelete(item)">删除</a>
@ -56,10 +59,15 @@ export default {
{
title: '教学详情',
dataIndex: 'course_detail',
},
{
title: '状态',
dataIndex: 'status',
scopedSlots: { customRender: 'status' }
},
{
title: '排序',
dataIndex: 'sort',
dataIndex: 'sort',
},
{
title: '添加时间',

@ -36,6 +36,12 @@
v-decorator="['course_detail', { rules: [{ required: true, message: '请输入教学详情' }] }]"
/>
</a-form-item>
<a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" extra="用户端是否展示">
<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-item label="教学图片" :labelCol="labelCol" :wrapperCol="wrapperCol">
<SelectImage v-decorator="['image_id', { rules: [{ required: true, message: '请上传1张图片 ' }] }]" />
</a-form-item>

@ -43,6 +43,12 @@
v-decorator="['course_detail', { rules: [{ required: true, message: '请输入教学详情' }] }]"
/>
</a-form-item>
<a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" extra="用户端是否展示">
<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-item label="教学图片" :labelCol="labelCol" :wrapperCol="wrapperCol">
<SelectImage
:defaultList="record.image_url ? [record.image_url] : []"
@ -118,7 +124,7 @@ export default {
} = this
//
this.$nextTick(() => {
setFieldsValue(_.pick(record, ['course_name', 'course_subheading', 'course_detail','image_id', 'video_id','course_category_id']))
setFieldsValue(_.pick(record, ['status','course_name', 'course_subheading', 'course_detail','image_id', 'video_id','course_category_id']))
})
},

Loading…
Cancel
Save