|
|
@ -7,20 +7,32 @@ |
|
|
|
<div class="area-text">反应板夹区</div> |
|
|
|
</div> |
|
|
|
<div class="real-time-temperature"> |
|
|
|
<div :class="['status-ball', { 'overheat': temperature > 40 }]"></div> |
|
|
|
<div :class="['status-ball', { overheat: temperature > 40 }]"></div> |
|
|
|
<div class="number">温度: {{ temperature }}°</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!--反应板显示区域--> |
|
|
|
<div class="sptting-plates"> |
|
|
|
<div class="card" v-for="i in 6" :key="i" @click="changeNumber(plates[i - 1], i - 1)"> |
|
|
|
<div class="card" v-for="i in 6" :key="i"> |
|
|
|
<div class="plate-area"> |
|
|
|
<!-- 当 plates 数组长度不为 0 时,渲染 Plate 组件,否则显示默认的图片 --> |
|
|
|
<div v-if="plates.length > 0" class="plate"> |
|
|
|
<Plate :value="plates[i - 1].num" :color="plates[i - 1].color" /> |
|
|
|
<SliderAreaEx |
|
|
|
v-if="plates[i - 1].num > 0" |
|
|
|
class="slider-area" |
|
|
|
:currValue="plates[i - 1].num" |
|
|
|
:totalValue="totalVal" |
|
|
|
:order="i" |
|
|
|
@update:sliderValue="updateSliderVal" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<div v-else class="close-circle"> |
|
|
|
<img src="@/assets/Index/stop.svg" alt="" style="width: 40px;height: 40px; margin-bottom: 20px;" /> |
|
|
|
<img |
|
|
|
src="@/assets/Index/stop.svg" |
|
|
|
alt="" |
|
|
|
style="width: 40px; height: 40px; margin-bottom: 20px" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="plate-bottom" v-if="plates.length > 0"> |
|
|
@ -36,34 +48,63 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- 修改数字弹框 --> |
|
|
|
<ChangeNum ref="changeNumRef"></ChangeNum> |
|
|
|
<!-- <ChangeNum ref="changeNumRef"></ChangeNum> --> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup> |
|
|
|
import Plate from './Plate.vue'; |
|
|
|
import { ref, onMounted, onBeforeUnmount } from 'vue'; |
|
|
|
import ChangeNum from './ChangeNum.vue'; |
|
|
|
import Plate from './Plate.vue' |
|
|
|
import { ref, onMounted, onBeforeUnmount } from 'vue' |
|
|
|
import SliderAreaEx from './SliderAreaEx.vue' |
|
|
|
import { eventBus } from '../../../../eventBus' |
|
|
|
// import ChangeNum from './ChangeNum.vue'; |
|
|
|
import { useDeviceStore } from '../../../../store/index' |
|
|
|
import { updateConsumables } from '../../../../services' |
|
|
|
import { pl } from 'element-plus/es/locale/index.mjs' |
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
|
plates: { |
|
|
|
type: Array, |
|
|
|
default: () => [] |
|
|
|
default: () => [], |
|
|
|
}, |
|
|
|
temperature: { |
|
|
|
type: Number, |
|
|
|
default: 40 |
|
|
|
} |
|
|
|
default: 40, |
|
|
|
}, |
|
|
|
}) |
|
|
|
|
|
|
|
const changeNumRef = ref() |
|
|
|
const changeNumber = (plate, index) => { |
|
|
|
if (props.plates.length > 0) { |
|
|
|
changeNumRef.value.openDialog(plate, index) |
|
|
|
const totalVal = ref(25) |
|
|
|
const deviceStore = useDeviceStore() |
|
|
|
|
|
|
|
const updateSliderVal = async (plate, order) => { |
|
|
|
// eventBus.emit('confirm', { type: 'Plate', value: plate, index }) |
|
|
|
if (deviceStore.status === 'IDLE') { |
|
|
|
try { |
|
|
|
const newVal = plate.toFixed() |
|
|
|
const res = await updateConsumables({group: `CG${order}`, num: newVal}) |
|
|
|
if (res.success) { |
|
|
|
// eventBus.emit('confirm', { |
|
|
|
// type: 'Plate', |
|
|
|
// value: newVal, |
|
|
|
// index: order - 1, |
|
|
|
// }) |
|
|
|
// isOpen.value = false |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
console.error('更新失败:', error) |
|
|
|
} |
|
|
|
} else { |
|
|
|
ElMessage.error('设备正在工作,无法修改数值') |
|
|
|
} |
|
|
|
console.log('plate', plate) |
|
|
|
} |
|
|
|
|
|
|
|
// const changeNumRef = ref() |
|
|
|
// const changeNumber = (plate, index) => { |
|
|
|
// if (props.plates.length > 0) { |
|
|
|
// changeNumRef.value.openDialog(plate, index) |
|
|
|
// } |
|
|
|
// console.log('plate', plate) |
|
|
|
// } |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="less" scoped> |
|
|
@ -150,7 +191,15 @@ const changeNumber = (plate, index) => { |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
|
|
|
|
position: relative; |
|
|
|
|
|
|
|
.slider-area { |
|
|
|
position: absolute; |
|
|
|
left: 0; |
|
|
|
top: 0; |
|
|
|
right: 0; |
|
|
|
bottom: 30px; |
|
|
|
} |
|
|
|
.plate { |
|
|
|
width: 100%; |
|
|
|
height: 76px; |
|
|
@ -180,4 +229,4 @@ const changeNumber = (plate, index) => { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |