1、发布工具流程-关联工具细节调整
2、文档资源管理调整
This commit is contained in:
@@ -48,45 +48,63 @@
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>上传文档</el-button>
|
||||
<el-button type="primary" icon="el-icon-position">发布</el-button>
|
||||
<el-button type="primary" icon="el-icon-position" @click="handlePush">发布</el-button>
|
||||
<el-button icon="el-icon-delete" @click="handleDelete">批量删除</el-button>
|
||||
</div><!--operate 操作按钮-->
|
||||
|
||||
<el-table v-loading="loading" :data="docList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="文档编号" prop="docCode" width="120" />
|
||||
<el-table-column label="文档名称" prop="docName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="类别" prop="docType" :show-overflow-tooltip="true" width="80" />
|
||||
<el-table-column label="负责人" prop="docPrincipals" :show-overflow-tooltip="true" width="80" />
|
||||
<el-table-column label="归属部门" prop="docRespDept" :show-overflow-tooltip="true" width="150" />
|
||||
<el-table-column label="来源" prop="docSource" width="100" />
|
||||
<el-table-column label="关联工具" prop="roleSort" width="100" />
|
||||
<el-table-column label="上传状态" prop="docUploadProgress" width="100" >
|
||||
<el-table-column type="selection" width="55" align="center" :selectable="isSelectable"/>
|
||||
<el-table-column label="文档编号" align="center" prop="docCode" width="120" />
|
||||
<el-table-column label="文档名称" align="center" prop="docName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="类别" align="center" prop="docType" :show-overflow-tooltip="true" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-tag type="success" v-if="scope.row.docStatus == 'ysc'">已上传</el-tag>
|
||||
<el-tag type="danger" v-else>上传失败</el-tag>
|
||||
<dict-tag :options="dict.type.doc_class" :value="scope.row.docType"/>
|
||||
</template>
|
||||
</el-table-column>·
|
||||
<el-table-column label="负责人" align="center" 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="来源" align="center" 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">
|
||||
<el-table-column label="关联工具" align="center" prop="toolName" width="100" />
|
||||
<el-table-column label="上传状态" align="center" prop="docUploadProgress" width="100" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag type="info" v-if="scope.row.docStatus == 'ysc'">已上传</el-tag>
|
||||
<el-tag type="success" v-else-if="scope.row.docStatus == 'yfb'">已发布</el-tag>
|
||||
<el-tag type="warning" v-else-if="scope.row.docStatus == 'shz'">审核中</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="180">
|
||||
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
v-if="scope.row.docStatus != 'yfb' && scope.row.docStatus != 'shz'"
|
||||
@click="handleEdit(scope.row)"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="handlePriew(scope.row)"
|
||||
v-if="previewAuth(scope.row)"
|
||||
@click="handlePreview(scope.row)"
|
||||
>预览</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
v-if="scope.row.docStatus != 'yfb' && scope.row.docStatus != 'shz'"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
<el-button type="text" icon="el-icon-download">下载</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>
|
||||
@@ -132,7 +150,7 @@
|
||||
<span class="title">新增文档资源</span>
|
||||
<div class="drawer-head-btn">
|
||||
<el-button type="primary" @click="$refs.editDocumentRef.submitForm()">确 定</el-button>
|
||||
<el-button @click="$refs.editDocumentRef.cancel()">取 消</el-button>
|
||||
<el-button @click="docCancel()">取 消</el-button>
|
||||
</div><!--drawer-head-btn 抽屉顶部按钮区域-->
|
||||
</template>
|
||||
<edit-document ref="editDocumentRef" @submit="editDocumentSubmit"/>
|
||||
@@ -143,7 +161,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listDocument, getDocument, delDocument, addDocument, updateDocument } from "@/api/document/document";
|
||||
import { listDocument, getDocument, delDocument, addDocument, updateDocument,pushDoc } from "@/api/document/document";
|
||||
import { deptTreeSelect } from "@/api/system/user";
|
||||
import { documentTree,addCategory,updateCategory,delCategory,getCategory } from "@/api/documentCategory/documentCategory.js";
|
||||
|
||||
@@ -153,10 +171,10 @@ import editDocument from "./editDocument";
|
||||
import uploadProgress from "./uploadProgress";
|
||||
import { w3cwebsocket as WebSocket } from 'websocket';
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
|
||||
export default {
|
||||
name: "Document",
|
||||
components: { iFrame, editDocument, uploadProgress, Treeselect},
|
||||
dicts:['doc_class','doc_source'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
@@ -243,6 +261,8 @@ export default {
|
||||
categoryDescription: null,
|
||||
parentId: null
|
||||
},
|
||||
loadingDownload: false,
|
||||
acceptType: "zip,rar,7z",
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@@ -297,9 +317,17 @@ export default {
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.open = true
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.editDocumentRef.resetForm();
|
||||
})
|
||||
},
|
||||
handlePriew(row){
|
||||
console.log('mmmmmmmmmmm',process.env.VUE_APP_BASE_API + row.docUrl)
|
||||
handleEdit(row){
|
||||
this.open = true
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.editDocumentRef.editInit(row.docId, "edit");
|
||||
})
|
||||
},
|
||||
handlePreview(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;
|
||||
@@ -322,11 +350,10 @@ export default {
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}).catch((err) => {console.info(err)});
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleDocCategoryAdd(data) {
|
||||
console.info("data================", data)
|
||||
this.docCategoryOpen = true;
|
||||
// this.docCategoryForm.parentId = data.id;
|
||||
this.$nextTick(() => {
|
||||
@@ -385,6 +412,54 @@ export default {
|
||||
/** 重置 **/
|
||||
resetDocCategoryForm(){
|
||||
this.$refs.docCategoryForm.resetFields();
|
||||
},
|
||||
/**
|
||||
* 处理下载
|
||||
* **/
|
||||
handleDownload(row){
|
||||
let self = this
|
||||
self.loadingDownload = true
|
||||
this.$download.resource(row.docUrl);
|
||||
setTimeout(()=>{
|
||||
self.loadingDownload = false
|
||||
},1000)
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handlePush(row) {
|
||||
const docIds = row.docId || this.ids;
|
||||
this.$modal.confirm('是否确认发布?').then(function() {
|
||||
return pushDoc(docIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("发布成功");
|
||||
}).catch((err) => {
|
||||
console.error(err)
|
||||
});
|
||||
},
|
||||
docCancel(){
|
||||
this.$refs.editDocumentRef.resetForm();
|
||||
this.open = false
|
||||
},
|
||||
previewAuth(row){
|
||||
if(row.docUrl == null || row.docUrl == '' || row.docUrl == undefined){
|
||||
return false
|
||||
}
|
||||
let extension = this.getExtension(row.docUrl);
|
||||
const acceptedExtensions = this.acceptType.toLowerCase().split(',');
|
||||
if(acceptedExtensions.includes(extension)){
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
getExtension(filePath) {
|
||||
// 分割字符串,以 '.' 为分隔符
|
||||
const parts = filePath.split('.');
|
||||
// 取最后一个部分作为后缀名
|
||||
const extension = parts.pop();
|
||||
return extension;
|
||||
},
|
||||
isSelectable(row) {
|
||||
return row.docStatus !== 'yfb' && row.docStatus !== 'shz';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user