andrew 4 年 前
コミット
93fa566c68

バイナリ
estateagents-admin-manager/src/assets/bg.jpg ファイルの表示


バイナリ
estateagents-admin-manager/src/assets/border.png ファイルの表示


バイナリ
estateagents-admin-manager/src/assets/bottom.png ファイルの表示


バイナリ
estateagents-admin-manager/src/assets/boy.png ファイルの表示


+ 101
- 0
estateagents-admin-manager/src/global.jsx ファイルの表示

@@ -0,0 +1,101 @@
1
+import { Button, message, notification } from 'antd';
2
+import React from 'react';
3
+import { formatMessage } from 'umi-plugin-react/locale';
4
+import defaultSettings from '../config/defaultSettings';
5
+const { pwa } = defaultSettings; // if pwa is true
6
+
7
+if (pwa) {
8
+  // Notify user if offline now
9
+  window.addEventListener('sw.offline', () => {
10
+    message.warning(
11
+      formatMessage({
12
+        id: 'app.pwa.offline',
13
+      }),
14
+    );
15
+  }); // Pop up a prompt on the page asking the user if they want to use the latest version
16
+
17
+  window.addEventListener('sw.updated', event => {
18
+    const e = event;
19
+
20
+    const reloadSW = async () => {
21
+      // Check if there is sw whose state is waiting in ServiceWorkerRegistration
22
+      // https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration
23
+      const worker = e.detail && e.detail.waiting;
24
+
25
+      if (!worker) {
26
+        return true;
27
+      } // Send skip-waiting event to waiting SW with MessageChannel
28
+
29
+      await new Promise((resolve, reject) => {
30
+        const channel = new MessageChannel();
31
+
32
+        channel.port1.onmessage = msgEvent => {
33
+          if (msgEvent.data.error) {
34
+            reject(msgEvent.data.error);
35
+          } else {
36
+            resolve(msgEvent.data);
37
+          }
38
+        };
39
+
40
+        worker.postMessage(
41
+          {
42
+            type: 'skip-waiting',
43
+          },
44
+          [channel.port2],
45
+        );
46
+      }); // Refresh current page to use the updated HTML and other assets after SW has skiped waiting
47
+
48
+      window.location.reload(true);
49
+      return true;
50
+    };
51
+
52
+    const key = `open${Date.now()}`;
53
+    const btn = (
54
+      <Button
55
+        type="primary"
56
+        onClick={() => {
57
+          notification.close(key);
58
+          reloadSW();
59
+        }}
60
+      >
61
+        {formatMessage({
62
+          id: 'app.pwa.serviceworker.updated.ok',
63
+        })}
64
+      </Button>
65
+    );
66
+    notification.open({
67
+      message: formatMessage({
68
+        id: 'app.pwa.serviceworker.updated',
69
+      }),
70
+      description: formatMessage({
71
+        id: 'app.pwa.serviceworker.updated.hint',
72
+      }),
73
+      btn,
74
+      key,
75
+      onClose: async () => {},
76
+    });
77
+  });
78
+} else if ('serviceWorker' in navigator) {
79
+  // unregister service worker
80
+  const { serviceWorker } = navigator;
81
+
82
+  if (serviceWorker.getRegistrations) {
83
+    serviceWorker.getRegistrations().then(sws => {
84
+      sws.forEach(sw => {
85
+        sw.unregister();
86
+      });
87
+    });
88
+  }
89
+
90
+  serviceWorker.getRegistration().then(sw => {
91
+    if (sw) sw.unregister();
92
+  }); // remove all caches
93
+
94
+  if (window.caches && window.caches.keys) {
95
+    caches.keys().then(keys => {
96
+      keys.forEach(key => {
97
+        caches.delete(key);
98
+      });
99
+    });
100
+  }
101
+}

+ 194
- 0
estateagents-admin-manager/src/global.less ファイルの表示

