5c45629495
CI/CD Pipeline / Check if frontend-only change (push) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (push) Successful in 1s
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Frontend Lint (push) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 3s
CI/CD Pipeline / PR Build API Image (push) Has been skipped
CI/CD Pipeline / PR Build Web Image (push) Has been skipped
CI/CD Pipeline / PR Build Worker Image (push) Has been skipped
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been skipped
CI/CD Pipeline / Validate - Code Quality (pull_request) Has been skipped
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Has been skipped
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Has been skipped
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Check push changed paths (push) Successful in 4m37s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 4m37s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 4m50s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 5m5s
AI Code Review / AI Code Review (pull_request) Successful in 7m56s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 4m40s
CI/CD Pipeline / Build Staging API Image (push) Has been skipped
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
PR Automation / Auto Approve on CI Green (pull_request) Successful in 8m15s
CI/CD Pipeline / Build Staging Worker Image (push) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Validate - Code Quality (push) Successful in 8m37s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / PR Build Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (push) Successful in 1m48s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 1m55s
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 10m20s
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (push) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 2m1s
CI/CD Pipeline / Retag skipped Staging API Image (push) Successful in 2m18s
CI/CD Pipeline / CI Gate (pull_request) Successful in 1m49s
CI/CD Pipeline / Retag skipped Staging Worker Image (push) Successful in 2m16s
CI/CD Pipeline / Integration Tests (push) Successful in 4m27s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 1m0s
CI/CD Pipeline / Unit Tests (push) Successful in 15m57s
CI/CD Pipeline / Build Production API Image (push) Has been skipped
CI/CD Pipeline / CI Gate (push) Has been skipped
CI/CD Pipeline / Build Production Web Image (push) Has been skipped
CI/CD Pipeline / Build Production Worker Image (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 2m25s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 4m10s
CI/CD Pipeline / Canary Release to Production (push) Has been skipped
CI/CD Pipeline / Staging E2E Tests (push) Successful in 4m44s
Co-authored-by: xiaoxia <dev@xiaoxiajianji.com> Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
172 lines
4.3 KiB
TypeScript
172 lines
4.3 KiB
TypeScript
/**
|
|
* AssetLibrary 弹窗集合
|
|
*/
|
|
import React from "react"
|
|
import type { AssetItem, AssetKind } from "../types"
|
|
import type { SmartViewType } from "./BatchMarkModal"
|
|
import type { BatchOperationResult } from "@/api/assets"
|
|
import CreateLibraryModal from "./CreateLibraryModal"
|
|
import PlayModal from "./PlayModal"
|
|
import BatchTagModal from "./BatchTagModal"
|
|
import BatchClassifyModal from "./BatchClassifyModal"
|
|
import BatchMarkModal from "./BatchMarkModal"
|
|
import ResultDrawer from "./ResultDrawer"
|
|
|
|
export interface AssetModalsProps {
|
|
/* 上传进度 */
|
|
|
|
/* 新建视频库 */
|
|
createModalOpen: boolean
|
|
onCreateModalCancel: () => void
|
|
onCreateModalOk: () => void
|
|
newLibName: string
|
|
onNewLibNameChange: (name: string) => void
|
|
newLibKind: AssetKind
|
|
onNewLibKindChange: (kind: AssetKind) => void
|
|
createLoading: boolean
|
|
|
|
/* 播放弹窗 */
|
|
playingAsset: AssetItem | null
|
|
onPlayClose: () => void
|
|
|
|
/* 批量打标签 */
|
|
tagModalOpen: boolean
|
|
selectedCount: number
|
|
onTagCancel: () => void
|
|
onTagOk: () => void
|
|
batchTags: string[]
|
|
batchTagInput: string
|
|
onTagInputChange: (val: string) => void
|
|
onTagInputKeyDown: (e: React.KeyboardEvent) => void
|
|
onRemoveTag: (tag: string) => void
|
|
tagMode: "add" | "replace"
|
|
onTagModeChange: (mode: "add" | "replace") => void
|
|
batchLoading: boolean
|
|
|
|
/* 批量改分类 */
|
|
classifyModalOpen: boolean
|
|
onClassifyCancel: () => void
|
|
onClassifyOk: () => void
|
|
batchCategory: string
|
|
onCategoryChange: (val: string) => void
|
|
|
|
/* 批量智能标记 */
|
|
markModalOpen: boolean
|
|
onMarkCancel: () => void
|
|
onMarkOk: () => void
|
|
batchSmartView: SmartViewType
|
|
onSmartViewChange: (val: SmartViewType) => void
|
|
|
|
/* 操作结果 Drawer */
|
|
resultDrawerOpen: boolean
|
|
operationTitle: string
|
|
operationResult: BatchOperationResult | null
|
|
onResultDrawerClose: () => void
|
|
}
|
|
|
|
export const AssetModals: React.FC<AssetModalsProps> = ({
|
|
createModalOpen,
|
|
onCreateModalCancel,
|
|
onCreateModalOk,
|
|
newLibName,
|
|
onNewLibNameChange,
|
|
newLibKind,
|
|
onNewLibKindChange,
|
|
createLoading,
|
|
playingAsset,
|
|
onPlayClose,
|
|
tagModalOpen,
|
|
selectedCount,
|
|
onTagCancel,
|
|
onTagOk,
|
|
batchTags,
|
|
batchTagInput,
|
|
onTagInputChange,
|
|
onTagInputKeyDown,
|
|
onRemoveTag,
|
|
tagMode,
|
|
onTagModeChange,
|
|
batchLoading,
|
|
classifyModalOpen,
|
|
onClassifyCancel,
|
|
onClassifyOk,
|
|
batchCategory,
|
|
onCategoryChange,
|
|
markModalOpen,
|
|
onMarkCancel,
|
|
onMarkOk,
|
|
batchSmartView,
|
|
onSmartViewChange,
|
|
resultDrawerOpen,
|
|
operationTitle,
|
|
operationResult,
|
|
onResultDrawerClose,
|
|
}) => {
|
|
return (
|
|
<>
|
|
{/* 新建视频库弹窗 */}
|
|
<CreateLibraryModal
|
|
open={createModalOpen}
|
|
onCancel={onCreateModalCancel}
|
|
onOk={onCreateModalOk}
|
|
name={newLibName}
|
|
onNameChange={onNewLibNameChange}
|
|
kind={newLibKind}
|
|
onKindChange={onNewLibKindChange}
|
|
confirmLoading={createLoading}
|
|
/>
|
|
|
|
{/* 视频/音频播放弹窗 */}
|
|
<PlayModal open={!!playingAsset} asset={playingAsset} onClose={onPlayClose} />
|
|
|
|
{/* 批量打标签弹窗 */}
|
|
<BatchTagModal
|
|
open={tagModalOpen}
|
|
selectedCount={selectedCount}
|
|
onCancel={onTagCancel}
|
|
onOk={onTagOk}
|
|
tags={batchTags}
|
|
onTagInputChange={onTagInputChange}
|
|
onTagInputKeyDown={onTagInputKeyDown}
|
|
onRemoveTag={onRemoveTag}
|
|
tagInput={batchTagInput}
|
|
tagMode={tagMode}
|
|
onTagModeChange={onTagModeChange}
|
|
confirmLoading={batchLoading}
|
|
/>
|
|
|
|
{/* 批量改分类弹窗 */}
|
|
<BatchClassifyModal
|
|
open={classifyModalOpen}
|
|
selectedCount={selectedCount}
|
|
onCancel={onClassifyCancel}
|
|
onOk={onClassifyOk}
|
|
category={batchCategory}
|
|
onCategoryChange={onCategoryChange}
|
|
confirmLoading={batchLoading}
|
|
/>
|
|
|
|
{/* 批量智能标记弹窗 */}
|
|
<BatchMarkModal
|
|
open={markModalOpen}
|
|
selectedCount={selectedCount}
|
|
onCancel={onMarkCancel}
|
|
onOk={onMarkOk}
|
|
smartView={batchSmartView}
|
|
onSmartViewChange={onSmartViewChange}
|
|
confirmLoading={batchLoading}
|
|
/>
|
|
|
|
{/* 操作结果 Drawer */}
|
|
<ResultDrawer
|
|
open={resultDrawerOpen}
|
|
title={operationTitle}
|
|
result={operationResult}
|
|
onClose={onResultDrawerClose}
|
|
/>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default AssetModals
|