Commit da36dfaf authored by 田翔's avatar 田翔

fix: 代码完善

parent 6fb603f9
Pipeline #85317 passed with stages
...@@ -17,6 +17,7 @@ import { ...@@ -17,6 +17,7 @@ import {
Row, Row,
Col, Col,
Switch, Switch,
Checkbox,
} from 'antd'; } from 'antd';
import { PlusOutlined, InfoCircleOutlined, EyeOutlined } from '@ant-design/icons'; import { PlusOutlined, InfoCircleOutlined, EyeOutlined } from '@ant-design/icons';
import { LoadEventFields } from '@/services/tablemanager/tablemanager'; import { LoadEventFields } from '@/services/tablemanager/tablemanager';
...@@ -74,6 +75,7 @@ const BookConfigNew = props => { ...@@ -74,6 +75,7 @@ const BookConfigNew = props => {
const [parentData, setParentData] = useState([]); // 父级台账下拉框数据 const [parentData, setParentData] = useState([]); // 父级台账下拉框数据
const [currentId, setCurrentId] = useState(''); // 新增成功后保存的ID const [currentId, setCurrentId] = useState(''); // 新增成功后保存的ID
const [EnableImportExport, setEnableImportExport] = useState(false) //是否导入导出 const [EnableImportExport, setEnableImportExport] = useState(false) //是否导入导出
const [EnableSiteFilter, setEnableSiteFilter] = useState(false) //是否站点过滤
const [form] = Form.useForm(); const [form] = Form.useForm();
const tableRef = useRef(null); const tableRef = useRef(null);
const accountRef = useRef(null); const accountRef = useRef(null);
...@@ -251,6 +253,7 @@ const BookConfigNew = props => { ...@@ -251,6 +253,7 @@ const BookConfigNew = props => {
if (res.code === 0) { if (res.code === 0) {
form.setFieldsValue({ ...res.data }); form.setFieldsValue({ ...res.data });
setEnableImportExport(res.data.EnableImportExport) setEnableImportExport(res.data.EnableImportExport)
setEnableSiteFilter(res.data.EnableSiteFilter)
setOrder(res.data.Order); setOrder(res.data.Order);
let editArr = res.data.LedgerFieids; let editArr = res.data.LedgerFieids;
changTable(res.data.TableName, editArr); changTable(res.data.TableName, editArr);
...@@ -267,6 +270,8 @@ const BookConfigNew = props => { ...@@ -267,6 +270,8 @@ const BookConfigNew = props => {
Type: (!pickItem1 || pickItem1 == '全部') ? data[0] : pickItem1, Type: (!pickItem1 || pickItem1 == '全部') ? data[0] : pickItem1,
PageSize: 20 PageSize: 20
}) })
setEnableImportExport(true)
setEnableSiteFilter(false)
} }
getParentData({ ledgerId: type === 'edit' ? formObj.ID : '0' }); getParentData({ ledgerId: type === 'edit' ? formObj.ID : '0' });
} else { } else {
...@@ -618,6 +623,12 @@ const BookConfigNew = props => { ...@@ -618,6 +623,12 @@ const BookConfigNew = props => {
if ('EnableImportExport' in changedValues) { if ('EnableImportExport' in changedValues) {
setEnableImportExport(changedValues['EnableImportExport']) setEnableImportExport(changedValues['EnableImportExport'])
} }
if ('EnableSiteFilter' in changedValues) {
setEnableSiteFilter(changedValues['EnableSiteFilter'])
if (!changedValues['EnableSiteFilter']) {
form.setFieldsValue({ EnableSiteIDFilter: false })
}
}
}; };
return ( return (
...@@ -772,15 +783,8 @@ const BookConfigNew = props => { ...@@ -772,15 +783,8 @@ const BookConfigNew = props => {
<Input placeholder="服务项目dll库" allowClear /> <Input placeholder="服务项目dll库" allowClear />
</Item> </Item>
</Col> </Col>
<Col span={5}> </Row>
<Form.Item <Row style={{ marginLeft: '40px' }}>
{...switchLayout}
label="分页默认数量"
name="PageSize"
>
<Select style={{ width: 150 }} options={pagingOptions} />
</Form.Item>
</Col>
<Col span={2}> <Col span={2}>
<Form.Item <Form.Item
{...switchLayout} {...switchLayout}
...@@ -792,7 +796,7 @@ const BookConfigNew = props => { ...@@ -792,7 +796,7 @@ const BookConfigNew = props => {
<Switch checkedChildren="是" unCheckedChildren="否" /> <Switch checkedChildren="是" unCheckedChildren="否" />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={4}> <Col span={6} style={{ position: 'relative', left: '-28px' }}>
<Form.Item <Form.Item
{...switchLayout} {...switchLayout}
label="导出模板名称" label="导出模板名称"
...@@ -801,6 +805,15 @@ const BookConfigNew = props => { ...@@ -801,6 +805,15 @@ const BookConfigNew = props => {
<Input disabled={!EnableImportExport} placeholder='请输入导出模板名称' /> <Input disabled={!EnableImportExport} placeholder='请输入导出模板名称' />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={4}>
<Form.Item
{...switchLayout}
label="分页默认数量"
name="PageSize"
>
<Select style={{ width: 150 }} options={pagingOptions} />
</Form.Item>
</Col>
<Col span={3}> <Col span={3}>
<Form.Item <Form.Item
{...switchLayout} {...switchLayout}
...@@ -815,8 +828,8 @@ const BookConfigNew = props => { ...@@ -815,8 +828,8 @@ const BookConfigNew = props => {
<Form.Item <Form.Item
{...switchLayout} {...switchLayout}
valuePropName="checked" valuePropName="checked"
label="站点过滤" label="批量操作"
name="EnableSiteFilter" name="EnableBatchOperation"
> >
<Switch checkedChildren="是" unCheckedChildren="否" /> <Switch checkedChildren="是" unCheckedChildren="否" />
</Form.Item> </Form.Item>
...@@ -825,20 +838,25 @@ const BookConfigNew = props => { ...@@ -825,20 +838,25 @@ const BookConfigNew = props => {
<Form.Item <Form.Item
{...switchLayout} {...switchLayout}
valuePropName="checked" valuePropName="checked"
label="站点ID过滤" label="站点过滤"
name="EnableSiteIDFilter" name="EnableSiteFilter"
> >
<Switch checkedChildren="是" unCheckedChildren="否" /> <Switch checkedChildren="是" unCheckedChildren="否" />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={3}> <Col span={3} style={{ display: EnableSiteFilter ? 'block' : 'none' }}>
<Form.Item <Form.Item
{...switchLayout} {...switchLayout}
valuePropName="checked" valuePropName="checked"
label="批量操作" label=""
name="EnableBatchOperation" name="EnableSiteIDFilter"
> >
<Switch checkedChildren="是" unCheckedChildren="否" /> <Checkbox
value={true}
style={{ lineHeight: '32px' }}
>
站点ID过滤
</Checkbox>
</Form.Item> </Form.Item>
</Col> </Col>
{/* <Col span={4}> {/* <Col span={4}>
......
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