Merge branch 'develop' of ssh://gitlab.dongwu-inc.com:10022/BOE/fe-stu into develop

This commit is contained in:
zhangyc
2022-12-18 22:43:27 +08:00
12 changed files with 5453 additions and 5063 deletions

5
.env
View File

@@ -1,5 +1,5 @@
VITE_BASE=/fe-student
VITE_BASE_API=/
VITE_BASE_API=
VITE_BASE_LOGIN_URL=https://u-pre.boe.com/web/
VITE_PROXY_URL=http://111.231.196.214:30001
@@ -12,4 +12,5 @@ VITE_BOE_EXAM_DETAIL_URL=https://u-pre.boe.com/pc/exam/test?id=
VITE_BOE_API_URL=https://u-pre.boe.com
VITE_TASK_WHITE_TYPE=-8-,-12-,-13-
VITE_TASK_WHITE_TYPE=-8-,-12-,-13-
# VITE_TASK_WHITE_TYPE=-8-,-12-

View File

@@ -16,7 +16,8 @@
"axios": "^1.1.3",
"core-js": "^3.26.0",
"dayjs": "^1.11.6",
"element-plus": "^2.2.20",
"element-plus": "^2.2.27",
"json-bigint": "^1.0.0",
"vue": "^3.2.45",
"vue-router": "^4.1.6",
"vuex": "^4.1.0"

