|
@@ -1,1710 +1,1710 @@
|
|
|
-<!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="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css">
|
|
|
|
|
- <link rel="stylesheet" href="https://at.alicdn.com/t/font_3114978_qe0b39no76.css">
|
|
|
|
|
- <link rel="stylesheet" href="../assets/css/global.css">
|
|
|
|
|
- <style>
|
|
|
|
|
- :root {
|
|
|
|
|
- --primary: #4CAF50;
|
|
|
|
|
- --primary-dark: #388E3C;
|
|
|
|
|
- --primary-light: #A5D6A7;
|
|
|
|
|
- --primary-bg: #F1F8E9;
|
|
|
|
|
- --success: #4CAF50;
|
|
|
|
|
- --warning: #FFC107;
|
|
|
|
|
- --danger: #F44336;
|
|
|
|
|
- --info: #2196F3;
|
|
|
|
|
- --disabled: #9E9E9E;
|
|
|
|
|
- --border: #E0E0E0;
|
|
|
|
|
- --text-primary: #212121;
|
|
|
|
|
- --text-secondary: #757575;
|
|
|
|
|
- --radius: 8px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 全局样式重置 */
|
|
|
|
|
- * {
|
|
|
|
|
- margin: 0;
|
|
|
|
|
- padding: 0;
|
|
|
|
|
- box-sizing: border-box;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 移除所有固定定位和绝对定位元素 */
|
|
|
|
|
- .fixed,
|
|
|
|
|
- .absolute,
|
|
|
|
|
- [style*="position: fixed"],
|
|
|
|
|
- [style*="position: absolute"] {
|
|
|
|
|
- display: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 移除所有圆形按钮和浮动元素 */
|
|
|
|
|
- .circle,
|
|
|
|
|
- .rounded-full,
|
|
|
|
|
- .floating,
|
|
|
|
|
- [class*="circle"],
|
|
|
|
|
- [class*="round"],
|
|
|
|
|
- [class*="float"] {
|
|
|
|
|
- display: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 确保内容不会溢出 */
|
|
|
|
|
- html, body {
|
|
|
|
|
- overflow-x: hidden;
|
|
|
|
|
- position: relative;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 移除所有可能的遮罩层 */
|
|
|
|
|
- [class*="overlay"],
|
|
|
|
|
- [class*="mask"],
|
|
|
|
|
- [style*="z-index: 9999"] {
|
|
|
|
|
- display: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 重置默认样式 */
|
|
|
|
|
- html, body {
|
|
|
|
|
- margin: 0;
|
|
|
|
|
- padding: 0;
|
|
|
|
|
- font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
|
|
|
|
|
- height: 100%;
|
|
|
|
|
- position: relative;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- body {
|
|
|
|
|
- background-color: #f5f7f9;
|
|
|
|
|
- color: var(--text-primary);
|
|
|
|
|
- overflow-x: hidden;
|
|
|
|
|
- padding-top: 15px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 防止重复菜单 - 修改选择器避免影响按钮和模态框 */
|
|
|
|
|
- body > div:not(.page-container):not(.modal):not(#fieldModal),
|
|
|
|
|
- iframe#sidebar,
|
|
|
|
|
- div.system-menu,
|
|
|
|
|
- [id^="system-menu"],
|
|
|
|
|
- [class^="system-menu"],
|
|
|
|
|
- #admin-sidebar,
|
|
|
|
|
- .menu-popup,
|
|
|
|
|
- .user-avatar-circle {
|
|
|
|
|
- display: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 移除可能影响按钮和模态框的全局样式 */
|
|
|
|
|
- .circle-btn,
|
|
|
|
|
- .floating-circle,
|
|
|
|
|
- .round-button,
|
|
|
|
|
- .scroll-top-btn,
|
|
|
|
|
- .help-btn,
|
|
|
|
|
- .chat-btn {
|
|
|
|
|
- display: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 模态框样式 */
|
|
|
|
|
- .modal {
|
|
|
|
|
- display: none;
|
|
|
|
|
- position: fixed;
|
|
|
|
|
- top: 0;
|
|
|
|
|
- left: 0;
|
|
|
|
|
- right: 0;
|
|
|
|
|
- bottom: 0;
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- height: 100%;
|
|
|
|
|
- background-color: rgba(0, 0, 0, 0.5);
|
|
|
|
|
- z-index: 99999;
|
|
|
|
|
- opacity: 0;
|
|
|
|
|
- visibility: hidden;
|
|
|
|
|
- transition: opacity 0.3s ease, visibility 0.3s ease;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .modal.show {
|
|
|
|
|
- display: block !important;
|
|
|
|
|
- opacity: 1 !important;
|
|
|
|
|
- visibility: visible !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .modal-dialog {
|
|
|
|
|
- position: fixed;
|
|
|
|
|
- top: 50%;
|
|
|
|
|
- left: 50%;
|
|
|
|
|
- transform: translate(-50%, -50%);
|
|
|
|
|
- width: 90%;
|
|
|
|
|
- max-width: 800px;
|
|
|
|
|
- margin-top: 20px;
|
|
|
|
|
- background: #fff;
|
|
|
|
|
- border-radius: 8px;
|
|
|
|
|
- z-index: 100000;
|
|
|
|
|
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .modal-content {
|
|
|
|
|
- background: #fff;
|
|
|
|
|
- border-radius: 8px;
|
|
|
|
|
- overflow: hidden;
|
|
|
|
|
- position: relative;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .modal-header {
|
|
|
|
|
- padding: 16px 24px;
|
|
|
|
|
- border-bottom: 1px solid #e0e0e0;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: space-between;
|
|
|
|
|
- background: #fff;
|
|
|
|
|
- position: sticky;
|
|
|
|
|
- top: 0;
|
|
|
|
|
- z-index: 1;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .modal-close {
|
|
|
|
|
- padding: 8px;
|
|
|
|
|
- background: none;
|
|
|
|
|
- border: none;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- font-size: 20px;
|
|
|
|
|
- color: #666;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
- border-radius: 4px;
|
|
|
|
|
- transition: all 0.3s;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .modal-close:hover {
|
|
|
|
|
- background-color: rgba(0, 0, 0, 0.05);
|
|
|
|
|
- color: #333;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .modal-title {
|
|
|
|
|
- font-size: 18px;
|
|
|
|
|
- font-weight: 500;
|
|
|
|
|
- color: #333;
|
|
|
|
|
- margin: 0;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .modal-body {
|
|
|
|
|
- padding: 24px;
|
|
|
|
|
- max-height: calc(100vh - 200px);
|
|
|
|
|
- overflow-y: auto;
|
|
|
|
|
- background: #fff;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .modal-footer {
|
|
|
|
|
- padding: 16px 24px;
|
|
|
|
|
- border-top: 1px solid #e0e0e0;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- justify-content: flex-end;
|
|
|
|
|
- gap: 12px;
|
|
|
|
|
- background: #fff;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .form-grid {
|
|
|
|
|
- display: grid;
|
|
|
|
|
- grid-template-columns: repeat(2, 1fr);
|
|
|
|
|
- gap: 20px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .form-group {
|
|
|
|
|
- margin-bottom: 0;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .form-label {
|
|
|
|
|
- display: block;
|
|
|
|
|
- margin-bottom: 8px;
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
- color: #333;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .form-input {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- padding: 8px 12px;
|
|
|
|
|
- border: 1px solid #ddd;
|
|
|
|
|
- border-radius: 4px;
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
- transition: all 0.3s;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .form-input:focus {
|
|
|
|
|
- border-color: var(--primary);
|
|
|
|
|
- box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
|
|
|
|
|
- outline: none;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .required {
|
|
|
|
|
- color: #f44336;
|
|
|
|
|
- margin-left: 4px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 确保所有按钮可点击 */
|
|
|
|
|
- .action-btn,
|
|
|
|
|
- .btn,
|
|
|
|
|
- button {
|
|
|
|
|
- cursor: pointer !important;
|
|
|
|
|
- pointer-events: auto !important;
|
|
|
|
|
- position: relative;
|
|
|
|
|
- z-index: 1;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 移除可能影响按钮的样式 */
|
|
|
|
|
- body > div:not(.page-container):not(.modal):not(#fieldModal) {
|
|
|
|
|
- display: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 确保所有操作按钮可见和可交互 */
|
|
|
|
|
- .action-btn,
|
|
|
|
|
- #addFieldBtn,
|
|
|
|
|
- .btn-primary,
|
|
|
|
|
- .btn-outline,
|
|
|
|
|
- .modal button {
|
|
|
|
|
- visibility: visible !important;
|
|
|
|
|
- opacity: 1 !important;
|
|
|
|
|
- display: inline-flex !important;
|
|
|
|
|
- pointer-events: auto !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 页面容器 */
|
|
|
|
|
- .page-container {
|
|
|
|
|
- max-width: 100%;
|
|
|
|
|
- padding: 24px;
|
|
|
|
|
- padding-top: 42px;
|
|
|
|
|
- margin: 0;
|
|
|
|
|
- box-sizing: border-box;
|
|
|
|
|
- position: relative;
|
|
|
|
|
- z-index: 1;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 页面标题和操作按钮容器 */
|
|
|
|
|
- .page-header {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- justify-content: space-between;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- margin-bottom: 20px;
|
|
|
|
|
- padding-bottom: 16px;
|
|
|
|
|
- border-bottom: 1px solid var(--border);
|
|
|
|
|
- padding-top: 10px;
|
|
|
|
|
- position: relative;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 添加新增按钮的特定样式 */
|
|
|
|
|
- .add-button-container {
|
|
|
|
|
- position: relative;
|
|
|
|
|
- z-index: 9999;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- #addFieldBtn {
|
|
|
|
|
- position: relative;
|
|
|
|
|
- z-index: 9999 !important;
|
|
|
|
|
- visibility: visible !important;
|
|
|
|
|
- opacity: 1 !important;
|
|
|
|
|
- display: inline-flex !important;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- pointer-events: auto !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .page-title {
|
|
|
|
|
- font-size: 22px;
|
|
|
|
|
- font-weight: 600;
|
|
|
|
|
- position: relative;
|
|
|
|
|
- color: var(--text-primary);
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- margin: 0;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .page-title::before {
|
|
|
|
|
- content: "";
|
|
|
|
|
- width: 4px;
|
|
|
|
|
- height: 22px;
|
|
|
|
|
- background-color: var(--primary);
|
|
|
|
|
- margin-right: 8px;
|
|
|
|
|
- border-radius: 2px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .search-card {
|
|
|
|
|
- background-color: #fff;
|
|
|
|
|
- border-radius: var(--radius);
|
|
|
|
|
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
|
|
|
|
|
- padding: 16px;
|
|
|
|
|
- margin-bottom: 20px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .search-input {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- border: 1px solid var(--border);
|
|
|
|
|
- border-radius: 4px;
|
|
|
|
|
- padding: 6px 12px;
|
|
|
|
|
- font-size: 13px;
|
|
|
|
|
- transition: all 0.3s;
|
|
|
|
|
- height: 32px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .search-input:focus {
|
|
|
|
|
- border-color: var(--primary);
|
|
|
|
|
- box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
|
|
|
|
|
- outline: none;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .form-select {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- padding: 6px 24px 6px 10px;
|
|
|
|
|
- border: 1px solid var(--border);
|
|
|
|
|
- border-radius: 4px;
|
|
|
|
|
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23757575' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
|
|
|
|
|
- background-repeat: no-repeat;
|
|
|
|
|
- background-position: right 8px center;
|
|
|
|
|
- background-size: 14px;
|
|
|
|
|
- -webkit-appearance: none;
|
|
|
|
|
- -moz-appearance: none;
|
|
|
|
|
- appearance: none;
|
|
|
|
|
- font-size: 13px;
|
|
|
|
|
- color: #333;
|
|
|
|
|
- height: 32px;
|
|
|
|
|
- line-height: 1.2;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .form-select:focus {
|
|
|
|
|
- border-color: var(--primary);
|
|
|
|
|
- box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
|
|
|
|
|
- outline: none;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 调整搜索区按钮样式 */
|
|
|
|
|
- .search-card .btn {
|
|
|
|
|
- height: 32px;
|
|
|
|
|
- padding: 0 16px;
|
|
|
|
|
- font-size: 13px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .search-card .btn-icon {
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 调整间距 */
|
|
|
|
|
- .search-card .grid.gap-4 {
|
|
|
|
|
- gap: 12px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 调整搜索图标大小和位置 */
|
|
|
|
|
- .search-input + button .iconfont {
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 调整日期输入框样式 */
|
|
|
|
|
- .search-card input[type="date"] {
|
|
|
|
|
- height: 32px;
|
|
|
|
|
- font-size: 13px;
|
|
|
|
|
- padding: 6px 10px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 添加placeholder样式 */
|
|
|
|
|
- .search-input::placeholder {
|
|
|
|
|
- color: #999;
|
|
|
|
|
- font-size: 13px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 调整select的placeholder颜色 */
|
|
|
|
|
- .form-select option:first-child {
|
|
|
|
|
- color: #999;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .table-card {
|
|
|
|
|
- background-color: #fff;
|
|
|
|
|
- border-radius: var(--radius);
|
|
|
|
|
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
|
|
|
|
|
- overflow: hidden;
|
|
|
|
|
- position: relative;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .table-container {
|
|
|
|
|
- overflow-x: auto;
|
|
|
|
|
- border-radius: var(--radius);
|
|
|
|
|
- max-height: calc(100vh - 320px);
|
|
|
|
|
- min-height: 400px;
|
|
|
|
|
- overflow-y: auto;
|
|
|
|
|
- position: relative;
|
|
|
|
|
- scrollbar-width: thin;
|
|
|
|
|
- scrollbar-color: #cbd5e1 #f1f5f9;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .table-container::-webkit-scrollbar {
|
|
|
|
|
- height: 6px;
|
|
|
|
|
- width: 6px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .table-container::-webkit-scrollbar-track {
|
|
|
|
|
- background: #f1f5f9;
|
|
|
|
|
- border-radius: 3px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .table-container::-webkit-scrollbar-thumb {
|
|
|
|
|
- background: #cbd5e1;
|
|
|
|
|
- border-radius: 3px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .table-container::-webkit-scrollbar-thumb:hover {
|
|
|
|
|
- background: #94a3b8;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .badge {
|
|
|
|
|
- display: inline-flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- padding: 2px 8px;
|
|
|
|
|
- border-radius: 12px;
|
|
|
|
|
- font-size: 12px;
|
|
|
|
|
- font-weight: 500;
|
|
|
|
|
- line-height: 1.5;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .badge-success {
|
|
|
|
|
- background-color: #dcfce7;
|
|
|
|
|
- color: #15803d;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .badge-warning {
|
|
|
|
|
- background-color: #fef9c3;
|
|
|
|
|
- color: #854d0e;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .badge-danger {
|
|
|
|
|
- background-color: #fee2e2;
|
|
|
|
|
- color: #b91c1c;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .badge-icon {
|
|
|
|
|
- margin-right: 4px;
|
|
|
|
|
- font-size: 12px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .action-group {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- gap: 8px;
|
|
|
|
|
- flex-wrap: wrap;
|
|
|
|
|
- padding: 4px 0;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .action-group + .action-group {
|
|
|
|
|
- margin-top: 4px;
|
|
|
|
|
- padding-top: 4px;
|
|
|
|
|
- border-top: 1px solid #f0f0f0;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .action-btn {
|
|
|
|
|
- display: inline-flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
- padding: 4px 8px;
|
|
|
|
|
- font-size: 13px;
|
|
|
|
|
- line-height: 1;
|
|
|
|
|
- color: #666;
|
|
|
|
|
- background: transparent;
|
|
|
|
|
- border: none;
|
|
|
|
|
- border-radius: 4px;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- transition: all 0.2s;
|
|
|
|
|
- white-space: nowrap;
|
|
|
|
|
- text-decoration: none;
|
|
|
|
|
- -webkit-appearance: none;
|
|
|
|
|
- -moz-appearance: none;
|
|
|
|
|
- appearance: none;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .action-btn:hover {
|
|
|
|
|
- color: var(--primary);
|
|
|
|
|
- background-color: rgba(76, 175, 80, 0.1);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .action-btn:focus {
|
|
|
|
|
- outline: none;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .action-btn i {
|
|
|
|
|
- margin-right: 4px;
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .action-btn.view:hover {
|
|
|
|
|
- color: var(--primary);
|
|
|
|
|
- background-color: rgba(76, 175, 80, 0.1);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .action-btn.edit:hover {
|
|
|
|
|
- color: var(--info);
|
|
|
|
|
- background-color: rgba(33, 150, 243, 0.1);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .action-btn.delete:hover {
|
|
|
|
|
- color: var(--danger);
|
|
|
|
|
- background-color: rgba(244, 67, 54, 0.1);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 确保最后一列的操作按钮容器没有背景 */
|
|
|
|
|
- tr td:last-child {
|
|
|
|
|
- background: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .pagination {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- gap: 8px;
|
|
|
|
|
- margin-top: 20px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .pagination .page-item {
|
|
|
|
|
- width: 32px;
|
|
|
|
|
- height: 32px;
|
|
|
|
|
- display: inline-flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
- border-radius: 4px;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
- transition: all 0.2s;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .pagination .page-item:hover {
|
|
|
|
|
- background-color: #f5f5f5;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .pagination .page-item.active {
|
|
|
|
|
- background-color: var(--primary);
|
|
|
|
|
- color: white;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .pagination .page-item.disabled {
|
|
|
|
|
- color: #ccc;
|
|
|
|
|
- cursor: not-allowed;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .count-badge {
|
|
|
|
|
- display: inline-flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- gap: 4px;
|
|
|
|
|
- font-size: 13px;
|
|
|
|
|
- color: #475569;
|
|
|
|
|
- padding: 2px 4px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .count-badge i {
|
|
|
|
|
- color: #64748b;
|
|
|
|
|
- font-size: 13px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 新增按钮容器样式 */
|
|
|
|
|
- .add-button-container {
|
|
|
|
|
- position: relative;
|
|
|
|
|
- z-index: 9999;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 新增按钮的特定样式 */
|
|
|
|
|
- #addFieldBtn {
|
|
|
|
|
- position: relative;
|
|
|
|
|
- z-index: 9999 !important;
|
|
|
|
|
- visibility: visible !important;
|
|
|
|
|
- opacity: 1 !important;
|
|
|
|
|
- display: inline-flex !important;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- pointer-events: auto !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 防止页面滚动 */
|
|
|
|
|
- body.modal-open {
|
|
|
|
|
- overflow: hidden;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @media (max-width: 768px) {
|
|
|
|
|
- .form-grid {
|
|
|
|
|
- grid-template-columns: 1fr;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .modal-dialog {
|
|
|
|
|
- margin: 10px;
|
|
|
|
|
- width: auto;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 表格样式优化 */
|
|
|
|
|
- table {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- border-collapse: separate;
|
|
|
|
|
- border-spacing: 0;
|
|
|
|
|
- font-size: 13px;
|
|
|
|
|
- table-layout: fixed;
|
|
|
|
|
- background: transparent !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 表格行样式 */
|
|
|
|
|
- tr {
|
|
|
|
|
- background: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- tr::before,
|
|
|
|
|
- tr::after {
|
|
|
|
|
- display: none !important;
|
|
|
|
|
- content: none !important;
|
|
|
|
|
- background: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 表格单元格基础样式 */
|
|
|
|
|
- th, td {
|
|
|
|
|
- position: relative;
|
|
|
|
|
- background: none !important;
|
|
|
|
|
- border-radius: 0 !important;
|
|
|
|
|
- -webkit-border-radius: 0 !important;
|
|
|
|
|
- -moz-border-radius: 0 !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- td {
|
|
|
|
|
- padding: 12px 16px;
|
|
|
|
|
- border-bottom: 1px solid #e2e8f0;
|
|
|
|
|
- color: #1e293b;
|
|
|
|
|
- line-height: 1.4;
|
|
|
|
|
- vertical-align: middle;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 确保操作列没有任何装饰 */
|
|
|
|
|
- td:last-child {
|
|
|
|
|
- background: none !important;
|
|
|
|
|
- border-radius: 0 !important;
|
|
|
|
|
- -webkit-border-radius: 0 !important;
|
|
|
|
|
- -moz-border-radius: 0 !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- td:last-child::before,
|
|
|
|
|
- td:last-child::after {
|
|
|
|
|
- display: none !important;
|
|
|
|
|
- content: none !important;
|
|
|
|
|
- background: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 操作按钮组容器样式 */
|
|
|
|
|
- .action-group {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- gap: 6px;
|
|
|
|
|
- flex-wrap: wrap;
|
|
|
|
|
- justify-content: flex-start;
|
|
|
|
|
- background: none !important;
|
|
|
|
|
- position: relative;
|
|
|
|
|
- border-radius: 0 !important;
|
|
|
|
|
- -webkit-border-radius: 0 !important;
|
|
|
|
|
- -moz-border-radius: 0 !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .action-group::before,
|
|
|
|
|
- .action-group::after {
|
|
|
|
|
- display: none !important;
|
|
|
|
|
- content: none !important;
|
|
|
|
|
- background: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 操作按钮样式 */
|
|
|
|
|
- .action-btn {
|
|
|
|
|
- padding: 4px 8px;
|
|
|
|
|
- background: none !important;
|
|
|
|
|
- color: #64748b;
|
|
|
|
|
- cursor: pointer !important;
|
|
|
|
|
- transition: all 0.2s;
|
|
|
|
|
- display: inline-flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- border: none !important;
|
|
|
|
|
- font-size: 12px;
|
|
|
|
|
- line-height: 1;
|
|
|
|
|
- position: relative;
|
|
|
|
|
- outline: none !important;
|
|
|
|
|
- box-shadow: none !important;
|
|
|
|
|
- -webkit-appearance: none !important;
|
|
|
|
|
- -moz-appearance: none !important;
|
|
|
|
|
- appearance: none !important;
|
|
|
|
|
- border-radius: 4px !important;
|
|
|
|
|
- -webkit-border-radius: 4px !important;
|
|
|
|
|
- -moz-border-radius: 4px !important;
|
|
|
|
|
- text-decoration: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .action-btn::before,
|
|
|
|
|
- .action-btn::after {
|
|
|
|
|
- display: none !important;
|
|
|
|
|
- content: none !important;
|
|
|
|
|
- background: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 鼠标悬停效果 */
|
|
|
|
|
- .action-btn:hover {
|
|
|
|
|
- color: var(--primary);
|
|
|
|
|
- background-color: rgba(241, 245, 249, 0.9) !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .action-btn.edit:hover {
|
|
|
|
|
- color: #0284c7;
|
|
|
|
|
- background-color: rgba(240, 249, 255, 0.9) !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .action-btn.delete:hover {
|
|
|
|
|
- color: #dc2626;
|
|
|
|
|
- background-color: rgba(254, 242, 242, 0.9) !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 按钮图标样式 */
|
|
|
|
|
- .action-btn i {
|
|
|
|
|
- margin-right: 4px;
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
- display: inline-flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
- background: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 移除所有可能的装饰性样式 */
|
|
|
|
|
- .action-btn,
|
|
|
|
|
- .action-btn:focus,
|
|
|
|
|
- .action-btn:hover,
|
|
|
|
|
- .action-btn:active,
|
|
|
|
|
- .action-group,
|
|
|
|
|
- td,
|
|
|
|
|
- tr,
|
|
|
|
|
- th {
|
|
|
|
|
- text-decoration: none !important;
|
|
|
|
|
- -webkit-appearance: none !important;
|
|
|
|
|
- -moz-appearance: none !important;
|
|
|
|
|
- appearance: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 确保表格行交替背景色正确 */
|
|
|
|
|
- tbody tr:hover {
|
|
|
|
|
- background-color: #f8fafc !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- tbody tr:hover td {
|
|
|
|
|
- background: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 移除所有可能的轮廓和装饰 */
|
|
|
|
|
- *:focus {
|
|
|
|
|
- outline: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 确保按钮组之间的间距正确 */
|
|
|
|
|
- .action-group + .action-group {
|
|
|
|
|
- margin-top: 4px;
|
|
|
|
|
- border-top: none !important;
|
|
|
|
|
- background: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 移除滚动按钮相关样式 */
|
|
|
|
|
- #scrollLeftBtn,
|
|
|
|
|
- #scrollRightBtn {
|
|
|
|
|
- display: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .w-8,
|
|
|
|
|
- .h-8,
|
|
|
|
|
- .shadow-md {
|
|
|
|
|
- display: none !important;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 表格容器相关样式 */
|
|
|
|
|
- .table-container-wrapper {
|
|
|
|
|
- position: relative;
|
|
|
|
|
- padding: 0 40px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .scroll-button {
|
|
|
|
|
- position: absolute;
|
|
|
|
|
- top: 50%;
|
|
|
|
|
- transform: translateY(-50%);
|
|
|
|
|
- width: 32px;
|
|
|
|
|
- height: 32px;
|
|
|
|
|
- background: #fff;
|
|
|
|
|
- border: 1px solid #e5e7eb;
|
|
|
|
|
- border-radius: 50%;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
|
|
|
- z-index: 10;
|
|
|
|
|
- transition: all 0.2s;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .scroll-button:hover {
|
|
|
|
|
- background: #f9fafb;
|
|
|
|
|
- border-color: #d1d5db;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .scroll-button:disabled {
|
|
|
|
|
- opacity: 0.5;
|
|
|
|
|
- cursor: not-allowed;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .scroll-button.left {
|
|
|
|
|
- left: 4px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .scroll-button.right {
|
|
|
|
|
- right: 4px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .scroll-button i {
|
|
|
|
|
- font-size: 16px;
|
|
|
|
|
- color: #6b7280;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 确保操作按钮在一行 */
|
|
|
|
|
- .action-group {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- gap: 8px;
|
|
|
|
|
- flex-wrap: nowrap;
|
|
|
|
|
- white-space: nowrap;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 调整表格滚动容器 */
|
|
|
|
|
- .table-container {
|
|
|
|
|
- overflow-x: auto;
|
|
|
|
|
- scrollbar-width: thin;
|
|
|
|
|
- scrollbar-color: #cbd5e1 #f1f5f9;
|
|
|
|
|
- -ms-overflow-style: none;
|
|
|
|
|
- scroll-behavior: smooth;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .table-container::-webkit-scrollbar {
|
|
|
|
|
- height: 6px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .table-container::-webkit-scrollbar-track {
|
|
|
|
|
- background: #f1f5f9;
|
|
|
|
|
- border-radius: 3px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .table-container::-webkit-scrollbar-thumb {
|
|
|
|
|
- background: #cbd5e1;
|
|
|
|
|
- border-radius: 3px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .table-container::-webkit-scrollbar-thumb:hover {
|
|
|
|
|
- background: #94a3b8;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /* 调整表格最后一列宽度 */
|
|
|
|
|
- table th:last-child,
|
|
|
|
|
- table td:last-child {
|
|
|
|
|
- min-width: 200px;
|
|
|
|
|
- width: 200px;
|
|
|
|
|
- }
|
|
|
|
|
- </style>
|
|
|
|
|
-</head>
|
|
|
|
|
-<body>
|
|
|
|
|
- <div class="page-container">
|
|
|
|
|
- <!-- 页面标题和操作按钮 -->
|
|
|
|
|
- <div class="page-header">
|
|
|
|
|
- <div class="flex items-center">
|
|
|
|
|
- <h1 class="page-title">地块管理</h1>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="add-button-container">
|
|
|
|
|
- <button type="button"
|
|
|
|
|
- class="btn btn-primary"
|
|
|
|
|
- id="addFieldBtn"
|
|
|
|
|
- onclick="showModalDialog(event)">
|
|
|
|
|
- <i class="iconfont icon-plus btn-icon"></i>新增地块
|
|
|
|
|
- </button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 搜索和筛选区域 -->
|
|
|
|
|
- <div class="search-card">
|
|
|
|
|
- <div class="grid grid-cols-1 gap-4">
|
|
|
|
|
- <div class="grid grid-cols-1 md:grid-cols-4 lg:grid-cols-6 gap-4">
|
|
|
|
|
- <!-- 搜索框 -->
|
|
|
|
|
- <div class="md:col-span-2 lg:col-span-2">
|
|
|
|
|
- <div class="relative">
|
|
|
|
|
- <input type="text" class="search-input" placeholder="请输入地块编号、名称、位置关键词">
|
|
|
|
|
- <button class="absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-400 focus:outline-none">
|
|
|
|
|
- <i class="iconfont icon-search"></i>
|
|
|
|
|
- </button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 筛选项第一行 -->
|
|
|
|
|
- <div class="md:col-span-1 lg:col-span-1">
|
|
|
|
|
- <select class="form-select">
|
|
|
|
|
- <option value="">所属农场</option>
|
|
|
|
|
- <option value="1">智慧农场一号</option>
|
|
|
|
|
- <option value="2">智慧农场二号</option>
|
|
|
|
|
- <option value="3">智慧农场三号</option>
|
|
|
|
|
- <option value="4">有机蔬菜基地</option>
|
|
|
|
|
- <option value="5">生态果园基地</option>
|
|
|
|
|
- </select>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="md:col-span-1 lg:col-span-1">
|
|
|
|
|
- <select class="form-select">
|
|
|
|
|
- <option value="">所属区域</option>
|
|
|
|
|
- <option value="1">东区</option>
|
|
|
|
|
- <option value="2">西区</option>
|
|
|
|
|
- <option value="3">南区</option>
|
|
|
|
|
- <option value="4">北区</option>
|
|
|
|
|
- </select>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="md:col-span-1 lg:col-span-1">
|
|
|
|
|
- <select class="form-select">
|
|
|
|
|
- <option value="">使用状态</option>
|
|
|
|
|
- <option value="1">使用中</option>
|
|
|
|
|
- <option value="2">维护中</option>
|
|
|
|
|
- <option value="0">未使用</option>
|
|
|
|
|
- </select>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="md:col-span-1 lg:col-span-1">
|
|
|
|
|
- <select class="form-select">
|
|
|
|
|
- <option value="">土壤类型</option>
|
|
|
|
|
- <option value="1">黏土</option>
|
|
|
|
|
- <option value="2">沙质土</option>
|
|
|
|
|
- <option value="3">壤土</option>
|
|
|
|
|
- <option value="4">沙壤土</option>
|
|
|
|
|
- <option value="5">其他</option>
|
|
|
|
|
- </select>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 筛选项第二行 -->
|
|
|
|
|
- <div class="grid grid-cols-1 md:grid-cols-4 lg:grid-cols-6 gap-4">
|
|
|
|
|
- <div class="md:col-span-1 lg:col-span-1">
|
|
|
|
|
- <select class="form-select">
|
|
|
|
|
- <option value="">灌溉方式</option>
|
|
|
|
|
- <option value="1">喷灌</option>
|
|
|
|
|
- <option value="2">滴灌</option>
|
|
|
|
|
- <option value="3">微喷灌</option>
|
|
|
|
|
- <option value="4">漫灌</option>
|
|
|
|
|
- <option value="5">其他</option>
|
|
|
|
|
- </select>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="md:col-span-1 lg:col-span-1">
|
|
|
|
|
- <select class="form-select">
|
|
|
|
|
- <option value="">种植作物</option>
|
|
|
|
|
- <optgroup label="粮食作物">
|
|
|
|
|
- <option value="101">水稻</option>
|
|
|
|
|
- <option value="102">小麦</option>
|
|
|
|
|
- <option value="103">玉米</option>
|
|
|
|
|
- <option value="104">大豆</option>
|
|
|
|
|
- <option value="105">高粱</option>
|
|
|
|
|
- <option value="106">谷子</option>
|
|
|
|
|
- </optgroup>
|
|
|
|
|
- <optgroup label="经济作物">
|
|
|
|
|
- <option value="201">棉花</option>
|
|
|
|
|
- <option value="202">油菜</option>
|
|
|
|
|
- <option value="203">花生</option>
|
|
|
|
|
- <option value="204">芝麻</option>
|
|
|
|
|
- <option value="205">甘蔗</option>
|
|
|
|
|
- <option value="206">烟草</option>
|
|
|
|
|
- <option value="207">茶叶</option>
|
|
|
|
|
- <option value="208">药材</option>
|
|
|
|
|
- </optgroup>
|
|
|
|
|
- <optgroup label="果树作物">
|
|
|
|
|
- <option value="301">葡萄</option>
|
|
|
|
|
- <option value="302">苹果</option>
|
|
|
|
|
- <option value="303">梨</option>
|
|
|
|
|
- <option value="304">桃</option>
|
|
|
|
|
- <option value="305">柑橘</option>
|
|
|
|
|
- <option value="306">枣</option>
|
|
|
|
|
- <option value="307">猕猴桃</option>
|
|
|
|
|
- <option value="308">石榴</option>
|
|
|
|
|
- <option value="309">杏</option>
|
|
|
|
|
- </optgroup>
|
|
|
|
|
- <optgroup label="蔬菜作物">
|
|
|
|
|
- <option value="401">叶菜类</option>
|
|
|
|
|
- <option value="402">根茎类</option>
|
|
|
|
|
- <option value="403">瓜果类</option>
|
|
|
|
|
- <option value="404">豆类</option>
|
|
|
|
|
- <option value="405">茄果类</option>
|
|
|
|
|
- <option value="406">葱蒜类</option>
|
|
|
|
|
- </optgroup>
|
|
|
|
|
- <optgroup label="其他作物">
|
|
|
|
|
- <option value="901">饲料作物</option>
|
|
|
|
|
- <option value="902">观赏作物</option>
|
|
|
|
|
- <option value="903">食用菌</option>
|
|
|
|
|
- <option value="999">其他</option>
|
|
|
|
|
- </optgroup>
|
|
|
|
|
- </select>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="md:col-span-1 lg:col-span-1">
|
|
|
|
|
- <div class="relative">
|
|
|
|
|
- <input type="text" class="search-input" placeholder="负责人">
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="md:col-span-1 lg:col-span-1">
|
|
|
|
|
- <div class="relative">
|
|
|
|
|
- <input type="date" class="search-input" placeholder="创建日期">
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="md:col-span-2 lg:col-span-2 flex justify-end items-center gap-2">
|
|
|
|
|
- <button class="btn btn-primary">
|
|
|
|
|
- <i class="iconfont icon-search btn-icon"></i>查询
|
|
|
|
|
- </button>
|
|
|
|
|
- <button class="btn btn-outline">
|
|
|
|
|
- <i class="iconfont icon-refresh btn-icon"></i>重置
|
|
|
|
|
- </button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 表格列表 -->
|
|
|
|
|
- <div class="table-card">
|
|
|
|
|
- <div class="relative table-container-wrapper">
|
|
|
|
|
- <!-- 左滑动按钮 -->
|
|
|
|
|
- <button type="button" class="scroll-button left" id="scrollLeftBtn" disabled>
|
|
|
|
|
- <i class="iconfont icon-left"></i>
|
|
|
|
|
- </button>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 右滑动按钮 -->
|
|
|
|
|
- <button type="button" class="scroll-button right" id="scrollRightBtn">
|
|
|
|
|
- <i class="iconfont icon-right"></i>
|
|
|
|
|
- </button>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 表格容器 -->
|
|
|
|
|
- <div class="table-container" id="tableContainer">
|
|
|
|
|
- <table>
|
|
|
|
|
- <thead>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <th class="whitespace-nowrap min-w-[120px]">地块编号</th>
|
|
|
|
|
- <th class="whitespace-nowrap min-w-[120px]">地块名称</th>
|
|
|
|
|
- <th class="whitespace-nowrap min-w-[120px]">所属农场</th>
|
|
|
|
|
- <th class="whitespace-nowrap min-w-[100px]">所属区域</th>
|
|
|
|
|
- <th class="whitespace-nowrap min-w-[100px]">地块类型</th>
|
|
|
|
|
- <th class="whitespace-nowrap min-w-[90px]">面积(亩)</th>
|
|
|
|
|
- <th class="whitespace-nowrap min-w-[120px]">种植作物</th>
|
|
|
|
|
- <th class="whitespace-nowrap min-w-[100px]">土壤类型</th>
|
|
|
|
|
- <th class="whitespace-nowrap min-w-[100px]">灌溉方式</th>
|
|
|
|
|
- <th class="whitespace-nowrap min-w-[100px]">使用状态</th>
|
|
|
|
|
- <th class="whitespace-nowrap min-w-[100px]">绑定设备</th>
|
|
|
|
|
- <th class="whitespace-nowrap min-w-[100px]">绑定人员</th>
|
|
|
|
|
- <th class="whitespace-nowrap min-w-[100px]">负责人</th>
|
|
|
|
|
- <th class="whitespace-nowrap min-w-[120px]">创建时间</th>
|
|
|
|
|
- <th class="whitespace-nowrap min-w-[120px]">上次更新</th>
|
|
|
|
|
- <th class="whitespace-nowrap min-w-[180px]">操作</th>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </thead>
|
|
|
|
|
- <tbody>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <td>FK20230001</td>
|
|
|
|
|
- <td>东区水稻田A</td>
|
|
|
|
|
- <td>智慧农场一号</td>
|
|
|
|
|
- <td>东区</td>
|
|
|
|
|
- <td>水田</td>
|
|
|
|
|
- <td>120</td>
|
|
|
|
|
- <td>水稻</td>
|
|
|
|
|
- <td>黏土</td>
|
|
|
|
|
- <td>喷灌</td>
|
|
|
|
|
- <td>
|
|
|
|
|
- <span class="badge badge-success">
|
|
|
|
|
- <i class="iconfont icon-check-circle badge-icon"></i>使用中
|
|
|
|
|
- </span>
|
|
|
|
|
- </td>
|
|
|
|
|
- <td>
|
|
|
|
|
- <span class="count-badge">
|
|
|
|
|
- <i class="iconfont icon-device"></i>3
|
|
|
|
|
- </span>
|
|
|
|
|
- </td>
|
|
|
|
|
- <td>
|
|
|
|
|
- <span class="count-badge">
|
|
|
|
|
- <i class="iconfont icon-user"></i>2
|
|
|
|
|
- </span>
|
|
|
|
|
- </td>
|
|
|
|
|
- <td>张三</td>
|
|
|
|
|
- <td>2023-05-15</td>
|
|
|
|
|
- <td>2023-06-20</td>
|
|
|
|
|
- <td>
|
|
|
|
|
- <div class="action-group">
|
|
|
|
|
- <button type="button" class="action-btn view" title="地块管理">
|
|
|
|
|
- <i class="iconfont icon-eye"></i>管理
|
|
|
|
|
- </button>
|
|
|
|
|
- <button type="button" class="action-btn edit" title="编辑地块">
|
|
|
|
|
- <i class="iconfont icon-edit"></i>编辑
|
|
|
|
|
- </button>
|
|
|
|
|
- <button type="button" class="action-btn delete" title="删除地块">
|
|
|
|
|
- <i class="iconfont icon-delete"></i>删除
|
|
|
|
|
- </button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <td>FK20230002</td>
|
|
|
|
|
- <td>西区蔬菜园B</td>
|
|
|
|
|
- <td>有机蔬菜基地</td>
|
|
|
|
|
- <td>西区</td>
|
|
|
|
|
- <td>菜地</td>
|
|
|
|
|
- <td>85</td>
|
|
|
|
|
- <td>青菜、萝卜</td>
|
|
|
|
|
- <td>沙质土</td>
|
|
|
|
|
- <td>滴灌</td>
|
|
|
|
|
- <td>
|
|
|
|
|
- <span class="badge badge-success">
|
|
|
|
|
- <i class="iconfont icon-check-circle badge-icon"></i>使用中
|
|
|
|
|
- </span>
|
|
|
|
|
- </td>
|
|
|
|
|
- <td>
|
|
|
|
|
- <span class="count-badge">
|
|
|
|
|
- <i class="iconfont icon-device"></i>2
|
|
|
|
|
- </span>
|
|
|
|
|
- </td>
|
|
|
|
|
- <td>
|
|
|
|
|
- <span class="count-badge">
|
|
|
|
|
- <i class="iconfont icon-user"></i>1
|
|
|
|
|
- </span>
|
|
|
|
|
- </td>
|
|
|
|
|
- <td>李四</td>
|
|
|
|
|
- <td>2023-05-18</td>
|
|
|
|
|
- <td>2023-06-25</td>
|
|
|
|
|
- <td>
|
|
|
|
|
- <div class="action-group">
|
|
|
|
|
- <button type="button" class="action-btn view" title="地块管理">
|
|
|
|
|
- <i class="iconfont icon-eye"></i>管理
|
|
|
|
|
- </button>
|
|
|
|
|
- <button type="button" class="action-btn edit" title="编辑地块">
|
|
|
|
|
- <i class="iconfont icon-edit"></i>编辑
|
|
|
|
|
- </button>
|
|
|
|
|
- <button type="button" class="action-btn delete" title="删除地块">
|
|
|
|
|
- <i class="iconfont icon-delete"></i>删除
|
|
|
|
|
- </button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <td>FK20230003</td>
|
|
|
|
|
- <td>南区果园C</td>
|
|
|
|
|
- <td>生态果园基地</td>
|
|
|
|
|
- <td>南区</td>
|
|
|
|
|
- <td>果园</td>
|
|
|
|
|
- <td>200</td>
|
|
|
|
|
- <td>苹果</td>
|
|
|
|
|
- <td>壤土</td>
|
|
|
|
|
- <td>微喷灌</td>
|
|
|
|
|
- <td>
|
|
|
|
|
- <span class="badge badge-warning">
|
|
|
|
|
- <i class="iconfont icon-warning badge-icon"></i>维护中
|
|
|
|
|
- </span>
|
|
|
|
|
- </td>
|
|
|
|
|
- <td>
|
|
|
|
|
- <span class="count-badge">
|
|
|
|
|
- <i class="iconfont icon-device"></i>5
|
|
|
|
|
- </span>
|
|
|
|
|
- </td>
|
|
|
|
|
- <td>
|
|
|
|
|
- <span class="count-badge">
|
|
|
|
|
- <i class="iconfont icon-user"></i>3
|
|
|
|
|
- </span>
|
|
|
|
|
- </td>
|
|
|
|
|
- <td>王五</td>
|
|
|
|
|
- <td>2023-05-20</td>
|
|
|
|
|
- <td>2023-07-05</td>
|
|
|
|
|
- <td>
|
|
|
|
|
- <div class="action-group">
|
|
|
|
|
- <button type="button" class="action-btn view" title="地块管理">
|
|
|
|
|
- <i class="iconfont icon-eye"></i>管理
|
|
|
|
|
- </button>
|
|
|
|
|
- <button type="button" class="action-btn edit" title="编辑地块">
|
|
|
|
|
- <i class="iconfont icon-edit"></i>编辑
|
|
|
|
|
- </button>
|
|
|
|
|
- <button type="button" class="action-btn delete" title="删除地块">
|
|
|
|
|
- <i class="iconfont icon-delete"></i>删除
|
|
|
|
|
- </button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <td>FK20230004</td>
|
|
|
|
|
- <td>北区小麦田D</td>
|
|
|
|
|
- <td>智慧农场二号</td>
|
|
|
|
|
- <td>北区</td>
|
|
|
|
|
- <td>旱地</td>
|
|
|
|
|
- <td>160</td>
|
|
|
|
|
- <td>小麦</td>
|
|
|
|
|
- <td>沙壤土</td>
|
|
|
|
|
- <td>漫灌</td>
|
|
|
|
|
- <td>
|
|
|
|
|
- <span class="badge badge-danger">
|
|
|
|
|
- <i class="iconfont icon-close-circle badge-icon"></i>未使用
|
|
|
|
|
- </span>
|
|
|
|
|
- </td>
|
|
|
|
|
- <td>
|
|
|
|
|
- <span class="count-badge">
|
|
|
|
|
- <i class="iconfont icon-device"></i>0
|
|
|
|
|
- </span>
|
|
|
|
|
- </td>
|
|
|
|
|
- <td>
|
|
|
|
|
- <span class="count-badge">
|
|
|
|
|
- <i class="iconfont icon-user"></i>0
|
|
|
|
|
- </span>
|
|
|
|
|
- </td>
|
|
|
|
|
- <td>赵六</td>
|
|
|
|
|
- <td>2023-06-10</td>
|
|
|
|
|
- <td>2023-07-15</td>
|
|
|
|
|
- <td>
|
|
|
|
|
- <div class="action-group">
|
|
|
|
|
- <button type="button" class="action-btn view" title="地块管理">
|
|
|
|
|
- <i class="iconfont icon-eye"></i>管理
|
|
|
|
|
- </button>
|
|
|
|
|
- <button type="button" class="action-btn edit" title="编辑地块">
|
|
|
|
|
- <i class="iconfont icon-edit"></i>编辑
|
|
|
|
|
- </button>
|
|
|
|
|
- <button type="button" class="action-btn delete" title="删除地块">
|
|
|
|
|
- <i class="iconfont icon-delete"></i>删除
|
|
|
|
|
- </button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </tbody>
|
|
|
|
|
- </table>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 分页 -->
|
|
|
|
|
- <div class="flex justify-between items-center px-6 py-4">
|
|
|
|
|
- <div class="text-sm text-gray-600">
|
|
|
|
|
- 共 <span class="text-primary font-medium">24</span> 条记录
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="pagination">
|
|
|
|
|
- <div class="page-item disabled">
|
|
|
|
|
- <i class="iconfont icon-left"></i>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="page-item active">1</div>
|
|
|
|
|
- <div class="page-item">2</div>
|
|
|
|
|
- <div class="page-item">3</div>
|
|
|
|
|
- <div class="page-item">
|
|
|
|
|
- <i class="iconfont icon-right"></i>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 新增/编辑地块模态框 -->
|
|
|
|
|
- <div id="fieldModal" class="modal hidden">
|
|
|
|
|
- <div class="modal-backdrop"></div>
|
|
|
|
|
- <div class="modal-dialog">
|
|
|
|
|
- <div class="modal-content">
|
|
|
|
|
- <!-- 模态框头部 -->
|
|
|
|
|
- <div class="modal-header">
|
|
|
|
|
- <h3 class="modal-title">新增地块</h3>
|
|
|
|
|
- <button type="button" class="modal-close" id="closeModal">
|
|
|
|
|
- <i class="iconfont icon-close"></i>
|
|
|
|
|
- </button>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 模态框内容 -->
|
|
|
|
|
- <div class="modal-body">
|
|
|
|
|
- <form id="fieldForm">
|
|
|
|
|
- <div class="form-grid">
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label class="form-label">地块名称<span class="required">*</span></label>
|
|
|
|
|
- <input type="text" name="fieldName" class="form-input" required>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label class="form-label">地块编号</label>
|
|
|
|
|
- <input type="text" name="fieldCode" class="form-input" placeholder="自动生成" disabled>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label class="form-label">所属农场<span class="required">*</span></label>
|
|
|
|
|
- <select name="farmId" class="form-input" required>
|
|
|
|
|
- <option value="">请选择农场</option>
|
|
|
|
|
- <option value="1">智慧农场一号</option>
|
|
|
|
|
- <option value="2">智慧农场二号</option>
|
|
|
|
|
- <option value="3">智慧农场三号</option>
|
|
|
|
|
- <option value="4">有机蔬菜基地</option>
|
|
|
|
|
- <option value="5">生态果园基地</option>
|
|
|
|
|
- </select>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label class="form-label">所属区域<span class="required">*</span></label>
|
|
|
|
|
- <select name="fieldArea" class="form-input" required>
|
|
|
|
|
- <option value="">请选择区域</option>
|
|
|
|
|
- <option value="1">东区</option>
|
|
|
|
|
- <option value="2">西区</option>
|
|
|
|
|
- <option value="3">南区</option>
|
|
|
|
|
- <option value="4">北区</option>
|
|
|
|
|
- </select>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label class="form-label">地块类型<span class="required">*</span></label>
|
|
|
|
|
- <select name="fieldType" class="form-input" required>
|
|
|
|
|
- <option value="">请选择类型</option>
|
|
|
|
|
- <option value="1">水田</option>
|
|
|
|
|
- <option value="2">旱地</option>
|
|
|
|
|
- <option value="3">果园</option>
|
|
|
|
|
- <option value="4">菜地</option>
|
|
|
|
|
- <option value="5">其他</option>
|
|
|
|
|
- </select>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label class="form-label">面积(亩)<span class="required">*</span></label>
|
|
|
|
|
- <input type="number" name="fieldSize" class="form-input" required>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label class="form-label">负责人</label>
|
|
|
|
|
- <select name="manager" class="form-input">
|
|
|
|
|
- <option value="">请选择负责人</option>
|
|
|
|
|
- <option value="1">张三</option>
|
|
|
|
|
- <option value="2">李四</option>
|
|
|
|
|
- <option value="3">王五</option>
|
|
|
|
|
- <option value="4">赵六</option>
|
|
|
|
|
- </select>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label class="form-label">种植作物</label>
|
|
|
|
|
- <select name="crops" class="form-input">
|
|
|
|
|
- <option value="">请选择作物</option>
|
|
|
|
|
- <optgroup label="粮食作物">
|
|
|
|
|
- <option value="101">水稻</option>
|
|
|
|
|
- <option value="102">小麦</option>
|
|
|
|
|
- <option value="103">玉米</option>
|
|
|
|
|
- <option value="104">大豆</option>
|
|
|
|
|
- <option value="105">高粱</option>
|
|
|
|
|
- <option value="106">谷子</option>
|
|
|
|
|
- </optgroup>
|
|
|
|
|
- <optgroup label="经济作物">
|
|
|
|
|
- <option value="201">棉花</option>
|
|
|
|
|
- <option value="202">油菜</option>
|
|
|
|
|
- <option value="203">花生</option>
|
|
|
|
|
- <option value="204">芝麻</option>
|
|
|
|
|
- <option value="205">甘蔗</option>
|
|
|
|
|
- <option value="206">烟草</option>
|
|
|
|
|
- <option value="207">茶叶</option>
|
|
|
|
|
- <option value="208">药材</option>
|
|
|
|
|
- </optgroup>
|
|
|
|
|
- <optgroup label="果树作物">
|
|
|
|
|
- <option value="301">葡萄</option>
|
|
|
|
|
- <option value="302">苹果</option>
|
|
|
|
|
- <option value="303">梨</option>
|
|
|
|
|
- <option value="304">桃</option>
|
|
|
|
|
- <option value="305">柑橘</option>
|
|
|
|
|
- <option value="306">枣</option>
|
|
|
|
|
- <option value="307">猕猴桃</option>
|
|
|
|
|
- <option value="308">石榴</option>
|
|
|
|
|
- <option value="309">杏</option>
|
|
|
|
|
- </optgroup>
|
|
|
|
|
- <optgroup label="蔬菜作物">
|
|
|
|
|
- <option value="401">叶菜类</option>
|
|
|
|
|
- <option value="402">根茎类</option>
|
|
|
|
|
- <option value="403">瓜果类</option>
|
|
|
|
|
- <option value="404">豆类</option>
|
|
|
|
|
- <option value="405">茄果类</option>
|
|
|
|
|
- <option value="406">葱蒜类</option>
|
|
|
|
|
- </optgroup>
|
|
|
|
|
- <optgroup label="其他作物">
|
|
|
|
|
- <option value="901">饲料作物</option>
|
|
|
|
|
- <option value="902">观赏作物</option>
|
|
|
|
|
- <option value="903">食用菌</option>
|
|
|
|
|
- <option value="999">其他</option>
|
|
|
|
|
- </optgroup>
|
|
|
|
|
- </select>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label class="form-label">土壤类型</label>
|
|
|
|
|
- <select name="soilType" class="form-input">
|
|
|
|
|
- <option value="">请选择</option>
|
|
|
|
|
- <option value="1">黏土</option>
|
|
|
|
|
- <option value="2">沙质土</option>
|
|
|
|
|
- <option value="3">壤土</option>
|
|
|
|
|
- <option value="4">沙壤土</option>
|
|
|
|
|
- <option value="5">其他</option>
|
|
|
|
|
- </select>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label class="form-label">灌溉方式</label>
|
|
|
|
|
- <select name="irrigationType" class="form-input">
|
|
|
|
|
- <option value="">请选择</option>
|
|
|
|
|
- <option value="1">喷灌</option>
|
|
|
|
|
- <option value="2">滴灌</option>
|
|
|
|
|
- <option value="3">微喷灌</option>
|
|
|
|
|
- <option value="4">漫灌</option>
|
|
|
|
|
- <option value="5">其他</option>
|
|
|
|
|
- </select>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label class="form-label">使用状态</label>
|
|
|
|
|
- <select name="status" class="form-input">
|
|
|
|
|
- <option value="1">使用中</option>
|
|
|
|
|
- <option value="2">维护中</option>
|
|
|
|
|
- <option value="0">未使用</option>
|
|
|
|
|
- <option value="3">闲置中</option>
|
|
|
|
|
- <option value="4">待开发</option>
|
|
|
|
|
- </select>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="form-group mt-4">
|
|
|
|
|
- <label class="form-label">地块描述</label>
|
|
|
|
|
- <textarea name="description" class="form-input" rows="4"></textarea>
|
|
|
|
|
- </div>
|
|
|
|
|
- </form>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 模态框底部 -->
|
|
|
|
|
- <div class="modal-footer">
|
|
|
|
|
- <button type="button" class="btn btn-outline" id="cancelBtn">取消</button>
|
|
|
|
|
- <button type="button" class="btn btn-primary" id="saveBtn">保存</button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <script>
|
|
|
|
|
- // 页面跳转函数
|
|
|
|
|
- function navigateTo(type, id) {
|
|
|
|
|
- switch(type) {
|
|
|
|
|
- case 'view':
|
|
|
|
|
- window.location.href = `../pages/field-detail.html?id=${id}`;
|
|
|
|
|
- break;
|
|
|
|
|
- case 'edit':
|
|
|
|
|
- window.location.href = `../pages/field-edit.html?id=${id}`;
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 全局函数,用于显示模态框
|
|
|
|
|
- function showModalDialog(event, type = 'add', rowData = null) {
|
|
|
|
|
- console.log('showModalDialog called', {type, rowData});
|
|
|
|
|
- try {
|
|
|
|
|
- if (event) {
|
|
|
|
|
- event.preventDefault();
|
|
|
|
|
- event.stopPropagation();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const modal = document.getElementById('fieldModal');
|
|
|
|
|
- if (!modal) {
|
|
|
|
|
- console.error('Modal not found');
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 设置模态框标题
|
|
|
|
|
- const modalTitle = modal.querySelector('.modal-title');
|
|
|
|
|
- if (modalTitle) {
|
|
|
|
|
- modalTitle.textContent = type === 'edit' ? '编辑地块' : '新增地块';
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 如果是编辑模式,预填充表单数据
|
|
|
|
|
- if (type === 'edit') {
|
|
|
|
|
- // 这里使用模拟数据,实际项目中应该从后端获取
|
|
|
|
|
- const mockFieldData = {
|
|
|
|
|
- fieldName: '西区蔬菜园B',
|
|
|
|
|
- fieldCode: 'FK20230002',
|
|
|
|
|
- farmId: '4', // 有机蔬菜基地
|
|
|
|
|
- fieldArea: '2', // 西区
|
|
|
|
|
- fieldType: '4', // 菜地
|
|
|
|
|
- fieldSize: '85',
|
|
|
|
|
- manager: '2', // 李四
|
|
|
|
|
- crops: '401', // 叶菜类
|
|
|
|
|
- soilType: '2', // 沙质土
|
|
|
|
|
- irrigationType: '2', // 滴灌
|
|
|
|
|
- status: '1', // 使用中
|
|
|
|
|
- description: '这是一个示例地块描述。'
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- const form = document.getElementById('fieldForm');
|
|
|
|
|
- if (form) {
|
|
|
|
|
- Object.keys(mockFieldData).forEach(key => {
|
|
|
|
|
- const input = form.elements[key];
|
|
|
|
|
- if (input) {
|
|
|
|
|
- input.value = mockFieldData[key];
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 显示模态框
|
|
|
|
|
- modal.style.cssText = 'display: block !important; opacity: 1 !important; visibility: visible !important;';
|
|
|
|
|
- modal.classList.remove('hidden');
|
|
|
|
|
- modal.classList.add('show');
|
|
|
|
|
- document.body.classList.add('modal-open');
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
- console.error('Error in showModalDialog:', error);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
|
- console.log('DOM Content Loaded');
|
|
|
|
|
-
|
|
|
|
|
- // 添加按钮点击事件
|
|
|
|
|
- const addButton = document.getElementById('addFieldBtn');
|
|
|
|
|
- if (addButton) {
|
|
|
|
|
- addButton.addEventListener('click', e => showModalDialog(e, 'add'));
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 为所有操作按钮添加事件监听
|
|
|
|
|
- document.querySelectorAll('.action-btn').forEach(btn => {
|
|
|
|
|
- btn.addEventListener('click', function(e) {
|
|
|
|
|
- e.preventDefault();
|
|
|
|
|
- e.stopPropagation();
|
|
|
|
|
-
|
|
|
|
|
- let type = 'add';
|
|
|
|
|
- if (this.classList.contains('view')) {
|
|
|
|
|
- type = 'view';
|
|
|
|
|
- navigateTo(type, this.getAttribute('data-id'));
|
|
|
|
|
- } else if (this.classList.contains('edit')) {
|
|
|
|
|
- type = 'edit';
|
|
|
|
|
- showModalDialog(e, type, {id: this.getAttribute('data-id')});
|
|
|
|
|
- } else if (this.classList.contains('delete')) {
|
|
|
|
|
- if (confirm('确认要删除该地块吗?')) {
|
|
|
|
|
- console.log('删除地块:', this.getAttribute('data-id'));
|
|
|
|
|
- // 这里添加删除逻辑
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- // 模态框关闭逻辑
|
|
|
|
|
- const modal = document.getElementById('fieldModal');
|
|
|
|
|
- const closeBtn = document.getElementById('closeModal');
|
|
|
|
|
- const cancelBtn = document.getElementById('cancelBtn');
|
|
|
|
|
- const form = document.getElementById('fieldForm');
|
|
|
|
|
-
|
|
|
|
|
- function hideModal(e) {
|
|
|
|
|
- if (e) {
|
|
|
|
|
- e.preventDefault();
|
|
|
|
|
- e.stopPropagation();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (!modal) return;
|
|
|
|
|
-
|
|
|
|
|
- // 强制隐藏模态框
|
|
|
|
|
- modal.style.cssText = 'display: none !important; opacity: 0 !important; visibility: hidden !important;';
|
|
|
|
|
- modal.classList.remove('show');
|
|
|
|
|
- modal.classList.add('hidden');
|
|
|
|
|
- document.body.classList.remove('modal-open');
|
|
|
|
|
-
|
|
|
|
|
- // 重置表单
|
|
|
|
|
- if (form) {
|
|
|
|
|
- form.reset();
|
|
|
|
|
- const inputs = form.querySelectorAll('input, select, textarea');
|
|
|
|
|
- inputs.forEach(input => {
|
|
|
|
|
- input.disabled = false;
|
|
|
|
|
- input.style.borderColor = '#ddd';
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 关闭按钮事件
|
|
|
|
|
- if (closeBtn) {
|
|
|
|
|
- closeBtn.onclick = hideModal;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 取消按钮事件
|
|
|
|
|
- if (cancelBtn) {
|
|
|
|
|
- cancelBtn.onclick = hideModal;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 点击背景关闭
|
|
|
|
|
- if (modal) {
|
|
|
|
|
- modal.onclick = function(e) {
|
|
|
|
|
- if (e.target === modal || e.target.classList.contains('modal-backdrop')) {
|
|
|
|
|
- hideModal(e);
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 保存按钮点击事件
|
|
|
|
|
- const saveBtn = document.getElementById('saveBtn');
|
|
|
|
|
- if (saveBtn) {
|
|
|
|
|
- saveBtn.onclick = function(e) {
|
|
|
|
|
- e.preventDefault();
|
|
|
|
|
- e.stopPropagation();
|
|
|
|
|
-
|
|
|
|
|
- if (!form) return;
|
|
|
|
|
-
|
|
|
|
|
- const requiredFields = form.querySelectorAll('[required]');
|
|
|
|
|
- let isValid = true;
|
|
|
|
|
-
|
|
|
|
|
- requiredFields.forEach(field => {
|
|
|
|
|
- if (!field.value.trim()) {
|
|
|
|
|
- field.style.borderColor = '#f44336';
|
|
|
|
|
- isValid = false;
|
|
|
|
|
- } else {
|
|
|
|
|
- field.style.borderColor = '#ddd';
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- if (!isValid) {
|
|
|
|
|
- alert('请填写必填项');
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- alert('地块信息保存成功');
|
|
|
|
|
- hideModal(e);
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 防止表单提交
|
|
|
|
|
- if (form) {
|
|
|
|
|
- form.onsubmit = function(e) {
|
|
|
|
|
- e.preventDefault();
|
|
|
|
|
- return false;
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 获取滚动相关元素
|
|
|
|
|
- const tableContainer = document.getElementById('tableContainer');
|
|
|
|
|
- const scrollLeftBtn = document.getElementById('scrollLeftBtn');
|
|
|
|
|
- const scrollRightBtn = document.getElementById('scrollRightBtn');
|
|
|
|
|
-
|
|
|
|
|
- // 更新滚动按钮状态
|
|
|
|
|
- function updateScrollButtons() {
|
|
|
|
|
- if (tableContainer) {
|
|
|
|
|
- const { scrollLeft, scrollWidth, clientWidth } = tableContainer;
|
|
|
|
|
-
|
|
|
|
|
- // 更新左滚动按钮状态
|
|
|
|
|
- if (scrollLeftBtn) {
|
|
|
|
|
- scrollLeftBtn.disabled = scrollLeft <= 0;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 更新右滚动按钮状态
|
|
|
|
|
- if (scrollRightBtn) {
|
|
|
|
|
- scrollRightBtn.disabled = scrollLeft + clientWidth >= scrollWidth;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 初始化滚动按钮状态
|
|
|
|
|
- updateScrollButtons();
|
|
|
|
|
-
|
|
|
|
|
- // 监听滚动事件
|
|
|
|
|
- if (tableContainer) {
|
|
|
|
|
- tableContainer.addEventListener('scroll', updateScrollButtons);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 左滚动按钮点击事件
|
|
|
|
|
- if (scrollLeftBtn) {
|
|
|
|
|
- scrollLeftBtn.addEventListener('click', () => {
|
|
|
|
|
- if (tableContainer) {
|
|
|
|
|
- tableContainer.scrollLeft -= 200; // 每次滚动200px
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 右滚动按钮点击事件
|
|
|
|
|
- if (scrollRightBtn) {
|
|
|
|
|
- scrollRightBtn.addEventListener('click', () => {
|
|
|
|
|
- if (tableContainer) {
|
|
|
|
|
- tableContainer.scrollLeft += 200; // 每次滚动200px
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 监听窗口大小变化
|
|
|
|
|
- window.addEventListener('resize', updateScrollButtons);
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- // 添加全局错误处理
|
|
|
|
|
- window.onerror = function(msg, url, line, col, error) {
|
|
|
|
|
- console.error('Global error:', {msg, url, line, col, error});
|
|
|
|
|
- return false;
|
|
|
|
|
- };
|
|
|
|
|
- </script>
|
|
|
|
|
-</body>
|
|
|
|
|
|
|
+<!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="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css">
|
|
|
|
|
+ <link rel="stylesheet" href="https://at.alicdn.com/t/font_3114978_qe0b39no76.css">
|
|
|
|
|
+ <link rel="stylesheet" href="../assets/css/global.css">
|
|
|
|
|
+ <style>
|
|
|
|
|
+ :root {
|
|
|
|
|
+ --primary: #4CAF50;
|
|
|
|
|
+ --primary-dark: #388E3C;
|
|
|
|
|
+ --primary-light: #A5D6A7;
|
|
|
|
|
+ --primary-bg: #F1F8E9;
|
|
|
|
|
+ --success: #4CAF50;
|
|
|
|
|
+ --warning: #FFC107;
|
|
|
|
|
+ --danger: #F44336;
|
|
|
|
|
+ --info: #2196F3;
|
|
|
|
|
+ --disabled: #9E9E9E;
|
|
|
|
|
+ --border: #E0E0E0;
|
|
|
|
|
+ --text-primary: #212121;
|
|
|
|
|
+ --text-secondary: #757575;
|
|
|
|
|
+ --radius: 8px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 全局样式重置 */
|
|
|
|
|
+ * {
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
+ padding: 0;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 移除所有固定定位和绝对定位元素 */
|
|
|
|
|
+ .fixed,
|
|
|
|
|
+ .absolute,
|
|
|
|
|
+ [style*="position: fixed"],
|
|
|
|
|
+ [style*="position: absolute"] {
|
|
|
|
|
+ display: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 移除所有圆形按钮和浮动元素 */
|
|
|
|
|
+ .circle,
|
|
|
|
|
+ .rounded-full,
|
|
|
|
|
+ .floating,
|
|
|
|
|
+ [class*="circle"],
|
|
|
|
|
+ [class*="round"],
|
|
|
|
|
+ [class*="float"] {
|
|
|
|
|
+ display: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 确保内容不会溢出 */
|
|
|
|
|
+ html, body {
|
|
|
|
|
+ overflow-x: hidden;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 移除所有可能的遮罩层 */
|
|
|
|
|
+ [class*="overlay"],
|
|
|
|
|
+ [class*="mask"],
|
|
|
|
|
+ [style*="z-index: 9999"] {
|
|
|
|
|
+ display: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 重置默认样式 */
|
|
|
|
|
+ html, body {
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
+ padding: 0;
|
|
|
|
|
+ font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ body {
|
|
|
|
|
+ background-color: #f5f7f9;
|
|
|
|
|
+ color: var(--text-primary);
|
|
|
|
|
+ overflow-x: hidden;
|
|
|
|
|
+ padding-top: 15px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 防止重复菜单 - 修改选择器避免影响按钮和模态框 */
|
|
|
|
|
+ body > div:not(.page-container):not(.modal):not(#fieldModal),
|
|
|
|
|
+ iframe#sidebar,
|
|
|
|
|
+ div.system-menu,
|
|
|
|
|
+ [id^="system-menu"],
|
|
|
|
|
+ [class^="system-menu"],
|
|
|
|
|
+ #admin-sidebar,
|
|
|
|
|
+ .menu-popup,
|
|
|
|
|
+ .user-avatar-circle {
|
|
|
|
|
+ display: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 移除可能影响按钮和模态框的全局样式 */
|
|
|
|
|
+ .circle-btn,
|
|
|
|
|
+ .floating-circle,
|
|
|
|
|
+ .round-button,
|
|
|
|
|
+ .scroll-top-btn,
|
|
|
|
|
+ .help-btn,
|
|
|
|
|
+ .chat-btn {
|
|
|
|
|
+ display: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 模态框样式 */
|
|
|
|
|
+ .modal {
|
|
|
|
|
+ display: none;
|
|
|
|
|
+ position: fixed;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ left: 0;
|
|
|
|
|
+ right: 0;
|
|
|
|
|
+ bottom: 0;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ background-color: rgba(0, 0, 0, 0.5);
|
|
|
|
|
+ z-index: 99999;
|
|
|
|
|
+ opacity: 0;
|
|
|
|
|
+ visibility: hidden;
|
|
|
|
|
+ transition: opacity 0.3s ease, visibility 0.3s ease;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .modal.show {
|
|
|
|
|
+ display: block !important;
|
|
|
|
|
+ opacity: 1 !important;
|
|
|
|
|
+ visibility: visible !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .modal-dialog {
|
|
|
|
|
+ position: fixed;
|
|
|
|
|
+ top: 50%;
|
|
|
|
|
+ left: 50%;
|
|
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
|
|
+ width: 90%;
|
|
|
|
|
+ max-width: 800px;
|
|
|
|
|
+ margin-top: 20px;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ z-index: 100000;
|
|
|
|
|
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .modal-content {
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .modal-header {
|
|
|
|
|
+ padding: 16px 24px;
|
|
|
|
|
+ border-bottom: 1px solid #e0e0e0;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ position: sticky;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ z-index: 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .modal-close {
|
|
|
|
|
+ padding: 8px;
|
|
|
|
|
+ background: none;
|
|
|
|
|
+ border: none;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ font-size: 20px;
|
|
|
|
|
+ color: #666;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ transition: all 0.3s;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .modal-close:hover {
|
|
|
|
|
+ background-color: rgba(0, 0, 0, 0.05);
|
|
|
|
|
+ color: #333;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .modal-title {
|
|
|
|
|
+ font-size: 18px;
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ color: #333;
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .modal-body {
|
|
|
|
|
+ padding: 24px;
|
|
|
|
|
+ max-height: calc(100vh - 200px);
|
|
|
|
|
+ overflow-y: auto;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .modal-footer {
|
|
|
|
|
+ padding: 16px 24px;
|
|
|
|
|
+ border-top: 1px solid #e0e0e0;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: flex-end;
|
|
|
|
|
+ gap: 12px;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .form-grid {
|
|
|
|
|
+ display: grid;
|
|
|
|
|
+ grid-template-columns: repeat(2, 1fr);
|
|
|
|
|
+ gap: 20px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .form-group {
|
|
|
|
|
+ margin-bottom: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .form-label {
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ margin-bottom: 8px;
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ color: #333;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .form-input {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ padding: 8px 12px;
|
|
|
|
|
+ border: 1px solid #ddd;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ transition: all 0.3s;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .form-input:focus {
|
|
|
|
|
+ border-color: var(--primary);
|
|
|
|
|
+ box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
|
|
|
|
|
+ outline: none;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .required {
|
|
|
|
|
+ color: #f44336;
|
|
|
|
|
+ margin-left: 4px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 确保所有按钮可点击 */
|
|
|
|
|
+ .action-btn,
|
|
|
|
|
+ .btn,
|
|
|
|
|
+ button {
|
|
|
|
|
+ cursor: pointer !important;
|
|
|
|
|
+ pointer-events: auto !important;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ z-index: 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 移除可能影响按钮的样式 */
|
|
|
|
|
+ body > div:not(.page-container):not(.modal):not(#fieldModal) {
|
|
|
|
|
+ display: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 确保所有操作按钮可见和可交互 */
|
|
|
|
|
+ .action-btn,
|
|
|
|
|
+ #addFieldBtn,
|
|
|
|
|
+ .btn-primary,
|
|
|
|
|
+ .btn-outline,
|
|
|
|
|
+ .modal button {
|
|
|
|
|
+ visibility: visible !important;
|
|
|
|
|
+ opacity: 1 !important;
|
|
|
|
|
+ display: inline-flex !important;
|
|
|
|
|
+ pointer-events: auto !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 页面容器 */
|
|
|
|
|
+ .page-container {
|
|
|
|
|
+ max-width: 100%;
|
|
|
|
|
+ padding: 24px;
|
|
|
|
|
+ padding-top: 42px;
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ z-index: 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 页面标题和操作按钮容器 */
|
|
|
|
|
+ .page-header {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ margin-bottom: 20px;
|
|
|
|
|
+ padding-bottom: 16px;
|
|
|
|
|
+ border-bottom: 1px solid var(--border);
|
|
|
|
|
+ padding-top: 10px;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 添加新增按钮的特定样式 */
|
|
|
|
|
+ .add-button-container {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ z-index: 9999;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ #addFieldBtn {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ z-index: 9999 !important;
|
|
|
|
|
+ visibility: visible !important;
|
|
|
|
|
+ opacity: 1 !important;
|
|
|
|
|
+ display: inline-flex !important;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ pointer-events: auto !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .page-title {
|
|
|
|
|
+ font-size: 22px;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ color: var(--text-primary);
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .page-title::before {
|
|
|
|
|
+ content: "";
|
|
|
|
|
+ width: 4px;
|
|
|
|
|
+ height: 22px;
|
|
|
|
|
+ background-color: var(--primary);
|
|
|
|
|
+ margin-right: 8px;
|
|
|
|
|
+ border-radius: 2px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .search-card {
|
|
|
|
|
+ background-color: #fff;
|
|
|
|
|
+ border-radius: var(--radius);
|
|
|
|
|
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
|
|
|
|
|
+ padding: 16px;
|
|
|
|
|
+ margin-bottom: 20px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .search-input {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ border: 1px solid var(--border);
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ padding: 6px 12px;
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ transition: all 0.3s;
|
|
|
|
|
+ height: 32px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .search-input:focus {
|
|
|
|
|
+ border-color: var(--primary);
|
|
|
|
|
+ box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
|
|
|
|
|
+ outline: none;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .form-select {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ padding: 6px 24px 6px 10px;
|
|
|
|
|
+ border: 1px solid var(--border);
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23757575' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
|
|
|
|
|
+ background-repeat: no-repeat;
|
|
|
|
|
+ background-position: right 8px center;
|
|
|
|
|
+ background-size: 14px;
|
|
|
|
|
+ -webkit-appearance: none;
|
|
|
|
|
+ -moz-appearance: none;
|
|
|
|
|
+ appearance: none;
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ color: #333;
|
|
|
|
|
+ height: 32px;
|
|
|
|
|
+ line-height: 1.2;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .form-select:focus {
|
|
|
|
|
+ border-color: var(--primary);
|
|
|
|
|
+ box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
|
|
|
|
|
+ outline: none;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 调整搜索区按钮样式 */
|
|
|
|
|
+ .search-card .btn {
|
|
|
|
|
+ height: 32px;
|
|
|
|
|
+ padding: 0 16px;
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .search-card .btn-icon {
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 调整间距 */
|
|
|
|
|
+ .search-card .grid.gap-4 {
|
|
|
|
|
+ gap: 12px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 调整搜索图标大小和位置 */
|
|
|
|
|
+ .search-input + button .iconfont {
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 调整日期输入框样式 */
|
|
|
|
|
+ .search-card input[type="date"] {
|
|
|
|
|
+ height: 32px;
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ padding: 6px 10px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 添加placeholder样式 */
|
|
|
|
|
+ .search-input::placeholder {
|
|
|
|
|
+ color: #999;
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 调整select的placeholder颜色 */
|
|
|
|
|
+ .form-select option:first-child {
|
|
|
|
|
+ color: #999;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .table-card {
|
|
|
|
|
+ background-color: #fff;
|
|
|
|
|
+ border-radius: var(--radius);
|
|
|
|
|
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .table-container {
|
|
|
|
|
+ overflow-x: auto;
|
|
|
|
|
+ border-radius: var(--radius);
|
|
|
|
|
+ max-height: calc(100vh - 320px);
|
|
|
|
|
+ min-height: 400px;
|
|
|
|
|
+ overflow-y: auto;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ scrollbar-width: thin;
|
|
|
|
|
+ scrollbar-color: #cbd5e1 #f1f5f9;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .table-container::-webkit-scrollbar {
|
|
|
|
|
+ height: 6px;
|
|
|
|
|
+ width: 6px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .table-container::-webkit-scrollbar-track {
|
|
|
|
|
+ background: #f1f5f9;
|
|
|
|
|
+ border-radius: 3px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .table-container::-webkit-scrollbar-thumb {
|
|
|
|
|
+ background: #cbd5e1;
|
|
|
|
|
+ border-radius: 3px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .table-container::-webkit-scrollbar-thumb:hover {
|
|
|
|
|
+ background: #94a3b8;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .badge {
|
|
|
|
|
+ display: inline-flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ padding: 2px 8px;
|
|
|
|
|
+ border-radius: 12px;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ line-height: 1.5;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .badge-success {
|
|
|
|
|
+ background-color: #dcfce7;
|
|
|
|
|
+ color: #15803d;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .badge-warning {
|
|
|
|
|
+ background-color: #fef9c3;
|
|
|
|
|
+ color: #854d0e;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .badge-danger {
|
|
|
|
|
+ background-color: #fee2e2;
|
|
|
|
|
+ color: #b91c1c;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .badge-icon {
|
|
|
|
|
+ margin-right: 4px;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .action-group {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ gap: 8px;
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
|
+ padding: 4px 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .action-group + .action-group {
|
|
|
|
|
+ margin-top: 4px;
|
|
|
|
|
+ padding-top: 4px;
|
|
|
|
|
+ border-top: 1px solid #f0f0f0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .action-btn {
|
|
|
|
|
+ display: inline-flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ padding: 4px 8px;
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ line-height: 1;
|
|
|
|
|
+ color: #666;
|
|
|
|
|
+ background: transparent;
|
|
|
|
|
+ border: none;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ transition: all 0.2s;
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+ text-decoration: none;
|
|
|
|
|
+ -webkit-appearance: none;
|
|
|
|
|
+ -moz-appearance: none;
|
|
|
|
|
+ appearance: none;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .action-btn:hover {
|
|
|
|
|
+ color: var(--primary);
|
|
|
|
|
+ background-color: rgba(76, 175, 80, 0.1);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .action-btn:focus {
|
|
|
|
|
+ outline: none;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .action-btn i {
|
|
|
|
|
+ margin-right: 4px;
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .action-btn.view:hover {
|
|
|
|
|
+ color: var(--primary);
|
|
|
|
|
+ background-color: rgba(76, 175, 80, 0.1);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .action-btn.edit:hover {
|
|
|
|
|
+ color: var(--info);
|
|
|
|
|
+ background-color: rgba(33, 150, 243, 0.1);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .action-btn.delete:hover {
|
|
|
|
|
+ color: var(--danger);
|
|
|
|
|
+ background-color: rgba(244, 67, 54, 0.1);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 确保最后一列的操作按钮容器没有背景 */
|
|
|
|
|
+ tr td:last-child {
|
|
|
|
|
+ background: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .pagination {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 8px;
|
|
|
|
|
+ margin-top: 20px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .pagination .page-item {
|
|
|
|
|
+ width: 32px;
|
|
|
|
|
+ height: 32px;
|
|
|
|
|
+ display: inline-flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ transition: all 0.2s;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .pagination .page-item:hover {
|
|
|
|
|
+ background-color: #f5f5f5;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .pagination .page-item.active {
|
|
|
|
|
+ background-color: var(--primary);
|
|
|
|
|
+ color: white;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .pagination .page-item.disabled {
|
|
|
|
|
+ color: #ccc;
|
|
|
|
|
+ cursor: not-allowed;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .count-badge {
|
|
|
|
|
+ display: inline-flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 4px;
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ color: #475569;
|
|
|
|
|
+ padding: 2px 4px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .count-badge i {
|
|
|
|
|
+ color: #64748b;
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 新增按钮容器样式 */
|
|
|
|
|
+ .add-button-container {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ z-index: 9999;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 新增按钮的特定样式 */
|
|
|
|
|
+ #addFieldBtn {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ z-index: 9999 !important;
|
|
|
|
|
+ visibility: visible !important;
|
|
|
|
|
+ opacity: 1 !important;
|
|
|
|
|
+ display: inline-flex !important;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ pointer-events: auto !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 防止页面滚动 */
|
|
|
|
|
+ body.modal-open {
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @media (max-width: 768px) {
|
|
|
|
|
+ .form-grid {
|
|
|
|
|
+ grid-template-columns: 1fr;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .modal-dialog {
|
|
|
|
|
+ margin: 10px;
|
|
|
|
|
+ width: auto;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 表格样式优化 */
|
|
|
|
|
+ table {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ border-collapse: separate;
|
|
|
|
|
+ border-spacing: 0;
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ table-layout: fixed;
|
|
|
|
|
+ background: transparent !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 表格行样式 */
|
|
|
|
|
+ tr {
|
|
|
|
|
+ background: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ tr::before,
|
|
|
|
|
+ tr::after {
|
|
|
|
|
+ display: none !important;
|
|
|
|
|
+ content: none !important;
|
|
|
|
|
+ background: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 表格单元格基础样式 */
|
|
|
|
|
+ th, td {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ background: none !important;
|
|
|
|
|
+ border-radius: 0 !important;
|
|
|
|
|
+ -webkit-border-radius: 0 !important;
|
|
|
|
|
+ -moz-border-radius: 0 !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ td {
|
|
|
|
|
+ padding: 12px 16px;
|
|
|
|
|
+ border-bottom: 1px solid #e2e8f0;
|
|
|
|
|
+ color: #1e293b;
|
|
|
|
|
+ line-height: 1.4;
|
|
|
|
|
+ vertical-align: middle;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 确保操作列没有任何装饰 */
|
|
|
|
|
+ td:last-child {
|
|
|
|
|
+ background: none !important;
|
|
|
|
|
+ border-radius: 0 !important;
|
|
|
|
|
+ -webkit-border-radius: 0 !important;
|
|
|
|
|
+ -moz-border-radius: 0 !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ td:last-child::before,
|
|
|
|
|
+ td:last-child::after {
|
|
|
|
|
+ display: none !important;
|
|
|
|
|
+ content: none !important;
|
|
|
|
|
+ background: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 操作按钮组容器样式 */
|
|
|
|
|
+ .action-group {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ gap: 6px;
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
|
+ background: none !important;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ border-radius: 0 !important;
|
|
|
|
|
+ -webkit-border-radius: 0 !important;
|
|
|
|
|
+ -moz-border-radius: 0 !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .action-group::before,
|
|
|
|
|
+ .action-group::after {
|
|
|
|
|
+ display: none !important;
|
|
|
|
|
+ content: none !important;
|
|
|
|
|
+ background: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 操作按钮样式 */
|
|
|
|
|
+ .action-btn {
|
|
|
|
|
+ padding: 4px 8px;
|
|
|
|
|
+ background: none !important;
|
|
|
|
|
+ color: #64748b;
|
|
|
|
|
+ cursor: pointer !important;
|
|
|
|
|
+ transition: all 0.2s;
|
|
|
|
|
+ display: inline-flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ border: none !important;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ line-height: 1;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ outline: none !important;
|
|
|
|
|
+ box-shadow: none !important;
|
|
|
|
|
+ -webkit-appearance: none !important;
|
|
|
|
|
+ -moz-appearance: none !important;
|
|
|
|
|
+ appearance: none !important;
|
|
|
|
|
+ border-radius: 4px !important;
|
|
|
|
|
+ -webkit-border-radius: 4px !important;
|
|
|
|
|
+ -moz-border-radius: 4px !important;
|
|
|
|
|
+ text-decoration: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .action-btn::before,
|
|
|
|
|
+ .action-btn::after {
|
|
|
|
|
+ display: none !important;
|
|
|
|
|
+ content: none !important;
|
|
|
|
|
+ background: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 鼠标悬停效果 */
|
|
|
|
|
+ .action-btn:hover {
|
|
|
|
|
+ color: var(--primary);
|
|
|
|
|
+ background-color: rgba(241, 245, 249, 0.9) !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .action-btn.edit:hover {
|
|
|
|
|
+ color: #0284c7;
|
|
|
|
|
+ background-color: rgba(240, 249, 255, 0.9) !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .action-btn.delete:hover {
|
|
|
|
|
+ color: #dc2626;
|
|
|
|
|
+ background-color: rgba(254, 242, 242, 0.9) !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 按钮图标样式 */
|
|
|
|
|
+ .action-btn i {
|
|
|
|
|
+ margin-right: 4px;
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ display: inline-flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ background: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 移除所有可能的装饰性样式 */
|
|
|
|
|
+ .action-btn,
|
|
|
|
|
+ .action-btn:focus,
|
|
|
|
|
+ .action-btn:hover,
|
|
|
|
|
+ .action-btn:active,
|
|
|
|
|
+ .action-group,
|
|
|
|
|
+ td,
|
|
|
|
|
+ tr,
|
|
|
|
|
+ th {
|
|
|
|
|
+ text-decoration: none !important;
|
|
|
|
|
+ -webkit-appearance: none !important;
|
|
|
|
|
+ -moz-appearance: none !important;
|
|
|
|
|
+ appearance: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 确保表格行交替背景色正确 */
|
|
|
|
|
+ tbody tr:hover {
|
|
|
|
|
+ background-color: #f8fafc !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ tbody tr:hover td {
|
|
|
|
|
+ background: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 移除所有可能的轮廓和装饰 */
|
|
|
|
|
+ *:focus {
|
|
|
|
|
+ outline: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 确保按钮组之间的间距正确 */
|
|
|
|
|
+ .action-group + .action-group {
|
|
|
|
|
+ margin-top: 4px;
|
|
|
|
|
+ border-top: none !important;
|
|
|
|
|
+ background: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 移除滚动按钮相关样式 */
|
|
|
|
|
+ #scrollLeftBtn,
|
|
|
|
|
+ #scrollRightBtn {
|
|
|
|
|
+ display: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .w-8,
|
|
|
|
|
+ .h-8,
|
|
|
|
|
+ .shadow-md {
|
|
|
|
|
+ display: none !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 表格容器相关样式 */
|
|
|
|
|
+ .table-container-wrapper {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ padding: 0 40px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .scroll-button {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 50%;
|
|
|
|
|
+ transform: translateY(-50%);
|
|
|
|
|
+ width: 32px;
|
|
|
|
|
+ height: 32px;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ border: 1px solid #e5e7eb;
|
|
|
|
|
+ border-radius: 50%;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
|
|
|
+ z-index: 10;
|
|
|
|
|
+ transition: all 0.2s;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .scroll-button:hover {
|
|
|
|
|
+ background: #f9fafb;
|
|
|
|
|
+ border-color: #d1d5db;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .scroll-button:disabled {
|
|
|
|
|
+ opacity: 0.5;
|
|
|
|
|
+ cursor: not-allowed;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .scroll-button.left {
|
|
|
|
|
+ left: 4px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .scroll-button.right {
|
|
|
|
|
+ right: 4px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .scroll-button i {
|
|
|
|
|
+ font-size: 16px;
|
|
|
|
|
+ color: #6b7280;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 确保操作按钮在一行 */
|
|
|
|
|
+ .action-group {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ gap: 8px;
|
|
|
|
|
+ flex-wrap: nowrap;
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 调整表格滚动容器 */
|
|
|
|
|
+ .table-container {
|
|
|
|
|
+ overflow-x: auto;
|
|
|
|
|
+ scrollbar-width: thin;
|
|
|
|
|
+ scrollbar-color: #cbd5e1 #f1f5f9;
|
|
|
|
|
+ -ms-overflow-style: none;
|
|
|
|
|
+ scroll-behavior: smooth;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .table-container::-webkit-scrollbar {
|
|
|
|
|
+ height: 6px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .table-container::-webkit-scrollbar-track {
|
|
|
|
|
+ background: #f1f5f9;
|
|
|
|
|
+ border-radius: 3px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .table-container::-webkit-scrollbar-thumb {
|
|
|
|
|
+ background: #cbd5e1;
|
|
|
|
|
+ border-radius: 3px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .table-container::-webkit-scrollbar-thumb:hover {
|
|
|
|
|
+ background: #94a3b8;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 调整表格最后一列宽度 */
|
|
|
|
|
+ table th:last-child,
|
|
|
|
|
+ table td:last-child {
|
|
|
|
|
+ min-width: 200px;
|
|
|
|
|
+ width: 200px;
|
|
|
|
|
+ }
|
|
|
|
|
+ </style>
|
|
|
|
|
+</head>
|
|
|
|
|
+<body>
|
|
|
|
|
+ <div class="page-container">
|
|
|
|
|
+ <!-- 页面标题和操作按钮 -->
|
|
|
|
|
+ <div class="page-header">
|
|
|
|
|
+ <div class="flex items-center">
|
|
|
|
|
+ <h1 class="page-title">地块管理</h1>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="add-button-container">
|
|
|
|
|
+ <button type="button"
|
|
|
|
|
+ class="btn btn-primary"
|
|
|
|
|
+ id="addFieldBtn"
|
|
|
|
|
+ onclick="showModalDialog(event)">
|
|
|
|
|
+ <i class="iconfont icon-plus btn-icon"></i>新增地块
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 搜索和筛选区域 -->
|
|
|
|
|
+ <div class="search-card">
|
|
|
|
|
+ <div class="grid grid-cols-1 gap-4">
|
|
|
|
|
+ <div class="grid grid-cols-1 md:grid-cols-4 lg:grid-cols-6 gap-4">
|
|
|
|
|
+ <!-- 搜索框 -->
|
|
|
|
|
+ <div class="md:col-span-2 lg:col-span-2">
|
|
|
|
|
+ <div class="relative">
|
|
|
|
|
+ <input type="text" class="search-input" placeholder="请输入地块编号、名称、位置关键词">
|
|
|
|
|
+ <button class="absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-400 focus:outline-none">
|
|
|
|
|
+ <i class="iconfont icon-search"></i>
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 筛选项第一行 -->
|
|
|
|
|
+ <div class="md:col-span-1 lg:col-span-1">
|
|
|
|
|
+ <select class="form-select">
|
|
|
|
|
+ <option value="">所属农场</option>
|
|
|
|
|
+ <option value="1">智慧农场一号</option>
|
|
|
|
|
+ <option value="2">智慧农场二号</option>
|
|
|
|
|
+ <option value="3">智慧农场三号</option>
|
|
|
|
|
+ <option value="4">有机蔬菜基地</option>
|
|
|
|
|
+ <option value="5">生态果园基地</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="md:col-span-1 lg:col-span-1">
|
|
|
|
|
+ <select class="form-select">
|
|
|
|
|
+ <option value="">所属区域</option>
|
|
|
|
|
+ <option value="1">东区</option>
|
|
|
|
|
+ <option value="2">西区</option>
|
|
|
|
|
+ <option value="3">南区</option>
|
|
|
|
|
+ <option value="4">北区</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="md:col-span-1 lg:col-span-1">
|
|
|
|
|
+ <select class="form-select">
|
|
|
|
|
+ <option value="">使用状态</option>
|
|
|
|
|
+ <option value="1">使用中</option>
|
|
|
|
|
+ <option value="2">维护中</option>
|
|
|
|
|
+ <option value="0">未使用</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="md:col-span-1 lg:col-span-1">
|
|
|
|
|
+ <select class="form-select">
|
|
|
|
|
+ <option value="">土壤类型</option>
|
|
|
|
|
+ <option value="1">黏土</option>
|
|
|
|
|
+ <option value="2">沙质土</option>
|
|
|
|
|
+ <option value="3">壤土</option>
|
|
|
|
|
+ <option value="4">沙壤土</option>
|
|
|
|
|
+ <option value="5">其他</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 筛选项第二行 -->
|
|
|
|
|
+ <div class="grid grid-cols-1 md:grid-cols-4 lg:grid-cols-6 gap-4">
|
|
|
|
|
+ <div class="md:col-span-1 lg:col-span-1">
|
|
|
|
|
+ <select class="form-select">
|
|
|
|
|
+ <option value="">灌溉方式</option>
|
|
|
|
|
+ <option value="1">喷灌</option>
|
|
|
|
|
+ <option value="2">滴灌</option>
|
|
|
|
|
+ <option value="3">微喷灌</option>
|
|
|
|
|
+ <option value="4">漫灌</option>
|
|
|
|
|
+ <option value="5">其他</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="md:col-span-1 lg:col-span-1">
|
|
|
|
|
+ <select class="form-select">
|
|
|
|
|
+ <option value="">种植作物</option>
|
|
|
|
|
+ <optgroup label="粮食作物">
|
|
|
|
|
+ <option value="101">水稻</option>
|
|
|
|
|
+ <option value="102">小麦</option>
|
|
|
|
|
+ <option value="103">玉米</option>
|
|
|
|
|
+ <option value="104">大豆</option>
|
|
|
|
|
+ <option value="105">高粱</option>
|
|
|
|
|
+ <option value="106">谷子</option>
|
|
|
|
|
+ </optgroup>
|
|
|
|
|
+ <optgroup label="经济作物">
|
|
|
|
|
+ <option value="201">棉花</option>
|
|
|
|
|
+ <option value="202">油菜</option>
|
|
|
|
|
+ <option value="203">花生</option>
|
|
|
|
|
+ <option value="204">芝麻</option>
|
|
|
|
|
+ <option value="205">甘蔗</option>
|
|
|
|
|
+ <option value="206">烟草</option>
|
|
|
|
|
+ <option value="207">茶叶</option>
|
|
|
|
|
+ <option value="208">药材</option>
|
|
|
|
|
+ </optgroup>
|
|
|
|
|
+ <optgroup label="果树作物">
|
|
|
|
|
+ <option value="301">葡萄</option>
|
|
|
|
|
+ <option value="302">苹果</option>
|
|
|
|
|
+ <option value="303">梨</option>
|
|
|
|
|
+ <option value="304">桃</option>
|
|
|
|
|
+ <option value="305">柑橘</option>
|
|
|
|
|
+ <option value="306">枣</option>
|
|
|
|
|
+ <option value="307">猕猴桃</option>
|
|
|
|
|
+ <option value="308">石榴</option>
|
|
|
|
|
+ <option value="309">杏</option>
|
|
|
|
|
+ </optgroup>
|
|
|
|
|
+ <optgroup label="蔬菜作物">
|
|
|
|
|
+ <option value="401">叶菜类</option>
|
|
|
|
|
+ <option value="402">根茎类</option>
|
|
|
|
|
+ <option value="403">瓜果类</option>
|
|
|
|
|
+ <option value="404">豆类</option>
|
|
|
|
|
+ <option value="405">茄果类</option>
|
|
|
|
|
+ <option value="406">葱蒜类</option>
|
|
|
|
|
+ </optgroup>
|
|
|
|
|
+ <optgroup label="其他作物">
|
|
|
|
|
+ <option value="901">饲料作物</option>
|
|
|
|
|
+ <option value="902">观赏作物</option>
|
|
|
|
|
+ <option value="903">食用菌</option>
|
|
|
|
|
+ <option value="999">其他</option>
|
|
|
|
|
+ </optgroup>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="md:col-span-1 lg:col-span-1">
|
|
|
|
|
+ <div class="relative">
|
|
|
|
|
+ <input type="text" class="search-input" placeholder="负责人">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="md:col-span-1 lg:col-span-1">
|
|
|
|
|
+ <div class="relative">
|
|
|
|
|
+ <input type="date" class="search-input" placeholder="创建日期">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="md:col-span-2 lg:col-span-2 flex justify-end items-center gap-2">
|
|
|
|
|
+ <button class="btn btn-primary">
|
|
|
|
|
+ <i class="iconfont icon-search btn-icon"></i>查询
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button class="btn btn-outline">
|
|
|
|
|
+ <i class="iconfont icon-refresh btn-icon"></i>重置
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 表格列表 -->
|
|
|
|
|
+ <div class="table-card">
|
|
|
|
|
+ <div class="relative table-container-wrapper">
|
|
|
|
|
+ <!-- 左滑动按钮 -->
|
|
|
|
|
+ <button type="button" class="scroll-button left" id="scrollLeftBtn" disabled>
|
|
|
|
|
+ <i class="iconfont icon-left"></i>
|
|
|
|
|
+ </button>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 右滑动按钮 -->
|
|
|
|
|
+ <button type="button" class="scroll-button right" id="scrollRightBtn">
|
|
|
|
|
+ <i class="iconfont icon-right"></i>
|
|
|
|
|
+ </button>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 表格容器 -->
|
|
|
|
|
+ <div class="table-container" id="tableContainer">
|
|
|
|
|
+ <table>
|
|
|
|
|
+ <thead>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th class="whitespace-nowrap min-w-[120px]">地块编号</th>
|
|
|
|
|
+ <th class="whitespace-nowrap min-w-[120px]">地块名称</th>
|
|
|
|
|
+ <th class="whitespace-nowrap min-w-[120px]">所属农场</th>
|
|
|
|
|
+ <th class="whitespace-nowrap min-w-[100px]">所属区域</th>
|
|
|
|
|
+ <th class="whitespace-nowrap min-w-[100px]">地块类型</th>
|
|
|
|
|
+ <th class="whitespace-nowrap min-w-[90px]">面积(亩)</th>
|
|
|
|
|
+ <th class="whitespace-nowrap min-w-[120px]">种植作物</th>
|
|
|
|
|
+ <th class="whitespace-nowrap min-w-[100px]">土壤类型</th>
|
|
|
|
|
+ <th class="whitespace-nowrap min-w-[100px]">灌溉方式</th>
|
|
|
|
|
+ <th class="whitespace-nowrap min-w-[100px]">使用状态</th>
|
|
|
|
|
+ <th class="whitespace-nowrap min-w-[100px]">绑定设备</th>
|
|
|
|
|
+ <th class="whitespace-nowrap min-w-[100px]">绑定人员</th>
|
|
|
|
|
+ <th class="whitespace-nowrap min-w-[100px]">负责人</th>
|
|
|
|
|
+ <th class="whitespace-nowrap min-w-[120px]">创建时间</th>
|
|
|
|
|
+ <th class="whitespace-nowrap min-w-[120px]">上次更新</th>
|
|
|
|
|
+ <th class="whitespace-nowrap min-w-[180px]">操作</th>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </thead>
|
|
|
|
|
+ <tbody>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <td>FK20230001</td>
|
|
|
|
|
+ <td>东区水稻田A</td>
|
|
|
|
|
+ <td>智慧农场一号</td>
|
|
|
|
|
+ <td>东区</td>
|
|
|
|
|
+ <td>水田</td>
|
|
|
|
|
+ <td>120</td>
|
|
|
|
|
+ <td>水稻</td>
|
|
|
|
|
+ <td>黏土</td>
|
|
|
|
|
+ <td>喷灌</td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <span class="badge badge-success">
|
|
|
|
|
+ <i class="iconfont icon-check-circle badge-icon"></i>使用中
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <span class="count-badge">
|
|
|
|
|
+ <i class="iconfont icon-device"></i>3
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <span class="count-badge">
|
|
|
|
|
+ <i class="iconfont icon-user"></i>2
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td>张三</td>
|
|
|
|
|
+ <td>2023-05-15</td>
|
|
|
|
|
+ <td>2023-06-20</td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <div class="action-group">
|
|
|
|
|
+ <button type="button" class="action-btn view" title="地块管理">
|
|
|
|
|
+ <i class="iconfont icon-eye"></i>管理
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button type="button" class="action-btn edit" title="编辑地块">
|
|
|
|
|
+ <i class="iconfont icon-edit"></i>编辑
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button type="button" class="action-btn delete" title="删除地块">
|
|
|
|
|
+ <i class="iconfont icon-delete"></i>删除
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <td>FK20230002</td>
|
|
|
|
|
+ <td>西区蔬菜园B</td>
|
|
|
|
|
+ <td>有机蔬菜基地</td>
|
|
|
|
|
+ <td>西区</td>
|
|
|
|
|
+ <td>菜地</td>
|
|
|
|
|
+ <td>85</td>
|
|
|
|
|
+ <td>青菜、萝卜</td>
|
|
|
|
|
+ <td>沙质土</td>
|
|
|
|
|
+ <td>滴灌</td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <span class="badge badge-success">
|
|
|
|
|
+ <i class="iconfont icon-check-circle badge-icon"></i>使用中
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <span class="count-badge">
|
|
|
|
|
+ <i class="iconfont icon-device"></i>2
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <span class="count-badge">
|
|
|
|
|
+ <i class="iconfont icon-user"></i>1
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td>李四</td>
|
|
|
|
|
+ <td>2023-05-18</td>
|
|
|
|
|
+ <td>2023-06-25</td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <div class="action-group">
|
|
|
|
|
+ <button type="button" class="action-btn view" title="地块管理">
|
|
|
|
|
+ <i class="iconfont icon-eye"></i>管理
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button type="button" class="action-btn edit" title="编辑地块">
|
|
|
|
|
+ <i class="iconfont icon-edit"></i>编辑
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button type="button" class="action-btn delete" title="删除地块">
|
|
|
|
|
+ <i class="iconfont icon-delete"></i>删除
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <td>FK20230003</td>
|
|
|
|
|
+ <td>南区果园C</td>
|
|
|
|
|
+ <td>生态果园基地</td>
|
|
|
|
|
+ <td>南区</td>
|
|
|
|
|
+ <td>果园</td>
|
|
|
|
|
+ <td>200</td>
|
|
|
|
|
+ <td>苹果</td>
|
|
|
|
|
+ <td>壤土</td>
|
|
|
|
|
+ <td>微喷灌</td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <span class="badge badge-warning">
|
|
|
|
|
+ <i class="iconfont icon-warning badge-icon"></i>维护中
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <span class="count-badge">
|
|
|
|
|
+ <i class="iconfont icon-device"></i>5
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <span class="count-badge">
|
|
|
|
|
+ <i class="iconfont icon-user"></i>3
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td>王五</td>
|
|
|
|
|
+ <td>2023-05-20</td>
|
|
|
|
|
+ <td>2023-07-05</td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <div class="action-group">
|
|
|
|
|
+ <button type="button" class="action-btn view" title="地块管理">
|
|
|
|
|
+ <i class="iconfont icon-eye"></i>管理
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button type="button" class="action-btn edit" title="编辑地块">
|
|
|
|
|
+ <i class="iconfont icon-edit"></i>编辑
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button type="button" class="action-btn delete" title="删除地块">
|
|
|
|
|
+ <i class="iconfont icon-delete"></i>删除
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <td>FK20230004</td>
|
|
|
|
|
+ <td>北区小麦田D</td>
|
|
|
|
|
+ <td>智慧农场二号</td>
|
|
|
|
|
+ <td>北区</td>
|
|
|
|
|
+ <td>旱地</td>
|
|
|
|
|
+ <td>160</td>
|
|
|
|
|
+ <td>小麦</td>
|
|
|
|
|
+ <td>沙壤土</td>
|
|
|
|
|
+ <td>漫灌</td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <span class="badge badge-danger">
|
|
|
|
|
+ <i class="iconfont icon-close-circle badge-icon"></i>未使用
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <span class="count-badge">
|
|
|
|
|
+ <i class="iconfont icon-device"></i>0
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <span class="count-badge">
|
|
|
|
|
+ <i class="iconfont icon-user"></i>0
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td>赵六</td>
|
|
|
|
|
+ <td>2023-06-10</td>
|
|
|
|
|
+ <td>2023-07-15</td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <div class="action-group">
|
|
|
|
|
+ <button type="button" class="action-btn view" title="地块管理">
|
|
|
|
|
+ <i class="iconfont icon-eye"></i>管理
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button type="button" class="action-btn edit" title="编辑地块">
|
|
|
|
|
+ <i class="iconfont icon-edit"></i>编辑
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button type="button" class="action-btn delete" title="删除地块">
|
|
|
|
|
+ <i class="iconfont icon-delete"></i>删除
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </tbody>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 分页 -->
|
|
|
|
|
+ <div class="flex justify-between items-center px-6 py-4">
|
|
|
|
|
+ <div class="text-sm text-gray-600">
|
|
|
|
|
+ 共 <span class="text-primary font-medium">24</span> 条记录
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="pagination">
|
|
|
|
|
+ <div class="page-item disabled">
|
|
|
|
|
+ <i class="iconfont icon-left"></i>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="page-item active">1</div>
|
|
|
|
|
+ <div class="page-item">2</div>
|
|
|
|
|
+ <div class="page-item">3</div>
|
|
|
|
|
+ <div class="page-item">
|
|
|
|
|
+ <i class="iconfont icon-right"></i>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 新增/编辑地块模态框 -->
|
|
|
|
|
+ <div id="fieldModal" class="modal hidden">
|
|
|
|
|
+ <div class="modal-backdrop"></div>
|
|
|
|
|
+ <div class="modal-dialog">
|
|
|
|
|
+ <div class="modal-content">
|
|
|
|
|
+ <!-- 模态框头部 -->
|
|
|
|
|
+ <div class="modal-header">
|
|
|
|
|
+ <h3 class="modal-title">新增地块</h3>
|
|
|
|
|
+ <button type="button" class="modal-close" id="closeModal">
|
|
|
|
|
+ <i class="iconfont icon-close"></i>
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 模态框内容 -->
|
|
|
|
|
+ <div class="modal-body">
|
|
|
|
|
+ <form id="fieldForm">
|
|
|
|
|
+ <div class="form-grid">
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label class="form-label">地块名称<span class="required">*</span></label>
|
|
|
|
|
+ <input type="text" name="fieldName" class="form-input" required>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label class="form-label">地块编号</label>
|
|
|
|
|
+ <input type="text" name="fieldCode" class="form-input" placeholder="自动生成" disabled>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label class="form-label">所属农场<span class="required">*</span></label>
|
|
|
|
|
+ <select name="farmId" class="form-input" required>
|
|
|
|
|
+ <option value="">请选择农场</option>
|
|
|
|
|
+ <option value="1">智慧农场一号</option>
|
|
|
|
|
+ <option value="2">智慧农场二号</option>
|
|
|
|
|
+ <option value="3">智慧农场三号</option>
|
|
|
|
|
+ <option value="4">有机蔬菜基地</option>
|
|
|
|
|
+ <option value="5">生态果园基地</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label class="form-label">所属区域<span class="required">*</span></label>
|
|
|
|
|
+ <select name="fieldArea" class="form-input" required>
|
|
|
|
|
+ <option value="">请选择区域</option>
|
|
|
|
|
+ <option value="1">东区</option>
|
|
|
|
|
+ <option value="2">西区</option>
|
|
|
|
|
+ <option value="3">南区</option>
|
|
|
|
|
+ <option value="4">北区</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label class="form-label">地块类型<span class="required">*</span></label>
|
|
|
|
|
+ <select name="fieldType" class="form-input" required>
|
|
|
|
|
+ <option value="">请选择类型</option>
|
|
|
|
|
+ <option value="1">水田</option>
|
|
|
|
|
+ <option value="2">旱地</option>
|
|
|
|
|
+ <option value="3">果园</option>
|
|
|
|
|
+ <option value="4">菜地</option>
|
|
|
|
|
+ <option value="5">其他</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label class="form-label">面积(亩)<span class="required">*</span></label>
|
|
|
|
|
+ <input type="number" name="fieldSize" class="form-input" required>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label class="form-label">负责人</label>
|
|
|
|
|
+ <select name="manager" class="form-input">
|
|
|
|
|
+ <option value="">请选择负责人</option>
|
|
|
|
|
+ <option value="1">张三</option>
|
|
|
|
|
+ <option value="2">李四</option>
|
|
|
|
|
+ <option value="3">王五</option>
|
|
|
|
|
+ <option value="4">赵六</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label class="form-label">种植作物</label>
|
|
|
|
|
+ <select name="crops" class="form-input">
|
|
|
|
|
+ <option value="">请选择作物</option>
|
|
|
|
|
+ <optgroup label="粮食作物">
|
|
|
|
|
+ <option value="101">水稻</option>
|
|
|
|
|
+ <option value="102">小麦</option>
|
|
|
|
|
+ <option value="103">玉米</option>
|
|
|
|
|
+ <option value="104">大豆</option>
|
|
|
|
|
+ <option value="105">高粱</option>
|
|
|
|
|
+ <option value="106">谷子</option>
|
|
|
|
|
+ </optgroup>
|
|
|
|
|
+ <optgroup label="经济作物">
|
|
|
|
|
+ <option value="201">棉花</option>
|
|
|
|
|
+ <option value="202">油菜</option>
|
|
|
|
|
+ <option value="203">花生</option>
|
|
|
|
|
+ <option value="204">芝麻</option>
|
|
|
|
|
+ <option value="205">甘蔗</option>
|
|
|
|
|
+ <option value="206">烟草</option>
|
|
|
|
|
+ <option value="207">茶叶</option>
|
|
|
|
|
+ <option value="208">药材</option>
|
|
|
|
|
+ </optgroup>
|
|
|
|
|
+ <optgroup label="果树作物">
|
|
|
|
|
+ <option value="301">葡萄</option>
|
|
|
|
|
+ <option value="302">苹果</option>
|
|
|
|
|
+ <option value="303">梨</option>
|
|
|
|
|
+ <option value="304">桃</option>
|
|
|
|
|
+ <option value="305">柑橘</option>
|
|
|
|
|
+ <option value="306">枣</option>
|
|
|
|
|
+ <option value="307">猕猴桃</option>
|
|
|
|
|
+ <option value="308">石榴</option>
|
|
|
|
|
+ <option value="309">杏</option>
|
|
|
|
|
+ </optgroup>
|
|
|
|
|
+ <optgroup label="蔬菜作物">
|
|
|
|
|
+ <option value="401">叶菜类</option>
|
|
|
|
|
+ <option value="402">根茎类</option>
|
|
|
|
|
+ <option value="403">瓜果类</option>
|
|
|
|
|
+ <option value="404">豆类</option>
|
|
|
|
|
+ <option value="405">茄果类</option>
|
|
|
|
|
+ <option value="406">葱蒜类</option>
|
|
|
|
|
+ </optgroup>
|
|
|
|
|
+ <optgroup label="其他作物">
|
|
|
|
|
+ <option value="901">饲料作物</option>
|
|
|
|
|
+ <option value="902">观赏作物</option>
|
|
|
|
|
+ <option value="903">食用菌</option>
|
|
|
|
|
+ <option value="999">其他</option>
|
|
|
|
|
+ </optgroup>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label class="form-label">土壤类型</label>
|
|
|
|
|
+ <select name="soilType" class="form-input">
|
|
|
|
|
+ <option value="">请选择</option>
|
|
|
|
|
+ <option value="1">黏土</option>
|
|
|
|
|
+ <option value="2">沙质土</option>
|
|
|
|
|
+ <option value="3">壤土</option>
|
|
|
|
|
+ <option value="4">沙壤土</option>
|
|
|
|
|
+ <option value="5">其他</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label class="form-label">灌溉方式</label>
|
|
|
|
|
+ <select name="irrigationType" class="form-input">
|
|
|
|
|
+ <option value="">请选择</option>
|
|
|
|
|
+ <option value="1">喷灌</option>
|
|
|
|
|
+ <option value="2">滴灌</option>
|
|
|
|
|
+ <option value="3">微喷灌</option>
|
|
|
|
|
+ <option value="4">漫灌</option>
|
|
|
|
|
+ <option value="5">其他</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label class="form-label">使用状态</label>
|
|
|
|
|
+ <select name="status" class="form-input">
|
|
|
|
|
+ <option value="1">使用中</option>
|
|
|
|
|
+ <option value="2">维护中</option>
|
|
|
|
|
+ <option value="0">未使用</option>
|
|
|
|
|
+ <option value="3">闲置中</option>
|
|
|
|
|
+ <option value="4">待开发</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="form-group mt-4">
|
|
|
|
|
+ <label class="form-label">地块描述</label>
|
|
|
|
|
+ <textarea name="description" class="form-input" rows="4"></textarea>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 模态框底部 -->
|
|
|
|
|
+ <div class="modal-footer">
|
|
|
|
|
+ <button type="button" class="btn btn-outline" id="cancelBtn">取消</button>
|
|
|
|
|
+ <button type="button" class="btn btn-primary" id="saveBtn">保存</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <script>
|
|
|
|
|
+ // 页面跳转函数
|
|
|
|
|
+ function navigateTo(type, id) {
|
|
|
|
|
+ switch(type) {
|
|
|
|
|
+ case 'view':
|
|
|
|
|
+ window.location.href = `../pages/field-detail.html?id=${id}`;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 'edit':
|
|
|
|
|
+ window.location.href = `../pages/field-edit.html?id=${id}`;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 全局函数,用于显示模态框
|
|
|
|
|
+ function showModalDialog(event, type = 'add', rowData = null) {
|
|
|
|
|
+ console.log('showModalDialog called', {type, rowData});
|
|
|
|
|
+ try {
|
|
|
|
|
+ if (event) {
|
|
|
|
|
+ event.preventDefault();
|
|
|
|
|
+ event.stopPropagation();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const modal = document.getElementById('fieldModal');
|
|
|
|
|
+ if (!modal) {
|
|
|
|
|
+ console.error('Modal not found');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 设置模态框标题
|
|
|
|
|
+ const modalTitle = modal.querySelector('.modal-title');
|
|
|
|
|
+ if (modalTitle) {
|
|
|
|
|
+ modalTitle.textContent = type === 'edit' ? '编辑地块' : '新增地块';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 如果是编辑模式,预填充表单数据
|
|
|
|
|
+ if (type === 'edit') {
|
|
|
|
|
+ // 这里使用模拟数据,实际项目中应该从后端获取
|
|
|
|
|
+ const mockFieldData = {
|
|
|
|
|
+ fieldName: '西区蔬菜园B',
|
|
|
|
|
+ fieldCode: 'FK20230002',
|
|
|
|
|
+ farmId: '4', // 有机蔬菜基地
|
|
|
|
|
+ fieldArea: '2', // 西区
|
|
|
|
|
+ fieldType: '4', // 菜地
|
|
|
|
|
+ fieldSize: '85',
|
|
|
|
|
+ manager: '2', // 李四
|
|
|
|
|
+ crops: '401', // 叶菜类
|
|
|
|
|
+ soilType: '2', // 沙质土
|
|
|
|
|
+ irrigationType: '2', // 滴灌
|
|
|
|
|
+ status: '1', // 使用中
|
|
|
|
|
+ description: '这是一个示例地块描述。'
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const form = document.getElementById('fieldForm');
|
|
|
|
|
+ if (form) {
|
|
|
|
|
+ Object.keys(mockFieldData).forEach(key => {
|
|
|
|
|
+ const input = form.elements[key];
|
|
|
|
|
+ if (input) {
|
|
|
|
|
+ input.value = mockFieldData[key];
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 显示模态框
|
|
|
|
|
+ modal.style.cssText = 'display: block !important; opacity: 1 !important; visibility: visible !important;';
|
|
|
|
|
+ modal.classList.remove('hidden');
|
|
|
|
|
+ modal.classList.add('show');
|
|
|
|
|
+ document.body.classList.add('modal-open');
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('Error in showModalDialog:', error);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
|
+ console.log('DOM Content Loaded');
|
|
|
|
|
+
|
|
|
|
|
+ // 添加按钮点击事件
|
|
|
|
|
+ const addButton = document.getElementById('addFieldBtn');
|
|
|
|
|
+ if (addButton) {
|
|
|
|
|
+ addButton.addEventListener('click', e => showModalDialog(e, 'add'));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 为所有操作按钮添加事件监听
|
|
|
|
|
+ document.querySelectorAll('.action-btn').forEach(btn => {
|
|
|
|
|
+ btn.addEventListener('click', function(e) {
|
|
|
|
|
+ e.preventDefault();
|
|
|
|
|
+ e.stopPropagation();
|
|
|
|
|
+
|
|
|
|
|
+ let type = 'add';
|
|
|
|
|
+ if (this.classList.contains('view')) {
|
|
|
|
|
+ type = 'view';
|
|
|
|
|
+ navigateTo(type, this.getAttribute('data-id'));
|
|
|
|
|
+ } else if (this.classList.contains('edit')) {
|
|
|
|
|
+ type = 'edit';
|
|
|
|
|
+ showModalDialog(e, type, {id: this.getAttribute('data-id')});
|
|
|
|
|
+ } else if (this.classList.contains('delete')) {
|
|
|
|
|
+ if (confirm('确认要删除该地块吗?')) {
|
|
|
|
|
+ console.log('删除地块:', this.getAttribute('data-id'));
|
|
|
|
|
+ // 这里添加删除逻辑
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 模态框关闭逻辑
|
|
|
|
|
+ const modal = document.getElementById('fieldModal');
|
|
|
|
|
+ const closeBtn = document.getElementById('closeModal');
|
|
|
|
|
+ const cancelBtn = document.getElementById('cancelBtn');
|
|
|
|
|
+ const form = document.getElementById('fieldForm');
|
|
|
|
|
+
|
|
|
|
|
+ function hideModal(e) {
|
|
|
|
|
+ if (e) {
|
|
|
|
|
+ e.preventDefault();
|
|
|
|
|
+ e.stopPropagation();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!modal) return;
|
|
|
|
|
+
|
|
|
|
|
+ // 强制隐藏模态框
|
|
|
|
|
+ modal.style.cssText = 'display: none !important; opacity: 0 !important; visibility: hidden !important;';
|
|
|
|
|
+ modal.classList.remove('show');
|
|
|
|
|
+ modal.classList.add('hidden');
|
|
|
|
|
+ document.body.classList.remove('modal-open');
|
|
|
|
|
+
|
|
|
|
|
+ // 重置表单
|
|
|
|
|
+ if (form) {
|
|
|
|
|
+ form.reset();
|
|
|
|
|
+ const inputs = form.querySelectorAll('input, select, textarea');
|
|
|
|
|
+ inputs.forEach(input => {
|
|
|
|
|
+ input.disabled = false;
|
|
|
|
|
+ input.style.borderColor = '#ddd';
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 关闭按钮事件
|
|
|
|
|
+ if (closeBtn) {
|
|
|
|
|
+ closeBtn.onclick = hideModal;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 取消按钮事件
|
|
|
|
|
+ if (cancelBtn) {
|
|
|
|
|
+ cancelBtn.onclick = hideModal;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 点击背景关闭
|
|
|
|
|
+ if (modal) {
|
|
|
|
|
+ modal.onclick = function(e) {
|
|
|
|
|
+ if (e.target === modal || e.target.classList.contains('modal-backdrop')) {
|
|
|
|
|
+ hideModal(e);
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 保存按钮点击事件
|
|
|
|
|
+ const saveBtn = document.getElementById('saveBtn');
|
|
|
|
|
+ if (saveBtn) {
|
|
|
|
|
+ saveBtn.onclick = function(e) {
|
|
|
|
|
+ e.preventDefault();
|
|
|
|
|
+ e.stopPropagation();
|
|
|
|
|
+
|
|
|
|
|
+ if (!form) return;
|
|
|
|
|
+
|
|
|
|
|
+ const requiredFields = form.querySelectorAll('[required]');
|
|
|
|
|
+ let isValid = true;
|
|
|
|
|
+
|
|
|
|
|
+ requiredFields.forEach(field => {
|
|
|
|
|
+ if (!field.value.trim()) {
|
|
|
|
|
+ field.style.borderColor = '#f44336';
|
|
|
|
|
+ isValid = false;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ field.style.borderColor = '#ddd';
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ if (!isValid) {
|
|
|
|
|
+ alert('请填写必填项');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ alert('地块信息保存成功');
|
|
|
|
|
+ hideModal(e);
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 防止表单提交
|
|
|
|
|
+ if (form) {
|
|
|
|
|
+ form.onsubmit = function(e) {
|
|
|
|
|
+ e.preventDefault();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 获取滚动相关元素
|
|
|
|
|
+ const tableContainer = document.getElementById('tableContainer');
|
|
|
|
|
+ const scrollLeftBtn = document.getElementById('scrollLeftBtn');
|
|
|
|
|
+ const scrollRightBtn = document.getElementById('scrollRightBtn');
|
|
|
|
|
+
|
|
|
|
|
+ // 更新滚动按钮状态
|
|
|
|
|
+ function updateScrollButtons() {
|
|
|
|
|
+ if (tableContainer) {
|
|
|
|
|
+ const { scrollLeft, scrollWidth, clientWidth } = tableContainer;
|
|
|
|
|
+
|
|
|
|
|
+ // 更新左滚动按钮状态
|
|
|
|
|
+ if (scrollLeftBtn) {
|
|
|
|
|
+ scrollLeftBtn.disabled = scrollLeft <= 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 更新右滚动按钮状态
|
|
|
|
|
+ if (scrollRightBtn) {
|
|
|
|
|
+ scrollRightBtn.disabled = scrollLeft + clientWidth >= scrollWidth;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 初始化滚动按钮状态
|
|
|
|
|
+ updateScrollButtons();
|
|
|
|
|
+
|
|
|
|
|
+ // 监听滚动事件
|
|
|
|
|
+ if (tableContainer) {
|
|
|
|
|
+ tableContainer.addEventListener('scroll', updateScrollButtons);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 左滚动按钮点击事件
|
|
|
|
|
+ if (scrollLeftBtn) {
|
|
|
|
|
+ scrollLeftBtn.addEventListener('click', () => {
|
|
|
|
|
+ if (tableContainer) {
|
|
|
|
|
+ tableContainer.scrollLeft -= 200; // 每次滚动200px
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 右滚动按钮点击事件
|
|
|
|
|
+ if (scrollRightBtn) {
|
|
|
|
|
+ scrollRightBtn.addEventListener('click', () => {
|
|
|
|
|
+ if (tableContainer) {
|
|
|
|
|
+ tableContainer.scrollLeft += 200; // 每次滚动200px
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 监听窗口大小变化
|
|
|
|
|
+ window.addEventListener('resize', updateScrollButtons);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 添加全局错误处理
|
|
|
|
|
+ window.onerror = function(msg, url, line, col, error) {
|
|
|
|
|
+ console.error('Global error:', {msg, url, line, col, error});
|
|
|
|
|
+ return false;
|
|
|
|
|
+ };
|
|
|
|
|
+ </script>
|
|
|
|
|
+</body>
|
|
|
</html>
|
|
</html>
|