学生端页面完成

main
qinzhenpen 2 years ago
parent 23307921af
commit c3fb03dff1

@ -0,0 +1,23 @@
import request from '@/utils/request'
export const getMarketQuotation = () => {
return request({
url: 'api/trading/getMarketQuotation',
method: 'post'
})
}
// 可用资金
export const getMemberById = ( memberId) => {
return request({
url: 'api/member/getMemberById ',
method: 'post',
data: memberId
})
}
// 可用资金
export const getMarketQuotationByCode = ( code) => {
return request({
url: 'api/trading/getMarketQuotationByCode ',
method: 'post',
data: code
})
}

@ -0,0 +1,8 @@
import request from '@/utils/request'
export const getMember = (data) => {
return request({
url: 'api/member/getMember',
method: 'post',
data:data
})
}

@ -20,4 +20,12 @@ export const findAll = (data) => {
method: 'get',
params: data
})
}
// 获取实训任务
export const findTrainingList = (data) => {
return request({
url: '/api/training/findTrainingList',
method: 'get',
params: data
})
}

@ -0,0 +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>

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -1 +1 @@
<svg width="128" height="100" xmlns="http://www.w3.org/2000/svg"><path d="M27.429 63.638c0-2.508-.893-4.65-2.679-6.424-1.786-1.775-3.94-2.662-6.464-2.662-2.524 0-4.679.887-6.465 2.662-1.785 1.774-2.678 3.916-2.678 6.424 0 2.508.893 4.65 2.678 6.424 1.786 1.775 3.94 2.662 6.465 2.662 2.524 0 4.678-.887 6.464-2.662 1.786-1.775 2.679-3.916 2.679-6.424zm13.714-31.801c0-2.508-.893-4.65-2.679-6.424-1.785-1.775-3.94-2.662-6.464-2.662-2.524 0-4.679.887-6.464 2.662-1.786 1.774-2.679 3.916-2.679 6.424 0 2.508.893 4.65 2.679 6.424 1.785 1.774 3.94 2.662 6.464 2.662 2.524 0 4.679-.888 6.464-2.662 1.786-1.775 2.679-3.916 2.679-6.424zM71.714 65.98l7.215-27.116c.285-1.23.107-2.378-.536-3.443-.643-1.064-1.56-1.762-2.75-2.094-1.19-.33-2.333-.177-3.429.462-1.095.639-1.81 1.573-2.143 2.804l-7.214 27.116c-2.857.237-5.405 1.266-7.643 3.088-2.238 1.822-3.738 4.152-4.5 6.992-.952 3.644-.476 7.098 1.429 10.364 1.905 3.265 4.69 5.37 8.357 6.317 3.667.947 7.143.474 10.429-1.42 3.285-1.892 5.404-4.66 6.357-8.305.762-2.84.619-5.607-.429-8.305-1.047-2.697-2.762-4.85-5.143-6.46zm47.143-2.342c0-2.508-.893-4.65-2.678-6.424-1.786-1.775-3.94-2.662-6.465-2.662-2.524 0-4.678.887-6.464 2.662-1.786 1.774-2.679 3.916-2.679 6.424 0 2.508.893 4.65 2.679 6.424 1.786 1.775 3.94 2.662 6.464 2.662 2.524 0 4.679-.887 6.465-2.662 1.785-1.775 2.678-3.916 2.678-6.424zm-45.714-45.43c0-2.509-.893-4.65-2.679-6.425C68.68 10.01 66.524 9.122 64 9.122c-2.524 0-4.679.887-6.464 2.661-1.786 1.775-2.679 3.916-2.679 6.425 0 2.508.893 4.65 2.679 6.424 1.785 1.774 3.94 2.662 6.464 2.662 2.524 0 4.679-.888 6.464-2.662 1.786-1.775 2.679-3.916 2.679-6.424zm32 13.629c0-2.508-.893-4.65-2.679-6.424-1.785-1.775-3.94-2.662-6.464-2.662-2.524 0-4.679.887-6.464 2.662-1.786 1.774-2.679 3.916-2.679 6.424 0 2.508.893 4.65 2.679 6.424 1.785 1.774 3.94 2.662 6.464 2.662 2.524 0 4.679-.888 6.464-2.662 1.786-1.775 2.679-3.916 2.679-6.424zM128 63.638c0 12.351-3.357 23.78-10.071 34.286-.905 1.372-2.19 2.058-3.858 2.058H13.93c-1.667 0-2.953-.686-3.858-2.058C3.357 87.465 0 76.037 0 63.638c0-8.613 1.69-16.847 5.071-24.703C8.452 31.08 13 24.312 18.714 18.634c5.715-5.68 12.524-10.199 20.429-13.559C47.048 1.715 55.333.035 64 .035c8.667 0 16.952 1.68 24.857 5.04 7.905 3.36 14.714 7.88 20.429 13.559 5.714 5.678 10.262 12.446 13.643 20.301 3.38 7.856 5.071 16.09 5.071 24.703z"/></svg>
<svg t="1688353918888" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6018" width="200" height="200"><path d="M98.033 480.211c-10.115 0-20.065-4.783-26.285-13.712-10.102-14.501-6.536-34.446 7.966-44.548l414.033-288.425a32.003 32.003 0 0 1 37.505 0.667l384.137 288.424c14.133 10.612 16.987 30.671 6.376 44.804s-30.67 16.988-44.804 6.375L511.335 199.272l-395.04 275.193a31.845 31.845 0 0 1-18.262 5.746zM831.241 927.64H608.515c-17.673 0-32-14.327-32-32V671.965H448.118V895.64c0 17.673-14.327 32-32 32H188.589c-17.673 0-32-14.327-32-32V513.167c0-17.673 14.327-32 32-32s32 14.327 32 32V863.64h163.529V639.965c0-17.673 14.327-32 32-32h192.397c17.673 0 32 14.327 32 32V863.64h158.727V513.167c0-17.673 14.327-32 32-32s32 14.327 32 32V895.64c-0.001 17.672-14.328 32-32.001 32z" fill="" p-id="6019"></path></svg>

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 848 B

@ -0,0 +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>

After

Width:  |  Height:  |  Size: 765 B

