|
@@ -1,18 +1,16 @@
|
|
|
-<script setup lang="ts">
|
|
|
+<script setup lang="tsx">
|
|
|
import {emrServerHttp} from "@/api/emr-control/request";
|
|
|
import {VxeGridProps} from "vxe-table";
|
|
|
-import XEUtils from "xe-utils";
|
|
|
-import CyDateRange from "@/components/cy/date-range/CyDateRange.vue";
|
|
|
import {xcMessage} from "@/utils/xiaochan-element-plus";
|
|
|
+import {useDialog} from "@/components/cy/CyDialog/index";
|
|
|
+import Details from './Details.vue'
|
|
|
+import {dayjs} from "element-plus";
|
|
|
|
|
|
defineOptions({
|
|
|
name: "variousRate"
|
|
|
});
|
|
|
|
|
|
-const queryData = reactive({
|
|
|
- start: "",
|
|
|
- end: "",
|
|
|
-});
|
|
|
+const queryData = ref(['2025-01', '2025-01']);
|
|
|
|
|
|
const tableRef = ref()
|
|
|
const tableGrid = reactive<VxeGridProps<any>>({
|
|
@@ -39,12 +37,30 @@ const tableGrid = reactive<VxeGridProps<any>>({
|
|
|
{field: '终极分子', title: '终极分子', width: 100},
|
|
|
{field: '终极分母', title: '终极分母', width: 100},
|
|
|
{field: '终极比值', title: '终极比值', width: 100},
|
|
|
+ {
|
|
|
+ fixed: 'right', title: '详情', width: 100, slots: {
|
|
|
+ default: ({row}) => <el-button type="primary" onClick=
|
|
|
+ {() => {
|
|
|
+ useDialog(Details, {
|
|
|
+ dialogProps: {
|
|
|
+ title: row.二级指标,
|
|
|
+ width: "90%"
|
|
|
+ },
|
|
|
+ params: {
|
|
|
+ data: row.患者详情,
|
|
|
+ name: row.二级指标,
|
|
|
+ mainName: row.一级指标,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }}>详情</el-button>,
|
|
|
+ }
|
|
|
+ }
|
|
|
],
|
|
|
columnConfig: {resizable: true}
|
|
|
})
|
|
|
|
|
|
async function openParams() {
|
|
|
- if (queryData.start == '') {
|
|
|
+ if (queryData.value === null) {
|
|
|
xcMessage.warning("请选择时间范围")
|
|
|
return
|
|
|
}
|
|
@@ -52,35 +68,28 @@ async function openParams() {
|
|
|
const tmp = await emrServerHttp({
|
|
|
method: "get",
|
|
|
url: "/queryEmr/variousRate",
|
|
|
- params: {...queryData}
|
|
|
+ params: {
|
|
|
+ start: dayjs(queryData.value[0]).format('YYYY-MM-DD'),
|
|
|
+ end: dayjs(queryData.value[1]).format('YYYY-MM-DD'),
|
|
|
+ }
|
|
|
}).catch(() => {
|
|
|
- return {}
|
|
|
+ return []
|
|
|
});
|
|
|
-
|
|
|
- if (XEUtils.isEmpty(tmp)) {
|
|
|
- tableGrid.data = []
|
|
|
- } else {
|
|
|
- let tmpData = []
|
|
|
- let mergeCells = []
|
|
|
- for (const key in tmp) {
|
|
|
- const item = tmp[key];
|
|
|
- if (XEUtils.isArray(item)) {
|
|
|
- item.forEach(i => {
|
|
|
- i.一级指标 = key
|
|
|
- })
|
|
|
- }
|
|
|
- const currentLength = tmpData.length;
|
|
|
- mergeCells.push({
|
|
|
- row: currentLength,
|
|
|
- col: 1,
|
|
|
- rowspan: item.length,
|
|
|
- colspan: 1
|
|
|
- })
|
|
|
- tableGrid.mergeCells = mergeCells
|
|
|
- tmpData.push(...item)
|
|
|
- tableGrid.data = tmpData
|
|
|
- }
|
|
|
- }
|
|
|
+ const tmpData = []
|
|
|
+ const mergeCells = []
|
|
|
+ let currentRowIndex = 0;
|
|
|
+ tmp.forEach((item) => {
|
|
|
+ tmpData.push(...item);
|
|
|
+ mergeCells.push({
|
|
|
+ row: currentRowIndex,
|
|
|
+ col: 1,
|
|
|
+ rowspan: item.length,
|
|
|
+ colspan: 1
|
|
|
+ })
|
|
|
+ currentRowIndex += item.length
|
|
|
+ })
|
|
|
+ tableGrid.data = tmpData
|
|
|
+ tableGrid.mergeCells = mergeCells
|
|
|
tableGrid.loading = false;
|
|
|
}
|
|
|
|
|
@@ -89,7 +98,14 @@ async function openParams() {
|
|
|
<template>
|
|
|
<div class="layout_container">
|
|
|
<header>
|
|
|
- <CyDateRange v-model="queryData" start="start" end="end"/>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="queryData"
|
|
|
+ unlink-panels
|
|
|
+ type="monthrange"
|
|
|
+ range-separator="To"
|
|
|
+ start-placeholder="开始月份"
|
|
|
+ end-placeholder="结束月份"
|
|
|
+ />
|
|
|
<el-button type="primary" v-el-btn="openParams">查询</el-button>
|
|
|
<el-button @click="() => tableRef.exportData()">导出</el-button>
|
|
|
</header>
|