交易完成

main
qinzhenpen 2 years ago
parent c207b2982a
commit 933ed0ffe7

@ -8,7 +8,7 @@ export const getMarketQuotation = () => {
// 可用资金
export const getMemberById = ( memberId) => {
return request({
url: 'api/member/getMemberById ',
url: 'api/member/getMemberById',
method: 'post',
data: memberId
})
@ -20,4 +20,12 @@ export const getMarketQuotation = () => {
method: 'post',
data: code
})
}
export const transactionMarketQuotation = ( data) => {
return request({
url: 'api/trading/transactionMarketQuotation',
method: 'post',
data: data
})
}

@ -0,0 +1,24 @@
import request from '@/utils/request'
export const getTakeStashList = (data) => {
return request({
url: 'api/takeStash/getTakeStashList',
method: 'post',
data: data
})
}
export const flashProfitAndLoss = (data) => {
return request({
url: 'api/takeStash/flashProfitAndLoss',
method: 'post',
data: data
})
}
export const updateTakeStash = (data) => {
return request({
url: 'api/takeStash/updateTakeStash',
method: 'post',
data: data
})
}

@ -38,7 +38,7 @@ export function getInfo() {
// 退出方法
export function logout() {
return request({
url: '/logout',
url: '/api/sysUser/logout',
method: 'post'
})
}

@ -5,4 +5,12 @@ export const getRouters = () => {
url: '/api/sysUser/getRoutesByRole',
method: 'get'
})
}
}
// 件分页获取实训记录数据
export const findByConditions = (query) => {
return request({
url: '/api/training/findByConditions',
method: 'get',
params:query
})
}

@ -101,8 +101,8 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$store.dispatch('FedLogOut').then(() => {
location.href = '/index'
this.$store.dispatch('LogOut').then(() => {
location.href = '/login'
})
}).catch(() => {})
}

