From 23307921af9b67c411c68c59770c3b5fd2ab4a6f Mon Sep 17 00:00:00 2001 From: qzp <1748141997@qq.com> Date: Mon, 3 Jul 2023 09:21:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E7=AB=AF=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/permission.js | 4 +- ruoyi-ui/src/router/index.js | 42 ++- ruoyi-ui/src/store/modules/settings.js | 8 +- ruoyi-ui/src/utils/request.js | 68 ++-- ruoyi-ui/src/views/PracticeZone/index.vue | 48 +-- ruoyi-ui/src/views/index.vue | 249 ++++++++------- ruoyi-ui/src/views/login.vue | 152 ++++----- ruoyi-ui/src/views/quotation/index.vue | 81 +++++ ruoyi-ui/src/views/teachingpan/index.vue | 62 ++++ .../src/views/trade/components/Deposit.vue | 266 ++++++++-------- .../src/views/trade/components/current.vue | 167 +++++----- ruoyi-ui/src/views/trade/components/deals.vue | 183 ++++++----- .../trade/components/numberTransactions.vue | 130 ++++++++ .../src/views/trade/components/orders.vue | 296 +++++++++--------- .../src/views/trade/components/quotation.vue | 128 ++++++++ ruoyi-ui/src/views/trade/holding.vue | 250 ++++++++++----- ruoyi-ui/src/views/trade/index.vue | 67 ++-- ruoyi-ui/src/views/trade/strike.vue | 162 +++++----- 18 files changed, 1430 insertions(+), 933 deletions(-) create mode 100644 ruoyi-ui/src/views/quotation/index.vue create mode 100644 ruoyi-ui/src/views/teachingpan/index.vue create mode 100644 ruoyi-ui/src/views/trade/components/numberTransactions.vue create mode 100644 ruoyi-ui/src/views/trade/components/quotation.vue diff --git a/ruoyi-ui/src/permission.js b/ruoyi-ui/src/permission.js index bfe923f..853b1f2 100644 --- a/ruoyi-ui/src/permission.js +++ b/ruoyi-ui/src/permission.js @@ -21,8 +21,8 @@ router.beforeEach((to, from, next) => { if (to.path === '/login') { // console.log(getToken(),"getToken()") // next({ path: '/' }) - router.push({path:'/'}) - } + router.push({ path: '/' }) + } next() // to.meta.title && store.dispatch('settings/setTitle', "外汇模拟交易") /* has token*/ diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index 81631d4..667b3be 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -111,7 +111,7 @@ export const dynamicRoutes = [{ component: () => import('@/views/index'), name: 'Index', meta: { title: '首页', icon: 'dashboard', affix: true } - }, + } ] }, { @@ -140,7 +140,7 @@ export const dynamicRoutes = [{ component: () => import('@/views/training/index'), name: 'training', meta: { title: '实训任务', icon: 'dashboard', affix: true } - }, + } // { // path: 'homepage', // component: () => import('@/views/homepage/index.vue'), @@ -159,7 +159,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: '首页', icon: 'dashboard', affix: true, activeMenu: '/training/List' } } ] }, @@ -173,7 +173,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: '练习专区', icon: 'dashboard', affix: true, activeMenu: '/training/List' } } ] }, @@ -187,7 +187,35 @@ export const dynamicRoutes = [{ path: 'index', component: () => import('@/views/trade/index.vue'), name: 'Index', - meta: { title: '练习专区', icon: 'dashboard', affix: true, activeMenu: "/training/List" } + meta: { title: '练习专区', icon: 'dashboard', affix: true, activeMenu: '/training/List' } + } + ] +}, +{ + path: '/teachingPlan', + component: Layout, + hidden: false, + permissions: ['system:user:edit'], + children: [ + { + path: 'case', + component: () => import('@/views/teachingpan/index.vue'), + name: 'teachingPlan', + meta: { title: '实训教案', icon: 'dashboard', affix: true, activeMenu: '/teachingPlan/case' } + } + ] +}, +{ + path: '/quotation', + component: Layout, + hidden: false, + permissions: ['system:user:edit'], + children: [ + { + path: 'lowcore', + component: () => import('@/views/quotation/index.vue'), + name: 'lowcore', + meta: { title: '行情中心', icon: 'dashboard', affix: true, activeMenu: '/teachingPlan/case' } } ] }, @@ -266,8 +294,8 @@ export const dynamicRoutes = [{ } ] // 防止连续点击多次路由报错 -let routerPush = Router.prototype.push; -let routerReplace = Router.prototype.replace; +const routerPush = Router.prototype.push +const routerReplace = Router.prototype.replace // push Router.prototype.push = function push(location) { return routerPush.call(this, location).catch(err => err) diff --git a/ruoyi-ui/src/store/modules/settings.js b/ruoyi-ui/src/store/modules/settings.js index af0eee4..e193f1a 100644 --- a/ruoyi-ui/src/store/modules/settings.js +++ b/ruoyi-ui/src/store/modules/settings.js @@ -1,9 +1,9 @@ import defaultSettings from '@/settings' const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dynamicTitle } = defaultSettings - -const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || '' -// const storageSetting = '' +// tagsView, +// const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || '' +const storageSetting = '' const state = { title: '', theme: storageSetting.theme || '#409EFF', @@ -27,7 +27,7 @@ const actions = { // 修改布局设置 changeSetting({ commit }, data) { commit('CHANGE_SETTING', data) - }, + } // 设置网页标题 // setTitle({ commit }, title) { // state.title = title diff --git a/ruoyi-ui/src/utils/request.js b/ruoyi-ui/src/utils/request.js index 3c56857..f4d0490 100644 --- a/ruoyi-ui/src/utils/request.js +++ b/ruoyi-ui/src/utils/request.js @@ -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:8800", - baseURL:"http://192.168.2.14:8800", + baseURL: "http://118.31.7.2:8800", + // baseURL:"http://192.168.2.14:8800", // baseURL: process.env.VUE_APP_BASE_API, // 超时 timeout: 200000 @@ -61,46 +61,46 @@ service.interceptors.request.use(config => { } return config }, error => { - console.log(error) - Promise.reject(error) + console.log(error) + Promise.reject(error) }) // 响应拦截器 service.interceptors.response.use(res => { - // 未设置状态码则默认成功状态 - const code = res.data.code || 200; - // 获取错误信息 - const msg = errorCode[code] || res.data.msg || errorCode['default'] - // 二进制数据则直接返回 - if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') { - return res.data - } - if (code === 401) { - if (!isRelogin.show) { - isRelogin.show = true; - MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { - isRelogin.show = false; - // store.dispatch('LogOut').then(() => { - // location.href = '/index'; - // }) + // 未设置状态码则默认成功状态 + const code = res.data.code || 200; + // 获取错误信息 + const msg = errorCode[code] || res.data.msg || errorCode['default'] + // 二进制数据则直接返回 + if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') { + return res.data + } + if (code === 401) { + if (!isRelogin.show) { + isRelogin.show = true; + MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { + isRelogin.show = false; + // store.dispatch('LogOut').then(() => { + // location.href = '/index'; + // }) }).catch(() => { isRelogin.show = false; }); } - return Promise.reject('无效的会话,或者会话已过期,请重新登录。') - } else if (code === 500) { - Message({ message: msg, type: 'error' }) - return Promise.reject(new Error(msg)) - } else if (code === 601) { - Message({ message: msg, type: 'warning' }) - return Promise.reject('error') - } else if (code !== 200) { - Notification.error({ title: msg }) - return Promise.reject('error') - } else { - return res.data - } - }, + return Promise.reject('无效的会话,或者会话已过期,请重新登录。') + } else if (code === 500) { + Message({ message: msg, type: 'error' }) + return Promise.reject(new Error(msg)) + } else if (code === 601) { + Message({ message: msg, type: 'warning' }) + return Promise.reject('error') + } else if (code !== 200) { + Notification.error({ title: msg }) + return Promise.reject('error') + } else { + return res.data + } +}, error => { console.log('err' + error) let { message } = error; diff --git a/ruoyi-ui/src/views/PracticeZone/index.vue b/ruoyi-ui/src/views/PracticeZone/index.vue index 54300ea..2d0512d 100644 --- a/ruoyi-ui/src/views/PracticeZone/index.vue +++ b/ruoyi-ui/src/views/PracticeZone/index.vue @@ -1,17 +1,17 @@ - \ No newline at end of file + diff --git a/ruoyi-ui/src/views/index.vue b/ruoyi-ui/src/views/index.vue index 9dcfafe..7c75006 100644 --- a/ruoyi-ui/src/views/index.vue +++ b/ruoyi-ui/src/views/index.vue @@ -1,18 +1,20 @@ \ No newline at end of file + diff --git a/ruoyi-ui/src/views/login.vue b/ruoyi-ui/src/views/login.vue index 7830656..833ce9a 100644 --- a/ruoyi-ui/src/views/login.vue +++ b/ruoyi-ui/src/views/login.vue @@ -3,52 +3,52 @@
-
- +
@@ -149,53 +142,53 @@ export default { colseDialogVisible: false, tableData: [ { - ranking: "euresd", - class: "1612167713", + ranking: 'euresd', + class: '1612167713', name: 1, - StudentID: "2003001", - profit: "+20000", - income: "50%", - number: "8", - Simulation: "80", - experiment: "70", + StudentID: '2003001', + profit: '+20000', + income: '50%', + number: '8', + Simulation: '80', + experiment: '70' }, { - ranking: "euresd", - class: "1612167713", + ranking: 'euresd', + class: '1612167713', name: 0, - StudentID: "2003001", - profit: "+20000", - income: "20%", - number: "8", - Simulation: "80", - experiment: "70", + StudentID: '2003001', + profit: '+20000', + income: '20%', + number: '8', + Simulation: '80', + experiment: '70' }, { - ranking: "euresd", - class: "1612167713", + ranking: 'euresd', + class: '1612167713', name: 0, - StudentID: "2003001", - profit: "+20000", - income: "20%", - number: "8", - Simulation: "80", - experiment: "-70", + StudentID: '2003001', + profit: '+20000', + income: '20%', + number: '8', + Simulation: '80', + experiment: '-70' }, { - ranking: "euresd", - class: "1612167713", + ranking: 'euresd', + class: '1612167713', name: 1, - StudentID: "2003001", - profit: "+20000", - income: "20%", - number: "8", - Simulation: "80", - experiment: "70", - }, - ], - }; - }, -}; + StudentID: '2003001', + profit: '+20000', + income: '20%', + number: '8', + Simulation: '80', + experiment: '70' + } + ] + } + } +} \ No newline at end of file + diff --git a/ruoyi-ui/src/views/trade/components/deals.vue b/ruoyi-ui/src/views/trade/components/deals.vue index 9b72e75..6410eb5 100644 --- a/ruoyi-ui/src/views/trade/components/deals.vue +++ b/ruoyi-ui/src/views/trade/components/deals.vue @@ -1,114 +1,127 @@ - - \ No newline at end of file + + + diff --git a/ruoyi-ui/src/views/trade/components/numberTransactions.vue b/ruoyi-ui/src/views/trade/components/numberTransactions.vue new file mode 100644 index 0000000..280623d --- /dev/null +++ b/ruoyi-ui/src/views/trade/components/numberTransactions.vue @@ -0,0 +1,130 @@ + + + + diff --git a/ruoyi-ui/src/views/trade/components/orders.vue b/ruoyi-ui/src/views/trade/components/orders.vue index d653017..e81b841 100644 --- a/ruoyi-ui/src/views/trade/components/orders.vue +++ b/ruoyi-ui/src/views/trade/components/orders.vue @@ -1,165 +1,153 @@ + + + + 平 仓 + 取 消 + + + + + \ No newline at end of file + diff --git a/ruoyi-ui/src/views/trade/components/quotation.vue b/ruoyi-ui/src/views/trade/components/quotation.vue new file mode 100644 index 0000000..35f6703 --- /dev/null +++ b/ruoyi-ui/src/views/trade/components/quotation.vue @@ -0,0 +1,128 @@ + + + + diff --git a/ruoyi-ui/src/views/trade/holding.vue b/ruoyi-ui/src/views/trade/holding.vue index 306733d..3047eed 100644 --- a/ruoyi-ui/src/views/trade/holding.vue +++ b/ruoyi-ui/src/views/trade/holding.vue @@ -6,30 +6,24 @@ label="交易品种" width="100" align="center" - > - - - - + /> + + - - - - - - - - + /> + + + + - 交易 + 交易 - + + :id="id" + /> + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + +
+ + 确定 + 取消 + +
\ No newline at end of file +::v-deep .price { + max-width: calc(100% - 136px); + min-height: 60px; + background: #f2f3f4; + border-radius: 4px; + margin-left: 20px; + text-align: center; + line-height: 60px; + font-size: 18px; + font-family: Microsoft YaHei; + font-weight: bold; + color: #1d2129; +} + diff --git a/ruoyi-ui/src/views/trade/index.vue b/ruoyi-ui/src/views/trade/index.vue index 096d208..da98fa0 100644 --- a/ruoyi-ui/src/views/trade/index.vue +++ b/ruoyi-ui/src/views/trade/index.vue @@ -1,62 +1,61 @@ \ No newline at end of file + diff --git a/ruoyi-ui/src/views/trade/strike.vue b/ruoyi-ui/src/views/trade/strike.vue index 8052b3f..3a65ade 100644 --- a/ruoyi-ui/src/views/trade/strike.vue +++ b/ruoyi-ui/src/views/trade/strike.vue @@ -1,6 +1,6 @@ \ No newline at end of file +