Commit cede7f9c authored by TZW's avatar TZW

11141510

parent a25bf5e8
...@@ -14,6 +14,27 @@ function getcolumns(setdrawer) { ...@@ -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: '备注', title: '备注',
dataIndex: 'remark', dataIndex: 'remark',
...@@ -25,6 +46,7 @@ function getcolumns(setdrawer) { ...@@ -25,6 +46,7 @@ function getcolumns(setdrawer) {
}, },
], ],
}, },
search: false, search: false,
}, },
]; ];
......
...@@ -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-11-14 13:31:02 * @Last Modified time: 2022-11-14 14:19:53
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -60,16 +60,21 @@ function Type(props) { ...@@ -60,16 +60,21 @@ function Type(props) {
setDrawer((s) => ({ setDrawer((s) => ({
...s, ...s,
visible: true, visible: true,
detailpath: urlParams.detail, detailpath: null,
params: { id: drawer?.item?.id }, item: {
title: row.title,
remark: row.remark,
},
title: '编辑', title: '编辑',
val: 'edit', val: 'edit',
onFinish: async (vals) => { onFinish: async (vals) => {
console.log(1); console.log(1);
let params = { let params = {
...vals, ...vals,
id: row.id, id: row.key,
parentId: row.parentKey,
}; };
console.log(params);
let res = await doFetch({ let res = await doFetch({
url: urlParams.save, url: urlParams.save,
params, params,
...@@ -84,6 +89,7 @@ function Type(props) { ...@@ -84,6 +89,7 @@ function Type(props) {
} }
}, },
})); }));
console.log(row);
}, },
}} }}
> >
...@@ -102,21 +108,27 @@ function Type(props) { ...@@ -102,21 +108,27 @@ function Type(props) {
...s, ...s,
visible: true, visible: true,
detailpath: null, detailpath: null,
// params: { id: drawer?.item?.id }, item: {
parentKey: row.title,
},
title: '新增子级', title: '新增子级',
val: 'add', val: 'add',
onFinish: async (vals) => { onFinish: async (vals) => {
console.log(1); console.log(1);
let params = { let params = {
...vals, ...vals,
id: row.id, parentId: row.key,
equipmentTypeName: vals.title,
}; };
delete params.title;
delete params.parentKey;
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,
...@@ -125,6 +137,7 @@ function Type(props) { ...@@ -125,6 +137,7 @@ function Type(props) {
} }
}, },
})); }));
console.log(drawer.item);
}, },
}} }}
> >
...@@ -137,11 +150,11 @@ function Type(props) { ...@@ -137,11 +150,11 @@ function Type(props) {
return ( return (
<PremButton <PremButton
pop={{ pop={{
title: '是否删除该供应商?', title: '是否删除该设备类型?',
okText: '确认', okText: '确认',
cancelText: '取消', cancelText: '取消',
onConfirm: async () => { 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') { if (res.code === '0000') {
message.success('删除成功!'); message.success('删除成功!');
setDrawer((s) => ({ setDrawer((s) => ({
...@@ -201,8 +214,9 @@ function Type(props) { ...@@ -201,8 +214,9 @@ function Type(props) {
let params = { let params = {
...vals, ...vals,
parentId: 0, parentId: 0,
equipmentTypeName: vals. equipmentTypeName: vals.title,
}; };
delete params.title;
let res = await doFetch({ let res = await doFetch({
url: urlParams.save, url: urlParams.save,
params, params,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment