Browse Source

智慧平车界面

master
aBin 4 years ago
commit
be04802d6c
  1. 3
      .browserslistrc
  2. 8
      .editorconfig
  3. 3
      .env
  4. 10
      .env.development
  5. 10
      .env.production
  6. 47
      .eslintrc.js
  7. 23
      .gitignore
  8. 13
      .prettierrc
  9. 24
      README.md
  10. 13
      babel.config.js
  11. 1
      commitlint.config.js
  12. 13755
      package-lock.json
  13. 51
      package.json
  14. BIN
      public/favicon.ico
  15. BIN
      public/img/icons/android-chrome-192x192.png
  16. BIN
      public/img/icons/android-chrome-512x512.png
  17. BIN
      public/img/icons/android-chrome-maskable-192x192.png
  18. BIN
      public/img/icons/android-chrome-maskable-512x512.png
  19. BIN
      public/img/icons/apple-touch-icon-120x120.png
  20. BIN
      public/img/icons/apple-touch-icon-152x152.png
  21. BIN
      public/img/icons/apple-touch-icon-180x180.png
  22. BIN
      public/img/icons/apple-touch-icon-60x60.png
  23. BIN
      public/img/icons/apple-touch-icon-76x76.png
  24. BIN
      public/img/icons/apple-touch-icon.png
  25. BIN
      public/img/icons/favicon-16x16.png
  26. BIN
      public/img/icons/favicon-32x32.png
  27. BIN
      public/img/icons/msapplication-icon-144x144.png
  28. BIN
      public/img/icons/mstile-150x150.png
  29. 3
      public/img/icons/safari-pinned-tab.svg
  30. 25
      public/index.html
  31. 2
      public/robots.txt
  32. 15
      rest/http-client.env.json
  33. 72
      rest/project.http
  34. 56
      src/App.vue
  35. BIN
      src/assets/aaa.mp4
  36. BIN
      src/assets/aaa.png
  37. BIN
      src/assets/bg-bottom.png
  38. BIN
      src/assets/bg-left.png
  39. BIN
      src/assets/bg-right.png
  40. BIN
      src/assets/bg-top.png
  41. BIN
      src/assets/bg.jpg
  42. BIN
      src/assets/box-bottom.png
  43. BIN
      src/assets/box-top.png
  44. BIN
      src/assets/cz-bg.png
  45. BIN
      src/assets/cz-bg1.png
  46. 21
      src/assets/icon/iconfont.css
  47. BIN
      src/assets/icon/iconfont.eot
  48. 29
      src/assets/icon/iconfont.svg
  49. BIN
      src/assets/icon/iconfont.ttf
  50. BIN
      src/assets/icon/iconfont.woff
  51. BIN
      src/assets/rfid-bg-active.png
  52. BIN
      src/assets/rfid-bg.png
  53. BIN
      src/assets/top-video.webm
  54. 279
      src/common/portrait.styl
  55. 165
      src/components/Day/Day.vue
  56. 107
      src/components/Search/Search.vue
  57. 86
      src/components/Table/Table.vue
  58. 13
      src/config/api-user.js
  59. 13
      src/config/api.js
  60. 30
      src/config/setting.js
  61. 19
      src/config/user.js
  62. 26
      src/main.js
  63. 76
      src/plugins/ant-design-vue.js
  64. 77
      src/plugins/axios.js
  65. 34
      src/registerServiceWorker.js
  66. 22
      src/router/index.js
  67. 13
      src/store/index.js
  68. 28
      src/store/modules/home/actions.js
  69. 7
      src/store/modules/home/getters.js
  70. 6
      src/store/modules/home/index.js
  71. 24
      src/store/modules/home/mutations.js
  72. 6
      src/store/modules/home/state.js
  73. 7
      src/store/modules/messages/actions.js
  74. 3
      src/store/modules/messages/getters.js
  75. 11
      src/store/modules/messages/index.js
  76. 181
      src/store/modules/messages/mutations.js
  77. 16
      src/store/modules/messages/state.js
  78. 75
      src/views/Index/Index.vue
  79. 138
      vue.config.js
  80. 9950
      yarn.lock

3
.browserslistrc

@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead

8
.editorconfig

@ -0,0 +1,8 @@
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 140
root = true

3
.env

@ -0,0 +1,3 @@
VUE_APP_MODE=production
VUE_APP_PREVIEW=false
VUE_APP_URL=http://www.tall.wiki/

10
.env.development

@ -0,0 +1,10 @@
VUE_APP_MODE=development
VUE_APP_NODE_ENV=development
VUE_APP_SCENE=wisdomcar_counter
VUE_APP_BASE_URL=http://test.tall.wiki/
VUE_APP_API_URL=http://test.tall.wiki/gateway
VUE_APP_PROXY_URL=/gateway
VUE_APP_PUBLIC_PATH=/wisdomcar_counter
VUE_APP_MSG_URL=wss://test.tall.wiki/websocket/message/v4.0/ws
VUE_APP_TITLE=选矿系统
VUE_APP_DESCRIPTION=选矿系统

10
.env.production

@ -0,0 +1,10 @@
VUE_APP_MODE=production
VUE_APP_NODE_ENV=production
VUE_APP_SCENE=wisdomcar_counter
VUE_APP_BASE_URL=http://www.tall.wiki/
VUE_APP_API_URL=http://www.tall.wiki/gateway
VUE_APP_PROXY_URL=/gateway
VUE_APP_PUBLIC_PATH=/wisdomcar_counter
VUE_APP_MSG_URL=wss://www.tall.wiki/websocket/message/v4.0/ws
VUE_APP_TITLE=选矿系统
VUE_APP_DESCRIPTION=选矿系统

47
.eslintrc.js

@ -0,0 +1,47 @@
/*
* Copyright (c) 2019.
* author: wally
* email: 18603454788@163.com
*/
module.exports = {
root: true,
env: { browser: true, node: true },
extends: ['plugin:vue/recommended', 'plugin:vue/essential'],
rules: {
'vue/html-self-closing': 'off',
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-param-reassign': ['error', { props: true, ignorePropertyModificationsFor: ['state'] }],
'max-len': ['error', { code: 140, tabWidth: 2 }],
'object-curly-newline': ['error', { multiline: true }],
'arrow-parens': ['error', 'as-needed'],
'linebreak-style': 'off',
'vue/attributes-order': 'off',
'no-param-reassign': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/max-attributes-per-line': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/html-indent': 'off',
},
parserOptions: { parser: 'babel-eslint' },
overrides: [
{
files: ['**/__tests__/*.{j,t}s?(x)'],
env: { jest: true },
},
],
globals: {
Vue: true,
VueRouter: true,
Vuex: true,
axios: true,
_: true,
Vuetify: true,
vuetify: true,
},
};

