push im model

This commit is contained in:
wang_yp 2024-06-20 23:21:43 +08:00
parent 27cfbbd201
commit ec6c38cb3e
7 changed files with 24 additions and 17 deletions

View File

@ -37,7 +37,6 @@ const BTable = (props: any) => {
rowSelection={rowSelection} rowSelection={rowSelection}
columns={props.columns} columns={props.columns}
dataSource={dataSource} dataSource={dataSource}
/> />
); );
}; };

View File

@ -34,7 +34,7 @@ const Dilog = (props: DilogModel) => {
document.documentElement.removeEventListener("click", onClick); document.documentElement.removeEventListener("click", onClick);
document.documentElement.removeEventListener("keydown", handleKeyword); document.documentElement.removeEventListener("keydown", handleKeyword);
}; };
}, [props.show]); }, [props, props.show]);
const handleClose = () => { const handleClose = () => {
showState(false); showState(false);
props.close(); props.close();

View File

@ -4,19 +4,19 @@ import { useState } from "react";
export const FormSelect = (v: FormDatas) => { export const FormSelect = (v: FormDatas) => {
const [list] = useState([ const [list] = useState([
{ {
value: 1, value: "1",
label: "卡片一", label: "卡片一",
}, },
{ {
value: 2, value: "2",
label: "卡片二", label: "卡片二",
}, },
{ {
value: 3, value: "3",
label: "卡片三", label: "卡片三",
}, },
{ {
value: 4, value: "4",
label: "卡片四", label: "卡片四",
}, },
]); ]);

View File

@ -0,0 +1,12 @@
import { useEffect, useRef } from "react"
// 判断组件挂载状态
export const useMountedStatus = () => {
const status = useRef(false)
useEffect(() => {
status.current = true;
return ()=>{
status.current = false;
}
})
}

View File

@ -20,5 +20,4 @@ export interface UserDataType {
startTime: any; startTime: any;
endTime: any; endTime: any;
status: any; status: any;
} }

View File

@ -117,6 +117,7 @@ const CardPageList = (props) => {
] ]
const onFinish = (values: any) => { const onFinish = (values: any) => {
values.cardType = `${values.cardType}`;
if (!id) { if (!id) {
cardStore.add(values); cardStore.add(values);
} else { } else {

View File

@ -35,8 +35,8 @@ class BaseStore<B> implements BaseStoreInterface<B> {
this.getlist() this.getlist()
} }
// 分页 // 分页
setPages(page: Pages) { setPages(params: Pages) {
this.page = page this.page = params
this.getlist() this.getlist()
} }
// 添加 // 添加
@ -54,15 +54,11 @@ class BaseStore<B> implements BaseStoreInterface<B> {
// 获取列表 // 获取列表
async getlist() { async getlist() {
let res = await baseHttp.get(this.urlConfig.LIST, { let res = await baseHttp.get(this.urlConfig.LIST, {
pageNum: this.page?.PageNum | 1, pageIndex: this.page?.PageNum ?? 1,
pageSize: this.page?.PageSize | 20, pageSize: this.page?.PageSize ?? 20,
isSelf:0 isSelf: 0
}); });
console.log(this.page?.PageNum)
this.page = {
PageNum: res.data?.pageNum,
PageSize: res.data?.pageSize
}
let data: Array<B> = [] let data: Array<B> = []
if (!res.data.records) { if (!res.data.records) {
runInAction(() => { runInAction(() => {