9722
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -2,13 +2,13 @@
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2022-12-11 16:57:58
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2022-12-17 14:59:41
* @LastEditTime: 2022-12-18 18:37:26
* @FilePath: /fe-stu/src/api/api.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
export const LOGIN = '/admin/CheckUser/userLogin post'
// export const FILE_UPLOAD = 'http://111.231.196.214:30001/file/upload'
export const FILE_UPLOAD = import.meta.env.VITE_BASE_API + '/file/upload'
export const FILE_UPLOAD = '/file/upload'
export const COMMON_TOKEN = 'https://upload-z2.qiniup.com'
export const ROUTER_CHAPTER_LIST = '/stu/router/chapterList'
export const ROUTER_LIST = '/stu/router/list post'
@@ -18,6 +18,8 @@ export const PROJECT_PROCESS = '/stu/project/process'
export const ROUTER_UNCOMPLETE_LIST = '/stu/router/unCompleteTaskList post'
export const TAS_ACTIVITY_DETAIL = '/activity'
export const TASK_ACTIVITY_SIGN = '/stu/task/activity/sign post'
export const TASK_OFFCOURSE_NOTASK_SIGN = '/stu/task/offcourse/notask/sign post'
export const TASK_OFFCOURSE_SIGN = '/stu/task/offcourse/sign post'
export const TASK_BROADCAST_COMMIT = '/stu/task/broadcast/commit'
export const TASK_BROADCAST_DETAIL = '/liveBroadcast'
export const TASK_BROADCAST_SIGN = '/stu/task/broadcast/sign post'
@@ -51,4 +53,7 @@ export const ASSESSMENT_SUBMIT_QUERY = assessmentId => `/assessmentSubmit/queryA
export const ASSESSMENT_QUERY = assessmentId => `/stu/task/evaluate/get`
export const ASSESSMENT_SUBMIT = '/stu/task/evaluate/commit post'
export const ACTIVITY = '/activity'
export const ACTIVITY = '/activity'
export const STUDY_RECORD = '/stu/task/thirdTask/submit post'
export const PROJECT_LIST = '/stu/project/list post'

View File

@@ -2,7 +2,8 @@ import router from "@/router";
import { reactive, ref, toRefs, watch } from "vue";
import axios from 'axios';
import { getCookie } from "@/api/utils";
import JSONBigInt from 'json-bigint';
const JSONBigIntStr = JSONBigInt({ storeAsString: true });
export function usePage(_url, param) {
const state = reactive({
@@ -130,19 +131,16 @@ export async function boeRequest(_url, params) {
}
}
const body = method !== 'get' ? params || {} : {}
return axios({
url,
return fetch(url,{
method,
headers: {
headers:{
token: getCookie('token'),
...method !== 'get' ? { 'Content-Type': 'application/json' } : {}
...method !== 'get' ? {'Content-Type': 'application/json'} : {}
},
baseURL: '',
...method !== 'get' ? { data: JSON.stringify(body) } : {}
}).then(resp => resp.data).then(response => {
return response
}).catch(e => {
console.log(e)
// router.push({path: '/login'})
...method !== 'get' ? {body: JSON.stringify(body)} : {}
}).then(res=>{
return res.text()
}).then(res=>{
return JSONBigIntStr.parse(res)
})
}

View File

@@ -1,19 +1,13 @@
<!--
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2022-12-11 16:57:58
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2022-12-17 14:51:44
* @FilePath: /fe-stu/src/components/img/UploadImg.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<el-upload
:file-list="files"
:action="FILE_UPLOAD"
method="POST"
:show-file-list="false"
:on-change="handleChange"
ref="imageRef"
:file-list="files"
:action="FILE_UPLOAD"
method="POST"
:show-file-list="false"
:on-change="handleChange"
:limit="max"
ref="imageRef"
:on-exceed="exceed"
>
<template #trigger>
<div>
@@ -23,56 +17,64 @@
</el-upload>
</template>
<script setup>
import { FILE_UPLOAD } from "@/api/api";
import { defineProps, ref } from "vue";
import {FILE_UPLOAD} from "@/api/api";
import {defineProps, ref, watch} from "vue";
import {ElMessage} from "element-plus";
const { modelValue = [] } = defineProps({
modelValue: [],
});
const props = defineProps({
value: [],
max: {
type: Number,
default: 1
}
})
const emit = defineEmits();
const emit = defineEmits()
const files = ref(modelValue);
const imageRef = ref();
const files = ref([])
const imageRef = ref()
watch(props.value, () => {
props.value.length || (files.value = props.value)
})
function exceed() {
ElMessage.error(`只能上传${props.max}个附件`);
}
function handleChange(e) {
console.log("上传", e);
if (e.response && e.response.code === 200) {
e.url = e.response.data;
e.url = e.response.data
}
const index = files.value.findIndex((f) => f.uid === e.uid);
const index = files.value.findIndex(f => f.uid === e.uid)
if (index === -1) {
files.value.unshift(e);
files.value.unshift(e)
} else {
files.value[index] = e;
files.value[index] = e
}
emit("update:modelValue", files);
emit('update:value', files.value)
}
function remove(i) {
files.value.splice(i, 1);
files.value.splice(i, 1)
}
function reUpload(i) {
if (
files.value[i].status === "ready" ||
files.value[i].status === "uploading"
) {
imageRef.value.abort(files.value[i].raw);
files.value[i].status = "abort";
} else if (
files.value[i].status === "fail" ||
files.value[i].status === "abort"
) {
imageRef.value.handleStart(files.value[i].raw);
imageRef.value.submit();
if (files.value[i].status === 'ready' || files.value[i].status === 'uploading') {
imageRef.value.abort(files.value[i].raw)
files.value[i].status = 'abort';
} else if (files.value[i].status === 'fail' || files.value[i].status === 'abort') {
imageRef.value.handleStart(files.value[i].raw)
imageRef.value.submit()
}
}
function abort(i) {
imageRef.value.abort(files.value[i].raw);
imageRef.value.abort(files.value[i].raw)
}
defineExpose({ reUpload, remove });
defineExpose({reUpload, remove})
</script>

View File

@@ -1,4 +1,12 @@
import {createApp} from 'vue'
/*
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2022-12-11 16:57:58
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2022-12-18 16:31:00
* @FilePath: /fe-stu/src/main.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

View File

@@ -52,8 +52,7 @@
class="btn"
style="margin-right: 20px"
:style="{
background:
data.signFlag || !isAllowSign ? '#999' : 'rgb(57, 146, 249)',
background: data.signFlag ? '#999' : 'rgb(57, 146, 249)',
}"
@click="signClick"
>{{ data.signFlag ? "已签到" : "签到" }}
@@ -236,13 +235,18 @@
</template>
<script setup>
import { computed, reactive, toRefs, watch } from "vue";
import { computed, reactive, toRefs, watch, onUnmounted } from "vue";
import FileTypeImg from "@/components/FileTypeImg.vue";
import { request, useRequest } from "@/api/request";
import { STU_OFFCOURSE_DETAIL } from "@/api/api";
import {
STU_OFFCOURSE_DETAIL,
TASK_OFFCOURSE_NOTASK_SIGN,
TASK_OFFCOURSE_SIGN,
TASK_BROADCAST_SIGN,
} from "@/api/api";
import { useRoute, useRouter } from "vue-router";
import { useUserInfo } from "@/api/utils";
import { ElMessage } from "element-plus";
const router = useRouter();
const returnclick = () => {
router.back();
@@ -273,56 +277,45 @@ let timer = null;
//判断能否签到
function isSignClick() {
timer = setInterval(() => {
let beginTime = new Date(data.value.planDto.beginTime).getTime();
let endTime = !data.value.planDto.afterStart
? new Date(data.value.planDto.endTime).getTime()
: new Date(data.value.planDto.beginTime).getTime();
let nowTime = new Date().getTime();
if (data.value.planDto.beforeStart && data.value.planDto.afterStart) {
//有开始前有开始后
let beginTime =
new Date(data.value.planDto.beginTime).getTime() -
data.value.planDto.beforeStart * 60 * 1000;
let endTime =
new Date(data.value.planDto.beginTime).getTime() +
data.value.planDto.afterStart * 60 * 1000;
let nowTime = new Date().getTime();
if (nowTime < endTime && nowTime > beginTime) {
state.isAllowSign = true;
} else {
state.isAllowSign = false;
}
} else if (
!data.value.planDto.beforeStart &&
!data.value.planDto.afterStart
) {
//开始前开始后都没有
state.isAllowSign = true;
beginTime = beginTime - data.value.planDto.beforeStart * 60 * 1000;
endTime = endTime + data.value.planDto.afterStart * 60 * 1000;
console.log("1111");
} else if (
data.value.planDto.beforeStart &&
!data.value.planDto.afterStart
) {
//只有开始前无开始后
let beginTime =
new Date(data.value.planDto.beginTime).getTime() -
data.value.planDto.beforeStart * 60 * 1000;
let nowTime = new Date().getTime();
if (nowTime > beginTime) {
state.isAllowSign = true;
} else {
state.isAllowSign = false;
}
beginTime = beginTime - data.value.planDto.beforeStart * 60 * 1000;
console.log("11112222");
} else if (
!data.value.planDto.beforeStart &&
data.value.planDto.afterStart
) {
//无开始前有开始后
let endTime =
new Date(data.value.planDto.beginTime).getTime() +
data.value.planDto.afterStart * 60 * 1000;
let nowTime = new Date().getTime();
if (nowTime < endTime) {
state.isAllowSign = true;
} else {
state.isAllowSign = false;
}
endTime = endTime + data.value.planDto.afterStart * 60 * 1000;
console.log("1111333");
}
console.log("isAllowSign", state.isAllowSign);
if (nowTime < endTime && nowTime > beginTime) {
state.isAllowSign = true;
} else {
state.isAllowSign = false;
}
// console.log(
// "isAllowSign",
// state.isAllowSign,
// nowTime,
// endTime,
// beginTime,
// nowTime < endTime,
// nowTime > beginTime
// );
}, 1000);
}
isSignClick();
@@ -332,14 +325,26 @@ const signClick = () => {
if (data.value.signFlag) {
return;
}
console.log("data.signFlag", data.value.signFlag);
if (!isAllowSign) {
// console.log(
// "data.signFlag",
// data.value.signFlag,
// state.isAllowSign,
// !state.isAllowSign
// );
if (!state.isAllowSign) {
// console.log("data.signFlag", data.value.signFlag, isAllowSign);
ElMessage.info("未在签到范围内");
return;
}
2;
data.value.signFlag = 1;
ElMessage.info("签到成功");
request(TASK_BROADCAST_SIGN, { courseId: courseId, taskId, type });
if (taskId) {
request(TASK_OFFCOURSE_SIGN, { courseId: courseId, taskId, type });
} else {
request(TASK_OFFCOURSE_NOTASK_SIGN, { courseId: courseId });
}
};
function toSurvery() {
@@ -378,6 +383,12 @@ function toExamItem(obj) {
window.open(import.meta.env.VITE_BOE_EXAM_DETAIL_URL + obj.examinationTestId); //测评
// router.push({ path: import.meta.env.VITE_BOE_EXAM_DETAIL_URL+ obj.examinationTestId });
}
onUnmounted(() => {
if (timer) {
clearInterval(timer);
}
});
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->

View File

@@ -57,12 +57,10 @@
</div>
</div>
</div>
<UploadImg v-model="fileList" ref="uploadRef">
<UploadImg v-model:value="fileList" ref="uploadRef">
<button
class="shangchuan"
style="cursor: pointer"
@mousemove="showFileList = 1"
@mouseout="showFileList = 0"
>
上传
</button>
@@ -197,6 +195,9 @@
"
>
{{ value.workUploadContent }}
<span style="margin-left: 10px">
<el-link target="_blank" type="primary" :href="value.workUploadAddress?.split(',')[0] || ''">{{value.workUploadAddress?.split(',')[0].split('/').at(-1)|| ''}}</el-link>
</span>
</div>
</div>
</div>
@@ -274,7 +275,7 @@
</template>
<script setup>
import { reactive, ref, toRefs } from "vue";
import {computed, reactive, ref, toRefs} from "vue";
import { request, useRequest } from "@/api/request";
import {
TASK_WORK_COMMIT,
@@ -293,7 +294,6 @@ import {ElMessage} from "element-plus";
const fileList = ref([]);
const uploadRef = ref();
const showFileList = ref(0);
const centerDialogVisible =ref(false);
const sbValue = ref({
content: "",
@@ -312,15 +312,15 @@ const { data } = useRequest(TASK_WORK_DETAIL, { workId, taskId });
const { data: submitList } = useRequest(TASK_WORK_SUBMIT_LIST, {
workerId: workId,
});
const handleClose=()=> {
router.back();
};
const open=()=>{
centerDialogVisible.value = true
};
const showFileList = computed(()=>{
return fileList.value.length
})
const handleClick = () => {
console.log(sbValue.value);
console.log(fileList);
if(!sbValue.value.content){
return ElMessage.warning("请输入作业内容");
@@ -337,6 +337,7 @@ const handleClick = () => {
open();
});
sbValue.value.content = "";
fileList.value = [];
};
function remove(i) {
@@ -485,8 +486,8 @@ function reUpload(i) {
}
.square {
width: 475px;
height: 243px;
padding-bottom: 40px;
width: 600px;
background: #ffffff;
box-shadow: 0px 1px 24px 0px rgba(0, 0, 0, 0.11);
border-radius: 8px;

View File

@@ -15,23 +15,25 @@
<div class="title">
<div class="titleL">{{ i.stageName }}</div>
<div class="titleR" :style="{ display: 'flex' }">
<img src="../../assets/image/pathdetails/circle.png"/>
<img src="../../assets/image/pathdetails/circle.png" />
<div class="titleRT">进行中</div>
</div>
<div
class="titleR"
:style="{ display: i.status === 2 ? 'flex' : 'none' }"
class="titleR"
:style="{ display: i.status === 2 ? 'flex' : 'none' }"
>
<img src="../../assets/image/pathdetails/circle2.png"/>
<img src="../../assets/image/pathdetails/circle2.png" />
<div class="titleRT" style="color: rgba(102, 102, 102, 1)">
未开始
</div>
</div>
</div>
<div
class="course"
v-for="(value, index) in i.taskProcessList.filter(e=>!whiteTypes(e.type))"
:key="index"
class="course"
v-for="(value, index) in i.taskProcessList.filter(
(e) => !whiteTypes(e.type)
)"
:key="index"
>
<div>
<div class="coursename">{{ value.name }}</div>
@@ -53,17 +55,17 @@
<!-- </div>-->
</div>
<div
class="progressBox"
:style="{ display: value.status === 1 ? 'block' : 'none' }"
class="progressBox"
:style="{ display: value.status === 1 ? 'block' : 'none' }"
>
<div>当前进度</div>
<div class="progress">
<div style="width: 291px">
<el-progress
:percentage="value.currentRatio"
:show-text="false"
:stroke-width="8"
:color="
:percentage="value.currentRatio"
:show-text="false"
:stroke-width="8"
:color="
{
0: 'rgba(238, 112, 108, 1)',
1: 'rgba(255, 151, 38, 1)',
@@ -76,13 +78,13 @@
/>
</div>
<div
style="
style="
font-size: 14px;
font-weight: 500;
color: #277aff;
margin-left: 10px;
"
:style="{
:style="{
color: {
0: 'rgba(238, 112, 108, 1)',
1: 'rgba(255, 151, 38, 1)',
@@ -98,13 +100,13 @@
</div>
</div>
</div>
<div class="goclass" @click="toFinish(value,i.name)">
<div class="goclass" @click="toFinish(value, i.name, i.stageId)">
{{
value.status === 1
? "已完成"
: types.path[value.type]
? types.toName[value.type]
: "未开放"
? "已完成"
: types.path[value.type]
? types.toName[value.type]
: "未开放"
}}
</div>
<!-- <div :style="{ display: value.status === 1 ? 'block' : 'none' }">-->
@@ -131,33 +133,33 @@
<div class="detailRT">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="课程公告" name="first">
<div class="notice">{{data}}
{{ data.remark || '暂无公告' }}
<div class="notice">
{{ data.remark || "暂无公告" }}
</div>
</el-tab-pane>
<!--
<!--
<el-tab-pane label="共享文档" name="second">
<div style="padding: 19px 30px 17px 28px">-->
<!-- <div-->
<!-- v-for="(value, index) in sharedoc"-->
<!-- :key="index"-->
<!-- style="-->
<!-- display: flex;-->
<!-- align-items: center;-->
<!-- margin-bottom: 15px;-->
<!-- "-->
<!-- >-->
<!-- <img :src="value.img" style="width: 22px; height: 26px" />-->
<!-- <div class="sharedocname">{{ value.name }}</div>-->
<!-- <div class="download">-->
<!-- <img-->
<!-- src="../../assets/image/download.png"-->
<!-- style="width: 16px; height: 15px"-->
<!-- />-->
<!-- <div style="margin-left: 7px">下载</div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>
<!-- <div-->
<!-- v-for="(value, index) in sharedoc"-->
<!-- :key="index"-->
<!-- style="-->
<!-- display: flex;-->
<!-- align-items: center;-->
<!-- margin-bottom: 15px;-->
<!-- "-->
<!-- >-->
<!-- <img :src="value.img" style="width: 22px; height: 26px" />-->
<!-- <div class="sharedocname">{{ value.name }}</div>-->
<!-- <div class="download">-->
<!-- <img-->
<!-- src="../../assets/image/download.png"-->
<!-- style="width: 16px; height: 15px"-->
<!-- />-->
<!-- <div style="margin-left: 7px">下载</div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>
</el-tab-pane>-->
</el-tabs>
</div>
@@ -167,26 +169,26 @@
<div class="info">
<div class="title">
<img
style="width: 21px; height: 20px"
src="../../assets/image/pathdetails/info.png"
style="width: 21px; height: 20px"
src="../../assets/image/pathdetails/info.png"
/>
<div class="text" style="margin-left: 7px">个人信息</div>
<div class="box"></div>
</div>
<!-- todo #路径详情 个人信息缺少img和介绍-->
<div
class="teacheritem"
:style="{ 'border-bottom': '1px solid rgba(56, 125, 247, 0.2)' }"
class="teacheritem"
:style="{ 'border-bottom': '1px solid rgba(56, 125, 247, 0.2)' }"
>
<img class="peopleimg" :src="`/upload${userInfo.avatar}`"/>
<img class="peopleimg" :src="`/upload${userInfo.avatar}`" />
<div style="margin-left: 17px">
<div class="teacherName">
<div style="margin-right: 5px">
{{ userInfo?.realName }}
</div>
<!-- <div v-for="(item, key) in data.userInfoBo?.medal" :key="key">-->
<!-- <img class="teacherMedal" :src="item"/>-->
<!-- </div>-->
<!-- <div v-for="(item, key) in data.userInfoBo?.medal" :key="key">-->
<!-- <img class="teacherMedal" :src="item"/>-->
<!-- </div>-->
</div>
<div class="introduce">{{ userInfo?.bandDesc }}</div>
</div>
@@ -195,8 +197,8 @@
<div class="info" style="padding-top: 20px">
<div class="title">
<img
style="width: 18px; height: 17px"
src="../../assets/image/pathdetails/study.png"
style="width: 18px; height: 17px"
src="../../assets/image/pathdetails/study.png"
/>
<div class="text" style="margin-left: 9px">学习进度</div>
<div class="box"></div>
@@ -207,17 +209,16 @@
<div class="ratebtn">继续学习</div>
</div>-->
<div style="margin-top: 16px">
<div class="progressBox">
<div>总进度</div>
<div class="progress">
<div style="width: 291px">
<el-progress
:percentage="data.totalChapterCnt"
:show-text="false"
:stroke-width="8"
:color="
:percentage="data.totalChapterCnt"
:show-text="false"
:stroke-width="8"
:color="
{
0: 'rgba(238, 112, 108, 1)',
1: 'rgba(255, 151, 38, 1)',
@@ -230,8 +231,8 @@
/>
</div>
<div
style="font-size: 14px; font-weight: 500; margin-left: 10px"
:style="{
style="font-size: 14px; font-weight: 500; margin-left: 10px"
:style="{
color: {
0: 'rgba(238, 112, 108, 1)',
1: 'rgba(255, 151, 38, 1)',
@@ -253,10 +254,10 @@
<div class="progress">
<div style="width: 291px">
<el-progress
:percentage="data.currentChapterCnt"
:show-text="false"
:stroke-width="8"
:color="
:percentage="data.currentChapterCnt"
:show-text="false"
:stroke-width="8"
:color="
{
0: 'rgba(238, 112, 108, 1)',
1: 'rgba(255, 151, 38, 1)',
@@ -269,13 +270,13 @@
/>
</div>
<div
style="
style="
font-size: 14px;
font-weight: 500;
color: #277aff;
margin-left: 10px;
"
:style="{
:style="{
color: {
0: 'rgba(238, 112, 108, 1)',
1: 'rgba(255, 151, 38, 1)',
@@ -301,7 +302,7 @@
</template>
<script setup>
import {computed, reactive, ref} from "vue";
import { computed, reactive, ref } from "vue";
import word from "@/assets/image/file/word.png";
import ppt from "@/assets/image/file/ppt.png";
import pdf from "@/assets/image/file/pdf.png";
@@ -311,20 +312,27 @@ import medal1 from "@/assets/image/medal/medal1.png";
import medal2 from "@/assets/image/medal/medal2.png";
import medal3 from "@/assets/image/medal/medal3.png";
import img from "@/assets/image/uploadimg.png";
import {useRequest, request} from "@/api/request";
import {PROJECT_PROCESS, ROUTER_PROCESS, LINK_DETAILS} from "@/api/api";
import {useRoute, useRouter} from "vue-router";
import { useRequest, request } from "@/api/request";
import {
PROJECT_PROCESS,
ROUTER_PROCESS,
LINK_DETAILS,
STUDY_RECORD,
} from "@/api/api";
import { useRoute, useRouter } from "vue-router";
import store from "@/store";
import {ElMessage} from "element-plus";
import { ElMessage } from "element-plus";
const {
query: {courseId, projectId},
query: { courseId, projectId },
} = useRoute();
const router = useRouter();
const returnclick = () => {
router.back();
};
const {data} = useRequest(PROJECT_PROCESS, {projectId: projectId || courseId});
const { data } = useRequest(PROJECT_PROCESS, {
projectId: projectId || courseId,
});
const userInfo = computed(() => store.state.userInfo);
const activeName = ref("first");
@@ -332,7 +340,7 @@ const activeName = ref("first");
const handleClick = (tab, event) => {
console.log(tab, event);
};
const path = {1: "path"};
const path = { 1: "path" };
const types = ref({
typeName: {
@@ -372,34 +380,61 @@ const types = ref({
4: "/homeworkpage",
5: import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试
6: "/livebroadcast",
7: ({courseId}) => request(LINK_DETAILS(courseId), {}).then(({data: {linkAddress}}) => window.open(linkAddress)),//外联
7: ({ courseId }) =>
request(LINK_DETAILS(courseId), {}).then(({ data: { linkAddress } }) =>
window.open(linkAddress)
), //外联
8: "/discusspage",
9: "/moreactive",
10: ({evaTyp, targetId}) => window.open((evaTyp === 1 ? import.meta.env.VITE_BOE_TEST_DETAIL_URL : import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL) + targetId), //测评
10: ({ evaType, targetId }) =>
window.open(
(evaType == 0
? import.meta.env.VITE_BOE_TEST_DETAIL_URL
: import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL) + targetId
), //测评
11: "/surveydetail",
12: "/ballotpage",
13: "/projectdetails",
},
});
function toFinish(d,sName) {
function toFinish(d, sName, chapterId) {
console.log("dddddd", d);
if (!types.value.path[d.type]) {
ElMessage.error("暂时未开放");
return;
}
if (typeof types.value.path[d.type] === 'string') {
types.value.path[d.type] && types.value.path[d.type].startsWith("http") && window.open(types.value.path[d.type] + d.targetId)
types.value.path[d.type] && types.value.path[d.type].startsWith("/") && router.push({
path: types.value.path[d.type],
query: {id: d.routerTaskId, type: 2, courseId: d.courseId, pName: data.value.name, sName},
})
} else if (typeof types.value.path[d.type] === 'function') {
types.value.path[d.type](d)
if (d.type == 3 || d.type == 7) {
request(STUDY_RECORD, {
studentId: data.value.userInfoBo.userId,
targetId: data.value.routerId,
logo: 2,
stageOrChapterId: chapterId,
taskId: d.projectTaskId,
});
}
if (typeof types.value.path[d.type] === "string") {
types.value.path[d.type] &&
types.value.path[d.type].startsWith("http") &&
window.open(types.value.path[d.type] + d.targetId);
types.value.path[d.type] &&
types.value.path[d.type].startsWith("/") &&
router.push({
path: types.value.path[d.type],
query: {
id: d.projectTaskId,
type: 2,
courseId: d.courseId,
pName: data.value.name,
sName,
},
});
} else if (typeof types.value.path[d.type] === "function") {
types.value.path[d.type](d);
}
}
function whiteTypes(type){
return import.meta.env.VITE_TASK_WHITE_TYPE.includes('-' + type +'-')
function whiteTypes(type) {
return import.meta.env.VITE_TASK_WHITE_TYPE.includes("-" + type + "-");
}
</script>

View File

@@ -0,0 +1,298 @@
<!--
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2022-12-18 15:56:03
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2022-12-18 21:04:56
* @FilePath: /fe-stu/src/views/project/ProjectList.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="projectManage">
<div class="content">
<div class="title">我的项目</div>
<div class="search">
<!-- <el-select v-model="value" class="m-2" placeholder="Select">
<el-option
v-for="item in projectClassify"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-select v-model="value" class="m-2" placeholder="Select">
<el-option
v-for="item in studyProgress"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> -->
<div style="width: 200px; margin-right: 20px">
<el-input v-model="projectname" placeholder="请输入项目名称" />
</div>
<div style="width: 420px">
<el-date-picker
v-model="searchTime"
type="datetimerange"
start-placeholder="开始时间"
end-placeholder="结束时间"
@change="selectTime"
/>
</div>
<button
class="searchBtn"
@click="searchClick"
style="margin-left: 20px"
>
搜索
</button>
<button class="searchBtn" @click="resetClick">重置</button>
</div>
<div class="projectList" v-for="(i, k) in data" :key="k">
<div style="display: flex">
<img
style="width: 253px; height: 144px; border-radius: 4px"
:src="i.picUrl"
/>
<div style="margin-left: 29px">
<div class="projectName" :title="i.name">
{{ i.name }}
</div>
<div class="progress">
<div class="progressNow">当前进度</div>
<div style="width: 115px">
<el-progress
:percentage="parseInt(i.finishTaskNum / i.totalTaskNum) * 100"
:show-text="false"
:stroke-width="8"
color="rgba(255, 160, 80, 1)"
/>
</div>
<div class="progressNum">
{{
i.finishTaskNum && i.totalTaskNum
? parseInt(i.finishTaskNum / i.totalTaskNum) * 100
: 0
}}%
</div>
</div>
<div class="studyNew">最新一次学习时间{{ i.lastStudyTime }}</div>
</div>
</div>
<div
class="tobestarted"
v-if="i.status == 2"
@click="goProjectDetails(i)"
>
待开始
</div>
<div class="gostudy" v-if="i.status == 0" @click="goProjectDetails(i)">
去学习
</div>
<div class="finish" v-if="i.status == 1" @click="goProjectDetails(i)">
已完成
</div>
<div
class="tobestarted"
v-if="i.status == 3"
@click="goProjectDetails(i)"
>
已结束
</div>
</div>
</div>
</div>
</template>
<script setup>
import { reactive, toRefs, ref, onMounted, computed } from "vue";
import { boeRequest, request, usePage, useRequest } from "@/api/request";
import {
ROUTER_CHAPTER_LIST,
PROJECT_LIST,
ROUTER_UNCOMPLETE_LIST,
} from "@/api/api";
import { useRouter } from "vue-router";
import store from "@/store";
const projectClassify = [];
const studyProgress = [];
const pageNo = ref("");
const pageSize = ref("");
const currentPage = ref("");
const projectTotal = ref("");
//搜索--------------start-----------------------------------------
const projectname = ref(""); //项目名称
const searchTime = ref(""); //选择时间
//搜索
const searchClick = () => {
console.log("点击搜索", projectname.value, searchTime.value);
let beginTime = null;
let endTime = null;
if (searchTime.value) {
beginTime = new Date(searchTime.value[0]).getTime();
endTime = new Date(searchTime.value[1]).getTime();
}
request(PROJECT_LIST, {
// beginTime: disDetail.value.discussId,
// endTime: replayComment.value.content,
// key: projectname.value,
// pageNo: pageNo,
// pageSize: pageSize,
}).then(() => {
commonFetch();
});
};
//重置
const resetClick = () => {
searchTime.value = "";
projectname.value = "";
console.log("点击重置");
};
//搜索--------------end-----------------------------------------
const userInfo = computed(() => store.state.userInfo);
const { data } = usePage(PROJECT_LIST, {});
console.log("datadata", data);
const router = useRouter();
const goProjectDetails = (value) => {
router.push({
path: "/projectdetails",
query: { projectId: value.projectId },
});
};
</script>
<style lang="scss">
.projectManage {
width: 100%;
min-height: 800px;
//border-radius: 8px;
background-color: rgba(255, 255, 255, 1);
display: flex;
// background-color: #ccc;
.content {
width: 100%;
// flex: 1;
margin-top: 50px;
margin-left: 81px;
.title {
font-size: 18px;
font-weight: 600;
color: #333333;
line-height: 25px;
}
.search {
margin-top: 31px;
display: flex;
align-items: center;
.searchBtn {
width: 100px;
height: 35px;
border-radius: 8px;
display: flex;
justify-content: center;
align-items: center;
background: #387df7;
border: 1px solid #387df7;
color: #ffffff;
cursor: pointer;
margin-left: 10px;
}
}
.projectList {
margin-top: 40px;
display: flex;
justify-content: space-between;
align-items: center;
.projectName {
width: 270px;
margin-top: 12px;
font-size: 18px;
font-weight: 600;
color: #333333;
line-height: 25px;
margin-bottom: 40px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.progress {
display: flex;
align-items: center;
.el-progress-bar__outer {
background-color: rgba(255, 160, 80, 0.19);
}
.progressNow {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
margin-right: 20px;
}
.progressNum {
font-size: 12px;
font-weight: 400;
color: #999999;
line-height: 17px;
margin-left: 26px;
}
}
.studyNew {
margin-top: 16px;
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
}
.tobestarted {
width: 140px;
height: 40px;
border-radius: 4px;
border: 1px solid #387df7;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
font-weight: 400;
color: #387df7;
line-height: 22px;
cursor: pointer;
margin-right: 120px;
}
.gostudy {
width: 140px;
height: 40px;
background: #387df7;
box-shadow: 1px 2px 15px 1px rgba(56, 125, 247, 0.34);
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
font-weight: 400;
color: #ffffff;
line-height: 22px;
margin-right: 120px;
cursor: pointer;
}
.finish {
width: 140px;
height: 40px;
background: rgba(56, 125, 247, 0.6);
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
font-weight: 400;
color: #ffffff;
line-height: 22px;
cursor: pointer;
}
}
}
}
</style>

View File

@@ -116,7 +116,7 @@
:style="{
background: `${types.path[value.type] ? '#2478ff' : '#999'}`,
}"
@click="toFinish(value, i.chapterName)"
@click="toFinish(value, i.chapterName, i.chapterId)"
>
{{
value.status === 1
@@ -329,7 +329,7 @@ import medal2 from "@/assets/image/medal/medal2.png";
import medal3 from "@/assets/image/medal/medal3.png";
import img from "@/assets/image/uploadimg.png";
import { boeRequest, useRequest, request } from "@/api/request";
import { ROUTER_PROCESS, LINK_DETAILS } from "@/api/api";
import { ROUTER_PROCESS, LINK_DETAILS, STUDY_RECORD } from "@/api/api";
import { useRoute, useRouter } from "vue-router";
import { ElMessage } from "element-plus";
import { useUserInfo } from "@/api/utils";
@@ -343,7 +343,7 @@ const returnclick = () => {
router.back();
};
const { data } = useRequest(ROUTER_PROCESS, { routerId });
console.log("data", data);
const userInfo = computed(() => store.state.userInfo);
console.log("userInfo", userInfo);
const activeName = ref("first");
@@ -409,13 +409,23 @@ const types = ref({
},
});
function toFinish(d, sName) {
function toFinish(d, sName, chapterId) {
if (!types.value.path[d.type]) {
ElMessage.error("暂时未开放");
return;
}
if (d.type == 3 || d.type == 7) {
request(STUDY_RECORD, {
studentId: data.value.userInfoBo.userId,
targetId: data.value.routerId,
logo: 1,
stageOrChapterId: chapterId,
taskId: d.routerTaskId,
});
}
if (typeof types.value.path[d.type] === "string") {
console.log("dddddd", d);
types.value.path[d.type] &&
types.value.path[d.type].startsWith("http") &&
window.open(types.value.path[d.type] + d.targetId);