Yansen пре 2 година
родитељ
комит
e7c312ffbe

+ 0
- 10
src/components/page/Container.jsx Прегледај датотеку

@@ -1,10 +0,0 @@
1
-import React from 'react';
2
-import './style.less'
3
-
4
-export default (props) => {
5
-  return (
6
-    <div className="page-container">
7
-      {props.children}
8
-    </div>
9
-  )
10
-}

+ 0
- 14
src/components/page/index.jsx Прегледај датотеку

@@ -1,14 +0,0 @@
1
-import React, { useEffect } from 'react';
2
-// import { PageHeader } from 'antd';
3
-import { useModel } from '@/store';
4
-import Container from './Container';
5
-
6
-export default (props) => {
7
-  // const { children, ...headerProps } = props;
8
-  
9
-  return (
10
-    <Container>
11
-      {props.children}
12
-    </Container>
13
-  )
14
-}

+ 0
- 5
src/components/page/style.less Прегледај датотеку

@@ -1,5 +0,0 @@
1
-
2
-.page-container {
3
-  margin: 24px;
4
-  // margin-bottom: 0;
5
-}

src/layouts/Container.jsx → src/layouts/PageContainer.jsx Прегледај датотеку


src/pages/sample/home/components/VideoPlay.jsx → src/pages/home/components/VideoPlay.jsx Прегледај датотеку


src/pages/sample/home/index.jsx → src/pages/home/index.jsx Прегледај датотеку


+ 0
- 353
src/pages/sample/form/index.jsx Прегледај датотеку