@ -79,11 +79,11 @@ export default {
mounted() {
const roleid = getroleId();
// roleid4,3
// if (roleid == 4) {
if (roleid == 4) {
this.routesList = dynamicRoutes
// } else if (roleid == 3) {
// this.routesList = teacher;
// }
} else if (roleid == 3) {
this.routesList = teacher;
}
},
watch: {
limitsRoutes() {

@ -11,7 +11,7 @@ NProgress.configure({ showSpinner: false })
const whiteList = ['/login', '/register']
var datas = []
router.beforeEach((to, from, next) => {
console.log(to.path, "----")
// if (datas.indexOf(to.path)) {
// alert(1)
// next()

@ -86,7 +86,6 @@ export const constantRoutes = [
redirect: '/404'
}
]
// 动态路由,基于用户权限动态去加载
export const dynamicRoutes = [{
path: '/student',
@ -112,7 +111,7 @@ export const dynamicRoutes = [{
path: 'index',
component: () => import('@/views/transactionRecords/index'),
name: 'transactionRecords',
meta: { title: '交易记录', icon: 'null', affix: true, activeMenu: '/index' }
meta: { title: '交易记录', icon: 'null', affix: true, activeMenu: '/student/index' }
}
]
},
@ -140,7 +139,7 @@ export const dynamicRoutes = [{
path: 'homepageage',
component: () => import('@/views/task/index'),
name: 'homepageage',
meta: { title: '任务主页', affix: true, activeMenu: '/training/List' }
meta: { title: '任务主页', affix: true, activeMenu: '/student/training/List' }
}
]
},
@ -154,7 +153,7 @@ export const dynamicRoutes = [{
path: 'homepagege',
component: () => import('@/views/PracticeZone/index.vue'),
name: 'PracticeZone',
meta: { title: '练习专区', affix: true, activeMenu: '/training/List' }
meta: { title: '练习专区', affix: true, activeMenu: '/student/training/List' }
}
]
},
@ -168,7 +167,7 @@ export const dynamicRoutes = [{
path: 'index',
component: () => import('@/views/trade/index.vue'),
name: 'Index',
meta: { title: '练习专区', affix: true, activeMenu: '/training/List' }
meta: { title: '练习专区', affix: true, activeMenu: '/student/training/List' }
}
]
},
@ -270,34 +269,34 @@ export const dynamicRoutes = [{
}
]
}
, { path: '*', redirect: '/404' },
, { path: '*', redirect: '/404' }
]
// 教师端路由
export const teacher = [
{
path: '',
path: '/teacher',
component: Layout,
redirect: 'ageIssue',
hidden: false,
children: [
{
path: 'teacher',
path: 'index',
component: () => import('@/views/index_v1.vue'),
name: 'teacher',
meta: { title: '首页', icon: 'dashboard', affix: true }
}
]
},
]
// 教师端路由
export const teacher = [
{
path: '',
path: '/teacher',
component: Layout,
redirect: 'ageIssue',
hidden: false,
children: [
{
path: 'teacher',
component: () => import('@/views/index_v1.vue'),
name: 'teacher',
path: 'report',
component: () => import('@/views/report/index.vue'),
name: 'report',
meta: { title: '首页', icon: 'dashboard', affix: true }
}
]
@ -323,11 +322,15 @@ router.beforeEach((to, from, next) => {
// next();
console.log('to.fullPath',to.fullPath);
console.log('localStorage.getItem("limitsRoutes")', localStorage.getItem("limitsRoutes"));
let fullPath=to.fullPath
if(fullPath.indexOf('?')!=-1){
fullPath=fullPath.split('?')[0]
console.log('fullPath',fullPath);
}
const limitsRoutes = localStorage.getItem("limitsRoutes") ? localStorage.getItem("limitsRoutes").split(',') : []
if (!constantRoutes.filter(item => item.path == to.fullPath).length && to.fullPath !== '/404') {
if (limitsRoutes.indexOf(to.fullPath) == -1) {
if (!constantRoutes.filter(item => item.path == fullPath).length &&fullPath !== '/404') {
if (limitsRoutes.indexOf(fullPath) == -1) {
console.log('没有权限')
next({ path: "/login" });
} else {
@ -343,7 +346,6 @@ const limitsRoutes = localStorage.getItem("limitsRoutes") ? localStorage.getItem
else {
next();
}
});
export default router
export default router

@ -8,6 +8,7 @@ const user = {
schoolId: cookie.getschoolId(),
classid: '',
memberId: cookie.getmemberId(),
trainingId: '',
roles: [],
permissions: []
},
@ -33,6 +34,9 @@ const user = {
},
SET_MEMBERID: (state, memberId) => {
state.memberId = memberId
},
SET_TRAININGID: (state, trainingId) => {
state.trainingId = trainingId
}
},
actions: {
@ -82,7 +86,16 @@ const user = {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
commit('SET_PERMISSIONS', [])
removeToken()
// 删除token
cookie.removeToken()
// 删除username
cookie.removename()
// 删除schoolId
cookie.removeschoolId()
// 删除memberId
cookie.removememberId()
// 删除roleId
cookie.removeroleId()
resolve()
}).catch(error => {
reject(error)

@ -14,9 +14,9 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
// 创建axios实例
const service = axios.create({
// axios中请求配置有baseURL选项表示请求URL公共部分
baseURL: 'http://118.31.7.2:8800',
// baseURL: 'http://118.31.7.2:8800',
// baseURL: 'http://192.168.2.14:8800',
// baseURL:"http://192.168.2.17:8800",
baseURL:"http://192.168.2.17:8800",
// baseURL: process.env.VUE_APP_BASE_API,
// 超时
timeout: 200000
@ -70,6 +70,7 @@ service.interceptors.request.use(config => {
// 响应拦截器
service.interceptors.response.use(res => {
console.log(res, 'res');
// 未设置状态码则默认成功状态
const code = res.data.code || 200
// 获取错误信息

@ -31,7 +31,7 @@
</el-select>
</el-form-item>
<el-form-item label="日期" prop="cateId">
<el-date-picker v-model="queryParams.startTime" type="date" placeholder="选择日期" />
<el-date-picker v-model="queryParams.startTime" value-format="yyyy-MM-dd HH:mm:ss" type="date" placeholder="选择日期" />
</el-form-item>
<el-form-item label="搜索" prop="status">
<el-input placeholder="学号 / 姓名" clearable v-model="queryParams.name" />
@ -65,12 +65,15 @@
/>
<el-table-column prop="experiment" label="实验报告成绩" align="center" />
<el-table-column prop="totalAssets" label="总成绩" align="center" />
<el-table-column prop="address" label="交易记录" align="center">
<el-button
size="mini"
type="primary"
@click="trade"
>交易记录</el-button>
<el-table-column label="交易记录" align="center">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
@click="trade(scope.row)"
>交易记录</el-button>
</template>
</el-table-column>
</el-table>
<pagination
@ -116,6 +119,7 @@ export default {
this.loading=true
home.findAll(this.queryParams).then((res) => {
if(res.code !== 200) return
// Mon Jul 24 2023 00:00:00 GMT+0800 ()2023-07-24-00:00:00
this.transactionlist=res.data.list
this.total=res.data.total
@ -136,8 +140,9 @@ export default {
this.classeslist=res.data
})
},
trade() {
this.$tab.openPage('交易记录', '/student/transactionRecords/index')
trade(data) {
console.log(data,"data");
// this.$tab.openPage('', `/student/transactionRecords/index?trainingId:${this.transactionlist.trainingId}`)
},
lianxi() {
this.$tab.openPage('实训任务', '/student/training/List')

@ -1,168 +1,234 @@
<template>
<div class="app-mian">
<!-- 搜索栏 -->
<div class="index">
<el-form ref="queryForm" size="small" :inline="true" :model="queryParams">
<el-form-item label="实训任务" prop="title" class="formIpt">
<el-select placeholder="选择任务" clearable type="image" v-model="queryParams.trainingName">
<el-option v-for="item in tasklist" :key="item.training_id" :label="item.training_name" :value="item.training_name"/>
</el-select>
</el-form-item>
<el-form-item label="班级" prop="content" class="formIpt">
<el-select placeholder="选择分类" clearable type="image" v-model="queryParams.classGrade">
<el-option v-for="item in classeslist" :key="item" :label="item" :value="item"/>
</el-select>
</el-form-item>
<el-form-item label="日期" prop="cateId">
<el-date-picker v-model="queryParams.startTime" type="date" placeholder="选择日期" />
</el-form-item>
<el-form-item label="搜索" prop="status">
<el-input placeholder="学号 / 姓名" clearable v-model="queryParams.name" />
</el-form-item>
<div class="app-mian">
<!-- 搜索栏 -->
<div class="index">
<el-form ref="queryForm" size="small" :inline="true" :model="queryParams">
<el-form-item label="实训任务" prop="title" class="formIpt">
<el-select placeholder="选择任务" clearable type="image" v-model="queryParams.trainingName">
<el-option v-for="item in tasklist" :key="item.training_id" :label="item.training_name" :value="item.training_name"/>
</el-select>
</el-form-item>
<el-form-item label="班级" prop="content" class="formIpt">
<el-select placeholder="选择分类" clearable type="image" v-model="queryParams.classGrade">
<el-option v-for="item in classeslist" :key="item" :label="item" :value="item"/>
</el-select>
</el-form-item>
<el-form-item label="日期" prop="cateId">
<el-date-picker v-model="queryParams.startTime" type="date" placeholder="选择日期" />
</el-form-item>
<el-form-item label="搜索" prop="status">
<el-input placeholder="学号 / 姓名" clearable v-model="queryParams.name" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="getlist"></el-button>
</el-form-item>
<el-form-item>
<el-button type="warning" icon="el-icon-search" size="mini" @click="getlist"></el-button>
</el-form-item>
<div class="weight">
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="getlist"></el-button>
</el-form-item>
<el-form-item>
<el-button type="warning" icon="el-icon-search" size="mini" @click="getlist"></el-button>
</el-form-item>
<div class="weight">
<el-form-item>
<el-button type="warning" icon="el-icon-search" size="mini" @click="centerDialogVisible=true"></el-button>
</el-form-item>
</div>
</el-form>
<el-table v-loading="loading" :data="transactionlist" style="width: 100%" >
<el-table-column prop="stuRank" label="排名" width="100" align="center" />
<el-table-column prop="stuRank" label="实训任务名称" width="100" align="center" />
<el-table-column prop="classGrade" label="班级" width="140" align="center" />
<el-table-column prop="name" label="姓名" align="center" />
<el-table-column prop="studentNumber" label="学号" align="center" />
<el-table-column label="累计盈亏" align="center">
<template slot-scope="scope">
<span v-if="scope.row.cumulativeProfitLoss > 0" style="color: #f98133">{{scope.row.cumulativeProfitLoss }}</span>
<span v-else-if="scope.row.profit < 0" style="color: #36b9b2">{{scope.row.cumulativeProfitLoss}}</span>
</template>
</el-table-column>
<el-table-column prop="yield" label="收益率" align="center" />
<el-table-column prop="Simulation" label="模拟交易实训成绩" align="center"/>
<el-table-column prop="experiment" label="实验报告成绩" align="center" />
<el-table-column prop="totalAssets" label="总成绩" align="center" />
<el-table-column prop="address" label="操作" align="center" width="300">
<el-button size="mini" type="primary" @click="report"></el-button>
<el-button size="mini" type="primary" @click="trade"></el-button>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.index"
:limit.sync="queryParams.size"
@pagination="getlist"
/>
<el-dialog
title="成绩权重设置"
:visible.sync="centerDialogVisible"
width="30%"
append-to-body
<el-button type="warning" icon="el-icon-search" size="mini" @click="centerDialogVisible=true"></el-button>
</el-form-item>
</div>
</el-form>
<el-table v-loading="loading" :data="transactionlist" style="width: 100%" >
<el-table-column prop="stuRank" label="排名" width="100" align="center" />
<el-table-column prop="stuRank" label="实训任务名称" width="100" align="center" />
<el-table-column prop="classGrade" label="班级" width="140" align="center" />
<el-table-column prop="name" label="姓名" align="center" />
<el-table-column prop="studentNumber" label="学号" align="center" />
<el-table-column label="累计盈亏" align="center">
<template slot-scope="scope">
<span v-if="scope.row.cumulativeProfitLoss > 0" style="color: #f98133">{{scope.row.cumulativeProfitLoss }}</span>
<span v-else-if="scope.row.profit < 0" style="color: #36b9b2">{{scope.row.cumulativeProfitLoss}}</span>
</template>
</el-table-column>
<el-table-column prop="yield" label="收益率" align="center" />
<el-table-column prop="Simulation" label="模拟交易实训成绩" align="center"/>
<el-table-column prop="experiment" label="实验报告成绩" align="center" />
<el-table-column prop="totalAssets" label="总成绩" align="center" />
<el-table-column prop="address" label="操作" align="center" width="300">
<el-button size="mini" type="warning" @click="report"></el-button>
<el-button size="mini" type="primary" @click="trade"></el-button>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.index"
:limit.sync="queryParams.size"
@pagination="getlist"
/>
<el-dialog
title="成绩权重设置"
:visible.sync="centerDialogVisible"
width="30%"
append-to-body
>
<span slot="footer" class="dialog-footer">
<el-button
type="primary"
@click="centerDialogVisible = false"
> </el-button>
<el-button
type="info"
@click="centerDialogVisible = false"
> </el-button>
</span>
</el-dialog>
</div>
<el-form :inline="true" >
<el-form-item label="模拟交易收益评分:">
<el-input style="width: 100px;" placeholder="审批人" class="input__inner" ></el-input>
</el-form-item>
<el-form-item label="实验报告评分:">
<el-input style="width: 100px;" placeholder="审批人" class="input__inner"></el-input>
</el-form-item>
<el-row>
<el-col :span="24"><div class="record" style="margin-bottom: 20px;">模拟交易收益评分设置:</div></el-col>
</el-row>
<el-form-item label="收益率:">
<el-input style="width: 160px;" placeholder="审批人" class="input"></el-input>
</el-form-item>
<el-form-item label="以上:">
<el-input style="width: 160px;" placeholder="审批人" class="input-a"></el-input>
</el-form-item>
<el-form-item label="收益率:">
<el-input style="width: 120px;" placeholder="审批人" class="input"></el-input>
</el-form-item>
<el-form-item label="至:">
<el-input style="width: 120px;" placeholder="审批人" class="input"></el-input>
</el-form-item>
<el-form-item >
<el-input style="width: 120px;" placeholder="审批人" class="input-a"></el-input>
</el-form-item>
<el-form-item label="收益率:">
<el-input style="width: 120px;" placeholder="审批人" class="input"></el-input>
</el-form-item>
<el-form-item label="至:">
<el-input style="width: 120px;" placeholder="审批人" class="input"></el-input>
</el-form-item>
<el-form-item >
<el-input style="width: 120px;" placeholder="审批人" class="input-a"></el-input>
</el-form-item>
<el-form-item label="收益率:">
<el-input style="width: 160px;" placeholder="审批人" class="input"></el-input>
</el-form-item>
<el-form-item label="以下:">
<el-input style="width: 160px;" placeholder="审批人" class="input-a"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button
type="primary"
@click="centerDialogVisible = false"
> </el-button>
<el-button
type="info"
@click="centerDialogVisible = false"
> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import * as home from '@/api/index.js'
export default {
name: 'Index',
data() {
return {
centerDialogVisible:false,
loading:true,
queryParams: {
trainingName: null,
classGrade: '',
index: 1,
name: '',
size: 10,
startTime: null,
studentNumber: ''
},
tasklist:null,
classeslist:null,
transactionlist:[],
total:0
}
},
computed: {},
created() {
this.getlist()
this.taskname()
this.classGrade()
},
methods: {
getlist() {
this.loading=true
home.findAll(this.queryParams).then((res) => {
if(res.code !== 200) return
this.transactionlist=res.data.list
this.total=res.data.total
// console.log(this.transactionlist,"this.transactionlist");
this.loading=false
})
</div>
</template>
<script>
import * as home from '@/api/teacher/index.js'
export default {
name: 'Index',
data() {
return {
centerDialogVisible:false,
loading:true,
queryParams: {
index: 1,
size: 10,
},
taskname() {
//
home.getTrainingName().then((res) => {
if(res.code !== 200) return
this.tasklist=res.data
})
},
classGrade() {
home.getClassGrade().then((res) => {
if(res.code !== 200) return
this.classeslist=res.data
})
},
trade() {
this.$tab.openPage('交易记录', '/student/transactionRecords/index')
},
report() {
this.$tab.openPage('实验报告', '/student/report/index')
}
tasklist:null,
classeslist:null,
transactionlist:[],
total:0
}
},
computed: {},
created() {
this.getlist()
this.taskname()
this.classGrade()
},
methods: {
getlist() {
this.loading=true
home.findByConditions(this.queryParams).then((res) => {
if(res.code !== 200) return
this.transactionlist=res.data.list
this.total=res.data.total
// console.log(this.transactionlist,"this.transactionlist");
this.loading=false
})
},
taskname() {
//
home.getTrainingName().then((res) => {
if(res.code !== 200) return
this.tasklist=res.data
})
},
classGrade() {
home.getClassGrade().then((res) => {
if(res.code !== 200) return
this.classeslist=res.data
})
},
trade() {
this.$tab.openPage('交易记录', '/student/transactionRecords/index')
},
report() {
this.$tab.openPage('实验报告', '/teacher/report')
}
}
</script>
<style lang='scss' scoped>
.row-bg {
display: flex;
width: 100% !important;
}
.index {
position: relative;
background: #ffff;
border-radius: 4px;
padding: 20px;
}
img {
cursor: pointer;
}
.weight{
position: absolute;
right: 0;
top: 20px;
}
</script>
<style lang='scss' scoped>
.row-bg {
display: flex;
width: 100% !important;
}
.index {
position: relative;
background: #ffff;
border-radius: 4px;
padding: 20px;
.record{
margin-bottom: 20px !important;
font-size: 16px;
font-family: Microsoft YaHei;
font-weight: bold;
color: #1D2129;
}
</style>
}
.weight{
position: absolute;
right: 0;
top: 20px;
}
.input__inner{
display: flex;
margin-right: 30px;;
&::after{
display: block;
// display: none;
content: '%' !important;
margin-left: 10px;
}
}
.input{
display: flex;
&::after{
display: block;
// display: none;
content: '%' !important;
margin-left: 10px;
}
}
.input-a{
display: flex;
&::after{
// display: none;
content: '分' !important;
margin-left: 10px;
}
}
</style>

@ -176,16 +176,7 @@ export default {
path: this.redirect || "/student/index",
});
} else {
this.$router.push({ path: this.redirect || "/teacher" });
}
} else {
localStorage.setItem("limitsRoutes",['/teacher']);
if (getroleId() == 4) {
this.$router.push({
path: this.redirect || "/student/index",
});
} else {
this.$router.push({ path: this.redirect || "/teacher" });
this.$router.push({ path: this.redirect || "/teacher/index" });
}
}
console.log("res111", localStorage.getItem("limitsRoutes"));

@ -0,0 +1,108 @@
<template>
<div class="homepage-report">
<el-row>
<el-col :span="24"><div class="titles">外汇模拟交易过程风险管理</div></el-col>
</el-row>
<el-form>
<el-row :gutter="20" type="flex" justify="space-between">
<el-col :span="11">
<el-form-item label="交易计划:">
<el-input type="textarea"></el-input>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="交易方法与技巧:">
<el-input type="textarea"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24"><div class="titles">外汇模拟交易过程收益分析</div></el-col>
</el-row>
<el-row :gutter="20" type="flex" justify="space-between">
<el-col :span="11">
<el-form-item label="盈利品种分析:">
<el-input type="textarea"></el-input>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="亏损品种分析:">
<el-input type="textarea"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24"
><div class="titles">外汇模拟交易过程改进措施</div></el-col
>
</el-row>
<el-row :gutter="20" type="flex" justify="space-between">
<el-col :span="11">
<el-form-item label="改进措施1:">
<el-input type="textarea"></el-input>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="改进措施2:">
<el-input type="textarea"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</template>
<script>
export default {
name: "",
data() {
return {};
},
created() {},
computed: {},
methods: {},
};
</script>
<style lang='scss' scoped>
.homepage-report {
width: 100%;
height: 100%;
background: url("../../assets/images/report.png") no-repeat !important;
background-size: 100% 100% !important;
.titles {
margin-top: 10px;
font-size: 18px;
font-family: Microsoft YaHei;
font-weight: bold;
}
.el-row {
margin-bottom: 20px;
&:last-child {
margin-bottom: 0;
}
}
::v-deep .el-form {
.el-form-item__label {
font-size: 16px;
font-family: Microsoft YaHei;
font-weight: bold;
color: #333333;
&.el-form-item__label::before {
display: inline-block;
content: "";
width: 7px;
height: 14px;
background: #3c9cf5;
border-radius: 4px;
margin-right: 8px;
}
}
.el-textarea__inner {
min-height: 160px !important;
border-color: transparent;
background: #f6f7f8;
}
}
}
</style>

@ -19,7 +19,6 @@
:label="item.label"
:name="item.name"
>
<components
:is="item.name"
:id="id"

@ -79,9 +79,9 @@ export default {
methods: {
getlist() {
homepage.getMember({name:this.name,schoolId:this.schoolId,trainingId:this.id}).then((res) => {
this.datalist = res
setmemberId(res.memberId)
this.$store.commit("SET_MEMBERID", res.memberId);
this.datalist = res.data
setmemberId(res.data.memberId)
this.$store.commit("SET_MEMBERID", res.data.memberId);
})
},
handleClick(tab) {

@ -2,9 +2,7 @@
<div class="homepage-report">
<!-- 御剑乘风来,除魔天地间! -->
<el-row>
<el-col :span="24"
><div class="title">外汇模拟交易过程风险管理</div></el-col
>
<el-col :span="24"><div class="titles">外汇模拟交易过程风险管理</div></el-col>
</el-row>
<el-form>
<el-row :gutter="20" type="flex" justify="space-between">
@ -16,14 +14,11 @@
<el-col :span="11">
<el-form-item label="交易方法与技巧:">
<el-input type="textarea"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24"
><div class="title">外汇模拟交易过程收益分析</div></el-col
>
<el-col :span="24"><div class="titles">外汇模拟交易过程收益分析</div></el-col>
</el-row>
<el-row :gutter="20" type="flex" justify="space-between">
<el-col :span="11">
@ -39,7 +34,7 @@
</el-row>
<el-row>
<el-col :span="24"
><div class="title">外汇模拟交易过程改进措施</div></el-col
><div class="titles">外汇模拟交易过程改进措施</div></el-col
>
</el-row>
<el-row :gutter="20" type="flex" justify="space-between">
@ -74,7 +69,7 @@ export default {
height: 100%;
background: url("../../assets/images/report.png") no-repeat !important;
background-size: 100% 100% !important;
.title {
.titles {
margin-top: 10px;
font-size: 18px;
font-family: Microsoft YaHei;

@ -6,30 +6,30 @@
:cell-style="{ background: '#f8f8f9' }"
>
<el-table-column
prop="ranking"
prop="tradingCode"
label="交易品种"
width="100"
align="center"
/>
<el-table-column prop="class" label="订单号" width="140" align="center" />
<el-table-column prop="orderNumber" label="订单号" width="260" align="center" />
<el-table-column label="类型" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.profit >0" type="danger"></el-tag>
<el-tag v-if="scope.row.buySellType === 'buy'" type="danger"></el-tag>
<el-tag v-else></el-tag>
</template>
</el-table-column>
<el-table-column prop="StudentID" label="交易量(手)" align="center" />
<el-table-column label="交易价位" align="center" prop="profit" />
<el-table-column prop="income" label="止损" align="center" />
<el-table-column prop="number" label="止盈" align="center" />
<el-table-column prop="Simulation" label="当前价位" align="center" />
<el-table-column prop="volumeTransaction" label="交易量(手)" align="center" />
<el-table-column label="交易价位" align="center" prop="priceTransaction" />
<el-table-column prop="stopLoss" label="止损" align="center" />
<el-table-column prop="stopWin" label="止盈" align="center" />
<el-table-column prop="currentPrice" label="当前价位" align="center" />
<el-table-column label="持仓盈亏" align="center">
<template slot-scope="scope">
<span v-if="scope.row.experiment > 0" style="color: #EC6C01;">{{ scope.row.experiment }}</span>
<span v-else style="color: #2CB7B0;">{{ scope.row.experiment }}</span>
<span v-if="scope.row.profitAndLoss > 0" style="color: #EC6C01;">{{ scope.row.profitAndLoss }}</span>
<span v-else style="color: #2CB7B0;">{{ scope.row.profitAndLoss }}</span>
</template>
</el-table-column>
<el-table-column prop="class" label="交易时间" align="center" />
<el-table-column prop="timeTransaction" label="交易时间" align="center" />
<el-table-column prop="address" label="操作" align="center" width="200">
<el-button size="mini" type="primary" @click="centerDialogVisible = true">修改</el-button>
<el-button size="mini" type="warning" @click="colseDialogVisible = true">平仓</el-button>
@ -44,7 +44,7 @@
width="30%"
append-to-body
>
<el-form ref="ruleForm" label-width="100px" class="demo-ruleForm">
<el-form ref="ruleForm" label-width="100px" class="demo-ruleForm" :model="tableData">
<el-form-item label="交易品种:">
<el-select placeholder="活动区域" style="width: 100%">
<el-option label="区域一" value="shanghai" />
@ -133,59 +133,53 @@
</div>
</template>
<script>
import * as currentPosition from '@/api/currentPosition'
export default {
data() {
return {
// dialog
centerDialogVisible: false,
//
colseDialogVisible: false,
tableData: [
{
ranking: 'euresd',
class: '1612167713',
name: 1,
StudentID: '2003001',
profit: '+20000',
income: '50%',
number: '8',
Simulation: '80',
experiment: '70'
},
{
ranking: 'euresd',
class: '1612167713',
name: 0,
StudentID: '2003001',
profit: '+20000',
income: '20%',
number: '8',
Simulation: '80',
experiment: '70'
},
{
ranking: 'euresd',
class: '1612167713',
name: 0,
StudentID: '2003001',
profit: '+20000',
income: '20%',
number: '8',
Simulation: '80',
experiment: '-70'
},
{
ranking: 'euresd',
class: '1612167713',
name: 1,
StudentID: '2003001',
profit: '+20000',
income: '20%',
number: '8',
Simulation: '80',
experiment: '70'
}
]
//
tableData:null,
takeStash:{
trainingId:this.$route.query.id,
memberId:this.$store.state.user.memberId,
status:0
},
modifylist:{
stashId:''
}
}
},
created(){
this.getlist()
},
methods:{
getlist() {
currentPosition.getTakeStashList(this.takeStash).then(res => {
// console.log(res)
this.tableData = res.data
setInterval(() => {
this.price(res.data)
}, 5000);
})
},
//
price(data){
currentPosition.flashProfitAndLoss(data).then(res => {
this.tableData = res.data
// this.getlist()
})
}
}
}

@ -27,49 +27,51 @@
</el-tabs>
<!-- 交易 -->
<el-dialog title="交易" :visible.sync="colseDialogVisible" width="30%" append-to-body>
<el-form ref="ruleForm" label-width="100px" class="demo-ruleForm">
<el-form :model="tradingVolume" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="交易品种:">
<el-select placeholder="活动区域" style="width: 100%">
<el-option label="区域一" value="shanghai" />
<el-select v-model="tradingVolume.tradingCode" placeholder="活动区域" style="width: 100%">
<el-option :label="tradingVolume.code" :value="tradingVolume.code" />
</el-select>
</el-form-item>
<el-form-item label="名 称:">
<el-input type="password" autocomplete="off" />
<el-input v-model="tradingVolume.name" autocomplete="off" />
</el-form-item>
<el-form-item label="类 型:">
<el-select v-model="value1" placeholder="请选择开仓类型" style="width: 100%" @change="transaction">
<el-select v-model="tradingVolume.transactionType" placeholder="请选择开仓类型" style="width: 100%" @change="transaction">
<el-option label="市价开仓" value="市价开仓" />
<el-option label="挂单开仓" value="挂单开仓" />
</el-select>
</el-form-item>
<el-form-item v-if="RegistrationVisible" label="类 型:">
<el-select placeholder="活动区域" style="width: 100%">
<el-option label="区域一" value="shanghai" />
<el-option label="区域二" value="beijing" />
<el-form-item v-if="RegistrationVisible" label="买卖类型:">
<el-select placeholder="活动区域" style="width: 100%" v-model="tradingVolume.buySellType">
<el-option label="限价买进" value="buyLimit" />
<el-option label="限价卖出" value="sellLimit" />
<el-option label="止损买进" value="buyStop" />
<el-option label="止损卖出" value="sellStop"/>
</el-select>
</el-form-item>
<el-form-item v-if="value1 !== '挂单开仓'" label="买 卖">
<el-radio-group>
<el-radio label="买入" />
<el-radio label="卖出" />
<el-form-item v-if="tradingVolume.transactionType !== '挂单开仓'" label="买 卖">
<el-radio-group v-model="tradingVolume.buySellType">
<el-radio label="买入" ></el-radio>
<el-radio label="卖出" ></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="交 易 量:">
<el-input />
<el-input v-model="tradingVolume.transactionVolume" />
</el-form-item>
<el-form-item v-if="RegistrationVisible" label="价 位:">
<el-input />
<el-input v-model="tradingVolume.priceCommission" />
</el-form-item>
<div class="dialog-inline" style="display: flex">
<el-form-item label="止 损:">
<el-input />
<el-input placeholder="请输入" v-model="tradingVolume.stopLoss" />
</el-form-item>
<el-form-item label="止 盈:">
<el-input />
<el-input placeholder="请输入" v-model="tradingVolume.stopWin" />
</el-form-item>
</div>
<el-form-item v-if="RegistrationVisible" label="有效期限">
<el-date-picker style="width: 100%;" type="date" placeholder="选择日期" />
<el-date-picker v-model="tradingVolume.validityTime" style="width: 100%;" type="date" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss" />
</el-form-item>
<el-form-item label="可用资金:">
<template>
@ -79,7 +81,7 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="colseDialogVisible = false">确定</el-button>
<el-button type="primary" @click="determine"></el-button>
<el-button type="info" @click="colseDialogVisible = false">取消</el-button>
</span>
</el-dialog>
@ -109,7 +111,7 @@ export default {
nowName: 'tabs1',
colseDialogVisible: false,
RegistrationVisible: false,
memberId: getmemberId(),
value1: '',
varietieslist:[],
datalist:null,
@ -127,7 +129,22 @@ export default {
name: 'tabs3'
}
],
member: []
member: [],
tradingVolume:{
tradingCode:'',
name:'',
transactionType:'',
buySellType:'',
transactionVolume:null,
stopLoss:null,
stopWin:null,
memberId: getmemberId(),
trainingId:this.$route.query.id,
priceCommission:null,
validityTime:null
}
}
},
created(){
@ -150,7 +167,7 @@ export default {
}
},
availableFunds() {
Simulated.getMemberById(this.memberId).then((res)=>{
Simulated.getMemberById(this.tradingVolume.memberId).then((res)=>{
this.member=res
})
},
@ -160,9 +177,19 @@ export default {
})
},
trading(data){
console.log(data,'data');
this.colseDialogVisible=true
this.availableFunds()
this.Price(data.code)
this.tradingVolume.tradingCode=data.code
this.tradingVolume.name=data.currency
},
determine(){
this.tradingVolume.transactionType === '市价开仓' ? this.tradingVolume.transactionType = 'sjkc' : this.tradingVolume.transactionType = 'gdkc'
this.tradingVolume.buySellType == '买入' ? this.tradingVolume.buySellType = 'buy' : this.tradingVolume.buySellType = 'sell'
Simulated.transactionMarketQuotation(this.tradingVolume).then((res)=>{
console.log(res,'res');
})
}
}

@ -31,7 +31,7 @@
<span>{{ item.trainingName }}</span>
<el-tag type="info" >已结束</el-tag>
</div>
<div class="centern">起止时间{{ parseTime(item.startTime ) }}</div>
<div class="centern">起止时间{{ parseTime(item.startTime)}}</div>
<div class="grid-footer">
<el-button type="primary" @click="progress(item.trainingId)"></el-button>
</div>
@ -75,13 +75,15 @@ export default {
this.characterslist = res.data.list
this.total = res.data.total
this.loading = false
}
})
},
progress(id) {
console.log(id,"id");
this.$tab.openPage("进行中", "/student/task/homepageage/" ,{id:id});
this.$tab.openPage("进行中", "/student/task/homepageage?id="+ id);
// this.$router.push({path:'/student/task/homepageage/',{id:id}})
// this.$tab.openPage("", "/student/task/homepageage");
},
},
};
@ -133,7 +135,6 @@ export default {
margin-top: 10px;
border-radius: 4px;
min-height: 160px;
height: 160px;
.title {
display: flex;

Loading…
Cancel
Save