<template>
  <t-table rowKey="id" :data="data" :columns="columns" bordered />
</template>

<script setup lang="jsx">
import { computed, ref } from 'vue'
import { useImageStore } from '@/store'
import { transNumberToEn } from '@/utils/common'
import moment from 'moment'
const imageStore = useImageStore()
const data = computed(() => {
  const res = { ...imageStore.coreInfo }
  res.nuclearCoreName = imageStore.nuclearCoreName
  res.operatorName = imageStore.operatorName
  res.nuclearStationName = imageStore.nuclearStationName
  return [res]
})
const columns = ref([
  {
    colKey: 'operatorName',
    title: '操作员',
    width: 120,
  },
  {
    colKey: 'serialNumber',
    width: 120,
    title: '核查坐标',
    cell: (h, { row }) => {
      if (row.serialNumber) {
        // transNumberToEn
        // 将本次核查坐标横坐标转换为应为字母
        const arr = row.serialNumber.split('-')
        return `${transNumberToEn(arr[0])} - ${arr[1]}`
      } else {
        return '---'
      }
    },
  },
  {
    colKey: 'firstSign',
    title: '坐标信息',
    width: 120,
    cell: (h, { row }) =>
      row.firstSign && row.secondSign ? (
        <div>
          <p>{row.firstSign?.substr(-4)}</p>
          <p>{row.secondSign?.substr(-4)}</p>
        </div>
      ) : (
        '---'
      ),
  },
  {
    colKey: 'result',
    title: '核对结果',
    cell: (h, { row }) => {
      if (row.result == 1) {
        return (
          <div>
            <p>{row.resultSerial}</p>
            <svg
              xmlns="http://www.w3.org/2000/svg"
              xmlns:xlink="http://www.w3.org/1999/xlink"
              fill="none"
              version="1.1"
              width="84.521484375"
              height="32"
              viewBox="0 0 84.521484375 32"
            >
              <defs>
                <clipPath id="master_svg0_157_05943">
                  <rect
                    x="5.080078125"
                    y="4"
                    width="24"
                    height="24.000097274780273"
                    rx="0"
                  />
                </clipPath>
              </defs>
              <g>
                <g>
                  <rect
                    x="0"
                    y="0"
                    width="84.52100372314453"
                    height="32"
                    rx="16"
                    fill="#01FF8D"
                    fill-opacity="1"
                  />
                </g>
                <g clip-path="url(#master_svg0_157_05943)">
                  <rect
                    x="5.080078125"
                    y="4"
                    width="24"
                    height="24.000097274780273"
                    rx="0"
                    fill="#01FF8D"
                    fill-opacity="1"
                  />
                  <g>
                    <path
                      d="M17.080078125,28.0001C10.453078125000001,28.0001,5.080078125,22.6271,5.080078125,16C5.080078125,9.37302,10.453078125000001,4,17.080078125,4C23.707078125,4,29.080078125,9.37302,29.080078125,16C29.080078125,22.6271,23.707078125,28.0001,17.080078125,28.0001ZM14.404078125,20.7121C14.892258125,21.2004,15.683878125,21.2004,16.172078125,20.7121L23.750078125,13.13404C24.238278125,12.64581,24.238278125,11.85425,23.750078125,11.36603C23.261878125,10.87781,22.470278125,10.87781,21.982078125,11.36603L15.234078125,18.0061L12.214078125,14.986C11.725968125,14.4972,10.933878125,14.4969,10.445398125,14.9854C9.956908125,15.4739,9.957218125,16.265900000000002,10.446078125,16.7541L14.404078125,20.7121Z"
                      fill="#FFFFFF"
                      fill-opacity="1"
                    />
                  </g>
                </g>
                <g>
                  <path
                    d="M40.76188421875,15.0402L40.76188421875,21.8123L38.85693321875,21.8123L38.85693321875,22.8377L51.43052421875,22.8377L51.43052421875,21.8123L46.03922421875,21.8123L46.03922421875,17.2961L50.42332421875,17.2961L50.42332421875,16.270699999999998L46.03922421875,16.270699999999998L46.03922421875,12.3514L50.97022421875,12.3514L50.97022421875,11.31233L39.39013421875,11.31233L39.39013421875,12.3514L44.93636421875,12.3514L44.93636421875,21.8123L41.84196421875,21.8123L41.84196421875,15.0402L40.76188421875,15.0402ZM60.83692421875,10.23226C60.22172421875,11.95947,59.18722421875,13.65934,57.98402421875,14.73942C58.18002421875,14.93082,58.49902421875,15.31819,58.612924218749995,15.5096C58.849924218750004,15.29085,59.08692421875,15.06298,59.314824218750005,14.80778L59.314824218750005,17.7928C59.314824218750005,19.2466,59.15982421875,21.3612,57.80182421875,22.8742C58.038724218750005,22.9881,58.44432421875,23.2798,58.612924218749995,23.4484C59.52442421875,22.4959,59.94372421875,21.1652,60.13962421875,19.8208L62.140324218749996,19.8208L62.140324218749996,22.9289L63.065424218749996,22.9289L63.065424218749996,19.8208L65.07972421875,19.8208L65.07972421875,22.1496C65.07972421875,22.3182,65.02512421875,22.382,64.85642421874999,22.3957C64.70152421875,22.3957,64.14092421875,22.3957,63.53942421875,22.382C63.66702421875,22.6509,63.78092421875,23.0565,63.80832421875,23.3208C64.67412421875,23.3208,65.27572421875,23.3071,65.62662421875,23.1522C65.97752421875,22.9881,66.08692421875,22.7056,66.08692421875,22.1496L66.08692421875,13.93733L63.52572421875,13.93733C64.01792421875,13.36312,64.53292421875,12.65673,64.87012421875,12.018709999999999L64.20022421875001,11.55387L64.03162421875,11.599440000000001L61.37012421875,11.599440000000001C61.51142421875,11.243970000000001,61.639024218749995,10.89306,61.76202421875,10.53759L60.83692421875,10.23226ZM62.140324218749996,18.895699999999998L60.24902421875,18.895699999999998C60.28092421875,18.5083,60.29462421875,18.143700000000003,60.29462421875,17.7928L60.29462421875,17.4054L62.140324218749996,17.4054L62.140324218749996,18.895699999999998ZM63.065424218749996,18.895699999999998L63.065424218749996,17.4054L65.07972421875,17.4054L65.07972421875,18.895699999999998L63.065424218749996,18.895699999999998ZM62.140324218749996,16.5623L60.29462421875,16.5623L60.29462421875,14.84879L62.140324218749996,14.84879L62.140324218749996,16.5623ZM63.065424218749996,16.5623L63.065424218749996,14.84879L65.07972421875,14.84879L65.07972421875,16.5623L63.065424218749996,16.5623ZM60.02572421875,13.93733L59.99842421875,13.93733C60.33562421875,13.48616,60.65462421875,12.989419999999999,60.93722421875,12.479L63.45742421875,12.479C63.14752421875,12.989419999999999,62.76922421875,13.536290000000001,62.40462421875,13.93733L60.02572421875,13.93733ZM53.89622421875,11.020669999999999L53.89622421875,11.98681L55.55962421875,11.98681C55.19502421875,14.16976,54.57972421875,16.1658,53.59992421875,17.5467C53.76852421875,17.8338,54.01922421875,18.4399,54.09212421875,18.7134C54.342824218749996,18.367,54.57972421875,17.966,54.80312421875,17.5467L54.80312421875,22.7511L55.71452421875,22.7511L55.71452421875,21.5845L58.16632421875,21.5845L58.16632421875,15.39567L55.71452421875,15.39567C56.065424218749996,14.32926,56.35712421875,13.171710000000001,56.56672421875,11.98681L58.612924218749995,11.98681L58.612924218749995,11.020669999999999L53.89622421875,11.020669999999999ZM55.71452421875,16.348100000000002L57.26852421875,16.348100000000002L57.26852421875,20.645699999999998L55.71452421875,20.645699999999998L55.71452421875,16.348100000000002Z"
                    fill="#FFFFFF"
                    fill-opacity="1"
                  />
                </g>
              </g>
            </svg>
          </div>
        )
      } else if (row.result == 2) {
        return (
          <div>
            <p>{row.resultSerial}</p>
            <svg
              xmlns="http://www.w3.org/2000/svg"
              xmlns:xlink="http://www.w3.org/1999/xlink"
              fill="none"
              version="1.1"
              width="84.521484375"
              height="32"
              viewBox="0 0 84.521484375 32"
            >
              <defs>
                <clipPath id="master_svg0_126_07519">
                  <rect
                    x="5.080078125"
                    y="4"
                    width="24"
                    height="24.000097274780273"
                    rx="0"
                  />
                </clipPath>
              </defs>
              <g>
                <g>
                  <rect
                    x="0"
                    y="0"
                    width="84.52100372314453"
                    height="32"
                    rx="16"
                    fill="#FE0A0A"
                    fill-opacity="1"
                  />
                </g>
                <g clip-path="url(#master_svg0_126_07519)">
                  <rect
                    x="5.080078125"
                    y="4"
                    width="24"
                    height="24.000097274780273"
                    rx="0"
                    fill="#FE0A0A"
                    fill-opacity="1"
                  />
                  <g>
                    <path
                      d="M17.080078125,4C10.479408124999999,4,5.080078125,9.399329999999999,5.080078125,16C5.080078125,22.6007,10.479408124999999,28,17.080078125,28C23.680778125,28,29.080078125,22.6007,29.080078125,16C29.080078125,9.399329999999999,23.680778125,4,17.080078125,4ZM22.813878125,20.1338C23.215178125,20.5351,23.215178125,21.2682,22.813878125,21.6669C22.613178125,21.8676,22.348278125,22.0013,22.013878125,22.0013C21.746278125,22.0013,21.414478125,21.8676,21.213878125,21.6669L17.347678125,17.8007L13.481418125,21.6669C13.080078125,22.0682,12.346968125,22.0682,11.948308125,21.6669C11.549648125000001,21.2656,11.546968125,20.5324,11.948308125,20.1338L15.814478125,16.2676L11.948308125,12.40134C11.747638125,12.20067,11.613858125,11.93579,11.613858125,11.60134C11.613858125,11.33378,11.747638125,11.00201,11.948308125,10.80134C12.349648125,10.4,13.082758125,10.4,13.481418125,10.80134L17.347678125,14.6676L21.213878125,10.80134C21.414478125,10.600670000000001,21.679378125,10.46689,22.013878125,10.46689C22.281378125,10.46689,22.613178125,10.600670000000001,22.813878125,10.80134C23.014478125,11.00201,23.148278125,11.26689,23.148278125,11.60134C23.148278125,11.8689,23.014478125,12.20067,22.813878125,12.40134L18.947678125,16.2676L22.813878125,20.1338Z"
                      fill="#FFFFFF"
                      fill-opacity="1"
                    />
                  </g>
                </g>
                <g>
                  <path
                    d="M40.62060421875,10.327960000000001C40.20133421875,11.6997,39.49039421875,12.952960000000001,38.64729821875,13.80973C38.82959021875,14.02392,39.093913218750004,14.55257,39.18050421875,14.7622C39.62711421875,14.2928,40.04638421875,13.70947,40.424644218750004,13.06233L43.74235421875,13.06233L43.74235421875,12.06884L40.97151421875,12.06884C41.18115421875,11.599440000000001,41.37711421875,11.11181,41.53206421875,10.624179999999999L40.62060421875,10.327960000000001ZM38.99820921875,17.3507L38.99820921875,18.3123L40.95784421875,18.3123L40.95784421875,21.1652C40.95784421875,21.785,40.53857421875,22.186,40.28792421875,22.3319C40.47021421875,22.5461,40.70719421875,22.9927,40.78922421875,23.2388C41.01253421875,23.0109,41.37711421875,22.7648,43.72867421875,21.4113C43.66031421875,21.192500000000003,43.56461421875,20.7778,43.53271421875,20.4907L41.923994218749996,21.352L41.923994218749996,18.3123L43.84261421875,18.3123L43.84261421875,17.3507L41.923994218749996,17.3507L41.923994218749996,15.39567L43.53271421875,15.39567L43.53271421875,14.44775L39.61344421875,14.44775L39.61344421875,15.39567L40.95784421875,15.39567L40.95784421875,17.3507L38.99820921875,17.3507ZM48.61862421875,10.286940000000001L48.61862421875,12.18733L46.67268421875,12.18733L46.67268421875,10.286940000000001L45.72021421875,10.286940000000001L45.72021421875,12.18733L44.34847421875,12.18733L44.34847421875,13.112459999999999L45.72021421875,13.112459999999999L45.72021421875,15.03108L44.01123421875,15.03108L44.01123421875,15.979L51.54442421875,15.979L51.54442421875,15.03108L49.58482421875,15.03108L49.58482421875,13.112459999999999L51.220824218749996,13.112459999999999L51.220824218749996,12.18733L49.58482421875,12.18733L49.58482421875,10.286940000000001L48.61862421875,10.286940000000001ZM46.67268421875,13.112459999999999L48.61862421875,13.112459999999999L48.61862421875,15.03108L46.67268421875,15.03108L46.67268421875,13.112459999999999ZM45.78857421875,20.354L49.61212421875,20.354L49.61212421875,21.8214L45.78857421875,21.8214L45.78857421875,20.354ZM45.78857421875,19.5018L45.78857421875,18.0435L49.61212421875,18.0435L49.61212421875,19.5018L45.78857421875,19.5018ZM44.82242421875,17.145699999999998L44.82242421875,23.3527L45.78857421875,23.3527L45.78857421875,22.6873L49.61212421875,22.6873L49.61212421875,23.2935L50.60562421875,23.2935L50.60562421875,17.145699999999998L44.82242421875,17.145699999999998ZM60.06672421875,11.895669999999999L64.60582421875,11.895669999999999L64.60582421875,13.89176L60.06672421875,13.89176L60.06672421875,11.895669999999999ZM59.08692421875,10.97509L59.08692421875,14.81233L65.62662421875,14.81233L65.62662421875,10.97509L59.08692421875,10.97509ZM54.538724218750005,11.353349999999999C55.29522421875,12.01416,56.22042421875,12.9803,56.66702421875,13.60009L57.39622421875,12.80713C56.94502421875,12.214680000000001,55.97882421875,11.307780000000001,55.23602421875,10.683430000000001L54.538724218750005,11.353349999999999ZM58.23472421875,18.604L58.23472421875,19.5428L61.39752421875,19.5428C60.93722421875,20.992,59.97102421875,21.962699999999998,57.829124218749996,22.5552C58.052424218750005,22.7557,58.31672421875,23.175,58.41702421875,23.4211C60.57262421875,22.7557,61.66632421875,21.7303,62.22692421875,20.226399999999998C62.97882421875,21.8032,64.24122421875,22.9152,65.97752421875,23.4666C66.10512421875,23.1613,66.41052421875,22.7557,66.64752421875,22.5415C64.88382421875,22.0903,63.612324218750004,21.033,62.937824218749995,19.5428L66.56542421875,19.5428L66.56542421875,18.604L62.64622421875,18.604C62.71452421875,18.157400000000003,62.76922421875,17.6652,62.801124218750005,17.145699999999998L66.03222421875,17.145699999999998L66.03222421875,16.1978L58.69502421875,16.1978L58.69502421875,17.145699999999998L61.80312421875,17.145699999999998C61.77572421875,17.6789,61.72102421875,18.157400000000003,61.639024218749995,18.604L58.23472421875,18.604ZM55.75552421875,22.9881C55.965224218749995,22.7283,56.316124218750005,22.4549,58.55832421875,20.8325C58.47172421875,20.613799999999998,58.33042421875,20.208199999999998,58.27572421875,19.9347L56.73532421875,20.9783L56.73532421875,14.81233L53.72752421875,14.81233L53.72752421875,15.82405L55.71452421875,15.82405L55.71452421875,20.9191C55.71452421875,21.5116,55.41832421875,21.8442,55.20872421875,21.990099999999998C55.39092421875,22.2225,55.67352421875,22.7283,55.75552421875,22.9881Z"
                    fill="#FFFFFF"
                    fill-opacity="1"
                  />
                </g>
              </g>
            </svg>
          </div>
        )
      } else {
        return '---'
      }
    },
  },
  {
    colKey: 'checkTime',
    title: '核对时间',
    cell: (h, { row }) =>
      row.checkTime ? moment(row.checkTime).format('YYYY-MM-DD HH:mm') : '---',
  },
  {
    colKey: 'nuclearStationName',
    title: '核电站名称',
  },
  {
    colKey: 'nuclearCoreName',
    title: '核反应堆名称',
  },
])
</script>

<style></style>
