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
b674812c
Commit
b674812c
authored
2 years ago
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
7d3039fe
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
26 deletions
+18
-26
columns.js
src/pages/system/field/columns.js
+1
-0
index.jsx
src/pages/system/field/index.jsx
+17
-26
No files found.
src/pages/system/field/columns.js
View file @
b674812c
...
@@ -136,6 +136,7 @@ function getcolumns(ifs) {
...
@@ -136,6 +136,7 @@ function getcolumns(ifs) {
],
],
},
},
search
:
false
,
search
:
false
,
precision
:
0
,
},
},
];
];
}
}
...
...
This diff is collapsed.
Click to expand it.
src/pages/system/field/index.jsx
View file @
b674812c
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Author: Li Hanlin
* @Date: 2022-11-10 09:39:56
* @Date: 2022-11-10 09:39:56
* @Last Modified by: Li Hanlin
* @Last Modified by: Li Hanlin
* @Last Modified time: 202
2-12-19 11:25:5
3
* @Last Modified time: 202
3-01-13 17:07:0
3
*/
*/
import
*
as
React
from
'react'
;
import
*
as
React
from
'react'
;
...
@@ -26,7 +26,6 @@ function Field(props) {
...
@@ -26,7 +26,6 @@ function Field(props) {
visible
:
false
,
visible
:
false
,
}),
}),
[
items
,
setitems
]
=
useState
([]),
[
items
,
setitems
]
=
useState
([]),
[
extraparams
,
setextraparams
]
=
useState
({}),
urlParams
=
{
urlParams
=
{
save
:
'/base/paFormField/save'
,
save
:
'/base/paFormField/save'
,
remove
:
'/base/paFormField/delete'
,
remove
:
'/base/paFormField/delete'
,
...
@@ -43,7 +42,7 @@ function Field(props) {
...
@@ -43,7 +42,7 @@ function Field(props) {
});
});
//console.log(result);
//console.log(result);
if
(
!
result
?.
data
?.
dataList
.
length
==
0
)
{
if
(
!
result
?.
data
?.
dataList
.
length
==
0
)
{
setitems
(
await
setitems
(
result
?.
data
?.
dataList
.
map
((
it
,
index
)
=>
{
result
?.
data
?.
dataList
.
map
((
it
,
index
)
=>
{
return
{
return
{
key
:
it
.
id
,
key
:
it
.
id
,
...
@@ -51,7 +50,7 @@ function Field(props) {
...
@@ -51,7 +50,7 @@ function Field(props) {
};
};
}),
}),
);
);
setDrawer
((
s
)
=>
({
await
setDrawer
((
s
)
=>
({
...
s
,
...
s
,
formName
:
result
?.
data
?.
dataList
[
0
]?.
formName
,
formName
:
result
?.
data
?.
dataList
[
0
]?.
formName
,
formId
:
result
?.
data
?.
dataList
[
0
]?.
id
,
formId
:
result
?.
data
?.
dataList
[
0
]?.
id
,
...
@@ -60,41 +59,42 @@ function Field(props) {
...
@@ -60,41 +59,42 @@ function Field(props) {
};
};
fn
();
fn
();
},
[]);
},
[]);
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
return
(
<
PremButton
<
PremButton
btn=
{
{
btn=
{
{
size
:
'small'
,
size
:
'small'
,
onClick
:
()
=>
{
onClick
:
()
=>
{
console
.
log
(
drawer
);
setDrawer
((
s
)
=>
({
setDrawer
((
s
)
=>
({
...
s
,
...
s
,
visible
:
true
,
visible
:
true
,
title
:
'编辑'
,
title
:
'编辑'
,
fields
:
getcolumns
(
true
),
val
:
'edit'
,
// detailpath: urlParams.detail,
// params:
{
id
:
row
.
id
},
item
:
{
item
:
{
...
row
,
...
row
,
formName
:
s
?.
formName
,
fieldChar
:
String
(
row
?.
fieldChar
),
fieldChar
:
String
(
row
?.
fieldChar
),
formName
:
drawer
?.
formName
,
// formId: s?.formId,
formId
:
drawer
?.
formId
,
},
},
fields
:
getcolumns
(
true
),
val
:
'edit'
,
// detailpath: urlParams.detail,
// params:
{
id
:
row
.
id
},
onFinish
:
async
(
vals
)
=>
{
onFinish
:
async
(
vals
)
=>
{
//
console.log(vals);
console
.
log
(
vals
);
let
params
=
{
let
params
=
{
...
vals
,
...
vals
,
id
:
row
.
id
,
id
:
row
?
.
id
,
formId
:
drawer
?.
formId
,
formId
:
drawer
?.
formId
,
};
};
delete
params
.
formName
;
delete
params
.
formName
;
console
.
log
(
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
,
...
@@ -142,14 +142,13 @@ function Field(props) {
...
@@ -142,14 +142,13 @@ function Field(props) {
const
columns
=
useMemo
(()
=>
{
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setDrawer
);
let
defcolumn
=
getcolumns
(
setDrawer
);
return
defcolumn
.
concat
({
return
defcolumn
.
concat
({
title
:
'操作'
,
title
:
'操作'
,
valueType
:
'option'
,
valueType
:
'option'
,
width
:
200
,
width
:
200
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
)],
render
:
(
text
,
row
,
_
,
action
)
=>
[
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
)],
});
});
},
[]);
},
[
drawer
?.
formId
]);
return
(
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
div
style=
{
{
position
:
'relative'
}
}
>
...
@@ -175,11 +174,7 @@ function Field(props) {
...
@@ -175,11 +174,7 @@ function Field(props) {
</
h3
>
</
h3
>
<
Menu
<
Menu
onClick=
{
async
(
e
)
=>
{
onClick=
{
async
(
e
)
=>
{
// //console.log(e);
await
setDrawer
((
s
)
=>
({
setextraparams
({
formId
:
e
?.
key
,
});
setDrawer
((
s
)
=>
({
...
s
,
...
s
,
formName
:
items
.
filter
((
it
)
=>
it
?.
key
==
e
?.
key
)[
0
].
label
,
formName
:
items
.
filter
((
it
)
=>
it
?.
key
==
e
?.
key
)[
0
].
label
,
formId
:
e
?.
key
,
formId
:
e
?.
key
,
...
@@ -199,7 +194,7 @@ function Field(props) {
...
@@ -199,7 +194,7 @@ function Field(props) {
pagetitle=
{
<
h3
style=
{
{
marginBottom
:
0
,
fontWeight
:
400
}
}
>
字段信息
</
h3
>
}
pagetitle=
{
<
h3
style=
{
{
marginBottom
:
0
,
fontWeight
:
400
}
}
>
字段信息
</
h3
>
}
columns=
{
columns
}
columns=
{
columns
}
path=
{
urlParams
.
list
}
path=
{
urlParams
.
list
}
params=
{
{
formId
:
'1'
}
}
extraparams=
{
{
formId
:
drawer
?.
formId
}
}
actionRef=
{
actionRef
}
actionRef=
{
actionRef
}
pageextra=
{
'add'
}
pageextra=
{
'add'
}
resizeable=
{
false
}
resizeable=
{
false
}
...
@@ -246,7 +241,6 @@ function Field(props) {
...
@@ -246,7 +241,6 @@ function Field(props) {
},
},
}
}
}
}
// x={1500}
// x={1500}
extraparams=
{
extraparams
}
/>
/>
</
Content
>
</
Content
>
</
Layout
>
</
Layout
>
...
@@ -259,9 +253,6 @@ function Field(props) {
...
@@ -259,9 +253,6 @@ function Field(props) {
setDrawer
((
s
)
=>
({
setDrawer
((
s
)
=>
({
...
s
,
...
s
,
visible
:
false
,
visible
:
false
,
item
:
null
,
detailpath
:
null
,
params
:
null
,
}));
}));
}
}
}
}
{
...
drawer
}
{
...
drawer
}
...
...
This diff is collapsed.
Click to expand it.
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