Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
wisdom-components
Commits
a08bd4fb
Commit
a08bd4fb
authored
Jan 09, 2023
by
崔佳豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(EC_RealTimeInfo): 组件服务优化
parent
4af880d5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
108 additions
and
40 deletions
+108
-40
proxy.js
config/proxy.js
+10
-0
index.js
packages/extend-components/EC_RealTimeInfo/apis/index.js
+56
-0
Basic.tsx
...ges/extend-components/EC_RealTimeInfo/src/demos/Basic.tsx
+42
-40
index.js
packages/extend-components/EC_RealTimeInfo/src/index.js
+0
-0
No files found.
config/proxy.js
View file @
a08bd4fb
...
...
@@ -16,4 +16,14 @@ export default {
'/PandaMonitor'
:
'/PandaMonitor'
,
},
},
'/PandaCore'
:
{
target
:
proxyURL
,
changeOrigin
:
true
,
headers
:
{
'Access-Control-Allow-Origin'
:
'*'
,
},
pathRewrite
:
{
'/PandaCore'
:
'/PandaCore'
,
},
},
};
packages/extend-components/EC_RealTimeInfo/apis/index.js
0 → 100644
View file @
a08bd4fb
import
{
request
}
from
'@wisdom-utils/utils'
;
const
REQUEST_METHOD_GET
=
'get'
;
const
REQUEST_METHOD_POST
=
'post'
;
// eslint-disable-next-line no-undef
const
baseUrl
=
typeof
DUMI_TYPE
!==
'undefined'
&&
DUMI_TYPE
===
'dumi'
?
'/api'
:
''
;
// 获取监控展示配置
export
function
getMonitorConfig
({
params
,
data
}
=
{})
{
return
request
({
url
:
`/PandaMonitor/Monitor/MonitorConfig/GetMonitorConf`
,
method
:
REQUEST_METHOD_GET
,
params
,
data
,
});
}
// 获取传感器类型
export
function
getSensorType
({
params
,
data
}
=
{})
{
return
request
({
url
:
`/PandaCore/GCK/Sensor/GetSensorType`
,
method
:
REQUEST_METHOD_GET
,
params
,
data
,
});
}
// 获取设备实时数据
export
function
getDeviceRealInfo
({
params
,
data
}
=
{})
{
return
request
({
url
:
`/PandaMonitor/Monitor/Device/GetDeviceRealInfo`
,
method
:
REQUEST_METHOD_POST
,
params
,
data
,
});
}
// 获取点表地址
export
function
getPointAddressEntry
({
params
,
data
}
=
{})
{
return
request
({
url
:
`/PandaMonitor/Monitor/PointAddress/GetPointAddressEntry`
,
method
:
REQUEST_METHOD_GET
,
params
,
data
,
});
}
// 获取点表版本
export
function
getPointAddress
({
params
,
data
}
=
{})
{
return
request
({
url
:
`/PandaMonitor/Monitor/PointAddress/GetPointAddress`
,
method
:
REQUEST_METHOD_GET
,
params
,
data
,
});
}
packages/extend-components/EC_RealTimeInfo/src/demos/Basic.tsx
View file @
a08bd4fb
...
...
@@ -20,53 +20,55 @@ const GET_DEVICE_REAL_INFO =
// const GET_SENSOR_TYPE = '/api/Publish/GCK/Sensor/GetSensorType'; //获取传感器类型
// const GET_DEVICE_REAL_INFO = '/api/Publish/GCK/Device/DeviceRealInfo'; //获取设备实时数据
const
realTimeInfoService
=
{
getDeviceConf
:
{
url
:
GET_DEVICE_CONF
,
method
:
REQUEST_METHOD_GET
,
type
:
REQUEST_HTTP
,
},
getPointAddressEntry
:
{
url
:
GET_POINT_ADDRESS_ENTRY
,
method
:
REQUEST_METHOD_GET
,
type
:
REQUEST_HTTP
,
},
getSensorType
:
{
url
:
GET_SENSOR_TYPE
,
method
:
REQUEST_METHOD_GET
,
type
:
REQUEST_HTTP
,
},
getDeviceRealInfo
:
{
url
:
GET_DEVICE_REAL_INFO
,
method
:
REQUEST_METHOD_POST
,
type
:
REQUEST_HTTP
,
},
};
//
const realTimeInfoService = {
//
getDeviceConf: {
//
url: GET_DEVICE_CONF,
//
method: REQUEST_METHOD_GET,
//
type: REQUEST_HTTP,
//
},
//
getPointAddressEntry: {
//
url: GET_POINT_ADDRESS_ENTRY,
//
method: REQUEST_METHOD_GET,
//
type: REQUEST_HTTP,
//
},
//
getSensorType: {
//
url: GET_SENSOR_TYPE,
//
method: REQUEST_METHOD_GET,
//
type: REQUEST_HTTP,
//
},
//
getDeviceRealInfo: {
//
url: GET_DEVICE_REAL_INFO,
//
method: REQUEST_METHOD_POST,
//
type: REQUEST_HTTP,
//
},
//
};
const
rtService
=
service
(
realTimeInfoService
);
//
const rtService = service(realTimeInfoService);
const
getDeviceConf
=
rtService
.
getDeviceConf
;
const
getPointAddressEntry
=
rtService
.
getPointAddressEntry
;
const
getSensorType
=
rtService
.
getSensorType
;
const
getDeviceRealInfo
=
rtService
.
getDeviceRealInfo
;
//
const getDeviceConf = rtService.getDeviceConf;
//
const getPointAddressEntry = rtService.getPointAddressEntry;
//
const getSensorType = rtService.getSensorType;
//
const getDeviceRealInfo = rtService.getDeviceRealInfo;
const
Demo
=
()
=>
{
return
(
<
div
style=
{
{
width
:
'200px'
,
height
:
'60px'
,
background
:
'black'
}
}
>
<
RealTimeInfo
deviceConfService=
{
getDeviceConf
}
pointAddressEntryService=
{
getPointAddressEntry
}
sensorTypeService=
{
getSensorType
}
deviceRealInfoService=
{
getDeviceRealInfo
}
deviceRealInfoParams=
{
{
userID
:
'1'
,
pageIndex
:
1
,
pageSize
:
20
,
isFocus
:
false
,
accountFieldParams
:
[{
AName
:
'二供泵房'
},
{
AName
:
'二供机组'
}],
equipmentCode
:
'EGBF00000001'
,
}
}
user=
{
'1'
}
deviceParams=
{
[
{
deviceType
:
'二供泵房'
,
deviceCode
:
'EGBF00000001'
,
},
{
deviceType
:
'二供机组'
,
deviceCode
:
'EGJZ00000001'
,
},
{
deviceType
:
'二供机组'
,
deviceCode
:
'EGJZ00000002'
,
},
]
}
user=
{
1
}
/>
</
div
>
);
...
...
packages/extend-components/EC_RealTimeInfo/src/index.js
View file @
a08bd4fb
This diff is collapsed.
Click to expand it.
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