vue3+echarts实现基于indexdb的工厂企业erp管理系统代码
代码语言:html
所属分类:其他
代码描述:vue3+echarts实现基于indexdb的工厂企业erp管理系统代码
代码标签: vue echarts 基于 indexdb 工厂 企业 erp 管理 系统 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>厂长专用ERP - ECharts仪表盘版</title> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/vue3.2.22.js"></script> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/echarts.js"></script> <style> :root { --primary-color: #007bff; --primary-hover-color: #0056b3; --bg-color: #f8f9fa; --sidebar-bg: #343a40; --sidebar-text: #adb5bd; --sidebar-active-text: #ffffff; --sidebar-active-bg: #007bff; --text-color: #212529; --border-color: #dee2e6; --card-bg: #ffffff; --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05); --success-color: #28a745; --warning-color: #ffc107; --danger-color: #dc3545; --info-color: #17a2b8; } * { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; } body, html { height: 100%; background-color: var(--bg-color); color: var(--text-color); font-size: 14px; -webkit-font-smoothing: antialiased; } #app { display: flex; height: 100vh; } .sidebar { width: 240px; background-color: var(--sidebar-bg); overflow-y: scroll;color: var(--sidebar-text); padding: 15px 0; flex-shrink: 0; display: flex; flex-direction: column; } .sidebar-header { padding: 10px 25px 25px 25px; display: flex; align-items: center; font-size: 20px; font-weight: 600; color: #fff; } .sidebar-header svg { width: 36px; height: 36px; margin-right: 12px; fill: var(--primary-color); } .menu-group-title { padding: 15px 25px 5px; font-size: 11px; font-weight: 700; color: #6c757d; text-transform: uppercase; letter-spacing: .05em; } .menu-item { display: flex; align-items: center; padding: 12px 25px; margin: 4px 10px; cursor: pointer; border-radius: 6px; transition: all 0.2s ease-in-out; } .menu-item svg { width: 18px; height: 18px; margin-right: 15px; opacity: 0.7; transition: all 0.2s ease-in-out; } .menu-item:hover { background-color: rgba(255, 255, 255, 0.05); color: #f8f9fa; } .menu-item.active { background-color: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 500; } .menu-item.active svg { opacity: 1; } .main-content { flex-grow: 1; display: flex; flex-direction: column; overflow-y: auto; } .page-header { padding: 24px 32px; background: var(--card-bg); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 10; } .page-header h1 { font-size: 28px; font-weight: 600; } .page-content { padding: 24px 32px; flex-grow: 1; } .content-card { background: var(--card-bg); padding: 24px; border-radius: 8px; box-shadow: var(--card-shadow); margin-bottom: 24px; } .toolbar { margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; } button { padding: 10px 20px; border: none; background-color: var(--primary-color); color: white; border-radius: 6px; cursor: pointer; transition: all 0.2s ease; font-size: 14px; font-weight: 500; } button:hover { background-color: var(--primary-hover-color); transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2); } button:disabled { background-color: #6c757d; cursor: not-allowed; transform: none; box-shadow: none; } button.secondary { background-color: #6c757d; } button.secondary:hover { background-color: #5a6268; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); } button.danger { background-color: var(--danger-color); } button.danger:hover { background-color: #c82333; box-shadow: 0 4px 8px rgba(220, 53, 69, 0.2); } button.success { background-color: var(--success-color); } button.success:hover { background-color: #218838; box-shadow: 0 4px 8px rgba(40, 167, 69, 0.2); } table { width: 100%; border-collapse: collapse; margin-top: 20px; } th, td { padding: 15px; border-bottom: 1px solid var(--border-color); text-align: left; vertical-align: middle; } th { background-color: #f8f9fa; font-weight: 600; font-size: 13px; color: #6c757d; text-transform: uppercase; } tbody tr:hover { background-color: #f1f3f5; } .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); display: flex; justify-content: center; align-items: center; z-index: 1000; backdrop-filter: blur(5px); } .modal-content { background: white; padding: 30px 40px; border-radius: 12px; width: 90%; max-width: 700px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); transform: scale(0.95); opacity: 0; animation: modal-fade-in 0.3s forwards; } @keyframes modal-fade-in { to { transform: scale(1); opacity: 1; } } .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid var(--border-color); } .modal-header h3 { font-size: 22px; font-weight: 600; } .modal-header .close-btn { background: none; border: none; font-size: 24px; color: #6c757d; cursor: pointer; } .form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; } .form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 14px; transition: border-color 0.2s, box-shadow 0.2s; } .form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25); } .modal-footer { margin-top: 30px; text-align: right; } .modal-footer button { margin-left: 10px; } .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; } .form-grid .full-width { grid-column: 1 / -1; } .badge { padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; color: #fff; } .badge.primary { background-color: var(--primary-color); } .badge.success { background-color: var(--success-color); } .badge.warning { background-color: var(--warning-color); color: #212529; } .badge.danger { background-color: var(--danger-color); } .badge.info { background-color: var(--info-color); } /* Dashboard specific styles */ .dashboard-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; } .stat-card { background: var(--card-bg); padding: 20px; border-radius: 8px; box-shadow: var(--card-shadow); display: flex; align-items: center; transition: all 0.3s ease; } .stat-card:hover { transform: translateY(-5px); box-shadow: 0 8px 15px rgba(0,0,0,0.07); } .stat-card-icon { width: 48px; height: 48px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-right: 20px; } .stat-card-icon svg { width: 24px; height: 24px; color: #fff; } .stat-card-info h4 { font-size: 14px; color: #6c757d; margin-bottom: 5px; font-weight: 500;} .stat-card-info p { font-size: 26px; font-weight: 700; color: var(--text-color); } .charts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 24px; } .chart-container { height: 320px; width: 100%; } @media (max-width: 1200px) { .charts-grid { grid-template-columns: 1fr; } } </style> </head> <body> <div id="app"> <!-- Sidebar and other components remain unchanged --> <div class="sidebar"> <div class="sidebar-header"><svg viewBox="0 0 1024 1024"><path d="M512 64l448 225.9V792c0 112.5-199.1 203.2-448 203.2S64 904.5 64 792V289.9L512 64z m0 60.8L128 320.6v471.4c0 74.8 172.5 135.2 384 135.2s384-60.4 384-135.2V320.6L512 124.8zM294.2 429.3h435.6l-131 66-186.8-94.1-117.8 28.1zM512 480.3l213.8 107.7-213.8 107.7-213.8-107.7L512 480.3z" fill="currentColor"></path></svg><span>厂长ERP</span></div> <div v-for="group in menuItems" :key="group.title"> <div class="menu-group-title">{{ group.title }}</div> <div v-for="item in group.items" :key="item.page" class="menu-item" :class="{ active: currentPage === item.page }" @click="navigateTo(item.page)"> <span v-html="item.icon" style="fill: currentColor;"></span><span>{{ item.name }}</span> </div> </div> </div> <div class="main-content"> <component :is="currentPageComponent" @navigate="navigateToWithState"></component> </div> </div> <script type="module"> const { createApp, ref, reactive, onMounted, onUnmounted, computed, defineComponent, nextTick } = Vue; // SVG icons... const icons = { dashboard: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z"/></svg>`, sales: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M21.822 7.431A1 1 0 0 0 21 7H7.414l-2-2H3a1 1 0 0 0 0 2h1.586l2.743 2.743L8.11 15.41l-1.092.936a1 1 0 0 0 .813 1.654h10.24a1 1 0 0 0 .813-1.654l-1.092-.936.758-2.257A1 1 0 0 0 18 12H9.274l-1-1h10.42a1 1 0 0 0 .94-.664l1.666-5.895zM9 21a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm10 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"/></svg>`, production: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M22 17c0 1.657-3.134 3-7 3s-7-1.343-7-3h14zm-14-1a5 5 0 0 1 10 0H8zm12.87-8.12a2.993 2.993 0 0 0-2.333-2.333A8.956 8.956 0 0 0 12 5a8.956 8.956 0 0 0-6.537 1.547A2.993 2.993 0 0 0 3.13 8.88 8.956 8.956 0 0 0 1.583 15h1.024A6.963 6.963 0 0 1 5 9.17V15h2V9.17A6.963 6.963 0 0 1 9.4 15h2V9.17c0-1.32.32-2.553.89-3.633a.997.997 0 0 1 1.42 0c.57.98.89 2.313.89 3.633V15h2V9.17A6.963 6.963 0 0 1 17.6 15h2V9.17a6.963 6.963 0 0 1 2.393-5.83z"/></svg>`, purchase: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M20 6h-2.586l-2.707-2.707A.996.996 0 0 0 14 3H10a.996.996 0 0 0-.707.293L6.586 6H4c-1.103 0-2 .897-2 2v11c0 1.103.897 2 2 2h16c1.103 0 2-.897 2-2V8c0-1.103-.897-2-2-2zM12 18c-2.757 0-5-2.243-5-5s2.243-5 5-5 5 2.243 5 5-2.243 5-5 5z"/><path fill="currentColor" d="M12 10c-1.654 0-3 1.346-3 3s1.346 3 3 3 3-1.346 3-3-1.346-3-3-3z"/></svg>`, warehouse: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M20 18h-2v-4h2v4zm-4 0h-2v-4h2v4zm-4 0H8v-4h4v4zM22 6l-10-4-10 4v2h20V6zM4 9v9h16V9H4z"/></svg>`, settings: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill=&.........完整代码请登录后点击上方下载按钮下载查看
网友评论0