魏熙美 5 gadus atpakaļ
vecāks
revīzija
c0d05fef4a

+ 17
- 6
config/config.js Parādīt failu

@@ -30,11 +30,11 @@ const plugins = [
30 30
       // },
31 31
       pwa: pwa
32 32
         ? {
33
-          workboxPluginMode: 'InjectManifest',
34
-          workboxOptions: {
35
-            importWorkboxFrom: 'local',
36
-          },
37
-        }
33
+            workboxPluginMode: 'InjectManifest',
34
+            workboxOptions: {
35
+              importWorkboxFrom: 'local',
36
+            },
37
+          }
38 38
         : false, // default close dll, because issue https://github.com/ant-design/ant-design-pro/issues/4665
39 39
       // dll features https://webpack.js.org/plugins/dll-plugin/
40 40
       // dll: {
@@ -112,6 +112,18 @@ export default {
112 112
               name: '首页',
113 113
               component: './Welcome',
114 114
             },
115
+            {
116
+              path: '/building',
117
+              name: '项目管理',
118
+              component: '../layouts/BlankLayout',
119
+              routes: [
120
+                {
121
+                  path: '/building/list',
122
+                  name: '项目列表',
123
+                  component: './building/list/index',
124
+                },
125
+              ],
126
+            },
115 127
             // {
116 128
             //   path: '/welcome2',
117 129
             //   name: '首页2',
