|
@@ -3,13 +3,23 @@
|
|
|
<p>编辑设备</p>
|
|
|
<div class='row'>
|
|
|
<div class='row-tit'>名称</div>
|
|
|
- <a-input v-model='equipmentName' style='width: 180px' @change='changeEquipmentName' />
|
|
|
- <!-- <a-button type="link" class="edit-option-btn" @click="OpenEditStatus">{{editStatus[type]}}</a-button> -->
|
|
|
+ <a-input v-model='equipmentName' style='width: 180px' @change='changeEquipmentName' />
|
|
|
</div>
|
|
|
+ <!-- 工程信息化对象列表 -->
|
|
|
<div class='row'>
|
|
|
- <div class='row-tit'>工程信息化对象</div>
|
|
|
- <a-input style='width: 180px' />
|
|
|
+ <div class='row-tit'>工程信息化对象列表</div>
|
|
|
</div>
|
|
|
+ <div class='row' v-for='(item,index) in AttachObjectIds' :key='index'>
|
|
|
+ <a-input class='input' v-model='AttachObjectIds[index]' type='small' @change='changeAttachObjectIds(index)' />
|
|
|
+ </div>
|
|
|
+ <!-- 添加工程信息化对象列表 -->
|
|
|
+ <div class='row'>
|
|
|
+ <span>操作工程程信息化对象</span>
|
|
|
+ <a-button @click='handleAttach(1)' size='small' type='primary'>添加</a-button>
|
|
|
+ <a-button @click='handleAttach(-1)' size='small' v-show='AttachObjectIds.length' type='danger'>删除</a-button>
|
|
|
+ </div>
|
|
|
+ <a-divider />
|
|
|
+ <!-- 信息点 -->
|
|
|
<div class='row'>
|
|
|
<div class='row-tit'>信息点</div>
|
|
|
</div>
|
|
@@ -60,8 +70,9 @@ export default {
|
|
|
return {
|
|
|
equipmentName: '',
|
|
|
equipmentData: {},
|
|
|
- InfoList: [],
|
|
|
- info: [],
|
|
|
+ InfoList: [], //保存存入的InfoList
|
|
|
+ info: [], //修改 info
|
|
|
+ AttachObjectIds: [], //工程信息化对象 ID 列表
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -71,9 +82,26 @@ export default {
|
|
|
},
|
|
|
mounted() {},
|
|
|
methods: {
|
|
|
+ /**
|
|
|
+ * @description 添加,删除 工程信息化对象, baseEditer.vue bus事务中做对应处理
|
|
|
+ * @param { Number } flag -1:删除 1:添加
|
|
|
+ */
|
|
|
+ handleAttach(flag) {
|
|
|
+ switch (flag) {
|
|
|
+ case -1:
|
|
|
+ bus.$emit('deleteAttachObjectIds')
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ bus.$emit('addAttachObjectIds')
|
|
|
+ break
|
|
|
+ }
|
|
|
+ this.init()
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @description
|
|
|
+ */
|
|
|
addInfo() {
|
|
|
bus.$emit('addEquipmentInfo')
|
|
|
- console.log(this.focusItemList)
|
|
|
this.init()
|
|
|
},
|
|
|
delInfo() {
|
|
@@ -82,23 +110,28 @@ export default {
|
|
|
},
|
|
|
init() {
|
|
|
// 设置设备名称
|
|
|
- window.vuem = this
|
|
|
- // window._focusItem = this.focusItemList.itemList[0]
|
|
|
+ window.equipmentData = this.focusItemList.itemList[0].toData()
|
|
|
this.equipmentData = this.focusItemList.itemList[0].toData()
|
|
|
this.equipmentName = this.equipmentData.Name
|
|
|
- this.equipmentName = this.equipmentData.Name
|
|
|
this.InfoList = cloneDeep(this.equipmentData.InfoList)
|
|
|
+ this.AttachObjectIds = cloneDeep(this.equipmentData.AttachObjectIds || [])
|
|
|
this.info = []
|
|
|
this.InfoList.map((item) => {
|
|
|
- let { Name, FontSize, Color,Code } = item
|
|
|
+ let { Name, FontSize, Color, Code } = item
|
|
|
// this.info.push(item.Name)
|
|
|
this.info.push({ Name, FontSize, Color, Code })
|
|
|
})
|
|
|
// console.log(this.equipmentData)
|
|
|
},
|
|
|
+ // 更改设备名称
|
|
|
changeEquipmentName() {
|
|
|
bus.$emit('changeEquipmentName', this.equipmentName)
|
|
|
},
|
|
|
+ // 更改 工程信息化对象列表
|
|
|
+ changeAttachObjectIds(index) {
|
|
|
+ let ID = this.AttachObjectIds[index]
|
|
|
+ bus.$emit('changeEqAttachObjectIds', { index, ID })
|
|
|
+ },
|
|
|
// 更改信息点名称
|
|
|
changeInfoName(index) {
|
|
|
let info = this.info[index]
|