Commit fcbbaa7184336d3b8db3df827b5464ccc010b30d

Authored by fengtao
1 parent 0f4e8266

fix: 产品物模型创建到下一页时,点击新物模型下移,提示服务器错误

@@ -142,13 +142,21 @@ @@ -142,13 +142,21 @@
142 { 142 {
143 label: t('common.sortOperation.moveDown'), 143 label: t('common.sortOperation.moveDown'),
144 icon: 'ant-design:down-outlined', 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 onClick: handleTableSort.bind(null, 'down', record), 150 onClick: handleTableSort.bind(null, 'down', record),
147 }, 151 },
148 { 152 {
149 label: t('common.sortOperation.isBottom'), 153 label: t('common.sortOperation.isBottom'),
150 icon: 'ant-design:vertical-align-bottom-outlined', 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 onClick: handleTableSort.bind(null, 'bottomUp', record), 160 onClick: handleTableSort.bind(null, 'bottomUp', record),
153 }, 161 },
154 ]" 162 ]"
@@ -217,6 +225,8 @@ @@ -217,6 +225,8 @@
217 225
218 const includeSortIsTop = [0, 1]; 226 const includeSortIsTop = [0, 1];
219 227
  228 + const tableList = ref<Recordable[]>([]);
  229 +
220 const { createMessage } = useMessage(); 230 const { createMessage } = useMessage();
221 const isShowBtn = ref(false); 231 const isShowBtn = ref(false);
222 const [registerModal, { openModal }] = useModal(); 232 const [registerModal, { openModal }] = useModal();
@@ -234,6 +244,7 @@ @@ -234,6 +244,7 @@
234 selectType: props.record.ifShowClass ? 'category' : undefined, 244 selectType: props.record.ifShowClass ? 'category' : undefined,
235 }); 245 });
236 thingsModelListTotal.value = (res as Recordable)?.total || 0; 246 thingsModelListTotal.value = (res as Recordable)?.total || 0;
  247 + tableList.value = (res as Recordable)?.items || [];
237 return res; 248 return res;
238 }, 249 },
239 columns: props.record.ifShowClass 250 columns: props.record.ifShowClass