| | |
| | | :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" |
| | |
| | | <!-- <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> |
| | | <!-- |
| | |
| | | </el-table-column> |
| | | <el-table-column label="型号" align="center" prop="model" /> |
| | | --> |
| | | <el-table-column label="使用状态" align="center" prop="lost" > |
| | | <el-table-column label="使用状态" align="center" prop="state" > |
| | | <template #default="scope"> |
| | | <span>{{tranlateDevState(scope.row.state)}}</span> |
| | | </template> |
| | |
| | | </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[]>([]) // 列表的数据 |
| | |
| | | pageSize: 10, |
| | | purchaseDate: [], |
| | | createTime: [], |
| | | devId: undefined, |
| | | category: undefined, |
| | | brand: undefined, |
| | | model: undefined |
| | | devId: '', |
| | | category: '', |
| | | brand: '', |
| | | model: '' |
| | | }) |
| | | const queryFormRef = ref() // 搜索的表单 |
| | | const exportLoading = ref(false) // 导出的加载中 |
| | |
| | | |
| | | /** 添加/修改操作 */ |
| | | 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 () => { |
| | |
| | | brandOptions.value = data |
| | | |
| | | queryParams.brand = '' |
| | | queryParams.model = '' |
| | | |
| | | //queryParams.brand = brandOptions.value.length === 0 ? "" : brandOptions.value[0].value |
| | | //brandChanged() |
| | |
| | | |
| | | getList() |
| | | }) |
| | | </script> |
| | | </script> |