mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-student.git
synced 2025-12-11 03:46:48 +08:00
feat:增加关卡预览和可以学习部分判断、增加投票浏览和参与数接口调用。
This commit is contained in:
@@ -123,6 +123,8 @@ export const PostList = `/statement/list`
|
|||||||
// 查询单个测评的状态
|
// 查询单个测评的状态
|
||||||
export const QueryEvaluationTaskStatusOne = `/evaluation/queryEvaluationTaskStatusOne`
|
export const QueryEvaluationTaskStatusOne = `/evaluation/queryEvaluationTaskStatusOne`
|
||||||
|
|
||||||
|
// 投票浏览和参与数目
|
||||||
|
export const EditVoteInvolvedAndBrowse = `/vote/editVoteInvolvedAndBrowse post`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import {computed, defineProps, ref} from "vue";
|
import {computed, defineProps, ref} from "vue";
|
||||||
|
import {ElMessage} from "element-plus";
|
||||||
import back from '@/assets/image/pathdetails/pathDetailBack.png'
|
import back from '@/assets/image/pathdetails/pathDetailBack.png'
|
||||||
import nameBack from '@/assets/image/pathdetails/pathDetailImg.png'
|
import nameBack from '@/assets/image/pathdetails/pathDetailImg.png'
|
||||||
import currentBack from '@/assets/image/pathdetails/pathDetailImgSelect.png'
|
import currentBack from '@/assets/image/pathdetails/pathDetailImgSelect.png'
|
||||||
@@ -120,17 +121,50 @@ function show() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function toDetail(i) {
|
function toDetail(i) {
|
||||||
if (current.value !== i) {
|
// 预览和学习设置
|
||||||
return
|
let previewSetting = props.detail.previewSetting;
|
||||||
|
let studySetting = props.detail.studySetting;
|
||||||
|
let isStudy = false;
|
||||||
|
let chapterId = props.detail.chapterDtoList[i].id
|
||||||
|
console.log(studySetting)
|
||||||
|
if(previewSetting==null){
|
||||||
|
// 如果未设置预览 则只可以看当前关卡 其余关卡不让点击
|
||||||
|
if (current.value !== i) {
|
||||||
|
ElMessage.warning("当前关卡不可预览");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if (current.value !== i) {
|
||||||
|
let lookArr = [];
|
||||||
|
lookArr = previewSetting.split(',')
|
||||||
|
if((i+1)>=lookArr[0] && (i+1)<=lookArr[1]){
|
||||||
|
if(studySetting!==null){
|
||||||
|
let studyArr = [];
|
||||||
|
studyArr = studySetting.split(',')
|
||||||
|
if((i+1)>=studyArr[0] && (i+1)<=studyArr[1]){
|
||||||
|
isStudy = true;
|
||||||
|
}else{
|
||||||
|
isStudy = false;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
isStudy = false;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
ElMessage.warning("当前关卡不可预览");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
isStudy = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
(import.meta.env.MODE === "development" || import.meta.env.MODE === "test")
|
(import.meta.env.MODE === "development" || import.meta.env.MODE === "test")
|
||||||
? router.push({
|
? router.push({
|
||||||
path: "/pathdetails",
|
path: "/pathdetails",
|
||||||
query: {routerId: props.detail.id, routerName: props.detail.name},
|
query: {routerId: props.detail.id, routerName: props.detail.name, isStudy, chapterId},
|
||||||
})
|
})
|
||||||
: window.open(
|
: window.open(
|
||||||
`${window.location.protocol + import.meta.env.VITE_BOE_PATH_DETAIL_URL}/pathdetails¶ms=${encodeURIComponent(
|
`${window.location.protocol + import.meta.env.VITE_BOE_PATH_DETAIL_URL}/pathdetails¶ms=${encodeURIComponent(
|
||||||
`routerId=${props.detail.id}&routerName=${props.detail.name}`
|
`routerId=${props.detail.id}&routerName=${props.detail.name}&chapterId=${chapterId}&studySetting=${studySetting}`
|
||||||
)}`
|
)}`
|
||||||
,'_top');
|
,'_top');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -186,12 +186,12 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import {useRequest} from "@/api/request";
|
import {useRequest} from "@/api/request";
|
||||||
import {VOTE_DETAIL3, VOTE_DETAIL_SUBMIT} from "@/api/api";
|
import {VOTE_DETAIL3, VOTE_DETAIL_SUBMIT, EditVoteInvolvedAndBrowse} from "@/api/api";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import {ElMessage} from "element-plus";
|
import {ElMessage} from "element-plus";
|
||||||
import {useRoute, useRouter} from "vue-router/dist/vue-router";
|
import {useRoute, useRouter} from "vue-router/dist/vue-router";
|
||||||
import {computed} from "vue";
|
import {computed,watch} from "vue";
|
||||||
import {useTaskPage} from "@/api/useCommon";
|
import {useTaskPage} from "@/api/useCommon";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@@ -206,6 +206,11 @@ const { data: dataInfo } = useRequest(VOTE_DETAIL3(courseId), {type});
|
|||||||
const userInfo = computed(() => store.state.userInfo);
|
const userInfo = computed(() => store.state.userInfo);
|
||||||
const answerTime = dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss");
|
const answerTime = dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss");
|
||||||
|
|
||||||
|
// 增加浏览量
|
||||||
|
watch(dataInfo, () => {
|
||||||
|
useRequest(EditVoteInvolvedAndBrowse, {operationType:2, voteId:dataInfo.id });
|
||||||
|
})
|
||||||
|
|
||||||
// 选择题目
|
// 选择题目
|
||||||
const choiceQuestion = (item, value) => {
|
const choiceQuestion = (item, value) => {
|
||||||
if (dataInfo.value.isSubmit) {
|
if (dataInfo.value.isSubmit) {
|
||||||
@@ -245,6 +250,8 @@ const submitVote = () => {
|
|||||||
voteName: dataInfo.value.voteName,
|
voteName: dataInfo.value.voteName,
|
||||||
};
|
};
|
||||||
useRequest(VOTE_DETAIL_SUBMIT, obj);
|
useRequest(VOTE_DETAIL_SUBMIT, obj);
|
||||||
|
// 增加参与数目
|
||||||
|
useRequest(EditVoteInvolvedAndBrowse, {operationType:1, voteId:dataInfo.id });
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ import FileTypeImg from "@/components/FileTypeImg.vue";
|
|||||||
import {useStore} from "vuex";
|
import {useStore} from "vuex";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
query: { routerId, routerName },
|
query: { routerId, routerName, isStudy, chapterId },
|
||||||
} = useRoute();
|
} = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const returnclick = () => {
|
const returnclick = () => {
|
||||||
|
|||||||
@@ -164,6 +164,9 @@ export default defineConfig(({ command, mode }) =>
|
|||||||
},'/evaluation/queryEvaluationTaskStatusOne': {
|
},'/evaluation/queryEvaluationTaskStatusOne': {
|
||||||
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
|
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
|
},'/vote/editVoteInvolvedAndBrowse': {
|
||||||
|
target: loadEnv(mode, process.cwd()).VITE_PROXY_URL,
|
||||||
|
changeOrigin: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user