交易完成

main
qinzhenpen 2 years ago
parent c207b2982a
commit 933ed0ffe7

@ -21,3 +21,11 @@ export const getMarketQuotation = () => {
data: code 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() { export function logout() {
return request({ return request({
url: '/logout', url: '/api/sysUser/logout',
method: 'post' method: 'post'
}) })
} }

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

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

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

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

@ -86,7 +86,6 @@ export const constantRoutes = [
redirect: '/404' redirect: '/404'
} }
] ]
// 动态路由,基于用户权限动态去加载 // 动态路由,基于用户权限动态去加载
export const dynamicRoutes = [{ export const dynamicRoutes = [{
path: '/student', path: '/student',
@ -112,7 +111,7 @@ export const dynamicRoutes = [{
path: 'index', path: 'index',
component: () => import('@/views/transactionRecords/index'), component: () => import('@/views/transactionRecords/index'),
name: 'transactionRecords', 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', path: 'homepageage',
component: () => import('@/views/task/index'), component: () => import('@/views/task/index'),
name: 'homepageage', 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', path: 'homepagege',
component: () => import('@/views/PracticeZone/index.vue'), component: () => import('@/views/PracticeZone/index.vue'),
name: 'PracticeZone', 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', path: 'index',
component: () => import('@/views/trade/index.vue'), component: () => import('@/views/trade/index.vue'),
name: 'Index', 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, component: Layout,
redirect: 'ageIssue', redirect: 'ageIssue',
hidden: false, hidden: false,
children: [ children: [
{ {
path: 'teacher', path: 'index',
component: () => import('@/views/index_v1.vue'), component: () => import('@/views/index_v1.vue'),
name: 'teacher', name: 'teacher',
meta: { title: '首页', icon: 'dashboard', affix: true } meta: { title: '首页', icon: 'dashboard', affix: true }
} }
] ]
}, },
]
// 教师端路由
export const teacher = [
{ {
path: '', path: '/teacher',
component: Layout, component: Layout,
redirect: 'ageIssue', redirect: 'ageIssue',
hidden: false, hidden: false,
children: [ children: [
{ {
path: 'teacher', path: 'report',
component: () => import('@/views/index_v1.vue'), component: () => import('@/views/report/index.vue'),
name: 'teacher', name: 'report',
meta: { title: '首页', icon: 'dashboard', affix: true } meta: { title: '首页', icon: 'dashboard', affix: true }
} }
] ]
@ -323,11 +322,15 @@ router.beforeEach((to, from, next) => {
// next(); // next();
console.log('to.fullPath',to.fullPath); console.log('to.fullPath',to.fullPath);
console.log('localStorage.getItem("limitsRoutes")', localStorage.getItem("limitsRoutes")); 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(',') : [] const limitsRoutes = localStorage.getItem("limitsRoutes") ? localStorage.getItem("limitsRoutes").split(',') : []
if (!constantRoutes.filter(item => item.path == to.fullPath).length && to.fullPath !== '/404') { if (!constantRoutes.filter(item => item.path == fullPath).length &&fullPath !== '/404') {
if (limitsRoutes.indexOf(to.fullPath) == -1) { if (limitsRoutes.indexOf(fullPath) == -1) {
console.log('没有权限') console.log('没有权限')
next({ path: "/login" }); next({ path: "/login" });
} else { } else {
@ -343,7 +346,6 @@ const limitsRoutes = localStorage.getItem("limitsRoutes") ? localStorage.getItem
else { else {
next(); next();
} }
}); });
export default router export default router

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

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

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

@ -48,7 +48,7 @@
<el-table-column prop="experiment" label="实验报告成绩" align="center" /> <el-table-column prop="experiment" label="实验报告成绩" align="center" />
<el-table-column prop="totalAssets" label="总成绩" align="center" /> <el-table-column prop="totalAssets" label="总成绩" align="center" />
<el-table-column prop="address" label="操作" align="center" width="300"> <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="warning" @click="report"></el-button>
<el-button size="mini" type="primary" @click="trade"></el-button> <el-button size="mini" type="primary" @click="trade"></el-button>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -65,12 +65,52 @@
width="30%" width="30%"
append-to-body append-to-body
> >
<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"> <span slot="footer" class="dialog-footer">
<el-button <el-button
type="primary" type="primary"
@click="centerDialogVisible = false" @click="centerDialogVisible = false"
> </el-button> > </el-button>
<el-button <el-button
type="info" type="info"
@click="centerDialogVisible = false" @click="centerDialogVisible = false"
@ -81,7 +121,7 @@
</div> </div>
</template> </template>
<script> <script>
import * as home from '@/api/index.js' import * as home from '@/api/teacher/index.js'
export default { export default {
name: 'Index', name: 'Index',
data() { data() {
@ -89,13 +129,11 @@
centerDialogVisible:false, centerDialogVisible:false,
loading:true, loading:true,
queryParams: { queryParams: {
trainingName: null,
classGrade: '',
index: 1, index: 1,
name: '',
size: 10, size: 10,
startTime: null,
studentNumber: ''
}, },
tasklist:null, tasklist:null,
classeslist:null, classeslist:null,
@ -112,9 +150,8 @@
methods: { methods: {
getlist() { getlist() {
this.loading=true this.loading=true
home.findAll(this.queryParams).then((res) => { home.findByConditions(this.queryParams).then((res) => {
if(res.code !== 200) return if(res.code !== 200) return
this.transactionlist=res.data.list this.transactionlist=res.data.list
this.total=res.data.total this.total=res.data.total
// console.log(this.transactionlist,"this.transactionlist"); // console.log(this.transactionlist,"this.transactionlist");
@ -138,7 +175,7 @@
this.$tab.openPage('交易记录', '/student/transactionRecords/index') this.$tab.openPage('交易记录', '/student/transactionRecords/index')
}, },
report() { report() {
this.$tab.openPage('实验报告', '/student/report/index') this.$tab.openPage('实验报告', '/teacher/report')
} }
} }
} }
@ -153,16 +190,45 @@
background: #ffff; background: #ffff;
border-radius: 4px; border-radius: 4px;
padding: 20px; padding: 20px;
.record{
margin-bottom: 20px !important;
font-size: 16px;
font-family: Microsoft YaHei;
font-weight: bold;
color: #1D2129;
} }
img {
cursor: pointer;
} }
.weight{ .weight{
position: absolute; position: absolute;
right: 0; right: 0;
top: 20px; 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> </style>

@ -176,16 +176,7 @@ export default {
path: this.redirect || "/student/index", path: this.redirect || "/student/index",
}); });
} else { } else {
this.$router.push({ path: this.redirect || "/teacher" }); this.$router.push({ path: this.redirect || "/teacher/index" });
}
} else {
localStorage.setItem("limitsRoutes",['/teacher']);
if (getroleId() == 4) {
this.$router.push({
path: this.redirect || "/student/index",
});
} else {
this.$router.push({ path: this.redirect || "/teacher" });
} }
} }
console.log("res111", localStorage.getItem("limitsRoutes")); 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" :label="item.label"
:name="item.name" :name="item.name"
> >
<components <components
:is="item.name" :is="item.name"
:id="id" :id="id"

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

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

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

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

@ -75,13 +75,15 @@ export default {
this.characterslist = res.data.list this.characterslist = res.data.list
this.total = res.data.total this.total = res.data.total
this.loading = false this.loading = false
} }
}) })
}, },
progress(id) { progress(id) {
console.log(id,"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; margin-top: 10px;
border-radius: 4px; border-radius: 4px;
min-height: 160px; min-height: 160px;
height: 160px; height: 160px;
.title { .title {
display: flex; display: flex;

Loading…
Cancel
Save