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

View File

@ -72,7 +72,7 @@ const ArchivesFolder = (props: Store) => {
setFolderId(info.node.identity);
};
const cancel: PopconfirmProps['onCancel'] = (e) => {
const cancel: PopconfirmProps["onCancel"] = (e) => {
console.log(e);
};
const onExpand: DirectoryTreeProps["onExpand"] = (keys, info) => {
@ -122,11 +122,11 @@ const ArchivesFolder = (props: Store) => {
okText="Yes"
cancelText="No"
>
<Button danger variant="solid" size="small"></Button>
<Button danger variant="solid" size="small">
</Button>
</Popconfirm>
</Space>
</>
);
}}

View File

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

View File

@ -27,7 +27,7 @@ const Preview = (props: any) => {
{list && list.length > 0 ? (
<img
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}
/>
) : null}

View File

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

View File

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

View File

@ -1,8 +1,7 @@
class Config {
static baseUrl = "https://www.hswzct.cn:12016/";
static uploadUrl = "https://www.hswzct.cn:12016";
static ws = "wss://www.hswzct.cn:12016/wsadmin?id=admin";
static userStatic = "https://hswzct.cn:12016/uploads/user/";
static baseUrl = "https://rw.quwanya.cn/";
static ws = "wss://rw.quwanya.cn/wsadmin?id=admin";
static userStatic = "https://rw.quwanya.cn/uploads/user/";
static videoApi = "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";
class WebRtc {
@ -48,6 +49,10 @@ class WebRtc {
case "answer":
this.pee?.setRemoteDescription(msg.content.body.description)
break;
case "reject":
message.info("对方拒绝了通话邀请")
this.close()
break;
case "bye":
this.close()
break;
@ -159,14 +164,16 @@ class WebRtc {
close() {
this.video?.pause();
this.pee?.close();
// this.ws?.send({
// type: "bye",
// data: {
// session_id: this.userToId + "admin",
// to: this.userToId,
// from: "admin"
// }
// });
this.ws?.send({
type: "bye",
data: {
to: this.userToId,
from: "admin",
description: "bye",
media: "video",
session_id: this.userToId + "admin",
}
});
(this.mediaStream as MediaStream)?.getTracks().forEach(track => track.stop());
}
}