JayChou 3 months ago
commit 739b07b103
  1. 4
      .env.development
  2. 8333
      pnpm-lock.yaml
  3. 11
      src/views/MyCourseStudy/learningProcess.vue
  4. 30
      src/views/course/components/KnowledgeGraphUi/foldInfoUi.vue
  5. 10
      src/views/course/courseChapters.vue
  6. 26
      src/views/courseResources/componse/resourceAdd.vue
  7. 14
      src/views/courseResources/index.vue

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

File diff suppressed because it is too large Load Diff

@ -4,19 +4,26 @@ import { ref } from 'vue'
import { ElMessageBox, ElMessage } from 'element-plus' import { ElMessageBox, ElMessage } from 'element-plus'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import useUserStore from '@/store/modules/user'
import { onMounted } from 'vue'
// //
import { LearningRecordsControllerService } from '../../../generated/services/LearningRecordsControllerService' import { LearningRecordsControllerService } from '../../../generated/services/LearningRecordsControllerService'
const total = ref(0) const total = ref(0)
const userStore = useUserStore()
const recordList = ref([]) const recordList = ref([])
const selectedIds = ref([]) const selectedIds = ref([])
const loading = ref(false) const loading = ref(false)
const showCheckbox = ref(false) const showCheckbox = ref(false)
onMounted(()=>{
userStore.getUserInfo()
})
const params = ref({ const params = ref({
// pagesize: '10', // pagesize: '10',
// pagenum: '1', // pagenum: '1',
userId: '1', userId: userStore.data.id,
}) })
console.log(userStore.data.id);
// //
const getrecordList = async () => { const getrecordList = async () => {
//console.log(1111111) //console.log(1111111)

@ -17,7 +17,7 @@
<div class="my-tag">本章资源</div> <div class="my-tag">本章资源</div>
</div> </div>
<button class="my-button" @click.stop="emits('edit', item)" style="margin-right: 10px;">编辑</button> <button class="my-button" @click.stop="emits('edit', item)" style="margin-right: 10px;">编辑</button>
<el-button type="danger" class="is-el-button" :loading="loading&&item.id===activeData.id" @click.stop="hanDel(item)" style="margin-right: 10px;">删除</el-button> <my-btn :id="item.id" type="danger" class="is-el-button" style="margin-right: 10px;">删除</my-btn>
</div> </div>
</template> </template>
<template #default> <template #default>
@ -40,8 +40,9 @@
<div class="my-tag" type="warning">{{ obj.totalclasshours }}学时</div> <div class="my-tag" type="warning">{{ obj.totalclasshours }}学时</div>
</div> </div>
<div class="tit-box-edit"> <div class="tit-box-edit">
<button class="my-button" @click.stop="emits('edit', obj)" style="margin-right: 10px;">编辑</button> <button class="my-button" @click.stop="emits('edit', obj)"
<el-button type="danger" class="is-el-button" :loading="loading&&obj.id==activeData.id" my-type="error" @click.stop="hanDel(obj)">删除</el-button> style="margin-right: 10px;">编辑</button>
<my-btn :id="obj.id" type="danger" class="is-el-button" style="margin-right: 10px;">删除</my-btn>
</div> </div>
</div> </div>
</div> </div>
@ -62,13 +63,24 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue' import { ElButton } from 'element-plus';
defineProps(['foldInfoData','loading']) import { ref, h, type SetupContext, withModifiers } from 'vue'
defineProps(['foldInfoData'])
const emits = defineEmits(['add', 'del', 'edit']) const emits = defineEmits(['add', 'del', 'edit'])
const activeData = ref({id:undefined})
function hanDel(o:any){ const MyBtn = {
activeData.value = o props: ['id'],
emits('del', o.id) setup(props:{id:string}, context:SetupContext) {
const loading = ref(false)
const setLoading = (bool: boolean) => loading.value = bool
return ()=> h(ElButton, {
loading: loading.value,
onClick: withModifiers(function () {
emits('del', props.id,setLoading)
}, ['stop']),
...context.attrs,
}, context.slots)
}
} }
</script> </script>

@ -16,8 +16,7 @@
</div> </div>
<div class="bottom"> <div class="bottom">
<!-- 可折叠基本概念 --> <!-- 可折叠基本概念 -->
<fold-info-ui :foldInfoData="foldInfoData" @add="showHide = true" @edit="hanEdit" @del="flodDel" <fold-info-ui :foldInfoData="foldInfoData" @add="showHide = true" @edit="hanEdit" @del="flodDel" />
:loading="foldDelLoading" />
<FoldAdd v-model:is-d="showHide" v-if="showHide" :data="foldInfoData" @submit="foldAddSubmit" /> <FoldAdd v-model:is-d="showHide" v-if="showHide" :data="foldInfoData" @submit="foldAddSubmit" />
<FoldEdit v-model:is-d="showHide1" v-if="showHide1" :editData="activeEditData" :data="foldInfoData" <FoldEdit v-model:is-d="showHide1" v-if="showHide1" :editData="activeEditData" :data="foldInfoData"
@submit="foldEditSubmit" /> @submit="foldEditSubmit" />
@ -91,9 +90,8 @@ function foldAddSubmit(data: any, updLoading: Function) {
}).finally(() => updLoading(false)) }).finally(() => updLoading(false))
} }
// //
const foldDelLoading = ref(false) function flodDel(id: string,setLoading:Function) {
function flodDel(id: string) { setLoading(true)
foldDelLoading.value = true
deleteSectionApi(id).then(() => { deleteSectionApi(id).then(() => {
ElMessage({ ElMessage({
message: `删除成功`, message: `删除成功`,
@ -105,7 +103,7 @@ function flodDel(id: string) {
message: `删除失败`, message: `删除失败`,
type: 'error' type: 'error'
}) })
}).finally(() => foldDelLoading.value = false) }).finally(() =>setLoading(false))
} }
// //
const showHide1 = ref(false) const showHide1 = ref(false)

@ -3,6 +3,8 @@ import { ref } from 'vue'
const visibilerDrawer = ref(false) const visibilerDrawer = ref(false)
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { CourseResourceControllerService } from '../../../../generated/services/CourseResourceControllerService' import { CourseResourceControllerService } from '../../../../generated/services/CourseResourceControllerService'
import tool from '@/utils/oss.js'
import { id } from 'element-plus/es/locales.mjs';
// //
const defaultForm = { const defaultForm = {
description: '', description: '',
@ -13,13 +15,25 @@ const defaultForm = {
path: '', path: '',
} }
const imageUrl = ref('') const imageUrl = ref('')
const onSelectFile = (uploadFile) => { //oss
// console.log(uploadFile) const upload = async (option) =>{
// //
imageUrl.value = URL.createObjectURL(uploadFile.raw) imageUrl.value = URL.createObjectURL(option.raw)
// const res = await tool.oss.upload(option.raw);//
formModel.value.img = uploadFile.raw const url = "https://wenyu132.oss-cn-beijing.aliyuncs.com/" + res.name;//url
console.log(url);
//url
formModel.value.img = url
} }
// const onSelectFile = (uploadFile) => {
// // console.log(uploadFile)
// //
// imageUrl.value = URL.createObjectURL(uploadFile.raw)
// //
// formModel.value.img = uploadFile.raw
// }
// //
const formModel = ref({ const formModel = ref({
@ -184,7 +198,7 @@ defineExpose({
:show-file-list="false" :show-file-list="false"
:auto-upload="false" :auto-upload="false"
:before-upload="beforeAvatarUpload" :before-upload="beforeAvatarUpload"
:on-change="onSelectFile" :on-change="upload"
> >
<img v-if="imageUrl" :src="imageUrl" class="avatar" /> <img v-if="imageUrl" :src="imageUrl" class="avatar" />
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon> <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>

@ -14,6 +14,9 @@ import { LearningRecordsControllerService } from '../../../generated/services/Le
import { CourseResourceControllerService } from '../../../generated/services/CourseResourceControllerService' import { CourseResourceControllerService } from '../../../generated/services/CourseResourceControllerService'
import resourceAdd from './componse/resourceAdd.vue' import resourceAdd from './componse/resourceAdd.vue'
import useUserStore from '@/store/modules/user'
import { onMounted } from 'vue'
const total = ref(0) const total = ref(0)
const pptresourceList = ref([]) const pptresourceList = ref([])
@ -77,20 +80,25 @@ const onDeleteResource = async (ids) => {
ElMessage({ type: 'success', message: '删除成功' }) ElMessage({ type: 'success', message: '删除成功' })
getpptresourceList() getpptresourceList()
} }
const userStore = useUserStore()
onMounted(()=>{
userStore.getUserInfo()
})
const param = ref({ const param = ref({
coursesId: '', coursesId: '',
userId: '1', coursesName: '',
userId: userStore.data.id,
open: '1', open: '1',
download: '0', download: '0',
content: '', content: '',
address: '/portal', address: '/portal',
type: '1', type: '4',
}) })
// //
const generateRecords = async (rescource) => { const generateRecords = async (rescource) => {
param.value.content = rescource.img param.value.content = rescource.img
param.value.coursesId = rescource.id.toString() param.value.coursesId = rescource.id.toString()
param.value.coursesName = rescource.name
await LearningRecordsControllerService.saveRecordsUsingPost1(param.value) await LearningRecordsControllerService.saveRecordsUsingPost1(param.value)
// console.log(param) // console.log(param)
} }

Loading…
Cancel
Save