Sfoglia il codice sorgente

恢复新闻网2026媒体华夏首页版式

回退红色二级模板首页媒体区块的尺寸联动渲染,避免媒体华夏被切换成媒体网格排版。

新增 HXCS 迁移,将新闻网-2026 首页子栏目“媒体华夏”的 wnlscode 恢复为 10000,保留 160x90 缩略图裁剪尺寸。

Validation:

- git diff --check -- WebRoot/web/upload/ffkj-template/college-red-index.jsp local-run/migrations/2026-08-29-006-restore-news2026-media-home-list-style.sql
非繁 3 mesi fa
parent
commit
e29a6d2b91

+ 2 - 8
WebRoot/web/upload/ffkj-template/college-red-index.jsp

@@ -38,7 +38,6 @@
 		.college-red-page .department-home-panel {
 			--college-red-home-record-height: 78px;
 			--college-red-home-thumb-width: 103px;
-			--college-red-home-thumb-height: 58px;
 		}
 		.college-red-page .department-home-panel .department-plain-list a,
 		.college-red-page .department-home-panel .department-section-graphic-list a,
@@ -53,8 +52,7 @@
 		}
 		.college-red-page .department-home-panel .department-section-thumb {
 			width: var(--college-red-home-thumb-width);
-			height: var(--college-red-home-thumb-height);
-			aspect-ratio: auto;
+			aspect-ratio: 16 / 9;
 		}
 		.college-red-page .department-home-panel.is-graphic-list .department-section-copy b,
 		.college-red-page .department-home-panel.is-media-grid .department-section-media-grid b {
@@ -389,11 +387,7 @@
 									<c:set var="sectionIsCarouselList" value="${sectionListStyleCode == 10020}"/>
 									<c:set var="sectionIsMediaGrid" value="${sectionListStyleCode == 10030 or sectionListStyleCode == 10050}"/>
 									<c:set var="sectionHref" value="${empty sectionNav.href ? sectionNav.url : sectionNav.href}"/>
-									<c:set var="sectionStyle" value=""/>
-									<c:if test="${sectionIsMediaGrid and not empty sectionNav.photo_size_width and not empty sectionNav.photo_size_height}">
-										<c:set var="sectionStyle" value="--college-red-home-thumb-width:${sectionNav.photo_size_width}px;--college-red-home-thumb-height:${sectionNav.photo_size_height}px;--college-red-home-record-height:${sectionNav.photo_size_height + 20}px;"/>
-									</c:if>
-									<article class="department-list-panel department-home-panel ${sectionIsGraphicList ? 'is-graphic-list' : ''} ${sectionIsCarouselList ? 'is-carousel-list' : ''} ${sectionIsMediaGrid ? 'is-media-grid' : ''}" style="${sectionStyle}">
+									<article class="department-list-panel department-home-panel ${sectionIsGraphicList ? 'is-graphic-list' : ''} ${sectionIsCarouselList ? 'is-carousel-list' : ''} ${sectionIsMediaGrid ? 'is-media-grid' : ''}">
 										<div class="department-section-title"><h2>${sectionNav.name}</h2><a href="${sectionHref}" target="${sectionNav.target}">查看更多</a></div>
 										<c:choose>
 											<c:when test="${sectionIsCarouselList}">

+ 64 - 0
local-run/migrations/2026-08-29-006-restore-news2026-media-home-list-style.sql

@@ -0,0 +1,64 @@
+-- Restore News2026 homepage "媒体华夏" to the previous plain-list layout.
+
+SET NAMES utf8mb4;
+USE sp_gzhx_apps;
+
+START TRANSACTION;
+
+SET @news2026_site_id := (
+  SELECT websiteid
+  FROM website
+  WHERE dcode = 61
+    AND name = '新闻网-2026'
+    AND FIND_IN_SET('xinwen2026.hxcs.feifan.net', REPLACE(TRIM(BOTH ';' FROM IFNULL(domains, '')), ';', ',')) > 0
+  ORDER BY websiteid
+  LIMIT 1
+);
+
+SET @news2026_media_nav_id := (
+  SELECT navigationid
+  FROM website_navigation
+  WHERE websiteid = @news2026_site_id
+    AND dcode = 61
+    AND name = '媒体华夏'
+    AND (
+      idcard = 'FFKJ_NEWS2026_HOME_MEDIA'
+      OR url = '/meiti/'
+    )
+  ORDER BY (idcard = 'FFKJ_NEWS2026_HOME_MEDIA') DESC, navigationid
+  LIMIT 1
+);
+
+SET @guard_sql := IF(
+  @news2026_site_id IS NOT NULL
+    AND @news2026_media_nav_id IS NOT NULL,
+  'SELECT 1',
+  'SELECT * FROM __news2026_media_nav_missing__'
+);
+PREPARE guard_stmt FROM @guard_sql;
+EXECUTE guard_stmt;
+DEALLOCATE PREPARE guard_stmt;
+
+UPDATE website_navigation
+SET wntcode = 10010,
+    wnscode = 10030,
+    wnjtcode = 10010,
+    wnlscode = 10000,
+    photo_size_width = 160,
+    photo_size_height = 90,
+    dcode = 61
+WHERE navigationid = @news2026_media_nav_id;
+
+SELECT
+  @news2026_site_id AS news2026_site_id,
+  navigationid,
+  name,
+  idcard,
+  url,
+  wnlscode,
+  photo_size_width,
+  photo_size_height
+FROM website_navigation
+WHERE navigationid = @news2026_media_nav_id;
+
+COMMIT;