diff --git a/src/components/form/simple_form.tsx b/src/components/form/simple_form.tsx index 0937c5a..abccbab 100644 --- a/src/components/form/simple_form.tsx +++ b/src/components/form/simple_form.tsx @@ -40,7 +40,7 @@ const SimpleForm = (props: SimpleFormData) => { name={v.name} rules={v.rules} > - + ); case FormType.inputNumber: @@ -51,7 +51,7 @@ const SimpleForm = (props: SimpleFormData) => { name={v.name} rules={v.rules} > - + ); case FormType.password: @@ -86,7 +86,6 @@ const SimpleForm = (props: SimpleFormData) => { > { form.setFieldValue(v.name, res); }} @@ -111,27 +110,24 @@ const SimpleForm = (props: SimpleFormData) => { case FormType.select: return FormSelect(v); case FormType.upload: - console.log(form.getFieldValue(v.name)) return ( { if (Array.isArray(e)) { return e; } - console.log(e) return e && e.fileList; }} > { - console.log(res); form.setFieldValue(v.name, res); }} /> @@ -219,7 +215,7 @@ const SimpleForm = (props: SimpleFormData) => { name={v.name} rules={v.rules} > - + ); } diff --git a/src/pages/home/home.tsx b/src/pages/home/home.tsx index caf0ebd..47d9ede 100644 --- a/src/pages/home/home.tsx +++ b/src/pages/home/home.tsx @@ -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(() => {
-
- - 仓库3,2号货架,单兵装备,即将临期, - 仓库4,1号货架,单兵装备,即将临期, - 仓库2,3号货架,单兵装备,即将临期 - -
+
diff --git a/src/pages/home/scr.tsx b/src/pages/home/scr.tsx new file mode 100644 index 0000000..8959ec3 --- /dev/null +++ b/src/pages/home/scr.tsx @@ -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(false); + useEffect(() => { + homeStore.getTodo().then((res) => { + let b = res.data.record.map((vs)=>vs.title) + setString(b.join(",")) + }); + }, [homeStore, homeStore.showVideo]); + return ( +
+ + {val} + +
+ ); +}; + +export default inject("homeStore")(observer(Scr)); diff --git a/src/pages/home/video.less b/src/pages/home/video.less index f0641a7..794c2dc 100644 --- a/src/pages/home/video.less +++ b/src/pages/home/video.less @@ -2,4 +2,7 @@ width: 100%; display: flex; flex-wrap: wrap; +} +video::-webkit-media-controls-timeline { + display: none; } \ No newline at end of file diff --git a/src/pages/home/video.tsx b/src/pages/home/video.tsx index 8da4c52..52ed45b 100644 --- a/src/pages/home/video.tsx +++ b/src/pages/home/video.tsx @@ -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"; diff --git a/src/pages/user/user.tsx b/src/pages/user/user.tsx index bb4629d..b605ac8 100644 --- a/src/pages/user/user.tsx +++ b/src/pages/user/user.tsx @@ -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); diff --git a/src/service/base.ts b/src/service/base.ts index f1932e1..cf4f1c7 100644 --- a/src/service/base.ts +++ b/src/service/base.ts @@ -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 diff --git a/src/store/home.ts b/src/store/home.ts index 0236b36..c0b1c81 100644 --- a/src/store/home.ts +++ b/src/store/home.ts @@ -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 { async getContact(params) { return await baseHttp.get(HomeConfig.con, params); } + async getTodo(params) { + return await baseHttp.get(HomeConfig.todo, params); + } // 获取视频推流连接 async getVideoUrlList() { diff --git a/src/store/singin.ts b/src/store/singin.ts index c1eb2b4..fe2c764 100644 --- a/src/store/singin.ts +++ b/src/store/singin.ts @@ -7,7 +7,7 @@ import baseHttp from '@/service/base'; class SigninConfig { static LISTs: string = "/v1/user/signin" static Export: string = "/v1/user/signin/export" - + } class SigninStore extends BaseStore { signList = [] @@ -19,26 +19,36 @@ class SigninStore extends BaseStore { }) } async getSignList(query) { - let list =await baseHttp.get(SigninConfig.LISTs, { + let list = await baseHttp.get(SigninConfig.LISTs, { size: query?.Size ?? 20, offset: query?.Offset ?? 1, user_name: query?.user_name, id_card: query?.id_card ?? '', - start_time: query?.start_time , - end_time: query?.end_time , + start_time: query?.start_time, + end_time: query?.end_time, }) this.signList = list?.data.record; } 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, id_card: query?.id_card ?? '', - start_time: query?.start_time , - end_time: query?.end_time , + start_time: query?.start_time, + end_time: query?.end_time, }) + const url = window.URL.createObjectURL(res.data); // 创建一个临时的URL + const a = document.createElement('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中移除该元素 + } } diff --git a/src/util/config.ts b/src/util/config.ts index 4be147a..bee7cf8 100644 --- a/src/util/config.ts +++ b/src/util/config.ts @@ -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"; // }