Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-platform
Commits
1a91bb75
Commit
1a91bb75
authored
Dec 01, 2021
by
前端-李俊鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 内容能力-公告管理国际化
parent
c7d2dc6d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
161 additions
and
286 deletions
+161
-286
common.ts
src/locales/zh-CN/common.ts
+4
-0
content.ts
src/locales/zh-CN/content.ts
+20
-0
announceInfo.tsx
src/pages/content/announcements/announceInfo.tsx
+8
-8
index.tsx
src/pages/content/announcements/index.tsx
+0
-0
announceInfoSchema.tsx
...pages/content/announcements/schema/announceInfoSchema.tsx
+9
-7
index.tsx
src/pages/content/announcements/schema/index.tsx
+79
-203
index.tsx
src/pages/content/infomation/index.tsx
+1
-1
infomationInfo.tsx
src/pages/content/infomation/infomationInfo.tsx
+11
-10
index.tsx
src/pages/content/infomation/schema/index.tsx
+5
-5
infomationInfoSchema.tsx
src/pages/content/infomation/schema/infomationInfoSchema.tsx
+24
-52
No files found.
src/locales/zh-CN/common.ts
View file @
1a91bb75
...
...
@@ -61,6 +61,9 @@
'common.text.unit.strip'
:
'条'
,
'common.text.pleaseSelect'
:
'请选择'
,
'common.text.notEmpty'
:
'不可为空'
,
'common.text.image'
:
'图片'
,
'common.text.title'
:
'标题'
,
'common.text.all'
:
'全部'
,
/** form */
'common.form.name.placeholder'
:
'请输入姓名'
,
...
...
@@ -69,6 +72,7 @@
'common.form.activity.startTime.placeholder'
:
'活动开始时间'
,
'common.form.activity.endTime.placeholder'
:
'活动结束时间'
,
'common.form.input.placeholder'
:
'请输入'
,
'common.form.upload.placeholder'
:
'请上传'
,
}
src/locales/zh-CN/content.ts
View file @
1a91bb75
...
...
@@ -34,4 +34,24 @@
'content.info.time'
:
'发布时间'
,
'content.info.recommendTag'
:
'推荐标签'
,
'content.info.sort'
:
'排序'
,
'content.info.add'
:
'新建资讯'
,
'content.info.edit'
:
'编辑资讯'
,
'content.info.see'
:
'查看资讯'
,
'content.info.label1'
:
'头条文章'
,
'content.info.label2'
:
'轮播新闻'
,
'content.info.label3'
:
'图片新闻'
,
'content.info.label4'
:
'推荐阅读'
,
'content.info.label5'
:
'行情推荐'
,
'content.info.label6'
:
'本栏推荐'
,
'content.info.recommendSort'
:
'排序'
,
'content.info.views'
:
'浏览数'
,
'content.info.tag'
:
'资讯标签'
,
'content.info.abstract'
:
'摘要'
,
'content.info.content'
:
'内容'
,
'content.notice.add'
:
'新建公告'
,
'content.notice.edit'
:
'编辑公告'
,
'content.notice.see'
:
'查看公告'
,
'content.notice.topping'
:
'置顶'
,
}
src/pages/content/announcements/announceInfo.tsx
View file @
1a91bb75
...
...
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
import
{
PageHeaderWrapper
}
from
"@ant-design/pro-layout"
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
history
,
Prompt
}
from
'umi'
;
import
{
history
,
Prompt
,
useIntl
}
from
'umi'
;
import
{
Card
,
Button
}
from
'antd'
;
import
{
SchemaForm
,
createFormActions
,
FormButtonGroup
,
Submit
}
from
'@formily/antd'
import
announceInfoSchema
from
'./schema/announceInfoSchema'
;
...
...
@@ -20,6 +20,7 @@ import { getManageMemberNoticeGet, postManageMemberNoticeAdd, postManageMemberNo
const
actions
=
createFormActions
();
const
AdvertisementInfo
=
()
=>
{
const
intl
=
useIntl
()
useCustomValidator
();
const
{
id
,
preview
}
=
usePageStatus
();
const
initialValues
:
any
=
useInitialValues
({
id
:
id
},
getManageMemberNoticeGet
);
...
...
@@ -43,7 +44,6 @@ const AdvertisementInfo = () => {
console
.
log
(
value
)
const
{
content
,
top
,
...
rest
}
=
value
;
const
editorContent
=
content
.
toHTML
();
// const { title, columnType, sort, link, imageUrl} = value;
const
serviceActions
=
isAdd
?
postManageMemberNoticeAdd
:
postManageMemberNoticeUpdate
...
...
@@ -67,8 +67,8 @@ const AdvertisementInfo = () => {
return
(
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
title=
{
isAdd
?
'新建公告'
:
isEdit
?
'编辑公告'
:
'查看公告'
}
backIcon=
{
<
ReutrnEle
description=
{
intl
.
formatMessage
({
id
:
'common.button.back'
})
}
/>
}
title=
{
isAdd
?
intl
.
formatMessage
({
id
:
'content.notice.add'
})
:
isEdit
?
intl
.
formatMessage
({
id
:
'content.notice.edit'
})
:
intl
.
formatMessage
({
id
:
'content.notice.see'
})
}
>
<
Card
>
<
SchemaForm
...
...
@@ -82,7 +82,7 @@ const AdvertisementInfo = () => {
editable=
{
isAdd
||
isEdit
}
expressionScope=
{
{
label
:
(
<
div
className=
{
styles
.
custom_label
}
>
栏目
</
div
>
<
div
className=
{
styles
.
custom_label
}
>
{
intl
.
formatMessage
({
id
:
'content.info.column'
})
}
</
div
>
)
}
}
>
...
...
@@ -90,14 +90,14 @@ const AdvertisementInfo = () => {
isAdd
||
isEdit
?
(
<
FormButtonGroup
offset=
{
3
}
>
<
Submit
loading=
{
submitLoading
}
>
提交
</
Submit
>
<
Button
onClick=
{
handleCancel
}
>
取消
</
Button
>
<
Submit
loading=
{
submitLoading
}
>
{
intl
.
formatMessage
({
id
:
'common.button.submit'
})
}
</
Submit
>
<
Button
onClick=
{
handleCancel
}
>
{
intl
.
formatMessage
({
id
:
'common.button.cancel'
})
}
</
Button
>
</
FormButtonGroup
>
)
:
<></>
}
</
SchemaForm
>
<
Prompt
when=
{
unsaved
&&
(
isAdd
||
isEdit
)
}
message=
"您还有未保存的内容,是否确定要离开?"
></
Prompt
>
<
Prompt
when=
{
unsaved
&&
(
isAdd
||
isEdit
)
}
message=
{
intl
.
formatMessage
({
id
:
'common.tip.save.confirm'
})
}
></
Prompt
>
</
Card
>
</
PageHeaderWrapper
>
)
...
...
src/pages/content/announcements/index.tsx
View file @
1a91bb75
This diff is collapsed.
Click to expand it.
src/pages/content/announcements/schema/announceInfoSchema.tsx
View file @
1a91bb75
import
{
ANNOUNCE_COLUMN_TYPE
,
transfer2Options
}
from
'../../utils/utils'
;
import
{
getIntl
}
from
'umi'
;
const
columnsList
=
transfer2Options
(
ANNOUNCE_COLUMN_TYPE
);
const
schema
=
{
...
...
@@ -15,15 +17,15 @@ const schema = {
properties
:
{
title
:
{
type
:
'string'
,
title
:
'标题'
,
title
:
getIntl
().
formatMessage
({
id
:
'common.text.title'
})
,
'x-component'
:
'Input'
,
'x-component-props'
:
{
placeholder
:
'最长60个字符,30个汉字'
placeholder
:
`30
${
getIntl
().
formatMessage
({
id
:
'common.unit.individual.chinese'
})}
, 60
${
getIntl
().
formatMessage
({
id
:
'common.unit.individual.character'
})}
`
,
},
"x-rules"
:
[
{
"required"
:
true
,
"message"
:
"最长60个字符,30个汉字"
"message"
:
`30
${
getIntl
().
formatMessage
({
id
:
'common.unit.individual.chinese'
})}
, 60
${
getIntl
().
formatMessage
({
id
:
'common.unit.individual.character'
})}
`
,
},
{
limitByte
:
true
,
// 自定义校验规则
...
...
@@ -63,7 +65,7 @@ const schema = {
},
"x-rules"
:
[{
"required"
:
true
,
"message"
:
"请选择栏目"
"message"
:
`
${
getIntl
().
formatMessage
({
id
:
'common.text.pleaseSelect'
})}${
getIntl
().
formatMessage
({
id
:
'content.info.column'
})}
`
,
}],
},
top
:
{
...
...
@@ -74,7 +76,7 @@ const schema = {
span
:
1
},
'x-component-props'
:
{
children
:
'置顶'
,
children
:
getIntl
().
formatMessage
({
id
:
'content.notice.topping'
})
,
}
}
}
...
...
@@ -91,7 +93,7 @@ const schema = {
content
:
{
type
:
"string"
,
name
:
'content'
,
title
:
'内容'
,
title
:
getIntl
().
formatMessage
({
id
:
'content.info.content'
})
,
"x-component"
:
'CustomEditor'
,
"x-component-parent-props"
:
{
style
:
{
...
...
@@ -100,7 +102,7 @@ const schema = {
},
"x-rules"
:
{
"required"
:
true
,
"message"
:
"请输入内容"
"message"
:
`
${
getIntl
().
formatMessage
({
id
:
'common.form.input.placeholder'
})}${
getIntl
().
formatMessage
({
id
:
'content.info.content'
})}
`
,
},
"x-component-props"
:
{
contentStyle
:
{
...
...
src/pages/content/announcements/schema/index.tsx
View file @
1a91bb75
import
EyePreview
from
'@/components/EyePreview'
;
import
{
DownOutlined
}
from
'@ant-design/icons'
;
import
{
ISchema
}
from
'@formily/antd'
;
import
{
TimeList
}
from
'../../statusList'
;
import
moment
from
'moment'
;
import
React
from
'react'
;
import
{
getIntl
}
from
'umi'
;
import
{
ANNOUNCE_COLUMN_TYPE
,
transfer2Options
}
from
'../../utils/utils'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
const
ALL
=
[{
label
:
'栏目(全部)'
,
value
:
0
}]
const
COLUMNSOPTIONS
=
ALL
.
concat
(
transfer2Options
(
ANNOUNCE_COLUMN_TYPE
));
// const ALL = [{ label: getIntl().formatMessage({ id: 'common.text.all' }), value: 0
}]
// const COLUMNS_OPTIONS = ALL.concat(transfer2Options(ANNOUNCE_COLUMN_TYPE))
const
columns
=
[
{
title
:
'ID'
,
dataIndex
:
'id'
},
{
title
:
'栏目'
,
dataIndex
:
'columnType'
,
render
:
(
text
,
record
)
=>
{
return
(
<
div
>
{
ANNOUNCE_COLUMN_TYPE
[
text
]
}
</
div
>
)
}
},
{
title
:
'标题'
,
dataIndex
:
'title'
,
render
:
(
text
:
string
,
record
:
any
)
=>
(
<
EyePreview
url=
{
`/memberCenter/contentAbility/announcements/detail?id=${record.id}&preview=1`
}
>
{
text
}
</
EyePreview
>
)
},
{
title
:
'发布时间'
,
dataIndex
:
'createTime'
,
render
:
(
text
)
=>
(
moment
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
)
},
{
title
:
'状态'
,
dataIndex
:
'status'
,
render
:
"{{renderStatus}}"
},
{
title
:
'操作'
,
render
:
"{{renderOperation}}"
}
];
/**
* 公告管理列表也 schemat
*/
const
announcementSchema
=
{
type
:
'object'
,
properties
:
{
layout
:
{
type
:
'object'
,
// 'x-component': 'mega-layout',
'x-component'
:
'CustomFlexRowLayout'
,
'x-component-props'
:
{
justify
:
'space-between'
,
align
:
'center'
},
properties
:
{
'left-layout'
:
{
export
const
schema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
mageLayout
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
properties
:
{
topLayout
:
{
type
:
'object'
,
name
:
'left-layout'
,
'x-component'
:
'CustomFlexRowLayout'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
justify
:
'start'
,
align
:
'center'
grid
:
true
,
},
properties
:
{
c
reateBtn
:
{
type
:
"object"
,
name
:
"createBtn"
,
"x-component"
:
"button"
,
"x-component-props"
:
{
"onClick"
:
"{{goToCreate}}"
,
"children"
:
"新建"
,
"type"
:
'primary'
,
style
:
{
width
:
'112px
'
,
margin
:
'0 0 15px 0'
}
}
c
tl
:
{
type
:
'object'
,
'x-component'
:
'Children'
,
'x-component-props'
:
{
children
:
'{{controllerBtns}}'
,
}
,
}
,
title
:
{
type
:
'string'
,
'x-component'
:
'Search
'
,
'x-component-props'
:
{
placeholder
:
getIntl
().
formatMessage
({
id
:
'content.info.title'
}),
}
,
},
}
}
,
},
'right-layout'
:
{
type
:
'object'
,
name
:
'rigth-layout'
,
"x-component"
:
'CustomFlexColumnLayout'
,
properties
:
{
controllers
:
{
type
:
'object'
,
name
:
'controllers'
,
'x-component'
:
'CustomFlexRowLayout'
,
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
'x-component'
:
'flex-layout'
,
'x-component-props'
:
{
rowStyle
:
{
flexWrap
:
'nowrap'
,
},
colStyle
:
{
marginLeft
:
20
,
},
},
properties
:
{
columnType
:
{
type
:
'string'
,
enum
:
transfer2Options
(
ANNOUNCE_COLUMN_TYPE
),
'x-component-props'
:
{
justify
:
'end'
,
placeholder
:
`
${
getIntl
().
formatMessage
({
id
:
'common.text.pleaseSelect'
})}${
getIntl
().
formatMessage
({
id
:
'content.info.column'
})}
`
,
style
:
{
width
:
'174px'
},
},
properties
:
{
search
:
{
type
:
'string'
,
name
:
'name'
,
'x-component'
:
'CustomSearch'
,
'x-component-props'
:
{
placeholder
:
"请填写标题名称"
,
"onSearch"
:
"{{search}}"
,
}
},
'HIGHT_FILTER_BTN'
:
{
type
:
'string'
,
name
:
'HIGHT_FILTER_BTN'
,
'x-component'
:
'button'
,
'x-component-props'
:
{
"children"
:
(
<
div
>
高级搜索
<
DownOutlined
/></
div
>
),
"onClick"
:
"{{toggleFilters}}"
,
style
:
{
margin
:
'0 15px'
}
}
},
reset
:
{
type
:
'string'
,
name
:
'reset'
,
"x-component"
:
"button"
,
"x-component-props"
:
{
"onClick"
:
"{{reset}}"
,
"children"
:
"重置"
,
}
},
}
},
'FILTERS'
:
{
type
:
'object'
,
name
:
'FILTERS'
,
'x-component'
:
'CustomFlexRowLayout'
,
status
:
{
type
:
'string'
,
enum
:
[
{
label
:
getIntl
().
formatMessage
({
id
:
'common.text.all'
}),
value
:
'0'
},
{
label
:
getIntl
().
formatMessage
({
id
:
'content.common.waitUp'
}),
value
:
'1'
},
{
label
:
getIntl
().
formatMessage
({
id
:
'content.common.hadUp'
}),
value
:
'2'
},
{
label
:
getIntl
().
formatMessage
({
id
:
'content.common.hadDown'
}),
value
:
'3'
},
],
'x-component-props'
:
{
justify
:
'end'
placeholder
:
`
${
getIntl
().
formatMessage
({
id
:
'common.text.pleaseSelect'
})}${
getIntl
().
formatMessage
({
id
:
'common.table.status'
})}
`
,
style
:
{
width
:
'174px'
},
},
properties
:
{
columnType
:
{
type
:
'string'
,
'x-component'
:
'Select'
,
'x-component-props'
:
{
style
:
{
width
:
'160px'
},
options
:
COLUMNSOPTIONS
,
defaultValue
:
0
,
}
},
status
:
{
name
:
'status'
,
type
:
'string'
,
'x-component'
:
'Select'
,
'x-component-props'
:
{
options
:
[
{
label
:
'状态(全部)'
,
value
:
'0'
},
{
label
:
'待上架'
,
value
:
'1'
},
{
label
:
'已上架'
,
value
:
'2'
},
{
label
:
'已下架'
,
value
:
'3'
},
],
defaultValue
:
'0'
,
placeholder
:
'请选择状态'
,
style
:
{
width
:
'160px'
,
margin
:
'0 15px'
}
}
},
time
:
{
name
:
'time'
,
type
:
'string'
,
'x-component'
:
'Select'
,
'x-component-props'
:
{
placeholder
:
'发布时间(全部)'
,
options
:
TimeList
,
style
:
{
width
:
'160px'
,
}
}
}
}
}
}
}
}
},
"table"
:
{
"key"
:
"table"
,
"type"
:
"object"
,
"name"
:
"table"
,
"x-component"
:
"Table"
,
"x-component-props"
:
{
"columns"
:
columns
,
"rowKey"
:
"id"
,
pagination
:
false
,
// "pagination": {
// showQuickJumper: true,
// size: "small",
// "onChange": "{{paginationChange}}",
// },
// "rowSelection": "{{rowSelection}}"
}
},
pagination
:
{
type
:
'object'
,
'x-component'
:
"TablePagination"
,
'x-style'
:
{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'flex-end'
},
// time: {
// type: 'string',
// enum: TimeList,
// 'x-component-props': {
// placeholder: getIntl().formatMessage({id: 'content.info.time'}),
// style: { width: '174px' },
// },
// },
submit
:
{
'x-component'
:
'Submit'
,
'x-mega-props'
:
{
span
:
1
,
},
'x-component-props'
:
{
children
:
getIntl
().
formatMessage
({
id
:
'common.button.submit'
}),
},
},
},
},
},
'x-component-props'
:
{
showQuickJumper
:
true
,
pageSize
:
10
,
size
:
'small'
}
}
}
}
export
default
announcementSchema
},
},
};
src/pages/content/infomation/index.tsx
View file @
1a91bb75
...
...
@@ -190,7 +190,7 @@ const Infomation = () => {
return
(
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
<
StandardTable
columns=
{
columns
}
currentRef=
{
ref
}
tableProps=
{
{
rowKey
:
'id'
}
}
...
...
src/pages/content/infomation/infomationInfo.tsx
View file @
1a91bb75
...
...
@@ -4,7 +4,7 @@ import { Card, Select, Input, Checkbox, Button} from 'antd';
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
history
,
Prompt
}
from
'umi'
;
import
{
history
,
Prompt
,
useIntl
}
from
'umi'
;
// import CustomUpload from '@/components/NiceForm/components/CustomUpload';
import
{
CustomTags
}
from
'../components/Tags'
;
import
CustomEditor
from
'../components/CustomEditor'
;
...
...
@@ -36,6 +36,7 @@ type ColumnListType = {
}
const
InfomationInfo
=
()
=>
{
const
intl
=
useIntl
()
useCustomValidator
();
const
{
id
,
preview
}
=
usePageStatus
();
// const [isTop, setIsTop] = useState(1);
...
...
@@ -122,7 +123,7 @@ const InfomationInfo = () => {
const
targetColumn
=
column
.
filter
((
_item
)
=>
_item
.
value
===
data
.
columnId
)[
0
];
if
(
targetColumn
)
{
actions
.
setFieldState
(
'layout.columnId'
,
state
=>
{
state
.
props
[
'description'
]
=
`
栏目分类
:
${
COLUMN_CATEGORY
[
targetColumn
?.
type
]
||
''
}
`
state
.
props
[
'description'
]
=
`
${
intl
.
formatMessage
({
id
:
'content.columns.category'
})}
:
${
COLUMN_CATEGORY
[
targetColumn
?.
type
]
||
''
}
`
})
setType(targetColumn?.type)
}
...
...
@@ -168,8 +169,8 @@ const InfomationInfo = () => {
<div>
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description=
"返回"
/>}
title={isAdd ?
'新建资讯' : isEdit ? '编辑资讯' : '查看资讯'
}
backIcon={<ReutrnEle description=
{intl.formatMessage({ id: 'common.button.back' })}
/>}
title={isAdd ?
intl.formatMessage({ id: 'content.info.add' }) : isEdit ? intl.formatMessage({ id: 'content.info.edit' }) : intl.formatMessage({ id: 'content.info.see' })
}
>
<Card>
<SchemaForm
...
...
@@ -187,7 +188,7 @@ const InfomationInfo = () => {
onFieldValueChange$('layout.columnId').subscribe(({ value }) => {
actions.setFieldState('layout.columnId', state => {
const currentType = state.props["x-component-props"]!.options?.filter((_row) => _row.value === value)[0];
state["props"]["description"] = `
栏目分类
:
$
{
currentType
&&
(
COLUMN_CATEGORY
[
currentType
.
type
])}
`;
state["props"]["description"] = `
$
{
intl
.
formatMessage
({
id
:
'content.columns.category'
})}
:
$
{
currentType
&&
(
COLUMN_CATEGORY
[
currentType
.
type
])}
`;
setType(currentType ? currentType.type : 0)
})
})
...
...
@@ -213,7 +214,7 @@ const InfomationInfo = () => {
actions.setFieldState('imageUrl', state => {
state.props["x-rules"] = [1, 2, 3, 4, 6].includes(value) ? {
"required": true,
"message":
"请上传图片"
"message":
`
$
{
intl
.
formatMessage
({
id
:
'common.form.upload.placeholder'
})}
$
{
intl
.
formatMessage
({
id
:
'common.text.image'
})}
`
} : {}
})
})
...
...
@@ -224,7 +225,7 @@ const InfomationInfo = () => {
},
label: (
<div className={cx((isAdd || isEdit) && [1, 2, 3, 4, 6].includes(recommendLabelValue) && styles.custom_label)}>
图片
{intl.formatMessage({ id: 'common.text.image' })}
</div>
)
}}
...
...
@@ -233,15 +234,15 @@ const InfomationInfo = () => {
isAdd || isEdit
? (
<FormButtonGroup offset={3}>
<Submit loading={submitLoading}>
提交
</Submit>
<Button onClick={handleCancel}>
取消
</Button>
<Submit loading={submitLoading}>
{intl.formatMessage({ id: 'common.button.submit' })}
</Submit>
<Button onClick={handleCancel}>
{intl.formatMessage({ id: 'common.button.cancel' })}
</Button>
</FormButtonGroup>
)
: <></>
}
</SchemaForm>
</Card>
<Prompt when={(isAdd || isEdit) && unsaved} message=
"您还有未保存的内容,是否确定要离开?"
/>
<Prompt when={(isAdd || isEdit) && unsaved} message=
{intl.formatMessage({ id: 'common.tip.save.confirm' })}
/>
</PageHeaderWrapper>
</div>
)
...
...
src/pages/content/infomation/schema/index.tsx
View file @
1a91bb75
...
...
@@ -3,7 +3,7 @@ import { TimeList } from '../../statusList';
import
{
getIntl
}
from
'umi'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
const
CustomTimeList
=
[{
label
:
'全部'
,
value
:
0
}].
concat
(
TimeList
.
slice
(
1
));
const
CustomTimeList
=
[{
label
:
getIntl
().
formatMessage
({
id
:
'common.text.all'
})
,
value
:
0
}].
concat
(
TimeList
.
slice
(
1
));
export
const
schema
:
ISchema
=
{
type
:
'object'
,
...
...
@@ -58,10 +58,10 @@ export const schema: ISchema = {
status
:
{
type
:
'string'
,
enum
:
[
{
label
:
'全部'
,
value
:
'0'
},
{
label
:
'待上架'
,
value
:
'1'
},
{
label
:
'已上架'
,
value
:
'2'
},
{
label
:
'已下架'
,
value
:
'3'
},
{
label
:
getIntl
().
formatMessage
({
id
:
'common.text.all'
})
,
value
:
'0'
},
{
label
:
getIntl
().
formatMessage
({
id
:
'content.common.waitUp'
})
,
value
:
'1'
},
{
label
:
getIntl
().
formatMessage
({
id
:
'content.common.hadUp'
})
,
value
:
'2'
},
{
label
:
getIntl
().
formatMessage
({
id
:
'content.common.hadDown'
})
,
value
:
'3'
},
],
'x-component-props'
:
{
placeholder
:
`
${
getIntl
().
formatMessage
({
id
:
'common.text.pleaseSelect'
})}${
getIntl
().
formatMessage
({
id
:
'common.table.status'
})}
`
,
...
...
src/pages/content/infomation/schema/infomationInfoSchema.tsx
View file @
1a91bb75
import
{
getIntl
}
from
'umi'
;
interface
IOption
{
value
:
number
|
string
,
label
:
number
|
string
...
...
@@ -30,15 +32,15 @@ const schema = {
properties
:
{
title
:
{
name
:
'title'
,
title
:
'标题'
,
title
:
getIntl
().
formatMessage
({
id
:
'common.text.title'
})
,
'x-component'
:
'Input'
,
'x-component-props'
:
{
placeholder
:
'最长30个汉字,60个字符'
,
placeholder
:
`30
${
getIntl
().
formatMessage
({
id
:
'common.unit.individual.chinese'
})}
, 60
${
getIntl
().
formatMessage
({
id
:
'common.unit.individual.character'
})}
`
,
},
"x-rules"
:
[
{
"required"
:
true
,
"message"
:
"请填写标题"
"message"
:
`
${
getIntl
().
formatMessage
({
id
:
'common.form.input.placeholder'
})}${
getIntl
().
formatMessage
({
id
:
'common.text.title'
})}
`
,
},
{
limitByte
:
true
,
...
...
@@ -48,22 +50,22 @@ const schema = {
},
columnId
:
{
name
:
'columnId'
,
title
:
'栏目'
,
title
:
getIntl
().
formatMessage
({
id
:
'content.info.column'
})
,
'x-component'
:
'Select'
,
"x-component-props"
:
{
style
:
{
marginBottom
:
'8px'
},
},
description
:
"栏目分类"
,
description
:
getIntl
().
formatMessage
({
id
:
'content.columns.category'
})
,
"x-rules"
:
{
"required"
:
true
,
"message"
:
"请选择咨询说明"
"message"
:
`
${
getIntl
().
formatMessage
({
id
:
'common.text.pleaseSelect'
})}${
getIntl
().
formatMessage
({
id
:
'content.columns.category'
})}
`
,
},
},
recommendLabel
:
{
name
:
'recommendLabel'
,
title
:
'推荐标签'
,
title
:
getIntl
().
formatMessage
({
id
:
'content.info.recommendTag'
})
,
type
:
'string'
,
'x-component'
:
'Select'
,
"x-component-props"
:
{
...
...
@@ -72,49 +74,19 @@ const schema = {
},
allowClear
:
true
,
options
:
[
{
label
:
'头条文章'
,
value
:
1
},
{
label
:
'轮播新闻'
,
value
:
2
},
{
label
:
'图片新闻'
,
value
:
3
},
{
label
:
'推荐阅读'
,
value
:
4
},
{
label
:
'行情推荐'
,
value
:
5
},
{
label
:
'本栏推荐'
,
value
:
6
}
{
label
:
getIntl
().
formatMessage
({
id
:
'content.info.label1'
})
,
value
:
1
},
{
label
:
getIntl
().
formatMessage
({
id
:
'content.info.label2'
})
,
value
:
2
},
{
label
:
getIntl
().
formatMessage
({
id
:
'content.info.label3'
})
,
value
:
3
},
{
label
:
getIntl
().
formatMessage
({
id
:
'content.info.label4'
})
,
value
:
4
},
{
label
:
getIntl
().
formatMessage
({
id
:
'content.info.label5'
})
,
value
:
5
},
{
label
:
getIntl
().
formatMessage
({
id
:
'content.info.label6'
})
,
value
:
6
}
],
},
},
// sortLayout: {
// type: 'object',
// 'x-component': 'mega-layout',
// "x-component-props": {
// "label": "推荐排序",
// // wrapperCol: 23,
// // layoutProps: {
// // "wrapperCol": 12,
// // },
// style: {
// marginBottom: 0
// },
// // addonAfter: "{{isTop}}"
// },
// properties: {
// sort: {
// name: 'sort',
// type: 'string',
// 'x-component': 'Select',
// 'x-component-props': {
// // style: {
// // width: '100%'
// // },
// options: sortedList,
// allowClear: true,
// }
// },
// }
// },
sort
:
{
name
:
'sort'
,
type
:
'string'
,
title
:
'推荐排序'
,
title
:
getIntl
().
formatMessage
({
id
:
'content.info.recommendSort'
})
,
'x-component'
:
'Select'
,
'x-component-props'
:
{
options
:
sortedList
,
...
...
@@ -124,7 +96,7 @@ const schema = {
},
readCount
:
{
name
:
'readCount'
,
title
:
'浏览数'
,
title
:
getIntl
().
formatMessage
({
id
:
'content.info.views'
})
,
type
:
'string'
,
'x-component'
:
'Input'
,
'x-component-props'
:
{
...
...
@@ -144,7 +116,7 @@ const schema = {
'x-component-props'
:
{
grid
:
true
,
full
:
true
,
label
:
"行情资讯分类:"
,
label
:
getIntl
().
formatMessage
({
id
:
'content.info.category'
})
,
"wrapperCol"
:
24
,
},
properties
:
{
...
...
@@ -200,7 +172,7 @@ const schema = {
},
labelIds
:
{
name
:
'labelIds'
,
title
:
'咨询标签'
,
title
:
getIntl
().
formatMessage
({
id
:
'content.info.tag'
})
,
"x-component"
:
'CustomTags'
,
"x-component-props"
:
{
layoutProps
:
{
...
...
@@ -223,16 +195,16 @@ const schema = {
digest
:
{
type
:
'string'
,
name
:
'digest'
,
title
:
'摘要'
,
title
:
getIntl
().
formatMessage
({
id
:
'content.info.abstract'
})
,
"x-component"
:
'TextArea'
,
"x-component-props"
:
{
placeholder
:
"最长400个字符,200个汉字"
,
placeholder
:
`200
${
getIntl
().
formatMessage
({
id
:
'common.unit.individual.chinese'
})}
, 400
${
getIntl
().
formatMessage
({
id
:
'common.unit.individual.character'
})}
`
,
rows
:
5
,
},
"x-rules"
:
[
{
"required"
:
true
,
"message"
:
"最长400个字符,200个汉字"
"message"
:
`200
${
getIntl
().
formatMessage
({
id
:
'common.unit.individual.chinese'
})}
, 400
${
getIntl
().
formatMessage
({
id
:
'common.unit.individual.character'
})}
`
,
},
{
limitByte
:
true
,
...
...
@@ -252,7 +224,7 @@ const schema = {
content
:
{
type
:
"string"
,
name
:
'content'
,
title
:
'内容'
,
title
:
getIntl
().
formatMessage
({
id
:
'content.info.content'
})
,
"x-component"
:
'CustomEditor'
,
"x-component-parent-props"
:
{
style
:
{
...
...
@@ -261,7 +233,7 @@ const schema = {
},
"x-rules"
:
{
"required"
:
true
,
"message"
:
"请输入内容"
"message"
:
`
${
getIntl
().
formatMessage
({
id
:
'common.form.input.placeholder'
})}${
getIntl
().
formatMessage
({
id
:
'content.info.content'
})}
`
,
},
"x-component-props"
:
{
contentStyle
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment