|
@@ -2,12 +2,16 @@
|
|
<div class="doc-container">
|
|
<div class="doc-container">
|
|
<div class="editor-top">
|
|
<div class="editor-top">
|
|
<div class="left">
|
|
<div class="left">
|
|
- <div class="doc">
|
|
|
|
|
|
+ <div class="doc" v-if="type == 'document'">
|
|
<span>当前打开文档:</span
|
|
<span>当前打开文档:</span
|
|
>{{ docAttr.title == "" ? "新建文档" : docAttr.title }}
|
|
>{{ docAttr.title == "" ? "新建文档" : docAttr.title }}
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="doc" v-else>
|
|
|
|
+ <span>当前打开模版:</span
|
|
|
|
+ >{{ docAttr.title == "" ? "新建模版" : docAttr.title }}
|
|
|
|
+ </div>
|
|
<div class="creator" v-if="userInfo != null">
|
|
<div class="creator" v-if="userInfo != null">
|
|
- <span>创建者:</span>{{ userInfo.username }}
|
|
|
|
|
|
+ <span>创建者:</span>{{ userInfo && userInfo.username }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="right">
|
|
<div class="right">
|
|
@@ -15,17 +19,26 @@
|
|
type="primary"
|
|
type="primary"
|
|
size="mini"
|
|
size="mini"
|
|
@click="onSaveAs"
|
|
@click="onSaveAs"
|
|
- v-if="type !== 'module'"
|
|
|
|
|
|
+ v-if="type !== 'module' && type == 'document'"
|
|
>保存文档</el-button
|
|
>保存文档</el-button
|
|
><!-- v-if="docAttr.id > 0" -->
|
|
><!-- v-if="docAttr.id > 0" -->
|
|
<el-button
|
|
<el-button
|
|
type="primary"
|
|
type="primary"
|
|
size="mini"
|
|
size="mini"
|
|
- @click="onSave"
|
|
|
|
- v-if="docAttr.is_template == 0 && docAttr.id > 0 && type !== 'module'"
|
|
|
|
|
|
+ @click="renew"
|
|
|
|
+ v-if="
|
|
|
|
+ docAttr.is_template == 0 &&
|
|
|
|
+ docAttr.id > 0 &&
|
|
|
|
+ type !== 'module' &&
|
|
|
|
+ type == 'document'
|
|
|
|
+ "
|
|
>更新文档</el-button
|
|
>更新文档</el-button
|
|
>
|
|
>
|
|
- <el-popover placement="bottom" trigger="click" v-if="type !== 'module'">
|
|
|
|
|
|
+ <el-popover
|
|
|
|
+ placement="bottom"
|
|
|
|
+ trigger="click"
|
|
|
|
+ v-if="type !== 'module' && type !== 'document'"
|
|
|
|
+ >
|
|
<el-button @click="onSaveUpload">保存</el-button>
|
|
<el-button @click="onSaveUpload">保存</el-button>
|
|
<el-button @click="onUpload">更新</el-button>
|
|
<el-button @click="onUpload">更新</el-button>
|
|
<el-button
|
|
<el-button
|
|
@@ -47,7 +60,7 @@
|
|
<el-button
|
|
<el-button
|
|
type="primary"
|
|
type="primary"
|
|
size="mini"
|
|
size="mini"
|
|
- v-if="type !== 'module'"
|
|
|
|
|
|
+ v-if="type !== 'module' && type == 'document'"
|
|
@click="onOpenView"
|
|
@click="onOpenView"
|
|
>预览导出
|
|
>预览导出
|
|
</el-button>
|
|
</el-button>
|
|
@@ -59,13 +72,17 @@
|
|
<div class="editor-content">
|
|
<div class="editor-content">
|
|
<div class="neary-doc">
|
|
<div class="neary-doc">
|
|
<div class="left-content">
|
|
<div class="left-content">
|
|
- <div class="search">
|
|
|
|
|
|
+ <!-- <div class="search">
|
|
<el-input placeholder="搜索文档标题"></el-input>
|
|
<el-input placeholder="搜索文档标题"></el-input>
|
|
- </div>
|
|
|
|
|
|
+ </div> -->
|
|
<div class="new-article">
|
|
<div class="new-article">
|
|
<div v-if="showView == 0 && type !== 'module'">
|
|
<div v-if="showView == 0 && type !== 'module'">
|
|
<el-collapse v-model="activeNames">
|
|
<el-collapse v-model="activeNames">
|
|
- <el-collapse-item title="最新文档" name="-1">
|
|
|
|
|
|
+ <el-collapse-item
|
|
|
|
+ title="最新文档"
|
|
|
|
+ name="-1"
|
|
|
|
+ v-if="type == 'document'"
|
|
|
|
+ >
|
|
<div
|
|
<div
|
|
v-for="(it, index) in articleList"
|
|
v-for="(it, index) in articleList"
|
|
draggable
|
|
draggable
|
|
@@ -80,7 +97,7 @@
|
|
<el-collapse-item
|
|
<el-collapse-item
|
|
title="模版列表"
|
|
title="模版列表"
|
|
name="-2"
|
|
name="-2"
|
|
- v-if="showView == 0"
|
|
|
|
|
|
+ v-if="showView == 0 && type !== 'document'"
|
|
>
|
|
>
|
|
<div
|
|
<div
|
|
v-for="(it, index) in templateList"
|
|
v-for="(it, index) in templateList"
|
|
@@ -100,6 +117,7 @@
|
|
v-model="activeModel"
|
|
v-model="activeModel"
|
|
:accordion="true"
|
|
:accordion="true"
|
|
@change="handleItemClick"
|
|
@change="handleItemClick"
|
|
|
|
+ class="borderless-collapse"
|
|
>
|
|
>
|
|
<el-collapse-item
|
|
<el-collapse-item
|
|
v-for="(item, itemIndex) in categoryList"
|
|
v-for="(item, itemIndex) in categoryList"
|
|
@@ -112,6 +130,7 @@
|
|
v-model="item.activeChildren"
|
|
v-model="item.activeChildren"
|
|
@change="handleItemVal"
|
|
@change="handleItemVal"
|
|
v-show="item.children"
|
|
v-show="item.children"
|
|
|
|
+ class="borderless-collapse"
|
|
>
|
|
>
|
|
<el-collapse-item
|
|
<el-collapse-item
|
|
v-for="(child, childIndex) in item.children"
|
|
v-for="(child, childIndex) in item.children"
|
|
@@ -125,6 +144,7 @@
|
|
group: { name: 'itxst', pull: 'clone' },
|
|
group: { name: 'itxst', pull: 'clone' },
|
|
sort: true,
|
|
sort: true,
|
|
}"
|
|
}"
|
|
|
|
+ :disabled="type == 'module'"
|
|
>
|
|
>
|
|
<transition-group>
|
|
<transition-group>
|
|
<div
|
|
<div
|
|
@@ -144,6 +164,7 @@
|
|
group: { name: 'itxst', pull: 'clone' },
|
|
group: { name: 'itxst', pull: 'clone' },
|
|
sort: true,
|
|
sort: true,
|
|
}"
|
|
}"
|
|
|
|
+ :disabled="type == 'module'"
|
|
>
|
|
>
|
|
<transition-group>
|
|
<transition-group>
|
|
<div
|
|
<div
|
|
@@ -167,14 +188,15 @@
|
|
:class="showView == 0 ? 'active-item' : ''"
|
|
:class="showView == 0 ? 'active-item' : ''"
|
|
@click="viewDocument"
|
|
@click="viewDocument"
|
|
>
|
|
>
|
|
- 查看文档
|
|
|
|
|
|
+ <span v-if="type == 'document'">查看文档</span>
|
|
|
|
+ <span v-else>查看模版</span>
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
class="sidebar-item"
|
|
class="sidebar-item"
|
|
:class="showView == 1 ? 'active-item' : ''"
|
|
:class="showView == 1 ? 'active-item' : ''"
|
|
@click="viewModule"
|
|
@click="viewModule"
|
|
>
|
|
>
|
|
- 查看模块
|
|
|
|
|
|
+ 模块列表
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -213,12 +235,12 @@
|
|
<div class="editor-option">
|
|
<div class="editor-option">
|
|
<div class="editor-menu">
|
|
<div class="editor-menu">
|
|
<div
|
|
<div
|
|
- v-if="type !== 'module'"
|
|
|
|
|
|
+ v-if="type !== 'module' && type !== 'document'"
|
|
class="item"
|
|
class="item"
|
|
@click="onSetActiveIndexs(3)"
|
|
@click="onSetActiveIndexs(3)"
|
|
:class="docuComIndex == 3 ? 'active-item' : ''"
|
|
:class="docuComIndex == 3 ? 'active-item' : ''"
|
|
>
|
|
>
|
|
- <span class="name">文档属性</span>
|
|
|
|
|
|
+ <span class="name">模版属性</span>
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
class="item"
|
|
class="item"
|
|
@@ -243,7 +265,9 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <template v-if="docuComIndex == 3 && type !== 'module'">
|
|
|
|
|
|
+ <template
|
|
|
|
+ v-if="docuComIndex == 3 && type !== 'module' && type !== 'document'"
|
|
|
|
+ >
|
|
<docAttr :attrs="docAttr"></docAttr>
|
|
<docAttr :attrs="docAttr"></docAttr>
|
|
</template>
|
|
</template>
|
|
<template v-if="comIndex == 9998">
|
|
<template v-if="comIndex == 9998">
|
|
@@ -307,6 +331,54 @@
|
|
@onInsertProductAttr="onInsertProductAttr"
|
|
@onInsertProductAttr="onInsertProductAttr"
|
|
></ProductAttr>
|
|
></ProductAttr>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+ <el-dialog
|
|
|
|
+ :visible.sync="docVisible"
|
|
|
|
+ append-to-body
|
|
|
|
+ v-el-drag-dialog
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ width="500px"
|
|
|
|
+ custom-class="prod-verify"
|
|
|
|
+ title="文档信息"
|
|
|
|
+ >
|
|
|
|
+ <el-form
|
|
|
|
+ :model="docForm"
|
|
|
|
+ :rules="docRules"
|
|
|
|
+ ref="docRef"
|
|
|
|
+ label-position="left"
|
|
|
|
+ label-width="100"
|
|
|
|
+ >
|
|
|
|
+ <el-form-item label="文档名称:" prop="title">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="docForm.title"
|
|
|
|
+ style="width: 60%"
|
|
|
|
+ class="input-item"
|
|
|
|
+ placeholder="请填写文档名称"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ <el-form-item label="文档分类:" prop="category_id">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="docForm.category_id"
|
|
|
|
+ style="width: 60%"
|
|
|
|
+ placeholder="请选择所属分类"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="(item, index) in articleCategoryList"
|
|
|
|
+ :key="index"
|
|
|
|
+ :label="item.name"
|
|
|
|
+ :value="item.id"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="创建人:">
|
|
|
|
+ {{ userInfo && userInfo.username }}
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="closeDoc">取 消</el-button>
|
|
|
|
+ <el-button type="primary" @click="submitDoc">确 定</el-button>
|
|
|
|
+ </span>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -334,6 +406,7 @@ import {
|
|
updateDocument,
|
|
updateDocument,
|
|
getDocumentInfo,
|
|
getDocumentInfo,
|
|
exportDocument,
|
|
exportDocument,
|
|
|
|
+ searchDocumentCategory,
|
|
} from "@/api/document";
|
|
} from "@/api/document";
|
|
import ViewForm from "./com/view";
|
|
import ViewForm from "./com/view";
|
|
import elDragDialog from "@/directive/el-drag-dialog";
|
|
import elDragDialog from "@/directive/el-drag-dialog";
|
|
@@ -401,6 +474,16 @@ export default {
|
|
catalogIndex: 0, //目录信息
|
|
catalogIndex: 0, //目录信息
|
|
docuComIndex: 3,
|
|
docuComIndex: 3,
|
|
type: "",
|
|
type: "",
|
|
|
|
+ docVisible: false,
|
|
|
|
+ docForm: {
|
|
|
|
+ title: "",
|
|
|
|
+ category_id: "",
|
|
|
|
+ },
|
|
|
|
+ docRules: {
|
|
|
|
+ title: [{ required: true, message: "请输文档名称", trigger: "blur" }],
|
|
|
|
+ category_id: [{ required: true, message: "请选择文档分类", trigger: "change" }],
|
|
|
|
+ },
|
|
|
|
+ articleCategoryList: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
@@ -436,9 +519,38 @@ export default {
|
|
_this.loadTemplateInfo(templateId);
|
|
_this.loadTemplateInfo(templateId);
|
|
}
|
|
}
|
|
_this.isAdmin = _this.userInfo.roleInfo.is_admin;
|
|
_this.isAdmin = _this.userInfo.roleInfo.is_admin;
|
|
|
|
+ this.initArticleCategoryList();
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
+ /* 取消新增 */
|
|
|
|
+ closeDoc() {
|
|
|
|
+ this.docVisible = false;
|
|
|
|
+ this.docForm = {
|
|
|
|
+ title: "",
|
|
|
|
+ category_id: "",
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ /* 确定新增模块*/
|
|
|
|
+ submitDoc() {
|
|
|
|
+ this.$refs.docRef.validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ this.docAttr.title = this.docForm.title;
|
|
|
|
+ this.docAttr.category_id = this.docForm.category_id;
|
|
|
|
+ this.onSave();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ //加载文档分类
|
|
|
|
+ initArticleCategoryList() {
|
|
|
|
+ let _this = this;
|
|
|
|
+ searchDocumentCategory({ page: 1, pageSize: 99, status: 5 }).then(
|
|
|
|
+ (res) => {
|
|
|
|
+ if (res.status != 200) return;
|
|
|
|
+ _this.articleCategoryList = res.data.dataList;
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ },
|
|
updateAttrs(newComs, oldComs) {
|
|
updateAttrs(newComs, oldComs) {
|
|
newComs.forEach((newCom, comIndex) => {
|
|
newComs.forEach((newCom, comIndex) => {
|
|
const oldCom = oldComs[comIndex];
|
|
const oldCom = oldComs[comIndex];
|
|
@@ -763,6 +875,13 @@ export default {
|
|
};
|
|
};
|
|
getTemplateInfo(par).then((res) => {
|
|
getTemplateInfo(par).then((res) => {
|
|
if (res.status != 200) return;
|
|
if (res.status != 200) return;
|
|
|
|
+ if (res.data.attrs == null || res.data.type == "") {
|
|
|
|
+ res.data.attrs = "[]";
|
|
|
|
+ res.data.content = "请填写内容";
|
|
|
|
+ res.data.lay_id = "textArea";
|
|
|
|
+ res.data.type = "TextArea";
|
|
|
|
+ }
|
|
|
|
+ console.log(res.data);
|
|
res.data.attrs = JSON.parse(res.data.attrs);
|
|
res.data.attrs = JSON.parse(res.data.attrs);
|
|
_this.coms = [res.data];
|
|
_this.coms = [res.data];
|
|
});
|
|
});
|
|
@@ -938,10 +1057,24 @@ export default {
|
|
this.docuComIndex = 0;
|
|
this.docuComIndex = 0;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ /* 更新 */
|
|
|
|
+ renew() {
|
|
|
|
+ let _this = this;
|
|
|
|
+ _this.docVisible = true;
|
|
|
|
+ this.docForm.title = _this.docAttr.title;
|
|
|
|
+ this.docForm.category_id = _this.docAttr.category_id;
|
|
|
|
+ },
|
|
|
|
+ /* 保存 */
|
|
onSaveAs(e) {
|
|
onSaveAs(e) {
|
|
let _this = this;
|
|
let _this = this;
|
|
|
|
+ if (_this.coms.length <= 0) {
|
|
|
|
+ _this.$alert("请填写内容");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
_this.docAttr.id = "";
|
|
_this.docAttr.id = "";
|
|
- _this.onSave(e);
|
|
|
|
|
|
+ _this.docVisible = true;
|
|
|
|
+ this.docForm.title = _this.docAttr.title;
|
|
|
|
+ this.docForm.category_id = _this.docAttr.category_id;
|
|
},
|
|
},
|
|
//保存文档
|
|
//保存文档
|
|
onSave(e) {
|
|
onSave(e) {
|
|
@@ -970,6 +1103,11 @@ export default {
|
|
if (res.status != 200) return; //更新文档
|
|
if (res.status != 200) return; //更新文档
|
|
_this.docAttr.id = res.data;
|
|
_this.docAttr.id = res.data;
|
|
_this.$alert("文档更新成功");
|
|
_this.$alert("文档更新成功");
|
|
|
|
+ _this.docVisible = false;
|
|
|
|
+ _this.docForm = {
|
|
|
|
+ title: "",
|
|
|
|
+ category_id: "",
|
|
|
|
+ };
|
|
_this.searchArticle();
|
|
_this.searchArticle();
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
@@ -977,6 +1115,11 @@ export default {
|
|
if (res.status != 200) return; //保存文档
|
|
if (res.status != 200) return; //保存文档
|
|
_this.docAttr.id = res.data;
|
|
_this.docAttr.id = res.data;
|
|
_this.$alert("文档保存成功");
|
|
_this.$alert("文档保存成功");
|
|
|
|
+ _this.docVisible = false;
|
|
|
|
+ _this.docForm = {
|
|
|
|
+ title: "",
|
|
|
|
+ category_id: "",
|
|
|
|
+ };
|
|
_this.searchArticle();
|
|
_this.searchArticle();
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -1317,14 +1460,12 @@ export default {
|
|
} else {
|
|
} else {
|
|
//仅对图表中插入有效
|
|
//仅对图表中插入有效
|
|
if (_this.comIndex >= 0) {
|
|
if (_this.comIndex >= 0) {
|
|
- debugger;
|
|
|
|
_this.setTableData(data.id);
|
|
_this.setTableData(data.id);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//插入原数据
|
|
//插入原数据
|
|
insertSourceData(e) {
|
|
insertSourceData(e) {
|
|
- debugger;
|
|
|
|
let _this = this;
|
|
let _this = this;
|
|
if (_this.comIndex < 0) {
|
|
if (_this.comIndex < 0) {
|
|
_this.$alert("请选择插入图层");
|
|
_this.$alert("请选择插入图层");
|
|
@@ -1390,7 +1531,7 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
- //获取模板分类信息
|
|
|
|
|
|
+ //获取模版分类信息
|
|
async initCategoryList() {
|
|
async initCategoryList() {
|
|
let _this = this;
|
|
let _this = this;
|
|
/* let res = await getAllCategory({list:1 });
|
|
/* let res = await getAllCategory({list:1 });
|
|
@@ -1424,7 +1565,7 @@ export default {
|
|
);
|
|
);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- //获取模板列表
|
|
|
|
|
|
+ //获取模版列表
|
|
async getTemplateList(categoryId) {
|
|
async getTemplateList(categoryId) {
|
|
let _this = this;
|
|
let _this = this;
|
|
let res = await searchTemplate({
|
|
let res = await searchTemplate({
|
|
@@ -1464,4 +1605,15 @@ export default {
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
@import "./create.scss";
|
|
@import "./create.scss";
|
|
|
|
+.borderless-collapse {
|
|
|
|
+ border: none;
|
|
|
|
+
|
|
|
|
+ ::v-deep .el-collapse-item__header,
|
|
|
|
+ ::v-deep .el-collapse-item__wrap {
|
|
|
|
+ border-bottom: none;
|
|
|
|
+ }
|
|
|
|
+ ::v-deep .el-collapse-item .el-collapse-item__header{
|
|
|
|
+ border-bottom: none;
|
|
|
|
+ }
|
|
|
|
+}
|
|
</style>
|
|
</style>
|