From a16f29184b48d3351e500ae50e4770389bc21574 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Tue, 14 May 2024 11:37:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=A3=8E=E6=8E=A7=E9=87=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E5=A2=9E=E7=AD=96=E7=95=A5=E7=9A=84?= =?UTF-8?q?=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system.ts | 1 + src/api/user.ts | 31 ---- src/components/Panel/index.vue | 12 +- src/utils/auth.ts | 1 + src/utils/request.ts | 3 +- src/views/Home.vue | 4 +- src/views/product/afterLoan/1029/Index.vue | 21 ++- src/views/product/afterLoan/1030/Index.vue | 21 ++- src/views/product/afterLoan/1031/Index.vue | 21 ++- src/views/product/afterLoan/1032/Index.vue | 21 ++- src/views/product/afterLoan/1033/Index.vue | 21 ++- src/views/product/bank/Config.vue | 144 ++++++++++++++----- src/views/product/interestRate/772/Index.vue | 21 ++- src/views/product/interestRate/935/Index.vue | 21 ++- src/views/product/interestRate/936/Index.vue | 21 ++- src/views/product/strategy/150/Index.vue | 17 ++- src/views/product/strategy/151/Index.vue | 21 ++- src/views/product/strategy/152/Index.vue | 21 ++- src/views/product/strategy/153/Index.vue | 21 ++- src/views/product/strategy/154/Index.vue | 21 ++- src/views/product/strategy/155/Index.vue | 21 ++- src/views/product/strategy/156/Index.vue | 21 ++- src/views/product/strategy/512/Index.vue | 21 ++- src/views/product/strategy/513/Index.vue | 21 ++- 24 files changed, 377 insertions(+), 172 deletions(-) delete mode 100644 src/api/user.ts diff --git a/src/api/system.ts b/src/api/system.ts index 5a64ee3..85084b4 100644 --- a/src/api/system.ts +++ b/src/api/system.ts @@ -17,3 +17,4 @@ export const editExperimentalData = async (data: Record): Promise): Promise => (await axios.get('/python/python/getStartTime', { params })).data; export const getCurrentTime = async (): Promise => (await axios.get('/competition/competition/management/getCurrentTime')).data; export const heartbeatDetection = async (): Promise => (await axios.get('/nakadai/message/heartbeatDetection')).data; +export const initData = async (data: Record): Promise => (await axios.post(`/product/product/bank/operation/initData`, data)).data; diff --git a/src/api/user.ts b/src/api/user.ts deleted file mode 100644 index 38a389c..0000000 --- a/src/api/user.ts +++ /dev/null @@ -1,31 +0,0 @@ -import axios from '@/utils/request'; - -export const queryOrgList = async (params?: Record): Promise => (await axios.get('/backend/core/org', { params })).data; -export const queryOrg = async (id: number): Promise => (await axios.get(`/backend/core/org/${id}`)).data; -export const createOrg = async (data: Record): Promise => (await axios.post('/backend/core/org', data)).data; -export const updateOrg = async (data: Record): Promise => (await axios.post('/backend/core/org?_method=put', data)).data; -export const updateOrgOrder = async (data: number[]): Promise => (await axios.post('/backend/core/org/order?_method=put', data)).data; -export const deleteOrg = async (data: number[]): Promise => (await axios.post('/backend/core/org?_method=delete', data)).data; - -export const queryRoleList = async (params?: Record): Promise => (await axios.get('/backend/core/role', { params })).data; -export const queryRole = async (id: number): Promise => (await axios.get(`/backend/core/role/${id}`)).data; -export const createRole = async (data: Record): Promise => (await axios.post('/backend/core/role', data)).data; -export const updateRole = async (data: Record): Promise => (await axios.post('/backend/core/role?_method=put', data)).data; -export const updateRoleOrder = async (data: number[]): Promise => (await axios.post('/backend/core/role/order?_method=put', data)).data; -export const deleteRole = async (data: number[]): Promise => (await axios.post('/backend/core/role?_method=delete', data)).data; - -export const queryGroupList = async (params?: Record): Promise => (await axios.get('/backend/core/group', { params })).data; -export const queryGroup = async (id: number): Promise => (await axios.get(`/backend/core/group/${id}`)).data; -export const createGroup = async (data: Record): Promise => (await axios.post('/backend/core/group', data)).data; -export const updateGroup = async (data: Record): Promise => (await axios.post('/backend/core/group?_method=put', data)).data; -export const updateGroupOrder = async (data: number[]): Promise => (await axios.post('/backend/core/group/order?_method=put', data)).data; -export const deleteGroup = async (data: number[]): Promise => (await axios.post('/backend/core/group?_method=delete', data)).data; - -export const queryUserPage = async (params?: Record): Promise => (await axios.get('/backend/core/user', { params })).data; -export const queryUser = async (id: number): Promise => (await axios.get(`/backend/core/user/${id}`)).data; -export const createUser = async (data: Record): Promise => (await axios.post('/backend/core/user', data)).data; -export const updateUser = async (data: Record): Promise => (await axios.post('/backend/core/user?_method=put', data)).data; -export const deleteUser = async (data: number[]): Promise => (await axios.post('/backend/core/user?_method=delete', data)).data; -export const usernameValidation = async (username?: string): Promise => (await axios.get('/backend/core/user/username-validation', { params: { username } })).data; -export const emailValidation = async (email?: string): Promise => (await axios.get('/backend/core/user/email-validation', { params: { email } })).data; -export const mobileValidation = async (mobile?: string): Promise => (await axios.get('/backend/core/user/mobile-validation', { params: { mobile } })).data; diff --git a/src/components/Panel/index.vue b/src/components/Panel/index.vue index 2ff7b12..d80fa6e 100644 --- a/src/components/Panel/index.vue +++ b/src/components/Panel/index.vue @@ -224,7 +224,7 @@ import { ref, reactive, onMounted, inject, computed, watch, onUnmounted } from 'vue'; import { submitOpe } from '@/api/bank'; import { getSandTableLastCache, deleteOperationData } from '@/api/judgment'; -import { getProjectBySystemId, getProjectDetail, getDetailById, getCompetition, getStartTime, heartbeatDetection } from '@/api/system'; +import { getProjectBySystemId, getProjectDetail, getDetailById, getCompetition, getStartTime, heartbeatDetection, initData } from '@/api/system'; import Settings from '@/settings'; import { useRouter, useRoute, beforeRouteLeave } from 'vue-router'; import type { Action } from 'element-plus'; @@ -493,8 +493,18 @@ let setNewProject = (reloadPage?: number) => { } } }; +// 初始化数据 +const initBuiltInData = async () => { + await initData({ + assessmentId: param.assessmentId, + cid: param.cid, + competitionId: param.competitionId, + projectId: param.projectId, + }); +}; // 项目选择回调 let getCache = async (reloadPage?: number) => { + initBuiltInData(); // 查询该项目是否有缓存记录 const res = await getSandTableLastCache({ cid: param.cid, diff --git a/src/utils/auth.ts b/src/utils/auth.ts index c785dc9..a09fcb3 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -24,6 +24,7 @@ export const removeParam = (): void => { Cookies.remove('sand-systemId'); Cookies.remove('sand-level'); Cookies.remove('sand-submit'); + Cookies.remove('sand-loaded'); }; export const getAuthHeaders = (): any => { diff --git a/src/utils/request.ts b/src/utils/request.ts index df8fa2f..f0163f1 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -23,7 +23,8 @@ service.interceptors.response.use( if (status === 200) { return res; } - message === '无缓存' || ElMessage.error(message); + + ElMessage.error(message); } else { return res; } diff --git a/src/views/Home.vue b/src/views/Home.vue index b955052..654ca9d 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -129,9 +129,7 @@ const move = (dir: string) => { if (dir === 'up' || dir === 'down') param.top = el.scrollTop + (dir === 'up' ? -150 : 150); el.scrollTo(param); }; -onMounted(() => { - getLevel(); -}); +onMounted(getLevel);