@@ -1,353 +0,0 @@
1
-import {
2
-  AutoComplete,
3
-  Button,
4
-  Cascader,
5
-  Checkbox,
6
-  Col,
7
-  Form,
8
-  Input,
9
-  InputNumber,
10
-  Row,
11
-  Select,
12
-  Card,
13
-} from 'antd';
14
-import React, { useState } from 'react';
15
-import Page from '@/components/page';
16
-
17
-const { Option } = Select;
18
-const residences = [
19
-  {
20
-    value: 'zhejiang',
21
-    label: 'Zhejiang',
22
-    children: [
23
-      {
24
-        value: 'hangzhou',
25
-        label: 'Hangzhou',
26
-        children: [
27
-          {
28
-            value: 'xihu',
29
-            label: 'West Lake',
30
-          },
31
-        ],
32
-      },
33
-    ],
34
-  },
35
-  {
36
-    value: 'jiangsu',
37
-    label: 'Jiangsu',
38
-    children: [
39
-      {
40
-        value: 'nanjing',
41
-        label: 'Nanjing',
42
-        children: [
43
-          {
44
-            value: 'zhonghuamen',
45
-            label: 'Zhong Hua Men',
46
-          },
47
-        ],
48
-      },
49
-    ],
50
-  },
51
-];
52
-const formItemLayout = {
53
-  labelCol: {
54
-    xs: {
55
-      span: 24,
56
-    },
57
-    sm: {
58
-      span: 8,
59
-    },
60
-  },
61
-  wrapperCol: {
62
-    xs: {
63
-      span: 24,
64
-    },
65
-    sm: {
66
-      span: 16,
67
-    },
68
-  },
69
-};
70
-const tailFormItemLayout = {
71
-  wrapperCol: {
72
-    xs: {
73
-      span: 24,
74
-      offset: 0,
75
-    },
76
-    sm: {
77
-      span: 16,
78
-      offset: 8,
79
-    },
80
-  },
81
-};
82
-
83
-
84
-const BasicForm = () => {
85
-  const [form] = Form.useForm();
86
-
87
-  const onFinish = (values) => {
88
-    console.log('Received values of form: ', values);
89
-  };
90
-
91
-  const prefixSelector = (
92
-    <Form.Item name="prefix" noStyle>
93
-      <Select
94
-        style={{
95
-          width: 70,
96
-        }}
97
-      >
98
-        <Option value="86">+86</Option>
99
-        <Option value="87">+87</Option>
100
-      </Select>
101
-    </Form.Item>
102
-  );
103
-  const suffixSelector = (
104
-    <Form.Item name="suffix" noStyle>
105
-      <Select
106
-        style={{
107
-          width: 70,
108
-        }}
109
-      >
110
-        <Option value="USD">$</Option>
111
-        <Option value="CNY">¥</Option>
112
-      </Select>
113
-    </Form.Item>
114
-  );
115
-  const [autoCompleteResult, setAutoCompleteResult] = useState([]);
116
-
117
-  const onWebsiteChange = (value) => {
118
-    if (!value) {
119
-      setAutoCompleteResult([]);
120
-    } else {
121
-      setAutoCompleteResult(['.com', '.org', '.net'].map((domain) => `${value}${domain}`));
122
-    }
123
-  };
124
-
125
-  const websiteOptions = autoCompleteResult.map((website) => ({
126
-    label: website,
127
-    value: website,
128
-  }));
129
-  return (
130
-    <Form
131
-      {...formItemLayout}
132
-      form={form}
133
-      name="register"
134
-      onFinish={onFinish}
135
-      initialValues={{
136
-        residence: ['zhejiang', 'hangzhou', 'xihu'],
137
-        prefix: '86',
138
-      }}
139
-      scrollToFirstError
140
-      style={{ background: '#fff', boxSizing: 'border-box', padding: '24px' }}
141
-    >
142
-      <Form.Item
143
-        name="email"
144
-        label="E-mail"
145
-        rules={[
146
-          {
147
-            type: 'email',
148
-            message: 'The input is not valid E-mail!',
149
-          },
150
-          {
151
-            required: true,
152
-            message: 'Please input your E-mail!',
153
-          },
154
-        ]}
155
-      >
156
-        <Input />
157
-      </Form.Item>
158
-
159
-      <Form.Item
160
-        name="password"
161
-        label="Password"
162
-        rules={[
163
-          {
164
-            required: true,
165
-            message: 'Please input your password!',
166
-          },
167
-        ]}
168
-        hasFeedback
169
-      >
170
-        <Input.Password />
171
-      </Form.Item>
172
-
173
-      <Form.Item
174
-        name="confirm"
175
-        label="Confirm Password"
176
-        dependencies={['password']}
177
-        hasFeedback
178
-        rules={[
179
-          {
180
-            required: true,
181
-            message: 'Please confirm your password!',
182
-          },
183
-          ({ getFieldValue }) => ({
184
-            validator(_, value) {
185
-              if (!value || getFieldValue('password') === value) {
186
-                return Promise.resolve();
187
-              }
188
-
189
-              return Promise.reject(new Error('The two passwords that you entered do not match!'));
190
-            },
191
-          }),
192
-        ]}
193
-      >
194
-        <Input.Password />
195
-      </Form.Item>
196
-
197
-      <Form.Item
198
-        name="nickname"
199
-        label="Nickname"
200
-        tooltip="What do you want others to call you?"
201
-        rules={[
202
-          {
203
-            required: true,
204
-            message: 'Please input your nickname!',
205
-            whitespace: true,
206
-          },
207
-        ]}
208
-      >
209
-        <Input />
210
-      </Form.Item>
211
-
212
-      <Form.Item
213
-        name="residence"
214
-        label="Habitual Residence"
215
-        rules={[
216
-          {
217
-            type: 'array',
218
-            required: true,
219
-            message: 'Please select your habitual residence!',
220
-          },
221
-        ]}
222
-      >
223
-        <Cascader options={residences} />
224
-      </Form.Item>
225
-
226
-      <Form.Item
227
-        name="phone"
228
-        label="Phone Number"
229
-        rules={[
230
-          {
231
-            required: true,
232
-            message: 'Please input your phone number!',
233
-          },
234
-        ]}
235
-      >
236
-        <Input
237
-          addonBefore={prefixSelector}
238
-          style={{
239
-            width: '100%',
240
-          }}
241
-        />
242
-      </Form.Item>
243
-
244
-      <Form.Item
245
-        name="donation"
246
-        label="Donation"
247
-        rules={[
248
-          {
249
-            required: true,
250
-            message: 'Please input donation amount!',
251
-          },
252
-        ]}
253
-      >
254
-        <InputNumber
255
-          addonAfter={suffixSelector}
256
-          style={{
257
-            width: '100%',
258
-          }}
259
-        />
260
-      </Form.Item>
261
-
262
-      <Form.Item
263
-        name="website"
264
-        label="Website"
265
-        rules={[
266
-          {
267
-            required: true,
268
-            message: 'Please input website!',
269
-          },
270
-        ]}
271
-      >
272
-        <AutoComplete options={websiteOptions} onChange={onWebsiteChange} placeholder="website">
273
-          <Input />
274
-        </AutoComplete>
275
-      </Form.Item>
276
-
277
-      <Form.Item
278
-        name="intro"
279
-        label="Intro"
280
-        rules={[
281
-          {
282
-            required: true,
283
-            message: 'Please input Intro',
284
-          },
285
-        ]}
286
-      >
287
-        <Input.TextArea showCount maxLength={100} />
288
-      </Form.Item>
289
-
290
-      <Form.Item
291
-        name="gender"
292
-        label="Gender"
293
-        rules={[
294
-          {
295
-            required: true,
296
-            message: 'Please select gender!',
297
-          },
298
-        ]}
299
-      >
300
-        <Select placeholder="select your gender">
301
-          <Option value="male">Male</Option>
302
-          <Option value="female">Female</Option>
303
-          <Option value="other">Other</Option>
304
-        </Select>
305
-      </Form.Item>
306
-
307
-      <Form.Item label="Captcha" extra="We must make sure that your are a human.">
308
-        <Row gutter={8}>
309
-          <Col span={12}>
310
-            <Form.Item
311
-              name="captcha"
312
-              noStyle
313
-              rules={[
314
-                {
315
-                  required: true,
316
-                  message: 'Please input the captcha you got!',
317
-                },
318
-              ]}
319
-            >
320
-              <Input />
321
-            </Form.Item>
322
-          </Col>
323
-          <Col span={12}>
324
-            <Button>Get captcha</Button>
325
-          </Col>
326
-        </Row>
327
-      </Form.Item>
328
-
329
-      <Form.Item
330
-        name="agreement"
331
-        valuePropName="checked"
332
-        rules={[
333
-          {
334
-            validator: (_, value) =>
335
-              value ? Promise.resolve() : Promise.reject(new Error('Should accept agreement')),
336
-          },
337
-        ]}
338
-        {...tailFormItemLayout}
339
-      >
340
-        <Checkbox>
341
-          I have read the <a href="">agreement</a>
342
-        </Checkbox>
343
-      </Form.Item>
344
-      <Form.Item {...tailFormItemLayout}>
345
-        <Button type="primary" htmlType="submit">
346
-          Register
347
-        </Button>
348
-      </Form.Item>
349
-    </Form>
350
-  );
351
-};
352
-
353
-export default () => <Page><Card><BasicForm /></Card></Page>;

