统计
This commit is contained in:
parent
54662297d4
commit
cf88c111a7
@ -77,7 +77,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import SelectTable from '@/components/SelectTable/index.vue';
|
import SelectTable from '@/components/SelectTable/index.vue';
|
||||||
import { getDictData, formatDict, dictData } from '@/hooks'
|
import { getDictData, formatDict, dictData } from '@/hooks'
|
||||||
import { E } from 'vue-router/dist/router-CWoNjPRp.mjs';
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
labPat: {
|
labPat: {
|
||||||
|
|||||||
@ -233,9 +233,8 @@ import {
|
|||||||
updatestatsparam
|
updatestatsparam
|
||||||
} from "@/api/liswork/xtwh/StatsparameterApi.ts";
|
} from "@/api/liswork/xtwh/StatsparameterApi.ts";
|
||||||
import { liststatstemp, copyParameter } from "@/api/liswork/xtwh/StatstemplateApi.ts";
|
import { liststatstemp, copyParameter } from "@/api/liswork/xtwh/StatstemplateApi.ts";
|
||||||
import { copy } from "clipboard";
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
// ========== 基础变量声明(避免提前访问) ==========
|
|
||||||
// 菜单名称
|
// 菜单名称
|
||||||
const menuname = ref("参数");
|
const menuname = ref("参数");
|
||||||
const statsCode = ref("1");
|
const statsCode = ref("1");
|
||||||
@ -349,7 +348,6 @@ const multiple = ref(true); // 是否多选
|
|||||||
const total = ref(0); // 总条数
|
const total = ref(0); // 总条数
|
||||||
const title = ref(""); // 对话框标题
|
const title = ref(""); // 对话框标题
|
||||||
|
|
||||||
// ========== 工具方法 ==========
|
|
||||||
// 获取类别颜色
|
// 获取类别颜色
|
||||||
function getparamTypeColor(type) {
|
function getparamTypeColor(type) {
|
||||||
const item = paramTypeOptions.value.find(item => item.value === type);
|
const item = paramTypeOptions.value.find(item => item.value === type);
|
||||||
@ -380,7 +378,6 @@ function resetForm() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 核心业务方法 ==========
|
|
||||||
// 查询列表
|
// 查询列表
|
||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
@ -389,18 +386,12 @@ function getList() {
|
|||||||
.then(response => {
|
.then(response => {
|
||||||
regdictList.value = response?.rows || [];
|
regdictList.value = response?.rows || [];
|
||||||
total.value = response?.total || 0;
|
total.value = response?.total || 0;
|
||||||
})
|
}).finally(() => {
|
||||||
.catch(() => {
|
|
||||||
regdictList.value = [];
|
|
||||||
total.value = 0;
|
|
||||||
proxy && proxy.$modal.msgError("数据加载失败");
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//获取模板数据
|
||||||
liststatstemp().then(response => {
|
liststatstemp({ pageSize: 100, pageNum: 1 }).then(response => {
|
||||||
copyTemplateOptions.value = response?.rows || [];
|
copyTemplateOptions.value = response?.rows || [];
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -195,13 +195,11 @@ const getSummaries = ({ columns, data }) => {
|
|||||||
// return '合计';
|
// return '合计';
|
||||||
// } else
|
// } else
|
||||||
if (isSumColumn) {
|
if (isSumColumn) {
|
||||||
// 对合计列求和(处理空值/非数字)
|
|
||||||
const sum = data.reduce((total, row) => {
|
const sum = data.reduce((total, row) => {
|
||||||
const value = Number(row[colField] || 0);
|
const value = Number(row[colField] ?? 0);
|
||||||
return total + (isNaN(value) ? 0 : value);
|
return total + (Number.isNaN(value) ? 0 : value);
|
||||||
}, 0);
|
}, 0);
|
||||||
|
return Math.round(sum * 100) / 100;
|
||||||
return sum;
|
|
||||||
} else {
|
} else {
|
||||||
// 非合计列显示空
|
// 非合计列显示空
|
||||||
return '';
|
return '';
|
||||||
@ -258,6 +256,8 @@ const handleCheckBoxChange = (val) => {
|
|||||||
// 列双击
|
// 列双击
|
||||||
const cellDblclickEvent = ({ row }) => {
|
const cellDblclickEvent = ({ row }) => {
|
||||||
console.log("🚀 ~ cellDblclickEvent ~ row:", row)
|
console.log("🚀 ~ cellDblclickEvent ~ row:", row)
|
||||||
|
// if(row.paramZct == '1'){
|
||||||
|
// }
|
||||||
openDetail.value = true
|
openDetail.value = true
|
||||||
mxtableData.value = []
|
mxtableData.value = []
|
||||||
}
|
}
|
||||||
@ -278,7 +278,9 @@ const search = () => {
|
|||||||
};
|
};
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
getstatsQuery(data).then(res => {
|
getstatsQuery(data).then(res => {
|
||||||
tableData.value = res.data
|
if (res.code == 0) {
|
||||||
|
tableData.value = res.data || []
|
||||||
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user