黎海 2 місяців тому
батько
коміт
1d835fdb90
2 змінених файлів з 51 додано та 123 видалено
  1. 0 7
      src/pages/home/home.js
  2. 51 116
      src/pages/projectDetail/projectDetail.js

+ 0 - 7
src/pages/home/home.js

@@ -443,13 +443,6 @@ const Home = forwardRef((props, ref) => {
443 443
                                 >
444 444
                                   复制文案
445 445
                                 </Button>
446
-                                <Button
447
-                                  variant="outline-success"
448
-                                  size="sm"
449
-                                  onClick={() => downloadPlainText(project.id, project.title)}
450
-                                >
451
-                                  下载文案
452
-                                </Button>
453 446
                                 {project.audio_path && (
454 447
                                   <Button
455 448
                                     variant="outline-info"

+ 51 - 116
src/pages/projectDetail/projectDetail.js

@@ -1881,33 +1881,8 @@ const ProjectDetail = () => {
1881 1881
             >
1882 1882
               返回列表
1883 1883
             </Button>
1884
-            {showAudioPlayer && projectAudioPath && projectAudioPath.trim() !== '' && (
1885
-              <div className="project-audio-container mb-3">
1886
-                <AudioPlayerComponent
1887
-                  audioPath={projectAudioPath}
1888
-                  label="项目音频"
1889
-                  onPlay={() => console.log('项目音频开始播放')}
1890
-                  onPause={() => console.log('项目音频暂停播放')}
1891
-                />
1892
-              </div>
1893
-            )}
1894 1884
           </div>
1895 1885
           <div className="d-flex">
1896
-
1897
-            <Button
1898
-              variant="danger"
1899
-              onClick={showDeleteConfirmation}
1900
-              className="me-2"
1901
-            >
1902
-              删除项目
1903
-            </Button>
1904
-            <Button
1905
-              variant="info"
1906
-              onClick={() => setShowUploadProjectAudioModal(true)}
1907
-              className="me-2"
1908
-            >
1909
-              {projectAudioPath ? '更新项目音频' : '上传项目音频'}
1910
-            </Button>
1911 1886
             {selectedSegments.length > 1 && (
1912 1887
               <Button
1913 1888
                 variant="primary"
@@ -1922,16 +1897,61 @@ const ProjectDetail = () => {
1922 1897
 
1923 1898
         {project ? (
1924 1899
           <div className="project-detail-container mt-4">
1925
-            {/* 项目画风选择 */}
1900
+            {/* 项目资源和画风设置 */}
1926 1901
             <Card className="mb-4">
1927 1902
               <Card.Header>
1928
-                <h5 className="mb-0">项目画风设置</h5>
1903
+                <h5 className="mb-0">项目资源与画风设置</h5>
1929 1904
               </Card.Header>
1930 1905
               <Card.Body>
1931 1906
                 <Row className="align-items-center">
1907
+                  {/* 项目音频 */}
1908
+                  <Col md={4}>
1909
+                    <Form.Group>
1910
+                      <Form.Label>项目音频</Form.Label>
1911
+                      {projectAudioPath && projectAudioPath.trim() !== '' ? (
1912
+                        <div className="project-audio-container">
1913
+                          <AudioPlayerComponent
1914
+                            audioPath={projectAudioPath}
1915
+                            label="音频文件"
1916
+                            onPlay={() => console.log('项目音频开始播放')}
1917
+                            onPause={() => console.log('项目音频暂停播放')}
1918
+                          />
1919
+                        </div>
1920
+                      ) : (
1921
+                        <Alert variant="warning" className="mb-0">
1922
+                          <small>暂无项目音频</small>
1923
+                        </Alert>
1924
+                      )}
1925
+                    </Form.Group>
1926
+                  </Col>
1927
+                  
1928
+                  {/* 项目视频 */}
1932 1929
                   <Col md={4}>
1933 1930
                     <Form.Group>
1934
-                      <Form.Label>选择项目画风</Form.Label>
1931
+                      <Form.Label>对口型视频</Form.Label>
1932
+                      {project.video_path && project.video_path.trim() !== '' ? (
1933
+                        <div className="project-video-container">
1934
+                          <video 
1935
+                            className="w-100" 
1936
+                            controls 
1937
+                            src={project.video_path}
1938
+                            style={{ maxHeight: '150px' }}
1939
+                          >
1940
+                            您的浏览器不支持视频播放
1941
+                          </video>
1942
+                        </div>
1943
+                      ) : (
1944
+                        <Alert variant="warning" className="mb-0">
1945
+                          <small>暂无对口型视频</small>
1946
+                        </Alert>
1947
+                      )}
1948
+                    </Form.Group>
1949
+                  </Col>
1950
+                  
1951
+                  {/* 项目画风选择 */}
1952
+                  <Col md={4}>
1953
+                    <Form.Group>
1954
+                      <Form.Label>项目画风</Form.Label>
1935 1955
                       <InputGroup>
1936 1956
                         <Form.Select
1937 1957
                           value={selectedStyle}
@@ -1960,17 +1980,10 @@ const ProjectDetail = () => {
1960 1980
                         </Button>
1961 1981
                       </InputGroup>
1962 1982
                       <Form.Text className="text-muted">
1963
-                        选择的画风将应用于整个项目生成的图像中
1983
+                        选择的画风将应用于生成的图像中
1964 1984
                       </Form.Text>
1965 1985
                     </Form.Group>
1966 1986
                   </Col>
1967
-                  <Col md={8}>
1968
-                    {selectedStyle && (
1969
-                      <Alert variant="info" className="mb-0 mt-md-0 mt-3">
1970
-                        <small>当前选择的画风: <strong>{selectedStyle}</strong></small>
1971
-                      </Alert>
1972
-                    )}
1973
-                  </Col>
1974 1987
                 </Row>
1975 1988
               </Card.Body>
1976 1989
             </Card>
@@ -2067,9 +2080,7 @@ const ProjectDetail = () => {
2067 2080
                           <th width="5%">ID</th>
2068 2081
                           <th width="25%">文本内容</th>
2069 2082
                           <th width="25%">描述词</th>
2070
-                          <th width="12%">音频</th>
2071 2083
                           <th width="12%">图片</th>
2072
-                          <th width="12%">口播视频</th>
2073 2084
                           <th width="10%">操作</th>
2074 2085
                         </tr>
2075 2086
                       </thead>
@@ -2166,45 +2177,7 @@ const ProjectDetail = () => {
2166 2177
                                 </div>
2167 2178
                               )}
2168 2179
                             </td>
2169
-                            <td>
2170
-                              {segment.audio_path ? (
2171
-                                <div className="media-cell">
2172
-                                  <OverlayTrigger
2173
-                                    placement="top"
2174
-                                    overlay={<Tooltip>点击播放</Tooltip>}
2175
-                                  >
2176
-                                    <Button
2177
-                                      variant="outline-success"
2178
-                                      size="sm"
2179
-                                      onClick={() => {/* 播放音频功能 */ }}
2180
-                                      className="me-2"
2181
-                                    >
2182
-                                      播放
2183
-                                    </Button>
2184
-                                  </OverlayTrigger>
2185
-                                  <OverlayTrigger
2186
-                                    placement="top"
2187
-                                    overlay={<Tooltip>重新上传</Tooltip>}
2188
-                                  >
2189
-                                    <Button
2190
-                                      variant="outline-secondary"
2191
-                                      size="sm"
2192
-                                      onClick={() => showUploadModalFor(segment.id, 'audio')}
2193
-                                    >
2194
-                                      更新
2195
-                                    </Button>
2196
-                                  </OverlayTrigger>
2197
-                                </div>
2198
-                              ) : (
2199
-                                <Button
2200
-                                  variant="outline-secondary"
2201
-                                  size="sm"
2202
-                                  onClick={() => showUploadModalFor(segment.id, 'audio')}
2203
-                                >
2204
-                                  上传
2205
-                                </Button>
2206
-                              )}
2207
-                            </td>
2180
+                            
2208 2181
                             <td>
2209 2182
                               {segment.image_path ? (
2210 2183
                                 <div className="media-cell">
@@ -2282,45 +2255,7 @@ const ProjectDetail = () => {
2282 2255
                                 </div>
2283 2256
                               )}
2284 2257
                             </td>
2285
-                            <td>
2286
-                              {segment.video_path ? (
2287
-                                <div className="media-cell">
2288
-                                  <OverlayTrigger
2289
-                                    placement="top"
2290
-                                    overlay={<Tooltip>点击播放</Tooltip>}
2291
-                                  >
2292
-                                    <Button
2293
-                                      variant="outline-success"
2294
-                                      size="sm"
2295
-                                      onClick={() => {/* 播放视频功能 */ }}
2296
-                                      className="me-2"
2297
-                                    >
2298
-                                      播放
2299
-                                    </Button>
2300
-                                  </OverlayTrigger>
2301
-                                  <OverlayTrigger
2302
-                                    placement="top"
2303
-                                    overlay={<Tooltip>重新上传</Tooltip>}
2304
-                                  >
2305
-                                    <Button
2306
-                                      variant="outline-secondary"
2307
-                                      size="sm"
2308
-                                      onClick={() => showUploadModalFor(segment.id, 'video')}
2309
-                                    >
2310
-                                      更新
2311
-                                    </Button>
2312
-                                  </OverlayTrigger>
2313
-                                </div>
2314
-                              ) : (
2315
-                                <Button
2316
-                                  variant="outline-secondary"
2317
-                                  size="sm"
2318
-                                  onClick={() => showUploadModalFor(segment.id, 'video')}
2319
-                                >
2320
-                                  上传
2321
-                                </Button>
2322
-                              )}
2323
-                            </td>
2258
+                            
2324 2259
                             <td>
2325 2260
                               <Dropdown>
2326 2261
                                 <Dropdown.Toggle variant="outline-secondary" size="sm" id={`dropdown-${segment.id}`}>