yxh
2026-10-18 1446994d504819c367e1ff667360eadb314f9ac6
src/views/ecg/room/index.vue
@@ -17,10 +17,10 @@
          class="!w-240px"
        />
      </el-form-item>
      <el-form-item label="诊疗床号" prop="bedNo">
      <el-form-item label="诊室工位" prop="bedNo">
        <el-input
          v-model="queryParams.bedNo"
          placeholder="请输入诊疗床编号"
          placeholder="请输入诊室工位编号"
          clearable
          @keyup.enter="handleQuery"
          class="!w-240px"
@@ -66,11 +66,18 @@
    <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
      <el-table-column label="诊室编号" align="center" prop="roomId" />
      <el-table-column label="诊室名称" align="center" prop="roomName" />
      <el-table-column label="诊疗床编号" align="center" prop="bedNo" />
      <el-table-column label="诊室IP" align="center" prop="ip" />
      <el-table-column label="检查类型" align="center" prop="checkTypes" width="180px">
      <el-table-column label="诊室工位" align="center" prop="bedNo" />
      <el-table-column label="工位绑定IP" align="center" prop="ip" />
      <el-table-column label="操作类型" align="center" prop="opType">
        <template #default="scope">
          {{scope.row.checkTypes}}
          {{ opTypeText(scope.row.opType) }}
        </template>
      </el-table-column>
      <el-table-column label="检查项目" align="center" prop="checkTypes" width="180px">
        <template #default="scope">
          <div v-for="(checkType, subIndex) in scope.row.checkTypes" :key="subIndex">
            {{getCheckTypeName(checkType)}}
          </div>
        </template>
      </el-table-column>
      <el-table-column
@@ -114,16 +121,20 @@
</template>
<script setup lang="ts">
import {dateFormatter, dateFormatter2} from '@/utils/formatTime'
import {dateFormatter2} from '@/utils/formatTime'
import download from '@/utils/download'
import { RoomApi, RoomVO } from '@/api/ecg/room'
import RoomForm from './RoomForm.vue'
import {useCheckTypeStore} from "@/store/modules/checkType";
import {getCheckTypeName} from "../../../utils/checkTypeFormatter";
/** 诊室和诊疗床 列表 */
defineOptions({ name: 'Room' })
const message = useMessage() // 消息弹窗
const { t } = useI18n() // 国际化
const checkTypeStore = useCheckTypeStore();
const loading = ref(true) // 列表的加载中
const list = ref<RoomVO[]>([]) // 列表的数据
@@ -138,6 +149,21 @@
const queryFormRef = ref() // 搜索的表单
const exportLoading = ref(false) // 导出的加载中
/**
 * 操作类型中文(本需求:列表不再显示数字)。
 *
 * 取值与后端 `BedOpTypeEnum`、以及本模块 RoomForm 的「作业类型」单选项保持一致:
 *   0=检查  1=领用  2=装机
 * 历史脏数据(null / 其它值)显示 '-',不猜。
 */
const opTypeText = (opType?: number | null) => {
  if (opType === 0) return '检查'
  if (opType === 1) return '领用'
  if (opType === 2) return '装机'
  if (opType === 3) return '分诊'
  return '-'
}
/** 查询列表 */
const getList = async () => {
  loading.value = true