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
cede7f9c
Commit
cede7f9c
authored
Nov 14, 2022
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11141510
parent
a25bf5e8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
10 deletions
+46
-10
columns.js
src/pages/device/type/columns.js
+22
-0
index.jsx
src/pages/device/type/index.jsx
+24
-10
No files found.
src/pages/device/type/columns.js
View file @
cede7f9c
...
...
@@ -14,6 +14,27 @@ function getcolumns(setdrawer) {
],
},
},
{
title
:
'上级类型'
,
// dataIndex: 'parentId',
dataIndex
:
'parentKey'
,
key
:
'parentKey'
,
hideInTable
:
true
,
// hideInForm: true,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
},
fieldProps
:
{
placeholder
:
'请输入'
,
disabled
:
true
,
},
search
:
false
,
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
...
...
@@ -25,6 +46,7 @@ function getcolumns(setdrawer) {
},
],
},
search
:
false
,
},
];
...
...
src/pages/device/type/index.jsx
View file @
cede7f9c
...
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-14 1
3:31:02
* @Last Modified time: 2022-11-14 1
4:19:53
*/
import
*
as
React
from
'react'
;
...
...
@@ -60,16 +60,21 @@ function Type(props) {
setDrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
detailpath
:
urlParams
.
detail
,
params
:
{
id
:
drawer
?.
item
?.
id
},
detailpath
:
null
,
item
:
{
title
:
row
.
title
,
remark
:
row
.
remark
,
},
title
:
'编辑'
,
val
:
'edit'
,
onFinish
:
async
(
vals
)
=>
{
console
.
log
(
1
);
let
params
=
{
...
vals
,
id
:
row
.
id
,
id
:
row
.
key
,
parentId
:
row
.
parentKey
,
};
console
.
log
(
params
);
let
res
=
await
doFetch
({
url
:
urlParams
.
save
,
params
,
...
...
@@ -84,6 +89,7 @@ function Type(props) {
}
},
}));
console
.
log
(
row
);
},
}
}
>
...
...
@@ -102,21 +108,27 @@ function Type(props) {
...
s
,
visible
:
true
,
detailpath
:
null
,
// params:
{
id
:
drawer
?.
item
?.
id
},
item
:
{
parentKey
:
row
.
title
,
},
title
:
'新增子级'
,
val
:
'add'
,
onFinish
:
async
(
vals
)
=>
{
console
.
log
(
1
);
let
params
=
{
...
vals
,
id
:
row
.
id
,
parentId
:
row
.
key
,
equipmentTypeName
:
vals
.
title
,
};
delete
params
.
title
;
delete
params
.
parentKey
;
console
.
log
(
params
);
let
res
=
await
doFetch
({
url
:
urlParams
.
save
,
params
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'
编辑
成功!'
);
message
.
success
(
'
新增子级
成功!'
);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
...
...
@@ -125,6 +137,7 @@ function Type(props) {
}
},
}));
console
.
log
(
drawer
.
item
);
},
}
}
>
...
...
@@ -137,11 +150,11 @@ function Type(props) {
return
(
<
PremButton
pop=
{
{
title
:
'是否删除该
供应商
?'
,
title
:
'是否删除该
设备类型
?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
async
()
=>
{
let
res
=
await
doFetch
({
url
:
urlParams
.
remove
,
params
:
{
id
:
row
.
id
}
});
let
res
=
await
doFetch
({
url
:
urlParams
.
remove
,
params
:
{
id
:
row
.
key
}
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'删除成功!'
);
setDrawer
((
s
)
=>
({
...
...
@@ -201,8 +214,9 @@ function Type(props) {
let
params
=
{
...
vals
,
parentId
:
0
,
equipmentTypeName
:
vals
.
equipmentTypeName
:
vals
.
title
,
};
delete
params
.
title
;
let
res
=
await
doFetch
({
url
:
urlParams
.
save
,
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