@@ -0,0 +1,194 @@
1
+@import '~antd/es/style/themes/default.less';
2
+
3
+html,
4
+body,
5
+#root {
6
+  height: 100%;
7
+}
8
+
9
+.colorWeak {
10
+  filter: invert(80%);
11
+}
12
+
13
+canvas {
14
+  display: block;
15
+}
16
+
17
+body {
18
+  text-rendering: optimizeLegibility;
19
+  -webkit-font-smoothing: antialiased;
20
+  -moz-osx-font-smoothing: grayscale;
21
+  font-size: 16px;
22
+}
23
+
24
+ul,
25
+ol {
26
+  list-style: none;
27
+}
28
+
29
+@media (max-width: @screen-xs) {
30
+  .ant-table {
31
+    width: 100%;
32
+    overflow-x: auto;
33
+    &-thead > tr,
34
+    &-tbody > tr {
35
+      > th,
36
+      > td {
37
+        white-space: pre;
38
+        > span {
39
+          display: block;
40
+        }
41
+      }
42
+    }
43
+  }
44
+}
45
+
46
+.ant-layout-header .ant-pro-global-header{
47
+  background:#393C39;
48
+  border-bottom: 0.6px solid rgb(156, 153, 153);
49
+}
50
+.ant-layout .ant-pro-sider-menu-sider.light .ant-pro-sider-menu-logo{
51
+  background:#EF273A;
52
+  box-shadow: none;
53
+  border: none;
54
+  a{
55
+    h1{
56
+      color: #fff;
57
+    }
58
+  }
59
+}
60
+.antd-pro-layouts-user-layout-container{
61
+  .ant-input-affix-wrapper .ant-input-prefix{
62
+    left:7px;
63
+  }
64
+  .ant-input-affix-wrapper .ant-input:not(:first-child) {
65
+    padding-left: 40px;
66
+  }
67
+}
68
+ 
69
+.ant-layout{
70
+  .ant-menu-vertical .ant-menu-item,
71
+.ant-menu-vertical-left .ant-menu-item,
72
+.ant-menu-vertical-right .ant-menu-item,
73
+.ant-menu-inline .ant-menu-item,
74
+.ant-menu-vertical .ant-menu-submenu-title,
75
+.ant-menu-vertical-left .ant-menu-submenu-title,
76
+.ant-menu-vertical-right .ant-menu-submenu-title,
77
+.ant-menu-inline .ant-menu-submenu-title,
78
+.ant-input ,.ant-btn,.ant-select,.ant-table,.ant-form-item,.ant-form label,.ant-tabs-nav-container {
79
+  font-size: 0.096rem;
80
+  
81
+}
82
+.ant-input{
83
+  height: 32px;
84
+  border-radius: 4px;
85
+  padding: 0 0 0 10px;
86
+  align-items: center;
87
+}
88
+.ant-radio-button-wrapper{
89
+  color: #FF7E48;
90
+  border: 1px solid #FF7E48;
91
+}
92
+.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {
93
+  color: #fff;
94
+  background: #FF7E48;
95
+  border-color: #FF7E48;
96
+  box-shadow: none;
97
+}
98
+.ant-radio-button-wrapper:not(:first-child)::before{
99
+  background: #FF7E48;
100
+}
101
+.ant-radio-button-wrapper:first-child {
102
+  border-left: 1px solid #FF7E48;
103
+}
104
+.ant-radio-button-wrapper:hover{
105
+  border-color: #FF7E48;
106
+  color: #FF7E48; ;
107
+}
108
+.ant-row.ant-form-item .ant-form-item-label.ant-col-sm-3{
109
+  min-width: 100px;
110
+}
111
+.ant-card-body{
112
+  padding: 0;
113
+}
114
+.antd-pro-pages-index-echarts-styles-pie,.antd-pro-pages-index-echarts-styles-bar{
115
+  padding: 40px;
116
+  margin-bottom: 40px;
117
+}
118
+.ant-breadcrumb{
119
+  font-size: 0.096rem;
120
+  .anticon {
121
+    font-size: 0.096rem;
122
+  }
123
+} 
124
+  .ant-pro-global-header-trigger{
125
+    display: none;
126
+  }
127
+  .ant-pro-sider-menu-sider.light{
128
+    box-shadow: none;
129
+    .ant-pro-sider-menu-logo h1{
130
+      color: #fff;
131
+    }
132
+  }
133
+  .ant-pro-page-header-wrap-page-header-warp{
134
+    background:rgba(240,240,240,1);
135
+  }
136
+   .ant-menu:not(.ant-menu-horizontal)  .ant-menu-item-selected{
137
+    background:rgb(230, 227, 227)!important;
138
+    border: none!important;
139
+  }
140
+  .ant-menu-inline .ant-menu-selected::after, .ant-menu-inline .ant-menu-item-selected::after{
141
+    opacity: 0;
142
+  }
143
+  .ant-menu-inline > .ant-menu-item{
144
+    height: 45px;
145
+    line-height: 45px;
146
+    
147
+    margin: 0;
148
+    .ant-menu-submenu-title{
149
+      font-size: 16px!important;
150
+    }
151
+  }
152
+  .ant-menu.ant-pro-sider-menu{
153
+    padding: 0!important;
154
+  }
155
+  
156
+  .ant-breadcrumb + .ant-page-header-heading{
157
+    display: none;
158
+  }
159
+  .ant-page-header{
160
+    height: 50px;
161
+    padding:0 30px;
162
+    line-height: 50px;
163
+    
164
+    .ant-breadcrumb{
165
+      color: #333;
166
+    }
167
+  }
168
+  .ant-pro-sider-menu-logo img{
169
+    height: 41px;
170
+  }
171
+  .ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active {
172
+    color: #FF7E48;
173
+  }
174
+  .ant-table{
175
+    line-height: 3;
176
+  }
177
+  .ant-modal-header{
178
+    border-bottom: none;
179
+    .ant-modal-title{
180
+      font-size: 24px;
181
+      line-height: 50px;
182
+    }
183
+  }
184
+  .ant-modal-footer{
185
+    border-top:none;
186
+  }
187
+}
188
+:global {
189
+  .ant-layout {
190
+    min-height: 100vh;
191
+    background-color: #f8f8f8;
192
+    height: fit-content!important;
193
+  }  
194
+}

