fix🐛资源-平台资源和校本资源里别人上传的文件不应该可以编辑名称;

This commit is contained in:
yangws 2024-08-13 11:31:39 +08:00
parent 67320f897e
commit 776be8eaac
1 changed files with 10 additions and 3 deletions

View File

@ -94,13 +94,14 @@
</div> </div>
</template> </template>
<template v-else> <template v-else>
<div class="item-popover-item"> <!-- 判断是不是自己创建的课件-->
<div class="item-popover-item" v-if="userInfo.userId === Number(item.createUserId)">
<el-button text @click="editTalk(item, index)"> <el-button text @click="editTalk(item, index)">
<i class="iconfont icon-bianji"></i> <i class="iconfont icon-bianji"></i>
<span>重命名</span> <span>重命名</span>
</el-button> </el-button>
</div> </div>
<div class="item-popover-item"> <div class="item-popover-item" v-if="userInfo.userId === Number(item.createUserId)">
<el-button text @click="deleteTalk(item)"> <el-button text @click="deleteTalk(item)">
<i class="iconfont icon-shanchu"></i> <i class="iconfont icon-shanchu"></i>
<span>删除</span> <span>删除</span>
@ -140,6 +141,7 @@ import { asyncLocalFile } from '@/utils/talkFile'
import { toTimeText } from '@/utils/date' import { toTimeText } from '@/utils/date'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { deleteSmarttalk, updateSmarttalk, getPrepareById } from '@/api/file' import { deleteSmarttalk, updateSmarttalk, getPrepareById } from '@/api/file'
import useUserStore from '@/store/modules/user'
const { ipcRenderer } = window.electron || {} const { ipcRenderer } = window.electron || {}
export default { export default {
@ -162,11 +164,13 @@ export default {
emits: { 'on-move': null, 'on-delete': null, 'on-set': null, 'on-delhomework': null }, emits: { 'on-move': null, 'on-delete': null, 'on-set': null, 'on-delhomework': null },
data() { data() {
return { return {
listenList: [] listenList: [],
userInfo:{}
} }
}, },
methods: { methods: {
editTalk(item) { editTalk(item) {
console.log(item,this.userInfo,'this.userInfo')
ElMessageBox.prompt('请输入新的名称', '重命名', { ElMessageBox.prompt('请输入新的名称', '重命名', {
confirmButtonText: '确认', confirmButtonText: '确认',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -253,6 +257,9 @@ export default {
deleteHomework(item){ deleteHomework(item){
this.$emit('on-delhomework', item) this.$emit('on-delhomework', item)
} }
},
mounted() {
this.userInfo = useUserStore().user
} }
} }
</script> </script>