feat: 算力分配3D图构建完成
parent
ab5cee04d0
commit
1924de58c4
@ -0,0 +1,130 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: donghao donghao@supervision.ltd
|
||||||
|
* @Date: 2024-01-19 09:38:33
|
||||||
|
* @LastEditors: donghao donghao@supervision.ltd
|
||||||
|
* @LastEditTime: 2024-01-19 13:11:17
|
||||||
|
* @FilePath: \General-AI-Platform-Web-Client\src\views\demo\cube.vue
|
||||||
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||||
|
-->
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from "vue";
|
||||||
|
defineOptions({
|
||||||
|
name: "DemoCube"
|
||||||
|
});
|
||||||
|
const listData = ref([
|
||||||
|
{
|
||||||
|
label: "剩余算力",
|
||||||
|
value: 214,
|
||||||
|
color: "#DCDCDC"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "离岗监控",
|
||||||
|
value: 207,
|
||||||
|
color: "#FAA90B"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "玩手机监控",
|
||||||
|
value: 120,
|
||||||
|
color: "#014BE6"
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
const fetchPathValByHeight = val => {
|
||||||
|
return val - 12;
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<div class="cube_wrap">
|
||||||
|
<ul class="cube_info">
|
||||||
|
<li v-for="(v, k) in listData" :key="k">
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="42"
|
||||||
|
:height="v.value"
|
||||||
|
:viewBox="`0 0 42 ${v.value}`"
|
||||||
|
fill="none"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
:d="`M20.7846 90L41.5692 ${fetchPathValByHeight(v.value)}L20.7846 ${
|
||||||
|
v.value
|
||||||
|
}L0 ${fetchPathValByHeight(v.value)}L20.7846 90Z`"
|
||||||
|
fill="#D9D9D9"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
:d="`M41.5693 72L20.7847 60V90L41.5693 ${fetchPathValByHeight(
|
||||||
|
v.value
|
||||||
|
)}V72Z`"
|
||||||
|
fill="#D9D9D9"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
:d="`M20.7846 60L0 72V${fetchPathValByHeight(
|
||||||
|
v.value
|
||||||
|
)}L20.7846 90V60Z`"
|
||||||
|
fill="#D9D9D9"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
:d="`M20.7847 24L41.5693 12V${fetchPathValByHeight(
|
||||||
|
v.value
|
||||||
|
)}L20.7847 ${v.value}V24Z`"
|
||||||
|
:fill="v.color"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
:d="`M0 12L20.7846 24V${v.value}L0 ${fetchPathValByHeight(
|
||||||
|
v.value
|
||||||
|
)}V12Z`"
|
||||||
|
:fill="v.color"
|
||||||
|
/>
|
||||||
|
<rect
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
transform="matrix(0.866025 0.5 -0.866025 0.5 20.7847 0)"
|
||||||
|
:fill="v.color"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="cube_btn">
|
||||||
|
<li>
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="15"
|
||||||
|
height="18"
|
||||||
|
viewBox="0 0 15 18"
|
||||||
|
fill="none"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M-4.37114e-07 9L15 0.339744L15 17.6603L-4.37114e-07 9Z"
|
||||||
|
fill="#FAA90B"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.cube_wrap {
|
||||||
|
position: relative;
|
||||||
|
.cube_info {
|
||||||
|
& > li {
|
||||||
|
margin-top: -24px;
|
||||||
|
&:nth-child(1) {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.cube_btn {
|
||||||
|
& > li {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
position: absolute;
|
||||||
|
left: 41px;
|
||||||
|
top: 193px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in New Issue