Compare commits
2 Commits
c150564797
...
fb6e0da6ff
Author | SHA1 | Date |
---|---|---|
朱浩 | fb6e0da6ff | |
朱浩 | 34fec10fc1 |
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "aix-win",
|
"name": "aix-win-ws",
|
||||||
"version": "2.5.1",
|
"version": "2.5.3",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"author": "上海交大重庆人工智能研究院",
|
"author": "上海交大重庆人工智能研究院",
|
||||||
|
|
|
@ -53,3 +53,14 @@ export const moveSmarttalk = (params) => {
|
||||||
params
|
params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const addFileToPrepareThird = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/smarttalk/file/addFileToPrepareThird',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
},
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -19,11 +19,12 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, defineExpose } from 'vue'
|
import { ref, defineExpose,defineEmits } from 'vue'
|
||||||
import ChooseTextbook from './chooseTextbook.vue'
|
import ChooseTextbook from './chooseTextbook.vue'
|
||||||
|
const emit = defineEmits(['onsuccess'])
|
||||||
|
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const getNodeInfo = ref([])
|
const getNodeInfo = ref({})
|
||||||
|
|
||||||
const openDialog = () => {
|
const openDialog = () => {
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
|
@ -47,12 +48,14 @@
|
||||||
const nodeClick = (data) => {
|
const nodeClick = (data) => {
|
||||||
getNodeInfo.value = {
|
getNodeInfo.value = {
|
||||||
textbookId:data.node.rootid,
|
textbookId:data.node.rootid,
|
||||||
bookList:getFullObj(data.node)
|
cataList:getFullObj(data.node)
|
||||||
}
|
}
|
||||||
|
console.log(getNodeInfo.value,'log')
|
||||||
}
|
}
|
||||||
|
|
||||||
const save = () => {
|
const save = () => {
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
|
emit('onsuccess', getNodeInfo.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
|
|
|
@ -50,6 +50,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</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>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
|
@ -66,17 +70,20 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<FilePreview ref="thirdPreview" v-model="isViewImg"></FilePreview>
|
<FilePreview ref="thirdPreview" v-model="isViewImg"></FilePreview>
|
||||||
|
<TreeLog ref="treelogRef" @onsuccess="addToPrepare"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
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 { Clock,View,Folder,Search } from '@element-plus/icons-vue'
|
||||||
import FileImage from '@/components/file-image/index.vue'
|
import FileImage from '@/components/file-image/index.vue'
|
||||||
import FilePreview from '@/components/thirdFile-preview/index.vue'
|
import FilePreview from '@/components/thirdFile-preview/index.vue'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import useResoureStore from '../store'
|
import useResoureStore from '../store'
|
||||||
|
import { addFileToPrepareThird } from '@/api/file'
|
||||||
|
import TreeLog from '@/views/prepare/components/treeLog.vue'
|
||||||
|
|
||||||
const userstore = useUserStore()
|
const userstore = useUserStore()
|
||||||
const sourceStore = useResoureStore()
|
const sourceStore = useResoureStore()
|
||||||
|
@ -85,6 +92,9 @@ const sourceStore = useResoureStore()
|
||||||
//判断是否预览图片
|
//判断是否预览图片
|
||||||
const isViewImg = ref(false)
|
const isViewImg = ref(false)
|
||||||
const thirdPreview = ref()
|
const thirdPreview = ref()
|
||||||
|
const treelogRef = ref()
|
||||||
|
const currentItem = ref()
|
||||||
|
const loading = ref(false)
|
||||||
|
|
||||||
// 分页change
|
// 分页change
|
||||||
const handleSizeChange = (limit) => {
|
const handleSizeChange = (limit) => {
|
||||||
|
@ -114,6 +124,31 @@ const handleRow = (item) => {
|
||||||
isViewImg.value = true
|
isViewImg.value = true
|
||||||
thirdPreview.value.init(item.itemId)
|
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>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
Loading…
Reference in New Issue