tailwindcss+vue3实现一个crm客户关系管理系统pc端后台原型图代码
代码语言:html
所属分类:其他
代码描述:tailwindcss+vue3实现一个crm客户关系管理系统pc端后台原型图代码
代码标签: tailwind vue crm 客户 关系 管理 系统 pc端 后台 原型图 代码
下面为部分代码预览,完整代码请点击下载或在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>企业级CRM管理系统</title>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/tailwindcss.3.4.16.js"></script>
<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.5.5.0.js"></script>
<style>
[v-cloak] { display: none; }
.sidebar-transition { transition: all 0.3s ease; }
</style>
</head>
<body class="bg-gray-50">
<div id="app" v-cloak>
<!-- 登录页面 -->
<div v-if="currentPage === 'login'" class="min-h-screen flex items-center justify-center bg-gradient-to-br from-blue-600 to-purple-700">
<div class="bg-white p-8 rounded-lg shadow-2xl w-full max-w-md">
<div class="text-center mb-8">
<h1 class="text-3xl font-bold text-gray-800">CRM系统</h1>
<p class="text-gray-600 mt-2">企业级客户关系管理</p>
</div>
<form @submit.prevent="login">
<div class="mb-6">
<label class="block text-gray-700 text-sm font-bold mb-2">用户名</label>
<input v-model="loginForm.username" type="text" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="请输入用户名" required>
</div>
<div class="mb-6">
<label class="block text-gray-700 text-sm font-bold mb-2">密码</label>
<input v-model="loginForm.password" type="password" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="请输入密码" required>
</div>
<button type="submit" class="w-full bg-blue-600 text-white py-2 px-4 rounded-md hover:bg-blue-700 transition duration-200">登录</button>
</form>
</div>
</div>
<!-- 主应用界面 -->
<div v-else class="flex h-screen">
<!-- 侧边栏 -->
<div class="bg-gray-800 text-white w-64 min-h-screen sidebar-transition" :class="{'w-16': sidebarCollapsed}">
<div class="p-4">
<div class="flex items-center justify-between">
<h1 v-show="!sidebarCollapsed" class="text-xl font-bold">CRM系统</h1>
<button @click="toggleSidebar" class="text-white hover:text-gray-300">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
</svg>
</button>
</div>
</div>
<nav class="mt-8">
<div v-for="item in menuItems" :key="item.page"
@click="navigateTo(item.page)"
class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-700 hover:text-white cursor-pointer transition duration-200"
:class="{'bg-gray-700 text-white': currentPage === item.page}">
<svg class="w-5 h-5 mr-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" :d="item.icon"></path>
</svg>
<span v-show="!sidebarCollapsed">{{ item.name }}</span>
</div>
</nav>
<div class="absolute bottom-4 left-4 right-4">
<div @click="logout" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-700 hover:text-white cursor-pointer transition duration-200">
<svg class="w-5 h-5 mr-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"></path>
</svg>
<span v-show="!sidebarCollapsed">退出</span>
</div>
</div>
</div>
<!-- 主内容区域 -->
<div class="flex-1 flex flex-col overflow-hidden">
<!-- 顶部导航栏 -->
<header class="bg-white shadow-sm border-b border-gray-200 px-6 py-4">
<div class="flex items-center justify-between">
<h2 class="text-2xl font-semibold text-gray-800">{{ getCurrentPageTitle() }}</h2>
<div class="flex items-center space-x-4">
<div class="text-sm text-gray-600">欢迎,{{ currentUser.username }}</div>
<img :src="`https://picsum.photos/40/40?random=${currentUser.id}`" alt="头像" class="w-8 h-8 rounded-full">
</div>
</div>
</header>
<!-- 页面内容 -->
<main class="flex-1 overflow-auto p-6">
<!-- 仪表板 -->
<div v-if="currentPage === 'dashboard'" class="space-y-6">
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<div class="bg-white p-6 rounded-lg shadow-sm border border-gray-200">
<div class="flex items-center">
<div class="p-2 bg-blue-100 rounded-md">
<svg class="w-6 h-6 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"></path>
</svg>
</div>
<div class="ml-4">
<h3 class="text-sm font-medium text-gray-500">总客户数</h3>
<p class="text-2xl font-semibold text-gray-900">{{ customers.length }}</p>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-lg shadow-sm border border-gray-200">
<div class="flex items-center">
<div class="p-2 bg-green-100 rounded-md">
<svg class="w-6 h-6 text-green-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"></path>
</svg>
</div>
<div class="ml-4">
<h3 class="text-sm font-medium text-gray-500">销售机会</h3>
<p class="text-2xl font-semibold text-gray-900">{{ opportunities.length }}</p>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-lg shadow-sm border border-gray-200">
<div class="flex items-center">
<div class="p-2 bg-yellow-100 rounded-md">
<svg class="w-6 h-6 text-yellow-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path>
</svg>
</div>
<div class="ml-4">
<h3 class="text-sm font-medium text-gray-500">待办任务</h3>
<p class="text-2xl font-semibold text-gray-900">{{ tasks.filter(t => !t.completed).length }}</p>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-lg shadow-sm border border-gray-200">
<div class="flex items-center">
<div class="p-2 bg-purple-100 rounded-md">
<svg class="w-6 h-6 text-purple-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1"></path>
</svg>
</div>
<div class="ml-4">
<h3 class="text-sm font-medium text-gray-500">本月销售额</h3>
<p class="text-2xl font-semibold text-gray-900">¥{{ getTotalSales() }}</p>
</div>
</div>
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
<div class="bg-white p-6 rounded-lg shadow-sm border border-gray-200">
<h3 class="text-lg font-semibold text-gray-800 mb-4">销售趋势</h3>
<div id="salesChart" style="height: 300px;"></div>
</div>
<div class="bg-white p-6 rounded-lg shadow-sm border border-gray-200">
<h3 class="text-lg font-semibold text-gray-800 mb-4">客户分布</h3>
<div id="customerChart" style="height: 300px;"></div>
</div>
</div>
</div>
<!-- 客户管理 -->
<div v-if="currentPage === 'customers'">
<div class="bg-white rounded-lg shadow-sm border border-gray-200">
<div class="p-6 border-b border-gray-200&qu.........完整代码请登录后点击上方下载按钮下载查看
网友评论0