diff --git a/ruoyi-ui/src/api/Simulated.js b/ruoyi-ui/src/api/Simulated.js
index 60ce100..e5e2a53 100644
--- a/ruoyi-ui/src/api/Simulated.js
+++ b/ruoyi-ui/src/api/Simulated.js
@@ -8,7 +8,7 @@ export const getMarketQuotation = () => {
// 可用资金
export const getMemberById = ( memberId) => {
return request({
- url: 'api/member/getMemberById ',
+ url: 'api/member/getMemberById',
method: 'post',
data: memberId
})
@@ -20,4 +20,12 @@ export const getMarketQuotation = () => {
method: 'post',
data: code
})
+ }
+ export const transactionMarketQuotation = ( data) => {
+
+ return request({
+ url: 'api/trading/transactionMarketQuotation',
+ method: 'post',
+ data: data
+ })
}
\ No newline at end of file
diff --git a/ruoyi-ui/src/api/currentPosition.js b/ruoyi-ui/src/api/currentPosition.js
new file mode 100644
index 0000000..0865381
--- /dev/null
+++ b/ruoyi-ui/src/api/currentPosition.js
@@ -0,0 +1,24 @@
+import request from '@/utils/request'
+
+export const getTakeStashList = (data) => {
+ return request({
+ url: 'api/takeStash/getTakeStashList',
+ method: 'post',
+ data: data
+ })
+}
+export const flashProfitAndLoss = (data) => {
+ return request({
+ url: 'api/takeStash/flashProfitAndLoss',
+ method: 'post',
+ data: data
+ })
+}
+
+export const updateTakeStash = (data) => {
+ return request({
+ url: 'api/takeStash/updateTakeStash',
+ method: 'post',
+ data: data
+ })
+}
\ No newline at end of file
diff --git a/ruoyi-ui/src/api/login.js b/ruoyi-ui/src/api/login.js
index 1468908..6f2340e 100644
--- a/ruoyi-ui/src/api/login.js
+++ b/ruoyi-ui/src/api/login.js
@@ -38,7 +38,7 @@ export function getInfo() {
// 退出方法
export function logout() {
return request({
- url: '/logout',
+ url: '/api/sysUser/logout',
method: 'post'
})
}
diff --git a/ruoyi-ui/src/api/teacher/index.js b/ruoyi-ui/src/api/teacher/index.js
index c503793..da8c7b6 100644
--- a/ruoyi-ui/src/api/teacher/index.js
+++ b/ruoyi-ui/src/api/teacher/index.js
@@ -5,4 +5,12 @@ export const getRouters = () => {
url: '/api/sysUser/getRoutesByRole',
method: 'get'
})
- }
\ No newline at end of file
+ }
+ // 件分页获取实训记录数据
+ export const findByConditions = (query) => {
+ return request({
+ url: '/api/training/findByConditions',
+ method: 'get',
+ params:query
+ })
+ }
\ No newline at end of file
diff --git a/ruoyi-ui/src/layout/components/Navbar.vue b/ruoyi-ui/src/layout/components/Navbar.vue
index 6a2e0b3..931dc9d 100644
--- a/ruoyi-ui/src/layout/components/Navbar.vue
+++ b/ruoyi-ui/src/layout/components/Navbar.vue
@@ -101,8 +101,8 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
- this.$store.dispatch('FedLogOut').then(() => {
- location.href = '/index'
+ this.$store.dispatch('LogOut').then(() => {
+ location.href = '/login'
})
}).catch(() => {})
}
diff --git a/ruoyi-ui/src/layout/components/Sidebar/index.vue b/ruoyi-ui/src/layout/components/Sidebar/index.vue
index 96bfc31..1c450f5 100644
--- a/ruoyi-ui/src/layout/components/Sidebar/index.vue
+++ b/ruoyi-ui/src/layout/components/Sidebar/index.vue
@@ -79,11 +79,11 @@ export default {
mounted() {
const roleid = getroleId();
// 判断roleid全等于4就是学生,全等于3就是老师
- // if (roleid == 4) {
+ if (roleid == 4) {
this.routesList = dynamicRoutes
- // } else if (roleid == 3) {
- // this.routesList = teacher;
- // }
+ } else if (roleid == 3) {
+ this.routesList = teacher;
+ }
},
watch: {
limitsRoutes() {
diff --git a/ruoyi-ui/src/permission.js b/ruoyi-ui/src/permission.js
index 5ffdc8c..5b464a5 100644
--- a/ruoyi-ui/src/permission.js
+++ b/ruoyi-ui/src/permission.js
@@ -11,7 +11,7 @@ NProgress.configure({ showSpinner: false })
const whiteList = ['/login', '/register']
var datas = []
router.beforeEach((to, from, next) => {
- console.log(to.path, "----")
+
// if (datas.indexOf(to.path)) {
// alert(1)
// next()
diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js
index e38c2e1..8d46dc3 100644
--- a/ruoyi-ui/src/router/index.js
+++ b/ruoyi-ui/src/router/index.js
@@ -86,7 +86,6 @@ export const constantRoutes = [
redirect: '/404'
}
]
-
// 动态路由,基于用户权限动态去加载
export const dynamicRoutes = [{
path: '/student',
@@ -112,7 +111,7 @@ export const dynamicRoutes = [{
path: 'index',
component: () => import('@/views/transactionRecords/index'),
name: 'transactionRecords',
- meta: { title: '交易记录', icon: 'null', affix: true, activeMenu: '/index' }
+ meta: { title: '交易记录', icon: 'null', affix: true, activeMenu: '/student/index' }
}
]
},
@@ -140,7 +139,7 @@ export const dynamicRoutes = [{
path: 'homepageage',
component: () => import('@/views/task/index'),
name: 'homepageage',
- meta: { title: '任务主页', affix: true, activeMenu: '/training/List' }
+ meta: { title: '任务主页', affix: true, activeMenu: '/student/training/List' }
}
]
},
@@ -154,7 +153,7 @@ export const dynamicRoutes = [{
path: 'homepagege',
component: () => import('@/views/PracticeZone/index.vue'),
name: 'PracticeZone',
- meta: { title: '练习专区', affix: true, activeMenu: '/training/List' }
+ meta: { title: '练习专区', affix: true, activeMenu: '/student/training/List' }
}
]
},
@@ -168,7 +167,7 @@ export const dynamicRoutes = [{
path: 'index',
component: () => import('@/views/trade/index.vue'),
name: 'Index',
- meta: { title: '练习专区', affix: true, activeMenu: '/training/List' }
+ meta: { title: '练习专区', affix: true, activeMenu: '/student/training/List' }
}
]
},
@@ -270,34 +269,34 @@ export const dynamicRoutes = [{
}
]
}
- , { path: '*', redirect: '/404' },
+ , { path: '*', redirect: '/404' }
+]
+// 教师端路由
+export const teacher = [
{
- path: '',
+ path: '/teacher',
component: Layout,
redirect: 'ageIssue',
hidden: false,
children: [
{
- path: 'teacher',
+ path: 'index',
component: () => import('@/views/index_v1.vue'),
name: 'teacher',
meta: { title: '首页', icon: 'dashboard', affix: true }
}
]
},
-]
-// 教师端路由
-export const teacher = [
{
- path: '',
+ path: '/teacher',
component: Layout,
redirect: 'ageIssue',
hidden: false,
children: [
{
- path: 'teacher',
- component: () => import('@/views/index_v1.vue'),
- name: 'teacher',
+ path: 'report',
+ component: () => import('@/views/report/index.vue'),
+ name: 'report',
meta: { title: '首页', icon: 'dashboard', affix: true }
}
]
@@ -323,11 +322,15 @@ router.beforeEach((to, from, next) => {
// next();
console.log('to.fullPath',to.fullPath);
console.log('localStorage.getItem("limitsRoutes")', localStorage.getItem("limitsRoutes"));
-
+let fullPath=to.fullPath
+if(fullPath.indexOf('?')!=-1){
+ fullPath=fullPath.split('?')[0]
+ console.log('fullPath',fullPath);
+}
const limitsRoutes = localStorage.getItem("limitsRoutes") ? localStorage.getItem("limitsRoutes").split(',') : []
- if (!constantRoutes.filter(item => item.path == to.fullPath).length && to.fullPath !== '/404') {
- if (limitsRoutes.indexOf(to.fullPath) == -1) {
+ if (!constantRoutes.filter(item => item.path == fullPath).length &&fullPath !== '/404') {
+ if (limitsRoutes.indexOf(fullPath) == -1) {
console.log('没有权限')
next({ path: "/login" });
} else {
@@ -343,7 +346,6 @@ const limitsRoutes = localStorage.getItem("limitsRoutes") ? localStorage.getItem
else {
next();
}
-
});
-export default router
\ No newline at end of file
+export default router
diff --git a/ruoyi-ui/src/store/modules/user.js b/ruoyi-ui/src/store/modules/user.js
index d51a795..9248b2b 100644
--- a/ruoyi-ui/src/store/modules/user.js
+++ b/ruoyi-ui/src/store/modules/user.js
@@ -8,6 +8,7 @@ const user = {
schoolId: cookie.getschoolId(),
classid: '',
memberId: cookie.getmemberId(),
+ trainingId: '',
roles: [],
permissions: []
},
@@ -33,6 +34,9 @@ const user = {
},
SET_MEMBERID: (state, memberId) => {
state.memberId = memberId
+ },
+ SET_TRAININGID: (state, trainingId) => {
+ state.trainingId = trainingId
}
},
actions: {
@@ -82,7 +86,16 @@ const user = {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
commit('SET_PERMISSIONS', [])
- removeToken()
+ // 删除token
+ cookie.removeToken()
+ // 删除username
+ cookie.removename()
+ // 删除schoolId
+ cookie.removeschoolId()
+ // 删除memberId
+ cookie.removememberId()
+ // 删除roleId
+ cookie.removeroleId()
resolve()
}).catch(error => {
reject(error)
diff --git a/ruoyi-ui/src/utils/request.js b/ruoyi-ui/src/utils/request.js
index 7f7dc74..072f07b 100644
--- a/ruoyi-ui/src/utils/request.js
+++ b/ruoyi-ui/src/utils/request.js
@@ -14,9 +14,9 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
// 创建axios实例
const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分
- baseURL: 'http://118.31.7.2:8800',
+ // baseURL: 'http://118.31.7.2:8800',
// baseURL: 'http://192.168.2.14:8800',
- // baseURL:"http://192.168.2.17:8800",
+ baseURL:"http://192.168.2.17:8800",
// baseURL: process.env.VUE_APP_BASE_API,
// 超时
timeout: 200000
@@ -70,6 +70,7 @@ service.interceptors.request.use(config => {
// 响应拦截器
service.interceptors.response.use(res => {
+ console.log(res, 'res');
// 未设置状态码则默认成功状态
const code = res.data.code || 200
// 获取错误信息
diff --git a/ruoyi-ui/src/views/index.vue b/ruoyi-ui/src/views/index.vue
index 7087c25..cbc226a 100644
--- a/ruoyi-ui/src/views/index.vue
+++ b/ruoyi-ui/src/views/index.vue
@@ -31,7 +31,7 @@
-
+
@@ -65,12 +65,15 @@
/>
-
- 交易记录
+
+
+ 交易记录
+
+
{
if(res.code !== 200) return
+ // Mon Jul 24 2023 00:00:00 GMT+0800 (中国标准时间)转换成2023-07-24-00:00:00
this.transactionlist=res.data.list
this.total=res.data.total
@@ -136,8 +140,9 @@ export default {
this.classeslist=res.data
})
},
- trade() {
- this.$tab.openPage('交易记录', '/student/transactionRecords/index')
+ trade(data) {
+ console.log(data,"data");
+ // this.$tab.openPage('交易记录', `/student/transactionRecords/index?trainingId:${this.transactionlist.trainingId}`)
},
lianxi() {
this.$tab.openPage('实训任务', '/student/training/List')
diff --git a/ruoyi-ui/src/views/index_v1.vue b/ruoyi-ui/src/views/index_v1.vue
index 4cb7b10..1706371 100644
--- a/ruoyi-ui/src/views/index_v1.vue
+++ b/ruoyi-ui/src/views/index_v1.vue
@@ -1,168 +1,234 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+
+
+ 导出
+
+
- 查询
-
-
- 导出
-
-
-
- 成绩权重设置
-
-
-
-
-
-
-
-
-
-
-
- {{scope.row.cumulativeProfitLoss }}
- {{scope.row.cumulativeProfitLoss}}
-
-
-
-
-
-
-
- 实验报告
- 交易记录
-
-
-
-
成绩权重设置
+
+
+
+
+
+
+
+
+
+
+
+ {{scope.row.cumulativeProfitLoss }}
+ {{scope.row.cumulativeProfitLoss}}
+
+
+
+
+
+
+
+ 实验报告
+ 交易记录
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+ 模拟交易收益评分设置:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
\ No newline at end of file
+}
+.weight{
+ position: absolute;
+ right: 0;
+ top: 20px;
+}
+ .input__inner{
+ display: flex;
+ margin-right: 30px;;
+ &::after{
+ display: block;
+ // display: none;
+ content: '%' !important;
+ margin-left: 10px;
+}
+}
+.input{
+display: flex;
+&::after{
+ display: block;
+ // display: none;
+ content: '%' !important;
+ margin-left: 10px;
+}
+
+}
+.input-a{
+display: flex;
+&::after{
+ // display: none;
+ content: '分' !important;
+ margin-left: 10px;
+}
+}
+
diff --git a/ruoyi-ui/src/views/login.vue b/ruoyi-ui/src/views/login.vue
index 4366e42..1325298 100644
--- a/ruoyi-ui/src/views/login.vue
+++ b/ruoyi-ui/src/views/login.vue
@@ -176,16 +176,7 @@ export default {
path: this.redirect || "/student/index",
});
} else {
- this.$router.push({ path: this.redirect || "/teacher" });
- }
- } else {
- localStorage.setItem("limitsRoutes",['/teacher']);
- if (getroleId() == 4) {
- this.$router.push({
- path: this.redirect || "/student/index",
- });
- } else {
- this.$router.push({ path: this.redirect || "/teacher" });
+ this.$router.push({ path: this.redirect || "/teacher/index" });
}
}
console.log("res111", localStorage.getItem("limitsRoutes"));
diff --git a/ruoyi-ui/src/views/report/index.vue b/ruoyi-ui/src/views/report/index.vue
new file mode 100644
index 0000000..c977759
--- /dev/null
+++ b/ruoyi-ui/src/views/report/index.vue
@@ -0,0 +1,108 @@
+
+
+
+
+ 外汇模拟交易过程风险管理:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 外汇模拟交易过程收益分析:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 外汇模拟交易过程改进措施:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ruoyi-ui/src/views/task/index.vue b/ruoyi-ui/src/views/task/index.vue
index 9e612eb..d798287 100644
--- a/ruoyi-ui/src/views/task/index.vue
+++ b/ruoyi-ui/src/views/task/index.vue
@@ -19,7 +19,6 @@
:label="item.label"
:name="item.name"
>
-
{
- this.datalist = res
- setmemberId(res.memberId)
- this.$store.commit("SET_MEMBERID", res.memberId);
+ this.datalist = res.data
+ setmemberId(res.data.memberId)
+ this.$store.commit("SET_MEMBERID", res.data.memberId);
})
},
handleClick(tab) {
diff --git a/ruoyi-ui/src/views/task/report.vue b/ruoyi-ui/src/views/task/report.vue
index a5a610e..c8be62f 100644
--- a/ruoyi-ui/src/views/task/report.vue
+++ b/ruoyi-ui/src/views/task/report.vue
@@ -2,9 +2,7 @@
- 外汇模拟交易过程风险管理:
+ 外汇模拟交易过程风险管理:
@@ -16,14 +14,11 @@
-
- 外汇模拟交易过程收益分析:
+ 外汇模拟交易过程收益分析:
@@ -39,7 +34,7 @@
外汇模拟交易过程改进措施:
外汇模拟交易过程改进措施:
@@ -74,7 +69,7 @@ export default {
height: 100%;
background: url("../../assets/images/report.png") no-repeat !important;
background-size: 100% 100% !important;
- .title {
+ .titles {
margin-top: 10px;
font-size: 18px;
font-family: Microsoft YaHei;
diff --git a/ruoyi-ui/src/views/trade/components/current.vue b/ruoyi-ui/src/views/trade/components/current.vue
index 35dc588..6a927de 100644
--- a/ruoyi-ui/src/views/trade/components/current.vue
+++ b/ruoyi-ui/src/views/trade/components/current.vue
@@ -6,30 +6,30 @@
:cell-style="{ background: '#f8f8f9' }"
>
-
+
- 买
+ 买
卖
-
-
-
-
-
+
+
+
+
+
- {{ scope.row.experiment }}
- {{ scope.row.experiment }}
+ {{ scope.row.profitAndLoss }}
+ {{ scope.row.profitAndLoss }}
-
+
修改
平仓
@@ -44,7 +44,7 @@
width="30%"
append-to-body
>
-
+
@@ -133,59 +133,53 @@