代码优化

master
liangliang.Li 3 years ago
parent e6739924d8
commit 1d3594939c
  1. BIN
      src/assets/img/offshelf.png
  2. 20
      src/components/common/Header.vue
  3. 3
      src/components/page/ClientLogin.vue
  4. 3
      src/components/page/Index.vue
  5. 6
      src/components/page/Login.vue
  6. 9
      src/components/page/ProjectPattern.vue
  7. 5
      src/components/page/Record.vue
  8. 2
      src/components/page/RegisterForm.vue
  9. 150
      src/components/page/ShowExperiment.vue
  10. 10
      src/config/index.js
  11. 2
      src/router/index.js
  12. 5
      src/utils/api.js
  13. 10
      src/utils/core.js

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

@ -36,16 +36,16 @@ export default {
},
methods: {
loginout() {
this.$router.push('/login')
this.$store.replaceState({})
sessionStorage.clear()
// this.$get(this.api.logout,{
// token:this.$store.state.token
// }).then(res => {
// this.$store.replaceState({})
// sessionStorage.clear()
// this.$router.push('/login')
// })
// this.$router.push('/login')
// this.$store.replaceState({})
// sessionStorage.clear()
this.$get(this.api.logout,{
token:this.$store.state.token
}).then(res => {
this.$store.replaceState({})
sessionStorage.clear()
this.$router.push('/login')
})
},
toPersonalCenter(){
this.$router.push('/personalcenter')

@ -204,8 +204,6 @@ export default {
if(item.includes('type')){
let type = item.split('=')
this.type = type[1]
console.log(this.type);
}
})
if(this.type == '1'){
@ -214,7 +212,6 @@ export default {
}
},
backIndex(){
// this.$router.go(-1);
this.$router.push('login');
},
getSchool(form) {

@ -11,7 +11,7 @@
<div class="button_item right" @click="toNext(1)">
<div class="text_wrap">
<div>期权交易</div>
<div>仿实验</div>
<div>仿实验</div>
</div>
<div class="img_wrap"><img src="../../assets/img/right_up.png" alt=""></div>
</div>
@ -61,7 +61,6 @@ export default {
};
},
mounted() {
// sessionStorage.removeItem('model')
this.showChangePass()
},
methods:{

@ -74,7 +74,7 @@ export default {
//
userAuth(){
location.href = 'http://116.63.168.79/liuwanr/userInfo/loginSchoolPerson'
location.href = 'https://finance.uestc.cn/liuwanr/userInfo/loginSchoolPerson'
},
accessNum(){
this.$get(this.api.getAccessNum).then(res =>{
@ -84,12 +84,12 @@ export default {
}).catch(err=>{})
},
toClient(){
location.href = location.host.includes('116.63.168.79') ? 'http://116.63.168.79/kdclient/#/clientLogin?type=0' : 'http://122.9.154.146/kdclient/#/clientLogin?type=0'
location.href = location.host.includes('116.63.168.79') ? 'http://116.63.168.79/kdclient/#/clientLogin?type=0' : 'https://finance.uestc.cn/kdclient/#/clientLogin?type=0'
// this.$router.push(`/clientLogin?type=0`)
this.visiteShow = false
},
toMang(){
location.href = location.host.includes('116.63.168.79') ? 'http://116.63.168.79/kdserver/#/login' : 'http://122.9.154.146/kdserver/#/login'
location.href = location.host.includes('116.63.168.79') ? 'http://116.63.168.79/kdserver/#/login' : 'https://finance.uestc.cn/kdserver/#/login'
},
toExpert(){
this.loadIns = Loading.service({

@ -85,15 +85,6 @@ export default {
},
toPrac(){
this.core.toSubSystem('','','',this.pattern)
// if(this.pattern == 2){
// sessionStorage.setItem("model",this.pattern);
// this.core.toSubSystem('','','',0)
// }else if(this.pattern == 3){
// sessionStorage.setItem("model",this.pattern);
// this.core.toSubSystem('','','',0)
// }else{
// this.core.toSubSystem('','','',this.pattern)
// }
},
toNext(index) {
sessionStorage.setItem('pattern',this.pattern)

@ -70,10 +70,7 @@ export default {
this.$get(`${this.api.fictitiousScore}/${this.userId}`, {})
.then(res => {
this.overview = res.data
})
.catch(err => {
console.log(err);
});
}).catch(err => {});
}
},
components: {

@ -133,7 +133,7 @@ export default {
methods: {
//
getVerificationCode(){
this.verifyCode = `http://116.63.168.79/evaluation/tms/userInfo/getValidateCode?id=${Math.random()}`
this.verifyCode = `https://finance.uestc.cn/evaluation/tms/userInfo/getValidateCode?id=${Math.random()}`
},
getProvince(){
this.$get(this.api.queryProvince).then(res => {

@ -324,7 +324,52 @@
</div>
</div>
<div v-if="pattern == 3">
<div v-for="item in patternFour.reportList" :key="item.id" class="item_wrap">
<div class="select_wrap">
{{item.id + 1}}
</div>
<div class="table_wrap">
<el-table :data="item.tableData" stripe header-align="center" border :span-method="mergeColumn">
<el-table-column prop="arbitrageDirection" align="center" label="套利方向" ></el-table-column>
<el-table-column prop="futureName" align="center" label="合约" ></el-table-column>
<el-table-column prop="transactionTime" align="center" label="开仓时间" ></el-table-column>
<el-table-column align="center" label="开仓方向" >
<template slot-scope="scope">{{scope.row.tradeDirection == 'BUY'?'买入':'卖出'}}</template>
</el-table-column>
<el-table-column align="center" label="开仓价" >
<template slot-scope="scope">
{{scope.row.price}}/
</template>
</el-table-column>
<el-table-column prop="closeTime" align="center" label="平仓时间" ></el-table-column>
<el-table-column prop="closeType" align="center" label="平仓方式" ></el-table-column>
<el-table-column prop="closePrice" align="center" label="平仓价" ></el-table-column>
<el-table-column prop="count" align="center" label="数量" >
<template slot-scope="scope">
{{scope.row.futureName.includes('现货')? `${scope.row.quantity}(吨)`:`${scope.row.quantity}(手)`}}
</template>
</el-table-column>
<el-table-column prop="profit" align="center" label="合约盈亏" ></el-table-column>
<el-table-column prop="closeProfit" align="center" label="持仓成本损益" ></el-table-column>
<el-table-column prop="totalProfit" align="center" label="总盈亏" ></el-table-column>
<el-table-column prop="annualizedRate" align="center" label="年化收益率" ></el-table-column>
</el-table>
<!-- 折线图区域 -->
<div class="chart_wrap">
<div class="chart_one">
<div class="line_wrap">
<div :id="'line_contentOne' + item.id" class="line_content"></div>
</div>
</div>
<div class="chart_two">
<div class="chart_two_title">无套利区间</div>
<div class="line_wrap">
<div :id="'line_contentTwo' + item.id" class="line_content"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<el-input style="margin-top: 20px" v-model="form.analysis" type="textarea" :disabled="true" rows="5"></el-input>
</div>
@ -370,6 +415,7 @@
</template>
<script>
import echarts from 'echarts/lib/echarts';
import html2Canvas from 'html2canvas'
import JsPDF from 'jspdf'
export default {
@ -425,7 +471,7 @@
hisPositionData1:[]
},
patternFour:{
reportList:[]
},
sjData: [],
infoData: [],
@ -437,6 +483,33 @@
this.getSgin()
},
methods: {
//
mergeColumn({ row, column, rowIndex, columnIndex }){
if(columnIndex == 0 || columnIndex == 11 || columnIndex == 12){
if (rowIndex % 2 === 0) {
return {
rowspan: 2,
colspan: 1
};
} else {
return {
rowspan: 0,
colspan: 0
};
}
}
},
//echart
drawChart(){
this.patternFour.reportList.forEach(item =>{
setTimeout(() => {
let myChart = echarts.init(document.getElementById('line_contentOne' + item.id));
let myChartTwo = echarts.init(document.getElementById('line_contentTwo' + item.id));
myChart.setOption(item.option);
myChartTwo.setOption(item.optionTwo);
}, 500);
})
},
getData(){
let data = {
reportId: this.id,
@ -477,6 +550,18 @@
this.patternThree.hisPositionData1 = steps9.hisPositionData1 ? steps9.hisPositionData1: []
}
break;
case 3:
if(report.steps6){
let steps6 = JSON.parse(report.steps6)
console.log(steps6);
this.patternFour.reportList = steps6 ? steps6: []
console.log(this.patternFour.reportList);
this.drawChart()
}
break
}
@ -609,6 +694,67 @@
</script>
<style lang="scss" scoped>
.chart_two_title{
height: 60px;
line-height: 60px;
width: 100%;
text-align: center;
font-size: 18px;
color: #3D8BF7;
}
.chart_one{
padding: 50px 120px;
box-sizing: border-box;
}
.chart_two{
margin: 20px 40px;
padding: 10px 50px;
border: 3px solid #3D8BF7;
box-sizing: border-box;
}
.chart_wrap{
box-sizing: border-box;
border: 2px solid #3D8BF7;
border-left: none;
}
.line_wrap{
height: 400px;
width: 100%;
background: rgb(248, 245, 245);
.line_content{
width: 100%;
height: 100%;
}
.design_chart_empty{
background: url(../../assets/img/offshelf.png) 58% 50% no-repeat;
background-size: 250px ;
}
}
.item_wrap{
display: flex;
// justify-content: center;
margin-left:60px ;
align-items: center;
padding: 0px 20px;
position: relative;
.table_wrap{
width: 90%;
box-sizing: border-box;
margin-left: 80px;
}
}
.select_wrap{
text-align: center;
width: 80px;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
box-sizing: border-box;
border: 2px solid #3D8BF7;
}
.mat10{
margin-top: 10px;
margin-bottom: 10px;

@ -12,23 +12,23 @@ export default {
/**
* @description 基础url
*/
baseUrl: location.host.includes('116.63.168.79') ? 'http://116.63.168.79' : 'http://122.9.154.146',
baseUrl: location.host.includes('116.63.168.79') ? 'http://116.63.168.79' : 'https://finance.uestc.cn',
/**
* @description 基础模式子系统链接
*/
subSystem1: location.host.includes('116.63.168.79') ? 'http://116.63.168.79/kd/#/Dashboard' : 'http://122.9.154.146/kd/#/Dashboard',
subSystem1: location.host.includes('116.63.168.79') ? 'http://116.63.168.79/kd/#/Dashboard' : 'https://finance.uestc.cn/kd/#/Dashboard',
/**
* @description 挑战模式子系统链接
*/
subSystem2: location.host.includes('116.63.168.79') ? 'http://116.63.168.79/kdChallenge/#/Dashboard' : 'http://122.9.154.146/kdChallenge/#/Dashboard',
subSystem2: location.host.includes('116.63.168.79') ? 'http://116.63.168.79/kdChallenge/#/Dashboard' : 'https://finance.uestc.cn/kdChallenge/#/Dashboard',
/**
* @description 期货模式
*/
subSystem3: location.host.includes('116.63.168.79') ? 'http://116.63.168.79/future/#/Dashboard' : 'http://122.9.154.146//future/#/Dashboard',
subSystem3: location.host.includes('116.63.168.79') ? 'http://116.63.168.79/future/#/Dashboard' : 'https://finance.uestc.cn//future/#/Dashboard',
/**
* @description 期货套利模式
*/
subSystem4: location.host.includes('116.63.168.79') ? 'http://116.63.168.79/futureArbitrage/#/Dashboard' : 'http://122.9.154.146/futureArbitrage/#/Dashboard',
subSystem4: location.host.includes('116.63.168.79') ? 'http://116.63.168.79/futureArbitrage/#/Dashboard' : 'https://finance.uestc.cn/futureArbitrage/#/Dashboard',
/**
* @description 专家账号
*/

@ -10,8 +10,6 @@ export default new Router({
{
path: '/',
redirect: '/login'
// redirect: '/dashboard'
// redirect: '/clientLogin'
},
{
path: '/teachingVideo',

@ -4,10 +4,11 @@ import axios from 'axios';
// let host = 'http://192.168.31.137:9090'//陈
// let host = 'http://192.168.31.205:9090'//杨
// let host = 'https://finance.uestc.cn/'//学校内网
// let host = 'https://116.63.168.79/'//学校内网
let host = ''
if(process.env.NODE_ENV === 'development'){
host = 'http://122.9.154.146'
// host = 'http://116.63.168.79'
host = 'https://finance.uestc.cn'
}
export default {

@ -3,6 +3,7 @@ import store from '@/store'
import api from '@/utils/api'
import {get} from '@/utils/http'
import router from '@/router/index.js';
import { Message } from 'element-ui'
const pad2 = str => ('0' + str).substr(-2)
function fMoney (s, n) {
@ -197,22 +198,21 @@ function toSubSystem(className = '',id = '',classId = '',pattern = ''){
{
case 0:
location.href = config.subSystem1
sessionStorage.setItem("id",1);
break;
case 1:
location.href = config.subSystem2
sessionStorage.setItem("id",2);
break;
case 2:
location.href = config.subSystem3
sessionStorage.setItem("id",67);
break;
case 3:
location.href = config.subSystem4
sessionStorage.setItem("id",66);
break;
}
// if(sessionStorage.getItem('model')){
// location.href = sessionStorage.getItem('model') == 2 ? config.subSystem3 : config.subSystem4
// }else{
// location.href = pattern === 0 ? config.subSystem1 : config.subSystem2
// }
}
}

Loading…
Cancel
Save