lyc-dev #29

Merged
lyc merged 2 commits from lyc-dev into main 2024-07-17 15:19:21 +08:00
4 changed files with 57 additions and 15 deletions
Showing only changes of commit b10b850b9a - Show all commits

View File

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

View File

@ -5,12 +5,12 @@
<ul> <ul>
<li class="list-item" v-for="item in sourceStore.result.list" :key="item.id"> <li class="list-item" v-for="item in sourceStore.result.list" :key="item.id">
<div class="item-left flex"> <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="flex item-left-content">
<div class="name flex">{{ item.fileShowName }}</div> <div class="name flex">{{ item.fileShowName }}</div>
<div class="item-tags flex"> <div class="item-tags flex">
<el-tag type="info" class="mr-10">{{ item.fileFlag }}</el-tag> <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="gray-text mr-10">{{ item.uploadTime }}上传</span>
<!-- <span class="line mr-10"></span> <!-- <span class="line mr-10"></span>
<span class="gray-text mr-10">下载3次</span> --> <span class="gray-text mr-10">下载3次</span> -->
@ -37,15 +37,11 @@
<i class="iconfont icon-xiazai"></i> <i class="iconfont icon-xiazai"></i>
<span>下载</span> <span>下载</span>
</div> </div>
<div class="item-popover-item" @click="moveFile(item)">
<i class="iconfont icon-xiazai"></i>
<span>移动至</span>
</div>
</div> </div>
</template> </template>
</el-popover> </el-popover>
<el-button size="small" plain round type="primary" @click="addLesson(item)">
<el-button size="small" plain round type="primary">
<i class="iconfont icon-jiahao"></i> <i class="iconfont icon-jiahao"></i>
备课</el-button> 备课</el-button>
</div> </div>
@ -63,10 +59,11 @@
</template> </template>
<script setup> <script setup>
import { ref } from 'vue' import { toRaw } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import FileImage from '@/components/file-image/index.vue' import FileImage from '@/components/file-image/index.vue'
import { deleteSmarttalk, updateSmarttalk } from '@/api/file' import { deleteSmarttalk, updateSmarttalk } from '@/api/file'
import { addFileToPrepare } from '@/api/subject'
import { getFileSuffix } from '@/utils/ruoyi' import { getFileSuffix } from '@/utils/ruoyi'
import useResoureStore from '../store' import useResoureStore from '../store'
@ -114,10 +111,39 @@ const delRow = (item) => {
} }
} }
// //
const moveFile = (item) => { const addLesson = ({ id }) => {
moveDialogVisible.value = true 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> </script>

View File

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

View File

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