登录、home、工单管理

This commit is contained in:
2023-04-07 17:41:38 +08:00
parent c47cc6a357
commit 6917835ce2
15 changed files with 521 additions and 241 deletions

View File

@@ -18,6 +18,7 @@
"babel-polyfill": "^6.26.0",
"element-ui": "^2.8.2",
"fastclick": "^1.0.6",
"jsencrypt": "^3.3.2",
"vue": "^2.5.2",
"vue-router": "^3.0.1",
"vuex": "^3.0.1"

View File

@@ -35,22 +35,22 @@ export default {
label: '工单操作',
index: '1',
router: '/operation'
},
{
label: '残次品上报',
index: '2',
router: '/ungraded'
},
}
// {
// label: '残次品上报',
// index: '2',
// router: '/ungraded'
// },
// {
// label: '状态设置',
// index: '3',
// router: '/stateset'
// },
{
label: '工单查询',
index: '4',
router: '/opersearch'
}
// {
// label: '工单查询',
// index: '4',
// router: '/opersearch'
// }
]
}
},

39
src/config/getData2.js Normal file
View File

@@ -0,0 +1,39 @@
import {post} from '@config/http.js'
/** 手持登陆 */
export const handLogin = (user, password) => post('mobile/auth/login', {
username: user,
password: password
})
// 1.首页-查询人员所属的设备信息
export const getDevice = () => post('api/produceshiftorder/getDevice', {
})
// 2.工单管理
export const getTable = (code, val, d1, d2, is, ids, qc) => post('api/produceshiftorder/getTable', {
device_code: code,
key_value: val,
order_date1: d1,
order_date2: d2,
is_finished: is,
is_producted: ids,
is_qc: qc
})
// 3.设备开工
export const openStart = (id, code) => post('api/produceshiftorder/openStart', {
workorder_id: id,
device_code: code
})
// 4.设备报工
export const saveReport = (id, code) => post('api/produceshiftorder/saveReport', {
workorder_id: id,
report_qty: code
})
// 5.设备完工
export const tofinish = (row) => post('api/produceshiftorder/finish', {
row: row
})

View File

