更新安装页面内容

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

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

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

@ -72,7 +72,7 @@ const CoreArea: FC<PageProps> = ({
body: JSON.stringify({
folderPath: `${DEV.FILE_URL}/${countType[urlParams?.fileType]}`,
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();

@ -72,7 +72,7 @@ const DutyArea: FC<PageProps> = ({
body: JSON.stringify({
folderPath: `${DEV.FILE_URL}/${countType[urlParams?.fileType]}`,
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();

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

Loading…
Cancel
Save