23
.gitignore

@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

13
.prettierrc

@ -0,0 +1,13 @@
{
"printWidth": 140,
"singleQuote": true,
"semi": true,
"trailingComma": "all",
"arrowParens": "avoid",
"tabWidth": 2,
"useTabs": false,
"bracketSpacing": true,
"jsxBracketSameLine": false,
"proseWrap": "always",
"endOfLine": "lf"
}

24
README.md

@ -0,0 +1,24 @@
# 盐湖区人民医院数字看板
## Project setup
```
yarn install
```
### Compiles and hot-reloads for development
```
yarn serve
```
### Compiles and minifies for production
```
yarn build
```
### Lints and fixes files
```
yarn lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

13
babel.config.js

@ -0,0 +1,13 @@
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
plugins: [
[
"import",
{
libraryName: "ant-design-vue",
libraryDirectory: "es",
style: true
}
]
]
};

1
commitlint.config.js

@ -0,0 +1 @@
module.exports = {extends: ['./node_modules/vue-cli-plugin-commitlint/lib/lint']};

13755
package-lock.json

File diff suppressed because it is too large

51
package.json

@ -0,0 +1,51 @@
{
"name": "salt-lake-hospital",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"ant-design-vue": "^1.2.4",
"compression-webpack-plugin": "^6.1.1",
"core-js": "^3.6.5",
"echarts": "^4.9.0",
"echarts-gl": "^1.1.1",
"moment": "^2.29.1",
"register-service-worker": "^1.7.1",
"stylus": "^0.54.8",
"vue": "^2.6.11",
"vue-dompurify-html": "^2.3.0",
"vue-router": "^3.2.0",
"vuex": "^3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-pwa": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/eslint-config-prettier": "^6.0.0",
"axios": "^0.18.0",
"babel-eslint": "^10.1.0",
"babel-plugin-import": "^1.11.0",
"css-loader": "^5.0.1",
"eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-vue": "^6.2.2",
"less": "^2.7.3",
"less-loader": "^4.1.0",
"prettier": "^1.19.1",
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",
"svg-sprite-loader": "^5.0.0",
"vue-cli-plugin-ant-design": "^1.0.1",
"vue-cli-plugin-axios": "^0.0.4",
"vue-template-compiler": "^2.6.11"
}
}

BIN
public/favicon.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
public/img/icons/android-chrome-192x192.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

BIN
public/img/icons/android-chrome-512x512.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
public/img/icons/android-chrome-maskable-192x192.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
public/img/icons/android-chrome-maskable-512x512.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
public/img/icons/apple-touch-icon-120x120.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
public/img/icons/apple-touch-icon-152x152.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

BIN
public/img/icons/apple-touch-icon-180x180.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
public/img/icons/apple-touch-icon-60x60.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
public/img/icons/apple-touch-icon-76x76.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
public/img/icons/apple-touch-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
public/img/icons/favicon-16x16.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

BIN
public/img/icons/favicon-32x32.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

BIN
public/img/icons/msapplication-icon-144x144.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

BIN
public/img/icons/mstile-150x150.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

3
public/img/icons/safari-pinned-tab.svg

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.00251 14.9297L0 1.07422H6.14651L8.00251 4.27503L9.84583 1.07422H16L8.00251 14.9297Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 215 B

25
public/index.html

@ -0,0 +1,25 @@
<!--
* @Author: wally
* @email: 18603454788@163.com
* @Date: 2021-01-21 16:06:32
* @LastEditors: wally
* @LastEditTime: 2021-01-21 16:08:59
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="./favicon.ico">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>智慧平车数据统计</title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

2
public/robots.txt

@ -0,0 +1,2 @@
User-agent: *
Disallow:

15
rest/http-client.env.json

@ -0,0 +1,15 @@
{
"$shared": {
"version": "v1",
"identifier": "wally",
"credential": "111111"
},
"dev": {
"name": "dev",
"url": "http://192.168.0.99/gateway"
},
"local": {
"version": "v2",
"url": "http://192.168.0.99/gateway"
}
}

72
rest/project.http

@ -0,0 +1,72 @@
# @tall = {{url}}/tall/v1.0
@tall = http://www.tall.wiki/gateway/tall/v1.0
@greenvalley = http://www.sxwikionline.com/gateway/greenvalley
@record = https://www.tall.wiki/gateway/wisdomcar
@type = content-type: application/json;charset=utf-8
### login
# @name login
POST {{tall}}/users/signin
{{type}}
{
"client": 1,
"type": 3,
"data": {
"identifier": "song",
"credential": "999999"
}
}
### send code
GET {{tall}}/users/smscode?phone=16603418748
### phone login
# @name phonelogin
POST {{tall}}/users/signin
{{type}}
{
"client": 1,
"type": 1,
"data": {
"identifier": "16603418748",
"credential": "1111"
}
}
### 根据团队id查看研发团队相关信息
POST {{greenvalley}}/researchTeam/selectTeam
{{type}}
Authorization: Bearer {{login.response.body.$.data.token}}
{
"param": {
"company": "",
"researchDirection": "",
"teamId": 0,
"teamIntroduce": "",
"teamLeaderName": "",
"teamName": ""
}
}
### 根据团队id查看研发团队相关信息
POST {{record}}/debug/record
{{type}}
# Authorization: Bearer {{login.response.body.$.data.token}}
{
"param":{
"authId": "1",
"type": "2",
"value":"21",
"time":"1607937529000"
}
}

56
src/App.vue

@ -0,0 +1,56 @@
<!--
* @Author: wally
* @email: 18603454788@163.com
* @Date: 2021-01-21 16:06:32
* @LastEditors: wally
* @LastEditTime: 2021-01-22 14:47:59
-->
<!--
* @Author: wally
* @email: 18603454788@163.com
* @Date: 2021-01-21 16:06:32
* @LastEditors: wally
* @LastEditTime: 2021-01-22 09:18:31
-->
<template>
<a-config-provider :locale="zh_CN">
<div id="app">
<router-view class="flex-1 bg pa-3"></router-view>
</div>
</a-config-provider>
</template>
<script>
import { mapState, mapActions, mapMutations } from 'vuex';
import zh_CN from 'ant-design-vue/lib/locale-provider/zh_CN';
export default {
name: 'App',
data() {
return { zh_CN };
},
computed: mapState('home', ['anyringToken']),
methods: mapActions('home', ['getUserId']),
};
</script>
<style>
html,
body,
#app {
min-height: 100%;
}
#app {
background: transparent;
}
body::-webkit-scrollbar {
width: 0;
}
</style>
<style lang="stylus">
@import './common/portrait.styl';
</style>

BIN
src/assets/aaa.mp4

Binary file not shown.

BIN
src/assets/aaa.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 546 KiB

BIN
src/assets/bg-bottom.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 B

BIN
src/assets/bg-left.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 B

BIN
src/assets/bg-right.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 868 B

BIN
src/assets/bg-top.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
src/assets/bg.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

BIN
src/assets/box-bottom.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
src/assets/box-top.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

BIN
src/assets/cz-bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/assets/cz-bg1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

21
src/assets/icon/iconfont.css

@ -0,0 +1,21 @@
@font-face {font-family: "iconfont";
src: url('iconfont.eot?t=1606814380789'); /* IE9 */
src: url('iconfont.eot?t=1606814380789#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAALAAAsAAAAABnAAAAJ0AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCCcAp8gRABNgIkAwgLBgAEIAWEbQcvG7UFyJ6aPClS2/jAQpBlKUHgLEQQraGzf/cfBIUoGRWCjoqLMLFRrXRVrTH1bMRfztXeEwobfUDy1DOlP3OusGk5nTSH6gmFJ0tKIY+nBgQ4ZZ5fe/U+cbjXxvJA5jvvchlj0FiTJnUBxoEU0N4YbeEC+QD+h7ELXMJlAs2GJMUOR6aWoE1mzQrEm22q0JbzyzJLNQpVzcYsvio1Fp/FAXwJfx//IR9tFMrEqrh4HTag75dmZ6SPmhefIEBA20skLACZuKmNn2kUjNmoOd5kDOyrNPil1bVvE3v954mKVdwKBqDknqSu7Fb5C5DpzRiwMuoDpJaW1veXVeV5b+lxhVLteX355ZA+rS0ZjT+ex05fRr8/jR493lS0+Eefi/THEQbKv8zAm9u5cn11ob622gISIuUCqogn3i5OR1tKlzE/z2iuVkMfQC0tEYA/mX852tS7eVtLBj//5s/CKbVc+kDjvh3BP5L2bMm63LIWWZXWpgtjGs9d1awZddjd7Xusoe+G0qFR3205GwymSBpNEDN1AaUWi6g02kGzeaPbW/QQGkVuwpxNgNDpEoV235B0uiJm6hdK/f5R6YxGNLuLngNbTIXdcSBQlWgQrUZsnQfMscuOqHQBzZKniqw8ZCkoIjtEculsMTWKAYo5lkRlMy8lI0xwn4yA69DzOAkFd1CXaUvKsJDJsLo7pXXuQ4cDAlJJyEBoagibjgswv7PUUfr+AmQq8ahES1NNUIGEiN0/kZOW7UEc1QS9mu7llkiZKU+SGIIROB8xAsYhj4cjwvpxDqST0qwR0VBBxm7H+mrS6+v8r9sFzSxjEfaIpHzjuuoBAAA=') format('woff2'),
url('iconfont.woff?t=1606814380789') format('woff'),
url('iconfont.ttf?t=1606814380789') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
url('iconfont.svg?t=1606814380789#iconfont') format('svg'); /* iOS 4.1- */
}
.iconfont {
font-family: "iconfont" !important;
font-size: 14px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-local:before {
content: "\e662";
font-size: 20px;
}

BIN
src/assets/icon/iconfont.eot

Binary file not shown.

29
src/assets/icon/iconfont.svg

@ -0,0 +1,29 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<!--
2013-9-30: Created.
-->
<svg>
<metadata>
Created by iconfont
</metadata>
<defs>
<font id="iconfont" horiz-adv-x="1024" >
<font-face
font-family="iconfont"
font-weight="500"
font-stretch="normal"
units-per-em="1024"
ascent="896"
descent="-128"
/>
<missing-glyph />
<glyph glyph-name="local" unicode="&#58978;" d="M720.0256 262.9504c115.168 115.5392 115.168 303.0336 0 418.5664-114.9376 115.3088-301.12 115.3088-416.0512 0-115.168-115.5328-115.168-303.0272 0-418.56L512 54.2464l208.0256 208.704z m-506.7072-90.3616c-164.96 165.4912-164.96 433.8048 0 599.296 164.96 165.4848 432.4032 165.4848 597.3632 0 164.96-165.4912 164.96-433.8048 0-599.296L512-127.0592l-298.6816 299.648zM512 345.6c-70.6944 0-128 57.3056-128 128s57.3056 128 128 128 128-57.3056 128-128-57.3056-128-128-128z" horiz-adv-x="1024" />
</font>
</defs></svg>

After

Width:  |  Height:  |  Size: 1018 B

BIN
src/assets/icon/iconfont.ttf

Binary file not shown.

BIN
src/assets/icon/iconfont.woff

Binary file not shown.

BIN
src/assets/rfid-bg-active.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
src/assets/rfid-bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
src/assets/top-video.webm

Binary file not shown.

279
src/common/portrait.styl

@ -0,0 +1,279 @@
// padding
.pa-3 {
padding: 12px;
}
.px-2{
padding-left: 8px;
padding-right: 8px;
}
.px-3{
padding-left: 12px;
padding-right: 12px;
}
.px-10{
padding-left: 30px;
padding-right: 30px;
}
.pb-3 {
padding-bottom: 12px;
}
.pb-4 {
padding-bottom: 16px;
}
.pb-5 {
padding-bottom: 20px;
}
.pb-10 {
padding-bottom: 40px;
}
// margin
.ma-2 {
margin: 8px;
}
.ma-3 {
margin: 12px;
}
.mx-2{
margin-left: 8px;
margin-right: 8px;
}
.my-2{
margin-top: 8px;
margin-bottom: 8px;
}
.my-3{
margin-top: 12px;
margin-bottom: 12px;
}
.my-4{
margin-top: 16px;
margin-bottom: 16px;
}
.mt-1{
margin-top: 4px;
}
.mt-2{
margin-top: 8px;
}
.mt-3{
margin-top: 12px;
}
.mt-4{
margin-top: 16px;
}
.mb-1{
margin-bottom: 4px;
}
.mb-2{
margin-bottom: 8px;
}
.mb-3{
margin-bottom: 12px;
}
.mb-4{
margin-bottom: 16px;
}
.ml-2{
margin-left: 8px;
}
.ml-3{
margin-left: 12px;
}
.ml-4{
margin-left: 16px;
}
.ml-5{
margin-left: 20px;
}
.ml-6{
margin-left: 24px;
}
.ml-7{
margin-left: 28px;
}
.ml-8{
margin-left: 32px;
}
.mr-1{
margin-right: 4px;
}
.mr-2{
margin-right: 8px;
}
.mr-3{
margin-right: 12px;
}
.mr-4{
margin-right: 16px;
}
.mr-5{
margin-right: 20px;
}
.mr-6{
margin-right: 24px;
}
// background
.white {
background: white;
}
// flex
.d-flex{
display: flex;
}
.flex-wrap{
flex-wrap: wrap;
}
.flex-nowrap{
flex-wrap: nowrap;
}
.flex-column{
flex-direction: column;
}
.flex-column-reverse{
flex-direction: column-reverse;
}
.flex-row{
flex-direction: row;
}
.flex-row-reverse{
flex-direction: row-reverse;
}
.justify-center{
justify-content: center;
}
.justify-space-between{
justify-content: space-between;
}
.align-center{
align-items: center;
}
.flex-1{
display: flex;
flex: 1;
}
.flex-2{
display: flex;
flex: 2;
}
// other
.pointer{
cursor:pointer;
}
.fill-height{
height:100%;
}
// font
.font-bold-24{
font-size: 24px;
font-weight: bold;
}
.font-24{
font-size: 24px;
}
.font-bold-16{
font-size: 16px;
font-weight: bold;
}
.font-16{
font-size: 16px;
}
.font-bold-14{
font-size: 14px;
font-weight: bold;
}
.font-14{
font-size: 14px;
}
.icon-size{
font-size: 20px;
}
h2{
font-size: 24px;
font-weight: bold;
color: rgba(0,0,0,.85)
}
.textColor{
color: rgba(0,0,0,.65)
}
.baseColor{
color: #13ACC4
}
.bg{
background: #F5F5F5
}
.ant-btn-primary{
background-color: #13ACC4
border-color: #13ACC4;
}
.ant-btn-link:hover, .ant-btn-link:focus{
color: #13ACC4;
}
.fill-width{
width:100%;
}
.fill-height{
height:100%;
}

165
src/components/Day/Day.vue

@ -0,0 +1,165 @@
<template>
<!-- 选矿新版rfid图 -->
<div>
<div id="echarts" :style="{ width: '100%', height: '500px' }" class="chart-box">
<div id="Day" style="width: 100%; height: 100%"></div>
</div>
</div>
</template>
<script>
export default {
name: 'Day',
props: {
list: {
type: Array,
default: () => [],
},
},
data() {
return {
width: '',
height: '',
timer: null,
dateTiem: [],
weightDate: [],
weight1: [],
weight2: [],
start: 0,
end: 100,
};
},
computed: {
// option
option() {
return {
legend: { data: ['体重数据', 'RFID'] },
tooltip: { trigger: 'axis' },
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true,
},
xAxis: {
type: 'category',
data: this.dateTiem,
},
yAxis: {
type: 'value',
axisLabel: { formatter: '{value}' },
},
series: [
{
name: '体重数据',
type: 'line',
step: 'start',
// lineStyle: { color: '#73C0DE' },
data: this.weightDate,
},
{
name: 'RFID',
type: 'line',
markPoint: { data: this.weight1 },
// data: this.weight2,
},
],
};
},
},
watch: {
list() {
this.forList(this.list);
this.drawLine();
},
},
mounted() {
this.forList(this.list);
this.drawLine();
let wh = window.innerWidth;
let hg = window.innerHeight;
this.width = wh + 'px';
this.height = hg + 'px';
window.onresize = () => {
return (() => {
wh = window.innerWidth;
hg = window.innerHeight;
this.width = wh + 'px';
this.height = hg + 'px';
})();
};
},
methods: {
drawLine() {
// domecharts
let myChart = this.$echarts.init(document.getElementById('Day'));
//
myChart.setOption(this.option);
},
getStyle(obj, attr) {
if (obj.currentStyle) {
return obj.currentStyle[attr];
} else {
return document.defaultView.getComputedStyle(obj, null)[attr];
}
},
//
forList(list) {
this.dateTiem = [];
this.weightDate = [];
this.weight1 = [];
this.weight2 = [];
//
for (let i = 0; i < list.length; i++) {
this.dateTiem.push(this.format(parseInt(list[i].time)));
this.weight2.push(-50);
}
//
for (let i = 0; i < list.length; i++) {
this.weightDate.push(parseInt(list[i].value) / 1000);
}
// // rfid线
// for (let i = 0; i < list.length; i++) {
// let obj = {};
// if (list[i].type === 2) {
// obj = {
// value: list[i].name,
// xAxis: this.format(parseInt(list[i].time)),
// yAxis: -50,
// };
// }
// this.weight1.push(obj);
// }
// rfid线
for (let i = 0; i < list.length; i++) {
let obj = {};
if (list[i].type === 2) {
obj = {
value: list[i].name,
xAxis: this.format(parseInt(list[i].time)),
yAxis: parseInt(list[i].value) / 1000,
};
this.weight1.push(obj);
}
}
},
add0(m) {
return m < 10 ? '0' + m : m;
},
format(shijianchuo) {
//shijianchuoparseInt
var time = new Date(shijianchuo);
var y = time.getFullYear();
var m = time.getMonth() + 1;
var d = time.getDate();
var h = time.getHours();
var mm = time.getMinutes();
var s = time.getSeconds();
return y + '-' + this.add0(m) + '-' + this.add0(d) + ' ' + this.add0(h) + ':' + this.add0(mm);
},
},
};
</script>
<style lang="stylus" scoped ></style>

107
src/components/Search/Search.vue

@ -0,0 +1,107 @@
<template>
<div class="d-flex flex-wrap pb-3">
<div>
<a-date-picker
v-model="startValue"
:disabled-date="disabledStartDate"
show-time
placeholder="开始时间"
:default-value="$moment(`${timeObj.startTime}`, dateFormat)"
:format="dateFormat"
@openChange="handleStartOpenChange"
@change="getStartDate"
:allow-clear="clear"
/>
<a-date-picker
v-model="endValue"
:disabled-date="disabledEndDate"
show-time
placeholder="结束时间"
:open="endOpen"
:default-value="$moment(timeObj.endTime, dateFormat)"
:format="dateFormat"
@openChange="handleEndOpenChange"
@change="getEndDate"
:allow-clear="clear"
/>
<a-button @click="handleTableChange" class="mx-2" type="primary">搜索</a-button>
<a-button @click="downFile" icon="download" class="mx-2 down-btn" type="primary">下载</a-button>
</div>
</div>
</template>
<script>
import { weightExport } from 'config/api';
export default {
name: 'Search',
data() {
return {
timeObj: {
startTime: this.$moment(Date.parse(new Date()) - 3600 * 30 * 24 * 1000).format('YYYY-MM-DD'),
endTime: this.$moment(Date.parse(new Date())).format('YYYY-MM-DD'),
},
dateFormat: 'YYYY-MM-DD',
startValue: null,
endValue: null,
endOpen: false,
clear: false,
};
},
methods: {
disabledStartDate(startValue) {
const endValue = this.endValue;
if (!startValue || !endValue) {
return false;
}
return startValue.valueOf() > endValue.valueOf() || startValue.valueOf() < endValue.valueOf() - 3600 * 30 * 24 * 1000;
},
disabledEndDate(endValue) {
const startValue = this.startValue;
if (!endValue || !startValue) {
return false;
}
return startValue.valueOf() >= endValue.valueOf() || startValue.valueOf() < endValue.valueOf() - 3600 * 30 * 24 * 1000;
},
handleStartOpenChange(open) {
if (!open) {
this.endOpen = true;
}
},
handleEndOpenChange(open) {
this.endOpen = open;
},
getStartDate(e) {
this.timeObj.startTime = this.$moment(e._d).unix() * 1000;
},
getEndDate(e) {
this.timeObj.endTime = this.$moment(e._d).unix() * 1000;
},
handleTableChange() {
if (typeof this.timeObj.startTime === 'string') {
this.timeObj.startTime = this.$moment(this.timeObj.startTime).unix() * 1000;
}
if (typeof this.timeObj.endTime === 'string') {
this.timeObj.endTime = this.$moment(this.timeObj.endTime).unix() * 1000;
}
this.$emit('getData', this.timeObj);
},
//
downFile() {
window.open(
`http://test.tall.wiki/gateway/wisdomcar/record/weightExport?startTime=${this.timeObj.startTime}&&endTime=${this.timeObj.endTime}`,
);
},
},
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="stylus">
.down-btn {
position: absolute;
right: 25px;
}
</style>

