|
@@ -1,17 +1,27 @@
|
|
<template>
|
|
<template>
|
|
- <el-table :data="tableData" style="width: 100%">
|
|
|
|
|
|
+ <el-table
|
|
|
|
+ :data="tableData"
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ :span-method="arraySpanMethod"
|
|
|
|
+ >
|
|
<el-table-column type="index" label="排名" width="80" fixed>
|
|
<el-table-column type="index" label="排名" width="80" fixed>
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- <div v-if="scope.$index > 2" class="diamond">
|
|
|
|
|
|
+ <div
|
|
|
|
+ v-if="scope.$index === 0"
|
|
|
|
+ class="text-center text-sm font-extrabold text-[#000000]"
|
|
|
|
+ >
|
|
|
|
+ 平均分
|
|
|
|
+ </div>
|
|
|
|
+ <div v-if="scope.$index > 3" class="diamond">
|
|
{{ scope.$index + 1 }}
|
|
{{ scope.$index + 1 }}
|
|
</div>
|
|
</div>
|
|
- <div class="text-center">
|
|
|
|
- <img :src="RANK_IMG[scope.$index]" alt="" />
|
|
|
|
|
|
+ <div v-if="scope.$index > 0" class="text-center">
|
|
|
|
+ <img :src="RANK_IMG[scope.$index - 1]" alt="" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="date" label="科室" fixed width="150" />
|
|
<el-table-column prop="date" label="科室" fixed width="150" />
|
|
- <el-table-column prop="date" label="姓名" width="100" />
|
|
|
|
|
|
+ <el-table-column prop="date" label="姓名" fixed width="100" />
|
|
<el-table-column label="数量(5%)">
|
|
<el-table-column label="数量(5%)">
|
|
<el-table-column prop="state" label="出院人次(5%)" width="140" sortable />
|
|
<el-table-column prop="state" label="出院人次(5%)" width="140" sortable />
|
|
<el-table-column prop="city" label="手术人次(15%)" width="140" />
|
|
<el-table-column prop="city" label="手术人次(15%)" width="140" />
|
|
@@ -62,11 +72,12 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
|
+import { computed, reactive } from "vue";
|
|
import rank1 from "@/assets/rank/rank1.png";
|
|
import rank1 from "@/assets/rank/rank1.png";
|
|
import rank2 from "@/assets/rank/rank2.png";
|
|
import rank2 from "@/assets/rank/rank2.png";
|
|
import rank3 from "@/assets/rank/rank3.png";
|
|
import rank3 from "@/assets/rank/rank3.png";
|
|
const RANK_IMG = [rank1, rank2, rank3];
|
|
const RANK_IMG = [rank1, rank2, rank3];
|
|
-const tableData = [
|
|
|
|
|
|
+const tableData = reactive([
|
|
{
|
|
{
|
|
date: "2016-05-03",
|
|
date: "2016-05-03",
|
|
name: "Tom",
|
|
name: "Tom",
|
|
@@ -99,7 +110,31 @@ const tableData = [
|
|
address: "No. 189, Grove St, Los Angeles",
|
|
address: "No. 189, Grove St, Los Angeles",
|
|
zip: "CA 90036"
|
|
zip: "CA 90036"
|
|
}
|
|
}
|
|
-];
|
|
|
|
|
|
+]);
|
|
|
|
+const averageData = () => {
|
|
|
|
+ tableData.unshift({
|
|
|
|
+ date: "",
|
|
|
|
+ name: "",
|
|
|
|
+ state: "",
|
|
|
|
+ city: "",
|
|
|
|
+ address: "",
|
|
|
|
+ zip: ""
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+averageData();
|
|
|
|
+const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => {
|
|
|
|
+ // 合并第一行的“排名”、“科室”和“姓名”
|
|
|
|
+ if (rowIndex === 0) {
|
|
|
|
+ if (columnIndex === 0) {
|
|
|
|
+ return [1, 3]; // “排名”合并三列
|
|
|
|
+ } else if (columnIndex === 1) {
|
|
|
|
+ return [0, 0]; // “科室”不显示
|
|
|
|
+ } else if (columnIndex === 2) {
|
|
|
|
+ return [0, 0]; // “姓名”不显示
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return [1, 1]; // 其他单元格正常显示
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|