@ -0,0 +1 @@
<svg t="1688354047105" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7192" width="200" height="200"><path d="M831.825474 63.940169H191.939717C121.2479 63.940169 63.940169 121.2479 63.940169 191.939717v639.885757C63.940169 902.517291 121.2479 959.825022 191.939717 959.825022h639.885757c70.691817 0 127.999548-57.307731 127.999548-127.999548V191.939717C959.825022 121.2479 902.517291 63.940169 831.825474 63.940169zM895.884854 831.998871A63.835408 63.835408 0 0 1 831.912173 895.884854H192.087827c-17.112123 0-33.270563-6.574639-45.372232-18.67631S127.880338 849.110994 127.880338 831.998871V192.001129A64.236389 64.236389 0 0 1 192.087827 127.880338h639.824346A64.037705 64.037705 0 0 1 895.884854 192.001129v639.997742z" fill="" p-id="7193"></path><path d="M791.998335 351.851551h-255.999097a31.970084 31.970084 0 0 0 0 63.940169h255.999097a31.970084 31.970084 0 0 0 0-63.940169zM791.998335 607.973471h-255.999097a31.970084 31.970084 0 0 0 0 63.940169h255.999097a31.970084 31.970084 0 0 0 0-63.940169zM344.001722 527.997686c-61.855792 0-111.985607 50.144265-111.985607 111.985606s50.144265 111.985607 111.985607 111.985607 111.985607-50.144265 111.985606-111.985607-50.129815-111.985607-111.985606-111.985606z m33.982213 145.982269a48.045438 48.045438 0 1 1 14.088511-33.982213 47.745605 47.745605 0 0 1-14.088511 33.985826zM417.395643 297.394035L311.999125 402.78694 270.6078 361.392003a31.970084 31.970084 0 1 0-45.213286 45.213285l63.997968 64.001581a31.970084 31.970084 0 0 0 45.213286 0l127.999548-127.999549a31.970084 31.970084 0 0 0-45.209673-45.213285z" fill="" p-id="7194"></path></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

@ -0,0 +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>

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

@ -3,12 +3,12 @@
<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 id="topmenu-container" class="topmenu-container" v-if="topNav"/>
<top-nav v-if="topNav" id="topmenu-container" class="topmenu-container" />
<div class="right-menu">
<!-- <template v-if="device!=='mobile'">
<search id="header-search" class="right-menu-item" />
<el-tooltip content="源码地址" effect="dark" placement="bottom">
<ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
</el-tooltip>
@ -27,7 +27,7 @@
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<div class="avatar-wrapper">
<i class="el-icon-s-custom"/>
<i class="el-icon-s-custom" />
<!-- <i class="el-icon-caret-bottom" /> -->
</div>
<el-dropdown-menu slot="dropdown">
@ -101,10 +101,10 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$store.dispatch('LogOut').then(() => {
location.href = '/index';
this.$store.dispatch('FedLogOut').then(() => {
location.href = '/index'
})
}).catch(() => {});
}).catch(() => {})
}
}
}