86
src/components/Table/Table.vue

@ -0,0 +1,86 @@
<template>
<div class="main flex-1">
<div style="width: 100%" v-if="list && list.length > 0">
<a-table
:columns="columns"
:data-source="list"
:loading="loading"
:row-key="record => record.id"
bordered
class="white"
:scroll="{ y: height }"
>
<template slot="id" slot-scope="text, record, index">
<span>{{ index + 1 }}</span>
</template>
<template slot="time" slot-scope="text, record">
<span>{{ $moment(parseInt(record.time)).format('YYYY-MM-DD HH:MM:SS') }}</span>
</template>
<template slot="value" slot-scope="text, record">
<span v-if="record.type === 1">{{ record.value / 1000 }}kg</span>
<span v-if="record.type === 2">{{ record.name }}</span>
</template>
</a-table>
</div>
<a-empty v-else />
</div>
</template>
<script>
const columns = [
{
title: '序号',
align: 'center',
dataIndex: 'id',
key: 'id',
scopedSlots: { customRender: 'id' },
},
{
title: '时间',
align: 'center',
dataIndex: 'time',
key: 'time',
width: 350,
scopedSlots: { customRender: 'time' },
},
{
title: '类型',
align: 'center',
dataIndex: 'name',
key: 'name',
scopedSlots: { customRender: 'name' },
},
{
title: '数据',
align: 'center',
dataIndex: 'value',
key: 'value',
scopedSlots: { customRender: 'value' },
},
];
export default {
name: 'Table',
props: {
list: {
type: Array,
default: () => [],
},
},
data() {
return {
columns,
loading: false,
editingKey: '',
height: '',
editVisible: false,
editItem: null, //
};
},
methods: {},
};
</script>
<style scoped lang="stylus"></style>

