This commit is contained in:
lyc 2024-07-17 14:34:02 +08:00
parent 8fe2602598
commit b10b850b9a
4 changed files with 57 additions and 15 deletions

View File

@ -8,3 +8,12 @@ export const listEvaluation = (params)=> {
params
})
}
export const addFileToPrepare = (params) => {
return request({
url: '/smarttalk/file/addFileToPrepare',
method: 'post',
params
})
}

View File

@ -5,12 +5,12 @@
<ul>
<li class="list-item" v-for="item in sourceStore.result.list" :key="item.id">
<div class="item-left flex">
<FileImage :fileName="item.fileName" :size="50" />
<FileImage :fileName="item.fileShowName" :size="50" />
<div class="flex item-left-content">
<div class="name flex">{{ item.fileShowName }}</div>
<div class="item-tags flex">
<el-tag type="info" class="mr-10">{{ item.fileFlag }}</el-tag>
<el-tag type="info" class="mr-10">{{ getFileSuffix(item.fileName) }}</el-tag>
<el-tag type="info" class="mr-10">{{ getFileSuffix(item.fileShowName) }}</el-tag>
<span class="gray-text mr-10">{{ item.uploadTime }}上传</span>
<!-- <span class="line mr-10"></span>
<span class="gray-text mr-10">下载3次</span> -->
@ -37,15 +37,11 @@
<i class="iconfont icon-xiazai"></i>
<span>下载</span>
</div>
<div class="item-popover-item" @click="moveFile(item)">
<i class="iconfont icon-xiazai"></i>
<span>移动至</span>
</div>
</div>
</template>
</el-popover>
<el-button size="small" plain round type="primary">
<el-button size="small" plain round type="primary" @click="addLesson(item)">
<i class="iconfont icon-jiahao"></i>
备课</el-button>
</div>
@ -63,10 +59,11 @@
</template>
<script setup>
import { ref } from 'vue'
import { toRaw } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import FileImage from '@/components/file-image/index.vue'
import { deleteSmarttalk, updateSmarttalk } from '@/api/file'
import { addFileToPrepare } from '@/api/subject'
import { getFileSuffix } from '@/utils/ruoyi'
import useResoureStore from '../store'
@ -114,11 +111,40 @@ const delRow = (item) => {
}
}
//
const moveFile = (item) => {
moveDialogVisible.value = true
//
const addLesson = ({ id }) => {
let data = {
id,
fileRoot: '资源',
...(toRaw(sourceStore.nodeData)),
}
//
for (let key in data) {
if (!data[key]) {
delete data[key]
}
}
try {
sourceStore.loading = true
addFileToPrepare(data).then(() => {
ElMessage.success('操作成功')
})
}
finally {
sourceStore.loading = false
}
// ElMessageBox.confirm('', '', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning'
// }).then(() => {
// ElMessage.success('')
// }).catch(() => { })
}
</script>
<style>

View File

@ -16,7 +16,6 @@
</div>
<!-- 上传弹窗 -->
<uploadDialog v-model="isDialogOpen" @submitFile="submitFile" />
<!-- <MoveFile v-model="isDialogOpen" @onSubmit="onSubmit" /> -->
</template>
<script setup>
@ -64,6 +63,11 @@ const getData = (data) => {
levelSecondId,
...sourceStore.query
}
sourceStore.nodeData = {
textBookId,
levelFirstId,
levelSecondId,
}
sourceStore.handleQuery()
}

View File

@ -42,6 +42,9 @@ export default defineStore('resource', {
searchKey: '',
// 新建资源
isCreate: false,
//节点数据
nodeData:{},
loading: false,
//查询条件
query: {