Commit 654dbec3 by 史敦盼

画布右侧属性面板修改,资产问题修复

1 parent 2e1b8dc7
......@@ -88,9 +88,47 @@ const initAttributePanel = function(that) {
// button_container.appendChild(save_button);
// that.container.appendChild(button_container);
// 二次开发-添加元素基本信息
const infoContain = document.createElement('div');
infoContain.style.cssText = 'display: flex;flex-direction: column;width: 100%;border-bottom: 1px dashed #ccc;padding: 10px;box-sizing: border-box;';
if(urlParams.page === 'metaModelListDetails') {
let titleDom = document.createElement('div');
titleDom.style.cssText = 'font-weight: bold;margin-bottom: 4px;';
titleDom.innerHTML = '元素基本信息';
infoContain.appendChild(titleDom)
that.container.appendChild(infoContain);
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, item.name, item.value)
})
}
}
// 添加基本信息方法
function fnAddInfoItem(that, name, value) {
const infoItemContain = document.createElement('div');
infoItemContain.style.cssText = 'display: flex;padding: 4px 0';
const nameSpan = document.createElement('span');
nameSpan.innerHTML = name + ': ';
nameSpan.style.cssText = 'margin-right: 10px;width: 60px;text-align: right;flex-shrink: 0;'
const valueSpan = document.createElement('span');
valueSpan.style.cssText = 'white-space: normal;'
valueSpan.innerHTML = value
infoItemContain.appendChild(nameSpan);
infoItemContain.appendChild(valueSpan);
infoContain.appendChild(infoItemContain);
}
// 添加属性信息
if(propertyList.length > 0) {
let propertyTitleDom = document.createElement('div');
propertyTitleDom.style.cssText = 'font-weight: bold;padding-left: 10px;padding-top: 10px;';
propertyTitleDom.innerHTML = '属性信息';
that.container.appendChild(propertyTitleDom);
propertyList.forEach(item => {
addListPanel(that, propertyList, item.name, item.value, item.controlType);
})
......@@ -129,7 +167,7 @@ const initAttributePanel = function(that) {
}
const addListPanel = function(that, originAttr, attrName_, attrValue_, controlType) {
const add_item_container = document.createElement('div');
add_item_container.style.cssText = 'display: flex;justify-content: space-between;padding: 4px;';
add_item_container.style.cssText = 'display: flex;justify-content: space-between;padding: 10px;';
add_item_container.className = 'add_item_container';
......
......@@ -82,10 +82,24 @@
)
}
})
let info__ = [{
name: '元素名称',
value: item2.eleName
},{
name: '定义',
value: item2.definition
},{
name: '引用关系',
value: item2.referenceRelationship
},{
name: '示例',
value: item2.example
}];
fns.push(
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.iconName + ';attr=' + JSON.stringify(attr_) + ';info__=' + JSON.stringify(info__),
item2.shapeWidth ? item2.shapeWidth : 71,
item2.shapeHeight ? item2.shapeHeight : 41,
null,
......@@ -144,7 +158,7 @@
fns.push(
this.createVertexTemplateEntry(
// 'html=1;outlineConnect=0;whiteSpace=wrap;fillColor=#99ffff;shape=mxgraph.archimate3.application;appType=rightTopTriangle;archiType=rounded',
item3.iconName + ';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_) + ';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,
......
......@@ -670,7 +670,7 @@
</el-dialog>
<el-dialog
:title="is_add_edit == 'add' ? '新建资产' : '编辑资产'"
:title="getDialogTitle"
:visible.sync="add_dialog3"
:center="false"
:close-on-click-modal="false"
......@@ -812,6 +812,7 @@
<template v-if="item.controlType == 0">
<el-input
placeholder="请输入内容"
:disabled="is_add_edit == 'view' ? true : false"
v-no-backslash
v-model="item.value_"
maxlength="100"
......@@ -820,6 +821,7 @@
<template v-else-if="item.controlType == 1">
<el-input
placeholder="请输入内容"
:disabled="is_add_edit == 'view' ? true : false"
v-no-backslash
v-model="item.value_"
type="textarea"
......@@ -833,6 +835,7 @@
class="selectComponent"
v-model="item.value_"
clearable
:disabled="is_add_edit == 'view' ? true : false"
>
<el-option
v-for="item2 in item.dictArray_"
......@@ -1052,6 +1055,15 @@ export default {
sysDeptOptions: [],
}
},
computed: {
getDialogTitle() {
return this.is_add_edit == 'add'
? '新建资产'
: this.is_add_edit == 'edit'
? '编辑资产'
: '查看资产'
}
},
mounted() {
window.addEventListener('resize', () => {
this.set_table_height()
......@@ -1135,7 +1147,7 @@ export default {
this.selectValue = selectedObject.assetId
this.selectLabel = selectedObject.assetName
this.selectCode = selectedObject.assetCode
this.ruleForm.sort = selectedObject.assetName
this.ruleForm.parentAssetName = selectedObject.assetName
},
findObjectById(items, id) {
for (let i = 0; i < items.length; i++) {
......
......@@ -127,7 +127,7 @@
<img class="btn_icon" src="@/assets/tech-politics-fabric/export.png" alt="" />
<p>导出</p>
</div> -->
<div
<!-- <div
class="import_btn"
@click="openDownloadTemplateDialog"
style="margin-left: 0; width: 100px"
......@@ -138,7 +138,7 @@
alt=""
/>
<p>模版下载</p>
</div>
</div> -->
</div>
<el-table
:height="tableHeight"
......@@ -435,7 +435,7 @@
</div>
</div>
</div>
<el-form-item
<!-- <el-form-item
class="dynamicFormClass"
v-for="(item, index) in ruleForm.dynamicForm0_"
:key="index"
......@@ -448,7 +448,7 @@
v-model="item.relaName"
maxlength="100"
></el-input>
</el-form-item>
</el-form-item> -->
<el-form-item
class="dynamicFormClass"
v-for="(item, index) in ruleForm.dynamicForm_"
......@@ -1074,19 +1074,19 @@ export default {
this.selectGraphSrc = row.icon
this.selectGraphShape = row.iconName
let targetAsset_id = []
if (targetAsset) {
if (targetAsset.length == 4) {
this.ruleForm.dynamicForm0_ = []
} else {
let targetAsset_ = JSON.parse(targetAsset)
this.ruleForm.dynamicForm0_ = targetAsset_
// if (targetAsset) {
// if (targetAsset.length == 4) {
// this.ruleForm.dynamicForm0_ = []
// } else {
// let targetAsset_ = JSON.parse(targetAsset)
// this.ruleForm.dynamicForm0_ = targetAsset_
targetAsset_.forEach((item) => {
targetAsset_id.push(item.assetId)
})
}
this.ruleForm.let6 = targetAsset_id
}
// targetAsset_.forEach((item) => {
// targetAsset_id.push(item.assetId)
// })
// }
// this.ruleForm.let6 = targetAsset_id
// }
console.log(2)
if (fieldsValue && fieldsValue.length == 4) {
this.ruleForm.dynamicForm_ = []
......@@ -1172,6 +1172,7 @@ export default {
}
})
this.ruleForm.dynamicForm_ = fieldsValue_
console.log('dynamicForm_', this.ruleForm.dynamicForm_)
}
},
handleChange(value) {
......@@ -1321,31 +1322,31 @@ export default {
} else {
this.disabled1 = false
}
if (data) {
const params = {
type: '1',
typeId: data,
}
queryZuJianLeiXingBelongForm(params).then((res) => {
if (res.code == 200) {
if (res.data.length > 0) {
res.data.map((item) => {
if (item.controlType == 2) {
this.get_key(item.dictKey).then((res2) => {
this.$set(item, 'dictArray_', res2)
})
}
item['value_'] = ''
})
this.ruleForm.dynamicForm_ = res.data
} else {
this.ruleForm.dynamicForm_ = []
}
}
})
} else {
this.ruleForm.dynamicForm_ = []
}
// if (data) {
// const params = {
// type: '1',
// typeId: data,
// }
// queryZuJianLeiXingBelongForm(params).then((res) => {
// if (res.code == 200) {
// if (res.data.length > 0) {
// res.data.map((item) => {
// if (item.controlType == 2) {
// this.get_key(item.dictKey).then((res2) => {
// this.$set(item, 'dictArray_', res2)
// })
// }
// item['value_'] = ''
// })
// this.ruleForm.dynamicForm_ = res.data
// } else {
// this.ruleForm.dynamicForm_ = []
// }
// }
// })
// } else {
// this.ruleForm.dynamicForm_ = []
// }
},
queryZuJianLeiXingSelect(data) {
//所属元素搜索
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!