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