Commit 358caf9c by liuyong
2 parents faa006b2 bcf97a92
......@@ -6,12 +6,18 @@ const initDrawioGraph = function (that) {
that.loadFile(`-2`, true, file)
} else {
// const jsonToGraph = JSON.parse(localStorage.getItem('jsonToGraph'))
// console.log('jsonToGraph', JSON.parse(jsonToGraph))
// console.log('that', that)
const xmlData = localStorage.getItem('xmlData')
const xmlTitle = localStorage.getItem('xmlTitle')
let joinGraph_ = null;
let xmlData = ''
let xmlTitle = ''
if(urlParams.page === 'metaModelListDetails') {
joinGraph_ = JSON.parse(localStorage.getItem('metaModelJoinGraph'));
xmlData = localStorage.getItem('metamodelXmlData')
xmlTitle = localStorage.getItem('metamodelXmlTitle')
} else {
joinGraph_ = JSON.parse(localStorage.getItem('joinGraph'));
xmlData = localStorage.getItem('xmlData')
xmlTitle = localStorage.getItem('xmlTitle')
}
const file = new LocalFile(that, xmlData, xmlTitle, that.mode)
that.loadFile(`-1`, true, file)
}
......@@ -245,45 +251,38 @@ const leftCustomGraph = function (that) {
// }
// })
const joinGraph_ = JSON.parse(localStorage.getItem('joinGraph'))
const joinGraph = joinGraph_.graph
if (joinGraph_.state == 1) {
// 标准图元
joinGraph.pop()
Sidebar.prototype.sidebarTitles = true;//勾选标签
// Sidebar.prototype.createEdgeTemplateEntry
joinGraph.forEach(function (item, index) {
if (item.eleDtos) {
if (item.eleDtos.length > 0) {
const libraryName = item.arciBelongName
let images = []
item.eleDtos.forEach(function (item2) {
images.unshift({
aspect: 'fixed',
xml: item2.iconName,
h: 41,
title: item2.eleName,
w: 71,
})
})
var xml = that.createLibraryDataFromImages(images)
// const joinGraph_ = JSON.parse(localStorage.getItem('joinGraph'))
// const joinGraph = joinGraph_.graph
// if (joinGraph_.state == 1) {
// // 标准图元
// joinGraph.pop()
// Sidebar.prototype.sidebarTitles = true;//勾选标签
// // Sidebar.prototype.createEdgeTemplateEntry
// joinGraph.forEach(function (item, index) {
// if (item.eleDtos) {
// if (item.eleDtos.length > 0) {
// const libraryName = item.arciBelongName
// let images = []
// item.eleDtos.forEach(function (item2) {
// images.unshift({
// aspect: 'fixed',
// xml: item2.iconName,
// h: 41,
// title: item2.eleName,
// w: 71,
// })
// })
// var xml = that.createLibraryDataFromImages(images)
var file = new LocalLibrary(that, xml, libraryName)
that.libraryLoaded(file, images, null, true)
} else {
}
}
})
} else {
// joinGraph.forEach(item => {
// item.eleDtos.forEach(item2 => {
// if(item2.eleType == '1') {
// console.log(item2)
// var file = new LocalLibrary(that, xml, libraryName)
// that.libraryLoaded(file, images, null, true)
// } else {
// }
// }
// })
// })
}
// } else {
// }
}
//二次开发,创建时不必先保存文件至本地,定义Dialogs.js文件里面的createTemporaryFile函数
......
......@@ -39,9 +39,12 @@
{
Sidebar.prototype.addCustomGraph = function()
{
const joinGraph_ = JSON.parse(localStorage.getItem('joinGraph'));
let joinGraph_ = null;
if(urlParams.page === 'metaModelListDetails') {
joinGraph_ = JSON.parse(localStorage.getItem('metaModelJoinGraph'));
} else {
joinGraph_ = JSON.parse(localStorage.getItem('joinGraph'));
}
const joinGraph = joinGraph_.graph;
this.sidebarTitles = true;//勾选标签
if(joinGraph_.state == 1) {
......@@ -49,8 +52,8 @@
if(item.arciBelongName == '架构元素关系') {
let fns = [];
item.eleDtos.forEach(item2 => {
fns.push(
this.createEdgeTemplateEntry(
let archi = null
archi = this.createEdgeTemplateEntry(
item2.iconName + 'attr=[];assetName=[' + item2.rsName + '];',
item2.shapeWidth ? item2.shapeWidth : 150,
item2.shapeHeight ? item2.shapeHeight : 75,
......@@ -59,37 +62,71 @@
null,
'非封闭图形2'
)
)
fns.push(archi)
});
this.addPaletteFunctions(item.arciBelongId, item.arciBelongName, true, fns);
}
})
}
if(joinGraph_.state == 2) {
// console.log(joinGraph)
joinGraph.forEach(item => {
if(item.arciBelongName == '架构元素关系') {
} else {
let fns = [];
item.eleDtos.forEach(item2 => {
// if(item2.assets && item2.dicys) {
let attr_ = [];
item2.dicys && item2.dicys.forEach(res => {
if(res.fieldName) {
attr_.push(
{
name: res.fieldName,
value: res.propertyValue,
id: res.propertyId,
controlType: res.controlType,
}
)
}
})
fns.push(
this.createEdgeTemplateEntry(
item2.iconName + 'attr=[];assetName=[' + item2.rsName + '];',
item2.shapeWidth ? item2.shapeWidth : 150,
item2.shapeHeight ? item2.shapeHeight : 75,
'',
item2.rsName,
this.createVertexTemplateEntry(
// 'html=1;outlineConnect=0;whiteSpace=wrap;fillColor=#d2edfd;shape=mxgraph.archimate3.application;appType=rightTopCircleHasLeft;archiType=rounded',
item2.iconName + ';attr=' + JSON.stringify(attr_),
item2.shapeWidth ? item2.shapeWidth : 71,
item2.shapeHeight ? item2.shapeHeight : 41,
null,
'非封闭图形2'
item2.eleName,
null,
null,
'封闭图形2'
)
)
// }
});
this.addPaletteFunctions(item.arciBelongId, item.arciBelongName, true, fns);
}else {
this.addPaletteFunctions(item.eleBelongId, item.arciBelongName, true, fns);
}
})
}
if(joinGraph_.state == 2) {
// console.log(joinGraph)
joinGraph.forEach(item => {
// if(item.arciBelongName == '架构元素关系') {
// let fns = [];
// item.eleDtos.forEach(item2 => {
// fns.push(
// this.createEdgeTemplateEntry(
// // 'html=1;outlineConnect=0;whiteSpace=wrap;fillColor=#99ffff;shape=mxgraph.archimate3.application;appType=rightTopCircle;archiType=rounded',
// item2.iconName + 'attr=[];assetName=[' + item2.rsName + '];',
// item2.shapeWidth ? item2.shapeWidth : 150,
// item2.shapeHeight ? item2.shapeHeight : 75,
// '',
// item2.rsName,
// null,
// '非封闭图形2'
// )
// )
// });
// this.addPaletteFunctions(item.arciBelongId, item.arciBelongName, true, fns);
// }else {
item.eleDtos.forEach(item2 => {
if(item2.assets && item2.dicys) {
if(item2.assets) { // && item2.dicys
let fns = [];
let attr_ = [];
item2.dicys.forEach(res => {
item2.dicys && item2.dicys.forEach(res => {
if(res.fieldName) {
attr_.push(
{
......@@ -106,7 +143,8 @@
// console.log(item3.fieldsValue)
fns.push(
this.createVertexTemplateEntry(
item2.iconName + ';fillColor=' + item2.color + ';' + 'attr=' + JSON.stringify(attr_) + ';assetId=' + item3.assetId + ';archiBelongId=' + item3.archiBelongId + ';assetName=[' + item3.assetName + '];eleName=' + item2.eleName +';elementId=' + item2.elementId + ';eaLevel=' + item2.eaLevel + ';',
// 'html=1;outlineConnect=0;whiteSpace=wrap;fillColor=#99ffff;shape=mxgraph.archimate3.application;appType=rightTopTriangle;archiType=rounded',
item3.iconName + ';fillColor=' + item2.color + ';' + 'attr=' + JSON.stringify(attr_) + ';assetId=' + item3.assetId + ';archiBelongId=' + item3.archiBelongId + ';assetName=[' + item3.assetName + '];eleName=' + item2.eleName +';elementId=' + item2.elementId + ';eaLevel=' + item2.eaLevel + ';',
item2.shapeWidth ? item2.shapeWidth : 150,
item2.shapeHeight ? item2.shapeHeight : 75,
null,
......@@ -120,7 +158,7 @@
this.addPaletteFunctions(item2.eleBelongId, item2.eleName, true, fns);
}
});
}
// }
});
}
};
......
function initSetScratchpad() {
console.log('urlParams', urlParams)
//左侧便签本初始化数据
$.ajax({
method: 'post',
url: `http://${ajaxUrl}/eadc-architecture/short-cut-model/qSCMList`,
data: JSON.stringify({}),
data: {
referenceId: urlParams.referenceId,
referenceType: isMetaModel()
},
success: function (result) {
let images = []
result.data.forEach((item) => {
......@@ -54,6 +58,13 @@ function initSetScratchpad() {
// 若为压缩的xml,则内容是diagram的内容
}
function isMetaModel() {
if(urlParams.page === 'metaModelListDetails') {
return 1
} else {
return 2
}
}
function saveScratchpad(data) {
//左侧便签本保存数据
......@@ -67,6 +78,8 @@ function saveScratchpad(data) {
width: item.w,
title: item.title ? item.title : null,
sort: 1,
referenceId: urlParams.referenceId,
referenceType: isMetaModel()
})
})
} else {
......
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1713148019040" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3261" width="64" height="64" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M905.216 895.488H119.808c-11.264 0-22.016-6.144-27.648-15.872-5.632-9.728-5.632-22.016 0-31.744L484.864 167.424c5.632-9.728 16.384-15.872 27.648-15.872s22.016 6.144 27.648 15.872l392.704 679.936c5.632 9.728 5.632 22.016 0 31.744s-16.384 16.384-27.648 16.384zM175.104 831.488H849.92L512.512 247.296 175.104 831.488z" fill="#2c2c2c" p-id="3262"></path></svg>
\ No newline at end of file
......@@ -454,6 +454,9 @@
background-color: #fff;
display: none;
}
.geFormatContainer .geToolbarContainer {
display: block;
}
/* 二次开发,设置左右侧工具栏位置 */
.geSidebarContainer{
top: 3px !important;
......
......@@ -1043,7 +1043,7 @@
}
// 二次开发-画布只保留五大架构元素关系图标
const joinGraph_ = JSON.parse(localStorage.getItem('joinGraph'));
if(joinGraph_.state == 2) {
if(joinGraph_ && joinGraph_.state == 2 && urlParams.page !== 'metaModelListDetails') {
this.addGeneralPalette(this.customEntries == null);//通用图形
}
// this.addMiscPalette(false); //杂项图形
......
......@@ -60,7 +60,13 @@ mxArchiMate3Application.prototype.cst = {
ARCHI_TYPE : 'archiType',
TYPE_SQUARE : 'square',
TYPE_ROUNDED : 'rounded',
TYPE_OCT : 'oct'
TYPE_OCT : 'oct',
// 二次开发自定义右上角角标图形
rightTopCircle: 'rightTopCircle',
rightTopTriangle: 'rightTopTriangle',
circleAndTriangle: 'circleAndTriangle',
rightTopCircleHasLeft: 'rightTopCircleHasLeft',
rightTopCircleAndTriangleHasLeft: 'rightTopCircleAndTriangleHasLeft'
};
mxArchiMate3Application.prototype.customProperties = [
......@@ -123,7 +129,7 @@ mxArchiMate3Application.prototype.background = function(c, x, y, w, h)
if (archiType === 'rounded')
{
c.roundrect(0, 0, w, h, 10, 10);
c.roundrect(0, 0, w, h, 6, 6);
}
else if ((archiType === 'oct') && w >= 20 && h >= 20)
{
......@@ -480,6 +486,37 @@ mxArchiMate3Application.prototype.foreground = function(c, x, y, w, h)
mxArchiMate3Path.prototype.background(c, x, y, w, h);
}
// 二次开发- 添加矩形图(右上角圆形角标)
else if (type === mxArchiMate3Application.prototype.cst.rightTopCircle)
{
c.translate(0, 3);
h = h - 6;
mxArchiMateRightTopCircle.prototype.background(c, x, y, w, h);
}
else if (type === mxArchiMate3Application.prototype.cst.rightTopTriangle)
{
c.translate(0, 3);
h = h - 6;
mxArchiMateRightTopTriangle.prototype.background(c, x, y, w, h);
}
else if (type === mxArchiMate3Application.prototype.cst.circleAndTriangle)
{
c.translate(0, 3);
h = h - 6;
mxArchiMateRightTopCircleAndTriangle.prototype.background(c, x, y, w, h);
}
else if (type === mxArchiMate3Application.prototype.cst.rightTopCircleHasLeft)
{
c.translate(0, 3);
h = h - 6;
mxArchiMateRightTopCircleHasLeft.prototype.background(c, x, y, w, h);
}
else if (type === mxArchiMate3Application.prototype.cst.rightTopCircleAndTriangleHasLeft)
{
c.translate(0, 3);
h = h - 6;
mxArchiMateRightTopCircleAndTriangleHasLeft.prototype.background(c, x, y, w, h);
}
};
mxCellRenderer.registerShape(mxArchiMate3Application.prototype.cst.APPLICATION, mxArchiMate3Application);
......@@ -975,7 +1012,122 @@ mxArchiMate3Service.prototype.background = function(c, x, y, w, h)
};
mxCellRenderer.registerShape(mxArchiMate3Service.prototype.cst.SERVICE, mxArchiMate3Service);
// 二次开发自定义右上角圆形右角标
// 右上角圆形
function mxArchiMateRightTopCircle(bounds, fill, stroke, strokewidth)
{
mxShape.call(this);
this.bounds = bounds;
this.fill = fill;
this.stroke = stroke;
this.strokewidth = (strokewidth != null) ? strokewidth : 1;
};
mxUtils.extend(mxArchiMateRightTopCircle, mxArchiMate3Service);
mxArchiMateRightTopCircle.prototype.cst = {
rightTopCircle : 'mxgraph.archimate3.rightTopCircle'
};
mxArchiMateRightTopCircle.prototype.background = function(c, x, y, w, h) {
c.ellipse(4, -6, 10, 10);
c.fillAndStroke();
}
mxCellRenderer.registerShape(mxArchiMateRightTopCircle.prototype.cst.rightTopCircle, mxArchiMateRightTopCircle);
// 右上角三角形
function mxArchiMateRightTopTriangle(bounds, fill, stroke, strokewidth)
{
mxShape.call(this);
this.bounds = bounds;
this.fill = fill;
this.stroke = stroke;
this.strokewidth = (strokewidth != null) ? strokewidth : 1;
};
mxUtils.extend(mxArchiMateRightTopTriangle, mxArchiMate3Service);
mxArchiMateRightTopTriangle.prototype.cst = {
rightTopTriangle : 'mxgraph.archimate3.rightTopTriangle'
};
mxArchiMateRightTopTriangle.prototype.background = function(c, x, y, w, h) {
c.begin();
c.moveTo(10, -6);
c.lineTo(14, 4);
c.lineTo(6, 4);
c.close();
c.fillAndStroke();
}
mxCellRenderer.registerShape(mxArchiMateRightTopTriangle.prototype.cst.rightTopCircle, mxArchiMateRightTopTriangle);
// 右上角圆圈套三角
function mxArchiMateRightTopCircleAndTriangle(bounds, fill, stroke, strokewidth)
{
mxShape.call(this);
this.bounds = bounds;
this.fill = fill;
this.stroke = stroke;
this.strokewidth = (strokewidth != null) ? strokewidth : 1;
};
mxUtils.extend(mxArchiMateRightTopCircleAndTriangle, mxArchiMate3Service);
mxArchiMateRightTopCircleAndTriangle.prototype.cst = {
circleAndTriangle : 'mxgraph.archimate3.circleAndTriangle'
};
mxArchiMateRightTopCircleAndTriangle.prototype.background = function(c, x, y, w, h) {
// console.log('w', w, 'h', h, c)
c.ellipse(4, -6, 11, 11);
c.fillAndStroke();
c.begin();
c.moveTo(10, -5);
c.lineTo(14, 3);
c.lineTo(6, 3);
c.close();
c.fillAndStroke();
}
mxCellRenderer.registerShape(mxArchiMateRightTopCircleAndTriangle.prototype.cst.circleAndTriangle, mxArchiMateRightTopCircleAndTriangle);
// 左刷新 右圆圈
function mxArchiMateRightTopCircleHasLeft(bounds, fill, stroke, strokewidth)
{
mxShape.call(this);
this.bounds = bounds;
this.fill = fill;
this.stroke = stroke;
this.strokewidth = (strokewidth != null) ? strokewidth : 1;
};
mxUtils.extend(mxArchiMateRightTopCircleHasLeft, mxArchiMate3Service);
mxArchiMateRightTopCircleHasLeft.prototype.cst = {
rightTopCircleHasLeft : 'mxgraph.archimate3.rightTopCircleHasLeft'
};
mxArchiMateRightTopCircleHasLeft.prototype.background = function(c, x, y, w, h) {
c.image(-x + 6, -6, 12, 12, 'data:image/svg+xml;base64,PHN2ZyB0PSIxNzEzMTcxMjMyOTIzIiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjQ4NzUiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTk2MCA0MTZWMTkybC03My4wNTYgNzMuMDU2YTQ0Ny43MTIgNDQ3LjcxMiAwIDAgMC0zNzMuNi0yMDEuMDg4QzI2NS45MiA2My45NjggNjUuMzEyIDI2NC41NDQgNjUuMzEyIDUxMlMyNjUuOTIgOTYwLjAzMiA1MTMuMzQ0IDk2MC4wMzJhNDQ4LjA2NCA0NDguMDY0IDAgMCAwIDQxNS4yMzItMjc5LjQ4OCAzOC4zNjggMzguMzY4IDAgMSAwLTcxLjEzNi0yOC44OTYgMzcxLjM2IDM3MS4zNiAwIDAgMS0zNDQuMDk2IDIzMS41ODRDMzA4LjMyIDg4My4yMzIgMTQyLjExMiA3MTcuMDI0IDE0Mi4xMTIgNTEyUzMwOC4zMiAxNDAuNzY4IDUxMy4zNDQgMTQwLjc2OGMxMzIuNDQ4IDAgMjUxLjkzNiA3MC4wOCAzMTguMDE2IDE3OS44NEw3MzYgNDE2aDIyNHoiIHAtaWQ9IjQ4NzYiPjwvcGF0aD48L3N2Zz4=');
c.ellipse(4, -6, 10, 10);
c.fillAndStroke();
}
mxCellRenderer.registerShape(mxArchiMateRightTopCircleHasLeft.prototype.cst.rightTopCircleHasLeft, mxArchiMateRightTopCircleHasLeft);
// 左刷新,右圆圈套三角
function mxArchiMateRightTopCircleAndTriangleHasLeft(bounds, fill, stroke, strokewidth)
{
mxShape.call(this);
this.bounds = bounds;
this.fill = fill;
this.stroke = stroke;
this.strokewidth = (strokewidth != null) ? strokewidth : 1;
};
mxUtils.extend(mxArchiMateRightTopCircleAndTriangleHasLeft, mxArchiMate3Service);
mxArchiMateRightTopCircleAndTriangleHasLeft.prototype.cst = {
rightTopCircleAndTriangleHasLeft : 'mxgraph.archimate3.rightTopCircleAndTriangleHasLeft'
};
mxArchiMateRightTopCircleAndTriangleHasLeft.prototype.background = function(c, x, y, w, h) {
c.ellipse(4, -6, 11, 11);
c.fillAndStroke();
c.begin();
c.moveTo(10, -5);
c.lineTo(14, 3);
c.lineTo(6, 3);
c.close();
c.fillAndStroke();
c.image(-x + 6, -6, 12, 12, 'data:image/svg+xml;base64,PHN2ZyB0PSIxNzEzMTcxMjMyOTIzIiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjQ4NzUiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTk2MCA0MTZWMTkybC03My4wNTYgNzMuMDU2YTQ0Ny43MTIgNDQ3LjcxMiAwIDAgMC0zNzMuNi0yMDEuMDg4QzI2NS45MiA2My45NjggNjUuMzEyIDI2NC41NDQgNjUuMzEyIDUxMlMyNjUuOTIgOTYwLjAzMiA1MTMuMzQ0IDk2MC4wMzJhNDQ4LjA2NCA0NDguMDY0IDAgMCAwIDQxNS4yMzItMjc5LjQ4OCAzOC4zNjggMzguMzY4IDAgMSAwLTcxLjEzNi0yOC44OTYgMzcxLjM2IDM3MS4zNiAwIDAgMS0zNDQuMDk2IDIzMS41ODRDMzA4LjMyIDg4My4yMzIgMTQyLjExMiA3MTcuMDI0IDE0Mi4xMTIgNTEyUzMwOC4zMiAxNDAuNzY4IDUxMy4zNDQgMTQwLjc2OGMxMzIuNDQ4IDAgMjUxLjkzNiA3MC4wOCAzMTguMDE2IDE3OS44NEw3MzYgNDE2aDIyNHoiIHAtaWQ9IjQ4NzYiPjwvcGF0aD48L3N2Zz4=');
c.fillAndStroke();
}
mxCellRenderer.registerShape(mxArchiMateRightTopCircleAndTriangleHasLeft.prototype.cst.rightTopCircleAndTriangleHasLeft, mxArchiMateRightTopCircleAndTriangleHasLeft);
// end------
mxArchiMate3Service.prototype.getConstraints = function(style, w, h)
{
var constr = [];
......
......@@ -542,6 +542,9 @@ export function archiAssetShowTree(params) {
export function archiIntelligenceSearchTree(params) {
return post(EADC_ARRCHITECTURE + '/archi-asset-view/assetTree', params)
}
export function archiIntelligenceSearchTreeNew(params) {
return post(EADC_ARRCHITECTURE + '/arc-ast-sys/assetInfoLevel', params)
}
// 总体架构资产智能搜索,架构版本
export function archiIntelligenceSearchVersionList(params) {
return post(EADC_ARRCHITECTURE + '/archi-asset-view/assetV', params)
......@@ -810,7 +813,30 @@ export function getQryByTree(params) {
export function getPreArc(params) {
return post(EADC_ARRCHITECTURE + '/arc-ast-info/qyLastEle', params)
}
// 获取组织树形
export function getOrgTreeData(params) {
return post(EADC_SHARED_ABILITY + '/org/tree', params)
}
// 单个删除组织
export function delOrgTreeItem(params) {
return post(EADC_SHARED_ABILITY + `/org/del`, params)
}
// 批量删除组织
export function batchDeleteOrgTreeItem(params) {
return post(EADC_SHARED_ABILITY + `/org/bDel`, params)
}
// 新增/编辑组织
export function editOrgTreeItem(params) {
return post(EADC_SHARED_ABILITY + `/org/cOrg`, params)
}
// 获取组织下拉
export function getOrgOption(params) {
return post(EADC_SHARED_ABILITY + `/org/getOrgOption`, params)
}
// 获取部门下拉
export function getDeptOption(params) {
return post(EADC_SHARED_ABILITY + `/org/getDeptOption`, params)
}
export function postRequest(url, params) {
return post(EADC_ARRCHITECTURE + url, params)
}
......
import { EADC_ARRCHITECTURE, EADC_KNOWLEDGE_POOL } from '@/config/micromodule'
import { EADC_ARRCHITECTURE, EADC_KNOWLEDGE_POOL, EADC_SHARED_ABILITY } from '@/config/micromodule'
// 列表接口url
// 批量计划管理分页查询
export const batchPlanManagement = EADC_ARRCHITECTURE + '/bat-plan-info/'
......@@ -42,3 +42,6 @@ export const queryArchitectureFollowExamine =
export const queryqKLPerson = EADC_KNOWLEDGE_POOL + '/kl-talent-pool/qKLPerson/'
export const queryExpert = EADC_KNOWLEDGE_POOL + '/kl-talent-pool/'
// 系统管理-组织机构管理
export const queryOrganizationManagement = EADC_SHARED_ABILITY + '/org/'
......@@ -4,7 +4,7 @@
* @Autor: pan
* @Date: 2024-03-12 14:55:59
* @LastEditors: pan
* @LastEditTime: 2024-04-02 09:56:29
* @LastEditTime: 2024-04-16 17:46:16
-->
<template>
<div class="form-box">
......@@ -165,7 +165,7 @@ export default {
// el-input宽度
/deep/ .form-item {
.el-input,
.el-select {
.el-select, .el-cascader {
width: 100% !important;
}
.el-rate {
......
......@@ -4,7 +4,7 @@
* @Autor: pan
* @Date: 2024-03-12 14:01:57
* @LastEditors: pan
* @LastEditTime: 2024-04-01 11:52:46
* @LastEditTime: 2024-04-16 18:59:44
-->
<template>
<div class="list-page">
......@@ -25,18 +25,61 @@
<slot name="operationWrap" />
</div>
<!-- 表格 -->
<div class="hasLeftTree" v-if="hasLeftTree">
<div class="leftTree">
<div class="treeTitle">{{ treeTitle }}</div>
<el-tree
:highlight-current="true"
:data="treeData"
:props="treeProps"
@node-click="handleNodeClick"
></el-tree>
</div>
<div class="table-wrap">
<slot name="tableWrap" />
</div>
</div>
<div class="table-wrap" v-else>
<slot name="tableWrap" />
</div>
</div>
</template>
<script>
export default {
name: 'list-page',
props: {
hasLeftTree: {
type: Boolean,
default: false,
},
treeTitle: {
type: String,
default: '',
},
treeData: {
type: Array,
default: () => [],
},
treeProps: {
type: Object,
default: () => {
return {
children: 'children',
label: 'label',
}
},
},
},
methods: {
handleNodeClick(data) {
this.$emit('node-click', data)
},
},
}
</script>
<style scoped lang="scss">
// active #c0ebe4 color: 999
.list-page {
display: flex;
flex-direction: column;
......@@ -48,6 +91,52 @@ export default {
padding: 14px 0;
box-sizing: border-box;
}
.hasLeftTree {
display: flex;
flex: 1;
min-height: 0;
margin-left: -20px;
.leftTree {
width: 273px;
display: flex;
flex-direction: column;
// height: 100%;
.treeTitle {
height: 60px;
line-height: 60px;
padding: 0 15px;
box-sizing: border-box;
border-bottom: 1px solid #ebeef5;
text-align: left;
font-weight: bold;
}
/deep/ .el-tree {
flex: 1;
min-height: 0;
overflow: auto;
padding-right: 10px;
margin-bottom: 10px;
.el-tree-node__expand-icon.el-icon-caret-right.is-leaf {
background-color: #ffffff !important;
}
.el-tree-node__content:hover {
.is-leaf {
background-color: #f5f7fa !important;
}
}
}
/deep/ .el-tree--highlight-current
.el-tree-node.is-current
> .el-tree-node__content {
background-color: #c0ebe4 !important;
color: #999999;
.is-leaf {
background-color: #c0ebe4 !important;
}
}
}
}
.table-wrap {
flex: 1;
min-height: 180px;
......
......@@ -4,7 +4,7 @@
* @Autor: pan
* @Date: 2024-03-12 15:11:47
* @LastEditors: pan
* @LastEditTime: 2024-04-02 12:39:00
* @LastEditTime: 2024-04-16 17:45:46
-->
<template>
<div class="form-item">
......@@ -105,7 +105,6 @@
v-model="currentVal"
v-bind="bindProps"
v-on="bindEvents"
size="mini"
clearable
></el-cascader>
</div>
......
......@@ -2,38 +2,46 @@
<iframe
id="drawioGraph"
name="content_frame"
:src="'/drawio/index.html?id='+id+'&info='+info"
frameborder=0
scrolling="no">
:src="getSrc"
frameborder="0"
scrolling="no"
>
</iframe>
</template>
<script>
export default {
export default {
props: {
initGraphId: Object
initGraphId: Object,
},
data() {
return {
id: null,
info: null
};
info: null,
page: null,
referenceId: null,
}
},
watch: {
initGraphId: {
handler(newVal, oldVal) {
this.id = newVal.id;
this.info = newVal.info;
this.id = newVal.id
this.info = newVal.info
this.page = newVal.page
this.referenceId = newVal.referenceId
},
}
},
mounted(){
},
}
computed: {
getSrc() {
return `/drawio/index.html?id=${this.id}&info=${this.info}&page=${this.page}&referenceId=${this.referenceId}`
},
},
mounted() {},
}
</script>
<style scoped>
#drawioGraph{
#drawioGraph {
height: 100%;
width: 100%;
}
}
</style>
......@@ -211,7 +211,7 @@ export const routes = [
name: 'archiAssetManage',
component: () => import('@/views/archi-asset-manage/index.vue'),
meta: {
title: '总体架构资产管理',
title: '系统架构资产管理',
},
},
{
......@@ -542,6 +542,15 @@ export const routes = [
title: '字典管理',
},
},
{
path: '/main/organizationManagement', // 系统管理 - 组织机构管理
name: 'organizationManagement',
component: () => import('@/views/organizationManagement/index.vue'),
meta: {
title: '组织机构管理',
keepAlive: true
},
},
],
},
]
......
export default `\n <mxGraphModel dx=\"1273\" dy=\"573\" grid=\"1\" gridSize=\"10\" guides=\"1\" tooltips=\"1\" connect=\"1\" arrows=\"1\" fold=\"1\" page=\"1\" pageScale=\"1\" pageWidth=\"827\" pageHeight=\"1169\" math=\"0\" shadow=\"0\">\n <root>\n <mxCell id=\"0\"/>\n <mxCell id=\"1\" parent=\"0\"/>\n </root>\n </mxGraphModel>\n `
\ No newline at end of file
......@@ -61,3 +61,18 @@ export function svgToBase64(svgCode) {
const utf8Bytes = new TextEncoder().encode(svgCode);
return 'data:image/svg+xml;base64,' + btoa(String.fromCharCode.apply(null, utf8Bytes));
}
export function deepClone(source) {
if (!source && typeof source !== 'object') {
throw new Error('error arguments', 'deepClone')
}
const targetObj = source.constructor === Array ? [] : {}
Object.keys(source).forEach(keys => {
if (source[keys] && typeof source[keys] === 'object') {
targetObj[keys] = deepClone(source[keys])
} else {
targetObj[keys] = source[keys]
}
})
return targetObj
}
\ No newline at end of file
......@@ -372,12 +372,16 @@ export const menuOptions = [
width: '220',
children: [
{
name: '字典管理',
name: '系统配置',
children: [
{
name: ' 字典管理 ',
name: '字典管理 ',
path: '/main/dictionaryManagement',
},
{
name: '组织机构管理 ',
path: '/main/organizationManagement',
},
],
},
],
......
......@@ -29,6 +29,7 @@
></el-option>
</el-select>
</div>
<div class="search_menu_item">
<span class="search_title">状态</span>
<el-select
......@@ -48,6 +49,21 @@
<el-option label="暂存" value="2"></el-option> -->
</el-select>
</div>
<div class="search_menu_item">
<span class="search_title">适用范围</span>
<el-select
clearable
placeholder="请选择"
v-model="queryParamsScope"
>
<el-option
:label="item.label"
:value="item.value"
v-for="item in scopeApplicationOptions"
:key="item.value"
></el-option>
</el-select>
</div>
</div>
<div class="search_menu_btn_container">
<div class="query_btn" @click="search_table">
......@@ -156,7 +172,7 @@
width="200"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column label="图标" align="center">
<el-table-column width="100" label="图标" align="center">
<template slot-scope="scope">
<img
:src="scope.row.icon"
......@@ -638,7 +654,7 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button class="greenButton" @click="save_dicy">保存</el-button>
<el-button class="greenButton" v-debounce:click="save_dicy">保存</el-button>
<el-button @click="dicy_dialog = false">取消</el-button>
</span>
</el-dialog>
......@@ -870,6 +886,7 @@ export default {
query_item1: null,
query_item3: null,
query_item4: null,
queryParamsScope: null,
add_select_item: null,
add_select_item2: null,
search_select1: [],
......@@ -1167,32 +1184,32 @@ export default {
this.selectGraphShape = this.graphList[this.graphIndex].graphName
}
// 给图形添加文字
const item_icon = this.selectGraphSrc.split('base64,')[1]
const decode_item_icon = window.atob(item_icon) //svg解码,为字符串
const svgDocument = new DOMParser().parseFromString(
decode_item_icon,
'text/xml',
) //svg字符串转标签
const svgTag = svgDocument.getElementsByTagName('svg')[0]
// 图形添加文字
var svgNS = 'http://www.w3.org/2000/svg'
var text = document.createElementNS(svgNS, 'text')
text.textContent = this.ruleForm.let1
// 设置text元素的属性,例如字体大小和颜色
text.setAttribute('font-size', '12')
text.setAttribute('fill', '#000000')
// 设置text元素的位置(居中展示)
text.setAttribute('text-anchor', 'middle')
text.setAttribute('dominant-baseline', 'middle')
const svgWidth = Number(svgTag.getAttribute('width').split('px')[0]) / 2
const svgHeight = Number(svgTag.getAttribute('height').split('px')[0]) / 2
text.setAttribute('x', svgWidth) // 距离左边界
text.setAttribute('y', svgHeight) // 距离上边界
// 将text元素添加到SVG容器中
svgTag.appendChild(text)
const svgToString = new XMLSerializer().serializeToString(svgDocument) //svg标签转化为字符串
// console.log('svgToString', svgToString)
this.selectGraphSrc = svgToBase64(svgToString) // 'data:image/svg+xml;base64,' + encode_item_icon
// const item_icon = this.selectGraphSrc.split('base64,')[1]
// const decode_item_icon = window.atob(item_icon) //svg解码,为字符串
// const svgDocument = new DOMParser().parseFromString(
// decode_item_icon,
// 'text/xml',
// ) //svg字符串转标签
// const svgTag = svgDocument.getElementsByTagName('svg')[0]
// // 图形添加文字
// var svgNS = 'http://www.w3.org/2000/svg'
// var text = document.createElementNS(svgNS, 'text')
// text.textContent = this.ruleForm.let1
// // 设置text元素的属性,例如字体大小和颜色
// text.setAttribute('font-size', '12')
// text.setAttribute('fill', '#000000')
// // 设置text元素的位置(居中展示)
// text.setAttribute('text-anchor', 'middle')
// text.setAttribute('dominant-baseline', 'middle')
// const svgWidth = Number(svgTag.getAttribute('width').split('px')[0]) / 2
// const svgHeight = Number(svgTag.getAttribute('height').split('px')[0]) / 2
// text.setAttribute('x', svgWidth) // 距离左边界
// text.setAttribute('y', svgHeight) // 距离上边界
// // 将text元素添加到SVG容器中
// svgTag.appendChild(text)
// const svgToString = new XMLSerializer().serializeToString(svgDocument) //svg标签转化为字符串
// // console.log('svgToString', svgToString)
// this.selectGraphSrc = svgToBase64(svgToString) // 'data:image/svg+xml;base64,' + encode_item_icon
},
closeGraphDialog() {
//图形选择窗口的取消
......@@ -1598,6 +1615,7 @@ export default {
elementName: this.query_item3,
pageSize: this.pager.size,
state: this.query_item4,
scope: this.queryParamsScope
}
this.loading = true
query_jia_gou_yuan_su_guan_xi_table(params).then((result) => {
......@@ -1867,7 +1885,7 @@ export default {
.search_menu_item {
display: flex;
align-items: center;
width: 344px;
width: 25%;
}
.search_title {
/* width: 20%; */
......
......@@ -75,7 +75,7 @@
queryViewManageQingDan
} from '@/api/index.js';
import $ from 'jquery';
import emptyView from '@/utils/emptyView'
export default {
name: 'Canvas',
components: {
......@@ -98,11 +98,13 @@
this.getQingDanTable();
this.get_search_select1();
const id = this.$route.query.id;
const graphGroup = this.$route.query.info;
// const id = this.$route.query.id;
// const graphGroup = this.$route.query.info;
const { id, info, referenceId } = this.$route.query
this.routerId = {
id: id,
info: graphGroup
info,
referenceId
}
window.onmessage = e => {
......@@ -151,6 +153,9 @@
}
if(e.data.type == 'saveFileSignalXml') {
if(emptyView == e.data.data.mxGraphModel) {
return this.$message.warning('视图为空')
}
MessageBox.confirm('确定保存文件?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
......
......@@ -16,6 +16,14 @@
<div class="right_container">
<el-tabs v-model="activeName" type="border-card">
<el-tab-pane label="发布" name="发布">
<el-skeleton style="width: 345px;" class="m-15" :loading="loading" animated>
<template slot="template">
<el-skeleton-item
variant="image"
style="width: 345px; height: 240px;"
/>
</template>
<template>
<div class="card_container">
<div class="card_body">
<el-card
......@@ -56,6 +64,8 @@
</div> -->
</div>
</div>
</template>
</el-skeleton>
<el-pagination
background
@size-change="(val) => handleSizeChange(val, '发布')"
......@@ -218,7 +228,7 @@ import $ from 'jquery'
import GraphGallery from '@/components/graphGallery.vue'
export default {
name: 'ArchiViewManage',
name: 'archiViewManage',
components: {
GraphGallery,
},
......@@ -267,6 +277,7 @@ export default {
addStatus: null,
graphGroup: null,
archiType: null,
loading: false
}
},
mounted() {
......@@ -468,7 +479,9 @@ export default {
viewId: this.viewId,
state: 1,
}
this.loading = true
getArchiViewManageDetail(params).then((res) => {
this.loading = false
if (res.code == 200) {
res.data.records.map((item) => {
if (item.metaModelSvg) {
......@@ -482,6 +495,8 @@ export default {
this.pager1.current = res.data.current
this.pager1.total = res.data.total
}
}).catch(() => {
this.loading = false
})
},
get_list2() {
......@@ -537,6 +552,11 @@ export default {
const params = {
viewDetailsId: item.viewDetailsId,
}
const loading = this.$loading({
lock: true,
text: '画布初始化中......',
spinner: 'el-icon-loading',
})
queryArchiViewManageCardDetails(params).then((res) => {
if (res.code == 200) {
const xmlData = res.data.metaModelData
......@@ -550,6 +570,7 @@ export default {
this.queryDrawioGraph2(id),
this.getArchiGraph(),
]).then((res2) => {
loading.close()
localStorage.setItem(
'commonGraph',
JSON.stringify({ show: true, graph: res2[0].dataEle }),
......@@ -563,13 +584,12 @@ export default {
JSON.stringify({ state: 2, graph: res2[2].dataEle }),
)
this.$router.push(
`/main/archiViewManageDetails?id=${id}&info=${this.graphGroup}&viewId=${this.viewId}&assetConstant=${this.archiType}`,
() => {},
() => {},
)
`/main/archiViewManageDetails?id=${id}&info=${this.graphGroup}&viewId=${this.viewId}&assetConstant=${this.archiType}&referenceId=${item.viewDetailsId}`)
})
}
})
}).catch(() => {
loading.close()
});
},
getArchiGraph() {
//查询综合图
......
......@@ -532,7 +532,7 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button class="greenButton" @click="save_dicy">保存</el-button>
<el-button class="greenButton" v-debounce:click="save_dicy">保存</el-button>
<el-button @click="dicy_dialog = false">取消</el-button>
</span>
</el-dialog>
......
......@@ -77,7 +77,7 @@
</div>
</div>
<div class="search_menu_btn_container">
<div class="query_btn" @click="getList">
<div class="query_btn" @click="getTable">
<img
class="btn_icon"
src="@/assets/archi-ele-list/search.png"
......@@ -193,13 +193,13 @@
width="200"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
<!-- <el-table-column
prop="relName"
label="元素关系范围"
align="center"
width="200"
:show-overflow-tooltip="true"
></el-table-column>
></el-table-column> -->
<el-table-column
prop="version"
label="版本"
......@@ -381,7 +381,7 @@
<el-table-column prop="elementName" label="元素名称" align="center"></el-table-column>
</el-table> -->
</div>
<div class="dialog_form_item">
<!-- <div class="dialog_form_item">
<div class="dialog_form_item_title">
<span class="reqIcon">*</span>元素关系范围
</div>
......@@ -392,13 +392,7 @@
v-if="title == '查看架构视图' ? false : true"
>添加</el-button
>
<!-- <el-table :data="tableData2" ref="multipleTable2" border height="195" @selection-change="handleSelectionChange2">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column type="index" label="序号" width="80" align="center"></el-table-column>
<el-table-column prop="rsName" label="元素关系名称" align="center"></el-table-column>
</el-table> -->
</div>
</div> -->
<div
style="text-align: right; margin: 20px 0 10px 0; width: 96%"
v-if="title != '新建架构视图'"
......@@ -566,7 +560,7 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button class="greenButton" @click="save_dicy">保存</el-button>
<el-button class="greenButton" v-debounce:click="save_dicy">保存</el-button>
<el-button @click="dicy_dialog = false">取消</el-button>
</span>
</el-dialog>
......@@ -1010,7 +1004,10 @@ export default {
}
})
},
getTable() {
this.params.current = 1
this.getList()
},
// 查询列表
getList() {
getJGSTPZlist(this.params).then((res) => {
......@@ -1205,10 +1202,10 @@ export default {
this.$message.error('请勾选元素范围')
return
}
if (!this.formData.relName) {
this.$message.error('请勾选元素关系范围')
return
}
// if (!this.formData.relName) {
// this.$message.error('请勾选元素关系范围')
// return
// }
this.formData.state = 2
// 赋值
......@@ -1254,10 +1251,10 @@ export default {
this.$message.error('请勾选元素范围')
return
}
if (!this.formData.relName) {
this.$message.error('请勾选元素关系范围')
return
}
// if (!this.formData.relName) {
// this.$message.error('请勾选元素关系范围')
// return
// }
this.formData.state = 1
// this.formData.eleName = this.selectData1.join(",");
// this.formData.archiEleId = this.selectData2.join(",");
......
......@@ -180,6 +180,7 @@
prop="parentElement"
label="上级元素"
align="center"
:formatter="formatParentElement"
show-overflow-tooltip
></el-table-column>
<el-table-column
......@@ -264,6 +265,14 @@
>发布</el-button
>
<el-button
icon="el-icon-remove-outline"
type="primary"
size="mini"
@click="stopItem(scope.row)"
:disabled="scope.row.state != 1"
>停用</el-button
>
<el-button
class="shanChu_btn"
icon="el-icon-delete"
size="mini"
......@@ -389,7 +398,7 @@
</el-form-item>
<el-form-item label="上级节点:" prop="let2">
<el-cascader
:disabled="is_add_edit == 'view' || !ruleForm.preArc ? true : false"
:disabled="is_add_edit == 'view' || !ruleForm.preArc && !treeSelectData.length ? true : false"
v-model="cascaderValue"
:options="treeSelectData"
filterable
......@@ -637,7 +646,7 @@ export default {
let4: 0,
let5: '显示',
let6: '',
color: '#d2edfd',
color: '',
dynamicForm0_: [],
dynamicForm_: [],
preArc: '',
......@@ -718,6 +727,9 @@ export default {
this.set_table_height()
},
methods: {
formatParentElement(row, column, cellValue, index) {
return cellValue?.replace(/\]|\[|\/?]/g, '').replace('null', '')
},
// 所属元素下拉
getArchiEleList(){
this.getZuJianLeiXingSelect(null).then((res) => {
......@@ -738,6 +750,8 @@ export default {
this.selectGraphShape = ''
this.addDialog = false
this.graphId = ''
this.treeSelectData = []
this.preArcList = []
},
getChooseSvg(svgInfo) {
this.selectGraphSrc = svgInfo.icon
......@@ -1049,7 +1063,7 @@ export default {
this.selectValue = ''
this.selectCode = ''
this.cascaderValue = [],
this.ruleForm.color = '#d2edfd'
this.ruleForm.color = ''
this.ruleForm.assetNumber = ''
this.ruleForm.preArc = ''
})
......@@ -1063,6 +1077,8 @@ export default {
this.ruleForm.let2 = row.parentAssetName
this.ruleForm.let3 = row.archiEleId
this.ruleForm.preArc = row.parentElement?.replace(/\]|\[|\/?]/g, '')
this.getShangJiJieDianSelect(this.ruleForm.preArc)
this.cascaderValue = [row.parentAssetId + '']
this.ruleForm.assetNumber = row.assetNumber
this.getZuJianLeiXingSelect(null).then((res) => {
this.zuJianLeiXingSelect = res
......@@ -1096,9 +1112,10 @@ export default {
this.ruleForm.let6 = targetAsset_id
}
console.log(2)
if (fieldsValue.length == 4) {
if (fieldsValue && fieldsValue.length == 4) {
this.ruleForm.dynamicForm_ = []
} else {
if(!fieldsValue) return
let fieldsValue_ = JSON.parse(fieldsValue)
console.log(3)
fieldsValue_.map((item) => {
......@@ -1120,6 +1137,9 @@ export default {
this.ruleForm.let3 = row.archiEleId
this.ruleForm.preArc = row.parentElement?.replace(/\]|\[|\/?]/g, '')
this.getShangJiJieDianSelect(this.ruleForm.preArc)
this.cascaderValue = [row.parentAssetId + '']
this.ruleForm.assetNumber = row.assetNumber
this.ruleForm.let4 = row.sort
this.ruleForm.let5 = row.isShow == 0 ? '显示' : '隐藏'
......@@ -1163,9 +1183,10 @@ export default {
this.ruleForm.let6 = targetAsset_id
}
if (fieldsValue.length == 4) {
if (fieldsValue && fieldsValue.length == 4) {
this.ruleForm.dynamicForm_ = []
} else {
if(!fieldsValue) return
let fieldsValue_ = JSON.parse(fieldsValue)
fieldsValue_.map((item) => {
if (item.dictKey) {
......@@ -1178,7 +1199,7 @@ export default {
}
},
handleChange(value) {
// console.log('data', data)
// console.log('value', value)
// 当选中值变化时,更新绑定的对象
let selectedObject = {}
if (value && value.length) {
......@@ -1225,12 +1246,13 @@ export default {
} else {
selectedObject = null;
}
console.log('value', value, selectedObject)
this.selectValue2 = selectedObject.assetId
this.selectLabel2 = selectedObject.assetName
this.ruleForm.let1 = selectedObject.assetName
this.$nextTick(() => {
this.$refs.form2.resetFields()
})
this.ruleForm2.let1 = selectedObject.assetName
// this.$nextTick(() => {
// this.$refs.form2.resetFields()
// })
},
handleCheckChange2(data, tree) {
//模版下载的上级节点的下拉树的勾选
......@@ -1298,6 +1320,9 @@ export default {
getPreArc({eleName: item?.elementName}).then(res => {
if(res.code === 200) {
this.preArcList = res.data
if(!this.preArcList.length) {
this.getShangJiJieDianSelect(item?.elementName)
}
}
})
},
......@@ -1453,7 +1478,7 @@ export default {
})
inpEle.click()
},
saveTemplateDialog() {
saveTemplateDialog() {console.log('this', this.ruleForm2)
//下载模版
this.$refs.form2.validate((valid) => {
if (valid) {
......@@ -1485,6 +1510,37 @@ export default {
}
})
},
stopItem(row) {
this.$confirm(`是否确认停用?`, '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
const params = {
assetId: row.assetId,
state: 0,
archiType: this.archiType,
assetNumber: row.assetNumber,
archiBelongId: row.archiBelongId
}
editZiChanJiaGouTable(params).then((res) => {
if (res.code == 200) {
this.get_table()
Message({
type: 'success',
message: '停用成功!',
})
} else {
Message({
type: 'error',
message: res.msg,
})
}
})
})
.catch(() => {})
},
releaseItem(row) {
//发布
MessageBox.confirm('确定发布?', '提示', {
......
......@@ -20,6 +20,7 @@
<!-- 表格插槽 -->
<template #tableWrap>
<table-config
v-if="showDialog"
ref="searchTable"
:query="query"
:columns="columns"
......@@ -121,6 +122,13 @@ export default {
// return row.state == '1' ? true : false
// },
},
{
title: '删除',
type: 'primary',
size: 'mini',
plain: true,
icon: 'el-icon-delete',
},
],
callback: (row, title) => {
this.fnOperation(row, title)
......@@ -167,6 +175,8 @@ export default {
case '编辑':
this.fnEdit(row)
break
case '删除':
this.fnDelete(row)
break
case 'titleChange':
this.fnEnable(row)
......@@ -174,6 +184,24 @@ export default {
break
}
},
fnDelete(row) {
this.$confirm(`是否确认删除?`, '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
this.$postRequestShared('/dictDetail/phyDel', {id: row.id}).then(res => {
if (res.code === 200) {
this.$message.success('删除成功')
this.$refs.searchTable.queryData()
} else {
this.$message.error(res.msg)
}
})
})
.catch(() => {})
},
fnEdit(row) {
this.dialogTitle = '数据字典详情修改'
this.addRowData = row
......
......@@ -115,6 +115,13 @@ export default {
type: 'primary',
plain: true,
},
{
title: '删除',
type: 'primary',
size: 'mini',
plain: true,
icon: 'el-icon-delete',
},
],
callback: (row, title) => {
this.fnOperation(row, title)
......@@ -157,12 +164,33 @@ export default {
case '维护':
this.fnMaintenance(row)
break
case '删除':
this.fnDelete(row)
break
case 'titleChange':
this.fnDisabled(row)
default:
break
}
},
fnDelete(row) {
this.$confirm(`是否确认删除?`, '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
this.$postRequestShared('/dict/phyDel', {id: row.id}).then(res => {
if (res.code === 200) {
this.$message.success('删除成功')
this.$refs.searchTable.queryData()
} else {
this.$message.error(res.msg)
}
})
})
.catch(() => {})
},
fnEdit(row) {
this.dialogTitle = '修改'
this.rowData = row
......
......@@ -53,6 +53,7 @@
save_drawio_version,
save_drawio_attribute,
} from '@/api/index.js';
import emptyView from '@/utils/emptyView'
export default {
name: 'Canvas',
components: {
......@@ -71,12 +72,14 @@
},
mounted(){
this.get_search_select1();
const id = this.$route.query.id;
const version = this.$route.query.info;
// const id = this.$route.query.id;
// const version = this.$route.query.info;
const {id, info, page, referenceId } = this.$route.query
this.routerId = {
id: id,
info: version
id,
info,
page,
referenceId
}
window.onmessage = e => {
......@@ -124,6 +127,10 @@
}
if(e.data.type == 'saveFileSignalXml') {
if(emptyView == e.data.data.mxGraphModel) {
return this.$message.warning('视图为空')
}
// console.log(emptyView == e.data.data.mxGraphModel)
MessageBox.confirm('确定保存文件?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
......
......@@ -18,6 +18,14 @@
</div>
<el-tabs v-model="activeName" type="border-card" @tab-click="tabs_click_func">
<el-tab-pane label="已发布" name="已发布">
<el-skeleton style="width: 328px;" class="m-15" :loading="loading" animated>
<template slot="template">
<el-skeleton-item
variant="image"
style="width: 328px; height: 240px;"
/>
</template>
<template>
<div class="card_container">
<div class="card_body">
<el-card class="card_item" v-for="item in yi_fa_bu" :key="item.metaModelId">
......@@ -35,6 +43,8 @@
</el-card>
</div>
</div>
</template>
</el-skeleton>
<el-pagination
background
@size-change="val => handleSizeChange(val, '已发布')"
......@@ -85,6 +95,7 @@
title="新建元模型视图"
:visible.sync="add_dialog"
:center="false"
@close="handleClose()"
width="40%">
<div class="add_dialog_content">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm">
......@@ -146,6 +157,7 @@ export default {
size: 10,
total: 0 //总条数
},
loading: false
};
},
mounted(){
......@@ -159,6 +171,9 @@ export default {
// })
},
methods: {
handleClose() {
this.ruleForm.name = ''
},
tabs_click_func(data) {
},
......@@ -231,7 +246,9 @@ export default {
pageSize: this.pager1.size,
state: 1
}
this.loading = true
get_yuan_mo_xing_list(params).then(res => {
this.loading = false
if(res.code == 200) {
res.data.records.map(item => {
if(item.metaModelSvg) {
......@@ -307,20 +324,28 @@ export default {
const params = {
metaModelId: item.metaModelId
}
const loading = this.$loading({
lock: true,
text: '画布初始化中......',
spinner: 'el-icon-loading',
})
query_yuan_mo_xing_details(params).then(res => {
if(res.code == 200) {
const xmlData = res.data.metaModelData;
const xmlTitle = res.data.verName;
localStorage.setItem('xmlData', xmlData);
localStorage.setItem('xmlTitle', xmlTitle);
localStorage.setItem('metamodelXmlData', xmlData);
localStorage.setItem('metamodelXmlTitle', xmlTitle);
// this.queryDrawioGraph(item.metaModelId),
Promise.all([ this.queryDrawioGraph2(item.metaModelId) ]).then(res2 => {
// localStorage.setItem('commonGraph', JSON.stringify({ show: false, graph: res2[0].dataEle }));
loading.close()
localStorage.setItem('commonGraph', JSON.stringify({ show: false, graph: res2[0].dataEle }));
localStorage.setItem('standardGraph', JSON.stringify({ show: true, graph: res2[0].dataEle }));
localStorage.setItem('joinGraph', JSON.stringify({ state: 1, graph: res2[0].dataEle }));
this.$router.push( `/main/metaModelListDetails?id=${item.metaModelId}&info=${item.version}`, () => {}, () => {} );
localStorage.setItem('metaModelJoinGraph', JSON.stringify({ state: 1, graph: res2[0].dataEle }));
this.$router.push( `/main/metaModelListDetails?id=${item.metaModelId}&info=${item.version}&page=metaModelListDetails&referenceId=${item.metaModelId}`);
});
}
}).catch(() => {
loading.close()
});
},
queryDrawioGraph(id) {//查询画布左侧常规图形
......
<template>
<div>
<el-dialog
:title="title"
:visible.sync="showDialog"
:close-on-click-modal="false"
width="60%"
@close="handleClose()"
@open="handleOpen()"
>
<div>
<Form ref="addForm" :form-options="formOptions" label-width="120px">
</Form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose()">取 消</el-button>
<el-button type="primary" v-preventReClick @click="handleSave()"
>保 存</el-button
>
</span></el-dialog
>
</div>
</template>
<script>
import Form from '@/components/Form.vue'
import { editOrgTreeItem } from '@/api'
import { deepClone } from '@/utils'
export default {
props: {
title: {
type: String,
default: '',
},
visible: {
type: Boolean,
default: false,
},
rowData: {
type: Object,
default: () => {},
},
orgTreeData: {
type: Array,
default: () => [],
},
},
data() {
return {}
},
components: {
Form,
},
computed: {
handleOrgTreeData() {
let arr = deepClone(this.orgTreeData)
arr.unshift({
orgName: '无',
orgId: '0',
})
return arr
},
formOptions() {
return [
{
label: '组织名称', // label文字
prop: 'orgName', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请填写组织名称', // elementui组件属性
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
maxlength: 30,
showWordLimit: true,
span: 12,
},
{
label: '组织编号', // label文字
prop: 'orgNum', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请填写组织编码', // elementui组件属性
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
maxlength: 30,
showWordLimit: true,
span: 12,
},
{
label: '上级组织', // label文字
prop: 'parentOrgId', // 字段名
element: 'el-cascader', // 指定elementui组件
placeholder: '请选择', // elementui组件属性
options: this.handleOrgTreeData,
rules: [{ required: true, trigger: 'change', message: '不能为空' }],
span: 12,
props: {
children: 'children',
label: 'orgName',
value: 'orgId',
},
filterable: true,
changeOnSelect: true,
events: {
change(data) {
console.log(data)
}
}
},
{
label: '组织简称', // label文字
prop: 'orgSimpleName', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请填写组织简称', // elementui组件属性
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
maxlength: 30,
showWordLimit: true,
span: 12,
},
{
label: '启用状态', // label文字
prop: 'orgStatus', // 字段名
element: 'el-select', // 指定elementui组件
initValue: undefined, // 字段初始值
placeholder: '请选择', // elementui组件属性
dictType: 'org_status',
span: 12,
rules: [{ required: true, trigger: 'change', message: '不能为空' }],
},
{
label: '组织类型', // label文字
prop: 'orgType', // 字段名
element: 'el-select', // 指定elementui组件
initValue: undefined, // 字段初始值
placeholder: '请选择', // elementui组件属性
dictType: 'org_type',
span: 12,
rules: [{ required: true, trigger: 'change', message: '不能为空' }],
},
{
label: '组织机构描述', // label文字
prop: 'orgDesc', // 字段名
type: 'textarea',
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
span: 24,
maxlength: 30,
showWordLimit: true,
rows: 4,
},
{
label: '排列顺序', // label文字
prop: 'orgSort', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请填写排列顺序(默认1)', // elementui组件属性
maxlength: 30,
span: 24,
},
]
},
showDialog: {
get() {
return this.visible
},
set(value) {
this.$emit('update:visible', value)
},
},
},
created() {},
methods: {
handleAddParams() {
const formInfo = this.$refs['addForm'].getData()
const params = {
...this.rowData,
...formInfo,
parentOrgId: formInfo.parentOrgId[formInfo.parentOrgId.length - 1]
}
return params
},
handleSave() {
this.$refs['addForm'].onValidate(() => {
const loading = this.$loading({
lock: true,
text: '保存中',
spinner: 'el-icon-loading',
})
editOrgTreeItem(this.handleAddParams()).then((res) => {
loading.close()
if (res.code === 200) {
this.$message.success('保存成功')
this.showDialog = false
this.handleClose()
this.$emit('querySearch')
} else {
this.$message.error(res.msg)
}
})
})
},
handleClose() {
this.showDialog = false
this.formOptions.forEach((v) => {
if(v.prop === 'parentOrgId') {
v.initValue = []
} else {
v.initValue = ''
}
})
this.$refs['addForm'].addInitValue()
this.$refs['addForm'].onReset()
},
handleOpen() {
if (Object.keys(this.rowData).length) {
this.formOptions.forEach((v) => {
if(v.prop === 'parentOrgId') {
let ids = this.rowData.ids.split(",");
ids.pop();
ids.shift();
let isdArr = [];
if (ids.length > 0) {
for (let i = 0; i < ids.length; i++) {
let item = ids[i];
if (ids.length != 0) {
isdArr.push(Number(item));
}
}
}
v.initValue = isdArr ? isdArr : [1];
if(!v.initValue.includes(this.rowData.orgId)) {
v.initValue.push(this.rowData.orgId)
}
console.log(v.initValue)
} else {
v.initValue = this.rowData[v.prop]
}
})
this.$nextTick(() => {
this.$refs['addForm'].addInitValue()
})
} else {
this.$nextTick(() => {
this.$refs['addForm'].addInitValue()
this.$refs['addForm'].onReset()
})
}
},
},
}
</script>
<style scoped lang="scss">
@import '@/styles/elementui.scss';
</style>
<!--
* @Description: 组织机构管理
* @Version: 2.0
* @Autor: pan
* @Date: 2024-04-16 15:09:52
* @LastEditors: pan
* @LastEditTime: 2024-04-16 19:33:58
-->
<template>
<div class="searchTable">
<list-page
:hasLeftTree="true"
treeTitle="组织机构"
:treeProps="treeProps"
:treeData="orgTreeData"
@node-click="treeItemClick"
>
<!-- 查询表单插槽 -->
<template #formWrap>
<SearchForm @onSearch="querySearch" :form-options="formOptions" />
</template>
<!-- 中部操作按钮 -->
<template #operationWrap>
<el-button
type="primary"
icon="el-icon-document-add"
size="medium"
plain
@click="fnTopOperation('新增')"
>新增</el-button
>
<el-button
type="primary"
icon="el-icon-edit"
size="medium"
plain
@click="fnTopOperation('编辑')"
>编辑</el-button
>
<el-button
type="danger"
icon="el-icon-delete"
size="medium"
plain
@click="fnTopOperation('删除')"
>删除</el-button
>
</template>
<!-- 表格插槽 -->
<template #tableWrap>
<table-config
ref="searchTable"
@selection-change="selectionChange"
:query="query"
:columns="columns"
id-key="orgId"
>
</table-config>
</template>
</list-page>
<Add
@querySearch="handleUpdate"
:visible.sync="visible"
:row-data="rowData"
:title="dialogTitle"
:orgTreeData="orgTreeData"
></Add>
</div>
</template>
<script>
import ListPage from '@/components/ListPage.vue'
import SearchForm from '@/components/SearchForm.vue'
import TableConfig from '@/components/TableConfig.vue'
import Add from './Add.vue'
import { queryOrganizationManagement } from '@/api/interface'
import { getDictTypeOptions } from '@/utils'
import {
getOrgTreeData,
delOrgTreeItem,
batchDeleteOrgTreeItem,
} from '@/api/index'
export default {
name: 'organizationManagement',
components: {
ListPage,
SearchForm,
TableConfig,
Add,
},
data() {
return {
selectRows: [],
query: {
url: queryOrganizationManagement,
method: 'post',
queryParam: {},
},
orgStatusOptions: [],
orgTreeData: [],
treeProps: {
children: 'children',
label: 'orgName',
value: 'orgId',
},
visible: false,
rowData: {},
dialogTitle: '',
}
},
computed: {
formOptions() {
return [
{
label: '组织名称', // label文字
prop: 'orgName', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请输入', // elementui组件属性
},
]
},
columns() {
return [
{ type: 'selection', width: '55px' },
{ label: '序号', type: 'index', width: '80px' },
{
label: '组织名称',
prop: 'orgName',
},
{ label: '组织简称', prop: 'orgSimpleName' },
{
label: '启用状态',
prop: 'orgStatus',
options: this.orgStatusOptions,
collectionType: true,
width: '120px',
},
{ label: '创建人', width: '120px', prop: 'createMan' },
{
label: '操作',
type: 'operation',
width: '200px',
actionButtons: [
{
title: '编辑',
type: 'primary',
size: 'mini',
plain: true,
icon: 'el-icon-edit',
},
{
title: '删除',
type: 'danger',
size: 'mini',
plain: true,
icon: 'el-icon-delete',
},
],
callback: (row, title) => {
this.fnOperation(row, title)
},
},
]
},
},
created() {
this.getDicts()
this.getOrgTreeData()
},
methods: {
handleUpdate() {
this.querySearch()
this.getOrgTreeData()
},
treeItemClick(data) {
console.log('data', data)
if(!data.children) {
this.query.queryParam.parentOrgId = data.orgId
this.querySearch()
}
},
fnTopOperation(type) {
switch (type) {
case '新增':
this.dialogTitle = '新增组织'
this.rowData = {}
this.visible = true
break
case '编辑':
if (this.selectRows.length != 1) {
return this.$message.warning('选择一项进行编辑')
}
this.rowData = this.selectRow[0]
this.dialogTitle = '编辑组织'
this.visible = true
break
case '删除':
if (this.selectRows.length == 0) {
return this.$message.warning('请选择需要删除项')
}
this.fnDel()
break
default:
break
}
},
getDicts() {
getDictTypeOptions('org_status').then((res) => {
this.orgStatusOptions = res
})
},
getOrgTreeData() {
getOrgTreeData({}).then((res) => {
if (res.code === 200) {
this.orgTreeData = res.data
}
})
},
// 表格勾选的数据
selectionChange(data) {
this.selectRows = data
},
querySearch(data) {
this.query.queryParam = {
...this.query.queryParam,
...data,
}
this.$refs.searchTable.queryData()
},
fnOperation(row, title) {
switch (title) {
case '编辑':
this.fnEdit(row)
break
case '删除':
this.fnDel(row)
break
default:
break
}
},
fnEdit(row) {
this.rowData = row
this.dialogTitle = '编辑组织'
this.visible = true
},
fnDel(row) {
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
let [params, delApi] = [{}, null]
if(row) {
params = {
orgId: row.orgId,
}
delApi = delOrgTreeItem
} else {
params = this.selectRows.map(v => Number(v.orgId))
delApi = batchDeleteOrgTreeItem
}
delApi(params).then((res) => {
if (res.code === 200) {
this.$message.success('删除成功')
this.$refs.searchTable.queryData()
} else {
this.$message.error('删除失败')
}
})
})
.catch(() => {})
},
},
}
</script>
<style scoped lang="scss">
@import '@/styles/common.scss';
</style>
......@@ -4,7 +4,7 @@
<div class="search_menu">
<div class="search_menu_item_container">
<div class="search_menu_item">
<span class="search_title">单位</span>
<span class="search_title">组织单位</span>
<!-- <el-input
v-no-backslash
v-model="searchParams.let1"
......@@ -16,6 +16,7 @@
v-model="searchParams.let1"
placeholder="请选择"
class="search_item"
filterable
>
<el-option
v-for="item in sysOrgOptions"
......@@ -26,7 +27,7 @@
</el-select>
</div>
<div class="search_menu_item">
<span class="search_title">部门</span>
<span class="search_title">业务部门</span>
<!-- <el-input
v-no-backslash
v-model="searchParams.let2"
......@@ -35,6 +36,7 @@
class="search_item"
></el-input> -->
<el-select
filterable
v-model="searchParams.let2"
placeholder="请选择"
class="search_item"
......@@ -119,7 +121,7 @@
></el-table-column>
<el-table-column
prop="manageOrgId"
label="单位"
label="建设单位"
align="center"
width="160"
:formatter="
......@@ -129,7 +131,7 @@
></el-table-column>
<el-table-column
prop="manageDeptId"
label="部门"
label="业务部门"
align="center"
:formatter="
(row, column, cellValue, index) =>
......@@ -699,6 +701,8 @@ import {
querysystemInfoManageTable,
addProjectManageTable,
getPrjInfoDetail,
getDeptOption,
getOrgOption
} from '@/api/index.js'
import { MessageBox, Message } from 'element-ui'
import $ from 'jquery'
......@@ -819,11 +823,25 @@ export default {
}
})
})
getDictTypeOptions('sys_org').then((res) => {
this.sysOrgOptions = res
getDeptOption().then(res => {
if(res.code === 200) {
this.sysDeptOptions = res.data.map(v => {
return {
label: v.orgName,
value: v.orgId
}
})
}
})
getOrgOption().then(res => {
if(res.code === 200) {
this.sysOrgOptions = res.data.map(v => {
return {
label: v.orgName,
value: v.orgId
}
})
getDictTypeOptions('sys_dept').then((res) => {
this.sysDeptOptions = res
}
})
},
openDetail(row) {
......
......@@ -4,7 +4,7 @@
<div class="search_menu">
<div class="search_menu_item_container">
<div class="search_menu_item">
<span class="search_title">单位</span>
<span class="search_title">组织单位</span>
<!-- <el-input
v-no-backslash
v-model="searchParams.let1"
......@@ -16,6 +16,7 @@
v-model="searchParams.let1"
placeholder="请选择"
class="search_item"
filterable
>
<el-option
v-for="item in sysOrgOptions"
......@@ -26,7 +27,7 @@
</el-select>
</div>
<div class="search_menu_item">
<span class="search_title">部门</span>
<span class="search_title">业务部门</span>
<!-- <el-input
v-no-backslash
v-model="searchParams.let2"
......@@ -35,6 +36,7 @@
class="search_item"
></el-input> -->
<el-select
filterable
v-model="searchParams.let2"
placeholder="请选择"
class="search_item"
......@@ -119,7 +121,7 @@
></el-table-column>
<el-table-column
prop="manageOrgId"
label="单位"
label="建设单位"
align="center"
:formatter="
(row, column, cellValue, index) =>
......@@ -129,7 +131,7 @@
</el-table-column>
<el-table-column
prop="manageDeptId"
label="部门"
label="业务部门"
align="center"
:formatter="
(row, column, cellValue, index) =>
......@@ -332,6 +334,8 @@ import {
getDianXingAnLiSelectData,
addasystemInfoManageTable,
editDeleteSystemInfoManageTable,
getDeptOption,
getOrgOption
} from '@/api/index.js'
import { MessageBox, Message } from 'element-ui'
import { getDictTypeOptions } from '@/utils'
......@@ -409,11 +413,25 @@ export default {
return obj.label
},
getDicts() {
getDictTypeOptions('sys_org').then((res) => {
this.sysOrgOptions = res
getDeptOption().then(res => {
if(res.code === 200) {
this.sysDeptOptions = res.data.map(v => {
return {
label: v.orgName,
value: v.orgId
}
})
}
})
getDictTypeOptions('sys_dept').then((res) => {
this.sysDeptOptions = res
getOrgOption().then(res => {
if(res.code === 200) {
this.sysOrgOptions = res.data.map(v => {
return {
label: v.orgName,
value: v.orgId
}
})
}
})
getDictTypeOptions('sys_build_org').then((res) => {
this.sysBuildOrgOptions = res
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!