Commit 035404b3 authored by neogcg's avatar neogcg

login

parent 74e54464
......@@ -101,12 +101,14 @@ export const constantRoutes = [
{
path: '/history',
component: Layout,
redirect: '/dashboard',
children: [{
path: 'history',
redirect: '/history/historyStatus/historyStatus',
name: 'History',
component: () => import('@/views/dashboard/index'),
meta: { title: '历史数据', icon: 'dashboard' }
meta: { title: 'History', icon: 'example' },
children: [{
path: 'historyStatus',
name: '历史数据状态',
component: () => import('@/views/history/historyStatus/historyStatus.vue'),
meta: { title: '历史数据状态' }
}]
},
{
......
<template>
<div>
<h1>会搜发的随风</h1>
</div>
</template>
<script>
import {mapGetters,mapActions} from 'vuex';
export default {
props: [],
components: {},
data() {
return {
beginItem: 1,
endItem: 10,
total: 0,
currentPage: 1,
pageSize: 10,
historyStatusList:[
{
stationName:'STATION2未开通',
alarmObj:'漏缆FSU2_R1下行方向',
alarmInfo:'距离:0米 驻波比:8.72',
alarmInfo2:'距离:18米 驻波比:1.07',
alarmInfo3:'距离:42米 驻波比:1.02',
firstTime:'2022/12/18 11:51:12'
},
{
stationName:'STATION2未开通',
alarmObj:'漏缆FSU2_R1下行方向',
alarmInfo:'距离:0米 驻波比:8.72',
alarmInfo2:'距离:18米 驻波比:1.07',
alarmInfo3:'距离:42米 驻波比:1.02',
firstTime:'2022/12/18 11:51:12'
}, {
stationName:'STATION2未开通',
alarmObj:'漏缆FSU2_R1下行方向',
alarmInfo:'距离:0米 驻波比:8.72',
alarmInfo2:'距离:18米 驻波比:1.07',
alarmInfo3:'距离:42米 驻波比:1.02',
firstTime:'2022/12/18 11:51:12'
}, {
stationName:'STATION2未开通',
alarmObj:'漏缆FSU2_R1下行方向',
alarmInfo:'距离:0米 驻波比:8.72',
alarmInfo2:'距离:18米 驻波比:1.07',
alarmInfo3:'距离:42米 驻波比:1.02',
firstTime:'2022/12/18 11:51:12'
}, {
stationName:'STATION2未开通',
alarmObj:'漏缆FSU2_R1下行方向',
alarmInfo:'距离:0米 驻波比:8.72',
alarmInfo2:'距离:18米 驻波比:1.07',
alarmInfo3:'距离:42米 驻波比:1.02',
firstTime:'2022/12/18 11:51:12'
}, {
stationName:'STATION2未开通',
alarmObj:'漏缆FSU2_R1下行方向',
alarmInfo:'距离:0米 驻波比:8.72',
alarmInfo2:'距离:18米 驻波比:1.07',
alarmInfo3:'距离:42米 驻波比:1.02',
firstTime:'2022/12/18 11:51:12'
},
],
};
},
computed: {
...mapGetters({}),
},
methods: {
...mapActions({}),
getTableData() {
this.tableData = this.historyStatusList.slice(
(this.currentPage - 1) * this.pageSize,
this.currentPage * this.pageSize
);
this.total = this.historyStatusList.length;
},
currentChange(val) {
this.currentPage = val;
this.getTableData();
},
sizeChange(val) {
console.log("改变每页多少条,当前一页多少条数据", val);
this.pageSize = val;
this.currentPage = 1;
this.getTableData();
},
},
mounted() {},
};
</script>
<style scoped>
</style>
\ No newline at end of file
......@@ -49,10 +49,10 @@
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">登录</el-button>
<div class="tips">
<!-- <div class="tips">
<span style="margin-right:20px;">username: admin</span>
<span> password:任意6位</span>
</div>
</div> -->
</el-form>
</div>
......@@ -82,7 +82,7 @@ export default {
return {
loginForm: {
username: 'admin',
password: '111111'
password: '123456'
},
loginRules: {
username: [{ required: true, trigger: 'blur', validator: validateUsername }],
......@@ -114,11 +114,19 @@ export default {
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true
this.$store.dispatch('user/login', this.loginForm).then(() => {
if (this.loginForm.password=='123456') {
this.$router.push({ path: this.redirect || '/' })
this.loading = false
}
else{
alert('密码错误')
this.loading = false
return false
}
}).catch(() => {
this.loading = false
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment