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

This commit is contained in:
zhangyc
2022-12-17 19:22:00 +08:00
7 changed files with 294 additions and 140 deletions

View File

@@ -2,7 +2,7 @@
* @Author: lixg lixg@dongwu-inc.com * @Author: lixg lixg@dongwu-inc.com
* @Date: 2022-12-11 16:57:58 * @Date: 2022-12-11 16:57:58
* @LastEditors: lixg lixg@dongwu-inc.com * @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2022-12-15 10:56:54 * @LastEditTime: 2022-12-17 14:59:41
* @FilePath: /fe-stu/src/api/api.js * @FilePath: /fe-stu/src/api/api.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */

View File

@@ -1,7 +1,7 @@
import router from "@/router"; import router from "@/router";
import {reactive, ref, toRefs, watch} from "vue"; import { reactive, ref, toRefs, watch } from "vue";
import axios from 'axios'; import axios from 'axios';
import {getCookie} from "@/api/utils"; import { getCookie } from "@/api/utils";
export function usePage(_url, param) { export function usePage(_url, param) {
@@ -11,11 +11,11 @@ export function usePage(_url, param) {
total: 0, total: 0,
size: 10, size: 10,
current: 1, current: 1,
params: {pageNo: 1, pageSize: 10, ...param} params: { pageNo: 1, pageSize: 10, ...param }
}) })
watch(param, () => { watch(param, () => {
state.params = {...state.params, ...param} state.params = { ...state.params, ...param }
fetchData() fetchData()
}) })
@@ -86,14 +86,14 @@ export async function request(_url, params) {
method, method,
headers: { headers: {
'token': getCookie('token'), 'token': getCookie('token'),
...method !== 'get' ? {'Content-Type': 'application/json'} : {} ...method !== 'get' ? { 'Content-Type': 'application/json' } : {}
}, },
baseURL: import.meta.env.VITE_BASE_API, baseURL: import.meta.env.VITE_BASE_API,
...method !== 'get' ? {data: JSON.stringify(body)} : {} ...method !== 'get' ? { data: JSON.stringify(body) } : {}
}).then(resp => resp.data).then(response => { }).then(resp => resp.data).then(response => {
if (response.code !== 200 && response.code !== 0) { if (response.code !== 200 && response.code !== 0) {
if (response.code === 1000) { if (response.code === 1000) {
import.meta.env.MODE === 'development' ? router.push({path: '/login'}) : window.open(import.meta.env.VITE_BASE_LOGIN_URL) import.meta.env.MODE === 'development' ? router.push({ path: '/login' }) : window.open(import.meta.env.VITE_BASE_LOGIN_URL)
} }
// if (import.meta.env.DEV && response.code === 1000) { // if (import.meta.env.DEV && response.code === 1000) {
// router.push({path: '/login'}) // router.push({path: '/login'})
@@ -108,7 +108,7 @@ export async function request(_url, params) {
} }
return response return response
}).catch(e => { }).catch(e => {
console.log(e) console.log('eeeee', e)
// router.push({path: '/login'}) // router.push({path: '/login'})
}) })
} }
@@ -135,10 +135,10 @@ export async function boeRequest(_url, params) {
method, method,
headers: { headers: {
token: getCookie('token'), token: getCookie('token'),
...method !== 'get' ? {'Content-Type': 'application/json'} : {} ...method !== 'get' ? { 'Content-Type': 'application/json' } : {}
}, },
baseURL: '', baseURL: '',
...method !== 'get' ? {data: JSON.stringify(body)} : {} ...method !== 'get' ? { data: JSON.stringify(body) } : {}
}).then(resp => resp.data).then(response => { }).then(resp => resp.data).then(response => {
return response return response
}).catch(e => { }).catch(e => {

View File

@@ -1,3 +1,11 @@
<!--
* @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> <template>
<el-upload <el-upload
:file-list="files" :file-list="files"
@@ -15,52 +23,56 @@
</el-upload> </el-upload>
</template> </template>
<script setup> <script setup>
import {FILE_UPLOAD} from "@/api/api"; import { FILE_UPLOAD } from "@/api/api";
import {defineProps, ref} from "vue"; import { defineProps, ref } from "vue";
const {modelValue = []} = defineProps({ const { modelValue = [] } = defineProps({
modelValue: [] modelValue: [],
}) });
const emit = defineEmits() const emit = defineEmits();
const files = ref(modelValue) const files = ref(modelValue);
const imageRef = ref() const imageRef = ref();
function handleChange(e) { function handleChange(e) {
console.log(e) console.log("上传", e);
if (e.response && e.response.code === 200) { 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) { if (index === -1) {
files.value.unshift(e) files.value.unshift(e);
} else { } else {
files.value[index] = e files.value[index] = e;
} }
emit('update:modelValue', files) emit("update:modelValue", files);
} }
function remove(i) { function remove(i) {
files.value.splice(i, 1) files.value.splice(i, 1);
} }
function reUpload(i) { function reUpload(i) {
if (files.value[i].status === 'ready' || files.value[i].status === 'uploading') { if (
imageRef.value.abort(files.value[i].raw) files.value[i].status === "ready" ||
files.value[i].status = 'abort'; files.value[i].status === "uploading"
} else if (files.value[i].status === 'fail'||files.value[i].status === 'abort') { ) {
imageRef.value.handleStart(files.value[i].raw) imageRef.value.abort(files.value[i].raw);
imageRef.value.submit() 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) { function abort(i) {
imageRef.value.abort(files.value[i].raw) imageRef.value.abort(files.value[i].raw);
} }
defineExpose({ reUpload, remove });
defineExpose({reUpload, remove})
</script> </script>

View File

@@ -39,6 +39,25 @@
<div style="margin-left: 8px">{{ data.planDto?.address }}</div> <div style="margin-left: 8px">{{ data.planDto?.address }}</div>
</div> </div>
</div> </div>
<div style="display: flex">
<botton
v-if="!isAllowSign"
class="btn"
style="margin-right: 20px; background: #999"
@click="signClick"
>签到
</botton>
<botton
v-if="isAllowSign"
class="btn"
style="margin-right: 20px"
:style="{
background:
data.signFlag || !isAllowSign ? '#999' : 'rgb(57, 146, 249)',
}"
@click="signClick"
>{{ data.signFlag ? "已签到" : "签到" }}
</botton>
<botton <botton
style="background: #999" style="background: #999"
class="btn" class="btn"
@@ -57,6 +76,7 @@
>{{ data.isSurvery ? "已评估" : "评估" }} >{{ data.isSurvery ? "已评估" : "评估" }}
</botton> </botton>
</div> </div>
</div>
<!-- 基本信息 --> <!-- 基本信息 -->
<!-- 详细信息 --> <!-- 详细信息 -->
@@ -228,7 +248,7 @@ const returnclick = () => {
router.back(); router.back();
}; };
const { const {
query: { courseId, type }, query: { courseId, type, id: taskId },
} = useRoute(); } = useRoute();
const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId }); const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId });
@@ -240,26 +260,103 @@ const { avatar: userAvatar } = useUserInfo(
const state = reactive({ const state = reactive({
activeName: "first", activeName: "first",
enclosure: "", enclosure: "",
isAllowSign: false,
}); });
const { activeName, enclosure } = toRefs(state); const { activeName, enclosure, isAllowSign } = toRefs(state);
const handleClick = (tab, event) => { const handleClick = (tab, event) => {
console.log(tab, event); console.log(tab, event);
}; };
const download = (url) => { const download = (url) => {
window.open(url); window.open(url);
}; };
let timer = null;
//判断能否签到
function isSignClick() {
timer = setInterval(() => {
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;
} 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;
}
} 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;
}
}
console.log("isAllowSign", state.isAllowSign);
}, 1000);
}
isSignClick();
//签到
const signClick = () => {
if (data.value.signFlag) {
return;
}
console.log("data.signFlag", data.value.signFlag);
if (!isAllowSign) {
ElMessage.info("未在签到范围内");
return;
}
data.value.signFlag = 1;
ElMessage.info("签到成功");
request(TASK_BROADCAST_SIGN, { courseId: courseId, taskId, type });
};
function toSurvery() { function toSurvery() {
if (data.value.isSurvery) { if (data.value.isSurvery) {
return; return;
} }
if (data.value.planDto.evalFlag == 0) { if (data.value.planDto.evalFlag == 0) {
alert("此课程无评估"); ElMessage.info("此课程无评估");
return; return;
} }
router.push({ router.push({
path: "/surveydetail", path: "/surveydetail",
query: { courseId: data.value.planDto.evaluateId }, query: {
courseId: data.value.planDto.evaluateId,
pName: "面授课",
sName: data.value.planDto.name,
},
}); });
} }
@@ -270,6 +367,8 @@ function toWork() {
courseId: data.value.workDto.workId, courseId: data.value.workDto.workId,
id: data.value.offcourseDto.categoryId, id: data.value.offcourseDto.categoryId,
type, type,
pName: "面授课",
sName: data.value.planDto.name,
}, },
}); });
} }

