yxh
2026-11-26 bd3f4b0a9b9207b647de0f0d8c52600a2742fd56
src/views/ecg/devmanage/DevStatistic.vue
@@ -8,10 +8,10 @@
        :inline="true"
        label-width="68px"
    >
      <el-form-item label="分类名" prop="category">
      <el-form-item label="设备名称" prop="category">
        <el-select
            v-model="queryParams.category"
            placeholder="请选择分类名"
            placeholder="请选择设备名称"
            clearable
            class="!w-240px"
            @change="categoryChanged"
@@ -68,7 +68,13 @@
      <!--      <el-table-column label="id" align="center" prop="id" />-->
      <el-table-column label="分类名" align="center" prop="category">
        <template #default="scope">
          <dict-tag :type="DICT_TYPE.ECG_DEV_CATEGORY" :value="scope.row.category" />
          <!-- 字典命中时显示标签;未命中的兜底显示原始名称,避免整格空白 -->
          <dict-tag
              v-if="getDictLabel(DICT_TYPE.ECG_DEV_CATEGORY, scope.row.category)"
              :type="DICT_TYPE.ECG_DEV_CATEGORY"
              :value="scope.row.category"
          />
          <span v-else>{{ scope.row.category }}</span>
        </template>
      </el-table-column>
<!--
@@ -91,17 +97,14 @@
</template>
<script setup lang="ts">
import {getStrDictOptions, DICT_TYPE, DictDataType} from '@/utils/dict'
import {dateFormatter, dateFormatter2} from '@/utils/formatTime'
import {getStrDictOptions, getDictLabel, DICT_TYPE, DictDataType} from '@/utils/dict'
import download from '@/utils/download'
import {DeviceApi, DeviceStatisticVO, DeviceVO, DevModelApi, OptionsVO} from '@/api/ecg/devmanage'
import DeviceForm from './DeviceForm.vue'
import {DeviceApi, DeviceStatisticVO, DevModelApi, OptionsVO} from '@/api/ecg/devmanage'
/** 设备 列表 */
defineOptions({ name: 'DeviceStatistic' })
const message = useMessage() // 消息弹窗
const { t } = useI18n() // 国际化
const loading = ref(true) // 列表的加载中
const list = ref<DeviceStatisticVO[]>([]) // 列表的数据
@@ -110,10 +113,10 @@
  pageSize: 10,
  purchaseDate: [],
  createTime: [],
  devId: undefined,
  category: undefined,
  brand: undefined,
  model: undefined
  devId: '',
  category: '',
  brand: '',
  model: ''
})
const queryFormRef = ref() // 搜索的表单
const exportLoading = ref(false) // 导出的加载中
@@ -148,22 +151,6 @@
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
  formRef.value.open(type, id)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
  try {
    // 删除的二次确认
    await message.delConfirm()
    // 发起删除
    await DeviceApi.deleteDevice(id)
    message.success(t('common.delSuccess'))
    // 刷新列表
    await getList()
  } catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {