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>
<body>
<div id="root"></div>
<script src="/umi.1c2fd8af.js"></script>
<script src="/umi.a34d6821.js"></script>
</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 TabPane from 'antd/es/tabs/TabPane';
import React, { useRef, useState } from 'react';
import { online } from '../services/matrix/device';
// import { RequestOptionsType, ProFieldRequestData } from "@ant-design/pro-utils";
@ -70,6 +71,16 @@ const DeviceOwnerApp: React.FC = () => {
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>>({
deviceId: { show: !isMobile() },
appName: { show: !isMobile() },
@ -215,6 +226,9 @@ const DeviceOwnerApp: React.FC = () => {
if (record.status === 0) {
return <a onClick={() => handleSetOffline(record.deviceId)}>线</a>;
}
if (record.status === -1) {
return <a onClick={() => handleSetOnline(record.deviceId)}>线</a>;
}
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 */
export async function saveAdmin(body: API.MatrixAdminBo, options?: { [key: string]: any }) {
return request<API.RVoid>('/api/admin/saveAdmin', {

15
src/services/matrix/device.ts

@ -73,3 +73,18 @@ export async function offline(
...(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 = {
appId?: number;
incomeYuan?: number;
scheduleTime?: number;
scheduleTime?: number[];
};
type addWhiteList1Params = {
@ -222,13 +222,11 @@ declare namespace API {
createdAt?: string;
};
type mockDataParams = {
appCode: string;
incomeYuan: number;
channel: string;
type offlineParams = {
deviceId: string;
};
type offlineParams = {
type onlineParams = {
deviceId: string;
};

Loading…
Cancel
Save