View File

@@ -288,6 +288,7 @@ const {
} = useRoute(); } = useRoute();
const { data } = useRequest(TASK_WORK_DETAIL, { workId, taskId }); const { data } = useRequest(TASK_WORK_DETAIL, { workId, taskId });
console.log("data", data);
const { data: submitList } = useRequest(TASK_WORK_SUBMIT_LIST, { const { data: submitList } = useRequest(TASK_WORK_SUBMIT_LIST, {
workerId: workId, workerId: workId,
}); });

View File

@@ -220,13 +220,17 @@ const commitClick = () => {
return; return;
} }
if (data.value.isEvaluate == 0) { if (data.value.isEvaluate == 0) {
alert("此直播无评估"); ElMessage.info("此直播无评估");
return; return;
} }
router.push({ router.push({
path: "/surveydetail", path: "/surveydetail",
query: { courseId: data.value.assessmentId }, query: {
courseId: data.value.assessmentId,
pName: "直播",
sName: data.value.liveName,
},
}); });
}; };

View File

@@ -10,6 +10,7 @@
<div>{{ sName }}</div> <div>{{ sName }}</div>
<div style="margin-left: 6px; margin-right: 6px">/</div> <div style="margin-left: 6px; margin-right: 6px">/</div>
<div style="font-weight: 700; font-size: 16px">评估详情</div> <div style="font-weight: 700; font-size: 16px">评估详情</div>
<div style="font-weight: 700; font-size: 16px">评估详情</div>
</div> </div>
<!-- <!--
<div class="prevnext"> <div class="prevnext">
@@ -30,16 +31,17 @@
<div class="return"> <div class="return">
<div style="display: flex" @click="returnclick"> <div style="display: flex" @click="returnclick">
<img <img
class="img2" style="margin-right:22px;" class="img2"
style="margin-right: 22px"
src="../../assets/image/return.png" src="../../assets/image/return.png"
/> />
<div class="text">返回</div> <div class="text" style="color: #fff">返回</div>
</div> </div>
</div> </div>
</div> </div>
<!-- 面包屑导航 --> <!-- 面包屑导航 -->
<!-- 标题 --> <!-- 标题 -->
<div class="title">调研管理者进阶腾飞班 - 培训阶段性调研</div> <div class="title">评估管理者进阶腾飞班 - 培训阶段性调研</div>
<!-- 标题 --> <!-- 标题 -->
<!-- 基本信息 --> <!-- 基本信息 -->
<div class="bascinfo"> <div class="bascinfo">
@@ -74,8 +76,8 @@
}" }"
@click=" @click="
() => { () => {
if(data.isSubmit){ if (data.isSubmit) {
return return;
} }
value.selectAnswer = item; value.selectAnswer = item;
} }
@@ -90,18 +92,26 @@
<div <div
class="question" class="question"
style="margin-top: 41px" style="margin-top: 41px"
v-if="data.assessmentSingleChoiceDtoList && data.assessmentSingleChoiceDtoList.length" v-if="
data.assessmentSingleChoiceDtoList &&
data.assessmentSingleChoiceDtoList.length
"
> >
<div class="text">{{ data.assessmentSingleChoiceDtoList[0]?.singleStemName }}</div> <div class="text">
{{ data.assessmentSingleChoiceDtoList[0]?.singleStemName }}
</div>
<div <div
v-for="(value, index) in data.assessmentSingleChoiceDtoList" v-for="(value, index) in data.assessmentSingleChoiceDtoList"
:key="index" :key="index"
style="display: flex; align-items: center" style="display: flex; align-items: center"
:style="{'margin-top': index === 0 ? '29px' : '22px',cursor: 'pointer'}" :style="{
'margin-top': index === 0 ? '29px' : '22px',
cursor: 'pointer',
}"
@click=" @click="
() => { () => {
if(data.isSubmit){ if (data.isSubmit) {
return return;
} }
data.assessmentSingleChoiceDtoList.forEach((e) => { data.assessmentSingleChoiceDtoList.forEach((e) => {
e.select = false; e.select = false;
@@ -121,9 +131,14 @@
<div <div
class="question" class="question"
style="margin-top: 41px" style="margin-top: 41px"
v-if="data.assessmentMultipleChoiceDtoList && data.assessmentMultipleChoiceDtoList.length" v-if="
data.assessmentMultipleChoiceDtoList &&
data.assessmentMultipleChoiceDtoList.length
"
> >
<div class="text">{{ data.assessmentMultipleChoiceDtoList[0]?.multipleStemName }}</div> <div class="text">
{{ data.assessmentMultipleChoiceDtoList[0]?.multipleStemName }}
</div>
<div <div
v-for="(value, index) in data.assessmentMultipleChoiceDtoList" v-for="(value, index) in data.assessmentMultipleChoiceDtoList"
:key="index" :key="index"
@@ -132,12 +147,14 @@
'margin-top': index === 0 ? '29px' : '22px', 'margin-top': index === 0 ? '29px' : '22px',
cursor: 'pointer', cursor: 'pointer',
}" }"
@click="() => { @click="
if(data.isSubmit){ () => {
return if (data.isSubmit) {
return;
} }
value.select = !value.select value.select = !value.select;
}" }
"
> >
<img <img
style="width: 19px; height: 18px; cursor: pointer" style="width: 19px; height: 18px; cursor: pointer"
@@ -165,9 +182,22 @@
<div class="words">{{ item.content?.length || 0 }}/200</div> <div class="words">{{ item.content?.length || 0 }}/200</div>
</div> </div>
</div> </div>
<div style="display: flex; justify-content: center" <div
v-if="data.assessmentEssayQuestionDtoList?.length || data.assessmentMultipleChoiceDtoList?.length || data.assessmentSingleChoiceDtoList?.length || data.assessmentScoringQuestionDtoList?.length"> style="display: flex; justify-content: center"
<div class="submit" @click="submit" :style="{background: data.isSubmit?'#999':'#2478ff'}">提交</div> v-if="
data.assessmentEssayQuestionDtoList?.length ||
data.assessmentMultipleChoiceDtoList?.length ||
data.assessmentSingleChoiceDtoList?.length ||
data.assessmentScoringQuestionDtoList?.length
"
>
<div
class="submit"
@click="submit"
:style="{ background: data.isSubmit ? '#999' : '#2478ff' }"
>
提交
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -191,19 +221,27 @@ const returnclick = () => {
router.back(); router.back();
}; };
const { const {
query: {courseId, id: taskId, type, pName, sName}, query: { courseId, id: taskId, type, pName, sName },
} = useRoute(); } = useRoute();
const router = useRouter();
const {data} = useRequest(ASSESSMENT_QUERY(courseId), {id: courseId}); const returnclick = () => {
router.back();
};
const { data } = useRequest(ASSESSMENT_QUERY(courseId), { id: courseId });
console.log("data", data);
function submit() { function submit() {
if (data.value.isSubmit) { if (data.value.isSubmit) {
return return;
} }
data.value.isSubmit = !data.value.isSubmit data.value.isSubmit = !data.value.isSubmit;
request(ASSESSMENT_SUBMIT, {assessmentId: courseId, taskId, type, result: JSON.stringify(data.value)}) request(ASSESSMENT_SUBMIT, {
assessmentId: courseId,
taskId,
type,
result: JSON.stringify(data.value),
});
ElMessage.info("提交成功"); ElMessage.info("提交成功");
router.back() router.back();
} }
</script> </script>
<style lang="scss"> <style lang="scss">
@@ -214,10 +252,10 @@ function submit() {
font-size: 14px; font-size: 14px;
line-height: 24px; line-height: 24px;
} }
.return{ .return {
position: absolute; position: absolute;
right: 10%; right: 10%;
.text{ .text {
text-align: center; text-align: center;
display: flex; display: flex;
flex-direction: row; flex-direction: row;