changes style

develoop
ww 5 months ago
commit 0d469d9cc1
  1. 7
      package.json
  2. 7935
      pnpm-lock.yaml
  3. 106
      src/views/MyCourseStudy/learningProcess.vue
  4. 158
      src/views/courseResources/componse/resourceAdd.vue
  5. 66
      src/views/courseResources/index.vue

@ -19,22 +19,29 @@
"dependencies": { "dependencies": {
"3d-force-graph": "^1.73.3", "3d-force-graph": "^1.73.3",
"@element-plus/icons-vue": "^2.3.1", "@element-plus/icons-vue": "^2.3.1",
"@vueup/vue-quill": "^1.2.0",
"@vueuse/core": "^10.9.0", "@vueuse/core": "^10.9.0",
"ali-oss": "^6.20.0", "ali-oss": "^6.20.0",
"axios": "^1.6.8", "axios": "^1.6.8",
"d3": "^5.16.0", "d3": "^5.16.0",
"echarts": "^5.5.0", "echarts": "^5.5.0",
<<<<<<< HEAD
"element-plus": "^2.6.0", "element-plus": "^2.6.0",
"jwt-decode": "^4.0.0", "jwt-decode": "^4.0.0",
=======
>>>>>>> f6dea2720fd0ad6ab62f53607d894cd0c406cb6d
"echarts-liquidfill": "^3.1.0", "echarts-liquidfill": "^3.1.0",
"element-plus": "^2.6.0",
"form-data": "^4.0.0", "form-data": "^4.0.0",
"jquery": "^3.7.1", "jquery": "^3.7.1",
"jwt-decode": "^4.0.0",
"nanoid": "^5.0.7", "nanoid": "^5.0.7",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"pinia": "^2.1.7", "pinia": "^2.1.7",
"three": "^0.163.0", "three": "^0.163.0",
"vue": "^3.4.27", "vue": "^3.4.27",
"vue-echarts": "^6.7.2", "vue-echarts": "^6.7.2",
"vue-quill": "^1.5.1",
"vue-router": "^4.3.0" "vue-router": "^4.3.0"
}, },
"devDependencies": { "devDependencies": {

File diff suppressed because it is too large Load Diff

@ -161,32 +161,39 @@ const goToAnotherPage = (address) => {
v-if="showCheckbox" v-if="showCheckbox"
/> />
<div class="right"> <img
<div class="video"> class="img"
<img :src="record.content"
:src="record.content" @click="goToAnotherPage(record.address)"
style="width: 100%" style="margin-bottom: 10px"
height="100%" />
@click="goToAnotherPage(record.address)"
/> <div
</div> style="
<div class="info"> display: flex;
<div class="tv"> justify-content: space-between;
<div class="name"> flex-grow: 1;
{{ record.coursesName }} margin-top: 10px;
</div> margin-bottom: 10px;
<el-icon "
style="float: right" >
@click="onDeleteRecord(record.id)" <p>
> {{ record.coursesName }}
<Delete /> </p>
</el-icon> <el-icon @click="onDeleteRecord(record.id)">
</div> <Delete />
<div class="tv"> </el-icon>
<div class="time">{{ record.time }}</div> </div>
<div class="views">{{ record.number }} 观看次数</div> <div
</div> style="
</div> display: flex;
justify-content: space-between;
flex-grow: 1;
margin-top: 10px;
"
>
<p>{{ record.time }}</p>
<p>{{ record.number }} 观看次数</p>
</div> </div>
</li> </li>
</ul> </ul>
@ -211,10 +218,6 @@ const goToAnotherPage = (address) => {
</template> </template>
<style scoped> <style scoped>
.right {
float: right;
}
.record { .record {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -234,58 +237,33 @@ const goToAnotherPage = (address) => {
margin: 10px 0; margin: 10px 0;
} }
ul { ul {
/* flex-wrap: wrap; */
/* margin-bottom: 10px; */
list-style-type: none; list-style-type: none;
padding: 10; padding: 10;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
/* justify-content: space-evenly; */
justify-content: start; justify-content: start;
} }
li { li {
transition: filter 0.3s; /* 添加过渡动画 */ transition: filter 0.3s; /* 添加过渡动画 */
flex: 0 0 20%; flex: 0 0 20%;
/* width: 18%; */ flex-direction: column;
margin-bottom: 10px; margin-bottom: 10px;
padding: 10px; padding: 10px;
box-sizing: border-box; box-sizing: border-box;
/* border: 1px solid #ccc; */
/* border-radius: 4px; */
/* text-align: center; */
transition: box-shadow 0.3s; transition: box-shadow 0.3s;
cursor: pointer; cursor: pointer;
align-items: center;
} }
li:hover { li:hover {
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
} }
.video {
.img {
width: 100%; width: 100%;
height: 150px; height: 100%;
background-color: #d7e8f2;
}
.info {
display: flex;
/* overflow: hidden; */
flex-direction: column;
}
.name {
float: left;
margin: 5px;
font-size: 15px;
}
.tv {
/* display: grid */
margin: 5px;
font-size: 10px;
display: flex;
justify-content: space-between;
align-items: center;
}
.time {
float: left;
}
.views {
float: right;
} }
</style> </style>

@ -1,7 +1,9 @@
<script setup> <script lang="ts" setup>
import { ref } from 'vue' import { ref } from 'vue'
import { CourseResourceControllerService } from '../../../../generated/services/CourseResourceControllerService'
const props = defineProps(['dafulIndex']) const props = defineProps(['dafulIndex'])
import { QuillEditor } from '@vueup/vue-quill'
import '@vueup/vue-quill/dist/vue-quill.snow.css'
// //
const visibleDramwer = ref(false) const visibleDramwer = ref(false)
// //
@ -17,28 +19,28 @@ const defaultForm = {
const formModel = ref({ const formModel = ref({
...defaultForm, ...defaultForm,
}) })
// //
const imgUrl = ref('') const rules = {
const onSelectFile = (uploadFile) => { name: [
imgUrl.value = URL.createObjectURL(uploadFile.raw) { required: true, message: '请输入资源名称', trigger: 'blur' },
{ min: 3, max: 10, message: '长度在 3 到 10 个字符', trigger: 'blur' },
],
} }
//selectedOption
// const selectedOption = ref('')
//
// import tool from '@/utils/oss.js'
// const FileList = ref([])
// const upload = async (option) => {
// const res = await tool.oss.upload(option.file)
// console.log(22, res)
// console.log(res.name)
// const url = 'https://wenyu132.oss-cn-beijing.aliyuncs.com/' + res.name
// console.log(url)
// }
//open //open
const open = (row) => { const open = async (row) => {
visibleDramwer.value = true visibleDramwer.value = true
//console.log(row.id)
if (row.id) { if (row.id) {
//row.id //row.id
const res = await CourseResourceControllerService.getAllUsingGet1(row.id)
//
formModel.value = res.data.records
console.log(res)
//
//
console.log('编辑回显') console.log('编辑回显')
} else { } else {
// //
@ -61,7 +63,20 @@ const selectOp = ref([
{ label: '文件', value: '5' }, { label: '文件', value: '5' },
{ label: '音频', value: '6' }, { label: '音频', value: '6' },
]) ])
function handleSel() {} const handleSel = () => {}
//
import type { UploadProps, UploadUserFile } from 'element-plus'
const fileList = ref<UploadUserFile[]>([])
const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
console.log(uploadFile, uploadFiles)
}
const handlePreview: UploadProps['onPreview'] = (file) => {
console.log(file)
}
</script> </script>
<template> <template>
<el-drawer <el-drawer
@ -71,7 +86,13 @@ function handleSel() {}
size="50%" size="50%"
> >
<!-- 添加资源表单 --> <!-- 添加资源表单 -->
<el-form :model="formModel" ref="formRef" label-width="100px"> <el-form
class="resourceformModel"
:model="formModel"
ref="formRef"
:rules="rules"
label-width="100px"
>
<el-form-item label="资源名称" prop="name"> <el-form-item label="资源名称" prop="name">
<el-input <el-input
v-model="formModel.name" v-model="formModel.name"
@ -79,63 +100,60 @@ function handleSel() {}
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="资源类型"> <el-form-item label="资源类型">
<div class="flex flex-wrap gap-4 items-center"> <el-select
<el-select @change="handleSel"
@change="handleSel" v-model="selectVal"
v-model="selectVal" placeholder="请选择资源类型"
placeholder="Select" size="large"
size="large" style="width: 100%"
style="width: 240px" >
> <el-option
<el-option v-for="item in selectOp"
v-for="item in selectOp" :key="item.value"
:key="item.value" :label="item.label"
:label="item.label" :value="item.value"
:value="item.value" />
/> </el-select>
</el-select>
</div>
</el-form-item>
<el-form-item label="资源简介" prop="description">
资源简介
<!-- <el-input
v-model="formModel.description"
placeholder="请输入资源简介"
></el-input> -->
</el-form-item> </el-form-item>
<el-form-item label="上传资源" prop="img"> <el-form-item label="上传资源" prop="fileList">
<!-- 此处需要关闭element-plus的自动上传不需要配置action等参数
只需要前端的本地预览图片无需在提交前上传图标
-->
<el-upload <el-upload
class="avatar-uploader" v-model:file-list="fileList"
:show-file-list="false"
:auto-upload="false"
:onchange="onSelectFile"
>
<img v-if="imgUrl" :src="imgUrl" class="avatar" />
<el-icon v-else class="avatar-uploader-icon">
<Plus />
</el-icon>
</el-upload>
<!-- <el-upload
v-model:file-list="FileList"
:http-request="upload"
class="upload-demo" class="upload-demo"
multiple action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
:on-preview="handlePreview"
:on-remove="handleRemove"
list-type="picture"
> >
<el-button type="primary">点击上传</el-button> <el-button type="primary">点击上传资源</el-button>
<template #tip> <template #tip>
<div class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> <div class="el-upload__tip">
jpg/png files with a size less than 500kb
</div>
</template> </template>
</el-upload> --> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="资源简介" prop="description">
<el-form-item class="bottom-box"> <div class="editor">
<el-button type="info" @click="onRemoval">取消</el-button> <quill-editor
<el-button type="primary">确定</el-button> v-model:description="formModel.description"
content-type="html"
theme="snow"
></quill-editor>
</div>
</el-form-item>
<el-form-item>
<el-button type="primary">取消</el-button>
<el-button type="info">确定</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-drawer> </el-drawer>
</template> </template>
<style scoped></style> <style lang="scss" scoped>
.editor {
width: 100%;
:deep(.ql-editor) {
min-height: 200px;
}
}
</style>

@ -171,22 +171,30 @@ const onEditResource = (row) => {
:key="resource.id" :key="resource.id"
v-loading="loading" v-loading="loading"
> >
<div> <div
<div class="icon"> style="
<el-icon @click="onDeleteResource(resource.id)"> display: flex;
<Delete /> justify-content: space-between;
</el-icon> margin-bottom: 10px;
<el-icon @click="onEditResource"> "
<Edit /> >
</el-icon> <el-icon @click="onDeleteResource(resource.id)">
</div> <Delete />
<div class="vedio" @click="generateRecords(resource)"> </el-icon>
<img style="height: 200px" :src="resource.img" /> <el-icon @click="onEditResource(row)">
</div> <Edit />
<div class="resource-info"> </el-icon>
<div class="zy-name">{{ resource.name }}</div> </div>
<div class="zy-info">{{ resource.description }}</div> <div
</div> class="vedio"
@click="generateRecords(resource)"
style="margin-top: 10px; margin-bottom: 10px"
>
<img :src="resource.img" />
</div>
<div class="box" style="display: flex; flex-direction: column">
<p style="margin-bottom: 10px">{{ resource.name }}</p>
<p style="margin-top: 10px">{{ resource.description }}</p>
</div> </div>
</li> </li>
</ul> </ul>
@ -212,6 +220,7 @@ const onEditResource = (row) => {
:dafulIndex="params.type" :dafulIndex="params.type"
ref="resourceAddRef" ref="resourceAddRef"
></resource-add> ></resource-add>
<!-- -->
</div> </div>
</div> </div>
</div> </div>
@ -259,6 +268,11 @@ ul {
li { li {
transition: filter 0.3s; /* 添加过渡动画 */ transition: filter 0.3s; /* 添加过渡动画 */
flex: 0 0 20%; flex: 0 0 20%;
<<<<<<< HEAD
=======
flex-direction: column;
align-items: center;
>>>>>>> f6dea2720fd0ad6ab62f53607d894cd0c406cb6d
margin-bottom: 10px; margin-bottom: 10px;
padding: 10px; padding: 10px;
box-sizing: border-box; box-sizing: border-box;
@ -281,23 +295,7 @@ li:hover {
bottom: 0; bottom: 0;
margin: 0 auto; margin: 0 auto;
} }
.icon { .box p:hover {
display: flex; font-weight: bold;
justify-content: space-between;
}
.resource-info {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.zy-name:hover {
color: rgb(138, 201, 243); /* 鼠标经过时将字体颜色设置为蓝色 */
}
.zy-name {
margin-top: 10px;
font-size: 20px;
}
.zy-info {
margin-top: 20px;
} }
</style> </style>

Loading…
Cancel
Save