Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dwsproject
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dws
dwsproject
Commits
b0a240ed
Commit
b0a240ed
authored
May 27, 2025
by
guibin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
天合堂设备实时状态页面自动获取factoryCode
parent
76b869d4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
3 deletions
+34
-3
tht_project/static/src/view/equipment_status.html
+34
-3
No files found.
tht_project/static/src/view/equipment_status.html
View file @
b0a240ed
...
@@ -225,7 +225,7 @@
...
@@ -225,7 +225,7 @@
start_time
:
""
,
// 开始时间
start_time
:
""
,
// 开始时间
end_time
:
""
,
// 结束时间
end_time
:
""
,
// 结束时间
refreshInterval
:
null
,
// 定时刷新计时器
refreshInterval
:
null
,
// 定时刷新计时器
factoryCode
:
"
f1991dbb-52d6-11ef-b13f-fa163e5bb392
"
,
// 公司CODE
factoryCode
:
""
,
// 公司CODE
allEquipmentData
:
[],
// 所有已绑定设备数据
allEquipmentData
:
[],
// 所有已绑定设备数据
selectedWorkshop
:
""
,
// 新增字段:当前选中的车间
selectedWorkshop
:
""
,
// 新增字段:当前选中的车间
};
};
...
@@ -411,10 +411,13 @@
...
@@ -411,10 +411,13 @@
const
start_working_time
=
response
.
data
.
result
.
start_working_time
||
[];
const
start_working_time
=
response
.
data
.
result
.
start_working_time
||
[];
const
end_working_time
=
response
.
data
.
result
.
end_working_time
||
[];
const
end_working_time
=
response
.
data
.
result
.
end_working_time
||
[];
const
wait_time
=
response
.
data
.
result
.
wait_time
||
[];
const
wait_time
=
response
.
data
.
result
.
wait_time
||
[];
if
(
this
.
factoryCode
)
{
// 调用设备状态接口
// 调用设备状态接口
await
this
.
getDeviceStateList
(
start_working_time
,
end_working_time
,
wait_time
);
await
this
.
getDeviceStateList
(
start_working_time
,
end_working_time
,
wait_time
);
}
else
{
await
this
.
getFactoryCode
(
start_working_time
,
end_working_time
,
wait_time
);
}
return
start_working_time
,
end_working_time
,
wait_time
;
return
start_working_time
,
end_working_time
,
wait_time
;
}
else
{
}
else
{
const
errorMsg
=
response
.
data
.
result
const
errorMsg
=
response
.
data
.
result
...
@@ -489,6 +492,34 @@
...
@@ -489,6 +492,34 @@
throw
error
;
throw
error
;
}
}
},
},
// 获取factoryCode
async
getFactoryCode
(
start_working_time
,
end_working_time
,
wait_time
)
{
try
{
// 使用CORS代理
// 发送请求获取设备状态
const
response
=
await
axios
({
method
:
"post"
,
url
:
this
.
dwsURL
+
"/roke/workstation/db_uuid/get"
,
data
:
{},
headers
:
{
"Content-Type"
:
"application/json"
},
});
// 处理JSON-RPC格式的响应
if
(
response
.
data
&&
response
.
data
.
result
&&
response
.
data
.
result
.
code
===
0
)
{
// 获取计划运行时间数据
this
.
factoryCode
=
response
.
data
.
result
.
data
||
""
;
// 调用设备状态接口
await
this
.
getDeviceStateList
(
start_working_time
,
end_working_time
,
wait_time
);
}
else
{
const
errorMsg
=
response
.
data
.
result
?
response
.
data
.
result
.
message
:
"获取账套db_uuid失败"
;
throw
new
Error
(
errorMsg
);
}
}
catch
(
error
)
{
// console.error("获取账套db_uuid失败:", error);
throw
error
;
}
},
// 处理设备状态数据
// 处理设备状态数据
processDeviceStateData
(
deviceStateData
)
{
processDeviceStateData
(
deviceStateData
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment