7 changed files with 162 additions and 48 deletions
-
54src/src/main/java/com/my/graphiteDigesterBg/diframe/api/DiApiResource.java
-
5src/src/main/java/com/my/graphiteDigesterBg/resource/ResAcidBucket.java
-
24src/src/main/java/com/my/graphiteDigesterBg/resource/ResAcidManager.java
-
11src/src/main/java/com/my/graphiteDigesterBg/task/TaskLiquidAdd.java
-
74src/web/src/pages/main/contents/AcidManagement.vue
-
35src/web/src/pages/main/contents/Operation.vue
-
5src/web/src/utils/ApiClient.js
@ -1,43 +1,65 @@ |
|||||
<template> |
<template> |
||||
<a-row class="h-full p-1"> |
<a-row class="h-full p-1"> |
||||
<a-col :span="10" class="p-5"> |
|
||||
|
<a-col v-for="bucket in buckets" :key="bucket.index" :span="6" class="p-5"> |
||||
<div class="flex flex-col justify-center items-center h-full bg-gray-50 rounded-3xl"> |
<div class="flex flex-col justify-center items-center h-full bg-gray-50 rounded-3xl"> |
||||
<div class="text-center mb-10 text-3xl bg-blue-200 p-5 rounded-3xl w-32 text-gray-100">硫酸</div> |
|
||||
<div class="w-full relative"> |
<div class="w-full relative"> |
||||
<div class="h-full w-full text-center"> |
<div class="h-full w-full text-center"> |
||||
<img class="w-1/2" src="../../../assets/icon/bucket-full.svg" /> |
<img class="w-1/2" src="../../../assets/icon/bucket-full.svg" /> |
||||
</div> |
</div> |
||||
<div class="h-full w-full text-center absolute top-0 overflow-hidden" :style="{height:`${Math.random()*100}%`}"> |
|
||||
|
<div class="h-full w-full text-center absolute top-0 overflow-hidden" :style="{height:`${100-bucket.volume/bucket.maxVolume*100}%`}"> |
||||
<img class="w-1/2" src="../../../assets/icon/bucket-empty.svg" /> |
<img class="w-1/2" src="../../../assets/icon/bucket-empty.svg" /> |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
<div class="mx-2 p-2 mt-3 rounded-2xl text-3xl" style="background:#D2DFEF;color:#8799AB;"> |
<div class="mx-2 p-2 mt-3 rounded-2xl text-3xl" style="background:#D2DFEF;color:#8799AB;"> |
||||
<span class="inline-block p-1 rounded-2xl mr-5" style="background:#DCE8F7;">3000g</span> |
|
||||
<span class="inline-block py-1">5000g</span> |
|
||||
|
<span class="inline-block p-1 rounded-2xl mr-5" style="background:#DCE8F7;">{{bucket.volume}}g</span> |
||||
|
<span class="inline-block py-1">{{bucket.maxVolume}}g</span> |
||||
</div> |
</div> |
||||
</div> |
|
||||
</a-col> |
|
||||
<a-col :span="10" class="p-5"> |
|
||||
<div class="flex flex-col justify-center items-center h-full bg-gray-50 rounded-3xl"> |
|
||||
<div class="text-center mb-10 text-3xl bg-blue-200 p-5 rounded-3xl w-32 text-gray-100">硫酸</div> |
|
||||
<div class="w-full relative"> |
|
||||
<div class="h-full w-full text-center"> |
|
||||
<img class="w-1/2" src="../../../assets/icon/bucket-full.svg" /> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="mx-2 p-2 mt-3 rounded-2xl text-3xl" style="background:#D2DFEF;color:#8799AB;"> |
|
||||
<span class="inline-block p-1 rounded-2xl mr-5" style="background:#DCE8F7;">3000g</span> |
|
||||
<span class="inline-block py-1">5000g</span> |
|
||||
</div> |
|
||||
<div class="py-3 px-5 text-3xl bg-blue-500 text-white mt-10 rounded-3xl">加载</div> |
|
||||
</div> |
|
||||
</a-col> |
|
||||
<a-col :span="4" class="p-5"> |
|
||||
<div class="flex flex-col justify-center items-center h-full bg-gray-50 rounded-3xl"> |
|
||||
<div v-for="i in 8" :key="i" class="bg-white bg-gray-200 p-3 mb-5 w-3/4 text-center rounded-3xl text-xl text-gray-500" :class="{'!bg-blue-500 !text-white':i==2}"> |
|
||||
硫酸 |
|
||||
|
<div class="mt-5"> |
||||
|
<a-select v-model:value="bucket.acidType" :dropdownMatchSelectWidth="false"> |
||||
|
<a-select-option value="hydrochloric">盐酸</a-select-option> |
||||
|
<a-select-option value="nitric">硝酸</a-select-option> |
||||
|
<a-select-option value="sulfuric">硫酸</a-select-option> |
||||
|
<a-select-option value="hydrofluoric">氢氟酸</a-select-option> |
||||
|
<a-select-option value="perchloric">高氯酸</a-select-option> |
||||
|
<a-select-option value="hydrobromic">液溴</a-select-option> |
||||
|
<a-select-option value="phosphoric">磷酸</a-select-option> |
||||
|
<a-select-option value="tartaric">酒石酸</a-select-option> |
||||
|
</a-select> |
||||
|
<a-button class="ml-3" @click="actionReload(bucket)">加载</a-button> |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
</a-col> |
</a-col> |
||||
</a-row> |
</a-row> |
||||
</template> |
</template> |
||||
|
<script setup> |
||||
|
import ApiClient from '@/utils/ApiClient'; |
||||
|
import { onMounted, ref } from 'vue'; |
||||
|
/** @var {Array} */ |
||||
|
const buckets = ref([]); |
||||
|
// on mounted |
||||
|
onMounted(mounted); |
||||
|
|
||||
|
// on mounted |
||||
|
async function mounted() { |
||||
|
await refresh(); |
||||
|
} |
||||
|
|
||||
|
// refresh |
||||
|
async function refresh() { |
||||
|
let client = ApiClient.getClient(); |
||||
|
let response = await client.resourceDataGet('Acid'); |
||||
|
buckets.value = structuredClone(response); |
||||
|
console.log(buckets.value); |
||||
|
} |
||||
|
|
||||
|
// action reload |
||||
|
async function actionReload(bucket) { |
||||
|
let client = ApiClient.getClient(); |
||||
|
await client.resourceActionExecute('Acid', 'bucketUpdate', { |
||||
|
index : bucket.index, |
||||
|
acidType : bucket.acidType, |
||||
|
volume : 5000, |
||||
|
}); |
||||
|
refresh(); |
||||
|
} |
||||
|
</script> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue