Commit a08bd4fb authored by 崔佳豪's avatar 崔佳豪

fix(EC_RealTimeInfo): 组件服务优化

parent 4af880d5
...@@ -16,4 +16,14 @@ export default { ...@@ -16,4 +16,14 @@ export default {
'/PandaMonitor': '/PandaMonitor', '/PandaMonitor': '/PandaMonitor',
}, },
}, },
'/PandaCore': {
target: proxyURL,
changeOrigin: true,
headers: {
'Access-Control-Allow-Origin': '*',
},
pathRewrite: {
'/PandaCore': '/PandaCore',
},
},
}; };
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,
});
}
...@@ -20,53 +20,55 @@ const GET_DEVICE_REAL_INFO = ...@@ -20,53 +20,55 @@ const GET_DEVICE_REAL_INFO =
// const GET_SENSOR_TYPE = '/api/Publish/GCK/Sensor/GetSensorType'; //获取传感器类型 // const GET_SENSOR_TYPE = '/api/Publish/GCK/Sensor/GetSensorType'; //获取传感器类型
// const GET_DEVICE_REAL_INFO = '/api/Publish/GCK/Device/DeviceRealInfo'; //获取设备实时数据 // const GET_DEVICE_REAL_INFO = '/api/Publish/GCK/Device/DeviceRealInfo'; //获取设备实时数据
const realTimeInfoService = { // const realTimeInfoService = {
getDeviceConf: { // getDeviceConf: {
url: GET_DEVICE_CONF, // url: GET_DEVICE_CONF,
method: REQUEST_METHOD_GET, // method: REQUEST_METHOD_GET,
type: REQUEST_HTTP, // type: REQUEST_HTTP,
}, // },
getPointAddressEntry: { // getPointAddressEntry: {
url: GET_POINT_ADDRESS_ENTRY, // url: GET_POINT_ADDRESS_ENTRY,
method: REQUEST_METHOD_GET, // method: REQUEST_METHOD_GET,
type: REQUEST_HTTP, // type: REQUEST_HTTP,
}, // },
getSensorType: { // getSensorType: {
url: GET_SENSOR_TYPE, // url: GET_SENSOR_TYPE,
method: REQUEST_METHOD_GET, // method: REQUEST_METHOD_GET,
type: REQUEST_HTTP, // type: REQUEST_HTTP,
}, // },
getDeviceRealInfo: { // getDeviceRealInfo: {
url: GET_DEVICE_REAL_INFO, // url: GET_DEVICE_REAL_INFO,
method: REQUEST_METHOD_POST, // method: REQUEST_METHOD_POST,
type: REQUEST_HTTP, // type: REQUEST_HTTP,
}, // },
}; // };
const rtService = service(realTimeInfoService); // const rtService = service(realTimeInfoService);
const getDeviceConf = rtService.getDeviceConf; // const getDeviceConf = rtService.getDeviceConf;
const getPointAddressEntry = rtService.getPointAddressEntry; // const getPointAddressEntry = rtService.getPointAddressEntry;
const getSensorType = rtService.getSensorType; // const getSensorType = rtService.getSensorType;
const getDeviceRealInfo = rtService.getDeviceRealInfo; // const getDeviceRealInfo = rtService.getDeviceRealInfo;
const Demo = () => { const Demo = () => {
return ( return (
<div style={{ width: '200px', height: '60px', background: 'black' }}> <div style={{ width: '200px', height: '60px', background: 'black' }}>
<RealTimeInfo <RealTimeInfo
deviceConfService={getDeviceConf} deviceParams={[
pointAddressEntryService={getPointAddressEntry} {
sensorTypeService={getSensorType} deviceType: '二供泵房',
deviceRealInfoService={getDeviceRealInfo} deviceCode: 'EGBF00000001',
deviceRealInfoParams={{ },
userID: '1', {
pageIndex: 1, deviceType: '二供机组',
pageSize: 20, deviceCode: 'EGJZ00000001',
isFocus: false, },
accountFieldParams: [{ AName: '二供泵房' }, { AName: '二供机组' }], {
equipmentCode: 'EGBF00000001', deviceType: '二供机组',
}} deviceCode: 'EGJZ00000002',
user={'1'} },
]}
user={1}
/> />
</div> </div>
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment