first commit

This commit is contained in:
wang_yp 2024-11-25 01:06:05 +08:00
parent 5afd6e3933
commit 41f434c354
8 changed files with 71 additions and 57 deletions

View File

@ -50,7 +50,7 @@ const AliUpload = (props: UploadFileProps) => {
const handleChange: UploadProps["onChange"] = ({ fileList: newFileList }) => { const handleChange: UploadProps["onChange"] = ({ fileList: newFileList }) => {
newFileList.forEach((i) => { newFileList.forEach((i) => {
i.url = `${Config.uploadUrl}uploads/` + i.name; i.url = `${Config.baseUrl}uploads/` + i.name;
i.fileName = i.name; i.fileName = i.name;
}); });
setFileList(newFileList); setFileList(newFileList);
@ -68,7 +68,7 @@ const AliUpload = (props: UploadFileProps) => {
<Upload <Upload
listType="picture-card" listType="picture-card"
fileList={files} fileList={files}
action={`${Config.uploadUrl}v1/public/fts/upload`} action={`${Config.baseUrl}v1/public/fts/upload`}
onPreview={handlePreview} onPreview={handlePreview}
maxCount={props.maxCount ?? 4} maxCount={props.maxCount ?? 4}
onChange={handleChange} onChange={handleChange}

View File

@ -72,7 +72,7 @@ const ArchivesFolder = (props: Store) => {
setFolderId(info.node.identity); setFolderId(info.node.identity);
}; };
const cancel: PopconfirmProps['onCancel'] = (e) => { const cancel: PopconfirmProps["onCancel"] = (e) => {
console.log(e); console.log(e);
}; };
const onExpand: DirectoryTreeProps["onExpand"] = (keys, info) => { const onExpand: DirectoryTreeProps["onExpand"] = (keys, info) => {
@ -115,18 +115,18 @@ const ArchivesFolder = (props: Store) => {
<Popconfirm <Popconfirm
title="Delete the task" title="Delete the task"
description="Are you sure to delete this task?" description="Are you sure to delete this task?"
onConfirm={()=>{ onConfirm={() => {
remove(nodeData.id); remove(nodeData.id);
}} }}
onCancel={cancel} onCancel={cancel}
okText="Yes" okText="Yes"
cancelText="No" cancelText="No"
> >
<Button danger variant="solid" size="small"></Button> <Button danger variant="solid" size="small">
</Button>
</Popconfirm> </Popconfirm>
</Space> </Space>
</> </>
); );
}} }}

View File

