1、文档中心权限调整

2、下载权限调整
3、消息中心
4、修复预览关闭窗口时视屏播放暂停不了问题
This commit is contained in:
pan 2024-09-01 10:57:25 +08:00
parent b500c53218
commit 40525f5b49
6 changed files with 373 additions and 16 deletions

View File

@ -175,7 +175,7 @@
v-hasPermi="['document:remove']" v-hasPermi="['document:remove']"
>删除</el-button> >删除</el-button>
<el-button type="text" icon="el-icon-download" @click="handleDownload(scope.row)" <el-button type="text" icon="el-icon-download" @click="handleDownload(scope.row)"
v-hasPermi="['document:batch:remove']" v-if="scope.row.downloadStatus"
v-loading="loadingDownload">下载</el-button> v-loading="loadingDownload">下载</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -213,8 +213,8 @@
</span> </span>
</el-dialog> </el-dialog>
<el-dialog :title="viewDialogTitle" :visible.sync="viewDialogOpen" fullscreen width="500px" append-to-body> <el-dialog :title="viewDialogTitle" :visible.sync="viewDialogOpen" fullscreen width="500px" append-to-body :before-close="handleBeforeClose">
<i-frame :src="previewUrl" /> <i-frame :src="previewUrl" v-if="viewDialogOpen"/>
</el-dialog> </el-dialog>
<el-drawer :visible.sync="open" :modal-append-to-body="false" size="75%"> <el-drawer :visible.sync="open" :modal-append-to-body="false" size="75%">
@ -275,6 +275,8 @@ import editDocument from "./editDocument";
import uploadProgress from "./uploadProgress"; import uploadProgress from "./uploadProgress";
import { w3cwebsocket as WebSocket } from 'websocket'; import { w3cwebsocket as WebSocket } from 'websocket';
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import { addCount } from "@/api/tool/downloadCount";
export default { export default {
name: "Document", name: "Document",
components: { iFrame, editDocument, uploadProgress, Treeselect}, components: { iFrame, editDocument, uploadProgress, Treeselect},
@ -331,6 +333,9 @@ export default {
docSource: '', docSource: '',
docStatus: '', docStatus: '',
docCategoryId: '', docCategoryId: '',
createById: this.$store.getters.userId,
permissionCheck: true,
downloadCheck:true
}, },
// //
form: { form: {
@ -447,9 +452,9 @@ export default {
}) })
}, },
handlePreview(row){ handlePreview(row){
this.viewDialogOpen = true;
this.previewUrl = process.env.VUE_APP_TOOL_TECH_FILE_VIEW_API + '/onlinePreview?url=' + encodeURIComponent(Base64.encode(process.env.VUE_APP_BASE_API + row.docUrl)); this.previewUrl = process.env.VUE_APP_TOOL_TECH_FILE_VIEW_API + '/onlinePreview?url=' + encodeURIComponent(Base64.encode(process.env.VUE_APP_BASE_API + row.docUrl));
this.viewDialogTitle = '文档在线预览' this.viewDialogTitle = '文档在线预览'
this.viewDialogOpen = true;
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
@ -539,6 +544,15 @@ export default {
let self = this let self = this
self.loadingDownload = true self.loadingDownload = true
this.$download.resource(row.docUrl); this.$download.resource(row.docUrl);
//
if(row.toolId){
let formData = {
toolId: row.toolId
}
addCount(formData).then(res => {
console.info("res==========", res)
});
}
setTimeout(()=>{ setTimeout(()=>{
self.loadingDownload = false self.loadingDownload = false
},1000) },1000)
@ -596,6 +610,9 @@ export default {
excludeFields:excludeFields, excludeFields:excludeFields,
}, `文档资源信息数据_${new Date().getTime()}.xlsx`) }, `文档资源信息数据_${new Date().getTime()}.xlsx`)
}, },
handleBeforeClose() {
this.viewDialogOpen = false
}
} }
}; };

View File

@ -117,9 +117,9 @@
@close="detailDrawerOpen = false" @close="detailDrawerOpen = false"
> >
<el-table :data="toolDownDetailStatList" v-loading="loading"> <el-table :data="toolDownDetailStatList" v-loading="loading">
<el-table-column label="下载用户" align="center" key="userName" prop="userName" min-width="120" /> <el-table-column label="下载用户" align="center" key="nickName" prop="nickName" min-width="120" />
<el-table-column label="下载次数" align="center" key="toolDownNum" prop="toolDownNum" min-width="120" /> <el-table-column label="下载次数" align="center" key="toolDownNum" prop="toolDownNum" min-width="120" />
<el-table-column label="下载时间" align="center" key="donwTime" prop="donwTime" min-width="120" /> <el-table-column label="下载时间" align="center" key="createTime" prop="createTime" min-width="120" />
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"

View File

@ -0,0 +1,306 @@
<template>
<div class="fbox1">
<div class="fl">
<el-tabs v-model="detailActiveName">
<el-tab-pane label="文件信息" name="first">
<el-table :data="docList" style="width: 100%">
<el-table-column label="文档名称" prop="docName" :show-overflow-tooltip="true" />
<el-table-column label="类别" prop="docType" :show-overflow-tooltip="true" width="80" >
<template slot-scope="scope">
<dict-tag :options="dict.type.doc_class" :value="scope.row.docType"/>
</template>
</el-table-column>
<el-table-column label="负责人" prop="docPrincipals" :show-overflow-tooltip="true" width="80" />
<el-table-column label="归属单位" align="center" prop="docRespDeptName" :show-overflow-tooltip="true" width="80" />
<el-table-column label="来源" prop="docSource" width="100" >
<template slot-scope="scope">
<dict-tag :options="dict.type.doc_source" :value="scope.row.docSource"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="180" v-if="toolDetail.downloadStatus">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handlePriew(scope.row)"
>预览</el-button>
<el-button type="text" icon="el-icon-download" @click="handleDownload(scope.row)" v-loading="loadingDownload">下载</el-button>
</template>
</el-table-column>
</el-table><!--el-table-->
</el-tab-pane><!--el-tab-pane-->
</el-tabs><!--el-tabs-->
</div><!--fl 左侧页签-->
</div><!--fbox1 左右分栏-->
</template>
<script>
import { listDocument, getDocument, delDocument, addDocument, updateDocument } from "@/api/document/document";
import { listDiscussions, addDiscussions } from "@/api/tool/discussions.js";
import { listReplies, addReplies} from "@/api/tool/replies.js";
import { addCount } from "@/api/tool/downloadCount";
import AddDoc from './AddDoc'
import editDocument from "../document/editDocument";
import { Base64 } from 'js-base64';
import iFrame from "@/components/iFrame/index"
export default {
name: 'toolDetail',
components: { editDocument, AddDoc, iFrame },
dicts:['sys_normal_disable','tool_type','tool_source','tool_status','doc_class','doc_source'],
props: {
toolDetail: {
type: Object,
default: {},
}
},
data(){
return{
detailActiveName: 'first',
docList: [],
queryParams: {
pageNum: 1,
pageSize: 10,
toolId: ''
},
previewUrl: '',
viewDialogTitle: "",
viewDialogOpen: false,
title: '新增文档',
open: false,
loadingDownload: false,
discussionContent: null, //
repliesContent: null, //
//
discussionsList: [],
//
repliesList: [],
showReplyForm: [],
replyContent: [],
}
},
created(){
this.getDocList()
this.getDiscussionsList()
},
watch: {
discussionsList(newList) {
this.showReplyForm = new Array(newList.length).fill(false);
this.replyContent = new Array(newList.length).fill('');
}
},
methods:{
getDocList() {
this.loading = true;
this.queryParams.toolId = this.toolDetail.toolId
listDocument(this.queryParams).then(response => {
this.docList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
handleAdd(){
this.open = true
},
editDocumentSubmit(){
this.open = false
this.getDocList()
},
handlePriew(row){
this.previewUrl = process.env.VUE_APP_TOOL_TECH_FILE_VIEW_API + '/onlinePreview?url=' + encodeURIComponent(Base64.encode(process.env.VUE_APP_BASE_API + row.docUrl));
this.viewDialogTitle = '文档在线预览'
this.viewDialogOpen = true;
},
/** 删除按钮操作 */
handleDelete(row) {
const docIds = row.docId || this.ids;
this.$modal.confirm('是否确认删除?').then(function() {
return delDocument(docIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/**
* 处理下载
* **/
handleDownload(row){
let self = this
self.loadingDownload = true
this.$download.resource(row.docUrl);
//
if(this.toolDetail.toolId){
let formData = {
toolId: this.toolDetail.toolId
}
addCount(formData).then(res => {
console.info("res==========", res)
});
}
setTimeout(()=>{
self.loadingDownload = false
},1000)
},
getDiscussionsList() {
let self = this
listDiscussions({businessId:this.toolDetail.toolId}).then(res => {
self.discussionsList = res.rows
self.discussionsList.forEach(item => {
if(item.repliesList && item.repliesList.length > 0){
self.$set(item, 'showReplyFormSon', new Array(item.repliesList.length).fill(false))
self.$set(item, 'replyContentSon', new Array(item.repliesList.length).fill(''))
}else{
self.$set(item, 'showReplyFormSon', false)
self.$set(item, 'replyContentSon', '')
}
});
});
},
/** 评论 **/
handleDiscussions(){
let self = this
if (this.discussionContent == '' || this.discussionContent == null || this.discussionContent == undefined) {
self.$message({
message: '内容不能为空',//
type:'warning',  //
duration:1200,  //, 0 1200
});
return;
}
let data = {
businessId: this.toolDetail.toolId,
content: this.discussionContent,
type: "tool",
}
self.$modal.confirm('是否确认发布?').then(()=> {
addDiscussions(data).then(res => {
this.discussionContent = null
self.$message({
message: '发布成功',//
type:'success',  //
duration:1200,  //, 0 1200
});
self.getDiscussionsList()
}).catch(err =>{
this.discussionContent = null
console.error("handleDiscussions==err==", err)
self.$modal.msgError("发布失败");
});
})
},
getFirstChar(value) {
if(!value){return ''}
return value.charAt(0);
},
toggleReplyForm(index) {
this.$set(this.showReplyForm, index, !this.showReplyForm[index]);
},
cancelReply(index) {
this.$set(this.showReplyForm, index, false);
this.$set(this.replyContent, index, '');
},
/** 回复 **/
submitReply(index, item) {
let self = this
const content = this.replyContent[index];
if (content == '' || content == null || content == undefined) {
self.$message({
message: '回复内容不能为空',//
type:'warning',  //
duration:1200,  //, 0 1200
});
return;
}
let data = {
"discussionId": item.id,
"content": content,
}
self.$modal.confirm('是否确认发布?').then(()=> {
addReplies(data).then(res => {
self.$message({
message: '发布成功',//
type:'success',  //
duration:1200,  //, 0 1200
});
self.cancelReply(index)
self.getDiscussionsList()
}).catch(err =>{
console.error("handleDiscussions==err==", err)
self.$modal.msgError("发布失败");
});
})
//
this.replyContent[index] = '';
this.showReplyForm[index] = false;
},
/** 第二级 **/
toggleReplyFormSon(parentIndex, repIndex) {
const parentItem = this.discussionsList[parentIndex];
this.$set(parentItem.showReplyFormSon, repIndex, !parentItem.showReplyFormSon[repIndex]);
// this.$set(this.showReplyFormSon, index, !this.showReplyFormSon[index]);
},
/** 第二级,取消回复 **/
cancelReplySon(parentIndex, repIndex) {
const parentItem = this.discussionsList[parentIndex];
this.$set(parentItem.showReplyFormSon, repIndex, false);
this.$set(parentItem.replyContentSon, repIndex, '');
},
/** 第二级回复 **/
submitReplySon(parentIndex, repIndex, repItem) {
let self = this
const parentItem = this.discussionsList[parentIndex];
const content = parentItem.replyContentSon[repIndex];
if (content.trim() == '' || content == null || content == undefined) {
self.$message({
message: '回复内容不能为空',//
type:'warning',  //
duration:1200,  //, 0 1200
});
return;
}
let data = {
"discussionId": repItem.id,
"content": content,
}
self.$modal.confirm('是否确认发布?').then(()=> {
addReplies(data).then(res => {
self.$message({
message: '发布成功',//
type:'success',  //
duration:1200,  //, 0 1200
});
self.cancelReplySon(parentIndex, repIndex)
self.getDiscussionsList()
}).catch(err =>{
console.error("submitReplySon==err==", err)
self.$modal.msgError("发布失败");
});
})
//
this.$set(parentItem.replyContentSon, repIndex, '');
this.$set(parentItem.showReplyFormSon, repIndex, false);
},
}
}
</script>
<style scoped>
</style>

View File

@ -121,7 +121,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" icon="el-icon-info" v-if="scope.row.recordStatus=='done'" @click="applyUse(scope.row)">申请使用</el-button> <el-button type="text" icon="el-icon-info" v-if="scope.row.recordStatus=='done'" @click="applyUse(scope.row)">申请使用</el-button>
<el-button type="text" icon="el-icon-info" @click="handleDetail(scope.row)">详情</el-button> <el-button type="text" icon="el-icon-info" @click="handleDetail(scope.row)">详情</el-button>
<el-button type="text" icon="el-icon-download" v-if="scope.row.downloadStatus">下载</el-button> <el-button type="text" icon="el-icon-download" v-if="scope.row.downloadStatus" @click="handleFileDownload(scope.row)">下载</el-button>
<el-dropdown size="mini" v-if="selectable(scope.row)" @command="(command) => handleCommand(command, scope.row)"> <el-dropdown size="mini" v-if="selectable(scope.row)" @command="(command) => handleCommand(command, scope.row)">
<el-button size="mini" type="text" icon="el-icon-d-arrow-right" >更多</el-button> <el-button size="mini" type="text" icon="el-icon-d-arrow-right" >更多</el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
@ -200,23 +200,36 @@
</template> </template>
</el-drawer><!--el-drawer 详情-抽屉--> </el-drawer><!--el-drawer 详情-抽屉-->
<!-- 工具详情对话框 -->
<el-drawer :visible.sync="fileDetailDrawerOpen" :modal-append-to-body="false" size="85%" class="no-padding" @close="handleFileCloseDetail()">
<template #title>
<span>工具下载</span>
</template>
<template v-if="fileDetailOpen">
<download-file-detail ref="downloadFileDetailRef" :toolDetail="toolDetail"/>
</template>
</el-drawer><!--el-drawer 详情-抽屉-->
</div><!--app-container--> </div><!--app-container-->
</template> </template>
<script> <script>
import { listTool, getTool, delTool, addTool, updateTool } from "@/api/tool/tool"; import { listTool, getTool, delTool, addTool, updateTool } from "@/api/tool/tool";
import { deptTreeSelect } from "@/api/system/user"; import { deptTreeSelect } from "@/api/system/user";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { Base64 } from 'js-base64' import { Base64 } from 'js-base64'
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import toolDetail from "./toolDetail"; import toolDetail from "./toolDetail";
import downloadFileDetail from "./downloadFileDetail.vue";
import AddDoc from './AddDoc' import AddDoc from './AddDoc'
import mainComponent from "@/components/mainComponent/index.vue"; import mainComponent from "@/components/mainComponent/index.vue";
export default { export default {
name: "User", name: "User",
dicts: ['sys_normal_disable', 'tool_type', 'tool_status'], dicts: ['sys_normal_disable', 'tool_type', 'tool_status'],
components: { Treeselect, toolDetail, AddDoc,mainComponent }, components: { Treeselect, toolDetail, AddDoc,mainComponent,downloadFileDetail },
data() { data() {
return { return {
userInfo: this.$store.getters.userInfo, userInfo: this.$store.getters.userInfo,
@ -311,7 +324,9 @@ export default {
addDocShow: false, addDocShow: false,
viewDialogOpen: false, viewDialogOpen: false,
viewDialogTitle: '', viewDialogTitle: '',
previewUrl: '' previewUrl: '',
fileDetailDrawerOpen: false,
fileDetailOpen: false,
}; };
}, },
watch: { watch: {
@ -441,6 +456,11 @@ export default {
this.detailOpen = true this.detailOpen = true
this.toolDetail = row this.toolDetail = row
}, },
handleFileDownload(row){
this.fileDetailDrawerOpen = true
this.fileDetailOpen = true
this.toolDetail = row
},
// //
handleCommand(command, row) { handleCommand(command, row) {
switch (command) { switch (command) {
@ -540,13 +560,21 @@ export default {
}, },
/** 关闭详情 **/ /** 关闭详情 **/
handleCloseDetail(){ handleCloseDetail(){
console.info("1111111111")
this.detailDrawerOpen = false; this.detailDrawerOpen = false;
this.detailOpen = false; this.detailOpen = false;
this.$refs.toolDetailRef.$destroy(); // this.$refs.toolDetailRef.$destroy(); //
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.toolDetailRef = null; // this.$refs.toolDetailRef = null; //
}); });
},
/** 关闭详情 **/
handleFileCloseDetail(){
this.fileDetailDrawerOpen = false;
this.fileDetailOpen = false;
this.$refs.downloadFileDetailRef.$destroy(); //
this.$nextTick(() => {
this.$refs.downloadFileDetailRef = null; //
});
} }
} }
}; };

View File

@ -114,8 +114,8 @@
</template> </template>
</div> </div>
</div> </div>
<el-dialog :title="viewDialogTitle" :visible.sync="viewDialogOpen" fullscreen width="500px" append-to-body> <el-dialog :title="viewDialogTitle" :visible.sync="viewDialogOpen" fullscreen width="500px" append-to-body :before-close="handleBeforeClose">
<i-frame :src="previewUrl" /> <i-frame :src="previewUrl" v-if="viewDialogOpen"/>
</el-dialog> </el-dialog>
<!-- 上传 --> <!-- 上传 -->
@ -368,6 +368,9 @@
this.$set(parentItem.replyContentSon, repIndex, ''); this.$set(parentItem.replyContentSon, repIndex, '');
this.$set(parentItem.showReplyFormSon, repIndex, false); this.$set(parentItem.showReplyFormSon, repIndex, false);
}, },
handleBeforeClose() {
this.viewDialogOpen = false
}
} }
} }
</script> </script>

View File

@ -283,8 +283,8 @@
<bl-user-selector ref="peopleSelect" :type="'single'" :isCheck="true" :open="toolPrincipalsChoose" @cancel="toolPrincipalsChoose=false" @submit="submitPeople"></bl-user-selector> <bl-user-selector ref="peopleSelect" :type="'single'" :isCheck="true" :open="toolPrincipalsChoose" @cancel="toolPrincipalsChoose=false" @submit="submitPeople"></bl-user-selector>
<el-dialog :title="viewDialogTitle" :visible.sync="viewDialogOpen" fullscreen width="500px" append-to-body> <el-dialog :title="viewDialogTitle" :visible.sync="viewDialogOpen" fullscreen width="500px" append-to-body :before-close="handleBeforeClose">
<i-frame :src="previewUrl" /> <i-frame :src="previewUrl" v-if="viewDialogOpen"/>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -882,6 +882,9 @@ export default {
self.loadingDownload = false self.loadingDownload = false
},1000) },1000)
}, },
handleBeforeClose() {
this.viewDialogOpen = false
}
}, },
}; };