Commit a12a97ba authored by TZW's avatar TZW

1115

parent 33e12f4e
...@@ -2,16 +2,20 @@ ...@@ -2,16 +2,20 @@
* @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: 2022-11-14 15:52:12 * @Last Modified time: 2022-11-15 13:29:58
*/ */
import * as React from 'react'; import * as React from 'react';
import { useState, useMemo, useRef } from 'react'; import { useState, useMemo, useRef } from 'react';
import DrawerPro from '@/components/DrawerPro'; import DrawerPro from '@/components/DrawerPro';
import AutoTable from '@/components/AutoTable'; import AutoTable from '@/components/AutoTable';
import PremButton from '@/components/PremButton'; import PremButton from '@/components/PremButton';
import getcolumns from './columns'; import getcolumns from './columns';
import TreeRender from '@/components/TreeRender';
import { Layout } from 'antd';
const { Sider, Content } = Layout;
function Account(props) { function Account(props) {
const actionRef = useRef(), const actionRef = useRef(),
formRef = useRef(); formRef = useRef();
...@@ -100,30 +104,44 @@ function Account(props) { ...@@ -100,30 +104,44 @@ function Account(props) {
return ( return (
<div style={{ position: 'relative' }}> <div style={{ position: 'relative' }}>
<AutoTable <div className="ant-card-head">
pagetitle="设备台账" <div className="ant-card-head-wrapper">
columns={columns} <div className="ant-card-head-title">
path="/ngic-auth/sysUser/query/page" <h3 className="page-title">设备台账</h3>
actionRef={actionRef} </div>
pageextra={'add'} </div>
resizeable={true} </div>
addconfig={{ <Layout style={{ height: '100%' }}>
// access: 'sysDepartment_save', <Sider theme="light" width={300}>
btn: { <TreeRender />
disabled: false, </Sider>
onClick: () => { <Content>
setdrawer((s) => ({ <AutoTable
...s, pagetitle={<h3 style={{ marginBottom: 0, fontWeight: 400 }}>设备台账</h3>}
visible: true, columns={columns}
item: null, path="/ngic-auth/sysUser/query/page"
title: '新增', actionRef={actionRef}
val: 'add', pageextra={'add'}
})); resizeable={true}
}, addconfig={{
}, // access: 'sysDepartment_save',
}} btn: {
/> disabled: false,
type: 'primary',
onClick: () => {
setdrawer((s) => ({
...s,
visible: true,
item: null,
title: '新增',
val: 'add',
}));
},
},
}}
/>
</Content>
</Layout>
<DrawerPro <DrawerPro
fields={columns} fields={columns}
detailpath="/ngic-auth/sysUser/query/detail" detailpath="/ngic-auth/sysUser/query/detail"
......
...@@ -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-15 09:50:49 * @Last Modified time: 2022-11-15 10:13:24
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -174,9 +174,13 @@ function Type(props) { ...@@ -174,9 +174,13 @@ function Type(props) {
}; };
const columns = useMemo(() => { const columns = useMemo(() => {
// console.log(drawer);
// if(drawer?.val == 'edit')
let defcolumn = getcolumns(setDrawer); let defcolumn = getcolumns(setDrawer);
console.log(drawer);
if (drawer?.val == 'add' || drawer?.val == 'edit') {
defcolumn[1].hideInForm = true;
} else {
defcolumn[1].hideInForm = false;
}
return defcolumn.concat({ return defcolumn.concat({
title: '操作', title: '操作',
valueType: 'option', valueType: 'option',
......
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