@ -32,21 +32,20 @@ const FileListPage = (props: any) => {
onChange(info) { onChange(info) {
if (info.file.status === "done") { if (info.file.status === "done") {
message.success(`${info.file.name} file uploaded successfully`); message.success(`${info.file.name} file uploaded successfully`);
console.log("info.fileList", info.fileList);
saveHandler(info.fileList); saveHandler(info.fileList);
} else if (info.file.status === "error") { } else if (info.file.status === "error") {
message.error(`${info.file.name} file upload failed.`); message.error(`${info.file.name} file upload failed.`);
} }
}, },
}; };
const getFileList =()=>{ const getFileList = () => {
folderStore.getAlist(id).then((res) => { folderStore.getAlist(id).then((res) => {
setFileList(folderStore.alist); setFileList(folderStore.alist);
}); });
} };
useEffect(() => { useEffect(() => {
getFileList() getFileList();
}, [folderStore, id]); }, [id]);
const getFileTypeFromUrl = (url) => { const getFileTypeFromUrl = (url) => {
if (url === "" || url.length === 0) return; if (url === "" || url.length === 0) return;
// 解析URL以提取文件名 // 解析URL以提取文件名
@ -107,12 +106,16 @@ const FileListPage = (props: any) => {
} }
}; };
const saveHandler = (files) => { const saveHandler = (files) => {
files.forEach((item) => { let file = files[files.length - 1];
item.file_url = item.url; file = {
item.file_type = item.type; file_url: file.url,
item.file_name = item.name; file_type: file.type,
file_name: file.name,
...file,
};
archivesStore.save(id, [file]).then(() => {
getFileList();
}); });
archivesStore.save(id, files);
}; };
return ( return (
@ -129,7 +132,7 @@ const FileListPage = (props: any) => {
<span className="text-overflow"> {item?.file_name}</span> <span className="text-overflow"> {item?.file_name}</span>
<Button <Button
onClick={() => { onClick={() => {
setFileName(item?.file_url); setFileName(Config.baseUrl + "/uploads/" + item?.file_name);
setIsModalOpen(true); setIsModalOpen(true);
}} }}
> >
@ -142,8 +145,9 @@ const FileListPage = (props: any) => {
title="删除文件" title="删除文件"
description="是否删除文件?" description="是否删除文件?"
onConfirm={() => { onConfirm={() => {
archivesStore.deleteItem(item.id) archivesStore.deleteItem(item.id).then(() => {
getFileList() getFileList();
});
}} }}
onCancel={() => {}} onCancel={() => {}}
okText="Yes" okText="Yes"

View File

@ -27,7 +27,7 @@ const Preview = (props: any) => {
{list && list.length > 0 ? ( {list && list.length > 0 ? (
<img <img
style={{ width: "100%", minHeight: "200px" }} style={{ width: "100%", minHeight: "200px" }}
src={Config.uploadUrl + "uploads/" + list[selectIndex].file_url} src={Config.baseUrl + "uploads/" + list[selectIndex].file_url}
alt={list[selectIndex].file_url} alt={list[selectIndex].file_url}
/> />
) : null} ) : null}

View File

@ -1,8 +1,10 @@
import { useNavigate } from "react-router";
import Ac from "./ac"; import Ac from "./ac";
import Pyzx from "./pyzx"; import Pyzx from "./pyzx";
import "./right.less"; import "./right.less";
import Wz from "./wz"; import Wz from "./wz";
const HomeRight = () => { const HomeRight = () => {
const nv = useNavigate();
return ( return (
<div className="right_container"> <div className="right_container">
<div className="org"> <div className="org">
@ -11,7 +13,7 @@ const HomeRight = () => {
</div> </div>
<Wz /> <Wz />
</div> </div>
<div className="org"> <div className="org" onClick={()=>nv('/admin/archives/box')}>
<div className="org_head"> <div className="org_head">
<p></p> <p></p>
</div> </div>

View File

@ -24,11 +24,13 @@
.pyzx{ .pyzx{
height: 100%; height: 100%;
padding: 10px; padding: 10px;
overflow-y: auto;
.pyzx_title{ .pyzx_title{
display: flex; display: flex;
padding: 5px 4px; padding: 5px 4px;
align-items: start; align-items: start;
background: rgba(37, 52, 70, 0.4); background: rgba(37, 52, 70, 0.4);
.content{ .content{
text-align: left; text-align: left;
font-size: 13px; font-size: 13px;

View File

@ -1,8 +1,7 @@
class Config { class Config {
static baseUrl = "https://www.hswzct.cn:12016/"; static baseUrl = "https://rw.quwanya.cn/";
static uploadUrl = "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/uploads/user/";
static userStatic = "https://hswzct.cn:12016/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"; //
} }

View File

@ -1,4 +1,5 @@
import { message } from "antd";
import SocketService from "./socket"; import SocketService from "./socket";
class WebRtc { class WebRtc {
@ -48,6 +49,10 @@ class WebRtc {
case "answer": case "answer":
this.pee?.setRemoteDescription(msg.content.body.description) this.pee?.setRemoteDescription(msg.content.body.description)
break; break;
case "reject":
message.info("对方拒绝了通话邀请")
this.close()
break;
case "bye": case "bye":
this.close() this.close()
break; break;
@ -159,14 +164,16 @@ class WebRtc {
close() { close() {
this.video?.pause(); this.video?.pause();
this.pee?.close(); this.pee?.close();
// this.ws?.send({ this.ws?.send({
// type: "bye", type: "bye",
// data: { data: {
// session_id: this.userToId + "admin", to: this.userToId,
// to: this.userToId, from: "admin",
// from: "admin" description: "bye",
// } media: "video",
// }); session_id: this.userToId + "admin",
}
});
(this.mediaStream as MediaStream)?.getTracks().forEach(track => track.stop()); (this.mediaStream as MediaStream)?.getTracks().forEach(track => track.stop());
} }
} }