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