13
src/config/api-user.js

@ -0,0 +1,13 @@
/*
* Copyright (c) 2020.
* author: wally
* email: 18603454788@163.com
*/
import axios from 'axios';
let { proxyUrl, msgUrl } = require('@/config/setting');
const tall = `${proxyUrl}/tall/v1.0`;
const users = `${tall}/users`;
// 查找用户详细信息
export const getUserId = params => axios.get(`${users}/userId`, params);

13
src/config/api.js

@ -0,0 +1,13 @@
import axios from 'axios';
let { proxyUrl, msgUrl } = require('@/config/setting');
const wisdomcar = `${proxyUrl}/wisdomcar`; // 选矿相关接口
// websocket基础地址
export const WS_BASE_URL = msgUrl;
// 智慧平车称重和rfid记录导出
// export const weightExport = params =>
// axios.get(`${wisdomcar}/record/weightExport?carId=${params.carId}&&startTime=${params.startTime}&&endTime=${params.endTime}`);
// 智慧平车称重和rfid记录统计图
export const weightList = params => axios.post(`${wisdomcar}/record/weightList`, params);

30
src/config/setting.js

@ -0,0 +1,30 @@
const title = process.env.VUE_APP_TITLE;
const description = process.env.VUE_APP_DESCRIPTION;
const baseUrl = process.env.VUE_APP_BASE_URL;
const apiUrl = process.env.VUE_APP_API_URL;
const proxyUrl = process.env.VUE_APP_PROXY_URL;
const publicPath = process.env.VUE_APP_PUBLIC_PATH;
const msgUrl = process.env.VUE_APP_MSG_URL;
module.exports = {
// 首页标题
title,
// 首页描述信息
description,
// 基础地址
baseUrl,
// api基础地址
apiUrl,
// 消息系统地址
msgUrl,
// api代理地址
proxyUrl,
// 生成文件目录 publicPath
publicPath,
};

