增加模块

main
qinzhenpen 2 years ago
parent 60bbcca095
commit 6bce75a4d5

Binary file not shown.

@ -6,3 +6,4 @@ export const getMember = (data) => {
data:data
})
}
// 获取memberid

@ -53,4 +53,12 @@ export function getCodeImg() {
method: 'get',
timeout: 20000
})
}
// 获取用户memberid
export const getMemberId = (data) => {
return request({
url: 'api/member/getPracticeMemberIdByStudentNumberAndPracticeTrainingId',
method: 'post',
data:data
})
}

@ -0,0 +1 @@
<svg t="1691129590745" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4374" width="200" height="200"><path d="M512 1024C229.227 1024 0 794.773 0 512S229.227 0 512 0s512 229.227 512 512-229.227 512-512 512z m0-981.333C252.8 42.667 42.667 252.8 42.667 512 42.667 771.2 252.8 981.333 512 981.333c259.2 0 469.333-210.133 469.333-469.333C981.333 252.8 771.2 42.667 512 42.667z m21.333 768h-42.666V640H320v-42.667h170.667V512H320v-42.667h170.667v-55.317l-0.086 0.085-170.005-169.365 30.165-30.165 161.366 160.746 160.085-160.085 29.888 29.91-168.747 168.767v55.424H704V512H533.333v85.333H704V640H533.333v170.667z" fill="" p-id="4375"></path></svg>

After

Width:  |  Height:  |  Size: 686 B

@ -0,0 +1 @@
<svg t="1691129563708" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3302" width="200" height="200"><path d="M531.2 179.2a19.2 19.2 0 0 0-38.4 0v51.2a19.2 19.2 0 0 0 38.4 0V179.2zM390.4 518.528v-0.0768a46.08 46.08 0 0 1 0.2304-4.2752c0.2304-3.1488 0.7168-7.7824 1.6896-13.3888 1.9712-11.264 5.888-26.0608 13.4912-40.6272a100.5312 100.5312 0 0 1 35.0976-38.9376c16.3584-10.4192 39.0656-18.0224 71.0912-18.0224a19.2 19.2 0 0 0 0-38.4c-38.4 0-68.4544 9.216-91.7248 24.0128a138.9056 138.9056 0 0 0-48.4864 53.5296 179.1232 179.1232 0 0 0-17.3056 51.8656 176.9728 176.9728 0 0 0-2.4832 23.6032v0.6656s0 0.0512 19.2 0.0512h-19.2a19.2 19.2 0 0 0 38.4 0.0512v-0.0512z" p-id="3303"></path><path d="M262.4 532.224v242.176H204.8a19.2 19.2 0 0 0 0 38.4h614.4a19.2 19.2 0 0 0 0-38.4h-57.6v-242.176a249.6 249.6 0 1 0-499.2 0z m460.8 0v242.176h-422.4v-242.176a211.2 211.2 0 1 1 422.4 0zM270.9504 227.2256a19.2 19.2 0 0 1 26.624 5.3248l25.6 38.4a19.2 19.2 0 1 1-31.9488 21.2992l-25.6-38.4a19.2 19.2 0 0 1 5.3248-26.624zM758.3744 253.8496a19.2 19.2 0 1 0-31.9488-21.2992l-25.6 38.4a19.2 19.2 0 1 0 31.9488 21.2992l25.6-38.4z" p-id="3304"></path></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -0,0 +1 @@
<svg t="1691129712313" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6026" width="200" height="200"><path d="M418.441232 1022.574927a27.363528 27.363528 0 0 1-26.108612-35.637459l55.301338-175.028737a27.363528 27.363528 0 0 1 45.453447-11.081537l115.920114 115.973288a27.374163 27.374163 0 0 1-10.432811 45.240749l-171.221452 59.044814a27.448607 27.448607 0 0 1-8.912024 1.488882zM486.238547 871.410845l-25.332267 80.186941 78.464091-27.044482z" p-id="6027"></path><path d="M589.69459 963.540748a27.427337 27.427337 0 0 1-19.355469-8.018694L454.355198 839.527496a27.352893 27.352893 0 0 1 0-38.710937l293.10773-293.118365a27.384798 27.384798 0 0 1 38.721572 0L902.168423 623.692752a27.374163 27.374163 0 0 1 0 38.710937L609.007519 955.522054a27.384798 27.384798 0 0 1-19.312929 8.018694z m-77.272986-143.368721l77.272986 77.272986L844.102017 643.04822l-77.28362-77.251716z" p-id="6028"></path><path d="M882.812954 670.422383a27.363528 27.363528 0 0 1-19.355468-8.018694L747.462928 546.409131a27.374163 27.374163 0 0 1 0-38.710937l59.767985-59.767985a84.132479 84.132479 0 0 1 118.834069 0l35.871426 35.860791a84.015495 84.015495 0 0 1 0 118.834069l-59.767985 59.767985a27.363528 27.363528 0 0 1-19.355469 8.029329z m-77.272986-143.368721l77.272986 77.272986 40.412517-40.412516a29.26717 29.26717 0 0 0 0-41.412195l-35.860791-35.860791a29.30971 29.30971 0 0 0-41.412195 0zM756.470665 1023.989365h-91.268478a27.374163 27.374163 0 0 1 0-54.748325h91.268478c53.599759 0 97.202738-44.666466 97.202738-99.616854v-96.447662a27.374163 27.374163 0 0 1 54.748325 0v96.405123c0 85.164062-68.169535 154.407719-151.951063 154.407718z" p-id="6029"></path><path d="M254.536572 1023.989365h-65.138596C105.616448 1023.989365 37.446913 954.745708 37.446913 869.624186v-478.569277a27.480511 27.480511 0 0 1 1.882373-9.996781L173.158525 39.816964A62.065118 62.065118 0 0 1 231.161122 0.02127H756.470665c83.781528 0 151.951063 69.243657 151.951063 154.354544v168.46702a27.374163 27.374163 0 0 1-54.748325 0V154.354544c0-54.918483-43.602979-99.606219-97.202738-99.606219H231.161122a7.657108 7.657108 0 0 0-7.029651 5.0622l-131.978772 336.381027v473.432634c0 54.929118 43.602979 99.616854 97.202738 99.616854h65.138596a27.374163 27.374163 0 0 1 0 54.748325z" p-id="6030"></path><path d="M724.28954 367.98787H265.809538a27.374163 27.374163 0 0 1 0-54.748326h458.480002a27.374163 27.374163 0 0 1 0 54.748326zM654.801281 487.577015H265.809538a27.374163 27.374163 0 0 1 0-54.748326H654.801281a27.374163 27.374163 0 1 1 0 54.748326zM550.590162 607.12362H265.809538a27.384798 27.384798 0 0 1 0-54.75896h284.780624a27.384798 27.384798 0 0 1 0 54.75896zM437.679717 726.659591H265.809538a27.374163 27.374163 0 1 1 0-54.748326h171.870179a27.374163 27.374163 0 1 1 0 54.748326zM251.239762 44.485673l124.045156 105.710636a18.759916 18.759916 0 0 1-0.989043 29.352249L89.781123 390.576339l131.808613-338.61435a18.759916 18.759916 0 0 1 29.650026-7.476316z" p-id="6031"></path></svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

