5.9 高质量运营优化
This commit is contained in:
@ -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}
|
||||
|
Reference in New Issue
Block a user