马一丁

Change the display method of PEST chart in PDF

@@ -1365,6 +1365,190 @@ body {{ @@ -1365,6 +1365,190 @@ body {{
1365 font-style: italic !important; 1365 font-style: italic !important;
1366 }} 1366 }}
1367 1367
  1368 +/* ========== PEST PDF表格布局 ========== */
  1369 +/* 核心策略:PDF中使用表格形式而非卡片形式,更适合分页 */
  1370 +
  1371 +/* 隐藏HTML卡片布局,显示PDF表格布局 */
  1372 +.pest-card--html {{
  1373 + display: none !important;
  1374 +}}
  1375 +
  1376 +.pest-pdf-wrapper {{
  1377 + display: block !important;
  1378 + margin: 24px 0;
  1379 +}}
  1380 +
  1381 +/* PDF表格整体样式 */
  1382 +.pest-pdf-table {{
  1383 + width: 100% !important;
  1384 + border-collapse: collapse !important;
  1385 + font-size: 11px !important;
  1386 + table-layout: fixed !important;
  1387 + background: white;
  1388 +}}
  1389 +
  1390 +/* 表格标题 */
  1391 +.pest-pdf-caption {{
  1392 + caption-side: top !important;
  1393 + text-align: left !important;
  1394 + font-size: 16px !important;
  1395 + font-weight: 700 !important;
  1396 + padding: 12px 0 !important;
  1397 + color: #333 !important;
  1398 + border-bottom: 2px solid #333 !important;
  1399 + margin-bottom: 8px !important;
  1400 +}}
  1401 +
  1402 +/* 表头样式 */
  1403 +.pest-pdf-thead {{
  1404 + break-after: avoid !important;
  1405 + page-break-after: avoid !important;
  1406 +}}
  1407 +
  1408 +.pest-pdf-thead th {{
  1409 + background: #f5f3f7 !important;
  1410 + padding: 10px 8px !important;
  1411 + text-align: left !important;
  1412 + font-weight: 600 !important;
  1413 + border: 1px solid #ccc !important;
  1414 + color: #4a4458 !important;
  1415 + font-size: 11px !important;
  1416 +}}
  1417 +
  1418 +.pest-pdf-th-dimension {{ width: 70px !important; }}
  1419 +.pest-pdf-th-num {{ width: 40px !important; text-align: center !important; }}
  1420 +.pest-pdf-th-title {{ width: 20% !important; }}
  1421 +.pest-pdf-th-detail {{ width: auto !important; }}
  1422 +.pest-pdf-th-tags {{ width: 80px !important; text-align: center !important; }}
  1423 +
  1424 +/* 摘要行 */
  1425 +.pest-pdf-summary {{
  1426 + padding: 10px 12px !important;
  1427 + background: #f8f6fa !important;
  1428 + color: #555 !important;
  1429 + font-style: italic !important;
  1430 + border: 1px solid #ccc !important;
  1431 + font-size: 11px !important;
  1432 +}}
  1433 +
  1434 +/* 每个维度区块 - 核心分页控制 */
  1435 +.pest-pdf-dimension {{
  1436 + break-inside: avoid !important;
  1437 + page-break-inside: avoid !important;
  1438 +}}
  1439 +
  1440 +/* 允许在不同维度之间分页 */
  1441 +.pest-pdf-dimension + .pest-pdf-dimension {{
  1442 + break-before: auto;
  1443 + page-break-before: auto;
  1444 +}}
  1445 +
  1446 +/* 维度标签单元格 */
  1447 +.pest-pdf-dimension-label {{
  1448 + text-align: center !important;
  1449 + vertical-align: middle !important;
  1450 + padding: 12px 6px !important;
  1451 + font-weight: 700 !important;
  1452 + border: 1px solid #ccc !important;
  1453 + width: 70px !important;
  1454 +}}
  1455 +
  1456 +/* 四个维度的颜色主题 */
  1457 +.pest-pdf-dimension-label.pest-pdf-political {{
  1458 + background: #f5eef8 !important;
  1459 + color: #8e44ad !important;
  1460 + border-left: 4px solid #8e44ad !important;
  1461 +}}
  1462 +.pest-pdf-dimension-label.pest-pdf-economic {{
  1463 + background: #e8f6f3 !important;
  1464 + color: #16a085 !important;
  1465 + border-left: 4px solid #16a085 !important;
  1466 +}}
  1467 +.pest-pdf-dimension-label.pest-pdf-social {{
  1468 + background: #fdecf4 !important;
  1469 + color: #e84393 !important;
  1470 + border-left: 4px solid #e84393 !important;
  1471 +}}
  1472 +.pest-pdf-dimension-label.pest-pdf-technological {{
  1473 + background: #ebf3f9 !important;
  1474 + color: #2980b9 !important;
  1475 + border-left: 4px solid #2980b9 !important;
  1476 +}}
  1477 +
  1478 +/* 维度代码字母 */
  1479 +.pest-pdf-code {{
  1480 + display: block !important;
  1481 + font-size: 20px !important;
  1482 + font-weight: 800 !important;
  1483 + margin-bottom: 2px !important;
  1484 +}}
  1485 +
  1486 +/* 维度标签文字 */
  1487 +.pest-pdf-label-text {{
  1488 + display: block !important;
  1489 + font-size: 9px !important;
  1490 + font-weight: 600 !important;
  1491 + letter-spacing: 0.02em !important;
  1492 +}}
  1493 +
  1494 +/* 数据行 */
  1495 +.pest-pdf-item-row td {{
  1496 + padding: 8px 6px !important;
  1497 + border: 1px solid #ddd !important;
  1498 + vertical-align: top !important;
  1499 + font-size: 11px !important;
  1500 + line-height: 1.4 !important;
  1501 +}}
  1502 +
  1503 +/* 行背景色 */
  1504 +.pest-pdf-item-row.pest-pdf-political td {{ background: #faf7fc !important; }}
  1505 +.pest-pdf-item-row.pest-pdf-economic td {{ background: #f5fbfa !important; }}
  1506 +.pest-pdf-item-row.pest-pdf-social td {{ background: #fef8fb !important; }}
  1507 +.pest-pdf-item-row.pest-pdf-technological td {{ background: #f7fafd !important; }}
  1508 +
  1509 +/* 序号单元格 */
  1510 +.pest-pdf-item-num {{
  1511 + text-align: center !important;
  1512 + font-weight: 600 !important;
  1513 + color: #888 !important;
  1514 + width: 40px !important;
  1515 +}}
  1516 +
  1517 +/* 要点标题 */
  1518 +.pest-pdf-item-title {{
  1519 + font-weight: 600 !important;
  1520 + color: #222 !important;
  1521 +}}
  1522 +
  1523 +/* 详情说明 */
  1524 +.pest-pdf-item-detail {{
  1525 + color: #444 !important;
  1526 + line-height: 1.5 !important;
  1527 +}}
  1528 +
  1529 +/* 标签单元格 */
  1530 +.pest-pdf-item-tags {{
  1531 + text-align: center !important;
  1532 +}}
  1533 +
  1534 +/* 标签样式 */
  1535 +.pest-pdf-tag {{
  1536 + display: inline-block !important;
  1537 + padding: 2px 6px !important;
  1538 + border-radius: 3px !important;
  1539 + font-size: 9px !important;
  1540 + background: #ece9f1 !important;
  1541 + color: #5a4f6a !important;
  1542 + margin: 1px !important;
  1543 +}}
  1544 +
  1545 +/* 空数据提示 */
  1546 +.pest-pdf-empty {{
  1547 + text-align: center !important;
  1548 + color: #999 !important;
  1549 + font-style: italic !important;
  1550 +}}
  1551 +
1368 {optimized_css} 1552 {optimized_css}
1369 </style> 1553 </style>
1370 """ 1554 """