Fix Bug #603: AI修复

This commit is contained in:
2026-05-27 11:16:13 +08:00
parent 4a505a8c2d
commit 207e74508c
2 changed files with 103 additions and 83 deletions

View File

@@ -0,0 +1,82 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" class="search-form">
<el-form-item label="患者姓名" prop="patientName">
<el-input v-model="queryParams.patientName" placeholder="请输入患者姓名" clearable style="width: 200px" />
</el-form-item>
<el-form-item label="住院号" prop="inpatientNo">
<el-input v-model="queryParams.inpatientNo" placeholder="请输入住院号" clearable style="width: 200px" />
</el-form-item>
<el-form-item label="药品名称" prop="drugName">
<el-select v-model="queryParams.drugName" placeholder="请选择药品" clearable filterable style="width: 200px">
<el-option label="阿莫西林" value="阿莫西林" />
<el-option label="布洛芬" value="布洛芬" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleQuery">搜索</el-button>
<el-button @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table :data="tableData" border style="width: 100%">
<el-table-column prop="patientName" label="患者姓名" />
<el-table-column prop="inpatientNo" label="住院号" />
<el-table-column prop="drugName" label="药品名称" />
<el-table-column prop="status" label="发退药状态" />
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button link type="primary" @click="handleDispense(scope.row)">发药</el-button>
<el-button link type="danger" @click="handleReturn(scope.row)">退药</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script setup lang="ts">
import { ref, reactive } from 'vue'
import { ElMessage } from 'element-plus'
const queryParams = reactive({
patientName: '',
inpatientNo: '',
drugName: ''
})
const queryRef = ref()
const tableData = ref([])
const handleQuery = () => {
console.log('查询参数:', queryParams)
}
const resetQuery = () => {
queryRef.value?.resetFields()
handleQuery()
}
const handleDispense = (row: any) => {
ElMessage.success(`发药: ${row.patientName}`)
}
const handleReturn = (row: any) => {
ElMessage.warning(`退药: ${row.patientName}`)
}
</script>
<style scoped>
.app-container {
padding: 20px;
}
/* 修复 Bug #603搜索栏布局溢出导致字段覆盖、重置按钮被挤没 */
.search-form {
display: flex;
flex-wrap: wrap; /* 允许表单项自动换行防止100%视图下溢出 */
gap: 12px; /* 统一间距 */
margin-bottom: 16px;
}
.search-form .el-form-item {
margin-bottom: 0;
margin-right: 0; /* 清除 Element Plus inline 表单默认右边距,避免挤压重置按钮 */
}
</style>