@@ -1,20 +1,21 @@
import axios from 'axios'
import qs from 'qs'
import { Dialog } from './utils.js'
// import { Dialog, toast } from './utils.js'
import store from '../vuex/store'
import router from './../router'
import router from '@/router'
axios.defaults.timeout = 50000
// axios.defaults.retry = 5
// axios.defaults.retryDelay = 10000
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8'
axios.interceptors.request.use(
config => {
let token = ''
if (store.getters.userInfo !== '') {
token = JSON.parse(store.getters.userInfo).token
}
token && (config.headers.Authorization = token)
if (config.method === 'post') {
if (!config.data.flag) {
config.data = qs.stringify(config.data)
config.data = config.data
} else {
config.data = config.data.formData
}
@@ -32,24 +33,59 @@ axios.interceptors.response.use(
return Promise.resolve(response)
},
error => {
// toast(error.message)
router.push({
path: '/500',
query: {redirect: router.currentRoute.fullPath}
})
return Promise.reject(error)
if (error && error.response) {
switch (error.response.status) {
case 400:
break
case 401:
store.dispatch('setSignOut')
router.push('/login')
break
}
return Promise.reject(error.response.data)
} else {
return Promise.reject(error)
}
}
)
export const post = (params) => {
export const post = (sevmethod, params) => {
return new Promise((resolve, reject) => {
axios.post(`${store.getters.baseUrl}/wdk?action=wdk.pub&method=call_service&ajaxparam=` + new Date().getTime(), params)
axios.post(`${store.getters.baseUrl}/` + sevmethod, params)
.then(response => {
// if (response.data.code === '0') {
// Dialog(response.data.desc)
// }
resolve(response.data)
}, error => {
Dialog(error.message)
reject(error.message)
})
.catch((error) => {
reject(error)
})
})
}
export const post2 = (sevmethod, params) => {
return new Promise((resolve, reject) => {
axios.post(`${store.getters.imgip}/` + sevmethod, params)
.then(response => {
resolve(response.data)
}, error => {
Dialog(error.message)
reject(error.message)
})
.catch((error) => {
reject(error)
})
})
}
export const post3 = (sevmethod, params) => {
return new Promise((resolve, reject) => {
axios.post(sevmethod, params)
.then(response => {
resolve(response.data)
}, error => {
Dialog(error.message)
reject(error.message)
})
.catch((error) => {

View File

@@ -7,18 +7,31 @@ import store from './vuex/store'
import '@style/reset.css'
import '@style/layout.styl'
import fastClick from 'fastclick'
import { DatePicker } from 'element-ui'
import { DatePicker, Select, Option } from 'element-ui'
import '@config/rem.js'
import {post} from '@config/http.js'
import { Dialog, toast } from '@config/utils.js'
import JSEncrypt from 'jsencrypt'
fastClick.attach(document.body)
Vue.use(DatePicker)
Vue.use(Select)
Vue.use(Option)
Vue.prototype.$post = post
Vue.prototype.Dialog = Dialog
Vue.prototype.toast = toast
Vue.config.productionTip = false
const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANL378k3RiZHWx5AfJqdH9xRNBmD9wGD\n' +
'2iRe41HdTNF8RUhNnHit5NpMNtGL0NPTSSpPjjI1kJfVorRvaQerUgkCAwEAAQ=='
// 加密
export function encrypt (txt) {
const encryptor = new JSEncrypt()
encryptor.setPublicKey(publicKey) // 设置公钥
return encryptor.encrypt(txt) // 对需要加密的数据进行加密
}
/* eslint-disable no-new */
new Vue({
el: '#app',

View File

@@ -1,6 +1,6 @@
<template>
<div>
<div class="login_wrap" :class="heightLimit">
<div class="login_wrap">
<div class="login_tab">
<div class="login_tab_line drift" :style="{'left': drift+'%'}"></div>
<div class="login_tab_item" @click="_tabChange(0)">登录</div>
@@ -10,54 +10,68 @@
<div v-show="!scanShow" class="login_card fl">
<div class="card_wrap">
<div class="inputOuter">
<label>用户名</label>
<div class="label">用户名</div>
<input type="text" v-model="loginname" class="inputStyle">
<i v-show="closeIcon1" class="iconfont close_icon" @click="clearData(1)"></i>
<div v-show="closeIcon1" class="iconfont close_icon" @click="clearData(1)"></div>
</div>
<div class="inputOuter">
<label>密码</label>
<div class="label">密码</div>
<input type="password" v-model="password" class="inputStyle">
<i v-show="closeIcon2" class="iconfont close_icon" @click="clearData(2)"></i>
<div v-show="closeIcon2" class="iconfont close_icon" @click="clearData(2)"></div>
</div>
<div class="inputOuter"></div>
</div>
<div class="submit">
<button class="btn" @click="_login" :disabled="disabled">手工登录</button>
<button class="fr btn" @click="_scan">扫码登录</button>
<div class="btn-wrap">
<button class="btn" @click="_login" :disabled="disabled">手工登录</button>
</div>
<div class="btn-wrap">
<button class="btn" @click="_scan">扫码登录</button>
</div>
</div>
</div>
<div v-show="scanShow" class="login_card fl">
<div class="card_wrap">
<div class="inputOuter">
<label>用户名</label>
<div class="label">用户名</div>
<input type="password" ref="lname" v-model="qrcode" class="inputStyle" @keyup.enter="scanInput" :disabled="disabled">
</div>
<div class="inputOuter"></div>
<div class="inputOuter"></div>
</div>
<div class="submit">
<button class="fl btn" @click="_login2">手工登录</button>
<button class="fr btn" @click="_scan">重新扫码</button>
<div class="btn-wrap">
<button class="btn" @click="_login2">手工登录</button>
</div>
<div class="btn-wrap">
<button class="btn" @click="_scan">重新扫码</button>
</div>
</div>
</div>
<div class="login_card fl" ref="config">
<div class="card_wrap">
<div class="inputOuter">
<label>域名地址</label>
<input type="text" class="inputStyle" v-model="baseUrl">
<i v-show="closeIcon3" class="iconfont close_icon" @click="clearData(3)"></i>
<div class="label label1">域名地址</div>
<input type="text" class="inputStyle inputStyle1" v-model="baseUrl">
<div v-show="closeIcon3" class="iconfont close_icon" @click="clearData(3)"></div>
</div>
<div class="inputOuter">
<label>图片域名地址</label>
<input type="text" class="inputStyle" v-model="imgBaseUrl">
<i v-show="closeIcon4" class="iconfont close_icon" @click="clearData(4)"></i>
<div class="label label1">图片域名地址</div>
<input type="text" class="inputStyle inputStyle1" v-model="imgBaseUrl">
<div v-show="closeIcon4" class="iconfont close_icon" @click="clearData(4)"></div>
</div>
<!-- <div class="inputOuter">
<label>锁屏时间(分钟)</label>
<input type="text" class="inputStyle" v-model="lockTime">
</div> -->
<div class="inputOuter">
<label>锁屏时间(分钟)</label>
<select name="equipment" v-model="lockTime">
<option :value="e.id" v-for="e in lockTimeArr" :key="e.id">{{e.name}}</option>
</select>
<div class="label label1">锁屏时间(分钟)</div>
<div class="select select1">
<el-select v-model="value" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
</div>
<div class="submit">
@@ -70,22 +84,23 @@
</template>
<script>
import {handLogin} from './../config/getData2.js'
import {encrypt} from './../main.js'
export default {
name: 'Login',
data () {
return {
loginname: '',
password: '',
lockTimeArr: [{id: 0, name: '0(不锁屏)'}, {id: 1, name: '1'}, {id: 3, name: '3'}, {id: 5, name: '5'}, {id: 10, name: '10'}, {id: 15, name: '15'}, {id: 30, name: '30'}, {id: 60, name: '60'}],
lockTime: Number(this.$store.getters.lockTime),
baseUrl: this.$store.getters.baseUrl,
imgBaseUrl: this.$store.getters.imgBaseUrl,
drift: 0,
heightLimit: 'heightLimit2',
disabled: false,
scanShow: false,
qrcode: '',
logintype: ''
logintype: '',
options: [{value: 0, label: '0(不锁屏)'}, {value: 1, label: '1'}, {value: 3, label: '3'}, {value: 5, label: '5'}, {value: 10, label: '10'}, {value: 15, label: '15'}, {value: 30, label: '30'}, {value: 60, label: '60'}],
value: Number(this.$store.getters.lockTime)
}
},
computed: {
@@ -105,7 +120,6 @@ export default {
methods: {
_tabChange (num) {
this.drift = num
this.heightLimit = num === 0 ? 'heightLimit2' : 'heightLimit3'
this.scanShow = false
},
clearData (e) {
@@ -128,39 +142,21 @@ export default {
let obj = {
baseUrl: this.baseUrl,
imgBaseUrl: this.imgBaseUrl,
lockTime: this.lockTime
lockTime: this.value
}
this.$store.dispatch('setConfig', obj)
this._tabChange(0)
},
loginApi () {
let data = {
'_SRVNAME': 'server.app.screenAPI',
'_SRVMETHOD': 'verifyAccount',
'_DATA': JSON.stringify({
form: {
logintype: this.logintype,
loginname: this.loginname,
password: this.password,
qrcode: this.qrcode
}
})
async loginApi () {
try {
let res = await handLogin(this.loginname, encrypt(this.password))
this.$store.dispatch('setUserInfo', JSON.stringify(res.user.user))
this.$store.dispatch('saveToken', res.token)
this.$router.push('/home')
this.disabled = false
} catch (e) {
this.disabled = false
}
this
.$post(data)
.then(res => {
if (res.code === '1') {
this.$store.dispatch('setUserInfo', res.result)
this.$router.push('/home')
} else {
this.Dialog(res.desc)
}
this.disabled = false
})
.catch(error => {
this.disabled = false
console.log(error)
})
},
_login () {
this.disabled = true
@@ -179,7 +175,6 @@ export default {
},
_scan () {
this.scanShow = true
this.heightLimit = 'heightLimit1'
this.qrcode = ''
this.$nextTick(() => {
this.$refs.lname.focus()
@@ -191,7 +186,6 @@ export default {
},
_login2 () {
this.scanShow = false
this.heightLimit = 'heightLimit2'
}
}
}
@@ -199,21 +193,17 @@ export default {
<style lang="stylus" scoped>
.login_wrap
position fixed
position absolute
left 50%
top 50%
min-width 369px
width 50%
// min-width 369px
width 60%
height 3.3rem
transform translate3d(-50%, -50%, 0)
background-color rgba(255, 255, 255, 0.8)
border-radius 5px
overflow hidden
.heightLimit1
height 2.4rem
.heightLimit2
height 3.3rem
.heightLimit3
height 4.2rem
z-index 1
overflow-x hidden
.login_tab
position relative
height .5rem
@@ -238,43 +228,80 @@ export default {
.login_cnt
position relative
width 200%
overflow hidden
overflow-x hidden
.login_card
width 50%
padding .3rem .5rem
height auto
padding .3rem .3rem
.card_wrap
overflow hidden
width 100%
// overflow hidden
.inputOuter
position relative
width 100%
height .4rem
margin-bottom .2rem
label
display block
clear both
.label
float left
width .7rem
font-size .16rem
line-height .3rem
line-height .4rem
color #333
.inputStyle, select
text-align justify
text-align-last justify
label::after
display inline-block
content ''
width 100%
height 0
visibility hidden
.inputStyle, .select
float right
width calc(100% - .9rem)
font-size .16rem
line-height .4rem
height .4rem
color #999
color #606266
text-indent .1rem
border 1px solid rgba(0, 0, 0, .2)
box-sizing border-box
select
appearance auto
outline none
.label1
width 1.1rem
.inputStyle1
width calc(100% - 1.2rem)
.select1
width calc(100% - 1.2rem)
background-color #fff
text-indent 0
.submit
width 100%
text-align center
height .4rem
clear both
.btn-wrap
float left
width 50%
height .4rem
.btn
display block
background-color #2778f3
font-size .16rem
line-height .4rem
color #fff
width .9rem
margin 0 .3rem
padding 0 .1rem
margin 0 auto
border-radius 5px
.drift
transition left .3s linear
.el-select
width 100%
.el-input__inner
height .4rem
line-height .4rem
border none
padding 0 .1rem
font-size .16rem
</style>

View File

@@ -0,0 +1,191 @@
<template>
<sec-header :deviceCode="deviceCode" activeIndex="1">
<div class="wrap">
<div class="wrap-filter">
<div class="fl mgt10">
工单日期&nbsp;
<el-date-picker
v-model="value1"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</div>
<div class="fl mgt10 keyValue">
&nbsp;关键字
<input type="text" class="input" v-model="keyValue" placeholder="请输入工单号、物料编码">
<i v-show="closeIcon1" class="iconfont close_icon" @click="clearData(1)"></i>
</div>
<div class="fr mgt10">
<button class="mgr5 button--primary" @click="toSearch">&nbsp;&nbsp;</button>
<button class="button--primary" :disabled="disabled1" @click="_openStart">开工</button>
<button class="button--primary" :disabled="disabled2" @click="addProduce">报工</button>
<button class="button--primary" :disabled="disabled3" @click="addProduce">完工</button>
</div>
</div>
<table class="filter-table">
<tr>
<th width="4%"></th>
<th width="8%">工单号</th>
<th width="8%">班次</th>
<th width="9%">物料名称</th>
<th width="8%">工序</th>
<th width="9%">工单状态</th>
<th width="10%">生产数量</th>
<th width="9%">上报残次数</th>
<th width="9%">本次加工</th>
<th width="13%">开始时间</th>
<th width="13%">结束时间</th>
</tr>
<tr v-for="e in datas" :key="e.pk_id" @click="toRadio(e)">
<td>
<button class="iconfont select_icon" :class="pkId === e.pk_id ? 'selected_icon' : 'unselect_icon'"></button>
</td>
<td>{{e.produceorder_code}}</td>
<td>{{e.shift_type_scode_name}}</td>
<td>{{e.material_name}}</td>
<td>{{e.workprocedure_name}}</td>
<td>{{['未生产','生产中','生产完成','已报工'][Number(e.order_status)]}}</td>
<td>{{e.produce_qty}}</td>
<td>{{e.unqualified_qty}}</td>
<td>{{e.this_qty}}</td>
<td>{{e.realproducestart_date}}</td>
<td>{{e.realproduceend_date}}</td>
</tr>
</table>
</div>
<Back></Back>
</sec-header>
</template>
<script>
import SecHeader from '@components/SecHeader.vue'
import {dateFtt} from '@config/utils.js'
import Back from '@components/Back.vue'
import {getTable, openStart, saveReport, tofinish} from './../../config/getData2.js'
export default {
name: 'workordermanage',
components: {
SecHeader,
Back
},
data () {
return {
value1: [new Date(), new Date()],
deviceCode: this.$route.query.code,
keyValue: '',
datas: [],
pkId: '',
pkObj: {},
disabled1: false,
disabled2: false,
disabled3: false
}
},
computed: {
closeIcon1 () {
return this.keyValue !== ''
},
closeIcon2 () {
return this.produceQty !== ''
}
},
created () {
this.getDatas()
},
methods: {
clearData (e) {
switch (e) {
case 1:
this.keyValue = ''
break
case 2:
this.produceQty = ''
break
}
},
async getDatas () {
let res = await getTable(this.$route.query.code, this.keyValue, this.value1 !== null ? dateFtt(this.value1[0]) : '', this.value1 !== null ? dateFtt(this.value1[1]) : '', '0', '', '0')
this.datas = [...res]
},
toSearch () {
this.getDatas()
},
toRadio (e) {
this.pkId = this.pkId === e.pk_id ? '' : e.pk_id
this.pkObj = this.pkId === e.pk_id ? e : {}
},
closeModalCall () {
this.mdShow = false
},
comfirmCall () {
this.disabled = true
if (this.produceQty === '' || this.produceQty === null) {
this.toast('请输入追加数量')
this.disabled = false
return
}
this.addProduceData()
},
addProduce () {
this.mdShow = true
},
async _openStart () {
this.disabled1 = true
if (!this.pkId) {
this.toast('请选择一行')
this.disabled1 = false
return
}
try {
let res = await openStart()
this.toast(res.desc)
this.disabled1 = false
this.getDatas()
} catch (e) {
this.disabled1 = false
}
},
async _saveReport () {
this.disabled2 = true
if (!this.pkId) {
this.toast('请选择一行')
this.disabled2 = false
return
}
try {
let res = await saveReport()
this.toast(res.desc)
this.disabled2 = false
this.getDatas()
} catch (e) {
this.disabled2 = false
}
},
async _tofinish () {
this.disabled3 = true
if (!this.pkId) {
this.toast('请选择一行')
this.disabled3 = false
return
}
try {
let res = await tofinish()
this.toast(res.desc)
this.disabled3 = false
this.getDatas()
} catch (e) {
this.disabled3 = false
}
}
}
}
</script>
<style lang="stylus" scoped>
.input
width 1.2rem
.close_icon
top 0
</style>

View File

@@ -31,6 +31,7 @@
<script>
import Back from '@components/Back.vue'
import {getDevice} from './../../config/getData2.js'
export default {
name: 'Home',
components: {
@@ -40,97 +41,6 @@ export default {
return {
timer: null,
list: []
// list: [
// {
// device_status: '0',
// is_setstatus: '0',
// device_code: 'A0001',
// device_name: '设备名称设备名称设备名称设备名称哈哈哈你好吗好哦',
// job_count: '6',
// produceorder_code: 'gd0002',
// imgurl: '//img14.360buyimg.com/babel/s190x210_jfs/t1/54510/8/1271/6158/5cef5bfbEede24168/4aa624bd9ada781f.png!q90!cc_190x210'
// },
// {
// device_status: '1',
// is_setstatus: '1',
// device_code: 'A0002',
// job_count: '6',
// produceorder_code: 'gd0002',
// imgurl: '//img1.360buyimg.com/da/s590x470_jfs/t1/36626/1/11773/101331/5cf9fd07E20a31b94/57ae8abe34bebdd3.jpg!q90!cc_590x470.webp'
// },
// {
// device_status: '2',
// is_setstatus: '0',
// device_code: 'A0003',
// job_count: '6',
// produceorder_code: 'gd0002',
// imgurl: '//img14.360buyimg.com/mobilecms/s580x176_jfs/t1/45895/4/2239/49551/5d009864Ea34300cd/5a5e78699233f6dd.jpg!cr_1190x360_4_0'
// },
// {
// device_status: '0',
// is_setstatus: '0',
// device_code: 'A0004',
// job_count: '6',
// produceorder_code: 'gd0002',
// imgurl: ''
// },
// {
// device_status: '1',
// is_setstatus: '0',
// device_code: 'A0005',
// job_count: '6',
// produceorder_code: 'gd0002',
// imgurl: ''
// },
// {
// device_status: '2',
// is_setstatus: '1',
// device_code: 'A0006',
// job_count: '6',
// produceorder_code: 'gd0002',
// imgurl: ''
// },
// {
// device_status: '0',
// is_setstatus: '0',
// device_code: 'A0007',
// job_count: '6',
// produceorder_code: 'gd0002',
// imgurl: ''
// },
// {
// device_status: '0',
// is_setstatus: '0',
// device_code: 'A0008',
// job_count: '6',
// produceorder_code: 'gd0002',
// imgurl: ''
// },
// {
// device_status: '1',
// is_setstatus: '0',
// device_code: 'A0009',
// job_count: '6',
// produceorder_code: 'gd0002',
// imgurl: ''
// },
// {
// device_status: '2',
// is_setstatus: '1',
// device_code: 'A00010',
// job_count: '6',
// produceorder_code: 'gd0002',
// imgurl: ''
// },
// {
// device_status: '0',
// is_setstatus: '0',
// device_code: 'A00011',
// job_count: '6',
// produceorder_code: 'gd0002',
// imgurl: ''
// }
// ]
}
},
mounted () {
@@ -143,40 +53,28 @@ export default {
this.getList()
}, 30000)
},
getList () {
let data = {
'_SRVNAME': 'service.mps.AIOProduceReport20',
'_SRVMETHOD': 'queryEquip',
'_DATA': JSON.stringify({
accountId: this.$store.getters.accountId
})
}
this
.$post(data)
.then(res => {
if (res.code === '1') {
let newArr = []
res.allrows.map(el => {
newArr.push(Object.assign({}, el, {imgurl: this.$store.getters.imgBaseUrl + el.device_icon}))
})
this.list = newArr
this.$store.dispatch('getIsProplan', res.result.is_productonplan)
} else {
this.Dialog(res.desc)
}
})
async getList () {
let res = await getDevice()
let newArr = []
res.map(el => {
newArr.push(Object.assign({}, el, {imgurl: this.$store.getters.imgBaseUrl + el.device_icon}))
})
this.list = [...newArr]
// this.$store.dispatch('getIsProplan', res.result.is_productonplan)
},
toIfWork () {
this.$router.push('/ifwork')
// this.$router.push('/ifwork')
},
toOperation (item) {
if (item.is_run === '1') {
let obj = {
deviceUuid: item.device_uuid,
deviceCode: item.device_name
}
this.$store.dispatch('setDevice', obj)
this.$router.push('/operation')
// let obj = {
// code: item.device_code
// }
// this.$store.dispatch('setDevice', obj)
this.$router.push({
path: '/workordermanage',
query: {code: item.device_code}
})
}
}
},

View File

@@ -14,6 +14,7 @@ const OperSearch = r => require.ensure([], () => r(require('@page/assignment/Ope
const NotFound = r => require.ensure([], () => r(require('@page/404')), 'NotFound')
const ErrorComponent = r => require.ensure([], () => r(require('@page/500')), 'ErrorComponent')
Vue.use(Router)
const workordermanage = r => require.ensure([], () => r(require('@page/assignment/workordermanage')), 'workordermanage')
export default new Router({
routes: [
@@ -25,6 +26,10 @@ export default new Router({
path: '/login',
component: Login
},
{
path: '/workordermanage',
component: workordermanage
},
{
path: '/operation',
component: Operation

View File

@@ -11,11 +11,6 @@
/***/
[class*=" el-icon-"], [class^=el-icon-]
color #c0c4cc
.el-date-editor--daterange.el-input__inner
width 2.45rem
.el-input__inner
height .3rem
line-height .3rem
.el-date-range-picker__header div
color #606266
.el-date-table td span
@@ -47,11 +42,15 @@
-webkit-font-smoothing antialiased
-moz-osx-font-smoothing grayscale
.close_icon
width .3rem
height .3rem
position absolute
right .05rem
top .08rem
right 0
top .05rem
color #C0C4CC
font-size .14rem
font-size .2rem
line-height .3rem
text-align center
.select_icon
width .2rem
height .2rem

39
src/style/mixin.styl Normal file
View File

@@ -0,0 +1,39 @@
$red = #e74f1a
$green = #6CBE8B
$yellow = #E9B451
$blue = #6798ef
$gray = #c9c9c9
$fc1 = #323232
//
_wh(w, h)
width: w
height: h
//
_font(size,height,color=$fc1,weight=normal,align=left)
font-size: size
line-height: height
color: color
font-weight: weight
text-align: align
//flex
_fj(x=space-between,y=center)
display: flex
justify-content: x
align-items: y
//
_bis(url,w,h=auto,x=center,y=center)
background-position: x y
background-size: w h
background-image: url(url)
background-repeat: no-repeat
//
_ct()
position: absolute
top: 50%
transform: translateY(-50%)

View File

@@ -17,7 +17,6 @@ time, mark, audio, video, input, button {
outline: none;
font-size: 0.16rem;
line-height: inherit;
color: #ffffff;
font-weight: normal;
}

View File

@@ -5,14 +5,18 @@ const state = {
accountId: getStore('accountId') || '',
accountName: getStore('accountName') || '',
userName: getStore('userName') || '',
deptName: getStore('deptName') || ''
deptName: getStore('deptName') || '',
userInfo: getStore('userInfo') ? getStore('userInfo') : '',
saveToken: getStore('saveToken') || ''
}
const getters = {
accountId: state => state.accountId,
accountName: state => state.accountName,
userName: state => state.userName,
deptName: state => state.deptName
deptName: state => state.deptName,
userInfo: state => state.userInfo,
saveToken: state => state.saveToken
}
const actions = {
@@ -29,6 +33,18 @@ const actions = {
localStorage.removeItem('userName')
localStorage.removeItem('deptName')
commit(types.SET_SIGN_OUT)
},
saveUserInfo ({commit}, res) {
setStore('userInfo', res)
commit(types.SAVE_USER_INFO, res)
},
delUserInfo ({commit}, res) {
localStorage.removeItem('userInfo')
commit(types.DEL_USER_INFO, res)
},
saveToken ({commit}, res) {
setStore('saveToken', res)
commit(types.SAVE_TOKEN, res)
}
}
@@ -44,6 +60,15 @@ const mutations = {
state.accountName = ''
state.userName = ''
state.deptName = ''
},
[types.SAVE_USER_INFO] (state, res) {
state.userInfo = res
},
[types.DEL_USER_INFO] (state, res) {
state.userInfo = res
},
[types.SAVE_TOKEN] (state, res) {
state.saveToken = res
}
}

View File

@@ -11,6 +11,9 @@ export const COM_ALERT_MSG = 'COM_ALERT_MSG'
// 用户
export const SET_USER_INFO = 'SET_USER_INFO'
export const SET_SIGN_OUT = 'SET_SIGN_OUT'
export const SAVE_USER_INFO = 'SAVE_USER_INFO'
export const DEL_USER_INFO = 'DEL_USER_INFO'
export const SAVE_TOKEN = 'SAVE_TOKEN'
// 数据
export const DATA_DEVICE = 'DATA_DEVICE'

View File

@@ -5132,6 +5132,11 @@ jsdom@^11.5.1:
ws "^5.2.0"
xml-name-validator "^3.0.0"
jsencrypt@^3.3.2:
version "3.3.2"
resolved "https://registry.yarnpkg.com/jsencrypt/-/jsencrypt-3.3.2.tgz#b0f1a2278810c7ba1cb8957af11195354622df7c"
integrity sha512-arQR1R1ESGdAxY7ZheWr12wCaF2yF47v5qpB76TtV64H1pyGudk9Hvw8Y9tb/FiTIaaTRUyaSnm5T/Y53Ghm/A==
jsesc@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b"