<template>
  <base-model :config="model_cfg">
    <div slot="dialog-body">
      <el-table :data="modelList" style="width: 100%" height="300">
        <!--检查编号-->
        <el-table-column
          prop="StudyCode"
          :label="$t('trials:uploadImage:table:StudyCode')"
        />
        <!--检查类型-->
        <el-table-column
          prop="ModalityForEdit"
          :label="$t('trials:uploadImage:table:ModalityForEdit')"
        />
        <!--检查模态-->
        <el-table-column
          prop="Modalities"
          :label="$t('trials:uploadImage:table:Modalities')"
        />
        <!--检查部位-->
        <el-table-column
          prop="BodyPartForEdit"
          :label="$t('trials:uploadImage:table:BodyPartForEdit')"
        />
        <!--序列数量-->
        <el-table-column
          prop="SeriesCount"
          :label="$t('trials:uploadImage:table:SeriesCount')"
        />
        <!--图像数量-->
        <el-table-column
          prop="InstanceCount"
          :label="$t('trials:uploadImage:table:InstanceCount')"
        />
        <!--检查时间-->
        <el-table-column
          prop="StudyTime"
          :label="$t('trials:uploadImage:table:StudyTime')"
          min-width="130"
        />
        <el-table-column
          :label="$t('common:action:action')"
          fixed="right"
          width="80"
        >
          <template slot-scope="scope">
            <!--预览--->
            <el-button
              circle
              icon="el-icon-view"
              :title="$t('trials:uploadImage:button:download')"
              @click.stop="preview(scope.row)"
            />
          </template>
        </el-table-column>
      </el-table>
    </div>
  </base-model>
</template>
<script>
import baseModel from "@/components/BaseModel";
import { getToken } from "@/utils/auth";
export default {
  name: "studyView",
  props: {
    model_cfg: {
      type: Object,
      default: () => {
        return {};
      },
    },
    modelList: {
      type: Array,
      default: () => {
        return [];
      },
    },
  },
  components: {
    "base-model": baseModel,
  },
  methods: {
    // 预览
    preview(row) {
      var token = getToken();
      const routeData = this.$router.resolve({
        path: `/showdicom?studyId=${row.Id}&TokenKey=${token}&type=Study`,
      });
      window.open(routeData.href, "_blank");
    },
  },
};
</script>
<style lang="scss" scoped>
</style>