Commit aaf672c44a7a4ee9232d9a7883d7d0de281769e6
Merge branch 'fix/teambition/10-18/2024' into 'main_dev'
fix: 产品物模型创建到下一页时,点击新物模型下移,提示服务器错误 See merge request yunteng/thingskit-front!1513
Showing
2 changed files
with
16 additions
and
3 deletions
| ... | ... | @@ -107,7 +107,9 @@ |
| 107 | 107 | const handleSwitch = async (e: any, record: any) => { |
| 108 | 108 | switchLoading.value = true; |
| 109 | 109 | await deviceProfileCategory({ ...record, status: e }); |
| 110 | - switchLoading.value = false; | |
| 110 | + setTimeout(() => { | |
| 111 | + switchLoading.value = false; | |
| 112 | + }, 1500); | |
| 111 | 113 | createMessage.success( |
| 112 | 114 | `${!e ? t('common.disableText') : t('common.enableText')}${t('common.successText')}` |
| 113 | 115 | ); | ... | ... |
| ... | ... | @@ -142,13 +142,21 @@ |
| 142 | 142 | { |
| 143 | 143 | label: t('common.sortOperation.moveDown'), |
| 144 | 144 | icon: 'ant-design:down-outlined', |
| 145 | - ifShow: thingsModelListTotal - record.sort <= 1 ? false : true, | |
| 145 | + ifShow: | |
| 146 | + index === tableList.length - 1 && | |
| 147 | + includeSortIsTop.includes(thingsModelListTotal - record.sort) | |
| 148 | + ? false | |
| 149 | + : true, | |
| 146 | 150 | onClick: handleTableSort.bind(null, 'down', record), |
| 147 | 151 | }, |
| 148 | 152 | { |
| 149 | 153 | label: t('common.sortOperation.isBottom'), |
| 150 | 154 | icon: 'ant-design:vertical-align-bottom-outlined', |
| 151 | - ifShow: thingsModelListTotal - record.sort <= 1 ? false : true, | |
| 155 | + ifShow: | |
| 156 | + index === tableList.length - 1 && | |
| 157 | + includeSortIsTop.includes(thingsModelListTotal - record.sort) | |
| 158 | + ? false | |
| 159 | + : true, | |
| 152 | 160 | onClick: handleTableSort.bind(null, 'bottomUp', record), |
| 153 | 161 | }, |
| 154 | 162 | ]" |
| ... | ... | @@ -217,6 +225,8 @@ |
| 217 | 225 | |
| 218 | 226 | const includeSortIsTop = [0, 1]; |
| 219 | 227 | |
| 228 | + const tableList = ref<Recordable[]>([]); | |
| 229 | + | |
| 220 | 230 | const { createMessage } = useMessage(); |
| 221 | 231 | const isShowBtn = ref(false); |
| 222 | 232 | const [registerModal, { openModal }] = useModal(); |
| ... | ... | @@ -234,6 +244,7 @@ |
| 234 | 244 | selectType: props.record.ifShowClass ? 'category' : undefined, |
| 235 | 245 | }); |
| 236 | 246 | thingsModelListTotal.value = (res as Recordable)?.total || 0; |
| 247 | + tableList.value = (res as Recordable)?.items || []; | |
| 237 | 248 | return res; |
| 238 | 249 | }, |
| 239 | 250 | columns: props.record.ifShowClass | ... | ... |