+ 0
- 169
src/pages/sample/table/index.jsx Прегледај датотеку

@@ -1,169 +0,0 @@
1
-import { EllipsisOutlined, PlusOutlined } from '@ant-design/icons';
2
-import { ProTable, TableDropdown } from '@ant-design/pro-components';
3
-import { Button, Dropdown, Menu, Space, Tag } from 'antd';
4
-import { useRef, useEffect } from 'react';
5
-import Page from '@/components/page';
6
-import { useModel } from '@/store';
7
-
8
-// import request from 'umi-request';
9
-const columns = [
10
-    {
11
-        dataIndex: 'index',
12
-        valueType: 'indexBorder',
13
-        width: 48,
14
-    },
15
-    {
16
-        title: '标题',
17
-        dataIndex: 'title',
18
-        copyable: true,
19
-        ellipsis: true,
20
-        tip: '标题过长会自动收缩',
21
-        formItemProps: {
22
-            rules: [
23
-                {
24
-                    required: true,
25
-                    message: '此项为必填项',
26
-                },
27
-            ],
28
-        },
29
-    },
30
-    {
31
-        disable: true,
32
-        title: '状态',
33
-        dataIndex: 'state',
34
-        filters: true,
35
-        onFilter: true,
36
-        ellipsis: true,
37
-        valueType: 'select',
38
-        valueEnum: {
39
-            all: { text: '超长'.repeat(50) },
40
-            open: {
41
-                text: '未解决',
42
-                status: 'Error',
43
-            },
44
-            closed: {
45
-                text: '已解决',
46
-                status: 'Success',
47
-                disabled: true,
48
-            },
49
-            processing: {
50
-                text: '解决中',
51
-                status: 'Processing',
52
-            },
53
-        },
54
-    },
55
-    {
56
-        disable: true,
57
-        title: '标签',
58
-        dataIndex: 'labels',
59
-        search: false,
60
-        renderFormItem: (_, { defaultRender }) => {
61
-            return defaultRender(_);
62
-        },
63
-        render: (_, record) => (<Space>
64
-        {record.labels.map(({ name, color }) => (<Tag color={color} key={name}>
65
-            {name}
66
-          </Tag>))}
67
-      </Space>),
68
-    },
69
-    {
70
-        title: '创建时间',
71
-        key: 'showTime',
72
-        dataIndex: 'created_at',
73
-        valueType: 'date',
74
-        sorter: true,
75
-        hideInSearch: true,
76
-    },
77
-    {
78
-        title: '创建时间',
79
-        dataIndex: 'created_at',
80
-        valueType: 'dateRange',
81
-        hideInTable: true,
82
-        search: {
83
-            transform: (value) => {
84
-                return {
85
-                    startTime: value[0],
86
-                    endTime: value[1],
87
-                };
88
-            },
89
-        },
90
-    },
91
-    {
92
-        title: '操作',
93
-        valueType: 'option',
94
-        key: 'option',
95
-        render: (text, record, _, action) => [
96
-            <a key="editable" onClick={() => {
97
-                    var _a;
98
-                    (_a = action === null || action === void 0 ? void 0 : action.startEditable) === null || _a === void 0 ? void 0 : _a.call(action, record.id);
99
-                }}>
100
-        编辑
101
-      </a>,
102
-            <a href={record.url} target="_blank" rel="noopener noreferrer" key="view">
103
-        查看
104
-      </a>,
105
-            <TableDropdown key="actionGroup" onSelect={() => action === null || action === void 0 ? void 0 : action.reload()} menus={[
106
-                    { key: 'copy', name: '复制' },
107
-                    { key: 'delete', name: '删除' },
108
-                ]}/>,
109
-        ],
110
-    },
111
-];
112
-const menu = (<Menu items={[
113
-        {
114
-            label: '1st item',
115
-            key: '1',
116
-        },
117
-        {
118
-            label: '2nd item',
119
-            key: '1',
120
-        },
121
-        {
122
-            label: '3rd item',
123
-            key: '1',
124
-        },
125
-    ]}/>);
126
-export default () => {
127
-
128
-    const actionRef = useRef();
129
-    return (<Page><ProTable columns={columns} actionRef={actionRef} cardBordered request={async (params = {}, sort, filter) => {
130
-            console.log(sort, filter);
131
-            // return request('https://proapi.azurewebsites.net/github/issues', {
132
-            //     params,
133
-            // });
134
-        }} editable={{
135
-            type: 'multiple',
136
-        }} columnsState={{
137
-            persistenceKey: 'pro-table-singe-demos',
138
-            persistenceType: 'localStorage',
139
-            onChange(value) {
140
-                console.log('value: ', value);
141
-            },
142
-        }} rowKey="id" search={{
143
-            labelWidth: 'auto',
144
-        }} options={{
145
-            setting: {
146
-                listsHeight: 400,
147
-            },
148
-        }} form={{
149
-            // 由于配置了 transform,提交的参与与定义的不同这里需要转化一下
150
-            syncToUrl: (values, type) => {
151
-                if (type === 'get') {
152
-                    return Object.assign(Object.assign({}, values), { created_at: [values.startTime, values.endTime] });
153
-                }
154
-                return values;
155
-            },
156
-        }} pagination={{
157
-            pageSize: 5,
158
-            onChange: (page) => console.log(page),
159
-        }} dateFormatter="string" headerTitle="高级表格" toolBarRender={() => [
160
-            <Button key="button" icon={<PlusOutlined />} type="primary">
161
-          新建
162
-        </Button>,
163
-            <Dropdown key="menu" overlay={menu}>
164
-          <Button>
165
-            <EllipsisOutlined />
166
-          </Button>
167
-        </Dropdown>,
168
-        ]}/></Page>);
169
-};

