| | |
| | | |
| | | // 查询列表 |
| | | const getList = () => { |
| | | showLoadingToast('加载中...') |
| | | const params = { |
| | | current: -1, |
| | | size: -1, |
| | |
| | | .then((res) => { |
| | | // 如果res.data不是数组,设置为空数组 |
| | | upkeepList.value = res.records || res.data?.records || [] |
| | | closeToast() |
| | | }) |
| | | .catch(() => { |
| | | closeToast() |
| | | showToast('获取数据失败') |
| | | }) |
| | | } |
| | | |
| | | // 显示加载提示 |
| | | const showLoadingToast = (message) => { |
| | | uni.showLoading({ |
| | | title: message, |
| | | mask: true |
| | | }); |
| | | }; |
| | | |
| | | // 关闭提示 |
| | | const closeToast = () => { |
| | | uni.hideLoading(); |
| | | }; |
| | | |
| | | // 切换选择状态 |
| | | const toggleSelection = (item) => { |
| | | const index = multipleList.value.findIndex(selected => selected.id === item.id) |