Compare commits
4 Commits
1507e1a725
...
91bba8de8a
Author | SHA1 | Date | |
---|---|---|---|
![]() |
91bba8de8a | ||
![]() |
a5f67793b6 | ||
![]() |
7b7496dae1 | ||
![]() |
f549b084a8 |
21
__unconfig_vite.config.js
Normal file
21
__unconfig_vite.config.js
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
let __unconfig_data;
|
||||||
|
let __unconfig_stub = function (data = {}) { __unconfig_data = data };
|
||||||
|
__unconfig_stub.default = (data = {}) => { __unconfig_data = data };
|
||||||
|
import { defineConfig } from 'vite'
|
||||||
|
import vue from '@vitejs/plugin-vue'
|
||||||
|
|
||||||
|
// https://vite.dev/config/
|
||||||
|
const __unconfig_default = defineConfig({
|
||||||
|
plugins: [vue()],
|
||||||
|
define: {
|
||||||
|
'import.meta.env.MODE': JSON.stringify(process.env.NODE_ENV || 'development')
|
||||||
|
},
|
||||||
|
server: {
|
||||||
|
host: '0.0.0.0', // 允许从任何IP访问
|
||||||
|
port: 5173, // 前端端口
|
||||||
|
strictPort: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (typeof __unconfig_default === "function") __unconfig_default(...[{"command":"serve","mode":"development"}]);export default __unconfig_data;
|
@ -860,7 +860,7 @@ const initCharts = () => {
|
|||||||
const labLineChart = echarts.init(labLineChartRef.value)
|
const labLineChart = echarts.init(labLineChartRef.value)
|
||||||
labLineChart.setOption({
|
labLineChart.setOption({
|
||||||
title: {
|
title: {
|
||||||
text: '近三年科研成果增长曲线',
|
text: '科研成果增长曲线',
|
||||||
textStyle: {
|
textStyle: {
|
||||||
color: 'rgba(255, 255, 255, 0.8)',
|
color: 'rgba(255, 255, 255, 0.8)',
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
@ -885,6 +885,7 @@ const initCharts = () => {
|
|||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
|
max: 100,
|
||||||
axisLine: { lineStyle: { color: '#fff' } },
|
axisLine: { lineStyle: { color: '#fff' } },
|
||||||
axisLabel: { color: '#fff' },
|
axisLabel: { color: '#fff' },
|
||||||
splitLine: {
|
splitLine: {
|
||||||
|
@ -24,6 +24,33 @@
|
|||||||
<span class="home-link" @click="jumpToDashboard">首页</span> > 工程研究中心评估
|
<span class="home-link" @click="jumpToDashboard">首页</span> > 工程研究中心评估
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="searchbox">
|
||||||
|
<!-- 新增:得分比较按钮组 -->
|
||||||
|
<div class="score-comparison-wrapper">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
v-if="!scoreComparisonMode"
|
||||||
|
class="compare-score-btn"
|
||||||
|
@click="toggleScoreComparisonMode"
|
||||||
|
>
|
||||||
|
得分比较
|
||||||
|
</el-button>
|
||||||
|
<template v-else>
|
||||||
|
<el-button class="compare-score-btn close-btn" @click="toggleScoreComparisonMode">
|
||||||
|
关闭
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
class="compare-score-btn start-compare-btn"
|
||||||
|
@click="openScoreComparisonDialog"
|
||||||
|
:disabled="selectedLabs.length < 2"
|
||||||
|
:class="{ 'disabled-btn': selectedLabs.length < 2 }"
|
||||||
|
>
|
||||||
|
开始比较 ({{ selectedLabs.length }})
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
<!-- 搜索框 -->
|
||||||
<div class="search-box">
|
<div class="search-box">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
@ -42,21 +69,26 @@
|
|||||||
新增评估
|
新增评估
|
||||||
</button> -->
|
</button> -->
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 工程研究中心卡片列表 -->
|
<!-- 工程研究中心卡片列表 -->
|
||||||
<div class="lab-card-grid custom-scrollbar">
|
<div class="lab-card-grid custom-scrollbar">
|
||||||
<!-- <div v-for="(lab, index) in filteredLabs" :key="index" class="lab-card" style="height: 440px;"> -->
|
<div v-for="(lab) in filteredLabs" :key="lab.id" class="lab-card">
|
||||||
<div v-for="(lab, index) in filteredLabs" :key="index" class="lab-card" style="height: 440px;" @click="openLabDetail(lab)">
|
<!-- 复选框 -->
|
||||||
<div class="card-header">
|
<div v-if="scoreComparisonMode" class="card-checkbox-wrapper">
|
||||||
<span class="lab-id">ID: {{ lab.basicInformation.name1 || lab.id }}</span>
|
<input
|
||||||
<span class="total-score">时间: <span class="score-value">{{ lab.basicInformation.name0 }}</span></span>
|
type="checkbox"
|
||||||
|
v-model="lab.selected"
|
||||||
|
@change="handleLabSelection(lab)"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card-content">
|
<div class="card-header" @click="openLabDetail(lab)">
|
||||||
<!-- <div class="lab-image">
|
<span class="lab-id" :style="scoreComparisonMode?'margin-left: 40px;':''">ID: {{ lab.basicInformation.name1 || lab.id }}</span>
|
||||||
<img :src="lab.basicInformation.name5" alt="工程研究中心图片" />
|
<span class="total-score">年份: <span class="score-value">{{ lab.basicInformation.name0 }}</span></span>
|
||||||
</div> -->
|
</div>
|
||||||
|
|
||||||
|
<div class="card-content" @click="openLabDetail(lab)">
|
||||||
<div class="lab-info">
|
<div class="lab-info">
|
||||||
<div class="info-item">
|
<div class="info-item">
|
||||||
<span class="info-label">中心名称:</span>
|
<span class="info-label">中心名称:</span>
|
||||||
@ -74,13 +106,14 @@
|
|||||||
<span class="info-label">主管部门:</span>
|
<span class="info-label">主管部门:</span>
|
||||||
<span class="info-value">{{ lab.basicInformation.name5 }}</span>
|
<span class="info-value">{{ lab.basicInformation.name5 }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="evaluation-chart">
|
<div class="evaluation-chart" @click="openLabDetail(lab)">
|
||||||
<div :id="`lab-chart-${index}`" class="radar-chart"></div>
|
<div :id="`lab-chart-${lab.id}`" class="radar-chart"></div> <!-- 根据lab.id确保唯一性 -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="evaluation-info">评估摘要:{{ lab.abstracts }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -101,10 +134,47 @@
|
|||||||
:lab-data="selectedLab"
|
:lab-data="selectedLab"
|
||||||
@save="handleSaveEvaluation"
|
@save="handleSaveEvaluation"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<!-- 得分比较弹窗 -->
|
||||||
|
<el-dialog
|
||||||
|
v-model="scoreComparisonDialogVisible"
|
||||||
|
title="得分比较"
|
||||||
|
width="70%"
|
||||||
|
center
|
||||||
|
:append-to-body="true"
|
||||||
|
class="score-comparison-dialog"
|
||||||
|
>
|
||||||
|
<el-table
|
||||||
|
:data="scoreComparisonTableData"
|
||||||
|
style="width: 100%"
|
||||||
|
border
|
||||||
|
stripe
|
||||||
|
class="default-table score-comparison-table"
|
||||||
|
:row-class-name="tableRowClassName"
|
||||||
|
>
|
||||||
|
<el-table-column prop="category" label="" width="180"></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
v-for="(header) in scoreComparisonHeaders"
|
||||||
|
:key="header.prop"
|
||||||
|
:prop="header.prop"
|
||||||
|
:label="header.label"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template #default="{ row }">
|
||||||
|
<span :class="{
|
||||||
|
'max-score-in-column': Number(row[header.prop]) === columnStats[header.prop]?.max,
|
||||||
|
'min-score-in-column': Number(row[header.prop]) === columnStats[header.prop]?.min
|
||||||
|
}">
|
||||||
|
{{ row[header.prop] }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, watch, nextTick } from 'vue';
|
import { ref, onMounted, watch, nextTick, computed, onBeforeUnmount } from 'vue'; // 引入 onBeforeUnmount
|
||||||
import * as echarts from 'echarts/core';
|
import * as echarts from 'echarts/core';
|
||||||
import { RadarChart } from 'echarts/charts';
|
import { RadarChart } from 'echarts/charts';
|
||||||
import LabDrawerDetail from './LabDrawerDetail.vue';
|
import LabDrawerDetail from './LabDrawerDetail.vue';
|
||||||
@ -117,7 +187,7 @@ import {
|
|||||||
} from 'echarts/components';
|
} from 'echarts/components';
|
||||||
import { CanvasRenderer } from 'echarts/renderers';
|
import { CanvasRenderer } from 'echarts/renderers';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage, ElDialog, ElTable, ElTableColumn } from 'element-plus';
|
||||||
import { getApiBaseUrl } from '../config'; // 导入API基础URL函数
|
import { getApiBaseUrl } from '../config'; // 导入API基础URL函数
|
||||||
|
|
||||||
// 注册必要的 echarts 组件
|
// 注册必要的 echarts 组件
|
||||||
@ -135,6 +205,14 @@ const isEditMode = ref(false);
|
|||||||
const selectedLab = ref(null);
|
const selectedLab = ref(null);
|
||||||
const dimensionDrawerVisible = ref(false);
|
const dimensionDrawerVisible = ref(false);
|
||||||
|
|
||||||
|
// 得分比较相关响应式变量
|
||||||
|
const scoreComparisonMode = ref(false); // 是否处于得分比较模式
|
||||||
|
const selectedLabs = ref([]); // 存储选中的 Lab Card 数据
|
||||||
|
const scoreComparisonDialogVisible = ref(false); // 控制得分比较弹窗显示
|
||||||
|
|
||||||
|
// 存储 Echarts 实例,用于销毁
|
||||||
|
const chartInstances = new Map();
|
||||||
|
|
||||||
// 打开添加评估抽屉
|
// 打开添加评估抽屉
|
||||||
const openAddEvaluationDrawer = () => {
|
const openAddEvaluationDrawer = () => {
|
||||||
isEditMode.value = false;
|
isEditMode.value = false;
|
||||||
@ -194,11 +272,27 @@ onMounted(async () => {
|
|||||||
await loadLabs();
|
await loadLabs();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 组件销毁前,销毁所有 Echarts 实例和事件监听器
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
chartInstances.forEach(chart => {
|
||||||
|
chart.dispose();
|
||||||
|
});
|
||||||
|
chartInstances.clear();
|
||||||
|
window.removeEventListener('resize', debounceResize); // 移除全局resize监听
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// 加载工程研究中心数据
|
// 加载工程研究中心数据
|
||||||
const loadLabs = async () => {
|
const loadLabs = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await axios.get(`${getApiBaseUrl()}/admin-api/pg/evaluation-results/get-release`);
|
const response = await axios.get(`${getApiBaseUrl()}/admin-api/pg/evaluation-results/get-release`);
|
||||||
labs.value = response.data.data;
|
// 为每个lab添加selected属性,并确保它是一个响应式引用
|
||||||
|
// 同时确保 result 数组中的数据是数字类型
|
||||||
|
labs.value = response.data.data.map(lab => ({
|
||||||
|
...lab,
|
||||||
|
selected: false,
|
||||||
|
result: lab.result.map(Number) // 确保 radarData 转换为数字
|
||||||
|
}));
|
||||||
// 先更新过滤的工程研究中心列表
|
// 先更新过滤的工程研究中心列表
|
||||||
handleSearch();
|
handleSearch();
|
||||||
// 给一个短暂的延时,确保DOM已经更新
|
// 给一个短暂的延时,确保DOM已经更新
|
||||||
@ -210,36 +304,55 @@ const loadLabs = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 编辑维度
|
// 节流函数 for resize
|
||||||
const editDimension = (dim, index) => {
|
const debounce = (fn, delay) => {
|
||||||
// 打开维度设置抽屉
|
let timer = null;
|
||||||
openDimensionDrawer();
|
return function() {
|
||||||
|
const context = this;
|
||||||
|
const args = arguments;
|
||||||
|
clearTimeout(timer);
|
||||||
|
timer = setTimeout(() => {
|
||||||
|
fn.apply(context, args);
|
||||||
|
}, delay);
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const debounceResize = debounce(() => {
|
||||||
|
chartInstances.forEach(chart => {
|
||||||
|
chart && chart.resize();
|
||||||
|
});
|
||||||
|
}, 300); // 300ms 节流
|
||||||
|
|
||||||
// 更新所有雷达图
|
// 更新所有雷达图
|
||||||
const updateAllRadarCharts = () => {
|
const updateAllRadarCharts = () => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
filteredLabs.value.forEach((lab, index) => {
|
// 先销毁不再存在的图表实例
|
||||||
const chartDom = document.getElementById(`lab-chart-${index}`);
|
const currentLabIds = new Set(filteredLabs.value.map(lab => lab.id));
|
||||||
|
chartInstances.forEach((chart, id) => {
|
||||||
|
if (!currentLabIds.has(id)) {
|
||||||
|
chart.dispose();
|
||||||
|
chartInstances.delete(id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
filteredLabs.value.forEach((lab) => {
|
||||||
|
const chartDom = document.getElementById(`lab-chart-${lab.id}`);
|
||||||
if (!chartDom) return;
|
if (!chartDom) return;
|
||||||
|
|
||||||
// 先清空之前的图表实例,避免重复创建
|
let chart = chartInstances.get(lab.id);
|
||||||
echarts.dispose(chartDom);
|
if (!chart) {
|
||||||
const chart = echarts.init(chartDom);
|
chart = echarts.init(chartDom);
|
||||||
|
chartInstances.set(lab.id, chart);
|
||||||
|
// 只在第一次创建时添加 resize 监听
|
||||||
|
window.addEventListener('resize', debounceResize);
|
||||||
|
}
|
||||||
|
|
||||||
// 从二级维度生成指标
|
// 从二级维度生成指标
|
||||||
// const indicators = lab.dimension;
|
const indicators = lab.dimension.map(name => ({ name: name, max: 50 })); // 假设最大值为50
|
||||||
const indicators = lab.dimension.map(index => ({ name: index, max: 50}));
|
|
||||||
// 准备雷达图数据
|
// 准备雷达图数据
|
||||||
let radarData = lab.result;
|
let radarData = lab.result; // 已确保为数字数组
|
||||||
|
|
||||||
|
|
||||||
console.log('radarData:', indicators,radarData);
|
|
||||||
chart.setOption({
|
chart.setOption({
|
||||||
// tooltip: {
|
|
||||||
// trigger: 'item', // 触发类型为数据项
|
|
||||||
// formatter: '{b}: {c}' // 提示框内容格式,b 为数据项名称,c 为数值
|
|
||||||
// },
|
|
||||||
radar: {
|
radar: {
|
||||||
indicator: indicators,
|
indicator: indicators,
|
||||||
splitArea: {
|
splitArea: {
|
||||||
@ -297,11 +410,6 @@ const updateAllRadarCharts = () => {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
// 添加窗口大小变化时的图表调整
|
|
||||||
window.addEventListener('resize', () => {
|
|
||||||
chart && chart.resize();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -315,7 +423,7 @@ const handleSearch = () => {
|
|||||||
filteredLabs.value = labs.value;
|
filteredLabs.value = labs.value;
|
||||||
} else {
|
} else {
|
||||||
filteredLabs.value = labs.value.filter(lab =>
|
filteredLabs.value = labs.value.filter(lab =>
|
||||||
lab.basicInformation.name2 && lab.basicInformation.name2.includes(searchQuery.value) ||
|
(lab.basicInformation.name2 && lab.basicInformation.name2.includes(searchQuery.value)) ||
|
||||||
(lab.basicInformation.name1 && lab.basicInformation.name1.includes(searchQuery.value))
|
(lab.basicInformation.name1 && lab.basicInformation.name1.includes(searchQuery.value))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -328,19 +436,173 @@ const handleSearch = () => {
|
|||||||
|
|
||||||
// 打开工程研究中心详情抽屉
|
// 打开工程研究中心详情抽屉
|
||||||
const openLabDetail = async (lab) => {
|
const openLabDetail = async (lab) => {
|
||||||
// const response = await axios.get(`${getApiBaseUrl()}/pg/evaluation-results/get-preview?id=${lab.id}`);
|
// 如果在比较模式,点击卡片不打开详情
|
||||||
// console.log('responseresponseresponseresponse',response)
|
if (scoreComparisonMode.value) return;
|
||||||
selectedLab.value = lab;
|
selectedLab.value = lab;
|
||||||
isEditMode.value = true;
|
isEditMode.value = true;
|
||||||
drawerVisible.value = true;
|
drawerVisible.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// --- 得分比较功能实现 ---
|
||||||
|
|
||||||
|
// 切换得分比较模式
|
||||||
|
const toggleScoreComparisonMode = () => {
|
||||||
|
scoreComparisonMode.value = !scoreComparisonMode.value;
|
||||||
|
if (!scoreComparisonMode.value) {
|
||||||
|
// 关闭模式时,清空所有选中状态
|
||||||
|
filteredLabs.value.forEach(lab => {
|
||||||
|
lab.selected = false;
|
||||||
|
});
|
||||||
|
selectedLabs.value = [];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 处理 Lab Card 选中状态变化
|
||||||
|
const handleLabSelection = (lab) => {
|
||||||
|
// 使用 Vue 的响应式方法确保数组更新被追踪
|
||||||
|
if (lab.selected) {
|
||||||
|
selectedLabs.value.push(lab);
|
||||||
|
} else {
|
||||||
|
selectedLabs.value = selectedLabs.value.filter(item => item.id !== lab.id);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 计算得分比较表格的横向表头
|
||||||
|
const scoreComparisonHeaders = computed(() => {
|
||||||
|
if (selectedLabs.value.length === 0) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
// 取第一个选中 Lab 的 dimension 作为横向表头
|
||||||
|
const firstLabDimensions = selectedLabs.value[0].dimension;
|
||||||
|
return firstLabDimensions.map((dim, index) => ({
|
||||||
|
prop: `score${index + 1}`, // 动态生成属性名,例如 score1, score2
|
||||||
|
label: dim
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
|
||||||
|
// 计算得分比较表格的数据
|
||||||
|
const scoreComparisonTableData = computed(() => {
|
||||||
|
if (selectedLabs.value.length === 0) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return selectedLabs.value.map(lab => {
|
||||||
|
const row = {
|
||||||
|
category: lab.basicInformation.name2 // 纵向表头是中心名称
|
||||||
|
};
|
||||||
|
// 将 radarData 映射到 row 的动态属性上
|
||||||
|
lab.result.forEach((score, index) => {
|
||||||
|
row[`score${index + 1}`] = score;
|
||||||
|
});
|
||||||
|
return row;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 新增:计算每列的最大值和最小值
|
||||||
|
const columnStats = computed(() => {
|
||||||
|
const stats = {};
|
||||||
|
if (scoreComparisonTableData.value.length === 0 || scoreComparisonHeaders.value.length === 0) {
|
||||||
|
return stats;
|
||||||
|
}
|
||||||
|
|
||||||
|
scoreComparisonHeaders.value.forEach(header => {
|
||||||
|
const prop = header.prop;
|
||||||
|
// 确保在计算最大最小值时,所有值都是数字
|
||||||
|
const values = scoreComparisonTableData.value.map(row => Number(row[prop]));
|
||||||
|
if (values.length > 0) {
|
||||||
|
stats[prop] = {
|
||||||
|
max: Math.max(...values),
|
||||||
|
min: Math.min(...values)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// console.log("Calculated columnStats:", stats); // 调试输出
|
||||||
|
return stats;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 表格行样式,用于隔行高亮
|
||||||
|
const tableRowClassName = ({ rowIndex }) => {
|
||||||
|
if (rowIndex % 2 === 1) {
|
||||||
|
return 'striped-row'; // 奇数行应用条纹样式
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 打开得分比较弹窗
|
||||||
|
const openScoreComparisonDialog = () => {
|
||||||
|
if (selectedLabs.value.length < 2) {
|
||||||
|
ElMessage.warning('请至少选择两个工程研究中心进行比较!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
scoreComparisonDialogVisible.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 监听 filteredLabs 变化,更新雷达图
|
||||||
|
// 这里不再需要深度监听,因为 lab.id 变化不会频繁,内部数据的变化由 ECharts 自身处理
|
||||||
|
watch(filteredLabs, () => {
|
||||||
|
nextTick(() => {
|
||||||
|
updateAllRadarCharts();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
/* common.css 保持不变,用于全局样式 */
|
||||||
@import './common.css';
|
@import './common.css';
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.default-table {
|
||||||
|
background-color: white; /* 表格背景色为白色 */
|
||||||
|
color: black; /* 文字颜色为黑色 */
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 新增:得分比较表格的特定样式 */
|
||||||
|
.score-comparison-table {
|
||||||
|
max-height: 60vh; /* 设置最大高度,例如视口高度的60% */
|
||||||
|
overflow-y: auto; /* 当内容超出最大高度时,显示垂直滚动条 */
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.default-table th.el-table__cell {
|
||||||
|
background-color: #f5f7fa !important; /* 表头背景色浅灰 */
|
||||||
|
color: black !important;
|
||||||
|
font-weight: bold;
|
||||||
|
border-right: 1px solid #ebeef5 !important;
|
||||||
|
border-bottom: 1px solid #ebeef5 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.default-table td.el-table__cell {
|
||||||
|
background-color: white !important; /* 单元格背景色白色 */
|
||||||
|
color: black !important;
|
||||||
|
border-right: 1px solid #ebeef5 !important;
|
||||||
|
border-bottom: 1px solid #ebeef5 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.default-table tr:hover > td {
|
||||||
|
background-color: #f0f2f5 !important; /* 行悬停背景色更浅的灰色 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 条纹样式 */
|
||||||
|
.default-table.el-table--striped .el-table__body tr.striped-row td {
|
||||||
|
background-color: #fafafa !important; /* 条纹行背景色,比默认单元格略深 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 最大值和最小值高亮 */
|
||||||
|
.max-score-in-column {
|
||||||
|
color: red; /* 红色 */
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.min-score-in-column {
|
||||||
|
color: blue; /* 蓝色 */
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
.evaluation-page {
|
.evaluation-page {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@ -553,21 +815,30 @@ const openLabDetail = async (lab) => {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
max-height: calc(100vh - 100px); /* 限制最大高度 */
|
max-height: none;
|
||||||
|
height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 搜索和操作栏 */
|
/* 搜索和操作栏 */
|
||||||
.action-bar {
|
.action-bar {
|
||||||
height: 64px;
|
height: 64px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between; /* 使得左中右元素分散对齐 */
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* 新增:得分比较按钮组容器,与搜索框分离 */
|
||||||
|
.score-comparison-wrapper {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px; /* 按钮之间的间距 */
|
||||||
|
margin-right: 20px; /* 与搜索框的间距 */
|
||||||
|
}
|
||||||
|
|
||||||
.search-box {
|
.search-box {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 300px;
|
width: 300px; /* 调整宽度,不再包含得分比较按钮 */
|
||||||
background-color: rgba(255,255,255,0.1);
|
background-color: rgba(255,255,255,0.1);
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@ -614,26 +885,29 @@ const openLabDetail = async (lab) => {
|
|||||||
|
|
||||||
/* 工程研究中心卡片网格 */
|
/* 工程研究中心卡片网格 */
|
||||||
.lab-card-grid {
|
.lab-card-grid {
|
||||||
display: grid;
|
display: flex; /* 使用 flex 布局 */
|
||||||
grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
|
flex-wrap: wrap; /* 允许项目换行 */
|
||||||
gap: 20px;
|
gap: 20px; /* 项目间的间距 */
|
||||||
overflow-y: auto; /* 允许卡片区域滚动 */
|
|
||||||
flex: 1;
|
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
background-color: #262F50;
|
background-color: #262F50;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
overflow-y: auto;
|
||||||
|
justify-content: flex-start;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lab-card {
|
.lab-card {
|
||||||
|
box-sizing: border-box;
|
||||||
|
flex: 0 0 calc((100% - 40px) / 3);
|
||||||
background-color: #1f3266;
|
background-color: #1f3266;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border: 1px solid rgba(73,134,255,0.3);
|
border: 1px solid rgba(73,134,255,0.3);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
min-height: 350px; /* 调整最小高度,确保雷达图有足够空间 */
|
min-height: 350px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: transform 0.2s, box-shadow 0.2s;
|
transition: transform 0.2s, box-shadow 0.2s;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lab-card:hover {
|
.lab-card:hover {
|
||||||
@ -641,6 +915,31 @@ const openLabDetail = async (lab) => {
|
|||||||
box-shadow: 0 5px 15px rgba(0,0,0,0.3);
|
box-shadow: 0 5px 15px rgba(0,0,0,0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 复选框容器样式 */
|
||||||
|
.card-checkbox-wrapper {
|
||||||
|
position: absolute;
|
||||||
|
top: 4px; /* 距离顶部 */
|
||||||
|
left: 8px; /* 距离左侧 */
|
||||||
|
z-index: 10; /* 确保在最上层 */
|
||||||
|
background-color: rgba(0, 0, 0, 0.3); /* 半透明黑色背景 */
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 4px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 28px; /* 确保有足够点击区域 */
|
||||||
|
height: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-checkbox-wrapper input[type="checkbox"] {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
cursor: pointer;
|
||||||
|
accent-color: #4986ff; /* 改变复选框颜色 */
|
||||||
|
margin: 0; /* 移除默认外边距 */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.card-header {
|
.card-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@ -653,6 +952,7 @@ const openLabDetail = async (lab) => {
|
|||||||
.lab-id {
|
.lab-id {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: rgba(255,255,255,0.7);
|
color: rgba(255,255,255,0.7);
|
||||||
|
/* 确保ID不被复选框遮挡,如果复选框在左边,这里可能需要调整padding-left或margin-left */
|
||||||
}
|
}
|
||||||
|
|
||||||
.total-score {
|
.total-score {
|
||||||
@ -687,14 +987,16 @@ const openLabDetail = async (lab) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.lab-info {
|
.lab-info {
|
||||||
width: 60%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: row; /* 修改为横向排列 */
|
||||||
|
flex-wrap: wrap; /* 允许元素换行 */
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-item {
|
.info-item {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
|
width: calc(50% - 5px); /* 每个元素占一半宽度,减去 gap 的一半 */
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-label {
|
.info-label {
|
||||||
@ -756,6 +1058,49 @@ const openLabDetail = async (lab) => {
|
|||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 得分比较按钮样式 */
|
||||||
|
.compare-score-btn {
|
||||||
|
background-color: rgb(13, 70, 192);
|
||||||
|
border: none;
|
||||||
|
color: rgba(255,255,255,1);
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 8px 15px;
|
||||||
|
font-size: 14px;
|
||||||
|
text-align: center;
|
||||||
|
font-family: PingFangSC-regular;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 0.2s, border-color 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.compare-score-btn:hover {
|
||||||
|
background-color: rgba(14,62,167,0.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
.compare-score-btn.close-btn {
|
||||||
|
background-color: #f44336; /* 红色 */
|
||||||
|
border-color: #f44336;
|
||||||
|
}
|
||||||
|
|
||||||
|
.compare-score-btn.close-btn:hover {
|
||||||
|
background-color: #d32f2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.compare-score-btn.start-compare-btn {
|
||||||
|
background-color: #4CAF50; /* 绿色 */
|
||||||
|
border-color: #4CAF50;
|
||||||
|
}
|
||||||
|
|
||||||
|
.compare-score-btn.start-compare-btn:hover {
|
||||||
|
background-color: #388E3C;
|
||||||
|
}
|
||||||
|
|
||||||
|
.compare-score-btn.disabled-btn {
|
||||||
|
background-color: #616161; /* 灰色 */
|
||||||
|
border-color: #616161;
|
||||||
|
cursor: not-allowed;
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 1200px) {
|
@media (max-width: 1200px) {
|
||||||
.lab-card-grid {
|
.lab-card-grid {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
@ -781,4 +1126,10 @@ const openLabDetail = async (lab) => {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.searchbox{
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.evaluation-info{
|
||||||
|
padding: 20px 15px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
@ -15,6 +15,10 @@
|
|||||||
<span class="label">编号:</span>
|
<span class="label">编号:</span>
|
||||||
<span class="display-text">{{ labData.basicInformation.name1 }}</span>
|
<span class="display-text">{{ labData.basicInformation.name1 }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-item">
|
||||||
|
<span class="label">年份:</span>
|
||||||
|
<span class="display-text">{{ labData.basicInformation.name0 }}</span>
|
||||||
|
</div>
|
||||||
<div class="form-item">
|
<div class="form-item">
|
||||||
<span class="label">中心名称:</span>
|
<span class="label">中心名称:</span>
|
||||||
<span class="display-text">{{ labData.basicInformation.name2 }}</span>
|
<span class="display-text">{{ labData.basicInformation.name2 }}</span>
|
||||||
@ -42,9 +46,8 @@
|
|||||||
<div class="detail-sections">
|
<div class="detail-sections">
|
||||||
<!-- 新增:总分显示 -->
|
<!-- 新增:总分显示 -->
|
||||||
<div class="overall-score-section">
|
<div class="overall-score-section">
|
||||||
<h3 class="section-title">详细信息</h3>
|
|
||||||
<div>
|
<div>
|
||||||
<span class="overall-score-label">总分:</span>
|
<span class="overall-score-label">评估总分:</span>
|
||||||
<span class="overall-score-value">{{ overallTotalScore }}</span>
|
<span class="overall-score-value">{{ overallTotalScore }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -58,7 +61,7 @@
|
|||||||
<div v-for="(categoryItem, index) in labData.resultList" :key="index" class="category-section">
|
<div v-for="(categoryItem, index) in labData.resultList" :key="index" class="category-section">
|
||||||
<h4 class="category-title">
|
<h4 class="category-title">
|
||||||
{{ categoryItem.category }}
|
{{ categoryItem.category }}
|
||||||
<span>总分: {{ calculateCategoryTotal(categoryItem.result) }} / 满分: {{ labData.scoreList[index] }}</span>
|
<span>得分: {{ calculateCategoryTotal(categoryItem.result) }} / 满分: {{ labData.scoreList[index] }}</span>
|
||||||
</h4>
|
</h4>
|
||||||
<div class="category-content">
|
<div class="category-content">
|
||||||
<div v-for="(item, itemIndex) in categoryItem.result" :key="itemIndex" class="category-item">
|
<div v-for="(item, itemIndex) in categoryItem.result" :key="itemIndex" class="category-item">
|
||||||
@ -622,7 +625,7 @@ const handleClose = () => {
|
|||||||
color: #4986ff;
|
color: #4986ff;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: center;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
.overall-score-section h3{
|
.overall-score-section h3{
|
||||||
|
@ -60,9 +60,8 @@
|
|||||||
|
|
||||||
<!-- 新增:总分显示 -->
|
<!-- 新增:总分显示 -->
|
||||||
<div class="overall-score-section">
|
<div class="overall-score-section">
|
||||||
<h3 class="section-title">详细信息</h3>
|
|
||||||
<div>
|
<div>
|
||||||
<span class="overall-score-label">总分:</span>
|
<span class="overall-score-label">评估总分:</span>
|
||||||
<span class="overall-score-value">{{ overallTotalScore }}</span>
|
<span class="overall-score-value">{{ overallTotalScore }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -75,7 +74,7 @@
|
|||||||
<div v-for="(categoryItem, index) in teacherData.resultList" :key="index" class="category-section">
|
<div v-for="(categoryItem, index) in teacherData.resultList" :key="index" class="category-section">
|
||||||
<h4 class="category-title">
|
<h4 class="category-title">
|
||||||
{{ categoryItem.category }}
|
{{ categoryItem.category }}
|
||||||
<span>总分: {{ calculateCategoryTotal(categoryItem.result) }} / 满分: {{ teacherData.scoreList[index] }}</span>
|
<span>得分: {{ calculateCategoryTotal(categoryItem.result) }} / 满分: {{ teacherData.scoreList[index] }}</span>
|
||||||
</h4>
|
</h4>
|
||||||
<div class="category-content">
|
<div class="category-content">
|
||||||
<div v-for="(item, itemIndex) in categoryItem.result" :key="itemIndex" class="category-item">
|
<div v-for="(item, itemIndex) in categoryItem.result" :key="itemIndex" class="category-item">
|
||||||
@ -407,7 +406,7 @@ const handleClose = () => {
|
|||||||
color: #4986ff;
|
color: #4986ff;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: center;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
.overall-score-section h3{
|
.overall-score-section h3{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user