1、文档新增详情和评论

2、新增导出word
3、预览功能调整
4、页面上图标等样式调整
This commit is contained in:
pan
2024-09-03 09:31:21 +08:00
parent 014341b671
commit 522a40ae64
16 changed files with 596 additions and 163 deletions

View File

@@ -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() {
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 == 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) {