|
@@ -1,80 +1,95 @@
|
|
<template>
|
|
<template>
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
|
- <el-form-item label="文档名称" prop="docName">
|
|
|
|
- <el-input v-model="queryParams.docName" placeholder="请输入文档名称" clearable @keyup.enter.native="handleQuery" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="文档级别" prop="docLevel">
|
|
|
|
- <el-input v-model="queryParams.docLevel" placeholder="请输入文档级别" clearable @keyup.enter.native="handleQuery" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="文档年份" prop="createYear">
|
|
|
|
- <el-input v-model="queryParams.createYear" placeholder="请输入文档创建年份" clearable
|
|
|
|
- @keyup.enter.native="handleQuery" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item>
|
|
|
|
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
-
|
|
|
|
- <el-row :gutter="10" class="mb8">
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
|
|
|
- v-hasPermi="['doc:info:add']">新增</el-button>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
- <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
|
|
|
|
- v-hasPermi="['doc:info:edit']">修改</el-button>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
- <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
|
|
|
|
- v-hasPermi="['doc:info:remove']">删除</el-button>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
|
|
|
- v-hasPermi="['doc:info:export']">导出</el-button>
|
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
+ <!--目录数据-->
|
|
|
|
+ <el-col :span="4" :xs="24">
|
|
|
|
+ <div class="head-container">
|
|
|
|
+ <el-tree :data="dirList" :props="defaultProps" :expand-on-click-node="false" ref="tree" node-key="id"
|
|
|
|
+ default-expand-all highlight-current @node-click="handleNodeClick" />
|
|
|
|
+ </div>
|
|
</el-col>
|
|
</el-col>
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
- </el-row>
|
|
|
|
|
|
+ <!--文件数据-->
|
|
|
|
+ <el-col :span="16" :xs=24>
|
|
|
|
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
|
|
|
+ label-width="68px">
|
|
|
|
+ <el-form-item label="文件名称" prop="docName">
|
|
|
|
+ <el-input v-model="queryParams.docName" placeholder="请输入文件名称" clearable @keyup.enter.native="handleQuery" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="文件级别" prop="docLevel">
|
|
|
|
+ <el-input v-model="queryParams.docLevel" placeholder="请输入文件级别" clearable
|
|
|
|
+ @keyup.enter.native="handleQuery" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="文件年份" prop="createYear">
|
|
|
|
+ <el-input v-model="queryParams.createYear" placeholder="请输入文件创建年份" clearable
|
|
|
|
+ @keyup.enter.native="handleQuery" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+
|
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
+ <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
|
|
|
+ v-hasPermi="['doc:info:add']">上传</el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
+ <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
|
|
|
|
+ v-hasPermi="['doc:info:edit']">修改</el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
+ <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
|
|
|
|
+ v-hasPermi="['doc:info:remove']">删除</el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
+ <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
|
|
|
+ v-hasPermi="['doc:info:export']">导出</el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
+ </el-row>
|
|
|
|
|
|
- <el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
|
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
|
- <el-table-column label="文档ID" align="center" prop="docId" />
|
|
|
|
- <el-table-column label="文档名称" align="center" prop="docName" />
|
|
|
|
- <el-table-column label="文档级别" align="center" prop="docLevel" />
|
|
|
|
- <el-table-column label="文档年份" align="center" prop="createYear" />
|
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-button size="mini" type="text" icon="el-icon-view" @click="handlePreview(scope.row)">预览</el-button>
|
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
|
|
|
- v-hasPermi="['doc:info:edit']">修改</el-button>
|
|
|
|
- <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
|
|
|
- v-hasPermi="['doc:info:remove']">删除</el-button>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
|
|
+ <el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
|
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
|
+ <el-table-column label="文件名称" align="center" prop="docName" />
|
|
|
|
+ <el-table-column label="文件大小" align="center" prop="docSize" :formatter="fileSizeData" />
|
|
|
|
+ <el-table-column label="修改时间" align="center" prop="updateTime" />
|
|
|
|
+ <el-table-column label="文件级别" align="center" prop="docLevel" />
|
|
|
|
+ <el-table-column label="文件年份" align="center" prop="createYear" />
|
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-view" @click="handlePreview(scope.row)">分享</el-button>
|
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-view" @click="handlePreview(scope.row)">下载</el-button>
|
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-view" @click="handlePreview(scope.row)">预览</el-button>
|
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-view" @click="handleEdit(scope.row)">在线编辑</el-button>
|
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
|
|
|
+ v-hasPermi="['doc:info:edit']">修改</el-button>
|
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
|
|
|
+ v-hasPermi="['doc:info:remove']">删除</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
|
|
- <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
|
|
|
- @pagination="getList" />
|
|
|
|
|
|
+ <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
|
|
|
+ @pagination="getList" />
|
|
|
|
|
|
- <!-- 添加或修改文档基本信息对话框 -->
|
|
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <!-- 添加或修改文件基本信息对话框 -->
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
- <el-form-item label="文档名称" prop="docName">
|
|
|
|
- <el-input v-model="form.docName" placeholder="请输入文档名称" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="文档描述">
|
|
|
|
- <editor v-model="form.docDesc" :min-height="192" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="文档存储路径" prop="docPath">
|
|
|
|
- <!-- <el-input v-model="form.docPath" placeholder="请输入文档路径" /> -->
|
|
|
|
|
|
+ <el-form-item label="" prop="docPath">
|
|
|
|
+ <!-- <el-input v-model="form.docPath" placeholder="请输入文件路径" /> -->
|
|
<file-upload v-model="form.docPath" />
|
|
<file-upload v-model="form.docPath" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="文档级别" prop="docLevel">
|
|
|
|
- <el-input v-model="form.docLevel" placeholder="请输入文档级别" />
|
|
|
|
|
|
+ <el-form-item label="文件名称" prop="docName">
|
|
|
|
+ <el-input v-model="form.docName" placeholder="请输入文件名称" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="文件描述">
|
|
|
|
+ <el-input v-model="form.docDesc" type="textarea" placeholder="请输入内容" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="文档年份" prop="createYear">
|
|
|
|
- <el-input v-model="form.createYear" placeholder="请输入文档创建年份" />
|
|
|
|
|
|
+ <el-form-item label="文件级别" prop="docLevel">
|
|
|
|
+ <el-input v-model="form.docLevel" placeholder="请输入文件级别" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -82,9 +97,6 @@
|
|
<el-button @click="cancel">取 消</el-button>
|
|
<el-button @click="cancel">取 消</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
- <div v-if='show' class='qualityManual-container-office'>
|
|
|
|
- <vab-only-office :option='option' />
|
|
|
|
- </div>
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -96,14 +108,23 @@
|
|
addInfo,
|
|
addInfo,
|
|
updateInfo
|
|
updateInfo
|
|
} from "@/api/doc/info";
|
|
} from "@/api/doc/info";
|
|
|
|
+ import {
|
|
|
|
+ listDir,
|
|
|
|
+ getDir,
|
|
|
|
+ delDir,
|
|
|
|
+ addDir,
|
|
|
|
+ updateDir,
|
|
|
|
+ personalList
|
|
|
|
+ } from "@/api/doc/dir";
|
|
|
|
|
|
- import vabOnlyOffice from '@/views/tool/onlyoffice.vue';
|
|
|
|
|
|
+ import Treeselect from "@riophae/vue-treeselect";
|
|
|
|
+ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
|
+ name: "Info",
|
|
components: {
|
|
components: {
|
|
- vabOnlyOffice
|
|
|
|
|
|
+ Treeselect
|
|
},
|
|
},
|
|
- name: "Info",
|
|
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
// 遮罩层
|
|
// 遮罩层
|
|
@@ -118,8 +139,10 @@
|
|
showSearch: true,
|
|
showSearch: true,
|
|
// 总条数
|
|
// 总条数
|
|
total: 0,
|
|
total: 0,
|
|
- // 文档基本信息表格数据
|
|
|
|
|
|
+ // 文件基本信息表格数据
|
|
infoList: [],
|
|
infoList: [],
|
|
|
|
+ dirId: undefined, //目录ID
|
|
|
|
+ dirList: undefined,
|
|
// 弹出层标题
|
|
// 弹出层标题
|
|
title: "",
|
|
title: "",
|
|
// 是否显示弹出层
|
|
// 是否显示弹出层
|
|
@@ -134,58 +157,63 @@
|
|
},
|
|
},
|
|
// 表单参数
|
|
// 表单参数
|
|
form: {},
|
|
form: {},
|
|
|
|
+ defaultProps: {
|
|
|
|
+ children: "children",
|
|
|
|
+ label: "dirName",
|
|
|
|
+ id: "dirId"
|
|
|
|
+ },
|
|
// 表单校验
|
|
// 表单校验
|
|
rules: {
|
|
rules: {
|
|
docName: [{
|
|
docName: [{
|
|
required: true,
|
|
required: true,
|
|
- message: "文档名称不能为空",
|
|
|
|
|
|
+ message: "文件名称不能为空",
|
|
trigger: "blur"
|
|
trigger: "blur"
|
|
}],
|
|
}],
|
|
createYear: [{
|
|
createYear: [{
|
|
required: true,
|
|
required: true,
|
|
- message: "文档创建年份;文档创建年份,分表用不能为空",
|
|
|
|
|
|
+ message: "文件创建年份;文件创建年份,分表用不能为空",
|
|
trigger: "blur"
|
|
trigger: "blur"
|
|
}],
|
|
}],
|
|
- },
|
|
|
|
- option: {
|
|
|
|
- key: '', //key 使用文档ID+年份
|
|
|
|
- url: '', //在线文档地址
|
|
|
|
- isEdit: '', //是否允许编辑
|
|
|
|
- fileType: '', //文件扩展名
|
|
|
|
- title: '', //文件标题
|
|
|
|
- user: {
|
|
|
|
- id: null, //用户ID
|
|
|
|
- name: '' //用户姓名
|
|
|
|
- },
|
|
|
|
- editUrl: '' //回调地址
|
|
|
|
- },
|
|
|
|
- show: true //是否显示
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- this.getList();
|
|
|
|
|
|
+ this.dirTree();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 节点单击事件
|
|
|
|
+ handleNodeClick(data) {
|
|
|
|
+ this.dirId = data.dirId;
|
|
|
|
+ this.queryParams.dirId = this.dirId;
|
|
|
|
+ this.queryParams.searchValue = this.spaceId;
|
|
|
|
+ this.handleQuery();
|
|
|
|
+ },
|
|
|
|
+ //预览
|
|
handlePreview(row) {
|
|
handlePreview(row) {
|
|
- console.log(row);
|
|
|
|
- //获取当前登录用户名:this.$store.state.user.name
|
|
|
|
- //获取当前登录用户ID:this.$store.state.user.uid
|
|
|
|
- //获取当前登录用户昵称:this.$store.state.user.uname
|
|
|
|
- this.show = true;
|
|
|
|
- // getAction('/file/selectById', { id: this.id }).then(res => {
|
|
|
|
- this.option.isEdit = true;
|
|
|
|
- this.option.url = row.docPath;
|
|
|
|
- //'http://192.168.1.26:9300/statics/2023/04/03/产品研发会议纪要20230314_20230403170635A001.doc';
|
|
|
|
- this.option.title = row.docName; //'测试word';
|
|
|
|
- this.option.fileType = row.docType;
|
|
|
|
|
|
+ row.isEdit = false;
|
|
|
|
+ this.$tab.openPage("文件[" + row.docName + "]预览", '/doc/oo-edit/index/' + row.docId, row);
|
|
|
|
+ },
|
|
|
|
+ //在线编辑
|
|
|
|
+ handleEdit(row) {
|
|
|
|
+ row.isEdit = true;
|
|
|
|
+ this.$tab.openPage("文件[" + row.docName + "]在线编辑", '/doc/oo-edit/index/' + row.docId, row);
|
|
|
|
+ },
|
|
|
|
+ //先获取左边目录树,拿到目录ID和spaceId才能查询
|
|
|
|
+ dirTree() {
|
|
|
|
+ this.loading = true;
|
|
|
|
+ personalList().then(response => {
|
|
|
|
+ this.dirId = response.data[0].dirId;
|
|
|
|
+ this.spaceId = response.data[0].spaceId;
|
|
|
|
+ this.dirList = this.handleTree(response.data, "dirId");
|
|
|
|
|
|
- this.option.user = {
|
|
|
|
- id: this.$store.state.user.uid,
|
|
|
|
- name: this.$store.state.user.uname
|
|
|
|
- };
|
|
|
|
- this.option.editUrl = 'http://192.168.1.26:8080/doc/only-office/callback?id='+row.docId+"&year="+row.createYear
|
|
|
|
|
|
+ this.queryParams.dirId = this.dirId;
|
|
|
|
+ this.queryParams.searchValue = this.spaceId;
|
|
|
|
+ this.getList();
|
|
|
|
+
|
|
|
|
+ this.loading = false;
|
|
|
|
+ });
|
|
},
|
|
},
|
|
- /** 查询文档基本信息列表 */
|
|
|
|
|
|
+ /** 查询文件基本信息列表 */
|
|
getList() {
|
|
getList() {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
listInfo(this.queryParams).then(response => {
|
|
listInfo(this.queryParams).then(response => {
|
|
@@ -203,6 +231,7 @@
|
|
reset() {
|
|
reset() {
|
|
this.form = {
|
|
this.form = {
|
|
docId: null,
|
|
docId: null,
|
|
|
|
+ dirId: this.dirId,
|
|
docName: null,
|
|
docName: null,
|
|
docType: null,
|
|
docType: null,
|
|
docSize: null,
|
|
docSize: null,
|
|
@@ -219,7 +248,8 @@
|
|
updateBy: null,
|
|
updateBy: null,
|
|
updateTime: null,
|
|
updateTime: null,
|
|
remark: null,
|
|
remark: null,
|
|
- isDel: null
|
|
|
|
|
|
+ isDel: null,
|
|
|
|
+ searchValue: this.spaceId
|
|
};
|
|
};
|
|
this.resetForm("form");
|
|
this.resetForm("form");
|
|
},
|
|
},
|
|
@@ -231,6 +261,8 @@
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
resetQuery() {
|
|
resetQuery() {
|
|
this.resetForm("queryForm");
|
|
this.resetForm("queryForm");
|
|
|
|
+ this.queryParams.dirId = this.dirId;
|
|
|
|
+ this.queryParams.searchValue = this.spaceId;
|
|
this.handleQuery();
|
|
this.handleQuery();
|
|
},
|
|
},
|
|
// 多选框选中数据
|
|
// 多选框选中数据
|
|
@@ -243,7 +275,7 @@
|
|
handleAdd() {
|
|
handleAdd() {
|
|
this.reset();
|
|
this.reset();
|
|
this.open = true;
|
|
this.open = true;
|
|
- this.title = "添加文档基本信息";
|
|
|
|
|
|
+ this.title = "添加文件基本信息";
|
|
},
|
|
},
|
|
/** 修改按钮操作 */
|
|
/** 修改按钮操作 */
|
|
handleUpdate(row) {
|
|
handleUpdate(row) {
|
|
@@ -252,7 +284,7 @@
|
|
getInfo(docId, row.createYear).then(response => {
|
|
getInfo(docId, row.createYear).then(response => {
|
|
this.form = response.data;
|
|
this.form = response.data;
|
|
this.open = true;
|
|
this.open = true;
|
|
- this.title = "修改文档基本信息";
|
|
|
|
|
|
+ this.title = "修改文件基本信息";
|
|
});
|
|
});
|
|
},
|
|
},
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
@@ -278,7 +310,7 @@
|
|
/** 删除按钮操作 */
|
|
/** 删除按钮操作 */
|
|
handleDelete(row) {
|
|
handleDelete(row) {
|
|
const docIds = row.docId || this.ids;
|
|
const docIds = row.docId || this.ids;
|
|
- this.$modal.confirm('是否确认删除文档基本信息编号为"' + docIds + '"的数据项?').then(function() {
|
|
|
|
|
|
+ this.$modal.confirm('是否确认删除文件基本信息编号为"' + docIds + '"的数据项?').then(function() {
|
|
return delInfo(docIds);
|
|
return delInfo(docIds);
|
|
}).then(() => {
|
|
}).then(() => {
|
|
this.getList();
|
|
this.getList();
|
|
@@ -290,6 +322,19 @@
|
|
this.download('doc/info/export', {
|
|
this.download('doc/info/export', {
|
|
...this.queryParams
|
|
...this.queryParams
|
|
}, `info_${new Date().getTime()}.xlsx`)
|
|
}, `info_${new Date().getTime()}.xlsx`)
|
|
|
|
+ },
|
|
|
|
+ /**格式化文件大小数据*/
|
|
|
|
+ fileSizeData(row, col, value) {
|
|
|
|
+ const KB = 1;
|
|
|
|
+ const MB = KB * 1024;
|
|
|
|
+ const GB = MB * 1024;
|
|
|
|
+ if (value < MB) {
|
|
|
|
+ return `${(value / KB).toFixed(2)} KB`;
|
|
|
|
+ } else if (value < GB) {
|
|
|
|
+ return `${(value / MB).toFixed(2)} MB`;
|
|
|
|
+ } else {
|
|
|
|
+ return `${(value / GB).toFixed(2)} GB`;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|