Compare commits

..

No commits in common. "fb6e0da6ff25fff8ac541a736ab424df86f565ed" and "c150564797865a3eba4944a98f7338fb71992ef3" have entirely different histories.

4 changed files with 14 additions and 63 deletions

View File

@ -1,6 +1,6 @@
{
"name": "aix-win-ws",
"version": "2.5.3",
"name": "aix-win",
"version": "2.5.1",
"description": "",
"main": "./out/main/index.js",
"author": "上海交大重庆人工智能研究院",

View File

@ -53,14 +53,3 @@ 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

@ -17,19 +17,18 @@
</el-dialog>
</div>
</template>
<script setup>
import { ref, defineExpose,defineEmits } from 'vue'
import { ref, defineExpose } from 'vue'
import ChooseTextbook from './chooseTextbook.vue'
const emit = defineEmits(['onsuccess'])
const dialogVisible = ref(false)
const getNodeInfo = ref({})
const getNodeInfo = ref([])
const openDialog = () => {
dialogVisible.value = true
}
const getFullObj = (node) => {
const obj = []
const recursive = (currentNode) => {
@ -44,21 +43,19 @@
recursive(node)
return obj
}
const nodeClick = (data) => {
getNodeInfo.value = {
textbookId:data.node.rootid,
cataList:getFullObj(data.node)
bookList:getFullObj(data.node)
}
console.log(getNodeInfo.value,'log')
}
const save = () => {
dialogVisible.value = false
emit('onsuccess', getNodeInfo.value)
}
defineExpose({
openDialog
})
</script>
</script>

View File

@ -50,10 +50,6 @@
</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>
@ -70,20 +66,17 @@
/>
</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 { ElMessage, ElMessageBox } from 'element-plus'
import { Clock,View,Folder,Search } 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()
@ -92,9 +85,6 @@ const sourceStore = useResoureStore()
//
const isViewImg = ref(false)
const thirdPreview = ref()
const treelogRef = ref()
const currentItem = ref()
const loading = ref(false)
// change
const handleSizeChange = (limit) => {
@ -124,31 +114,6 @@ 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">