ai创建修改
This commit is contained in:
@@ -34,6 +34,7 @@ const GenerateConver: React.FC = () => {
|
||||
const [currentPage, setCurrentPage] = useState(1);
|
||||
const [pageSize, setPageSize] = useState(20);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [searchKeyword, setSearchKeyword] = useState('');
|
||||
|
||||
// 卡片列表专用状态
|
||||
const [cardData, setCardData] = useState<any[]>([]);
|
||||
@@ -114,8 +115,8 @@ const GenerateConver: React.FC = () => {
|
||||
};
|
||||
|
||||
// 获取列表数据的函数
|
||||
const fetchList = (page: number, size: number, isPolling = false) => {
|
||||
getReplicationList(page, size).then((res: any) => {
|
||||
const fetchList = (page: number, size: number, isPolling = false, keyword?: string) => {
|
||||
getReplicationList(page, size, keyword).then((res: any) => {
|
||||
if (res.items) {
|
||||
if (isPolling) {
|
||||
// 轮询时:增量更新,只更新状态发生变化的项目
|
||||
@@ -139,7 +140,7 @@ const GenerateConver: React.FC = () => {
|
||||
// 如果有 processing 状态且轮询未启动,启动轮询
|
||||
if (hasProcessing && !tablePollingTimer.current) {
|
||||
tablePollingTimer.current = setInterval(() => {
|
||||
fetchList(currentPage, pageSize, true);
|
||||
fetchList(currentPage, pageSize, true, searchKeyword);
|
||||
}, 5000);
|
||||
}
|
||||
// 如果没有 processing 状态且轮询正在运行,停止轮询
|
||||
@@ -177,7 +178,13 @@ const GenerateConver: React.FC = () => {
|
||||
const handlePageChange = (page: number, size: number) => {
|
||||
setCurrentPage(page);
|
||||
setPageSize(size);
|
||||
fetchList(page, size);
|
||||
fetchList(page, size, false, searchKeyword);
|
||||
};
|
||||
|
||||
// 搜索处理
|
||||
const handleSearch = () => {
|
||||
setCurrentPage(1);
|
||||
fetchList(1, pageSize, false, searchKeyword);
|
||||
};
|
||||
|
||||
// 文件上传前校验
|
||||
@@ -205,7 +212,7 @@ const GenerateConver: React.FC = () => {
|
||||
resolve(false);
|
||||
return;
|
||||
}
|
||||
if (video.duration > 15) {
|
||||
if (video.duration >= 16) {
|
||||
message.error('视频时长不能超过15秒');
|
||||
URL.revokeObjectURL(video.src);
|
||||
resolve(false);
|
||||
@@ -489,13 +496,14 @@ const GenerateConver: React.FC = () => {
|
||||
key={item.id}
|
||||
style={{
|
||||
background: 'rgba(255,255,255,0.9)',
|
||||
border: '1px solid rgba(99, 102, 241, 0.6)',
|
||||
backdropFilter: 'blur(10px)',
|
||||
borderRadius: 16,
|
||||
overflow: 'hidden',
|
||||
boxShadow: '0 4px 16px rgba(99, 102, 241, 0.06)',
|
||||
cursor: 'pointer',
|
||||
transition: 'transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1)',
|
||||
border: '1px solid rgba(99, 102, 241, 0.06)',
|
||||
// border: '1px solid rgba(99, 102, 241, 0.06)',
|
||||
}}
|
||||
onClick={() => navigate(`/initial/${item.id}/initialinfo`)}
|
||||
onMouseEnter={(e) => {
|
||||
@@ -1146,6 +1154,9 @@ const GenerateConver: React.FC = () => {
|
||||
<div style={{ display: 'flex', justifyContent: 'flex-end', margin: '16px 24px', flexShrink: 0 }}>
|
||||
<Input
|
||||
placeholder="搜索产品名称"
|
||||
value={searchKeyword}
|
||||
onChange={(e) => setSearchKeyword(e.target.value)}
|
||||
onPressEnter={handleSearch}
|
||||
style={{
|
||||
width: 220,
|
||||
borderRadius: 10,
|
||||
@@ -1156,6 +1167,7 @@ const GenerateConver: React.FC = () => {
|
||||
/>
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={handleSearch}
|
||||
style={{
|
||||
borderRadius: 10,
|
||||
background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)',
|
||||
|
||||
Reference in New Issue
Block a user