获取最新

develoop
lijiaqi 3 months ago
parent 0cf6e42287
commit 21e0ad0d13
  1. 4
      .env.development
  2. 62
      src/views/course/basicCourseInformation.vue
  3. 39
      src/views/course/components/course-brief.vue
  4. 6
      src/views/course/components/course-object.vue
  5. 61
      src/views/course/components/courseEdit.vue

@ -1,5 +1,5 @@
# 变量必须以 VITE_ 为前缀才能暴露给外部读取
NODE_ENV = 'development'
VITE_APP_TITLE = '无糖运营平台'
VITE_APP_BASE_API = 'http://127.0.0.1:8080'
# VITE_APP_BASE_API = 'http://39.106.16.162:8080'
# VITE_APP_BASE_API = 'http://127.0.0.1:8080'
VITE_APP_BASE_API = 'http://39.106.16.162:8080'

@ -209,11 +209,7 @@ const CloseCouresNameChangeEvent = () => {
</el-form>
<div class="course">
<ul class="course_list">
<li
v-if="userStore.userInfo.roleId[0] === '1'"
@click="onAddCourse()"
class="add_course"
>
<li v-if="userStore.userInfo.roleId[0] === '1'" @click="onAddCourse()" class="add_course">
<div class="plus">
<el-icon class="avatar-uploader-icon">
<Plus />
@ -222,17 +218,8 @@ const CloseCouresNameChangeEvent = () => {
<h2 class="course_name">{{ course_name }}</h2>
</li>
<li v-for="item in courseList" :key="item.id">
<img
title="点击查看课程详情"
:src="item.img"
alt=""
@click="onGetCourseObject(item.id)"
/>
<h2
title="点击查看课程基本信息"
class="course_name"
@click="onEditCourse(item)"
>
<img title="点击查看课程详情" :src="item.img" alt="" @click="onGetCourseObject(item.id)" />
<h2 title="点击查看课程基本信息" class="course_name">
{{ item.name }}
</h2>
<p class="teacher_name">讲师{{ item.teacher }}</p>
@ -245,36 +232,22 @@ const CloseCouresNameChangeEvent = () => {
<el-icon class="del" @click="onDeleteCourse(item.id)">
<Delete />
</el-icon>
<el-button
class="object"
round
plain
@click="onGetCourseObject(item.id)"
>
查看课程详情
<el-button class="object" round plain @click="onGetCourseObject(item.id)">
详情
</el-button>
<el-button class="object1" round plain @click="onEditCourse(item)">
编辑
</el-button>
</li>
</ul>
</div>
<el-pagination
v-model:current-page="params.pageNo"
v-model:page-size="params.pageSize"
:page-sizes="[2, 5, 7, 10]"
:background="true"
layout="jumper,total, sizes, prev, pager, next "
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
style="margin-top: 10px; justify-content: center"
/>
<el-pagination v-model:current-page="params.pageNo" v-model:page-size="params.pageSize"
:page-sizes="[2, 5, 7, 10]" :background="true" layout="jumper,total, sizes, prev, pager, next " :total="total"
@size-change="handleSizeChange" @current-change="handleCurrentChange"
style="margin-top: 10px; justify-content: center" />
</div>
<course-edit
ref="drawer"
@success="onSuccess"
@couresNameChange="couresNameChangeEvent"
@CloseCouresNameChange="CloseCouresNameChangeEvent"
:flog="flog"
></course-edit>
<course-edit ref="drawer" @success="onSuccess" @couresNameChange="couresNameChangeEvent"
@CloseCouresNameChange="CloseCouresNameChangeEvent" :flog="flog"></course-edit>
</div>
</div>
</template>
@ -320,6 +293,7 @@ const CloseCouresNameChangeEvent = () => {
}
.course {
// display: flex;
// flex: 0 0 25%;
// justify-content: space-between;
@ -399,6 +373,12 @@ const CloseCouresNameChangeEvent = () => {
margin-left: 180px;
margin-top: -29px;
}
.object1 {
position: absolute;
margin-left: 250px;
margin-top: -29px;
}
}
.plus {

@ -26,20 +26,25 @@ onMounted(() => {
</script>
<template>
<div class="grid-content course-brief" style="height: 350px">
<h1 style="text-align:">课程基本信息</h1>
<h1 style="text-align:">
{{ courseDetails.name }}
<span>主讲教师{{ courseDetails.teacher }}</span>
</h1>
<div class="box">
<div class="image">
<img :src="courseDetails.img" alt="" />
</div>
<div class="text">
<h2 class="title">
<!-- <h2 class="title">
{{ courseDetails.name }}
<span>主讲教师{{ courseDetails.teacher }}</span>
</h2>
</h2> -->
<div>
<h3>
课程简介:
<el-scrollbar height="70px">
<el-scrollbar height="143px">
<p class="pp">{{ courseDetails.description }}</p>
</el-scrollbar>
<!-- <textarea name="" id=""></textarea> -->
@ -87,9 +92,16 @@ onMounted(() => {
// display: block;
padding-top: 20px;
text-align: center;
font-size: 24px;
font-size: 26px;
font-weight: 700;
color: #333333ff;
span {
margin-left: 40px;
font-size: 18px;
line-height: 30px;
color: #8a8b99;
}
}
.box {
@ -136,12 +148,7 @@ onMounted(() => {
font-family: Inter, Inter;
color: #333333ff;
span {
margin-left: 40px;
font-size: 18px;
line-height: 30px;
color: #8a8b99;
}
}
h3 {
@ -161,23 +168,27 @@ onMounted(() => {
.brief {
border-radius: 4px;
width: 100%;
height: 50%;
height: 80%;
.ull {
display: flex;
flex-wrap: wrap;
margin-top: 10px;
align-content: space-around;
justify-content: space-between;
}
li {
// margin-top: 10px;
// padding-left: 10px;
margin-right: 80px;
font-size: 14px;
text-align: center;
margin-bottom: 15px;
margin-bottom: 10px;
p {
margin-top: 10px;
margin-top: 6px;
font-size: 16px;
}

@ -10,15 +10,15 @@ import {
getObjectContent,
} from '@/api/user/object'
import { useRoute } from 'vue-router'
import { ITEM_RENDER_EVT } from 'element-plus/es/components/virtual-list/src/defaults.mjs'
// import { ITEM_RENDER_EVT } from 'element-plus/es/components/virtual-list/src/defaults.mjs'
const route = useRoute()
// const router = useRouter()
const courseId = ref(0)
const courseId = ref()
//
const data = ref({})
//
const params = ref({
content: '',
content: '请添加整体目标',
id: '',
objectiveId: '',
})

@ -127,6 +127,13 @@ const rules = {
trigger: 'change',
},
],
description: [
{
required: true,
message: '请输入课程简介',
trigger: 'blur',
},
]
}
//
@ -243,20 +250,11 @@ const upload = async (option: any) => {
</script>
<template>
<el-drawer
:before-close="handleClose"
v-model="visibleDrawer"
direction="rtl"
:title="formModel.id ? '编辑课程' : '添加课程'"
>
<el-drawer :before-close="handleClose" v-model="visibleDrawer" direction="rtl"
:title="formModel.id ? '编辑课程' : '添加课程'">
<el-form :model="formModel" :rules="rules" ref="formRef">
<el-form-item label="课程封面" prop="img">
<el-upload
v-model="formModel.img"
class="avatar-uploader"
:http-request="upload"
:show-file-list="false"
>
<el-upload v-model="formModel.img" class="avatar-uploader" :http-request="upload" :show-file-list="false">
<img v-if="imgUrl" :src="imgUrl" class="avatar" />
<el-icon v-else class="avatar-uploader-icon">
<Plus />
@ -295,12 +293,8 @@ const upload = async (option: any) => {
</el-upload> -->
</el-form-item>
<el-form-item label="课程名称" prop="name">
<el-input
:disabled="nameDisabled"
style="width: 200px"
v-model="formModel.name"
@input="courseNameInput"
></el-input>
<el-input :disabled="nameDisabled" style="width: 200px" v-model="formModel.name"
@input="courseNameInput"></el-input>
</el-form-item>
<el-form-item label="课程类别" prop="category">
<el-radio-group v-model="formModel.category">
@ -316,25 +310,18 @@ const upload = async (option: any) => {
</el-radio-group>
</el-form-item>
<el-form-item label="课程编码" prop="code">
<el-input
style="width: 200px"
v-model="formModel.code"
:disabled="codeDisabled"
></el-input>
<el-input style="width: 200px" v-model="formModel.code" :disabled="codeDisabled"></el-input>
</el-form-item>
<el-form-item label="课程学分" prop="credit">
<el-input style="width: 200px" v-model="formModel.credit"></el-input>
</el-form-item>
<el-form-item label="课程学时" prop="classhours">
<el-input
style="width: 200px"
v-model="formModel.classhours"
></el-input>
<el-input style="width: 200px" v-model="formModel.classhours"></el-input>
</el-form-item>
<el-form-item label="考核类型" prop="assessmenttype">
<el-radio-group v-model="formModel.assessmenttype">
<el-radio value="1">考试</el-radio>
<el-radio value="2"></el-radio>
<el-radio value="2"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="考核方式" prop="assessmentway">
@ -344,14 +331,15 @@ const upload = async (option: any) => {
<el-radio value="3">其他</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="教学方法" prop="teachermethod">
<!-- <el-form-item label="教学方法" prop="teachermethod">
<el-input type="textarea" v-model="formModel.teachermethod" />
</el-form-item>
<el-form-item label="教学方式" prop="teacherway">
<el-input type="textarea" v-model="formModel.teacherway" />
</el-form-item>
</el-form-item> -->
<el-form-item label="课程简介" prop="description">
<el-input type="textarea" v-model="formModel.description" />
<textarea name="" id="" v-model="formModel.description"></textarea>
<!-- <el-input class="brief_text" type="textarea" /> -->
</el-form-item>
</el-form>
@ -367,6 +355,17 @@ const upload = async (option: any) => {
</el-drawer>
</template>
<style lang="scss" scoped>
textarea {
width: 400px;
height: 180px;
resize: none;
border: 1px solid #dcdfe6;
color: #606266;
line-height: 1.3;
letter-spacing: 1px;
border-radius: 6px;
}
.avatar-uploader {
:deep() {
.avatar {

Loading…
Cancel
Save