vue实现一个报价单表格制作设计工具代码

代码语言:html

所属分类:表格

代码描述:vue实现一个报价单表格制作设计工具代码,像表格一样操作,最后可导出图片,还能修改标题和各项内容。

代码标签: vue 报价单 表格 制作 设计 工具 代码

下面为部分代码预览,完整代码请点击下载或在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>APP报价单生成器</title>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/vue@2.6.1-dev.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/html2canvas.1.4.1.js"></script>
  
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: "Helvetica Neue", Arial, sans-serif;
        }
        
        body {
            background-color: #f5f7fa;
            color: #333;
            padding: 20px;
        }
        
        .container {
            max-width: 1000px;
            margin: 0 auto;
            background: white;
            box-shadow: 0 0 25px rgba(0, 0, 0, 0.1);
            border-radius: 10px;
            overflow: hidden;
        }
        
        .header {
            background: linear-gradient(135deg, #4a6cf7, #3053e1);
            color: white;
            padding: 30px 40px;
            position: relative;
        }
        
        .header h1 {
            font-size: 28px;
            margin-bottom: 10px;
            font-weight: 600;
        }
        
        .header p {
            opacity: 0.9;
            font-size: 16px;
        }
        
        .content {
            padding: 30px 40px;
        }
        
        .actions {
            margin-bottom: 20px;
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }
        
        button {
            background: #4a6cf7;
            color: white;
            border: none;
            padding: 10px 16px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        button:hover {
            background: #3053e1;
            transform: translateY(-2px);
            box-shadow: 0 3px 10px rgba(74, 108, 247, 0.3);
        }
        
        button.delete {
            background: #ff4757;
        }
        
        button.delete:hover {
            background: #e02639;
            box-shadow: 0 3px 10px rgba(224, 38, 57, 0.3);
        }
        
        button.export {
            background: #2ed573;
        }
        
        button.export:hover {
            background: #26b463;
            box-shadow: 0 3px 10px rgba(38, 180, 99, 0.3);
        }
        
        table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 20px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }
        
        th {
            background-color: #f1f2fa;
            padding: 12px 15px;
            text-align: left;
            font-weight: 600;
            color: #333;
            border-bottom: 2px solid #e6e8f0;
        }
        
        td {
            padding: 12px 15px;
            border-bottom: 1px solid #e6e8f0;
            position: relative;
        }
        
        td.editable:hover {
            background-color: #f8f9ff;
        }
        
        tr:hover {
            background-color: #f8f9ff;
        }
        
        .summary {
            background-color: #f8faff;
            padding: 20px;
            border-radius: 8px;
            margin-top: 30px;
            display: flex;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 20px;
        }
        
        .summary-item {
            font-size: 16px;
        }
        
        .summary-value {
            font-weight: 600;
            font-size: 20px;
            color: #4a6cf7;
        }
        
        .edit-input {
            width: 100%;
            padding: 8px 10px;
            border: 2px solid #4a6cf7;
            border-radius: 4px;
            font-size: 14px;
        }
        
        .edit-input-title {
            width: 100%;
            padding: 8px 10px;
            border: 2px solid rgba(255, 255, 255, 0.5);
            border-radius: 4px;
            font-size: 18px;
            background: rgba(255, 255, 255, 0.1);
            color: white;
            font-weight: 600;
        }
        
        .company-info {
            margin-top: 20px;
            color: #666;
            font-size: 14px;
        }
        
        .company-info p {
            margin-bottom: 5px;
        }
        
        .logo {
            position: absolute;
            top: 20px;
            right: 40px;
            font-size: 22px;
            font-weight: bold;
            opacity: 0.8;
            cursor: pointer;
        }
        
        .export-container {
            display: none;
        }
        
        .export-container.active {
            display: block;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.8);
            z-index: 1000;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }
        
        .export-preview {
            background: white;
            max-width: 100%;
            max-height: 90vh;
            overflow: auto;
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
            border-radius: 8px;
        }
        
        .export-actions {
            position: absolute;
            bottom: 20px;
            display: flex;
            gap: 10px;
        }
        
        .action-icon {
            margin-right: 6px;
        }
        
        .editable {
            cursor: pointer;
        }
        
        .editable-area {
            cursor: pointer;
        }
        
        .page-break-fix {
            page-break-inside: avoid;
        }
        
        @media (max-width: 768px) {
            .header, .content {
                padding: 20px;
            }
            
            th, td {
                padding: 10px;
            }
            
            .logo {
                position: static;
                margin-bottom: 15px;
            }
            
            .header {
                text-align: center;
            }
        }
    </style>
</head>
<body>
    <div id="app">
        <div class="container" id="quotation">
            <div class="header">
                <div class="logo editable-area" @dblclick="startEdit('logo')">
                    <div v-if="editingField === 'logo'">
                        <input
                            class="edit-input-title"
                            v-model="companyName"
                            @blur="finishEditField"
                            @keyup.enter="finishEditField"
                            ref="editFieldInput"
                        >
                    </div>
                    <span v-else>{{ companyName }}</span>
                </div>
                <h1 class="editable-area" @dblclick="startEdit('title')">
                    <div v-if="editingField === 'title'">
                        <input
                            class="edit-input-title"
                            v-model="title"
                            @blur="finishEditField"
                            @keyup.enter="finishEditField"
                            ref="editFieldInput"
                        >
                    </div>
                    <span v-else>{{ title }}</span>
                </h1>
 .........完整代码请登录后点击上方下载按钮下载查看

网友评论0