add
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>资产详情 - 资产辅助系统</title>
|
||||
<link rel="stylesheet" href="../../assets/css/common.css">
|
||||
<link rel="stylesheet" href="../../assets/css/dark-theme.css">
|
||||
<style>
|
||||
.asset-detail { margin-top: 20px; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
|
||||
.dark-theme .asset-detail { background: #2c3e50; }
|
||||
.detail-item { margin-bottom: 15px; display: flex; }
|
||||
.detail-label { width: 120px; font-weight: bold; }
|
||||
.btn-back { margin-top: 20px; padding: 8px 16px; background: #3498db; color: white; border: none; border-radius: 4px; cursor: pointer; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main-content">
|
||||
<h2>资产详情</h2>
|
||||
<div class="asset-detail">
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">资产ID:</div>
|
||||
<div id="asset-id">--</div>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">资产名称:</div>
|
||||
<div id="asset-name">--</div>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">资产类型:</div>
|
||||
<div id="asset-type">--</div>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">购买日期:</div>
|
||||
<div>2024-01-15</div>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">状态:</div>
|
||||
<div style="color: #27ae60;">运行中</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn-back" onclick="goBack()">返回列表</button>
|
||||
</div>
|
||||
|
||||
<script type="module">
|
||||
import { Router } from '../../assets/js/core/router.js';
|
||||
|
||||
// 获取资产ID参数
|
||||
function getAssetId() {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
return params.get('id') || '';
|
||||
}
|
||||
|
||||
// 初始化详情数据
|
||||
function initDetail() {
|
||||
const assetId = getAssetId();
|
||||
if (!assetId) return;
|
||||
|
||||
document.getElementById('asset-id').textContent = assetId;
|
||||
|
||||
// 模拟根据ID获取资产名称和类型
|
||||
const assetMap = {
|
||||
'ASSET-001': { name: '服务器-Web01', type: '服务器' },
|
||||
'ASSET-002': { name: '交换机-SW02', type: '网络设备' }
|
||||
};
|
||||
|
||||
const asset = assetMap[assetId] || { name: '未知资产', type: '未知类型' };
|
||||
document.getElementById('asset-name').textContent = asset.name;
|
||||
document.getElementById('asset-type').textContent = asset.type;
|
||||
}
|
||||
|
||||
function goBack() {
|
||||
Router.push('asset-list.html');
|
||||
}
|
||||
|
||||
// 初始化
|
||||
initDetail();
|
||||
</script>
|
||||
<script type="module" src="../../assets/js/app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user