| | |
| | | <basic-container> |
| | | <el-form ref="queryParamsRef" :model="searchParams" class="ztzf-page-history-search"> |
| | | <el-form-item label="名称" prop="deviceName"> |
| | | <el-input class="ztzf-data-cockpit-search-input" v-model="searchParams.deviceName" placeholder="请输入" |
| | | clearable @clear="handleSearch" /> |
| | | <el-input |
| | | class="ztzf-data-cockpit-search-input" |
| | | v-model="searchParams.deviceName" |
| | | placeholder="请输入" |
| | | clearable |
| | | @clear="handleSearch" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="类型" prop="deviceType"> |
| | | <el-select class="ztzf-data-cockpit-select" popper-class="ztzf-data-cockpit-select-popper" |
| | | v-model="searchParams.deviceType" placeholder="请选择" clearable @change="handleSearch"> |
| | | <el-option v-for="item in dictObj.deviceType" :key="item.dictKey" :label="item.dictValue" |
| | | :value="item.dictKey" /> |
| | | <el-select |
| | | class="ztzf-data-cockpit-select" |
| | | popper-class="ztzf-data-cockpit-select-popper" |
| | | v-model="searchParams.deviceType" |
| | | placeholder="请选择" |
| | | clearable |
| | | @change="handleSearch" |
| | | > |
| | | <el-option |
| | | v-for="item in dictObj.deviceType" |
| | | :key="item.dictKey" |
| | | :label="item.dictValue" |
| | | :value="item.dictKey" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | |
| | | </div> |
| | | |
| | | <div class="ztzf-table-pagination"> |
| | | <el-pagination popper-class="ztzf-data-cockpit-select-popper" |
| | | v-model:current-page="searchParams.current" v-model:page-size="searchParams.size" |
| | | layout="total, prev, pager, next, sizes" :total="total" @change="getList" /> |
| | | <el-pagination |
| | | popper-class="ztzf-data-cockpit-select-popper" |
| | | v-model:current-page="searchParams.current" |
| | | v-model:page-size="searchParams.size" |
| | | layout="total, prev, pager, next, sizes" |
| | | :total="total" |
| | | @change="getList" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | provide('dictObj', dictObj) |
| | | |
| | | // 获取列表 |
| | | async function getList () { |
| | | async function getList() { |
| | | loading.value = true |
| | | try { |
| | | const res = await detectionRangePageApi(searchParams.value) |
| | |
| | | } |
| | | |
| | | // 查询 |
| | | function handleSearch () { |
| | | function handleSearch() { |
| | | searchParams.value.current = 1 |
| | | getList() |
| | | } |
| | | |
| | | // 重置查询 |
| | | function resetForm () { |
| | | function resetForm() { |
| | | queryParamsRef.value?.resetFields() |
| | | searchParams.value.current = 1 |
| | | getList() |
| | | } |
| | | |
| | | // 新增 |
| | | function handleAdd () { |
| | | function handleAdd() { |
| | | dialogRef.value?.open({ mode: 'add' }) |
| | | } |
| | | |
| | | // 查看 |
| | | function handleView (row) { |
| | | function handleView(row) { |
| | | dialogRef.value?.open({ mode: 'view', row: { ...row } }) |
| | | } |
| | | |
| | | // 编辑 |
| | | function handleEdit (row) { |
| | | function handleEdit(row) { |
| | | dialogRef.value?.open({ mode: 'edit', row: { ...row } }) |
| | | } |
| | | |
| | | // 删除 |
| | | async function handleDelete (row) { |
| | | async function handleDelete(row) { |
| | | await ElMessageBox.confirm('确认删除该条数据吗?', '提示', { type: 'warning' }) |
| | | await detectionRangeSubmitApi({ id: row.id, effectiveRangeKm: 0 }) |
| | | ElMessage.success('删除成功') |
| | |
| | | } |
| | | |
| | | // 获取字典 |
| | | function getDictList () { |
| | | function getDictList() { |
| | | getDictionaryByCode('deviceType').then(res => { |
| | | dictObj.value = res.data.data |
| | | }) |
| | | } |
| | | |
| | | function formatDeployLocation (row) { |
| | | function formatDeployLocation(row) { |
| | | if (!row) return '-' |
| | | const location = row.deployLocation ?? row.address ?? row.location ?? row.deployAddress |
| | | if (Array.isArray(location) && location.length) { |
| | |
| | | return '-' |
| | | } |
| | | |
| | | function formatRange (row) { |
| | | function formatRange(row) { |
| | | if (!row) return '-' |
| | | const value = row.effectiveRangeKm ?? row.range |
| | | return value === null || value === undefined || value === '' ? '-' : value |
| | | } |
| | | |
| | | function formatDeviceCode (row) { |
| | | if (!row) return '-' |
| | | return row.deviceCode || row.deviceSn || row.deviceNo || '-' |
| | | function formatDeviceCode(row) { |
| | | if (!row) return '' |
| | | return row.deviceSn |
| | | } |
| | | |
| | | onMounted(() => { |