|
|
|
@ -16,6 +16,12 @@ |
|
|
|
|
v-decorator="['name', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]" |
|
|
|
|
/> |
|
|
|
|
</a-form-item> |
|
|
|
|
<a-form-item label="分类图片" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<SelectImage |
|
|
|
|
:defaultList="record.catImg ? [record.catImg] : []" |
|
|
|
|
v-decorator="['img_id', { 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> |
|
|
|
@ -36,8 +42,12 @@ |
|
|
|
|
<script> |
|
|
|
|
import pick from 'lodash.pick' |
|
|
|
|
import * as Api from '@/api/content/article/category' |
|
|
|
|
import { SelectImage } from '@/components' |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
SelectImage |
|
|
|
|
}, |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
// 对话框标题 |
|
|
|
@ -76,7 +86,7 @@ export default { |
|
|
|
|
setFieldsValue () { |
|
|
|
|
const { $nextTick, form: { setFieldsValue } } = this |
|
|
|
|
$nextTick(() => { |
|
|
|
|
setFieldsValue(pick(this.record, ['name', 'status', 'sort'])) |
|
|
|
|
setFieldsValue(pick(this.record, ['name', 'status', 'sort', 'img_id'])) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|