12 changed files with 344 additions and 315 deletions
-
2src/apis/home.ts
-
5src/app.vue
-
5src/components/home/CleanSolution/index.vue
-
9src/components/home/DrainSolution/index.vue
-
5src/components/home/DrainWasteSolution/index.vue
-
5src/components/home/FillSolution/index.vue
-
138src/components/home/selectCraft/index.vue
-
2src/main.ts
-
239src/stores/systemStore.ts
-
8src/types/home.d.ts
-
65src/types/system.d.ts
-
176src/views/home/index.vue
@ -0,0 +1,138 @@ |
|||
<script setup lang="ts"> |
|||
import type { CheckboxValueType } from 'element-plus' |
|||
import { getCraftList } from 'apis/crafts' |
|||
import { onMounted } from 'vue' |
|||
|
|||
const emits = defineEmits(['close']) |
|||
|
|||
const craftList = ref([]) |
|||
onMounted(async () => { |
|||
const res = await getCraftList() |
|||
craftList.value = res.list |
|||
}) |
|||
|
|||
const checkAll1 = ref(false) |
|||
const isIndeterminate1 = ref(false) |
|||
const trayTubes1 = ref([]) |
|||
|
|||
const checkAll2 = ref(false) |
|||
const isIndeterminate2 = ref(false) |
|||
const trayTubes2 = ref([]) |
|||
|
|||
const handleCheckAllChange = (val: CheckboxValueType, type: number) => { |
|||
if (type === 1) { |
|||
checkAll1.value = val |
|||
trayTubes1.value = val ? Array.from({ length: 16 }, (_, index) => index + 1) : [] |
|||
isIndeterminate1.value = false |
|||
} |
|||
else { |
|||
checkAll2.value = val |
|||
trayTubes2.value = val ? Array.from({ length: 16 }, (_, index) => index + 17) : [] |
|||
isIndeterminate2.value = false |
|||
} |
|||
} |
|||
|
|||
const tubeCrafts = ref([]) |
|||
|
|||
const close = () => { |
|||
emits('close') |
|||
} |
|||
</script> |
|||
|
|||
<template lang="pug"> |
|||
FtDialog(visible title="自动滴定" width="60%") |
|||
div.box |
|||
el-card |
|||
el-checkbox(v-model="checkAll1" :indeterminate="isIndeterminate1" @change="val => handleCheckAllChange(val, 1)") 全选 |
|||
el-checkbox-group(v-model="trayTubes1" ) |
|||
div.tube-content |
|||
div.tube-box(v-for="item in 16" :key="item" :class="{ 'tube-box-success': true }") |
|||
div.tube-item |
|||
span.serial-number {{item.toString().padStart(2, '0')}} |
|||
el-checkbox(:value="item") |
|||
el-card |
|||
el-checkbox(v-model="checkAll2" :indeterminate="isIndeterminate2" @change="val => handleCheckAllChange(val, 2)") 全选 |
|||
el-checkbox-group(v-model="trayTubes2" ) |
|||
div.tube-content |
|||
div.tube-box(v-for="item in 16" :key="item" :class="{ 'tube-box-success': true }") |
|||
div.tube-item |
|||
span.serial-number {{(item+16).toString().padStart(2, '0')}} |
|||
el-checkbox(:value="item+16") |
|||
p 加热位打发过分沙发斯蒂芬 |
|||
div.select-box |
|||
p 选择工艺 |
|||
el-select(style="width: 200px") |
|||
el-option(v-for="item in craftList" :key="item.id" :label="item.name" :value="item.id") |
|||
template(#footer) |
|||
ft-button(type="primary" :click-handle="start") |
|||
| 开始滴定 |
|||
ft-button(type="primary" :click-handle="pause") |
|||
| 暂停滴定 |
|||
ft-button(type="primary" :click-handle="stop") |
|||
| 停止滴定 |
|||
ft-button(:click-handle="close") |
|||
| 关闭 |
|||
</template> |
|||
|
|||
<style scoped lang="stylus"> |
|||
.box |
|||
height 350px |
|||
display flex |
|||
justify-content space-between |
|||
.el-card |
|||
width calc(50% - 5px) |
|||
height 100% |
|||
background #F7F7F7 |
|||
border-radius 10px !important |
|||
box-shadow none |
|||
border none |
|||
:deep(.el-card__body) |
|||
background #F7F7F7 |
|||
border-radius 10px!important |
|||
padding 10px |
|||
height 100% |
|||
.tube-content |
|||
width 100% |
|||
height calc(100% - 30px) |
|||
display grid |
|||
grid-template-columns repeat(4, 1fr) |
|||
grid-template-rows repeat(4, 1fr) |
|||
grid-gap 4px |
|||
.tube-box-success |
|||
background #12C290 !important |
|||
color #fff !important |
|||
.tube-box |
|||
font-size 10px |
|||
background #EBEFF4 |
|||
border-radius: 10px |
|||
padding 0 5px |
|||
color #606266 |
|||
border 2px solid #ffffff |
|||
transition all .5s |
|||
position relative |
|||
overflow hidden |
|||
p |
|||
position absolute |
|||
bottom 0 |
|||
left 0 |
|||
padding 0 10px |
|||
height 20px |
|||
width 100% |
|||
background rgba(0, 0, 0, 0.15) |
|||
text-align center |
|||
line-height 20px |
|||
.tube-item |
|||
display flex |
|||
justify-content space-between |
|||
align-items center |
|||
.serial-number |
|||
font-size 14px |
|||
font-weight 900 |
|||
.select-box |
|||
display flex |
|||
align-items center |
|||
gap 20px |
|||
margin-top 10px |
|||
.el-checkbox-group |
|||
height 100% |
|||
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue