资源模块修改 #32

Merged
lyc merged 7 commits from lyc-dev into main 2024-07-18 09:32:37 +08:00
5 changed files with 14 additions and 27 deletions
Showing only changes of commit d6f82cf91a - Show all commits

View File

@ -112,8 +112,8 @@ const editUserInfo = async () =>{
const data = {
userId,
userName,
edustage: subjectVal.value,
edusubject: gradeVal.value
edustage: gradeVal.value,
edusubject: subjectVal.value
}
await updateUserInfo(data)
await userStore.getInfo()

View File

@ -16,7 +16,7 @@
<div class="file-list-item flex" v-for="(item, index) in fileList" :key="item.uid">
<div class="file-name">
<span class="name">标题</span>
<FileImage :fileName="item.name" size="50"/>
<FileImage :fileName="item.name" :size="50"/>
<el-input class="file-input" v-model="item.fileData.name" placeholder="请输入文件名" />
<span>.{{ getFileSuffix(item.name) }}</span>
</div>

View File

@ -8,7 +8,7 @@
}}</el-button>
</el-col>
<el-col :span="12" class="search-box flex">
<el-input v-model="sourceStore.searchKey" style="width: 240px" placeholder="请输入关键词" />
<el-input v-model="sourceStore.query.fileName" @input="sourceStore.changeName" style="width: 240px" placeholder="请输入关键词" />
</el-col>
</el-row>
<el-row class="resoure-btns">
@ -36,7 +36,6 @@
import useResoureStore from '../store'
const sourceStore = useResoureStore()
</script>
<style lang="scss" scoped>
.resoure-search {

View File

@ -1,7 +1,7 @@
<template>
<div class="page-resource flex">
<!--左侧 教材 目录-->
<ChooseTextbook @changeBook="changeBook" @nodeClick="nodeClick" />
<ChooseTextbook @changeBook="getData" @nodeClick="getData" />
<div class="page-right">
<!-- 搜索 -->
@ -27,7 +27,6 @@ import ResoureList from './container/resoure-list.vue'
import uploadDialog from '@/components/upload-dialog/index.vue'
import uploaderState from '@/store/modules/uploader'
const sourceStore = useResoureStore()
const isDialogOpen = ref(false)
@ -35,27 +34,13 @@ const openDialog = () => {
isDialogOpen.value = true
}
const onSubmit = (data)=>{
console.log(data)
}
//
const changeBook = (data) => {
getData(data)
}
//
const nodeClick = (data) => {
getData(data)
}
//
const getData = (data) => {
const { textBook, node } = data
let textbookId = textBook.curBookId
console.log(textbookId)
let levelFirstId = node.id
let levelSecondId = node.parentNode ? node.parentNode.id : ''
let levelSecondId = node.id
let levelFirstId = node.parentNode ? node.parentNode.id : ''
sourceStore.query = {
levelFirstId,
levelSecondId,

View File

@ -38,10 +38,7 @@ export default defineStore('resource', {
resourceTypeList,
resourceFormatList,
curFormat: -1,
searchKey: '',
// 新建资源
isCreate: false,
//节点数据
nodeData:{},
@ -55,6 +52,7 @@ export default defineStore('resource', {
// 资源类型 课件 素材 教案
fileFlag: '',
fileRoot: '资源',
fileName: '',
orderByColumn: 'uploadTime',
isAsc: 'desc',
...structQuery
@ -91,6 +89,11 @@ export default defineStore('resource', {
changeSuffix(val){
this.query.fileSuffix = val
this.handleQuery()
}
},
// 关键词搜索
changeName(){
console.log(this.query.fileName)
this.handleQuery()
},
}
})