5.9 高质量运营优化

This commit is contained in:
jl-zhoujl2
2023-05-09 09:56:52 +08:00
parent c47f65dc36
commit 10bb13b13e
3 changed files with 29 additions and 14 deletions

View File

@ -6,10 +6,12 @@ import React, { useState } from 'react';
import { useRef } from 'react';
import EventMaintenanceModal from './components/EventMaintenanceModal';
import { changeEventStatus, deleteEvent, getEventList } from './service';
import { managerAuthority } from '../../utils';
import { authCheck, managerAuthority } from '../../utils';
const EventMaintenance: React.FC<{}> = () => {
const actionRef = useRef<ActionType>();
//权限校验
const auth = useRef<boolean>(authCheck(["ebtp-party-admin"]));
//新建 编辑 查看
const [modalVisible, setModalVisible] = useState<boolean>(false);
//行数据
@ -192,23 +194,20 @@ const EventMaintenance: React.FC<{}> = () => {
actionRef={actionRef}
loading={loading}
request={async (params) => {
setLoading(true);
return await getEventList(params).then(res => {
if (res?.success) {
if (auth.current) {
setLoading(true);
return await getEventList(params).then(res => {
return {
data: res?.data.records,
success: res?.success,
total: res?.data.total
};
}
return {
data: [],
success: false,
total: 0,
};
}).finally(() => {
setLoading(false);
})
}).finally(() => {
setLoading(false);
})
} else {
return {};
}
}}
rowKey="id"
options={false}