<template>
  <div class="app-container container-flex">
    <el-descriptions title="管道信息" :column="column">
      <el-descriptions-item label="管道编号">{{ form.code }}</el-descriptions-item>
      <el-descriptions-item label="管道名称">{{ form.name }}</el-descriptions-item>
      <el-descriptions-item label="管道属站">{{ form.inPipeLineTypeName }}</el-descriptions-item>
      <el-descriptions-item label="所属汇管">{{ form.networkName }}</el-descriptions-item>
      <el-descriptions-item label="埋深">{{ form.buriedDepth }}</el-descriptions-item>
      <el-descriptions-item label="里程">{{ form.mileage }}</el-descriptions-item>
      <el-descriptions-item label="进管管线号">{{ form.inPipeLineCode }}</el-descriptions-item>
      <el-descriptions-item label="进管管线管径">{{
        form.inPipeLineDiameter
      }}</el-descriptions-item>
      <el-descriptions-item label="进管管线长度">{{ form.inPipeLineLength }}</el-descriptions-item>
      <el-descriptions-item label="进管管线设计压力">{{
        form.inPipeLineDesignPressure
      }}</el-descriptions-item>
    </el-descriptions>
  </div>
</template>

<script>
import { initData } from '@/api/data'

export default {
  name: 'ControlpointView',
  computed: {},
  watch: {},
  data() {
    return {
      column: 3,
      form: {
        id: '0',
        code: '', //编号
        name: '', //名称
        parentId: '', //前一控制点
        type: '', //类型
        network: undefined, //隶属管网
        longitude: 0, //绝对坐标经度
        latitude: 0, //绝对坐标纬度
        buriedDepth: '', //埋深
        mileage: '', //里程
        inPipeLineCode: '', //进管管线号
        inPipeLineType: '', //进管类型
        inPipeLineDiameter: '', //进管管线管径
        inPipeLineLength: '', //进管管线长度
        inPipeLineDesignPressure: '', //进管管线设计压力
      }
    }
  },
  computed: {
    VUE_APP_BASE_API() {
      return process.env.VUE_APP_BASE_API
    },
  },
  created() {
    this.initData()
  },
  methods: {
    initData() {
      if (this.$route.query.column) this.column = this.$route.query.column
      initData('pipe/controlpoint/GetEntityFromCache', { id: this.$route.query.id }).then(
        (resp) => {
          this.form = resp.data
          // console.log(this.form)
        }
      )
    },
  },
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.container-flex {
  display: flex;
}
</style>
