门诊号码管理维护界面-》优化
This commit is contained in:
@@ -141,6 +141,7 @@
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { getConfigKey } from '@/api/system/config'
|
||||
import { logQuery, logCreate, logUpdate, logDelete } from './components/operationLog'
|
||||
import { listOutpatientNo, addOutpatientNo, updateOutpatientNo, deleteOutpatientNo } from './components/outpatientNumber'
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const userStore = useUserStore()
|
||||
@@ -492,6 +493,35 @@ function onDelete() {
|
||||
function getList() {
|
||||
loading.value = true
|
||||
queryParams.value.onlySelf = !viewAll.value
|
||||
|
||||
// 先尝试调用后端API
|
||||
listOutpatientNo(queryParams.value).then((res) => {
|
||||
if (res.code === 200) {
|
||||
tableData.value = (res.data?.records || res.data || []).map((it) => ({
|
||||
...it,
|
||||
_editing: false,
|
||||
_error: false,
|
||||
_dirty: false,
|
||||
}))
|
||||
total.value = res.data?.total || res.data?.length || 0
|
||||
|
||||
// 记录查询操作日志
|
||||
logQuery(total.value, getUserInfo())
|
||||
} else {
|
||||
// API返回错误,回退到localStorage
|
||||
console.warn('后端API返回错误,使用localStorage数据')
|
||||
loadFromLocalStorage()
|
||||
}
|
||||
loading.value = false
|
||||
}).catch((error) => {
|
||||
// API调用失败(如404),回退到localStorage
|
||||
console.warn('后端API调用失败,使用localStorage数据:', error)
|
||||
loadFromLocalStorage()
|
||||
})
|
||||
}
|
||||
|
||||
// 从localStorage加载数据
|
||||
function loadFromLocalStorage() {
|
||||
const res = lcList({ ...queryParams.value })
|
||||
tableData.value = res.records.map((it) => ({
|
||||
...it,
|
||||
@@ -500,10 +530,10 @@ function getList() {
|
||||
_dirty: false,
|
||||
}))
|
||||
total.value = res.total
|
||||
loading.value = false
|
||||
|
||||
// 记录查询操作日志
|
||||
logQuery(total.value, getUserInfo())
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
|
||||
@@ -576,27 +606,30 @@ function lcDeleteByIds(idList) {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/*Windows XP风格布局 */
|
||||
/*Windows XP风格布局 - 全屏显示 */
|
||||
|
||||
/* 外层容器 - 居中显示 */
|
||||
/* 外层容器 - 全屏显示 */
|
||||
.outpatient-no-management-wrapper {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
min-height: calc(100vh - 100px);
|
||||
padding: 20px;
|
||||
width: 100%;
|
||||
height: calc(100vh - 84px);
|
||||
padding: 0;
|
||||
background-color: #f0f0f0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 主容器 - 600px固定宽度 */
|
||||
/* 主容器 - 全屏宽度和高度 */
|
||||
.outpatient-no-management {
|
||||
width: 600px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #D4D0C8;
|
||||
border: 1px solid #000000;
|
||||
box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 500px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 标题栏(32px高,背景色#D4D0C8) */
|
||||
@@ -703,13 +736,18 @@ function lcDeleteByIds(idList) {
|
||||
background-color: #FFFFFF;
|
||||
padding: 8px;
|
||||
overflow: auto;
|
||||
min-height: 400px;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* 表格样式(1px实线边框#CCCCCC,表头背景#F0F0F0) */
|
||||
.table-content :deep(.el-table) {
|
||||
border: 1px solid #CCCCCC;
|
||||
font-size: 13px;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.table-content :deep(.el-table th) {
|
||||
@@ -806,16 +844,10 @@ function lcDeleteByIds(idList) {
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
/* 响应式调整 */
|
||||
@media (max-width: 650px) {
|
||||
.outpatient-no-management {
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.outpatient-no-management-wrapper {
|
||||
padding: 0;
|
||||
}
|
||||
/* 表格容器样式调整 */
|
||||
.table-content :deep(.el-table__body-wrapper) {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user