Commit 9b753402 authored by 田翔's avatar 田翔

fix: 增加分页配置

parent a747718d
Pipeline #84926 passed with stages
......@@ -33,6 +33,14 @@ import ChangeAdd from './changeAdd';
import EditTable from './EditTable';
import styles from './BookConfigNew.less';
const pagingOptions = [
{ label: '20条/页', value: 20 },
{ label: '50条/页', value: 50 },
{ label: '100条/页', value: 100 },
{ label: '200条/页', value: 200 },
{ label: '500条/页', value: 500 },
]
const { Option } = Select;
const { TextArea } = Input;
const BookConfigNew = props => {
......@@ -234,32 +242,27 @@ const BookConfigNew = props => {
});
};
useEffect(() => {
console.log(pickItem1);
console.log(data[0]);
if (visible) {
// 获取台账表
getTableData();
if (type === 'edit') {
Ledger_QueryLedger({ ledgerId: formObj.ID }).then(res => {
if (res.code === 0) {
// setTableShow(true)
form.setFieldsValue(res.data);
form.setFieldsValue({ ...res.data });
setOrder(res.data.Order);
let editArr = res.data.LedgerFieids;
changTable(res.data.TableName, editArr);
// tableRef.current.setTableData(false, res.data.LedgerFieids);
}
});
} else {
if (!pickItem1 || pickItem1 == '全部') {
form.setFieldsValue({ Type: data[0] });
} else {
form.setFieldsValue({ Type: pickItem1 });
}
form.setFieldsValue({ EnableTimeFilter: true });
form.setFieldsValue({ EnableQuickSearch: true });
form.setFieldsValue({ EnableBatchOperation: true });
form.setFieldsValue({ EnableImportExport: true });
form.setFieldsValue({
EnableTimeFilter: true,
EnableQuickSearch: true,
EnableBatchOperation: true,
EnableImportExport: true,
Type: (!pickItem1 || pickItem1 == '全部') ? data[0] : pickItem1,
PageSize: 20
})
}
getParentData({ ledgerId: type === 'edit' ? formObj.ID : '0' });
} else {
......@@ -615,17 +618,6 @@ const BookConfigNew = props => {
title={
<div className={styles.modalTitle}>
<div>{type === 'add' ? '台账配置' : '台账编辑'}</div>
{/* <div>
<Button
type="primary"
ghost
icon={<EyeOutlined />}
onClick={() => setAccountVisile(true)}
style={{ marginLeft: '10px' }}
>
预览
</Button>
</div> */}
</div>
}
visible={visible}
......@@ -635,18 +627,7 @@ const BookConfigNew = props => {
centered
bodyStyle={{ width: '100%', height: '800px', overflowY: 'scorll' }}
width="1600px"
// style={{ top: '-20px' }}
getContainer={false}
// style={{
// maxWidth: '100vw',
// top: 0,
// paddingBottom: 0,
// }}
// bodyStyle={{
// height: 'calc(100vh - 55px - 53px)',
// overflowY: 'auto',
// }}
// width="100vw"
confirmLoading={modalLoading}
okText="保存并查看"
>
......@@ -681,7 +662,6 @@ const BookConfigNew = props => {
<Item
label="父级台账"
name="PreName"
// rules={[{ required: true, message: '请选择分组' }]}
>
<Select showSearch placeholder="请选择父级台账" allowClear>
{parentData.map((item, index) => (
......@@ -789,29 +769,26 @@ const BookConfigNew = props => {
<Form.Item
{...switchLayout}
valuePropName="checked"
// style={{ marginBottom: '0', padding: '2px', borderBottom: '1px solid #ccc' }}
label="时间筛选"
name="EnableTimeFilter"
>
<Switch checkedChildren="是" unCheckedChildren="否" />
</Form.Item>
</Col>
<Col span={4}>
{/* <Col span={4}>
<Form.Item
{...switchLayout}
valuePropName="checked"
// style={{ marginBottom: '0', padding: '2px', borderBottom: '1px solid #ccc' }}
label="快速检索"
name="EnableQuickSearch"
>
<Switch checkedChildren="是" unCheckedChildren="否" />
</Form.Item>
</Col>
</Col> */}
<Col span={4}>
<Form.Item
{...switchLayout}
valuePropName="checked"
// style={{ marginBottom: '0', padding: '2px', borderBottom: '1px solid #ccc' }}
label="站点过滤"
name="EnableSiteFilter"
>
......@@ -822,7 +799,6 @@ const BookConfigNew = props => {
<Form.Item
{...switchLayout}
valuePropName="checked"
// style={{ marginBottom: '0', padding: '2px', borderBottom: '1px solid #ccc' }}
label="导入导出"
name="EnableImportExport"
>
......@@ -833,7 +809,6 @@ const BookConfigNew = props => {
<Form.Item
{...switchLayout}
valuePropName="checked"
// style={{ marginBottom: '0', padding: '2px', borderBottom: '1px solid #ccc' }}
label="批量操作"
name="EnableBatchOperation"
>
......@@ -844,13 +819,21 @@ const BookConfigNew = props => {
<Form.Item
{...switchLayout}
valuePropName="checked"
// style={{ marginBottom: '0', padding: '2px', borderBottom: '1px solid #ccc' }}
label="打印功能"
name="EnablePrint"
>
<Switch checkedChildren="是" unCheckedChildren="否" />
</Form.Item>
</Col>
<Col span={4}>
<Form.Item
{...switchLayout}
label="分页默认数量"
name="PageSize"
>
<Select options={pagingOptions} />
</Form.Item>
</Col>
</Row>
</Form>
<ChangeAdd
......@@ -882,7 +865,6 @@ const BookConfigNew = props => {
bodyStyle={{ width: '100%', height: '800px', overflowY: 'scorll' }}
width="1600px"
confirmLoading={viewModalLoading}
// okText=
>
<Account
ref={accountRef}
......
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