Commit 654dbec3 by 史敦盼

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

1 parent 2e1b8dc7
...@@ -88,9 +88,47 @@ const initAttributePanel = function(that) { ...@@ -88,9 +88,47 @@ const initAttributePanel = function(that) {
// button_container.appendChild(save_button); // button_container.appendChild(save_button);
// that.container.appendChild(button_container); // 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) { 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 => { propertyList.forEach(item => {
addListPanel(that, propertyList, item.name, item.value, item.controlType); addListPanel(that, propertyList, item.name, item.value, item.controlType);
}) })
...@@ -129,10 +167,10 @@ const initAttributePanel = function(that) { ...@@ -129,10 +167,10 @@ 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: 4px;'; add_item_container.style.cssText = 'display: flex;justify-content: space-between;padding: 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%;';
......
...@@ -82,10 +82,24 @@ ...@@ -82,10 +82,24 @@
) )
} }
}) })
let info__ = [{
name: '元素名称',
value: item2.eleName
},{
name: '定义',
value: item2.definition
},{
name: '引用关系',
value: item2.referenceRelationship
},{
name: '示例',
value: item2.example
}];
fns.push( fns.push(
this.createVertexTemplateEntry( this.createVertexTemplateEntry(
// 'html=1;outlineConnect=0;whiteSpace=wrap;fillColor=#d2edfd;shape=mxgraph.archimate3.application;appType=rightTopCircleHasLeft;archiType=rounded', // '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.shapeWidth ? item2.shapeWidth : 71,
item2.shapeHeight ? item2.shapeHeight : 41, item2.shapeHeight ? item2.shapeHeight : 41,
null, null,
...@@ -144,7 +158,7 @@ ...@@ -144,7 +158,7 @@
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 + ';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.shapeWidth ? item2.shapeWidth : 150,
item2.shapeHeight ? item2.shapeHeight : 75, item2.shapeHeight ? item2.shapeHeight : 75,
null, null,
......
...@@ -670,7 +670,7 @@ ...@@ -670,7 +670,7 @@
</el-dialog> </el-dialog>
<el-dialog <el-dialog
:title="is_add_edit == 'add' ? '新建资产' : '编辑资产'" :title="getDialogTitle"
:visible.sync="add_dialog3" :visible.sync="add_dialog3"
:center="false" :center="false"
:close-on-click-modal="false" :close-on-click-modal="false"
...@@ -812,6 +812,7 @@ ...@@ -812,6 +812,7 @@
<template v-if="item.controlType == 0"> <template v-if="item.controlType == 0">
<el-input <el-input
placeholder="请输入内容" placeholder="请输入内容"
:disabled="is_add_edit == 'view' ? true : false"
v-no-backslash v-no-backslash
v-model="item.value_" v-model="item.value_"
maxlength="100" maxlength="100"
...@@ -820,6 +821,7 @@ ...@@ -820,6 +821,7 @@
<template v-else-if="item.controlType == 1"> <template v-else-if="item.controlType == 1">
<el-input <el-input
placeholder="请输入内容" placeholder="请输入内容"
:disabled="is_add_edit == 'view' ? true : false"
v-no-backslash v-no-backslash
v-model="item.value_" v-model="item.value_"
type="textarea" type="textarea"
...@@ -833,6 +835,7 @@ ...@@ -833,6 +835,7 @@
class="selectComponent" class="selectComponent"
v-model="item.value_" v-model="item.value_"
clearable clearable
:disabled="is_add_edit == 'view' ? true : false"
> >
<el-option <el-option
v-for="item2 in item.dictArray_" v-for="item2 in item.dictArray_"
...@@ -1052,6 +1055,15 @@ export default { ...@@ -1052,6 +1055,15 @@ export default {
sysDeptOptions: [], sysDeptOptions: [],
} }
}, },
computed: {
getDialogTitle() {
return this.is_add_edit == 'add'
? '新建资产'
: this.is_add_edit == 'edit'
? '编辑资产'
: '查看资产'
}
},
mounted() { mounted() {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.set_table_height() this.set_table_height()
...@@ -1135,7 +1147,7 @@ export default { ...@@ -1135,7 +1147,7 @@ export default {
this.selectValue = selectedObject.assetId this.selectValue = selectedObject.assetId
this.selectLabel = selectedObject.assetName this.selectLabel = selectedObject.assetName
this.selectCode = selectedObject.assetCode this.selectCode = selectedObject.assetCode
this.ruleForm.sort = selectedObject.assetName this.ruleForm.parentAssetName = selectedObject.assetName
}, },
findObjectById(items, id) { findObjectById(items, id) {
for (let i = 0; i < items.length; i++) { for (let i = 0; i < items.length; i++) {
......
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<img class="btn_icon" src="@/assets/tech-politics-fabric/export.png" alt="" /> <img class="btn_icon" src="@/assets/tech-politics-fabric/export.png" alt="" />
<p>导出</p> <p>导出</p>
</div> --> </div> -->
<div <!-- <div
class="import_btn" class="import_btn"
@click="openDownloadTemplateDialog" @click="openDownloadTemplateDialog"
style="margin-left: 0; width: 100px" style="margin-left: 0; width: 100px"
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
alt="" alt=""
/> />
<p>模版下载</p> <p>模版下载</p>
</div> </div> -->
</div> </div>
<el-table <el-table
:height="tableHeight" :height="tableHeight"
...@@ -435,7 +435,7 @@ ...@@ -435,7 +435,7 @@
</div> </div>
</div> </div>
</div> </div>
<el-form-item <!-- <el-form-item
class="dynamicFormClass" class="dynamicFormClass"
v-for="(item, index) in ruleForm.dynamicForm0_" v-for="(item, index) in ruleForm.dynamicForm0_"
:key="index" :key="index"
...@@ -448,7 +448,7 @@ ...@@ -448,7 +448,7 @@
v-model="item.relaName" v-model="item.relaName"
maxlength="100" maxlength="100"
></el-input> ></el-input>
</el-form-item> </el-form-item> -->
<el-form-item <el-form-item
class="dynamicFormClass" class="dynamicFormClass"
v-for="(item, index) in ruleForm.dynamicForm_" v-for="(item, index) in ruleForm.dynamicForm_"
...@@ -1074,19 +1074,19 @@ export default { ...@@ -1074,19 +1074,19 @@ export default {
this.selectGraphSrc = row.icon this.selectGraphSrc = row.icon
this.selectGraphShape = row.iconName this.selectGraphShape = row.iconName
let targetAsset_id = [] let targetAsset_id = []
if (targetAsset) { // if (targetAsset) {
if (targetAsset.length == 4) { // if (targetAsset.length == 4) {
this.ruleForm.dynamicForm0_ = [] // this.ruleForm.dynamicForm0_ = []
} else { // } else {
let targetAsset_ = JSON.parse(targetAsset) // let targetAsset_ = JSON.parse(targetAsset)
this.ruleForm.dynamicForm0_ = targetAsset_ // this.ruleForm.dynamicForm0_ = targetAsset_
targetAsset_.forEach((item) => { // targetAsset_.forEach((item) => {
targetAsset_id.push(item.assetId) // targetAsset_id.push(item.assetId)
}) // })
} // }
this.ruleForm.let6 = targetAsset_id // this.ruleForm.let6 = targetAsset_id
} // }
console.log(2) console.log(2)
if (fieldsValue && fieldsValue.length == 4) { if (fieldsValue && fieldsValue.length == 4) {
this.ruleForm.dynamicForm_ = [] this.ruleForm.dynamicForm_ = []
...@@ -1172,6 +1172,7 @@ export default { ...@@ -1172,6 +1172,7 @@ export default {
} }
}) })
this.ruleForm.dynamicForm_ = fieldsValue_ this.ruleForm.dynamicForm_ = fieldsValue_
console.log('dynamicForm_', this.ruleForm.dynamicForm_)
} }
}, },
handleChange(value) { handleChange(value) {
...@@ -1321,31 +1322,31 @@ export default { ...@@ -1321,31 +1322,31 @@ export default {
} else { } else {
this.disabled1 = false this.disabled1 = false
} }
if (data) { // if (data) {
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_ = [] // 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!