Browse Source

add timestamp.new

zxlie 5 months ago
parent
commit
1083f69fab
3 changed files with 3068 additions and 0 deletions
  1. 1598 0
      apps/ts-bak/index.css
  2. 429 0
      apps/ts-bak/index.html
  3. 1041 0
      apps/ts-bak/index.js

+ 1598 - 0
apps/ts-bak/index.css

@@ -0,0 +1,1598 @@
+@import url("../static/css/bootstrap.min.css");
+
+/* 整体布局样式 */
+.wrapper {
+    min-height: 100vh;
+    background: #f8f9fa;
+}
+
+/* 顶部导航栏样式 */
+.panel-heading {
+    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
+    border: none;
+    color: white;
+}
+
+.panel-heading .panel-title {
+    color: white;
+    font-size: 18px;
+    font-weight: 600;
+}
+
+.panel-heading .panel-title a {
+    color: white;
+    text-decoration: none;
+}
+
+.panel-heading .panel-title a:hover {
+    color: #e3f2fd;
+}
+
+.x-donate-area {
+    float: right;
+    margin-top: -5px;
+}
+
+/* 标签页容器样式 */
+.tab-container {
+    background: white;
+    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
+    border-radius: 0 0 8px 8px;
+    overflow: hidden;
+}
+
+/* 标签页导航样式 */
+.nav-tabs {
+    background: #f8f9fa;
+    border-bottom: 2px solid #e9ecef;
+    margin: 0;
+    padding: 10px 15px 0;
+}
+
+.nav-tabs > li > a {
+    color: #6c757d;
+    font-weight: 500;
+    border: none;
+    border-radius: 8px 8px 0 0;
+    margin-right: 5px;
+    padding: 12px 16px;
+    background: transparent;
+    transition: all 0.3s ease;
+}
+
+.nav-tabs > li.active > a,
+.nav-tabs > li.active > a:hover,
+.nav-tabs > li.active > a:focus {
+    background: white;
+    color: #495057;
+    border: none;
+    border-bottom: 3px solid #007bff;
+    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
+}
+
+.nav-tabs > li > a:hover {
+    background: #e9ecef;
+    border: none;
+}
+
+/* 标签页内容样式 */
+.tab-content {
+    padding: 30px;
+    min-height: 500px;
+}
+
+.tool-section {
+    margin-bottom: 30px;
+}
+
+.section-title {
+    color: #343a40;
+    font-size: 24px;
+    font-weight: 600;
+    margin-bottom: 10px;
+    border-left: 4px solid #007bff;
+    padding-left: 15px;
+}
+
+.section-desc {
+    color: #6c757d;
+    margin-bottom: 25px;
+    font-size: 14px;
+    line-height: 1.5;
+}
+
+/* 时间显示和操作区域样式 */
+.time-and-actions {
+    margin-bottom: 25px;
+}
+
+/* 实时时间显示样式 */
+.current-time-display {
+    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
+    color: white;
+    padding: 20px;
+    border-radius: 8px;
+    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
+}
+
+.current-time-display label {
+    color: white;
+    font-weight: 600;
+    margin-bottom: 8px;
+    display: block;
+    font-size: 12px;
+    text-transform: uppercase;
+    letter-spacing: 0.5px;
+}
+
+.time-display {
+    background: rgba(255,255,255,0.9);
+    border: 2px solid rgba(255,255,255,0.5);
+    color: #2d3748;
+    font-weight: 700;
+    cursor: pointer;
+    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
+    font-size: 13px;
+    text-align: center;
+    transition: all 0.3s ease;
+}
+
+.time-display:hover {
+    background: white;
+    border-color: rgba(255,255,255,0.8);
+    transform: translateY(-1px);
+    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
+}
+
+.time-display:focus {
+    background: white;
+    border-color: rgba(255,255,255,0.8);
+    color: #2d3748;
+    box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
+    outline: none;
+}
+
+/* 操作面板样式 */
+.actions-panel {
+    padding: 20px;
+    background: #f8f9fa;
+    border-radius: 8px;
+    border: 2px solid #e9ecef;
+    height: 100%;
+}
+
+.time-control {
+    margin-bottom: 20px;
+}
+
+.time-control label {
+    color: #495057;
+    font-weight: 600;
+    margin-bottom: 10px;
+    display: block;
+    font-size: 12px;
+    text-transform: uppercase;
+    letter-spacing: 0.5px;
+}
+
+.time-toggle-btn {
+    width: 100%;
+    font-weight: 600;
+    border-radius: 6px;
+    transition: all 0.3s ease;
+}
+
+.time-toggle-btn:hover {
+    transform: translateY(-1px);
+    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
+}
+
+.quick-actions label {
+    color: #495057;
+    font-weight: 600;
+    margin-bottom: 10px;
+    display: block;
+    font-size: 12px;
+    text-transform: uppercase;
+    letter-spacing: 0.5px;
+}
+
+.quick-buttons {
+    display: flex;
+    flex-wrap: wrap;
+    gap: 6px;
+}
+
+.quick-buttons .btn {
+    font-size: 11px;
+    padding: 4px 8px;
+    border-radius: 4px;
+    font-weight: 500;
+    white-space: nowrap;
+    flex: 1;
+    min-width: auto;
+    transition: all 0.2s ease;
+}
+
+.quick-buttons .btn:hover {
+    transform: translateY(-1px);
+    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
+    background-color: #007bff;
+    color: white;
+    border-color: #007bff;
+}
+
+/* 通用标签样式 */
+.input-label, .result-label {
+    display: flex;
+    align-items: center;
+    gap: 8px;
+    font-weight: 600;
+    color: #2d3748;
+    margin-bottom: 15px;
+    font-size: 16px;
+    border-bottom: 2px solid #e2e8f0;
+    padding-bottom: 8px;
+}
+
+.label-icon {
+    font-size: 18px;
+}
+
+.input-section, .results-section {
+    background: #f8f9fa;
+    border-radius: 12px;
+    padding: 20px;
+    margin-bottom: 25px;
+    border: 1px solid #e9ecef;
+}
+
+.results-section {
+    background: #ffffff;
+    border: 2px solid #e9ecef;
+    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
+}
+
+/* 智能解析器左右布局样式 */
+.parser-main-layout {
+    display: flex;
+    gap: 25px;
+    margin-top: 25px;
+}
+
+.left-panel {
+    flex: 1;
+    display: flex;
+    flex-direction: column;
+    gap: 20px;
+}
+
+.right-panel {
+    flex: 1;
+    display: flex;
+    flex-direction: column;
+    gap: 20px;
+}
+
+/* 模块标签样式 */
+.module-label {
+    display: flex;
+    align-items: center;
+    gap: 8px;
+    font-weight: 600;
+    color: #2d3748;
+    margin-bottom: 15px;
+    font-size: 16px;
+    border-bottom: 2px solid #e2e8f0;
+    padding-bottom: 8px;
+}
+
+/* 快捷操作模块 */
+.quick-actions-module {
+    background: #f8f9fa;
+    border-radius: 12px;
+    padding: 20px;
+    border: 1px solid #e9ecef;
+}
+
+.quick-buttons-grid {
+    display: flex;
+    flex-wrap: wrap;
+    gap: 8px;
+    justify-content: space-between;
+}
+
+.quick-btn {
+    flex: 1;
+    min-width: 0;
+    padding: 10px 8px;
+    border-radius: 8px;
+    font-weight: 600;
+    font-size: 12px;
+    transition: all 0.3s ease;
+    text-align: center;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    border: 2px solid;
+    background: white;
+    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
+}
+
+.quick-btn:hover {
+    transform: translateY(-2px);
+    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
+    background: #f8f9fa;
+}
+
+.quick-btn:active {
+    transform: translateY(0);
+    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
+}
+
+/* 不同颜色的快捷按钮 */
+.quick-btn[data-action="now"] {
+    border-color: #007bff;
+    color: #007bff;
+}
+
+.quick-btn[data-action="now"]:hover {
+    background: #e3f2fd;
+    border-color: #0056b3;
+}
+
+.quick-btn[data-action="today"] {
+    border-color: #28a745;
+    color: #28a745;
+}
+
+.quick-btn[data-action="today"]:hover {
+    background: #e8f5e8;
+    border-color: #1e7e34;
+}
+
+.quick-btn[data-action="yesterday"] {
+    border-color: #17a2b8;
+    color: #17a2b8;
+}
+
+.quick-btn[data-action="yesterday"]:hover {
+    background: #e1f7fa;
+    border-color: #117a8b;
+}
+
+.quick-btn[data-action="week_start"] {
+    border-color: #ffc107;
+    color: #856404;
+}
+
+.quick-btn[data-action="week_start"]:hover {
+    background: #fff3cd;
+    border-color: #d39e00;
+}
+
+.quick-btn[data-action="month_start"] {
+    border-color: #6c757d;
+    color: #6c757d;
+}
+
+.quick-btn[data-action="month_start"]:hover {
+    background: #f8f9fa;
+    border-color: #545b62;
+}
+
+.quick-btn[data-action="clear"] {
+    border-color: #dc3545;
+    color: #dc3545;
+}
+
+.quick-btn[data-action="clear"]:hover {
+    background: #f8d7da;
+    border-color: #bd2130;
+}
+
+/* 输入时间模块 */
+.input-time-module {
+    background: #f8f9fa;
+    border-radius: 12px;
+    padding: 20px;
+    border: 1px solid #e9ecef;
+    flex: 1;
+}
+
+.input-group-custom {
+    display: flex;
+    gap: 12px;
+    align-items: flex-start;
+}
+
+.smart-input {
+    flex: 1;
+    border-radius: 8px;
+    border: 2px solid #cbd5e0;
+    font-size: 14px;
+    transition: all 0.3s ease;
+    resize: vertical;
+    min-height: 140px;
+}
+
+.smart-input:focus {
+    border-color: #4299e1;
+    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
+}
+
+.input-actions {
+    display: flex;
+    flex-direction: column;
+    gap: 8px;
+}
+
+.input-actions .btn {
+    white-space: nowrap;
+    min-width: 100px;
+    border-radius: 6px;
+    font-weight: 500;
+}
+
+/* 当前时间模块 */
+.current-time-module {
+    background: #ffffff;
+    border-radius: 12px;
+    padding: 20px;
+    border: 2px solid #e9ecef;
+    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
+}
+
+.time-control-inline {
+    margin-left: auto;
+}
+
+.current-time-grid {
+    display: grid;
+    grid-template-columns: repeat(3, 1fr);
+    gap: 15px;
+}
+
+.time-item {
+    display: flex;
+    flex-direction: column;
+    gap: 5px;
+}
+
+.time-item label {
+    font-weight: 500;
+    color: #4a5568;
+    font-size: 12px;
+    text-align: center;
+    margin-bottom: 8px;
+}
+
+.time-item .time-display {
+    font-family: 'Monaco', 'Consolas', monospace;
+    font-size: 13px;
+    background: #f7fafc;
+    border: 2px solid #e2e8f0;
+    color: #2d3748;
+    font-weight: 600;
+    cursor: pointer;
+    transition: all 0.3s ease;
+    text-align: center;
+    padding: 8px 6px;
+}
+
+.time-item .time-display:hover {
+    border-color: #4299e1;
+    background: #ebf8ff;
+}
+
+/* 解析结果模块 */
+.parse-results-module {
+    background: #ffffff;
+    border-radius: 12px;
+    padding: 20px;
+    border: 2px solid #e9ecef;
+    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
+    flex: 1;
+}
+
+.format-hints {
+    margin-top: 15px;
+}
+
+.format-hints .badge {
+    background: #48bb78;
+    color: white;
+    padding: 6px 12px;
+    border-radius: 20px;
+    font-size: 12px;
+    font-weight: 500;
+    display: inline-block;
+}
+
+.format-hints:empty {
+    display: none;
+}
+
+.result-container {
+    padding: 0;
+    border: none;
+    background: transparent;
+}
+
+/* 解析结果网格布局 - 参考当前时间模块 */
+.parse-results-grid {
+    display: grid;
+    grid-template-columns: repeat(2, 1fr);
+    gap: 15px;
+    margin-top: 15px;
+}
+
+.result-item {
+    display: flex;
+    flex-direction: column;
+    gap: 5px;
+    background: #f7fafc;
+    border-radius: 8px;
+    padding: 12px;
+    border-left: 4px solid #4299e1;
+}
+
+.result-item label {
+    font-weight: 500;
+    color: #4a5568;
+    font-size: 12px;
+    text-align: center;
+    margin-bottom: 8px;
+}
+
+.result-item .result-value {
+    font-family: 'Monaco', 'Consolas', monospace;
+    font-size: 13px;
+    background: white;
+    border: 2px solid #e2e8f0;
+    color: #2d3748;
+    font-weight: 600;
+    cursor: pointer;
+    transition: all 0.3s ease;
+    text-align: center;
+    padding: 8px 6px;
+    border-radius: 6px;
+    word-break: break-all;
+}
+
+.result-item .result-value:hover {
+    border-color: #4299e1;
+    background: #ebf8ff;
+}
+
+/* ISO 8601 结果项特殊样式 */
+.result-item.iso-result {
+    grid-column: 1 / -1;
+}
+
+.result-item.iso-result .result-value {
+    text-align: left;
+    word-break: normal;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+}
+
+/* 代码生成器样式 */
+.code-generator-container {
+    margin-top: 25px;
+}
+
+.input-row {
+    display: flex;
+    gap: 15px;
+    align-items: flex-end;
+}
+
+.time-input-group {
+    flex: 2;
+    display: flex;
+    gap: 10px;
+}
+
+.time-input {
+    flex: 1;
+    border-radius: 8px;
+    border: 2px solid #cbd5e0;
+}
+
+.time-input:focus {
+    border-color: #4299e1;
+    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
+}
+
+.generate-btn {
+    white-space: nowrap;
+    padding: 8px 16px;
+    border-radius: 6px;
+    font-weight: 500;
+}
+
+.language-selector {
+    flex: 1;
+    min-width: 150px;
+}
+
+.language-selector select {
+    border-radius: 8px;
+    border: 2px solid #cbd5e0;
+}
+
+.code-results {
+    border: 2px solid #e2e8f0;
+    border-radius: 12px;
+    padding: 20px;
+    background: #f7fafc;
+}
+
+.code-block {
+    margin-bottom: 25px;
+    background: #ffffff;
+    border: 1px solid #e2e8f0;
+    border-radius: 10px;
+    overflow: hidden;
+    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
+}
+
+.code-block:last-child {
+    margin-bottom: 0;
+}
+
+/* 时间计算器样式 */
+.calculator-container {
+    margin-top: 25px;
+}
+
+/* 时间计算器左右布局 */
+.calculator-main-layout {
+    display: flex;
+    gap: 25px;
+    margin-top: 25px;
+}
+
+.left-calc-panel {
+    flex: 1;
+    display: flex;
+    flex-direction: column;
+}
+
+.right-calc-panel {
+    flex: 1;
+    display: flex;
+    flex-direction: column;
+}
+
+.calc-input-group {
+    display: flex;
+    flex-direction: column;
+    gap: 15px;
+    margin-bottom: 20px;
+}
+
+.time-inputs {
+    display: flex;
+    gap: 10px;
+    align-items: center;
+    flex-wrap: wrap;
+}
+
+.time-input-item {
+    display: flex;
+    align-items: center;
+    gap: 8px;
+    flex: 1;
+}
+
+.input-prefix {
+    color: #4a5568;
+    font-weight: 500;
+    min-width: 30px;
+}
+
+.calc-separator {
+    color: #4a5568;
+    font-weight: 600;
+    padding: 0 10px;
+}
+
+.start-time, .end-time {
+    border-radius: 8px;
+    border: 2px solid #cbd5e0;
+}
+
+.calc-btn {
+    white-space: nowrap;
+    padding: 8px 20px;
+    border-radius: 6px;
+    font-weight: 500;
+}
+
+.add-subtract-section {
+    margin-top: 0px;
+}
+
+/* 统一的左右布局样式 */
+.main-layout {
+    display: flex;
+    gap: 20px;
+    margin-top: 20px;
+}
+
+.left-panel {
+    flex: 1;
+    min-width: 0; /* 确保可以缩小 */
+}
+
+.right-panel {
+    flex: 1;
+    min-width: 0; /* 确保可以缩小 */
+}
+
+/* 在小屏幕上切换为垂直布局 */
+@media (max-width: 768px) {
+    .main-layout {
+        flex-direction: column;
+    }
+    
+    .timezone-selectors {
+        grid-template-columns: 1fr;
+        gap: 20px;
+    }
+    
+    .panel-section {
+        padding: 20px;
+    }
+    
+    .batch-actions {
+        flex-direction: column;
+    }
+    
+    .batch-actions .btn {
+        width: 100%;
+    }
+}
+
+/* 通用面板样式 */
+.panel-section {
+    background: rgba(248, 249, 250, 0.8);
+    border: 1px solid #e0e6ed;
+    border-radius: 12px;
+    padding: 20px;
+    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
+    transition: box-shadow 0.3s ease;
+}
+
+.panel-section:hover {
+    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
+}
+
+/* 左右布局中的表单样式 */
+.input-group,
+.batch-input-group,
+.timezone-input-group,
+.db-input-group {
+    display: flex;
+    flex-direction: column;
+    gap: 20px;
+}
+
+.time-input-section,
+.language-selector-section,
+.time-db-input,
+.db-type-selector {
+    display: flex;
+    flex-direction: column;
+    gap: 8px;
+}
+
+/* 时区选择器优化布局 */
+.timezone-selectors {
+    display: grid;
+    grid-template-columns: 1fr 1fr;
+    gap: 15px;
+    align-items: end;
+}
+
+/* 时区转换模块特殊宽度设置 */
+.timezone-input-group .time-input-section .form-control {
+    width: 100% !important;
+}
+
+.timezone-selectors select.form-control {
+    width: 50% !important;
+    min-width: 180px;
+}
+
+.from-timezone,
+.to-timezone {
+    display: flex;
+    flex-direction: column;
+    gap: 8px;
+    align-items: flex-start;
+}
+
+/* 时区选择器容器样式 */
+.from-timezone select,
+.to-timezone select {
+    align-self: flex-start;
+}
+
+/* 时区选择器的标签样式 */
+.timezone-selectors .form-label {
+    font-size: 14px;
+    font-weight: 600;
+    color: #495057;
+    margin-bottom: 5px;
+}
+
+/* 数据库输入组网格布局 */
+.db-input-group {
+    display: grid;
+    grid-template-columns: 1fr;
+    gap: 20px;
+}
+
+/* 表单标签统一样式 */
+.panel-section .form-label {
+    font-size: 14px;
+    font-weight: 600;
+    color: #495057;
+    margin-bottom: 5px;
+    display: block;
+}
+
+/* 批量操作按钮组 */
+.batch-actions {
+    display: flex;
+    gap: 10px;
+    flex-wrap: wrap;
+    margin-top: 10px;
+}
+
+.batch-actions .btn {
+    flex: 1;
+    min-width: 100px;
+}
+
+/* 统一按钮样式 */
+.generate-btn,
+.timezone-convert-btn,
+.db-generate-btn {
+    margin-top: 15px;
+    padding: 14px 24px;
+    font-size: 16px;
+    font-weight: 600;
+    border-radius: 10px;
+    border: none;
+    background: linear-gradient(135deg, #007bff, #0056b3);
+    color: white;
+    cursor: pointer;
+    transition: all 0.3s ease;
+    box-shadow: 0 3px 12px rgba(0, 123, 255, 0.25);
+    text-align: center;
+    width: 100%;
+}
+
+.generate-btn:hover,
+.timezone-convert-btn:hover,
+.db-generate-btn:hover {
+    background: linear-gradient(135deg, #0056b3, #004085);
+    box-shadow: 0 5px 16px rgba(0, 123, 255, 0.35);
+    transform: translateY(-2px);
+}
+
+/* 表单控件统一样式 */
+.panel-section .form-control {
+    padding: 12px 16px;
+    border: 2px solid #e9ecef;
+    border-radius: 8px;
+    font-size: 15px;
+    transition: all 0.3s ease;
+    background-color: #ffffff;
+    width: 100%;
+    box-sizing: border-box;
+    min-height: 44px;
+}
+
+/* input输入框统一100%宽度 */
+.panel-section input.form-control {
+    width: 100% !important;
+}
+
+/* select下拉框默认宽度调整 */
+.panel-section select.form-control {
+    width: 100% !important;
+}
+
+.panel-section .form-control:focus {
+    border-color: #007bff;
+    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
+    outline: none;
+}
+
+/* select下拉框特殊样式 */
+.panel-section select.form-control {
+    appearance: none;
+    -webkit-appearance: none;
+    -moz-appearance: none;
+    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
+    background-repeat: no-repeat;
+    background-position: right 12px center;
+    background-size: 16px 12px;
+    padding-right: 40px;
+    cursor: pointer;
+}
+
+.panel-section select.form-control:focus {
+    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23007bff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
+}
+
+/* select选项样式 */
+.panel-section select.form-control option {
+    padding: 8px 12px;
+    background-color: #ffffff;
+    color: #343a40;
+    font-size: 15px;
+}
+
+/* 输入标签样式优化 */
+.input-label {
+    font-size: 16px;
+    font-weight: 700;
+    color: #343a40;
+    margin-bottom: 15px;
+    display: flex;
+    align-items: center;
+    gap: 8px;
+}
+
+.label-icon {
+    font-size: 18px;
+}
+
+/* 面板内间距优化 */
+.panel-section {
+    padding: 25px;
+}
+
+/* 时区和数据库特殊布局优化 */
+.timezone-input-group .time-input-section {
+    margin-bottom: 5px;
+}
+
+.db-input-group .time-db-input,
+.db-input-group .db-type-selector {
+    margin-bottom: 5px;
+}
+
+/* 单行布局:基准时间 + 操作 + 数量 + 单位 */
+.single-row-group {
+    display: flex;
+    gap: 12px;
+    align-items: center;
+    flex-wrap: wrap;
+}
+
+.base-time-group {
+    flex: 2;
+    min-width: 200px;
+}
+
+.operation-select-group {
+    flex: 0 0 120px;
+}
+
+.amount-group {
+    flex: 0 0 100px;
+}
+
+.unit-group {
+    flex: 0 0 120px;
+}
+
+/* 时间加减运算按钮样式,与时间差计算按钮保持一致 */
+.calc-add-btn {
+    width: 100%;
+    padding: 12px;
+    font-size: 16px;
+    font-weight: 600;
+    border-radius: 8px;
+    border: none;
+    background: linear-gradient(135deg, #28a745, #20c997);
+    color: white;
+    cursor: pointer;
+    transition: all 0.3s ease;
+    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
+}
+
+.calc-add-btn:hover {
+    background: linear-gradient(135deg, #218838, #1ea085);
+    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
+    transform: translateY(-1px);
+}
+
+.operation-group {
+    display: flex;
+    gap: 8px;
+    align-items: center;
+    flex-wrap: wrap;
+}
+
+.operation-select, .amount-input, .unit-select {
+    border-radius: 6px;
+    border: 2px solid #cbd5e0;
+}
+
+.calc-add-btn {
+    white-space: nowrap;
+    padding: 8px 16px;
+    border-radius: 6px;
+    font-weight: 500;
+}
+
+.calc-results, .add-subtract-results {
+    padding: 15px;
+    background: #f7fafc;
+    border-radius: 8px;
+    border: 2px solid #e2e8f0;
+    min-height: 60px;
+}
+
+/* 代码生成器样式 */
+
+.code-block {
+    margin-bottom: 20px;
+    border: 1px solid #e9ecef;
+    border-radius: 8px;
+    overflow: hidden;
+}
+
+.code-header {
+    background: #f8f9fa;
+    padding: 10px 15px;
+    border-bottom: 1px solid #e9ecef;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+}
+
+.code-lang {
+    font-weight: 600;
+    color: #495057;
+}
+
+.code-content {
+    background: #2d3748;
+    color: #e2e8f0;
+    margin: 0;
+    padding: 15px;
+    border-radius: 0;
+    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
+    font-size: 13px;
+    line-height: 1.4;
+    word-wrap: break-word;
+    white-space: pre-wrap;
+}
+
+/* 时间计算器样式 */
+.calc-section {
+    background: white;
+    border: 1px solid #e9ecef;
+    border-radius: 8px;
+    padding: 20px;
+    margin-bottom: 20px;
+}
+
+.calc-section h5 {
+    color: #495057;
+    font-weight: 600;
+    margin-bottom: 15px;
+    padding-bottom: 10px;
+    border-bottom: 1px solid #e9ecef;
+}
+
+.result-display {
+    margin-top: 20px;
+    padding: 15px;
+    background: #f8f9fa;
+    border-radius: 6px;
+}
+
+.human-readable {
+    margin-top: 15px;
+    padding: 10px;
+    background: white;
+    border-left: 4px solid #28a745;
+    color: #495057;
+}
+
+/* 批量转换器样式 */
+.batch-controls {
+    margin-top: 15px;
+}
+
+.batch-controls .btn {
+    margin-right: 10px;
+    margin-bottom: 5px;
+}
+
+.batch-results {
+    background: #f8f9fa;
+    border-radius: 8px;
+    padding: 15px;
+}
+
+.result-stats {
+    margin-bottom: 15px;
+}
+
+.result-stats .badge {
+    margin-right: 10px;
+    padding: 5px 10px;
+}
+
+.results-table-container {
+    background: white;
+    border-radius: 6px;
+    overflow: hidden;
+}
+
+.table {
+    margin: 0;
+    font-size: 13px;
+}
+
+.original-value,
+.converted-value {
+    max-width: 200px;
+    word-wrap: break-word;
+    white-space: normal;
+}
+
+.converted-value {
+    cursor: pointer;
+    color: #007bff;
+}
+
+.converted-value:hover {
+    background: #e3f2fd;
+}
+
+/* 时区专家样式 */
+.timezone-converter {
+    margin-bottom: 30px;
+}
+
+.timezone-result {
+    margin-top: 20px;
+    padding: 15px;
+    background: #e8f5e8;
+    border-radius: 6px;
+}
+
+.world-clock {
+    margin-top: 30px;
+}
+
+.clock-item {
+    background: white;
+    border: 1px solid #e9ecef;
+    border-radius: 8px;
+    padding: 15px;
+    text-align: center;
+    margin-bottom: 15px;
+    transition: transform 0.2s ease;
+}
+
+.clock-item:hover {
+    transform: translateY(-2px);
+    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
+}
+
+.clock-city {
+    font-weight: 600;
+    color: #495057;
+    margin-bottom: 5px;
+}
+
+.clock-time {
+    font-size: 18px;
+    font-weight: 700;
+    color: #007bff;
+    margin-bottom: 5px;
+}
+
+.clock-timezone {
+    font-size: 12px;
+    color: #6c757d;
+}
+
+/* 数据库工具样式 */
+.db-results {
+}
+
+.db-format-item {
+    margin-bottom: 15px;
+}
+
+.sql-examples {
+    margin-top: 20px;
+}
+
+.sql-example {
+    margin-bottom: 20px;
+    border: 1px solid #e9ecef;
+    border-radius: 8px;
+    overflow: hidden;
+}
+
+.sql-header {
+    background: #f8f9fa;
+    padding: 10px 15px;
+    border-bottom: 1px solid #e9ecef;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    font-weight: 500;
+}
+
+.sql-content {
+    background: #2d3748;
+    color: #e2e8f0;
+    margin: 0;
+    padding: 15px;
+    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
+    font-size: 13px;
+    line-height: 1.4;
+    word-wrap: break-word;
+    white-space: pre-wrap;
+}
+
+/* 底部面板样式 */
+.bottom-panel {
+    background: white;
+    border-top: 1px solid #e9ecef;
+    padding: 20px 30px;
+    margin-top: 30px;
+}
+
+.bottom-panel h5 {
+    color: #495057;
+    font-weight: 600;
+    margin-bottom: 15px;
+    padding-bottom: 8px;
+    border-bottom: 1px solid #e9ecef;
+}
+
+/* 历史记录样式 */
+.history-list {
+}
+
+.history-item {
+    padding: 8px 12px;
+    border: 1px solid #e9ecef;
+    border-radius: 4px;
+    margin-bottom: 5px;
+    cursor: pointer;
+    transition: background 0.2s ease;
+    font-size: 13px;
+}
+
+.history-item:hover {
+    background: #f8f9fa;
+}
+
+.history-time {
+    color: #6c757d;
+    font-size: 11px;
+    margin-right: 10px;
+}
+
+.history-action {
+    color: #007bff;
+    font-weight: 500;
+    margin-right: 10px;
+}
+
+.history-value {
+    color: #495057;
+}
+
+/* 快捷操作样式 */
+.quick-actions .btn {
+    margin-right: 8px;
+    margin-bottom: 8px;
+    font-size: 13px;
+}
+
+/* 响应式设计 */
+@media (max-width: 1024px) and (min-width: 769px) {
+    .current-time-grid {
+        grid-template-columns: 1fr;
+        gap: 12px;
+    }
+    
+    .time-item .time-display {
+        font-size: 14px;
+        padding: 10px;
+    }
+    
+    .time-item label {
+        font-size: 13px;
+        text-align: left;
+    }
+}
+
+@media (max-width: 768px) {
+    .tab-content {
+        padding: 15px;
+    }
+    
+    .nav-tabs {
+        padding: 5px 10px 0;
+    }
+    
+    .nav-tabs > li > a {
+        padding: 8px 12px;
+        font-size: 13px;
+    }
+    
+    .section-title {
+        font-size: 20px;
+    }
+    
+    .current-time-display {
+        padding: 15px;
+    }
+    
+    .bottom-panel {
+        padding: 15px;
+    }
+    
+    /* 智能解析器响应式布局 */
+    .parser-main-layout {
+        flex-direction: column;
+        gap: 20px;
+    }
+    
+    .left-panel, .right-panel {
+        flex: none;
+    }
+    
+    .quick-buttons-grid {
+        grid-template-columns: repeat(3, 1fr);
+        gap: 8px;
+    }
+    
+    .quick-btn {
+        font-size: 12px;
+        padding: 6px 8px;
+    }
+    
+    .input-group-custom {
+        flex-direction: column;
+    }
+    
+    .input-actions {
+        flex-direction: row;
+        justify-content: space-between;
+    }
+    
+    .current-time-grid {
+        grid-template-columns: 1fr;
+        gap: 10px;
+    }
+
+    .calculator-main-layout {
+        flex-direction: column;
+        gap: 20px;
+    }
+
+    .left-calc-panel, .right-calc-panel {
+        flex: none;
+    }
+}
+
+/* 动画效果 */
+.fade-enter-active, .fade-leave-active {
+    transition: opacity 0.3s ease;
+}
+
+.fade-enter, .fade-leave-to {
+    opacity: 0;
+}
+
+/* 自定义滚动条 */
+
+
+/* 表单增强样式 */
+.form-control:focus {
+    border-color: #007bff;
+    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
+}
+
+.btn-primary {
+    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
+    border: none;
+    font-weight: 500;
+    transition: all 0.3s ease;
+}
+
+.btn-primary:hover {
+    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
+    transform: translateY(-1px);
+    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
+}
+
+/* Toast 提示样式 */
+#fehelper_alertmsg {
+    position: fixed;
+    top: 0;
+    left: 0;
+    right: 0;
+    z-index: 1000000;
+    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
+    display: inline-block;
+    color: #fff;
+    text-align: center;
+    padding: 12px 20px;
+    margin: 0 auto;
+    font-size: 14px;
+    font-weight: 500;
+    border-bottom: 1px solid rgba(255,255,255,0.2);
+    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
+}
+
+/* 批量转换器增强样式 */
+.batch-container {
+    margin-top: 25px;
+}
+
+.batch-input-group {
+    display: flex;
+    gap: 15px;
+}
+
+.batch-input {
+    flex: 1;
+    border-radius: 8px;
+    border: 2px solid #cbd5e0;
+    font-family: 'Monaco', 'Consolas', monospace;
+    font-size: 13px;
+}
+
+.batch-actions {
+    display: flex;
+    flex-direction: column;
+    gap: 8px;
+    min-width: 130px;
+}
+
+.batch-actions .btn {
+    white-space: nowrap;
+    border-radius: 6px;
+    font-weight: 500;
+    font-size: 13px;
+}
+
+/* 时区转换器增强样式 */
+.timezone-container {
+    margin-top: 25px;
+}
+
+.timezone-input-group {
+    display: flex;
+    gap: 15px;
+    align-items: center;
+    flex-wrap: wrap;
+    margin-bottom: 20px;
+}
+
+.time-input-section {
+    flex: 2;
+    min-width: 200px;
+}
+
+.timezone-time-input {
+    border-radius: 8px;
+    border: 2px solid #cbd5e0;
+}
+
+.timezone-selectors {
+    display: flex;
+    gap: 10px;
+    align-items: center;
+    flex: 3;
+}
+
+.from-timezone, .to-timezone {
+    display: flex;
+    align-items: center;
+    gap: 8px;
+    flex: 1;
+}
+
+.timezone-label {
+    color: #4a5568;
+    font-weight: 500;
+    min-width: 30px;
+}
+
+.timezone-arrow {
+    color: #4a5568;
+    font-size: 16px;
+    padding: 0 5px;
+}
+
+.from-timezone-select, .to-timezone-select {
+    border-radius: 6px;
+    border: 2px solid #cbd5e0;
+    font-size: 13px;
+}
+
+.timezone-convert-btn {
+    white-space: nowrap;
+    padding: 8px 16px;
+    border-radius: 6px;
+    font-weight: 500;
+}
+
+.timezone-results {
+    padding: 15px;
+    background: #f7fafc;
+    border-radius: 8px;
+    border: 2px solid #e2e8f0;
+    min-height: 60px;
+}
+
+/* 数据库工具增强样式 */
+.database-container {
+    margin-top: 25px;
+}
+
+.db-input-group {
+    display: flex;
+    gap: 15px;
+    align-items: center;
+    flex-wrap: wrap;
+    margin-bottom: 20px;
+}
+
+.time-db-input {
+    flex: 2;
+    min-width: 200px;
+}
+
+.db-time-input {
+    border-radius: 8px;
+    border: 2px solid #cbd5e0;
+}
+
+.db-type-selector {
+    flex: 1;
+    min-width: 150px;
+}
+
+.db-type-select {
+    border-radius: 6px;
+    border: 2px solid #cbd5e0;
+}
+
+.db-generate-btn {
+    white-space: nowrap;
+    padding: 8px 16px;
+    border-radius: 6px;
+    font-weight: 500;
+}
+
+.db-results {
+    border: 2px solid #e2e8f0;
+    border-radius: 8px;
+    padding: 15px;
+    background: #f7fafc;
+}

+ 429 - 0
apps/ts-bak/index.html

@@ -0,0 +1,429 @@
+<!DOCTYPE HTML>
+<html lang="zh-CN">
+    <head>
+        <title>专业时间戳工具 - FeHelper</title>
+        <meta charset="UTF-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
+        <link rel="shortcut icon" href="../static/img/favicon.ico">
+        <link rel="stylesheet" href="index.css" />
+    </head>
+    <body>
+
+    <div class="wrapper" id="app">
+        <!-- 顶部导航栏 -->
+        <div class="panel panel-default" style="margin-bottom: 0px;">
+            <div class="panel-heading">
+                <h3 class="panel-title">
+                    <a href="https://www.baidufe.com/fehelper/index/index.html" target="_blank" class="x-a-high">
+                        <img src="../static/img/fe-16.png" alt="fehelper"/> FeHelper</a>:专业时间戳工具
+                    
+                    <span class="x-donate-area">
+                        <a href="https://www.baidufe.com/fehelper/donate.html" target="_blank" class="btn btn-primary btn-sm">
+                            💖 打赏
+                        </a>
+                    </span>
+                </h3>
+            </div>
+        </div>
+
+        <!-- 功能标签页 -->
+        <div class="tab-container">
+            <ul class="nav nav-tabs" role="tablist">
+                <li role="presentation" class="active">
+                    <a href="#">🧠 智能解析</a>
+                </li>
+                <li role="presentation">
+                    <a href="#">💻 代码生成</a>
+                </li>
+                <li role="presentation">
+                    <a href="#">🧮 时间计算</a>
+                </li>
+                <li role="presentation">
+                    <a href="#">📊 批量转换</a>
+                </li>
+                <li role="presentation">
+                    <a href="#">🌍 时区专家</a>
+                </li>
+                <li role="presentation">
+                    <a href="#">🗄️ 数据库</a>
+                </li>
+            </ul>
+
+            <!-- 标签页内容 -->
+            <div class="tab-content">
+                <!-- 智能解析模块 -->
+                <div role="tabpanel" class="tab-pane active" id="smart-parser">
+                    <div class="tool-section">
+                        <h4 class="section-title">🧠 智能时间解析器</h4>
+                        <p class="section-desc">支持20+种时间格式自动识别,包括Unix时间戳、ISO 8601、RFC 3339、数据库格式等</p>
+                        
+                        <div class="parser-main-layout">
+                            <!-- 左侧区域 -->
+                            <div class="left-panel">
+                                <!-- 快捷操作模块 -->
+                                <div class="quick-actions-module">
+                                    <label class="module-label">
+                                        <span class="label-icon">⚡</span>
+                                        快捷操作
+                                    </label>
+                                    <div class="quick-buttons-grid">
+                                        <button class="btn btn-outline-primary btn-sm quick-btn" data-action="now">
+                                            🕐 当前时间
+                                        </button>
+                                        <button class="btn btn-outline-success btn-sm quick-btn" data-action="today">
+                                            📅 今天开始
+                                        </button>
+                                        <button class="btn btn-outline-info btn-sm quick-btn" data-action="yesterday">
+                                            📆 昨天
+                                        </button>
+                                        <button class="btn btn-outline-warning btn-sm quick-btn" data-action="week_start">
+                                            🗓️ 本周开始
+                                        </button>
+                                        <button class="btn btn-outline-secondary btn-sm quick-btn" data-action="month_start">
+                                            📊 本月开始
+                                        </button>
+                                    </div>
+                                </div>
+                                
+                                <!-- 输入时间模块 -->
+                                <div class="input-time-module">
+                                    <label class="module-label">
+                                        <span class="label-icon">📝</span>
+                                        输入时间(支持多种格式)
+                                    </label>
+                                    <div class="input-group-custom">
+                                        <textarea class="form-control smart-input" 
+                                                 placeholder="试试输入:&#10;• 1749722690(时间戳)&#10;• 2025-06-12 18:06:25&#10;• now / today / yesterday&#10;• 2025/06/12&#10;• Jun 12, 2025"
+                                                 rows="6"></textarea>
+                                        <div class="input-actions">
+                                            <button class="btn btn-primary parse-btn">🔍 解析</button>
+                                            <button class="btn btn-secondary clear-input-btn">🗑️ 清空</button>
+                                        </div>
+                                    </div>
+                                    <div class="format-hints"></div>
+                                </div>
+                            </div>
+                            
+                            <!-- 右侧区域 -->
+                            <div class="right-panel">
+                                <!-- 当前时间模块 -->
+                                <div class="current-time-module">
+                                    <label class="module-label">
+                                        <span class="label-icon">🕒</span>
+                                        当前时间
+                                        <div class="time-control-inline">
+                                            <button class="btn btn-sm btn-warning time-toggle-btn">⏸️ 暂停</button>
+                                        </div>
+                                    </label>
+                                    <div class="current-time-grid">
+                                        <div class="time-item">
+                                            <label>当前本地时间</label>
+                                            <input type="text" class="form-control time-display" readonly title="点击复制">
+                                        </div>
+                                        <div class="time-item">
+                                            <label>Unix时间戳(秒)</label>
+                                            <input type="text" class="form-control time-display" readonly title="点击复制">
+                                        </div>
+                                        <div class="time-item">
+                                            <label>Unix时间戳(毫秒)</label>
+                                            <input type="text" class="form-control time-display" readonly title="点击复制">
+                                        </div>
+                                    </div>
+                                </div>
+                                
+                                <!-- 解析结果模块 -->
+                                <div class="parse-results-module">
+                                    <label class="module-label">
+                                        <span class="label-icon">📋</span>
+                                        解析结果
+                                    </label>
+                                    <div class="result-container"></div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+
+                <!-- 代码生成模块 -->
+                <div role="tabpanel" class="tab-pane" id="code-generator" style="display: none;">
+                    <div class="tool-section">
+                        <h4 class="section-title">💻 多语言代码生成器</h4>
+                        <p class="section-desc">根据时间值生成各种编程语言的时间处理代码</p>
+                        
+                        <div class="main-layout">
+                            <!-- 左侧:输入和控制 -->
+                            <div class="left-panel">
+                                <div class="panel-section">
+                                    <label class="input-label">
+                                        <span class="label-icon">⚡</span>
+                                        时间输入与语言选择
+                                    </label>
+                                    <div class="input-group">
+                                        <div class="time-input-section">
+                                            <input type="text" class="form-control time-input" placeholder="输入时间戳或时间字符串(如:1699999999)">
+                                        </div>
+                                        <div class="language-selector-section">
+                                            <label class="form-label">选择语言</label>
+                                            <select class="form-control language-select">
+                                                <option value="all">所有语言</option>
+                                                <option value="javascript">JavaScript</option>
+                                                <option value="python">Python</option>
+                                                <option value="java">Java</option>
+                                                <option value="go">Go</option>
+                                                <option value="php">PHP</option>
+                                                <option value="sql">SQL</option>
+                                            </select>
+                                        </div>
+                                        <button class="btn btn-primary generate-btn">🔨 生成代码</button>
+                                    </div>
+                                </div>
+                            </div>
+                            
+                            <!-- 右侧:结果显示 -->
+                            <div class="right-panel">
+                                <div class="panel-section">
+                                    <label class="result-label">
+                                        <span class="label-icon">💻</span>
+                                        生成的代码(点击代码块可复制)
+                                    </label>
+                                    <div class="code-results"></div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+
+                <!-- 时间计算模块 -->
+                <div role="tabpanel" class="tab-pane" id="time-calculator" style="display: none;">
+                    <div class="tool-section">
+                        <h4 class="section-title">🧮 时间计算器</h4>
+                        <p class="section-desc">进行时间差计算、时间加减运算等复杂时间计算</p>
+                        
+                        <div class="calculator-container">
+                            <div class="calculator-main-layout">
+                                <!-- 左侧:时间差计算 -->
+                                <div class="left-calc-panel">
+                                    <div class="calc-section">
+                                        <label class="input-label">
+                                            <span class="label-icon">⏰</span>
+                                            时间差计算
+                                        </label>
+                                        <div class="calc-input-group">
+                                            <div class="time-inputs">
+                                                <div class="time-input-item">
+                                                    <span class="input-prefix">从</span>
+                                                    <input type="text" class="form-control start-time" placeholder="开始时间(如:2024-01-01 10:00:00)">
+                                                </div>
+                                                <div class="calc-separator">到</div>
+                                                <div class="time-input-item">
+                                                    <input type="text" class="form-control end-time" placeholder="结束时间(如:2024-01-02 15:30:00)">
+                                                </div>
+                                            </div>
+                                            <button class="btn btn-primary calc-btn">📊 计算时间差</button>
+                                        </div>
+                                        <div class="calc-results"></div>
+                                    </div>
+                                </div>
+                                
+                                <!-- 右侧:时间加减运算 -->
+                                <div class="right-calc-panel">
+                                    <div class="calc-section">
+                                        <label class="input-label">
+                                            <span class="label-icon">➕➖</span>
+                                            时间加减运算
+                                        </label>
+                                        <div class="calc-input-group">
+                                            <!-- 单行布局:基准时间 + 操作 + 数量 + 单位 -->
+                                            <div class="single-row-group">
+                                                <div class="base-time-group">
+                                                    <input type="text" class="form-control base-time" placeholder="基准时间(如:2024-01-01 10:00:00)">
+                                                </div>
+                                                <div class="operation-select-group">
+                                                    <select class="form-control operation-select">
+                                                        <option value="add">➕ 增加</option>
+                                                        <option value="subtract">➖ 减去</option>
+                                                    </select>
+                                                </div>
+                                                <div class="amount-group">
+                                                    <input type="number" class="form-control amount-input" placeholder="数量">
+                                                </div>
+                                                <div class="unit-group">
+                                                    <select class="form-control unit-select">
+                                                        <option value="seconds">秒</option>
+                                                        <option value="minutes">分钟</option>
+                                                        <option value="hours">小时</option>
+                                                        <option value="days">天</option>
+                                                        <option value="months">月</option>
+                                                        <option value="years">年</option>
+                                                    </select>
+                                                </div>
+                                            </div>
+                                            
+                                            <button class="btn btn-success calc-add-btn">🧮 计算结果</button>
+                                        </div>
+                                        <div class="calc-results add-subtract-results"></div>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+
+                <!-- 批量转换模块 -->
+                <div role="tabpanel" class="tab-pane" id="batch-converter" style="display: none;">
+                    <div class="tool-section">
+                        <h4 class="section-title">📊 批量转换器</h4>
+                        <p class="section-desc">批量处理时间数据,支持CSV导入导出</p>
+                        
+                        <div class="main-layout">
+                            <!-- 左侧:输入和控制 -->
+                            <div class="left-panel">
+                                <div class="panel-section">
+                                    <label class="input-label">
+                                        <span class="label-icon">📝</span>
+                                        批量时间输入(每行一个)
+                                    </label>
+                                    <div class="batch-input-group">
+                                        <textarea class="form-control batch-input" rows="10" 
+                                                 placeholder="输入多个时间值,每行一个:&#10;1699999999&#10;2024-01-15 10:30:45&#10;now&#10;today&#10;2024/01/15"></textarea>
+                                        <div class="batch-actions">
+                                            <button class="btn btn-primary batch-convert-btn">🔄 批量转换</button>
+                                            <button class="btn btn-success batch-export-btn">📥 导出结果</button>
+                                            <button class="btn btn-secondary batch-clear-btn">🗑️ 清空</button>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                            
+                            <!-- 右侧:结果显示 -->
+                            <div class="right-panel">
+                                <div class="panel-section">
+                                    <label class="result-label">
+                                        <span class="label-icon">📊</span>
+                                        转换结果
+                                        <span class="result-stats"></span>
+                                    </label>
+                                    <div class="batch-results"></div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+
+                <!-- 时区专家模块 -->
+                <div role="tabpanel" class="tab-pane" id="timezone-expert" style="display: none;">
+                    <div class="tool-section">
+                        <h4 class="section-title">🌍 时区转换专家</h4>
+                        <p class="section-desc">精确的时区转换,支持夏令时和历史时区数据</p>
+                        
+                        <div class="main-layout">
+                            <!-- 左侧:输入和控制 -->
+                            <div class="left-panel">
+                                <div class="panel-section">
+                                    <label class="input-label">
+                                        <span class="label-icon">🌍</span>
+                                        时区转换设置
+                                    </label>
+                                    <div class="timezone-input-group">
+                                        <div class="time-input-section">
+                                            <label class="form-label">输入时间</label>
+                                            <input type="text" class="form-control timezone-time-input" placeholder="输入时间(如:2024-01-15 10:30:00)">
+                                        </div>
+                                        <div class="timezone-selectors">
+                                            <div class="from-timezone">
+                                                <label class="form-label">从时区</label>
+                                                <select class="form-control from-timezone-select">
+                                                    <option value="Asia/Shanghai">🇨🇳 北京时间 (GMT+8)</option>
+                                                    <option value="America/New_York">🇺🇸 纽约时间 (EST)</option>
+                                                    <option value="Europe/London">🇬🇧 伦敦时间 (GMT)</option>
+                                                    <option value="Asia/Tokyo">🇯🇵 东京时间 (JST)</option>
+                                                </select>
+                                            </div>
+                                            <div class="to-timezone">
+                                                <label class="form-label">到时区</label>
+                                                <select class="form-control to-timezone-select">
+                                                    <option value="America/New_York">🇺🇸 纽约时间 (EST)</option>
+                                                    <option value="Asia/Shanghai">🇨🇳 北京时间 (GMT+8)</option>
+                                                    <option value="Europe/London">🇬🇧 伦敦时间 (GMT)</option>
+                                                    <option value="Asia/Tokyo">🇯🇵 东京时间 (JST)</option>
+                                                </select>
+                                            </div>
+                                        </div>
+                                        <button class="btn btn-primary timezone-convert-btn">🔄 转换时区</button>
+                                    </div>
+                                </div>
+                            </div>
+                            
+                            <!-- 右侧:结果显示 -->
+                            <div class="right-panel">
+                                <div class="panel-section">
+                                    <label class="result-label">
+                                        <span class="label-icon">⏰</span>
+                                        转换结果
+                                    </label>
+                                    <div class="timezone-results"></div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+
+                <!-- 数据库工具模块 -->
+                <div role="tabpanel" class="tab-pane" id="database-tools" style="display: none;">
+                    <div class="tool-section">
+                        <h4 class="section-title">🗄️ 数据库时间工具</h4>
+                        <p class="section-desc">生成各种数据库的时间格式和SQL查询语句</p>
+                        
+                        <div class="main-layout">
+                            <!-- 左侧:输入和控制 -->
+                            <div class="left-panel">
+                                <div class="panel-section">
+                                    <label class="input-label">
+                                        <span class="label-icon">⚙️</span>
+                                        数据库配置
+                                    </label>
+                                    <div class="db-input-group">
+                                        <div class="time-db-input">
+                                            <label class="form-label">输入时间值</label>
+                                            <input type="text" class="form-control db-time-input" placeholder="输入时间值(如:1699999999 或 2024-01-15 10:30:00)">
+                                        </div>
+                                        <div class="db-type-selector">
+                                            <label class="form-label">选择数据库类型</label>
+                                            <select class="form-control db-type-select">
+                                                <option value="mysql">🐬 MySQL</option>
+                                                <option value="postgresql">🐘 PostgreSQL</option>
+                                                <option value="sqlite">📱 SQLite</option>
+                                                <option value="mongodb">🍃 MongoDB</option>
+                                            </select>
+                                        </div>
+                                        <button class="btn btn-primary db-generate-btn">🔧 生成格式</button>
+                                    </div>
+                                </div>
+                            </div>
+                            
+                            <!-- 右侧:结果显示 -->
+                            <div class="right-panel">
+                                <div class="panel-section">
+                                    <label class="result-label">
+                                        <span class="label-icon">📄</span>
+                                        数据库格式与SQL语句
+                                    </label>
+                                    <div class="db-results"></div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+
+
+    </div>
+
+    <!-- 引入所需的JavaScript库 -->
+    <script type="text/javascript" src="../static/vendor/jquery/jquery-3.3.1.min.js"></script>
+    <script type="text/javascript" src="index.js"></script>
+
+    </body>
+</html>
+

+ 1041 - 0
apps/ts-bak/index.js

@@ -0,0 +1,1041 @@
+/**
+ * FeHelper - 专业时间戳工具
+ * 使用原生JavaScript实现,无需Vue依赖,兼容Chrome扩展CSP策略
+ */
+
+// 全局状态管理
+var AppState = {
+    // 当前活跃的标签页
+    activeTab: 'smart-parser',
+    
+    // 当前时间显示
+    currentTime: {
+        local: '',
+        timestamp: 0,
+        timestampMs: 0
+    },
+    isTimeRunning: true,
+    
+    // 智能时间解析器
+    smartParser: {
+        input: '',
+        results: [],
+        error: '',
+        detectedFormat: ''
+    },
+    
+    // 代码生成器
+    codeGenerator: {
+        input: '',
+        codes: [],
+        selectedLang: 'all'
+    },
+    
+    // 时间计算器
+    calculator: {
+        startTime: '',
+        endTime: '',
+        difference: null
+    },
+    
+    // 批量转换器
+    batchConverter: {
+        input: '',
+        results: []
+    },
+    
+    // 时区转换
+    timezoneExpert: {
+        inputTime: '',
+        fromTimezone: 'Asia/Shanghai',
+        toTimezone: 'America/New_York',
+        result: null
+    },
+    
+    // 数据库工具
+    dbTools: {
+        inputTime: '',
+        dbType: 'mysql',
+        formats: []
+    }
+};
+
+// 工具类 - 简易时间处理
+var TimeUtils = {
+    // 解析时间输入
+    parseTimeInput: function(input) {
+        if (!input || !input.trim()) {
+            throw new Error('请输入时间值');
+        }
+        
+        input = input.trim();
+        
+        // Unix时间戳(秒) - 10位数字
+        if (/^\d{10}$/.test(input)) {
+            return {
+                timestamp: parseInt(input) * 1000,
+                format: 'Unix时间戳(秒)'
+            };
+        }
+        
+        // Unix时间戳(毫秒) - 13位数字  
+        if (/^\d{13}$/.test(input)) {
+            return {
+                timestamp: parseInt(input),
+                format: 'Unix时间戳(毫秒)'
+            };
+        }
+        
+        // 特殊关键字
+        var now = new Date();
+        if (input.toLowerCase() === 'now') {
+            return {
+                timestamp: now.getTime(),
+                format: '当前时间(now)'
+            };
+        }
+        
+        if (input.toLowerCase() === 'today') {
+            var today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
+            return {
+                timestamp: today.getTime(),
+                format: '今天开始时间(today)'
+            };
+        }
+        
+        if (input.toLowerCase() === 'yesterday') {
+            var yesterday = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1);
+            return {
+                timestamp: yesterday.getTime(),
+                format: '昨天开始时间(yesterday)'
+            };
+        }
+        
+        // 尝试解析为日期字符串
+        var date = new Date(input);
+        if (!isNaN(date.getTime())) {
+            return {
+                timestamp: date.getTime(),
+                format: '日期字符串'
+            };
+        }
+        
+        throw new Error('无法识别的时间格式');
+    },
+    
+    // 格式化时间戳为各种格式
+    formatTimestamp: function(timestamp) {
+        var date = new Date(timestamp);
+        
+        return [
+            { label: '标准格式', value: this.formatDate(date, 'YYYY-MM-DD HH:mm:ss') },
+            { label: 'Unix时间戳(秒)', value: Math.floor(timestamp / 1000).toString() },
+            { label: 'Unix时间戳(毫秒)', value: timestamp.toString() },
+            { label: 'UTC时间', value: this.formatDate(new Date(date.getTime() + date.getTimezoneOffset() * 60000), 'YYYY-MM-DD HH:mm:ss') + ' UTC' },
+            { label: '本地格式', value: date.toLocaleString('zh-CN') },
+            { label: '相对时间', value: this.getRelativeTime(date) },
+            { label: 'ISO 8601', value: date.toISOString() }
+        ];
+    },
+    
+    // 格式化日期
+    formatDate: function(date, format) {
+        var year = date.getFullYear();
+        var month = (date.getMonth() + 1).toString().padStart(2, '0');
+        var day = date.getDate().toString().padStart(2, '0');
+        var hour = date.getHours().toString().padStart(2, '0');
+        var minute = date.getMinutes().toString().padStart(2, '0');
+        var second = date.getSeconds().toString().padStart(2, '0');
+        
+        return format
+            .replace('YYYY', year)
+            .replace('MM', month)
+            .replace('DD', day)
+            .replace('HH', hour)
+            .replace('mm', minute)
+            .replace('ss', second);
+    },
+    
+    // 获取相对时间
+    getRelativeTime: function(date) {
+        var now = new Date();
+        var diff = now.getTime() - date.getTime();
+        var seconds = Math.floor(diff / 1000);
+        var minutes = Math.floor(seconds / 60);
+        var hours = Math.floor(minutes / 60);
+        var days = Math.floor(hours / 24);
+        
+        if (days > 0) {
+            return days + '天前';
+        } else if (hours > 0) {
+            return hours + '小时前';
+        } else if (minutes > 0) {
+            return minutes + '分钟前';
+        } else if (seconds > 0) {
+            return seconds + '秒前';
+        } else {
+            return '刚刚';
+        }
+    },
+    
+    // 生成各种语言代码
+    generateCode: function(input, lang) {
+        var parsed = this.parseTimeInput(input);
+        var timestamp = Math.floor(parsed.timestamp / 1000); // 转为秒
+        
+        var codes = {
+            javascript: 'var date = new Date(' + parsed.timestamp + ');\nconsole.log(date.toISOString());\n// 输出: ' + new Date(parsed.timestamp).toISOString(),
+            
+            python: 'import datetime\nfrom datetime import timezone\n\ntimestamp = ' + timestamp + '\ndate = datetime.datetime.fromtimestamp(timestamp, timezone.utc)\nprint(date.isoformat())\n# 输出: ' + new Date(parsed.timestamp).toISOString(),
+            
+            java: 'import java.time.Instant;\nimport java.time.ZoneId;\nimport java.time.format.DateTimeFormatter;\n\nInstant instant = Instant.ofEpochSecond(' + timestamp + ');\nString formatted = instant.atZone(ZoneId.systemDefault())\n    .format(DateTimeFormatter.ISO_LOCAL_DATE_TIME);\nSystem.out.println(formatted);',
+            
+            go: 'package main\n\nimport (\n    "fmt"\n    "time"\n)\n\nfunc main() {\n    timestamp := int64(' + timestamp + ')\n    t := time.Unix(timestamp, 0)\n    fmt.Println(t.Format(time.RFC3339))\n    // 输出: ' + new Date(parsed.timestamp).toISOString() + '\n}',
+            
+            php: '<?php\n$timestamp = ' + timestamp + ';\n$date = new DateTime("@$timestamp");\necho $date->format("c");\n// 输出: ' + new Date(parsed.timestamp).toISOString() + '\n?>',
+            
+            sql: '-- MySQL\nSELECT FROM_UNIXTIME(' + timestamp + ') AS formatted_date;\n\n-- PostgreSQL\nSELECT to_timestamp(' + timestamp + ') AS formatted_date;\n\n-- SQLite\nSELECT datetime(' + timestamp + ', "unixepoch") AS formatted_date;'
+        };
+        
+        return codes[lang] || '不支持的语言';
+    }
+};
+
+// DOM操作工具
+var DOMUtils = {
+    // 查找元素
+    $: function(selector) {
+        return document.querySelector(selector);
+    },
+    
+    // 查找所有元素
+    $$: function(selector) {
+        return document.querySelectorAll(selector);
+    },
+    
+    // 设置元素内容
+    setText: function(element, text) {
+        if (element) {
+            element.textContent = text;
+        }
+    },
+    
+    // 设置元素值
+    setValue: function(element, value) {
+        if (element) {
+            element.value = value;
+        }
+    },
+    
+    // 设置元素HTML
+    setHTML: function(element, html) {
+        if (element) {
+            element.innerHTML = html;
+        }
+    },
+    
+    // 添加类
+    addClass: function(element, className) {
+        if (element) {
+            element.classList.add(className);
+        }
+    },
+    
+    // 移除类
+    removeClass: function(element, className) {
+        if (element) {
+            element.classList.remove(className);
+        }
+    },
+    
+    // 切换类
+    toggleClass: function(element, className) {
+        if (element) {
+            element.classList.toggle(className);
+        }
+    },
+    
+    // 显示元素
+    show: function(element) {
+        if (element) {
+            element.style.display = '';
+        }
+    },
+    
+    // 隐藏元素
+    hide: function(element) {
+        if (element) {
+            element.style.display = 'none';
+        }
+    }
+};
+
+// 应用主类
+var TimestampApp = {
+    // 初始化
+    init: function() {
+        console.log('初始化时间戳工具...');
+        
+        // 移除Vue相关的HTML属性
+        this.cleanupVueAttributes();
+        
+        // 初始化事件监听器
+        this.initEventListeners();
+        
+        // 初始化界面
+        this.initUI();
+        
+        // 启动时间更新
+        this.startTimeUpdates();
+        
+        console.log('时间戳工具初始化完成');
+    },
+    
+    // 清理Vue属性
+    cleanupVueAttributes: function() {
+        // 移除所有Vue相关的属性 - 直接遍历所有元素
+        var allElements = document.querySelectorAll('*');
+        allElements.forEach(function(el) {
+            // 移除Vue指令属性
+            var attributes = el.attributes;
+            for (var i = attributes.length - 1; i >= 0; i--) {
+                var attr = attributes[i];
+                if (attr.name.startsWith('v-') || attr.name.startsWith(':') || attr.name.startsWith('@')) {
+                    el.removeAttribute(attr.name);
+                }
+            }
+        });
+    },
+    
+    // 初始化事件监听器
+    initEventListeners: function() {
+        var self = this;
+        
+        // 标签页切换
+        var tabLinks = DOMUtils.$$('.nav-tabs a');
+        tabLinks.forEach(function(link, index) {
+            link.addEventListener('click', function(e) {
+                e.preventDefault();
+                var tabName = ['smart-parser', 'code-generator', 'time-calculator', 'batch-converter', 'timezone-expert', 'database-tools'][index];
+                self.setActiveTab(tabName);
+            });
+        });
+        
+        // 时间控制按钮
+        var timeToggleBtn = DOMUtils.$('.time-toggle-btn');
+        if (timeToggleBtn) {
+            timeToggleBtn.addEventListener('click', function(e) {
+                e.preventDefault();
+                self.toggleTime();
+            });
+        }
+        
+        // 智能解析输入
+        var smartInput = DOMUtils.$('.smart-input');
+        if (smartInput) {
+            smartInput.addEventListener('input', function() {
+                AppState.smartParser.input = this.value;
+                self.parseSmartTime();
+            });
+        }
+        
+        // 代码生成输入
+        var codeInput = DOMUtils.$('.time-input');
+        if (codeInput) {
+            codeInput.addEventListener('input', function() {
+                AppState.codeGenerator.input = this.value;
+                self.generateCodes();
+            });
+        }
+        
+        // 代码语言选择
+        var codeLangSelect = DOMUtils.$('.language-selector select');
+        if (codeLangSelect) {
+            codeLangSelect.addEventListener('change', function() {
+                AppState.codeGenerator.selectedLang = this.value;
+                self.updateCodeDisplay();
+            });
+        }
+        
+        // 时间显示点击复制
+        var timeDisplays = DOMUtils.$$('.time-display');
+        timeDisplays.forEach(function(display) {
+            display.addEventListener('click', function() {
+                self.copyToClipboard(this.value);
+            });
+        });
+        
+        // 快捷操作按钮
+        var quickButtons = DOMUtils.$$('.quick-buttons .btn');
+        quickButtons.forEach(function(btn, index) {
+            btn.addEventListener('click', function(e) {
+                e.preventDefault();
+                var actions = ['now', 'today', 'yesterday', 'week_start', 'month_start', 'clear'];
+                self.handleQuickAction(actions[index]);
+            });
+        });
+        
+        // 智能解析器按钮
+        var parseBtn = DOMUtils.$('.parse-btn');
+        if (parseBtn) {
+            parseBtn.addEventListener('click', function(e) {
+                e.preventDefault();
+                self.parseSmartTime();
+            });
+        }
+        
+        var clearInputBtn = DOMUtils.$('.clear-input-btn');
+        if (clearInputBtn) {
+            clearInputBtn.addEventListener('click', function(e) {
+                e.preventDefault();
+                var smartInput = DOMUtils.$('.smart-input');
+                if (smartInput) {
+                    smartInput.value = '';
+                    AppState.smartParser.input = '';
+                    self.parseSmartTime();
+                }
+            });
+        }
+        
+        // 新的快捷操作按钮
+        var quickBtns = DOMUtils.$$('.quick-btn');
+        quickBtns.forEach(function(btn) {
+            btn.addEventListener('click', function(e) {
+                e.preventDefault();
+                var action = this.getAttribute('data-action');
+                self.handleQuickAction(action);
+            });
+        });
+        
+        // 代码生成器按钮
+        var generateBtn = DOMUtils.$('.generate-btn');
+        if (generateBtn) {
+            generateBtn.addEventListener('click', function(e) {
+                e.preventDefault();
+                self.generateCodes();
+            });
+        }
+        
+        // 时间计算器按钮
+        var calcBtn = DOMUtils.$('.calc-btn');
+        if (calcBtn) {
+            calcBtn.addEventListener('click', function(e) {
+                e.preventDefault();
+                self.calculateTimeDiff();
+            });
+        }
+        
+        var calcAddBtn = DOMUtils.$('.calc-add-btn');
+        if (calcAddBtn) {
+            calcAddBtn.addEventListener('click', function(e) {
+                e.preventDefault();
+                self.calculateTimeAddSubtract();
+            });
+        }
+        
+        // 批量转换器按钮
+        var batchConvertBtn = DOMUtils.$('.batch-convert-btn');
+        if (batchConvertBtn) {
+            batchConvertBtn.addEventListener('click', function(e) {
+                e.preventDefault();
+                self.batchConvert();
+            });
+        }
+        
+        var batchExportBtn = DOMUtils.$('.batch-export-btn');
+        if (batchExportBtn) {
+            batchExportBtn.addEventListener('click', function(e) {
+                e.preventDefault();
+                self.exportBatchResults();
+            });
+        }
+        
+        var batchClearBtn = DOMUtils.$('.batch-clear-btn');
+        if (batchClearBtn) {
+            batchClearBtn.addEventListener('click', function(e) {
+                e.preventDefault();
+                var batchInput = DOMUtils.$('.batch-input');
+                if (batchInput) {
+                    batchInput.value = '';
+                }
+            });
+        }
+        
+        // 时区转换器按钮
+        var timezoneConvertBtn = DOMUtils.$('.timezone-convert-btn');
+        if (timezoneConvertBtn) {
+            timezoneConvertBtn.addEventListener('click', function(e) {
+                e.preventDefault();
+                self.convertTimezone();
+            });
+        }
+        
+        // 数据库工具按钮
+        var dbGenerateBtn = DOMUtils.$('.db-generate-btn');
+        if (dbGenerateBtn) {
+            dbGenerateBtn.addEventListener('click', function(e) {
+                e.preventDefault();
+                self.generateDatabaseFormats();
+            });
+        }
+    },
+    
+    // 初始化UI
+    initUI: function() {
+        // 设置初始标签页
+        this.setActiveTab(AppState.activeTab);
+        
+        // 初始化时间显示
+        this.updateTimeDisplay();
+    },
+    
+    // 设置活跃标签页
+    setActiveTab: function(tabName) {
+        AppState.activeTab = tabName;
+        
+        // 更新标签链接样式
+        var tabLinks = DOMUtils.$$('.nav-tabs li');
+        var tabPanes = DOMUtils.$$('.tab-pane');
+        
+        tabLinks.forEach(function(link, index) {
+            var tabNames = ['smart-parser', 'code-generator', 'time-calculator', 'batch-converter', 'timezone-expert', 'database-tools'];
+            if (tabNames[index] === tabName) {
+                DOMUtils.addClass(link, 'active');
+            } else {
+                DOMUtils.removeClass(link, 'active');
+            }
+        });
+        
+        // 更新标签页内容显示
+        tabPanes.forEach(function(pane) {
+            if (pane.id === tabName) {
+                DOMUtils.addClass(pane, 'active');
+                DOMUtils.show(pane);
+            } else {
+                DOMUtils.removeClass(pane, 'active');
+                DOMUtils.hide(pane);
+            }
+        });
+    },
+    
+    // 启动时间更新
+    startTimeUpdates: function() {
+        var self = this;
+        
+        function updateTime() {
+            var now = new Date();
+            AppState.currentTime.local = TimeUtils.formatDate(now, 'YYYY-MM-DD HH:mm:ss');
+            AppState.currentTime.timestamp = Math.floor(now.getTime() / 1000);
+            AppState.currentTime.timestampMs = now.getTime();
+            
+            self.updateTimeDisplay();
+        }
+        
+        updateTime();
+        setInterval(function() {
+            if (AppState.isTimeRunning) {
+                updateTime();
+            }
+        }, 1000);
+    },
+    
+    // 更新时间显示
+    updateTimeDisplay: function() {
+        var timeInputs = DOMUtils.$$('.time-display');
+        if (timeInputs.length >= 3) {
+            DOMUtils.setValue(timeInputs[0], AppState.currentTime.local);
+            DOMUtils.setValue(timeInputs[1], AppState.currentTime.timestamp);
+            DOMUtils.setValue(timeInputs[2], AppState.currentTime.timestampMs);
+        }
+    },
+    
+    // 切换时间运行状态
+    toggleTime: function() {
+        AppState.isTimeRunning = !AppState.isTimeRunning;
+        var toggleBtn = DOMUtils.$('.time-toggle-btn');
+        if (toggleBtn) {
+            DOMUtils.setText(toggleBtn, AppState.isTimeRunning ? '⏸️ 暂停' : '▶️ 开始');
+            toggleBtn.className = AppState.isTimeRunning ? 'btn btn-sm btn-warning time-toggle-btn' : 'btn btn-sm btn-success time-toggle-btn';
+        }
+    },
+    
+    // 智能解析时间
+    parseSmartTime: function() {
+        var resultContainer = DOMUtils.$('.result-container');
+        var formatHints = DOMUtils.$('.format-hints');
+        
+        if (!AppState.smartParser.input.trim()) {
+            DOMUtils.setHTML(resultContainer, '');
+            DOMUtils.setHTML(formatHints, '');
+            return;
+        }
+        
+        try {
+            var parsed = TimeUtils.parseTimeInput(AppState.smartParser.input);
+            var results = TimeUtils.formatTimestamp(parsed.timestamp);
+            
+            AppState.smartParser.results = results;
+            AppState.smartParser.detectedFormat = parsed.format;
+            AppState.smartParser.error = '';
+            
+            // 显示检测到的格式
+            DOMUtils.setHTML(formatHints, '<span class="badge badge-info">检测到格式: ' + parsed.format + '</span>');
+            
+            // 显示解析结果 - 使用网格布局
+            var html = '<div class="parse-results-grid">';
+            results.forEach(function(result, index) {
+                var isIsoResult = result.label === 'ISO 8601';
+                var resultClass = isIsoResult ? 'result-item iso-result' : 'result-item';
+                
+                html += '<div class="' + resultClass + '">' +
+                    '<label>' + result.label + '</label>' +
+                    '<div class="result-value" onclick="TimestampApp.copyToClipboard(\'' + result.value.replace(/'/g, "\\'") + '\')" title="点击复制">' + 
+                    result.value + 
+                    '</div>' +
+                    '</div>';
+            });
+            html += '</div>';
+            DOMUtils.setHTML(resultContainer, html);
+            
+        } catch (error) {
+            AppState.smartParser.error = error.message;
+            AppState.smartParser.results = [];
+            AppState.smartParser.detectedFormat = '';
+            
+            DOMUtils.setHTML(resultContainer, '<div class="alert alert-danger">❌ ' + error.message + '</div>');
+            DOMUtils.setHTML(formatHints, '');
+        }
+    },
+    
+    // 生成代码
+    generateCodes: function() {
+        if (!AppState.codeGenerator.input.trim()) {
+            AppState.codeGenerator.codes = [];
+            this.updateCodeDisplay();
+            return;
+        }
+        
+        try {
+            var languages = ['javascript', 'python', 'java', 'go', 'php', 'sql'];
+            AppState.codeGenerator.codes = languages.map(function(lang) {
+                return {
+                    lang: lang.charAt(0).toUpperCase() + lang.slice(1),
+                    code: TimeUtils.generateCode(AppState.codeGenerator.input, lang)
+                };
+            });
+            
+            this.updateCodeDisplay();
+            
+        } catch (error) {
+            AppState.codeGenerator.codes = [{
+                lang: 'Error',
+                code: '代码生成失败: ' + error.message
+            }];
+            this.updateCodeDisplay();
+        }
+    },
+    
+    // 更新代码显示
+    updateCodeDisplay: function() {
+        var codeResults = DOMUtils.$('.code-results');
+        if (!codeResults) return;
+        
+        // 过滤代码
+        var filteredCodes = AppState.codeGenerator.codes;
+        if (AppState.codeGenerator.selectedLang !== 'all') {
+            filteredCodes = AppState.codeGenerator.codes.filter(function(code) {
+                return code.lang.toLowerCase().includes(AppState.codeGenerator.selectedLang.toLowerCase());
+            });
+        }
+        
+        // 显示代码
+        var html = '';
+        filteredCodes.forEach(function(code) {
+            html += '<div class="code-block">' +
+                '<div class="code-header">' +
+                '<span class="code-lang">' + code.lang + '</span>' +
+                '<button class="btn btn-xs btn-default" onclick="TimestampApp.copyToClipboard(\'' + code.code.replace(/'/g, "\\'").replace(/\n/g, '\\n') + '\')">📋 复制</button>' +
+                '</div>' +
+                '<pre class="code-content">' + code.code + '</pre>' +
+                '</div>';
+        });
+        DOMUtils.setHTML(codeResults, html);
+    },
+    
+    // 复制到剪贴板
+    copyToClipboard: function(text) {
+        try {
+            if (navigator.clipboard && navigator.clipboard.writeText) {
+                navigator.clipboard.writeText(text).then(function() {
+                    TimestampApp.showToast('已复制到剪贴板');
+                }).catch(function(error) {
+                    console.error('复制失败:', error);
+                    TimestampApp.fallbackCopy(text);
+                });
+            } else {
+                TimestampApp.fallbackCopy(text);
+            }
+        } catch (error) {
+            console.error('复制失败:', error);
+            TimestampApp.fallbackCopy(text);
+        }
+    },
+    
+    // 备用复制方法
+    fallbackCopy: function(text) {
+        var textarea = document.createElement('textarea');
+        textarea.value = text;
+        textarea.style.position = 'fixed';
+        textarea.style.opacity = '0';
+        document.body.appendChild(textarea);
+        textarea.select();
+        
+        try {
+            var successful = document.execCommand('copy');
+            if (successful) {
+                this.showToast('已复制到剪贴板');
+            } else {
+                this.showToast('复制失败');
+            }
+        } catch (error) {
+            console.error('复制失败:', error);
+            this.showToast('复制失败');
+        }
+        
+        document.body.removeChild(textarea);
+    },
+    
+    // 快捷操作处理
+    handleQuickAction: function(action) {
+        var smartInput = DOMUtils.$('.smart-input');
+        if (!smartInput) return;
+        
+        var value = '';
+        var now = new Date();
+        
+        switch(action) {
+            case 'now':
+                value = 'now';
+                break;
+            case 'today':
+                value = 'today';
+                break;
+            case 'yesterday':
+                value = 'yesterday';
+                break;
+            case 'week_start':
+                var weekStart = new Date(now);
+                weekStart.setDate(now.getDate() - now.getDay());
+                weekStart.setHours(0, 0, 0, 0);
+                value = TimeUtils.formatDate(weekStart, 'YYYY-MM-DD HH:mm:ss');
+                break;
+            case 'month_start':
+                var monthStart = new Date(now.getFullYear(), now.getMonth(), 1);
+                value = TimeUtils.formatDate(monthStart, 'YYYY-MM-DD HH:mm:ss');
+                break;
+            case 'clear':
+                value = '';
+                // 清空所有输入框
+                var allInputs = DOMUtils.$$('input[type="text"], textarea');
+                allInputs.forEach(function(input) {
+                    if (!input.readOnly) {
+                        input.value = '';
+                    }
+                });
+                this.showToast('已清空所有输入');
+                return;
+        }
+        
+        smartInput.value = value;
+        AppState.smartParser.input = value;
+        this.parseSmartTime();
+        
+        if (value) {
+            this.showToast('已插入: ' + value);
+        }
+    },
+    
+    // 显示提示信息
+    showToast: function(message) {
+        // 移除已存在的toast
+        var existingToast = DOMUtils.$('.toast-message');
+        if (existingToast) {
+            document.body.removeChild(existingToast);
+        }
+        
+        var toast = document.createElement('div');
+        toast.className = 'toast-message';
+        toast.textContent = message;
+        toast.style.cssText = 'position:fixed;top:20px;right:20px;background:#333;color:#fff;padding:10px 20px;border-radius:4px;z-index:9999;transition:opacity 0.3s;';
+        document.body.appendChild(toast);
+        
+        setTimeout(function() {
+            toast.style.opacity = '0';
+            setTimeout(function() {
+                if (toast.parentNode) {
+                    document.body.removeChild(toast);
+                }
+            }, 300);
+        }, 2000);
+    },
+    
+    // 计算时间差
+    calculateTimeDiff: function() {
+        var startInput = DOMUtils.$('.start-time');
+        var endInput = DOMUtils.$('.end-time');
+        var resultsDiv = DOMUtils.$('.calc-results');
+        
+        if (!startInput || !endInput || !resultsDiv) return;
+        
+        var startTime = startInput.value.trim();
+        var endTime = endInput.value.trim();
+        
+        if (!startTime || !endTime) {
+            DOMUtils.setHTML(resultsDiv, '<div class="text-warning">请输入开始时间和结束时间</div>');
+            return;
+        }
+        
+        try {
+            var start = TimeUtils.parseTimeInput(startTime);
+            var end = TimeUtils.parseTimeInput(endTime);
+            var diff = Math.floor((end.timestamp - start.timestamp) / 1000); // 转换为秒
+            
+            var html = '<div class="result-item">';
+            html += '<strong>时间差:</strong><br>';
+            html += '秒数:' + diff + ' 秒<br>';
+            html += '分钟:' + Math.floor(diff / 60) + ' 分钟<br>';
+            html += '小时:' + Math.floor(diff / 3600) + ' 小时<br>';
+            html += '天数:' + Math.floor(diff / 86400) + ' 天<br>';
+            html += '</div>';
+            
+            DOMUtils.setHTML(resultsDiv, html);
+        } catch (error) {
+            DOMUtils.setHTML(resultsDiv, '<div class="text-danger">错误:' + error.message + '</div>');
+        }
+    },
+    
+    // 计算时间加减
+    calculateTimeAddSubtract: function() {
+        var baseTimeInput = DOMUtils.$('.base-time');
+        var operationSelect = DOMUtils.$('.operation-select');
+        var amountInput = DOMUtils.$('.amount-input');
+        var unitSelect = DOMUtils.$('.unit-select');
+        var resultsDiv = DOMUtils.$('.add-subtract-results');
+        
+        if (!baseTimeInput || !operationSelect || !amountInput || !unitSelect || !resultsDiv) return;
+        
+        var baseTime = baseTimeInput.value.trim();
+        var operation = operationSelect.value;
+        var amount = parseInt(amountInput.value);
+        var unit = unitSelect.value;
+        
+        if (!baseTime || isNaN(amount)) {
+            DOMUtils.setHTML(resultsDiv, '<div class="text-warning">请输入基准时间和数量</div>');
+            return;
+        }
+        
+        try {
+            var base = TimeUtils.parseTimeInput(baseTime);
+            var timestamp = base.timestamp;
+            
+            var multiplier = {
+                'seconds': 1000,
+                'minutes': 60 * 1000,
+                'hours': 3600 * 1000,
+                'days': 86400 * 1000,
+                'months': 30 * 86400 * 1000,
+                'years': 365 * 86400 * 1000
+            };
+            
+            var change = amount * multiplier[unit];
+            if (operation === 'subtract') {
+                change = -change;
+            }
+            
+            var newTimestamp = timestamp + change;
+            var results = TimeUtils.formatTimestamp(newTimestamp);
+            
+            var html = '<div class="result-item">';
+            html += '<strong>计算结果:</strong><br>';
+            results.forEach(function(result) {
+                html += result.label + ':' + result.value + '<br>';
+            });
+            html += '</div>';
+            
+            DOMUtils.setHTML(resultsDiv, html);
+        } catch (error) {
+            DOMUtils.setHTML(resultsDiv, '<div class="text-danger">错误:' + error.message + '</div>');
+        }
+    },
+    
+    // 批量转换
+    batchConvert: function() {
+        var batchInput = DOMUtils.$('.batch-input');
+        var resultsDiv = DOMUtils.$('.batch-results');
+        var statsSpan = DOMUtils.$('.result-stats');
+        
+        if (!batchInput || !resultsDiv) return;
+        
+        var lines = batchInput.value.split('\n').filter(function(line) {
+            return line.trim();
+        });
+        
+        if (lines.length === 0) {
+            DOMUtils.setHTML(resultsDiv, '<div class="text-warning">请输入要转换的时间值</div>');
+            return;
+        }
+        
+        var results = [];
+        var successCount = 0;
+        var errorCount = 0;
+        
+        lines.forEach(function(line, index) {
+            try {
+                var parsed = TimeUtils.parseTimeInput(line.trim());
+                var formatted = TimeUtils.formatTimestamp(parsed.timestamp);
+                results.push({
+                    line: index + 1,
+                    input: line.trim(),
+                    success: true,
+                    results: formatted
+                });
+                successCount++;
+            } catch (error) {
+                results.push({
+                    line: index + 1,
+                    input: line.trim(),
+                    success: false,
+                    error: error.message
+                });
+                errorCount++;
+            }
+        });
+        
+        // 更新统计信息
+        if (statsSpan) {
+            DOMUtils.setHTML(statsSpan, '(成功:' + successCount + ',失败:' + errorCount + ')');
+        }
+        
+        // 显示结果
+        var html = '';
+        results.forEach(function(result) {
+            if (result.success) {
+                html += '<div class="mb-3">';
+                html += '<strong>第' + result.line + '行:</strong> ' + result.input + '<br>';
+                result.results.forEach(function(format) {
+                    html += '• ' + format.label + ':' + format.value + '<br>';
+                });
+                html += '</div>';
+            } else {
+                html += '<div class="mb-3 text-danger">';
+                html += '<strong>第' + result.line + '行错误:</strong> ' + result.input + '<br>';
+                html += '错误:' + result.error + '<br>';
+                html += '</div>';
+            }
+        });
+        
+        DOMUtils.setHTML(resultsDiv, html);
+    },
+    
+    // 导出批量结果
+    exportBatchResults: function() {
+        this.showToast('导出功能开发中...');
+    },
+    
+    // 时区转换
+    convertTimezone: function() {
+        var timeInput = DOMUtils.$('.timezone-time-input');
+        var fromSelect = DOMUtils.$('.from-timezone-select');
+        var toSelect = DOMUtils.$('.to-timezone-select');
+        var resultsDiv = DOMUtils.$('.timezone-results');
+        
+        if (!timeInput || !fromSelect || !toSelect || !resultsDiv) return;
+        
+        var timeValue = timeInput.value.trim();
+        var fromTimezone = fromSelect.value;
+        var toTimezone = toSelect.value;
+        
+        if (!timeValue) {
+            DOMUtils.setHTML(resultsDiv, '<div class="text-warning">请输入时间</div>');
+            return;
+        }
+        
+        try {
+            var parsed = TimeUtils.parseTimeInput(timeValue);
+            var fromDate = new Date(parsed.timestamp);
+            
+            var html = '<div class="result-item">';
+            html += '<strong>时区转换结果:</strong><br>';
+            html += '原时间:' + timeValue + ' (' + fromTimezone + ')<br>';
+            html += '目标时区:' + toTimezone + '<br>';
+            html += '转换结果:' + TimeUtils.formatDate(fromDate, 'YYYY-MM-DD HH:mm:ss') + '<br>';
+            html += '</div>';
+            
+            DOMUtils.setHTML(resultsDiv, html);
+        } catch (error) {
+            DOMUtils.setHTML(resultsDiv, '<div class="text-danger">错误:' + error.message + '</div>');
+        }
+    },
+    
+    // 生成数据库格式
+    generateDatabaseFormats: function() {
+        var timeInput = DOMUtils.$('.db-time-input');
+        var dbSelect = DOMUtils.$('.db-type-select');
+        var resultsDiv = DOMUtils.$('.db-results');
+        
+        if (!timeInput || !dbSelect || !resultsDiv) return;
+        
+        var timeValue = timeInput.value.trim();
+        var dbType = dbSelect.value;
+        
+        if (!timeValue) {
+            DOMUtils.setHTML(resultsDiv, '<div class="text-warning">请输入时间值</div>');
+            return;
+        }
+        
+        try {
+            var parsed = TimeUtils.parseTimeInput(timeValue);
+            var date = new Date(parsed.timestamp);
+            
+            var html = '<div class="result-item">';
+            html += '<strong>' + dbType.toUpperCase() + ' 格式:</strong><br>';
+            
+            switch (dbType) {
+                case 'mysql':
+                    html += 'DATETIME:' + TimeUtils.formatDate(date, 'YYYY-MM-DD HH:mm:ss') + '<br>';
+                    html += 'TIMESTAMP:' + Math.floor(parsed.timestamp / 1000) + '<br>';
+                    html += 'SQL示例:<br>';
+                    html += '<code>SELECT * FROM table WHERE created_at = \'' + TimeUtils.formatDate(date, 'YYYY-MM-DD HH:mm:ss') + '\';</code><br>';
+                    break;
+                case 'postgresql':
+                    html += 'TIMESTAMP:' + TimeUtils.formatDate(date, 'YYYY-MM-DD HH:mm:ss') + '<br>';
+                    html += 'TIMESTAMPTZ:' + date.toISOString() + '<br>';
+                    html += 'EPOCH:' + Math.floor(parsed.timestamp / 1000) + '<br>';
+                    break;
+                case 'sqlite':
+                    html += 'TEXT:' + TimeUtils.formatDate(date, 'YYYY-MM-DD HH:mm:ss') + '<br>';
+                    html += 'INTEGER:' + Math.floor(parsed.timestamp / 1000) + '<br>';
+                    break;
+                case 'mongodb':
+                    html += 'ISODate:ISODate("' + date.toISOString() + '")<br>';
+                    html += 'ObjectId时间戳:' + Math.floor(parsed.timestamp / 1000).toString(16).padStart(8, '0') + '0000000000000000<br>';
+                    break;
+            }
+            html += '</div>';
+            
+            DOMUtils.setHTML(resultsDiv, html);
+        } catch (error) {
+            DOMUtils.setHTML(resultsDiv, '<div class="text-danger">错误:' + error.message + '</div>');
+        }
+    }
+};
+
+// 页面加载完成后初始化
+document.addEventListener('DOMContentLoaded', function() {
+    TimestampApp.init();
+});
+
+// 全局暴露主要对象(用于调试)
+window.TimestampApp = TimestampApp;
+window.AppState = AppState;
+window.TimeUtils = TimeUtils;