This commit is contained in:
yuping
2022-12-13 18:11:55 +08:00
parent 6573261fd6
commit c75d463c40
4 changed files with 73 additions and 66 deletions

View File

@@ -2,6 +2,8 @@ import {watch, ref} from "vue";
import {boeRequest} from "@/api/request";
import {BASE, GET_USER_LIST} from "@/api/ThirdApi";
const BASE_AVATAR = import.meta.env.DEV ? `${BASE}/upload` : ''
export function useImage(src) {
return new URL(`../assets/image/${src}`, import.meta.url).href
}
@@ -16,12 +18,13 @@ export function getCookie(name) {
return document.cookie?.split(";").find(e => e.includes(name)).replace(`${name}=`, '') || ''
}
export function useUserInfoAvatar(id) {
const avatar = ref(import.meta.env.DEV ? `${BASE}/upload` : '')
export function useUserInfo(id) {
const userInfo = ref({})
watch(id, () => {
id.value && boeRequest(GET_USER_LIST, {id: id.value}).then(res => {
avatar.value = avatar.value + res.result.userInfoList[0].avatar
userInfo.value = res.result.userInfoList[0]
userInfo.value.avatar = BASE_AVATAR + userInfo.value.avatar
})
})
return avatar
return userInfo
}

View File

@@ -115,9 +115,9 @@
<div class="tag3" style="margin-left: 11px">考试</div>
</div>
</div>
<!-- <div class="submit" @click="toExamItem(data.examinationDto)">-->
<!-- 去考试-->
<!-- </div>-->
<!-- <div class="submit" @click="toExamItem(data.examinationDto)">-->
<!-- 去考试-->
<!-- </div>-->
</div>
</el-tab-pane>
</el-tabs>
@@ -155,16 +155,16 @@ import FileTypeImg from "@/components/FileTypeImg.vue";
import {request, useRequest} from "@/api/request";
import {STU_OFFCOURSE_DETAIL} from "@/api/api";
import {useRoute, useRouter} from "vue-router";
import {useUserInfoAvatar} from "@/api/utils";
import {useUserInfo} from "@/api/utils";
const router = useRouter();
const {
query: {courseId,type},
query: {courseId, type},
} = useRoute();
const {data} = useRequest(STU_OFFCOURSE_DETAIL, {courseId});
const userAvatar = useUserInfoAvatar(computed(() => data.value?.planDto?.teacherId))
const {avatar: userAvatar} = useUserInfo(computed(() => data.value?.planDto?.teacherId))
const state = reactive({
activeName: "first",
@@ -183,7 +183,10 @@ function toSurvery() {
}
function toWork() {
router.push({path: "/homeworkpage", query: {courseId: data.value.workDto.workId, id: data.value.offcourseDto.categoryId, type}})
router.push({
path: "/homeworkpage",
query: {courseId: data.value.workDto.workId, id: data.value.offcourseDto.categoryId, type}
})
}
function toExamItem(obj) {

View File

@@ -23,15 +23,15 @@
<div class="title">直播{{ data?.liveName }}</div>
<div class="time" style="margin-top: 26px">
<img
style="width: 15px; height: 17px"
src="../../assets/image/time.png"
style="width: 15px; height: 17px"
src="../../assets/image/time.png"
/>
<div style="margin-left: 8px">{{ data?.liveStartTime }}</div>
</div>
<div class="time" style="margin-top: 23px">
<img
style="width: 16px; height: 18px"
src="../../assets/image/position.png"
style="width: 16px; height: 18px"
src="../../assets/image/position.png"
/>
<!-- todo #直播详情 没有位置字段-->
<div style="margin-left: 8px">大族广场</div>
@@ -39,20 +39,23 @@
</div>
<div class="threeBtn">
<botton
class="btn"
style="background: rgb(59, 191, 252)"
@click="showClick"
>观看</botton
class="btn"
style="background: rgb(59, 191, 252)"
@click="showClick"
>观看
</botton
>
<botton
class="btn"
style="background: rgb(57, 146, 249)"
@click="signClick"
v-if="!data.signFlag"
>签到</botton
class="btn"
style="background: rgb(57, 146, 249)"
@click="signClick"
v-if="!data.signFlag"
>签到
</botton
>
<botton class="btn" @click="commitClick" v-if="!data.evalFlag"
>评估</botton
>评估
</botton
>
</div>
</div>
@@ -65,8 +68,8 @@
<div class="" style="margin-left: 48px; margin-right: 48px">
<div class="title">
<img
style="width: 20px; height: 20px"
src="../../assets/image/course.png"
style="width: 20px; height: 20px"
src="../../assets/image/course.png"
/>
<div class="text">课前预习</div>
<div class="box"></div>
@@ -74,21 +77,21 @@
<div style="display: flex; align-items: center">
<!-- todo #直播 没有课前预习字段-->
<div class="content">
通过对各级人员的软件平台培训使其能够了解如何运用乾元坤和智能信息管理系统来提升企业管理水平最大限度发挥软件产品在企业中的作用;<br />
通过对各级人员的软件平台培训使其能够了解如何运用乾元坤和智能信息管理系统来提升企业管理水平最大限度发挥软件产品在企业中的作用;<br/>
培训目标
<br />1.使企业不同部门人员掌握便捷有效的系统平台操作方法;<br />
2.通过系统平台的培训提高员工对企业的管理理念认识与提升<br />
<br/>1.使企业不同部门人员掌握便捷有效的系统平台操作方法;<br/>
2.通过系统平台的培训提高员工对企业的管理理念认识与提升<br/>
3.通过系统平台培训加强沟通统一部署协同工作提高效率
<br />
培训对象<br />
集团领导各相关部门领导总经理车间主管车间操作员等;<br />
<br/>
培训对象<br/>
集团领导各相关部门领导总经理车间主管车间操作员等;<br/>
</div>
</div>
<div class="title">
<img
style="width: 20px; height: 20px"
src="../../assets/image/write.png"
style="width: 20px; height: 20px"
src="../../assets/image/write.png"
/>
<!-- todo #直播 课后作业-->
<div class="text">课后作业</div>
@@ -97,9 +100,9 @@
<div style="display: flex; align-items: center">
<div class="content">
<span style="font-weight: 600"
>网易有道词典现有功能结构拆解+问题分析</span
><br />
查找资料介绍一种国外日本美国欧洲道路公路铁路城市道路地铁设计规范的演变过程可以一种或几种主要技术指标为例并说明其原因<br />
>网易有道词典现有功能结构拆解+问题分析</span
><br/>
查找资料介绍一种国外日本美国欧洲道路公路铁路城市道路地铁设计规范的演变过程可以一种或几种主要技术指标为例并说明其原因<br/>
</div>
</div>
</div>
@@ -109,8 +112,8 @@
<div class="tell">
<div class="title">
<img
style="width: 21px; height: 23px"
src="../../assets/image/tv.png"
style="width: 21px; height: 23px"
src="../../assets/image/tv.png"
/>
<div class="text">直播公告</div>
<div class="box"></div>
@@ -120,32 +123,25 @@
<div class="teacher">
<div class="title">
<img
style="width: 21px; height: 23px"
src="../../assets/image/livelecturer.png"
style="width: 21px; height: 23px"
src="../../assets/image/livelecturer.png"
/>
<!-- todo #直播详情 没有直播讲师-->
<div class="text">直播讲师</div>
<div class="box"></div>
</div>
<div
v-for="(el, index) in teacher"
:key="el.id"
class="teacheritem"
:style="{
'border-bottom':
index === teacher.length - 1
? null
: '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="el.peopleimg" />
<img class="peopleimg" :src="userAvatar"/>
<div style="margin-left: 17px; width: 190px">
<div class="teacherName" style="margin-right: 5px">
{{ data.userInfoBo?.userName }}
</div>
<div class="introduce">{{ data.userInfoBo?.bandDesc }}</div>
</div>
<div class="follow">+ 关注</div>
<!-- <div class="follow">+ 关注</div>-->
</div>
</div>
</div>
@@ -155,22 +151,27 @@
</template>
<script setup>
import { reactive, toRefs } from "vue";
import {computed, reactive, toRefs} from "vue";
import img from "@/assets/image/uploadimg.png";
import { request, useRequest } from "@/api/request";
import {request, useRequest} from "@/api/request";
import {
TASK_BROADCAST_DETAIL,
TASK_BROADCAST_SIGN,
} from "@/api/api";
import { useRoute } from "vue-router/dist/vue-router";
import {useRoute} from "vue-router/dist/vue-router";
import {useRouter} from "vue-router";
import {useUserInfo} from "@/api/utils";
const {
query: { courseId: liveId },
query: {courseId: liveId},
} = useRoute();
const router = useRouter()
const { data } = useRequest(TASK_BROADCAST_DETAIL, { liveId });
const {data} = useRequest(TASK_BROADCAST_DETAIL, {liveId});
const {avatar: userAvatar} = useUserInfo(computed(() => data.value.userInfoBo?.userId))
const state = reactive({
activeName: "first",
teacher: [
@@ -178,7 +179,7 @@ const state = reactive({
id: 1,
name: "王星天(显示事业)",
introduce:
"教师是学生的镜子,学生是老师的影子。教师是学生的镜子,学生是老师的影子。教师是学生的镜子,学生是老师的影子。",
"教师是学生的镜子,学生是老师的影子。教师是学生的镜子,学生是老师的影子。教师是学生的镜子,学生是老师的影子。",
peopleimg: img,
},
],
@@ -186,7 +187,7 @@ const state = reactive({
const {activeName, teacher} = toRefs(state)
const signClick = () => {
data.value.signFlag = 1
request(TASK_BROADCAST_SIGN, { courseId: liveId })
request(TASK_BROADCAST_SIGN, {courseId: liveId})
};
const commitClick = () => {
router.push({path: '/surveydetail', query: {courseId: data.value.assessmentId}})
@@ -482,9 +483,9 @@ function showClick() {
background-color: rgba(255, 255, 255, 1);
border-radius: 8px;
background: linear-gradient(
180deg,
rgba(36, 120, 255, 0.15) 0%,
rgba(255, 255, 255) 50%
180deg,
rgba(36, 120, 255, 0.15) 0%,
rgba(255, 255, 255) 50%
);
.title {

View File

@@ -40,7 +40,7 @@
<div class="coursename">{{ value.name }}</div>
<div class="coursetag">
<div class="tag1" style="margin-right: 11px; margin-top: 16px" v-if="value.flag">必修</div>
<div class="tag2" style="margin-right: 11px; margin-top: 16px" v-if="!value.flag">选修</div>
<div class="tag2" style="margin-right: 11px; margin-top: 16px" v-if="!value.flag">选修</div>
<div class="tag3" style="margin-right: 11px; margin-top: 16px">{{
types.typeName[value.type] || ''
}}
@@ -320,12 +320,12 @@ import {boeRequest, useRequest} from "@/api/request";
import {ROUTER_PROCESS} from "@/api/api";
import {useRoute, useRouter} from "vue-router";
import {ElMessage} from 'element-plus'
import {useUserInfoAvatar} from "@/api/utils";
import {useUserInfo} from "@/api/utils";
const {query: {routerId}} = useRoute()
const router = useRouter()
const {data} = useRequest(ROUTER_PROCESS, {routerId})
const userAvatar = useUserInfoAvatar(computed(() => data.value?.userInfoBo?.userId))
const {avatar: userAvatar} = useUserInfo(computed(() => data.value?.userInfoBo?.userId))
const state = reactive({
course: [