+ 22
- 0
estateagents-admin-manager/src/manifest.json ファイルの表示

@@ -0,0 +1,22 @@
1
+{
2
+  "name": "Ant Design Pro",
3
+  "short_name": "Ant Design Pro",
4
+  "display": "standalone",
5
+  "start_url": "./?utm_source=homescreen",
6
+  "theme_color": "#002140",
7
+  "background_color": "#001529",
8
+  "icons": [
9
+    {
10
+      "src": "icons/icon-192x192.png",
11
+      "sizes": "192x192"
12
+    },
13
+    {
14
+      "src": "icons/icon-128x128.png",
15
+      "sizes": "128x128"
16
+    },
17
+    {
18
+      "src": "icons/icon-512x512.png",
19
+      "sizes": "512x512"
20
+    }
21
+  ]
22
+}

+ 66
- 0
estateagents-admin-manager/src/service-worker.js ファイルの表示

@@ -0,0 +1,66 @@
1
+/* eslint-disable eslint-comments/disable-enable-pair */
2
+/* eslint-disable no-restricted-globals */
3
+/* eslint-disable no-underscore-dangle */
4
+/* globals workbox */
5
+workbox.core.setCacheNameDetails({
6
+  prefix: 'antd-pro',
7
+  suffix: 'v1',
8
+});
9
+// Control all opened tabs ASAP
10
+workbox.clientsClaim();
11
+
12
+/**
13
+ * Use precaching list generated by workbox in build process.
14
+ * https://developers.google.com/web/tools/workbox/reference-docs/latest/workbox.precaching
15
+ */
16
+workbox.precaching.precacheAndRoute(self.__precacheManifest || []);
17
+
18
+/**
19
+ * Register a navigation route.
20
+ * https://developers.google.com/web/tools/workbox/modules/workbox-routing#how_to_register_a_navigation_route
21
+ */
22
+workbox.routing.registerNavigationRoute('/index.html');
23
+
24
+/**
25
+ * Use runtime cache:
26
+ * https://developers.google.com/web/tools/workbox/reference-docs/latest/workbox.routing#.registerRoute
27
+ *
28
+ * Workbox provides all common caching strategies including CacheFirst, NetworkFirst etc.
29
+ * https://developers.google.com/web/tools/workbox/reference-docs/latest/workbox.strategies
30
+ */
31
+
32
+/**
33
+ * Handle API requests
34
+ */
35
+workbox.routing.registerRoute(/\/api\//, workbox.strategies.networkFirst());
36
+
37
+/**
38
+ * Handle third party requests
39
+ */
40
+workbox.routing.registerRoute(
41
+  /^https:\/\/gw.alipayobjects.com\//,
42
+  workbox.strategies.networkFirst(),
43
+);
44
+workbox.routing.registerRoute(
45
+  /^https:\/\/cdnjs.cloudflare.com\//,
46
+  workbox.strategies.networkFirst(),
47
+);
48
+workbox.routing.registerRoute(/\/color.less/, workbox.strategies.networkFirst());
49
+
50
+/**
51
+ * Response to client after skipping waiting with MessageChannel
52
+ */
53
+addEventListener('message', event => {
54
+  const replyPort = event.ports[0];
55
+  const message = event.data;
56
+  if (replyPort && message && message.type === 'skip-waiting') {
57
+    event.waitUntil(
58
+      self
59
+        .skipWaiting()
60
+        .then(
61
+          () => replyPort.postMessage({ error: null }),
62
+          error => replyPort.postMessage({ error }),
63
+        ),
64
+    );
65
+  }
66
+});