From b7a644b54ca351b8106c842a5611fa8c22e383b8 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期日, 18 二月 2024 16:19:24 +0800
Subject: [PATCH] #

---
 /dev/null                                                        |  194 -------------
 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/utils/CodeBuilder.java |    4 
 zy-asrs-wcs/src/main/java/host.sql                               |    9 
 zy-asrs-flow/src/pages/system/host/index.jsx                     |  510 +++++++++++++++++++++++++-----------
 zy-asrs-flow/src/pages/system/host/components/edit.jsx           |  101 +++++++
 5 files changed, 465 insertions(+), 353 deletions(-)

diff --git a/zy-asrs-flow/src/pages/system/host/components/UpdateForm.jsx b/zy-asrs-flow/src/pages/system/host/components/UpdateForm.jsx
deleted file mode 100644
index 9ad2d41..0000000
--- a/zy-asrs-flow/src/pages/system/host/components/UpdateForm.jsx
+++ /dev/null
@@ -1,194 +0,0 @@
-import {
-  ProFormDateTimePicker,
-  ProFormRadio,
-  ProFormSelect,
-  ProFormText,
-  ProFormTextArea,
-  StepsForm,
-} from '@ant-design/pro-components';
-import { FormattedMessage, useIntl } from '@umijs/max';
-import { Modal } from 'antd';
-import React from 'react';
-
-const UpdateForm = (props) => {
-  const intl = useIntl();
-  return (
-    <StepsForm
-      stepsProps={{
-        size: 'small',
-      }}
-      stepsFormRender={(dom, submitter) => {
-        return (
-          <Modal
-            width={640}
-            bodyStyle={{ padding: '32px 40px 48px' }}
-            destroyOnClose
-            title={intl.formatMessage({
-              id: 'pages.searchTable.updateForm.ruleConfig',
-              defaultMessage: '瑙勫垯閰嶇疆',
-            })}
-            open={props.updateModalOpen}
-            footer={submitter}
-            onCancel={() => {
-              props.onCancel();
-            }}
-          >
-            {dom}
-          </Modal>
-        );
-      }}
-      onFinish={props.onSubmit}
-    >
-      <StepsForm.StepForm
-        initialValues={{
-          name: props.values.name,
-          desc: props.values.desc,
-        }}
-        title={intl.formatMessage({
-          id: 'pages.searchTable.updateForm.basicConfig',
-          defaultMessage: '鍩烘湰淇℃伅',
-        })}
-      >
-        <ProFormText
-          name="name"
-          label={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.ruleName.nameLabel',
-            defaultMessage: '瑙勫垯鍚嶇О',
-          })}
-          width="md"
-          rules={[
-            {
-              required: true,
-              message: (
-                <FormattedMessage
-                  id="pages.searchTable.updateForm.ruleName.nameRules"
-                  defaultMessage="璇疯緭鍏ヨ鍒欏悕绉帮紒"
-                />
-              ),
-            },
-          ]}
-        />
-        <ProFormTextArea
-          name="desc"
-          width="md"
-          label={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.ruleDesc.descLabel',
-            defaultMessage: '瑙勫垯鎻忚堪',
-          })}
-          placeholder={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.ruleDesc.descPlaceholder',
-            defaultMessage: '璇疯緭鍏ヨ嚦灏戜簲涓瓧绗�',
-          })}
-          rules={[
-            {
-              required: true,
-              message: (
-                <FormattedMessage
-                  id="pages.searchTable.updateForm.ruleDesc.descRules"
-                  defaultMessage="璇疯緭鍏ヨ嚦灏戜簲涓瓧绗︾殑瑙勫垯鎻忚堪锛�"
-                />
-              ),
-              min: 5,
-            },
-          ]}
-        />
-      </StepsForm.StepForm>
-      <StepsForm.StepForm
-        initialValues={{
-          target: '0',
-          template: '0',
-        }}
-        title={intl.formatMessage({
-          id: 'pages.searchTable.updateForm.ruleProps.title',
-          defaultMessage: '閰嶇疆瑙勫垯灞炴��',
-        })}
-      >
-        <ProFormSelect
-          name="target"
-          width="md"
-          label={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.object',
-            defaultMessage: '鐩戞帶瀵硅薄',
-          })}
-          valueEnum={{
-            0: '琛ㄤ竴',
-            1: '琛ㄤ簩',
-          }}
-        />
-        <ProFormSelect
-          name="template"
-          width="md"
-          label={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.ruleProps.templateLabel',
-            defaultMessage: '瑙勫垯妯℃澘',
-          })}
-          valueEnum={{
-            0: '瑙勫垯妯℃澘涓�',
-            1: '瑙勫垯妯℃澘浜�',
-          }}
-        />
-        <ProFormRadio.Group
-          name="type"
-          label={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.ruleProps.typeLabel',
-            defaultMessage: '瑙勫垯绫诲瀷',
-          })}
-          options={[
-            {
-              value: '0',
-              label: '寮�',
-            },
-            {
-              value: '1',
-              label: '寮�',
-            },
-          ]}
-        />
-      </StepsForm.StepForm>
-      <StepsForm.StepForm
-        initialValues={{
-          type: '1',
-          frequency: 'month',
-        }}
-        title={intl.formatMessage({
-          id: 'pages.searchTable.updateForm.schedulingPeriod.title',
-          defaultMessage: '璁惧畾璋冨害鍛ㄦ湡',
-        })}
-      >
-        <ProFormDateTimePicker
-          name="time"
-          width="md"
-          label={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.schedulingPeriod.timeLabel',
-            defaultMessage: '寮�濮嬫椂闂�',
-          })}
-          rules={[
-            {
-              required: true,
-              message: (
-                <FormattedMessage
-                  id="pages.searchTable.updateForm.schedulingPeriod.timeRules"
-                  defaultMessage="璇烽�夋嫨寮�濮嬫椂闂达紒"
-                />
-              ),
-            },
-          ]}
-        />
-        <ProFormSelect
-          name="frequency"
-          label={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.object',
-            defaultMessage: '鐩戞帶瀵硅薄',
-          })}
-          width="md"
-          valueEnum={{
-            month: '鏈�',
-            week: '鍛�',
-          }}
-        />
-      </StepsForm.StepForm>
-    </StepsForm>
-  );
-};
-
-export default UpdateForm;
diff --git a/zy-asrs-flow/src/pages/system/host/components/edit.jsx b/zy-asrs-flow/src/pages/system/host/components/edit.jsx
new file mode 100644
index 0000000..4950fb5
--- /dev/null
+++ b/zy-asrs-flow/src/pages/system/host/components/edit.jsx
@@ -0,0 +1,101 @@
+import React, { useState, useRef, useEffect } from 'react';
+import {
+    ProForm,
+    ProFormDigit,
+    ProFormText,
+    ProFormSelect,
+    ProFormDateTimePicker
+} from '@ant-design/pro-components';
+import { Form, Modal } from 'antd';
+import moment from 'moment';
+import Http from '@/utils/http';
+
+const Edit = (props) => {
+    const [form] = Form.useForm();
+    const { } = props;
+
+    useEffect(() => {
+        form.resetFields();
+        form.setFieldsValue({
+            ...props.values
+        })
+    }, [form, props])
+
+    const handleCancel = () => {
+        props.onCancel();
+    };
+
+    const handleOk = () => {
+        form.submit();
+    }
+
+    const handleFinish = async (values) => {
+        props.onSubmit({ ...values });
+    }
+
+    return (
+        <>
+            <Modal
+                title="Edit"
+                width={640}
+                forceRender
+                destroyOnClose
+                open={props.open}
+                onCancel={handleCancel}
+                onOk={handleOk}
+            >
+                <ProForm
+                    form={form}
+                    submitter={false}
+                    onFinish={handleFinish}
+                    layout="horizontal"
+                    grid={true}
+                >
+                    <ProFormDigit
+                        name="id"
+                        disabled
+                        hidden={true}
+                    />
+                    <ProForm.Group>
+                        <ProFormText
+                            name="name"
+                            label="鍚嶇О"
+                            colProps={{ md: 12, xl: 12 }}
+                            placeholder="璇疯緭鍏�"
+                            rules={[{ required: true, message: "鍚嶇О涓嶈兘涓虹┖锛�" }]}
+                        />
+                        <ProFormSelect
+                            name="status"
+                            label="鐘舵��"
+                            colProps={{ md: 12, xl: 12 }}
+                            placeholder="璇烽�夋嫨"
+                            options={[
+                                { label: '姝e父', value: 1 },
+                                { label: '绂佺敤', value: 0 },
+                            ]}
+                        />
+                    </ProForm.Group>
+                    <ProForm.Group>
+                        <ProFormDateTimePicker
+                            name="createTime"
+                            label="娣诲姞鏃堕棿"
+                            colProps={{ md: 12, xl: 12 }}
+                            placeholder="璇烽�夋嫨"
+                            transform={(value) => moment(value).toISOString()}
+                        />
+                        <ProFormDateTimePicker
+                            name="updateTime"
+                            label="淇敼鏃堕棿"
+                            colProps={{ md: 12, xl: 12 }}
+                            placeholder="璇烽�夋嫨"
+                            transform={(value) => moment(value).toISOString()}
+                        />
+                    </ProForm.Group>
+
+                </ProForm>
+            </Modal>
+        </>
+    )
+}
+
+export default Edit;
diff --git a/zy-asrs-flow/src/pages/system/host/index.jsx b/zy-asrs-flow/src/pages/system/host/index.jsx
index bf04e23..e2f369e 100644
--- a/zy-asrs-flow/src/pages/system/host/index.jsx
+++ b/zy-asrs-flow/src/pages/system/host/index.jsx
@@ -1,166 +1,362 @@
-import { EllipsisOutlined, SearchOutlined } from '@ant-design/icons';
-import { ProTable, TableDropdown } from '@ant-design/pro-components';
-import { Button, Dropdown, Input } from 'antd';
 
