From e2c1376608cd91c7d9e29e9884b8310e77749b65 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Fri, 1 Mar 2024 17:53:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E9=83=A8=E6=A8=A1=E5=9D=97=E7=9A=84?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=96=B0=E5=A2=9E=E5=8A=A0=E4=B8=8A=E8=80=83?= =?UTF-8?q?=E6=A0=B8id=E3=80=81=E7=AB=9E=E8=B5=9Bid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 2 +- src/api/model.ts | 67 +++--- src/components/DialogForm.vue | 258 --------------------- src/components/HelloI18n.vue | 30 --- src/components/LabelTip.vue | 17 -- src/components/ListMove.vue | 27 --- src/components/Panel/index.vue | 68 +++--- src/components/QueryForm/QueryForm.vue | 59 ----- src/components/QueryForm/QueryInput.vue | 16 -- src/components/QueryForm/QueryItem.vue | 64 ----- src/components/QueryForm/index.ts | 2 - src/components/TableList/ColumnList.vue | 45 ---- src/components/TableList/ColumnSetting.vue | 40 ---- src/components/TableList/index.ts | 2 - src/components/TableList/useColumns.ts | 55 ----- src/utils/common.ts | 11 + src/views/Home.vue | 2 +- src/views/config/level/Index.vue | 2 +- src/views/finance/Bank.vue | 8 +- src/views/finance/Fund.vue | 20 +- src/views/finance/Insurance.vue | 8 +- src/views/product/bank/Add.vue | 26 +-- src/views/product/bank/CardList.vue | 6 +- src/views/product/bank/Config.vue | 3 +- src/views/product/bank/List.vue | 5 +- src/views/product/fund/Add.vue | 27 ++- src/views/product/fund/CardList.vue | 6 +- src/views/product/fund/Info.vue | 2 +- src/views/product/fund/List.vue | 5 +- src/views/product/insurance/Add.vue | 9 +- src/views/product/insurance/CardList.vue | 4 +- src/views/product/insurance/Info.vue | 2 +- src/views/product/insurance/List.vue | 5 +- src/views/product/strategy/150.vue | 5 +- src/views/product/strategy/151.vue | 36 ++- src/views/product/strategy/152.vue | 14 +- src/views/product/strategy/153.vue | 31 +-- src/views/product/strategy/154.vue | 5 +- src/views/product/strategy/155.vue | 11 +- src/views/product/strategy/156.vue | 8 +- src/views/product/strategy/CardList.vue | 4 +- src/views/product/strategy/Credit.vue | 4 - src/views/product/strategy/Risk1.vue | 6 +- src/views/product/strategy/Risk2.vue | 6 +- src/views/product/strategy/Risk3.vue | 6 +- 45 files changed, 198 insertions(+), 841 deletions(-) delete mode 100644 src/components/DialogForm.vue delete mode 100644 src/components/HelloI18n.vue delete mode 100644 src/components/LabelTip.vue delete mode 100644 src/components/ListMove.vue delete mode 100644 src/components/QueryForm/QueryForm.vue delete mode 100644 src/components/QueryForm/QueryInput.vue delete mode 100644 src/components/QueryForm/QueryItem.vue delete mode 100644 src/components/QueryForm/index.ts delete mode 100644 src/components/TableList/ColumnList.vue delete mode 100644 src/components/TableList/ColumnSetting.vue delete mode 100644 src/components/TableList/index.ts delete mode 100644 src/components/TableList/useColumns.ts diff --git a/.env b/.env index 97571e0..0c43f01 100644 --- a/.env +++ b/.env @@ -2,7 +2,7 @@ VITE_APP_TITLE=金融产品设计及数字化营销沙盘 VITE_PORT=9520 VITE_PROXY=http://192.168.31.125:8080 VITE_PUBLIC_PATH=./ -VITE_BASE_API=http://192.168.31.217:9000 +VITE_BASE_API=http://192.168.31.51:9000 # VITE_BASE_API=http://121.37.12.51 VITE_I18N_LOCALE=zh-cn VITE_I18N_FALLBACK_LOCALE=zh-cn diff --git a/src/api/model.ts b/src/api/model.ts index 6f1017c..7ba71a3 100644 --- a/src/api/model.ts +++ b/src/api/model.ts @@ -1,84 +1,81 @@ import axios from '@/utils/request'; +import { getIds } from '@/utils/common'; -export const accessStrategyGovernmentBlacklistFind = async (checkpointId: number, projectId: number): Promise => - (await axios.post(`/product/accessStrategyGovernmentBlacklist/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data; +const host = `http://192.168.31.51:9000`; + +export const accessStrategyGovernmentBlacklistFind = async (): Promise => (await axios.post(`/product/accessStrategyGovernmentBlacklist/details`, getIds())).data; export const accessStrategyGovernmentBlacklistSave = async (data: Record): Promise => (await axios.post(`/product/accessStrategyGovernmentBlacklist/saveOrUpdate`, data)).data; -export const accessStrategyEnterpriseBlacklistFind = async (checkpointId: number, projectId: number): Promise => - (await axios.post(`/product/accessStrategyEnterpriseBlacklist/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data; +export const accessStrategyEnterpriseBlacklistFind = async (): Promise => (await axios.post(`/product/accessStrategyEnterpriseBlacklist/details`, getIds())).data; export const accessStrategyEnterpriseBlacklistSave = async (data: Record): Promise => (await axios.post(`/product/accessStrategyEnterpriseBlacklist/saveOrUpdate`, data)).data; -export const accessStrategyAntiFraudStrategyFind = async (checkpointId: number, projectId: number): Promise => - (await axios.post(`/product/accessStrategyAntiFraudStrategy/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data; +export const accessStrategyAntiFraudStrategyFind = async (): Promise => (await axios.post(`/product/accessStrategyAntiFraudStrategy/details`, getIds())).data; export const accessStrategyAntiFraudStrategySave = async (data: Record): Promise => (await axios.post(`/product/accessStrategyAntiFraudStrategy/saveOrUpdate`, data)).data; -export const accessStrategyBusinessBlacklistFind = async (checkpointId: number, projectId: number): Promise => - (await axios.post(`/product/accessStrategyBusinessBlacklist/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data; +export const accessStrategyBusinessBlacklistFind = async (): Promise => (await axios.post(`/product/accessStrategyBusinessBlacklist/details`, getIds())).data; export const accessStrategyBusinessBlacklistSave = async (data: Record): Promise => (await axios.post(`/product/accessStrategyBusinessBlacklist/saveOrUpdate`, data)).data; -export const accessStrategyCreditBlacklistFind = async (checkpointId: number, projectId: number): Promise => - (await axios.post(`/product/accessStrategyCreditBlacklist/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data; +export const accessStrategyCreditBlacklistFind = async (): Promise => (await axios.post(`/product/accessStrategyCreditBlacklist/details`, getIds())).data; export const accessStrategyCreditBlacklistSave = async (data: Record): Promise => (await axios.post(`/product/accessStrategyCreditBlacklist/saveOrUpdate`, data)).data; -export const accessStrategyInlineBlacklistFind = async (checkpointId: number, projectId: number): Promise => - (await axios.post(`/product/accessStrategyInlineBlacklist/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data; +export const accessStrategyInlineBlacklistFind = async (): Promise => (await axios.post(`/product/accessStrategyInlineBlacklist/details`, getIds())).data; export const accessStrategyInlineBlacklistSave = async (data: Record): Promise => (await axios.post(`/product/accessStrategyInlineBlacklist/saveOrUpdate`, data)).data; -export const accessStrategyNegativeIndustryStrategyFind = async (checkpointId: number, projectId: number): Promise => - (await axios.post(`/product/accessStrategyNegativeIndustryStrategy/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data; +export const accessStrategyNegativeIndustryStrategyFind = async (): Promise => (await axios.post(`/product/accessStrategyNegativeIndustryStrategy/details`, getIds())).data; export const accessStrategyNegativeIndustryStrategySave = async (data: Record): Promise => (await axios.post(`/product/accessStrategyNegativeIndustryStrategy/saveOrUpdate`, data)).data; export const delCredit = async (id: number): Promise => (await axios.post(`/product/creditScoringStrategy/delete?strategyId=${id}`)).data; export const findCredit = async (id: number): Promise => (await axios.post(`/product/creditScoringStrategy/details?strategyId=${id}`)).data; export const listCredit = async (data: Record): Promise => - (await axios.post(`/product/creditScoringStrategy/list?checkpointId=${data.checkpointId}&projectId=${data.projectId}&pageNum=${data.pageNum}&pageSize=${data.pageSize}`)).data; + ( + await axios.post(`/product/creditScoringStrategy/list`, { + ...data, + ...getIds(), + }) + ).data; export const saveCredit = async (data: Record): Promise => (await axios.post(`/product/creditScoringStrategy/saveOrUpdate`, data)).data; -export const detailRick = async (data: Record): Promise => - (await axios.post(`/product/riskDegreeStrategy/details?checkpointId=${data.checkpointId}&projectId=${data.projectId}&type=${data.type}`)).data; +export const detailRick = async (type: number): Promise => + ( + await axios.post(`/product/riskDegreeStrategy/details`, { + ...getIds(), + type, + }) + ).data; export const saveRick = async (data: Record): Promise => (await axios.post(`/product/riskDegreeStrategy/saveOrUpdate`, data)).data; -export const businessInterestRateDetails = async (checkpointId: number, projectId: number): Promise => - (await axios.post(`/product/interestRateModel/businessInterestRateDetails?checkpointId=${checkpointId}&projectId=${projectId}`)).data; +export const businessInterestRateDetails = async (): Promise => (await axios.post(`/product/interestRateModel/businessInterestRateDetails`, getIds())).data; export const businessInterestRateSaveOrUpdate = async (data: Record): Promise => (await axios.post(`/product/interestRateModel/businessInterestRateSaveOrUpdate`, data)).data; -export const personalInterestRateDetails = async (checkpointId: number, projectId: number): Promise => - (await axios.post(`/product/interestRateModel/personalInterestRateDetails?checkpointId=${checkpointId}&projectId=${projectId}`)).data; +export const personalInterestRateDetails = async (): Promise => (await axios.post(`/product/interestRateModel/personalInterestRateDetails`, getIds())).data; export const personalInterestRateSaveOrUpdate = async (data: Record): Promise => (await axios.post(`/product/interestRateModel/personalInterestRateSaveOrUpdate`, data)).data; -export const businessQuotaModelDetails = async (checkpointId: number, projectId: number): Promise => - (await axios.post(`/product/quotaModel/businessQuotaModelDetails?checkpointId=${checkpointId}&projectId=${projectId}`)).data; +export const businessQuotaModelDetails = async (): Promise => (await axios.post(`/product/quotaModel/businessQuotaModelDetails`, getIds())).data; export const businessQuotaModelSaveOrUpdate = async (data: Record): Promise => (await axios.post(`/product/quotaModel/businessQuotaModelSaveOrUpdate`, data)).data; -export const personalCreditModelDetails = async (checkpointId: number, projectId: number): Promise => - (await axios.post(`/product/quotaModel/personalCreditModelDetails?checkpointId=${checkpointId}&projectId=${projectId}`)).data; +export const personalCreditModelDetails = async (): Promise => (await axios.post(`/product/quotaModel/personalCreditModelDetails`, getIds())).data; export const personalCreditModelSaveOrUpdate = async (data: Record): Promise => (await axios.post(`/product/quotaModel/personalCreditModelSaveOrUpdate`, data)).data; -export const fiveLevelClassificationDetails = async (checkpointId: number, projectId: number): Promise => - (await axios.post(`/product/fiveLevelClassification/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data; +export const fiveLevelClassificationDetails = async (): Promise => (await axios.post(`/product/fiveLevelClassification/details`, getIds())).data; export const fiveLevelClassificationSave = async (data: Record): Promise => (await axios.post(`/product/fiveLevelClassification/saveOrUpdate`, data)).data; -export const postLoanInspectionDetails = async (checkpointId: number, projectId: number): Promise => - (await axios.post(`/product/postLoanInspection/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data; +export const postLoanInspectionDetails = async (): Promise => (await axios.post(`/product/postLoanInspection/details`, getIds())).data; export const postLoanInspectionSave = async (data: Record): Promise => (await axios.post(`/product/postLoanInspection/saveOrUpdate`, data)).data; -export const postCreditScoreDetails = async (checkpointId: number, projectId: number): Promise => - (await axios.post(`/product/postCreditScore/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data; +export const postCreditScoreDetails = async (): Promise => (await axios.post(`/product/postCreditScore/details`, getIds())).data; export const postCreditScoreSave = async (data: Record): Promise => (await axios.post(`/product/postCreditScore/saveOrUpdate`, data)).data; -export const postLoanWarningDetails = async (checkpointId: number, projectId: number): Promise => - (await axios.post(`/product/postLoanWarning/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data; +export const postLoanWarningDetails = async (): Promise => (await axios.post(`/product/postLoanWarning/details`, getIds())).data; export const postLoanWarningSave = async (data: Record): Promise => (await axios.post(`/product/postLoanWarning/saveOrUpdate`, data)).data; -export const collectionAfterLoanDetails = async (checkpointId: number, projectId: number): Promise => - (await axios.post(`/product/collectionAfterLoan/details?checkpointId=${checkpointId}&projectId=${projectId}`)).data; +export const collectionAfterLoanDetails = async (): Promise => (await axios.post(`/product/collectionAfterLoan/details`, getIds())).data; export const collectionAfterLoanSave = async (data: Record): Promise => (await axios.post(`/product/collectionAfterLoan/saveOrUpdate`, data)).data; diff --git a/src/components/DialogForm.vue b/src/components/DialogForm.vue deleted file mode 100644 index 20137c8..0000000 --- a/src/components/DialogForm.vue +++ /dev/null @@ -1,258 +0,0 @@ - - - diff --git a/src/components/HelloI18n.vue b/src/components/HelloI18n.vue deleted file mode 100644 index f4af4e1..0000000 --- a/src/components/HelloI18n.vue +++ /dev/null @@ -1,30 +0,0 @@ - - - - - -{ - "en": { - "hello": "Hello i18n in SFC!" - } -} - diff --git a/src/components/LabelTip.vue b/src/components/LabelTip.vue deleted file mode 100644 index d73f3f6..0000000 --- a/src/components/LabelTip.vue +++ /dev/null @@ -1,17 +0,0 @@ - - - diff --git a/src/components/ListMove.vue b/src/components/ListMove.vue deleted file mode 100644 index ed1c283..0000000 --- a/src/components/ListMove.vue +++ /dev/null @@ -1,27 +0,0 @@ - - - diff --git a/src/components/Panel/index.vue b/src/components/Panel/index.vue index 11fa25e..10b73fe 100644 --- a/src/components/Panel/index.vue +++ b/src/components/Panel/index.vue @@ -24,7 +24,7 @@ placeholder="请选择" class="select" :disabled="per != 0" - @change="selectProject"> + @change="getCache(1)"> (''); const getLevel = ref(); const container = ref(null); const handle = ref(null); +const isFirst = ref(true); // 实验面板拖拽 const { x, y, style } = useDraggable(container, { initialValue: { x: 0, y: 200 }, @@ -305,6 +306,7 @@ if (param.token) { Cookies.set('sand-account', param.account ?? ''); Cookies.set('sand-admin', param.admin ?? ''); // 从中台进来的标识 Cookies.remove('sand-submit'); + Cookies.remove('sand-loaded'); router.replace(route.path); } else { param.systemId = Cookies.get('sand-systemId'); @@ -387,24 +389,10 @@ const setSubmit = (val: boolean) => { }; // 获取考核列表来查询该考核是否已经考过 const getAssList = async () => { - // const { list } = await pageStuAssessment({ - // pageNum: 1, - // pageSize: 10000, - // }); - // let done = false; - // // 匹配到该考核,并且已经提交过(有reportId则说明有实验记录),并且classId跟当前用户的classId相同,就提示提交了考核然后返回上一页 - // if (list.find((e) => e.assessmentId == param.assessmentId && e.reportId && e.classId == param.classId)) { - // done = true; - // setSubmit(true); - // ElMessage.error('你已经提交过该考核!'); - // setTimeout((_) => { - // window.history.back(); // 直接返回上一页面 - // }, 1500); - // } - getProDetail(); - getAssStatus(); + await getAssStatus(); + await getProDetail(); }; -// 定时查询考核状态(查到考核如果结束后,直接提交考核) +// 查询考核状态(查到考核如果结束后,直接提交考核) const getAssStatus = async () => { // 未提交才需要查询状态 if (!isSubmit.value) { @@ -423,7 +411,7 @@ const getAssStatus = async () => { } }; -// 定时查询竞赛状态(查到竞赛如果结束后,直接提交竞赛) +// 查询竞赛状态(查到竞赛如果结束后,直接提交竞赛) const getCompetitionStatus = async () => { // 未提交才需要查询状态 if (!isSubmit.value) { @@ -470,11 +458,13 @@ const setNewProject = (reloadPage?: number) => { } }; // 项目选择回调 -const selectProject = async () => { +const getCache = async (reloadPage?: number) => { // 查询该项目是否有缓存记录 const res = await getSandTableLastCache({ cid: param.cid, projectId: param.projectId, + assessmentId: param.assessmentId, + competitionId: param.competitionId, }); // 如果有缓存 if (res.getLastCache) { @@ -484,7 +474,7 @@ const selectProject = async () => { type: 'success', }) .then(async () => { - setNewProject(1); + setNewProject(reloadPage); }) .catch(async () => { setNewProject(); @@ -495,10 +485,12 @@ const selectProject = async () => { competitionId: param.competitionId, }); // 在选择关卡的页面,直接刷新;否则调选择关卡页的获取关卡接口 - if (route.path === '/') { - location.reload(); - } else { - getLevel.value && getLevel.value(); + if (reloadPage) { + if (route.path === '/') { + location.reload(); + } else { + getLevel.value && getLevel.value(); + } } }); } else { @@ -685,24 +677,34 @@ const initSocket = () => { // 监听socket消息 socket.onmessage = getMessage; }; - -onMounted(() => { +const handleCache = () => { + visible.value && !Cookies.get('sand-loaded') && getCache(0); // 选择关卡页面才需要弹出是否恢复缓存的弹框 +}; +// 初始化 +const init = async () => { getLevel.value = inject('getLevel'); // 关卡页面获取关卡方法 per.value = param.assessmentId ? 1 : param.competitionId ? 2 : 0; param.cid && getEntryTime(); if (param.assessmentId) { - getAssList(); + // 考核 + await getAssList(); + handleCache(); + initSocket(); + } else if (param.competitionId) { + // 竞赛 + getCompetitionStatus(); + handleCache(); initSocket(); } else { + // 练习 param.cid && getList(); - if (param.competitionId) { - getCompetitionStatus(); - initSocket(); - } + handleCache(); } -}); + Cookies.set('sand-loaded', 1); +}; +onMounted(init);