@ -1 +1 @@
<svg t="1688354284616" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8003" width="200" height="200"><path d="M876.3 848.9h-19V363.5c0-21.6-17.3-39.1-38.6-39.1H689.9c-21.3 0-38.6 17.5-38.6 39.1v485.4H614V178c0-22.5-17.3-40.7-38.7-40.7H446.2c-21.4 0-38.7 18.2-38.7 40.7v670.9h-37.2V551.3c0-21.9-17.3-39.7-38.6-39.7H202.9c-21.3 0-38.6 17.8-38.6 39.7v297.6h-19.2c-10.3 0-18.7 8.4-18.7 18.7s8.4 18.7 18.7 18.7h731.2c10.4 0 18.7-8.4 18.7-18.7s-8.3-18.7-18.7-18.7zM688.8 363.5c0-1.1 0.7-1.6 1.2-1.6h128.6c0.5 0 1.2 0.6 1.2 1.6v485.4h-131V363.5zM445 178c0-2.2 1.2-3.2 1.3-3.2h128.9c0.3 0.2 1.3 1.2 1.3 3.2v670.9H445V178zM201.8 551.3c0-1.5 0.9-2.2 1.2-2.2h128.6c0.2 0 1.2 0.7 1.2 2.2v297.6h-131V551.3z" p-id="8004"></path></svg>
<svg t="1691129324956" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="18073" width="200" height="200"><path d="M876.3 848.9h-19V363.5c0-21.6-17.3-39.1-38.6-39.1H689.9c-21.3 0-38.6 17.5-38.6 39.1v485.4H614V178c0-22.5-17.3-40.7-38.7-40.7H446.2c-21.4 0-38.7 18.2-38.7 40.7v670.9h-37.2V551.3c0-21.9-17.3-39.7-38.6-39.7H202.9c-21.3 0-38.6 17.8-38.6 39.7v297.6h-19.2c-10.3 0-18.7 8.4-18.7 18.7s8.4 18.7 18.7 18.7h731.2c10.4 0 18.7-8.4 18.7-18.7s-8.3-18.7-18.7-18.7zM688.8 363.5c0-1.1 0.7-1.6 1.2-1.6h128.6c0.5 0 1.2 0.6 1.2 1.6v485.4h-131V363.5zM445 178c0-2.2 1.2-3.2 1.3-3.2h128.9c0.3 0.2 1.3 1.2 1.3 3.2v670.9H445V178zM201.8 551.3c0-1.5 0.9-2.2 1.2-2.2h128.6c0.2 0 1.2 0.7 1.2 2.2v297.6h-131V551.3z" p-id="18074"></path></svg>

Before

Width:  |  Height:  |  Size: 765 B

After

Width:  |  Height:  |  Size: 767 B

