yujialong 2 months ago
parent c0299db074
commit 0ca09ffa98
  1. 4
      .env
  2. 84
      src/components/Panel/index.vue
  3. 2
      src/utils/request.ts
  4. 2
      src/views/report/Index.vue

@ -2,8 +2,8 @@ VITE_APP_TITLE=金融产品设计及数字化营销沙盘
VITE_PORT=9520 VITE_PORT=9520
# VITE_PROXY=http://192.168.31.125:8080 # VITE_PROXY=http://192.168.31.125:8080
VITE_PUBLIC_PATH=./ VITE_PUBLIC_PATH=./
# VITE_BASE_API=http://192.168.31.51:9000 VITE_BASE_API=http://192.168.31.51:9000
VITE_BASE_API=http://121.37.12.51 # VITE_BASE_API=http://121.37.12.51
# VITE_BASE_API=https://www.occupationlab.com # VITE_BASE_API=https://www.occupationlab.com
VITE_I18N_LOCALE=zh-cn VITE_I18N_LOCALE=zh-cn
VITE_I18N_FALLBACK_LOCALE=zh-cn VITE_I18N_FALLBACK_LOCALE=zh-cn

@ -1,5 +1,5 @@
<template> <template>
<div v-if="!hidePanel" :class="['panel', { active: visible }]" id="panel" ref="container" :style="style"> <div v-if="!hidePanel" :class="['panel', { active: visible }]" id="panel" ref="container" :style="style" v-loading="loading">
<el-container class="scrollbar" id="container" v-show="visible"> <el-container class="scrollbar" id="container" v-show="visible">
<el-header class="panel-header" id="panelHeader"> <el-header class="panel-header" id="panelHeader">
<div class="project"> <div class="project">
@ -130,7 +130,7 @@
<el-icon class="cursor-pointer" color="#f1772b" :size="24"> <el-icon class="cursor-pointer" color="#f1772b" :size="24">
<Rank id="toggle" /> <Rank id="toggle" />
</el-icon> </el-icon>
<div class="toggle-panel w-[40px] h-[175px] bg-[length:100%_100%] bg-no-repeat cursor-pointer" :class="{ active: visible }" ref="handle" @click="visible = !visible"></div> <div class="toggle-panel w-[40px] h-[175px] bg-[length:100%_100%] bg-no-repeat cursor-pointer" :class="{ active: visible }" ref="handle" @click="pannelToggle"></div>
</div> </div>
</div> </div>
<div v-if="isSubmit && !isReport" class="z-[199] fixed top-[64px] right-0 bottom-0 left-0 bg-[rgba(0,0,0,.3)]"></div> <div v-if="isSubmit && !isReport" class="z-[199] fixed top-[64px] right-0 bottom-0 left-0 bg-[rgba(0,0,0,.3)]"></div>
@ -150,7 +150,7 @@ import Cookies from 'js-cookie';
import { mavonEditor } from 'mavon-editor'; import { mavonEditor } from 'mavon-editor';
import 'mavon-editor/dist/css/index.css'; import 'mavon-editor/dist/css/index.css';
import '@vueup/vue-quill/dist/vue-quill.snow.css'; import '@vueup/vue-quill/dist/vue-quill.snow.css';
import { useDraggable } from '@vueuse/core'; import { useDraggable, useWindowSize, Position } from '@vueuse/core';
import { logout } from '@/store/useCurrentUser'; import { logout } from '@/store/useCurrentUser';
import { getNow } from '@/utils/common'; import { getNow } from '@/utils/common';
@ -180,20 +180,23 @@ const judgmentId = ref<string | number>('');
const curReq = ref<Record<string, any>[]>([]); const curReq = ref<Record<string, any>[]>([]);
const taskList = ref<Record<string, any>[]>([]); const taskList = ref<Record<string, any>[]>([]);
const pannelTab = ref<string>('first'); const pannelTab = ref<string>('first');
const loading = ref<boolean>(false);
const submiting = ref<boolean>(false); const submiting = ref<boolean>(false);
const reportId = ref<string | number>(''); const reportId = ref<string | number>('');
const countVal = ref<any>(''); const countVal = ref<any>('');
const getLevel = ref(); const getLevel = ref();
const container = ref<HTMLElement | null>(null); const container = ref<HTMLElement | null>(null);
const handle = ref<HTMLElement | null>(null); const handle = ref<HTMLElement | null>(null);
const { width, height } = useWindowSize();
// //
const { x, y, style } = useDraggable(container, { const { x, y, style } = useDraggable(container, {
initialValue: { x: 0, y: 200 }, initialValue: { x: 0, y: 200 },
stopPropagation: true, stopPropagation: true,
handle: handle.value, handle: handle.value,
onStart(position, e) { onStart: (p: Position, e: PointerEvent): boolean => {
const { id } = e.target; const { id } = e.target;
if (id !== 'panelHeader' && id !== 'toggle') return false; if (id !== 'panelHeader' && id !== 'toggle') return false;
return true;
}, },
}); });
@ -507,6 +510,11 @@ let reloadConfirm = async () => {
}); });
} }
}; };
let pannelToggle = () => {
visible.value = !visible.value;
x.value = 0;
y.value = 200;
};
// //
let submit = async () => { let submit = async () => {
if (!submiting.value) { if (!submiting.value) {
@ -597,37 +605,42 @@ let confirmSubmit = () => {
// //
let getProDetail = async () => { let getProDetail = async () => {
const res = await getProjectDetail({ loading.value = true;
projectId: param.projectId, try {
stuAssessent: 1, const res = await getProjectDetail({
}); projectId: param.projectId,
const pointsList = res.projectJudgmentVos; stuAssessent: 1,
const project = res.projectManage; });
Cookies.set('sand-projectId', param.projectId); const pointsList = res.projectJudgmentVos;
// / const project = res.projectManage;
if (per.value) { Cookies.set('sand-projectId', param.projectId);
projectList.value = [ // /
{ if (per.value) {
projectId: param.projectId, projectList.value = [
projectName: project.projectName, {
}, projectId: param.projectId,
]; projectName: project.projectName,
} },
curReq.value = pointsList.map((e) => e.judgmentId); // judgmentIditem ];
points.value = pointsList; }
taskList.value = isSubmit.value ? JSON.parse(localStorage.getItem('sand-taskList')) : pointsList; // curReq.value = pointsList.map((e) => e.judgmentId); // judgmentIditem
grade.value = isSubmit.value ? Cookies.get('sand-score') : '00'; points.value = pointsList;
judgmentId.value = pointsList[0].judgmentId; // taskList.value = isSubmit.value ? JSON.parse(localStorage.getItem('sand-taskList')) : pointsList; //
pd.value = project; grade.value = isSubmit.value ? Cookies.get('sand-score') : '00';
curSystemId.value = project.systemId; judgmentId.value = pointsList[0].judgmentId; //
hintOpen.value = project.founder ? !project.hintOpenBySchool : !project.hintOpen; // 01 pd.value = project;
const isPrac = per.value === 0; // curSystemId.value = project.systemId;
text.value = isPrac ? '已用' : '剩余'; hintOpen.value = project.founder ? !project.hintOpenBySchool : !project.hintOpen; // 01
// const isPrac = per.value === 0; //
if (!param.competitionId && !isSubmit.value) { text.value = isPrac ? '已用' : '剩余';
const now = await getNow(); //
countVal.value = (isPrac ? now - entryTime.value : new Date(param.stopTime).getTime() - now) / 1000; // if (!param.competitionId && !isSubmit.value) {
startCount(); const now = await getNow();
countVal.value = (isPrac ? now - entryTime.value : new Date(param.stopTime).getTime() - now) / 1000; //
startCount();
}
} finally {
loading.value = false;
} }
}; };
@ -722,6 +735,7 @@ onMounted(init);
onUnmounted(() => { onUnmounted(() => {
counter = null; counter = null;
submit = null; submit = null;
pannelToggle = null;
setHeartbeatDetection = null; setHeartbeatDetection = null;
getProDetail = null; getProDetail = null;
getCache = null; getCache = null;

@ -5,7 +5,7 @@ import { logout } from '@/store/useCurrentUser';
const service = axios.create({ const service = axios.create({
baseURL: import.meta.env.VITE_BASE_API, baseURL: import.meta.env.VITE_BASE_API,
timeout: 10000, timeout: 60 * 1000,
}); });
let logouted = 0; let logouted = 0;
service.interceptors.request.use( service.interceptors.request.use(

@ -200,7 +200,7 @@ const getData = async () => {
data: JSON.stringify(res.userScores), data: JSON.stringify(res.userScores),
}); });
} else { } else {
handleList(res.userScores); handleList(JSON.parse(data));
} }
} finally { } finally {
loading.value = false; loading.value = false;

Loading…
Cancel
Save