<template>
  <div class="conViews">
    <div class="sm-panel sm-function-module-query" v-drag v-if="isShallow">
      <div class="sm-panel-header">
        <span> 项目详情 </span>
        <i class="el-icon-close" @click="closeInster"></i>
      </div>
      <el-tabs type="border-card" class="xz_box" v-model="activeTabs" stretch>
        <el-tab-pane label="基本信息" name="jbxx">
          <Info :data="jbxxData"></Info>
        </el-tab-pane>
        <el-tab-pane label="进度跟踪" name="rdxx"> </el-tab-pane>
      </el-tabs>
    </div>
    <el-dialog
      :title="1"
      width="40%"
      :visible.sync="dialogVisible"
      :before-close="close"
      :modal-append-to-body="false"
      :close-on-click-modal="false"
    >
      <CustomDetails :model="formData" :config="detailInfos">
        <template #attachment>
          <span>{{ formData.attachment }}</span>
          <i class="usable el-icon-tickets" @click="download"></i>
        </template>
      </CustomDetails>
    </el-dialog>
  </div>
</template>
  <script>
import { GetDetail } from "@/api/Idleland.js";
import Info from "../../Idleland/components/info.vue";
import CustomDetails from "@/components/mapView/custom-detailsInfo.vue";
import { getXmList, getXm } from "@/api/stxf/tdzz.js";
import { detailInfos, tbInfos } from "./config";
export default {
  props: {
    interObj: {
      type: Object,
    },
  },
  components: { Info, CustomDetails },
  data() {
    return {
      activeTabs: "jbxx",
      isShallow: false,
      jbxxData: [],
      rdData: [],
      tempdataLayerId: null,
      dialogVisible: false,
    };
  },
  mounted() {
    // this.init();
  },
  methods: {
    //关闭详情
    closeInster() {
      this.isShallow = false;
    },

    handleView(val, type) {
      this.isShallow = true;
      this.jbxxData = [];
      getXm(val.id).then((res) => {
        if (res.code == 200) {
          // Object.keys(res.data).forEach((key) => {
          //   this.jbxxData.push({ name: key, value: res.data[key] });
          // });
          detailInfos.forEach((key) => {
            this.jbxxData.push({ name: key.name, value: res.data[key.value] });
          });
        } else {
          this.$message.error(res.message);
        }
      });
    },
  },
  mounted() {},
  watch: {},
};
</script>
  
  <style lang="scss" scoped>
.sm-panel {
  width: 400px;
  max-width: 400px;
  /deep/ .el-icon-close:before {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: larger;
    font-weight: bold;

    &:hover {
      color: aqua;
    }
  }
}

.sm-function-module-query {
  max-height: 800px !important;
  top: 28px !important;
}
</style>