feat: 接口联通

dev-deviceSetting
JINGYJ 12 months ago
parent 74f4604095
commit 8401a7ff25

@ -38,7 +38,7 @@ export default [
method: "post", method: "post",
response: req => { response: req => {
const { currServerList } = req.body; const { currServerList } = req.body;
console.log(currServerList, "currServerList"); // console.log(currServerList, "currServerList");
const finalServerList = currServerList.map(item => { const finalServerList = currServerList.map(item => {
if (item.isEnabled) { if (item.isEnabled) {
item.progressData = item.progressData.map(itemChild => { item.progressData = item.progressData.map(itemChild => {

@ -0,0 +1,58 @@
import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";
type Result = {
success: boolean;
data?: Array<any> | any;
};
type ResultList = {
success: boolean;
data?: {
count: number;
/** 列表数据 */
results: Array<any>;
};
};
/** 获取异常分类 */
export const getDataOverviewList = (params?: object) => {
return http.request<Result>("get", baseUrlApi("data_overview/"), {
params
});
};
/** 获取设备分类 */
export const getDeviceList = (params?: object) => {
return http.request<Result>("get", baseUrlApi("device_and_warnings/"), {
params
});
};
/** 获取违规总量 */
export const getWarningList = (params?: object) => {
return http.request<Result>("get", baseUrlApi("warnings_and_message/"), {
params
});
};
/** 获取消息通知 */
export const getMessagesList = (params?: object) => {
return http.request<ResultList>("get", baseUrlApi("messages/"), {
params
});
};
/** 获取算力配置 */
export const getComputeConfigList = (params?: object) => {
return http.request<ResultList>("get", baseUrlApi("compute_config/"), {
params
});
};
/** 获取缺陷 */
export const getClassifyWarningsList = (params?: object) => {
return http.request<ResultList>("get", baseUrlApi("classify_warnings/"), {
params
});
};

@ -16,13 +16,15 @@ defineOptions({
name: "DeviceStatus" name: "DeviceStatus"
}); });
const deviceStatusData = ref<Record<string, any>>({ const props = defineProps({
onlineCount: 618, deviceStatus: {
errorCount: 120, type: Object,
processCount: 118, default: () => {}
outlineCount: 200 }
}); });
const deviceStatusData = ref({ ...props.deviceStatus });
const deviceStatusOptions = ref<Record<string, any>[]>([ const deviceStatusOptions = ref<Record<string, any>[]>([
{ {
label: "在线", label: "在线",

@ -9,9 +9,11 @@
<script setup lang="ts"> <script setup lang="ts">
import { DsBox2 } from "@/components/DsBox"; import { DsBox2 } from "@/components/DsBox";
import { getAlarmList } from "@/api/list"; import { getAlarmList } from "@/api/list";
import { getWarnList } from "@/api/alarm";
import { onMounted, ref, reactive, h } from "vue"; import { onMounted, ref, reactive, h } from "vue";
import { BaseTable } from "@/components/CustomTable"; import { BaseTable } from "@/components/CustomTable";
import { getConfig } from "@/config"; import { getConfig } from "@/config";
import dayjs from "dayjs";
// import ModelCofrimBox from "../../components/modelCofrimBox.vue"; // import ModelCofrimBox from "../../components/modelCofrimBox.vue";
defineOptions({ defineOptions({
@ -84,17 +86,19 @@ const columns = [
// }, // },
{ {
label: "告警名称", label: "告警名称",
property: "name" property: "warning_name"
}, },
{ {
label: "告警代码", label: "告警代码",
property: "code" property: "warning_code"
}, },
{ {
label: "告警等级", label: "告警等级",
property: "level", property: "warning_level",
formatter: val => { formatter: val => {
const currentLevelObj = alarmLevelStatusEnum[Number(val?.level) - 1]; console.log(val);
const currentLevelObj =
alarmLevelStatusEnum[Number(val?.warning_level) - 1];
return h( return h(
"div", "div",
{ {
@ -123,8 +127,8 @@ const columns = [
} }
}, },
{ {
label: "设备组", label: "节点",
property: "deviceGroup", property: "node_name",
formatter: val => { formatter: val => {
return h( return h(
"div", "div",
@ -144,7 +148,7 @@ const columns = [
fontSize: "14px", fontSize: "14px",
class: "text-white" class: "text-white"
}, },
val.deviceGroup val.node_name
) )
] ]
); );
@ -152,13 +156,15 @@ const columns = [
}, },
{ {
label: "告警日期", label: "告警日期",
property: "createTime" property: "trigger_time",
}, formatter: ({ trigger_time }) =>
// TODO dayjs(trigger_time).format("YYYY-MM-DD HH:mm:ss")
{
type: "action",
label: "操作"
} }
// TODO
// {
// type: "action",
// label: ""
// }
]; ];
const svg = ` const svg = `
@ -179,20 +185,24 @@ const listData = ref([]);
// const searchValue = ref(""); // const searchValue = ref("");
const formData = reactive({ const formData = reactive({
name: "", warning_name: "",
level: "" warning_level: ""
}); });
const dataLoading = ref(true); const dataLoading = ref(true);
const getList = async () => { const getList = async () => {
const { currentPage, pageSize } = pagination.value; const { currentPage, pageSize } = pagination.value;
const { data } = await getAlarmList({ page: currentPage, pageSize }); const { data } = await getWarnList({
listData.value = data.list; ...formData,
console.log(data.list); page: currentPage,
pageSize
});
listData.value = data.results;
console.log(data.results);
pagination.value = { pagination.value = {
...pagination.value, ...pagination.value,
total: data.total total: data.count
}; };
dataLoading.value = false; dataLoading.value = false;
// try { // try {
@ -245,18 +255,25 @@ onMounted(() => {
> >
<el-form-item label="告警名称"> <el-form-item label="告警名称">
<el-select <el-select
v-model="formData.name" v-model="formData.warning_name"
placeholder="告警名称" placeholder="告警名称"
@change="getList"
clearable clearable
> >
<!-- <el-option label="名称1" value="1" /> <!-- <el-option label="名称1" value="1" />
<el-option label="名称2" value="2" /> --> <el-option label="名称2" value="2" /> -->
<el-option label="表面裂纹" value="表面裂纹" />
<el-option label="外观缺损" value="外观缺损" />
<el-option label="表面划痕" value="表面划痕" />
<el-option label="白斑" value="白斑" />
<el-option label="毛刺" value="毛刺" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="告警等级"> <el-form-item label="告警等级">
<el-select <el-select
v-model="formData.level" v-model="formData.warning_level"
placeholder="告警等级" placeholder="告警等级"
@change="getList"
clearable clearable
> >
<el-option <el-option

@ -14,7 +14,8 @@ import { ComputePowerPoolItem } from "./typing";
import { AnimationPic } from "@/components/AnimationCard"; import { AnimationPic } from "@/components/AnimationCard";
import computePowerAllocationIcon from "@/assets/animate/device/computePowerAllocation.json"; import computePowerAllocationIcon from "@/assets/animate/device/computePowerAllocation.json";
import { DsBox2 } from "@/components/DsBox"; import { DsBox2 } from "@/components/DsBox";
import { getPowerPoolsList, getPowerGroupList } from "@/api/list"; import { getPowerGroupList } from "@/api/list";
import { getComputeConfig } from "@/api/computePower";
defineOptions({ defineOptions({
name: "ComputePowerAllocation" name: "ComputePowerAllocation"
@ -25,7 +26,7 @@ const groupList = ref<Record<string, any>[]>([]); //获取dom;
const poolsData = ref<ComputePowerPoolItem[]>([]); const poolsData = ref<ComputePowerPoolItem[]>([]);
async function fetchPowerData() { async function fetchPowerData() {
const res = await getPowerPoolsList(); const res = await getComputeConfig();
console.log("fetchPowerData_res", res); console.log("fetchPowerData_res", res);
poolsData.value = res.data; poolsData.value = res.data;
} }

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, watch, type Ref } from "vue"; import { ref, computed, watch, type Ref, nextTick } from "vue";
import { useAppStoreHook } from "@/store/modules/app"; import { useAppStoreHook } from "@/store/modules/app";
import { import {
delay, delay,
@ -23,126 +23,143 @@ const { setOptions, resize } = useECharts(
} }
); );
setOptions( const props = defineProps({
{ data: {
title: { type: Array,
show: false, default: () => []
text: "算力占用", }
left: "left", });
textStyle: { watch(
fontSize: 14, () => props,
color: "#333" async () => {
} await nextTick();
}, setOptions(
tooltip: {
trigger: "item",
formatter: function (params) {
//
return `${params.value}%`;
}
},
legend: {
show: false,
icon: "rect",
// orient: "vertical",
align: "auto",
bottom: "0",
// top: "40%",
// right: "15%",
// itemGap: 18,
textStyle: {
fontSize: 12,
color: "#333"
}
// right: true
},
color: ["#1BFFFD", "#FA783C", "#008FFF", "#0CB6FF", "#FFC97C"],
series: [
{ {
radius: ["32%", "50%"], title: {
center: ["50%", "50%"], show: false,
type: "pie", text: "算力占用",
// silent: true,// false left: "left",
label: { textStyle: {
fontSize: 14, fontSize: 14,
show: true, color: "#333"
formatter: "{b} {c}%", }
color: "#fff",
position: "outside"
}, },
emphasis: { tooltip: {
disabled: true trigger: "item",
formatter: function (params) {
//
return `${params.value}%`;
}
}, },
labelLine: { legend: {
show: true, show: false,
length: 15, icon: "rect",
length2: 15 // orient: "vertical",
align: "auto",
bottom: "0",
// top: "40%",
// right: "15%",
// itemGap: 18,
textStyle: {
fontSize: 12,
color: "#333"
}
// right: true
}, },
name: "", color: ["#1BFFFD", "#FA783C", "#008FFF", "#0CB6FF", "#FFC97C"],
data: [ series: [
{ value: 15, name: "螺纹缺陷检测" },
{ value: 40, name: "PIN间距测量" },
{ value: 20, name: "压板缺陷检测" },
{ value: 15, name: "划伤缺陷检测" },
{ value: 10, name: "工件尺寸测量" }
]
// label: {
// formatter: function (params) {
// return params.value + "%";
// },
// fontWeight: 600
// }
// emphasis: {
// itemStyle: {
// shadowBlur: 10,
// shadowOffsetX: 0,
// shadowColor: "rgba(0, 0, 0, 0.5)"
// }
// }
},
{
name: "外边框",
type: "pie",
clockwise: false, //
// silent: true,
center: ["50%", "50%"],
radius: ["60%", "60%"],
label: { show: false },
data: [
{ {
value: 9, radius: ["32%", "50%"],
center: ["50%", "50%"],
type: "pie",
// silent: true,// false
label: {
fontSize: 14,
show: true,
formatter: "{b} {c}%",
color: "#fff",
position: "outside"
},
emphasis: {
disabled: true
},
labelLine: {
show: true,
length: 15,
length2: 15
},
name: "", name: "",
itemStyle: { data: props.data
borderWidth: 2, // data: [
borderColor: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ // { value: 15, name: "" },
{ // { value: 40, name: "PIN" },
offset: 0, // { value: 20, name: "" },
color: "rgba(12, 182, 255, 0)" // { value: 15, name: "" },
}, // { value: 10, name: "" }
{ // ]
offset: 1, // label: {
color: "rgba(12, 182, 255, 0.6)" // formatter: function (params) {
// return params.value + "%";
// },
// fontWeight: 600
// }
// emphasis: {
// itemStyle: {
// shadowBlur: 10,
// shadowOffsetX: 0,
// shadowColor: "rgba(0, 0, 0, 0.5)"
// }
// }
},
{
name: "外边框",
type: "pie",
clockwise: false, //
// silent: true,
center: ["50%", "50%"],
radius: ["60%", "60%"],
label: { show: false },
data: [
{
value: 9,
name: "",
itemStyle: {
borderWidth: 2,
borderColor: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "rgba(12, 182, 255, 0)"
},
{
offset: 1,
color: "rgba(12, 182, 255, 0.6)"
}
])
} }
]) }
} ]
} }
] ]
},
{
name: "click",
callback: params => {
console.log("click", params);
}
},
//
{
type: "zrender",
name: "click",
callback: params => {
console.log("点击空白处", params);
}
} }
] );
},
{
name: "click",
callback: params => {
console.log("click", params);
}
}, },
//
{ {
type: "zrender", deep: true,
name: "click", immediate: true
callback: params => {
console.log("点击空白处", params);
}
} }
); );

@ -92,29 +92,29 @@ const CubeTop = echarts.graphic.extendShape({
echarts.graphic.registerShape("CubeLeft", CubeLeft); echarts.graphic.registerShape("CubeLeft", CubeLeft);
echarts.graphic.registerShape("CubeRight", CubeRight); echarts.graphic.registerShape("CubeRight", CubeRight);
echarts.graphic.registerShape("CubeTop", CubeTop); echarts.graphic.registerShape("CubeTop", CubeTop);
watch( // watch(
() => props.defect3DData, // () => props.defect3DData,
newDefectData => { // newDefectData => {
defect3DData.value = [...newDefectData]; // defect3DData.value = [...newDefectData];
updateChart(); // updateChart();
}, // },
{ immediate: true, deep: true } // { immediate: true, deep: true }
); // );
function updateChart() { // function updateChart() {
// // //
if (!getInstance()) { // if (!getInstance()) {
console.error("图表实例不存在"); // console.error("");
return; // return;
} // }
// // //
const currentOption = getInstance()!.getOption(); // const currentOption = getInstance()!.getOption();
// series // // series
currentOption.series[0].data = defect3DData.value; // currentOption.series[0].data = defect3DData.value;
currentOption.series[1].data = defect3DData.value; // currentOption.series[1].data = defect3DData.value;
getInstance()!.setOption(currentOption); // getInstance()!.setOption(currentOption);
} // }
watch( watch(
() => props, () => props,
async () => { async () => {

@ -16,6 +16,12 @@ import AlarmInfoList from "../../components/alarmInfoList.vue";
import DeviceStatus from "../../components/deviceStatus.vue"; import DeviceStatus from "../../components/deviceStatus.vue";
import ComputingPowerPie from "./components/ComputingPowerPie.vue"; import ComputingPowerPie from "./components/ComputingPowerPie.vue";
import type { TabsPaneContext } from "element-plus"; import type { TabsPaneContext } from "element-plus";
import {
getDataOverviewList,
getDeviceList,
getComputeConfigList,
getClassifyWarningsList
} from "@/api/workbench";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { DsBox2 } from "@/components/DsBox"; import { DsBox2 } from "@/components/DsBox";
@ -149,8 +155,71 @@ const defect3DData = ref([100, 500, 400, 600, 700, 200]);
const randomIntFn = (min: number, max: number) => { const randomIntFn = (min: number, max: number) => {
return Math.floor(Math.random() * (max - min + 1) + min); return Math.floor(Math.random() * (max - min + 1) + min);
}; };
const dataOverView = ref({
total_device: 0,
total_node: 0,
total_resource: "",
total_warning: 0
});
const deviceStatus = ref({
errorCount: 0,
onlineCount: 0,
outlineCount: 0,
processCount: 0
});
const computeUsed = ref([]);
async function getListData() {
try {
// const { data } = await getModelList({});
const { data } = await getDataOverviewList();
dataOverView.value = data;
// console.log(data, "resData", data);
} catch (e) {
console.log(e);
}
}
async function getListDevice() {
try {
// const { data } = await getModelList({});
const { data } = await getDeviceList();
deviceStatus.value = data.device_status;
computeUsed.value = data.compute_used;
} catch (e) {
console.log(e);
}
}
async function getListComputeConfig() {
try {
// const { data } = await getModelList({});
const { data } = await getComputeConfigList();
console.log(data);
// deviceStatus.value = data.device_status;
// computeUsed.value = data.compute_used;
} catch (e) {
console.log(e);
}
}
const getListClassifyWarnings = async () => {
try {
// const { data } = await getModelList({});
const { data } = await getClassifyWarningsList();
nextTick(() => {
defectData.value = data.defectData;
alarmData.value = data.alarmData;
defect3DData.value = data.defect3DData;
});
console.log(data);
} catch (e) {
console.log(e);
}
};
onMounted(() => { onMounted(() => {
getListClassifyWarnings();
getListData();
getListDevice();
getListComputeConfig();
// intervalId.value = setInterval(() => { // intervalId.value = setInterval(() => {
// defectData.value = [ // defectData.value = [
// randomIntFn(0, 500), // randomIntFn(0, 500),
@ -247,21 +316,21 @@ onUnmounted(() => {
<div class="mid_box"> <div class="mid_box">
<div class="mid_box_icon" /> <div class="mid_box_icon" />
<div class="mid_box_info"> <div class="mid_box_info">
<span class="mid_box_info_top">1102</span> <span class="mid_box_info_top">{{ dataOverView.total_warning }}</span>
<span class="mid_box_info_bottom">异常总量</span> <span class="mid_box_info_bottom">异常总量</span>
</div> </div>
</div> </div>
<div class="mid_box"> <div class="mid_box">
<div class="mid_box_icon" /> <div class="mid_box_icon" />
<div class="mid_box_info"> <div class="mid_box_info">
<span class="mid_box_info_top">467</span> <span class="mid_box_info_top">{{ dataOverView.total_device }}</span>
<span class="mid_box_info_bottom">设备总量</span> <span class="mid_box_info_bottom">设备总量</span>
</div> </div>
</div> </div>
<div class="mid_box"> <div class="mid_box">
<div class="mid_box_icon" /> <div class="mid_box_icon" />
<div class="mid_box_info"> <div class="mid_box_info">
<span class="mid_box_info_top">3048</span> <span class="mid_box_info_top">{{ dataOverView.total_node }}</span>
<span class="mid_box_info_bottom">覆盖车间</span> <span class="mid_box_info_bottom">覆盖车间</span>
</div> </div>
</div> </div>
@ -269,8 +338,9 @@ onUnmounted(() => {
<div class="mid_box_icon" /> <div class="mid_box_icon" />
<div class="mid_box_info"> <div class="mid_box_info">
<span class="mid_box_info_top" <span class="mid_box_info_top"
>893 <i class="font-normal text-base not-italic">TOPS</i></span >{{ dataOverView.total_resource }}
> <!-- <i class="font-normal text-base not-italic">TOPS</i> -->
</span>
<span class="mid_box_info_bottom">资源使用</span> <span class="mid_box_info_bottom">资源使用</span>
</div> </div>
</div> </div>
@ -280,7 +350,7 @@ onUnmounted(() => {
<DsBox2 title="设备在线数量" type="w1h1" bgClass="bg_home_item1"> <DsBox2 title="设备在线数量" type="w1h1" bgClass="bg_home_item1">
<template #default> <template #default>
<div class="w-full px-[24px] py-[8px]"> <div class="w-full px-[24px] py-[8px]">
<DeviceStatus /> <DeviceStatus :deviceStatus="deviceStatus" />
</div> </div>
</template> </template>
</DsBox2> </DsBox2>
@ -290,7 +360,7 @@ onUnmounted(() => {
<template #default> <template #default>
<div class="w-full h-full"> <div class="w-full h-full">
<!-- 算力分配 --> <!-- 算力分配 -->
<ComputingPowerPie /> <ComputingPowerPie :data="computeUsed" />
</div> </div>
</template> </template>
</DsBox2> </DsBox2>

@ -19,12 +19,12 @@ defineOptions({
interface CardProductType { interface CardProductType {
isEnabled: boolean; isEnabled: boolean;
state: string; status: string;
description: string; description: string;
deviceSort: string; classification_name: string;
updateTime: string; updateTime: string;
type: string; model_type: string;
version: string; default_version: string;
industry: string; industry: string;
} }
@ -36,7 +36,7 @@ const props = defineProps({
const boxClass = computed(() => [ const boxClass = computed(() => [
"model-box-inUsed", "model-box-inUsed",
{ "model-box-notUsed": props.modelData?.state !== "在线" } { "model-box-notUsed": props.modelData?.status !== "1001" }
]); ]);
function getModelIcon(params: string) { function getModelIcon(params: string) {
if ( if (
@ -92,24 +92,24 @@ const handleClickDetail = (modelData: CardProductType) => {
<template> <template>
<div :class="boxClass" @click="handleClickDetail(modelData)"> <div :class="boxClass" @click="handleClickDetail(modelData)">
<div class="model-box-state" v-if="modelData.state === '在线'">使</div> <div class="model-box-state" v-if="modelData.status === '1001'">使</div>
<div class="model-box-title"> <div class="model-box-title">
<div class="model-box-name ff1"> <div class="model-box-name ff1">
{{ modelData.deviceSort }} {{ modelData.classification_name }}
</div> </div>
<div <div
:class=" :class="
modelData.type === '经典算法' modelData.model_type === '经典算法'
? 'model-box-type' ? 'model-box-type'
: 'model-box-type-deep' : 'model-box-type-deep'
" "
> >
{{ modelData.type }} {{ modelData.model_type }}
</div> </div>
</div> </div>
<div class="model-box-version"> <div class="model-box-version">
<div class="model-box-version-icon" /> <div class="model-box-version-icon" />
版本{{ modelData.version }} 版本{{ modelData.default_version }}
</div> </div>
<div class="model-box-industry"> <div class="model-box-industry">
<div class="model-box-industry-icon" /> <div class="model-box-industry-icon" />

@ -1,13 +1,14 @@
<script setup lang="ts"> <script setup lang="ts">
// import { getList } from "@/api/list"; // import { getList } from "@/api/list";
import { postModelList } from "@/api/list"; // import { postModelList } from "@/api/list";
import { getModelsList } from "@/api/model";
import error from "@/assets/dataScreen/modelList/error.png"; import error from "@/assets/dataScreen/modelList/error.png";
import loading from "@/assets/dataScreen/modelList/loading.png"; import loading from "@/assets/dataScreen/modelList/loading.png";
import { ElLoading } from "element-plus"; import { ElLoading } from "element-plus";
import "vue-waterfall-plugin-next/dist/style.css"; import "vue-waterfall-plugin-next/dist/style.css";
import InfiniteLoading from "v3-infinite-loading"; import InfiniteLoading from "v3-infinite-loading";
import { onMounted, reactive, ref, nextTick } from "vue"; import { onMounted, reactive, ref, nextTick } from "vue";
import backTop from "@/assets/svg/back_top.svg?component"; // import backTop from "@/assets/svg/back_top.svg?component";
import { Waterfall } from "vue-waterfall-plugin-next"; import { Waterfall } from "vue-waterfall-plugin-next";
import ModelBox from "./components/ModelBox.vue"; import ModelBox from "./components/ModelBox.vue";
@ -66,12 +67,12 @@ const isFinish = ref(false);
const INITIAL_DATA = { const INITIAL_DATA = {
index: null, index: null,
industry: "", industry: "",
state: "", status: "",
function: "", function: "",
deviceSort: "", classification_name: "",
description: "", comment: "",
version: "", default_version: "",
type: "", model_type: "",
provider: "", provider: "",
updateTime: "" updateTime: ""
}; };
@ -94,14 +95,28 @@ function loadList() {
background: "transparent", background: "transparent",
text: "加载中" text: "加载中"
}); });
postModelList({ // postModelList({
// page: page.value,
// pageSize: pageSize.value
// }).then(res => {
// console.log(res);
// // pageTotal.value = res.data?.total || 0;
// // setTimeout(() => {
// // list.value.push(...res.data.list);
// // page.value += 1;
// // nextTick(() => {
// // loadingInstance.value.close();
// // });
// // }, 1000);
// });
getModelsList({
page: page.value, page: page.value,
pageSize: pageSize.value pageSize: pageSize.value
}).then(res => { }).then(res => {
console.log(res); console.log(res);
pageTotal.value = res.data?.total || 0; pageTotal.value = res.data?.count || 0;
setTimeout(() => { setTimeout(() => {
list.value.push(...res.data.list); list.value.push(...res.data.results);
page.value += 1; page.value += 1;
nextTick(() => { nextTick(() => {
loadingInstance.value.close(); loadingInstance.value.close();
@ -167,26 +182,26 @@ onMounted(() => {
<div class="modelListDialogBody"> <div class="modelListDialogBody">
<div class="modelListDialogTitle">基本信息</div> <div class="modelListDialogTitle">基本信息</div>
<div class="modelListDialogContent"> <div class="modelListDialogContent">
模型名称:<span>{{ modelInfo.deviceSort }}</span> 模型名称:<span>{{ modelInfo.classification_name }}</span>
<span <span
:class=" :class="
modelInfo.type === '经典算法' modelInfo.model_type === '经典算法'
? 'model-box-type' ? 'model-box-type'
: 'model-box-type-deep' : 'model-box-type-deep'
" "
>{{ modelInfo.type }}</span >{{ modelInfo.model_type }}</span
> >
模型版本:<span>{{ modelInfo.version }}</span 模型版本:<span>{{ modelInfo.default_version }}</span
>适用行业:<span>{{ modelInfo.industry }}</span> >适用行业:<span>{{ modelInfo.industry }}</span>
</div> </div>
<div class="mb-3 modelListDialogContent"> <div class="mb-3 modelListDialogContent">
模型状态:<span class="modelListState">{{ 模型状态:<span class="modelListState">{{
modelInfo.state === "在线" ? "使用中" : "未使用" modelInfo.status === "1001" ? "使用中" : "未使用"
}}</span> }}</span>
</div> </div>
<div class="modelListDialogTitle">模型简介</div> <div class="modelListDialogTitle">模型简介</div>
<div class="modelListDialogContent"> <div class="modelListDialogContent">
{{ modelInfo.description }} {{ modelInfo.comment }}
</div> </div>
</div> </div>
</el-dialog> </el-dialog>

@ -8,16 +8,19 @@ defineOptions({
name: "ServerBox" name: "ServerBox"
}); });
interface CardProductType { // interface CardProductType {
isEnabled: boolean; // isEnabled: boolean;
state: string; // state: string;
description: string; // description: string;
deviceSort: string; // deviceSort: string;
} // }
const props = defineProps({ const props = defineProps({
serverData: { serverData: {
type: Object as PropType<CardProductType> type: Object,
default() {
return {};
}
} }
}); });
@ -25,7 +28,39 @@ const props = defineProps({
// "server-card", // "server-card",
// { "server-card_offline": props.serverData?.state === "线" } // { "server-card_offline": props.serverData?.state === "线" }
// ]); // ]);
const generateRandomTwoDecimal = value => {
// [0, 1)
// const randomFraction = Math.random();
// 100
// const multipliedValue = randomFraction * 100;
const multipliedValue = value;
// 使 Math.round()
return Math.round(multipliedValue) / 100;
};
const progressData = ref([
{
label: "CPU",
percent: generateRandomTwoDecimal(props.serverData?.cpu),
strokeColor: "rgb(243,48,5)"
},
{
label: "内存",
percent: generateRandomTwoDecimal(props.serverData?.mem),
strokeColor: "rgb(33,169,122)"
},
{
label: "存储",
percent: generateRandomTwoDecimal(props.serverData?.storage),
strokeColor: "rgb(33,169,122)"
},
{
label: "GPU",
percent: generateRandomTwoDecimal(props.serverData?.gpu),
strokeColor: "rgb(250,173,20)"
}
]);
const stateClass = computed(() => [ const stateClass = computed(() => [
"server-box-title-state", "server-box-title-state",
{ "server-box-title-state_offline": props.serverData?.state === "离线" } { "server-box-title-state_offline": props.serverData?.state === "离线" }
@ -36,7 +71,7 @@ const stateClass = computed(() => [
<div class="server-box"> <div class="server-box">
<div class="flex items-center justify-start server-box-title"> <div class="flex items-center justify-start server-box-title">
<span class="server-box-title-icon" /> <span class="server-box-title-icon" />
<span class="server-box-title-name">{{ serverData?.deviceSort }}</span> <span class="server-box-title-name">{{ serverData?.name }}</span>
<span :class="stateClass">{{ serverData?.state }}</span> <span :class="stateClass">{{ serverData?.state }}</span>
</div> </div>
<div class="server-box-content"> <div class="server-box-content">
@ -46,7 +81,7 @@ const stateClass = computed(() => [
</div> </div>
<div class="server-box-content-right"> <div class="server-box-content-right">
<ul class="w-full"> <ul class="w-full">
<li v-for="(v, k) in serverData?.progressData" :key="k"> <li v-for="(v, k) in progressData" :key="k">
<div class="flex items-center rectProgress_box"> <div class="flex items-center rectProgress_box">
<span> <span>
{{ v.label }} {{ v.label }}

@ -1,5 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { getServerBoxList, updateServerBoxList } from "@/api/list"; import { getServerBoxList, updateServerBoxList } from "@/api/list";
import { getServerList } from "@/api/server";
import error from "@/assets/dataScreen/modelList/error.png"; import error from "@/assets/dataScreen/modelList/error.png";
import loading from "@/assets/dataScreen/modelList/loading.png"; import loading from "@/assets/dataScreen/modelList/loading.png";
import { ElLoading } from "element-plus"; import { ElLoading } from "element-plus";
@ -75,23 +76,23 @@ function handleLoadMore() {
background: "transparent", background: "transparent",
text: "加载中" text: "加载中"
}); });
getServerBoxList({ getServerList({
page: page.value, page: page.value,
pageSize: pageSize.value pageSize: pageSize.value
}).then(res => { }).then(res => {
console.log(res); console.log(res);
setTimeout(() => { setTimeout(() => {
list.value.push(...res.data.list); list.value.push(...res.data.results);
page.value += 1; page.value += 1;
nextTick(() => { nextTick(() => {
loadingInstance.value.close(); loadingInstance.value.close();
}); });
if (timer.value) { // if (timer.value) {
clearInterval(timer.value); // clearInterval(timer.value);
} // }
timer.value = setInterval(() => { // timer.value = setInterval(() => {
handleUpdateContent(); // handleUpdateContent();
}, 3000); // }, 3000);
}, 1000); }, 1000);
}); });
} }

@ -171,7 +171,7 @@ const listData = ref([]);
// const searchValue = ref(""); // const searchValue = ref("");
const formData = reactive({ const formData = reactive({
node_name: "", warning_name: "",
warning_level: "" warning_level: ""
}); });
@ -235,7 +235,7 @@ onMounted(() => {
<el-form :inline="true" :model="formData" class="demo-form-inline"> <el-form :inline="true" :model="formData" class="demo-form-inline">
<el-form-item label="告警名称"> <el-form-item label="告警名称">
<el-select <el-select
v-model="formData.node_name" v-model="formData.warning_name"
placeholder="告警名称" placeholder="告警名称"
@change="getList" @change="getList"
clearable clearable

@ -204,7 +204,15 @@ const resetForm = (formEl: FormInstance | undefined) => {
if (!formEl) return; if (!formEl) return;
formEl.resetFields(); formEl.resetFields();
}; };
const onPageSizeChange = (size: number) => {
pagination.value.pageSize = size;
pagination.value.currentPage = 1;
getAlarmList();
};
const onCurrentChange = (current: number) => {
pagination.value.currentPage = current;
getAlarmList();
};
function showFullAlert() { function showFullAlert() {
isShowFull.value = true; isShowFull.value = true;
// getAlarmList(); // getAlarmList();
@ -390,6 +398,8 @@ onMounted(() => {
color: 'rgba(51, 51, 51, 1)' color: 'rgba(51, 51, 51, 1)'
}" }"
:pagination="pagination" :pagination="pagination"
@page-size-change="onPageSizeChange"
@page-current-change="onCurrentChange"
> >
<template #image="{ row, index }"> <template #image="{ row, index }">
<el-image <el-image

@ -40,7 +40,10 @@ const onCurrentChange = (current: number) => {
const getCardListData = async () => { const getCardListData = async () => {
try { try {
// const { data } = await getModelList({}); // const { data } = await getModelList({});
const { data } = await getModelsList(pagination.value); const { data } = await getModelsList({
page: pagination.value.current,
pageSize: pagination.value.pageSize
});
deviceList.value = data.results; deviceList.value = data.results;
modelNum.value = data.count; modelNum.value = data.count;
console.log(data, "resData", data.results); console.log(data, "resData", data.results);

@ -16,13 +16,15 @@ defineOptions({
name: "DeviceStatus" name: "DeviceStatus"
}); });
const deviceStatusData = ref<Record<string, any>>({ const props = defineProps({
onlineCount: 618, deviceStatus: {
errorCount: 2, type: Object,
processCount: 118, default: () => {}
outlineCount: 20 }
}); });
const deviceStatusData = ref({ ...props.deviceStatus });
const deviceStatusOptions = ref<Record<string, any>[]>([ const deviceStatusOptions = ref<Record<string, any>[]>([
{ {
label: "在线", label: "在线",

@ -7,79 +7,113 @@
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import { WarningFilled, ArrowRightBold } from "@element-plus/icons-vue";
import dayjs from "dayjs";
// import type { TabsPaneContext } from "element-plus"; // import type { TabsPaneContext } from "element-plus";
defineOptions({ defineOptions({
name: "Notify" name: "Notify"
}); });
const props = defineProps({
MessageData: {
type: Array,
default: () => []
}
});
console.log(props.MessageData);
//TODO //TODO
const urgencyStatus = [ // const urgencyStatus = [
{ // {
label: "紧急", // label: "",
value: 0, // value: 0,
color: "#E80D0D", // color: "#E80D0D",
bgColor: "rgba(232, 13, 13, 0.10)" // bgColor: "rgba(232, 13, 13, 0.10)"
}, // },
{ // {
label: "优先", // label: "",
value: 0, // value: 0,
color: "#FE9A05", // color: "#FE9A05",
bgColor: "rgba(254, 154, 5, 0.10)" // bgColor: "rgba(254, 154, 5, 0.10)"
}, // },
{ // {
label: "普通", // label: "",
value: 0, // value: 0,
color: "#52C41A", // color: "#52C41A",
bgColor: "rgba(82, 196, 26, 0.10)" // bgColor: "rgba(82, 196, 26, 0.10)"
} // }
]; // ];
function fetchNoticeList(readStatus = 1) { // function fetchNoticeList(readStatus = 1) {
const arr = []; // const arr = [];
arr.push({ // arr.push({
title: "系统消息" + (readStatus + 1), // title: "" + (readStatus + 1),
dateTime: "今天10:03:00", // dateTime: "10:03:00",
content: "A3号车间B01产线出现产品缺陷异常请及时查看", // content: "A3B01线",
status: 0 // status: 0
}); // });
arr.push({ // arr.push({
title: "系统消息" + (readStatus + 1), // title: "" + (readStatus + 1),
dateTime: "今天11:22:00", // dateTime: "11:22:00",
content: "B1号车间监测有人员吸烟请及时查看", // content: "B1",
status: 1 // status: 1
}); // });
return arr; // return arr;
// for (let i = 0; i < 3; i++) { // // for (let i = 0; i < 3; i++) {
// arr.push({ // // arr.push({
// title: "" + (readStatus + i), // // title: "" + (readStatus + i),
// dateTime: "10:03:00", // // dateTime: "10:03:00",
// content: "A3B01线", // // content: "A3B01线",
// status: Math.floor(Math.random(0, 2.9) * 3) // // status: Math.floor(Math.random(0, 2.9) * 3)
// }); // // });
// } // // }
// return arr; // // return arr;
} // }
const activeName = ref("1"); // const activeName = ref("1");
const noticeData = ref<Record<string, any>[]>([ // const noticeData = ref<Record<string, any>[]>([
{ // {
label: "已读10", // label: "10",
list: fetchNoticeList(1) // list: fetchNoticeList(1)
}, // },
{ // {
label: "未读15", // label: "15",
list: fetchNoticeList(4) // list: fetchNoticeList(4)
} // }
]); // ]);
</script> </script>
<template> <template>
<div class="w-full text-sm notify_wrap"> <div class="w-full text-sm notify_wrap">
<el-tabs v-model="activeName" class="w-full"> <div
class="notify_box"
v-for="(item, index) in props.MessageData"
:key="index"
>
<div class="notify_box_left">
<el-icon color="#154DDD" :size="16">
<WarningFilled />
</el-icon>
</div>
<div class="notify_box_mid">
<div class="notify_box_mid_top mb-2">
<span class="text-[14px] text-[#333333] font-bold mr-2">{{
item.info_type
}}</span>
<span>{{
dayjs(item.trigger_time).format("YYYY-MM-DD HH:mm:ss")
}}</span>
</div>
<div class="notify_box_mid_bottom">{{ item.message }}</div>
</div>
<div class="notify_box_right">
<el-icon color="#666666" :size="16">
<ArrowRightBold />
</el-icon>
</div>
</div>
<!-- <el-tabs v-model="activeName" class="w-full">
<el-tab-pane <el-tab-pane
v-for="(item, index) in noticeData" v-for="(item, index) in noticeData"
:key="index" :key="index"
@ -108,14 +142,45 @@ const noticeData = ref<Record<string, any>[]>([
</li> </li>
</ul> </ul>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs> -->
<div class="flex justify-center"> <!-- <div class="flex justify-center">
<el-button type="primary">查看更多</el-button> <el-button type="primary">查看更多</el-button>
</div> </div> -->
</div> </div>
</template> </template>
<style lang="scss"> <style lang="scss">
.notify_wrap { .notify_wrap {
box-sizing: border-box;
padding: 0 12px;
.notify_box {
margin-bottom: 12px;
box-sizing: border-box;
padding: 12px;
display: flex;
justify-content: flex-start;
align-items: center;
height: 72px;
background: #f5f5f5;
border-radius: 4px 4px 4px 4px;
cursor: pointer;
.notify_box_left {
width: 28px;
}
.notify_box_right {
width: 28px;
}
.notify_box_mid {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
.notify_box_mid_top {
display: flex;
justify-content: flex-start;
align-items: center;
}
}
}
.el-tabs__item { .el-tabs__item {
padding: 0 20px !important; padding: 0 20px !important;
} }

@ -37,7 +37,7 @@ const name = [
"11月", "11月",
"12月" "12月"
]; ];
const value = [100, 500, 400, 600, 700, 200, 100, 500, 400, 600, 700, 200]; // const value = [100, 500, 400, 600, 700, 200, 100, 500, 400, 600, 700, 200];
// const toolTims = null; // const toolTims = null;
const offsetX = 16; const offsetX = 16;
const offsetY = 8; const offsetY = 8;
@ -274,7 +274,7 @@ watch(
] ]
}; };
}, },
data: value data: props.requireData
}, },
{ {
// name: "", // name: "",
@ -295,7 +295,7 @@ watch(
color: "transparent" color: "transparent"
}, },
tooltip: {}, tooltip: {},
data: value data: props.requireData
} }
] ]
}); });

@ -1,12 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, watch, type Ref } from "vue"; import { ref, computed, watch, type Ref, nextTick } from "vue";
import { useAppStoreHook } from "@/store/modules/app"; // import { useAppStoreHook } from "@/store/modules/app";
import { import { useDark, useECharts, type EchartOptions } from "@pureadmin/utils";
delay,
useDark,
useECharts,
type EchartOptions
} from "@pureadmin/utils";
const { isDark } = useDark(); const { isDark } = useDark();
@ -15,163 +10,180 @@ const theme: EchartOptions["theme"] = computed(() => {
}); });
const pieChartRef = ref<HTMLDivElement | null>(null); const pieChartRef = ref<HTMLDivElement | null>(null);
const { setOptions, resize } = useECharts(pieChartRef as Ref<HTMLDivElement>, { const { setOptions } = useECharts(pieChartRef as Ref<HTMLDivElement>, {
theme theme
}); });
const props = defineProps({
data: {
type: Array,
default: () => []
}
});
setOptions( watch(
{ () => props,
// title: { async () => {
// text: "", await nextTick();
// left: "left", setOptions(
// textStyle: {
// fontSize: 14,
// color: "#333"
// }
// },
tooltip: {
trigger: "item",
formatter: function (params) {
//
return `${params.value}%`;
}
},
// legend: {
// // icon: "rect",
// // // orient: "vertical",
// // align: "auto",
// // bottom: "0",
// // // top: "40%",
// // // right: "15%",
// // // itemGap: 18,
// // textStyle: {
// // fontSize: 12,
// // color: "#333"
// // }
// // right: true
// },
series: [
{ {
type: "pie", // title: {
radius: ["30%", "50%"], // // text: "",
color: [ // left: "left",
{ // textStyle: {
type: "linear", // fontSize: 14,
x: 0, // color: "#333"
y: 0, // }
x2: 0.4, // },
y2: 1, tooltip: {
colorStops: [ trigger: "item",
{ formatter: function (params) {
offset: 0, //
color: "#F9AC28" // 0% return `${params.value}%`;
}, }
{ },
offset: 1, // legend: {
color: "#F58400" // 100% // // icon: "rect",
} // // // orient: "vertical",
], // // align: "auto",
globalCoord: false // false // // bottom: "0",
}, // // // top: "40%",
// // // right: "15%",
// // // itemGap: 18,
// // textStyle: {
// // fontSize: 12,
// // color: "#333"
// // }
// // right: true
// },
series: [
{ {
type: "linear", type: "pie",
x: 0, radius: ["30%", "50%"], //
y: 0, color: [
x2: 0.4,
y2: 1,
colorStops: [
{ {
offset: 0, type: "linear",
color: "#2C48FF" // 0% x: 0,
y: 0,
x2: 0.4,
y2: 1,
colorStops: [
{
offset: 0,
color: "#F9AC28" // 0%
},
{
offset: 1,
color: "#F58400" // 100%
}
],
globalCoord: false // false
}, },
{ {
offset: 1, type: "linear",
color: "#001BCF" // 100% x: 0,
y: 0,
x2: 0.4,
y2: 1,
colorStops: [
{
offset: 0,
color: "#2C48FF" // 0%
},
{
offset: 1,
color: "#001BCF" // 100%
}
],
globalCoord: false // false
} }
], ],
globalCoord: false // false // depth: 30,
} labelLine: {
], // type: "dashed",
// depth: 30, length: 20, // 线
labelLine: { length2: 30 // 线
// type: "dashed", },
length: 20, // 线
length2: 30 // 线
},
label: { label: {
// formatter: "{b} {c}", // // formatter: "{b} {c}", //
lineHeight: 20, // lineHeight: 20, //
// backgroundColor: ["#1D39EF", "#F58702"], // backgroundColor: ["#1D39EF", "#F58702"],
align: "center", align: "center",
verticalAlign: "middle", verticalAlign: "middle",
formatter: function (params) { formatter: function (params) {
// formatter // formatter
const { name, percent } = params; const { name, percent } = params;
if (name === "未占用") { if (name === "未占用") {
// Apple // Apple
return `{red|${name}: ${percent}%}`; return `{red|${name}: ${percent}%}`;
} else { } else {
// //
return `{blue|${name}: ${percent}%}`; return `{blue|${name}: ${percent}%}`;
} }
}, },
rich: { rich: {
red: { red: {
backgroundColor: "#F58400", backgroundColor: "#F58400",
// width: 79, // width: 79,
height: 24, height: 24,
padding: [5, 8], // padding: [5, 8], //
borderRadius: 4, // borderRadius: 4, //
color: "#fff" color: "#fff"
},
blue: {
backgroundColor: "#1D39EF",
// width: 79,
height: 24,
padding: [5, 8], //
borderRadius: 4, //
color: "#fff"
}
}
}, },
blue: { // data: [
backgroundColor: "#1D39EF", // { value: 22, name: "" },
// width: 79, // { value: 78, name: "" }
height: 24, // ],
padding: [5, 8], // data: props.data,
borderRadius: 4, // emphasis: {
color: "#fff" itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)"
}
} }
} }
}, ]
data: [ },
{ value: 22, name: "未占用" }, {
{ value: 78, name: "已占用" } name: "click",
], callback: params => {
emphasis: { console.log("click", params);
itemStyle: { }
shadowBlur: 10, },
shadowOffsetX: 0, //
shadowColor: "rgba(0, 0, 0, 0.5)" {
} type: "zrender",
name: "click",
callback: params => {
console.log("点击空白处", params);
} }
} }
] );
},
{
name: "click",
callback: params => {
console.log("click", params);
}
}, },
//
{ {
type: "zrender", deep: true,
name: "click", immediate: true
callback: params => {
console.log("点击空白处", params);
}
} }
); );
watch( // watch(
() => useAppStoreHook().getSidebarStatus, // () => useAppStoreHook().getSidebarStatus,
() => { // () => {
delay(600).then(() => resize()); // delay(600).then(() => resize());
} // }
); // );
</script> </script>
<template> <template>

@ -3,6 +3,13 @@ import ReCol from "@/components/ReCol";
import { barChart, pieChart, pie3DChart } from "./components/chart"; import { barChart, pieChart, pie3DChart } from "./components/chart";
import DeviceStatus from "./components/DeviceStatus.vue"; import DeviceStatus from "./components/DeviceStatus.vue";
import Notify from "./components/Notify.vue"; import Notify from "./components/Notify.vue";
import {
getDataOverviewList,
getDeviceList,
getWarningList,
getMessagesList
} from "@/api/workbench";
import { onMounted, ref } from "vue";
// import SwiperShow from "./components/SwiperShow.vue"; // import SwiperShow from "./components/SwiperShow.vue";
// import dataViewIcon1 from "@/assets/svg/icons/dataViewIcon1.svg"; // import dataViewIcon1 from "@/assets/svg/icons/dataViewIcon1.svg";
// import dataViewIcon2 from "@/assets/svg/icons/dataViewIcon1.svg"; // import dataViewIcon2 from "@/assets/svg/icons/dataViewIcon1.svg";
@ -25,20 +32,20 @@ const headStyles = "inline-block mb-3 text-base font-bold";
// questionData: [2116, 3148, 3255, 3788, 4821, 4970, 5390] // questionData: [2116, 3148, 3255, 3788, 4821, 4970, 5390]
// } // }
// ]; // ];
const pie3Ddata = { // const pie3Ddata = {
data: [ // data: [
{ name: "紧急", value: 30 }, // { name: "", value: 30 },
{ name: "较高", value: 10 }, // { name: "", value: 10 },
{ name: "一般", value: 60 } // { name: "", value: 60 }
] // ]
}; // };
// //
// TODO // TODO
const dataViewList = [ const dataViewList = ref([
{ {
label: "异常总量", label: "异常总量",
value: "110200", value: 110200,
color: "#FF861A", color: "#FF861A",
bgColor: "#FFE9D6", bgColor: "#FFE9D6",
bigBgColor: "#FFFAF5", bigBgColor: "#FFFAF5",
@ -48,7 +55,7 @@ const dataViewList = [
}, },
{ {
label: "设备总量", label: "设备总量",
value: "46700", value: 46700,
color: "#5786FF", color: "#5786FF",
bgColor: "#D6E0FF", bgColor: "#D6E0FF",
bigBgColor: "#F5F8FF", bigBgColor: "#F5F8FF",
@ -58,7 +65,7 @@ const dataViewList = [
}, },
{ {
label: "覆盖车间", label: "覆盖车间",
value: "40", value: 40,
color: "#5024FE", color: "#5024FE",
bgColor: "#DDD5FD", bgColor: "#DDD5FD",
bigBgColor: "#F5F3FD", bigBgColor: "#F5F3FD",
@ -77,7 +84,78 @@ const dataViewList = [
icon: "icon-ziyuanshiyong1" icon: "icon-ziyuanshiyong1"
} }
]; ]);
const dataOverView = ref({
total_device: 1,
total_node: 3,
total_resource: "62.201%",
total_warning: 1
});
const deviceStatus = ref({
errorCount: 0,
onlineCount: 1,
outlineCount: 0,
processCount: 1
});
const deviceWarning = ref([]);
const computeUsed = ref([]);
const barData = ref([]);
const MessageData = ref([]);
async function getListData() {
try {
// const { data } = await getModelList({});
const { data } = await getDataOverviewList();
dataOverView.value = data;
dataViewList.value[0].value = dataOverView.value.total_warning;
dataViewList.value[1].value = dataOverView.value.total_device;
dataViewList.value[2].value = dataOverView.value.total_node;
dataViewList.value[3].value = dataOverView.value.total_resource;
// console.log(data, "resData", data);
} catch (e) {
console.log(e);
}
}
async function getListDevice() {
try {
// const { data } = await getModelList({});
const { data } = await getDeviceList();
deviceStatus.value = data.device_status;
deviceWarning.value = data.device_warnings;
computeUsed.value = data.compute_used;
console.log(data, "resData");
console.log(deviceWarning.value, "computeUsed");
} catch (e) {
console.log(e);
}
}
async function getListWarning() {
try {
// const { data } = await getModelList({});
const { data } = await getWarningList();
barData.value = data.warnings_list;
console.log(data, "resData");
} catch (e) {
console.log(e);
}
}
async function getListMessages() {
try {
// const { data } = await getModelList({});
const { data } = await getMessagesList();
MessageData.value = data.results;
console.log(data, "resData");
} catch (e) {
console.log(e);
}
}
onMounted(() => {
getListData();
getListDevice();
getListWarning();
getListMessages();
});
</script> </script>
<template> <template>
@ -201,7 +279,9 @@ const dataViewList = [
:body-style="{ padding: '16px' }" :body-style="{ padding: '16px' }"
> >
<span :class="headStyles">设备状态</span> <span :class="headStyles">设备状态</span>
<div class="flex justify-between h-[210px]"><DeviceStatus /></div> <div class="flex justify-between h-[210px]">
<DeviceStatus :deviceStatus="deviceStatus" />
</div>
</el-card> </el-card>
</re-col> </re-col>
<re-col <re-col
@ -230,7 +310,7 @@ const dataViewList = [
> >
<span :class="headStyles">设备告警情况</span> <span :class="headStyles">设备告警情况</span>
<div class="flex justify-between h-[210px]"> <div class="flex justify-between h-[210px]">
<pie3DChart :data="pie3Ddata.data" /> <pie3DChart :data="deviceWarning" />
</div> </div>
</el-card> </el-card>
</re-col> </re-col>
@ -260,7 +340,7 @@ const dataViewList = [
> >
<span :class="headStyles">算力占用</span> <span :class="headStyles">算力占用</span>
<div class="flex justify-between h-[210px]"> <div class="flex justify-between h-[210px]">
<pieChart /> <pieChart :data="computeUsed" />
</div> </div>
</el-card> </el-card>
</re-col> </re-col>
@ -291,7 +371,7 @@ const dataViewList = [
> >
<span :class="headStyles">违规总量</span> <span :class="headStyles">违规总量</span>
<div class="flex justify-between h-[265px]"> <div class="flex justify-between h-[265px]">
<barChart /> <barChart :requireData="barData" />
</div> </div>
</el-card> </el-card>
</re-col> </re-col>
@ -317,7 +397,7 @@ const dataViewList = [
<el-card class="line-card" shadow="always" :body-style="{ padding: 0 }"> <el-card class="line-card" shadow="always" :body-style="{ padding: 0 }">
<span :class="headStyles" class="mt-3 ml-4 mb-0">消息通知</span> <span :class="headStyles" class="mt-3 ml-4 mb-0">消息通知</span>
<div class="flex justify-between h-[285px]"> <div class="flex justify-between h-[285px]">
<Notify /> <Notify :MessageData="MessageData" />
</div> </div>
</el-card> </el-card>
</re-col> </re-col>

Loading…
Cancel
Save