Merge branch 'main' of https://gitee.com/wg123/video-gen
This commit is contained in:
-442
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3
-3
File diff suppressed because one or more lines are too long
-442
File diff suppressed because one or more lines are too long
-442
File diff suppressed because one or more lines are too long
Vendored
+39
-5
@@ -1,3 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
@@ -29,9 +30,42 @@
|
||||
})();
|
||||
</script>
|
||||
<script type="module" crossorigin src="/assets/index-CD-m81KU.js"></script>
|
||||
=======
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap" rel="stylesheet" />
|
||||
<title>民众智创</title>
|
||||
<script>
|
||||
(function() {
|
||||
var cached = localStorage.getItem('siteInfo');
|
||||
if (cached) {
|
||||
try {
|
||||
var info = JSON.parse(cached);
|
||||
if (info.siteName) {
|
||||
document.title = info.siteName;
|
||||
}
|
||||
if (info.siteLogo) {
|
||||
var link = document.querySelector('link[rel="icon"]');
|
||||
if (link) {
|
||||
link.href = info.siteLogo;
|
||||
link.type = 'image/png';
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<script type="module" crossorigin src="/assets/index-CebEVS-b.js"></script>
|
||||
>>>>>>> 44aba3516b2577101e2bf90ad9e652009d7fd7d5
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-Bi8mcSs8.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>␍
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -55,17 +55,14 @@ const PreResultDisplay: React.FC<PreResultDisplayProps> = ({ preResult }) => {
|
||||
if (!config) return null;
|
||||
const value = parsedData[key as keyof PreResultData];
|
||||
const isYes = value === 'YES';
|
||||
const isNo = value === 'NO';
|
||||
const isUnknown = value === 'UNKNOWN';
|
||||
if (isUnknown) return null;
|
||||
let displayLabel, displayColor;
|
||||
// if (isUnknown) {
|
||||
// displayLabel = config.unknownLabel;
|
||||
// displayColor = config.unknownColor;
|
||||
// } else
|
||||
|
||||
if (isYes) {
|
||||
displayLabel = config.label;
|
||||
displayColor = config.yesColor;
|
||||
} else {
|
||||
} else if (isNo) {
|
||||
displayLabel = config.noLabel;
|
||||
displayColor = config.noColor;
|
||||
}
|
||||
@@ -102,15 +99,14 @@ const PreResultDisplay: React.FC<PreResultDisplayProps> = ({ preResult }) => {
|
||||
{fieldConfig.map(config => {
|
||||
const value = parsedData[config.key as keyof PreResultData];
|
||||
const isYes = value === 'YES';
|
||||
const isNo = value === 'NO';
|
||||
const isUnknown = value === 'UNKNOWN';
|
||||
if (isUnknown) return null;
|
||||
let displayLabel, displayColor;
|
||||
if (isUnknown) {
|
||||
displayLabel = config.unknownLabel;
|
||||
displayColor = config.unknownColor;
|
||||
} else if (isYes) {
|
||||
if (isYes) {
|
||||
displayLabel = config.label;
|
||||
displayColor = config.yesColor;
|
||||
} else {
|
||||
} else if (isNo) {
|
||||
displayLabel = config.noLabel;
|
||||
displayColor = config.noColor;
|
||||
}
|
||||
|
||||
@@ -171,6 +171,27 @@ const GeneratedRecord: React.FC = () => {
|
||||
const hasGeneratedResourceId = (item: any): boolean => {
|
||||
return Boolean(item.generatedResourceId);
|
||||
};
|
||||
// 检查视频尺寸是否符合480p要求(270×480或480×270)
|
||||
const checkVideoSize = (imagePx: string): boolean => {
|
||||
if (!imagePx) return true;
|
||||
const match = imagePx.match(/^(\d+)x(\d+)$/);
|
||||
if (!match) return true;
|
||||
const width = parseInt(match[1], 10);
|
||||
const height = parseInt(match[2], 10);
|
||||
const aspectRatio = width / height;
|
||||
const isLandscape = width >= height;
|
||||
if (isLandscape) {
|
||||
const isValidWidth = width >= 480 && width <= 2560;
|
||||
const isValidHeight = height >= 270 && height <= 1440;
|
||||
const isValidRatio = aspectRatio >= 1.775 && aspectRatio <= 1.784;
|
||||
return isValidWidth && isValidHeight && isValidRatio;
|
||||
} else {
|
||||
const isValidWidth = width >= 270 && width <= 1440;
|
||||
const isValidHeight = height >= 480 && height <= 2560;
|
||||
const isValidRatio = aspectRatio >= 0.555 && aspectRatio <= 0.564;
|
||||
return isValidWidth && isValidHeight && isValidRatio;
|
||||
}
|
||||
};
|
||||
// 多选相关函数
|
||||
const handleToggleSelect = (itemId: string) => {
|
||||
setSelectedItems(prev => {
|
||||
@@ -654,6 +675,7 @@ const GeneratedRecord: React.FC = () => {
|
||||
if (item.videoUrl && item.videoUrl.trim()) {
|
||||
const dimensions = await getVideoDimensions(item.videoUrl);
|
||||
if (dimensions) {
|
||||
console.log(dimensions);
|
||||
item.imagePx = dimensions;
|
||||
}
|
||||
}
|
||||
@@ -1091,33 +1113,51 @@ const GeneratedRecord: React.FC = () => {
|
||||
)}
|
||||
|
||||
{isSelectionMode && (
|
||||
<div
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: 8,
|
||||
left: 8,
|
||||
width: 20,
|
||||
height: 20,
|
||||
borderRadius: '50%',
|
||||
backgroundColor: isSelectedItem ? '#10b981' : 'rgba(255,255,255,0.9)',
|
||||
border: isSelectedItem ? '2px solid #10b981' : '2px solid #d1d5db',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
cursor: 'pointer',
|
||||
zIndex: 10,
|
||||
}}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
handleToggleSelect(getItemResourceId(item));
|
||||
}}
|
||||
>
|
||||
{isSelectedItem && (
|
||||
<svg width={12} height={12} viewBox="0 0 12 12" fill="none">
|
||||
<path d="M10 3L4.5 8.5L2 6" stroke="white" strokeWidth={2} strokeLinecap="round" strokeLinejoin="round" />
|
||||
</svg>
|
||||
<>
|
||||
<div
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: 8,
|
||||
left: 8,
|
||||
width: 20,
|
||||
height: 20,
|
||||
borderRadius: '50%',
|
||||
backgroundColor: isSelectedItem ? '#10b981' : 'rgba(255,255,255,0.9)',
|
||||
border: isSelectedItem ? '2px solid #10b981' : '2px solid #d1d5db',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
cursor: 'pointer',
|
||||
zIndex: 10,
|
||||
}}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
handleToggleSelect(getItemResourceId(item));
|
||||
}}
|
||||
>
|
||||
{isSelectedItem && (
|
||||
<svg width={12} height={12} viewBox="0 0 12 12" fill="none">
|
||||
<path d="M10 3L4.5 8.5L2 6" stroke="white" strokeWidth={2} strokeLinecap="round" strokeLinejoin="round" />
|
||||
</svg>
|
||||
)}
|
||||
</div>
|
||||
{isSelectedItem && filterMedia === 'video' && item.imagePx && !checkVideoSize(item.imagePx) && (
|
||||
<div style={{
|
||||
position: 'absolute',
|
||||
top: 36,
|
||||
left: 8,
|
||||
right: 8,
|
||||
padding: '4px 8px',
|
||||
backgroundColor: 'rgba(239, 68, 68, 0.9)',
|
||||
color: '#fff',
|
||||
fontSize: 10,
|
||||
borderRadius: 4,
|
||||
zIndex: 10,
|
||||
}}>
|
||||
视频实际尺寸可能不符合推送要求
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
{!isSelectionMode && (
|
||||
|
||||
Reference in New Issue
Block a user