chore: initial commit
22
.gitignore
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw*
|
||||
/dist-MES/
|
||||
29
README.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# MES
|
||||
|
||||
## Project setup
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
npm run serve
|
||||
```
|
||||
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
|
||||
### Run your tests
|
||||
```
|
||||
npm run test
|
||||
```
|
||||
|
||||
### Lints and fixes files
|
||||
```
|
||||
npm run lint
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||
5
babel.config.js
Normal file
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@vue/app'
|
||||
]
|
||||
}
|
||||
30633
package-lock.json
generated
Normal file
392
package.json
Normal file
@@ -0,0 +1,392 @@
|
||||
{
|
||||
"name": "mes",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint",
|
||||
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.21.4",
|
||||
"echarts": "^5.2.0",
|
||||
"element-ui": "^2.15.7",
|
||||
"file-saver": "^2.0.2",
|
||||
"js-cookie": "^2.2.1",
|
||||
"js-export-excel": "^1.1.2",
|
||||
"mint-ui": "^2.2.13",
|
||||
"mqtt": "^4.3.7",
|
||||
"pdfjs-dist": "^5.4.149",
|
||||
"qrcode": "^1.4.4",
|
||||
"qs": "^6.9.0",
|
||||
"sass-loader": "^7.3.1",
|
||||
"swiper": "^4.5.1",
|
||||
"uuid": "^8.3.2",
|
||||
"vue": "^2.6.6",
|
||||
"vue-awesome-swiper": "^3.1.3",
|
||||
"vue-jsonp": "^0.1.8",
|
||||
"vue-router": "^3.0.1",
|
||||
"vue-seamless-scroll": "^1.1.21",
|
||||
"vuex": "^3.0.1",
|
||||
"xlsx": "^0.17.1",
|
||||
"xlsx-style": "^0.8.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "^3.5.0",
|
||||
"@vue/cli-plugin-eslint": "^3.5.0",
|
||||
"@vue/cli-service": "^3.5.0",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"eslint": "^6.8.0",
|
||||
"eslint-plugin-vue": "^9.13.0",
|
||||
"jquery": "^3.6.4",
|
||||
"sass": "^1.62.0",
|
||||
"script-loader": "^0.7.2",
|
||||
"svg-sprite-loader": "^5.1.1",
|
||||
"vue-particles": "^1.0.9",
|
||||
"vue-template-compiler": "^2.5.21"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"plugin:vue/essential",
|
||||
"eslint:recommended"
|
||||
],
|
||||
"rules": {
|
||||
"vue/multi-word-component-names": [
|
||||
"error",
|
||||
{
|
||||
"ignores": [
|
||||
"index",
|
||||
"template"
|
||||
]
|
||||
}
|
||||
],
|
||||
"vue/max-attributes-per-line": [
|
||||
"off",
|
||||
{
|
||||
"singleline": {
|
||||
"max": 1
|
||||
},
|
||||
"multiline": {
|
||||
"max": 1
|
||||
}
|
||||
}
|
||||
],
|
||||
"vue/name-property-casing": "off",
|
||||
"accessor-pairs": 2,
|
||||
"arrow-spacing": [
|
||||
2,
|
||||
{
|
||||
"before": true,
|
||||
"after": true
|
||||
}
|
||||
],
|
||||
"block-spacing": [
|
||||
2,
|
||||
"always"
|
||||
],
|
||||
"brace-style": [
|
||||
2,
|
||||
"1tbs",
|
||||
{
|
||||
"allowSingleLine": true
|
||||
}
|
||||
],
|
||||
"camelcase": [
|
||||
0
|
||||
],
|
||||
"comma-dangle": [
|
||||
2,
|
||||
"never"
|
||||
],
|
||||
"comma-spacing": [
|
||||
2,
|
||||
{
|
||||
"before": false,
|
||||
"after": true
|
||||
}
|
||||
],
|
||||
"comma-style": [
|
||||
2,
|
||||
"last"
|
||||
],
|
||||
"constructor-super": 2,
|
||||
"curly": [
|
||||
2,
|
||||
"multi-line"
|
||||
],
|
||||
"dot-location": [
|
||||
2,
|
||||
"property"
|
||||
],
|
||||
"eol-last": 2,
|
||||
"eqeqeq": [
|
||||
2,
|
||||
"allow-null"
|
||||
],
|
||||
"generator-star-spacing": [
|
||||
2,
|
||||
{
|
||||
"before": true,
|
||||
"after": true
|
||||
}
|
||||
],
|
||||
"handle-callback-err": [
|
||||
2,
|
||||
"^(err|error)$"
|
||||
],
|
||||
"indent": [
|
||||
2,
|
||||
2,
|
||||
{
|
||||
"SwitchCase": 1
|
||||
}
|
||||
],
|
||||
"jsx-quotes": [
|
||||
2,
|
||||
"prefer-single"
|
||||
],
|
||||
"key-spacing": [
|
||||
2,
|
||||
{
|
||||
"beforeColon": false,
|
||||
"afterColon": true
|
||||
}
|
||||
],
|
||||
"keyword-spacing": [
|
||||
2,
|
||||
{
|
||||
"before": true,
|
||||
"after": true
|
||||
}
|
||||
],
|
||||
"new-cap": [
|
||||
2,
|
||||
{
|
||||
"newIsCap": true,
|
||||
"capIsNew": false
|
||||
}
|
||||
],
|
||||
"new-parens": 2,
|
||||
"no-array-constructor": 2,
|
||||
"no-caller": 2,
|
||||
"no-console": "off",
|
||||
"no-class-assign": 2,
|
||||
"no-cond-assign": 2,
|
||||
"no-const-assign": 2,
|
||||
"no-control-regex": 2,
|
||||
"no-delete-var": 2,
|
||||
"no-dupe-args": 2,
|
||||
"no-dupe-class-members": 2,
|
||||
"no-dupe-keys": 2,
|
||||
"no-duplicate-case": 2,
|
||||
"no-empty-character-class": 2,
|
||||
"no-empty-pattern": 2,
|
||||
"no-eval": 2,
|
||||
"no-ex-assign": 2,
|
||||
"no-extend-native": 2,
|
||||
"no-extra-bind": 2,
|
||||
"no-extra-boolean-cast": 2,
|
||||
"no-extra-parens": [
|
||||
2,
|
||||
"functions"
|
||||
],
|
||||
"no-fallthrough": 2,
|
||||
"no-floating-decimal": 2,
|
||||
"no-func-assign": 2,
|
||||
"no-implied-eval": 2,
|
||||
"no-inner-declarations": [
|
||||
2,
|
||||
"functions"
|
||||
],
|
||||
"no-invalid-regexp": 2,
|
||||
"no-irregular-whitespace": 2,
|
||||
"no-iterator": 2,
|
||||
"no-label-var": 2,
|
||||
"no-labels": [
|
||||
2,
|
||||
{
|
||||
"allowLoop": false,
|
||||
"allowSwitch": false
|
||||
}
|
||||
],
|
||||
"no-lone-blocks": 2,
|
||||
"no-mixed-spaces-and-tabs": 2,
|
||||
"no-multi-spaces": 2,
|
||||
"no-multi-str": 2,
|
||||
"no-multiple-empty-lines": [
|
||||
2,
|
||||
{
|
||||
"max": 1
|
||||
}
|
||||
],
|
||||
"no-native-reassign": 2,
|
||||
"no-negated-in-lhs": 2,
|
||||
"no-new-object": 2,
|
||||
"no-new-require": 2,
|
||||
"no-new-symbol": 2,
|
||||
"no-new-wrappers": 2,
|
||||
"no-obj-calls": 2,
|
||||
"no-octal": 2,
|
||||
"no-octal-escape": 2,
|
||||
"no-path-concat": 2,
|
||||
"no-proto": 2,
|
||||
"no-redeclare": 2,
|
||||
"no-regex-spaces": 2,
|
||||
"no-return-assign": [
|
||||
2,
|
||||
"except-parens"
|
||||
],
|
||||
"no-self-assign": 2,
|
||||
"no-self-compare": 2,
|
||||
"no-sequences": 2,
|
||||
"no-shadow-restricted-names": 2,
|
||||
"no-spaced-func": 2,
|
||||
"no-sparse-arrays": 2,
|
||||
"no-this-before-super": 2,
|
||||
"no-throw-literal": 2,
|
||||
"no-trailing-spaces": 2,
|
||||
"no-undef": 2,
|
||||
"no-undef-init": 2,
|
||||
"no-unexpected-multiline": 2,
|
||||
"no-unmodified-loop-condition": 2,
|
||||
"no-unneeded-ternary": [
|
||||
2,
|
||||
{
|
||||
"defaultAssignment": false
|
||||
}
|
||||
],
|
||||
"no-unreachable": 2,
|
||||
"no-unsafe-finally": 2,
|
||||
"no-unused-vars": [
|
||||
2,
|
||||
{
|
||||
"vars": "all",
|
||||
"args": "none"
|
||||
}
|
||||
],
|
||||
"no-useless-call": 2,
|
||||
"no-useless-computed-key": 2,
|
||||
"no-useless-constructor": 2,
|
||||
"no-useless-escape": 0,
|
||||
"no-whitespace-before-property": 2,
|
||||
"no-with": 2,
|
||||
"one-var": [
|
||||
2,
|
||||
{
|
||||
"initialized": "never"
|
||||
}
|
||||
],
|
||||
"operator-linebreak": [
|
||||
2,
|
||||
"after",
|
||||
{
|
||||
"overrides": {
|
||||
"?": "before",
|
||||
":": "before"
|
||||
}
|
||||
}
|
||||
],
|
||||
"padded-blocks": [
|
||||
2,
|
||||
"never"
|
||||
],
|
||||
"quotes": [
|
||||
2,
|
||||
"single",
|
||||
{
|
||||
"avoidEscape": true,
|
||||
"allowTemplateLiterals": true
|
||||
}
|
||||
],
|
||||
"semi": [
|
||||
2,
|
||||
"never"
|
||||
],
|
||||
"semi-spacing": [
|
||||
2,
|
||||
{
|
||||
"before": false,
|
||||
"after": true
|
||||
}
|
||||
],
|
||||
"space-before-blocks": [
|
||||
2,
|
||||
"always"
|
||||
],
|
||||
"space-before-function-paren": [
|
||||
2,
|
||||
"never"
|
||||
],
|
||||
"space-in-parens": [
|
||||
2,
|
||||
"never"
|
||||
],
|
||||
"space-infix-ops": 2,
|
||||
"space-unary-ops": [
|
||||
2,
|
||||
{
|
||||
"words": true,
|
||||
"nonwords": false
|
||||
}
|
||||
],
|
||||
"spaced-comment": [
|
||||
2,
|
||||
"always",
|
||||
{
|
||||
"markers": [
|
||||
"global",
|
||||
"globals",
|
||||
"eslint",
|
||||
"eslint-disable",
|
||||
"*package",
|
||||
"!",
|
||||
","
|
||||
]
|
||||
}
|
||||
],
|
||||
"template-curly-spacing": [
|
||||
2,
|
||||
"never"
|
||||
],
|
||||
"use-isnan": 2,
|
||||
"valid-typeof": 2,
|
||||
"wrap-iife": [
|
||||
2,
|
||||
"any"
|
||||
],
|
||||
"yield-star-spacing": [
|
||||
2,
|
||||
"both"
|
||||
],
|
||||
"yoda": [
|
||||
2,
|
||||
"never"
|
||||
],
|
||||
"prefer-const": 2,
|
||||
"object-curly-spacing": [
|
||||
2,
|
||||
"always",
|
||||
{
|
||||
"objectsInObjects": false
|
||||
}
|
||||
],
|
||||
"array-bracket-spacing": [
|
||||
2,
|
||||
"never"
|
||||
]
|
||||
},
|
||||
"parserOptions": {
|
||||
"parser": "babel-eslint"
|
||||
}
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not ie <= 8"
|
||||
]
|
||||
}
|
||||
BIN
public/CreamImg/视觉图片1.jpg
Normal file
|
After Width: | Height: | Size: 474 KiB |
BIN
public/CreamImg/视觉图片2.jpg
Normal file
|
After Width: | Height: | Size: 501 KiB |
BIN
public/MES.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
11
public/config.js
Normal file
@@ -0,0 +1,11 @@
|
||||
window.g = {
|
||||
mqttClient: null,
|
||||
mqttSubscriptionTopic: 'MES/InstantMessaging/XD_GLKG/',
|
||||
mqttPublishTopic: 'WEB/InstantMessaging/XD_GLKG/MisServer',
|
||||
mqttIP: '127.0.0.1',
|
||||
// mqttIP: '192.168.1.200',
|
||||
mqttPortNumber: '8083',
|
||||
baseURL: 'http://127.0.0.1:10040/submit/MESCommonBase.ashx',
|
||||
// baseURL: 'http://192.168.1.200:10000/submit/MESCommonBase.ashx',
|
||||
apiBaseURL: 'http://127.0.0.1:9982'
|
||||
}
|
||||
BIN
public/favicon.ico
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
public/favicon2.ico
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
26
public/index.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta content="IE=edge" http-equiv="X-UA-Compatible">
|
||||
<meta content="width=device-width,initial-scale=1.0" name="viewport">
|
||||
<link href="<%= BASE_URL %>favicon.ico" rel="icon">
|
||||
<title>MES工位系统</title>
|
||||
<script type="text/javascript">
|
||||
document.write("<script src='./config.js?v=" + new Date().getTime() + "'><\/script>");
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but MES 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>
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
background: white;
|
||||
}
|
||||
</style>
|
||||
BIN
public/leftPic.jpg
Normal file
|
After Width: | Height: | Size: 766 KiB |
BIN
public/login.png
Normal file
|
After Width: | Height: | Size: 625 KiB |
BIN
public/rightPic.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
17
src/App.vue
Normal file
@@ -0,0 +1,17 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<router-view />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
#app {
|
||||
font-family: MiSans Bold, serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
color: #2c3e50;
|
||||
}
|
||||
.el-table tbody tr:hover > td {
|
||||
background-color: unset !important
|
||||
}
|
||||
</style>
|
||||
44
src/api/login.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
import state from '@/store'
|
||||
import router from '@/router'
|
||||
export function login(username, password) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
UserID: state.state.user.id,
|
||||
ModularID: router.currentRoute.path,
|
||||
type: '1',
|
||||
name: '菜单模块系统_用户名密码_查询数据_改造新增',
|
||||
param: `用户名=${username}&密码=${password}`
|
||||
}
|
||||
})
|
||||
}
|
||||
//
|
||||
export function getInfo(token) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
UserID: state.state.user.id,
|
||||
ModularID: router.currentRoute.path,
|
||||
type: '1',
|
||||
name: '菜单模块系统_项目角色模块列表_二级_查询数据',
|
||||
param: `角色编号=${token}`
|
||||
}
|
||||
})
|
||||
}
|
||||
// 修改密码
|
||||
export function editPassword(num1, num2, num3, num4) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
UserID: state.state.user.id,
|
||||
ModularID: router.currentRoute.path,
|
||||
type: '2',
|
||||
name: '账号信息_修改密码_MESWORK',
|
||||
param: '考勤编号=' + num1 + '=string&原始密码=' + num2 + '=string&新密码=' + num3 + '=string&返回=' + num4 + '=string=output'
|
||||
}
|
||||
})
|
||||
}
|
||||
BIN
src/assets/font/MiSans-Bold.ttf
Normal file
BIN
src/assets/font/MiSans-Demibold.ttf
Normal file
BIN
src/assets/font/MiSans-ExtraLight.ttf
Normal file
BIN
src/assets/font/MiSans-Heavy.ttf
Normal file
BIN
src/assets/font/MiSans-Light.ttf
Normal file
BIN
src/assets/font/MiSans-Medium.ttf
Normal file
BIN
src/assets/font/MiSans-Normal.ttf
Normal file
BIN
src/assets/font/MiSans-Regular.ttf
Normal file
BIN
src/assets/font/MiSans-Semibold.ttf
Normal file
BIN
src/assets/font/MiSans-Thin.ttf
Normal file
70
src/assets/font/Misans.css
Normal file
@@ -0,0 +1,70 @@
|
||||
@font-face {
|
||||
font-family: MiSans Demibold;
|
||||
src: url("MiSans-Demibold.ttf");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: block;
|
||||
}
|
||||
@font-face {
|
||||
font-family: MiSans Bold;
|
||||
src: url("MiSans-Bold.ttf");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: block;
|
||||
}
|
||||
@font-face {
|
||||
font-family: MiSans ExtraLight;
|
||||
src: url("MiSans-ExtraLight.ttf");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: block;
|
||||
}
|
||||
@font-face {
|
||||
font-family: MiSans Heavy;
|
||||
src: url("MiSans-Heavy.ttf");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: block;
|
||||
}
|
||||
@font-face {
|
||||
font-family: MiSans Light;
|
||||
src: url("MiSans-Light.ttf");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: block;
|
||||
}
|
||||
@font-face {
|
||||
font-family: MiSans Medium;
|
||||
src: url("MiSans-Medium.ttf");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: block;
|
||||
}
|
||||
@font-face {
|
||||
font-family: MiSans Normal;
|
||||
src: url("MiSans-Normal.ttf");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: block;
|
||||
}
|
||||
@font-face {
|
||||
font-family: MiSans Regular;
|
||||
src: url("MiSans-Regular.ttf");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: block;
|
||||
}
|
||||
@font-face {
|
||||
font-family: MiSans Semibold;
|
||||
src: url("MiSans-Semibold.ttf");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: block;
|
||||
}
|
||||
@font-face {
|
||||
font-family: MiSans Thin;
|
||||
src: url("MiSans-Thin.ttf");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: block;
|
||||
}
|
||||
BIN
src/assets/image/Andon.png
Normal file
|
After Width: | Height: | Size: 426 B |
BIN
src/assets/image/DeviceManagement.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
src/assets/image/Init.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
src/assets/image/MESlogo.png
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
src/assets/image/MatchFail.png
Normal file
|
After Width: | Height: | Size: 55 KiB |
BIN
src/assets/image/MatchSuccess.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
src/assets/image/MaterialPull.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
src/assets/image/MeasureFail.png
Normal file
|
After Width: | Height: | Size: 62 KiB |
BIN
src/assets/image/MeasureSuccess.png
Normal file
|
After Width: | Height: | Size: 62 KiB |
BIN
src/assets/image/OperationGuide.png
Normal file
|
After Width: | Height: | Size: 625 B |
BIN
src/assets/image/OrderCompletion.png
Normal file
|
After Width: | Height: | Size: 338 B |
BIN
src/assets/image/PassNoSuccess.png
Normal file
|
After Width: | Height: | Size: 62 KiB |
BIN
src/assets/image/PassSuccess-assets/PassSuccess.png
Normal file
|
After Width: | Height: | Size: 62 KiB |
BIN
src/assets/image/PassSuccess.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
BIN
src/assets/image/PassSuccess.psd
Normal file
BIN
src/assets/image/Pdf.png
Normal file
|
After Width: | Height: | Size: 620 B |
BIN
src/assets/image/QualityInquiry.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
src/assets/image/RepairManagement.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
src/assets/image/StartWorkCircle.gif
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
src/assets/image/alarm.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
src/assets/image/andon_c.png
Normal file
|
After Width: | Height: | Size: 698 B |
BIN
src/assets/image/andon_d.png
Normal file
|
After Width: | Height: | Size: 556 B |
BIN
src/assets/image/andon_e.png
Normal file
|
After Width: | Height: | Size: 745 B |
BIN
src/assets/image/andon_ng.png
Normal file
|
After Width: | Height: | Size: 648 B |
BIN
src/assets/image/andon_q.png
Normal file
|
After Width: | Height: | Size: 527 B |
BIN
src/assets/image/andon_qua.png
Normal file
|
After Width: | Height: | Size: 576 B |
BIN
src/assets/image/blinkrectangle.gif
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
src/assets/image/bluerectangle.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
src/assets/image/boltnew.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
src/assets/image/bule.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
src/assets/image/call.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
src/assets/image/caozuo.png
Normal file
|
After Width: | Height: | Size: 752 KiB |
BIN
src/assets/image/green.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
src/assets/image/greenFace.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
src/assets/image/green_bolt.gif
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
src/assets/image/greenrectangle.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
src/assets/image/grey.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
src/assets/image/leftPic.png
Normal file
|
After Width: | Height: | Size: 766 KiB |
BIN
src/assets/image/leftPic2.png
Normal file
|
After Width: | Height: | Size: 9.5 KiB |
BIN
src/assets/image/logo.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
src/assets/image/nothing.png
Normal file
|
After Width: | Height: | Size: 152 B |
BIN
src/assets/image/orderINOUT.png
Normal file
|
After Width: | Height: | Size: 789 B |
BIN
src/assets/image/partFinish.png
Normal file
|
After Width: | Height: | Size: 630 B |
BIN
src/assets/image/passNG.png
Normal file
|
After Width: | Height: | Size: 648 B |
BIN
src/assets/image/passOK.png
Normal file
|
After Width: | Height: | Size: 622 B |
BIN
src/assets/image/passOn.png
Normal file
|
After Width: | Height: | Size: 566 B |
BIN
src/assets/image/passRate.png
Normal file
|
After Width: | Height: | Size: 699 B |
BIN
src/assets/image/red.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
src/assets/image/redFace.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
src/assets/image/redrectangle.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
src/assets/image/reset.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
src/assets/image/rightPic.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
src/assets/logo.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
49
src/directive/clipboard/clipboard.js
Normal file
@@ -0,0 +1,49 @@
|
||||
// Inspired by https://github.com/Inndy/vue-clipboard2
|
||||
const Clipboard = require('clipboard')
|
||||
if (!Clipboard) {
|
||||
throw new Error('you shold npm install `clipboard` --save at first ')
|
||||
}
|
||||
|
||||
export default {
|
||||
bind(el, binding) {
|
||||
if (binding.arg === 'success') {
|
||||
el._v_clipboard_success = binding.value
|
||||
} else if (binding.arg === 'error') {
|
||||
el._v_clipboard_error = binding.value
|
||||
} else {
|
||||
const clipboard = new Clipboard(el, {
|
||||
text() { return binding.value },
|
||||
action() { return binding.arg === 'cut' ? 'cut' : 'copy' }
|
||||
})
|
||||
clipboard.on('success', e => {
|
||||
const callback = el._v_clipboard_success
|
||||
callback && callback(e) // eslint-disable-line
|
||||
})
|
||||
clipboard.on('error', e => {
|
||||
const callback = el._v_clipboard_error
|
||||
callback && callback(e) // eslint-disable-line
|
||||
})
|
||||
el._v_clipboard = clipboard
|
||||
}
|
||||
},
|
||||
update(el, binding) {
|
||||
if (binding.arg === 'success') {
|
||||
el._v_clipboard_success = binding.value
|
||||
} else if (binding.arg === 'error') {
|
||||
el._v_clipboard_error = binding.value
|
||||
} else {
|
||||
el._v_clipboard.text = function() { return binding.value }
|
||||
el._v_clipboard.action = function() { return binding.arg === 'cut' ? 'cut' : 'copy' }
|
||||
}
|
||||
},
|
||||
unbind(el, binding) {
|
||||
if (binding.arg === 'success') {
|
||||
delete el._v_clipboard_success
|
||||
} else if (binding.arg === 'error') {
|
||||
delete el._v_clipboard_error
|
||||
} else {
|
||||
el._v_clipboard.destroy()
|
||||
delete el._v_clipboard
|
||||
}
|
||||
}
|
||||
}
|
||||
13
src/directive/clipboard/index.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import Clipboard from './clipboard'
|
||||
|
||||
const install = function(Vue) {
|
||||
Vue.directive('Clipboard', Clipboard)
|
||||
}
|
||||
|
||||
if (window.Vue) {
|
||||
window.clipboard = Clipboard
|
||||
Vue.use(install); // eslint-disable-line
|
||||
}
|
||||
|
||||
Clipboard.install = install
|
||||
export default Clipboard
|
||||
46
src/directive/el-dragDialog/drag.js
Normal file
@@ -0,0 +1,46 @@
|
||||
export default{
|
||||
bind(el, binding) {
|
||||
const dialogHeaderEl = el.querySelector('.el-dialog__header')
|
||||
const dragDom = el.querySelector('.el-dialog')
|
||||
dialogHeaderEl.style = 'cursor:move;'
|
||||
|
||||
// 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
|
||||
const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null)
|
||||
|
||||
dialogHeaderEl.onmousedown = (e) => {
|
||||
// 鼠标按下,计算当前元素距离可视区的距离
|
||||
const disX = e.clientX - dialogHeaderEl.offsetLeft
|
||||
const disY = e.clientY - dialogHeaderEl.offsetTop
|
||||
|
||||
// 获取到的值带px 正则匹配替换
|
||||
let styL, styT
|
||||
|
||||
// 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
|
||||
if (sty.left.includes('%')) {
|
||||
styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100)
|
||||
styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100)
|
||||
} else {
|
||||
styL = +sty.left.replace(/\px/g, '')
|
||||
styT = +sty.top.replace(/\px/g, '')
|
||||
}
|
||||
|
||||
document.onmousemove = function(e) {
|
||||
// 通过事件委托,计算移动的距离
|
||||
const l = e.clientX - disX
|
||||
const t = e.clientY - disY
|
||||
|
||||
// 移动当前元素
|
||||
dragDom.style.left = `${l + styL}px`
|
||||
dragDom.style.top = `${t + styT}px`
|
||||
|
||||
// 将此时的位置传出去
|
||||
// binding.value({x:e.pageX,y:e.pageY})
|
||||
}
|
||||
|
||||
document.onmouseup = function(e) {
|
||||
document.onmousemove = null
|
||||
document.onmouseup = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
13
src/directive/el-dragDialog/index.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import drag from './drag'
|
||||
|
||||
const install = function(Vue) {
|
||||
Vue.directive('el-drag-dialog', drag)
|
||||
}
|
||||
|
||||
if (window.Vue) {
|
||||
window['el-drag-dialog'] = drag
|
||||
Vue.use(install); // eslint-disable-line
|
||||
}
|
||||
|
||||
drag.install = install
|
||||
export default drag
|
||||
91
src/directive/sticky.js
Normal file
@@ -0,0 +1,91 @@
|
||||
const vueSticky = {}
|
||||
let listenAction
|
||||
vueSticky.install = Vue => {
|
||||
Vue.directive('sticky', {
|
||||
inserted(el, binding) {
|
||||
const params = binding.value || {}
|
||||
const stickyTop = params.stickyTop || 0
|
||||
const zIndex = params.zIndex || 1000
|
||||
const elStyle = el.style
|
||||
|
||||
elStyle.position = '-webkit-sticky'
|
||||
elStyle.position = 'sticky'
|
||||
// if the browser support css sticky(Currently Safari, Firefox and Chrome Canary)
|
||||
// if (~elStyle.position.indexOf('sticky')) {
|
||||
// elStyle.top = `${stickyTop}px`;
|
||||
// elStyle.zIndex = zIndex;
|
||||
// return
|
||||
// }
|
||||
const elHeight = el.getBoundingClientRect().height
|
||||
const elWidth = el.getBoundingClientRect().width
|
||||
elStyle.cssText = `top: ${stickyTop}px; z-index: ${zIndex}`
|
||||
|
||||
const parentElm = el.parentNode || document.documentElement
|
||||
const placeholder = document.createElement('div')
|
||||
placeholder.style.display = 'none'
|
||||
placeholder.style.width = `${elWidth}px`
|
||||
placeholder.style.height = `${elHeight}px`
|
||||
parentElm.insertBefore(placeholder, el)
|
||||
|
||||
let active = false
|
||||
|
||||
const getScroll = (target, top) => {
|
||||
const prop = top ? 'pageYOffset' : 'pageXOffset'
|
||||
const method = top ? 'scrollTop' : 'scrollLeft'
|
||||
let ret = target[prop]
|
||||
if (typeof ret !== 'number') {
|
||||
ret = window.document.documentElement[method]
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
const sticky = () => {
|
||||
if (active) {
|
||||
return
|
||||
}
|
||||
if (!elStyle.height) {
|
||||
elStyle.height = `${el.offsetHeight}px`
|
||||
}
|
||||
|
||||
elStyle.position = 'fixed'
|
||||
elStyle.width = `${elWidth}px`
|
||||
placeholder.style.display = 'inline-block'
|
||||
active = true
|
||||
}
|
||||
|
||||
const reset = () => {
|
||||
if (!active) {
|
||||
return
|
||||
}
|
||||
|
||||
elStyle.position = ''
|
||||
placeholder.style.display = 'none'
|
||||
active = false
|
||||
}
|
||||
|
||||
const check = () => {
|
||||
const scrollTop = getScroll(window, true)
|
||||
const offsetTop = el.getBoundingClientRect().top
|
||||
if (offsetTop < stickyTop) {
|
||||
sticky()
|
||||
} else {
|
||||
if (scrollTop < elHeight + stickyTop) {
|
||||
reset()
|
||||
}
|
||||
}
|
||||
}
|
||||
listenAction = () => {
|
||||
check()
|
||||
}
|
||||
|
||||
window.addEventListener('scroll', listenAction)
|
||||
},
|
||||
|
||||
unbind() {
|
||||
window.removeEventListener('scroll', listenAction)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export default vueSticky
|
||||
|
||||
13
src/directive/waves/index.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import waves from './waves'
|
||||
|
||||
const install = function(Vue) {
|
||||
Vue.directive('waves', waves)
|
||||
}
|
||||
|
||||
if (window.Vue) {
|
||||
window.waves = waves
|
||||
Vue.use(install); // eslint-disable-line
|
||||
}
|
||||
|
||||
waves.install = install
|
||||
export default waves
|
||||
26
src/directive/waves/waves.css
Normal file
@@ -0,0 +1,26 @@
|
||||
.waves-ripple {
|
||||
position: absolute;
|
||||
border-radius: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.15);
|
||||
background-clip: padding-box;
|
||||
pointer-events: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
-webkit-transform: scale(0);
|
||||
-ms-transform: scale(0);
|
||||
transform: scale(0);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.waves-ripple.z-active {
|
||||
opacity: 0;
|
||||
-webkit-transform: scale(2);
|
||||
-ms-transform: scale(2);
|
||||
transform: scale(2);
|
||||
-webkit-transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out;
|
||||
transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out;
|
||||
transition: opacity 1.2s ease-out, transform 0.6s ease-out;
|
||||
transition: opacity 1.2s ease-out, transform 0.6s ease-out, -webkit-transform 0.6s ease-out;
|
||||
}
|
||||
42
src/directive/waves/waves.js
Normal file
@@ -0,0 +1,42 @@
|
||||
import './waves.css'
|
||||
|
||||
export default{
|
||||
bind(el, binding) {
|
||||
el.addEventListener('click', e => {
|
||||
const customOpts = Object.assign({}, binding.value)
|
||||
const opts = Object.assign({
|
||||
ele: el, // 波纹作用元素
|
||||
type: 'hit', // hit点击位置扩散center中心点扩展
|
||||
color: 'rgba(0, 0, 0, 0.15)' // 波纹颜色
|
||||
}, customOpts)
|
||||
const target = opts.ele
|
||||
if (target) {
|
||||
target.style.position = 'relative'
|
||||
target.style.overflow = 'hidden'
|
||||
const rect = target.getBoundingClientRect()
|
||||
let ripple = target.querySelector('.waves-ripple')
|
||||
if (!ripple) {
|
||||
ripple = document.createElement('span')
|
||||
ripple.className = 'waves-ripple'
|
||||
ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + 'px'
|
||||
target.appendChild(ripple)
|
||||
} else {
|
||||
ripple.className = 'waves-ripple'
|
||||
}
|
||||
switch (opts.type) {
|
||||
case 'center':
|
||||
ripple.style.top = (rect.height / 2 - ripple.offsetHeight / 2) + 'px'
|
||||
ripple.style.left = (rect.width / 2 - ripple.offsetWidth / 2) + 'px'
|
||||
break
|
||||
default:
|
||||
ripple.style.top = (e.pageY - rect.top - ripple.offsetHeight / 2 - document.body.scrollTop) + 'px'
|
||||
ripple.style.left = (e.pageX - rect.left - ripple.offsetWidth / 2 - document.body.scrollLeft) + 'px'
|
||||
}
|
||||
ripple.style.backgroundColor = opts.color
|
||||
ripple.className = 'waves-ripple z-active'
|
||||
return false
|
||||
}
|
||||
}, false)
|
||||
}
|
||||
}
|
||||
|
||||
67
src/main.js
Normal file
@@ -0,0 +1,67 @@
|
||||
import Vue from 'vue'
|
||||
import 'element-ui/lib/theme-chalk/index.css'
|
||||
import App from './App.vue'
|
||||
import store from './store/index'
|
||||
import ElementUI from 'element-ui'
|
||||
import router from './router'
|
||||
import * as echarts from 'echarts'
|
||||
import curd from '@/utils/curd'
|
||||
import elDragDialog from '@/directive/el-dragDialog'
|
||||
// import '@/styles/index.scss' // global css
|
||||
import VueParticles from 'vue-particles'
|
||||
import jsonp from 'vue-jsonp'
|
||||
|
||||
// 新通讯11/12---<
|
||||
import service from '@/utils/request'
|
||||
import scroll from 'vue-seamless-scroll'
|
||||
import mqtt from 'mqtt'
|
||||
|
||||
// 关闭点弹窗周围关闭功能 -- 20200218
|
||||
ElementUI.Dialog.props.closeOnClickModal.default = false
|
||||
Vue.prototype.ExecDatabase = function(num) {
|
||||
return service({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: num
|
||||
})
|
||||
}
|
||||
|
||||
Vue.use(elDragDialog)
|
||||
Vue.use(scroll)
|
||||
Vue.use(VueParticles)
|
||||
Vue.use(curd)
|
||||
Vue.use(jsonp)
|
||||
Vue.use(ElementUI)
|
||||
Vue.prototype.echarts = echarts
|
||||
Vue.prototype.mqtt = mqtt
|
||||
Vue.config.productionTip = true
|
||||
Vue.directive('loadmore', {
|
||||
bind(el, binding) {
|
||||
var p = 0
|
||||
var t = 0
|
||||
var down = true
|
||||
var selectWrap = el.querySelector('.el-table__body-wrapper')
|
||||
selectWrap.addEventListener('scroll', function() {
|
||||
// 判断是否向下滚动
|
||||
p = this.scrollTop
|
||||
// if ( t < p){down=true}else{down=false}
|
||||
if (t < p) {
|
||||
down = true
|
||||
} else {
|
||||
down = false
|
||||
}
|
||||
t = p
|
||||
// 判断是否到底
|
||||
const sign = 10
|
||||
const scrollDistance = this.scrollHeight - this.scrollTop - this.clientHeight
|
||||
if (scrollDistance <= sign && down) {
|
||||
binding.value()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
new Vue({
|
||||
store,
|
||||
router,
|
||||
render: h => h(App)
|
||||
}).$mount('#app')
|
||||
98
src/router/index.js
Normal file
@@ -0,0 +1,98 @@
|
||||
import Vue from 'vue'
|
||||
import Router from 'vue-router'
|
||||
import layout from '@/views/layout/index.vue'
|
||||
import Login from '@/views/Login/index.vue'
|
||||
import OperationGuide from '@/views/OperationGuide/index.vue'
|
||||
import OrderCompletion from '@/views/OrderCompletion/index.vue'
|
||||
import QualityInquiry from '@/views/QualityInquiry/index.vue'
|
||||
import OrderData from '@/views/OrderData/index.vue'
|
||||
import Andon from '@/views/Andon/index.vue'
|
||||
import DeviceManagement from '@/views/EquipmentMaintenance/index.vue'
|
||||
import MaterialPull from '@/views/MaterialPull/index.vue'
|
||||
import RepairManagement from '@/views/RepairManagement/index.vue'
|
||||
import WorkPlanData from '@/views/WorkPlanData/index.vue'
|
||||
import MaterialData from '@/views/MaterialData/index.vue'
|
||||
|
||||
Vue.use(Router)
|
||||
const originalPush = Router.prototype.push
|
||||
|
||||
Router.prototype.push = function push(location) {
|
||||
return originalPush.call(this, location).catch(err => err)
|
||||
}
|
||||
|
||||
export const constantRouterMap = [{
|
||||
path: '/',
|
||||
name: 'Login',
|
||||
component: Login
|
||||
},
|
||||
{
|
||||
path: '/layout',
|
||||
name: 'layout',
|
||||
component: layout,
|
||||
children: [{
|
||||
path: '/OperationGuide',
|
||||
name: 'OperationGuide',
|
||||
component: OperationGuide
|
||||
// meta: {
|
||||
// keepAlive: true
|
||||
// }
|
||||
},
|
||||
{
|
||||
path: '/OperationGuidePdf',
|
||||
name: 'OperationGuidePdf',
|
||||
component: () => import('@/views/OperationGuidePdf/index.vue')
|
||||
},
|
||||
{
|
||||
path: '/OrderCompletion',
|
||||
name: 'OrderCompletion',
|
||||
component: OrderCompletion
|
||||
},
|
||||
{
|
||||
path: '/QualityInquiry',
|
||||
name: 'QualityInquiry',
|
||||
component: QualityInquiry
|
||||
},
|
||||
{
|
||||
path: '/OrderData',
|
||||
name: 'OrderData',
|
||||
component: OrderData
|
||||
},
|
||||
{
|
||||
path: '/Andon',
|
||||
name: 'Andon',
|
||||
component: Andon
|
||||
},
|
||||
{
|
||||
path: '/DeviceManagement',
|
||||
name: 'DeviceManagement',
|
||||
component: DeviceManagement
|
||||
},
|
||||
{
|
||||
path: '/MaterialPull',
|
||||
name: 'MaterialPull',
|
||||
component: MaterialPull
|
||||
},
|
||||
{
|
||||
path: '/RepairManagement',
|
||||
name: 'RepairManagement',
|
||||
component: RepairManagement
|
||||
},
|
||||
{
|
||||
path: '/WorkPlanData',
|
||||
name: 'WorkPlanData',
|
||||
component: WorkPlanData
|
||||
},
|
||||
{
|
||||
path: '/MaterialData',
|
||||
name: 'MaterialData',
|
||||
component: MaterialData
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
export default new Router({
|
||||
scrollBehavior: () => ({
|
||||
y: 0
|
||||
}),
|
||||
routes: constantRouterMap
|
||||
})
|
||||
26
src/store/getters.js
Normal file
@@ -0,0 +1,26 @@
|
||||
const getters = {
|
||||
sidebar: state => state.app.sidebar,
|
||||
device: state => state.app.device,
|
||||
token: state => state.user.token,
|
||||
avatar: state => state.user.avatar,
|
||||
name: state => state.user.name,
|
||||
roles: state => state.user.roles,
|
||||
visitedViews: state => state.tagsView.visitedViews,
|
||||
cachedViews: state => state.tagsView.cachedViews,
|
||||
permission_routers: state => state.permission.routers,
|
||||
addRouters: state => state.permission.addRouters,
|
||||
id: state => state.user.id,
|
||||
processList_table: state => state.operationGuide.processList_table,
|
||||
materialList_table: state => state.operationGuide.materialList_table,
|
||||
pic: state => state.operationGuide.pic,
|
||||
partAssemblyInformation: state => state.operationGuide.partAssemblyInformation,
|
||||
engineValue: state => state.station.engineValue,
|
||||
tighteningPosition: state => state.operationGuide.tighteningPosition,
|
||||
smile: state => state.operationGuide.smile,
|
||||
greenBoltInformation: state => state.operationGuide.greenBoltInformation,
|
||||
account: state => state.user.account,
|
||||
orderCompletion_table: state => state.orderCompletion.orderCompletion_table,
|
||||
statusValue: state => state.station.statusValue,
|
||||
tempDataObject: state => state.station.tempDataObject
|
||||
}
|
||||
export default getters
|
||||
29
src/store/index.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
import app from './modules/app'
|
||||
import tagsView from './modules/tagsView'
|
||||
import user from './modules/user'
|
||||
import orderCompletion from './modules/orderCompletion'
|
||||
import permission from './modules/permission'
|
||||
import station from './modules/station'
|
||||
import operationGuide from './modules/operationGuide'
|
||||
import mqttServer from './modules/mqttServer'
|
||||
import getters from './getters'
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
const store = new Vuex.Store({
|
||||
modules: {
|
||||
app,
|
||||
user,
|
||||
tagsView,
|
||||
permission,
|
||||
station,
|
||||
operationGuide,
|
||||
mqttServer,
|
||||
orderCompletion
|
||||
},
|
||||
getters
|
||||
})
|
||||
|
||||
export default store
|
||||
43
src/store/modules/app.js
Normal file
@@ -0,0 +1,43 @@
|
||||
import Cookies from 'js-cookie'
|
||||
|
||||
const app = {
|
||||
state: {
|
||||
sidebar: {
|
||||
opened: !+Cookies.get('sidebarStatus'),
|
||||
withoutAnimation: false
|
||||
},
|
||||
device: 'desktop'
|
||||
},
|
||||
mutations: {
|
||||
TOGGLE_SIDEBAR: state => {
|
||||
if (state.sidebar.opened) {
|
||||
Cookies.set('sidebarStatus', 1)
|
||||
} else {
|
||||
Cookies.set('sidebarStatus', 0)
|
||||
}
|
||||
state.sidebar.opened = !state.sidebar.opened
|
||||
state.sidebar.withoutAnimation = false
|
||||
},
|
||||
CLOSE_SIDEBAR: (state, withoutAnimation) => {
|
||||
Cookies.set('sidebarStatus', 1)
|
||||
state.sidebar.opened = false
|
||||
state.sidebar.withoutAnimation = withoutAnimation
|
||||
},
|
||||
TOGGLE_DEVICE: (state, device) => {
|
||||
state.device = device
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
ToggleSideBar: ({ commit }) => {
|
||||
commit('TOGGLE_SIDEBAR')
|
||||
},
|
||||
CloseSideBar({ commit }, { withoutAnimation }) {
|
||||
commit('CLOSE_SIDEBAR', withoutAnimation)
|
||||
},
|
||||
ToggleDevice({ commit }, device) {
|
||||
commit('TOGGLE_DEVICE', device)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default app
|
||||
87
src/store/modules/mesUser.js
Normal file
@@ -0,0 +1,87 @@
|
||||
import { getToken, setToken, removeToken } from '@/utils/auth'
|
||||
import Cookies from 'js-cookie'
|
||||
import { Message } from 'element-ui'
|
||||
import axios from 'axios'
|
||||
import { getPayToken } from '@/utils/request'
|
||||
const user = {
|
||||
state: {
|
||||
token: getToken(),
|
||||
name: Cookies.get('name'),
|
||||
roles: [],
|
||||
id: Cookies.get('id')
|
||||
},
|
||||
|
||||
mutations: {
|
||||
SET_TOKEN: (state, token) => {
|
||||
state.token = token
|
||||
},
|
||||
SET_NAME: (state, name) => {
|
||||
state.name = name
|
||||
},
|
||||
SET_ROLES: (state, roles) => {
|
||||
state.roles = roles
|
||||
},
|
||||
SET_ID: (state, id) => {
|
||||
state.id = id
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
// 登录
|
||||
Login({ commit }, userInfo) {
|
||||
console.log(userInfo.username)
|
||||
const username = userInfo.username.trim()
|
||||
const password = userInfo.password.trim()
|
||||
return new Promise((resolve, reject) => {
|
||||
var url = getPayToken + '?userName=' + username + '&passWord=' + password
|
||||
axios.get(url).then(response => {
|
||||
console.log(response)
|
||||
const data = response.data
|
||||
if (data.IsSuccess === false) {
|
||||
// const h = this.$createElement
|
||||
// this.$message({
|
||||
// message: h('p', null, [
|
||||
// h('span', null, '错误代码: '),
|
||||
// h('i', { style: 'color: teal' }, `${{ data.ErrorCode }}`)
|
||||
// ])
|
||||
// })
|
||||
// Message.error(`错误代码`+`${{ data.ErrorCode }}`+`,`+`${{ data.ErrorDesc }}`)
|
||||
var a = '错误' + response.data.ErrorCode + ',' + data.ErrorDesc
|
||||
Message({
|
||||
showClose: true,
|
||||
message: a,
|
||||
type: 'error'
|
||||
})
|
||||
this.$router.push({ path: '/login' })
|
||||
}
|
||||
if (data.token === '' || data.$id === '' || data === '') {
|
||||
Message.error('账号或密码错误,请重新登录')
|
||||
this.$router.push({ path: '/login' })
|
||||
} else { // 只有一个角色
|
||||
setToken(data.token)
|
||||
Cookies.set('id', data.$id, { expires: 1 })
|
||||
Cookies.set('name', username, { expires: 1 })
|
||||
commit('SET_TOKEN', data.token)
|
||||
commit('SET_NAME', username)
|
||||
commit('SET_ID', data.$id)
|
||||
resolve({ data, commit })
|
||||
}
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
// 登出
|
||||
FedLogOut({ commit }) {
|
||||
return new Promise(resolve => {
|
||||
commit('SET_TOKEN', '')
|
||||
Cookies.remove('name')
|
||||
Cookies.remove('id')
|
||||
removeToken()
|
||||
resolve()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default user
|
||||
18
src/store/modules/mqttServer.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const mqttServer = {
|
||||
state: {
|
||||
serverIP: sessionStorage.getItem('serverIP') ? sessionStorage.getItem('serverIP') : '',
|
||||
serverPort: sessionStorage.getItem('serverPort') ? sessionStorage.getItem('serverPort') : ''
|
||||
},
|
||||
mutations: {
|
||||
set_serverIP(state, serverIP) {
|
||||
sessionStorage.setItem('serverIP', serverIP)
|
||||
state.serverIP = serverIP
|
||||
},
|
||||
set_serverPort(state, serverPort) {
|
||||
sessionStorage.setItem('serverPort', serverPort)
|
||||
state.serverPort = serverPort
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default mqttServer
|
||||
45
src/store/modules/operationGuide.js
Normal file
@@ -0,0 +1,45 @@
|
||||
const operationGuide = {
|
||||
state: {
|
||||
processList_table: JSON.parse(sessionStorage.getItem('processList_table')) ? JSON.parse(sessionStorage.getItem('processList_table')) : [],
|
||||
materialList_table: JSON.parse(sessionStorage.getItem('materialList_table')) ? JSON.parse(sessionStorage.getItem('materialList_table')) : [],
|
||||
pic: sessionStorage.getItem('pic') ? sessionStorage.getItem('pic') : '',
|
||||
smile: sessionStorage.getItem('smile') ? sessionStorage.getItem('smile') : 0,
|
||||
tighteningPosition: sessionStorage.getItem('tighteningPosition') ? sessionStorage.getItem('tighteningPosition') : [],
|
||||
greenBoltInformation: sessionStorage.getItem('greenBoltInformation') ? sessionStorage.getItem('greenBoltInformation') : [],
|
||||
partAssemblyInformation: {}
|
||||
},
|
||||
mutations: {
|
||||
set_processList_table(state, processList_table) {
|
||||
sessionStorage.setItem('processList_table', '[]')
|
||||
sessionStorage.setItem('processList_table', JSON.stringify(processList_table))
|
||||
state.processList_table = processList_table
|
||||
},
|
||||
set_materialList_table(state, materialList_table) {
|
||||
sessionStorage.setItem('materialList_table', '[]')
|
||||
sessionStorage.setItem('materialList_table', JSON.stringify(materialList_table))
|
||||
state.materialList_table = materialList_table
|
||||
},
|
||||
set_pic(state, pic) {
|
||||
sessionStorage.setItem('pic', pic)
|
||||
state.pic = pic
|
||||
},
|
||||
set_smile(state, smile) {
|
||||
sessionStorage.setItem('smile', smile)
|
||||
state.smile = smile
|
||||
},
|
||||
set_tighteningPosition(state, tighteningPosition) {
|
||||
sessionStorage.setItem('tighteningPosition', tighteningPosition)
|
||||
state.tighteningPosition = tighteningPosition
|
||||
},
|
||||
set_greenBoltInformation(state, greenBoltInformation) {
|
||||
sessionStorage.setItem('greenBoltInformation', greenBoltInformation)
|
||||
state.greenBoltInformation = greenBoltInformation
|
||||
},
|
||||
set_partAssemblyInformation(state, partAssemblyInformation) {
|
||||
// sessionStorage.setItem('greenBoltInformation', greenBoltInformation)
|
||||
state.partAssemblyInformation = partAssemblyInformation
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default operationGuide
|
||||
13
src/store/modules/orderCompletion.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const orderCompletion = {
|
||||
state: {
|
||||
orderCompletion_table: JSON.parse(sessionStorage.getItem('orderCompletion_table')) ? JSON.parse(sessionStorage.getItem('orderCompletion_table')) : []
|
||||
},
|
||||
mutations: {
|
||||
set_orderCompletion_table(state, orderCompletion_table) {
|
||||
sessionStorage.setItem('orderCompletion_table', JSON.stringify(orderCompletion_table))
|
||||
state.orderCompletion_table = orderCompletion_table
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default orderCompletion
|
||||
23
src/store/modules/permission.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import { constantRouterMap } from '@/router'
|
||||
const permission = {
|
||||
state: {
|
||||
routers: constantRouterMap,
|
||||
addRouters: []
|
||||
},
|
||||
mutations: {
|
||||
SET_ROUTERS: (state, routers) => {
|
||||
state.addRouters = routers
|
||||
state.routers = constantRouterMap.concat(routers)
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
GenerateRoutes({ commit }, data) {
|
||||
return new Promise(resolve => {
|
||||
const accessedRouters = data
|
||||
commit('SET_ROUTERS', accessedRouters)
|
||||
resolve()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
export default permission
|
||||