@ -1,72 +1,77 @@
<template>
<div :class="{'has-logo':showLogo}" :style="{ backgroundColor: settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
<logo v-if="showLogo" :collapse="isCollapse" />
<el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper">
<div class="bg-img"></div>
<el-menu
:default-active="activeMenu"
:collapse="isCollapse"
:background-color="settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground"
:text-color="settings.sideTheme === 'theme-dark' ? variables.menuColor : variables.menuLightColor"
:unique-opened="true"
:active-text-color="settings.theme"
:collapse-transition="false"
mode="vertical"
>
<sidebar-item
v-for="(route, index) in routesList"
:key="route.path + index"
:item="route"
:base-path="route.path"
/>
</el-menu>
</el-scrollbar>
</div>
<div :class="{'has-logo':showLogo}" :style="{ backgroundColor: settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
<logo v-if="showLogo" :collapse="isCollapse" />
<el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper">
<div class="bg-img" />
<el-menu
:default-active="activeMenu"
:collapse="isCollapse"
:background-color="settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground"
:text-color="settings.sideTheme === 'theme-dark' ? variables.menuColor : variables.menuLightColor"
:unique-opened="true"
:active-text-color="settings.theme"
:collapse-transition="false"
mode="vertical"
>
<sidebar-item
v-for="(route, index) in routesList"
:key="route.path + index"
:item="route"
:base-path="route.path"
/>
</el-menu>
</el-scrollbar>
</div>
</template>
<script>
import { mapGetters, mapState } from "vuex";
import Logo from "./Logo";
import SidebarItem from "./SidebarItem";
import variables from "@/assets/styles/variables.scss";
import {dynamicRoutes} from '@/router/index.js';
import { mapGetters, mapState } from 'vuex'
import Logo from './Logo'
import SidebarItem from './SidebarItem'
import variables from '@/assets/styles/variables.scss'
import { dynamicRoutes,teacher} from '@/router/index.js'
import { getroleId } from '@/utils/auth'
export default {
components: { SidebarItem, Logo },
computed: {
...mapState(["settings"]),
...mapGetters(["sidebarRouters", "sidebar"]),
activeMenu() {
const route = this.$route;
const { meta, path } = route;
// if set path, the sidebar will highlight the path you set
if (meta.activeMenu) {
return meta.activeMenu;
}
return path;
},
showLogo() {
return this.$store.state.settings.sidebarLogo;
},
variables() {
return variables;
},
isCollapse() {
return !this.sidebar.opened;
}
components: { SidebarItem, Logo },
computed: {
...mapState(['settings']),
...mapGetters(['sidebarRouters', 'sidebar']),
activeMenu() {
const route = this.$route
const { meta, path } = route
// if set path, the sidebar will highlight the path you set
if (meta.activeMenu) {
return meta.activeMenu
}
return path
},
data(){
return{
routesList:[],
}
showLogo() {
return this.$store.state.settings.sidebarLogo
},
mounted() {
this.routesList=dynamicRoutes
// this.routesList.filter(item=>{
// console.log(item.children,"item.children");
// })
console.log('dynamicRoutes', this.sidebarRouters);
variables() {
return variables
},
isCollapse() {
return !this.sidebar.opened
}
},
data() {
return {
routesList: []
}
};
},
mounted() {
const roleid=getroleId()
// roleid4,3
if(roleid==4){
this.routesList = dynamicRoutes
}else if(roleid==3){
this.routesList = teacher
}
console.log('dynamicRoutes', this.routesList)
}
}
</script>
<style scoped>
.bg-img{

@ -3,25 +3,23 @@ import store from './store'
import { Message } from 'element-ui'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import { getToken } from '@/utils/auth'
import { getToken,getroleId } from '@/utils/auth'
import { isRelogin } from '@/utils/request'
NProgress.configure({ showSpinner: false })
const whiteList = ['/login', '/register']
router.beforeEach((to, from, next) => {
NProgress.start()
if (getToken()) {
// if (to.path === '/login') {
// console.log(getToken(),"getToken()")
// next({ path: '/' })
// } else{
// next()
// }
if (to.path === '/login') {
// console.log(getToken(),"getToken()")
// next({ path: '/' })
router.push({ path: '/' })
if(getroleId() === 4){
router.push({ path: '/teacher' })
}else if(getroleId() === 3){
// router.push({ path: '/' })
}
}
next()
// to.meta.title && store.dispatch('settings/setTitle', "外汇模拟交易")

@ -139,14 +139,8 @@ export const dynamicRoutes = [{
path: 'List',
component: () => import('@/views/training/index'),
name: 'training',
meta: { title: '实训任务', icon: 'dashboard', affix: true }
meta: { title: '实训任务', icon: 'quest', affix: true }
}
// {
// path: 'homepage',
// component: () => import('@/views/homepage/index.vue'),
// name: 'Index',
// meta: { title: '首页', icon: 'dashboard', affix: true }
// }
]
},
{
@ -159,7 +153,7 @@ export const dynamicRoutes = [{
path: 'home',
component: () => import('@/views/homepage/index.vue'),
name: 'Index',
meta: { title: '首页', icon: 'dashboard', affix: true, activeMenu: '/training/List' }
meta: { title: '首页', affix: true, activeMenu: '/training/List' }
}
]
},
@ -173,7 +167,7 @@ export const dynamicRoutes = [{
path: 'index',
component: () => import('@/views/PracticeZone/index.vue'),
name: 'Index',
meta: { title: '练习专区', icon: 'dashboard', affix: true, activeMenu: '/training/List' }
meta: { title: '练习专区', affix: true, activeMenu: '/training/List' }
}
]
},
@ -187,7 +181,7 @@ export const dynamicRoutes = [{
path: 'index',
component: () => import('@/views/trade/index.vue'),
name: 'Index',
meta: { title: '练习专区', icon: 'dashboard', affix: true, activeMenu: '/training/List' }
meta: { title: '练习专区', affix: true, activeMenu: '/training/List' }
}
]
},
@ -201,7 +195,7 @@ export const dynamicRoutes = [{
path: 'case',
component: () => import('@/views/teachingpan/index.vue'),
name: 'teachingPlan',
meta: { title: '实训教案', icon: 'dashboard', affix: true, activeMenu: '/teachingPlan/case' }
meta: { title: '实训教案', icon: 'teachingplan', affix: true, activeMenu: '/teachingPlan/case' }
}
]
},
@ -215,7 +209,7 @@ export const dynamicRoutes = [{
path: 'lowcore',
component: () => import('@/views/quotation/index.vue'),
name: 'lowcore',
meta: { title: '行情中心', icon: 'dashboard', affix: true, activeMenu: '/teachingPlan/case' }
meta: { title: '行情中心', icon: 'market', affix: true, activeMenu: '/teachingPlan/case' }
}
]
},
@ -293,6 +287,23 @@ export const dynamicRoutes = [{
redirect: '/404'
}
]
// 教师端路由
export const teacher = [
{
path: '',
component: Layout,
redirect: 'ageIssue',
hidden: false,
children: [
{
path: 'teacher',
component: () => import('@/views/index_v1.vue'),
name: 'teacher',
meta: { title: '首页', icon: 'dashboard', affix: true }
}
]
},
]
// 防止连续点击多次路由报错
const routerPush = Router.prototype.push
const routerReplace = Router.prototype.replace
@ -308,5 +319,5 @@ Router.prototype.replace = function push(location) {
export default new Router({
mode: 'history', // 去掉url中的#
scrollBehavior: () => ({ y: 0 }),
routes: [...dynamicRoutes, ...constantRoutes]
routes: [...dynamicRoutes, ...constantRoutes, ...teacher]
})

@ -12,8 +12,8 @@ const getters = {
roles: state => state.user.roles,
permissions: state => state.user.permissions,
permission_routes: state => state.permission.routes,
topbarRouters:state => state.permission.topbarRouters,
defaultRoutes:state => state.permission.defaultRoutes,
sidebarRouters:state => state.permission.sidebarRouters,
topbarRouters: state => state.permission.topbarRouters,
defaultRoutes: state => state.permission.defaultRoutes,
sidebarRouters: state => state.permission.sidebarRouters
}
export default getters

@ -2,8 +2,8 @@ import defaultSettings from '@/settings'
const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dynamicTitle } = defaultSettings
// tagsView
// const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || ''
const storageSetting = ''
const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || ''
// const storageSetting = ''
const state = {
title: '',
theme: storageSetting.theme || '#409EFF',

@ -1,11 +1,13 @@
import { login, logout, getInfo } from '@/api/login'
import { getToken, setToken, removeToken } from '@/utils/auth'
import { getToken, setToken, removeToken ,setname,getname,getschoolId,setschoolId,getmemberId,setroleId} from '@/utils/auth'
const user = {
state: {
token: getToken(),
name: '',
avatar: '',
name: getname(),
schoolId: getschoolId(),
classid: '',
memberId: getmemberId(),
roles: [],
permissions: []
},
@ -17,29 +19,39 @@ const user = {
SET_NAME: (state, name) => {
state.name = name
},
SET_AVATAR: (state, avatar) => {
state.avatar = avatar
SET_AVATAR: (state, classid) => {
state.avatar = classid
},
SET_ROLES: (state, roles) => {
state.roles = roles
},
SET_SCHOOLID: (state, schoolId) => {
state.schoolId = schoolId
},
SET_PERMISSIONS: (state, permissions) => {
state.permissions = permissions
},
SET_MEMBERID: (state, memberId) => {
state.memberId = memberId
}
},
actions: {
// 登录
Login({ commit }, userInfo) {
const username = userInfo.username
const passwordEncode = userInfo.passwordEncode
// console.log(username,passwordEncode,"userInfo");
return new Promise((resolve, reject) => {
login(username, passwordEncode).then(res => {
setToken(res.data.accessToken)
setname(res.data.name)
setschoolId(res.data.schoolId)
setroleId(res.data.roleId)
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)
// console.log(res,"res");
commit('SET_NAME', res.data.name)
commit('SET_AVATAR', res.data.classId)
commit('SET_SCHOOLID', res.data.schoolId)
resolve()
}).catch(error => {
reject(error)
@ -51,15 +63,12 @@ const user = {
return new Promise((resolve, reject) => {
getInfo().then(res => {
const user = res.user
const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar;
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
commit('SET_ROLES', res.roles)
commit('SET_PERMISSIONS', res.permissions)
} else {
commit('SET_ROLES', ['ROLE_DEFAULT'])
}
commit('SET_NAME', user.userName)
commit('SET_AVATAR', avatar)
resolve(res)
}).catch(error => {
reject(error)

@ -1,15 +1,39 @@
import Cookies from 'js-cookie'
const TokenKey = 'Admin-Token'
const username = 'NAME'
const schoolId = 'SCHOOLID'
const memberId = 'MEMBERID'
const roleId='ROLEID'
export function getToken() {
return Cookies.get(TokenKey)
}
export function setToken(token) {
return Cookies.set(TokenKey, token)
}
export function removeToken() {
return Cookies.remove(TokenKey)
}
export function getname() {
return Cookies.get(username)
}
export function setname(name) {
return Cookies.set(username, name)
}
export function getschoolId() {
return Cookies.get(schoolId)
}
export function setschoolId(id) {
return Cookies.set(schoolId, id)
}
export function getmemberId() {
return Cookies.get(memberId)
}
export function setmemberId(id) {
return Cookies.set(memberId, id)
}
export function getroleId() {
return Cookies.get(roleId)
}
export function setroleId(id) {
return Cookies.set(roleId, id)
}

@ -1,10 +1,10 @@
import Vue from 'vue'
import { mergeRecursive } from "@/utils/ruoyi";
import { mergeRecursive } from '@/utils/ruoyi'
import DictMeta from './DictMeta'
import DictData from './DictData'
const DEFAULT_DICT_OPTIONS = {
types: [],
types: []
}
/**

@ -1,4 +1,4 @@
import { mergeRecursive } from "@/utils/ruoyi";
import { mergeRecursive } from '@/utils/ruoyi'
import DictOptions from './DictOptions'
/**
@ -19,13 +19,12 @@ export default class DictMeta {
}
}
/**
* 解析字典元数据
* @param {Object} options
* @returns {DictMeta}
*/
DictMeta.parse= function(options) {
DictMeta.parse = function(options) {
let opts = null
if (typeof options === 'string') {
opts = DictOptions.metas[options] || {}

@ -1,4 +1,4 @@
import { mergeRecursive } from "@/utils/ruoyi";
import { mergeRecursive } from '@/utils/ruoyi'
import dictConverter from './DictConverter'
export const options = {
@ -16,8 +16,8 @@ export const options = {
*/
responseConverter,
labelField: 'label',
valueField: 'value',
},
valueField: 'value'
}
},
/**
* 默认标签字段
@ -26,7 +26,7 @@ export const options = {
/**
* 默认值字段
*/
DEFAULT_VALUE_FIELDS: ['value', 'id', 'uid', 'key'],
DEFAULT_VALUE_FIELDS: ['value', 'id', 'uid', 'key']
}
/**

@ -1,18 +1,16 @@
import { parseTime } from './ruoyi'
/**
* 表格时间格式化
*/
export function formatDate(cellValue) {
if (cellValue == null || cellValue == "") return "";
var date = new Date(cellValue)
if (cellValue == null || cellValue == '') return ''
var date = new Date(cellValue)
var year = date.getFullYear()
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds
}
@ -332,7 +330,7 @@ export function makeMap(str, expectsLowerCase) {
? val => map[val.toLowerCase()]
: val => map[val]
}
export const exportDefault = 'export default '
export const beautifierConf = {
@ -389,4 +387,4 @@ export function camelCase(str) {
export function isNumberStr(str) {
return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str)
}

@ -3,24 +3,26 @@ import { Notification, MessageBox, Message, Loading } from 'element-ui'
import store from '@/store'
import { getToken } from '@/utils/auth'
import errorCode from '@/utils/errorCode'
import { tansParams, blobValidate } from "@/utils/ruoyi";
import { tansParams, blobValidate } from '@/utils/ruoyi'
import cache from '@/plugins/cache'
import { saveAs } from 'file-saver'
let downloadLoadingInstance;
let downloadLoadingInstance
// 是否显示重新登录
export let isRelogin = { show: false };
export const isRelogin = { show: false }
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://192.168.2.14:8800",
// baseURL: 'http://118.31.7.2:8800',
// baseURL: 'http://192.168.2.14:8800',
baseURL:"http://192.168.2.17:8800",
// baseURL: process.env.VUE_APP_BASE_API,
// 超时
timeout: 200000
})
// request拦截器
service.interceptors.request.use(config => {
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false
@ -31,10 +33,10 @@ service.interceptors.request.use(config => {
}
// get请求映射params参数
if (config.method === 'get' && config.params) {
let url = config.url + '?' + tansParams(config.params);
url = url.slice(0, -1);
config.params = {};
config.url = url;
let url = config.url + '?' + tansParams(config.params)
url = url.slice(0, -1)
config.params = {}
config.url = url
}
if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) {
const requestObj = {
@ -46,12 +48,12 @@ service.interceptors.request.use(config => {
if (sessionObj === undefined || sessionObj === null || sessionObj === '') {
cache.session.setJSON('sessionObj', requestObj)
} else {
const s_url = sessionObj.url; // 请求地址
const s_data = sessionObj.data; // 请求数据
const s_time = sessionObj.time; // 请求时间
const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交
const s_url = sessionObj.url // 请求地址
const s_data = sessionObj.data // 请求数据
const s_time = sessionObj.time // 请求时间
const interval = 1000 // 间隔时间(ms),小于此时间视为重复提交
if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) {
const message = '数据正在处理,请勿重复提交';
const message = '数据正在处理,请勿重复提交'
console.warn(`[${s_url}]: ` + message)
return Promise.reject(new Error(message))
} else {
@ -68,7 +70,7 @@ service.interceptors.request.use(config => {
// 响应拦截器
service.interceptors.response.use(res => {
// 未设置状态码则默认成功状态
const code = res.data.code || 200;
const code = res.data.code || 200
// 获取错误信息
const msg = errorCode[code] || res.data.msg || errorCode['default']
// 二进制数据则直接返回
@ -77,15 +79,15 @@ service.interceptors.response.use(res => {
}
if (code === 401) {
if (!isRelogin.show) {
isRelogin.show = true;
isRelogin.show = true
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => {
isRelogin.show = false;
isRelogin.show = false
// store.dispatch('LogOut').then(() => {
// location.href = '/index';
// })
}).catch(() => {
isRelogin.show = false;
});
isRelogin.show = false
})
}
return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
} else if (code === 500) {
@ -101,45 +103,46 @@ service.interceptors.response.use(res => {
return res.data
}
},
error => {
console.log('err' + error)
let { message } = error;
if (message == "Network Error") {
message = "后端接口连接异常";
} else if (message.includes("timeout")) {
message = "系统接口请求超时";
} else if (message.includes("Request failed with status code")) {
message = "系统接口" + message.substr(message.length - 3) + "异常";
}
Message({ message: message, type: 'error', duration: 5 * 1000 })
return Promise.reject(error)
error => {
console.log('err' + error)
let { message } = error
if (message == 'Network Error') {
message = '后端接口连接异常'
} else if (message.includes('timeout')) {
message = '系统接口请求超时'
} else if (message.includes('Request failed with status code')) {
message = '系统接口' + message.substr(message.length - 3) + '异常'
}
Message({ message: message, type: 'error', duration: 5 * 1000 })
return Promise.reject(error)
}
)
// 通用下载方法
export function download(url, params, filename, config) {
downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", })
downloadLoadingInstance = Loading.service({ text: '正在下载数据,请稍候', spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0.7)' })
return service.post(url, params, {
transformRequest: [(params) => { return tansParams(params) }],
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob',
...config
}).then(async (data) => {
const isBlob = blobValidate(data);
}).then(async(data) => {
const isBlob = blobValidate(data)
if (isBlob) {
const blob = new Blob([data])
saveAs(blob, filename)
} else {
const resText = await data.text();
const rspObj = JSON.parse(resText);
const resText = await data.text()
const rspObj = JSON.parse(resText)
const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
Message.error(errMsg);
Message.error(errMsg)
}
downloadLoadingInstance.close();
downloadLoadingInstance.close()
}).catch((r) => {
console.error(r)
Message.error('下载文件出现错误,请联系管理员!')
downloadLoadingInstance.close();
downloadLoadingInstance.close()
})
}

@ -30,7 +30,7 @@
</template>
<script>
import tabs1 from '../homepage/overview.vue'
// import tabs2 from "./report.vue";
export default {
name: '',
components: {

@ -1,7 +1,7 @@
<template>
<div class="app-container">
<div class="overview-title" v-show="activeName !== 'tabs2'">
<el-button size="medium">进行中</el-button>
<el-button size="medium" @click="carryout"></el-button>
</div>
<div class="overview-title-right" v-show="activeName !== 'tabs1'">
<el-button type="primary"> </el-button>
@ -19,6 +19,7 @@
:label="item.label"
:name="item.name"
>
<components
:is="item.name"
:id="id"
@ -51,9 +52,13 @@ export default {
name: "tabs2",
},
],
id: "",
};
},
created() {},
created() {
this.id = this.$route.query.id;
console.log(this.id, "this.id");
},
computed: {},
methods: {
handleClick(tab) {
@ -61,6 +66,9 @@ export default {
? (this.nowName = tab.name)
: (this.nowName = tab.name);
},
carryout(){
this.$tab.openPage("进行中", "/trade/index",{id:this.id} );
}
},
};
</script>

@ -1,52 +1,41 @@
<template>
<div class="training-overview">
<el-row :gutter="20">
<el-row :gutter="20">
<el-col :span="8">
<div class="grid-content bg-purple">
<span>期初资金:<i>10000</i><em>美元</em> </span>
<span>已用保证金:<i>20.16</i> <em>美元</em> </span>
<div class="grid-content bg-purple" >
<span>期初资金:<i>{{ datalist.initialCapital }}</i><em>美元</em> </span>
<span>已用保证金:<i>{{ datalist.marginUsed }}</i> <em>美元</em> </span>
<span
>持仓盈亏:
<template>
<i style="color: #2cb7b0">-24.91</i>
<i style="color: #2cb7b0">{{datalist.positionProfitLoss }}</i>
</template>
<em>美元</em>
</span>
</div>
</el-col>
<el-col :span="8"
><div class="grid-content bg-purple">
<span>总资产:<i>10006.21</i><em>美元</em> </span>
<span>可用资金:<i>9961.72</i><em>美元</em> </span>
<el-col :span="8">
<div class="grid-content bg-purple">
<span>总资产:<i>{{ datalist.totalAssets }}</i><em>美元</em> </span>
<span>可用资金:<i>{{ datalist.availableFunds}}</i><em>美元</em> </span>
<span
>累计盈亏:
<template>
<i style="color: #ec6c01">6.21</i>
<i style="color: #ec6c01">{{ datalist.cumulativeProfitLoss }}</i>
</template>
<em>美元</em>
</span>
</div></el-col
>
</div></el-col>
<el-col :span="6"
><div class="grid-content bg-purp">
<span>净值:<i>9982.40</i><em>美元</em> </span>
<span>保证金水平:<i>48433.12%</i><em>美元</em> </span>
</div></el-col
>
<span>净值:<i>{{ datalist.netValue }}</i><em>美元</em> </span>
<span>保证金水平:<i>{{ datalist.marginLevel }}</i><em>美元</em> </span>
</div></el-col>
</el-row>
<el-tabs class="tabs" v-model="activeName" @tab-click="handleClick">
<el-tab-pane
v-for="(item, index) in tabsArr"
:key="index"
:label="item.label"
:name="item.name"
>
<components
:is="item.name"
:id="id"
v-if="item.name == nowName"
></components>
<el-tab-pane v-for="(item, index) in tabsArr" :key="index" :label="item.label" :name="item.name" >
<components :is="item.name" :id="id" v-if="item.name == nowName" ></components>
</el-tab-pane>
</el-tabs>
</div>
@ -54,6 +43,9 @@
<script>
import tabs1 from "./components/current.vue";
import tabs2 from "./components/deals.vue";
import * as homepage from "@/api/homepage.js";
import { getname,getschoolId,setmemberId } from "@/utils/auth.js";
export default {
name: "",
components: {
@ -74,11 +66,24 @@ export default {
name: "tabs2",
},
],
name:getname(),
schoolId:getschoolId(),
id:this.$route.query.id,
datalist:[],
};
},
created() {},
created() {
this.getlist()
},
computed: {},
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);
})
},
handleClick(tab) {
tab.name == "tabs1"
? (this.nowName = tab.name)

@ -16,6 +16,7 @@
<el-col :span="11">
<el-form-item label="交易方法与技巧:">
<el-input type="textarea"></el-input>
</el-form-item>
</el-col>
</el-row>

@ -19,55 +19,52 @@
</el-row>
<!-- 搜索栏 -->
<div class="index">
<el-form ref="queryForm" size="small" :inline="true">
<el-form ref="queryForm" size="small" :inline="true" :model="queryParams">
<el-form-item label="实训任务" prop="title" class="formIpt">
<el-select placeholder="选择分类" clearable type="image">
<el-option />
<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">
<el-option />
<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 type="date" placeholder="选择日期" />
<el-date-picker v-model="queryParams.startTime" type="date" placeholder="选择日期" />
</el-form-item>
<el-form-item label="搜索" prop="status">
<el-input placeholder="学号 / 姓名" clearable />
<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>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="ranking" label="排名" width="100" align="center" />
<el-table-column prop="class" label="班级" width="140" align="center" />
<el-table v-loading="loading" :data="transactionlist" style="width: 100%" >
<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="StudentID" 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.profit > 0" style="color: #f98133">{{
scope.row.profit
}}</span>
<span v-else-if="scope.row.profit < 0" style="color: #36b9b2">{{
scope.row.profit
}}</span>
<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="income" label="收益率" align="center" />
<el-table-column prop="number" label="开仓次数" align="center" />
<el-table-column prop="yield" label="收益率" align="center" />
<el-table-column prop="openingTrades" label="开仓次数" align="center" />
<el-table-column
prop="Simulation"
label="模拟交易实训成绩"
align="center"
/>
<el-table-column prop="experiment" label="实验报告成绩" align="center" />
<el-table-column prop="address" label="总成绩" align="center" />
<el-table-column prop="totalAssets" label="总成绩" align="center" />
<el-table-column prop="address" label="交易记录" align="center">
<el-button
size="mini"
@ -76,7 +73,13 @@
>交易记录</el-button>
</el-table-column>
</el-table>
<pagination :total="10" />
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.index"
:limit.sync="queryParams.size"
@pagination="getlist"
/>
</div>
</div>
</template>
@ -86,86 +89,7 @@ export default {
name: 'Index',
data() {
return {
tableData: [
{
ranking: '2',
class: '王小虎',
name: '王小虎',
StudentID: '2003001',
profit: '+20000',
income: '50%',
number: '8',
Simulation: '80',
experiment: '70'
},
{
ranking: '2',
class: '王小虎',
name: '王小虎',
StudentID: '2003001',
profit: '+20000',
income: '20%',
number: '8',
Simulation: '80',
experiment: '70'
},
{
ranking: '2',
class: '王小虎',
name: '王小虎',
StudentID: '2003001',
profit: '+20000',
income: '20%',
number: '8',
Simulation: '80',
experiment: '70'
},
{
ranking: '2',
class: '王小虎',
name: '王小虎',
StudentID: '2003001',
profit: '+20000',
income: '20%',
number: '8',
Simulation: '80',
experiment: '70'
},
{
ranking: '2',
class: '王小虎',
name: '王小虎',
StudentID: '2003001',
profit: '+20000',
income: '20%',
number: '8',
Simulation: '80',
experiment: '70'
},
{
ranking: '2',
class: '王小虎',
name: '王小虎',
StudentID: '2003001',
profit: '+20000',
income: '20%',
number: '8',
Simulation: '80',
experiment: '70'
},
{
ranking: '2',
class: '王小虎',
name: '王小虎',
StudentID: '2003001',
profit: '-20000',
income: '40%',
number: '8',
Simulation: '80',
experiment: '70'
}
],
loading:true,
queryParams: {
trainingName: null,
classGrade: '',
@ -174,7 +98,11 @@ export default {
size: 10,
startTime: '',
studentNumber: ''
}
},
tasklist:null,
classeslist:null,
transactionlist:[],
total:0
}
},
computed: {},
@ -185,19 +113,27 @@ export default {
},
methods: {
getlist() {
this.loading=true
home.findAll(this.queryParams).then((res) => {
console.log(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) => {
console.log(res)
if(res.code !== 200) return
this.tasklist=res.data
})
},
classGrade() {
home.getClassGrade().then((res) => {
console.log(res)
if(res.code !== 200) return
this.classeslist=res.data
})
},
trade() {

@ -1,98 +1,24 @@
<template>
<div class="dashboard-editor-container">
<!-- <panel-group @handleSetLineChartData="handleSetLineChartData" />
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
<line-chart :chart-data="lineChartData" />
</el-row>
<el-row :gutter="32">
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<raddar-chart />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<pie-chart />/index
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<bar-chart />
</div>
</el-col>
</el-row>
-->
</div>
<div>
御剑乘风来,除魔天地间!
</div>
</template>
<script>
import PanelGroup from './dashboard/PanelGroup'
import LineChart from './dashboard/LineChart'
import RaddarChart from './dashboard/RaddarChart'
import PieChart from './dashboard/PieChart'
import BarChart from './dashboard/BarChart'
const lineChartData = {
newVisitis: {
expectedData: [100, 120, 161, 134, 105, 160, 165],
actualData: [120, 82, 91, 154, 162, 140, 145]
},
messages: {
expectedData: [200, 192, 120, 144, 160, 130, 140],
actualData: [180, 160, 151, 106, 145, 150, 130]
},
purchases: {
expectedData: [80, 100, 121, 104, 105, 90, 100],
actualData: [120, 90, 100, 138, 142, 130, 130]
},
shoppings: {
expectedData: [130, 140, 141, 142, 145, 150, 160],
actualData: [120, 82, 91, 154, 162, 140, 130]
}
}
export default {
name: 'Index',
components: {
PanelGroup,
LineChart,
RaddarChart,
PieChart,
BarChart
},
data() {
return {
lineChartData: lineChartData.newVisitis
}
},
methods: {
handleSetLineChartData(type) {
this.lineChartData = lineChartData[type]
export default{
name:'',
data () {
return {
}
},
created () {
},
computed:{
},
methods:{
}
}
}
</script>
<style lang="scss" scoped>
.dashboard-editor-container {
padding: 32px;
background-color: rgb(240, 242, 245);
position: relative;
.chart-wrapper {
background: #fff;
padding: 16px 16px 0;
margin-bottom: 32px;
}
}
@media (max-width:1024px) {
.chart-wrapper {
padding: 8px;
}
}
</style>
<style lang='less' scoped>
</style>

@ -1,35 +1,35 @@
<template>
<div class="app-container">
<div class="quotation-container">
<el-row>
<el-col :span="24">
<div class="grid-content">
<img src="../../assets/images/已结束bg.png" style="height: 110px;" alt="">
<img src="../../assets/images/sina.png" style="height: 110px;" alt="">
<div class="center"> <span>新浪财经</span></div>
<div class="right"> <el-button type="primary">查看 >></el-button>
<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/已结束bg.png" style="height: 110px;" alt="">
<img src="../../assets/images/dongfang.png" style="height: 110px;" alt="">
<div class="center"> <span>东方财富</span></div>
<div class="right"> <el-button type="primary">查看 >></el-button>
<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/已结束bg.png" style="height: 110px;" alt="">
<img src="../../assets/images/csrc.png" style="height: 110px;" alt="">
<div class="center"> <span>中国证监会</span></div>
<div class="right"> <el-button type="primary">查看 >></el-button>
<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/已结束bg.png" style="height: 110px;" alt="">
<img src="../../assets/images/u2008.png" style="height: 110px;" alt="">
<div class="center"> <span>外汇模拟交易</span></div>
<div class="right"> <el-button type="primary"> 查看 >></el-button>
<div class="right"> <el-button type="primary" @click="oepnWindow(4)"> >></el-button>
</div>
</div>
</el-col>
@ -49,6 +49,18 @@ export default {
created() {
},
methods: {
oepnWindow(type){
//type1
if(type==1){
window.open("https://vip.stock.finance.sina.com.cn/mkt/");
} else if(type==2){
window.open("http://quote.eastmoney.com/center/");
} else if(type==3){
window.open("http://www.csrc.gov.cn/");
} else if(type==4){
window.open("http://www.u2008.com/");
}
}
}
}
</script>
@ -57,7 +69,7 @@ export default {
.grid-content {
border-radius: 4px;
margin-bottom: 30px;
background: pink;
background:url("../../assets/images/微信图片_20230703135000.png") no-repeat;
min-height: 170px;
padding: 30px 30px;
display: flex;

@ -30,7 +30,7 @@
<!-- 分页 -->
<pagination :total="10" />
<el-row>
<el-col :span="24"><div class="record">预警记录:</div></el-col>
<el-col :span="24"><div class="record"><svg-icon icon-class="EarlyWarning" /> 预警记录:</div></el-col>
</el-row>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="ranking" label="账号" width="100" align="center" />
@ -121,6 +121,7 @@ export default {
font-size: 18px;
font-family: Microsoft YaHei;
font-weight: bold;
// margin-left: 10px;
color: #333333;
}
}

@ -4,13 +4,10 @@
:data="tableData"
style="width: 100%"
>
<el-table-column
prop="ranking"
label="交易品种"
<el-table-column prop="ranking" label="交易品种"
width="100"
align="center"
/>
<el-table-column label="预警时长" align="center" prop="profit" />
<el-table-column prop="StudentID" label="状态" align="center" />
<el-table-column prop="class" label="设置时间" align="center" />
@ -22,7 +19,7 @@
<!-- 分页 -->
<pagination :total="10" />
<el-row>
<el-col :span="24"><div class="record">预警记录:</div></el-col>
<el-col :span="24"><div class="record"><svg-icon icon-class="EarlyWarning" />预警记录:</div></el-col>
</el-row>
<!-- 行情预警记录 -->
<el-table :data="tableData" style="width: 100%">

@ -23,7 +23,7 @@
<!-- 分页 -->
<pagination :total="10" />
<el-row>
<el-col :span="24"><div class="record">预警记录:</div></el-col>
<el-col :span="24"><div class="record"><svg-icon icon-class="EarlyWarning" />预警记录:</div></el-col>
</el-row>
<!-- 行情预警记录 -->
<el-table :data="tableData" style="width: 100%">

@ -23,7 +23,7 @@
<!-- 分页 -->
<pagination :total="10" />
<el-row>
<el-col :span="24"><div class="record">预警记录:</div></el-col>
<el-col :span="24"><div class="record"><svg-icon icon-class="EarlyWarning" />预警记录:</div></el-col>
</el-row>
<!-- 行情预警记录 -->
<el-table :data="tableData" style="width: 100%">

@ -1,25 +1,17 @@
<template>
<div>
<el-table :data="tableData" style="width: 100%">
<el-table-column
prop="ranking"
label="交易品种"
width="100"
align="center"
/>
<el-table-column prop="class" label="名称" align="center" />
<el-table-column label="卖价" align="center" />
<el-table-column
prop="StudentID"
label="最高卖价/最低卖价"
align="center"
/>
<el-table-column label="买价" align="center" />
<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="Simulation" label="操作" align="center">
<el-button type="primary" size="mini" @click="colseDialogVisible=true"></el-button>
<el-table :data="datalist" style="width: 100%">
<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 prop="range" label="振幅" align="center" />
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="trading(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
<pagination :total="10" />
@ -30,37 +22,33 @@
:label="item.label"
:name="item.name"
>
<components
:is="item.name"
v-if="item.name == nowName"
:id="id"
/>
<components :is="item.name" v-if="item.name == nowName" :id="id"/>
</el-tab-pane>
</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-item label="交易品种:">
<el-select placeholder="活动区域" style="width: 100%">
<el-option label="区域一" value="shanghai" />
<el-option label="区域二" value="beijing" />
</el-select>
</el-form-item>
<el-form-item label="名 称:">
<el-input type="password" autocomplete="off" />
</el-form-item>
<el-form-item label="类 型:">
<el-select v-model="value1" 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-select>
</el-form-item>
<el-form-item label="买 卖">
<el-form-item v-if="value1 !== '挂单开仓'" label="买 卖">
<el-radio-group>
<el-radio label="买入" />
<el-radio label="卖出" />
@ -69,6 +57,9 @@
<el-form-item label="交 易 量:">
<el-input />
</el-form-item>
<el-form-item v-if="RegistrationVisible" label="价 位:">
<el-input />
</el-form-item>
<div class="dialog-inline" style="display: flex">
<el-form-item label="止 损:">
<el-input />
@ -77,29 +68,19 @@
<el-input />
</el-form-item>
</div>
<el-form-item v-if="RegistrationVisible" label="有效期限">
<el-date-picker style="width: 100%;" type="date" placeholder="选择日期" />
</el-form-item>
<el-form-item label="可用资金:">
<template>
<span
style="
font-size: 18px;
font-weight: bold;
font-family: Microsoft YaHei;
color: #1d2129;
"
>9661.00美元</span>
<span style=" font-size: 18px; font-weight: bold; font-family: Microsoft YaHei; color: #1d2129; ">9661.00美元</span>
<div class="price">6.90494 / 6.90498</div>
</template>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button
type="primary"
@click="colseDialogVisible = false"
>确定</el-button>
<el-button
type="info"
@click="colseDialogVisible = false"
>取消</el-button>
<el-button type="primary" @click="colseDialogVisible = false">确定</el-button>
<el-button type="info" @click="colseDialogVisible = false">取消</el-button>
</span>
</el-dialog>
</div>
@ -108,7 +89,15 @@
import tabs1 from './components/current.vue'
import tabs3 from './components/deals.vue'
import tabs2 from './components/orders.vue'
import * as Simulated from "@/api/Simulated.js"
import { getmemberId } from "@/utils/auth.js"
export default {
props:{
id:{
type:String,
default:''
}
},
components: {
tabs1,
tabs2,
@ -119,6 +108,11 @@ export default {
activeName: 'tabs1',
nowName: 'tabs1',
colseDialogVisible: false,
RegistrationVisible: false,
memberId: getmemberId(),
value1: '',
varietieslist:[],
datalist:null,
tabsArr: [
{
label: '当前持仓',
@ -133,81 +127,45 @@ export default {
name: 'tabs3'
}
],
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'
},
{
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'
}
]
member: []
}
},
created(){
this.getlist()
},
methods: {
getlist(){
Simulated.getMarketQuotation().then((res)=>{
this.datalist=res.filter(item=>item.currency!== "美元指数")
})
},
handleClick(tab) {
tab.name == 'tabs1' ? this.nowName = tab.name : (tab.name = 'tabs2' ? this.nowName = tab.name : this.nowName = tab.name)
},
transaction(value) {
if (value !== '挂单开仓' || value === '') {
this.RegistrationVisible = false
} else {
this.RegistrationVisible = true
}
},
availableFunds() {
Simulated.getMemberById(this.memberId).then((res)=>{
this.member=res
})
},
Price(code){
Simulated.getMarketQuotationByCode(code).then((res)=>{
console.log(res,'code');
})
},
trading(data){
this.colseDialogVisible=true
this.availableFunds()
this.Price(data.code)
}
}
}
</script>
<style lang="scss" scoped>

@ -28,6 +28,7 @@ export default {
},
data() {
return {
id: this.$route.query.id,
activeName: 'tabs1',
nowName: 'tabs1',
tabsArr: [

@ -122,9 +122,8 @@ export default {
},
methods: {
handleClick(tab) {
// tab.name == 'tabs1' ? this.nowName = tab.name : (tab.name = 'tabs2' ? this.nowName = tab.name : this.nowName = tab.name)
// if(tab.name)
// console.log(tab.name, 'tab')
if (this.nowName) {
this.nowName = tab.name
}

@ -3,169 +3,91 @@
<div class="title-content">
<img src="../../assets//images/banner.png" alt="" style="width: 100%" />
</div>
<div class="raining-cemtern">
<div class="raining-cemtern" v-loading="loading">
<el-row :gutter="20">
<el-col :span="6" v-for="item in datalist" :key="item">
<div class="grid-content" v-if="item.text == '进行中'">
<el-col :span="6" v-for="item in characterslist" :key="item">
<div class="grid-content" v-if="item.status == 1">
<div class="title">
<span>{{ item.name }}</span>
<el-button
size="mini"
style="background: #dfecf8; color: #3c9cf5"
>{{ item.text }}</el-button
>
<span>{{ item.trainingName }}</span>
<el-tag type="success" >进行中</el-tag>
</div>
<div class="centern">起止时间2018-04-11 - 2018-10-25</div>
<div class="centern">起止时间{{ parseTime(item.startTime )}}</div>
<div class="grid-footer">
<el-button type="primary" @click="progress"></el-button>
<el-button type="primary" @click="progress(item.trainingId)"></el-button>
</div>
</div>
<div class="grid-content1" v-else-if="item.text == ''">
<div class="grid-content1" v-else-if="item.status == 0">
<div class="title">
<span>{{ item.name }}</span>
<el-button
size="mini"
style="background: #dfecf8; color: #3c9cf5"
>{{ item.text }}</el-button
>
<span>{{ item.trainingName }}</span>
<el-tag type="warning">未开始</el-tag>
</div>
<div class="centern">起止时间2018-04-11 - 2018-10-25</div>
<div class="centern">起止时间{{ parseTime(item.startTime ) }}</div>
<div class="grid-footer">
<el-button type="primary" @click="progress"></el-button>
<el-button type="primary" @click="progress(item.trainingId)"></el-button>
</div>
</div>
<div class="grid-content2" v-else>
<div class="title">
<span>{{ item.name }}</span>
<el-button
size="mini"
style="background: #dfecf8; color: #3c9cf5"
>{{ item.text }}</el-button
>
<span>{{ item.trainingName }}</span>
<el-tag type="info" >已结束</el-tag>
</div>
<div class="centern">起止时间2018-04-11 - 2018-10-25</div>
<div class="centern">起止时间{{ parseTime(item.startTime ) }}</div>
<div class="grid-footer">
<el-button type="primary" @click="progress"></el-button>
<el-button type="primary" @click="progress(item.trainingId)"></el-button>
</div>
</div>
<!-- <div class="grid-content1" v-else>
<div class="title">
<span>{{item.name}}</span>
<el-button size="mini" style="background: #DFECF8; color: #3C9CF5;">{{ item.text }}</el-button>
</div>
<div class="centern">起止时间2018-04-11 - 2018-10-25</div>
<div class="grid-footer">
<el-button type="primary">进行中</el-button>
</div>
</div> -->
</el-col>
</el-row>
</div>
<pagination :total="10" />
<pagination
v-show="total > 0"
:total="total"
:page.sync="recordlist.index"
:limit.sync="recordlist.size"
@pagination="getlist" />
</div>
</template>
<script>
import * as training from "@/api/index.js"
export default {
name: "",
data() {
return {
datalist: [
{
name: "外汇模拟交易",
text: "进行中",
time: "2018-04-11 - 2018-10-25",
},
{
name: "外汇模拟交易",
text: "进行中",
time: "2018-04-11 - 2018-10-25",
},
{
name: "外汇模拟交易",
text: "未开始",
time: "2018-04-11 - 2018-10-25",
},
{
name: "外汇模拟交易",
text: "未开始",
time: "2018-04-11 - 2018-10-25",
},
{
name: "外汇模拟交易",
text: "未开始",
time: "2018-04-11 - 2018-10-25",
},
{
name: "外汇模拟交易",
text: "未开始",
time: "2018-04-11 - 2018-10-25",
},
{
name: "外汇模拟交易",
text: "未开始",
time: "2018-04-11 - 2018-10-25",
},
{
name: "外汇模拟交易",
text: "未开始",
time: "2018-04-11 - 2018-10-25",
},
{
name: "外汇模拟交易",
text: "未开始",
time: "2018-04-11 - 2018-10-25",
},
{
name: "外汇模拟交易",
text: "未开始",
time: "2018-04-11 - 2018-10-25",
},
{
name: "外汇模拟交易",
text: "未开始",
time: "2018-04-11 - 2018-10-25",
},
{
name: "外汇模拟交易",
text: "未开始",
time: "2018-04-11 - 2018-10-25",
},
{
name: "外汇模拟交易",
text: "未开始",
time: "2018-04-11 - 2018-10-25",
},
{
name: "外汇模拟交易",
text: "未开始",
time: "2018-04-11 - 2018-10-25",
},
{
name: "外汇模拟交易",
text: "已结束",
time: "2018-04-11 - 2018-10-25",
},
{
name: "外汇模拟交易",
text: "已结束",
time: "2018-04-11 - 2018-10-25",
},
],
recordlist:{
index:1,
size:10
},
characterslist:null,//
id:'',
total:0,
loading:true
};
},
created() {},
created() {
this.getlist()
},
computed: {},
methods: {
progress() {
this.$tab.openPage("进行中", "/homepage/home");
getlist(){
this.loading = true
training.findTrainingList(this.recordlist).then((res)=>{
if(res.code == 200){
this.characterslist = res.data.list
this.total = res.data.total
this.loading = false
}
})
},
progress(id) {
console.log(id,"id");
this.$tab.openPage("进行中", "/homepage/home/" ,{id:id});
},
},
};
</script>
<style lang='scss' scoped>
.app-training {
background: #fff;
padding: 0 0 15px 0;
.el-row {
margin-bottom: 20px;
@ -179,6 +101,7 @@ export default {
.raining-cemtern {
margin-bottom: 30px;
.grid-content1 {
position: relative;
background: url("../../assets/images/未开始bg@2x.png") no-repeat;
background-size: cover;
@ -197,13 +120,14 @@ export default {
padding: 0 20px;
}
.grid-footer {
display: flex;
align-items: center;
flex-direction: column;
margin: 34px 0 14px 0;
position: absolute;
bottom: 10px;
left: 50%;
transform: translate(-50%, 0);
}
}
.grid-content2{
position: relative;
background: url("../../assets/images/已结束bg@2x.png") no-repeat;
background-size: cover;
margin-top: 10px;
@ -221,14 +145,15 @@ export default {
padding: 0 20px;
}
.grid-footer {
display: flex;
align-items: center;
flex-direction: column;
margin: 34px 0 14px 0;
position: absolute;
bottom: 10px;
left: 50%;
transform: translate(-50%, 0);
}
}
}
.grid-content {
position: relative;
margin-top: 10px;
border-radius: 4px;
min-height: 160px;
@ -245,11 +170,16 @@ export default {
padding: 0 20px;
}
.grid-footer {
display: flex;
align-items: center;
flex-direction: column;
margin: 34px 0 14px 0;
position: absolute;
bottom: 10px;
left: 50%;
transform: translate(-50%, 0);
}
}
}
.pagination-container{
background: #f1f4f6;
}
</style>
Loading…
Cancel
Save