init 2
This commit is contained in:
262
index.html
262
index.html
@@ -4,7 +4,7 @@
|
|||||||
<base target="_top">
|
<base target="_top">
|
||||||
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
|
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
|
||||||
<style>
|
<style>
|
||||||
/* --- 基础变量与重置 --- */
|
/* --- 基础变量 --- */
|
||||||
:root {
|
:root {
|
||||||
--bg-color: #f8fafc;
|
--bg-color: #f8fafc;
|
||||||
--card-bg: #ffffff;
|
--card-bg: #ffffff;
|
||||||
@@ -12,41 +12,31 @@
|
|||||||
--text-muted: #64748b;
|
--text-muted: #64748b;
|
||||||
--border-color: #e2e8f0;
|
--border-color: #e2e8f0;
|
||||||
--accent-blue: #2563eb;
|
--accent-blue: #2563eb;
|
||||||
--accent-hover: #1d4ed8;
|
--card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
||||||
--header-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
|
||||||
--card-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
|
|
||||||
|
|
||||||
/* 状态颜色 */
|
|
||||||
--color-safe: #10b981;
|
--color-safe: #10b981;
|
||||||
--color-unsafe: #ef4444;
|
--color-unsafe: #ef4444;
|
||||||
--color-unknown: #f59e0b;
|
--color-unknown: #f59e0b;
|
||||||
--type-web: #06b6d4;
|
|
||||||
--type-soft: #6366f1;
|
|
||||||
--type-ext: #f59e0b;
|
|
||||||
|
|
||||||
font-size: 16px; /* 基础字号 */
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- 暗黑模式变量 --- */
|
|
||||||
.dark-mode {
|
.dark-mode {
|
||||||
--bg-color: #0f172a;
|
--bg-color: #0f172a;
|
||||||
--card-bg: #1e293b;
|
--card-bg: #1e293b;
|
||||||
--text-main: #f1f5f9;
|
--text-main: #f1f5f9;
|
||||||
--text-muted: #94a3b8;
|
--text-muted: #94a3b8;
|
||||||
--border-color: #334155;
|
--border-color: #334155;
|
||||||
--header-shadow: 0 4px 6px rgba(0,0,0,0.3);
|
|
||||||
--card-shadow: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- 全局样式 --- */
|
/* --- 全局样式 --- */
|
||||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||||
|
|
||||||
body {
|
body {
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||||
background-color: var(--bg-color);
|
background-color: var(--bg-color);
|
||||||
color: var(--text-main);
|
color: var(--text-main);
|
||||||
line-height: 1.5;
|
line-height: 1.6;
|
||||||
/* 字体平滑优化 */
|
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
transition: background-color 0.3s, color 0.3s;
|
transition: background-color 0.3s, color 0.3s;
|
||||||
@@ -55,82 +45,76 @@
|
|||||||
[v-cloak] { display: none; }
|
[v-cloak] { display: none; }
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
max-width: 1200px;
|
max-width: 1280px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 2rem 1rem;
|
padding: 2rem 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- 头部设计 --- */
|
/* --- 头部 --- */
|
||||||
.header {
|
.header {
|
||||||
background: var(--card-bg);
|
background: var(--card-bg);
|
||||||
padding: 1.5rem 2rem;
|
padding: 1.5rem 2rem;
|
||||||
border-radius: 1.25rem;
|
border-radius: 1rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
border: 1px solid var(--border-color);
|
border: 1px solid var(--border-color);
|
||||||
box-shadow: var(--header-shadow);
|
box-shadow: var(--card-shadow);
|
||||||
}
|
}
|
||||||
|
|
||||||
.brand h1 {
|
.brand h1 {
|
||||||
font-size: 1.75rem;
|
font-size: 1.5rem;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
letter-spacing: -0.02em;
|
|
||||||
color: var(--accent-blue);
|
color: var(--accent-blue);
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|
||||||
.brand p {
|
.brand p {
|
||||||
font-size: 0.85rem;
|
font-size: 0.8rem;
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
letter-spacing: 0.1em;
|
letter-spacing: 0.1em;
|
||||||
margin-top: 0.25rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls {
|
.controls {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 1rem;
|
gap: 0.75rem;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="text"] {
|
input[type="text"] {
|
||||||
padding: 0.75rem 1.25rem;
|
padding: 0.6rem 1rem;
|
||||||
border-radius: 0.75rem;
|
border-radius: 0.5rem;
|
||||||
border: 1px solid var(--border-color);
|
border: 1px solid var(--border-color);
|
||||||
background: var(--bg-color);
|
background: var(--bg-color);
|
||||||
color: var(--text-main);
|
color: var(--text-main);
|
||||||
font-size: 1rem;
|
font-size: 0.9rem;
|
||||||
width: 300px;
|
width: 260px;
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="text"]:focus { border-color: var(--accent-blue); }
|
|
||||||
|
|
||||||
select {
|
select {
|
||||||
padding: 0.75rem;
|
padding: 0.6rem;
|
||||||
border-radius: 0.75rem;
|
border-radius: 0.5rem;
|
||||||
border: 1px solid var(--border-color);
|
border: 1px solid var(--border-color);
|
||||||
background: var(--bg-color);
|
background: var(--bg-color);
|
||||||
color: var(--text-main);
|
color: var(--text-main);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-weight: 600;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-btn {
|
.theme-btn {
|
||||||
background: var(--bg-color);
|
background: var(--bg-color);
|
||||||
border: 1px solid var(--border-color);
|
border: 1px solid var(--border-color);
|
||||||
padding: 0.75rem;
|
padding: 0.5rem 0.75rem;
|
||||||
border-radius: 0.75rem;
|
border-radius: 0.5rem;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 1.2rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- 表格设计 --- */
|
/* --- 表格样式 --- */
|
||||||
.table-card {
|
.table-container {
|
||||||
background: var(--card-bg);
|
background: var(--card-bg);
|
||||||
border-radius: 1.5rem;
|
border-radius: 1rem;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border: 1px solid var(--border-color);
|
border: 1px solid var(--border-color);
|
||||||
box-shadow: var(--card-shadow);
|
box-shadow: var(--card-shadow);
|
||||||
@@ -139,130 +123,119 @@
|
|||||||
table {
|
table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
table-layout: fixed;
|
table-layout: fixed; /* 固定布局确保宽度可控 */
|
||||||
}
|
}
|
||||||
|
|
||||||
th {
|
th {
|
||||||
background: rgba(0, 0, 0, 0.02);
|
background: rgba(0, 0, 0, 0.02);
|
||||||
padding: 1.25rem 1.5rem;
|
padding: 1rem 1.5rem;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-size: 0.9rem;
|
font-size: 0.85rem;
|
||||||
font-weight: 700;
|
font-weight: 600;
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: 0.05em;
|
|
||||||
border-bottom: 1px solid var(--border-color);
|
border-bottom: 1px solid var(--border-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
td {
|
td {
|
||||||
padding: 1.5rem;
|
padding: 1.25rem 1.5rem;
|
||||||
border-bottom: 1px solid var(--border-color);
|
border-bottom: 1px solid var(--border-color);
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
font-size: 0.95rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
tr:last-child td { border-bottom: none; }
|
tr:hover { background: rgba(37, 99, 235, 0.02); }
|
||||||
tr:hover { background: rgba(37, 99, 235, 0.03); }
|
|
||||||
|
|
||||||
/* --- 项目信息单元格 --- */
|
/* 项目信息列 */
|
||||||
.item-info { display: flex; align-items: center; gap: 1.25rem; }
|
.item-cell { display: flex; align-items: center; gap: 1rem; }
|
||||||
|
|
||||||
.icon-wrapper {
|
.icon-box {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 56px;
|
width: 48px;
|
||||||
height: 56px;
|
height: 48px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-icon {
|
.icon-img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
border-radius: 1rem;
|
border-radius: 0.75rem;
|
||||||
background: #eee;
|
|
||||||
border: 1px solid var(--border-color);
|
border: 1px solid var(--border-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.safety-dot {
|
.status-dot {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: -2px;
|
bottom: -2px;
|
||||||
right: -2px;
|
right: -2px;
|
||||||
width: 14px;
|
width: 12px;
|
||||||
height: 14px;
|
height: 12px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: 2px solid var(--card-bg);
|
border: 2px solid var(--card-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-text h3 {
|
.item-desc h3 {
|
||||||
font-size: 1.2rem; /* 调大项目名 */
|
font-size: 1.1rem;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
margin-bottom: 0.25rem;
|
margin-bottom: 0.15rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-text p {
|
.item-desc p {
|
||||||
font-size: 1rem; /* 调大备注 */
|
font-size: 0.85rem;
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- 标签样式 --- */
|
/* 标签与文本 */
|
||||||
.badge {
|
.type-label {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 0.4rem 0.8rem;
|
padding: 0.25rem 0.75rem;
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
font-weight: 600;
|
||||||
|
border: 1px solid currentColor;
|
||||||
|
background: rgba(0,0,0,0.03);
|
||||||
|
}
|
||||||
|
|
||||||
|
.safety-text {
|
||||||
|
font-weight: 400; /* 取消加粗 */
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plat-tag {
|
||||||
|
font-size: 0.75rem;
|
||||||
|
background: var(--bg-color);
|
||||||
|
padding: 0.2rem 0.4rem;
|
||||||
|
border-radius: 0.3rem;
|
||||||
|
border: 1px solid var(--border-color);
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.date-val {
|
||||||
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-link {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
background: #eff6ff;
|
||||||
|
color: var(--accent-blue);
|
||||||
|
text-decoration: none;
|
||||||
border-radius: 0.5rem;
|
border-radius: 0.5rem;
|
||||||
font-size: 0.85rem;
|
font-size: 0.85rem;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
border: 1px solid transparent;
|
transition: 0.2s;
|
||||||
white-space: nowrap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.type-badge.网站 { color: var(--type-web); border-color: var(--type-web); background: rgba(6, 182, 212, 0.1); }
|
.btn-link:hover {
|
||||||
.type-badge.软件 { color: var(--type-soft); border-color: var(--type-soft); background: rgba(99, 102, 241, 0.1); }
|
|
||||||
.type-badge.浏览器扩展 { color: var(--type-ext); border-color: var(--type-ext); background: rgba(245, 158, 11, 0.1); }
|
|
||||||
|
|
||||||
.safety-text {
|
|
||||||
font-size: 0.95rem;
|
|
||||||
font-weight: 800;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.platform-tag {
|
|
||||||
font-size: 0.75rem;
|
|
||||||
background: var(--bg-color);
|
|
||||||
padding: 0.25rem 0.5rem;
|
|
||||||
border-radius: 0.4rem;
|
|
||||||
border: 1px solid var(--border-color);
|
|
||||||
margin-right: 0.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.visit-btn {
|
|
||||||
display: inline-block;
|
|
||||||
padding: 0.6rem 1.25rem;
|
|
||||||
background: rgba(37, 99, 235, 0.1);
|
|
||||||
color: var(--accent-blue);
|
|
||||||
text-decoration: none;
|
|
||||||
border-radius: 0.75rem;
|
|
||||||
font-size: 0.9rem;
|
|
||||||
font-weight: 700;
|
|
||||||
transition: all 0.2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.visit-btn:hover {
|
|
||||||
background: var(--accent-blue);
|
background: var(--accent-blue);
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.date-text { font-family: monospace; font-size: 0.9rem; color: var(--text-muted); }
|
/* 移动端隐藏部分列 */
|
||||||
|
@media (max-width: 1024px) {
|
||||||
/* 响应式调整 */
|
|
||||||
@media (max-width: 768px) {
|
|
||||||
.header { flex-direction: column; }
|
|
||||||
input[type="text"] { width: 100%; }
|
|
||||||
th:nth-child(3), td:nth-child(3), th:nth-child(5), td:nth-child(5) { display: none; }
|
th:nth-child(3), td:nth-child(3), th:nth-child(5), td:nth-child(5) { display: none; }
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -279,68 +252,65 @@
|
|||||||
|
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input v-model="searchTerm" type="text" :placeholder="ui[lang].searchPlaceholder">
|
<input v-model="searchTerm" type="text" :placeholder="ui[lang].searchPlaceholder">
|
||||||
|
|
||||||
<select v-model="lang">
|
<select v-model="lang">
|
||||||
<option value="cn">中文</option>
|
<option value="cn">中文</option>
|
||||||
<option value="en">ENGLISH</option>
|
<option value="en">ENGLISH</option>
|
||||||
<option value="es">ESPAÑOL</option>
|
<option value="es">ESPAÑOL</option>
|
||||||
</select>
|
</select>
|
||||||
|
<button @click="toggleDark" class="theme-btn">{{ isDark ? '☀️' : '🌙' }}</button>
|
||||||
<button @click="toggleDark" class="theme-btn">
|
|
||||||
{{ isDark ? '☀️' : '🌙' }}
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="table-card">
|
<div class="table-container">
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width: 40%;">{{ ui[lang].colName }}</th>
|
<th style="width: 35%;">{{ ui[lang].colName }}</th>
|
||||||
<th style="width: 15%;">{{ ui[lang].colType }}</th>
|
<th style="width: 12%;">{{ ui[lang].colType }}</th>
|
||||||
<th style="width: 15%;">Platforms</th>
|
<th style="width: 15%;">{{ ui[lang].colPlat }}</th>
|
||||||
<th style="width: 12%;">{{ ui[lang].colSafety }}</th>
|
<th style="width: 12%;">{{ ui[lang].colSafety }}</th>
|
||||||
<th style="width: 18%; text-align: right;">Action</th>
|
<th style="width: 13%;">{{ ui[lang].colDate }}</th>
|
||||||
|
<th style="width: 13%; text-align: right;">{{ ui[lang].colAction }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="item in filteredItems" :key="item.id">
|
<tr v-for="item in filteredItems" :key="item.id">
|
||||||
<td>
|
<td>
|
||||||
<div class="item-info">
|
<div class="item-cell">
|
||||||
<div class="icon-wrapper">
|
<div class="icon-box">
|
||||||
<img :src="item.icon" @error="e => e.target.src = defaultIcon" class="item-icon">
|
<img :src="item.icon" @error="e => e.target.src = defaultIcon" class="icon-img">
|
||||||
<div class="safety-dot" :style="{ background: getSafetyColor(item.safety) }"></div>
|
<div class="status-dot" :style="{ background: getSafetyColor(item.safety) }"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-text">
|
<div class="item-desc">
|
||||||
<h3>{{ item.name }}</h3>
|
<h3>{{ item.name }}</h3>
|
||||||
<p>{{ item.note }}</p>
|
<p>{{ item.note }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="badge type-badge" :class="item.type">
|
<span class="type-label" :style="{ color: getTypeColor(item.type) }">
|
||||||
{{ translateStatic(item.type) }}
|
{{ translateStatic(item.type) }}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span v-for="p in splitPlatform(item.platform)" class="platform-tag">{{ p }}</span>
|
<div style="display: flex; flex-wrap: wrap; gap: 4px;">
|
||||||
|
<span v-for="p in splitPlatform(item.platform)" class="plat-tag">{{ p }}</span>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="safety-text" :style="{ color: getSafetyColor(item.safety) }">
|
<div class="safety-text" :style="{ color: getSafetyColor(item.safety) }">
|
||||||
● {{ translateStatic(item.safety) }}
|
● {{ translateStatic(item.safety) }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<span class="date-val">{{ formatDate(item.date) }}</span>
|
||||||
|
</td>
|
||||||
<td style="text-align: right;">
|
<td style="text-align: right;">
|
||||||
<div class="date-text" style="margin-bottom: 0.5rem;">{{ formatDate(item.date) }}</div>
|
<a v-if="item.url" :href="item.url" target="_blank" class="btn-link">{{ ui[lang].linkBtn }}</a>
|
||||||
<a v-if="item.url" :href="item.url" target="_blank" class="visit-btn">{{ ui[lang].linkBtn }}</a>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div v-if="loading" style="padding: 5rem; text-align: center; color: var(--text-muted);">
|
|
||||||
同步云端数据中...
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -357,9 +327,9 @@ createApp({
|
|||||||
const defaultIcon = 'https://cdn-icons-png.flaticon.com/512/684/684831.png';
|
const defaultIcon = 'https://cdn-icons-png.flaticon.com/512/684/684831.png';
|
||||||
|
|
||||||
const ui = {
|
const ui = {
|
||||||
cn: { subtitle: '全球数据资源索引', searchPlaceholder: '搜索名称、备注...', colName: '项目描述', colType: '类型', colSafety: '安全性', linkBtn: '访问官网' },
|
cn: { subtitle: '全球数据资源索引', searchPlaceholder: '搜索...', colName: '项目描述', colType: '类型', colPlat: '平台', colSafety: '安全性', colDate: '最近更新', colAction: '操作', linkBtn: '访问官网' },
|
||||||
en: { subtitle: 'GLOBAL RESOURCE INDEX', searchPlaceholder: 'Search...', colName: 'Description', colType: 'Type', colSafety: 'Security', linkBtn: 'VISIT' },
|
en: { subtitle: 'GLOBAL INDEX', searchPlaceholder: 'Search...', colName: 'Description', colType: 'Type', colPlat: 'Platform', colSafety: 'Security', colDate: 'Updated', colAction: 'Action', linkBtn: 'VISIT' },
|
||||||
es: { subtitle: 'ÍNDICE DE RECURSOS', searchPlaceholder: 'Buscar...', colName: 'Descripción', colType: 'Tipo', colSafety: 'Seguridad', linkBtn: 'VISITAR' }
|
es: { subtitle: 'ÍNDICE GLOBAL', searchPlaceholder: 'Buscar...', colName: 'Descripción', colType: 'Tipo', colPlat: 'Plataforma', colSafety: 'Seguridad', colDate: 'Fecha', colAction: 'Acción', linkBtn: 'VISITAR' }
|
||||||
};
|
};
|
||||||
|
|
||||||
const staticMap = {
|
const staticMap = {
|
||||||
@@ -416,17 +386,23 @@ createApp({
|
|||||||
return '#f59e0b';
|
return '#f59e0b';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getTypeColor = (type) => {
|
||||||
|
if (type === '网站') return '#06b6d4';
|
||||||
|
if (type === '软件') return '#6366f1';
|
||||||
|
return '#f59e0b';
|
||||||
|
};
|
||||||
|
|
||||||
const formatDate = (dateStr) => {
|
const formatDate = (dateStr) => {
|
||||||
if (!dateStr) return '';
|
if (!dateStr) return '--';
|
||||||
const d = new Date(dateStr);
|
const d = new Date(dateStr);
|
||||||
return d.toLocaleDateString(lang.value === 'cn' ? 'zh-CN' : 'en-US');
|
return d.toISOString().split('T')[0].replace(/-/g, '/');
|
||||||
};
|
};
|
||||||
|
|
||||||
const toggleDark = () => isDark.value = !isDark.value;
|
const toggleDark = () => isDark.value = !isDark.value;
|
||||||
|
|
||||||
onMounted(fetchData);
|
onMounted(fetchData);
|
||||||
|
|
||||||
return { lang, searchTerm, loading, isDark, filteredItems, ui, defaultIcon, toggleDark, translateStatic, getSafetyColor, formatDate, splitPlatform };
|
return { lang, searchTerm, loading, isDark, filteredItems, ui, defaultIcon, toggleDark, translateStatic, getSafetyColor, getTypeColor, formatDate, splitPlatform };
|
||||||
}
|
}
|
||||||
}).mount('#app');
|
}).mount('#app');
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user