Commit a8061e0e by liuyong

修改bug

1 parent 22b58731
Showing with 29 additions and 22 deletions
...@@ -51,11 +51,13 @@ ...@@ -51,11 +51,13 @@
<el-table-column prop="archiBelongName" 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 prop="content" label="描述" align="center" width="200" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="content" label="描述" align="center" width="200" :show-overflow-tooltip="true"></el-table-column>
<!-- <el-table-column label="图标" align="center"> <el-table-column label="图标" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<img :src="scope.row.icon" alt="" :style="{ 'width': scope.row.width, 'height': scope.row.height }"> <!-- <img :src="scope.row.icon" alt="" :style="{ 'width': scope.row.width, 'height': scope.row.height }"> -->
<img :src="scope.row.icon" alt="">
</template> </template>
</el-table-column> --> </el-table-column>
<el-table-column prop="version" label="版本" align="center"></el-table-column> <el-table-column prop="version" label="版本" align="center"></el-table-column>
<el-table-column label="状态" align="center"> <el-table-column label="状态" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -979,36 +981,41 @@ export default { ...@@ -979,36 +981,41 @@ export default {
this.pager.total = result.data.total; this.pager.total = result.data.total;
this.pager.size = result.data.size; this.pager.size = result.data.size;
if(result.data.records.length > 0) { if(result.data.records.length > 0) {
result.data.records.length = 1;
result.data.records.map(item => { result.data.records.map(item => {
if(item.icon.includes("svg+xml")) { if(item.icon.includes("svg+xml")) {
const item_icon = item.icon.split("base64,")[1]; const item_icon = item.icon.split("base64,")[1];
const decode_item_icon = window.atob(item_icon);//svg解码,为字符串 const decode_item_icon = window.atob(item_icon);//svg解码,为字符串
const svgDocument = new DOMParser().parseFromString(decode_item_icon, 'text/xml');//svg字符串转标签 const svgDocument = new DOMParser().parseFromString(decode_item_icon, 'text/xml');//svg字符串转标签
const path = svgDocument.getElementsByTagName('path')[0]; // console.log(svgDocument)
const rect = svgDocument.getElementsByTagName('rect')[0]; // const path = svgDocument.getElementsByTagName('path')[0];
const ellipse = svgDocument.getElementsByTagName('ellipse')[0]; // const rect = svgDocument.getElementsByTagName('rect')[0];
const svgTag = svgDocument.getElementsByTagName('svg')[0]; // const ellipse = svgDocument.getElementsByTagName('ellipse')[0];
const svgWidth = Number(svgTag.getAttribute('width').split('px')[0])/2; // const svgTag = svgDocument.getElementsByTagName('svg')[0];
const svgHeight = Number(svgTag.getAttribute('height').split('px')[0])/2; // const svgWidth = Number(svgTag.getAttribute('width').split('px')[0])/2;
item['width'] = svgWidth + 'px'; // const svgHeight = Number(svgTag.getAttribute('height').split('px')[0])/2;
item['height'] = svgHeight + 'px'; // item['width'] = svgWidth + 'px';
// item['height'] = svgHeight + 'px';
if(path) { // if(path) {
path.setAttribute('fill', item.color); // path.setAttribute('fill', item.color);
} // }
if(rect) { // if(rect) {
rect.setAttribute('fill', item.color); // rect.setAttribute('fill', item.color);
} // }
if(ellipse) { // if(ellipse) {
ellipse.setAttribute('fill', item.color); // ellipse.setAttribute('fill', item.color);
} // }
const svgToString = new XMLSerializer().serializeToString(svgDocument);//svg标签转化为字符串 const svgToString = new XMLSerializer().serializeToString(svgDocument);//svg标签转化为字符串
const encode_item_icon = window.btoa(svgToString);//base64编码 const encode_item_icon = window.btoa(svgToString);//base64编码
item.icon = 'data:image/svg+xml;base64,'+ encode_item_icon; item.icon = 'data:image/svg+xml;base64,'+ encode_item_icon;
}else { }else {
item['width'] = 0; const encode_item_icon = window.btoa(item.icon);//base64编码
item['height'] = 0; item.icon = 'data:image/svg+xml;base64,'+ encode_item_icon;
console.log(item)
// item['width'] = 0;
// item['height'] = 0;
} }
}) })
Promise.all([ this.get_dialog_select1(), this.get_dialog_select2() ]).then(res2 => { Promise.all([ this.get_dialog_select1(), this.get_dialog_select2() ]).then(res2 => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!