|
|
|
|
@ -10,7 +10,7 @@ import {
|
|
|
|
|
getImportComponentInfo,
|
|
|
|
|
importComponent
|
|
|
|
|
} from '@/api/componentBase';
|
|
|
|
|
import { getReviewGroupByNew } from '@/api/componentMarket';
|
|
|
|
|
import { getReviewGroupByNew, deleteComponentMarket } from '@/api/componentMarket';
|
|
|
|
|
import { componentRelease, componentRevoke } from '@/api/componentRelease';
|
|
|
|
|
import { ComponentItem } from '@/api/interface';
|
|
|
|
|
import AddComponentModal from '@/pages/componentDevelopment/componentList/addComponentModal';
|
|
|
|
|
@ -215,6 +215,7 @@ const GlobalVarContainer = () => {
|
|
|
|
|
setOffSaleComponent(row);
|
|
|
|
|
setShowOffSaleModal(true);
|
|
|
|
|
}}
|
|
|
|
|
onCancelPublish={handleCancelPublish}
|
|
|
|
|
onRowDel={(row) => {
|
|
|
|
|
// 显示确认框
|
|
|
|
|
Modal.confirm({
|
|
|
|
|
@ -293,6 +294,30 @@ const GlobalVarContainer = () => {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 取消发布组件
|
|
|
|
|
const handleCancelPublish = async (row: ComponentItem) => {
|
|
|
|
|
Modal.confirm({
|
|
|
|
|
title: '确认取消发布',
|
|
|
|
|
content: `确定要取消发布组件 "${row.name}" 吗?取消后该组件将从组件市场下架。`,
|
|
|
|
|
okButtonProps: { status: 'warning' },
|
|
|
|
|
onOk: async () => {
|
|
|
|
|
try {
|
|
|
|
|
const res: any = await deleteComponentMarket(row.id);
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
Message.success('取消发布成功');
|
|
|
|
|
// 重新获取数据以更新状态
|
|
|
|
|
fetchComponentData();
|
|
|
|
|
} else {
|
|
|
|
|
Message.error(res.message || '取消发布失败');
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('取消发布失败:', error);
|
|
|
|
|
Message.error('取消发布失败');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 处理导入组件 - 文件选择后获取组件信息
|
|
|
|
|
const handleImportFileSelect = async (file: File) => {
|
|
|
|
|
try {
|
|
|
|
|
|