Merge pull request #2 from SignDawn/feture/newVersion/2021-3-9
'修改topologyVue的版本''
This commit is contained in:
commit
d7e5edf7fc
File diff suppressed because it is too large
Load Diff
|
|
@ -10,7 +10,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"core-js": "^3.6.5",
|
||||
"topology-vue": "0.2.12",
|
||||
"topology-vue": "0.4.3",
|
||||
"vue": "^2.6.11",
|
||||
"vue-router": "^3.2.0"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,36 +1,39 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
|
||||
<!-- 通用字体图标 -->
|
||||
<link
|
||||
href="//at.alicdn.com/t/font_2030495_pwo1zu1ka1.css"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
href="//at.alicdn.com/t/font_2030495_pwo1zu1ka1.css"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
|
||||
<!-- 通用基础图形库 -->
|
||||
<link
|
||||
href="//at.alicdn.com/t/font_1331132_qhyav2o6mp.css"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
|
||||
<!-- 其他图形库在此补充,例如企业字体图形库 -->
|
||||
<!-- 通用基础图形库 -->
|
||||
<link
|
||||
href="//at.alicdn.com/t/font_1331132_qhyav2o6mp.css"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
|
||||
<!-- 其他图形库在此补充,例如企业字体图形库 -->
|
||||
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||
<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>
|
||||
<!-- built files will be auto injected -->
|
||||
|
||||
<!-- 需要用到的工具js -->
|
||||
<script src="http://topology.le5le.com/js/canvas2svg.js"></script>
|
||||
<script src="http://topology.le5le.com/assets/js/canvas2svg.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
||||
<script src="https://cdn.bootcss.com/jszip/3.2.2/jszip.min.js"></script>
|
||||
<script src="https://cdn.bootcdn.net/ajax/libs/echarts/4.8.0/echarts.min.js"></script>
|
||||
|
|
|
|||
|
|
@ -12,29 +12,33 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
// 导入topology-vue组件
|
||||
import topology from 'topology-vue';
|
||||
// 需要导入topology-vue.css
|
||||
import 'topology-vue/topology-vue.css';
|
||||
|
||||
import { defalutMenus, defalutUserMenus, defalutMaterials, userMaterials, images } from './data';
|
||||
Vue.use(topology);
|
||||
import {
|
||||
defalutMenus,
|
||||
defalutUserMenus,
|
||||
defalutMaterials,
|
||||
userMaterials,
|
||||
images,
|
||||
} from './data';
|
||||
|
||||
export default {
|
||||
name: 'Home',
|
||||
components: {
|
||||
topology
|
||||
},
|
||||
data: function() {
|
||||
data: function () {
|
||||
return {
|
||||
topologyConfigs: {
|
||||
license: {
|
||||
key: '企业版授权码',
|
||||
value: '国产原创开源发展做出我们的贡献'
|
||||
value: '国产原创开源发展做出我们的贡献',
|
||||
},
|
||||
logo: {
|
||||
img: 'http://topology.le5le.com/assets/img/favicon.ico',
|
||||
url: 'http://topology.le5le.com',
|
||||
target: '_blank'
|
||||
target: '_blank',
|
||||
},
|
||||
menus: defalutMenus,
|
||||
loginUrl: 'https://account.le5le.com',
|
||||
|
|
@ -49,20 +53,24 @@ export default {
|
|||
// 根据实际业务场景 + 参数返回数组对象。
|
||||
// Do sth.
|
||||
// ************
|
||||
return [{
|
||||
label: '选项1',
|
||||
value: 1
|
||||
}, {
|
||||
label: '选项2',
|
||||
value: 2
|
||||
}, {
|
||||
label: '选项3',
|
||||
value: 3
|
||||
}];
|
||||
}
|
||||
return [
|
||||
{
|
||||
label: '选项1',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '选项2',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: '选项3',
|
||||
value: 3,
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
user: {
|
||||
username: 'le5le'
|
||||
username: 'le5le',
|
||||
},
|
||||
materials: {
|
||||
system: defalutMaterials,
|
||||
|
|
@ -70,16 +78,16 @@ export default {
|
|||
images,
|
||||
uploadUrl: '/api/file',
|
||||
uploadHeaders: {
|
||||
Authorization: 'your token'
|
||||
Authorization: 'your token',
|
||||
},
|
||||
uploadParams: {
|
||||
mydata: 1
|
||||
}
|
||||
mydata: 1,
|
||||
},
|
||||
},
|
||||
data: {}
|
||||
data: {},
|
||||
};
|
||||
},
|
||||
created: function() {
|
||||
created: function () {
|
||||
const data = window.topologyData;
|
||||
// 存在缓存数据,预览页返回
|
||||
if (data) {
|
||||
|
|
@ -111,7 +119,7 @@ export default {
|
|||
// Do sth. For example:
|
||||
this.$router.push({
|
||||
path: '/',
|
||||
query: { component: '1' }
|
||||
query: { component: '1' },
|
||||
});
|
||||
break;
|
||||
|
||||
|
|
@ -147,15 +155,15 @@ export default {
|
|||
window.topologyData = window.topology.data;
|
||||
this.$router.push({
|
||||
path: '/preview',
|
||||
query: { id: 'xxx', r: '1' }
|
||||
query: { id: 'xxx', r: '1' },
|
||||
});
|
||||
break;
|
||||
|
||||
// ...
|
||||
// ...
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
|
|
|||
|
|
@ -19,17 +19,16 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import Topology from 'topology-vue';
|
||||
Vue.use(Topology);
|
||||
export default {
|
||||
name: 'Preview',
|
||||
components: {
|
||||
Topology
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
data: { data: {} },
|
||||
locked: 0,
|
||||
showTools: true
|
||||
showTools: true,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
@ -60,9 +59,9 @@ export default {
|
|||
window.topology.data.locked = this.locked;
|
||||
window.topologyData = window.topology.data;
|
||||
this.$router.go(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.preview {
|
||||
|
|
@ -84,4 +83,4 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,38 +1,45 @@
|
|||
export const defalutMenus = [
|
||||
{
|
||||
name: '文件(自定义菜单1)',
|
||||
children: [
|
||||
{ name: '新建文件', keyboard: 'Ctrl+N', action: 'open' },
|
||||
{ name: '打开文件', keyboard: 'Ctrl+O', action: 'loadNew' },
|
||||
{ name: '导入文件', keyboard: 'Ctrl+I', action: 'load' },
|
||||
{},
|
||||
{ name: '保存', keyboard: 'Ctrl+S', action: 'save' },
|
||||
{ name: '另存为', keyboard: 'Ctrl+Shift+I', action: 'saveAs' },
|
||||
{ name: '下载JSON文件', action: 'downloadJson' },
|
||||
{ name: '下载zip打包文件', action: 'downloadZip' },
|
||||
{},
|
||||
{ name: '导出为HTML', action: 'downloadHtml' },
|
||||
{},
|
||||
{ name: '下载为PNG', action: 'downloadPng' },
|
||||
{ name: '下载为SVG', action: 'downloadSvg' }
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '编辑(自定义菜单2)',
|
||||
children: [
|
||||
{ name: '撤销', keyboard: 'Ctrl+Z', action: 'undo' },
|
||||
{ name: '恢复 ', keyboard: 'Ctrl+Shift+Z', action: 'redo' },
|
||||
{},
|
||||
{ name: '剪切 ', keyboard: 'Ctrl+X', action: 'cut' },
|
||||
{ name: '复制 ', keyboard: 'Ctrl+C', action: 'copy' },
|
||||
{ name: '粘贴 ', keyboard: 'Ctrl+V', action: 'paste' }
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '我的菜单3',
|
||||
router: '/page'
|
||||
}
|
||||
];
|
||||
export const defalutMenus = {
|
||||
// back: {
|
||||
// icon: 't-icon t-angle-left'
|
||||
// },
|
||||
// login: true,
|
||||
left: [
|
||||
{
|
||||
name: '文件(自定义菜单1)',
|
||||
children: [
|
||||
{ name: '新建文件', keyboard: 'Ctrl+N', action: 'loadNew' },
|
||||
{ name: '打开文件', keyboard: 'Ctrl+O', action: 'open' },
|
||||
{ name: '导入文件', keyboard: 'Ctrl+I', action: 'load' },
|
||||
{},
|
||||
{ name: '保存', keyboard: 'Ctrl+S', action: 'save' },
|
||||
{ name: '另存为', keyboard: 'Ctrl+Shift+I', action: 'saveAs' },
|
||||
{ name: '下载JSON文件', action: 'downloadJson' },
|
||||
{ name: '下载zip打包文件', action: 'downloadZip' },
|
||||
{},
|
||||
{ name: '导出为HTML', action: 'downloadHtml' },
|
||||
{},
|
||||
{ name: '下载为PNG', action: 'downloadPng' },
|
||||
{ name: '下载为SVG', action: 'downloadSvg' }
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '编辑(自定义菜单2)',
|
||||
children: [
|
||||
{ name: '撤销', keyboard: 'Ctrl+Z', action: 'undo' },
|
||||
{ name: '恢复 ', keyboard: 'Ctrl+Shift+Z', action: 'redo' },
|
||||
{},
|
||||
{ name: '剪切 ', keyboard: 'Ctrl+X', action: 'cut' },
|
||||
{ name: '复制 ', keyboard: 'Ctrl+C', action: 'copy' },
|
||||
{ name: '粘贴 ', keyboard: 'Ctrl+V', action: 'paste' }
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '我的菜单3',
|
||||
router: '/page'
|
||||
}
|
||||
]
|
||||
// middle: []
|
||||
};
|
||||
|
||||
export const defalutUserMenus = [
|
||||
{ name: '个人中心', router: '/user/home' },
|
||||
|
|
|
|||
Loading…
Reference in New Issue