-const valueEnum = {
-  0: 'close',
-  1: 'running',
-  2: 'online',
-  3: 'error',
+import React, { useState, useRef, useEffect } from 'react';
+import { Button, message, Modal } from 'antd';
+import {
+    FooterToolbar,
+    PageContainer,
+    ProTable,
+    LightFilter,
+} from '@ant-design/pro-components';
+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'
+
+const handleSave = async (val) => {
+    const hide = message.loading('姝e湪娣诲姞');
+    try {
+        const resp = await Http.doPost('api/host/save', val);
+        if (resp.code === 200) {
+            message.success('娣诲姞鎴愬姛');
+            return true;
+        } else {
+            message.error(resp.msg);
+            return false;
+        }
+    } catch (error) {
+        message.error('娣诲姞澶辫触璇烽噸璇曪紒');
+        return false;
+    } finally {
+        hide();
+    }
 };
 
-const tableListDataSource = [];
+const handleUpdate = async (val) => {
+    const hide = message.loading('姝e湪鏇存柊');
+    try {
+        const resp = await Http.doPost('api/host/update', val);
+        if (resp.code === 200) {
+            message.success('鏇存柊鎴愬姛');
+            return true;
+        } else {
+            message.error(resp.msg);
+            return false;
+        }
+    } catch (error) {
+        message.error('閰嶇疆澶辫触璇烽噸璇曪紒');
+        return false;
+    } finally {
+        hide();
+    }
+};
 
-const creators = ['浠樺皬灏�', '鏇蹭附涓�', '鏋椾笢涓�', '闄堝竻甯�', '鍏兼煇鏌�'];
+const handleRemove = async (rows) => {
+    if (!rows) return true;
+    const hide = message.loading('姝e湪鍒犻櫎');
+    try {
+        const resp = await Http.doPost('api/host/remove/' + rows.map((row) => row.id).join(','));
+        if (resp.code === 200) {
+            message.success('鍒犻櫎鎴愬姛');
+            return true;
+        } else {
+            message.error(resp.msg);
+            return false;
+        }
+    } catch (error) {
+        message.error('鍒犻櫎澶辫触锛岃閲嶈瘯');
+        return false;
+    } finally {
+        hide();
+    }
+};
 
-for (let i = 0; i < 5; i += 1) {
-  tableListDataSource.push({
-    key: i,
-    name: 'AppName',
-    containers: Math.floor(Math.random() * 20),
-    creator: creators[Math.floor(Math.random() * creators.length)],
-    status: valueEnum[((Math.floor(Math.random() * 10) % 4) + '')],
-    createdAt: Date.now() - Math.floor(Math.random() * 2000),
-    money: Math.floor(Math.random() * 2000) * i,
-    progress: Math.ceil(Math.random() * 100) + 1,
-    memo:
-      i % 2 === 1
-        ? '寰堥暱寰堥暱寰堥暱寰堥暱寰堥暱寰堥暱寰堥暱鐨勬枃瀛楄灞曠ず浣嗘槸瑕佺暀涓嬪熬宸�'
-        : '绠�鐭娉ㄦ枃妗�',
-  });
-}
+const handleExport = async () => {
+    const hide = message.loading('姝e湪瀵煎嚭');
+    try {
+        const resp = await Http.doPostBlob('api/host/export');
+        const blob = new Blob([resp], { type: 'application/vnd.ms-excel' });
+        window.location.href = window.URL.createObjectURL(blob);
+        message.success('瀵煎嚭鎴愬姛');
+        return true;
+    } catch (error) {
+        message.error('瀵煎嚭澶辫触锛岃閲嶈瘯');
+        return false;
+    } finally {
+        hide();
+    }
+};
 
-const columns = [
-  {
-    title: '鎺掑簭',
-    dataIndex: 'index',
-    valueType: 'indexBorder',
-    width: 48,
-  },
-  {
-    title: '搴旂敤鍚嶇О',
-    dataIndex: 'name',
-    render: (_) => <a>{_}</a>,
-    // 鑷畾涔夌瓫閫夐」鍔熻兘鍏蜂綋瀹炵幇璇峰弬鑰� https://ant.design/components/table-cn/#components-table-demo-custom-filter-panel
-    filterDropdown: () => (
-      <div style={{ padding: 8 }}>
-        <Input style={{ width: 188, marginBlockEnd: 8, display: 'block' }} />
-      </div>
-    ),
-    filterIcon: (filtered) => (
-      <SearchOutlined style={{ color: filtered ? '#1890ff' : undefined }} />
-    ),
-  },
-  {
-    title: '鍒涘缓鑰�',
-    dataIndex: 'creator',
-    valueEnum: {
-      all: { text: '鍏ㄩ儴' },
-      浠樺皬灏�: { text: '浠樺皬灏�' },
-      鏇蹭附涓�: { text: '鏇蹭附涓�' },
-      鏋椾笢涓�: { text: '鏋椾笢涓�' },
-      闄堝竻甯�: { text: '闄堝竻甯�' },
-      鍏兼煇鏌�: { text: '鍏兼煇鏌�' },
-    },
-  },
-  {
-    title: '鐘舵��',
-    dataIndex: 'status',
-    initialValue: 'all',
-    filters: true,
-    onFilter: true,
-    valueEnum: {
-      all: { text: '鍏ㄩ儴', status: 'Default' },
-      close: { text: '鍏抽棴', status: 'Default' },
-      running: { text: '杩愯涓�', status: 'Processing' },
-      online: { text: '宸蹭笂绾�', status: 'Success' },
-      error: { text: '寮傚父', status: 'Error' },
-    },
-  },
-  {
-    title: '澶囨敞',
-    dataIndex: 'memo',
-    ellipsis: true,
-    copyable: true,
-  },
-  {
-    title: '鎿嶄綔',
-    width: 180,
-    key: 'option',
-    valueType: 'option',
-    render: () => [
-      <a key="link">閾捐矾</a>,
-      <a key="link2">鎶ヨ</a>,
-      <a key="link3">鐩戞帶</a>,
-      <TableDropdown
-        key="actionGroup"
-        menus={[
-          { key: 'copy', name: '澶嶅埗' },
-          { key: 'delete', name: '鍒犻櫎' },
-        ]}
-      />,
-    ],
-  },
-];
 
-export default () => {
-  return (
-    <ProTable
-      columns={columns}
-      request={(params, sorter, filter) => {
-        // 琛ㄥ崟鎼滅储椤逛細浠� params 浼犲叆锛屼紶閫掔粰鍚庣鎺ュ彛銆�
-        console.log(params, sorter, filter);
-        return Promise.resolve({
-          data: tableListDataSource,
-          success: true,
-        });
-      }}
-      rowKey="key"
-      pagination={{
-        showQuickJumper: true,
-      }}
-      search={{
-        layout: 'vertical',
-        defaultCollapsed: false,
-      }}
-      dateFormatter="string"
-      toolbar={{
-        title: '楂樼骇琛ㄦ牸',
-        tooltip: '杩欐槸涓�涓爣棰樻彁绀�',
-      }}
-      toolBarRender={() => [
-        <Button key="danger" danger>
-          鍗遍櫓鎸夐挳
-        </Button>,
-        <Button key="show">鏌ョ湅鏃ュ織</Button>,
-        <Button type="primary" key="primary">
-          鍒涘缓搴旂敤
-        </Button>,
+const Main = () => {
+    const formTableRef = useRef();
+    const actionRef = useRef();
+    const [selectedRows, setSelectedRows] = useState([]);
+    const [modalVisible, setModalVisible] = useState(false);
+    const [currentRow, setCurrentRow] = useState();
+    const [searchParam, setSearchParam] = useState({});
 
-        <Dropdown
-          key="menu"
-          menu={{
-            items: [
-              {
-                label: '1st item',
-                key: '1',
-              },
-              {
-                label: '2nd item',
-                key: '2',
-              },
-              {
-                label: '3rd item',
-                key: '3',
-              },
+    useEffect(() => {
+
+    }, []);
+
+    const columns = [
+        {
+            title: 'No',
+            dataIndex: 'index',
+            valueType: 'indexBorder',
+            width: 48,
+        },
+        {
+            title: '鍚嶇О',
+            dataIndex: 'name',
+            valueType: 'text',
+            hidden: false,
+            width: 140,
+            copyable: true,
+            filterDropdown: (props) => <TextFilter
+                name='name'
+                {...props}
+                actionRef={actionRef}
+                setSearchParam={setSearchParam}
+            />,
+        },
+        {
+            title: '鐘舵��',
+            dataIndex: 'status$',
+            valueType: 'text',
+            hidden: false,
+            width: 140,
+            filterDropdown: (props) => <SelectFilter
+                name='status'
+                {...props}
+                actionRef={actionRef}
+                setSearchParam={setSearchParam}
+                data={[
+                    { label: '姝e父', value: 1 },
+                    { label: '绂佺敤', value: 0 },
+                ]}
+            />,
+        },
+        {
+            title: '娣诲姞鏃堕棿',
+            dataIndex: 'createTime$',
+            valueType: 'text',
+            hidden: false,
+            width: 140,
+            filterDropdown: (props) => <DatetimeRangeFilter
+                name='createTime'
+                {...props}
+                actionRef={actionRef}
+                setSearchParam={setSearchParam}
+            />,
+        },
+        {
+            title: '淇敼鏃堕棿',
+            dataIndex: 'updateTime$',
+            valueType: 'text',
+            hidden: false,
+            width: 140,
+            filterDropdown: (props) => <DatetimeRangeFilter
+                name='updateTime'
+                {...props}
+                actionRef={actionRef}
+                setSearchParam={setSearchParam}
+            />,
+        },
+        {
+            title: '澶囨敞',
+            dataIndex: 'memo',
+            valueType: 'text',
+            hidden: false,
+            width: 140,
+            filterDropdown: (props) => <TextFilter
+                name='memo'
+                {...props}
+                actionRef={actionRef}
+                setSearchParam={setSearchParam}
+            />,
+        },
+
+        {
+            title: '鎿嶄綔',
+            dataIndex: 'option',
+            width: 140,
+            valueType: 'option',
+            render: (_, record) => [
+                <Button
+                    type="link"
+                    key="edit"
+                    onClick={() => {
+                        setModalVisible(true);
+                        setCurrentRow(record);
+                    }}
+                >
+                    缂栬緫
+                </Button>,
+                <Button
+                    type="link"
+                    danger
+                    key="batchRemove"
+                    onClick={async () => {
+                        Modal.confirm({
+                            title: '鍒犻櫎',
+                            content: '纭畾鍒犻櫎璇ラ」鍚楋紵',
+                            onOk: async () => {
+                                const success = await handleRemove([record]);
+                                if (success) {
+                                    if (actionRef.current) {
+                                        actionRef.current.reload();
+                                    }
+                                }
+                            },
+                        });
+                    }}
+                >
+                    鍒犻櫎
+                </Button>,
             ],
-          }}
-        >
-          <Button>
-            <EllipsisOutlined />
-          </Button>
-        </Dropdown>,
-      ]}
-    />
-  );
-};
\ No newline at end of file
+        },
+    ];
+
+    return (
+        <PageContainer>
+            <div style={{ width: '100%', float: 'right' }}>
+                <ProTable
+                    key="host"
+                    rowKey="id"
+                    actionRef={actionRef}
+                    formRef={formTableRef}
+                    columns={columns}
+                    cardBordered
+                    scroll={{ x: 1300 }}
+                    dateFormatter="string"
+                    pagination={{ pageSize: 20 }}
+                    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 />
+                                娣诲姞
+                            </Button>,
+                            <Button
+                                key="export"
+                                onClick={async () => {
+                                    handleExport();
+                                }}
+                            >
+                                <ExportOutlined />
+                                瀵煎嚭
+                            </Button>,
+                        ],
+                    }}
+                    request={(params, sorter, filter) =>
+                        Http.doPostPromise('/api/host/page', { ...params, ...searchParam }, (res) => {
+                            return {
+                                data: res.data.records,
+                                total: res.data.total,
+                                success: true,
+                            }
+                        })
+                    }
+                    rowSelection={{
+                        onChange: (ids, rows) => {
+                            setSelectedRows(rows);
+                        }
+                    }}
+                    columnsState={{
+                        persistenceKey: 'pro-table-host',
+                        persistenceType: 'localStorage',
+                        defaultValue: {
+                            option: { fixed: 'right', disable: true },
+                        },
+                        onChange(value) {
+                        },
+                    }}
+                />
+            </div>
+
+            {selectedRows?.length > 0 && (
+                <FooterToolbar
+                    extra={
+                        <div>
+                            宸查�夋嫨
+                            <a style={{ fontWeight: 600 }}>{selectedRows.length}</a>
+                            椤�
+                        </div>
+                    }
+                >
+                    <Button
+                        key="remove"
+                        danger
+                        onClick={async () => {
+                            Modal.confirm({
+                                title: '鍒犻櫎',
+                                content: '纭畾鍒犻櫎璇ラ」鍚楋紵',
+                                onOk: async () => {
+                                    const success = await handleRemove(selectedRows);
+                                    if (success) {
+                                        setSelectedRows([]);
+                                        actionRef.current?.reloadAndRest?.();
+                                    }
+                                },
+                            });
+                        }}
+                    >
+                        鎵归噺鍒犻櫎
+                    </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 })
+                    } else {
+                        ok = await handleSave({ ...values })
+                    }
+                    if (ok) {
+                        setModalVisible(false);
+                        setCurrentRow(undefined);
+                        if (actionRef.current) {
+                            actionRef.current.reload();
+                        }
+                    }
+                }
+                }
+            />
+        </PageContainer>
+    );
+};
+
+export default Main;
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/utils/CodeBuilder.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/utils/CodeBuilder.java
index 4a985ee..c2dc2d2 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/utils/CodeBuilder.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/utils/CodeBuilder.java
@@ -22,8 +22,8 @@
 //        generator.username="sa";
 //        generator.password="Zoneyung@zy56$";
 
-        generator.table="sys_user";
-        generator.tableName="鐢ㄦ埛";
+        generator.table="sys_host";
+        generator.tableName="鏈烘瀯";
         generator.packagePath="com.zy.asrs.wcs.system";
 
         generator.build();
diff --git a/zy-asrs-wcs/src/main/java/host.sql b/zy-asrs-wcs/src/main/java/host.sql
new file mode 100644
index 0000000..42c3662
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/host.sql
@@ -0,0 +1,9 @@
+-- save host record
+-- mysql
+insert into `sys_menu` ( `name`, `parent_id`, `route`, `type`, `sort`, `host_id`, `status`) values ( '鏈烘瀯绠$悊', '0', '/system/host', '0' , '0', '1' , '1');
+
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '鏌ヨ鏈烘瀯', '', '1', 'system:host:list', '0', '1', '1');
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '娣诲姞鏈烘瀯', '', '1', 'system:host:save', '1', '1', '1');
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '淇敼鏈烘瀯', '', '1', 'system:host:update', '2', '1', '1');
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '鍒犻櫎鏈烘瀯', '', '1', 'system:host:remove', '3', '1', '1');
+

--
Gitblit v1.9.1