singin
This commit is contained in:
parent
483bc1220b
commit
654630f2ae
|
@ -40,7 +40,7 @@ const SimpleForm = (props: SimpleFormData) => {
|
||||||
name={v.name}
|
name={v.name}
|
||||||
rules={v.rules}
|
rules={v.rules}
|
||||||
>
|
>
|
||||||
<Input defaultValue={v.value} value={v.value} />
|
<Input value={v.value} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
case FormType.inputNumber:
|
case FormType.inputNumber:
|
||||||
|
@ -51,7 +51,7 @@ const SimpleForm = (props: SimpleFormData) => {
|
||||||
name={v.name}
|
name={v.name}
|
||||||
rules={v.rules}
|
rules={v.rules}
|
||||||
>
|
>
|
||||||
<InputNumber defaultValue={v.value} value={v.value} />
|
<InputNumber value={v.value} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
case FormType.password:
|
case FormType.password:
|
||||||
|
@ -86,7 +86,6 @@ const SimpleForm = (props: SimpleFormData) => {
|
||||||
>
|
>
|
||||||
<Checkbox.Group
|
<Checkbox.Group
|
||||||
options={v.checkboxData}
|
options={v.checkboxData}
|
||||||
defaultValue={["Pear"]}
|
|
||||||
onChange={(res) => {
|
onChange={(res) => {
|
||||||
form.setFieldValue(v.name, res);
|
form.setFieldValue(v.name, res);
|
||||||
}}
|
}}
|
||||||
|
@ -111,27 +110,24 @@ const SimpleForm = (props: SimpleFormData) => {
|
||||||
case FormType.select:
|
case FormType.select:
|
||||||
return FormSelect(v);
|
return FormSelect(v);
|
||||||
case FormType.upload:
|
case FormType.upload:
|
||||||
console.log(form.getFieldValue(v.name))
|
|
||||||
return (
|
return (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
key={v.label}
|
key={v.label}
|
||||||
label={v.label}
|
label={v.label}
|
||||||
valuePropName="fileList"
|
valuePropName="fileList"
|
||||||
name={v.name}
|
name={v.name}
|
||||||
rules={v.rules}
|
rules={v.rules}
|
||||||
initialValue={v.value}
|
initialValue={v.value}
|
||||||
getValueFromEvent={(e) => {
|
getValueFromEvent={(e) => {
|
||||||
if (Array.isArray(e)) {
|
if (Array.isArray(e)) {
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
console.log(e)
|
|
||||||
return e && e.fileList;
|
return e && e.fileList;
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<AliUpload
|
<AliUpload
|
||||||
imgList={form.getFieldValue(v.name) ?? []}
|
imgList={v.value ?? []}
|
||||||
onChnage={(res) => {
|
onChnage={(res) => {
|
||||||
console.log(res);
|
|
||||||
form.setFieldValue(v.name, res);
|
form.setFieldValue(v.name, res);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
@ -219,7 +215,7 @@ const SimpleForm = (props: SimpleFormData) => {
|
||||||
name={v.name}
|
name={v.name}
|
||||||
rules={v.rules}
|
rules={v.rules}
|
||||||
>
|
>
|
||||||
<Input defaultValue={v.value} value={v.value} />
|
<Input value={v.value} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import Weather from "./homeLeft/weather";
|
||||||
import Timer from "./homeLeft/timer";
|
import Timer from "./homeLeft/timer";
|
||||||
import HomeVideo from "./home_video";
|
import HomeVideo from "./home_video";
|
||||||
import HomeCheck from "./home_check";
|
import HomeCheck from "./home_check";
|
||||||
|
import Scr from "./scr";
|
||||||
|
|
||||||
const Home = observer(() => {
|
const Home = observer(() => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
@ -36,13 +37,7 @@ const Home = observer(() => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="scr">
|
<div className="scr">
|
||||||
<div className="scrolling-text">
|
<Scr></Scr>
|
||||||
<span>
|
|
||||||
仓库3,2号货架,单兵装备,即将临期,
|
|
||||||
仓库4,1号货架,单兵装备,即将临期,
|
|
||||||
仓库2,3号货架,单兵装备,即将临期
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="map_container_l">
|
<div className="map_container_l">
|
||||||
<HomeLeft />
|
<HomeLeft />
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
import { Store } from "antd/es/form/interface";
|
||||||
|
import { inject, observer } from "mobx-react";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import "./video.less";
|
||||||
|
const Scr = (props: Store) => {
|
||||||
|
const { homeStore } = props;
|
||||||
|
const [val, setString] = useState<boolean>(false);
|
||||||
|
useEffect(() => {
|
||||||
|
homeStore.getTodo().then((res) => {
|
||||||
|
let b = res.data.record.map((vs)=>vs.title)
|
||||||
|
setString(b.join(","))
|
||||||
|
});
|
||||||
|
}, [homeStore, homeStore.showVideo]);
|
||||||
|
return (
|
||||||
|
<div className="scrolling-text">
|
||||||
|
<span>
|
||||||
|
{val}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default inject("homeStore")(observer(Scr));
|
|
@ -2,4 +2,7 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
video::-webkit-media-controls-timeline {
|
||||||
|
display: none;
|
||||||
}
|
}
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import React, { useEffect, useRef } from "react";
|
import React, { useEffect, useRef } from "react";
|
||||||
import flvjs from "flv.js";
|
import flvjs from "flv.js";
|
||||||
import { Store } from "antd/es/form/interface";
|
import { Store } from "antd/es/form/interface";
|
||||||
|
|
|
@ -32,9 +32,13 @@ const User = (props: Store) => {
|
||||||
pers_link_user:record.pers.map(item=>item.pers_identity),
|
pers_link_user:record.pers.map(item=>item.pers_identity),
|
||||||
head_img:[{ url: record.head_img }],
|
head_img:[{ url: record.head_img }],
|
||||||
};
|
};
|
||||||
|
let config = defaultConfig(team, per)
|
||||||
setProjectConfig(defaultConfig(team, per));
|
config.forEach((e:any)=>{
|
||||||
console.log(records)
|
if (e.name==="head_img"){
|
||||||
|
e.value =[{ url: record.head_img }];
|
||||||
|
}
|
||||||
|
})
|
||||||
|
setProjectConfig(config);
|
||||||
setIsModalOpen(true);
|
setIsModalOpen(true);
|
||||||
setRecord(records);
|
setRecord(records);
|
||||||
setId(records.id);
|
setId(records.id);
|
||||||
|
|
|
@ -93,6 +93,16 @@ class BaseHttp {
|
||||||
})
|
})
|
||||||
return res.data;
|
return res.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
async downloadFile(url: string, params: any) {
|
||||||
|
let res = await axios({
|
||||||
|
method: 'get',
|
||||||
|
url: url,
|
||||||
|
params,
|
||||||
|
responseType: 'blob',
|
||||||
|
})
|
||||||
|
return res;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line import/no-anonymous-default-export
|
// eslint-disable-next-line import/no-anonymous-default-export
|
||||||
|
|
|
@ -13,6 +13,7 @@ class HomeConfig {
|
||||||
static mm: string = "/v1/public/mm"
|
static mm: string = "/v1/public/mm"
|
||||||
static rm: string = "/v1/public/rm"
|
static rm: string = "/v1/public/rm"
|
||||||
static ae: string = "/v1/public/ae"
|
static ae: string = "/v1/public/ae"
|
||||||
|
static todo: string = "/v1/public/todo"
|
||||||
static con: string = "/v1/user/mapMakerUser"
|
static con: string = "/v1/user/mapMakerUser"
|
||||||
|
|
||||||
static newTask: string = "/v1/user/newTask"
|
static newTask: string = "/v1/user/newTask"
|
||||||
|
@ -60,6 +61,9 @@ class HomeStore extends BaseStore<TagDataType> {
|
||||||
async getContact(params) {
|
async getContact(params) {
|
||||||
return await baseHttp.get(HomeConfig.con, params);
|
return await baseHttp.get(HomeConfig.con, params);
|
||||||
}
|
}
|
||||||
|
async getTodo(params) {
|
||||||
|
return await baseHttp.get(HomeConfig.todo, params);
|
||||||
|
}
|
||||||
|
|
||||||
// 获取视频推流连接
|
// 获取视频推流连接
|
||||||
async getVideoUrlList() {
|
async getVideoUrlList() {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import baseHttp from '@/service/base';
|
||||||
class SigninConfig {
|
class SigninConfig {
|
||||||
static LISTs: string = "/v1/user/signin"
|
static LISTs: string = "/v1/user/signin"
|
||||||
static Export: string = "/v1/user/signin/export"
|
static Export: string = "/v1/user/signin/export"
|
||||||
|
|
||||||
}
|
}
|
||||||
class SigninStore extends BaseStore<TagDataType> {
|
class SigninStore extends BaseStore<TagDataType> {
|
||||||
signList = []
|
signList = []
|
||||||
|
@ -19,26 +19,36 @@ class SigninStore extends BaseStore<TagDataType> {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
async getSignList(query) {
|
async getSignList(query) {
|
||||||
let list =await baseHttp.get(SigninConfig.LISTs, {
|
let list = await baseHttp.get(SigninConfig.LISTs, {
|
||||||
size: query?.Size ?? 20,
|
size: query?.Size ?? 20,
|
||||||
offset: query?.Offset ?? 1,
|
offset: query?.Offset ?? 1,
|
||||||
user_name: query?.user_name,
|
user_name: query?.user_name,
|
||||||
id_card: query?.id_card ?? '',
|
id_card: query?.id_card ?? '',
|
||||||
start_time: query?.start_time ,
|
start_time: query?.start_time,
|
||||||
end_time: query?.end_time ,
|
end_time: query?.end_time,
|
||||||
})
|
})
|
||||||
this.signList = list?.data.record;
|
this.signList = list?.data.record;
|
||||||
}
|
}
|
||||||
|
|
||||||
async exports(query) {
|
async exports(query) {
|
||||||
await baseHttp.get(SigninConfig.Export, {
|
let res = await baseHttp.downloadFile(SigninConfig.Export, {
|
||||||
size: query?.Size ?? 20,
|
size: query?.Size ?? 20,
|
||||||
offset: query?.Offset ?? 1,
|
offset: query?.Offset ?? 1,
|
||||||
user_name: query?.user_name,
|
user_name: query?.user_name,
|
||||||
id_card: query?.id_card ?? '',
|
id_card: query?.id_card ?? '',
|
||||||
start_time: query?.start_time ,
|
start_time: query?.start_time,
|
||||||
end_time: query?.end_time ,
|
end_time: query?.end_time,
|
||||||
})
|
})
|
||||||
|
const url = window.URL.createObjectURL(res.data); // 创建一个临时的URL
|
||||||
|
const a = document.createElement('a'); // 创建一个<a>元素
|
||||||
|
a.style.display = 'none'; // 隐藏该元素
|
||||||
|
a.href = url; // 设置href属性为目标URL
|
||||||
|
a.download = '考勤.csv'; // 设置下载后的文件名
|
||||||
|
document.body.appendChild(a); // 将其添加到DOM中
|
||||||
|
a.click(); // 触发点击事件开始下载
|
||||||
|
window.URL.revokeObjectURL(url); // 释放之前创建的URL对象
|
||||||
|
document.body.removeChild(a); // 下载完成后可以从DOM中移除该元素
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class Config {
|
class Config {
|
||||||
static baseUrl = "https://rw.quwanya.cn/";
|
static baseUrl = "https://www.hswzct.cn:12016/";
|
||||||
static ws = "wss://rw.quwanya.cn/wsadmin?id=admin";
|
static ws = "wss://www.hswzct.cn:12016/wsadmin?id=admin";
|
||||||
static userStatic = "https://rw.quwanya.cn/api/uploads/user/";
|
static userStatic = "https://www.hswzct.cn:12016/api/uploads/user/";
|
||||||
static videoApi = "https://sprh.hswzct.cn:4443"; //
|
static videoApi = "https://sprh.hswzct.cn:4443"; //
|
||||||
static videoApis = "https://sprh.hswzct.cn:4443"; //
|
static videoApis = "https://sprh.hswzct.cn:4443"; //
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue