1、文档中心权限调整
2、下载权限调整 3、消息中心 4、修复预览关闭窗口时视屏播放暂停不了问题
This commit is contained in:
parent
b500c53218
commit
40525f5b49
@ -175,7 +175,7 @@
|
||||
v-hasPermi="['document:remove']"
|
||||
>删除</el-button>
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -213,8 +213,8 @@
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :title="viewDialogTitle" :visible.sync="viewDialogOpen" fullscreen width="500px" append-to-body>
|
||||
<i-frame :src="previewUrl" />
|
||||
<el-dialog :title="viewDialogTitle" :visible.sync="viewDialogOpen" fullscreen width="500px" append-to-body :before-close="handleBeforeClose">
|
||||
<i-frame :src="previewUrl" v-if="viewDialogOpen"/>
|
||||
</el-dialog>
|
||||
|
||||
<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 { w3cwebsocket as WebSocket } from 'websocket';
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import { addCount } from "@/api/tool/downloadCount";
|
||||
|
||||
export default {
|
||||
name: "Document",
|
||||
components: { iFrame, editDocument, uploadProgress, Treeselect},
|
||||
@ -331,6 +333,9 @@ export default {
|
||||
docSource: '',
|
||||
docStatus: '',
|
||||
docCategoryId: '',
|
||||
createById: this.$store.getters.userId,
|
||||
permissionCheck: true,
|
||||
downloadCheck:true
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
@ -447,9 +452,9 @@ export default {
|
||||
})
|
||||
},
|
||||
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.viewDialogTitle = '文档在线预览'
|
||||
this.viewDialogOpen = true;
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
@ -539,6 +544,15 @@ export default {
|
||||
let self = this
|
||||
self.loadingDownload = true
|
||||
this.$download.resource(row.docUrl);
|
||||
//保存下载记录
|
||||
if(row.toolId){
|
||||
let formData = {
|
||||
toolId: row.toolId
|
||||
}
|
||||
addCount(formData).then(res => {
|
||||
console.info("res==========", res)
|
||||
});
|
||||
}
|
||||
setTimeout(()=>{
|
||||
self.loadingDownload = false
|
||||
},1000)
|
||||
@ -596,6 +610,9 @@ export default {
|
||||
excludeFields:excludeFields,
|
||||
}, `文档资源信息数据_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
handleBeforeClose() {
|
||||
this.viewDialogOpen = false
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
@ -117,9 +117,9 @@
|
||||
@close="detailDrawerOpen = false"
|
||||
>
|
||||
<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="donwTime" prop="donwTime" min-width="120" />
|
||||
<el-table-column label="下载时间" align="center" key="createTime" prop="createTime" min-width="120" />
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
|
306
src/views/tool/downloadFileDetail.vue
Normal file
306
src/views/tool/downloadFileDetail.vue
Normal 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>
|
@ -121,7 +121,7 @@
|
||||
<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" @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-button size="mini" type="text" icon="el-icon-d-arrow-right" >更多</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
@ -200,6 +200,18 @@
|
||||
</template>
|
||||
</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-->
|
||||
</template>
|
||||
|
||||
@ -210,13 +222,14 @@ import { getToken } from "@/utils/auth";
|
||||
import { Base64 } from 'js-base64'
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import toolDetail from "./toolDetail";
|
||||
import downloadFileDetail from "./downloadFileDetail.vue";
|
||||
import AddDoc from './AddDoc'
|
||||
import mainComponent from "@/components/mainComponent/index.vue";
|
||||
|
||||
export default {
|
||||
name: "User",
|
||||
dicts: ['sys_normal_disable', 'tool_type', 'tool_status'],
|
||||
components: { Treeselect, toolDetail, AddDoc,mainComponent },
|
||||
components: { Treeselect, toolDetail, AddDoc,mainComponent,downloadFileDetail },
|
||||
data() {
|
||||
return {
|
||||
userInfo: this.$store.getters.userInfo,
|
||||
@ -311,7 +324,9 @@ export default {
|
||||
addDocShow: false,
|
||||
viewDialogOpen: false,
|
||||
viewDialogTitle: '',
|
||||
previewUrl: ''
|
||||
previewUrl: '',
|
||||
fileDetailDrawerOpen: false,
|
||||
fileDetailOpen: false,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@ -441,6 +456,11 @@ export default {
|
||||
this.detailOpen = true
|
||||
this.toolDetail = row
|
||||
},
|
||||
handleFileDownload(row){
|
||||
this.fileDetailDrawerOpen = true
|
||||
this.fileDetailOpen = true
|
||||
this.toolDetail = row
|
||||
},
|
||||
// 更多操作触发
|
||||
handleCommand(command, row) {
|
||||
switch (command) {
|
||||
@ -540,13 +560,21 @@ export default {
|
||||
},
|
||||
/** 关闭详情 **/
|
||||
handleCloseDetail(){
|
||||
console.info("1111111111")
|
||||
this.detailDrawerOpen = false;
|
||||
this.detailOpen = false;
|
||||
this.$refs.toolDetailRef.$destroy(); // 销毁组件
|
||||
this.$nextTick(() => {
|
||||
this.$refs.toolDetailRef = null; // 清空引用
|
||||
});
|
||||
},
|
||||
/** 关闭详情 **/
|
||||
handleFileCloseDetail(){
|
||||
this.fileDetailDrawerOpen = false;
|
||||
this.fileDetailOpen = false;
|
||||
this.$refs.downloadFileDetailRef.$destroy(); // 销毁组件
|
||||
this.$nextTick(() => {
|
||||
this.$refs.downloadFileDetailRef = null; // 清空引用
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -114,8 +114,8 @@
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog :title="viewDialogTitle" :visible.sync="viewDialogOpen" fullscreen width="500px" append-to-body>
|
||||
<i-frame :src="previewUrl" />
|
||||
<el-dialog :title="viewDialogTitle" :visible.sync="viewDialogOpen" fullscreen width="500px" append-to-body :before-close="handleBeforeClose">
|
||||
<i-frame :src="previewUrl" v-if="viewDialogOpen"/>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 上传 -->
|
||||
@ -368,6 +368,9 @@
|
||||
this.$set(parentItem.replyContentSon, repIndex, '');
|
||||
this.$set(parentItem.showReplyFormSon, repIndex, false);
|
||||
},
|
||||
handleBeforeClose() {
|
||||
this.viewDialogOpen = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -283,8 +283,8 @@
|
||||
<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>
|
||||
<i-frame :src="previewUrl" />
|
||||
<el-dialog :title="viewDialogTitle" :visible.sync="viewDialogOpen" fullscreen width="500px" append-to-body :before-close="handleBeforeClose">
|
||||
<i-frame :src="previewUrl" v-if="viewDialogOpen"/>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@ -882,6 +882,9 @@ export default {
|
||||
self.loadingDownload = false
|
||||
},1000)
|
||||
},
|
||||
handleBeforeClose() {
|
||||
this.viewDialogOpen = false
|
||||
}
|
||||
},
|
||||
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user