1、文档新增详情和评论
2、新增导出word 3、预览功能调整 4、页面上图标等样式调整
This commit is contained in:
parent
014341b671
commit
522a40ae64
@ -1,5 +1,5 @@
|
|||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 工具管理与技术交流平台
|
VUE_APP_TITLE = 技术交流平台
|
||||||
|
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
ENV = 'development'
|
ENV = 'development'
|
||||||
@ -7,11 +7,11 @@ ENV = 'development'
|
|||||||
VUE_APP_CONTEXT_PATH = '/tool-tech'
|
VUE_APP_CONTEXT_PATH = '/tool-tech'
|
||||||
|
|
||||||
# 工具与技术交流管理系统/开发环境
|
# 工具与技术交流管理系统/开发环境
|
||||||
VUE_APP_BASE_API = '/tool-tech-admin'
|
VUE_APP_BASE_API = 'http://localhost:8080/tool-tech-admin'
|
||||||
VUE_APP_WS_URL = 'ws://localhost:8080/tool-tech-admin/websocket'
|
VUE_APP_WS_URL = 'ws://localhost:8080/tool-tech-admin/websocket'
|
||||||
|
|
||||||
# 文档在线预览服务
|
# 文档在线预览服务
|
||||||
VUE_APP_TOOL_TECH_FILE_VIEW_API = '/tool-tech-file-view'
|
VUE_APP_TOOL_TECH_FILE_VIEW_API = 'http://127.0.0.1:8012/tool-tech-file-view'
|
||||||
|
|
||||||
# 流程管理服务地址
|
# 流程管理服务地址
|
||||||
VUE_APP_WORKFLOW_MANAGE_URL = '/ebpm-process-manage'
|
VUE_APP_WORKFLOW_MANAGE_URL = '/ebpm-process-manage'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 工具管理与技术交流平台
|
VUE_APP_TITLE = 技术交流平台
|
||||||
|
|
||||||
# 生产环境配置
|
# 生产环境配置
|
||||||
ENV = 'production'
|
ENV = 'production'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 工具管理与技术交流平台
|
VUE_APP_TITLE = 技术交流平台
|
||||||
|
|
||||||
NODE_ENV = production
|
NODE_ENV = production
|
||||||
|
|
||||||
|
@ -43,7 +43,6 @@
|
|||||||
"js-base64": "^3.7.7",
|
"js-base64": "^3.7.7",
|
||||||
"js-cookie": "3.0.1",
|
"js-cookie": "3.0.1",
|
||||||
"jsencrypt": "3.0.0-rc.1",
|
"jsencrypt": "3.0.0-rc.1",
|
||||||
"jszip": "3.10.1",
|
|
||||||
"nprogress": "0.2.0",
|
"nprogress": "0.2.0",
|
||||||
"quill": "1.3.7",
|
"quill": "1.3.7",
|
||||||
"screenfull": "5.0.2",
|
"screenfull": "5.0.2",
|
||||||
@ -56,7 +55,13 @@
|
|||||||
"vue-meta": "2.4.0",
|
"vue-meta": "2.4.0",
|
||||||
"vue-router": "3.4.9",
|
"vue-router": "3.4.9",
|
||||||
"vuex": "3.6.0",
|
"vuex": "3.6.0",
|
||||||
"websocket": "^1.0.35"
|
"websocket": "^1.0.35",
|
||||||
|
"jszip": "3.10.1",
|
||||||
|
"jszip-utils": "0.1.0",
|
||||||
|
"file-save": "0.2.0",
|
||||||
|
"pizzip": "3.1.7",
|
||||||
|
"docxtemplater": "3.50.0",
|
||||||
|
"docxtemplater-image-module-free": "1.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vue/cli-plugin-babel": "4.4.6",
|
"@vue/cli-plugin-babel": "4.4.6",
|
||||||
|
21
public/document.docx
Normal file
21
public/document.docx
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{#list}
|
||||||
|
{resName}
|
||||||
|
文档编号
|
||||||
|
{docCode}
|
||||||
|
文档名称
|
||||||
|
{docName}
|
||||||
|
文档类别
|
||||||
|
{docTypeName}
|
||||||
|
负责人
|
||||||
|
{docPrincipals}
|
||||||
|
归属单位
|
||||||
|
{docRespDeptName}
|
||||||
|
文档来源
|
||||||
|
{docSourceName}
|
||||||
|
关联工具
|
||||||
|
{toolName}
|
||||||
|
上传状态
|
||||||
|
{statusName}
|
||||||
|
创建时间
|
||||||
|
{createTime}
|
||||||
|
{/list}
|
27
public/tool.docx
Normal file
27
public/tool.docx
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{#list}
|
||||||
|
{resName}
|
||||||
|
工具名称
|
||||||
|
{toolName}
|
||||||
|
工具类别
|
||||||
|
{toolTypeName}
|
||||||
|
工具来源
|
||||||
|
{toolSourceName}
|
||||||
|
负责人
|
||||||
|
{toolPrincipalsName}
|
||||||
|
归属单位
|
||||||
|
{toolRespDeptName}
|
||||||
|
状态
|
||||||
|
{statusName}
|
||||||
|
工具用途
|
||||||
|
{toolUse}
|
||||||
|
测评情况
|
||||||
|
{testSituation}
|
||||||
|
功能描述
|
||||||
|
{functionDesc}
|
||||||
|
适用条件
|
||||||
|
{applyCondition}
|
||||||
|
操作说明
|
||||||
|
{operateExplain}
|
||||||
|
备注
|
||||||
|
{remark}
|
||||||
|
{/list}
|
@ -61,4 +61,14 @@ export function getStatistics(query) {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 查询【请填写功能名称】列表
|
||||||
|
export function listAllDoc(query) {
|
||||||
|
return request({
|
||||||
|
url: '/document/all/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -69,3 +69,12 @@ export function getStatistics(query) {
|
|||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// get导出word字段
|
||||||
|
export function exportWordList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/tool/export/word/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div v-if="!isDetail">
|
||||||
<el-upload class="upload-demo" ref="upload" action="#"
|
<el-upload class="upload-demo" ref="upload" action="#"
|
||||||
:before-upload="beforeUpload"
|
:before-upload="beforeUpload"
|
||||||
:on-change="onChange"
|
:on-change="onChange"
|
||||||
@ -12,8 +12,8 @@
|
|||||||
:auto-upload="true"
|
:auto-upload="true"
|
||||||
:http-request="uploadFile"
|
:http-request="uploadFile"
|
||||||
show-file-list>
|
show-file-list>
|
||||||
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
<el-button slot="trigger" size="small" type="primary" >选取文件</el-button>
|
||||||
<el-button size="small" type="primary" @click="handleUploadFile">
|
<el-button size="small" type="primary" @click="handleUploadFile" >
|
||||||
上传文件夹
|
上传文件夹
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- 上传-->
|
<!-- 上传-->
|
||||||
@ -23,11 +23,15 @@
|
|||||||
<!-- <input v-show="false" type="file" ref="fileRef" webkitdirectory @change="handleFolderUpload">
|
<!-- <input v-show="false" type="file" ref="fileRef" webkitdirectory @change="handleFolderUpload">
|
||||||
<el-button slot="trigger" size="small" type="primary">选取文件夹</el-button>-->
|
<el-button slot="trigger" size="small" type="primary">选取文件夹</el-button>-->
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<div slot="tip" class="el-upload__tip">只能上传{{acceptType}}文件</div>
|
<div slot="tip" class="el-upload__tip" >只能上传{{acceptType}}文件</div>
|
||||||
<div v-show="progressFlag" class="head-img">
|
<div v-show="progressFlag" class="head-img">
|
||||||
<el-progress :text-inside="true" :stroke-width="14" :percentage="progressPercent" status="success"></el-progress>
|
<el-progress :text-inside="true" :stroke-width="14" :percentage="progressPercent" status="success"></el-progress>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
{{fileDetailName}}
|
||||||
|
<!-- {{fileList[0].name}}-->
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -41,59 +45,69 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
uploadUrl: {
|
uploadUrl: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true
|
required: false
|
||||||
},
|
},
|
||||||
// 是否多选
|
// 是否多选
|
||||||
isMultiple: {
|
isMultiple: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default() {
|
default() {
|
||||||
return false
|
return false
|
||||||
}
|
},
|
||||||
|
required: false
|
||||||
},
|
},
|
||||||
// 文件类型
|
// 文件类型
|
||||||
type: {
|
type: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default() {
|
default() {
|
||||||
return []
|
return []
|
||||||
}
|
},
|
||||||
|
required: false
|
||||||
},
|
},
|
||||||
//上传类型
|
//上传类型
|
||||||
acceptType: {
|
acceptType: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true
|
required: false
|
||||||
},
|
},
|
||||||
// 上传数量
|
// 上传数量
|
||||||
limit: {
|
limit: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default() {
|
default() {
|
||||||
return 1
|
return 1
|
||||||
}
|
},
|
||||||
|
required: false
|
||||||
},
|
},
|
||||||
// 文件
|
// 文件
|
||||||
dataFile: {
|
dataFile: {
|
||||||
type: [Object, Array, String],
|
type: [Object, Array, String],
|
||||||
default() {
|
default() {
|
||||||
return ''
|
return ''
|
||||||
}
|
},
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
isDetail: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
fileList: [],
|
fileList: [{name:null}],
|
||||||
progress: 0,
|
progress: 0,
|
||||||
isUploading: false,
|
isUploading: false,
|
||||||
progressFlag: false, //进度条初始值隐藏
|
progressFlag: false, //进度条初始值隐藏
|
||||||
progressPercent: 0, //进度条初始值
|
progressPercent: 0, //进度条初始值
|
||||||
partSize: 5 * 1024 * 1024,
|
partSize: 5 * 1024 * 1024,
|
||||||
|
fileDetailName: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
dataFile: {
|
dataFile: {
|
||||||
handler(newValue, oldValue) {
|
handler(newValue, oldValue) {
|
||||||
if (newValue) {
|
if (newValue && newValue.length > 0) {
|
||||||
this.fileList = Array.isArray(newValue) ? newValue : [newValue]
|
this.fileList = Array.isArray(newValue) ? newValue : [newValue]
|
||||||
|
this.fileDetailName = this.fileList[0].name
|
||||||
} else {
|
} else {
|
||||||
this.fileList = []
|
this.fileList = [{name:null}]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
immediate: true
|
immediate: true
|
||||||
@ -159,6 +173,7 @@ export default {
|
|||||||
self.handleResult(res,file);
|
self.handleResult(res,file);
|
||||||
}, 500);
|
}, 500);
|
||||||
} else {
|
} else {
|
||||||
|
self.progressFlag = false;
|
||||||
self.$message({
|
self.$message({
|
||||||
message: '上传失败!',
|
message: '上传失败!',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
@ -301,6 +316,7 @@ export default {
|
|||||||
self.handleResult(res,file);
|
self.handleResult(res,file);
|
||||||
}, 500);
|
}, 500);
|
||||||
} else {
|
} else {
|
||||||
|
self.progressFlag = false;
|
||||||
self.$message({
|
self.$message({
|
||||||
message: '上传失败!',
|
message: '上传失败!',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
@ -328,7 +344,11 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 清空文件 **/
|
/** 清空文件 **/
|
||||||
clearFile(){
|
clearFile(){
|
||||||
this.$refs.upload.clearFiles();
|
this.progressFlag = false;
|
||||||
|
if(this.$refs.upload){
|
||||||
|
this.$refs.upload.clearFiles();
|
||||||
|
}
|
||||||
|
|
||||||
this.fileList = []
|
this.fileList = []
|
||||||
},
|
},
|
||||||
handleUploadFile() {
|
handleUploadFile() {
|
||||||
@ -407,6 +427,7 @@ export default {
|
|||||||
self.handleResult(res,fileObj.file);
|
self.handleResult(res,fileObj.file);
|
||||||
}, 500);
|
}, 500);
|
||||||
} else {
|
} else {
|
||||||
|
self.progressFlag = false;
|
||||||
self.$message({
|
self.$message({
|
||||||
message: '上传失败!',
|
message: '上传失败!',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
|
@ -36,6 +36,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: process.env.VUE_APP_TITLE,
|
title: process.env.VUE_APP_TITLE,
|
||||||
|
// title: process.env.VUE_APP_TITLE,
|
||||||
logo: logoImg
|
logo: logoImg
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
58
src/utils/docUtil/docutil.js
Normal file
58
src/utils/docUtil/docutil.js
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
import docxtemplater from 'docxtemplater';
|
||||||
|
import PizZip from 'pizzip';
|
||||||
|
import JSZipUtils from 'jszip-utils';
|
||||||
|
import {saveAs} from 'file-saver';
|
||||||
|
|
||||||
|
/**
|
||||||
|
导出docx,导出word
|
||||||
|
@param { String } tempDocxPath 模板文件路径
|
||||||
|
@param { Object } data 文件中传入的数据
|
||||||
|
@param { String } fileName 导出文件名称
|
||||||
|
*/
|
||||||
|
export const exportDocx = (tempDocxPath, data, fileName) => {
|
||||||
|
// 读取并获得模板文件的二进制内容
|
||||||
|
|
||||||
|
JSZipUtils.getBinaryContent(tempDocxPath, (error, content) => {
|
||||||
|
|
||||||
|
|
||||||
|
// input.docx是模板。我们在导出的时候,会根据此模板来导出对应的数据
|
||||||
|
// 抛出异常
|
||||||
|
if (error) {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
// 创建一个JSZip实例,内容为模板的内容
|
||||||
|
const zip = new PizZip(content)
|
||||||
|
// 创建并加载docxtemplater实例对象
|
||||||
|
const doc = new docxtemplater().loadZip(zip)
|
||||||
|
// 设置模板变量的值
|
||||||
|
doc.setData({
|
||||||
|
...data.form,
|
||||||
|
list: data.list
|
||||||
|
})
|
||||||
|
// 模板导出word,去除未定义值所显示的undefined
|
||||||
|
doc.setOptions({nullGetter: function() {
|
||||||
|
return "";
|
||||||
|
}}); // 设置角度解析器
|
||||||
|
try {
|
||||||
|
// render the document (replace all occurences of {first_name} by John, {last_name} by Doe, ...)
|
||||||
|
doc.render()
|
||||||
|
} catch (error) {
|
||||||
|
const e = {
|
||||||
|
message: error.message,
|
||||||
|
name: error.name,
|
||||||
|
stack: error.stack,
|
||||||
|
properties: error.properties
|
||||||
|
}
|
||||||
|
console.log({
|
||||||
|
error: e
|
||||||
|
})
|
||||||
|
// The error thrown here contains additional information when logged with JSON.stringify (it contains a property object).
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
const out = doc.getZip().generate({
|
||||||
|
type: 'blob',
|
||||||
|
mimeType: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
||||||
|
}) // Output the document using Data-URI
|
||||||
|
saveAs(out, fileName)
|
||||||
|
})
|
||||||
|
}
|
@ -1,105 +1,179 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="el-form-border">
|
<div class="fbox1">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
|
<div class="fl">
|
||||||
<el-row>
|
<div class="el-form-border">
|
||||||
<el-col :span="24">
|
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
|
||||||
<el-form-item label="文件分类" prop="docCategoryId">
|
<el-row>
|
||||||
<treeselect v-model="form.docCategoryId" :options="docCategory" :show-count="true" placeholder="请选择文件分类"/>
|
<el-col :span="24">
|
||||||
</el-form-item>
|
<el-form-item label="文件分类" prop="docCategoryId">
|
||||||
</el-col>
|
<treeselect v-model="form.docCategoryId" :options="docCategory" :show-count="true"
|
||||||
|
:disabled="detailBoolean"
|
||||||
|
placeholder="请选择文件分类"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="文档编号" prop="docCode">
|
<el-form-item label="文档编号" prop="docCode">
|
||||||
<el-input v-model="form.docCode" placeholder="请输入文档编号" maxlength="50" show-word-limit/>
|
<template v-if="detailBoolean">{{form.docCode}}</template>
|
||||||
</el-form-item>
|
<template v-else>
|
||||||
</el-col>
|
<el-input v-model="form.docCode" placeholder="请输入文档编号" maxlength="50" show-word-limit/>
|
||||||
|
</template>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="文档名称" prop="docName">
|
<el-form-item label="文档名称" prop="docName">
|
||||||
<el-input v-model="form.docName" placeholder="请输入文档名称" maxlength="200" show-word-limit/>
|
<template v-if="detailBoolean">{{form.docCode}}</template>
|
||||||
</el-form-item>
|
<template v-else>
|
||||||
</el-col>
|
<el-input v-model="form.docName" placeholder="请输入文档名称" maxlength="200" show-word-limit/>
|
||||||
|
</template>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="文档类别" prop="docType" style="width: 100%">
|
<el-form-item label="文档类别" prop="docType" style="width: 100%">
|
||||||
<el-select v-model="form.docType" placeholder="请选择文档来源" style="width: 100% !important;">
|
<el-select v-model="form.docType" placeholder="请选择文档来源" style="width: 100% !important;"
|
||||||
<el-option style="width: 100%"
|
:disabled="detailBoolean">
|
||||||
v-for="dict in dict.type.doc_class"
|
<el-option style="width: 100%"
|
||||||
:key="dict.value"
|
v-for="dict in dict.type.doc_class"
|
||||||
:label="dict.label"
|
:key="dict.value"
|
||||||
:value="dict.value"
|
:label="dict.label"
|
||||||
></el-option>
|
:value="dict.value"
|
||||||
</el-select>
|
></el-option>
|
||||||
</el-form-item>
|
</el-select>
|
||||||
</el-col>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="文档来源" prop="docSource">
|
<el-form-item label="文档来源" prop="docSource">
|
||||||
<el-select v-model="form.docSource" placeholder="请选择文档来源" style="width: 100%">
|
<el-select v-model="form.docSource" placeholder="请选择文档来源" style="width: 100%" :disabled="detailBoolean">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.doc_source"
|
v-for="dict in dict.type.doc_source"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<!-- <el-input v-model="form.docSource" placeholder="请输入文档来源" maxlength="50" show-word-limit/>-->
|
<!-- <el-input v-model="form.docSource" placeholder="请输入文档来源" maxlength="50" show-word-limit/>-->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" v-if="relatedTool">
|
<el-col :span="24" v-if="relatedTool">
|
||||||
<el-form-item label="关联工具" prop="toolId">
|
<el-form-item label="关联工具" prop="toolId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="toolDataInfo"
|
v-model="toolDataInfo"
|
||||||
ref="selectHeadTool"
|
ref="selectHeadTool"
|
||||||
multiple
|
multiple
|
||||||
value-key="toolId"
|
value-key="toolId"
|
||||||
filterable
|
filterable
|
||||||
remote
|
remote
|
||||||
placeholder="请选择关联工具"
|
placeholder="请选择关联工具"
|
||||||
@focus="toolSelect">
|
:disabled="detailBoolean"
|
||||||
<el-option
|
@focus="toolSelect">
|
||||||
v-for="item in toolDataInfo"
|
<el-option
|
||||||
:key="item.toolId"
|
v-for="item in toolDataInfo"
|
||||||
:label="item.toolName"
|
:key="item.toolId"
|
||||||
:value="item">
|
:label="item.toolName"
|
||||||
</el-option>
|
:value="item">
|
||||||
</el-select>
|
</el-option>
|
||||||
</el-form-item>
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="负责人" prop="docPrincipals">
|
<el-form-item label="负责人" prop="docPrincipals">
|
||||||
<el-input v-model="form.docPrincipals" placeholder="请输入负责人" maxlength="50" show-word-limit/>
|
<template v-if="detailBoolean">{{form.docPrincipals}}</template>
|
||||||
</el-form-item>
|
<template v-else>
|
||||||
</el-col>
|
<el-input v-model="form.docPrincipals" placeholder="请输入负责人" maxlength="50" show-word-limit/>
|
||||||
<el-col :span="24">
|
</template>
|
||||||
<el-form-item label="归属单位" prop="docRespDept">
|
</el-form-item>
|
||||||
<treeselect v-model="form.docRespDept" :options="deptOptions" :show-count="true" placeholder="请输入归属单位"/>
|
</el-col>
|
||||||
</el-form-item>
|
<el-col :span="24">
|
||||||
</el-col>
|
<el-form-item label="归属单位" prop="docRespDept">
|
||||||
<el-col :span="24">
|
<treeselect v-model="form.docRespDept" :options="deptOptions" :show-count="true"
|
||||||
<el-form-item label="文件" required>
|
:disabled="detailBoolean" placeholder="请输入归属单位"/>
|
||||||
<uploadVue
|
</el-form-item>
|
||||||
:display="editStatus"
|
</el-col>
|
||||||
:uploadUrl="uploadFileUrl"
|
<el-col :span="24">
|
||||||
:type="['.txt','.doc','.docx','.pdf','.mp4','.zip','.rar','.7z','.png','.jpg','.jpeg']"
|
<el-form-item label="文件" required>
|
||||||
:acceptType="acceptType"
|
<uploadVue
|
||||||
:limit="1"
|
:display="editStatus"
|
||||||
:dataFile="dataFile"
|
:uploadUrl="uploadFileUrl"
|
||||||
ref="uploadFile"
|
:type="['.txt','.doc','.docx','.pdf','.mp4','.zip','.rar','.7z','.png','.jpg','.jpeg']"
|
||||||
@handleSuccess="handleUploadSuccess"
|
:acceptType="acceptType"
|
||||||
@handleError="handleUploadError"
|
:limit="1"
|
||||||
/>
|
:dataFile="dataFile"
|
||||||
</el-form-item>
|
:isDetail="detailBoolean"
|
||||||
</el-col>
|
ref="uploadFile"
|
||||||
<el-col :span="24">
|
@handleSuccess="handleUploadSuccess"
|
||||||
<el-form-item label="备注" prop="remark">
|
@handleError="handleUploadError"
|
||||||
<el-input v-model="form.remark" type="textarea" :rows="3" maxlength="500" show-word-limit></el-input>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
<el-col :span="24">
|
||||||
</el-form><!--el-form-->
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<template v-if="detailBoolean">{{form.remark}}</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-input v-model="form.remark" type="textarea" :rows="3" maxlength="500" show-word-limit></el-input>
|
||||||
|
</template>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form><!--el-form-->
|
||||||
|
</div>
|
||||||
|
</div><!--fl 左侧页签-->
|
||||||
|
|
||||||
|
<div class="fr" v-if="detailBoolean">
|
||||||
|
<div class="tboper">
|
||||||
|
<div class="tit">评论</div>
|
||||||
|
</div><!--tboper 标题与操作按钮-->
|
||||||
|
<div class="pltextarea">
|
||||||
|
<el-input v-model="discussionContent" type="textarea" placeholder="请输入您的意见" :rows="4" maxlength="1000" show-word-limit></el-input>
|
||||||
|
<div class="plbtn"><el-button @click="handleDiscussions">发布</el-button></div>
|
||||||
|
</div><!--pltextarea-->
|
||||||
|
<div class="pllist">
|
||||||
|
<template v-if="discussionsList && discussionsList.length > 0">
|
||||||
|
<div class="list" v-for="(item,index) in discussionsList" :key="item.id">
|
||||||
|
<div class="luser"><span class="xuser">{{getFirstChar(item.nickName)}}</span></div>
|
||||||
|
<div class="ltext">
|
||||||
|
<div class="nt"><span class="name">{{item.nickName}}</span><span class="time">{{ parseTime(item.createTime, '{y}-{m}-{d} {h}:{i}') }}</span></div>
|
||||||
|
<div class="te">{{item.content}}</div>
|
||||||
|
<div class="hb">
|
||||||
|
<a class="btn" @click="toggleReplyForm(index)">
|
||||||
|
<i class="el-icon-chat-line-round"></i>回复
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="pltextarea" v-if="showReplyForm[index]">
|
||||||
|
<el-input type="textarea" v-model="replyContent[index]" placeholder="请输入您的意见" :rows="2" maxlength="1000" show-word-limit></el-input>
|
||||||
|
<div class="plbtn">
|
||||||
|
<el-button @click="cancelReply(index)">取消</el-button>
|
||||||
|
<el-divider direction="vertical"></el-divider>
|
||||||
|
<el-button @click="submitReply(index, item)">发布</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--第二层级-->
|
||||||
|
<template v-if="item.repliesList && item.repliesList.length > 0">
|
||||||
|
<div class="list" v-for="(repItem,repIdex) in item.repliesList" :key="repItem.id">
|
||||||
|
<div class="luser"><span class="xuser">{{getFirstChar(repItem.nickName)}}</span></div>
|
||||||
|
<div class="ltext">
|
||||||
|
<div class="nt"><span class="name">{{repItem.nickName}}</span><span class="time">{{ parseTime(repItem.createTime, '{y}-{m}-{d} {h}:{i}') }}</span></div>
|
||||||
|
<div class="te">{{repItem.content}}</div>
|
||||||
|
<!-- <div class="hb"><a class="btn" @click="toggleReplyFormSon(index,repIdex)"><i class="el-icon-chat-line-round"></i>回复</a></div>
|
||||||
|
<div class="pltextarea" v-if="item.showReplyFormSon[repIdex]">
|
||||||
|
<el-input type="textarea" v-model="item.replyContentSon[repIdex]" placeholder="请输入您的意见" :rows="2" maxlength="1000" show-word-limit></el-input>
|
||||||
|
<div class="plbtn">
|
||||||
|
<el-button @click="cancelReplySon(index,repIdex)">取消</el-button>
|
||||||
|
<el-divider direction="vertical"></el-divider>
|
||||||
|
<el-button @click="submitReplySon(index,repIdex, item)">发布</el-button>
|
||||||
|
</div>
|
||||||
|
</div>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<tool-selector ref="toolSelect" @selectHandle="selectHandle"></tool-selector>
|
<tool-selector ref="toolSelect" @selectHandle="selectHandle"></tool-selector>
|
||||||
|
|
||||||
</div><!--el-form-border 表单-->
|
</div><!--el-form-border 表单-->
|
||||||
@ -115,6 +189,8 @@
|
|||||||
import uploadProgress from "./uploadProgress";
|
import uploadProgress from "./uploadProgress";
|
||||||
import uploadVue from '@/components/FileUpload/optimizeUpload.vue'
|
import uploadVue from '@/components/FileUpload/optimizeUpload.vue'
|
||||||
import ToolSelector from '@/components/tool-selector/index.vue'
|
import ToolSelector from '@/components/tool-selector/index.vue'
|
||||||
|
import { listDiscussions, addDiscussions } from "@/api/tool/discussions.js";
|
||||||
|
import { listReplies, addReplies} from "@/api/tool/replies.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'editDocument',
|
name: 'editDocument',
|
||||||
@ -193,6 +269,18 @@
|
|||||||
editStatus: true,
|
editStatus: true,
|
||||||
toolDataInfo: [],
|
toolDataInfo: [],
|
||||||
dataFile: [],
|
dataFile: [],
|
||||||
|
//详情
|
||||||
|
detailBoolean: false,
|
||||||
|
|
||||||
|
discussionContent: null, // 评论内容
|
||||||
|
repliesContent: null, // 回复内容
|
||||||
|
// 评论列表
|
||||||
|
discussionsList: [],
|
||||||
|
// 回复列表
|
||||||
|
repliesList: [],
|
||||||
|
showReplyForm: [],
|
||||||
|
replyContent: [],
|
||||||
|
detailLoading: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created(){
|
created(){
|
||||||
@ -378,30 +466,180 @@
|
|||||||
this.$refs.form.resetFields();
|
this.$refs.form.resetFields();
|
||||||
this.toolDataInfo = []
|
this.toolDataInfo = []
|
||||||
this.fileList = []
|
this.fileList = []
|
||||||
|
this.detailBoolean = false
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.$refs.uploadFile.clearFile();
|
this.$refs.uploadFile.clearFile();
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
editInit(docId, type){
|
editInit(docId, type){
|
||||||
this.$refs.form.resetFields();
|
let self = this
|
||||||
this.toolDataInfo = []
|
if(type == "detail"){
|
||||||
this.$nextTick(()=>{
|
this.detailBoolean = true
|
||||||
this.$refs.uploadFile.clearFile();
|
}
|
||||||
|
self.$refs.form.resetFields();
|
||||||
|
self.toolDataInfo = []
|
||||||
|
self.$nextTick(()=>{
|
||||||
|
self.$refs.uploadFile.clearFile();
|
||||||
|
|
||||||
getDocument(docId).then(res => {
|
getDocument(docId).then(res => {
|
||||||
this.form = res.data
|
self.form = res.data
|
||||||
this.toolDataInfo = []
|
self.toolDataInfo = []
|
||||||
let toolInfo = {toolId:this.form.toolId,toolName:this.form.toolName}
|
let toolInfo = {toolId:self.form.toolId,toolName:self.form.toolName}
|
||||||
this.toolDataInfo.push(toolInfo)
|
self.toolDataInfo.push(toolInfo)
|
||||||
|
|
||||||
this.dataFile = []
|
self.dataFile = []
|
||||||
let fileData = res.data.attachment
|
let fileData = res.data.attachment
|
||||||
this.$set(fileData, "name", fileData.fileOldName)
|
self.$set(fileData, "name", fileData.fileOldName)
|
||||||
this.$set(fileData, "size", fileData.fileSize)
|
self.$set(fileData, "size", fileData.fileSize)
|
||||||
this.dataFile.push(fileData)
|
self.dataFile.push(fileData)
|
||||||
|
|
||||||
|
self.getDiscussionsList()
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
|
/** 评论 **/
|
||||||
|
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.form.docId,
|
||||||
|
content: this.discussionContent,
|
||||||
|
type: "doc",
|
||||||
|
}
|
||||||
|
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("发布失败");
|
||||||
|
});
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getDiscussionsList() {
|
||||||
|
let self = this
|
||||||
|
listDiscussions({businessId:this.form.docId}).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', '')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
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, '');
|
||||||
|
},
|
||||||
|
/** 第二级 **/
|
||||||
|
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);
|
||||||
|
},
|
||||||
|
/** 回复 **/
|
||||||
|
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;
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card>
|
<el-card>
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||||
<div class="search">
|
<div class="search">
|
||||||
<div class="sl">
|
<div class="sl">
|
||||||
<el-form-item label="文档编号" prop="docCode">
|
<el-form-item label="文档编号" prop="docCode">
|
||||||
@ -20,7 +20,7 @@
|
|||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="类别" prop="docType">
|
<el-form-item label="文档类别" prop="docType">
|
||||||
<el-select v-model="queryParams.docType" placeholder="请选择">
|
<el-select v-model="queryParams.docType" placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.doc_class"
|
v-for="dict in dict.type.doc_class"
|
||||||
@ -43,7 +43,7 @@
|
|||||||
placeholder="请选择归属单位"
|
placeholder="请选择归属单位"
|
||||||
:show-count="true" style="width: 150px"/>
|
:show-count="true" style="width: 150px"/>
|
||||||
</el-form-item>-->
|
</el-form-item>-->
|
||||||
<el-form-item label="来源" prop="docSource">
|
<el-form-item label="文档来源" prop="docSource">
|
||||||
<el-select v-model="queryParams.docSource" placeholder="请选择" >
|
<el-select v-model="queryParams.docSource" placeholder="请选择" >
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.doc_source"
|
v-for="dict in dict.type.doc_source"
|
||||||
@ -118,14 +118,14 @@
|
|||||||
<el-table-column type="selection" width="55" align="center" :selectable="isSelectable"/>
|
<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="docCode" width="120" />
|
||||||
<el-table-column label="文档名称" align="center" prop="docName" :show-overflow-tooltip="true" />
|
<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">
|
<el-table-column label="文档类别" align="center" prop="docType" :show-overflow-tooltip="true" width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.doc_class" :value="scope.row.docType"/>
|
<dict-tag :options="dict.type.doc_class" :value="scope.row.docType"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>·
|
</el-table-column>·
|
||||||
<el-table-column label="负责人" align="center" prop="docPrincipals" :show-overflow-tooltip="true" width="80" />
|
<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="docRespDeptName" :show-overflow-tooltip="true" width="80" />
|
||||||
<el-table-column label="来源" align="center" prop="docSource" width="100">
|
<el-table-column label="文档来源" align="center" prop="docSource" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.doc_source" :value="scope.row.docSource"/>
|
<dict-tag :options="dict.type.doc_source" :value="scope.row.docSource"/>
|
||||||
</template>
|
</template>
|
||||||
@ -158,6 +158,7 @@
|
|||||||
@click="handleEdit(scope.row)"
|
@click="handleEdit(scope.row)"
|
||||||
v-hasPermi="['document:edit']"
|
v-hasPermi="['document:edit']"
|
||||||
>编辑</el-button>
|
>编辑</el-button>
|
||||||
|
<el-button type="text" icon="el-icon-info" @click="handleDetail(scope.row)">详情</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@ -219,8 +220,8 @@
|
|||||||
|
|
||||||
<el-drawer :visible.sync="open" :modal-append-to-body="false" size="75%">
|
<el-drawer :visible.sync="open" :modal-append-to-body="false" size="75%">
|
||||||
<template #title>
|
<template #title>
|
||||||
<span class="title">新增文档资源</span>
|
<span class="title">{{docTitle}}</span>
|
||||||
<div class="drawer-head-btn">
|
<div class="drawer-head-btn" v-if="docDetailDisable">
|
||||||
<el-button type="primary" @click="$refs.editDocumentRef.submitForm()">确 定</el-button>
|
<el-button type="primary" @click="$refs.editDocumentRef.submitForm()">确 定</el-button>
|
||||||
<el-button @click="docCancel()">取 消</el-button>
|
<el-button @click="docCancel()">取 消</el-button>
|
||||||
</div><!--drawer-head-btn 抽屉顶部按钮区域-->
|
</div><!--drawer-head-btn 抽屉顶部按钮区域-->
|
||||||
@ -232,7 +233,12 @@
|
|||||||
<!-- 工具导出对话框 -->
|
<!-- 工具导出对话框 -->
|
||||||
<el-drawer :visible.sync="exportDrawerOpen" size="75%" :show-close="false">
|
<el-drawer :visible.sync="exportDrawerOpen" size="75%" :show-close="false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<span class="title">导出</span>
|
<span class="title">导出
|
||||||
|
<el-select v-model="statevalue" placeholder="请选择要导出的格式">
|
||||||
|
<el-option v-for="item in stateoptions" :key="item.value" :label="item.label" :value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</span>
|
||||||
<div class="drawer-head-btn">
|
<div class="drawer-head-btn">
|
||||||
<el-button type="primary" @click="handleExport">提交</el-button>
|
<el-button type="primary" @click="handleExport">提交</el-button>
|
||||||
<el-button @click="exportDrawerOpen=false">取消</el-button>
|
<el-button @click="exportDrawerOpen=false">取消</el-button>
|
||||||
@ -246,10 +252,10 @@
|
|||||||
<el-checkbox-group v-model="checkList">
|
<el-checkbox-group v-model="checkList">
|
||||||
<el-checkbox label="docCode">文档编号</el-checkbox>
|
<el-checkbox label="docCode">文档编号</el-checkbox>
|
||||||
<el-checkbox label="docName">文档名称</el-checkbox>
|
<el-checkbox label="docName">文档名称</el-checkbox>
|
||||||
<el-checkbox label="docType">类别</el-checkbox>
|
<el-checkbox label="docType">文档类别</el-checkbox>
|
||||||
<el-checkbox label="docPrincipals">负责人</el-checkbox>
|
<el-checkbox label="docPrincipals">负责人</el-checkbox>
|
||||||
<el-checkbox label="docRespDeptName">归属单位</el-checkbox>
|
<el-checkbox label="docRespDeptName">归属单位</el-checkbox>
|
||||||
<el-checkbox label="docSource">来源</el-checkbox>
|
<el-checkbox label="docSource">文档来源</el-checkbox>
|
||||||
<el-checkbox label="toolName">关联工具</el-checkbox>
|
<el-checkbox label="toolName">关联工具</el-checkbox>
|
||||||
<el-checkbox label="docStatus">上传状态</el-checkbox>
|
<el-checkbox label="docStatus">上传状态</el-checkbox>
|
||||||
<el-checkbox label="createTime">创建时间</el-checkbox>
|
<el-checkbox label="createTime">创建时间</el-checkbox>
|
||||||
@ -265,7 +271,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listDocument, getDocument, delDocument, addDocument, updateDocument,pushDoc } from "@/api/document/document";
|
import { listDocument, getDocument, delDocument, addDocument, updateDocument,pushDoc, listAllDoc} from "@/api/document/document";
|
||||||
import { deptTreeSelect } from "@/api/system/user";
|
import { deptTreeSelect } from "@/api/system/user";
|
||||||
import { documentTree,addCategory,updateCategory,delCategory,getCategory } from "@/api/documentCategory/documentCategory.js";
|
import { documentTree,addCategory,updateCategory,delCategory,getCategory } from "@/api/documentCategory/documentCategory.js";
|
||||||
|
|
||||||
@ -276,6 +282,7 @@ 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";
|
import { addCount } from "@/api/tool/downloadCount";
|
||||||
|
import { exportDocx } from '@/utils/docUtil/docutil.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Document",
|
name: "Document",
|
||||||
@ -382,6 +389,21 @@ export default {
|
|||||||
columnList: ['docCode', 'docName', 'docType', 'docPrincipals', 'docRespDeptName', 'docSource', 'toolName', 'docStatus', 'createTime'],
|
columnList: ['docCode', 'docName', 'docType', 'docPrincipals', 'docRespDeptName', 'docSource', 'toolName', 'docStatus', 'createTime'],
|
||||||
checkList: [],
|
checkList: [],
|
||||||
exportDrawerOpen: false,
|
exportDrawerOpen: false,
|
||||||
|
docTitle: '',
|
||||||
|
//文件详情标识
|
||||||
|
docDetailDisable: true,
|
||||||
|
//导出类型
|
||||||
|
statevalue: 1,
|
||||||
|
stateoptions: [
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: 'excel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 2,
|
||||||
|
label: 'word'
|
||||||
|
}
|
||||||
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -440,17 +462,29 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
|
this.docTitle="新增文档资源"
|
||||||
|
this.docDetailDisable=true
|
||||||
this.open = true
|
this.open = true
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.$refs.editDocumentRef.resetForm();
|
this.$refs.editDocumentRef.resetForm();
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleEdit(row){
|
handleEdit(row){
|
||||||
|
this.docTitle="编辑文档资源"
|
||||||
|
this.docDetailDisable=true
|
||||||
this.open = true
|
this.open = true
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.$refs.editDocumentRef.editInit(row.docId, "edit");
|
this.$refs.editDocumentRef.editInit(row.docId, "edit");
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
handleDetail(row){
|
||||||
|
this.docTitle="详情"
|
||||||
|
this.docDetailDisable=false
|
||||||
|
this.open = true
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
this.$refs.editDocumentRef.editInit(row.docId, "detail");
|
||||||
|
})
|
||||||
|
},
|
||||||
handlePreview(row){
|
handlePreview(row){
|
||||||
this.viewDialogOpen = true;
|
this.viewDialogOpen = true;
|
||||||
let protocol = window.location.protocol
|
let protocol = window.location.protocol
|
||||||
@ -606,12 +640,29 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
let excludeFields = this.columnList.filter(item=>!this.checkList.includes(item))
|
if (this.statevalue == 1) {
|
||||||
this.download('/document/export', {
|
let excludeFields = this.columnList.filter(item=>!this.checkList.includes(item))
|
||||||
...this.queryParams,
|
this.download('/document/export', {
|
||||||
downloadCheck:false,
|
...this.queryParams,
|
||||||
excludeFields:excludeFields,
|
downloadCheck:false,
|
||||||
}, `文档资源信息数据_${new Date().getTime()}.xlsx`)
|
excludeFields:excludeFields,
|
||||||
|
}, `文档资源信息数据_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
if (this.statevalue == 2) {
|
||||||
|
listAllDoc(this.queryParams).then(r => {
|
||||||
|
if (r.data.length != 0) {
|
||||||
|
const data = {
|
||||||
|
form: null,
|
||||||
|
list: r.data
|
||||||
|
}
|
||||||
|
//模板文件位置在public文件夹里N
|
||||||
|
exportDocx('document.docx', data, `document.docx`)
|
||||||
|
} else {
|
||||||
|
this.$message.error('没有数据');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
handleBeforeClose() {
|
handleBeforeClose() {
|
||||||
this.viewDialogOpen = false
|
this.viewDialogOpen = false
|
||||||
|
@ -41,8 +41,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
codeUrl: "",
|
codeUrl: "",
|
||||||
loginForm: {
|
loginForm: {
|
||||||
username: "admin",
|
username: "",
|
||||||
password: "admin123",
|
password: "",
|
||||||
rememberMe: false,
|
rememberMe: false,
|
||||||
code: "",
|
code: "",
|
||||||
uuid: ""
|
uuid: ""
|
||||||
|
@ -107,9 +107,9 @@
|
|||||||
<dict-tag :options="dict.type.tool_status" :value="scope.row.status"/>
|
<dict-tag :options="dict.type.tool_status" :value="scope.row.status"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="审核状态" align="center" key="status">
|
<el-table-column label="审核状态" align="center" key="recordStatus" width="90">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.tool_status" :value="scope.row.recordStatus"/>
|
<dict-tag :options="dict.type.flow_status" :value="scope.row.recordStatus"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="关联工具" align="center" :show-overflow-tooltip="true">
|
<el-table-column label="关联工具" align="center" :show-overflow-tooltip="true">
|
||||||
@ -132,7 +132,8 @@
|
|||||||
class-name="small-padding fixed-width"
|
class-name="small-padding fixed-width"
|
||||||
>
|
>
|
||||||
<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>
|
<!-- && !scope.row.downloadStatus-->
|
||||||
|
<el-button type="text" icon="el-icon-info" v-if="scope.row.recordStatus=='done' && !scope.row.downloadStatus" @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" @click="handleFileDownload(scope.row)">下载</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)">
|
||||||
@ -158,7 +159,12 @@
|
|||||||
<!-- 工具导出对话框 -->
|
<!-- 工具导出对话框 -->
|
||||||
<el-drawer :visible.sync="exoportDrawerOpen" size="75%" :show-close="false">
|
<el-drawer :visible.sync="exoportDrawerOpen" size="75%" :show-close="false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<span class="title">导出</span>
|
<span class="title">导出
|
||||||
|
<el-select v-model="statevalue" placeholder="请选择要导出的格式">
|
||||||
|
<el-option v-for="item in stateoptions" :key="item.value" :label="item.label" :value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</span>
|
||||||
<div class="drawer-head-btn">
|
<div class="drawer-head-btn">
|
||||||
<el-button type="primary" @click="handleExport">提交</el-button>
|
<el-button type="primary" @click="handleExport">提交</el-button>
|
||||||
<el-button @click="exoportDrawerOpen=false">取消</el-button>
|
<el-button @click="exoportDrawerOpen=false">取消</el-button>
|
||||||
@ -229,7 +235,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listTool, getTool, delTool, addTool, updateTool } from "@/api/tool/tool";
|
import { listTool, getTool, delTool, addTool, updateTool, exportWordList} 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'
|
||||||
@ -238,10 +244,11 @@ import toolDetail from "./toolDetail";
|
|||||||
import downloadFileDetail from "./downloadFileDetail.vue";
|
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";
|
||||||
|
import { exportDocx } from '@/utils/docUtil/docutil.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "User",
|
name: "User",
|
||||||
dicts: ['sys_normal_disable', 'tool_type', 'tool_status'],
|
dicts: ['sys_normal_disable', 'tool_type', 'tool_status','flow_status'],
|
||||||
components: { Treeselect, toolDetail, AddDoc,mainComponent,downloadFileDetail },
|
components: { Treeselect, toolDetail, AddDoc,mainComponent,downloadFileDetail },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -340,6 +347,18 @@ export default {
|
|||||||
previewUrl: '',
|
previewUrl: '',
|
||||||
fileDetailDrawerOpen: false,
|
fileDetailDrawerOpen: false,
|
||||||
fileDetailOpen: false,
|
fileDetailOpen: false,
|
||||||
|
//导出类型
|
||||||
|
statevalue: 1,
|
||||||
|
stateoptions: [
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: 'excel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 2,
|
||||||
|
label: 'word'
|
||||||
|
}
|
||||||
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -460,6 +479,7 @@ export default {
|
|||||||
this.dateRange = [];
|
this.dateRange = [];
|
||||||
this.resetForm("queryForm");
|
this.resetForm("queryForm");
|
||||||
this.queryParams.deptId = undefined;
|
this.queryParams.deptId = undefined;
|
||||||
|
this.queryParams.toolRespDept = undefined;
|
||||||
this.$refs.tree.setCurrentKey(null);
|
this.$refs.tree.setCurrentKey(null);
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
@ -518,12 +538,29 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
let excludeFields = this.columnList.filter(item=>!this.checkList.includes(item))
|
if (this.statevalue == 1) {
|
||||||
this.download('/tool/export', {
|
let excludeFields = this.columnList.filter(item=>!this.checkList.includes(item))
|
||||||
...this.queryParams,
|
this.download('/tool/export', {
|
||||||
downloadCheck:false,
|
...this.queryParams,
|
||||||
excludeFields:excludeFields,
|
downloadCheck:false,
|
||||||
}, `工具信息数据_${new Date().getTime()}.xlsx`)
|
excludeFields:excludeFields,
|
||||||
|
}, `工具信息数据_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
if (this.statevalue == 2) {
|
||||||
|
exportWordList(this.queryParams).then(r => {
|
||||||
|
if (r.data.length != 0) {
|
||||||
|
const data = {
|
||||||
|
form: null,
|
||||||
|
list: r.data
|
||||||
|
}
|
||||||
|
//模板文件位置在public文件夹里N
|
||||||
|
exportDocx('tool.docx', data, `tool.docx`)
|
||||||
|
} else {
|
||||||
|
this.$message.error('没有数据');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
// 文件上传中处理
|
// 文件上传中处理
|
||||||
handleFileUploadProgress(event, file, fileList) {
|
handleFileUploadProgress(event, file, fileList) {
|
||||||
|
@ -872,9 +872,12 @@ export default {
|
|||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
handlePreview(row){
|
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;
|
this.viewDialogOpen = true;
|
||||||
|
this.viewDialogTitle = '文档在线预览'
|
||||||
|
let protocol = window.location.protocol
|
||||||
|
let hostname = window.location.hostname;
|
||||||
|
let getDocUrl = protocol + '//' + hostname + ':8080' + process.env.VUE_APP_BASE_API
|
||||||
|
this.previewUrl = process.env.VUE_APP_TOOL_TECH_FILE_VIEW_API + '/onlinePreview?url=' + encodeURIComponent(Base64.encode(getDocUrl + row.docUrl));
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 处理下载
|
* 处理下载
|
||||||
|
Loading…
x
Reference in New Issue
Block a user