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}
columns={props.columns}
dataSource={dataSource}
/>
);
};

View File

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

View File

@ -4,19 +4,19 @@ import { useState } from "react";
export const FormSelect = (v: FormDatas) => {
const [list] = useState([
{
value: 1,
value: "1",
label: "卡片一",
},
{
value: 2,
value: "2",
label: "卡片二",
},
{
value: 3,
value: "3",
label: "卡片三",
},
{
value: 4,
value: "4",
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;
endTime: any;
status: any;
}

View File

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

View File

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