singin
This commit is contained in:
parent
483bc1220b
commit
654630f2ae
|
@ -40,7 +40,7 @@ const SimpleForm = (props: SimpleFormData) => {
|
|||
name={v.name}
|
||||
rules={v.rules}
|
||||
>
|
||||
<Input defaultValue={v.value} value={v.value} />
|
||||
<Input value={v.value} />
|
||||
</Form.Item>
|
||||
);
|
||||
case FormType.inputNumber:
|
||||
|
@ -51,7 +51,7 @@ const SimpleForm = (props: SimpleFormData) => {
|
|||
name={v.name}
|
||||
rules={v.rules}
|
||||
>
|
||||
<InputNumber defaultValue={v.value} value={v.value} />
|
||||
<InputNumber value={v.value} />
|
||||
</Form.Item>
|
||||
);
|
||||
case FormType.password:
|
||||
|
@ -86,7 +86,6 @@ const SimpleForm = (props: SimpleFormData) => {
|
|||
>
|
||||
<Checkbox.Group
|
||||
options={v.checkboxData}
|
||||
defaultValue={["Pear"]}
|
||||
onChange={(res) => {
|
||||
form.setFieldValue(v.name, res);
|
||||
}}
|
||||
|
@ -111,7 +110,6 @@ const SimpleForm = (props: SimpleFormData) => {
|
|||
case FormType.select:
|
||||
return FormSelect(v);
|
||||
case FormType.upload:
|
||||
console.log(form.getFieldValue(v.name))
|
||||
return (
|
||||
<Form.Item
|
||||
key={v.label}
|
||||
|
@ -124,14 +122,12 @@ const SimpleForm = (props: SimpleFormData) => {
|
|||
if (Array.isArray(e)) {
|
||||
return e;
|
||||
}
|
||||
console.log(e)
|
||||
return e && e.fileList;
|
||||
}}
|
||||
>
|
||||
<AliUpload
|
||||
imgList={form.getFieldValue(v.name) ?? []}
|
||||
imgList={v.value ?? []}
|
||||
onChnage={(res) => {
|
||||
console.log(res);
|
||||
form.setFieldValue(v.name, res);
|
||||
}}
|
||||
/>
|
||||
|
@ -219,7 +215,7 @@ const SimpleForm = (props: SimpleFormData) => {
|
|||
name={v.name}
|
||||
rules={v.rules}
|
||||
>
|
||||
<Input defaultValue={v.value} value={v.value} />
|
||||
<Input value={v.value} />
|
||||
</Form.Item>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import Weather from "./homeLeft/weather";
|
|||
import Timer from "./homeLeft/timer";
|
||||
import HomeVideo from "./home_video";
|
||||
import HomeCheck from "./home_check";
|
||||
import Scr from "./scr";
|
||||
|
||||
const Home = observer(() => {
|
||||
const navigate = useNavigate();
|
||||
|
@ -36,13 +37,7 @@ const Home = observer(() => {
|
|||
</div>
|
||||
</div>
|
||||
<div className="scr">
|
||||
<div className="scrolling-text">
|
||||
<span>
|
||||
仓库3,2号货架,单兵装备,即将临期,
|
||||
仓库4,1号货架,单兵装备,即将临期,
|
||||
仓库2,3号货架,单兵装备,即将临期
|
||||
</span>
|
||||
</div>
|
||||
<Scr></Scr>
|
||||
</div>
|
||||
<div className="map_container_l">
|
||||
<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));
|
|
@ -3,3 +3,6 @@
|
|||
display: flex;
|
||||
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 flvjs from "flv.js";
|
||||
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),
|
||||
head_img:[{ url: record.head_img }],
|
||||
};
|
||||
|
||||
setProjectConfig(defaultConfig(team, per));
|
||||
console.log(records)
|
||||
let config = defaultConfig(team, per)
|
||||
config.forEach((e:any)=>{
|
||||
if (e.name==="head_img"){
|
||||
e.value =[{ url: record.head_img }];
|
||||
}
|
||||
})
|
||||
setProjectConfig(config);
|
||||
setIsModalOpen(true);
|
||||
setRecord(records);
|
||||
setId(records.id);
|
||||
|
|
|
@ -93,6 +93,16 @@ class BaseHttp {
|
|||
})
|
||||
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
|
||||
|
|
|
@ -13,6 +13,7 @@ class HomeConfig {
|
|||
static mm: string = "/v1/public/mm"
|
||||
static rm: string = "/v1/public/rm"
|
||||
static ae: string = "/v1/public/ae"
|
||||
static todo: string = "/v1/public/todo"
|
||||
static con: string = "/v1/user/mapMakerUser"
|
||||
|
||||
static newTask: string = "/v1/user/newTask"
|
||||
|
@ -60,6 +61,9 @@ class HomeStore extends BaseStore<TagDataType> {
|
|||
async getContact(params) {
|
||||
return await baseHttp.get(HomeConfig.con, params);
|
||||
}
|
||||
async getTodo(params) {
|
||||
return await baseHttp.get(HomeConfig.todo, params);
|
||||
}
|
||||
|
||||
// 获取视频推流连接
|
||||
async getVideoUrlList() {
|
||||
|
|
|
@ -31,7 +31,7 @@ class SigninStore extends BaseStore<TagDataType> {
|
|||
}
|
||||
|
||||
async exports(query) {
|
||||
await baseHttp.get(SigninConfig.Export, {
|
||||
let res = await baseHttp.downloadFile(SigninConfig.Export, {
|
||||
size: query?.Size ?? 20,
|
||||
offset: query?.Offset ?? 1,
|
||||
user_name: query?.user_name,
|
||||
|
@ -39,6 +39,16 @@ class SigninStore extends BaseStore<TagDataType> {
|
|||
start_time: query?.start_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 {
|
||||
static baseUrl = "https://rw.quwanya.cn/";
|
||||
static ws = "wss://rw.quwanya.cn/wsadmin?id=admin";
|
||||
static userStatic = "https://rw.quwanya.cn/api/uploads/user/";
|
||||
static baseUrl = "https://www.hswzct.cn:12016/";
|
||||
static ws = "wss://www.hswzct.cn:12016/wsadmin?id=admin";
|
||||
static userStatic = "https://www.hswzct.cn:12016/api/uploads/user/";
|
||||
static videoApi = "https://sprh.hswzct.cn:4443"; //
|
||||
static videoApis = "https://sprh.hswzct.cn:4443"; //
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue