fix:组件优化

20240912_adapter
chenhc 5 months ago
parent 786f290156
commit da5fd400b3

@ -11,6 +11,7 @@
:key="slot.id" :key="slot.id"
class="shelf-slot" class="shelf-slot"
:style="{ width: `${100 / row.slots.length}%` }" :style="{ width: `${100 / row.slots.length}%` }"
@click="handleSlotClick(slot)"
> >
{{ slot.item }} {{ slot.item }}
</div> </div>
@ -27,6 +28,12 @@ export default {
required: true, required: true,
}, },
}, },
methods: {
handleSlotClick(slot) {
// 'slot-click'
this.$emit('slot-click', slot);
},
},
created() { created() {
this.shelfData = this.shelfData.sort((a, b) => a.row - b.row); this.shelfData = this.shelfData.sort((a, b) => a.row - b.row);
} }

@ -134,6 +134,7 @@
> >
<ShelfDisplay <ShelfDisplay
:shelfData="this.shelfData" :shelfData="this.shelfData"
@slot-click="handleSlotClick"
> >
</ShelfDisplay> </ShelfDisplay>
</el-dialog> </el-dialog>
@ -236,7 +237,12 @@ export default {
ShelfDisplay ShelfDisplay
}, },
methods: { methods: {
selectSysParam() { handleSlotClick(slot) {
//
console.log('被点击的货位:', slot);
//
},
selectSysParam() {
getSet().then((response) => { getSet().then((response) => {
if (response.code == 20000) { if (response.code == 20000) {
this.formData = response.data this.formData = response.data

Loading…
Cancel
Save