Procházet zdrojové kódy

Merge branch 'master' of http://git.ycjcjy.com/nanyang/machinery-admin

李志伟 před 3 roky
rodič
revize
00865d626a

+ 1
- 0
package.json Zobrazit soubor

@@ -47,6 +47,7 @@
47 47
   ],
48 48
   "dependencies": {
49 49
     "@amap/amap-jsapi-loader": "^1.0.1",
50
+    "@ant-design/charts": "^1.3.5",
50 51
     "@ant-design/icons": "^4.7.0",
51 52
     "@ant-design/pro-card": "^1.18.34",
52 53
     "@ant-design/pro-descriptions": "^1.10.0",

+ 6
- 0
public/css/hyzlsJ-embed.css
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


binární
src/assets/images/screen/bg.png Zobrazit soubor


+ 19
- 0
src/components/ScreenBox/SquareBox/index.jsx Zobrazit soubor

@@ -0,0 +1,19 @@
1
+
2
+
3
+import './style.less'
4
+export default (props) => {
5
+
6
+
7
+  return (
8
+    <div className="win">
9
+      <div className="border_corner border_corner_left_top" />
10
+      <div className="border_corner border_corner_right_top" />
11
+      <div className="border_corner border_corner_left_bottom" />
12
+      <div className="border_corner border_corner_right_bottom" />
13
+      {/* 内容 */}
14
+      <div className="main">
15
+        {props.children}
16
+      </div>
17
+    </div>
18
+  )
19
+}

+ 41
- 0
src/components/ScreenBox/SquareBox/style.less Zobrazit soubor

@@ -0,0 +1,41 @@
1
+.win {
2
+  position: relative;
3
+  display: inline-block;
4
+  margin: 20px;
5
+}
6
+.main {
7
+  color: #fff;
8
+  border: 1px solid rgba(61, 129, 240, 0.5);
9
+  border-radius: 4px;
10
+}
11
+.border_corner {
12
+  position: absolute;
13
+  width: 4px;
14
+  height: 4px;
15
+  background-color: #67ffff;
16
+  border-radius: 50%;
17
+}
18
+.border_corner_left_top {
19
+  top: 0;
20
+  left: -2px;
21
+  border-right: none;
22
+  border-bottom: none;
23
+}
24
+.border_corner_right_top {
25
+  top: 0;
26
+  right: -2px;
27
+  border-bottom: none;
28
+  border-left: none;
29
+}
30
+.border_corner_left_bottom {
31
+  bottom: 0;
32
+  left: -2px;
33
+  border-top: none;
34
+  border-right: none;
35
+}
36
+.border_corner_right_bottom {
37
+  right: -2px;
38
+  bottom: 0;
39
+  border-top: none;
40
+  border-left: none;
41
+}

+ 13
- 0
src/components/ScreenBox/TitleBox/index.jsx Zobrazit soubor

@@ -0,0 +1,13 @@
1
+
2
+
3
+import './style.less'
4
+
5
+export default (props) => {
6
+  const { value } = props
7
+  return (
8
+    <div className='TitleBox'>
9
+      <div className='TitleBox-ListBox' />
10
+      <span>{value}</span>
11
+    </div>
12
+  )
13
+}

+ 22
- 0
src/components/ScreenBox/TitleBox/style.less Zobrazit soubor

@@ -0,0 +1,22 @@
1
+.TitleBox {
2
+  display: flex;
3
+  align-items: center;
4
+  width: 163px;
5
+  padding: 11px 9px 9px 11px;
6
+  border-radius: 4px;
7
+  box-shadow: 0px 0px 10px 0px #3d81f0 inset;
8
+
9
+  .TitleBox-ListBox {
10
+    width: 13px;
11
+    height: 13px;
12
+    margin-right: 10px;
13
+    background: linear-gradient(0deg, #0c49c6, #3bd6e8);
14
+  }
15
+  > span {
16
+    color: transparent;
17
+    font-weight: 800;
18
+    font-size: 17px;
19
+    background: linear-gradient(0deg, #0c49c6, #3bd6e8);
20
+    background-clip: text;
21
+  }
22
+}

+ 43
- 0
src/pages/MonitoringScreen/hook.js Zobrazit soubor

@@ -0,0 +1,43 @@
1
+import React, { useCallback, useEffect, useRef, useState } from 'react';
2
+import useResize from '@/utils/hooks/useResize';
3
+
4
+export function useFullScreen() {
5
+  const [style, setStyle] = useState({});
6
+  const [isFullScreen, setIsFullScreen] = useState(false);
7
+  const fullScreenRef = useRef();
8
+  fullScreenRef.current = isFullScreen;
9
+
10
+  const calcStyle = useCallback(() => {
11
+    const container = document.querySelector('main.ant-layout-content');
12
+    const header = container.querySelector('.ant-pro-page-container-warp');
13
+    const height = container.offsetHeight - header.offsetHeight;
14
+
15
+    setStyle({
16
+      width: '100%',
17
+      height: `${height}px`,
18
+    });
19
+  }, []);
20
+
21
+  const onFullScreen = useCallback((e) => {
22
+    document.documentElement.requestFullscreen();
23
+  }, []);
24
+
25
+  useResize((w, h) => {
26
+    if (fullScreenRef.current) {
27
+      calcStyle();
28
+    } else {
29
+      setStyle({
30
+        width: `${w}px`,
31
+        height: `${h}px`,
32
+      });
33
+    }
34
+
35
+    setIsFullScreen(!fullScreenRef.current);
36
+  });
37
+
38
+  useEffect(() => {
39
+    calcStyle();
40
+  }, []);
41
+
42
+  return { style, isFullScreen, onFullScreen };
43
+}

+ 28
- 39
src/pages/MonitoringScreen/index.jsx Zobrazit soubor

@@ -1,49 +1,38 @@
1
-import React from 'react';
1
+import React, { useCallback, useEffect, useRef, useState } from 'react';
2 2
 import { history, Link } from 'umi';
3
+import classNames from 'classnames';
3 4
 // import { getPersonList, exportPersonList } from '@/services/person';
4 5
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
5
-import moment from 'moment';
6
-import PageTable from '@/components/PageTable';
7
-
8
-const formatterTime = (val) => {
9
-  return val ? moment(val).format('YYYY-MM-DD HH:mm:ss') : '';
10
-};
6
+import { FullscreenOutlined } from '@ant-design/icons';
7
+import { Button } from 'antd';
8
+import { useFullScreen } from './hook';
9
+import Styles from './style.less';
11 10
 
12 11
 export default (props) => {
13
-  const columns = [
14
-    {
15
-      title: '农机名',
16
-      dataIndex: 'machineryName',
17
-      key: 'machineryName',
18
-    },
19
-    {
20
-      title: '农机型号',
21
-      dataIndex: 'type',
22
-      key: 'type',
23
-    },
24
-    {
25
-      title: '操作',
26
-      valueType: 'option',
27
-      width: '300px',
28
-      render: (_, record) => [
29
-        <Link key={2} to={`./detail.jsx`}>
30
-          查看轨迹
31
-        </Link>,
32
-      ],
33
-    },
34
-    // 农机列表点击进入详情页 下面是轨迹上面是时间
35
-  ];
12
+  const { style, isFullScreen, onFullScreen } = useFullScreen();
36 13
 
37 14
   return (
38
-    <PageHeaderWrapper>
39
-      <PageTable
40
-        // request={getPersonList}
41
-        // expfunc={exportPersonList}
42
-        columns={columns}
43
-        rowKey="machineryId"
44
-        options={false}
45
-        scroll={{ x: 1000 }}
46
-      />
15
+    <PageHeaderWrapper
16
+      extra={
17
+        <Button icon={<FullscreenOutlined />} onClick={onFullScreen}>
18
+          全屏
19
+        </Button>
20
+      }
21
+    >
22
+      <div
23
+        className={classNames(Styles['screen-page'], { [Styles['full-screen']]: isFullScreen })}
24
+        style={style}
25
+      >
26
+        <div className={Styles['grail-layout']}>
27
+          <div className={Styles['grail-header']}></div>
28
+          <div className={Styles['grail-container']}>
29
+            <div className={Styles['grail-left']}></div>
30
+            <div className={Styles['grail-content']}></div>
31
+            <div className={Styles['grail-right']}></div>
32
+          </div>
33
+          <div className={Styles['grail-footer']}></div>
34
+        </div>
35
+      </div>
47 36
     </PageHeaderWrapper>
48 37
   );
49 38
 };

+ 48
- 0
src/pages/MonitoringScreen/style.less Zobrazit soubor

@@ -0,0 +1,48 @@
1
+.screen-page {
2
+  position: relative;
3
+  width: 100%;
4
+  height: 100%;
5
+
6
+  background-color: #021222;
7
+  background-image: url('~@/assets/images/screen/bg.png');
8
+  background-repeat: no-repeat;
9
+  background-size: 100% 100%;
10
+
11
+  &.full-screen {
12
+    position: fixed;
13
+    top: 0;
14
+    left: 0;
15
+    z-index: 1000;
16
+  }
17
+
18
+  .grail-layout {
19
+    height: 100%;
20
+
21
+    .grail-header,
22
+    .grail-footer {
23
+      //
24
+    }
25
+
26
+    .grail-container {
27
+      display: flex;
28
+      height: 100%;
29
+
30
+      .grail-left,
31
+      .grail-right {
32
+        flex: 1;
33
+      }
34
+
35
+      .grail-content {
36
+        flex: 2;
37
+      }
38
+    }
39
+  }
40
+}
41
+
42
+.demo {
43
+  font-size: 3em;
44
+  font-family: 'hyzlsJ';
45
+  background-image: linear-gradient(#3bd6e8, #0c49c6);
46
+  background-clip: text;
47
+  -webkit-text-fill-color: transparent;
48
+}

+ 48
- 1
src/pages/SystemManagement/UserRights/index.jsx Zobrazit soubor

@@ -1,7 +1,54 @@
1 1
 
2 2
 
3
+
4
+import SquareBox from '@/components/ScreenBox/SquareBox'
5
+import TitleBox from '@/components/ScreenBox/TitleBox'
6
+import { Bar } from '@ant-design/plots';
7
+// import ba from './a.png'
8
+
3 9
 export default (props) => {
10
+
11
+
12
+  const style = {
13
+    bgd: {
14
+      color: 'rgba(0,0,0,.25)',
15
+      height: '100vh',
16
+      // backgroundImage: `url(${ba})`,
17
+      backgroundSize: '100%,100%',
18
+      padding: '5em 10em'
19
+    }
20
+  }
21
+  const data = [
22
+    {
23
+      year: '收割机',
24
+      value: 200,
25
+    },
26
+    {
27
+      year: '播种机',
28
+      value: 150,
29
+    },
30
+    {
31
+      year: '农药机',
32
+      value: 50,
33
+    },
34
+  ];
35
+  const config = {
36
+    data,
37
+    xField: 'value',
38
+    yField: 'year',
39
+    seriesField: 'year',
40
+    legend: {
41
+      position: 'top-left',
42
+    },
43
+    color: [' #FB9900', '#23E8AE', '#E63404'],
44
+  };
45
+
4 46
   return (
5
-    <div>用户权限</div>
47
+    <div style={style.bgd} >
48
+      <TitleBox value='农机类型统计' />
49
+      <SquareBox>
50
+        <Bar  {...config} />
51
+      </SquareBox>
52
+    </div>
6 53
   )
7 54
 }

+ 1
- 0
src/pages/document.ejs Zobrazit soubor

@@ -23,6 +23,7 @@
23 23
       content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
24 24
     />
25 25
     <title>Ant Design Pro</title>
26
+    <link rel="stylesheet" href="./css/hyzlsJ-embed.css" />
26 27
     <link rel="icon" href="<%= context.config.publicPath +'favicon.ico'%>" type="image/x-icon" />
27 28
   </head>
28 29
   <body>

+ 28
- 0
src/services/PlatformMessageManagement.js Zobrazit soubor

@@ -0,0 +1,28 @@
1
+
2
+/**
3
+ * @表格展示
4
+ * 
5
+ */
6
+
7
+
8
+
9
+
10
+/**
11
+ * @增加
12
+ * 
13
+ */
14
+
15
+
16
+
17
+/**
18
+ * @删除
19
+ * 
20
+ */
21
+
22
+
23
+
24
+
25
+/**
26
+ * @修改
27
+ * 
28
+ */

+ 8
- 8
src/services/swagger/pet.js Zobrazit soubor

@@ -4,7 +4,7 @@
4 4
 import { request } from 'umi';
5 5
 /** Update an existing pet PUT /pet */
6 6
 
7
-export async function updatePet(body, options) {
7
+export async function updatePet (body, options) {
8 8
   return request('/pet', {
9 9
     method: 'PUT',
10 10
     headers: {
@@ -16,7 +16,7 @@ export async function updatePet(body, options) {
16 16
 }
17 17
 /** Add a new pet to the store POST /pet */
18 18
 
19
-export async function addPet(body, options) {
19
+export async function addPet (body, options) {
20 20
   return request('/pet', {
21 21
     method: 'POST',
22 22
     headers: {
@@ -28,7 +28,7 @@ export async function addPet(body, options) {
28 28
 }
29 29
 /** Finds Pets by status Multiple status values can be provided with comma separated strings GET /pet/findByStatus */
30 30
 
31
-export async function findPetsByStatus(params, options) {
31
+export async function findPetsByStatus (params, options) {
32 32
   return request('/pet/findByStatus', {
33 33
     method: 'GET',
34 34
     params: { ...params },
@@ -37,7 +37,7 @@ export async function findPetsByStatus(params, options) {
37 37
 }
38 38
 /** Finds Pets by tags Muliple tags can be provided with comma separated strings. Use         tag1, tag2, tag3 for testing. GET /pet/findByTags */
39 39
 
40
-export async function findPetsByTags(params, options) {
40
+export async function findPetsByTags (params, options) {
41 41
   return request('/pet/findByTags', {
42 42
     method: 'GET',
43 43
     params: { ...params },
@@ -46,7 +46,7 @@ export async function findPetsByTags(params, options) {
46 46
 }
47 47
 /** Find pet by ID Returns a single pet GET /pet/${param0} */
48 48
 
49
-export async function getPetById(params, options) {
49
+export async function getPetById (params, options) {
50 50
   const { petId: param0 } = params;
51 51
   return request(`/pet/${param0}`, {
52 52
     method: 'GET',
@@ -56,7 +56,7 @@ export async function getPetById(params, options) {
56 56
 }
57 57
 /** Updates a pet in the store with form data POST /pet/${param0} */
58 58
 
59
-export async function updatePetWithForm(params, body, options) {
59
+export async function updatePetWithForm (params, body, options) {
60 60
   const { petId: param0 } = params;
61 61
   const formData = new FormData();
62 62
   Object.keys(body).forEach((ele) => {
@@ -78,7 +78,7 @@ export async function updatePetWithForm(params, body, options) {
78 78
 }
79 79
 /** Deletes a pet DELETE /pet/${param0} */
80 80
 
81
-export async function deletePet(params, options) {
81
+export async function deletePet (params, options) {
82 82
   const { petId: param0 } = params;
83 83
   return request(`/pet/${param0}`, {
84 84
     method: 'DELETE',
@@ -88,7 +88,7 @@ export async function deletePet(params, options) {
88 88
 }
89 89
 /** uploads an image POST /pet/${param0}/uploadImage */
90 90
 
91
-export async function uploadFile(params, body, options) {
91
+export async function uploadFile (params, body, options) {
92 92
   const { petId: param0 } = params;
93 93
   const formData = new FormData();
94 94
   Object.keys(body).forEach((ele) => {

+ 17
- 0
src/utils/hooks/useResize.js Zobrazit soubor

@@ -0,0 +1,17 @@
1
+import { useEffect, useRef } from 'react';
2
+
3
+export default (fn) => {
4
+  const fnRef = useRef();
5
+  fnRef.current = fn;
6
+
7
+  useEffect(() => {
8
+    const resize = () => {
9
+      const { clientWidth, clientHeight } = document.documentElement;
10
+      fnRef.current(clientWidth, clientHeight);
11
+    };
12
+
13
+    window.addEventListener('resize', resize);
14
+
15
+    return () => window.removeEventListener('resize', resize);
16
+  }, []);
17
+};