Commit 597aa4c2 by liuyong

修改画布

1 parent ca4b185a
......@@ -103,35 +103,75 @@ const setIcon = function (itemIcon, dicys, color) {
// }
// ];
// xml格式数据,压缩或者不压缩的都行
// const images_ = [
// {
// aspect: "fixed",
// xml: "1VjZctowFP0aPaaDV+xHmyVJk7RJ6EyhLxlhC+wiEJUFmHx9JSzvZktJJp3JTHSPFkvnnnMtA7TOPL6mcBk8EB9hoLb8GGhdoKqKYhj8n0C2CaIbagJMaejLQTkwCF+RBFsSXYU+ikoDGSGYhcsy6JHFAnmshEFKyaY8bEJw+alLOEU1YOBBXEd/hj4LEtRS2zl+g8JpkD5ZMe2kZw7TwfIkUQB9silAWg9oHUoIS1rzuIOwIC/lJZnX39ObbYyiBTtlQnsSmLf34/BhOPBvbXI1uNPGV3KVNcQreWDQM4DdAZYpGm4XODJfEdumnPB1Of08cDdByNBgCT3Rs+EK4FjA5phHCm/CaJnkZBLGiG/Dre853QCiDMUFSJ7hGpE5YnTLh8jeTBlSUKom400hPRIKCplJMSgFMc1WzjnjDUnbGRSqDRRawOoDV8koTHkukMjlsBRNTgbEGGEypXDOKVoiGvKNIVrte8w7jvG+o1t6SbkM7bpRoV2v066oDbyb78W73si72wd2D/RMYPWAY9Slu/AdURV45GEYRaFXZo6S1cIXUu22eMTpotthMRiJ4IuRht242NndplEcsqFcUbQLs3iUTxJBOmdvjiKyoh467mEG6RSx40JFfqni1TNeyKjRkNAUowhDFq7LdbIpy/IJjyTkJ9vrY02vCCU5t5xVrGvVhcyKMu3KQgkxtYV2osuOfZIO4aK9Yi8tvz+7aUd3jhLM1JfGElr1/66odoHdrgmSBmQ+XkXHPX0JD1eY0qyPK52N1NVLJ657OB11ARfnxh2VfHvYxa0vutIuOFk56GMRFEr1P3pbrXv7kAg/ibc1uyy07OVxrrd1vbJQ6928vSXrP4/9kdKfLe5Hm+3TxL2LG72tA9cCtiMsbTnA2Znc7ou/mrczGSqnvLMx7hBM6G6u5kNkTYSsI0bJDBV6TM9C48mFLlPqHn4LOmk36KRaq99SERoJb7pMmcDWgdPfNVRg169SZ5aD1NZnvJyzEqKcdxE4yfiHDF00/iGFfhLjK8f8eqrxlUoF0aoV5HLG17XgyRp+7fxy8HPvt3rvqE+tJuP//+421I9z9/OPb2bYe9q2w3mr++x+X7/OGlkV5dQRphbu7gC34cqefW2mn0weJiv/Q25M1ReZ0vCx2fjV84YrEw/zHwMSHec/qWi9vw==",
// h: 430,
// title: "我的图库",
// w: 360
// }
// ];
const images_ = [
{
aspect: "fixed",
xml: "tZTBUoMwEIafhisDpC30qG3Vg84404NHJ4UtZAwsExahPr0JhALWjnqQC/D9uyT7bxaHbfL2XvEye8IEpBN4SeuwrRMEfriI9M2QkyXLld+TVInEshHsxQdY6FlaiwSqWSAhShLlHMZYFBDTjHGlsJmHHVHOVy15ChdgH3N5SV9EQllPoyAc+QOINBtW9lfrXsn5EGwrqTKeYDNBbOewjUKk/ilvNyCNe4Mvfd7dFfW8MQUF/SYh6BPeuaxtbXZfdBqKVVgXCZh432G3TSYI9iWPjdro/mqWUS6tfBRSblCi6nKZ5/FDtDYcC5rwY3dpXpHCN5gowTZceZ5WdO+IiwIMN+92o6AI2qvF+mcL9eEDzIHUSYfYhIC54bJPasa2hYFrYTbp2cI2iNujkp6/NrqpH6yh35vLfjbX1CP0wXrkB5DPWAkSWGjpgESY67KHgBspUiMQfnFcn6DSfCxvUzNt7oFXInZ5XBO8khK8SM1at930ebrSf3E2WvQZdqAvTR4md2qx/3eL9es4G502+cWw3Sc=",
h: 430,
title: "我的图库",
w: 360
}
];
const leftCustomGraph = function(that) {//左侧自定义图形
const leftGraph = JSON.parse(localStorage.getItem('leftGraph'));
leftGraph.forEach(function(item) {
// var xml = that.createLibraryDataFromImages(images_);
// var file = new LocalLibrary(that, xml, '图库');
// that.libraryLoaded(file, images_, null, false);
// const standardGraph = JSON.parse(localStorage.getItem('standardGraph'));
// standardGraph.forEach(function(item) {
// if(item.eleDtos) {
// if(item.eleDtos.length > 0) {
// const libraryName = item.arciBelongName;
// let images = [];
// item.eleDtos.forEach(function(item2) {
// if(item2.icon) {
// if(item2.icon.includes('data')) {
// images.unshift({
// aspect: "fixed",
// data: setIcon(item2.icon, item2.dicys, item2.color).icon,
// h: setIcon(item2.icon, item2.dicys, item2.color).height,
// title: item2.eleName,
// w: setIcon(item2.icon, item2.dicys, item2.color).width
// })
// }
// }
// })
// var xml = that.createLibraryDataFromImages(images);
// var file = new LocalLibrary(that, xml, libraryName);
// that.libraryLoaded(file, images, null, false);
// // that.saveLibrary(libraryName, images, null, 'ajax', undefined, undefined, undefined);
// }else {
// const libraryName2 = item.arciBelongName;
// var xml = that.createLibraryDataFromImages([]);
// var file = new LocalLibrary(that, xml, libraryName2);
// that.libraryLoaded(file, []);
// // that.saveLibrary(libraryName2, [], null, 'ajax', undefined, undefined, undefined);
// }
// }
// })
const standardGraph = JSON.parse(localStorage.getItem('standardGraph'));
standardGraph.pop();
standardGraph.forEach(function(item) {
if(item.eleDtos) {
if(item.eleDtos.length > 0) {
const libraryName = item.arciBelongName;
let images = [];
item.eleDtos.forEach(function(item2) {
if(item2.icon) {
if(item2.icon.includes('data')) {
images.unshift({
aspect: "fixed",
data: setIcon(item2.icon, item2.dicys, item2.color).icon,
h: setIcon(item2.icon, item2.dicys, item2.color).height,
title: item2.eleName,
w: setIcon(item2.icon, item2.dicys, item2.color).width
})
}
}
images.unshift({
aspect: "fixed",
xml: item2.iconName,
h: 41,
title: item2.eleName,
w: 71
})
})
var xml = that.createLibraryDataFromImages(images);
......@@ -149,12 +189,6 @@ const leftCustomGraph = function(that) {//左侧自定义图形
}
}
})
// const icons = leftGraph[1].eleDtos[2].icon;
// const item_icon = icons.split("base64,")[1];
// const decode_item_icon = (window.atob) ? atob(item_icon) : Base64.decode(item_icon);//svg解码,为字符串
// const svgDocument = new DOMParser().parseFromString(decode_item_icon, 'text/xml');//svg字符串转标签
// console.log(svgDocument)
}
//二次开发,创建时不必先保存文件至本地,定义Dialogs.js文件里面的createTemporaryFile函数
......@@ -186,6 +220,9 @@ const setGraphOnlyView = function(graph) {
// graph.setCellStyles('locked', 1, cells);
// graph.setCellStyles('connectable', value, cells);
// graph.getModel().endUpdate();
// graph.setEnabled(false);
// graph.setCellsEditable(false);
// graph.setTooltips(false);
......
......@@ -39,11 +39,11 @@
{
Sidebar.prototype.addCustomGraph = function()
{
const leftGraph = JSON.parse(localStorage.getItem('leftGraph'));
const commonGraph = JSON.parse(localStorage.getItem('commonGraph'));
this.sidebarTitles = true;//勾选标签
leftGraph.forEach(item => {
commonGraph.forEach(item => {
let fns = [];
item.eleDtos.forEach(item2 => {
if(item2.icon) {
......
......@@ -185,7 +185,8 @@ App = function(editor, container, lightbox)
const that = this;
setGraphDefault(that);
// leftCustomGraph(that);
leftCustomGraph(that);
};
/**
......
......@@ -4,9 +4,12 @@ import { get, post, download } from '@/utils/http';
export function query_jia_gou_yuan_su_guan_xi_table(params) {//查询架构元素管理表格
return post('/network/ele/', params);
}
export function getDrawioLeftGraph(params) {//查询画布左侧自定义图形
export function getDrawioLeftStandardGraph(params) {//查询画布左侧标准图形
return post('/network/ma-ml/archi-list', params);
}
export function getDrawioLeftCommonGraph(params) {//查询画布左侧常规图形
return post('/network/ma-ml/archi-list2', params);
}
export function save_drawio_attribute(params) {//保存画布属性
return post('/network/ma-ml/updateEleRelBatch', params);
}
......@@ -363,3 +366,7 @@ export function getComCenterServeList(params) {
export function getComCenterServeDetail(params) {
return post('/network/arc-aby-iy/', params);
}
// 资产架构表格
export function getZiChanJiaGouTable(params) {
return post('/network/arc-ast-cn/', params);
}
......@@ -80,7 +80,7 @@
<span style="margin-left: 5px;">总体架构资产维护</span>
</div>
<div class="menu_1_item_subtitle" @click="jumpPage('总体架构资产设计与维护', '架构元模型管理', '总体架构资产管理')">
<div class="menu_1_item_subtitle" @click="jumpPage('总体架构资产设计与维护', '总体架构资产维护', '总体架构资产管理')">
<img src="@/assets/main/3img.png" alt="">
<span style="margin-left: 5px;">总体架构资产管理</span>
</div>
......
......@@ -131,9 +131,9 @@
this.graphList = res.eleDtos;
},
get_search_select1() {//查询架构归属下拉框值
const leftGraph = JSON.parse(localStorage.getItem("leftGraph"));
leftGraph.reverse();
this.search_select1 = leftGraph;
const commonGraph = JSON.parse(localStorage.getItem("commonGraph"));
commonGraph.reverse();
this.search_select1 = commonGraph;
},
closeGraphDialog() {//图形选择窗口的取消
this.graphIndex = 0;
......
......@@ -138,7 +138,8 @@ import {
addArchiViewManage,
deleteArchiViewManage,
queryArchiViewManageCardDetails,
getDrawioLeftGraph
getDrawioLeftCommonGraph,
getDrawioLeftStandardGraph
} from '@/api/index.js';
import { MessageBox, Message } from 'element-ui';
import $ from 'jquery';
......@@ -200,13 +201,39 @@ export default {
this.getData();
},
methods: {
queryDrawioGraph(id) {//查询画布左侧图形
queryDrawioGraph(id) {//查询画布左侧常规图形
const params = {
metaModelId: id
}
return new Promise((resolve, reject) => {
getDrawioLeftGraph(params).then(res => {
resolve(res);
getDrawioLeftCommonGraph(params).then(res => {
if(res.code == 200) {
resolve(res.data);
}else {
Message({
type: 'error',
message: res.msg
});
reject(res.msg);
}
})
});
},
queryDrawioGraph2(id) {//查询画布左侧标准图形
const params = {
metaModelId: id
}
return new Promise((resolve, reject) => {
getDrawioLeftStandardGraph(params).then(res => {
if(res.code == 200) {
resolve(res.data);
}else {
Message({
type: 'error',
message: res.msg
});
reject(res.msg);
}
})
});
},
......@@ -222,17 +249,10 @@ export default {
localStorage.setItem('xmlData', xmlData);
localStorage.setItem('xmlTitle', xmlTitle);
this.queryDrawioGraph(id).then(res2 => {
if(res2.code == 200) {
res2.data.reverse();
localStorage.setItem('leftGraph', JSON.stringify(res2.data));
this.$router.push( `/main/archiViewManageDetails/id=${id}`, () => {}, () => {} );
}else {
Message({
type: 'error',
message: res2.msg
});
}
Promise.all([ this.queryDrawioGraph(id), this.queryDrawioGraph2(id) ]).then(res2 => {
localStorage.setItem('commonGraph', JSON.stringify(res2[0].dataEle));
localStorage.setItem('standardGraph', JSON.stringify(res2[1].dataEle));
this.$router.push( `/main/archiViewManageDetails/id=${id}`, () => {}, () => {} );
});
}
});
......
<template>
<template>
<div class="busiAssetslist">
<div class="left_container">
<el-input v-no-backslash placeholder="请输入搜索内容" v-model="filterText" prefix-icon="el-icon-search"></el-input>
<el-tree
class="filter-tree"
:data="treeData"
:props="{ children: 'children', label: 'label' }"
default-expand-all
:filter-node-method="filterNode"
ref="tree">
</el-tree>
</div>
<div class="right_container">
<Drawio :initGraphId="routerId"></Drawio>
</div>
</div>
</template>
<script>
import Drawio from '@/components/drawio.vue';
export default {
name: 'BusiAssetslist',
components: {
Drawio
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
}
},
data() {
return {
routerId: null,
filterText: '',
treeData: [
{
id: '1',
label: '业务架构',
children: [
{
id: '1-1',
label: '业务域',
children: [
{
id: '1-1-1',
label: '生产检修',
children: [
{
id: '1-1-1-1',
label: '业务职能',
children: [
{ id: '1-1-1-1-1', label: '国际业务' },
{ id: '1-1-1-1-2', label: '科研业务' },
{ id: '1-1-1-1-3', label: '协同办公' },
{
id: '1-1-1-1-4',
label: '综合管理',
children: [
{
id: '1-1-1-1-4-1',
label: '业务流程',
children: [
{ id: '1-1-1-1-4-1-1', label: '综合审批' },
{ id: '1-1-1-1-4-1-2', label: '项目填报' },
]
},
]
},
]
}
]
}
]
},
{ id: '1-2', label: '财力资源' },
{ id: '1-3', label: '物力资源' },
{ id: '1-4', label: '规划计划' },
{ id: '1-5', label: '电网建设' },
{ id: '1-6', label: '电力营销' },
{ id: '1-7', label: '调度运行' },
{ id: '1-8', label: '电力交易' },
{ id: '1-9', label: '产业业务' },
{ id: '1-10', label: '金融业务' },
]
}
]
};
},
mounted(){
const id = 2;
// const version = window.location.href.split("id=")[1].split("&")[1].split("=")[1];
// const state = window.location.href.split("id=")[1].split("&")[2].split("=")[1];
this.routerId = {
id: id,
version: 0,
state: 0
}
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
}
}
}
</script>
<style scoped>
.busiAssetslist{
width: 100%;
/* height: calc(100% - 20px); */
height: 100%;
display: flex;
/* padding-right: 20px;
padding-left: 20px;
padding-bottom: 20px; */
}
.left_container{
width: 20%;
margin-right: 20px;
}
.right_container{
width: 80%;
}
/deep/ .is-leaf {
background-color: #fff !important;
}
</style>
\ No newline at end of file
<template>
<div class="busiAssetslist">
<div class="left_container">
<el-input v-no-backslash placeholder="请输入搜索内容" v-model="filterText" prefix-icon="el-icon-search"></el-input>
<el-tree
class="filter-tree"
:data="treeData"
:props="{ children: 'children', label: 'label' }"
:props="{ children: 'children', label: 'name', id: 'belongId' }"
default-expand-all
:filter-node-method="filterNode"
ref="tree">
</el-tree>
</div>
<div class="right_container">
<Drawio :initGraphId="routerId"></Drawio>
<div class="search_menu">
<div class="search_menu_item_container">
<div class="search_menu_item">
<span class="search_title">业务组件名称</span>
<el-input v-no-backslash v-model="searchParams.let1" maxlength="100" placeholder="请输入内容" class="search_item"></el-input>
</div>
<div class="search_menu_item">
<span class="search_title">创建人</span>
<el-input v-no-backslash v-model="searchParams.let2" maxlength="100" placeholder="请输入内容" class="search_item"></el-input>
</div>
<div class="search_menu_item">
<span class="search_title">业务组件类型</span>
<el-select v-model="searchParams.let3" clearable placeholder="请选择" class="search_item">
<el-option label="已发布" value="1"></el-option>
<el-option label="已停用" value="0"></el-option>
<el-option label="暂存" value="2"></el-option>
</el-select>
</div>
</div>
<div class="search_menu_btn_container">
<div class="query_btn" @click="search_table">
<img class="btn_icon" src="@/assets/archi-ele-list/search.png" alt="" />
<p>查询</p>
</div>
<div class="reset_btn" @click="reset">
<img class="btn_icon" src="@/assets/archi-ele-list/reset.png" alt="" />
<p>重置</p>
</div>
</div>
</div>
<div class="search_btn">
<!-- <div class="add_btn">
<img class="btn_icon" src="@/assets/archi-ele-list/create.png" alt="" />
<p>新建</p>
</div> -->
<el-button @click="add" type="primary" size="medium" icon="el-icon-document-add">新建</el-button>
<el-button type="primary" size="medium" icon="el-icon-delete" @click="moreDelete">删除</el-button>
<!-- <el-button type="primary" size="medium" icon="el-icon-plus">导入</el-button> -->
<div class="import_btn" @click="importFile">
<img class="btn_icon" src="@/assets/tech-politics-fabric/import.png" alt="" />
<p>导入</p>
</div>
<!-- <el-button type="primary" size="medium" icon="el-icon-plus">导出</el-button> -->
<div class="import_btn" @click="exportFile" style="margin-left: 0;">
<img class="btn_icon" src="@/assets/tech-politics-fabric/export.png" alt="" />
<p>导出</p>
</div>
</div>
<el-table :height="tableHeight" @selection-change="select_table_rows" v-loading="loading" :data="tableData" stripe border>
<el-table-column type="selection" width="55" :selectable="selectable"></el-table-column>
<el-table-column type="index" label="序号" width="80" align="center"></el-table-column>
<el-table-column prop="elementName" label="业务组件名称" align="center"></el-table-column>
<el-table-column prop="archiLevelName" label="业务组件类型" align="center"></el-table-column>
<el-table-column prop="archiBelongName" label="上级业务组件" align="center"></el-table-column>
<el-table-column prop="eaLevel" label="创建人" align="center"></el-table-column>
<el-table-column prop="eaLevel" label="创建时间" align="center"></el-table-column>
<el-table-column label="操作" width="160" align="center">
<template slot-scope="scope">
<div style="display: flex;align-items: center;justify-content: center;">
<el-button icon="el-icon-edit" type="primary" size="mini" @click="editItem(scope.row)" :disabled="scope.row.state == 1">编辑</el-button>
<el-button class="shanChu_btn" icon="el-icon-delete" size="mini" @click="deleteItem(scope.row)" :disabled="scope.row.state == 1">删除</el-button>
</div>
</template>
</el-table-column>
</el-table>
</div>
<el-dialog
title="选择图形"
:visible.sync="addDialog"
:center="false"
:close-on-click-modal="false"
width="60%">
<span slot="footer" class="dialog-footer">
<el-button class="greenButton" @click="saveDialog">确定</el-button>
<el-button @click="cancelDialog">取消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Drawio from '@/components/drawio.vue';
import {
query_jia_gou_gui_shu,
} from '@/api/index.js';
export default {
name: 'BusiAssetslist',
components: {
Drawio
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
}
},
data() {
return {
routerId: null,
filterText: '',
searchParams: {
let1: null,
let2: null,
let3: null,
},
treeData: [
{
id: '1',
label: '业务架构',
children: [
{
id: '1-1',
label: '业务域',
children: [
{
id: '1-1-1',
label: '生产检修',
children: [
{
id: '1-1-1-1',
label: '业务职能',
children: [
{ id: '1-1-1-1-1', label: '国际业务' },
{ id: '1-1-1-1-2', label: '科研业务' },
{ id: '1-1-1-1-3', label: '协同办公' },
{
id: '1-1-1-1-4',
label: '综合管理',
children: [
{
id: '1-1-1-1-4-1',
label: '业务流程',
children: [
{ id: '1-1-1-1-4-1-1', label: '综合审批' },
{ id: '1-1-1-1-4-1-2', label: '项目填报' },
]
},
]
},
]
}
]
}
]
},
{ id: '1-2', label: '财力资源' },
{ id: '1-3', label: '物力资源' },
{ id: '1-4', label: '规划计划' },
{ id: '1-5', label: '电网建设' },
{ id: '1-6', label: '电力营销' },
{ id: '1-7', label: '调度运行' },
{ id: '1-8', label: '电力交易' },
{ id: '1-9', label: '产业业务' },
{ id: '1-10', label: '金融业务' },
]
belongId: '1',
name: '总体架构资产',
children: []
}
]
],
tableHeight: null,
selectTable: [],
loading: false,
tableData: [],
};
},
mounted(){
const id = 2;
// const version = window.location.href.split("id=")[1].split("&")[1].split("=")[1];
// const state = window.location.href.split("id=")[1].split("&")[2].split("=")[1];
this.routerId = {
id: id,
version: 0,
state: 0
}
this.getTreeData();
window.addEventListener('resize', () => {
this.set_table_height();
})
this.set_table_height();
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
}
add() {//新建
},
moreDelete() {//批量删除
},
importFile() {//导入
const inpEle = document.createElement("input");
inpEle.type = "file";
inpEle.style.display = "none";
inpEle.addEventListener("change", event => {
console.log(event.target.files[0]);
});
inpEle.click();
},
exportFile() {//导出
},
editItem(data){//编辑
},
deleteItem(data){//删除
},
select_table_rows(data){//表格的勾选
this.selectTable = data;
},
set_table_height() {//动态设置表格高度
const table_container_height = $(".table_container").height();
const search_menu_height = $(".search_menu").height();
const search_btn_height = $(".search_btn").outerHeight(true);
this.tableHeight = table_container_height - search_menu_height - search_btn_height - 90 + 'px';
},
getTreeData() {//查询架构归属下拉框值
query_jia_gou_gui_shu({}).then(res => {
if(res.code == 200) {
this.treeData[0].children = res.data;
console.log(res.data)
}else {
}
});
},
}
}
</script>
......@@ -127,4 +202,84 @@
/deep/ .is-leaf {
background-color: #fff !important;
}
.search_menu{
display: flex;
justify-content: space-between;
}
.search_menu_item_container{
display: flex;
align-items: center;
}
.search_menu_btn_container{
display: flex;
align-items: center;
}
.search_menu_item{
display: flex;
align-items: center;
width: 344px;
}
.search_title{
/* width: 20%; */
flex-shrink: 0;
margin-right: 15px;
}
.search_item{
width: 60%;
}
.search_btn{
width: 100%;
display: flex;
margin-top: 50px;
margin-bottom: 20px;
}
.import_btn{
display: flex;
align-items: center;
justify-content: center;
width: 86px;
height: 36px;
margin: 0 10px;
background: rgba(13,134,127,0.1);
border-radius: 6px 6px 6px 6px;
font-size: 14px;
color: #0D867F;
cursor: pointer;
}
.btn_icon{
margin-right: 10px;
}
.query_btn{
display: flex;
align-items: center;
justify-content: center;
width: 76px;
height: 32px;
background: rgba(13,134,127,1);
border-radius: 6px 6px 6px 6px;
border: 1px solid #0D867F;
font-size: 14px;
color: #fff;
margin-right: 10px;
cursor: pointer;
}
.reset_btn{
display: flex;
align-items: center;
justify-content: center;
width: 76px;
height: 32px;
background: rgba(244,244,244,1);
border-radius: 6px 6px 6px 6px;
border: 1px solid #ccc;
font-size: 14px;
color: #666;
cursor: pointer;
}
.el-button--primary{
background: rgba(13,134,127,0.1);
color: #0D867F;
border: 0;
}
</style>
\ No newline at end of file
......@@ -131,9 +131,9 @@
this.graphList = res.eleDtos;
},
get_search_select1() {//查询架构归属下拉框值
const leftGraph = JSON.parse(localStorage.getItem("leftGraph"));
leftGraph.reverse();
this.search_select1 = leftGraph;
const commonGraph = JSON.parse(localStorage.getItem("commonGraph"));
commonGraph.reverse();
this.search_select1 = commonGraph;
},
closeGraphDialog() {//图形选择窗口的取消
this.graphIndex = 0;
......
......@@ -107,7 +107,8 @@ import {
get_yuan_mo_xing_list,
delete_yuan_mo_xing_list,
query_yuan_mo_xing_details,
getDrawioLeftGraph
getDrawioLeftCommonGraph,
getDrawioLeftStandardGraph
} from '@/api/index.js';
import { MessageBox, Message } from 'element-ui';
import $ from 'jquery';
......@@ -305,29 +306,60 @@ export default {
const xmlTitle = res.data.verName;
localStorage.setItem('xmlData', xmlData);
localStorage.setItem('xmlTitle', xmlTitle);
this.queryDrawioGraph(item.metaModelId).then(res2 => {
if(res2.code == 200) {
res2.data.reverse();
localStorage.setItem('leftGraph', JSON.stringify(res2.data));
this.$router.push( `/main/metaModelListDetails/id=${item.metaModelId}&version=${item.version}`, () => {}, () => {} );
}else {
Message({
type: 'error',
message: res2.msg
});
}
})
Promise.all([ this.queryDrawioGraph(item.metaModelId), this.queryDrawioGraph2(item.metaModelId) ]).then(res2 => {
localStorage.setItem('commonGraph', JSON.stringify(res2[0].dataEle));
localStorage.setItem('standardGraph', JSON.stringify(res2[1].dataEle));
this.$router.push( `/main/metaModelListDetails/id=${item.metaModelId}&version=${item.version}`, () => {}, () => {} );
});
// this.queryDrawioGraph(item.metaModelId).then(res2 => {
// if(res2.code == 200) {
// res2.data.reverse();
// localStorage.setItem('commonGraph', JSON.stringify(res2.data));
// this.$router.push( `/main/metaModelListDetails/id=${item.metaModelId}&version=${item.version}`, () => {}, () => {} );
// }else {
// Message({
// type: 'error',
// message: res2.msg
// });
// }
// })
}
});
},
queryDrawioGraph(id) {//查询画布左侧图形
queryDrawioGraph(id) {//查询画布左侧常规图形
const params = {
metaModelId: id
}
return new Promise((resolve, reject) => {
getDrawioLeftCommonGraph(params).then(res => {
if(res.code == 200) {
resolve(res.data);
}else {
Message({
type: 'error',
message: res.msg
});
reject(res.msg);
}
})
})
},
queryDrawioGraph2(id) {//查询画布左侧标准图形
const params = {
metaModelId: id
}
return new Promise((resolve, reject) => {
getDrawioLeftGraph(params).then(res => {
resolve(res);
getDrawioLeftStandardGraph(params).then(res => {
if(res.code == 200) {
resolve(res.data);
}else {
Message({
type: 'error',
message: res.msg
});
reject(res.msg);
}
})
})
},
......
......@@ -9,7 +9,7 @@
</div>
<div class="search_menu_item">
<span class="search_title">架构归属</span>
<el-select v-model="params.archIBelongId" placeholder="请选择" clearable class="search_item">
<el-select v-model="params.archiBelongId" placeholder="请选择" clearable class="search_item">
<el-option v-for="item in search_select2" :key="item.belongId" :label="item.name" :value="item.belongId"></el-option>
</el-select>
</div>
......@@ -43,7 +43,7 @@
</el-table-column>
<el-table-column prop="archiBelongId" label="架构归属" width="150" align="center">
<template slot-scope="scope">
<span >{{dicObj.archiBelongId[scope.row.archiBelongId]}}</span>
<span >{{ scope.row.archiBelongName }}</span>
</template>
</el-table-column>
<el-table-column prop="content" label="描述" align="center"></el-table-column>
......@@ -274,7 +274,7 @@ export default {
current: 1,
pageSize: 10,
elementName: "",
archIBelongId: "",
archiBelongId: "",
state: "",
type: 1,
},
......@@ -350,6 +350,7 @@ export default {
this.search_select1 = res;
});
this.get_dialog_select2().then(res => {
// console.log(res)
this.search_select2 = res;
});
},
......@@ -361,8 +362,19 @@ export default {
getList() {
getYMXZDGLlist(this.params).then(res => {
if (res.code == 200) {
this.page.total = res.data.total;
this.tableData = res.data.records;
if(res.data.records.length > 0) {
this.get_dialog_select2().then(res2 => {
res.data.records.map(item => {
const result = res2.find(item2 => item2.belongId == item.archiBelongId);
item['archiBelongName'] = result.name;
})
this.tableData = res.data.records;
});
}else {
this.page.total = 0;
this.tableData = [];
}
}
});
},
......@@ -372,7 +384,7 @@ export default {
current: 1,
pageSize: 10,
elementName: "",
archIBelongId: "",
archiBelongId: "",
state: "",
type: 1,
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!