Commit 95ade57c by liuyong

修改菜单

2 parents 4ceea449 f8bd6675
This diff could not be displayed because it is too large.
......@@ -13,8 +13,10 @@
"element-ui": "^2.15.14",
"jquery": "^3.7.1",
"vue": "^2.6.14",
"vue-cli": "^2.9.6",
"vue-router": "^3.5.1",
"vuex": "^3.6.2"
"vuex": "^3.6.2",
"webpack": "^5.89.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~5.0.0",
......
{
"eadata": [{
"id" : "busi-archi-chart",
"type" : "business-ea",
"title" : "业务架构",
"elements" : [{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "长方形",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
}]
},{
"id" : "appl-archi-chart",
"type" : "appl-ea",
"title" : "应用架构",
"elements" : [{
"name" : "原型",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "菱形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
}]
},{
"id" : "data-archi-chart",
"type" : "data-ea",
"title" : "数据架构",
"elements" : [{
"name" : "",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
}]
},{
"id" : "tech-archi-chart",
"type" : "tech-ea",
"title" : "技术架构",
"elements" : [{
"name" : "",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
}]
},{
"type" : "secr-ea",
"title" : "安全架构",
"id" : "secr-archi-chart",
"elements" : [{
"name" : "",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
}]
}]
}
\ No newline at end of file
......@@ -158,7 +158,7 @@ mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-AlliedTelesis.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-Android.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-ArchiMate.js');
// 20231122 汪皖苏 自定义更多图形
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-ArchiMate4.js');
// mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-ArchiMate4.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-ArchiMate3.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-Arrows2.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-Atlassian.js');
......@@ -185,6 +185,8 @@ mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-Electrical.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-ER.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-Floorplan.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-Flowchart.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-ArchiEA.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-FluidPower.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-GCP.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-GCP2.js');
......
(function()
{
Sidebar.prototype.addEAPalette = function()
{
this.setCurrentSearchEntryLibrary('eachart');
$.ajax({
url: '/drawio/eachart.json', // 代表请求的服务器地址
method: 'get', // 使用的请求方法
contentType: 'application/x-www-form-urlencoded', // 请求的 enctype
dataType: 'json', // 默认根据 response 头部的信息自动推测
async: true, // 是否使用异步请求的方式
}).done((data) => {
var ea = data.eadata;
if(ea) {
ea.forEach(ele => {
var ii = ele.elements;
var items = [];
ii.forEach(element => {
items.push(this.createVertexTemplateEntry(element.styles, element.w, element.h, null, element.name, null, null, element.name));
});
this.addPaletteFunctions(ea.id, ele.title, false, items);
});
}
});
this.setCurrentSearchEntryLibrary();
};
})();
......@@ -4,23 +4,23 @@
Sidebar.prototype.addArchimate3Palette = function()
{
this.setCurrentSearchEntryLibrary('archimate3', 'archimate3Application');
this.addArchimate3ApplicationPalette();
// this.addArchimate3ApplicationPalette();
this.setCurrentSearchEntryLibrary('archimate3', 'archimate3Business');
this.addArchimate3BusinessPalette();
// this.addArchimate3BusinessPalette();
this.setCurrentSearchEntryLibrary('archimate3', 'archimate3Composite');
this.addArchimate3CompositePalette();
// this.addArchimate3CompositePalette();
this.setCurrentSearchEntryLibrary('archimate3', 'archimate3Implementation and Migration');
this.addArchimate3ImplementationAndMigrationPalette();
// this.addArchimate3ImplementationAndMigrationPalette();
this.setCurrentSearchEntryLibrary('archimate3', 'archimate3Motivation');
this.addArchimate3MotivationPalette();
// this.addArchimate3MotivationPalette();
this.setCurrentSearchEntryLibrary('archimate3', 'archimate3Physical');
this.addArchimate3PhysicalPalette();
// this.addArchimate3PhysicalPalette();
this.setCurrentSearchEntryLibrary('archimate3', 'archimate3Relationships');
this.addArchimate3RelationshipsPalette();
// this.addArchimate3RelationshipsPalette();
this.setCurrentSearchEntryLibrary('archimate3', 'archimate3Strategy');
this.addArchimate3StrategyPalette();
// this.addArchimate3StrategyPalette();
this.setCurrentSearchEntryLibrary('archimate3', 'archimate3Technology');
this.addArchimate3TechnologyPalette();
// this.addArchimate3TechnologyPalette();
this.setCurrentSearchEntryLibrary();
};
......@@ -75,9 +75,7 @@
'Data Object', null, null, this.getTagsForStencil(gn, '', dt + 'data object').join(' '))
];
// this.addPalette('archimate3Application', 'Archimate 3.0 / Application', false, mxUtils.bind(this, function(content)
// 二次开发 20231117 wangwansu ArchiMate 3.0英文改中文
this.addPalette('archimate3Application', '架构 / 应用', false, mxUtils.bind(this, function(content)
this.addPalette('archimate3Application', 'Archimate 3.0 / Application', false, mxUtils.bind(this, function(content)
{
for (var i = 0; i < fns.length; i++)
{
......@@ -148,8 +146,8 @@
w * 150, h * 90, '', 'Representation', null, null, this.getTagsForStencil(gn, '', dt + 'representation').join(' '))
];
// this.addPalette('archimate3Business', 'archimate 3.0 / Business', true, mxUtils.bind(this, function(content)
this.addPalette('archimate3Business', '架构 / 业务', false, mxUtils.bind(this, function(content)
this.addPalette('archimate3Business', 'archimate 3.0 / Business', true, mxUtils.bind(this, function(content)
// this.addPalette('archimate3Business', '架构 / 业务', false, mxUtils.bind(this, function(content)
{
for (var i = 0; i < fns.length; i++)
{
......@@ -178,8 +176,7 @@
w * 150, h * 105, '', 'Group', null, null, this.getTagsForStencil(gn, '', dt + 'actor').join(' '))
];
// this.addPalette('archimate3Composite', 'Archimate 3.0 / Composite', false, mxUtils.bind(this, function(content)
this.addPalette('archimate3Composite', '架构 / 组合', false, mxUtils.bind(this, function(content)
this.addPalette('archimate3Composite', 'Archimate 3.0 / Composite', false, mxUtils.bind(this, function(content)
{
for (var i = 0; i < fns.length; i++)
{
......@@ -217,9 +214,8 @@
w * 150, h * 60, '', 'Gap', null, null, this.getTagsForStencil(gn, '', dt + 'gap').join(' '))
];
// this.addPalette('archimate3Implementation and Migration', 'Archimate 3.0 / Implementation and Migration', false, mxUtils.bind(this, function(content)
this.addPalette('archimate3Implementation and Migration', '架构 / 实施和迁移', false, mxUtils.bind(this, function(content)
{
this.addPalette('archimate3Implementation and Migration', 'Archimate 3.0 / Implementation and Migration', false, mxUtils.bind(this, function(content)
{
for (var i = 0; i < fns.length; i++)
{
content.appendChild(fns[i](content));
......@@ -267,9 +263,8 @@
w * 100, h * 50, '', 'Constraint', null, null, this.getTagsForStencil(gn, '', dt + 'constraint').join(' '))
];
// this.addPalette('archimate3Motivation', 'Archimate 3.0 / Motivation', false, mxUtils.bind(this, function(content)
this.addPalette('archimate3Motivation', '架构 / 动机', false, mxUtils.bind(this, function(content)
{
this.addPalette('archimate3Motivation', 'Archimate 3.0 / Motivation', false, mxUtils.bind(this, function(content)
{
for (var i = 0; i < fns.length; i++)
{
content.appendChild(fns[i](content));
......@@ -303,8 +298,7 @@
w * 90, h * 40, '', 'Distribution Network', null, null, this.getTagsForStencil(gn, '', dt + 'distribution').join(' '))
];
// this.addPalette('archimate3Physical', 'Archimate 3.0 / Physical', false, mxUtils.bind(this, function(content)
this.addPalette('archimate3Physical', '架构 / 物理', false, mxUtils.bind(this, function(content)
this.addPalette('archimate3Physical', 'Archimate 3.0 / Physical', false, mxUtils.bind(this, function(content)
{
for (var i = 0; i < fns.length; i++)
{
......@@ -369,9 +363,8 @@
10, 10, '', 'Or Junction', null, this.getTagsForStencil(gn, '', dt + 'junction').join(' '))
];
// this.addPalette('archimate3Relationships', 'Archimate 3.0 / Relationships', false, mxUtils.bind(this, function(content)
this.addPalette('archimate3Relationships', '架构 / 关系', false, mxUtils.bind(this, function(content)
{
this.addPalette('archimate3Relationships', 'Archimate 3.0 / Relationships', false, mxUtils.bind(this, function(content)
{
for (var i = 0; i < fns.length; i++)
{
content.appendChild(fns[i](content));
......@@ -401,9 +394,8 @@
w * 150, h * 75, '', 'Course of Action', null, null, this.getTagsForStencil(gn, '', dt + 'course action').join(' '))
];
// this.addPalette('archimate3Strategy', 'Archimate 3.0 / Strategy', false, mxUtils.bind(this, function(content)
this.addPalette('archimate3Strategy', '架构 / 战略', false, mxUtils.bind(this, function(content)
{
this.addPalette('archimate3Strategy', 'Archimate 3.0 / Strategy', false, mxUtils.bind(this, function(content)
{
for (var i = 0; i < fns.length; i++)
{
content.appendChild(fns[i](content));
......@@ -479,9 +471,8 @@
w * 100, h * 30, '', 'Path', null, null, this.getTagsForStencil(gn, '', dt + 'path').join(' '))
];
// this.addPalette('archimate3Technology', 'Archimate 3.0 / Technology', false, mxUtils.bind(this, function(content)
this.addPalette('archimate3Technology', '架构 / 技术', false, mxUtils.bind(this, function(content)
{
this.addPalette('archimate3Technology', 'Archimate 3.0 / Technology', false, mxUtils.bind(this, function(content)
{
for (var i = 0; i < fns.length; i++)
{
content.appendChild(fns[i](content));
......
......@@ -87,7 +87,7 @@
Sidebar.prototype.veeam2 = ['Auxiliary', 'Data Center', 'Features', 'General', 'Products and Components', 'Software', 'States', 'Storage', '3D'];
Sidebar.prototype.archimate3 = ['Application', 'Business', 'Composite', 'Implementation and Migration', 'Motivation', 'Physical', 'Relationships', 'Strategy', 'Technology'];
Sidebar.prototype.archimate4 = ['Application'];
// Sidebar.prototype.archimate4 = ['Application'];
Sidebar.prototype.electrical = ['LogicGates', 'Resistors', 'Capacitors', 'Inductors', 'SwitchesRelays', 'Diodes', 'Sources', 'Transistors', 'Misc', 'Audio', 'PlcLadder', 'Abstract', 'Optical', 'VacuumTubes', 'Waveforms', 'Instruments', 'RotMech', 'Transmission'];
......@@ -155,8 +155,9 @@
{id: 'atlassian', libs: ['atlassian']},
{id: 'fluid_power', libs: ['fluid_power']},
{id: 'gmdl', prefix: 'gmdl', libs: Sidebar.prototype.gmdl},
{id: 'archimate4', prefix: 'archimate4', libs: Sidebar.prototype.archimate4},
// {id: 'archimate4', prefix: 'archimate4', libs: Sidebar.prototype.archimate4},
{id: 'archimate_define', prefix: 'archimate_define', libs: Sidebar.prototype.archimate_define},
{id: 'archimate', libs: ['archimate']},
{id: 'webicons', libs: ['webicons', 'weblogos']},
{id: 'sysml', prefix: 'sysml', libs: Sidebar.prototype.sysml}];
......@@ -516,7 +517,7 @@
// 二次开发 20231117 wangwansu ArchiMate 3.0英文改中文
// entries: [{title: 'ArchiMate 3.0', id: 'archimate3', image: IMAGE_PATH + '/sidebar-archimate3.png'},
entries: [{title: '架构', id: 'archimate3', image: IMAGE_PATH + '/sidebar-archimate3.png'},
{title: '架构-自定义', id: 'archimate4', image: IMAGE_PATH + '/sidebar-archimate3.png'},
// {title: '架构-自定义', id: 'archimate4', image: IMAGE_PATH + '/sidebar-archimate3.png'},
{title: mxResources.get('archiMate21'), id: 'archimate', image: IMAGE_PATH + '/sidebar-archimate.png'},
{title: mxResources.get('bpmn') + ' 2.0', id: 'bpmn2', image: IMAGE_PATH + '/sidebar-bpmn.png'},
{title: mxResources.get('sysml'), id: 'sysml', image: IMAGE_PATH + '/sidebar-sysml.png'},
......@@ -1192,7 +1193,7 @@
this.addVeeam2Palette();
this.addVVDPalette();
this.addArchimate3Palette();
this.addArchimate4Palette();
// this.addArchimate4Palette();
this.addArchiMatePalette();
this.addBpmn2Palette();
this.addSysMLPalette(sysml, dir);
......@@ -1209,6 +1210,7 @@
this.addWebIconsPalette();
this.addWebLogosPalette();
this.addSignsPalette(signs, dir);
this.addEAPalette(); //二次开发,增加动态读取架构设计要素
// LATER: Check if conflicts with restore libs after loading file
this.showEntries();
......
......@@ -12,10 +12,11 @@
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<script src="./api.js"></script>
<!-- <script type="text/javascript" src="http://192.168.0.187:9999/web-apps/apps/api/documents/api.js"></script> -->
<!-- built files will be auto injected -->
</body>
<style>
<style>
html,body{
height: 100%;
overflow: hidden;
......
<template>
<div id='vabOnlyOffice'></div>
</template>
<script>
// import { getFileType } from '@/utils/wayne'
export default {
name: 'VabOnlyOffice',
props: {
option: {
type: Object,
default: () => {
return {}
},
},
},
data() {
return {
doctype: '',
//参数说明
parameters: {
'document': {
//文件扩展名
'fileType': 'docx',
//key 默认置空则不走缓存 always update
'key': '',
//为已查看或编辑的文档定义所需的文件名,该文件名在下载文档时也将用作文件名。
'title': '',
//文件地址
'url': '',
//相关权限
'permissions': {
'copy': true,//定义内容是否可以复制到剪贴板。如果该参数设置为false,则只能在当前文档编辑器中粘贴内容。默认值为true。
'download': true,//定义文档是可以下载还是只能在线查看或编辑。如果下载权限设置为“假”的下载为...菜单选项将是缺席的文件菜单。默认值为true。
'edit': true,//定义文档是可以编辑还是只能查看。如果编辑权限设置为“true”,则文件菜单将包含编辑文档菜单选项;请注意,如果编辑权限设置为“false”,文档将在查看器中打开,即使模式参数设置为edit,您也无法将其切换到编辑器。默认值为true。
'print': true,//定义是否可以打印文档。如果打印权限设置为“false”的打印菜单选项将是缺席的文件菜单。默认值为true
},
},
//文件类型
'documentType': 'text',
'height': '100%',
'width': '100%',
'editorConfig': {
//语言:zh-CN简体中文/en英文
'lang': 'zh-CN',
//阅读状态 view/edit
'mode': 'view',
'customization': {
//是否显示插件
'plugins': false,
},
},
},
}
},
watch: {
option: {
// handler: function(n) {
// this.setEditor(n)
// this.doctype = getFileType(n.fileType)
// },
deep: true,
},
},
mounted() {
if (this.option.url) {
this.setEditor(this.option)
}
},
methods: {
async setEditor(option) {
// this.doctype = getFileType(option.fileType)
// this.doctype = ".word"
let config = {
document: {
//后缀
fileType: option.fileType,
key: '',
title: option.title,
permissions: {
edit: option.isEdit,//是否可以编辑: 只能查看,传false
print: option.isPrint,
download: false,
// "fillForms": true,//是否可以填写表格,如果将mode参数设置为edit,则填写表单仅对文档编辑器可用。 默认值与edit或review参数的值一致。
// "review": true //跟踪变化
},
url: option.url,
},
documentType: this.doctype,
editorConfig: {
callbackUrl: option.editUrl,//"编辑word后保存时回调的地址,这个api需要自己写了,将编辑后的文件通过这个api保存到自己想要的位置
lang: option.lang,//语言设置
//定制
customization: {
autosave: false,//是否自动保存
chat: false,
comments: false,
help: false,
// "hideRightMenu": false,//定义在第一次加载时是显示还是隐藏右侧菜单。 默认值为false
//是否显示插件
plugins: false,
//暂时无法生效
customer: {
address: '12333333333',
info: 'S11',
logo: '123',
mail: 'j123',
name: '123',
www: '123',
},
},
},
"token": "IQJIKLFoQLZUWmGpD1A7ynv30u6N3K",
width: '100%',
height: '100%',
}
// eslint-disable-next-line no-undef,no-unused-vars
new DocsAPI.DocEditor('vabOnlyOffice', config)
},
},
}
</script>
\ No newline at end of file
import Vue from 'vue';
import axios from 'axios';
import router from '../router/index.js';
import {
Message,
MessageBox,
Loading
} from 'element-ui';
let head = false;
axios.defaults.timeout = 300000;
axios.defaults.baseURL = process.env.VUE_APP_BASE_API;
// axios.defaults.baseURL = 'http://61.141.221.175:8081';
//http request 拦截器
axios.interceptors.request.use(config => {
// MessageBox.alert('<div class="box"><p>这里放图标</p><p>HTML</p></div>',{
// confirmButtonText: '确定',
// center: true,
// cancelButtonClass:"Text",
// dangerouslyUseHTMLString: true
// })
if (head) {
// if(head.headers){
// config.headers['content-type'] = 'multipart/form-data'
// }else{
// config.headers['content-type'] = 'application/x-www-form-urlencoded'
// }
config.headers['content-type'] = 'multipart/form-data'
} else {
config.data = JSON.stringify(config.data);
config.headers['content-type'] = 'application/json'
}
if(config.url=='/framework/page'||config.url=='/user/page'||config.url=='/activiti/saveModel'||config.url=='/activiti/processList'||config.url=='/activiti/findModelInfoDto'){
config.headers['content-type'] = 'application/json'
}
if(config.url=='/processClassification/delete'){//||config.url=="/activiti/createModel"
config.headers['content-type'] = 'application/x-www-form-urlencoded'
}
if(config.url!='/auth/login'){
config.headers['Authorization']=sessionStorage.getItem('adminToken')||''
}
return config;
},
error => {
return Promise.reject(error);
}
);
//响应拦截器即异常处理
axios.interceptors.response.use(response => {
let code = response.data.code
if (code == 200) {
return response
} else if(code == 507||code == 502) {
Vue.prototype.$message.error('登录状态过期或者没有token,请重新登录!');
sessionStorage.clear()
router.push({path:'/login'})
console.log('507------',response)
// console.log('未登录')
// Vue.prototype.$message.error(response.data.msg);
}else if(code == 500) {
if(response.config.url == '/approvalTask/queryToDoTasks'){
console.log('流程图获取不到数据')
return;
}
if(response.config.url == '/anasz-smart-screen/importExcel/verifyExcelImport'){
return response
}
Vue.prototype.$message({message:response.data.msg,type:'error', customClass:'messageIndex_'});
return response
}else{
// console.log('其他--------',response)
return response
}
}, err => {
if (err && err.response) {
console.log('连接到服务器失败')
} else {
console.log('未知错误')
// Message.error('连接到服务器失败')
}
return Promise.resolve(err.response)
})
export function get(url, params = {},type = false) {
return new Promise((resolve, reject) => {
head = type
axios.get(url, {
params: params
}).then(response => {
if(response){
resolve(response.data);
}
})
.catch(err => {
reject(err)
})
})
}
export function post(url, data = {}, type = false, loading = true) {
return new Promise((resolve, reject) => {
head = type
axios.post(url, data)
.then(response => {
if(response){
resolve(response.data);
}
}, err => {
reject(err)
})
})
}
export function postDownloadResponse(url, params = {}, type = false, loading = true) {
return new Promise((resolve, reject) => {
head = type
axios.post(url, params,{
responseType: 'blob'
}).then(response => {
if (response) {
resolve(response);
}
}).catch(err => {
reject(err)
})
})
}
export function getOnlyOfficeToken() {
return new Promise((resolve, reject) => {
const url = "http://192.168.0.187:9999/token"; // 将此处URL更改为真正的OnlyOffice服务器地址
axios.get(url).then(response => {
resolve(response.data);
}).catch(error => {
reject(error);
});
});
}
import jwt from 'jsonwebtoken'; // 假设你已经安装了 jsonwebtoken 包
const cfgSignatureSecret = 'IQJIKLFoQLZUWmGpD1A7ynv30u6N3K'; // 应该从环境变量或配置文件中获取
const cfgSignatureSecretExpiresIn = '1h'; // 令牌过期时间
const cfgSignatureSecretAlgorithmRequest = 'HS256'; // 算法
export const jwtService = {
getToken(data) {
const options = {
algorithm: cfgSignatureSecretAlgorithmRequest,
expiresIn: cfgSignatureSecretExpiresIn,
};
return jwt.sign(data, cfgSignatureSecret, options);
},
};
\ No newline at end of file
......@@ -38,7 +38,6 @@
<img src="@/assets/二级切图.png" alt="">
<span style="margin-left: 5px;">架构元模型管理</span>
</div>
<div class="menu_1_item_subtitle" @click="jumpPage('架构元素管理')">
<img src="@/assets/三级圆环.png" alt="">
<span style="margin-left: 5px;">架构元素管理</span>
......@@ -71,6 +70,11 @@
<img src="@/assets/三级圆环.png" alt="">
<span style="margin-left: 5px;">架构视图管理</span>
</div>
<div class="menu_1_item_subtitle" @click="jumpPage('在线文档编制')">
<img src="@/assets/三级圆环.png" alt="">
<span style="margin-left: 5px;">在线文档编制</span>
</div>
</div>
<img class="menu_1_item_line" src="@/assets/分割线.png" alt="" />
<div class="menu_1_item">
......
......@@ -4,17 +4,20 @@
<div class="office" @click="gotoOffice">
编辑文档
</div>
<!-- <div v-if='show' class='qualityManual-container-office'>
<only-Office :option='option' />
</div> -->
</div>
</template>
<script>
import { getOnlyOfficeToken } from '@/utils/request.js';
import onlyOffice from '@/components/onlyOffice'
export default {
name: 'wenDangDemo',
components: {
// ,
onlyOffice,
},
data() {
return {
......@@ -39,17 +42,21 @@ export default {
},
// "token": "CqzsKuP7jlI1aBatn4esS91ysFxDBR",
},
//参考vabOnlyOffice组件参数配置
option: {
url: '',
isEdit: '',
fileType: '',
title: '',
lang: '',
isPrint: '',
},
show: false,
};
},
methods: {
gotoOffice() {
getOnlyOfficeToken().then(token => {
console.log("只有Office Token:", token);
// 这里可以对获得的 OnlyOffice Token 进行后续操作
}).catch(error => {
console.error("无法获取 OnlyOffice Token:", error);
});
let config = {
"document": {
"fileType": "docx",
......@@ -61,10 +68,30 @@ export default {
"editorConfig": {
"callbackUrl": "http://192.168.0.187:9999/url-to-callback.ashx"
},
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.LwimMJA3puF3ioGeS-tfczR3370GXBZMIL-bdpu4hOU",
'editorConfig': {
//语言:zh-CN简体中文/en英文
'lang': 'zh-CN',
//阅读状态 view/edit
'mode': 'edit',
'customization': {
//是否显示插件
'plugins': false,
},
"callbackUrl": "http://192.168.0.187:9999/url-to-callback.ashx"
},
// "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlZGl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J9fSwidHlwZSI6ImRlc2t0b3AifQ.xhSqCy12e38LQUyia_FD1dfiBoAvrcItLVa-kzr5Xpo",
};
var docEditor = new DocsAPI.DocEditor("placeholder", config);
// this.show = true
// // getAction('/onlyfile/file/queryById', { id: this.id }).then(res => {
// this.option.isEdit = false
// this.option.lang = 'zh-CN'
// this.option.url = 'http://192.168.0.187:9999/example/editor?fileName=new.docx'
// this.option.title = '123'
// this.option.fileType = 'docx'
// this.option.isPrint = false
},
}
}
......@@ -80,4 +107,9 @@ export default {
font-size: 20px;
cursor: pointer;
}
.qualityManual-container-office {
height: 100%;
width: 100%;
padding: 0 !important;
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!