<template>
  <!-- 子系统点位（数据来源） -->
  <div id="dataSource" v-loading="loading">
    <div class="data-item" v-for="form in forms" :key="form.id">
      <el-form :model="form" label-width="150px">
        <el-form-item label="数据源名称：">
          {{form.Name || '--'}}
        </el-form-item>
        <el-form-item label="值单位说明:">
          {{form.ValueDescription || '--'}}
        </el-form-item>
        <el-form-item label="原始点位值:">
          {{form.Data || '--'}}
        </el-form-item>
        <el-form-item label="原始点位描述：">
          {{form.Description || '--'}}
        </el-form-item>
        <el-form-item label="位置标签：">
          {{form.LocationFlag.toString() || '--'}}
        </el-form-item>
        <el-form-item label="原始值处理规则详情：">
          {{form.DataRuleContent  || '--'}}
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
import {
  getTabFunNumSourceData
} from '@/api/scan/request'
export default {
  data() {
    return {
      forms: [
      ],
      loading: true
    }
  },
  methods: {
    //加载数据
    loadDataSource() {
      this.loading = true;
      let pa = {
        Filters: "Infos='" + this.tabFunNum + "'"
      };
      getTabFunNumSourceData(pa, res => {
        this.forms = res.Content;
        this.loading = false;
      });
    }
  },
  props: {
    tabFunNum: String
  },
  mounted() {
    this.loadDataSource();
  },
  watch: {
    tabFunNum() {
      this.loadDataSource();
    }
  }
}
</script>

<style lang="less" scoped>
#dataSource {
  height: 100%;
  overflow: auto;
}
.data-item {
  margin: 15px 10px;
  box-shadow: 0px 4px 10px 0px rgba(0,0,0,0.2);
  background-color: white;
  padding: 10px 10px;
}
</style>