diff --git a/src/components/ali_upload.tsx b/src/components/ali_upload.tsx index 801a8e5..cea1125 100644 --- a/src/components/ali_upload.tsx +++ b/src/components/ali_upload.tsx @@ -50,7 +50,7 @@ const AliUpload = (props: UploadFileProps) => { const handleChange: UploadProps["onChange"] = ({ fileList: newFileList }) => { newFileList.forEach((i) => { - i.url = `${Config.baseUrl}uploads/` + i.name; + i.url = `${Config.baseUrl}/uploads/` + i.name; i.fileName = i.name; }); setFileList(newFileList); @@ -68,7 +68,7 @@ const AliUpload = (props: UploadFileProps) => { { { title: "申请人", dataIndex: "user_name" }, { title: "申请人手机号", dataIndex: "tel" }, { title: "悬挂地址", dataIndex: "address" }, - { title: "申请时间", dataIndex: "created_at" }, + { title: "申请时间", dataIndex: "created_at",render:(created_at)=>({dayjs(created_at).format("YYYY-MM-DD")}) }, { title: "申请原因", dataIndex: "abbr",render: (abbr) => {abbr===2?'更换':'悬挂'} }, { title: "申请描述", dataIndex: "desc" }, - { - title: "操作", - dataIndex: "id", - render: (any, record) => ( -
- - - -
- ), - }, ]; return (
diff --git a/src/pages/home/homeBottom/dispath.tsx b/src/pages/home/homeBottom/dispath.tsx index 0dd8b46..8841025 100644 --- a/src/pages/home/homeBottom/dispath.tsx +++ b/src/pages/home/homeBottom/dispath.tsx @@ -36,18 +36,12 @@ const Dispath = (props: Store) => { { type: FormType.cehckboxGroup, label: "参与队伍", - name: "trem_id", + name: "team_id", value: [], checkboxData: userList, rules: [{ required: true, message: "请选择参与队伍!" }], }, - { - type: FormType.treeVideo, - label: "直播视频地址", - name: "task_video", - value: [], - rules: [{ required: true, message: "请选择直播视频地址!" }], - }, + ]); }; useEffect(() => { @@ -77,15 +71,15 @@ const Dispath = (props: Store) => { }; const onFinish = (values: any) => { - let task_video: any = []; + let task_videos: any = []; for (let i = 0; i < values.task_video.length; i++) { let item = values.task_video[i]; - task_video.push({ + task_videos.push({ device: item.split("-")[0], channel: item.split("-")[1], }); } - if (!task_video || task_video.length === 0) { + if (!task_videos || task_videos.length === 0) { message.error("请选择视频设备"); return; } @@ -102,13 +96,13 @@ const Dispath = (props: Store) => { score: Number(values.score), count: Number(values.count), }; - data.task_video = task_video; + data.task_video = task_videos; trainingStore.add(data); setIsModalOpen(false); }; const handleSearch = (newValue: string) => { if (newValue === "") return; - baseHttp.get("/supplies/list/serch", { name: newValue }).then((res) => { + baseHttp.get("/v1/supplies/list/serch", { name: newValue }).then((res) => { let data = res.data?.record ?? []; data.forEach((item) => { item.text = item.name; diff --git a/src/pages/home/homeLeft/turn.tsx b/src/pages/home/homeLeft/turn.tsx index 48d6282..884a0fb 100644 --- a/src/pages/home/homeLeft/turn.tsx +++ b/src/pages/home/homeLeft/turn.tsx @@ -127,21 +127,23 @@ const Turn = (props: Store) => { {}} onOk={() => {}} + centered footer={null} onCancel={() => { setisModalOpen(false); }} > - <> +

任务列表

- {trainingStore.list?.map((item) => { +
+ {trainingStore.list?.map((item) => { return (

{ }} onClick={() => { setTaskId(item.identity); - getFolderhandler(item.archives_category_identity); + getFolderhandler(item.identity); }} > {item.title}

); })} +
@@ -182,10 +185,11 @@ const Turn = (props: Store) => { })}
- +

档案列表

- {imageList?.map((item) => { +
+ {imageList?.map((item) => { let fileType = getFileTypeFromUrl(item.file_url); switch (fileType) { case "png": @@ -244,13 +248,13 @@ const Turn = (props: Store) => { ); } })} +
{
- +
); diff --git a/src/pages/home/home_video.tsx b/src/pages/home/home_video.tsx index bee8d5f..62a9548 100644 --- a/src/pages/home/home_video.tsx +++ b/src/pages/home/home_video.tsx @@ -6,11 +6,11 @@ import "./video.less"; const HomeVideo = (props: Store) => { const { homeStore } = props; - const [videoUrls, setVideoUrl] = useState<[] | null>([]); + const [videoUrls, setVideoUrl] = useState | null>([]); useEffect(() => { // 获取最新任务 homeStore.getNewTask().then((res) => { - setVideoUrl(res); + setVideoUrl(res); }); }, [homeStore]); return ( diff --git a/src/pages/home/video.tsx b/src/pages/home/video.tsx index a4ea2fb..98cbc9c 100644 --- a/src/pages/home/video.tsx +++ b/src/pages/home/video.tsx @@ -2,23 +2,23 @@ import { Store } from "antd/es/form/interface"; import { useEffect, useRef } from "react"; import videojs from "video.js"; import "video.js/dist/video-js.css"; -const videoJsOptions = { - autoplay: true, - controls: true, - responsive: true, - fluid: true, - sources: [ - { - src: "", - type: "application/x-mpegURL", - }, - ], -}; + const Videos = (props: Store) => { const { onReady } = props; - const videoRef = useRef(null); - const playerRef = useRef(null); // 使用 any 类型 - + let videoRef = useRef(null); + let playerRef = useRef(null); // 使用 any 类型 + const videoJsOptions = { + autoplay: true, + controls: true, + responsive: true, + fluid: true, + sources: [ + { + src: "", + type: "application/x-mpegURL", + }, + ], + }; useEffect(() => { if (!props.url) return; videoJsOptions.sources[0].src = props.url; @@ -39,6 +39,7 @@ const Videos = (props: Store) => { player?.autoplay(videoJsOptions?.autoplay); player.src(videoJsOptions?.sources); } + console.log(videoJsOptions.sources) return () => { if (playerRef.current) { playerRef.current.dispose(); @@ -50,7 +51,7 @@ const Videos = (props: Store) => { return ( <>
-
+
); diff --git a/src/pages/leaveApproval/levcat_column.tsx b/src/pages/leaveApproval/levcat_column.tsx index f21a7a2..7b239d8 100644 --- a/src/pages/leaveApproval/levcat_column.tsx +++ b/src/pages/leaveApproval/levcat_column.tsx @@ -1,6 +1,7 @@ import { FormType } from "@/components/form/interface"; import { UserDataType } from "@/model/userModel"; import { ColumnsType } from "antd/lib/table"; +import dayjs from "dayjs"; export const columns: ColumnsType = [ { title: "分类名称", @@ -17,10 +18,16 @@ export const leaveColumns: ColumnsType = [ { title: "请假开始时间", dataIndex: "leave_start_time", + render(leave_start_time) { + return dayjs(leave_start_time).format("YYYY-MM-DD"); + } }, { title: "请假结束时间", dataIndex: "leave_end_time", + render(leave_end_time) { + return dayjs(leave_end_time).format("YYYY-MM-DD"); + } }, { title: "请假备注", diff --git a/src/pages/patrol/index.tsx b/src/pages/patrol/index.tsx index ec7de38..b9cc910 100644 --- a/src/pages/patrol/index.tsx +++ b/src/pages/patrol/index.tsx @@ -39,7 +39,7 @@ const Patrol = (props: Store) => { status === 0 ? ( 进行中 ) : ( - 已完成 + 已完成 ), }, { @@ -56,18 +56,17 @@ const Patrol = (props: Store) => { > 编辑 - + {record.status === 0 ? ( + + ) : null} {record.supplies_status === 1 ? (