Commit 7316534b authored by 前端-李俊鑫's avatar 前端-李俊鑫

fix: 内容管理字符及必填想问题

parent 1436f214
......@@ -13,7 +13,7 @@
{
path: '/memberCenter/contentAbility/category',
name: '分类管理',
component: '@/pages/memberCenter/contentAbility/category'
component: '@/pages/content/category'
},
// 栏目管理
......@@ -41,19 +41,19 @@
{
path: '/memberCenter/contentAbility/tagsManagement',
name: 'tagsManagement',
component: '@/pages/memberCenter/contentAbility/tagsManagement'
component: '@/pages/content/tagsManagement'
},
{
path: '/memberCenter/contentAbility/tagsManagement/add',
name: 'tagsAdd',
component: '@/pages/memberCenter/contentAbility/tagsManagement/tagsInfo',
component: '@/pages/content/tagsManagement/tagsInfo',
hideInMenu: true,
hidePageHeader: true,
},
{
path: '/memberCenter/contentAbility/tagsManagement/detail',
name: 'tagsInfo',
component: '@/pages/memberCenter/contentAbility/tagsManagement/tagsInfo',
component: '@/pages/content/tagsManagement/tagsInfo',
hideInMenu: true,
hidePageHeader: true,
},
......@@ -78,24 +78,24 @@
hideInMenu: true,
hidePageHeader: true,
},
// 公告管理
{
path: '/memberCenter/contentAbility/announcements',
name: 'announcements',
component: '@/pages/memberCenter/contentAbility/announcements'
component: '@/pages/content/announcements'
},
{
path: '/memberCenter/contentAbility/announcements/add',
name: 'announceAdd',
component: '@/pages/memberCenter/contentAbility/announcements/announceInfo',
component: '@/pages/content/announcements/announceInfo',
hideInMenu: true,
hidePageHeader: true,
},
{
path: '/memberCenter/contentAbility/announcements/detail',
name: 'announceInfo',
component: '@/pages/memberCenter/contentAbility/announcements/announceInfo',
component: '@/pages/content/announcements/announceInfo',
hideInMenu: true,
hidePageHeader: true,
},
......
......@@ -28,19 +28,18 @@ export const classSchema: ISchema = {
title: '分类名称',
required: true,
"x-component-props": {
placeholder: '请输入类名称'
placeholder: '请输入类名称'
},
"x-rules": [
{
limitByte: true,
maxByte: 16
maxByte: 20
}
]
},
describe: {
type: 'textarea',
title: '类型',
required: true,
"x-component-props": {
placeholder: '最多100个字符,50个汉字'
},
......
......@@ -44,6 +44,8 @@ const InfomationInfo = () => {
const initialValues = useInitialValues({id:id}, PublicApi.getManageMemberInformationGet);
const [category, setCategory] = useState<any>([]);
const [column, setColumn] = useState<ColumnListType[]>([])
const [recommendLabelValue, setRecommendLabelValue] = useState<number>();
const isEdit = id && !preview;
const isAdd = !id && !preview;
const isView = id && preview;
......@@ -142,13 +144,17 @@ const InfomationInfo = () => {
: PublicApi.postManageMemberInformationUpdate
const postData = isAdd ? tempPostData : {...tempPostData, id: id};
console.log(`postData`, postData)
setSubmitLoading(true)
setUnsaved(false)
serviceActions(postData).then((data) => {
setSubmitLoading(false);
if(data.code === 1000) {
history.push('/memberCenter/contentAbility/infomations')
} else {
setSubmitLoading(false)
}
}).catch(() => {
setSubmitLoading(false)
})
}
......@@ -199,7 +205,16 @@ const InfomationInfo = () => {
state.props['x-component-props']!["options"] = list;
})
})
onFieldValueChange$('recommendLabel').subscribe(({ value }) => {
console.log(`recommendLabel value`, value)
setRecommendLabelValue(value)
actions.setFieldState('imageUrl', state => {
state.props["x-rules"] = [1, 2, 3, 4, 6].includes(value) ? {
"required": true,
"message": "请上传图片"
} : {}
})
})
}}
expressionScope={{
tagOnChange: (value) => {
......@@ -208,7 +223,7 @@ const InfomationInfo = () => {
label: (
<div>
{
isAdd || isEdit
(isAdd || isEdit) && [1, 2, 3, 4, 6].includes(recommendLabelValue)
? <span style={{color: '#ff4d4f'}}>* </span>
: null
}
......
......@@ -219,10 +219,6 @@ const schema = {
// onChange: "{{uploadImage}}",
fileMaxSize: 300
},
"x-rules": {
"required": true,
"message": "请上传图片"
},
},
digest: {
type: 'string',
......
......@@ -3,7 +3,7 @@ import EyePreview from '@/components/EyePreview';
const columns = [
{title: 'ID', dataIndex: 'id'},
{
title: '标签名称', dataIndex: 'name',
title: '标签名称', dataIndex: 'name',
render: (text: string, record: any) => (
<EyePreview
url={`/memberCenter/contentAbility/tagsManagement/detail?id=${record.id}&preview=1`}
......@@ -51,9 +51,9 @@ const schema = {
name: 'search',
'x-component': 'CustomSearch',
'x-component-props': {
placeholder: "请填写栏目名称",
placeholder: "请填写标签名称",
"onSearch": "{{search}}",
}
},
searchBtn: {
......@@ -70,7 +70,7 @@ const schema = {
},
}
}
}
},
"table": {
......@@ -102,4 +102,4 @@ const schema = {
}
}
export default schema;
\ No newline at end of file
export default schema;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment