feat: 算力配置和设备现场交互完成
parent
b2538ee9ef
commit
8eabf8c471
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* @Author: donghao donghao@supervision.ltd
|
||||
* @Date: 2024-01-17 13:54:43
|
||||
* @LastEditors: donghao donghao@supervision.ltd
|
||||
* @LastEditTime: 2024-03-20 14:50:57
|
||||
* @FilePath: \General-AI-Platform-Web-Client\mock\alarm.ts
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
import { MockMethod } from "vite-plugin-mock";
|
||||
import {
|
||||
deviceSceneListData,
|
||||
deviceSceneItemsData
|
||||
} from "./pools/deviceSceneData";
|
||||
import {
|
||||
fetchCurrPageByList,
|
||||
fetchMockSuccessFullByOther
|
||||
} from "./utils/apiMock";
|
||||
|
||||
export default [
|
||||
{
|
||||
url: "/getDeviceSceneList",
|
||||
method: "post",
|
||||
response: () => {
|
||||
return fetchMockSuccessFullByOther({ data: deviceSceneListData.data });
|
||||
}
|
||||
},
|
||||
{
|
||||
url: "/getDeviceSceneItemsList",
|
||||
method: "post",
|
||||
response: req => {
|
||||
const { page, pageSize } = req.body;
|
||||
// console.log(req);
|
||||
return {
|
||||
...fetchCurrPageByList({
|
||||
...deviceSceneItemsData,
|
||||
data: {
|
||||
...deviceSceneItemsData.data,
|
||||
page,
|
||||
pageSize: pageSize || 10
|
||||
}
|
||||
})
|
||||
};
|
||||
}
|
||||
}
|
||||
] as MockMethod[];
|
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* @Author: donghao donghao@supervision.ltd
|
||||
* @Date: 2024-02-22 13:38:04
|
||||
* @LastEditors: donghao donghao@supervision.ltd
|
||||
* @LastEditTime: 2024-03-20 16:51:18
|
||||
* @FilePath: \General-AI-Platform-Web-Client\mock\pools\alarmData.ts
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
import { generateRandomDateTimeByYear } from "../utils/mockMoment";
|
||||
|
||||
function fetchSceneItemsList(args = { maxCount: 24 }): Record<string, any>[] {
|
||||
const { maxCount } = args;
|
||||
const currList: Record<string, any>[] = [];
|
||||
|
||||
const productTypeArr = ["工件9501", "工件1132", "工件2108", "工件9183"];
|
||||
|
||||
for (let i = 0; i < maxCount; i++) {
|
||||
currList.push({
|
||||
id: 10000 + i,
|
||||
alarmNo: 24031215050 + (i + 1), // 序号
|
||||
defectType: "表面裂纹", // 缺陷类型
|
||||
createTime: generateRandomDateTimeByYear(2024),
|
||||
updateTime: "2023-10-17T02:35:41.14308Z", // 检测时间
|
||||
productType:
|
||||
productTypeArr[Math.floor(Math.random() * productTypeArr.length)], //产品类型
|
||||
productL: "15.8mm", // 长
|
||||
productW: "15.8mm" // 宽
|
||||
// baseInfo: {
|
||||
// left: 397.0215, // 相对x
|
||||
// top: 444.5797 // 相对y
|
||||
// }
|
||||
});
|
||||
}
|
||||
return currList;
|
||||
}
|
||||
|
||||
function fetchList(): Record<string, any>[] {
|
||||
const currList: Record<string, any>[] = [];
|
||||
for (let i = 0; i < 2; i++) {
|
||||
currList.push({
|
||||
id: 1 + i,
|
||||
createTime: generateRandomDateTimeByYear(2023),
|
||||
updateTime: "2023-10-17T02:35:41.14308Z",
|
||||
name: "GigEPRO_gmcam_01_00" + (i + 1),
|
||||
alarmList: fetchSceneItemsList({ maxCount: 3 })
|
||||
});
|
||||
}
|
||||
return currList;
|
||||
}
|
||||
|
||||
export const deviceSceneListData = {
|
||||
data: fetchList()
|
||||
};
|
||||
|
||||
export const deviceSceneItemsData = {
|
||||
data: {
|
||||
list: fetchSceneItemsList(),
|
||||
total: fetchSceneItemsList().length,
|
||||
page: 1,
|
||||
pageSize: 10
|
||||
}
|
||||
};
|
Binary file not shown.
After Width: | Height: | Size: 302 KiB |
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* @Author: donghao donghao@supervision.ltd
|
||||
* @Date: 2024-03-19 15:44:27
|
||||
* @LastEditors: donghao donghao@supervision.ltd
|
||||
* @LastEditTime: 2024-03-20 15:50:20
|
||||
* @FilePath: \General-AI-Platform-Web-Client\src\router\modules\deviceScene.ts
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
import { $t } from "@/plugins/i18n";
|
||||
|
||||
export default {
|
||||
path: "/deviceScene",
|
||||
meta: {
|
||||
title: $t("menus.hsdeviceScene"),
|
||||
icon: "icon-shebeiliebiao-weixuan",
|
||||
// showLink: false,
|
||||
bodyClass: "deviceScene_page",
|
||||
rank: 7,
|
||||
roles: ["admin", "common"]
|
||||
},
|
||||
component: () => import("@/views/device/scene.vue"),
|
||||
name: "DeviceScene"
|
||||
} as RouteConfigsTable;
|
@ -0,0 +1,102 @@
|
||||
.deviceScene_wrap {
|
||||
.deviceScene_container {
|
||||
.deviceScene_body {
|
||||
.scene_box {
|
||||
background-color: white;
|
||||
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 8px;
|
||||
}
|
||||
.left {
|
||||
width: 65.52%;
|
||||
padding: 16px 48px;
|
||||
.deviceScene_box_top {
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
color: #333333;
|
||||
padding: 8px 0 16px;
|
||||
.bg_icon {
|
||||
color: #154ddd;
|
||||
|
||||
i {
|
||||
font-size: 25px;
|
||||
}
|
||||
margin-right: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 32.61%;
|
||||
.alarm_head {
|
||||
padding: 7px 16px;
|
||||
border-bottom: 1px solid #e0e0e0;
|
||||
.label {
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
.alarm_body {
|
||||
& > li {
|
||||
background: #f3f6ff;
|
||||
margin: 16px;
|
||||
border-radius: 2px;
|
||||
h5 {
|
||||
padding: 12px;
|
||||
border-bottom: 1px solid #e0e0e0;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
color: #333333;
|
||||
}
|
||||
.alarm_info {
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
padding: 12px;
|
||||
color: #666666;
|
||||
& > p {
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
.label {
|
||||
}
|
||||
.active_value {
|
||||
color: #e80d0d;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-dialog__body {
|
||||
padding-top: 8px;
|
||||
}
|
||||
.alarm_table {
|
||||
height: 550px;
|
||||
}
|
||||
|
||||
.alarm_detail_box {
|
||||
.alarm_detail_info {
|
||||
border-radius: 2px;
|
||||
h5 {
|
||||
padding: 0 0 12px;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
color: #333333;
|
||||
}
|
||||
.alarm_info {
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
color: #666666;
|
||||
& > p {
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
.label {
|
||||
}
|
||||
.active_value {
|
||||
color: #e80d0d;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue