<template>
  <a-skeleton v-if="loading" :paragraph="{ rows: 5 }" />
  <a-card v-else :class="$style.logprintCard">
    <a-table
      :row-key="(record, index) => record.dispindex"
      size="middle"
      :columns="showColumns"
      :data-source="dataView"
      :default-expanded-row-keys="logExpandedRowKeys"
      :pagination="false"
      :class="[$style.loginfo, hasChildren ? $style.hasSub : '']"
      children-column-name="subFlowLogInfo"
      :indent-size="10"
    >
      <span slot="finishDate" slot-scope="finishDate">{{
        finishDate | sdDateFormat('YYYY-MM-DD HH:mm')
      }}</span>
      <span slot="sentDate" slot-scope="sentDate">{{
        sentDate | sdDateFormat('YYYY-MM-DD HH:mm')
      }}</span>
      <span slot="createdTime" slot-scope="createdTime">{{
        createdTime | sdDateFormat('YYYY-MM-DD HH:mm')
      }}</span>
      <template slot="opinion" slot-scope="text, record, index">
        <span>{{ record.opinion }}</span>
        <sd-picture-card
          v-if="record.processLogAttachments && record.processLogAttachments.length"
          :picture-arr="record.processLogAttachments"
        ></sd-picture-card>
        <sd-attachment
          v-if="
            record.processLogAttachments &&
              record.processLogAttachments.length &&
              record.processLogAttachments[0].groupCode
          "
          :ref="`${getRowKey(record, index)}_attach`"
          :group-id="record.processLogAttachments[0].groupCode"
          :inst-id="record.instId"
          :read-only="true"
          :cat-num-to-hide="[-2]"
        ></sd-attachment>
        <span v-if="record.trustor"> （{{ record.trustor }}代录） </span>
        <span v-if="record.secretaryAccount"> （{{ record.secretaryName }}代录） </span>
      </template>
    </a-table>
  </a-card>
</template>

<script>
import SdOpinionLogMixins from '@/webflow/sd-opinion-log-mixins'
import components from './_import-components/sd-opinion-log-print-import'

export default {
  name: 'SdOpinionLogPrint',
  metaInfo: {
    title: 'SdOpinionLogPrint',
  },
  components,
  mixins: [SdOpinionLogMixins],
  data() {
    return {}
  },
  methods: {},
}
</script>

<style module lang="scss">
@use '@/common/design' as *;
.logprint-card {
  .loginfo {
    :global(.ant-list-split .ant-list-item) {
      border-bottom: none;
    }
    :global(.ant-table-tbody) {
      td:last-child {
        max-width: 400px;
      }
    }
    .actionicon {
      margin-right: 10px;
    }
    .actionspan {
      min-width: 50px;
    }
    :global(.ant-table-row-cell-break-word) {
      span {
        white-space: pre-wrap;
      }
    }
    &.has-sub {
      th:first-child {
        :global(.ant-table-header-column) {
          margin-left: 25px;
        }
      }
    }
  }
}

:global(.browser-ie) {
  .log-filter {
    /* stylelint-disable-next-line  */
    :global(.ant-select-selection__rendered) {
      display: flex;
      ul {
        display: flex;
        /* stylelint-disable-next-line  */
        :global(.ant-select-selection__choice__content) {
          text-overflow: clip;
        }
      }
    }
  }
}
</style>
