Commit a12a97ba authored by TZW's avatar TZW

1115

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