Commit faa28e45edf141b5a1d87070a49aede6f90a3830
1 parent
f6188abb
fix: 产品物模型排序时,物模型第一个只能操作下移和置底,最后一个物模型只操作上移和置顶,其余的都可操作四个步骤
Showing
1 changed file
with
6 additions
and
8 deletions
... | ... | @@ -130,25 +130,25 @@ |
130 | 130 | { |
131 | 131 | label: t('common.sortOperation.isTop'), |
132 | 132 | icon: 'ant-design:vertical-align-top-outlined', |
133 | - ifShow: includeSortIsTop.includes(index) ? false : true, | |
133 | + ifShow: index === 0 && includeSortIsTop.includes(record.sort) ? false : true, | |
134 | 134 | onClick: handleTableSort.bind(null, 'topUp', record), |
135 | 135 | }, |
136 | 136 | { |
137 | 137 | label: t('common.sortOperation.moveUp'), |
138 | 138 | icon: 'ant-design:up-outlined', |
139 | - ifShow: includeSortIsTop.includes(index) ? false : true, | |
139 | + ifShow: index === 0 && includeSortIsTop.includes(record.sort) ? false : true, | |
140 | 140 | onClick: handleTableSort.bind(null, 'up', record), |
141 | 141 | }, |
142 | 142 | { |
143 | 143 | label: t('common.sortOperation.moveDown'), |
144 | 144 | icon: 'ant-design:down-outlined', |
145 | - ifShow: thingsModelListTotal - index <= 1 ? false : true, | |
145 | + ifShow: thingsModelListTotal - record.sort <= 1 ? false : true, | |
146 | 146 | onClick: handleTableSort.bind(null, 'down', record), |
147 | 147 | }, |
148 | 148 | { |
149 | 149 | label: t('common.sortOperation.isBottom'), |
150 | 150 | icon: 'ant-design:vertical-align-bottom-outlined', |
151 | - ifShow: thingsModelListTotal - index <= 1 ? false : true, | |
151 | + ifShow: thingsModelListTotal - record.sort <= 1 ? false : true, | |
152 | 152 | onClick: handleTableSort.bind(null, 'bottomUp', record), |
153 | 153 | }, |
154 | 154 | ]" |
... | ... | @@ -215,9 +215,7 @@ |
215 | 215 | isCategory: Boolean; |
216 | 216 | }>(); |
217 | 217 | |
218 | - const includeSortIsTop = [0]; | |
219 | - | |
220 | - // const includeSortIsBottom = [1]; | |
218 | + const includeSortIsTop = [0, 1]; | |
221 | 219 | |
222 | 220 | const { createMessage } = useMessage(); |
223 | 221 | const isShowBtn = ref(false); |
... | ... | @@ -235,7 +233,7 @@ |
235 | 233 | id: props.record.id, |
236 | 234 | selectType: props.record.ifShowClass ? 'category' : undefined, |
237 | 235 | }); |
238 | - thingsModelListTotal.value = res?.total || 0; | |
236 | + thingsModelListTotal.value = (res as Recordable)?.total || 0; | |
239 | 237 | return res; |
240 | 238 | }, |
241 | 239 | columns: props.record.ifShowClass | ... | ... |