19
src/config/user.js

@ -0,0 +1,19 @@
/*
* Copyright (c) 2019.
* author: wally
* email: 18603454788@163.com
*/
// 用户登录client
export const SIGN_IN_CLIENTS = { mp: 0, h5: 1, android: 2, ios: 3 };
// 用户登录类型
export const SIGN_IN_TYPES = {
mp: 0,
phone: 1,
email: 2,
username: 3,
wx: 4,
wx_web: 5,
wb: 6,
};

26
src/main.js

@ -0,0 +1,26 @@
// @ts-ignore
import Vue from 'vue';
import './plugins/axios';
import App from './App.vue';
import './registerServiceWorker';
import router from './router';
import store from './store';
import './plugins/ant-design-vue.js';
import 'common/portrait.styl';
import echarts from 'echarts';
import 'echarts-gl';
import 'echarts/map/js/province/shanxi.js'; //对应的省份
// Vue.use(echarts);
Vue.prototype.$echarts = echarts;
// import './assets/icon/iconfont.css';
// import VueDOMPurifyHTML from 'vue-dompurify-html';
import moment from 'moment'; //导入文件
Vue.prototype.$moment = moment; //赋值使用
Vue.config.productionTip = false;
window.vm = new Vue({
router,
store,
render: h => h(App),
}).$mount('#app');

