|
|
|
@ -8,7 +8,7 @@ |
|
|
|
<i class="el-icon-plus" @click="add" :class="addIcon?'addIcon':''"></i> |
|
|
|
</el-tooltip> |
|
|
|
<el-tooltip class="item" effect="dark" content="删除" placement="top-start"> |
|
|
|
<i class="el-icon-delete" :class="deleteIcon?'deleteIcon':''"></i> |
|
|
|
<i class="el-icon-delete" @click="remove" :class="deleteIcon?'deleteIcon':''"></i> |
|
|
|
</el-tooltip> |
|
|
|
<el-tooltip class="item" effect="dark" content="导出" placement="top-start"> |
|
|
|
<i class="el-icon-download" ></i> |
|
|
|
@ -23,7 +23,7 @@ |
|
|
|
:data="treeData" |
|
|
|
:props="defaultProps" |
|
|
|
@node-click="handleNodeClick" |
|
|
|
|
|
|
|
ref="tree" |
|
|
|
> |
|
|
|
<span slot-scope="{ node, data }" class="slot-node""> |
|
|
|
<template> |
|
|
|
@ -52,12 +52,12 @@ |
|
|
|
<el-empty description="右侧功能暂未开发" v-if="!show"></el-empty> |
|
|
|
<div class="grid-content-right" v-if="show"> |
|
|
|
<div class="titleName">{{ titleName }}</div> |
|
|
|
<el-form ref="form" :model="form" label-width="80px"> |
|
|
|
<el-form ref="form" :model="form" label-width="100px"> |
|
|
|
<el-form-item label="设备名称"> |
|
|
|
<el-input v-model="form.deviceName"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="设备类型"> |
|
|
|
<el-select v-model="form.deviceTypeId" placeholder="请选择" :disabled="form.deviceName?true:false"> |
|
|
|
<el-select v-model="form.devicetypeId" placeholder="请选择"> |
|
|
|
<el-option :label="item.deviceTypeName" :value="item.deviceTypeId" v-for="item in deviceTypeData" :key="item.deviceTypeId"></el-option> |
|
|
|
<!-- deviceTypeData --> |
|
|
|
</el-select> |
|
|
|
@ -67,33 +67,33 @@ |
|
|
|
<span class="serial-number">设备编号用于生产复核,需与SCADA系统中的设备编号一致</span> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="显示排序"> |
|
|
|
<el-input-number v-model="form.num" controls-position="right" :min="1"></el-input-number> |
|
|
|
<el-input-number v-model="form.orderNum" controls-position="right" :min="0"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="实物ID"> |
|
|
|
<el-input v-model="form.name"></el-input> |
|
|
|
<el-input v-model="form.phyassetId"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="监控索引号"> |
|
|
|
<el-input v-model="form.name"></el-input> |
|
|
|
<el-input v-model="form.monitorIndexNo"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="设备型号"> |
|
|
|
<el-input v-model="form.name"></el-input> |
|
|
|
<el-input v-model="form.deviceModel"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="设备厂家"> |
|
|
|
<el-input v-model="form.name"></el-input> |
|
|
|
<el-input v-model="form.manufacturer"></el-input> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="x坐标"> |
|
|
|
<el-input-number v-model="form.numX" controls-position="right" :min="-20" :max="20"></el-input-number> |
|
|
|
<el-input-number v-model="form.positionX" controls-position="right" :min="-20" :max="20" :step="0.1"></el-input-number> |
|
|
|
<span class="number-title">(建议最小值-20,最大值20)</span> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="y坐标"> |
|
|
|
<el-input-number v-model="form.num" controls-position="right" :min="66"></el-input-number> |
|
|
|
<el-input-number v-model="form.positionY" controls-position="right" :min="66" :step="0.1"></el-input-number> |
|
|
|
<span class="number-title">(建议66)</span> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="z坐标"> |
|
|
|
<el-input-number v-model="form.num" controls-position="right" :min="-6" :max="20"></el-input-number> |
|
|
|
<el-input-number v-model="form.positionZ" controls-position="right" :min="-6" :max="20" :step="0.1"></el-input-number> |
|
|
|
<span class="number-title">(建议最小值-6,最大值20)</span> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
@ -109,38 +109,19 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script > |
|
|
|
import { treeAreaDeviceSelect,devicetypeList,deviceQuery } from "@/api/equipment/entry"; |
|
|
|
import { |
|
|
|
treeAreaDeviceSelect, |
|
|
|
devicetypeList, |
|
|
|
deviceQuery, |
|
|
|
insertMainDeviceAndCommByDeviceType, |
|
|
|
deviceRemove, |
|
|
|
} from "@/api/equipment/entry"; |
|
|
|
export default { |
|
|
|
name: "entry", |
|
|
|
data() { |
|
|
|
return { |
|
|
|
queryParams: "", |
|
|
|
treeData: [ |
|
|
|
{ |
|
|
|
label: "一级 1", |
|
|
|
type: 1, |
|
|
|
children: [ |
|
|
|
{ |
|
|
|
label: "二级 1-1", |
|
|
|
children: [ |
|
|
|
{ |
|
|
|
label: "三级 1-1-1", |
|
|
|
children: [ |
|
|
|
{ |
|
|
|
label: "四级 1-1-1-1", |
|
|
|
type: 4, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "四级 1-1-1-2", |
|
|
|
type: 4, |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
], |
|
|
|
treeData: [], |
|
|
|
defaultProps: { |
|
|
|
children: "children", |
|
|
|
// label: "areaName", |
|
|
|
@ -149,50 +130,161 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
titleName: "", |
|
|
|
form: {}, |
|
|
|
form: { |
|
|
|
orderNum: 0, |
|
|
|
positionX: 0, |
|
|
|
positionY: 66, |
|
|
|
positionZ: 0, |
|
|
|
handerType: 0, |
|
|
|
boolAdd: 1, |
|
|
|
deviceId: "", |
|
|
|
// powerMainEquFlag: "Yes", |
|
|
|
// parentId: "", |
|
|
|
// devicetypeName: "A相", |
|
|
|
// delFlag:0, |
|
|
|
// ancestors:"" |
|
|
|
}, |
|
|
|
// form: { |
|
|
|
// ancestors: "", |
|
|
|
// areaId: 272, |
|
|
|
// areaIdS: null, |
|
|
|
// areaName: "", |
|
|
|
// boolAdd: 1, |
|
|
|
// createBy: "", |
|
|
|
// createTime: null, |
|
|
|
// delFlag: "0", |
|
|
|
// deviceCode: "1233321234", |
|
|
|
// deviceHigh: null, |
|
|
|
// deviceId: "", |
|
|
|
// deviceIdAll: null, |
|
|
|
// deviceIdListAll: null, |
|
|
|
// deviceLength: null, |
|
|
|
// deviceModel: "type", |
|
|
|
// deviceName: "无6", |
|
|
|
// deviceWidth: null, |
|
|
|
// devicetypeId: 902, |
|
|
|
// devicetypeName: "A相", |
|
|
|
// eqbookCode: null, |
|
|
|
// handerType: 0, |
|
|
|
// intallPosition: null, |
|
|
|
// manufacturer: "123", |
|
|
|
// monitorIndexNo: "index", |
|
|
|
// oldAreaId: "", |
|
|
|
// oldAreaName: null, |
|
|
|
// oldDeviceId: null, |
|
|
|
// oldParentId: null, |
|
|
|
// orderNum: 1, |
|
|
|
// params: {}, |
|
|
|
// parentId: "", |
|
|
|
// parentName: "无人机机巢", |
|
|
|
// patrolTaskList: null, |
|
|
|
// phase: "O", |
|
|
|
// phaseNum: "无相别", |
|
|
|
// phyassetId: "id", |
|
|
|
// positionX: 0, |
|
|
|
// positionY: 66, |
|
|
|
// positionZ: 0, |
|
|
|
// powerMainEquFlag: "No", |
|
|
|
// remark: null, |
|
|
|
// searchValue: null, |
|
|
|
// stationNo: null, |
|
|
|
// status: "0", |
|
|
|
// updateBy: "", |
|
|
|
// updateTime: null, |
|
|
|
// }, |
|
|
|
show: false, |
|
|
|
deleteIcon: true, |
|
|
|
addIcon:true, |
|
|
|
deviceTypeData:[], |
|
|
|
addIcon: true, |
|
|
|
deviceTypeData: [], |
|
|
|
deviceId: "", |
|
|
|
}; |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
treeAreaDeviceSelect().then((res) => { |
|
|
|
|
|
|
|
this.init(); |
|
|
|
devicetypeList().then((res) => { |
|
|
|
console.log(res); |
|
|
|
if (res.code == 200) { |
|
|
|
this.treeData = res.data; |
|
|
|
let arr = res.data.filter((item) => item.deviceTypeId !== 1); |
|
|
|
this.deviceTypeData = arr; |
|
|
|
} |
|
|
|
}); |
|
|
|
devicetypeList().then(res=>{ |
|
|
|
console.log(res); |
|
|
|
if(res.code==200){ |
|
|
|
this.deviceTypeData=res.data; |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleNodeClick(data) { |
|
|
|
init() { |
|
|
|
treeAreaDeviceSelect().then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.treeData = res.data; |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
handleNodeClick(data, e) { |
|
|
|
console.log(data, e); |
|
|
|
this.deviceId = data.deviceId; |
|
|
|
this.titleName = data.areaName || data.deviceName; |
|
|
|
// this.form.boolAdd = 1; |
|
|
|
(this.form.parentName = data.areaName), (this.form.areaId = data.areaId); |
|
|
|
|
|
|
|
if (data.areaName) { |
|
|
|
this.show = false; |
|
|
|
this.deleteIcon=true; |
|
|
|
this.addIcon=false; |
|
|
|
this.deleteIcon = true; |
|
|
|
this.addIcon = false; |
|
|
|
} else if (data.deviceName) { |
|
|
|
this.show = true; |
|
|
|
this.titleName = "编辑" + data.deviceName; |
|
|
|
this.deleteIcon=false; |
|
|
|
this.addIcon=true; |
|
|
|
deviceQuery(data.deviceId).then(res=>{ |
|
|
|
console.log(res) |
|
|
|
if(res.code==200){ |
|
|
|
this.form=res.data |
|
|
|
this.deleteIcon = false; |
|
|
|
this.addIcon = true; |
|
|
|
deviceQuery(data.deviceId).then((res) => { |
|
|
|
console.log(res, 1111); |
|
|
|
if (res.code == 200) { |
|
|
|
// this.form=res.data; |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
add() { |
|
|
|
this.show = true; |
|
|
|
}, |
|
|
|
remove() { |
|
|
|
this.$confirm("是否确定删除","系统提示", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning", |
|
|
|
}).then(() => { |
|
|
|
deviceRemove(this.deviceId).then((res) => { |
|
|
|
console.log(res, 1111); |
|
|
|
if (res.code == 200) { |
|
|
|
this.$message({ |
|
|
|
type: "success", |
|
|
|
message: "删除成功", |
|
|
|
}); |
|
|
|
this.init(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
onSubmit() { |
|
|
|
// console.log(this.form) |
|
|
|
// return |
|
|
|
insertMainDeviceAndCommByDeviceType(this.form).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.$message({ |
|
|
|
type: "success", |
|
|
|
message: "新增成功", |
|
|
|
}); |
|
|
|
// this.show = false; |
|
|
|
this.form = { |
|
|
|
orderNum: 0, |
|
|
|
positionX: 0, |
|
|
|
positionY: 66, |
|
|
|
positionZ: 0, |
|
|
|
handerType: 0, |
|
|
|
boolAdd: 1, |
|
|
|
deviceId: "", |
|
|
|
}; |
|
|
|
this.init(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
@ -236,7 +328,8 @@ export default { |
|
|
|
margin-bottom: 30px; |
|
|
|
margin-top: 20px; |
|
|
|
} |
|
|
|
.deleteIcon,.addIcon { |
|
|
|
.deleteIcon, |
|
|
|
.addIcon { |
|
|
|
color: #dddddd; |
|
|
|
cursor: not-allowed; |
|
|
|
} |
|
|
|
|