From c635d78b479510ebe2556a420948effcd30a0731 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期六, 21 十二月 2024 18:40:43 +0800
Subject: [PATCH] 新建德森项目分支

---
 zy-asrs-framework/src/main/resources/templates/react/Index.txt |  608 +++++++++++++++++++++++++++---------------------------
 1 files changed, 304 insertions(+), 304 deletions(-)

diff --git a/zy-asrs-framework/src/main/resources/templates/react/Index.txt b/zy-asrs-framework/src/main/resources/templates/react/Index.txt
index 44a7174..25081d6 100644
--- a/zy-asrs-framework/src/main/resources/templates/react/Index.txt
+++ b/zy-asrs-framework/src/main/resources/templates/react/Index.txt
@@ -1,304 +1,304 @@
-
-import React, { useState, useRef, useEffect } from 'react';
-import { Button, message, Modal, Tag  } from 'antd';
-import {
-    FooterToolbar,
-    PageContainer,
-    ProTable,
-    LightFilter,
-} from '@ant-design/pro-components';
-import { FormattedMessage, useIntl } from '@umijs/max';
-import { PlusOutlined, ExportOutlined } from '@ant-design/icons';
-import Http from '@/utils/http';
-import Edit from './components/edit'
-import { TextFilter, SelectFilter, DatetimeRangeFilter, LinkFilter } from '@/components/TableSearch'
-import { statusMap } from '@/utils/enum-util'
-import { repairBug } from '@/utils/common-util';
-
-const TABLE_KEY = 'pro-table-@{SIMPLEENTITYNAME}';
-
-const handleSave = async (val, intl) => {
-    const hide = message.loading(intl.formatMessage({ id: 'page.adding', defaultMessage: '姝e湪娣诲姞' }));
-    try {
-        const resp = await Http.doPost('api/@{SIMPLEENTITYNAME}/save', val);
-        if (resp.code === 200) {
-            message.success(intl.formatMessage({ id: 'page.add.success', defaultMessage: '娣诲姞鎴愬姛' }));
-            return true;
-        } else {
-            message.error(resp.msg);
-            return false;
-        }
-    } catch (error) {
-        message.error(intl.formatMessage({ id: 'page.add.fail', defaultMessage: '娣诲姞澶辫触璇烽噸璇曪紒' }));
-        return false;
-    } finally {
-        hide();
-    }
-};
-
-const handleUpdate = async (val, intl) => {
-    const hide = message.loading(intl.formatMessage({ id: 'page.updating', defaultMessage: '姝e湪鏇存柊' }));
-    try {
-        const resp = await Http.doPost('api/@{SIMPLEENTITYNAME}/update', val);
-        if (resp.code === 200) {
-            message.success(intl.formatMessage({ id: 'page.update.success', defaultMessage: '鏇存柊鎴愬姛' }));
-            return true;
-        } else {
-            message.error(resp.msg);
-            return false;
-        }
-    } catch (error) {
-        message.error(intl.formatMessage({ id: 'page.update.fail', defaultMessage: '鏇存柊澶辫触璇烽噸璇曪紒' }));
-        return false;
-    } finally {
-        hide();
-    }
-};
-
-const handleRemove = async (rows, intl) => {
-    if (!rows) return true;
-    const hide = message.loading(intl.formatMessage({ id: 'page.deleting', defaultMessage: '姝e湪鍒犻櫎' }));
-    try {
-        const resp = await Http.doPost('api/@{SIMPLEENTITYNAME}/remove/' + rows.map((row) => row.id).join(','));
-        if (resp.code === 200) {
-            message.success(intl.formatMessage({ id: 'page.delete.success', defaultMessage: '鍒犻櫎鎴愬姛' }));
-            return true;
-        } else {
-            message.error(resp.msg);
-            return false;
-        }
-    } catch (error) {
-        message.error(intl.formatMessage({ id: 'page.delete.fail', defaultMessage: '鍒犻櫎澶辫触锛岃閲嶈瘯锛�' }));
-        return false;
-    } finally {
-        hide();
-    }
-};
-
-const handleExport = async (intl) => {
-    const hide = message.loading(intl.formatMessage({ id: 'page.exporting', defaultMessage: '姝e湪瀵煎嚭' }));
-    try {
-        const resp = await Http.doPostBlob('api/@{SIMPLEENTITYNAME}/export');
-        const blob = new Blob([resp], { type: 'application/vnd.ms-excel' });
-        window.location.href = window.URL.createObjectURL(blob);
-        message.success(intl.formatMessage({ id: 'page.export.success', defaultMessage: '瀵煎嚭鎴愬姛' }));
-        return true;
-    } catch (error) {
-        message.error(intl.formatMessage({ id: 'page.export.fail', defaultMessage: '瀵煎嚭澶辫触锛岃閲嶈瘯' }));
-        return false;
-    } finally {
-        hide();
-    }
-};
-
-
-const Main = () => {
-    const intl = useIntl();
-    const formTableRef = useRef();
-    const actionRef = useRef();
-    const [selectedRows, setSelectedRows] = useState([]);
-    const [modalVisible, setModalVisible] = useState(false);
-    const [currentRow, setCurrentRow] = useState();
-    const [searchParam, setSearchParam] = useState({});
-
-    useEffect(() => {
-
-    }, []);
-
-    const columns = [
-        {
-            title: intl.formatMessage({
-                id: 'page.table.no',
-                defaultMessage: 'No'
-            }),
-            dataIndex: 'index',
-            valueType: 'indexBorder',
-            width: 48,
-        },
-@{TABLECOLUMNS}
-        {
-            title: '鎿嶄綔',
-            dataIndex: 'option',
-            width: 140,
-            valueType: 'option',
-            render: (_, record) => [
-                <Button
-                    type="link"
-                    key="edit"
-                    onClick={() => {
-                        setModalVisible(true);
-                        setCurrentRow(record);
-                    }}
-                >
-                    <FormattedMessage id='page.edit' defaultMessage='缂栬緫' />
-                </Button>,
-                <Button
-                    type="link"
-                    danger
-                    key="batchRemove"
-                    onClick={async () => {
-                        Modal.confirm({
-                            title: intl.formatMessage({ id: 'page.delete', defaultMessage: '鍒犻櫎' }),
-                            content: intl.formatMessage({ id: 'page.delete.confirm', defaultMessage: '纭畾鍒犻櫎璇ラ」鍚楋紵' }),
-                            onOk: async () => {
-                                const success = await handleRemove([record], intl);
-                                if (success) {
-                                    if (actionRef.current) {
-                                        actionRef.current.reload();
-                                    }
-                                }
-                            },
-                        });
-                    }}
-                >
-                    <FormattedMessage id='page.delete' defaultMessage='鍒犻櫎' />
-                </Button>,
-            ],
-        },
-    ];
-
-    return (
-        <PageContainer
-            header={{
-                breadcrumb: {},
-            }}
-        >
-            <div style={{ width: '100%', float: 'right' }}>
-                <ProTable
-                    key="@{SIMPLEENTITYNAME}"
-                    rowKey="id"
-                    actionRef={actionRef}
-                    formRef={formTableRef}
-                    columns={columns}
-                    cardBordered
-                    scroll={{ x: 1300 }}
-                    dateFormatter="string"
-                    pagination={{ pageSize: 16 }}
-                    search={false}
-                    toolbar={{
-                        search: {
-                            onSearch: (value) => {
-                                setSearchParam(prevState => ({
-                                    ...prevState,
-                                    condition: value
-                                }));
-                                actionRef.current?.reload();
-                            },
-                        },
-                        filter: (
-                            <LightFilter
-                                onValuesChange={(val) => {
-                                }}
-                            >
-                            </LightFilter>
-                        ),
-                        actions: [
-                            <Button
-                                type="primary"
-                                key="save"
-                                onClick={async () => {
-                                    setModalVisible(true)
-                                }}
-                            >
-                                <PlusOutlined />
-                                <FormattedMessage id='page.add' defaultMessage='娣诲姞' />
-                            </Button>,
-                            <Button
-                                key="export"
-                                onClick={async () => {
-                                    handleExport(intl);
-                                }}
-                            >
-                                <ExportOutlined />
-                                <FormattedMessage id='page.export' defaultMessage='瀵煎嚭' />
-                            </Button>,
-                        ],
-                    }}
-                    request={(params, sorter, filter) =>
-                        Http.doPostPromise('/api/@{SIMPLEENTITYNAME}/page', { ...params, ...searchParam }, (res) => {
-                            return {
-                                data: res.data.records,
-                                total: res.data.total,
-                                success: true,
-                            }
-                        })
-                    }
-                    rowSelection={{
-                        onChange: (ids, rows) => {
-                            setSelectedRows(rows);
-                        }
-                    }}
-                    columnsState={{
-                        persistenceKey: TABLE_KEY,
-                        persistenceType: 'localStorage',
-                        defaultValue: {
-                            // memo: { show: repairBug(TABLE_KEY, 'memo', false) },
-                            option: { fixed: 'right', disable: true },
-                        },
-                        onChange(value) {
-                        },
-                    }}
-                />
-            </div>
-
-            {selectedRows?.length > 0 && (
-                <FooterToolbar
-                    extra={
-                        <div>
-                            <a style={{ fontWeight: 600 }}>{selectedRows.length}</a>
-                            <FormattedMessage id='page.selected' defaultMessage=' 椤瑰凡閫夋嫨' />
-                        </div>
-                    }
-                >
-                    <Button
-                        key="remove"
-                        danger
-                        onClick={async () => {
-                            Modal.confirm({
-                                title: intl.formatMessage({ id: 'page.delete', defaultMessage: '鍒犻櫎' }),
-                                content: intl.formatMessage({ id: 'page.delete.confirm', defaultMessage: '纭畾鍒犻櫎璇ラ」鍚楋紵' }),
-                                onOk: async () => {
-                                    const success = await handleRemove(selectedRows, intl);
-                                    if (success) {
-                                        setSelectedRows([]);
-                                        actionRef.current?.reloadAndRest?.();
-                                    }
-                                },
-                            });
-                        }}
-                    >
-                        <FormattedMessage id='page.delete.batch' defaultMessage='鎵归噺鍒犻櫎' />
-                    </Button>
-                </FooterToolbar>
-            )}
-
-            <Edit
-                open={modalVisible}
-                values={currentRow || {}}
-                onCancel={
-                    () => {
-                        setModalVisible(false);
-                        setCurrentRow(undefined);
-                    }
-                }
-                onSubmit={async (values) => {
-                    let ok = false;
-                    if (values.id) {
-                        ok = await handleUpdate({ ...values }, intl)
-                    } else {
-                        ok = await handleSave({ ...values }, intl)
-                    }
-                    if (ok) {
-                        setModalVisible(false);
-                        setCurrentRow(undefined);
-                        if (actionRef.current) {
-                            actionRef.current.reload();
-                        }
-                    }
-                }}
-            />
-        </PageContainer>
-    );
-};
-
-export default Main;
+
+import React, { useState, useRef, useEffect } from 'react';
+import { Button, message, Modal, Tag  } from 'antd';
+import {
+    FooterToolbar,
+    PageContainer,
+    ProTable,
+    LightFilter,
+} from '@ant-design/pro-components';
+import { FormattedMessage, useIntl } from '@umijs/max';
+import { PlusOutlined, ExportOutlined } from '@ant-design/icons';
+import Http from '@/utils/http';
+import Edit from './components/edit'
+import { TextFilter, SelectFilter, DatetimeRangeFilter, LinkFilter } from '@/components/TableSearch'
+import { statusMap } from '@/utils/enum-util'
+import { repairBug } from '@/utils/common-util';
+
+const TABLE_KEY = 'pro-table-@{SIMPLEENTITYNAME}';
+
+const handleSave = async (val, intl) => {
+    const hide = message.loading(intl.formatMessage({ id: 'page.adding', defaultMessage: '姝e湪娣诲姞' }));
+    try {
+        const resp = await Http.doPost('api/@{SIMPLEENTITYNAME}/save', val);
+        if (resp.code === 200) {
+            message.success(intl.formatMessage({ id: 'page.add.success', defaultMessage: '娣诲姞鎴愬姛' }));
+            return true;
+        } else {
+            message.error(resp.msg);
+            return false;
+        }
+    } catch (error) {
+        message.error(intl.formatMessage({ id: 'page.add.fail', defaultMessage: '娣诲姞澶辫触璇烽噸璇曪紒' }));
+        return false;
+    } finally {
+        hide();
+    }
+};
+
+const handleUpdate = async (val, intl) => {
+    const hide = message.loading(intl.formatMessage({ id: 'page.updating', defaultMessage: '姝e湪鏇存柊' }));
+    try {
+        const resp = await Http.doPost('api/@{SIMPLEENTITYNAME}/update', val);
+        if (resp.code === 200) {
+            message.success(intl.formatMessage({ id: 'page.update.success', defaultMessage: '鏇存柊鎴愬姛' }));
+            return true;
+        } else {
+            message.error(resp.msg);
+            return false;
+        }
+    } catch (error) {
+        message.error(intl.formatMessage({ id: 'page.update.fail', defaultMessage: '鏇存柊澶辫触璇烽噸璇曪紒' }));
+        return false;
+    } finally {
+        hide();
+    }
+};
+
+const handleRemove = async (rows, intl) => {
+    if (!rows) return true;
+    const hide = message.loading(intl.formatMessage({ id: 'page.deleting', defaultMessage: '姝e湪鍒犻櫎' }));
+    try {
+        const resp = await Http.doPost('api/@{SIMPLEENTITYNAME}/remove/' + rows.map((row) => row.id).join(','));
+        if (resp.code === 200) {
+            message.success(intl.formatMessage({ id: 'page.delete.success', defaultMessage: '鍒犻櫎鎴愬姛' }));
+            return true;
+        } else {
+            message.error(resp.msg);
+            return false;
+        }
+    } catch (error) {
+        message.error(intl.formatMessage({ id: 'page.delete.fail', defaultMessage: '鍒犻櫎澶辫触锛岃閲嶈瘯锛�' }));
+        return false;
+    } finally {
+        hide();
+    }
+};
+
+const handleExport = async (intl) => {
+    const hide = message.loading(intl.formatMessage({ id: 'page.exporting', defaultMessage: '姝e湪瀵煎嚭' }));
+    try {
+        const resp = await Http.doPostBlob('api/@{SIMPLEENTITYNAME}/export');
+        const blob = new Blob([resp], { type: 'application/vnd.ms-excel' });
+        window.location.href = window.URL.createObjectURL(blob);
+        message.success(intl.formatMessage({ id: 'page.export.success', defaultMessage: '瀵煎嚭鎴愬姛' }));
+        return true;
+    } catch (error) {
+        message.error(intl.formatMessage({ id: 'page.export.fail', defaultMessage: '瀵煎嚭澶辫触锛岃閲嶈瘯' }));
+        return false;
+    } finally {
+        hide();
+    }
+};
+
+
+const Main = () => {
+    const intl = useIntl();
+    const formTableRef = useRef();
+    const actionRef = useRef();
+    const [selectedRows, setSelectedRows] = useState([]);
+    const [modalVisible, setModalVisible] = useState(false);
+    const [currentRow, setCurrentRow] = useState();
+    const [searchParam, setSearchParam] = useState({});
+
+    useEffect(() => {
+
+    }, []);
+
+    const columns = [
+        {
+            title: intl.formatMessage({
+                id: 'page.table.no',
+                defaultMessage: 'No'
+            }),
+            dataIndex: 'index',
+            valueType: 'indexBorder',
+            width: 48,
+        },
+@{TABLECOLUMNS}
+        {
+            title: '鎿嶄綔',
+            dataIndex: 'option',
+            width: 140,
+            valueType: 'option',
+            render: (_, record) => [
+                <Button
+                    type="link"
+                    key="edit"
+                    onClick={() => {
+                        setModalVisible(true);
+                        setCurrentRow(record);
+                    }}
+                >
+                    <FormattedMessage id='page.edit' defaultMessage='缂栬緫' />
+                </Button>,
+                <Button
+                    type="link"
+                    danger
+                    key="batchRemove"
+                    onClick={async () => {
+                        Modal.confirm({
+                            title: intl.formatMessage({ id: 'page.delete', defaultMessage: '鍒犻櫎' }),
+                            content: intl.formatMessage({ id: 'page.delete.confirm', defaultMessage: '纭畾鍒犻櫎璇ラ」鍚楋紵' }),
+                            onOk: async () => {
+                                const success = await handleRemove([record], intl);
+                                if (success) {
+                                    if (actionRef.current) {
+                                        actionRef.current.reload();
+                                    }
+                                }
+                            },
+                        });
+                    }}
+                >
+                    <FormattedMessage id='page.delete' defaultMessage='鍒犻櫎' />
+                </Button>,
+            ],
+        },
+    ];
+
+    return (
+        <PageContainer
+            header={{
+                breadcrumb: {},
+            }}
+        >
+            <div style={{ width: '100%', float: 'right' }}>
+                <ProTable
+                    key="@{SIMPLEENTITYNAME}"
+                    rowKey="id"
+                    actionRef={actionRef}
+                    formRef={formTableRef}
+                    columns={columns}
+                    cardBordered
+                    scroll={{ x: 1300 }}
+                    dateFormatter="string"
+                    pagination={{ pageSize: 16 }}
+                    search={false}
+                    toolbar={{
+                        search: {
+                            onSearch: (value) => {
+                                setSearchParam(prevState => ({
+                                    ...prevState,
+                                    condition: value
+                                }));
+                                actionRef.current?.reload();
+                            },
+                        },
+                        filter: (
+                            <LightFilter
+                                onValuesChange={(val) => {
+                                }}
+                            >
+                            </LightFilter>
+                        ),
+                        actions: [
+                            <Button
+                                type="primary"
+                                key="save"
+                                onClick={async () => {
+                                    setModalVisible(true)
+                                }}
+                            >
+                                <PlusOutlined />
+                                <FormattedMessage id='page.add' defaultMessage='娣诲姞' />
+                            </Button>,
+                            <Button
+                                key="export"
+                                onClick={async () => {
+                                    handleExport(intl);
+                                }}
+                            >
+                                <ExportOutlined />
+                                <FormattedMessage id='page.export' defaultMessage='瀵煎嚭' />
+                            </Button>,
+                        ],
+                    }}
+                    request={(params, sorter, filter) =>
+                        Http.doPostPromise('/api/@{SIMPLEENTITYNAME}/page', { ...params, ...searchParam }, (res) => {
+                            return {
+                                data: res.data.records,
+                                total: res.data.total,
+                                success: true,
+                            }
+                        })
+                    }
+                    rowSelection={{
+                        onChange: (ids, rows) => {
+                            setSelectedRows(rows);
+                        }
+                    }}
+                    columnsState={{
+                        persistenceKey: TABLE_KEY,
+                        persistenceType: 'localStorage',
+                        defaultValue: {
+                            // memo: { show: repairBug(TABLE_KEY, 'memo', false) },
+                            option: { fixed: 'right', disable: true },
+                        },
+                        onChange(value) {
+                        },
+                    }}
+                />
+            </div>
+
+            {selectedRows?.length > 0 && (
+                <FooterToolbar
+                    extra={
+                        <div>
+                            <a style={{ fontWeight: 600 }}>{selectedRows.length}</a>
+                            <FormattedMessage id='page.selected' defaultMessage=' 椤瑰凡閫夋嫨' />
+                        </div>
+                    }
+                >
+                    <Button
+                        key="remove"
+                        danger
+                        onClick={async () => {
+                            Modal.confirm({
+                                title: intl.formatMessage({ id: 'page.delete', defaultMessage: '鍒犻櫎' }),
+                                content: intl.formatMessage({ id: 'page.delete.confirm', defaultMessage: '纭畾鍒犻櫎璇ラ」鍚楋紵' }),
+                                onOk: async () => {
+                                    const success = await handleRemove(selectedRows, intl);
+                                    if (success) {
+                                        setSelectedRows([]);
+                                        actionRef.current?.reloadAndRest?.();
+                                    }
+                                },
+                            });
+                        }}
+                    >
+                        <FormattedMessage id='page.delete.batch' defaultMessage='鎵归噺鍒犻櫎' />
+                    </Button>
+                </FooterToolbar>
+            )}
+
+            <Edit
+                open={modalVisible}
+                values={currentRow || {}}
+                onCancel={
+                    () => {
+                        setModalVisible(false);
+                        setCurrentRow(undefined);
+                    }
+                }
+                onSubmit={async (values) => {
+                    let ok = false;
+                    if (values.id) {
+                        ok = await handleUpdate({ ...values }, intl)
+                    } else {
+                        ok = await handleSave({ ...values }, intl)
+                    }
+                    if (ok) {
+                        setModalVisible(false);
+                        setCurrentRow(undefined);
+                        if (actionRef.current) {
+                            actionRef.current.reload();
+                        }
+                    }
+                }}
+            />
+        </PageContainer>
+    );
+};
+
+export default Main;

--
Gitblit v1.9.1