+ 7
- 9
src/routes/routes.jsx Прегледај датотеку

@@ -9,12 +9,10 @@ import {
9 9
 } from "@ant-design/icons";
10 10
 import { Navigate } from "react-router-dom";
11 11
 import AuthLayout from "@/layouts/AuthLayout";
12
-import Container from "@/layouts/Container";
12
+import PageContainer from "@/layouts/PageContainer";
13 13
 import Login from "@/pages/login";
14 14
 import Page404 from "@/pages/404";
15
-import Home from "@/pages/sample/home";
16
-import BasicForm from "@/pages/sample/form";
17
-import BasicTable from "@/pages/sample/table";
15
+import Home from "@/pages/home";
18 16
 import GuaranteeTaskList from "@/pages/guaranteeTask";
19 17
 import GuaranteeTaskEdit from "@/pages/guaranteeTask/Edit";
20 18
 import GuaranteeTaskPrint from "@/pages/guaranteeTask/print";
@@ -77,7 +75,7 @@ export const authRoutes = [
77 75
   },
78 76
   {
79 77
     path: "task",
80
-    element: <Container />,
78
+    element: <PageContainer />,
81 79
     meta: {
82 80
       title: "军供任务",
83 81
       permission: 'task',
@@ -135,7 +133,7 @@ export const authRoutes = [
135 133
   },
136 134
   {
137 135
     path: "stock",
138
-    element: <Container />,
136
+    element: <PageContainer />,
139 137
     meta: {
140 138
       title: "库存物资",
141 139
       permission: 'stock',
@@ -190,7 +188,7 @@ export const authRoutes = [
190 188
   },
191 189
   {
192 190
     path: "purchase",
193
-    element: <Container />,
191
+    element: <PageContainer />,
194 192
     meta: {
195 193
       title: "采购管理",
196 194
       permission: 'purchase',
@@ -255,7 +253,7 @@ export const authRoutes = [
255 253
   },
256 254
   {
257 255
     path: "cms",
258
-    element: <Container />,
256
+    element: <PageContainer />,
259 257
     meta: {
260 258
       title: "公告文件",
261 259
       permission: 'cms',
@@ -355,7 +353,7 @@ export const authRoutes = [
355 353
   },
356 354
   {
357 355
     path: "system",
358
-    element: <Container />,
356
+    element: <PageContainer />,
359 357
     meta: {
360 358
       title: "系统管理",
361 359
       permission: 'system',