| | |
| | | <el-input v-model="searchParams.deviceType" /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="handleSearch">查询</el-button> |
| | | <el-button @click="resetForm">重置</el-button> |
| | | <el-button type="primary" @click="handleSearch">查询</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { onMounted, reactive, ref } from 'vue' |
| | | import { onMounted, ref } from 'vue' |
| | | import { ElMessageBox } from 'element-plus' |
| | | import { fwDeviceListApi, fwDeviceRemoveApi } from '@/api/fwDevice' |
| | | import DeviceStockFormDialog from './DeviceStockFormDialog.vue' |
| | | |
| | | const searchParams = reactive({ |
| | | const initSearchParams = () => ({ |
| | | deviceName: '', |
| | | deviceType: '', |
| | | current: 1, |
| | | size: 10, |
| | | }) |
| | | const searchParams = ref(initSearchParams()) |
| | | const total = ref(0) |
| | | const list = ref([]) |
| | | const queryParamsRef = ref(null) |
| | |
| | | |
| | | // 获取列表 |
| | | async function getList() { |
| | | const res = await fwDeviceListApi({ ...searchParams }) |
| | | const res = await fwDeviceListApi(searchParams.value) |
| | | list.value = res?.data?.data?.records ?? [] |
| | | total.value = res?.data?.data?.total ?? 0 |
| | | } |
| | | |
| | | // 查询 |
| | | function handleSearch() { |
| | | searchParams.current = 1 |
| | | searchParams.value.current = 1 |
| | | getList() |
| | | } |
| | | |
| | | // 重置查询 |
| | | function resetForm() { |
| | | queryParamsRef.value?.resetFields() |
| | | searchParams.current = 1 |
| | | searchParams.value.current = 1 |
| | | getList() |
| | | } |
| | | |