Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ems3.3
Project
Project
Details
Activity
Releases
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
wuhao
ems3.3
Commits
bec6748f
Commit
bec6748f
authored
Dec 14, 2022
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qwe
parent
526cfa36
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
12 deletions
+35
-12
FormItems.jsx
src/components/InitForm/FormItems.jsx
+1
-0
index.jsx
src/pages/system/rules/index.jsx
+34
-12
No files found.
src/components/InitForm/FormItems.jsx
View file @
bec6748f
...
@@ -1314,6 +1314,7 @@ function Diyrules({ item, colProps, formRef }) {
...
@@ -1314,6 +1314,7 @@ function Diyrules({ item, colProps, formRef }) {
<
Col
{
...
col
}
>
<
Col
{
...
col
}
>
<
ProForm
.
Item
<
ProForm
.
Item
convertValue=
{
(
value
)
=>
{
convertValue=
{
(
value
)
=>
{
console
.
log
(
value
);
if
(
value
?.
other
)
return
value
;
if
(
value
?.
other
)
return
value
;
let
nrList
=
{
let
nrList
=
{
other
:
{},
other
:
{},
...
...
src/pages/system/rules/index.jsx
View file @
bec6748f
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-14 1
6:38:10
* @Last Modified time: 2022-12-14 1
8:27:22
*/
*/
import
*
as
React
from
'react'
;
import
*
as
React
from
'react'
;
...
@@ -14,6 +14,7 @@ import getcolumns from './columns';
...
@@ -14,6 +14,7 @@ import getcolumns from './columns';
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
message
}
from
'antd'
;
import
{
message
}
from
'antd'
;
import
AddRules
from
'./AddRules'
;
import
AddRules
from
'./AddRules'
;
import
_
from
'lodash'
;
function
Rules
(
props
)
{
function
Rules
(
props
)
{
const
actionRef
=
useRef
(),
const
actionRef
=
useRef
(),
...
@@ -51,7 +52,7 @@ function Rules(props) {
...
@@ -51,7 +52,7 @@ function Rules(props) {
);
);
};
};
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
const
edit
=
(
text
,
row
,
i
,
action
)
=>
{
return
(
return
(
<
PremButton
<
PremButton
btn=
{
{
btn=
{
{
...
@@ -65,16 +66,40 @@ function Rules(props) {
...
@@ -65,16 +66,40 @@ function Rules(props) {
title
:
'编辑'
,
title
:
'编辑'
,
val
:
'edit'
,
val
:
'edit'
,
onFinish
:
async
(
vals
)
=>
{
onFinish
:
async
(
vals
)
=>
{
let
params
=
{
vals
.
nrList
.
other
=
_
.
pick
(
vals
.
nrList
.
other
,
[
...
vals
,
'formatType'
,
id
:
row
.
id
,
'increaseList'
,
};
'noRuleCode'
,
'sort'
,
]);
vals
.
nrList
.
value
=
vals
.
nrList
.
value
.
map
((
it
)
=>
{
return
_
.
pick
(
it
,
[
'id'
,
'noContent'
,
'noRuleCode'
,
'sort'
,
'paramList'
]);
});
console
.
log
(
'1214'
,
vals
);
let
params
=
{
...
vals
};
params
.
nrList
=
[];
params
.
nrList
=
params
.
nrList
.
concat
(
vals
?.
nrList
.
value
);
if
(
vals
?.
nrList
.
other
.
sort
)
{
vals
.
nrList
.
other
.
increaseList
=
Array
.
from
(
Array
(
vals
?.
nrList
.
value
.
length
+
1
),
(
_
,
index
)
=>
index
+
1
,
).
filter
((
it
)
=>
it
!==
vals
?.
nrList
.
other
.
sort
+
1
);
params
.
nrList
.
splice
(
vals
?.
nrList
.
other
.
sort
,
0
,
vals
?.
nrList
.
other
);
params
.
nrList
.
forEach
((
it
,
i
)
=>
{
it
.
sort
=
i
+
1
;
});
}
else
{
message
.
warning
(
'请选择顺序递增规则的位置!'
);
return
;
}
params
.
id
=
row
?.
id
;
console
.
log
(
'11111'
,
params
);
let
res
=
await
doFetch
({
let
res
=
await
doFetch
({
url
:
urlParams
.
save
,
url
:
urlParams
.
save
,
params
,
params
,
});
});
if
(
res
.
code
===
'0000'
)
{
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'
新增
成功!'
);
message
.
success
(
'
编辑
成功!'
);
setDrawer
((
s
)
=>
({
setDrawer
((
s
)
=>
({
...
s
,
...
s
,
visible
:
false
,
visible
:
false
,
...
@@ -154,10 +179,8 @@ function Rules(props) {
...
@@ -154,10 +179,8 @@ function Rules(props) {
title
:
'新增'
,
title
:
'新增'
,
val
:
'add'
,
val
:
'add'
,
onFinish
:
async
(
vals
)
=>
{
onFinish
:
async
(
vals
)
=>
{
console
.
log
(
'vals:'
,
vals
);
console
.
log
(
'myvals:'
,
vals
);
let
params
=
{
let
params
=
{
...
vals
};
...
vals
,
};
//console.log('vals:', vals);
//console.log('vals:', vals);
// for (let i in vals)
{
// for (let i in vals)
{
// if (i == 'nrList')
{
// if (i == 'nrList')
{
...
@@ -188,7 +211,6 @@ function Rules(props) {
...
@@ -188,7 +211,6 @@ function Rules(props) {
message
.
warning
(
'请选择顺序递增规则的位置!'
);
message
.
warning
(
'请选择顺序递增规则的位置!'
);
return
;
return
;
}
}
//console.log('11111', params);
let
res
=
await
doFetch
({
let
res
=
await
doFetch
({
url
:
urlParams
.
save
,
url
:
urlParams
.
save
,
params
,
params
,
...
...
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