76
src/plugins/ant-design-vue.js

@ -0,0 +1,76 @@
import Vue from 'vue';
import {
Pagination,
Button,
Input,
message,
notification,
Modal,
Tag,
Table,
Tabs,
Icon,
Empty,
Form,
Select,
Upload,
Badge,
Popconfirm,
DatePicker,
Switch,
Radio,
Dropdown,
Menu,
Row,
Col,
Timeline,
Checkbox,
BackTop,
Progress,
Carousel,
Card,
Spin,
} from 'ant-design-vue';
import { ConfigProvider } from 'ant-design-vue';
Vue.component(ConfigProvider.name, ConfigProvider);
Vue.use(Pagination);
Vue.use(Button);
Vue.use(Input);
Vue.use(Modal);
Vue.use(Tag);
Vue.use(Table);
Vue.use(Tabs);
Vue.use(Icon);
Vue.use(Empty);
Vue.use(Form);
Vue.use(Select);
Vue.use(Upload);
Vue.use(Badge);
Vue.use(Popconfirm);
Vue.use(DatePicker);
Vue.use(Switch);
Vue.use(Radio);
Vue.use(Dropdown);
Vue.use(Menu);
Vue.use(Row);
Vue.use(Col);
Vue.use(Timeline);
Vue.use(Checkbox);
Vue.use(BackTop);
Vue.use(Progress);
Vue.use(Carousel);
Vue.use(Spin);
Vue.use(Card);
Vue.prototype.$message = message;
Vue.prototype.$notification = notification;
Vue.prototype.$info = Modal.info;
Vue.prototype.$success = Modal.success;
Vue.prototype.$error = Modal.error;
Vue.prototype.$warning = Modal.warning;
Vue.prototype.$confirm = Modal.confirm;
message.config({
duration: 3,
maxCount: 3,
});

77
src/plugins/axios.js

@ -0,0 +1,77 @@
'use strict';
import Vue from 'vue';
import axios from 'axios';
import router from '../router/index';
import store from '../store/index';
// Full config: https://github.com/axios/axios#request-config
// axios.defaults.baseURL = process.env.baseURL || process.env.apiUrl || '';
// axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;
// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
let config = {
// baseURL: process.env.baseURL || process.env.apiUrl || ""
timeout: 60 * 1000, // Timeout
// withCredentials: true, // Check cross-site Access-Control
};
const _axios = axios.create(config);
axios.interceptors.request.use(
function(config) {
let token = store.state.anyringToken || sessionStorage.getItem('anyringToken');
if (token) {
config.headers.Authorization = `Bearer ${token}`;
}
return config;
},
function(error) {
// Do something with request error
return Promise.reject(error);
},
);
// Add a response interceptor
axios.interceptors.response.use(
function(response) {
if (response.data && response.data.code >= 400 && response.data.code < 500) {
store.commit('user/sign', '');
router.replace({
path: '/user/login',
query: { redirect: router.currentRoute.fullPath },
});
}
// Do something with response data
return response;
},
function(error) {
// Do something with response error
return Promise.reject(error);
},
);
Plugin.install = function(Vue) {
Vue.axios = _axios;
window.axios = _axios;
Object.defineProperties(Vue.prototype, {
axios: {
get() {
return _axios;
},
},
$axios: {
get() {
return _axios;
},
},
$http: {
get() {
return _axios;
},
},
});
};
Vue.use(Plugin);
export default Plugin;

34
src/registerServiceWorker.js

@ -0,0 +1,34 @@
/* eslint-disable no-console */
import { register } from "register-service-worker";
if (process.env.NODE_ENV === "production") {
register(`${process.env.BASE_URL}service-worker.js`, {
ready() {
console.log(
"App is being served from cache by a service worker.\n" +
"For more details, visit https://goo.gl/AFskqB"
);
},
registered() {
console.log("Service worker has been registered.");
},
cached() {
console.log("Content has been cached for offline use.");
},
updatefound() {
console.log("New content is downloading.");
},
updated() {
console.log("New content is available; please refresh.");
},
offline() {
console.log(
"No internet connection found. App is running in offline mode."
);
},
error(error) {
console.error("Error during service worker registration:", error);
}
});
}

22
src/router/index.js

@ -0,0 +1,22 @@
import Vue from 'vue';
import VueRouter from 'vue-router';
import Home from 'views/Index/Index.vue';
Vue.use(VueRouter);
const routes = [
// 首页
{
path: '/',
name: 'Home',
component: Home,
},
];
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes,
});
export default router;

13
src/store/index.js

@ -0,0 +1,13 @@
/*
* Copyright (c) 2019.
* author: wally
* email: 18603454788@163.com
*/
import Vue from 'vue';
import Vuex from 'vuex';
import home from './modules/home/index';
import messages from './modules/messages/index';
Vue.use(Vuex);
export default new Vuex.Store({ modules: { home, messages } });

28
src/store/modules/home/actions.js

