sov
This commit is contained in:
20
.babelrc
20
.babelrc
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"presets": [
|
||||
["env", {
|
||||
["es2015", { "modules": false }],
|
||||
[
|
||||
"env", {
|
||||
"modules": false,
|
||||
"targets": {
|
||||
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
|
||||
@@ -17,20 +19,6 @@
|
||||
"libraryName": "element-ui",
|
||||
"styleLibraryName": "theme-chalk"
|
||||
}
|
||||
],
|
||||
[
|
||||
"import",
|
||||
{
|
||||
"libraryName": "vant",
|
||||
"libraryDirectory": "es",
|
||||
"style": true
|
||||
}
|
||||
]
|
||||
],
|
||||
"env": {
|
||||
"test": {
|
||||
"presets": ["env", "stage-2"],
|
||||
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -23,7 +23,6 @@
|
||||
"jsencrypt": "^3.3.2",
|
||||
"simple-keyboard": "^3.7.26",
|
||||
"simple-keyboard-layouts": "^3.3.34",
|
||||
"vant": "^2.11.2",
|
||||
"vue": "^2.5.2",
|
||||
"vue-i18n": "8.2.1",
|
||||
"vue-infinite-scroll": "^2.0.2",
|
||||
|
||||
@@ -1,159 +0,0 @@
|
||||
<template>
|
||||
<section v-if="active" class="pick-bottom">
|
||||
<van-picker
|
||||
show-toolbar
|
||||
:title="title"
|
||||
:columns="columns"
|
||||
:default-index="defaultIndex"
|
||||
@cancel="onCancel"
|
||||
@confirm="onConfirm"
|
||||
/>
|
||||
<transition name="fade">
|
||||
<div class="overlay" @click="onCancel"></div>
|
||||
</transition>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Picker } from 'vant'
|
||||
import {deviceQuery, workprocedureQuery, instStatusQuery} from '@config/getData1'
|
||||
export default {
|
||||
name: 'Picker',
|
||||
components: {
|
||||
[Picker.name]: Picker
|
||||
},
|
||||
props: {
|
||||
active: Boolean,
|
||||
title: String,
|
||||
api: String,
|
||||
selectItem: Object,
|
||||
pickerArr: Array
|
||||
// defaultIndex: {
|
||||
// type: Number,
|
||||
// default: 0
|
||||
// }
|
||||
},
|
||||
computed: {
|
||||
defaultIndex () {
|
||||
return this.columns.findIndex(item => {
|
||||
return item.id === this.selectItem.id
|
||||
})
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
columns: []
|
||||
}
|
||||
},
|
||||
created () {
|
||||
if (!this.api && this.pickerArr.length > 0) {
|
||||
this.columns = this.pickerArr
|
||||
}
|
||||
switch (this.api) {
|
||||
case 'deviceQuery':
|
||||
this._deviceQuery()
|
||||
break
|
||||
case 'workprocedureQuery':
|
||||
this._workprocedureQuery()
|
||||
break
|
||||
case 'instStatusQuery':
|
||||
this._instStatusQuery()
|
||||
break
|
||||
case 'layerArr':
|
||||
this._layerArr()
|
||||
break
|
||||
case 'seatArr':
|
||||
this._seatArr()
|
||||
break
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async _deviceQuery () {
|
||||
let res = await deviceQuery()
|
||||
if (res.code === '1') {
|
||||
this.columns = res.result
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
// _deviceQuery () {
|
||||
// this.columns = [{id: '01', text: '缓存线1'}, {id: '02', text: '缓存线2'}, {id: '03', text: '缓存线3'}]
|
||||
// },
|
||||
async _workprocedureQuery () {
|
||||
let res = await workprocedureQuery()
|
||||
if (res.code === '1') {
|
||||
this.columns = res.result
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
// _workprocedureQuery () {
|
||||
// this.columns = [{id: '1', text: '工序1'}, {id: '2', text: '工序2'}, {id: '3', text: '工序3'}]
|
||||
// },
|
||||
async _instStatusQuery () {
|
||||
let res = await instStatusQuery()
|
||||
if (res.code === '1') {
|
||||
this.columns = res.result
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
// _instStatusQuery () {
|
||||
// this.columns = [{id: '1', text: '状态1'}, {id: '2', text: '状态2'}, {id: '3', text: '状态3'}]
|
||||
// },
|
||||
_layerArr () {
|
||||
this.columns = [{id: '1', text: '1'}, {id: '2', text: '2'}, {id: '3', text: '3'}]
|
||||
},
|
||||
_seatArr () {
|
||||
this.columns = [{id: '1', text: '1'}, {id: '2', text: '2'}, {id: '3', text: '3'}, {id: '4', text: '4'}, {id: '5', text: '5'}, {id: '6', text: '6'}, {id: '7', text: '7'}, {id: '8', text: '8'}, {id: '9', text: '9'}, {id: '10', text: '10'}]
|
||||
},
|
||||
onConfirm (value, index) {
|
||||
this.$emit('onConfirmCallback', value)
|
||||
// this.columns.defaultIndex = index
|
||||
},
|
||||
onCancel () {
|
||||
this.$emit('onCancelCallback')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.pick-bottom >>> .van-ellipsis
|
||||
font-size 14px
|
||||
.pick-bottom
|
||||
position fixed
|
||||
width 100%
|
||||
bottom 0
|
||||
z-index 2018
|
||||
.van-picker
|
||||
z-index 2018
|
||||
.overlay
|
||||
position fixed
|
||||
top 0
|
||||
left 0
|
||||
width 100%
|
||||
height 100%
|
||||
background-color rgba(0, 0, 0, 0.7)
|
||||
z-index 2012
|
||||
@keyframes fade-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes fade-out {
|
||||
from {
|
||||
opacity: 1;
|
||||
}
|
||||
to {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
.fade-enter-active
|
||||
animation 0.3s fade-in
|
||||
.fade-leave-active
|
||||
animation 0.3s fade-out
|
||||
</style>
|
||||
@@ -1,22 +1,28 @@
|
||||
import Vue from 'vue'
|
||||
import VueI18n from 'vue-i18n'
|
||||
import enLocale from 'element-ui/lib/locale/lang/en'
|
||||
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
|
||||
import locale from 'element-ui/lib/locale'
|
||||
import zh from './langs/zh'
|
||||
import en from './langs/en'
|
||||
import enLocale from 'element-ui/lib/locale/lang/en'
|
||||
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
|
||||
|
||||
Vue.use(VueI18n)
|
||||
|
||||
// 引入本地包
|
||||
const messages = {
|
||||
en: Object.assign(en, enLocale),
|
||||
zh: Object.assign(zh, zhLocale)
|
||||
'en-US': Object.assign(en, enLocale),
|
||||
'en': Object.assign(en, enLocale),
|
||||
'zh-CN': Object.assign(zh, zhLocale),
|
||||
'zh': Object.assign(zh, zhLocale)
|
||||
}
|
||||
|
||||
// console.log(messages.zh)
|
||||
|
||||
const navLang = navigator.language || navigator.userLanguage
|
||||
let localLang = navLang || false
|
||||
let lang = localLang || window.localStorage.getItem('locale') || 'zh-CN'
|
||||
lang = 'zh-CN'
|
||||
// 创建国际化实例
|
||||
const i18n = new VueI18n({
|
||||
locale: localStorage.getItem('locale') || 'zh',
|
||||
locale: lang,
|
||||
messages
|
||||
})
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
module.exports = {
|
||||
message: {
|
||||
title: 'Sport Brands'
|
||||
},
|
||||
top: {
|
||||
run: 'run',
|
||||
auto: 'auto'
|
||||
login: {
|
||||
passwordlogin: 'Password login',
|
||||
configuration: 'Configuration',
|
||||
username: 'Username',
|
||||
password: 'Password',
|
||||
domainnameaddress: 'Domain name address',
|
||||
refreshtime: 'Refresh time(s)',
|
||||
login: 'Login'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
module.exports = {
|
||||
message: {
|
||||
title: '运动品牌'
|
||||
},
|
||||
top: {
|
||||
run: '运行',
|
||||
auto: '自动'
|
||||
login: {
|
||||
passwordlogin: '密码登录',
|
||||
configuration: '配置',
|
||||
username: '用户名',
|
||||
password: '密码',
|
||||
domainnameaddress: '域名地址',
|
||||
refreshtime: '刷新时间(秒)',
|
||||
login: '登录'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@ import infiniteScroll from 'vue-infinite-scroll'
|
||||
import VueTouchKeyboard from 'vue-touch-keyboard'
|
||||
import 'vue-touch-keyboard/dist/vue-touch-keyboard.css'
|
||||
import { DatePicker, Select, Option, Radio, Menu, MenuItem, Tree } from 'element-ui'
|
||||
import { Pagination } from 'vant'
|
||||
// import '@style/layout.styl'
|
||||
import '@style/common.styl'
|
||||
import i18n from './i18n/i18n'
|
||||
import '@config/rem.js'
|
||||
@@ -27,7 +25,6 @@ Vue.use(Radio)
|
||||
Vue.use(Menu)
|
||||
Vue.use(MenuItem)
|
||||
Vue.use(Tree)
|
||||
Vue.use(Pagination)
|
||||
Vue.use(infiniteScroll)
|
||||
Vue.use(VueTouchKeyboard)
|
||||
Vue.prototype.$post = post
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="login-bottom"></div>
|
||||
<div class="login-wraper">
|
||||
<div class="navs-wraper">
|
||||
<button class="nav_item" :class="{'nav_item_active': tab === 0}" @click="toLogin">密码登录</button>
|
||||
<button class="nav_item" :class="{'nav_item_active': tab === 0}" @click="toLogin">{{ $t('login.passwordlogin') }}</button>
|
||||
<button class="nav_item" :class="{'nav_item_active': tab === 1}" @click="toSetup">配置</button>
|
||||
</div>
|
||||
<div v-show="tab === 0" class="login-content_wraper">
|
||||
|
||||
@@ -51,11 +51,11 @@
|
||||
<div class="state_left_wrap">
|
||||
<div class="state_item_wrap">
|
||||
<div class="agv_item_label">车辆状态:</div>
|
||||
<div class="agv_item_val" :style="result.vehicle_status === '运行' ? {'color': '#3CC1FF'} : {'color': '#E54F29'}">{{result.vehicle_status}}</div>
|
||||
<div class="agv_item_val" :class="{'state_item_val_disabled': result.vehicle_status !== '运行'}">{{result.vehicle_status}}</div>
|
||||
</div>
|
||||
<div class="state_item_wrap">
|
||||
<div class="agv_item_label">工作状态:</div>
|
||||
<div class="agv_item_val" :style="result.working_status === '正常' ? {'color': '#3CC1FF'} : {'color': '#E54F29'}">{{result.working_status}}</div>
|
||||
<div class="agv_item_val" :class="{'state_item_val_disabled': result.working_status !== '正常'}">{{result.working_status}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="state_line_dot_2"></div>
|
||||
@@ -142,12 +142,13 @@ export default {
|
||||
margin-bottom 50px
|
||||
.agv_item_label
|
||||
width 190px
|
||||
_font(36px, 36px, #B4C1D8, 500, right)
|
||||
_font(36px, 56px, #B4C1D8, 500, right)
|
||||
font-family: SourceHanSansCN-Medium;
|
||||
.agv_item_val
|
||||
width calc(100% - 190px)
|
||||
_font(36px, 36px, #3CC1FF, 500, left)
|
||||
font-family: SourceHanSansCN-Medium;
|
||||
_font(36px, 56px, #fff, 500,,)
|
||||
padding-left 66px
|
||||
background left center url(../../../images/new/state_btn.png) no-repeat
|
||||
.state_wrap
|
||||
width 100%
|
||||
_fj(,flex-start)
|
||||
@@ -157,7 +158,7 @@ export default {
|
||||
.state_item_wrap
|
||||
width 100%
|
||||
_fj(flex-start)
|
||||
margin-bottom 52px
|
||||
margin-bottom 30px
|
||||
.state_line_dot_2
|
||||
_wh(1px, 201px)
|
||||
background center / 100% 100% url(../../../images/new/line_2.png) no-repeat
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import Router from 'vue-router'
|
||||
import VueRouter from 'vue-router'
|
||||
|
||||
const Preload = r => require.ensure([], () => r(require('@page/Preload')), 'Preload')
|
||||
const Login = r => require.ensure([], () => r(require('@page/modules/login/login.vue')), 'login')
|
||||
@@ -24,9 +24,9 @@ const Role = r => require.ensure([], () => r(require('@page/modules/SystemManage
|
||||
const System = r => require.ensure([], () => r(require('@page/modules/SystemManage/system.vue')), 'modules')
|
||||
const Developer = r => require.ensure([], () => r(require('@page/modules/SystemManage/developer.vue')), 'modules')
|
||||
|
||||
Vue.use(Router)
|
||||
Vue.use(VueRouter)
|
||||
|
||||
export default new Router({
|
||||
const router = new VueRouter({
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
@@ -99,3 +99,17 @@ export default new Router({
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
if (!localStorage.getItem('locale')) {
|
||||
let lang = navigator.language
|
||||
if (lang === 'zh' || lang === 'zh-CN') {
|
||||
localStorage.setItem('locale', 'zh-CN')
|
||||
} else {
|
||||
localStorage.setItem('locale', 'en-US')
|
||||
}
|
||||
}
|
||||
next()
|
||||
})
|
||||
|
||||
export default router
|
||||
|
||||
40
yarn.lock
40
yarn.lock
@@ -88,7 +88,7 @@
|
||||
esutils "^2.0.2"
|
||||
js-tokens "^4.0.0"
|
||||
|
||||
"@babel/runtime@7.x", "@babel/runtime@^7.0.0":
|
||||
"@babel/runtime@^7.0.0":
|
||||
version "7.12.5"
|
||||
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.12.5.tgz#410e7e487441e1b360c29be715d870d9b985882e"
|
||||
integrity sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==
|
||||
@@ -148,11 +148,6 @@
|
||||
lodash "^4.17.19"
|
||||
to-fast-properties "^2.0.0"
|
||||
|
||||
"@popperjs/core@^2.5.4":
|
||||
version "2.5.4"
|
||||
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.5.4.tgz#de25b5da9f727985a3757fd59b5d028aba75841a"
|
||||
integrity sha512-ZpKr+WTb8zsajqgDkvCEWgp6d5eJT6Q63Ng2neTbzBO76Lbe91vX/iVIW9dikq+Fs3yEo+ls4cxeXABD2LtcbQ==
|
||||
|
||||
"@types/node@^8.0.7":
|
||||
version "8.10.48"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.48.tgz#e385073561643a9ba6199a1985ffc03530f90781"
|
||||
@@ -168,23 +163,6 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/strip-json-comments/-/strip-json-comments-0.0.30.tgz#9aa30c04db212a9a0649d6ae6fd50accc40748a1"
|
||||
integrity sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==
|
||||
|
||||
"@vant/icons@1.4.0":
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@vant/icons/-/icons-1.4.0.tgz#a91f7894f2f34356f78a5d6f8b9d4f1a46add0c5"
|
||||
integrity sha512-96k+x00FqdGAQeTWrHEJ6C+QNifPQu58W9mv8pJAQ7VQ527KV9GHQT7m2TT+PhHXejDENYhlpW/XWOB66j8r8w==
|
||||
|
||||
"@vant/popperjs@^1.0.0":
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@vant/popperjs/-/popperjs-1.0.2.tgz#522d71656235125a3ae08e9c701a3bae6fd88d7b"
|
||||
integrity sha512-CA2BgoQwlfm5OEmIuTnYNWaeCAcEhFFyVDg+irunZAWff+jV5TkAuDPpCWrIGYoVs99hwBDiRzzEAFybhlml2A==
|
||||
dependencies:
|
||||
"@popperjs/core" "^2.5.4"
|
||||
|
||||
"@vue/babel-helper-vue-jsx-merge-props@^1.0.0":
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.2.1.tgz#31624a7a505fb14da1d58023725a4c5f270e6a81"
|
||||
integrity sha512-QOi5OW45e2R20VygMSNhyQHvpdUwQZqGPc748JLGCYEy+yp8fNFNdbNIGAgZmi9e+2JHPd6i6idRuqivyicIkA==
|
||||
|
||||
abab@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f"
|
||||
@@ -8876,17 +8854,6 @@ validate-npm-package-license@^3.0.1:
|
||||
spdx-correct "^3.0.0"
|
||||
spdx-expression-parse "^3.0.0"
|
||||
|
||||
vant@^2.11.2:
|
||||
version "2.11.2"
|
||||
resolved "https://registry.yarnpkg.com/vant/-/vant-2.11.2.tgz#239c5ccac9de2764b405affad408c69db0b09da0"
|
||||
integrity sha512-cPWi9d37tf0kHrazH+/RjpdbplQKJV6XqGEc6qS/nkscxYuSOudxfe46r8TQLy4UU4/N4rRjT0HT315zF6DwYQ==
|
||||
dependencies:
|
||||
"@babel/runtime" "7.x"
|
||||
"@vant/icons" "1.4.0"
|
||||
"@vant/popperjs" "^1.0.0"
|
||||
"@vue/babel-helper-vue-jsx-merge-props" "^1.0.0"
|
||||
vue-lazyload "1.2.3"
|
||||
|
||||
vary@~1.1.2:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
|
||||
@@ -8956,11 +8923,6 @@ vue-jest@^1.0.2:
|
||||
tsconfig "^7.0.0"
|
||||
vue-template-es2015-compiler "^1.5.3"
|
||||
|
||||
vue-lazyload@1.2.3:
|
||||
version "1.2.3"
|
||||
resolved "https://registry.yarnpkg.com/vue-lazyload/-/vue-lazyload-1.2.3.tgz#901f9ec15c7e6ca78781a2bae4a343686bdedb2c"
|
||||
integrity sha512-DC0ZwxanbRhx79tlA3zY5OYJkH8FYp3WBAnAJbrcuoS8eye1P73rcgAZhyxFSPUluJUTelMB+i/+VkNU/qVm7g==
|
||||
|
||||
vue-loader@^13.3.0:
|
||||
version "13.7.3"
|
||||
resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-13.7.3.tgz#e07440f78230a639d00ada4da7b96d0e9d62037f"
|
||||
|
||||
Reference in New Issue
Block a user