release-v1.0 #1
@ -1,5 +1,5 @@
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 工具管理与技术交流平台
|
||||
VUE_APP_TITLE = 技术交流平台
|
||||
|
||||
# 开发环境配置
|
||||
ENV = 'development'
|
||||
@ -7,11 +7,11 @@ ENV = 'development'
|
||||
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_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'
|
||||
|
@ -1,5 +1,5 @@
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 工具管理与技术交流平台
|
||||
VUE_APP_TITLE = 技术交流平台
|
||||
|
||||
# 生产环境配置
|
||||
ENV = 'production'
|
||||
|
@ -1,5 +1,5 @@
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 工具管理与技术交流平台
|
||||
VUE_APP_TITLE = 技术交流平台
|
||||
|
||||
NODE_ENV = production
|
||||
|
||||
|
@ -43,7 +43,6 @@
|
||||
"js-base64": "^3.7.7",
|
||||
"js-cookie": "3.0.1",
|
||||
"jsencrypt": "3.0.0-rc.1",
|
||||
"jszip": "3.10.1",
|
||||
"nprogress": "0.2.0",
|
||||
"quill": "1.3.7",
|
||||
"screenfull": "5.0.2",
|
||||
@ -56,7 +55,13 @@
|
||||
"vue-meta": "2.4.0",
|
||||
"vue-router": "3.4.9",
|
||||
"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": {
|
||||
"@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}
|
@ -62,3 +62,13 @@ export function getStatistics(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
|
||||
})
|
||||
}
|
||||
|
||||
// get导出word字段
|
||||
export function exportWordList(query) {
|
||||
return request({
|
||||
url: '/tool/export/word/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="!isDetail">
|
||||
<el-upload class="upload-demo" ref="upload" action="#"
|
||||
:before-upload="beforeUpload"
|
||||
:on-change="onChange"
|
||||
@ -28,6 +28,10 @@
|
||||
<el-progress :text-inside="true" :stroke-width="14" :percentage="progressPercent" status="success"></el-progress>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
{{fileDetailName}}
|
||||
<!-- {{fileList[0].name}}-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -41,59 +45,69 @@ export default {
|
||||
props: {
|
||||
uploadUrl: {
|
||||
type: String,
|
||||
required: true
|
||||
required: false
|
||||
},
|
||||
// 是否多选
|
||||
isMultiple: {
|
||||
type: Boolean,
|
||||
default() {
|
||||
return false
|
||||
}
|
||||
},
|
||||
required: false
|
||||
},
|
||||
// 文件类型
|
||||
type: {
|
||||
type: Array,
|
||||
default() {
|
||||
return []
|
||||
}
|
||||
},
|
||||
required: false
|
||||
},
|
||||
//上传类型
|
||||
acceptType: {
|
||||
type: String,
|
||||
required: true
|
||||
required: false
|
||||
},
|
||||
// 上传数量
|
||||
limit: {
|
||||
type: Number,
|
||||
default() {
|
||||
return 1
|
||||
}
|
||||
},
|
||||
required: false
|
||||
},
|
||||
// 文件
|
||||
dataFile: {
|
||||
type: [Object, Array, String],
|
||||
default() {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
required: false
|
||||
},
|
||||
isDetail: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
fileList: [],
|
||||
fileList: [{name:null}],
|
||||
progress: 0,
|
||||
isUploading: false,
|
||||
progressFlag: false, //进度条初始值隐藏
|
||||
progressPercent: 0, //进度条初始值
|
||||
partSize: 5 * 1024 * 1024,
|
||||
fileDetailName: null
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
dataFile: {
|
||||
handler(newValue, oldValue) {
|
||||
if (newValue) {
|
||||
if (newValue && newValue.length > 0) {
|
||||
this.fileList = Array.isArray(newValue) ? newValue : [newValue]
|
||||
this.fileDetailName = this.fileList[0].name
|
||||
} else {
|
||||
this.fileList = []
|
||||
this.fileList = [{name:null}]
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
@ -159,6 +173,7 @@ export default {
|
||||
self.handleResult(res,file);
|
||||
}, 500);
|
||||
} else {
|
||||
self.progressFlag = false;
|
||||
self.$message({
|
||||
message: '上传失败!',
|
||||
type: 'error',
|
||||
@ -301,6 +316,7 @@ export default {
|
||||
self.handleResult(res,file);
|
||||
}, 500);
|
||||
} else {
|
||||
self.progressFlag = false;
|
||||
self.$message({
|
||||
message: '上传失败!',
|
||||
type: 'error',
|
||||
@ -328,7 +344,11 @@ export default {
|
||||
},
|
||||
/** 清空文件 **/
|
||||
clearFile(){
|
||||
this.progressFlag = false;
|
||||
if(this.$refs.upload){
|
||||
this.$refs.upload.clearFiles();
|
||||
}
|
||||
|
||||
this.fileList = []
|
||||
},
|
||||
handleUploadFile() {
|
||||
@ -407,6 +427,7 @@ export default {
|
||||
self.handleResult(res,fileObj.file);
|
||||
}, 500);
|
||||
} else {
|
||||
self.progressFlag = false;
|
||||
self.$message({
|
||||
message: '上传失败!',
|
||||
type: 'error',
|
||||
|
@ -36,6 +36,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
title: process.env.VUE_APP_TITLE,
|
||||
// title: process.env.VUE_APP_TITLE,
|
||||
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,28 +1,39 @@
|
||||
<template>
|
||||
<div class="fbox1">
|
||||
<div class="fl">
|
||||
<div class="el-form-border">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="文件分类" prop="docCategoryId">
|
||||
<treeselect v-model="form.docCategoryId" :options="docCategory" :show-count="true" placeholder="请选择文件分类"/>
|
||||
<treeselect v-model="form.docCategoryId" :options="docCategory" :show-count="true"
|
||||
:disabled="detailBoolean"
|
||||
placeholder="请选择文件分类"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="文档编号" prop="docCode">
|
||||
<template v-if="detailBoolean">{{form.docCode}}</template>
|
||||
<template v-else>
|
||||
<el-input v-model="form.docCode" placeholder="请输入文档编号" maxlength="50" show-word-limit/>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="文档名称" prop="docName">
|
||||
<template v-if="detailBoolean">{{form.docCode}}</template>
|
||||
<template v-else>
|
||||
<el-input v-model="form.docName" placeholder="请输入文档名称" maxlength="200" show-word-limit/>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<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;"
|
||||
:disabled="detailBoolean">
|
||||
<el-option style="width: 100%"
|
||||
v-for="dict in dict.type.doc_class"
|
||||
:key="dict.value"
|
||||
@ -35,7 +46,7 @@
|
||||
|
||||
<el-col :span="24">
|
||||
<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
|
||||
v-for="dict in dict.type.doc_source"
|
||||
:key="dict.value"
|
||||
@ -56,6 +67,7 @@
|
||||
filterable
|
||||
remote
|
||||
placeholder="请选择关联工具"
|
||||
:disabled="detailBoolean"
|
||||
@focus="toolSelect">
|
||||
<el-option
|
||||
v-for="item in toolDataInfo"
|
||||
@ -69,12 +81,16 @@
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="负责人" prop="docPrincipals">
|
||||
<template v-if="detailBoolean">{{form.docPrincipals}}</template>
|
||||
<template v-else>
|
||||
<el-input v-model="form.docPrincipals" placeholder="请输入负责人" maxlength="50" show-word-limit/>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="归属单位" prop="docRespDept">
|
||||
<treeselect v-model="form.docRespDept" :options="deptOptions" :show-count="true" placeholder="请输入归属单位"/>
|
||||
<treeselect v-model="form.docRespDept" :options="deptOptions" :show-count="true"
|
||||
:disabled="detailBoolean" placeholder="请输入归属单位"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
@ -86,6 +102,7 @@
|
||||
:acceptType="acceptType"
|
||||
:limit="1"
|
||||
:dataFile="dataFile"
|
||||
:isDetail="detailBoolean"
|
||||
ref="uploadFile"
|
||||
@handleSuccess="handleUploadSuccess"
|
||||
@handleError="handleUploadError"
|
||||
@ -94,12 +111,69 @@
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<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>
|
||||
|
||||
</div><!--el-form-border 表单-->
|
||||
@ -115,6 +189,8 @@
|
||||
import uploadProgress from "./uploadProgress";
|
||||
import uploadVue from '@/components/FileUpload/optimizeUpload.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 {
|
||||
name: 'editDocument',
|
||||
@ -193,6 +269,18 @@
|
||||
editStatus: true,
|
||||
toolDataInfo: [],
|
||||
dataFile: [],
|
||||
//详情
|
||||
detailBoolean: false,
|
||||
|
||||
discussionContent: null, // 评论内容
|
||||
repliesContent: null, // 回复内容
|
||||
// 评论列表
|
||||
discussionsList: [],
|
||||
// 回复列表
|
||||
repliesList: [],
|
||||
showReplyForm: [],
|
||||
replyContent: [],
|
||||
detailLoading: false,
|
||||
}
|
||||
},
|
||||
created(){
|
||||
@ -378,30 +466,180 @@
|
||||
this.$refs.form.resetFields();
|
||||
this.toolDataInfo = []
|
||||
this.fileList = []
|
||||
this.detailBoolean = false
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.uploadFile.clearFile();
|
||||
})
|
||||
},
|
||||
editInit(docId, type){
|
||||
this.$refs.form.resetFields();
|
||||
this.toolDataInfo = []
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.uploadFile.clearFile();
|
||||
let self = this
|
||||
if(type == "detail"){
|
||||
this.detailBoolean = true
|
||||
}
|
||||
self.$refs.form.resetFields();
|
||||
self.toolDataInfo = []
|
||||
self.$nextTick(()=>{
|
||||
self.$refs.uploadFile.clearFile();
|
||||
|
||||
getDocument(docId).then(res => {
|
||||
this.form = res.data
|
||||
this.toolDataInfo = []
|
||||
let toolInfo = {toolId:this.form.toolId,toolName:this.form.toolName}
|
||||
this.toolDataInfo.push(toolInfo)
|
||||
self.form = res.data
|
||||
self.toolDataInfo = []
|
||||
let toolInfo = {toolId:self.form.toolId,toolName:self.form.toolName}
|
||||
self.toolDataInfo.push(toolInfo)
|
||||
|
||||
this.dataFile = []
|
||||
self.dataFile = []
|
||||
let fileData = res.data.attachment
|
||||
this.$set(fileData, "name", fileData.fileOldName)
|
||||
this.$set(fileData, "size", fileData.fileSize)
|
||||
this.dataFile.push(fileData)
|
||||
self.$set(fileData, "name", fileData.fileOldName)
|
||||
self.$set(fileData, "size", fileData.fileSize)
|
||||
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>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<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="sl">
|
||||
<el-form-item label="文档编号" prop="docCode">
|
||||
@ -20,7 +20,7 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="类别" prop="docType">
|
||||
<el-form-item label="文档类别" prop="docType">
|
||||
<el-select v-model="queryParams.docType" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="dict in dict.type.doc_class"
|
||||
@ -43,7 +43,7 @@
|
||||
placeholder="请选择归属单位"
|
||||
:show-count="true" style="width: 150px"/>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="来源" prop="docSource">
|
||||
<el-form-item label="文档来源" prop="docSource">
|
||||
<el-select v-model="queryParams.docSource" placeholder="请选择" >
|
||||
<el-option
|
||||
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 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">
|
||||
<el-table-column label="文档类别" align="center" 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="负责人" 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">
|
||||
<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>
|
||||
@ -158,6 +158,7 @@
|
||||
@click="handleEdit(scope.row)"
|
||||
v-hasPermi="['document:edit']"
|
||||
>编辑</el-button>
|
||||
<el-button type="text" icon="el-icon-info" @click="handleDetail(scope.row)">详情</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@ -219,8 +220,8 @@
|
||||
|
||||
<el-drawer :visible.sync="open" :modal-append-to-body="false" size="75%">
|
||||
<template #title>
|
||||
<span class="title">新增文档资源</span>
|
||||
<div class="drawer-head-btn">
|
||||
<span class="title">{{docTitle}}</span>
|
||||
<div class="drawer-head-btn" v-if="docDetailDisable">
|
||||
<el-button type="primary" @click="$refs.editDocumentRef.submitForm()">确 定</el-button>
|
||||
<el-button @click="docCancel()">取 消</el-button>
|
||||
</div><!--drawer-head-btn 抽屉顶部按钮区域-->
|
||||
@ -232,7 +233,12 @@
|
||||
<!-- 工具导出对话框 -->
|
||||
<el-drawer :visible.sync="exportDrawerOpen" size="75%" :show-close="false">
|
||||
<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">
|
||||
<el-button type="primary" @click="handleExport">提交</el-button>
|
||||
<el-button @click="exportDrawerOpen=false">取消</el-button>
|
||||
@ -246,10 +252,10 @@
|
||||
<el-checkbox-group v-model="checkList">
|
||||
<el-checkbox label="docCode">文档编号</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="docRespDeptName">归属单位</el-checkbox>
|
||||
<el-checkbox label="docSource">来源</el-checkbox>
|
||||
<el-checkbox label="docSource">文档来源</el-checkbox>
|
||||
<el-checkbox label="toolName">关联工具</el-checkbox>
|
||||
<el-checkbox label="docStatus">上传状态</el-checkbox>
|
||||
<el-checkbox label="createTime">创建时间</el-checkbox>
|
||||
@ -265,7 +271,7 @@
|
||||
</template>
|
||||
|
||||
<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 { 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 Treeselect from "@riophae/vue-treeselect";
|
||||
import { addCount } from "@/api/tool/downloadCount";
|
||||
import { exportDocx } from '@/utils/docUtil/docutil.js';
|
||||
|
||||
export default {
|
||||
name: "Document",
|
||||
@ -382,6 +389,21 @@ export default {
|
||||
columnList: ['docCode', 'docName', 'docType', 'docPrincipals', 'docRespDeptName', 'docSource', 'toolName', 'docStatus', 'createTime'],
|
||||
checkList: [],
|
||||
exportDrawerOpen: false,
|
||||
docTitle: '',
|
||||
//文件详情标识
|
||||
docDetailDisable: true,
|
||||
//导出类型
|
||||
statevalue: 1,
|
||||
stateoptions: [
|
||||
{
|
||||
value: 1,
|
||||
label: 'excel'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: 'word'
|
||||
}
|
||||
],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -440,17 +462,29 @@ export default {
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.docTitle="新增文档资源"
|
||||
this.docDetailDisable=true
|
||||
this.open = true
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.editDocumentRef.resetForm();
|
||||
})
|
||||
},
|
||||
handleEdit(row){
|
||||
this.docTitle="编辑文档资源"
|
||||
this.docDetailDisable=true
|
||||
this.open = true
|
||||
this.$nextTick(()=>{
|
||||
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){
|
||||
this.viewDialogOpen = true;
|
||||
let protocol = window.location.protocol
|
||||
@ -606,12 +640,29 @@ export default {
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
if (this.statevalue == 1) {
|
||||
let excludeFields = this.columnList.filter(item=>!this.checkList.includes(item))
|
||||
this.download('/document/export', {
|
||||
...this.queryParams,
|
||||
downloadCheck:false,
|
||||
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() {
|
||||
this.viewDialogOpen = false
|
||||
|
@ -41,8 +41,8 @@ export default {
|
||||
return {
|
||||
codeUrl: "",
|
||||
loginForm: {
|
||||
username: "admin",
|
||||
password: "admin123",
|
||||
username: "",
|
||||
password: "",
|
||||
rememberMe: false,
|
||||
code: "",
|
||||
uuid: ""
|
||||
|
@ -107,9 +107,9 @@
|
||||
<dict-tag :options="dict.type.tool_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</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">
|
||||
<dict-tag :options="dict.type.tool_status" :value="scope.row.recordStatus"/>
|
||||
<dict-tag :options="dict.type.flow_status" :value="scope.row.recordStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="关联工具" align="center" :show-overflow-tooltip="true">
|
||||
@ -132,7 +132,8 @@
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<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-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)">
|
||||
@ -158,7 +159,12 @@
|
||||
<!-- 工具导出对话框 -->
|
||||
<el-drawer :visible.sync="exoportDrawerOpen" size="75%" :show-close="false">
|
||||
<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">
|
||||
<el-button type="primary" @click="handleExport">提交</el-button>
|
||||
<el-button @click="exoportDrawerOpen=false">取消</el-button>
|
||||
@ -229,7 +235,7 @@
|
||||
</template>
|
||||
|
||||
<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 { getToken } from "@/utils/auth";
|
||||
import { Base64 } from 'js-base64'
|
||||
@ -238,10 +244,11 @@ import toolDetail from "./toolDetail";
|
||||
import downloadFileDetail from "./downloadFileDetail.vue";
|
||||
import AddDoc from './AddDoc'
|
||||
import mainComponent from "@/components/mainComponent/index.vue";
|
||||
import { exportDocx } from '@/utils/docUtil/docutil.js';
|
||||
|
||||
export default {
|
||||
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 },
|
||||
data() {
|
||||
return {
|
||||
@ -340,6 +347,18 @@ export default {
|
||||
previewUrl: '',
|
||||
fileDetailDrawerOpen: false,
|
||||
fileDetailOpen: false,
|
||||
//导出类型
|
||||
statevalue: 1,
|
||||
stateoptions: [
|
||||
{
|
||||
value: 1,
|
||||
label: 'excel'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: 'word'
|
||||
}
|
||||
],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@ -460,6 +479,7 @@ export default {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.queryParams.deptId = undefined;
|
||||
this.queryParams.toolRespDept = undefined;
|
||||
this.$refs.tree.setCurrentKey(null);
|
||||
this.handleQuery();
|
||||
},
|
||||
@ -518,12 +538,29 @@ export default {
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
if (this.statevalue == 1) {
|
||||
let excludeFields = this.columnList.filter(item=>!this.checkList.includes(item))
|
||||
this.download('/tool/export', {
|
||||
...this.queryParams,
|
||||
downloadCheck:false,
|
||||
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) {
|
||||
|
@ -872,9 +872,12 @@ export default {
|
||||
return true
|
||||
},
|
||||
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.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