Merge pull request 'zhuhao_dev' (#404) from zhuhao_dev into main

Reviewed-on: #404
This commit is contained in:
朱浩 2024-11-12 15:53:26 +08:00
commit 5cc93bb093
4 changed files with 50 additions and 16 deletions

View File

@ -53,3 +53,14 @@ export const moveSmarttalk = (params) => {
params
})
}
export const addFileToPrepareThird = (data) => {
return request({
url: '/smarttalk/file/addFileToPrepareThird',
method: 'post',
headers: {
'Content-Type': 'multipart/form-data'
},
data
})
}

View File

@ -48,7 +48,7 @@
const nodeClick = (data) => {
getNodeInfo.value = {
textbookId:data.node.rootid,
bookList:getFullObj(data.node)
cataList:getFullObj(data.node)
}
console.log(getNodeInfo.value,'log')
}

View File

@ -2,7 +2,6 @@
<div v-loading="isLoading" class="page-resource flex">
<ChooseTextbook @node-click="nodeClick" />
<div class="page-center-wrap">
<el-button @click="openChapter" type="primary">打开章节</el-button>
<el-tabs v-model="activeAptTab" style="height: 100%;">
<el-tab-pane label="教学课件" name="教学课件" class="prepare-center-jxkj">
<div class="prepare-center-header">
@ -141,8 +140,6 @@
<!-- 上课配置 -->
<class-start ref="calssRef" @close="closeChange"/>
<PptDialog @add-success="addAiPPT" :currentNode="currentNode" :uploadData="uploadData" v-model="pptDialog"/>
<!-- 章节弹窗 -->
<TreeLog ref="treelogRef"/>
<!-- <button @click="test">test</button> -->
</template>
<script setup>
@ -796,11 +793,6 @@ export default {
'&reservId=' +
id
})
},
//
openChapter(){
//
this.$refs.treelogRef.openDialog()
}
}
}

View File

@ -50,6 +50,10 @@
</div>
</div>
</div>
<el-button v-loading="item.loading" size="small" plain round type="primary" @click.stop="openChapter(item)">
<i class="iconfont icon-jiahao"></i>
备课</el-button
>
</li>
</ul>
</el-scrollbar>
@ -66,25 +70,27 @@
/>
</div>
<FilePreview ref="thirdPreview" v-model="isViewImg"></FilePreview>
<TreeLog ref="treelogRef" @onsuccess="addToPrepare"/>
</div>
</template>
<script setup>
import { ref } from 'vue'
// import { ElMessage, ElMessageBox } from 'element-plus'
import { Clock,View,Folder,Search } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'
import { Clock,View,Folder } from '@element-plus/icons-vue'
import FileImage from '@/components/file-image/index.vue'
import FilePreview from '@/components/thirdFile-preview/index.vue'
import useUserStore from '@/store/modules/user'
import useResoureStore from '../store'
import { addFileToPrepareThird } from '@/api/file'
import TreeLog from '@/views/prepare/components/treeLog.vue'
const userstore = useUserStore()
const sourceStore = useResoureStore()
// const userInfo = userstore.user
//
const isViewImg = ref(false)
const thirdPreview = ref()
const treelogRef = ref()
const currentItem = ref()
// change
const handleSizeChange = (limit) => {
@ -114,6 +120,31 @@ const handleRow = (item) => {
isViewImg.value = true
thirdPreview.value.init(item.itemId)
}
const openChapter = (item)=>{
currentItem.value = item
//
treelogRef.value.openDialog()
}
const addToPrepare = (data) => {
console.log(data)
let chapterArr = []
for (let i = 0; i < data.cataList.length; i++) {
chapterArr.push({id: data.cataList[i].id,name: data.cataList[i].title})
}
let postData = {
itemId: currentItem.value.itemId,
textBookId: data.textbookId,
chapter: JSON.stringify(chapterArr)
}
currentItem.value.loading = true
addFileToPrepareThird(postData).then((res) => {
currentItem.value.loading = false
console.log(res)
if (res.code === 200) {
ElMessage.success("加入备课成功")
}
})
}
</script>
<style lang="scss">