Browse Source

update

master
yuanjunbin 2 years ago
parent
commit
f19212a75b
3 changed files with 127 additions and 153 deletions
  1. +0
    -152
      stock-forcast-web/views/homeData/index.vue.bak
  2. +2
    -1
      stock-forcast-web/views/login/index.vue
  3. +125
    -0
      stock-forcast-web/views/login/index.vue.bak

+ 0
- 152
stock-forcast-web/views/homeData/index.vue.bak View File

@@ -1,152 +0,0 @@
/**
* @Author moxianchengbao
*/

<template>
<div id="main"><br>
<el-row :gutter="12" style="margin-bottom: 20px">
<el-col :span="6">
<el-card shadow="always">
<div style="color:#53a8ff;font-size: large"><el-icon><component :is="User"></component></el-icon> 欢迎您</div>
<div style="padding: 10px 0;text-align: center;font-weight: bold;color: #42b983;font-size: larger" >{{ localName }}</div>
</el-card>
</el-col>
<el-col :span="6">
<el-card shadow="always">
<div style="color: #53a8ff;font-size: large"><el-icon><component :is="Timer"></component></el-icon> 今天是:{{ dateFormat(new Date()) }}</div>
<div style="padding: 10px 0;text-align: center;font-weight: bold;color: #53a8ff;font-size: larger" >{{ weekday }}</div>
</el-card>
</el-col>
<el-col :span="6">
<el-card shadow="always">
<div style="color: #21b9a7;font-size: large"><el-icon><component :is="List"></component></el-icon> 各类模型占比</div>
<div style="padding: 10px 0;text-align: center;font-weight: bold;color:#21b9a7;font-size: larger" >{{ modelTypeCnt }}</div>
</el-card>
</el-col>
<el-col :span="6">
<el-card shadow="always">
<div style="color: #b121bd;font-size: large"><el-icon><component :is="Tickets"></component></el-icon> 模型应用分布</div>
<div style="padding: 10px 0;text-align: center;font-weight: bold;color: #b121bd;font-size: larger" >{{ modelApplyStatus }}</div>
</el-card>
</el-col>

<el-col :span="6">
<el-card shadow="always">
<div style="color: #b121bd;font-size: large"><el-icon><component :is="Tickets"></component></el-icon> 模型数量每月增长趋势</div>
<div style="padding: 10px 0;text-align: center;font-weight: bold;color: #b121bd;font-size: larger" >{{ modelIncreaseStatus }}</div>
</el-card>
</el-col>

</el-row>


<div style="margin-top: 100px">
<el-descriptions
title="登陆者信息"
direction="vertical"
:column="4"
:size="size"
border
>
<el-descriptions-item label="操作系统">{{requestInfo.osName}}</el-descriptions-item>
<el-descriptions-item label="浏览器">{{requestInfo.browserName}}</el-descriptions-item>
<el-descriptions-item label="版本" :span="2">{{requestInfo.browserVersion}}</el-descriptions-item>
<el-descriptions-item label="IP地址">{{requestInfo.ip}}
</el-descriptions-item>
</el-descriptions>
</div>


</div>
</template>

<script>
import {Timer,List,Tickets,User} from '@element-plus/icons-vue'
// import {ElMessage} from "element-plus";
export default {
name: "index",
components:{
Timer,List,Tickets,User
},
data(){
return{
weekday: '', //星期
Timer,List,Tickets,User,
localName: '魔仙堡',
modelTypeCnt: 0 ,
modelApplyStatus: 0,
modelIncreaseStatus:[],
pieData: [],
requestInfo:[]
}
},
methods:{
getinfo(){
this.$http.get("/user/getUserInfo").then(res=>{
if(res.statusCode == '200'){
this.requestInfo = res.data
}
})
},
getModelTypeCnt(){
this.$http.post("/model/getModelTypeCnt").then(res=>{
if(res.statusCode == '200'){
this.modelTypeCnt = res.data
}
})
},
getModelApplyStatus(){
this.$http.post("/model/getModelApplyStatus").then(res=>{
if(res.statusCode == '200'){
this.modelApplyStatus = res.data
}
})
},
getModelIncreaseStatus(){
this.$http.post("/model/modelIncreaseStatus").then(res=>{
if(res.statusCode == '200'){
this.modelIncreaseStatus = res.data
}
})
},
getuserName(){ //获取当前用户名
let token = localStorage.getItem('token')
this.$http.post("/user/getUserNameByToken",token).then(res=>{
if(res.statusCode == '200'){
this.localName = res.data
}
})
},
dateFormat () { //时间处理
var date = new Date()
var year = date.getFullYear()
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
// var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
// var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
// var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
let week = date.getDay() // 星期
let weekArr = [ '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六' ]
this.weekday = weekArr[week]
// return year + '年' + month + '月' + day + '日 ' + hours + ':' + minutes + ':' + seconds + ' ' + weekArr[week]
return year + '年' + month + '月' + day + '日 '
}
},
created() {
this.getuserName()
this.getModelTypeCnt()
this.getModelApplyStatus()
this.getModelIncreaseStatus()
this.getinfo()
}

}
</script>

<style scoped>
#main{
margin-left: 15px;
margin-right: 15px;
}

</style>

+ 2
- 1
stock-forcast-web/views/login/index.vue View File

@@ -1,6 +1,7 @@
/**
* @Author moxianchengbao
*/

<template>
<div id="login-main">
<el-card class="box-card">
@@ -26,7 +27,7 @@

</el-card>
<div class="footerbtn">
<a href="https://beian.miit.gov.cn/" target="_blank" style="text-decoration: none;color: black;">蜀ICP备2021021930号-1</a>
<a href="" target="_blank" style="text-decoration: none;color: black;">蜀ICP备2021021930号-1</a>
</div>
</div>
</template>


+ 125
- 0
stock-forcast-web/views/login/index.vue.bak View File

@@ -0,0 +1,125 @@
/**
* @Author moxianchengbao
*/

<template>
<div id="login-main">
<el-card class="box-card">
<template #header>
<div class="card-header">
<span style="font-weight: bolder;color: #2155c2">登录系统</span>
</div>
</template>

<el-form :model="resetForm" status-icon :rules="resetFormRules" ref="resetForm" label-width="100px" style="width: 300px" hide-required-asterisk="false">
<el-form-item label="用户名" prop="username">
<el-input type="text" v-model="resetForm.username" auto-complete="off" placeholder="请输入用户名"></el-input>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input type="password" show-password v-model="resetForm.password" auto-complete="off" placeholder="请输入密码"></el-input>
</el-form-item>
</el-form>

<div class="subm">
<el-button type="primary" round @click="subup('resetForm')"> 登录</el-button>
<!-- <el-button type="primary" round> 注 册</el-button>-->
</div>

</el-card>
<div class="footerbtn">
<a href="/" target="_blank" style="text-decoration: none;color: black;">蜀ICP备2021021930号-1</a>
</div>
</div>
</template>

<script>
import {ElMessage} from "element-plus";

export default {
name: "index",
data(){
var validatePass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入密码!'));
} else {
callback();
}
};
var validateid = (rule, value, callback) => {
if (!value) {
callback(new Error('请输入用户名!'));
} else {
callback();
}
};
return{
//重置密码
resetForm: {},
resetFormRules: {
password: [
{ required: true, validator: validatePass,trigger: 'blur' }
],
username: [
{ required: true, validator: validateid, trigger: 'blur' }
]
},

}
},
methods:{
subup(resetForm){
this.$refs[resetForm].validate((valid)=>{
if(valid){
this.$http.post("/user/login",this.resetForm).then(res=>{
if(res.statusCode == '200'){
localStorage.setItem("token",res.data.userToken)
ElMessage({
message: '登录成功!',
type: 'success',
})
this.$router.push("/")
}else {
ElMessage.error('登录失败!')
}
}).catch(()=>{
ElMessage.error('登录失败!')
})
}else{
ElMessage.error('请填写!')
return false;
}
})
}
},
created() {
localStorage.removeItem("token")
}

}
</script>

<style scoped>
#login-main{
margin-left: 15px;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
}

.box-card {
width: 480px;
margin-left: 30%;
margin-top: 10%;
}
.subm{
margin-left: 35%;
margin-top: 7%;
}
.footerbtn{
margin-left: 580px;
margin-top: 150px;
}

</style>

Loading…
Cancel
Save