Browse Source

设备上线

fanmiyou
nili 5 months ago
parent
commit
3f425c7e6a
  1. 2
      dist/index.html
  2. 1
      dist/p__DeviceOverview.cc8f1771.async.js
  3. 1
      dist/p__DeviceOverview.d73ca448.async.js
  4. 1
      dist/p__DeviceOwnerApp.0d084f1d.async.js
  5. 1
      dist/p__DeviceOwnerApp.15acd8c2.async.js
  6. 433
      dist/umi.1c2fd8af.js
  7. 433
      dist/umi.a34d6821.js
  8. 14
      src/pages/DeviceOwnerApp.tsx
  9. 15
      src/services/matrix/admin.ts
  10. 15
      src/services/matrix/device.ts
  11. 10
      src/services/matrix/typings.d.ts

2
dist/index.html

@ -9,6 +9,6 @@
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
<script src="/umi.1c2fd8af.js"></script> <script src="/umi.a34d6821.js"></script>
</body></html> </body></html>

1
dist/p__DeviceOverview.cc8f1771.async.js

File diff suppressed because one or more lines are too long

1
dist/p__DeviceOverview.d73ca448.async.js

File diff suppressed because one or more lines are too long

1
dist/p__DeviceOwnerApp.0d084f1d.async.js

File diff suppressed because one or more lines are too long

1
dist/p__DeviceOwnerApp.15acd8c2.async.js

File diff suppressed because one or more lines are too long

433
dist/umi.1c2fd8af.js

File diff suppressed because one or more lines are too long

433
dist/umi.a34d6821.js

File diff suppressed because one or more lines are too long

14
src/pages/DeviceOwnerApp.tsx

@ -11,6 +11,7 @@ import { useIntl, useModel } from '@umijs/max';
import { Tabs } from 'antd'; import { Tabs } from 'antd';
import TabPane from 'antd/es/tabs/TabPane'; import TabPane from 'antd/es/tabs/TabPane';
import React, { useRef, useState } from 'react'; import React, { useRef, useState } from 'react';
import { online } from '../services/matrix/device';
// import { RequestOptionsType, ProFieldRequestData } from "@ant-design/pro-utils"; // import { RequestOptionsType, ProFieldRequestData } from "@ant-design/pro-utils";
@ -70,6 +71,16 @@ const DeviceOwnerApp: React.FC = () => {
deviceRef.current?.reload(); deviceRef.current?.reload();
}; };
const handleSetOnline = async (deviceId: string | undefined) => {
if (!deviceId) {
return;
}
try {
await online({ deviceId: deviceId });
deviceRef.current?.reload();
} catch {}
};
const [columnsState, setColumnsState] = useState<Record<string, ColumnsState>>({ const [columnsState, setColumnsState] = useState<Record<string, ColumnsState>>({
deviceId: { show: !isMobile() }, deviceId: { show: !isMobile() },
appName: { show: !isMobile() }, appName: { show: !isMobile() },
@ -215,6 +226,9 @@ const DeviceOwnerApp: React.FC = () => {
if (record.status === 0) { if (record.status === 0) {
return <a onClick={() => handleSetOffline(record.deviceId)}>线</a>; return <a onClick={() => handleSetOffline(record.deviceId)}>线</a>;
} }
if (record.status === -1) {
return <a onClick={() => handleSetOnline(record.deviceId)}>线</a>;
}
return null; return null;
}, },
}, },

15
src/services/matrix/admin.ts

@ -137,21 +137,6 @@ export async function adminLogin(
}); });
} }
/** 此处后端没有提供注释 GET /api/admin/mockData */
export async function mockData(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.mockDataParams,
options?: { [key: string]: any },
) {
return request<API.RVoid>('/api/admin/mockData', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /api/admin/saveAdmin */ /** 此处后端没有提供注释 POST /api/admin/saveAdmin */
export async function saveAdmin(body: API.MatrixAdminBo, options?: { [key: string]: any }) { export async function saveAdmin(body: API.MatrixAdminBo, options?: { [key: string]: any }) {
return request<API.RVoid>('/api/admin/saveAdmin', { return request<API.RVoid>('/api/admin/saveAdmin', {

15
src/services/matrix/device.ts

@ -73,3 +73,18 @@ export async function offline(
...(options || {}), ...(options || {}),
}); });
} }
/** 此处后端没有提供注释 POST /api/admin/device/online */
export async function online(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.onlineParams,
options?: { [key: string]: any },
) {
return request<API.RString>('/api/admin/device/online', {
method: 'POST',
params: {
...params,
},
...(options || {}),
});
}

10
src/services/matrix/typings.d.ts

@ -2,7 +2,7 @@ declare namespace API {
type AddMockScheduleReq = { type AddMockScheduleReq = {
appId?: number; appId?: number;
incomeYuan?: number; incomeYuan?: number;
scheduleTime?: number; scheduleTime?: number[];
}; };
type addWhiteList1Params = { type addWhiteList1Params = {
@ -222,13 +222,11 @@ declare namespace API {
createdAt?: string; createdAt?: string;
}; };
type mockDataParams = { type offlineParams = {
appCode: string; deviceId: string;
incomeYuan: number;
channel: string;
}; };
type offlineParams = { type onlineParams = {
deviceId: string; deviceId: string;
}; };

Loading…
Cancel
Save