@ -0,0 +1,28 @@
import axios from 'axios';
import { message } from 'ant-design-vue';
import { getUserId } from 'config/api-user';
const actions = {
/**
* 通过userId获取token
* @param {any} commit
* @param {object} params 提交的参数
*/
async getUserId({ commit }, params) {
try {
const res = await getUserId({ params });
const { code, msg, data } = res.data;
if (code === 200) {
commit('sign', data.token);
commit('setUser', data);
return data;
} else {
throw msg;
}
} catch (error) {
throw error || '获取个人信息失败';
}
},
};
export default actions;

7
src/store/modules/home/getters.js

@ -0,0 +1,7 @@
const getters = {};
// 域定制导航展示形式
// 0 -> 无特殊导航文字
// 1 -> 横向定制导航
// 2 -> 纵向定制导航
export default getters;

6
src/store/modules/home/index.js

@ -0,0 +1,6 @@
import mutations from './mutations';
import actions from './actions';
import getters from './getters';
import state from './state';
export default { namespaced: true, state, getters, mutations, actions };

24
src/store/modules/home/mutations.js

@ -0,0 +1,24 @@
const mutations = {
/**
* 设置token
* @param { object } state
* @param { string } token
*/
sign(state, token) {
state.anyringToken = token;
sessionStorage.setItem('anyringToken', token);
},
/**
* 设置user用户信息
* @param {object} state
* @param {object} user {id, account, phone}
*/
setUser(state, user) {
if (!user) return;
state.user = { ...user };
sessionStorage.setItem('user', JSON.stringify(user));
},
};
export default mutations;

6
src/store/modules/home/state.js

@ -0,0 +1,6 @@
const state = {
anyringToken: '',
user: { id: '', phone: '', account: '' },
};
export default state;

7
src/store/modules/messages/actions.js

@ -0,0 +1,7 @@
import http from 'axios';
import { message } from 'ant-design-vue';
import {} from 'config/api';
const actions = {};
export default actions;

3
src/store/modules/messages/getters.js

@ -0,0 +1,3 @@
const getters = {};
export default getters;

11
src/store/modules/messages/index.js

@ -0,0 +1,11 @@
/*
* Copyright (c) 2019.
* author: wally
* email: 18603454788@163.com
*/
import mutations from './mutations';
import actions from './actions';
import getters from './getters';
import state from './state';
export default { namespaced: true, state, getters, mutations, actions };

181
src/store/modules/messages/mutations.js

@ -0,0 +1,181 @@
const mutations = {
/**
* 初始化消息栈
* @param {object} state
* @param {string} type
* type:
* syncMessages 同步消息栈
* checkMessages 交付物消息栈
* faultMessages 故障消息 未处理消息栈
* faults 所有的故障消息栈
*/
messagesInit(state, type) {
const messages = localStorage.getItem(type) ? JSON.parse(localStorage.getItem(type)) : [];
state[type] = messages;
},
/**
* 将新 消息添加到 消息栈 最前边
* @param { object } state
* @param { object } data
* data: message, type
* message 消息对象
* type:
* syncMessages 同步消息栈
* checkMessages 交付物消息栈
* faultMessages 故障消息 未处理消息栈
* faults 所有的故障消息栈
*
* cache: boolean true 本地存储 false 不存储
*/
messagesAdd(state, data) {
const messages = state[data.type];
if (messages.length > 0) {
const result = messages.find(msg => msg.id === data.message.id);
if (result) return;
}
messages.unshift(data.message);
// eslint-disable-next-line no-param-reassign
state[data.type] = messages;
if (data.cache) {
localStorage.setItem(data.type, JSON.stringify(messages));
}
},
/**
* 通过消息id移除指定 同步 消息
* @param { object } state
* @param { object } data
* data: messageId, type
* messageId: 要移除的消息的messageId
* type:
* syncMessages 同步消息栈
* checkMessages 交付物消息栈
* faultMessages 故障消息 未处理消息栈
* faults 所有的故障消息栈
* cache: boolean true 本地存储 false 不存储
*/
messagesRemoveById(state, data) {
const messages = state[data.type];
const index = messages.findIndex(msg => msg.id === data.messageId);
if (index < 0) return;
messages.splice(index, 1);
// eslint-disable-next-line no-param-reassign
state[data.type] = messages;
if (data.cache) {
localStorage.setItem(data.type, JSON.stringify(messages));
}
},
/**
* 清除指定type的消息
* @param {any} state
* @param {object} data
* data: type, cache
*/
messagesClear(state, data) {
state[data.type] = [];
if (data.cache) {
localStorage.removeItem(data.type);
}
},
/**
* 添加体重消息
* @param {*} state
* @param {*} data
*/
messagesAddWeight(state, data) {
state.weightMessage = data;
},
/**
* 添加RFID消息
* @param {*} state
* @param {*} data
*/
messagesAddRfid(state, data) {
state.rfidMessage = data;
},
/**
* 添加称重传感器一消息
* @param {*} state
* @param {*} data
*/
messagesAddWeighSensor1(state, data) {
state.weighSensor1 = data;
},
/**
* 添加称重传感器二消息
* @param {*} state
* @param {*} data
*/
messagesAddWeighSensor2(state, data) {
state.weighSensor2 = data;
},
/**
* 添加称重传感器三消息
* @param {*} state
* @param {*} data
*/
messagesAddWeighSensor3(state, data) {
state.weighSensor3 = data;
},
/**
* 添加称重传感器四消息
* @param {*} state
* @param {*} data
*/
messagesAddWeighSensor4(state, data) {
state.weighSensor4 = data;
},
/**
* 添加震动传感器消息
* @param {*} state
* @param {*} data
*/
messagesAddVibrationSensor(state, data) {
state.vibrationSensor = data;
},
/**
* 添加溶栓剂量总量消息
* @param {*} state
* @param {*} data
*/
messagesAddThrombolyticDose(state, data) {
state.thrombolyticDose = data;
},
/**
* 添加团注剂量消息
* @param {*} state
* @param {*} data
*/
messagesAddBolusDose(state, data) {
state.bolusDose = data;
},
/**
* 添加维持剂量消息
* @param {*} state
* @param {*} data
*/
messagesAddMaintenanceDose(state, data) {
state.maintenanceDose = data;
},
/**
* 重新开始
* @param {*} state
* @param {*} data
*/
setStartMessages(state, data) {
state.startMessages = data;
},
};
export default mutations;

16
src/store/modules/messages/state.js

@ -0,0 +1,16 @@
const state = {
startMessages: false, // 是否重新开始 true为开始
syncMessages: [], // 同步消息
weightMessage: 0, // 体重
rfidMessage: null, // RFID
weighSensor1: 0, // 称重传感器一
weighSensor2: 0, // 称重传感器二
weighSensor3: 0, // 称重传感器三
weighSensor4: 0, // 称重传感器四
vibrationSensor: null, // 震动传感器
thrombolyticDose: 0, // 溶栓剂量(总量)
bolusDose: 0, // 团注剂量
maintenanceDose: 0, // 维持剂量
};
export default state;

75
src/views/Index/Index.vue

@ -0,0 +1,75 @@
<template>
<div>
<div class="fill-width mb-3">
<a-card style="width: 100%; height: 100px; margin-bottom: 12px">
<Search @getData="getData" />
</a-card>
<a-card style="width: 100%; height: 600px; margin-bottom: 12px" title="平车记录">
<Day :list="list" v-if="list.length > 0" />
<a-empty v-else />
</a-card>
<a-card style="width: 100%; height: auto">
<Table :list="list" />
</a-card>
</div>
</div>
</template>
<script>
import { mapActions } from 'vuex';
import Day from 'components/Day/Day.vue';
import Search from 'components/Search/Search.vue';
import Table from 'components/Table/Table.vue';
import { weightList } from 'config/api';
export default {
name: 'Index',
components: { Day, Search, Table },
data() {
return {
list: [],
str: '',
};
},
async created() {
await this.getData();
},
methods: {
async getData(timeData) {
try {
const params = {
param: {
carId: 1,
startTime: timeData && timeData.startTime ? timeData.startTime : Date.parse(new Date()) - 3600 * 30 * 24 * 1000,
endTime: timeData && timeData.endTime ? timeData.endTime : Date.parse(new Date()),
},
};
const res = await weightList(params);
const { code, data, msg } = res.data;
if (code === 200) {
let { list } = this;
list = data;
this.list = [...list];
// this.list = data;
} else {
this.$message.error(msg);
}
} catch (error) {
this.$message.error(error);
}
},
},
};
</script>
<style lang="stylus" scoped>
.weight-box {
margin-top: 14px;
text-align: left;
padding-left: 10%;
padding-top: 10px;
font-size: 18px;
font-weight: bold;
}
</style>

138
vue.config.js

@ -0,0 +1,138 @@
/*
* Copyright (c) 2019.
* author: wally
* email: 18603454788@163.com
*/
const path = require('path');
const productionGzipExtensions = /\.(js|css|json|txt|html|ico|svg|ttf|woff|woff2)(\?.*)?$/i;
const CompressionWebpackPlugin = require('compression-webpack-plugin');
const resolve = dir => path.join(__dirname, dir);
const isPro = process.env.VUE_APP_NODE_ENV === 'production';
const publicPath = process.env.VUE_APP_PUBLIC_PATH;
const proxyUrl = process.env.VUE_APP_PROXY_URL;
const apiUrl = process.env.VUE_APP_API_URL;
const title = process.env.VUE_APP_TITLE;
console.log('proxyUrl: ', proxyUrl);
console.log('apiUrl: ', apiUrl);
// 本地环境是否需要使用cdn
const devNeedCdn = true;
// cdn 链接及配置
const cdn = {
css: [
'https://cdn.jsdelivr.net/npm/@mdi/font@5.x/css/materialdesignicons.min.css',
'https://cdn.bootcdn.net/ajax/libs/ant-design-vue/1.6.5/antd.min.css',
],
js: [
isPro ? 'https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.min.js' : 'https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.js',
'https://cdn.bootcdn.net/ajax/libs/vue-router/3.4.3/vue-router.min.js',
'https://cdn.bootcdn.net/ajax/libs/vuex/3.5.1/vuex.min.js',
'https://cdn.bootcdn.net/ajax/libs/moment.js/2.9.0/moment.min.js',
'https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.20/lodash.min.js',
'https://cdn.bootcdn.net/ajax/libs/axios/0.20.0/axios.min.js',
'https://cdn.bootcdn.net/ajax/libs/ant-design-vue/1.6.5/antd.min.js',
],
// externals: {
// vue: 'Vue',
// vuex: 'Vuex',
// 'vue-router': 'VueRouter',
// moment: 'moment',
// axios: 'axios',
// 'ant-design-vue': 'antd',
// lodash: '_',
// },
};
module.exports = {
lintOnSave: true,
publicPath: isPro ? publicPath : '/',
devServer: {
open: true,
overlay: {
warnings: false,
errors: true,
},
proxy: {
[proxyUrl]: {
target: apiUrl, // 代理接口
changeOrigin: true,
pathRewrite: { [`^${proxyUrl}`]: '' },
},
},
},
productionSourceMap: false, // 去掉生产环境的sourcemap 加快构建速度
configureWebpack: {
// provide the app's title in webpack's name field, so that
// it can be accessed in index.html to inject the correct title.
name: title,
resolve: {
alias: {
'~': __dirname,
'@': resolve('src'),
assets: resolve('src/assets'),
views: resolve('src/views'),
components: resolve('src/components'),
common: resolve('src/common'),
config: resolve('src/config'),
router: resolve('src/router'),
store: resolve('src/store'),
util: resolve('src/util'),
request: resolve('src/request'),
},
},
plugins: isPro
? [
new CompressionWebpackPlugin({
test: productionGzipExtensions,
threshold: 10240,
deleteOriginalAssets: false,
}),
]
: [],
externals: isPro || devNeedCdn ? cdn.externals : {},
},
chainWebpack(config) {
if (isPro) {
config.optimization
.runtimeChunk('single')
.minimize(true)
.splitChunks({
chunks: 'all',
maxInitialRequests: Infinity,
minSize: 20000, // 依赖包超过20000bit将被单独打包
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name(module) {
// get the name. E.g. node_modules/packageName/not/this/part.js
// or node_modules/packageName
const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
// npm package names are URL-safe, but some servers don't like @ symbols
return `npm.${packageName.replace('@', '')}`;
},
},
},
});
}
// set svg-sprite-loader
// config.module
// .rule('svg')
// .exclude.add(resolve('src/icons'))
// .end();
// config.module
// .rule('icons')
// .test(/\.svg$/)
// .include.add(resolve('src/icons'))
// .end()
// .use('svg-sprite-loader')
// .loader('svg-sprite-loader')
// .options({ symbolId: 'icon-[name]' })
// .end();
},
};

9950
yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save