import { Edit, PlayCircle, Trash2 } from "lucide-react"; import React, { useState, useMemo, useEffect } from "react"; import { Popconfirm } from "tdesign-react"; import { requestCrudService } from "@/service/request-axios-service"; import { format } from "date-fns"; import logoSvg from "@/assets/icon/轻应用logo-DB.svg"; interface analysisListItem { id: number; categoryName: string; category: string; appName: string; appDesc: string; appIcon: string; jumpUrl: string; appType: number; } const service = requestCrudService; const zncmUrl = import.meta.env.VITE_API_BASE_URL || ""; export const AppCard: React.FC<{ app: analysisListItem; isDark: boolean; hoverColor: string; btnClass: string; delDataChange: (item: analysisListItem) => void; editShowChange: (item: analysisListItem) => void; }> = ({ app, isDark, hoverColor, btnClass, delDataChange, editShowChange }) => { const listDataChange = (item: analysisListItem) => { historyCreateSearch(item); // if (item.appType === 1) { // internalDataChange(item); // } else if (item.appType === 2) { // externalDataChange(item); // } }; const internalDataChange = (item: analysisListItem) => { // 内部接口跳转 }; const externalDataChange = (item: analysisListItem) => { // 外部应用接口跳转 window.open(item.jumpUrl); }; const handleConfirm = (item: analysisListItem) => { // 确认删除逻辑 console.log("用户点击了确认"); delDataChange(item); return true; // 返回 true 表示确认执行 }; const handleCancel = () => { // 取消删除逻辑 console.log("用户点击了取消"); return true; // 返回 true 表示取消 }; const historyCreateSearch = async (item: analysisListItem) => { const time = format(new Date(), "yyyy-MM-dd HH:mm:ss"); console.log("time", time); const param = { appId: item.id, appName: item.appName, runTime: time, }; const res = await service.post(`${zncmUrl}/app/history/create`, param); console.log("res", res); }; return (
{app.appDesc}