Compare commits

..

2 Commits

Author SHA1 Message Date
2138f98df2 Merge branch 'main' of http://47.97.125.165:8902/jiangs/lis8.0-vue3 2025-10-30 18:17:02 +08:00
07ef4268eb 多条件查询 2025-10-30 18:16:57 +08:00
12 changed files with 442 additions and 173 deletions

View File

@ -45,7 +45,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref, onMounted, watch, nextTick, toRaw } from "vue"; import { reactive, ref, onMounted, watch, nextTick, toRaw } from "vue";
// @ts-ignore // @ts-ignore
import { getFirstLetter } from '@/api/pinyin.js'; import { getFirstLetter } from '@/utils/pinyin.js';
import { ElEmpty } from 'element-plus'; import { ElEmpty } from 'element-plus';
// @ts-ignore // @ts-ignore
import { comDict } from '@/utils/dict' import { comDict } from '@/utils/dict'

View File

@ -16,7 +16,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, ref, watch, computed, reactive, toRaw } from 'vue'; import { onMounted, ref, watch, computed, reactive, toRaw } from 'vue';
// @ts-ignore // @ts-ignore
import { getFirstLetter } from '@/api/pinyin.js'; import { getFirstLetter } from '@/utils/pinyin.js';
interface Props { interface Props {

View File

@ -0,0 +1,266 @@
<template>
<el-popover :visible="selectVisible" placement="bottom" :width="'16vw'">
<el-form :model="queryParams" class="query-form" label-width="90px">
<!-- 病人类型选择 -->
<el-form-item label="病人类型:" prop="brly">
<el-select v-model="queryParams.brly" placeholder="全部" clearable>
<el-option v-for="item in brlyOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="完成状态:" prop="finish">
<el-radio-group v-model="queryParams.finish" @change="handleRadioChange">
<el-radio value="1" @click.native="handleRadioClick('1', 'finish')">已完成</el-radio>
<el-radio value="0" @click.native="handleRadioClick('0', 'finish')">未完成</el-radio>
</el-radio-group>
</el-form-item>
<!-- 审核状态选择 -->
<el-form-item label="审核状态:" prop="jgbz">
<el-radio-group v-model="queryParams.jgbz" @change="handleRadioChange">
<el-radio value="2" @click.native="handleRadioClick('2', 'jgbz')">已审核</el-radio>
<el-radio value="0" @click.native="handleRadioClick('0', 'jgbz')">未审核</el-radio>
</el-radio-group>
</el-form-item>
<el-row>
<el-col :span="8">
<!-- 自审状态选择 -->
<el-form-item label-width="10px" prop="autojgbz">
<el-checkbox v-model="queryParams.autojgbz" true-value="1" false-value=""> 自审 </el-checkbox>
</el-form-item>
</el-col>
<el-col :span="8">
<!-- 危急值选择 -->
<el-form-item prop="alarmflag" label-width="0">
<el-checkbox v-model="queryParams.alarmflag" true-value="1" false-value=""> 危急值 </el-checkbox>
</el-form-item>
</el-col>
<el-col :span="8">
<!-- 急诊选择 -->
<el-form-item prop="jzbz" label-width="0">
<el-checkbox v-model="queryParams.jzbz" true-value="1" false-value=""> 急诊 </el-checkbox>
</el-form-item>
</el-col>
</el-row>
<!-- 打印状态选择 -->
<el-form-item label="打印状态:" prop="dybz">
<el-radio-group v-model="queryParams.dybz" @chnage="handleRadioChange">
<el-radio value="1" @click.native="handleRadioClick('1', 'dybz')">已打印</el-radio>
<el-radio value="0" @click.native="handleRadioClick('0', 'dybz')">未打印</el-radio>
</el-radio-group>
</el-form-item>
<!-- 操作按钮 -->
<el-form-item>
<el-button type="primary" @click="handleQuery" :size="props.size">确认查询</el-button>
<el-button @click="handleReset" style="margin-left: 8px" :size="props.size">重置</el-button>
</el-form-item>
</el-form>
<template #reference>
<el-input v-model="selectShowValue" :size="props.size" @clear="clearHandle"
@click="selectVisible = !selectVisible" :placeholder="props.placeholder" readonly
:style="{ width: props.width }" suffix-icon="ArrowDown" :clearable="props.clearable" />
</template>
</el-popover>
</template>
<script setup lang="ts">
import { ref, defineProps, defineEmits, nextTick, watch } from 'vue'
import { ElMessage } from 'element-plus'
// 定义下拉选项类型
interface OptionItem {
label: string
value: string | number
}
// 定义查询参数类型
interface QueryParams {
brly?: string | number
jgbz?: string | number
dybz?: string | number
alarmflag?: string | number
jzbz?: string | number
finish?: string | number
autojgbz?: string | number
}
// 定义组件Props
const props = defineProps<{
// 可传入初始查询参数
initialParams?: Partial<QueryParams>,
// 宽度
width?: string,
// 是否禁用
disabled?: boolean,
// 是否可清空
clearable?: boolean,
// 是否显示查询按钮
showQueryButton?: boolean,
// 是否显示重置按钮
showResetButton?: boolean,
// 尺寸
size?: 'large' | 'default' | 'small',
// 占位符
placeholder?: string,
dictData?: any
}>()
watch(() => props.dictData, () => {
brlyOptions.value = props.dictData.PT
optionMaps.brly = props.dictData.PT
})
// 定义组件事件
const emit = defineEmits<{
// 查询事件,返回查询参数
(e: 'query', params: QueryParams): void
// 重置事件
(e: 'reset'): void
}>()
const selectVisible = ref(false)
const selectShowValue = ref('')
const selectRef = ref()
// 病人类型选项
const brlyOptions = ref<OptionItem[]>([])
// 审核状态选项
const jgbzOptions: OptionItem[] = [
{ label: '未审核', value: 0 },
{ label: '已审核', value: 2 },
]
// 打印状态选项
const dybzOptions: OptionItem[] = [
{ label: '未打印', value: 0 },
{ label: '已打印', value: 1 },
]
// 危急值选项
const alarmflagOptions: OptionItem[] = [
{ label: '危急值', value: 1 },
{ label: '无', value: 0 }
]
// 急诊选项
const emergencyOptions: OptionItem[] = [
{ label: '急诊', value: 1 },
{ label: '否', value: 0 }
]
// 完成状态选项
const finishOptions: OptionItem[] = [
{ label: '未完成', value: 0 },
{ label: '已完成', value: 1 },
]
// 自审状态选项
const autojgbzOptions: OptionItem[] = [
{ label: '否', value: 0 },
{ label: '自审', value: 1 },
]
// 创建选项映射关系,方便查找label
const optionMaps = {
brly: props.dictData.PT,
jgbz: jgbzOptions,
dybz: dybzOptions,
alarmflag: alarmflagOptions,
jzbz: emergencyOptions,
finish: finishOptions,
autojgbz: autojgbzOptions
}
// 查询参数
const queryParams = ref<QueryParams>({
...props.initialParams
})
// 记录上一次选中的值
const lastRadioValue = ref<string | undefined>(undefined);
const handleRadioChange = (value: string) => {
lastRadioValue.value = value;
};
const handleRadioClick = (value: string, zd: keyof QueryParams) => {
if (value === lastRadioValue.value) {
setTimeout(() => {
queryParams.value[zd] = undefined;
lastRadioValue.value = undefined;
}, 100);
} else {
lastRadioValue.value = value;
}
};
const clearHandle = () => {
queryParams.value = {}
selectShowValue.value = ''
}
// 根据值和选项列表获取对应的label
const getLabelByValue = (value: string | number | undefined, options: OptionItem[]) => {
if (value === undefined || value === null || value === '') return ''
const item = options.find(option => option.value == value)
return item ? item.label : ''
}
// 处理查询
const handleQuery = () => {
// 过滤空值参数
const filteredParams = Object.fromEntries(
Object.entries(queryParams.value).filter(([_, v]) => v !== undefined && v !== null && v !== '')
) as QueryParams
// 收集所有选中项的label
const labels: string[] = []
Object.entries(filteredParams).forEach(([key, value]) => {
// @ts-ignore
const options = optionMaps[key]
if (options) {
const label = getLabelByValue(value, options)
if (label) labels.push(label)
}
})
// 拼接label并设置到显示值
selectShowValue.value = labels.join(',')
console.log('selectShowValue.value==>', selectShowValue.value);
emit('query', filteredParams)
selectVisible.value = false;
}
// 处理重置
const handleReset = () => {
selectShowValue.value = ''
queryParams.value = {}
selectVisible.value = false;
emit('reset')
}
</script>
<style scoped lang="scss">
.query-form {
:deep(.el-form-item) {
margin-bottom: .5rem;
}
}
/* 响应式调整 */
@media (max-width: 768px) {
.query-form {
:deep(.el-form-item) {
margin-bottom: 12px;
width: 100%;
}
}
}
</style>

View File

@ -114,7 +114,6 @@ import { ref, onMounted, onUnmounted, Ref } from 'vue';
*/ */
function useAutoSize() { function useAutoSize() {
const autoSize = ref<'small' | 'default'>('default'); const autoSize = ref<'small' | 'default'>('default');
console.log('333==>', 333);
// 防抖函数,避免频繁触发 // 防抖函数,避免频繁触发
const debounce = (fn: Function, delay: number) => { const debounce = (fn: Function, delay: number) => {
let timer: number; let timer: number;
@ -126,7 +125,6 @@ function useAutoSize() {
const calculateSize = () => { const calculateSize = () => {
const screenWidth = window.innerWidth || document.documentElement.clientWidth; const screenWidth = window.innerWidth || document.documentElement.clientWidth;
console.log('screenWidth==>', screenWidth);
autoSize.value = screenWidth < 1600 ? 'small' : 'default'; autoSize.value = screenWidth < 1600 ? 'small' : 'default';
}; };

View File

@ -1,16 +1,11 @@
<template> <template>
<div class="dict-input-wrapper"> <div class="dict-input-wrapper">
<el-input <el-input v-model="displayValue" :placeholder="placeholder" :clearable="clearable"
v-model="displayValue" :disabled="isDictLoading || disabled" @blur="handleBlur" @clear="handleClear" @dblclick="handleDblClick">
:placeholder="placeholder"
:clearable="clearable"
:disabled="isDictLoading || disabled"
@blur="handleBlur"
@clear="handleClear"
@dblclick="handleDblClick"
>
<template #prefix> <template #prefix>
<el-icon v-if="isDictLoading" size="16"><Loading /></el-icon> <el-icon v-if="isDictLoading" size="16">
<Loading />
</el-icon>
</template> </template>
<template #suffix> <template #suffix>
<el-icon @click="openDictSelector" size="16" class="select-icon"> <el-icon @click="openDictSelector" size="16" class="select-icon">
@ -20,28 +15,11 @@
</el-input> </el-input>
<!-- 字典选择弹窗 --> <!-- 字典选择弹窗 -->
<el-dialog <el-dialog v-model="dialogVisible" :title="dialogTitle" width="500px" @close="handleDialogClose">
v-model="dialogVisible" <el-input v-model="searchKey" placeholder="搜索(支持名称、编码、简拼)..." class="mb-4" clearable @clear="filterDictData"
:title="dialogTitle" @input="filterDictData" />
width="500px"
@close="handleDialogClose"
>
<el-input
v-model="searchKey"
placeholder="搜索(支持名称、编码、简拼)..."
class="mb-4"
clearable
@clear="filterDictData"
@input="filterDictData"
/>
<el-table <el-table :data="filteredDictData" height="300px" border @row-click="selectItem" @row-dblclick="selectItem">
:data="filteredDictData"
height="300px"
border
@row-click="selectItem"
@row-dblclick="selectItem"
>
<el-table-column prop="value" label="编码" width="100" /> <el-table-column prop="value" label="编码" width="100" />
<el-table-column prop="label" label="名称" width="200" /> <el-table-column prop="label" label="名称" width="200" />
<el-table-column prop="pinyin" label="简拼" width="150" /> <!-- 显示简拼便于调试 --> <el-table-column prop="pinyin" label="简拼" width="150" /> <!-- 显示简拼便于调试 -->
@ -59,7 +37,7 @@
import { ref, computed, watch, onMounted } from 'vue'; import { ref, computed, watch, onMounted } from 'vue';
import { Loading, ArrowDown } from '@element-plus/icons-vue'; import { Loading, ArrowDown } from '@element-plus/icons-vue';
import { getFirstLetter } from '@/api/pinyin.js'; // 引入拼音处理工具 import { getFirstLetter } from '@/utils/pinyin.js'; // 引入拼音处理工具
// 组件参数 // 组件参数
const props = defineProps({ const props = defineProps({
modelValue: { type: [String, Number], default: '' }, modelValue: { type: [String, Number], default: '' },

View File

@ -1,25 +1,14 @@
<template> <template>
<!-- 遮罩层 --> <!-- 遮罩层 -->
<div <div v-if="visible" class="dialog-mask" @click="handleCancel"></div>
v-if="visible"
class="dialog-mask"
@click="handleCancel"
></div>
<!-- 弹窗主体 --> <!-- 弹窗主体 -->
<div <div v-if="visible" class="dialog-container">
v-if="visible"
class="dialog-container"
>
<div class="dialog-box"> <div class="dialog-box">
<!-- 标题区域 --> <!-- 标题区域 -->
<div class="dialog-header"> <div class="dialog-header">
<h3 class="dialog-title">{{ title }}</h3> <h3 class="dialog-title">{{ title }}</h3>
<button <button class="dialog-close" @click="handleCancel" aria-label="关闭">
class="dialog-close"
@click="handleCancel"
aria-label="关闭"
>
<span>×</span> <span>×</span>
</button> </button>
</div> </div>
@ -27,24 +16,12 @@
<!-- 内容区域 --> <!-- 内容区域 -->
<div class="dialog-body"> <div class="dialog-body">
<!-- 搜索框 --> <!-- 搜索框 -->
<el-input <el-input v-model="searchKey" placeholder="搜索(支持名称、编码、简拼)..." class="search-input" clearable
v-model="searchKey" @clear="filterDictData" @input="filterDictData" />
placeholder="搜索(支持名称、编码、简拼)..."
class="search-input"
clearable
@clear="filterDictData"
@input="filterDictData"
/>
<!-- 字典列表 --> <!-- 字典列表 -->
<el-table <el-table :data="filteredDictData" height="300px" border @row-click="selectItem" @row-dblclick="selectItem"
:data="filteredDictData" :loading="isDictLoading">
height="300px"
border
@row-click="selectItem"
@row-dblclick="selectItem"
:loading="isDictLoading"
>
<el-table-column prop="value" label="编码" width="100" /> <el-table-column prop="value" label="编码" width="100" />
<el-table-column prop="label" label="名称" width="200" /> <el-table-column prop="label" label="名称" width="200" />
<el-table-column prop="pinyin" label="简拼" width="150" /> <el-table-column prop="pinyin" label="简拼" width="150" />
@ -61,7 +38,7 @@
<script setup> <script setup>
import { ref, computed, watch, onMounted } from 'vue'; import { ref, computed, watch, onMounted } from 'vue';
import { getFirstLetter } from '@/api/pinyin.js'; // 拼音处理工具 import { getFirstLetter } from '@/utils/pinyin.js'; // 拼音处理工具
// 组件参数 // 组件参数
const props = defineProps({ const props = defineProps({

View File

@ -33,7 +33,7 @@
import { ref, computed, watch, onMounted } from 'vue'; import { ref, computed, watch, onMounted } from 'vue';
import { Loading, ArrowDown } from '@element-plus/icons-vue'; import { Loading, ArrowDown } from '@element-plus/icons-vue';
import { getFirstLetter } from '@/api/pinyin.js'; // 引入拼音处理工具 import { getFirstLetter } from '@/utils/pinyin.js'; // 引入拼音处理工具
// 组件参数 // 组件参数
const props = defineProps({ const props = defineProps({
modelValue: { type: [String, Number], default: '' }, modelValue: { type: [String, Number], default: '' },

View File

@ -1,12 +1,7 @@
<template> <template>
<div class="custom-select2"> <div class="custom-select2">
<Select2 <Select2 v-model="currentValue" :options="processedOptions" :settings="select2Settings"
v-model="currentValue" @update:modelValue="handleChange" :disabled="isDisabled" />
:options="processedOptions"
:settings="select2Settings"
@update:modelValue="handleChange"
:disabled="isDisabled"
/>
</div> </div>
</template> </template>
@ -14,7 +9,7 @@
//import { ref, computed, watch, defineProps, defineEmits } from 'vue'; //import { ref, computed, watch, defineProps, defineEmits } from 'vue';
import Select2 from 'vue3-select2-component'; import Select2 from 'vue3-select2-component';
import 'select2/dist/css/select2.min.css'; import 'select2/dist/css/select2.min.css';
import { processOptions } from '@/api/pinyin.js'; // 引入拼音处理工具 import { processOptions } from '@/utils/pinyin.js'; // 引入拼音处理工具
// 定义组件props // 定义组件props
const props = defineProps({ const props = defineProps({

View File

@ -69,12 +69,11 @@
<el-button type="primary" :size="aotuSize" icon="RefreshRight" @click="fetchlabPatList">刷新</el-button> <el-button type="primary" :size="aotuSize" icon="RefreshRight" @click="fetchlabPatList">刷新</el-button>
<el-button type="danger" :size="aotuSize" @click="delSampleHd">删除</el-button> <el-button type="danger" :size="aotuSize" @click="delSampleHd">删除</el-button>
<el-button class="btn_green" :size="aotuSize" icon="top" @click="handlePrev">上一个</el-button> <el-button class="btn_green" :size="aotuSize" icon="top" @click="handlePrev">上一个</el-button>
<el-button class="btn_green" :size="aotuSize" icon="bottom" @click="handleNext">下一个</el-button> <el-button class="btn_green mr5" :size="aotuSize" icon="bottom" @click="handleNext">下一个</el-button>
<el-select placeholder="所有" :size="aotuSize" style="width: 8rem" class="ml5"> <PatientQueryForm :initial-params="initialParams" @query="handleQueryResult" @reset="handleReset"
<el-option label="option" value="item.value" /> width="9rem" :size="aotuSize" placeholder="查询条件" :dict-data="dictData" :clearable="true" />
</el-select> <el-input v-model="searchText" clearable :size="aotuSize" @keyup.enter="searchQuery"
<el-input clearable :size="aotuSize" @keyup.enter="handleQuery" @clear="handleQuery" @clear="clearSearch" style="width: 6rem" />
style="width: 6rem" />
</div> </div>
<div> <div>
<el-checkbox v-model="lbFlag" :size="aotuSize"> 列表翻页 </el-checkbox> <el-checkbox v-model="lbFlag" :size="aotuSize"> 列表翻页 </el-checkbox>
@ -159,9 +158,11 @@ import ResultGraph from './resultGraph/index.vue'
import { getNextNumber, getPreviousNumber } from "@/utils/getNextNumber"; import { getNextNumber, getPreviousNumber } from "@/utils/getNextNumber";
import { useCommonStore } from '@/store/modules/commonStore'; import { useCommonStore } from '@/store/modules/commonStore';
import { classCom } from '@/utils/classCom'; import { classCom } from '@/utils/classCom';
const aotuSize = classCom.useAutoSize(); import PatientQueryForm from '@/components/selectSearch/index.vue'
const aotuSize = classCom.useAutoSize();
const previewShow = ref(false); const previewShow = ref(false);
const lbFlag = ref(false); const lbFlag = ref(false);
const queryParams = ref({ const queryParams = ref({
@ -187,41 +188,105 @@ const tabList = ref([
{ label: '临床意义', value: 7 }, { label: '临床意义', value: 7 },
{ label: '样本流转', value: 8 }, { label: '样本流转', value: 8 },
]) ])
const labPat = ref<any>( const labPat = ref<any>({},)
{
jyrq: '',
yq: '',
ybh: '',
brly: '',
jzbz: '0',
brdh: '',
brxm: '',
brxb: '',
nl: null,
nldw: '1',
ksdh: '',
ch: '',
sjys: '',
sqsj: '',
cyrq: '',
dysj: '',
zd: '',
bz: '',
yhdh: '',
hdys: '',
jgbz: '0',
yblx: '',
},
)
const labPatList = ref<Array<{ ybh: string; jgbz: string }>>([]); const labPatList = ref<Array<{ ybh: string; jgbz: string }>>([]);
const originalLabPatList = ref([]) //原始数据
const loading = ref(false) const loading = ref(false)
const total = ref(0) const searchText = ref('')
const rules = ref([]) const rules = ref([])
const instrGroupOptions = ref<any[]>([]) const instrGroupOptions = ref<any[]>([])
const instrOptions = ref<{ yq: string; yqmc: string }[]>([]) const instrOptions = ref<{ yq: string; yqmc: string }[]>([])
const pdfUrl = ref('') const pdfUrl = ref('')
// 初始查询参数(可选)
const initialParams = {}
// 定义查询参数类型
interface QueryParams {
brly?: string | number
jgbz?: string | number
dybz?: string | number
alarmflag?: string | number
jzbz?: string | number
finish?: string | number
autojgbz?: string | number
}
// 模糊查询
const searchQuery = () => {
let filterMhList = [...originalLabPatList.value];
if (searchText.value) {
const searchStr = searchText.value.trim().toLowerCase();
filterMhList = filterMhList.filter((item: any) => {
// 处理 zjf大写转为小写
const matchZjf = item.zjf && typeof item.zjf === 'string'
? item.zjf.toLowerCase().includes(searchStr)
: false; const matchBrxm = item.brxm && typeof item.brxm === 'string' && item.brxm.includes(searchStr);
const matchSqh = item.sqh && typeof item.sqh === 'string' && item.sqh.includes(searchStr);
return matchZjf || matchBrxm || matchSqh;
});
}
labPatList.value = filterMhList;
getTotals();
if (filterMhList.length > 0) {
highlightRowIndex.value = 0;
const firstRow = filterMhList[0];
labPatListRef.value.setCurrentRow(firstRow);
selectJob(firstRow);
} else {
labPat.value = {};
labResuts.value = [];
highlightRowIndex.value = -1;
}
};
const clearSearch = () => {
searchText.value = ''
searchQuery()
}
// 多条件查询
const handleQueryResult = (params: QueryParams) => {
// console.log('查询参数:', params);
// 复制原始列表作为筛选基础
let filteredList = [...originalLabPatList.value];
// 遍历所有查询参数,进行筛选
Object.entries(params).forEach(([key, value]) => {
filteredList = filteredList.filter((item: any) => {
if (value == 0) {
return item[key] == null;
} else {
return item[key] == value;
}
});
});
labPatList.value = filteredList;
getTotals();
if (filteredList.length > 0) {
highlightRowIndex.value = 0;
const firstRow = filteredList[0];
labPatListRef.value.setCurrentRow(firstRow);
selectJob(firstRow);
} else {
labPat.value = {};
labResuts.value = [];
highlightRowIndex.value = -1;
}
};
// 处理重置
const handleReset = () => {
labPatList.value = [...originalLabPatList.value];
getTotals();
}
const previewHandle = (url: string) => { const previewHandle = (url: string) => {
if (!url) return ElMessage.warning('未查询到文件') if (!url) return ElMessage.warning('未查询到文件')
pdfUrl.value = `data:application/pdf;base64,${url}` pdfUrl.value = `data:application/pdf;base64,${url}`
@ -491,6 +556,7 @@ const fetchlabPatList = () => {
queryLabPatList(queryParams.value).then((res: any) => { queryLabPatList(queryParams.value).then((res: any) => {
if (res.code == 0) { if (res.code == 0) {
labPatList.value = res.data; labPatList.value = res.data;
originalLabPatList.value = res.data
loading.value = false; loading.value = false;
if (res.data.length > 0) { if (res.data.length > 0) {
highlightRowIndex.value = 0; highlightRowIndex.value = 0;

View File

@ -1,36 +1,15 @@
<template> <template>
<div> <div>
<el-button <el-button @click="handleClick">查询病人</el-button>
@click="handleClick"
>查询病人</el-button>
<!-- 病人选择弹窗 --> <!-- 病人选择弹窗 -->
<el-dialog <el-dialog v-model="dialogVisible" :title="props.dialogTitle" width="500px" @close="handleDialogClose">
v-model="dialogVisible" <el-input v-model="searchKey" placeholder="搜索(支持姓名、病人ID、简拼)..." class="mb-4" clearable @clear="filteredPatData"
:title="props.dialogTitle" @input="filteredPatData" @keyup.down="navigateTable('down')" @keyup.up="navigateTable('up')"
width="500px" @keyup.enter="selectActiveItem" />
@close="handleDialogClose"
>
<el-input
v-model="searchKey"
placeholder="搜索(支持姓名、病人ID、简拼)..."
class="mb-4"
clearable
@clear="filteredPatData"
@input="filteredPatData"
@keyup.down="navigateTable('down')"
@keyup.up="navigateTable('up')"
@keyup.enter="selectActiveItem"
/>
<el-table <el-table :data="filteredPatData" height="300px" border @row-click="selectItem" @row-dblclick="selectItem"
:data="filteredPatData" class="compact-form my-table">
height="300px"
border
@row-click="selectItem"
@row-dblclick="selectItem"
class="compact-form my-table"
>
<template #empty> <template #empty>
<div v-if="isPatLoading">加载中...</div> <div v-if="isPatLoading">加载中...</div>
<div v-else>没有匹配的病人数据</div> <div v-else>没有匹配的病人数据</div>
@ -51,7 +30,7 @@
<script setup> <script setup>
import { ref, computed, watch, onMounted } from 'vue'; import { ref, computed, watch, onMounted } from 'vue';
import { queryPatList } from "@/api/mzcx/cydj.js"; import { queryPatList } from "@/api/mzcx/cydj.js";
import { getFirstLetter } from '@/api/pinyin.js'; // 引入拼音处理工具 import { getFirstLetter } from '@/utils/pinyin.js'; // 引入拼音处理工具
// 组件参数 // 组件参数
const props = defineProps({ const props = defineProps({
pidValue: { type: [String, Number], default: '' }, pidValue: { type: [String, Number], default: '' },
@ -153,22 +132,32 @@ const handleDialogClose = () => {
:deep(.el-table__row.active) { :deep(.el-table__row.active) {
background-color: #e6f7ff !important; background-color: #e6f7ff !important;
} }
::v-deep .my-table .el-table__row td { ::v-deep .my-table .el-table__row td {
padding: 1px 0; /* 减小行高 */ padding: 1px 0;
/* 减小行高 */
} }
::v-deep .my-table .el-table__header-wrapper th { ::v-deep .my-table .el-table__header-wrapper th {
padding: 6px 0; /* 表头内边距 */ padding: 6px 0;
background-color: #b3d8ff !important; /* 表头背景色(保留之前的设置) */ /* 表头内边距 */
color: #333; /* 文字颜色加深,提升可读性 */ background-color: #b3d8ff !important;
font-weight: 500; /* 文字加粗 */ /* 表头背景色(保留之前的设置) */
color: #333;
/* 文字颜色加深,提升可读性 */
font-weight: 500;
/* 文字加粗 */
} }
::v-deep .my-table .el-table__cell { ::v-deep .my-table .el-table__cell {
padding: 0 2px; /* 减小列间距 */ padding: 0 2px;
/* 减小列间距 */
} }
/* 可选:调整表格整体样式 */ /* 可选:调整表格整体样式 */
::v-deep .my-table { ::v-deep .my-table {
font-size: 13px; /* 适当减小字体 */ font-size: 13px;
/* 适当减小字体 */
} }
::v-deep .my-table .el-table__cell, ::v-deep .my-table .el-table__cell,

View File

@ -40,8 +40,8 @@ export default defineConfig(({
proxy: { proxy: {
// https://cn.vitejs.dev/config/#server-proxy // https://cn.vitejs.dev/config/#server-proxy
'/dev-api': { '/dev-api': {
target: 'http://localhost:9801', // target: 'http://localhost:9801',
//target: 'http://47.97.125.165:8904', target: 'http://47.97.125.165:8904',
// target: 'http://192.168.1.114:9801', // target: 'http://192.168.1.114:9801',
changeOrigin: true, changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '') rewrite: (p) => p.replace(/^\/dev-api/, '')