<!--
 * @Author: tengmingxue 1473375109@qq.com
 * @Date: 2023-06-05 17:46:54
 * @LastEditors: tengmingxue 1473375109@qq.com
 * @LastEditTime: 2023-06-07 09:25:02
 * @FilePath: \yx-big-screen\src\views\map\dialog\BasicInfo.vue
 * @Description: 表格信息
-->


<template>
  <div class="table-row-info">
    <a-row class="table-header">
      <a-col :span="1" class="title-col">序号</a-col>
      <a-col :span="3" class="title-col">工况名称</a-col>
      <a-col :span="5" class="title-col">强度储备安全系数Fs1</a-col>
      <a-col :span="5" class="title-col">超载储备安全系数Fs2</a-col>
      <a-col :span="5" class="title-col">下滑力超载储备安全系数Fs3</a-col>
      <a-col :span="3" class="title-col">安全系数</a-col>
      <a-col :span="2" class="title-col">操作</a-col>
    </a-row>

    <div class="table-container">
      <template v-for="(item, index) in tableData" :key="index">
        <a-row class="table-row" :class="{ active: currentRow === item.id }">
          <a-col :span="1" class="fields-col fields-style">
            <span class="defect-serial-p">
              <span class="defect-serial"> {{ index + 1 }}</span>
            </span>
          </a-col>
          <a-col :span="3" class="fields-col fields-style">{{ item.defectName }}</a-col>
          <a-col :span="5" class="fields-col fields-style">{{ item.qdcbaqxs }}</a-col>
          <a-col :span="5" class="fields-col fields-style">{{ item.czcbaqxs }}</a-col>
          <a-col :span="5" class="fields-col fields-style">{{ item.xhlczcbaqxs }}</a-col>

          <a-col :span="3" class="fields-col fields-style">{{ item.aqxs }}</a-col>
          <a-col :span="2" class="fields-col detail" @click="showDetailClick(item)">
            <span class="label">详情</span>
            <span :class="currentRow === item.id ? 'close-img img' : 'open-img img'"></span>
          </a-col>
        </a-row>
        <a-row class="table-detail" v-if="currentRow === item.id">
          <div class="title-label">依据标准</div>
          <div class="continer"
            >某某依据某某依据某某依据某某依据某某依据某某依据某某依据某某依据某某依据某某依据某某依据某某依据某某依据某某依据某某依据某某依据某某依据某某依据某某依据某某依据
            某某依据</div
          >

          <div class="title-label">极限平均分析方法</div>
          <div class="continer">某某依据某据某某依据某某依据某某依据某某依据某某依据某某依据某某依据某某依据某某依据某某依据</div>

          <div class="title-label">稳定性评价</div>
          <div class="continer">某某依据某据某某依据某某依据某某依据某某依据某某依据某某依据某某依据某某依据某某依据某某依据</div>
        </a-row>
      </template>
    </div>
  </div>
</template>
        
  <script>
import { defineComponent, reactive, toRefs, onMounted, ref, watch, getCurrentInstance } from 'vue';
import moment from 'moment';
import { getWorksInfoPage } from '/@/api/map/geologicalApi'
export default defineComponent({
  name: 'TableRowInfo',
  components: {},
  props: [],
  setup() {
    const data = reactive({
      currentRow: '',
      pagination:{
        dzdxid:'',
        current:1,
        size:10,
        total:0,
      },
      tableData: [
        {
          id: '1001', //缺陷编号
          deviceId: 'D001', //设备id
          defectName: '***', //缺陷名称
          dept: '***', //所属科室
          source: '***', //缺陷来源
          defectType: '***', //缺陷分类
          defectStatusName: '***', //缺陷状态
          defectStatus: '***', //缺陷状态 0:为处理 ， 1：已处理
          discoverDate: '***', //缺陷发现发现
        },
        {
          id: '1002',
          deviceId: 'D001',
          defectName: '***', //缺陷名称
          dept: '***', //所属科室
          source: '***', //缺陷来源
          defectType: '***', //缺陷分类
          defectStatusName: '***', //缺陷状态
          defectStatus: '***', //缺陷状态 0:为处理 ， 1：已处理
          discoverDate: '***', //缺陷发现发现
        },
        {
          id: '1003',
          deviceId: 'D001',
          defectName: '***', //缺陷名称
          dept: '***', //所属科室
          source: '***', //缺陷来源
          defectType: '***', //缺陷分类
          defectStatusName: '***', //缺陷状态
          defectStatus: '***', //缺陷状态 0:为处理 ， 1：已处理
          discoverDate: '***', //缺陷发现发现
        },
      ],
    });
    const showDetailClick = (row) => {
      data.currentRow = data.currentRow === row.id ? '' : row.id;
    };

    /**
     * 查询工况信息
    */
    const getWorksInfos = async (param) =>{
      const res = await getWorksInfoPage(param)
    };
    onMounted(() => {});
    return {
      ...toRefs(data),
      showDetailClick,
    };
  },
});
</script>
    <style lang="less" scoped>
.table-row-info {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: auto;

  .table-header {
    height: 40px;
    line-height: 40px;
    background: rgba(7, 178, 255, 0.18);
    .title-col {
      font-size: 14px;
      font-family: Source Han Sans CN;
      font-weight: 400;
      color: #16c0ff;
      text-align: center;
      border: 1px solid rgba(21, 186, 255, 0.3);
    }
  }
  .table-container {
    width: 100%;
    height: calc(100% - 70px);
    overflow: auto;
    .table-row {
      height: 40px;
      line-height: 40px;
      width: 100%;
      &:hover {
        background: rgba(255, 255, 255, 0.1);
      }
      .fields-col {
        display: flex;
        height: 100%;
        text-align: center;
        justify-content: center;
        align-items: center;
        border: 1px solid rgba(21, 186, 255, 0.3);
        .defect-serial-p {
          display: flex;
          width: 22px;
          height: 22px;
          .defect-serial {
            display: flex;
            width: 22px;
            height: 22px;
            padding: 0 5px;
            line-height: 22px;
            border-radius: 50%;
            font-size: 14px;
            font-family: Alimama ShuHeiTi;
            font-weight: bold;
            font-style: italic;
            color: #ffffff;
          }
        }
      }
      .fields-style {
        font-size: 14px;
        font-family: Source Han Sans CN;
        font-weight: 400;
        color: #ffffff;
      }
      .fields-style-red {
        color: #ff3535;
      }
      .fields-style-green {
        color: #0ae878;
      }
      .detail {
        font-size: 14px;
        font-family: Source Han Sans CN;
        font-weight: 500;
        color: #08ba68;
        background: linear-gradient(46deg, #ffe87e 0%, #00e1e4 37%, #ffffff 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        cursor: pointer;
        display: flex;
        text-align: center;
        justify-content: center;
        align-items: center;
        .label {
          display: flex;
          margin-right: 6px;
        }
        .img {
          display: flex;
          width: 31px;
          height: 27px;
        }
        .close-img {
          background: url('/@/assets/images/dialog/pickup-on.png') no-repeat;
          background-size: 100% 100%;
        }
        .open-img {
          background: url('/@/assets/images/dialog/open-on.png') no-repeat;
          background-size: 100% 100%;
        }
      }
    }
    .active {
      background: rgba(255, 255, 255, 0.1);
    }
    .table-detail {
      border: 1px solid rgba(21, 186, 255, 0.3);
      height: auto;
      padding: 0 10px;
      .title-label {
        width: 100%;
        height: 28px;
        line-height: 28px;
        margin: 5px 0 2px 0;
        font-size: 14px;
        font-family: Source Han Sans CN;
        font-weight: 500;
        color: #2ec6ff;
      }
      .container {
        height:auto;
        word-wrap: break-word;
        word-break: normal;
        margin-bottom:6px;
      }
    }
  }
}
</style>