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
d2523523
Commit
d2523523
authored
Aug 03, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2' of
http://10.0.0.22:3000/lingxi/lingxi-business-system
into v2
parents
cb382011
d11d0b2f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
91 additions
and
62 deletions
+91
-62
index.tsx
...ngsPanel/propsSettings/components/PlatformGoods/index.tsx
+39
-3
addRule.tsx
src/pages/ruleSettingManage/procurementRules/addRule.tsx
+0
-4
index.tsx
...nage/procurementRules/components/selectProcesss/index.tsx
+21
-18
index.tsx
...pages/ruleSettingManage/procurementRules/schema/index.tsx
+1
-1
addRule.tsx
src/pages/ruleSettingManage/transactionRules/addRule.tsx
+4
-6
RuleSetting.tsx
...SettingManage/transactionRules/components/RuleSetting.tsx
+2
-9
index.tsx
...nage/transactionRules/components/selectProcesss/index.tsx
+22
-18
index.tsx
src/pages/ruleSettingManage/transactionRules/index.tsx
+1
-1
index.tsx
...pages/ruleSettingManage/transactionRules/schema/index.tsx
+1
-2
No files found.
src/pages/pageCustomized/settingsPanel/propsSettings/components/PlatformGoods/index.tsx
View file @
d2523523
...
...
@@ -81,10 +81,24 @@ const PlatformGoods: React.FC<PlatformGoodsProps> = (props) => {
const
[
selectedRows
,
setSelectedRows
]
=
useState
([]);
const
[
mallSelectList
,
setMallSelectList
]
=
useState
<
NewSelectItemType
[]
>
([]);
const
[
selectMallInfo
,
setSelectMallInfo
]
=
useState
<
NewSelectItemType
>
();
const
[
categoryId
,
setCategoryId
]
=
useState
<
number
>
();
const
[
categoryId
,
setCategoryId
]
=
useState
<
string
>
();
const
[
fontColor
,
setFontColor
]
=
useState
<
string
>
();
const
ref
=
useRef
<
any
>
({});
const
initCategoryId
=
()
=>
{
if
(
dataInfo
)
{
if
(
dataInfo
.
thirdId
)
{
setCategoryId
(
dataInfo
.
thirdId
)
}
else
if
(
dataInfo
.
secondId
)
{
setCategoryId
(
dataInfo
.
secondId
)
}
else
if
(
dataInfo
.
firstId
){
setCategoryId
(
dataInfo
.
firstId
)
}
else
{
setCategoryId
(
undefined
)
}
}
}
const
initMallList
=
(
mallList
:
ShopInfo
[])
=>
{
if
(
!
mallList
)
{
return
[];
...
...
@@ -134,6 +148,7 @@ const PlatformGoods: React.FC<PlatformGoodsProps> = (props) => {
const
enterpriseMallList
=
GlobalConfig
.
web
.
shopInfo
.
filter
((
item
)
=>
item
.
type
===
1
&&
item
.
environment
===
1
);
setMallSelectList
(
initMallList
(
enterpriseMallList
));
initColorPicker
();
initCategoryId
()
},
[]);
useEffect
(()
=>
{
...
...
@@ -207,6 +222,27 @@ const PlatformGoods: React.FC<PlatformGoodsProps> = (props) => {
const
result
=
produce
(
newProps
,
(
old
)
=>
{
old
.
dataInfo
[
'visible'
]
=
true
})
if
(
result
.
dataInfo
.
name
)
{
let
str
=
result
.
dataInfo
.
name
str
=
str
.
replace
(
/
[\u
4e00-
\u
9fa5
]
/g
,
'OO'
)
const
maxByte
=
16
if
(
str
.
length
>
maxByte
)
{
message
.
error
(
`最多输入
${
maxByte
}
个字符,
${
Math
.
floor
(
maxByte
/
2
)}
个汉字`
);
return
}
}
if
(
result
.
dataInfo
.
describe
)
{
let
str
=
result
.
dataInfo
.
describe
str
=
str
.
replace
(
/
[\u
4e00-
\u
9fa5
]
/g
,
'OO'
)
const
maxByte
=
28
if
(
str
.
length
>
maxByte
)
{
message
.
error
(
`最多输入
${
maxByte
}
个字符,
${
Math
.
floor
(
maxByte
/
2
)}
个汉字`
);
return
}
}
changeProps
({
props
:
result
});
...
...
@@ -492,13 +528,13 @@ const PlatformGoods: React.FC<PlatformGoodsProps> = (props) => {
<
div
className=
{
styles
.
setting_line_addItem_line
}
>
<
div
className=
{
cx
(
styles
.
setting_line_addItem_line_label
,
styles
.
height32
)
}
>
分类名称:
</
div
>
<
div
className=
{
styles
.
setting_line_addItem_line_brief
}
>
<
Input
className=
{
styles
.
setting_line_addItem_input
}
value=
{
dataInfo
.
name
}
maxLength=
{
8
}
onChange=
{
(
e
)
=>
handleChangeForKey
(
e
.
target
.
value
,
'name'
)
}
/>
<
Input
className=
{
styles
.
setting_line_addItem_input
}
value=
{
dataInfo
.
name
}
onChange=
{
(
e
)
=>
handleChangeForKey
(
e
.
target
.
value
,
'name'
)
}
/>
</
div
>
</
div
>
<
div
className=
{
styles
.
setting_line_addItem_line
}
>
<
div
className=
{
cx
(
styles
.
setting_line_addItem_line_label
,
styles
.
height32
)
}
>
分类描述:
</
div
>
<
div
className=
{
styles
.
setting_line_addItem_line_brief
}
>
<
Input
className=
{
styles
.
setting_line_addItem_input
}
value=
{
dataInfo
.
describe
}
maxLength=
{
14
}
onChange=
{
(
e
)
=>
handleChangeForKey
(
e
.
target
.
value
,
'describe'
)
}
/>
<
Input
className=
{
styles
.
setting_line_addItem_input
}
value=
{
dataInfo
.
describe
}
onChange=
{
(
e
)
=>
handleChangeForKey
(
e
.
target
.
value
,
'describe'
)
}
/>
</
div
>
</
div
>
<
div
className=
{
styles
.
setting_line_addItem_line
}
>
...
...
src/pages/ruleSettingManage/procurementRules/addRule.tsx
View file @
d2523523
...
...
@@ -29,10 +29,6 @@ const AddRule:React.FC<{}> = (props) => {
const
formSubmit
=
async
(
values
)
=>
{
setIsDisabled
(
true
)
const
params
=
omit
(
values
,
[
'state'
])
params
.
baseProcessId
=
params
.
baseProcessId
[
0
]
console
.
log
(
params
,
'parmas'
)
// 切割memberId
let
res
:
any
=
{}
if
(
pageStatus
===
PageStatus
.
EDIT
){
res
=
await
PublicApi
.
postOrderPlatformPurchaseProcessUpdate
(
params
)
...
...
src/pages/ruleSettingManage/procurementRules/components/selectProcesss/index.tsx
View file @
d2523523
...
...
@@ -59,8 +59,10 @@ const SelectProcesss = (props: ISchemaFieldComponentProps) => {
})
const
modalRef
=
useRef
<
any
>
({})
const
{
dataSource
,
showMore
}
=
state
const
{
mutators
,
editable
}
=
props
const
value
:
number
[]
=
props
.
value
||
[]
const
{
value
,
mutators
,
editable
}
=
props
// @注释说明:多选变单选
// const { mutators, editable } = props
// const value: number[] = props.value || []
useEffect
(()
=>
{
PublicApi
.
getOrderPlatformPurchaseProcessBaseList
().
then
(
res
=>
{
...
...
@@ -74,26 +76,26 @@ const SelectProcesss = (props: ISchemaFieldComponentProps) => {
const
showDataSource
=
showMore
?
dataSource
:
[...
dataSource
].
splice
(
0
,
3
)
const
handleCheck
=
(
id
)
=>
{
// if (editable) {
// mutators.change(id)
// }
if
(
!
editable
)
{
return
false
}
if
(
value
.
includes
(
id
))
{
const
newValue
=
findItemAndDelete
(
value
,
id
)
mutators
.
change
(
newValue
)
}
else
{
mutators
.
change
([...
value
,
id
])
if
(
editable
)
{
mutators
.
change
(
id
)
}
}
// if (!editable) {
// return false
// }
// if (value.includes(id)) {
// const newValue = findItemAndDelete(value, id)
// mutators.change(newValue)
// } else {
// mutators.change([...value, id])
// }
const
isChecked
=
(
id
)
=>
{
return
value
.
includes
(
id
)
}
// const isChecked = (id) => {
// return value.includes(id)
// }
const
toogleMore
=
()
=>
{
setFieldState
({
dataSource
,
...
...
@@ -111,7 +113,8 @@ const SelectProcesss = (props: ISchemaFieldComponentProps) => {
<
div
style=
{
{
width
:
'100%'
}
}
>
<
SelectStyles
>
{
showDataSource
.
map
(
v
=>
<
div
key=
{
v
.
baseProcessid
}
onClick=
{
()
=>
handleCheck
(
v
.
baseProcessid
)
}
className=
{
cx
(
'select_style_border'
,
isChecked
(
v
.
baseProcessid
)
?
'active'
:
''
)
}
>
// showDataSource.map(v => <div key=
{
v
.
baseProcessid
}
onClick
=
{()
=>
handleCheck
(
v
.
baseProcessid
)}
className
=
{
cx
(
'select_style_border'
,
isChecked
(
v
.
baseProcessid
)
?
'active'
:
''
)}
>
showDataSource
.
map
(
v
=>
<
div
key=
{
v
.
baseProcessid
}
onClick=
{
()
=>
handleCheck
(
v
.
baseProcessid
)
}
className=
{
cx
(
'select_style_border'
,
value
===
v
.
baseProcessid
?
'active'
:
''
)
}
>
<
div
>
<
Row
style=
{
{
color
:
'#303133'
}
}
>
<
Col
>
{
v
.
processName
}
</
Col
>
...
...
src/pages/ruleSettingManage/procurementRules/schema/index.tsx
View file @
d2523523
...
...
@@ -46,7 +46,7 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
]
},
baseProcessId
:
{
type
:
'
array:
number'
,
type
:
'number'
,
title
:
'流程选择'
,
"x-component"
:
'SelectProcesss'
,
"x-mega-props"
:
{
...
...
src/pages/ruleSettingManage/transactionRules/addRule.tsx
View file @
d2523523
import
React
,
{
useState
,
useRef
,
useEffect
}
from
'react'
import
React
,
{
useState
}
from
'react'
import
{
history
}
from
'umi'
import
{
Button
,
Card
}
from
'antd'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
...
...
@@ -8,8 +8,8 @@ import {
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
'./index.less'
import
{
ruleDetailSchema
}
from
'./schema'
import
{
createFormActions
,
ISchema
,
FormEffectHooks
}
from
'@formily/antd'
import
{
findItemAndDelete
,
omit
}
from
'@/utils'
import
{
createFormActions
}
from
'@formily/antd'
import
{
omit
}
from
'@/utils'
import
{
PublicApi
}
from
'@/services/api'
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
import
RuleSetting
from
'./components/RuleSetting'
...
...
@@ -29,9 +29,7 @@ const AddRule:React.FC<{}> = (props) => {
const
formSubmit
=
async
(
values
)
=>
{
setIsDisabled
(
true
)
const
params
=
omit
(
values
,
[
'state'
])
params
.
baseProcessId
=
params
.
baseProcessId
[
0
]
// 切割memberId
console
.
log
(
values
,
'vvv'
)
let
res
:
any
=
{}
if
(
pageStatus
===
PageStatus
.
EDIT
){
res
=
await
PublicApi
.
postOrderPlatformTradeProcessUpdate
(
params
)
...
...
src/pages/ruleSettingManage/transactionRules/components/RuleSetting.tsx
View file @
d2523523
import
React
,
{
useEffect
,
useState
}
from
'react'
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
import
{
useInitValue
}
from
'@/formSchema/effects/useInitValue'
import
EyePreview
from
'@/components/EyePreview'
import
{
findItemAndDelete
}
from
'@/utils'
import
{
ISchemaFormActions
,
ISchema
,
FormEffectHooks
}
from
'@formily/antd'
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
import
{
createAddContractTemplateEffect
,
useUnitPreview
}
from
'../effects'
import
{
PublicApi
}
from
'@/services/api'
import
{
PlusOutlined
,
LinkOutlined
,
}
from
'@ant-design/icons'
import
{
Button
,
message
}
from
'antd'
import
{
PlusOutlined
}
from
'@ant-design/icons'
import
{
Button
}
from
'antd'
import
NiceForm
from
'@/components/NiceForm'
import
{
GlobalConfig
}
from
'@/global/config'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
SearchSelect
from
'@/components/NiceForm/components/SearchSelect'
import
Search
from
'@/components/NiceForm/components/Search'
...
...
src/pages/ruleSettingManage/transactionRules/components/selectProcesss/index.tsx
View file @
d2523523
...
...
@@ -59,8 +59,10 @@ const SelectProcesss = (props: ISchemaFieldComponentProps) => {
})
const
modalRef
=
useRef
<
any
>
({})
const
{
dataSource
,
showMore
}
=
state
const
{
mutators
,
editable
}
=
props
const
value
:
number
[]
=
props
.
value
||
[]
const
{
value
,
mutators
,
editable
}
=
props
// @注释说明:多选变单选
// const { mutators, editable } = props
// const value: number[] = props.value || []
useEffect
(()
=>
{
PublicApi
.
getOrderPlatformTradeProcessBaseList
().
then
(
res
=>
{
...
...
@@ -74,26 +76,27 @@ const SelectProcesss = (props: ISchemaFieldComponentProps) => {
const
showDataSource
=
showMore
?
dataSource
:
[...
dataSource
].
splice
(
0
,
3
)
const
handleCheck
=
(
id
)
=>
{
// if (editable) {
// mutators.change(id)
// }
if
(
!
editable
)
{
return
false
}
if
(
value
.
includes
(
id
))
{
const
newValue
=
findItemAndDelete
(
value
,
id
)
mutators
.
change
(
newValue
)
}
else
{
mutators
.
change
([...
value
,
id
])
console
.
log
(
id
,
'id'
)
if
(
editable
)
{
mutators
.
change
(
id
)
}
}
// if (!editable) {
// return false
// }
// if (value.includes(id)) {
// const newValue = findItemAndDelete(value, id)
// mutators.change(newValue)
// } else {
// mutators.change([...value, id])
// }
const
isChecked
=
(
id
)
=>
{
return
value
.
includes
(
id
)
}
// const isChecked = (id) => {
// return value.includes(id)
// }
const
toogleMore
=
()
=>
{
setFieldState
({
dataSource
,
...
...
@@ -111,7 +114,8 @@ const SelectProcesss = (props: ISchemaFieldComponentProps) => {
<
div
style=
{
{
width
:
'100%'
}
}
>
<
SelectStyles
>
{
showDataSource
.
map
(
v
=>
<
div
key=
{
v
.
baseProcessid
}
onClick=
{
()
=>
handleCheck
(
v
.
baseProcessid
)
}
className=
{
cx
(
'select_style_border'
,
isChecked
(
v
.
baseProcessid
)
?
'active'
:
''
)
}
>
// showDataSource.map(v => <div key=
{
v
.
baseProcessid
}
onClick
=
{()
=>
handleCheck
(
v
.
baseProcessid
)}
className
=
{
cx
(
'select_style_border'
,
isChecked
(
v
.
baseProcessid
)
?
'active'
:
''
)}
>
showDataSource
.
map
(
v
=>
<
div
key=
{
v
.
baseProcessid
}
onClick=
{
()
=>
handleCheck
(
v
.
baseProcessid
)
}
className=
{
cx
(
'select_style_border'
,
value
===
v
.
baseProcessid
?
'active'
:
''
)
}
>
<
div
>
<
Row
style=
{
{
color
:
'#303133'
}
}
>
<
Col
>
{
v
.
processName
}
</
Col
>
...
...
src/pages/ruleSettingManage/transactionRules/index.tsx
View file @
d2523523
...
...
@@ -73,7 +73,7 @@ const TransactionRules: React.FC<{}> = () => {
>
<
Button
type=
"link"
style=
{
record
.
status
?
{
color
:
'#00B37A'
}
:
{
color
:
'red'
}
}
>
{
record
.
stat
e
?
<>
有效
<
PlayCircleOutlined
/></>
:
<>
无效
<
PauseCircleOutlined
/></>
}
</
Button
>
style=
{
record
.
status
?
{
color
:
'#00B37A'
}
:
{
color
:
'red'
}
}
>
{
record
.
stat
us
?
<>
有效
<
PlayCircleOutlined
/></>
:
<>
无效
<
PauseCircleOutlined
/></>
}
</
Button
>
</
Popconfirm
>
)
return
component
...
...
src/pages/ruleSettingManage/transactionRules/schema/index.tsx
View file @
d2523523
...
...
@@ -46,9 +46,8 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
]
},
baseProcessId
:
{
type
:
'
array:
number'
,
type
:
'number'
,
title
:
'流程选择'
,
"x-component"
:
'SelectProcesss'
,
"x-mega-props"
:
{
style
:
{
...
...
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