@ -1 +1 @@
<svg t="1688354357249" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8715" data-spm-anchor-id="a313x.7781069.0.i17" width="200" height="200"><path d="M446.275089 956.340017c-3.76679 0-7.633864-0.199545-11.533684-0.649799l-273.066189-30.800493c-55.399751-6.250354-98.800213-54.667064-98.800213-110.199845l0-685.533288c0-57.300031 47.89994-101.43318 106.732883-94.132914l273.066189 33.099862c54.999638 6.650467 98.066503 55.150064 98.066503 110.400413l0 682.667008C540.741601 914.540006 499.241418 956.340017 446.275089 956.340017zM157.208485 102.540398c-15.366989 0-26.066679 10.933003-26.066679 26.616194l0 685.533288c0 20.632923 17.499559 40.033785 38.20002 42.366923l273.066189 30.800493c17.10047 1.833765 30.066783-9.533121 30.066783-26.666336L472.474798 178.523953c0-20.61655-17.400299-40.133046-38.000476-42.632983L161.408133 102.791108C159.974481 102.623285 158.574598 102.540398 157.208485 102.540398z" fill="#ffffff" p-id="8716" data-spm-anchor-id="a313x.7781069.0.i18" class="selected"></path><path d="M616.474446 956.140473c-17.133216 0-31.933293-12.867052-33.900088-30.300097-2.099824-18.733667 11.366885-35.633568 30.099529-37.749766l273.066189-30.816866c20.700461-2.333138 38.20002-21.732977 38.20002-42.366923l0-685.533288c0-8.316409-3.000334-15.550161-8.400321-20.35049-5.566786-4.916986-13.267165-7.033184-21.86703-6.01704l-273.066189 33.099862c-18.699897 2.366907-35.732829-11.067057-38.000476-29.783327-2.266623-18.699897 11.067057-35.716456 29.7997-37.983079l273.066189-33.099862c27.566846-3.499707 55.232952 4.883217 75.333756 22.683628 20.233833 17.949814 31.400151 43.316551 31.400151 71.450309l0 685.533288c0 55.533804-43.400462 103.950514-98.800213 110.199845L620.339474 955.923532C619.041922 956.073958 617.741299 956.140473 616.474446 956.140473z" fill="#ffffff" p-id="8717" data-spm-anchor-id="a313x.7781069.0.i16" class="selected"></path></svg>
<svg t="1691129466215" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1682" width="200" height="200"><path d="M913.92 275.968l-375.296-206.848c-15.36-8.192-33.792-8.704-49.152 0l-379.392 206.848c-18.432 10.24-29.696 30.208-29.696 51.2-0.512 20.992 10.24 40.448 28.16 51.712l375.296 221.696c15.872 9.728 35.84 9.728 52.224 0l379.392-221.696c17.92-10.752 28.672-30.72 28.16-51.712-0.512-21.504-11.776-41.472-29.696-51.2z m-403.968 269.824l-368.64-217.6 372.736-203.264 368.64 202.752-372.736 218.112z" p-id="1683"></path><path d="M902.656 510.464l-77.312-43.52-55.808 36.864 62.976 35.328-322.56 194.56-318.464-194.048 67.072-37.376-55.808-37.376-81.408 45.056c-9.728 5.632-15.872 16.384-15.872 27.648-0.512 11.264 5.12 22.016 14.848 28.672l375.296 225.28c4.096 2.56 9.216 4.096 14.336 4.096 5.12 0 9.728-1.536 13.824-4.096l379.392-225.28c9.728-6.144 15.36-16.896 14.848-28.16 0.512-11.264-5.632-22.016-15.36-27.648z" p-id="1684"></path><path d="M902.656 670.72l-75.264-41.472-12.288 38.912 19.456 30.72-324.608 199.168-320.512-198.656 22.528-30.208-11.776-39.424-78.848 40.448c-9.728 6.144-15.872 16.896-15.872 28.16 0 11.776 5.632 23.04 14.848 28.672l375.296 229.376c4.608 2.56 9.216 4.096 14.336 4.096 5.12 0 9.728-1.536 13.824-4.096l379.392-229.376c9.728-6.144 15.36-17.408 14.848-28.672 0.512-10.752-5.12-21.504-15.36-27.648z" p-id="1685"></path></svg>

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 12 KiB

