企业图形库的图标展示

This commit is contained in:
SignDawn 2021-07-08 17:54:39 +08:00
parent 57a0d9af8c
commit 355395ace2
1 changed files with 37 additions and 44 deletions

View File

@ -22,22 +22,22 @@ import {
defalutMenus,
defalutUserMenus,
defalutMaterials,
images,
images
} from './data';
export default {
name: 'Home',
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',
@ -55,21 +55,21 @@ export default {
return [
{
label: '选项1',
value: 1,
value: 1
},
{
label: '选项2',
value: 2,
value: 2
},
{
label: '选项3',
value: 3,
},
value: 3
}
];
},
}
},
user: {
username: 'le5le',
username: 'le5le'
},
materials: {
system: defalutMaterials,
@ -77,43 +77,33 @@ export default {
images,
uploadUrl: '/api/file',
uploadHeaders: {
Authorization: 'your token',
Authorization: 'your token'
},
uploadParams: {
mydata: 1,
},
mydata: 1
}
},
data: {},
data: {}
};
},
created: function () {
},
created: function() {},
mounted() {
// 7777777().js rg.js
if (window.registerTools) {
window.registerTools();
if (window.topologyTools) {
this.materials.system[0].list = window.topologyTools;
}
//
const json = sessionStorage.getItem('topologyData');
if (!this.$route.query.id && json) {
this.data = JSON.parse(json);
setTimeout(() => {
// session
sessionStorage.removeItem('topologyData');
}, 200);
}
this.materials.system[0].list = this.materials.system[0].list.concat(
window.topologyTools.map((el, index) => {
return {
data: el.data,
id: index,
name: 'rectangle',
icon: 't-icon t-rectangle',
};
})
);
const json = sessionStorage.getItem('topologyData');
if (!this.$route.query.id && json) {
this.data = JSON.parse(json);
setTimeout(() => {
// session
sessionStorage.removeItem('topologyData');
}, 200);
}
}
},
methods: {
@ -136,7 +126,7 @@ export default {
// Do sth. For example:
this.$router.push({
path: '/',
query: { component: '1' },
query: { component: '1' }
});
break;
@ -145,7 +135,7 @@ export default {
// Do sth. For example:
this.$router.push({
path: '/',
query: { id: e.params.id, component: '1' },
query: { id: e.params.id, component: '1' }
});
break;
@ -168,21 +158,24 @@ export default {
case 'preview':
//
//
//
// sessionStorage
sessionStorage.setItem('topologyData',JSON.stringify(window.topology.pureData()));
sessionStorage.setItem(
'topologyData',
JSON.stringify(window.topology.pureData())
);
this.$router.push({
path: '/preview',
query: { id: 'xxx', r: '1' },
query: { id: 'xxx', r: '1' }
});
break;
// ...
// ...
}
},
},
}
}
};
</script>
<style lang="scss">