This commit is contained in:
wyuu 2026-09-14 14:44:07 +08:00
parent 54662297d4
commit cf88c111a7
3 changed files with 12 additions and 20 deletions

View File

@ -77,7 +77,6 @@
<script setup lang="ts">
import SelectTable from '@/components/SelectTable/index.vue';
import { getDictData, formatDict, dictData } from '@/hooks'
import { E } from 'vue-router/dist/router-CWoNjPRp.mjs';
const props = defineProps({
labPat: {

View File

@ -233,9 +233,8 @@ import {
updatestatsparam
} from "@/api/liswork/xtwh/StatsparameterApi.ts";
import { liststatstemp, copyParameter } from "@/api/liswork/xtwh/StatstemplateApi.ts";
import { copy } from "clipboard";
const route = useRoute();
// ========== 基础变量声明(避免提前访问) ==========
// 菜单名称
const menuname = ref("参数");
const statsCode = ref("1");
@ -349,7 +348,6 @@ const multiple = ref(true); // 是否多选
const total = ref(0); // 总条数
const title = ref(""); // 对话框标题
// ========== 工具方法 ==========
// 获取类别颜色
function getparamTypeColor(type) {
const item = paramTypeOptions.value.find(item => item.value === type);
@ -380,7 +378,6 @@ function resetForm() {
}
}
// ========== 核心业务方法 ==========
// 查询列表
function getList() {
loading.value = true;
@ -389,18 +386,12 @@ function getList() {
.then(response => {
regdictList.value = response?.rows || [];
total.value = response?.total || 0;
})
.catch(() => {
regdictList.value = [];
total.value = 0;
proxy && proxy.$modal.msgError("数据加载失败");
})
.finally(() => {
}).finally(() => {
loading.value = false;
});
liststatstemp().then(response => {
//获取模板数据
liststatstemp({ pageSize: 100, pageNum: 1 }).then(response => {
copyTemplateOptions.value = response?.rows || [];
})
}

View File

@ -195,13 +195,11 @@ const getSummaries = ({ columns, data }) => {
// return '合计';
// } else
if (isSumColumn) {
// 对合计列求和(处理空值/非数字)
const sum = data.reduce((total, row) => {
const value = Number(row[colField] || 0);
return total + (isNaN(value) ? 0 : value);
const value = Number(row[colField] ?? 0);
return total + (Number.isNaN(value) ? 0 : value);
}, 0);
return sum;
return Math.round(sum * 100) / 100;
} else {
// 非合计列显示空
return '';
@ -258,6 +256,8 @@ const handleCheckBoxChange = (val) => {
// 列双击
const cellDblclickEvent = ({ row }) => {
console.log("🚀 ~ cellDblclickEvent ~ row:", row)
// if(row.paramZct == '1'){
// }
openDetail.value = true
mxtableData.value = []
}
@ -278,7 +278,9 @@ const search = () => {
};
loading.value = true;
getstatsQuery(data).then(res => {
tableData.value = res.data
if (res.code == 0) {
tableData.value = res.data || []
}
}).finally(() => {
loading.value = false;
})