@ -137,7 +137,7 @@
colseDialogVisible:false,
tableData:null,
takeStash:{
trainingId:this.$route.query.id,
trainingId: this.$route.query.id || '',
memberId:null,
status:0
},
@ -206,10 +206,9 @@
clearInterval(this.timer)
return
}
this.timer= setTimeout(() => {
this.timer= setInterval(() => {
this.price(this.tableData)
}, 16000);
}, 5000);
})
},
price(data){

@ -52,7 +52,9 @@
</template>
</el-table-column>
</el-table>
<pagination :total="total"
<pagination
v-show="total > 0"
:total="total"
:page.sync="forth.index"
:limit.sync="forth.size"
@pagination="getlist"
@ -73,7 +75,7 @@
size: 10,
},
takeStash:{
trainingId:this.$route.query.id,
trainingId:this.$route.query.id || '',
memberId:this.$store.state.user.memberId,
status:2,

@ -1,6 +1,6 @@
<template>
<div class="navbar">
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
<!-- <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> -->
<!-- <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/> -->
<top-nav v-if="topNav" id="topmenu-container" class="topmenu-container" />
@ -92,9 +92,9 @@ export default {
}
},
methods: {
toggleSideBar() {
this.$store.dispatch('app/toggleSideBar')
},
// toggleSideBar() {
// this.$store.dispatch('app/toggleSideBar')
// },
async logout() {
this.$confirm('确定注销并退出系统吗?', '提示', {
confirmButtonText: '确定',

@ -63,21 +63,27 @@ export default {
if (!children) {
children = []
}
const showingChildren = children.filter(item => {
if (item.hidden) {
return false
} else {
// Temp set(will be used if only has one showing child)
this.onlyOneChild = item
return true
}
})
// When there is only one child router, the child router is displayed by default
if (showingChildren.length === 1) {
if (showingChildren.length == 1) {
console.log(this.item,"onlyOneChild");
return true
}
// Show parent if there are no child router to display
if (showingChildren.length === 0) {
this.onlyOneChild = { ... parent, path: '', noShowingChildren: true }
return true
}

@ -68,7 +68,8 @@ export default {
return variables;
},
isCollapse() {
return !this.sidebar.opened;
// return !this.sidebar.opened;
return false
},
},
data() {

@ -45,8 +45,8 @@ export default {
classObj() {
console.log(this.sidebar,"sidebar");
return {
hideSidebar: !this.sidebar.opened,
openSidebar: this.sidebar.opened,
// hideSidebar: !this.sidebar.opened,
// openSidebar: this.sidebar.opened,
withoutAnimation: this.sidebar.withoutAnimation,
mobile: this.device === 'mobile'
}

@ -3,12 +3,14 @@ import store from './store'
import { Message } from 'element-ui'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import { getToken, getroleId } from '@/utils/auth'
import { getToken, getroleId ,getusername,removememberId,getmemberId} from '@/utils/auth'
import { getRouters } from '@/api/menu'
import { isRelogin } from '@/utils/request'
import { addRoutes } from '@/router'
NProgress.configure({ showSpinner: false })
const whiteList = ['/login', '/register']
// 不发送请求白名单
const whiteList1 = ['/student/training/List', '/student/index']
var datas = []
router.beforeEach((to, from, next) => {
@ -25,9 +27,25 @@ router.beforeEach((to, from, next) => {
// // router.push({ path: '/teacher' })
// // } else if (getroleId() === 3) {
// router.push({ path: '/student/index' })
// console.log(to.path, "to.path");
// // }
// }
next()
if( getroleId ()== 4){
if(to.path =="/student/training/List" || to.path == '/student/index'){
removememberId()
next()
}else{
if(to.path =="/student/training/homepageage" || to.path == '/student/transactionRecords'|| to.path =='/student/training/index' || to.path=='/student/training/homepageage'){
return next()
}else{
store.dispatch('GetMemberId',getusername()).then(res=>{
} )
}
}
next()
}
// to.meta.title && store.dispatch('settings/setTitle', "外汇模拟交易")
/* has token*/
// if (to.path === '/login') {

@ -99,26 +99,33 @@ export const dynamicRoutes = [{
children: [
{
path: 'index',
name: 'index',
component: () => import('@/views/index'),
name: 'Index',
meta: { title: '首页', icon: 'dashboard', affix: true }
}
]
},
{
path: '/student/transactionRecords',
component: Layout,
hidden: true,
permissions: ['system:user:edit'],
children: [
meta: {
title: '首页', affix: true, title: '首页',
icon: 'dashboard'
},
},
{
path: 'index',
path: 'homepagege',
name: 'homepagege',
hidden: true,
component: () => import('@/views/PracticeZone/index.vue'),
meta: { title: '练习专区', affix: true,activeMenu: '/student/index' }
},
{
path: 'transactionRecords',
component: () => import('@/views/transactionRecords/index'),
name: 'transactionRecords',
hidden: true,
meta: { title: '交易记录', icon: 'null', affix: true, activeMenu: '/student/index' }
}
},
// 练习专区
]
},
{
path: '/student/training',
component: Layout,
@ -130,62 +137,98 @@ export const dynamicRoutes = [{
component: () => import('@/views/training/index'),
name: 'training',
meta: { title: '实训任务', icon: 'quest', affix: true }
}
]
},
{
path: '/student/task',
component: Layout,
hidden: true,
permissions: ['system:user:edit'],
children: [
},
{
path: 'homepageage',
hidden: true,
component: () => import('@/views/task/index'),
name: 'homepageage',
meta: { title: '任务主页', affix: true, activeMenu: '/student/training/List' }
},
{
path: 'index',
component: () => import('@/views/trade/index.vue'),
name: 'Index',
hidden: true,
meta: { title: '练习专区', affix: true, activeMenu: '/student/training/List' }
}
]
},
// {
// path: '/student/task',
// component: Layout,
// hidden: true,
// permissions: ['system:user:edit'],
// children: [
// {
// path: 'homepageage',
// component: () => import('@/views/task/index'),
// name: 'homepageage',
// meta: { title: '任务主页', affix: true, activeMenu: '/student/training/List' }
// }
// ]
// },
{
path: '/student/PracticeZone',
component: Layout,
hidden: true,
hidden: false,
permissions: ['system:user:edit'],
children: [
{
path: 'homepagege',
component: () => import('@/views/PracticeZone/index.vue'),
name: 'PracticeZone',
meta: { title: '练习专区', affix: true, activeMenu: '/student/training/List' }
meta: { title: '练习专区', affix: true, icon: 'exercise' }
},
{
path: 'index',
component: () => import('@/views/trade/index.vue'),
name: 'Index',
hidden: true,
meta: { title: '练习专区', affix: true, activeMenu: '/student/PracticeZone/homepagege' }
}
]
},
// {
// path: '/student/trade',
// component: Layout,
// hidden: true,
// permissions: ['system:user:edit'],
// children: [
// {
// path: 'index',
// component: () => import('@/views/trade/index.vue'),
// name: 'Index',
// meta: { title: '练习专区', affix: true, activeMenu: '/student/training/List' }
// }
// ]
// },
{
path: '/student/trade',
path: '/student/transactionRecords',
component: Layout,
hidden: true,
hidden: false,
permissions: ['system:user:edit'],
children: [
{
path: 'index',
component: () => import('@/views/trade/index.vue'),
name: 'Index',
meta: { title: '练习专区', affix: true, activeMenu: '/student/training/List' }
component: () => import('@/views/transactionRecords/index'),
name: 'transactionRecords',
meta: { title: '交易记录', icon: 'deal', affix: true, }
}
]
},
// 系统预警
{
path: '/student/teachingPlan',
path: '/student/systemWarning',
component: Layout,
hidden: false,
permissions: ['system:user:edit'],
children: [
{
path: 'case',
component: () => import('@/views/teachingpan/index.vue'),
name: 'teachingPlan',
meta: { title: '实训教案', icon: 'teachingplan', affix: true }
path: 'index',
component: () => import('@/views/systemWarning/index'),
name: 'systemWarning',
meta: { title: '系统预警', icon: 'early', affix: true }
}
]
},
@ -203,6 +246,21 @@ export const dynamicRoutes = [{
}
]
},
{
path: '/student/teachingPlan',
component: Layout,
hidden: false,
permissions: ['system:user:edit'],
children: [
{
path: 'case',
component: () => import('@/views/teachingpan/index.vue'),
name: 'teachingPlan',
meta: { title: '实训教案', icon: 'teachingplan', affix: true }
}
]
},
{
path: '/system/user-auth',
component: Layout,
@ -277,7 +335,7 @@ export const dynamicRoutes = [{
]
// 教师端路由
export const teacher = [
{
{
path: '/teacher',
component: Layout,
redirect: 'ageIssue',
@ -329,7 +387,7 @@ export const teacher = [
path: 'testreport',
component: () => import('@/views/task/report.vue'),
name: 'testreport',
meta: { icon: 'teachingplan', affix: true ,activeMenu: '/teacher/index'}
meta: { icon: 'teachingplan', affix: true, activeMenu: '/teacher/index' }
}
]
},

@ -1,4 +1,4 @@
import { login, logout, getInfo } from '@/api/login'
import { login, logout, getInfo,getMemberId } from '@/api/login'
import * as cookie from '@/utils/auth'
const user = {
@ -8,6 +8,7 @@ const user = {
schoolId: cookie.getschoolId(),
classid: '',
memberId: cookie.getmemberId() ,
username: cookie.getusername(),
trainingId: '',
roles: [],
permissions: []
@ -37,6 +38,9 @@ const user = {
},
SET_TRAININGID: (state, trainingId) => {
state.trainingId = trainingId
},
SET_USERNAME: (state, username) => {
state.username = username
}
},
actions: {
@ -51,11 +55,13 @@ const user = {
cookie.setname(res.data.name)
cookie.setschoolId(res.data.schoolId)
cookie.setroleId(res.data.roleId)
cookie.setusername(res.data.username)
const avatar = (user.avatar == '' || user.avatar == null) ? require('@/assets/images/profile.jpg') : process.env.VUE_APP_BASE_API + user.avatar
commit('SET_TOKEN', res.data.accessToken)
commit('SET_NAME', res.data.name)
commit('SET_AVATAR', res.data.classId)
commit('SET_SCHOOLID', res.data.schoolId)
commit('SET_USERNAME', res.data.username)
resolve()
}).catch(error => {
@ -80,6 +86,21 @@ const user = {
})
})
},
// 获取memberId
GetMemberId({ commit}, state ) {
// debugger
const studentNumber=state
return new Promise((resolve, reject) => {
getMemberId(studentNumber).then(res => {
// const user = res.user
commit('SET_MEMBERID', res.data)
resolve(res)
}).catch(error => {
reject(error)
})
})
},
// 退出系统
LogOut({ commit, state }) {
return new Promise((resolve, reject) => {
@ -97,6 +118,8 @@ const user = {
cookie.removememberId()
// 删除roleId
cookie.removeroleId()
// 删除username
cookie.removeusername()
resolve()
}).catch(error => {
reject(error)

@ -4,6 +4,7 @@ const username = 'NAME'
const schoolId = 'SCHOOLID'
const memberId = 'MEMBERID'
const roleId='ROLEID'
const username1 = 'USERNAME'
export function getToken() {
return Cookies.get(TokenKey)
}
@ -53,3 +54,13 @@ export function setroleId(id) {
export function removeroleId() {
return Cookies.remove(roleId)
}
export function getusername() {
return Cookies.get(username1)
}
export function setusername(name) {
return Cookies.set(username1, name)
}
// 删除username
export function removeusername() {
return Cookies.remove(username1)
}

@ -393,7 +393,7 @@ export function isNumberStr(str) {
export function useWebSocket(url) {
let ws = null;
let reconnectInterval = 5000; // 重连间隔时间,单位:毫秒
let maxReconnectAttempts = 10; // 最大重连尝试次数
let maxReconnectAttempts = 20; // 最大重连尝试次数
let reconnectAttempts = 0; // 当前重连尝试次数
function createWebSocket() {

@ -14,8 +14,8 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
// 创建axios实例
const service = axios.create({
// axios中请求配置有baseURL选项表示请求URL公共部分
// baseURL: 'http://118.31.7.2:8801',
baseURL: 'http://192.168.2.14:8800',
baseURL: 'http://118.31.7.2:8801',
// baseURL: 'http://192.168.2.14:8801',
// baseURL:"http://192.168.2.17:8801",
// baseURL: process.env.VUE_APP_BASE_API,
// 超时
@ -54,7 +54,7 @@ service.interceptors.request.use(config => {
const interval = 1000 // 间隔时间(ms),小于此时间视为重复提交
if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) {
const message = '数据正在处理,请勿重复提交'
Message({ message:message, type: 'error' })
// Message({ message:message, type: 'error' })
return Promise.reject(new Error(message))
} else {
cache.session.setJSON('sessionObj', requestObj)

@ -57,7 +57,7 @@ export default {
: (this.nowName = tab.name)
},
progress() {
this.$tab.openPage('进行中', `/student/trade/index?id=${999999999}`)
this.$tab.openPage('进行中', `/student/PracticeZone/index?id=${999999999}`)
}
}
}

@ -182,6 +182,10 @@ export default {
}
)
},
//
clear(){
this.studentlist = []
},
//
// trade(row){
// if(this.practicalid == '') return

@ -272,7 +272,10 @@
message: "添加成功!",
});
this.getlist()
this.$refs.child.clear();
this.centerDialogVisible = false
this.$refs.ruleForm.resetFields()
}
})
})

@ -100,7 +100,7 @@ export default {
classGrade: '',
index: 1,
name: '',
size: 10,
size: 15,
startTime: null,
studentNumber: ''
},
@ -146,13 +146,13 @@ export default {
trade(data) {
this.$store.commit('SET_MEMBERID', data.memberId)
setmemberId(data.memberId)
this.$tab.openPage('交易记录', `/student/transactionRecords/index?id=${data.trainingId}`)
this.$tab.openPage('交易记录', `/student/transactionRecords?id=${data.trainingId}`)
},
lianxi() {
this.$tab.openPage('实训任务', '/student/training/List')
},
skip() {
this.$tab.openPage('练习专区', `/student/PracticeZone/homepagege?id=${'999999999'}`)
this.$tab.openPage('练习专区', `/student/homepagege?id=${'999999999'}`)
},
chooseTraining(){
this.tasklist.forEach((item)=>{
@ -179,4 +179,9 @@ export default {
img {
cursor: pointer;
}
::v-deep .el-table .el-table__cell {
// background: #f5f5f5;
padding: 6px 0;
}
</style>

@ -116,6 +116,12 @@ export default {
},
},
created() {
if(this.$route.query.token){
// this.register = true
this.loginForm.password = this.$route.query.token
return this.handleLogin()
}
Cookies.remove("Admin-Token");
localStorage.removeItem("limitsRoutes");
// this.getCode();
@ -134,7 +140,6 @@ export default {
getCookie() {
const username = Cookies.get("username");
const password = Cookies.get("password");
this.loginForm = {
username: username === undefined ? this.loginForm.username : username,
password:
@ -167,9 +172,6 @@ export default {
this.$store
.dispatch("Login", loginForm)
.then(() => {
console.log("loginForm", loginForm);
// this.getRouterList();
getRouters().then((res) => {
if (res.data?.length) {
@ -178,7 +180,6 @@ export default {
this.$router.push({
path: this.redirect || "/student/index",
});
this.createsocket()
} else {
this.$router.push({ path: this.redirect || "/teacher/index" });
@ -198,7 +199,7 @@ export default {
});
},
createsocket() {
useWebSocket('ws://192.168.2.14:8800/webSocket/' + getname())
useWebSocket('ws://118.31.7.2:8801/webSocket/' + getname())
},
},
};

@ -1,43 +1,30 @@
<template>
<div class="quotation-container">
<div class="quotation-holding">
<holding></holding>
</div>
<el-row>
<el-col :span="24">
<div class="grid-content">
<img src="../../assets/images/sina.png" style="height: 110px;" alt="">
<div class="center"> <span>新浪财经</span></div>
<div class="right"> <el-button type="primary" @click="oepnWindow(1)"> >></el-button>
</div>
</div>
</el-col>
<el-col :span="24">
<div class="grid-content">
<img src="../../assets/images/dongfang.png" style="height: 110px;" alt="">
<div class="center"> <span>东方财富</span></div>
<div class="right"> <el-button type="primary" @click="oepnWindow(2)"> >></el-button>
</div>
</div>
</el-col>
<el-col :span="24">
<div class="grid-content">
<img src="../../assets/images/csrc.png" style="height: 110px;" alt="">
<div class="center"> <span>中国证监会</span></div>
<div class="right"> <el-button type="primary" @click="oepnWindow(3)"> >></el-button>
</div>
</div>
</el-col>
<el-col :span="24">
<div class="grid-content">
<img src="../../assets/images/u2008.png" style="height: 110px;" alt="">
<div class="center"> <span>外汇模拟交易</span></div>
<div class="right"> <el-button type="primary" @click="oepnWindow(4)"> >></el-button>
</div>
<img src="../../assets/images/sina.png" style="height: 110px;" alt="" @click="oepnWindow(1)">
<img src="../../assets/images/dongfang.png" style="height: 110px;" alt="" @click="oepnWindow(2)">
<img src="../../assets/images/csrc.png" style="height: 110px;" alt="" @click="oepnWindow(3)">
<img src="../../assets/images/u2008.png" style="height: 110px;" alt="" @click="oepnWindow(4)">
</div>
</el-col>
</el-row>
</div>
</template>
<script>
// import holding from '@views/trade/holding.vue'
// views/trade/holding.vue
import holding from '../trade/holding.vue'
export default {
components: {
holding
},
name: '',
data() {
return {
@ -65,14 +52,17 @@ export default {
}
</script>
<style lang='scss' scoped>
.quotation-holding{
padding: 20px;
background: #ffff;
}
.grid-content {
border-radius: 4px;
margin-bottom: 30px;
background:url("../../assets/images/微信图片_20230703135000.png") no-repeat;
background: #ffff;
background-size: cover;
min-height: 170px;
padding: 30px 30px;
padding: 30px 20px;
width: 100%;
display: flex;
justify-content: space-between;

@ -0,0 +1,32 @@
<template>
<div class="app-Warning">
<strke></strke>
</div>
</template>
<script>
import strke from "../trade/strike.vue"
export default{
components:{
strke
},
name:'',
data () {
return {
}
},
created () {
},
computed:{
},
methods:{
}
}
</script>
<style lang='scss' scoped>
.app-Warning{
padding: 20px;
background: #ffff;
border-radius: 4px;
}
</style>

@ -4,8 +4,8 @@
<el-button :disabled="status == 'FINISHED' || status == 'NOT_STARTED'" size="medium" @click="carryout"></el-button>
</div>
<div class="overview-title-right" v-show="activeName !== 'tabs1'">
<el-button type="primary" @click="hsbmit()" > </el-button>
<el-button type="warning" onclick="upload.click()"> </el-button>
<el-button type="primary" @click="hsbmit()" :disabled="status == 'FINISHED' || status == 'NOT_STARTED'"> </el-button>
<el-button type="warning" onclick="upload.click()" :disabled="status == 'FINISHED' || status == 'NOT_STARTED'"> </el-button>
<input type="file" ref="fileInput" @change="getFilePDF" name="upload" id="upload" style="display: none;" accept=" .pdf" />
</div>
<el-tabs
@ -74,7 +74,7 @@ export default {
: (this.nowName = tab.name);
},
carryout(){
this.$tab.openPage("进行中", `/student/trade/index?id=${this.id}`);
this.$tab.openPage("进行中", `/student/training/index?id=${this.id}`);
},
//
hsbmit(){

@ -51,7 +51,7 @@
import tabs1 from "@/components/current/index.vue";
import tabs2 from "@/components/deals/index.vue";
import * as homepage from "@/api/homepage.js";
import { getname,getschoolId,setmemberId } from "@/utils/auth.js";
import { getusername,getschoolId,setmemberId } from "@/utils/auth.js";
export default {
name: "",
@ -73,9 +73,9 @@ export default {
name: "tabs2",
},
],
name:getname(),
name:getusername(),
schoolId: getschoolId(),
id:this.$route.query.id,
id:this.$route.query.id || '',
datalist:[],
member:'',
time:null,
@ -98,7 +98,7 @@ export default {
},
methods: {
getlist() {
homepage.getMember({name:this.name,schoolId:this.schoolId,trainingId:this.id,trainingStatus:this.localStorageValue}).then((res) => {
homepage.getMember({studentNumber:this.name,schoolId:this.schoolId,trainingId:this.id,trainingStatus:this.localStorageValue}).then((res) => {
this.datalist = res.data;
this.$store.commit("SET_MEMBERID", res.data.memberId);
setmemberId(res.data.memberId)

@ -13,7 +13,7 @@
<span v-show="reportName == null || reportName == ''">PdF</span>
</div>
<div class="right-btn">
<el-button type="primary" @click="submitScore"></el-button>
<el-button type="primary" @click="submitScore" >提交评分</el-button>
<el-button class="el-back" icon="el-icon-arrow-left" @click="back"></el-button>
</div>
</div>
@ -114,7 +114,7 @@ export default {
id:null
},
reportName: "",
// status:localStorage.getItem("status")
};
},
created() {
@ -136,11 +136,11 @@ export default {
this.$refs.reportref.validate((valid) => {
if (!valid) return;
// this.reportdata
for (let key in this.reportdata) {
if (this.reportdata[key] !== "") {
return this.$modal.msgError("已提交过实验报告,请勿重复提交")
}
}
// for (let key in this.reportdata) {
// if (this.reportdata[key] !== "") {
// return this.$modal.msgError(",")
// }
// }
testreport.getExperiment(this.reportdata).then((res) => {
if (res.code !== 200) return
this.isaddvalidate = true

@ -8,7 +8,7 @@
<el-table-column
prop="account"
label="账号"
width="100"
width="200"
align="center"
/>
<el-table-column prop="name" label="姓名" width="140" align="center" />
@ -89,7 +89,7 @@ export default {
//
//
queryParams:{
trainingId:this.$route.query.id,
trainingId:this.$route.query.id || '',
userName:getname(),
index:1,
size:5

@ -92,7 +92,7 @@ export default {
socket : null,
// parsma
holdTimeParams:{
trainingId:this.$route.query.id,
trainingId:this.$route.query.id || '',
memberId:this.$store.state.user.memberId,
index:1,
size:5

@ -92,7 +92,7 @@ export default {
// params
marketParams: {
memberId: this.$store.state.user.memberId,
trainingId: this.$route.query.id,
trainingId: this.$route.query.id || '',
index: 1,
size: 5
},

@ -3,10 +3,30 @@
<el-table :data="datalist" style="width: 100%" v-loading="loading">
<el-table-column prop="code" label="交易品种" width="100" align="center"/>
<el-table-column prop="currency" label="名称" align="center" />
<el-table-column label="卖价" align="center" prop="sellPic"/>
<el-table-column label="买价" align="center" prop="buyPic" />
<el-table-column prop="diffAmo" label="涨跌金额" align="center" />
<el-table-column prop="diffPer" label="涨跌率" align="center" />
<el-table-column label="卖价" align="center" prop="sellPic">
<template slot-scope="scope">
<span v-if="scope.row.sellPic > scope.row.openPri" style="color:red">{{scope.row.sellPic}}</span>
<span v-else-if="scope.row.sellPic < scope.row.openPri" style="color:green">{{scope.row.sellPic}}</span>
<span v-else :style="{color:scope.row.sellPic == scope.row.openPri ? '#333333' : '#2CB7B0'}">{{scope.row.sellPic}}</span>
</template>
</el-table-column>
<el-table-column label="买价" align="center" prop="buyPic" >
<template slot-scope="scope">
<span v-if="scope.row.buyPic > scope.row.openPri" style="color: red;">{{scope.row.buyPic}}</span>
<span v-else-if="scope.row.buyPic < scope.row.openPri" style="color: green;">{{scope.row.buyPic}}</span>
<span v-else style="color:#333333">{{scope.row.buyPic}}</span>
</template>
</el-table-column>
<el-table-column prop="diffAmo" label="涨跌金额" align="center" >
<template slot-scope="scope">
<span v-if="scope.row.diffAmo > 0" style="color: red;">{{scope.row.diffAmo}}</span>
<span v-else-if="scope.row.diffAmo < 0" style="color:green">{{scope.row.diffAmo}}</span>
<span v-else style="color: #33333">{{scope.row.diffAmo}}</span>
</template>
</el-table-column>
<el-table-column prop="diffPer" label="涨跌率" align="center" >
</el-table-column>
<el-table-column prop="ranges" label="振幅" align="center" />
<el-table-column label="操作" align="center">
<template slot-scope="scope">
@ -14,8 +34,8 @@
</template>
</el-table-column>
</el-table>
<pagination :total="10" />
<el-tabs v-model="activeName" class="tabs" @tab-click="handleClick">
<!-- <pagination :total="10" /> -->
<el-tabs v-model="activeName" class="tabs" @tab-click="handleClick" v-if="tabsVisible">
<el-tab-pane
v-for="(item, index) in tabsArr"
:key="index"
@ -143,8 +163,9 @@ export default {
trainingId:this.$route.query.id,
priceCommission:null,
validityTime:null,
},
// tsbs
tabsVisible: false,
ruleForm: {
transactionVolume: [
{ required: true, message: '请输入交易量', trigger: 'blur' },
@ -174,6 +195,11 @@ export default {
},
created(){
this.getlist()
///student/quotation/lowcore,
if(this.$route.path !== '/student/quotation/lowcore'){
// this.getVarieties()
this.tabsVisible = true
}
//
// window.addEventListener('storage', (e) => {
// if (e.key === 'Type') {
@ -191,9 +217,18 @@ export default {
}
//datalist,使gitlist datalist
this.localStorageValue=localStorage.getItem('status')
this.timer=setInterval(()=>{
//
let path = this.$route.path
if(path == '/student/quotation/lowcore' || path == '/student/quotation/lowcore' || path == '/student/PracticeZone/index' || path == '/student/training/index'){
this.timer=setInterval(()=>{
this.getlist()
},16000)
},5000)
}else{
this.timer=setInterval(()=>{
this.getlist()
},16000)
}
},
methods: {
getlist(){

@ -179,13 +179,13 @@ export default {
//
deposit: {
memberId:this.$store.state.user.memberId,
trainingId:this.$route.query.id,
trainingId:this.$route.query.id || '',
userName:this.$store.state.user.name,
warningLevel: '',
},
//
market: {
tariningid:this.$route.query.id,
tariningid:this.$route.query.id || '',
name:this.$store.state.user.name,
symbol: '',
direction: '',
@ -194,7 +194,7 @@ export default {
},
//
alertHoldDuration: {
trainingid:this.$route.query.id,
trainingid:this.$route.query.id || '',
name:this.$store.state.user.name,
memberid:this.$store.state.user.memberId,
symbol: '',
@ -203,7 +203,7 @@ export default {
},
//
alertDeal: {
trainingId:this.$route.query.id,
trainingId:this.$route.query.id || '',
memberId:this.$store.state.user.memberId,
trainingName: '',
warningCount:null,

@ -101,7 +101,7 @@ export default {
})
},
progress(data) {
this.$tab.openPage("进行中", `/student/task/homepageage?id=${data.trainingId}`);
this.$tab.openPage("进行中", `/student/training/homepageage?id=${data.trainingId}`);
localStorage.setItem("status",data.status)
localStorage.setItem("startTime",data.startTime)
localStorage.setItem("endTime",data.endTime)

@ -1,13 +1,13 @@
'use strict'
const path = require('path')
const TerserPlugin = require('terser-webpack-plugin');
function resolve(dir) {
return path.join(__dirname, dir)
}
const CompressionPlugin = require('compression-webpack-plugin')
const TerserPlugin = require('terser-webpack-plugin');
const name = process.env.VUE_APP_TITLE || '外汇模拟交易' // 网页标题
@ -75,7 +75,7 @@ module.exports = {
}),
],
// 去除打印
optimization: {
minimizer: [
new TerserPlugin({
@ -87,6 +87,15 @@ module.exports = {
})
]
}
// 压缩所有图片
// new ImageminPlugin({
// pngquant: {
// quality: '95-100'
// }
// })
},
chainWebpack(config) {
config.plugins.delete('preload') // TODO: need test

Loading…
Cancel
Save