fix: 修改assetBox vm=1时 位置可以编辑的问题

This commit is contained in:
zhangyu
2021-07-15 15:30:23 +08:00
parent cfccac90e7
commit c2cf06b485
4 changed files with 5 additions and 6 deletions

View File

@@ -107,7 +107,6 @@ export default {
obj: {
immediate: true,
handler (n) {
console.log(n)
if ((this.from === fromRoute.asset) && n) {
if (n.childrenNum) {
const assetSub = { prop: 'assetSubTab', name: this.$t('overall.assetSubTab'), active: false }

View File

@@ -1473,7 +1473,6 @@ export default {
getTopology(this.index).updateProps()
},
onLayout () { // 改变布局
console.log(this.layout)
layout(getTopology(this.index).activeLayer.pens, this.layout)
getTopology(this.index).updateProps()
},

View File

@@ -46,7 +46,6 @@
</el-form-item>
<el-form-item :label="$t('asset.brandAndModel')" class="placeholder-emphasize" prop="brandAndModel">
<el-cascader
v-if="!vmLock"
v-model="editAsset.brandAndModel"
:placeholder="lockModelInputValue"
:options="options.brandAndModelOptions"
@@ -55,7 +54,6 @@
size="small"
style="width: 100%;"
></el-cascader>
<el-input v-else v-model="lockModelInputValue" disabled size="small"></el-input>
</el-form-item>
<el-form-item :label="$t('asset.location')" prop="location">
<location-cascader v-if="!vmLock" ref="locationCascader" :dc-option="options.dcOptions" :default-model-u-size="1" @change="setLocationData"></location-cascader>
@@ -369,7 +367,7 @@ export default {
immediate: true,
handler (n) {
if (n.id) {
// this.vmLock = n.vm === 1 // vm == 1 时锁定model和location
this.vmLock = n.vm === 1 // vm == 1 时锁定model和location
if (this.editAsset.id) { // 有id表示是修改asset需要注意不要覆盖掉原有的port
const oldPort = this.obj.authProtocolPort // 原有的port
const oldAuthProtocol = this.obj.type.authProtocol // 原有的协议

View File

@@ -59,7 +59,10 @@
<template v-else-if="item.prop === 'model'">{{scope.row.model ? scope.row.model.name : '-'}}</template>
<template v-else-if="item.prop === 'parent'">{{scope.row.parent ? scope.row.parent.name : '-'}}</template>
<template v-else-if="item.prop === 'children'">
<div @click="$emit('showBottomBox', 'assetSubTab', scope.row)" v-if="scope.row.childrenNum"> {{scope.row.childrenNum}}</div>
<div @click="$emit('showBottomBox', 'assetSubTab', scope.row)" v-if="scope.row.childrenNum">
<i class="nz-icon nz-icon-overview-project monitorColor color23BF9A"></i>
{{scope.row.childrenNum}}</div>
<span v-else-if="scope.row.type.vm===1"> <i class="nz-icon nz-icon-overview-project monitorColor color23BF9A"></i> 0 </span>
<span v-else> - </span>
</template>
<template v-else-if="item.prop === 'brand'">{{scope.row.brand ? scope.row.brand.name : '-'}}</template>