更新安装页面内容

master
鲁誉程 11 months ago
parent 83217ad29e
commit 6d480464b8

@ -1,5 +1,5 @@
import { FC, useEffect, useState } from 'react'; import { FC, useEffect, useState } from 'react';
import { history, useLocation } from "umi"; import { history, useLocation, useParams } from "umi";
import styles from './index.less'; import styles from './index.less';
import { Input, Modal, message } from 'antd'; import { Input, Modal, message } from 'antd';
import ButtonComp from '@/components/ButtonComp'; import ButtonComp from '@/components/ButtonComp';
@ -8,14 +8,18 @@ import { LeftOutlined } from '@ant-design/icons';
interface PageProps { } interface PageProps { }
const CoreSystemEntrance: FC<PageProps> = ({ }) => { const CoreSystemEntrance: FC<PageProps> = ({ }) => {
const urlParams = useParams();
const loaction = useLocation();
const [visibility, setVisibility] = useState<boolean>(false); const [visibility, setVisibility] = useState<boolean>(false);
const [key, setKey] = useState<string>('一'); const [key, setKey] = useState<string>('一');
const [pin, setPin] = useState<any>(''); const [pin, setPin] = useState<any>('');
useEffect(() => { useEffect(() => {
let installExe: any = localStorage.getItem('installExe') let sysName = localStorage.getItem(`${urlParams?.fileType}`);
let data = JSON.parse(installExe); if (sysName) {
console.log("1",data); let data = JSON.parse(sysName);
console.log("1",data);
}
function handleKeyPress(e: any) { function handleKeyPress(e: any) {

@ -3,11 +3,14 @@ import styles from './index.less';
import { Input, Upload, UploadProps, message } from 'antd'; import { Input, Upload, UploadProps, message } from 'antd';
import ButtonComp from '@/components/ButtonComp'; import ButtonComp from '@/components/ButtonComp';
import { college_table_query, deviceInit_init, deviceInstall_deviceInstall } from '@/services/api'; import { college_table_query, deviceInit_init, deviceInstall_deviceInstall } from '@/services/api';
import { useParams } from 'umi';
import { fileStr, sysType } from '@/utils';
interface PageProps { interface PageProps {
} }
const DeviceInstall: FC<PageProps> = ({ }) => { const DeviceInstall: FC<PageProps> = ({ }) => {
const urlParams = useParams();
const [dataLoading, setDataLoading] = useState(false); const [dataLoading, setDataLoading] = useState(false);
const [fileInfo, setFileInfo] = useState({ const [fileInfo, setFileInfo] = useState({
"secret": "", "secret": "",
@ -35,11 +38,13 @@ const DeviceInstall: FC<PageProps> = ({ }) => {
const props: UploadProps = { const props: UploadProps = {
maxCount: 1, maxCount: 1,
beforeUpload: (file: any) => { beforeUpload: (file: any) => {
let str = sysType[urlParams?.fileType] + fileStr[urlParams?.fileType]
const formData = new FormData(); const formData = new FormData();
formData.append('file', file); formData.append('file', file);
formData.append('sysType ', str);
deviceInit_init(formData).then((res) => { deviceInit_init(formData).then((res) => {
if (res?.result == "success" && res?.data.length > 0) { if (res?.result == "success" && res?.data.length > 0) {
message.success('数据加载成功'); message.success('数据加载成功')
setFileInfo(res?.data[0]); setFileInfo(res?.data[0]);
localStorage.setItem('deviceInit', JSON.stringify(res?.data[0])); localStorage.setItem('deviceInit', JSON.stringify(res?.data[0]));
setDataLoading(true); setDataLoading(true);

@ -72,7 +72,7 @@ const CoreArea: FC<PageProps> = ({
body: JSON.stringify({ body: JSON.stringify({
folderPath: `${DEV.FILE_URL}/${countType[urlParams?.fileType]}`, folderPath: `${DEV.FILE_URL}/${countType[urlParams?.fileType]}`,
shortcutName: '核心区客户端', shortcutName: '核心区客户端',
shortcutURL: `${DEV.LOCAL_URL}/coreSystemEntrance/${urlParams?.fileType}?sysType=${sysType[urlParams?.fileType] + '核心区勤区'}` shortcutURL: `${DEV.LOCAL_URL}/coreSystemEntrance/${urlParams?.fileType}?sysType=${encodeURIComponent(sysType[urlParams?.fileType] + '核心区')}`
}), }),
}); });
const data = await response.text(); const data = await response.text();

@ -72,7 +72,7 @@ const DutyArea: FC<PageProps> = ({
body: JSON.stringify({ body: JSON.stringify({
folderPath: `${DEV.FILE_URL}/${countType[urlParams?.fileType]}`, folderPath: `${DEV.FILE_URL}/${countType[urlParams?.fileType]}`,
shortcutName: '执勤区客户端', shortcutName: '执勤区客户端',
shortcutURL: `${DEV.LOCAL_URL}/coreSystemEntrance/${urlParams?.fileType}?sysType=${sysType[urlParams?.fileType] + '执勤区'}` shortcutURL: `${DEV.LOCAL_URL}/coreSystemEntrance/${urlParams?.fileType}?sysType=${encodeURIComponent(sysType[urlParams?.fileType] + '执勤区')}`
}), }),
}); });
const data = await response.text(); const data = await response.text();

@ -5,6 +5,13 @@ export const countType = {
'zq2': '执勤区二' 'zq2': '执勤区二'
} }
export const fileStr = {
'hx1': '核心区',
'hx2': '核心区',
'zq1': '执勤区',
'zq2': '执勤区'
}
export const sysType = { export const sysType = {
'hx1': '上级', 'hx1': '上级',
'hx2': '下级', 'hx2': '下级',

Loading…
Cancel
Save