Commit 09a3c2fb authored by TZW's avatar TZW

1114

parent 522e0a76
...@@ -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 10:00:16 * @Last Modified time: 2022-11-14 10:39:38
*/ */
import * as React from 'react'; import * as React from 'react';
......
...@@ -4,13 +4,15 @@ function getcolumns(setdrawer) { ...@@ -4,13 +4,15 @@ function getcolumns(setdrawer) {
title: '设备类型', title: '设备类型',
dataIndex: 'title', dataIndex: 'title',
key: 'title', key: 'title',
hideInForm: { search: false,
accountName: { formItemProps: {
reverse: ['1', '2', '5'], rules: [
{
required: true,
message: '此项为必填项',
}, },
remark: ['3'], ],
}, },
search: false,
}, },
{ {
title: '备注', title: '备注',
......
...@@ -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-11 11:15:50 * @Last Modified time: 2022-11-14 13:31:02
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -92,6 +92,47 @@ function Type(props) { ...@@ -92,6 +92,47 @@ function Type(props) {
); );
}; };
const addChild = (text, row, _, action) => {
return (
<PremButton
btn={{
size: 'small',
onClick: () => {
setDrawer((s) => ({
...s,
visible: true,
detailpath: null,
// params: { id: drawer?.item?.id },
title: '新增子级',
val: 'add',
onFinish: async (vals) => {
console.log(1);
let params = {
...vals,
id: row.id,
};
let res = await doFetch({
url: urlParams.save,
params,
});
if (res.code === '0000') {
message.success('编辑成功!');
setDrawer((s) => ({
...s,
visible: false,
}));
actionRef.current.reload();
}
},
}));
},
}}
>
新增子级
</PremButton>
);
};
const remove = (text, row, _, action) => { const remove = (text, row, _, action) => {
return ( return (
<PremButton <PremButton
...@@ -127,7 +168,11 @@ function Type(props) { ...@@ -127,7 +168,11 @@ function Type(props) {
title: '操作', title: '操作',
valueType: 'option', valueType: 'option',
width: 150, width: 150,
render: (text, row, _, action) => [edit(text, row, _, action), remove(text, row, _, action)], render: (text, row, _, action) => [
addChild(text, row, _, action),
edit(text, row, _, action),
remove(text, row, _, action),
],
}); });
}, []); }, []);
...@@ -155,6 +200,8 @@ function Type(props) { ...@@ -155,6 +200,8 @@ function Type(props) {
onFinish: async (vals) => { onFinish: async (vals) => {
let params = { let params = {
...vals, ...vals,
parentId: 0,
equipmentTypeName: vals.
}; };
let res = await doFetch({ let res = await doFetch({
url: urlParams.save, url: urlParams.save,
...@@ -173,6 +220,7 @@ function Type(props) { ...@@ -173,6 +220,7 @@ function Type(props) {
}, },
}, },
}} }}
pagination={false}
/> />
<DrawerPro <DrawerPro
......
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