Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
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-admin
Commits
8951415b
Commit
8951415b
authored
May 11, 2021
by
Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 内容管理添加标签名
parent
ed6485b7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
7 deletions
+26
-7
global.d.ts
src/global/config/global.d.ts
+1
-0
infomationInfo.tsx
src/pages/content/infomation/infomationInfo.tsx
+13
-7
infomationInfoSchema.tsx
src/pages/content/infomation/schema/infomationInfoSchema.tsx
+12
-0
No files found.
src/global/config/global.d.ts
View file @
8951415b
...
...
@@ -41,6 +41,7 @@ export interface ShopInfo {
describe
:
string
;
state
:
number
;
url
:
string
;
isDefault
?:
any
;
}
export
interface
OrderMode
{
...
...
src/pages/content/infomation/infomationInfo.tsx
View file @
8951415b
...
...
@@ -100,6 +100,7 @@ const InfomationInfo = () => {
}
setFormStatus
(
'layout.contentLayout.content'
,
'readOnly'
,
isView
);
if
(
category
)
{
actions
.
setFieldValue
(
'layout.categoryLayout.firstCategoryName'
,
data
.
firstCategoryName
);
const
secondCategory
=
category
.
filter
((
_row
)
=>
_row
.
id
===
data
.
firstCategoryId
)[
0
]?.
list
||
[];
const
options
=
secondCategory
.
map
((
_row
:
any
)
=>
({
label
:
_row
.
name
,
value
:
_row
.
id
,
children
:
_row
.
list
}))
setFormStatus
(
'layout.categoryLayout.secondCategoryId'
,
'options'
,
options
);
...
...
@@ -118,9 +119,7 @@ const InfomationInfo = () => {
})
setType(targetColumn?.type)
}
}
setFormStatus('layout.imageUpload', 'imgUrl', data.imageUrl)
setIsTop(data.top);
setLabelIds(data.labelIds)
...
...
@@ -133,7 +132,7 @@ const InfomationInfo = () => {
...value,
top: isTop,
type: type,
labelIds: labelIds,
labelIds: labelIds
|| []
,
content: content,
}
const serviceActions = isAdd
...
...
@@ -141,7 +140,6 @@ const InfomationInfo = () => {
: PublicApi.postManageContentInformationUpdate
const postData = isAdd ? tempPostData : {...tempPostData, id: id};
console.log("postData", postData);
setSubmitLoading(true)
setUnsaved(false)
serviceActions(postData).then((data) => {
...
...
@@ -184,10 +182,18 @@ const InfomationInfo = () => {
setType(currentType ? currentType.type : 0)
})
})
onFieldValueChange$('layout.categoryLayout.*(firstCategoryId,secondCategoryId)').subscribe(({ value, props, name }) => {
onFieldValueChange$('layout.categoryLayout.*(firstCategoryId,secondCategoryId, thirdlyCategoryId)').subscribe(({ value, props, name }) => {
const matchName = name.match(/(.*?)Id/)
if(matchName?.length !== 2) {
return
}
const target = props["x-component-props"]!.options.filter((_row) => _row.value === value)[0];
actions.setFieldValue(`
layout
.
categoryLayout
.
$
{
matchName
[
1
]}
Name
`, target?.label)
if(name === 'thirdlyCategoryId') {
return;
}
const childrenName = name === 'firstCategoryId' ? 'secondCategoryId' : 'thirdlyCategoryId';
const optionChildren = props["x-component-props"]!.options.filter((_row) => _row.value === value)[0]?.children || [];
console.log(optionChildren)
const optionChildren = target?.children || [];
const list = optionChildren?.map((_item) => ({ label: _item.name, value: _item.id, children: _item.list }) );
actions.setFieldState(`
layout
.
categoryLayout
.
$
{
childrenName
}
`, state => {
state.value = "",
...
...
src/pages/content/infomation/schema/infomationInfoSchema.tsx
View file @
8951415b
...
...
@@ -163,6 +163,10 @@ const schema = {
},
]
},
firstCategoryName
:
{
type
:
'string'
,
display
:
false
,
},
secondCategoryId
:
{
type
:
'string'
,
'x-component'
:
"Select"
,
...
...
@@ -177,12 +181,20 @@ const schema = {
},
]
},
secondCategoryName
:
{
type
:
'string'
,
display
:
false
,
},
thirdlyCategoryId
:
{
type
:
'string'
,
'x-component'
:
"Select"
,
'x-component-props'
:
{
options
:
[],
},
},
thirdlyCategoryName
:
{
type
:
'string'
,
display
:
false
}
}
},
...
...
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