|
@@ -244,7 +244,7 @@
|
|
<el-table-column label="操作" align="center" width="320">
|
|
<el-table-column label="操作" align="center" width="320">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
<el-button type="primary" @click="previewTemplate(scope.row)"
|
|
<el-button type="primary" @click="previewTemplate(scope.row)"
|
|
- >查看历史版本</el-button
|
|
|
|
|
|
+ >预览</el-button
|
|
>
|
|
>
|
|
<el-button type="primary" @click="replaceTemplate(scope.row)"
|
|
<el-button type="primary" @click="replaceTemplate(scope.row)"
|
|
>替换</el-button
|
|
>替换</el-button
|
|
@@ -254,16 +254,15 @@
|
|
trigger="click"
|
|
trigger="click"
|
|
@command="(command) => handleExport(command, scope.row)"
|
|
@command="(command) => handleExport(command, scope.row)"
|
|
>
|
|
>
|
|
- <!-- <el-button type="success">
|
|
|
|
|
|
+ <el-button type="success">
|
|
导出文档<i class="el-icon-arrow-down el-icon--right"></i>
|
|
导出文档<i class="el-icon-arrow-down el-icon--right"></i>
|
|
</el-button>
|
|
</el-button>
|
|
<template #dropdown>
|
|
<template #dropdown>
|
|
<el-dropdown-menu>
|
|
<el-dropdown-menu>
|
|
- <el-dropdown-item command="word">Word格式</el-dropdown-item
|
|
|
|
- >
|
|
|
|
|
|
+ <el-dropdown-item command="word">Word格式</el-dropdown-item>
|
|
<el-dropdown-item command="pdf">PDF格式</el-dropdown-item>
|
|
<el-dropdown-item command="pdf">PDF格式</el-dropdown-item>
|
|
- </el-dropdown-menu>
|
|
|
|
- </template> --><!-- word -->
|
|
|
|
|
|
+ </el-dropdown-menu> </template
|
|
|
|
+ ><!-- word -->
|
|
<!-- <el-dropdown-item command="pdf-to-word"
|
|
<!-- <el-dropdown-item command="pdf-to-word"
|
|
>Word</el-dropdown-item
|
|
>Word</el-dropdown-item
|
|
> -->
|
|
> -->
|
|
@@ -1694,9 +1693,31 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|
|
- previewTemplate(template) {
|
|
|
|
|
|
+ async previewTemplate(template) {
|
|
this.currentTemplate = template;
|
|
this.currentTemplate = template;
|
|
- this.loadDocumentVersions(template);
|
|
|
|
|
|
+ /* this.loadDocumentVersions(template); */
|
|
|
|
+ const res = await searchlistDoc({
|
|
|
|
+ page: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ template_id: template.id,
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ if (res.status === 200) {
|
|
|
|
+ /* this.documentVersions = res.data.dataList[0]; */
|
|
|
|
+ if (res.data.dataList.length !== 0) {
|
|
|
|
+ let url = `#/document/viewCreate?articleId=${res.data.dataList[0].id}&type=document`;
|
|
|
|
+ window.open(url, "_blank");
|
|
|
|
+ } else {
|
|
|
|
+ let a = document.createElement("a");
|
|
|
|
+ a.href = "#/document/viewCreate?articleId=" + template.id;
|
|
|
|
+ a.target = "_blank";
|
|
|
|
+ a.click();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /* if (this.documentVersions.length === 0) {
|
|
|
|
+ this.$message.warning("未找到相关文档版本");
|
|
|
|
+ } */
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
replaceTemplate(template) {
|
|
replaceTemplate(template) {
|
|
@@ -1972,10 +1993,13 @@ export default {
|
|
_this.docAttr.template_id = _this.docAttr.id;
|
|
_this.docAttr.template_id = _this.docAttr.id;
|
|
createDocument(_this.docAttr).then((res) => {
|
|
createDocument(_this.docAttr).then((res) => {
|
|
if (res.status != 200) return; //更新文档
|
|
if (res.status != 200) return; //更新文档
|
|
- _this.docAttr.id = res.data;
|
|
|
|
|
|
+ /* _this.docAttr.id = res.data; */
|
|
_this.$message.success("文档创建成功");
|
|
_this.$message.success("文档创建成功");
|
|
|
|
+ searchlistDoc({
|
|
|
|
+ page: 1,
|
|
|
|
+ pageSize: 999,
|
|
|
|
+ });
|
|
});
|
|
});
|
|
- /* createDocument() */
|
|
|
|
},
|
|
},
|
|
|
|
|
|
// 添加统一的内容处理方法
|
|
// 添加统一的内容处理方法
|