7 Revize fc666e004b ... 6065d1b195

Autor SHA1 Zpráva Datum
  ethanfly 6065d1b195 Merge fix/bug-6160-6151-6142-6138 před 2 týdny
  ethanfly 149791c84b Merge fix/bug-6164-6163-6162 před 2 týdny
  ethanfly 63c92d346a fix #6151: Platform详情点击无反应,移除.stop.prevent事件修饰符; fix #6160: 作品数据统一使用playCount字段,保持与总览一致 před 2 týdny
  ethanfly bdebfb3307 fix #6163: 视频号发布时添加描述内容拼接在标题下方 před 2 týdny
  ethanfly ca9dd1cb11 fix #6164: 导出Excel时updateTime使用formatUpdateTime保持与列表一致 před 2 týdny
  ethanfly 76af28b39f fix #6166: 修复发布详情页描述文字多时样式乱掉的问题 před 2 týdny
  ethanfly d688f3471d fix #6165: 修复发布任务状态一直显示'发布中'的问题 před 2 týdny

+ 1 - 1
client/src/views/Analytics/Platform/index.vue

@@ -85,7 +85,7 @@
             <el-button 
               type="primary" 
               link 
-              @click.stop.prevent="handleDetail(row)"
+              @click="handleDetail(row)"
             >
               详情
             </el-button>

+ 16 - 1
client/src/views/Publish/index.vue

@@ -286,7 +286,11 @@
         <div v-if="taskDetail?.results?.length" class="publish-results">
           <h4>发布结果</h4>
           <el-table :data="taskDetail.results" size="small">
-            <el-table-column label="账号" prop="accountId" width="80" />
+            <el-table-column label="账号" width="120">
+              <template #default="{ row }">
+                {{ getAccountName(row.accountId) }}
+              </template>
+            </el-table-column>
             <el-table-column label="平台" width="100">
               <template #default="{ row }">
                 {{ getPlatformName(row.platform) }}
@@ -742,6 +746,11 @@ function getPlatformName(platform: PlatformType) {
   return PLATFORMS[platform]?.name || platform;
 }
 
+function getAccountName(accountId: number): string {
+  const account = accounts.value.find(a => a.id === accountId);
+  return account?.accountName || `账号${accountId}`;
+}
+
 // 根据 targetAccounts 获取关联的平台列表(Bug #6066: 显示渠道)
 function getTaskPlatforms(task: PublishTask): PlatformType[] {
   const ids = new Set(task.targetAccounts || []);
@@ -1292,4 +1301,10 @@ watch(showCreateDialog, (visible) => {
     padding-left: 8px;
   }
 }
+
+:deep(.el-descriptions__cell) {
+  .el-descriptions-item__content {
+    word-break: break-word;
+  }
+}
 </style>

+ 6 - 1
server/python/platforms/weixin.py

@@ -556,6 +556,11 @@ class WeixinPublisher(BasePublisher):
         await self.page.locator("div.input-editor").click()
         await self.page.keyboard.type(params.title)
 
+        # 添加描述(换行后在标题下方)
+        if params.description:
+            await self.page.keyboard.press("Enter")
+            await self.page.keyboard.type(params.description)
+
         if params.tags:
             await self.page.keyboard.press("Enter")
             for tag in params.tags:
@@ -1653,7 +1658,7 @@ class WeixinPublisher(BasePublisher):
         page: 页码从 0 开始,或上一页返回的 rawKeyBuff/lastBuff 字符串
         """
         # 分页:首页 currentPage=1/rawKeyBuff=null,下一页用 currentPage 递增或 rawKeyBuff
-        if page is None or page == "" or (isinstance(page, int) and page == 0):
+        if page is None or page == "" or page == "0" or (isinstance(page, int) and page == 0):
             current_page = 1
             raw_key_buff = None
         elif isinstance(page, int):

+ 5 - 2
server/src/services/PublishService.ts

@@ -193,13 +193,16 @@ export class PublishService {
       throw new AppError('任务不存在', HTTP_STATUS.NOT_FOUND, ERROR_CODES.NOT_FOUND);
     }
     // 基于 PublishResult 记录重新计算任务状态(修复 #6068:删除账号后状态不一致)
+    // 修复 Bug #6165:当 task.status 为 'processing' 时也参与状态聚合,否则已完成的任务会一直显示"发布中"
     const results = task.results || [];
     const actualTargetAccounts = results.map(r => r.accountId);
     const completedResults = results.filter(r => r.status === 'success');
     const failedResults = results.filter(r => r.status === 'failed');
 
     let computedStatus = task.status;
-    if (results.length > 0 && task.status !== 'pending' && task.status !== 'processing' && task.status !== 'cancelled') {
+    if (results.length > 0 && task.status !== 'pending' && task.status !== 'cancelled') {
+      // 只有当任务尚未开始(pending)或已取消时,才保持原始状态
+      // 其他情况(processing 等)都根据 results 重新计算
       if (completedResults.length === results.length) {
         computedStatus = 'completed';
       } else if (failedResults.length === results.length) {
@@ -207,7 +210,7 @@ export class PublishService {
       } else if (completedResults.length + failedResults.length === results.length) {
         computedStatus = 'failed'; // 部分失败也标记为 failed(保持向后兼容)
       } else {
-        computedStatus = task.status;
+        computedStatus = task.status; // 仍有未完成的,保持原状态
       }
     }
 

+ 3 - 3
server/src/services/WorkDayStatisticsService.ts

@@ -589,7 +589,7 @@ export class WorkDayStatisticsService {
         likesCount: stat?.likesCount ?? 0,
         commentsCount: stat?.commentsCount ?? 0,
         collectsCount: stat?.collectsCount ?? 0,
-        updateTime: latestUpdate ? latestUpdate.toISOString() : undefined,
+        updateTime: latestUpdate ? this.formatUpdateTime(latestUpdate) : undefined,
       };
     });
 
@@ -883,7 +883,7 @@ export class WorkDayStatisticsService {
       const accountYesterdayLikes = yesterdayUds?.likeCount ?? 0;
       const accountYesterdayFansIncrease = yesterdayUds?.fansIncrease ?? 0;
 
-      const updateTime = (yesterdayUds?.updatedAt ?? account.updatedAt).toISOString();
+      const updateTime = this.formatUpdateTime(yesterdayUds?.updatedAt ?? account.updatedAt ?? new Date());
 
       accountList.push({
         id: account.id,
@@ -1413,7 +1413,7 @@ export class WorkDayStatisticsService {
       .addSelect('pa.avatarUrl', 'accountAvatar')
       .addSelect('w.status', 'workType')
       .addSelect('w.publish_time', 'publishTime')
-      .addSelect('COALESCE(w.yesterday_play_count, 0)', 'viewsCount')
+      .addSelect('COALESCE(w.playCount, 0)', 'viewsCount')
       .addSelect('COALESCE(w.yesterday_comment_count, 0)', 'commentsCount')
       .addSelect('COALESCE(w.yesterday_share_count, 0)', 'sharesCount')
       .addSelect('COALESCE(w.yesterday_collect_count, 0)', 'collectsCount')