Commit a874dd7e by 史敦盼

架构视图属性修改,架构视图管理修改

1 parent 44be0b50
...@@ -103,14 +103,12 @@ const initAttributePanel = function(that) { ...@@ -103,14 +103,12 @@ const initAttributePanel = function(that) {
let stringAttr = haveAttrString[0].split('info__=')[1]; let stringAttr = haveAttrString[0].split('info__=')[1];
infoList = JSON.parse(stringAttr); infoList = JSON.parse(stringAttr);
infoList.forEach(item => { infoList.forEach(item => {
fnAddInfoItem(that, item.name, item.value) fnAddInfoItem(infoContain, item.name, item.value)
}) })
} }
} }
// 添加基本信息方法 // 添加基本信息方法
function fnAddInfoItem(that, name, value) { function fnAddInfoItem(contain, name, value) {
const infoItemContain = document.createElement('div'); const infoItemContain = document.createElement('div');
infoItemContain.style.cssText = 'display: flex;padding: 4px 0'; infoItemContain.style.cssText = 'display: flex;padding: 4px 0';
const nameSpan = document.createElement('span'); const nameSpan = document.createElement('span');
...@@ -121,18 +119,66 @@ const initAttributePanel = function(that) { ...@@ -121,18 +119,66 @@ const initAttributePanel = function(that) {
valueSpan.innerHTML = value valueSpan.innerHTML = value
infoItemContain.appendChild(nameSpan); infoItemContain.appendChild(nameSpan);
infoItemContain.appendChild(valueSpan); infoItemContain.appendChild(valueSpan);
infoContain.appendChild(infoItemContain); contain.appendChild(infoItemContain);
} }
// 添加属性信息 // 添加属性信息
if(propertyList.length > 0) { if(propertyList.length > 0) {
if(urlParams.page === 'metaModelListDetails') {
let propertyTitleDom = document.createElement('div'); let propertyTitleDom = document.createElement('div');
propertyTitleDom.style.cssText = 'font-weight: bold;padding-left: 10px;padding-top: 10px;'; propertyTitleDom.style.cssText = 'font-weight: bold;padding-left: 10px;padding-top: 10px;';
propertyTitleDom.innerHTML = '属性信息'; propertyTitleDom.innerHTML = '属性信息';
that.container.appendChild(propertyTitleDom); that.container.appendChild(propertyTitleDom);
var table = document.createElement("table");
table.style.borderCollapse = 'collapse'; // 边框合并
table.style.whiteSpace = 'normal'; // 边框合并
const tableColumn = ['属性名称', '属性类型', '值选项']
for (var i = 0; i < propertyList.length; i++) {
var row = document.createElement("tr");
row.style.border = '1px solid black'; // 设置行边框
console.log('propertyList[i]', propertyList[i])
// 创建表格单元格
for (var j = 0; j < tableColumn.length; j++) {
var cellT = document.createElement("td");
cellT.style.cssText = 'text-align: left;';
cellT.style.border = '1px solid black';
if(i === 0) {
cellT.textContent = tableColumn[j]
} else {
// 设置单元格内容
if(j === 0) {
cellT.textContent = propertyList[i].name;
} else if(j === 1) {
cellT.textContent = propertyList[i].dataType;
} else if(j === 2) {
cellT.textContent = propertyList[i].dictKey
}
}
// 将单元格添加到行
row.appendChild(cellT);
}
// 将行添加到表格
table.appendChild(row);
}
that.container.appendChild(table);
} else {
if(urlParams.page === 'archiViewManageDetails') {
if(cell.style.includes('info__=')) {//属性列表
let infoList = []
let haveAttrString = cell.style.match(/info__=\[[^\]]*\]/);
let stringAttr = haveAttrString[0].split('info__=')[1];
infoList = JSON.parse(stringAttr);
infoList.forEach(item => {
fnAddInfoItem(that.container, item.name, item.value)
})
}
}
propertyList.forEach(item => { propertyList.forEach(item => {
addListPanel(that, propertyList, item.name, item.value, item.controlType); addListPanel(that, propertyList, item.name, item.value, item.controlType);
}) })
} }
}
// let currentNode = graph.getModel().getValue(cell);//获取没有属性的节点,返回的是文字 // let currentNode = graph.getModel().getValue(cell);//获取没有属性的节点,返回的是文字
// if(currentNode) { // if(currentNode) {
...@@ -167,16 +213,16 @@ const initAttributePanel = function(that) { ...@@ -167,16 +213,16 @@ const initAttributePanel = function(that) {
} }
const addListPanel = function(that, originAttr, attrName_, attrValue_, controlType) { const addListPanel = function(that, originAttr, attrName_, attrValue_, controlType) {
const add_item_container = document.createElement('div'); const add_item_container = document.createElement('div');
add_item_container.style.cssText = 'display: flex;justify-content: space-between;padding: 10px;'; add_item_container.style.cssText = 'display: flex;justify-content: space-between;padding: 4px 10px;';
add_item_container.className = 'add_item_container'; add_item_container.className = 'add_item_container';
//属性名-------------------------------------------------------------------- //属性名--------------------------------------------------------------------
const item_left_container = document.createElement('div'); const item_left_container = document.createElement('div');
item_left_container.style.cssText = 'display: flex;width: 100%;'; item_left_container.style.cssText = 'display: flex;width: 100%;';
const item_left_span = document.createElement('span'); const item_left_span = document.createElement('span');
item_left_span.innerHTML = attrName_;// + ': '; item_left_span.innerHTML = attrName_ + ': ';
// const item_left_input = document.createElement('input'); // const item_left_input = document.createElement('input');
// item_left_input.type = "text"; // item_left_input.type = "text";
...@@ -197,6 +243,11 @@ const addListPanel = function(that, originAttr, attrName_, attrValue_, controlTy ...@@ -197,6 +243,11 @@ const addListPanel = function(that, originAttr, attrName_, attrValue_, controlTy
const item_right_container = document.createElement('div'); const item_right_container = document.createElement('div');
item_right_container.style.cssText = 'margin-right: 15px;;margin-left: 5px;display: flex;justify-content: space-between;width: 70%;'; item_right_container.style.cssText = 'margin-right: 15px;;margin-left: 5px;display: flex;justify-content: space-between;width: 70%;';
const valueSpan = document.createElement('span');
valueSpan.style.cssText = 'white-space: normal;'
valueSpan.innerHTML = attrValue_
item_right_container.appendChild(valueSpan);
// const item_right_span = document.createElement('span'); // const item_right_span = document.createElement('span');
// item_right_span.innerHTML = '属性值: '; // item_right_span.innerHTML = '属性值: ';
......
...@@ -78,22 +78,24 @@ ...@@ -78,22 +78,24 @@
value: res.propertyValue, value: res.propertyValue,
id: res.propertyId, id: res.propertyId,
controlType: res.controlType, controlType: res.controlType,
dataType: res.dataType,
dictKey: res.dictKey,
} }
) )
} }
}) })
let info__ = [{ let info__ = [{
name: '元素名称', name: '元素名称',
value: item2.eleName value: item2.eleName || ''
},{ },{
name: '定义', name: '定义',
value: item2.definition value: item2.definition || ''
},{ },{
name: '引用关系', name: '引用关系',
value: item2.referenceRelationship value: item2.referenceRelationship || ''
},{ },{
name: '示例', name: '示例',
value: item2.example value: item2.example || ''
}]; }];
fns.push( fns.push(
...@@ -154,11 +156,27 @@ ...@@ -154,11 +156,27 @@
}) })
item2.assets.forEach(item3 => { item2.assets.forEach(item3 => {
let info__ = [{
name: '资产名称',
value: item3.assetName || ''
},{
name: '资产编号',
value: item3.assetNumber || ''
},{
name: '所属元素',
value: item3.eleName || ''
},{
name: '上级元素',
value: item3.parentElement || ''
},{
name: '上级资产',
value: item3.parentAssetName || ''
}];
// console.log(item3.fieldsValue) // console.log(item3.fieldsValue)
fns.push( fns.push(
this.createVertexTemplateEntry( this.createVertexTemplateEntry(
// 'html=1;outlineConnect=0;whiteSpace=wrap;fillColor=#99ffff;shape=mxgraph.archimate3.application;appType=rightTopTriangle;archiType=rounded', // 'html=1;outlineConnect=0;whiteSpace=wrap;fillColor=#99ffff;shape=mxgraph.archimate3.application;appType=rightTopTriangle;archiType=rounded',
item3.iconName + (item3.color ? `;fillColor=${item3.color};` : '')+ 'attr=' + JSON.stringify(attr_) + ';assetId=' + item3.assetId + ';archiBelongId=' + item3.archiBelongId + ';assetName=[' + item3.assetName + '];eleName=' + item2.eleName +';elementId=' + item2.elementId + ';eaLevel=' + item2.eaLevel + ';', item3.iconName + (item3.color ? `;fillColor=${item3.color};` : '') + 'attr=' + JSON.stringify(attr_) + ';info__=' + JSON.stringify(info__) + ';assetId=' + item3.assetId + ';archiBelongId=' + item3.archiBelongId + ';assetName=[' + item3.assetName + '];eleName=' + item2.eleName +';elementId=' + item2.elementId + ';eaLevel=' + item2.eaLevel + ';',
item2.shapeWidth ? item2.shapeWidth : 150, item2.shapeWidth ? item2.shapeWidth : 150,
item2.shapeHeight ? item2.shapeHeight : 75, item2.shapeHeight ? item2.shapeHeight : 75,
null, null,
......
...@@ -100,11 +100,12 @@ ...@@ -100,11 +100,12 @@
// const id = this.$route.query.id; // const id = this.$route.query.id;
// const graphGroup = this.$route.query.info; // const graphGroup = this.$route.query.info;
const { id, info, referenceId } = this.$route.query const { id, info, referenceId, page } = this.$route.query
this.routerId = { this.routerId = {
id: id, id: id,
info, info,
referenceId referenceId,
page
} }
window.onmessage = e => { window.onmessage = e => {
......
...@@ -584,7 +584,7 @@ export default { ...@@ -584,7 +584,7 @@ export default {
JSON.stringify({ state: 2, graph: res2[2].dataEle }), JSON.stringify({ state: 2, graph: res2[2].dataEle }),
) )
this.$router.push( this.$router.push(
`/main/archiViewManageDetails?id=${id}&info=${this.graphGroup}&viewId=${this.viewId}&assetConstant=${this.archiType}&referenceId=${item.viewDetailsId}`) `/main/archiViewManageDetails?id=${id}&info=${this.graphGroup}&viewId=${this.viewId}&assetConstant=${this.archiType}&referenceId=${item.viewDetailsId}&page=archiViewManageDetails`)
}) })
} }
}).catch(() => { }).catch(() => {
......
...@@ -1059,7 +1059,7 @@ export default { ...@@ -1059,7 +1059,7 @@ export default {
this.getZuJianLeiXingSelect(null).then((res) => { this.getZuJianLeiXingSelect(null).then((res) => {
this.zuJianLeiXingSelect = res this.zuJianLeiXingSelect = res
if(this.ruleForm.let3) { if(this.ruleForm.let3) {
this.zuJianLeiXingSelectChange(this.ruleForm.let3) this.zuJianLeiXingSelectChange(this.ruleForm.let3, true)
} }
}) })
this.ruleForm.let4 = row.sort this.ruleForm.let4 = row.sort
...@@ -1135,7 +1135,7 @@ export default { ...@@ -1135,7 +1135,7 @@ export default {
(item) => item.elementId == this.ruleForm.let3, (item) => item.elementId == this.ruleForm.let3,
) )
if(this.ruleForm.let3) { if(this.ruleForm.let3) {
this.zuJianLeiXingSelectChange(this.ruleForm.let3) this.zuJianLeiXingSelectChange(this.ruleForm.let3, true)
} }
if (currentItem && currentItem.eaLevel == 1) { if (currentItem && currentItem.eaLevel == 1) {
this.disabled1 = true this.disabled1 = true
...@@ -1307,7 +1307,7 @@ export default { ...@@ -1307,7 +1307,7 @@ export default {
this.getShangJiJieDianSelect(data) this.getShangJiJieDianSelect(data)
}, },
zuJianLeiXingSelectChange(data) { zuJianLeiXingSelectChange(data, flag) {
//所属元素选择后 //所属元素选择后
// console.log(data) // console.log(data)
...@@ -1322,31 +1322,33 @@ export default { ...@@ -1322,31 +1322,33 @@ export default {
} else { } else {
this.disabled1 = false this.disabled1 = false
} }
// if (data) { if (data && !flag) {console.log('------')
// const params = { const params = {
// type: '1', type: '1',
// typeId: data, typeId: data,
// } }
// queryZuJianLeiXingBelongForm(params).then((res) => { queryZuJianLeiXingBelongForm(params).then((res) => {
// if (res.code == 200) { if (res.code == 200) {
// if (res.data.length > 0) { if (res.data.length > 0) {
// res.data.map((item) => { res.data.map((item) => {
// if (item.controlType == 2) { if (item.controlType == 2) {
// this.get_key(item.dictKey).then((res2) => { this.get_key(item.dictKey).then((res2) => {
// this.$set(item, 'dictArray_', res2) this.$set(item, 'dictArray_', res2)
// }) })
// } }
// item['value_'] = '' item['value_'] = ''
// }) })
// this.ruleForm.dynamicForm_ = res.data this.ruleForm.dynamicForm_ = res.data
// } else { } else {
// this.ruleForm.dynamicForm_ = [] this.ruleForm.dynamicForm_ = []
// } }
// } }
// }) })
// } else { } else {
// this.ruleForm.dynamicForm_ = [] if(!flag) {
// } this.ruleForm.dynamicForm_ = []
}
}
}, },
queryZuJianLeiXingSelect(data) { queryZuJianLeiXingSelect(data) {
//所属元素搜索 //所属元素搜索
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!