| | |
| | | <template> |
| | | <basic-container> |
| | | <el-form ref="queryParamsRef" :inline="true" :model="searchParams"> |
| | | <el-form-item label="名称" prop="deviceName"> |
| | | <el-input v-model="searchParams.deviceName" /> |
| | | </el-form-item> |
| | | <el-form-item label="类型" prop="deviceType"> |
| | | <el-input v-model="searchParams.deviceType" /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button @click="resetForm">重置</el-button> |
| | | <el-button type="primary" @click="handleSearch">查询</el-button> |
| | | </el-form-item> |
| | | <el-form ref="queryParamsRef" :model="searchParams"> |
| | | <el-row :gutter="16"> |
| | | <el-col :span="4"> |
| | | <el-form-item label="名称" prop="deviceName"> |
| | | <el-input v-model="searchParams.deviceName" placeholder="请输入" clearable @clear="getList" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item label="类型" prop="deviceType"> |
| | | <el-input v-model="searchParams.deviceType" placeholder="请输入" clearable @clear="getList" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item> |
| | | <el-button @click="resetForm">重置</el-button> |
| | | <el-button type="primary" @click="handleSearch">查询</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div> |
| | | <el-button type="primary" @click="handleAdd">新增</el-button> |
| | | </div> |
| | | <el-table :data="list"> |
| | | <el-table v-loading="loading" :data="list"> |
| | | <el-table-column type="index" width="60" label="序号" /> |
| | | <el-table-column prop="deviceName" label="名称" /> |
| | | <el-table-column prop="deviceType" label="类型" /> |
| | |
| | | /> |
| | | </div> |
| | | |
| | | <DeviceStockFormDialog ref="dialogRef" @success="getList" /> |
| | | <FormDiaLog ref="dialogRef" @success="getList" /> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { onMounted, ref } from 'vue' |
| | | import { ElMessageBox } from 'element-plus' |
| | | import { fwDeviceListApi, fwDeviceRemoveApi } from '@/api/fwDevice' |
| | | import DeviceStockFormDialog from './DeviceStockFormDialog.vue' |
| | | import { fwDeviceListApi, fwDeviceRemoveApi } from '@/views/basicManage/deviceStock/fwDevice' |
| | | import FormDiaLog from './FormDiaLog.vue' |
| | | |
| | | const initSearchParams = () => ({ |
| | | deviceName: '', |
| | | deviceType: '', |
| | | current: 1, |
| | | size: 10, |
| | | // 查询参数默认值 |
| | | deviceName: '', // 设备名称 |
| | | deviceType: '', // 设备类型 |
| | | current: 1, // 当前页 |
| | | size: 10, // 每页大小 |
| | | }) |
| | | const searchParams = ref(initSearchParams()) |
| | | const total = ref(0) |
| | | const list = ref([]) |
| | | const queryParamsRef = ref(null) |
| | | |
| | | const dialogRef = ref(null) |
| | | const searchParams = ref(initSearchParams()) // 查询参数 |
| | | const total = ref(0) // 总条数 |
| | | const loading = ref(false) // 列表加载中 |
| | | const list = ref([]) // 列表数据 |
| | | const queryParamsRef = ref(null) // 查询表单实例 |
| | | const dialogRef = ref(null) // 弹框实例 |
| | | |
| | | // 获取列表 |
| | | async function getList() { |
| | | const res = await fwDeviceListApi(searchParams.value) |
| | | list.value = res?.data?.data?.records ?? [] |
| | | total.value = res?.data?.data?.total ?? 0 |
| | | loading.value = true |
| | | try { |
| | | const res = await fwDeviceListApi(searchParams.value) |
| | | list.value = res?.data?.data?.records ?? [] |
| | | total.value = res?.data?.data?.total ?? 0 |
| | | } finally { |
| | | loading.value = false |
| | | } |
| | | } |
| | | |
| | | // 查询 |