@@ -141,7 +153,6 @@ export default {
141 153
   // Theme for antd: https://ant.design/docs/react/customize-theme-cn
142 154
   theme: {
143 155
     'primary-color': primaryColor,
144
-
145 156
   },
146 157
   define: {
147 158
     ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION:

+ 20
- 5
package.json Parādīt failu

@@ -26,14 +26,25 @@
26 26
     "test:component": "umi test ./src/components",
27 27
     "ui": "umi ui"
28 28
   },
29
-  "husky": { "hooks": { "pre-commit": "npm run lint-staged" } },
29
+  "husky": {
30
+    "hooks": {
31
+      "pre-commit": "npm run lint-staged"
32
+    }
33
+  },
30 34
   "lint-staged": {
31 35
     "**/*.less": "stylelint --syntax less",
32
-    "**/*.{js,jsx,tsx,ts,less,md,json}": ["prettier --write", "git add"],
36
+    "**/*.{js,jsx,tsx,ts,less,md,json}": [
37
+      "prettier --write",
38
+      "git add"
39
+    ],
33 40
     "**/*.{js,jsx}": "npm run lint-staged:js",
34 41
     "**/*.{js,ts,tsx}": "npm run lint-staged:js"
35 42
   },
36
-  "browserslist": ["> 1%", "last 2 versions", "not ie <= 10"],
43
+  "browserslist": [
44
+    "> 1%",
45
+    "last 2 versions",
46
+    "not ie <= 10"
47
+  ],
37 48
   "dependencies": {
38 49
     "@ant-design/pro-layout": "^4.5.9",
39 50
     "@antv/data-set": "^0.10.2",
@@ -94,8 +105,12 @@
94 105
     "umi-types": "^0.3.8",
95 106
     "webpack-theme-color-replacer": "^1.2.15"
96 107
   },
97
-  "optionalDependencies": { "puppeteer": "^1.17.0" },
98
-  "engines": { "node": ">=10.0.0" },
108
+  "optionalDependencies": {
109
+    "puppeteer": "^1.17.0"
110
+  },
111
+  "engines": {
112
+    "node": ">=10.0.0"
113
+  },
99 114
   "checkFiles": [
100 115
     "src/**/*.js*",
101 116
     "src/**/*.ts*",

+ 85
- 0
src/pages/building/list/index.jsx Parādīt failu

@@ -0,0 +1,85 @@
1
+import React from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select } from 'antd';
3
+import Styles from './style.less';
4
+
5
+const { Option } = Select;
6
+
7
+// 校验错误
8
+function hasErrors(fieldsError) {
9
+  return Object.keys(fieldsError).some(field => fieldsError[field]);
10
+}
11
+
12
+// 提交事件
13
+function handleSubmit(e, props) {
14
+  e.preventDefault();
15
+}
16
+
17
+// Change 事件
18
+function handleSelectChange(props) {}
19
+
20
+// 搜索
21
+function header(props) {
22
+  return (
23
+    <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
24
+      <Form.Item>
25
+        {
26
+          <Input
27
+            prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
28
+            placeholder="楼盘编号"
29
+          />
30
+        }
31
+      </Form.Item>
32
+      <Form.Item>
33
+        {
34
+          <Input
35
+            prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
36
+            type="password"
37
+            placeholder="楼盘名称"
38
+          />
39
+        }
40
+      </Form.Item>
41
+      <Form.Item>{<DatePicker placeholder="开盘时间" />}</Form.Item>
42
+      <Form.Item>
43
+        {
44
+          <Select style={{ width: '180px' }} placeholder="楼盘状态" onChange={handleSelectChange}>
45
+            <Option value="1">发布</Option>
46
+            <Option value="0">未发布</Option>
47
+          </Select>
48
+        }
49
+      </Form.Item>
50
+      <Form.Item>
51
+        {
52
+          <Select style={{ width: '180px' }} placeholder="销售状态" onChange={handleSelectChange}>
53
+            <Option value="1">已销售</Option>
54
+            <Option value="0">未销售</Option>
55
+          </Select>
56
+        }
57
+      </Form.Item>
58
+      <Form.Item>
59
+        {
60
+          <Select style={{ width: '180px' }} placeholder="城市" onChange={handleSelectChange}>
61
+            <Option value="male">male</Option>
62
+            <Option value="female">female</Option>
63
+          </Select>
64
+        }
65
+      </Form.Item>
66
+      <Form.Item>
67
+        {
68
+          <Select style={{ width: '180px' }} placeholder="首页推荐" onChange={handleSelectChange}>
69
+            <Option value="1">首页推荐</Option>
70
+            <Option value="0">首页未推荐</Option>
71
+          </Select>
72
+        }
73
+      </Form.Item>
74
+      <Form.Item>
75
+        <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
76
+          搜索
77
+        </Button>
78
+      </Form.Item>
79
+    </Form>
80
+  );
81
+}
82
+
83
+const WrappedHorizontalLoginForm = Form.create({ name: 'horizontal_login' })(header);
84
+
85
+export default WrappedHorizontalLoginForm;

+ 11
- 0
src/pages/building/list/style.css Parādīt failu

@@ -0,0 +1,11 @@
1
+.SubmitButton {
2
+  background: #3a91d5;
3
+  border-radius: 7px;
4
+  border: 0px;
5
+}
6
+.SelectFrom {
7
+  width: 180px;
8
+  background: #ffffff;
9
+  border-radius: 7px;
10
+  border: 1px solid #dbdbdb;
11
+}

+ 14
- 0
src/pages/building/list/style.less Parādīt failu

@@ -0,0 +1,14 @@
1
+// @import '~antd/es/style/themes/default.less';
2
+
3
+.SubmitButton {
4
+  background: rgba(58, 145, 213, 1);
5
+  border-radius: 7px;
6
+  border: 0px;
7
+}
8
+
9
+.SelectFrom {
10
+  width: 180px;
11
+  background: rgba(255, 255, 255, 1);
12
+  border-radius: 7px;
13
+  border: 1px solid rgba(219, 219, 219, 1);
14
+}

+ 11
- 0
src/pages/building/list/style.wxss Parādīt failu

@@ -0,0 +1,11 @@
1
+.SubmitButton {
2
+  background: #3a91d5;
3
+  border-radius: 7px;
4
+  border: 0px;
5
+}
6
+.SelectFrom {
7
+  width: 180px;
8
+  background: #ffffff;
9
+  border-radius: 7px;
10
+  border: 1px solid #dbdbdb;
11
+}