yujialong 2 months ago
parent c0299db074
commit 0ca09ffa98
  1. 4
      .env
  2. 22
      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_PROXY=http://192.168.31.125:8080
VITE_PUBLIC_PATH=./
# VITE_BASE_API=http://192.168.31.51:9000
VITE_BASE_API=http://121.37.12.51
VITE_BASE_API=http://192.168.31.51:9000
# VITE_BASE_API=http://121.37.12.51
# VITE_BASE_API=https://www.occupationlab.com
VITE_I18N_LOCALE=zh-cn
VITE_I18N_FALLBACK_LOCALE=zh-cn

@ -1,5 +1,5 @@
<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-header class="panel-header" id="panelHeader">
<div class="project">
@ -130,7 +130,7 @@
<el-icon class="cursor-pointer" color="#f1772b" :size="24">
<Rank id="toggle" />
</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 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 'mavon-editor/dist/css/index.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 { getNow } from '@/utils/common';
@ -180,20 +180,23 @@ const judgmentId = ref<string | number>('');
const curReq = ref<Record<string, any>[]>([]);
const taskList = ref<Record<string, any>[]>([]);
const pannelTab = ref<string>('first');
const loading = ref<boolean>(false);
const submiting = ref<boolean>(false);
const reportId = ref<string | number>('');
const countVal = ref<any>('');
const getLevel = ref();
const container = ref<HTMLElement | null>(null);
const handle = ref<HTMLElement | null>(null);
const { width, height } = useWindowSize();
//
const { x, y, style } = useDraggable(container, {
initialValue: { x: 0, y: 200 },
stopPropagation: true,
handle: handle.value,
onStart(position, e) {
onStart: (p: Position, e: PointerEvent): boolean => {
const { id } = e.target;
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 () => {
if (!submiting.value) {
@ -597,6 +605,8 @@ let confirmSubmit = () => {
//
let getProDetail = async () => {
loading.value = true;
try {
const res = await getProjectDetail({
projectId: param.projectId,
stuAssessent: 1,
@ -629,6 +639,9 @@ let getProDetail = async () => {
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(() => {
counter = null;
submit = null;
pannelToggle = null;
setHeartbeatDetection = null;
getProDetail = null;
getCache = null;

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

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

Loading…
Cancel
Save