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
XieZhiXiong
jinfa-platform
Commits
e05b6574
Commit
e05b6574
authored
Oct 21, 2021
by
前端-李俊鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 内容能力相关问题
parent
af110b65
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
56 additions
and
49 deletions
+56
-49
announceInfo.tsx
src/pages/content/announcements/announceInfo.tsx
+2
-8
columnInfo.tsx
src/pages/content/columnManagement/columnInfo.tsx
+5
-0
index.less
src/pages/content/index.less
+18
-0
index.tsx
src/pages/content/infomation/index.tsx
+22
-29
infomationInfo.tsx
src/pages/content/infomation/infomationInfo.tsx
+3
-6
infomationInfoSchema.tsx
src/pages/content/infomation/schema/infomationInfoSchema.tsx
+3
-3
index.less
src/pages/index.less
+3
-3
No files found.
src/pages/content/announcements/announceInfo.tsx
View file @
e05b6574
...
...
@@ -15,6 +15,7 @@ import CustomCheckbox from '../components/CustomCheckbox';
import
BraftEditor
from
'braft-editor'
;
import
{
setFormStatus
}
from
'../utils/utils'
;
import
useCustomValidator
from
'../hooks/useValidator'
import
styles
from
'../index.less'
const
actions
=
createFormActions
();
...
...
@@ -81,14 +82,7 @@ const AdvertisementInfo = () => {
editable=
{
isAdd
||
isEdit
}
expressionScope=
{
{
label
:
(
<
div
>
{
isAdd
||
isEdit
?
<
span
style=
{
{
color
:
'#ff4d4f'
}
}
>
*
</
span
>
:
null
}
栏目
</
div
>
<
div
className=
{
styles
.
custom_label
}
>
栏目
</
div
>
)
}
}
>
...
...
src/pages/content/columnManagement/columnInfo.tsx
View file @
e05b6574
...
...
@@ -4,6 +4,7 @@ import { Card, Select, Input, Button } from 'antd';
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
validatorAllTrim
}
from
'@/utils/regExp'
;
import
{
history
,
Prompt
}
from
'umi'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
useCustomValidator
from
'../hooks/useValidator'
...
...
@@ -51,6 +52,10 @@ const schema = {
{
limitByte
:
true
,
// 自定义校验规则
maxByte
:
20
,
},
{
validator
:
value
=>
value
.
trim
().
length
===
0
,
message
:
'栏目名称不可为空'
,
}
]
},
...
...
src/pages/content/index.less
0 → 100644
View file @
e05b6574
.custom_label {
position: relative;
font-size: 12px;
color: #909399;
&::after {
position: absolute;
display: inline-block;
margin-right: 4px;
color: #ff4d4f;
font-size: 12px;
font-family: SimSun, sans-serif;
line-height: 1;
content: '*';
top: 4px;
right: -22px;
}
}
src/pages/content/infomation/index.tsx
View file @
e05b6574
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useEffect
,
useState
,
useRef
}
from
'react'
;
import
{
FilterTable
,
SchemaFlexRowLayout
,
SchemaFlexColumnLayout
}
from
'../components/FilterTable'
;
import
{
Card
,
Input
,
Button
,
Table
,
Dropdown
,
Menu
,
Select
,
Space
,
Modal
,
Popconfirm
}
from
'antd'
;
import
{
createVirtualBox
,
createFormActions
,
FormEffectHooks
,
createEffectHook
}
from
'@formily/antd'
;
...
...
@@ -15,11 +15,6 @@ import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
const
{
onFormInit$
,
onFieldValueChange$
}
=
FormEffectHooks
const
{
Search
}
=
Input
;
const
SchemaButton
=
createVirtualBox
(
'button'
,
Button
);
const
SchemaTable
=
createVirtualBox
(
'SchemaTable'
,
Table
);
const
SchemaDropDown
=
createVirtualBox
(
'SchemaDropDown'
,
Dropdown
.
Button
);
const
actions
=
createFormActions
();
...
...
@@ -34,31 +29,16 @@ interface optionsType {
value
:
string
|
number
}
const
useGetColumns
=
()
=>
{
const
[
state
,
setState
]
=
useState
<
optionsType
[]
>
([]);
useEffect
(()
=>
{
async
function
getAllColumns
()
{
const
res
=
await
PublicApi
.
getManageMemberColumnAll
();
console
.
log
(
res
);
const
options
=
res
.
data
.
map
((
item
)
=>
({
label
:
item
.
name
,
value
:
item
.
id
}));
// setTableStatus("column", "options", options);
setState
(
options
)
}
getAllColumns
();
},
[])
return
state
;
}
const
getData
=
async
(
params
:
any
)
=>
{
const
res
=
await
PublicApi
.
getManageMemberInformationPage
(
params
);
return
res
.
data
}
const
Infomation
=
()
=>
{
const
columns
=
useGetColumns
();
const
[
selectedRow
,
setSelectedRow
]
=
useState
<
any
[]
>
([]);
// const [roleSelection, roleSelectCtl] = useRowSelectionTable()
// const refkeys = useRef([])
const
selectedRowRef
=
useRef
<
any
[]
>
([])
const
columnsOptionsRef
=
useRef
<
any
[]
>
([])
useEffect
(()
=>
{
const
params
=
{
...
...
@@ -68,6 +48,16 @@ const Infomation = () => {
getTableDataSource
(
actions
,
params
,
getData
);
},
[])
useEffect
(()
=>
{
PublicApi
.
getManageMemberColumnAll
().
then
((
res
)
=>
{
const
{
code
,
data
}
=
res
console
.
log
(
res
);
if
(
code
===
1000
)
{
columnsOptionsRef
.
current
=
data
.
map
((
item
)
=>
({
label
:
item
.
name
,
value
:
item
.
id
}));
}
});
},
[])
const
infomationEffects
=
()
=>
()
=>
{
onFormInit$
().
subscribe
(()
=>
{
actions
.
setFieldState
(
'FILTERS'
,
state
=>
{
...
...
@@ -121,12 +111,13 @@ const Infomation = () => {
// 批量删除
const
batchDelete
=
()
=>
{
const
rows
=
selectedRow
const
rows
=
selectedRow
Ref
.
current
handleBatch
(
rows
,
1
);
}
// type 1-批量删除 2-批量上架 3-批量下架
const
handleBatch
=
(
row
,
type
)
=>
{
console
.
log
(
`handleBatch type`
,
type
)
PublicApi
.
postManageMemberInformationBatch
({
ids
:
row
,
type
:
type
})
.
then
((
data
)
=>
{
const
paginationValue
=
actions
.
getFieldValue
(
'pagination'
);
...
...
@@ -231,12 +222,12 @@ const Infomation = () => {
batchGrounding
:
()
=>
{
console
.
log
(
"批量上架"
);
const
rows
=
selectedRow
const
rows
=
selectedRow
Ref
.
current
handleBatch
(
rows
,
2
);
},
undercarriage
:
()
=>
{
console
.
log
(
"批量下架"
)
const
rows
=
selectedRow
const
rows
=
selectedRow
Ref
.
current
handleBatch
(
rows
,
3
);
},
menu
:
()
=>
{
...
...
@@ -269,15 +260,18 @@ const Infomation = () => {
keys
=
keys
.
filter
((
_item
)
=>
_item
!==
record
.
id
);
}
setSelectedRow
(
keys
)
selectedRowRef
.
current
=
keys
},
onSelectAll
:
(
selected
,
checkedRows
,
changeRows
)
=>
{
const
changeRowKey
=
changeRows
.
filter
((
_item
)
=>
_item
).
map
((
item
)
=>
item
.
id
);
let
keys
=
Array
.
from
(
new
Set
([...
changeRowKey
,
...
selectedRow
]))
if
(
selected
)
{
setSelectedRow
(
keys
)
selectedRowRef
.
current
=
keys
}
else
{
const
removeKeys
=
keys
.
filter
((
_item
)
=>
!
changeRowKey
.
includes
(
_item
));
setSelectedRow
(
removeKeys
)
selectedRowRef
.
current
=
removeKeys
}
},
selectedRowKeys
:
selectedRow
...
...
@@ -287,7 +281,7 @@ const Infomation = () => {
const
visible
=
!
state
.
visible
;
state
.
visible
=
visible
;
if
(
visible
)
{
setFormStatus
(
actions
,
'columns'
,
"options"
,
columns
);
setFormStatus
(
actions
,
'columns'
,
"options"
,
columns
OptionsRef
.
current
);
}
actions
.
setFieldState
(
'HIGHT_FILTER_BTN'
,
(
state
)
=>
{
//@ts-ignore
...
...
@@ -296,7 +290,6 @@ const Infomation = () => {
)
})
});
},
}
}
effects=
{
infomationEffects
()
}
...
...
src/pages/content/infomation/infomationInfo.tsx
View file @
e05b6574
...
...
@@ -15,6 +15,8 @@ import infomationInfoSchema from './schema/infomationInfoSchema';
import
CustomUpload
from
'../components/WrapCustomUpload'
;
import
useCustomValidator
from
'../hooks/useValidator'
import
{
COLUMN_CATEGORY
}
from
'../constant'
;
import
cx
from
'classnames'
;
import
styles
from
'../index.less'
const
actions
=
createFormActions
();
const
{
onFieldValueChange$
,
onFieldInputChange$
}
=
FormEffectHooks
...
...
@@ -221,12 +223,7 @@ const InfomationInfo = () => {
setLabelIds(value);
},
label: (
<div>
{
(isAdd || isEdit) && [1, 2, 3, 4, 6].includes(recommendLabelValue)
? <span style={{color: '#ff4d4f'}}>* </span>
: null
}
<div className={cx((isAdd || isEdit) && [1, 2, 3, 4, 6].includes(recommendLabelValue) && styles.custom_label)}>
图片
</div>
)
...
...
src/pages/content/infomation/schema/infomationInfoSchema.tsx
View file @
e05b6574
...
...
@@ -226,17 +226,17 @@ const schema = {
title
:
'摘要'
,
"x-component"
:
'TextArea'
,
"x-component-props"
:
{
placeholder
:
"最长
300个字符,15
0个汉字"
,
placeholder
:
"最长
400个字符,20
0个汉字"
,
rows
:
5
,
},
"x-rules"
:
[
{
"required"
:
true
,
"message"
:
"最长
300个字符,15
0个汉字"
"message"
:
"最长
400个字符,20
0个汉字"
},
{
limitByte
:
true
,
maxByte
:
3
00
maxByte
:
4
00
}
],
},
...
...
src/pages/index.less
View file @
e05b6574
...
...
@@ -10,7 +10,7 @@
// 500 error
// .wrapper{
// }
.errorBox{
width: 100%;
...
...
@@ -27,4 +27,5 @@
.white-wrap {
background: #fff;
}
\ No newline at end of file
}
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