|
@@ -1,85 +1,111 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="setting-container">
|
|
|
|
|
- <!-- 系统时间 -->
|
|
|
|
|
- <div class="section">
|
|
|
|
|
- <div class="section-title">System Time</div>
|
|
|
|
|
- <div class="form-content">
|
|
|
|
|
- <div class="form-item">
|
|
|
|
|
- <label class="form-label">Current Time</label>
|
|
|
|
|
- <span class="time-value">{{ currentTime }}</span>
|
|
|
|
|
|
|
+ <div class="time-settings">
|
|
|
|
|
+ <!-- 系统时间 - 独立部分 -->
|
|
|
|
|
+ <div class="time-section-wrapper">
|
|
|
|
|
+ <div class="section">
|
|
|
|
|
+ <div class="section-header">
|
|
|
|
|
+ <h3>System Time</h3>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="form-item">
|
|
|
|
|
- <label class="form-label">Sync to Camera</label>
|
|
|
|
|
- <el-button type="primary" size="small" @click="syncTime" :loading="syncLoading" class="form-btn">
|
|
|
|
|
- Sync Now
|
|
|
|
|
- </el-button>
|
|
|
|
|
|
|
+ <div class="section-content">
|
|
|
|
|
+ <div class="form-item">
|
|
|
|
|
+ <label class="form-label">Current Time</label>
|
|
|
|
|
+ <span class="time-value">{{ currentTime }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-item">
|
|
|
|
|
+ <label class="form-label">Sync to Camera</label>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="syncTime"
|
|
|
|
|
+ :loading="syncLoading"
|
|
|
|
|
+ class="sync-btn"
|
|
|
|
|
+ >
|
|
|
|
|
+ Sync Now
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <!-- 显示设置 -->
|
|
|
|
|
- <div class="section">
|
|
|
|
|
- <div class="section-title">Display Settings</div>
|
|
|
|
|
- <div class="form-content">
|
|
|
|
|
- <div class="form-item">
|
|
|
|
|
- <label class="form-label">Display Mode</label>
|
|
|
|
|
- <el-select v-model="timeMode" class="form-control">
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in timeModeOptions"
|
|
|
|
|
- :key="item.value"
|
|
|
|
|
- :label="item.label"
|
|
|
|
|
- :value="item.value"
|
|
|
|
|
- />
|
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
+ <!-- 显示设置 + NTP 设置 + 按钮 - 组合部分 -->
|
|
|
|
|
+ <div class="settings-section-wrapper">
|
|
|
|
|
+ <!-- 显示设置 -->
|
|
|
|
|
+ <div class="section">
|
|
|
|
|
+ <div class="section-header">
|
|
|
|
|
+ <h3>Display Settings</h3>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="form-item">
|
|
|
|
|
- <label class="form-label">Ignore Time Zone</label>
|
|
|
|
|
- <el-switch v-model="timeZoneEn" />
|
|
|
|
|
|
|
+ <div class="section-content">
|
|
|
|
|
+ <div class="form-item">
|
|
|
|
|
+ <label class="form-label">Display Mode</label>
|
|
|
|
|
+ <el-select v-model="timeMode" class="form-control" placeholder="Select display mode">
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in timeModeOptions"
|
|
|
|
|
+ :key="item.value"
|
|
|
|
|
+ :label="item.label"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-item">
|
|
|
|
|
+ <label class="form-label">Ignore Time Zone</label>
|
|
|
|
|
+ <el-switch v-model="timeZoneEn" />
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
|
|
|
|
- <!-- NTP 设置 -->
|
|
|
|
|
- <div class="section">
|
|
|
|
|
- <div class="section-title">NTP Settings</div>
|
|
|
|
|
- <div class="form-content">
|
|
|
|
|
- <div class="form-item">
|
|
|
|
|
- <label class="form-label">Enable Manual NTP</label>
|
|
|
|
|
- <el-switch v-model="timeNTPEn" />
|
|
|
|
|
|
|
+ <!-- NTP 设置 -->
|
|
|
|
|
+ <div class="section">
|
|
|
|
|
+ <div class="section-header">
|
|
|
|
|
+ <h3>NTP Settings</h3>
|
|
|
</div>
|
|
</div>
|
|
|
- <transition name="collapse">
|
|
|
|
|
- <div v-if="timeNTPEn" class="ntp-fields">
|
|
|
|
|
- <div class="form-item">
|
|
|
|
|
- <label class="form-label required">NTP Server 1</label>
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="timeNTP"
|
|
|
|
|
- placeholder="e.g: pool.ntp.org"
|
|
|
|
|
- class="form-control"
|
|
|
|
|
- clearable
|
|
|
|
|
- @blur="validateNtpServer(timeNTP, 'server1')"
|
|
|
|
|
- />
|
|
|
|
|
- <div v-if="ntpErrors.server1" class="error-message">{{ ntpErrors.server1 }}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="form-item">
|
|
|
|
|
- <label class="form-label">NTP Server 2</label>
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="timeNTP2"
|
|
|
|
|
- placeholder="e.g: ntp.ubuntu.com"
|
|
|
|
|
- class="form-control"
|
|
|
|
|
- clearable
|
|
|
|
|
- @blur="validateNtpServer(timeNTP2, 'server2')"
|
|
|
|
|
- />
|
|
|
|
|
- <div v-if="ntpErrors.server2" class="error-message">{{ ntpErrors.server2 }}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div class="section-content">
|
|
|
|
|
+ <div class="form-item">
|
|
|
|
|
+ <label class="form-label">Enable Manual NTP</label>
|
|
|
|
|
+ <el-switch v-model="timeNTPEn" />
|
|
|
</div>
|
|
</div>
|
|
|
- </transition>
|
|
|
|
|
|
|
+ <transition name="slide-ntp">
|
|
|
|
|
+ <div v-if="timeNTPEn" class="ntp-fields">
|
|
|
|
|
+ <div class="form-item">
|
|
|
|
|
+ <label class="form-label required">NTP Server 1</label>
|
|
|
|
|
+ <div class="control-wrapper">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="timeNTP"
|
|
|
|
|
+ placeholder="e.g: pool.ntp.org"
|
|
|
|
|
+ class="form-control"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ @blur="validateNtpServer(timeNTP, 'server1')"
|
|
|
|
|
+ />
|
|
|
|
|
+ <div v-if="ntpErrors.server1" class="error-message">{{ ntpErrors.server1 }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-item">
|
|
|
|
|
+ <label class="form-label">NTP Server 2</label>
|
|
|
|
|
+ <div class="control-wrapper">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="timeNTP2"
|
|
|
|
|
+ placeholder="e.g: ntp.ubuntu.com"
|
|
|
|
|
+ class="form-control"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ @blur="validateNtpServer(timeNTP2, 'server2')"
|
|
|
|
|
+ />
|
|
|
|
|
+ <div v-if="ntpErrors.server2" class="error-message">{{ ntpErrors.server2 }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </transition>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
|
|
|
|
- <!-- 操作按钮 -->
|
|
|
|
|
- <div class="button-group">
|
|
|
|
|
- <el-button type="primary" @click="saveSettings" :loading="saveLoading" class="save-btn">Save</el-button>
|
|
|
|
|
- <el-button @click="resetSettings" class="reset-btn">Reset</el-button>
|
|
|
|
|
|
|
+ <!-- 操作按钮 -->
|
|
|
|
|
+ <div class="button-group">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ round
|
|
|
|
|
+ @click="saveSettings"
|
|
|
|
|
+ :loading="saveLoading"
|
|
|
|
|
+ class="save-btn"
|
|
|
|
|
+ >
|
|
|
|
|
+ Save
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -91,7 +117,6 @@ import { format } from 'date-fns'
|
|
|
import { ElMessage } from 'element-plus'
|
|
import { ElMessage } from 'element-plus'
|
|
|
import type { TimeParaData } from '@/api/types/setting'
|
|
import type { TimeParaData } from '@/api/types/setting'
|
|
|
|
|
|
|
|
-// ===== 响应式状态 =====
|
|
|
|
|
const timeMode = ref(1)
|
|
const timeMode = ref(1)
|
|
|
const currentTime = ref('')
|
|
const currentTime = ref('')
|
|
|
let intervalId: number | null = null
|
|
let intervalId: number | null = null
|
|
@@ -150,9 +175,9 @@ async function getTimeMode() {
|
|
|
function updateTime() {
|
|
function updateTime() {
|
|
|
const now = new Date()
|
|
const now = new Date()
|
|
|
currentTime.value =
|
|
currentTime.value =
|
|
|
- timeMode.value === 1
|
|
|
|
|
- ? format(now, 'yyyy-MM-dd HH:mm:ss')
|
|
|
|
|
- : format(now, 'yyyy-MM-dd hh:mm:ss a')
|
|
|
|
|
|
|
+ timeMode.value === 1
|
|
|
|
|
+ ? format(now, 'yyyy-MM-dd HH:mm:ss')
|
|
|
|
|
+ : format(now, 'yyyy-MM-dd hh:mm:ss a')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
@@ -194,7 +219,7 @@ function validateNtpServer(server: string, field: 'server1' | 'server2') {
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
const domainRegex =
|
|
const domainRegex =
|
|
|
- /^([a-z0-9]([a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,}$|^(\d{1,3}\.){3}\d{1,3}$/i
|
|
|
|
|
|
|
+ /^([a-z0-9]([a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,}$|^(\d{1,3}\.){3}\d{1,3}$/i
|
|
|
if (server.trim() && !domainRegex.test(server.trim())) {
|
|
if (server.trim() && !domainRegex.test(server.trim())) {
|
|
|
ntpErrors.value[field] = 'Please enter a valid domain name or IP address'
|
|
ntpErrors.value[field] = 'Please enter a valid domain name or IP address'
|
|
|
return false
|
|
return false
|
|
@@ -233,100 +258,170 @@ async function saveSettings() {
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
|
-.setting-container {
|
|
|
|
|
- padding: 20px;
|
|
|
|
|
- background: #f5f5f5;
|
|
|
|
|
-
|
|
|
|
|
- .section {
|
|
|
|
|
- margin-bottom: 20px;
|
|
|
|
|
- border-radius: 2px;
|
|
|
|
|
- border-left: 3px solid #409eff;
|
|
|
|
|
- padding: 0;
|
|
|
|
|
|
|
+// 颜色和尺寸变量定义
|
|
|
|
|
+$primary-color: #3b82f6;
|
|
|
|
|
+$primary-hover: #2563eb;
|
|
|
|
|
+$text-primary: #1f2d3d;
|
|
|
|
|
+$text-secondary: #333;
|
|
|
|
|
+$text-tertiary: #666;
|
|
|
|
|
+$border-color: #dcdfe6;
|
|
|
|
|
+$border-light: #eeeeee;
|
|
|
|
|
+$divider-color: #f0f0f0;
|
|
|
|
|
+$background-light: #fafafa;
|
|
|
|
|
+$error-color: #f56c6c;
|
|
|
|
|
+$success-color: #67c23a;
|
|
|
|
|
+
|
|
|
|
|
+$spacing-xs: 6px;
|
|
|
|
|
+$spacing-sm: 8px;
|
|
|
|
|
+$spacing-md: 12px;
|
|
|
|
|
+$spacing-lg: 16px;
|
|
|
|
|
+$spacing-xl: 20px;
|
|
|
|
|
+
|
|
|
|
|
+$radius-sm: 4px;
|
|
|
|
|
+$radius-md: 6px;
|
|
|
|
|
+
|
|
|
|
|
+$transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
|
|
|
|
|
+
|
|
|
|
|
+.time-settings {
|
|
|
|
|
+ max-width: 700px;
|
|
|
|
|
+ //margin: 0 auto;
|
|
|
|
|
+ padding: 0;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ gap: 15px;
|
|
|
|
|
+
|
|
|
|
|
+ // 系统时间部分 - 独立卡片
|
|
|
|
|
+ .time-section-wrapper {
|
|
|
|
|
+ .section {
|
|
|
|
|
+ padding: $spacing-xl;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 设置部分 - 组合卡片(一个整体)
|
|
|
|
|
+ .settings-section-wrapper {
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
|
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
- .section-title {
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
- font-weight: 600;
|
|
|
|
|
- color: #333333;
|
|
|
|
|
- padding: 14px 20px;
|
|
|
|
|
- background: #fafafa;
|
|
|
|
|
- border-bottom: 1px solid #eeeeee;
|
|
|
|
|
|
|
+ .section {
|
|
|
|
|
+ padding: $spacing-xl;
|
|
|
|
|
+ background: transparent;
|
|
|
|
|
+ border-radius: 0;
|
|
|
|
|
+ box-shadow: none;
|
|
|
margin: 0;
|
|
margin: 0;
|
|
|
|
|
+ border-bottom: 1px solid $divider-color;
|
|
|
|
|
+
|
|
|
|
|
+ &:last-of-type {
|
|
|
|
|
+ border-bottom: none;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .form-content {
|
|
|
|
|
- padding: 16px 20px;
|
|
|
|
|
|
|
+ .button-group {
|
|
|
background: transparent;
|
|
background: transparent;
|
|
|
|
|
+ border-radius: 0;
|
|
|
|
|
+ box-shadow: none;
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
+ padding: $spacing-xl;
|
|
|
|
|
+ border-top: 1px solid $divider-color;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ gap: $spacing-lg;
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .section-header {
|
|
|
|
|
+ padding-bottom: $spacing-lg;
|
|
|
|
|
+ margin-bottom: $spacing-lg;
|
|
|
|
|
+ border-bottom: 2px solid $divider-color;
|
|
|
|
|
+
|
|
|
|
|
+ h3 {
|
|
|
|
|
+ font-size: 15px;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ color: $text-primary;
|
|
|
|
|
+ margin: 0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ .section-content {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ gap: $spacing-lg;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
.form-item {
|
|
.form-item {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
- gap: 16px;
|
|
|
|
|
- margin-bottom: 16px;
|
|
|
|
|
-
|
|
|
|
|
- &:last-child {
|
|
|
|
|
- margin-bottom: 0;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ gap: $spacing-lg;
|
|
|
|
|
|
|
|
.form-label {
|
|
.form-label {
|
|
|
- display: block;
|
|
|
|
|
min-width: 140px;
|
|
min-width: 140px;
|
|
|
- font-size: 13px;
|
|
|
|
|
- color: #666666;
|
|
|
|
|
|
|
+ font-size: 14px;
|
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
|
|
|
+ color: $text-secondary;
|
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
|
|
|
|
&.required::after {
|
|
&.required::after {
|
|
|
content: '*';
|
|
content: '*';
|
|
|
- color: #f56c6c;
|
|
|
|
|
|
|
+ color: $error-color;
|
|
|
margin-left: 4px;
|
|
margin-left: 4px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.form-control {
|
|
.form-control {
|
|
|
- width: 180px;
|
|
|
|
|
|
|
+ width: 200px;
|
|
|
|
|
+ font-size: 13px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.time-value {
|
|
.time-value {
|
|
|
- font-size: 13px;
|
|
|
|
|
- color: #409eff;
|
|
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ color: $primary-color;
|
|
|
font-family: 'Monaco', 'Courier New', monospace;
|
|
font-family: 'Monaco', 'Courier New', monospace;
|
|
|
letter-spacing: 0.5px;
|
|
letter-spacing: 0.5px;
|
|
|
|
|
+ font-weight: 500;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .form-btn {
|
|
|
|
|
- font-size: 12px;
|
|
|
|
|
- width: auto;
|
|
|
|
|
- padding: 6px 16px;
|
|
|
|
|
- height: 32px;
|
|
|
|
|
- background-color: #409eff;
|
|
|
|
|
- color: #fff;
|
|
|
|
|
- border: none;
|
|
|
|
|
- border-radius: 6px;
|
|
|
|
|
|
|
+ .sync-btn {
|
|
|
|
|
+ background-color: $primary-color !important;
|
|
|
|
|
+ color: #fff !important;
|
|
|
|
|
+ border: none !important;
|
|
|
|
|
+ height: 30px;
|
|
|
|
|
+ min-width: 80px;
|
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
|
- cursor: pointer;
|
|
|
|
|
- transition: all 0.3s ease;
|
|
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ box-shadow: 0 2px 4px rgba($primary-color, 0.2);
|
|
|
|
|
+ transition: all 0.2s $transition-easing;
|
|
|
|
|
|
|
|
&:hover {
|
|
&:hover {
|
|
|
- background-color: #66b1ff;
|
|
|
|
|
|
|
+ background-color: $primary-hover !important;
|
|
|
|
|
+ box-shadow: 0 4px 8px rgba($primary-hover, 0.3);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
&:active {
|
|
&:active {
|
|
|
- background-color: #3a8ee6;
|
|
|
|
|
|
|
+ box-shadow: 0 1px 2px rgba($primary-hover, 0.2);
|
|
|
|
|
+ transform: translateY(1px);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // NTP 字段展开区域
|
|
|
.ntp-fields {
|
|
.ntp-fields {
|
|
|
- margin-top: 12px;
|
|
|
|
|
- padding-top: 12px;
|
|
|
|
|
- border-top: 1px solid #eeeeee;
|
|
|
|
|
|
|
+ padding: $spacing-lg;
|
|
|
|
|
+ margin-top: $spacing-md;
|
|
|
|
|
+ background: rgba($primary-color, 0.03);
|
|
|
|
|
+ border: 1px solid rgba($primary-color, 0.1);
|
|
|
|
|
+ border-radius: $radius-md;
|
|
|
|
|
+ animation: slideDown 0.3s $transition-easing;
|
|
|
|
|
|
|
|
.form-item {
|
|
.form-item {
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
align-items: flex-start;
|
|
align-items: flex-start;
|
|
|
- margin-bottom: 14px;
|
|
|
|
|
|
|
+ gap: $spacing-sm;
|
|
|
|
|
+ margin-bottom: $spacing-lg;
|
|
|
|
|
|
|
|
&:last-child {
|
|
&:last-child {
|
|
|
margin-bottom: 0;
|
|
margin-bottom: 0;
|
|
@@ -334,94 +429,226 @@ async function saveSettings() {
|
|
|
|
|
|
|
|
.form-label {
|
|
.form-label {
|
|
|
min-width: auto;
|
|
min-width: auto;
|
|
|
- margin-bottom: 6px;
|
|
|
|
|
|
|
+ margin-bottom: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .control-wrapper {
|
|
|
|
|
+ width: 100%;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.form-control {
|
|
.form-control {
|
|
|
- width: 240px;
|
|
|
|
|
|
|
+ width: 100%;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 控制元素样式
|
|
|
|
|
+ .control-wrapper {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
.error-message {
|
|
.error-message {
|
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
|
- color: #f56c6c;
|
|
|
|
|
- margin-top: 4px;
|
|
|
|
|
- margin-left: 0;
|
|
|
|
|
|
|
+ color: $error-color;
|
|
|
|
|
+ margin-top: $spacing-xs;
|
|
|
|
|
+ font-weight: 500;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .button-group {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- gap: 12px;
|
|
|
|
|
- padding: 0;
|
|
|
|
|
|
|
+ .save-btn {
|
|
|
|
|
+ background-color: $primary-color !important;
|
|
|
|
|
+ color: #fff !important;
|
|
|
|
|
+ border: none !important;
|
|
|
|
|
+ min-width: 80px;
|
|
|
|
|
+ height: 36px;
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ box-shadow: 0 2px 4px rgba($primary-color, 0.2);
|
|
|
|
|
+ transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
|
|
|
+
|
|
|
|
|
+ &:hover {
|
|
|
|
|
+ background-color: $primary-hover !important;
|
|
|
|
|
+ box-shadow: 0 4px 8px rgba($primary-hover, 0.3);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- .el-button {
|
|
|
|
|
- min-width: 100px;
|
|
|
|
|
- font-size: 13px;
|
|
|
|
|
- height: 36px;
|
|
|
|
|
- border-radius: 6px;
|
|
|
|
|
-
|
|
|
|
|
- &.reset-btn {
|
|
|
|
|
- background-color: #ffffff;
|
|
|
|
|
- border-color: #dcdfe6;
|
|
|
|
|
- color: #606266;
|
|
|
|
|
-
|
|
|
|
|
- &:hover {
|
|
|
|
|
- color: #409eff;
|
|
|
|
|
- border-color: #409eff;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ &:active {
|
|
|
|
|
+ box-shadow: 0 1px 2px rgba($primary-hover, 0.2);
|
|
|
|
|
+ transform: translateY(1px);
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
-/* 折叠展开动画 */
|
|
|
|
|
-.collapse-enter-active,
|
|
|
|
|
-.collapse-leave-active {
|
|
|
|
|
- transition: all 0.3s ease;
|
|
|
|
|
- max-height: 500px;
|
|
|
|
|
- overflow: hidden;
|
|
|
|
|
|
|
+ &:disabled,
|
|
|
|
|
+ &.is-disabled {
|
|
|
|
|
+ background-color: #c0c4cc !important;
|
|
|
|
|
+ cursor: not-allowed;
|
|
|
|
|
+ box-shadow: none;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.collapse-enter-from,
|
|
|
|
|
-.collapse-leave-to {
|
|
|
|
|
- opacity: 0;
|
|
|
|
|
- max-height: 0;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+// Element Plus 组件样式覆盖
|
|
|
|
|
|
|
|
|
|
+// Input 样式
|
|
|
:deep(.el-input__wrapper) {
|
|
:deep(.el-input__wrapper) {
|
|
|
- border-color: #dcdfe6;
|
|
|
|
|
- background-color: #ffffff;
|
|
|
|
|
|
|
+ border-color: $border-color;
|
|
|
|
|
+ background-color: #fff;
|
|
|
|
|
+ transition: all 0.2s $transition-easing;
|
|
|
|
|
|
|
|
&:hover {
|
|
&:hover {
|
|
|
border-color: #b1b3b6;
|
|
border-color: #b1b3b6;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
&.is-focus {
|
|
&.is-focus {
|
|
|
- border-color: #409eff;
|
|
|
|
|
|
|
+ border-color: $primary-color;
|
|
|
|
|
+ box-shadow: 0 0 0 2px rgba($primary-color, 0.1);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
:deep(.el-input__inner) {
|
|
:deep(.el-input__inner) {
|
|
|
font-size: 13px;
|
|
font-size: 13px;
|
|
|
- color: #606266;
|
|
|
|
|
|
|
+ color: $text-secondary;
|
|
|
|
|
|
|
|
&::placeholder {
|
|
&::placeholder {
|
|
|
color: #a8abb2;
|
|
color: #a8abb2;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// Select 样式
|
|
|
:deep(.el-select__wrapper) {
|
|
:deep(.el-select__wrapper) {
|
|
|
- border-color: #dcdfe6;
|
|
|
|
|
- background-color: #ffffff;
|
|
|
|
|
|
|
+ border-color: $border-color;
|
|
|
|
|
+ background-color: #fff;
|
|
|
|
|
+ transition: all 0.2s $transition-easing;
|
|
|
|
|
|
|
|
&:hover {
|
|
&:hover {
|
|
|
border-color: #b1b3b6;
|
|
border-color: #b1b3b6;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ &.is-focus {
|
|
|
|
|
+ border-color: $primary-color;
|
|
|
|
|
+ box-shadow: 0 0 0 2px rgba($primary-color, 0.1);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+:deep(.el-select__selection-text) {
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ color: $text-secondary;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+:deep(.el-option__label) {
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ color: $text-secondary;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// Switch 样式
|
|
|
:deep(.el-switch) {
|
|
:deep(.el-switch) {
|
|
|
- --el-switch-on-color: #409eff;
|
|
|
|
|
- --el-switch-off-color: #dcdfe6;
|
|
|
|
|
|
|
+ --el-switch-on-color: $primary-color;
|
|
|
|
|
+ --el-switch-off-color: #909399; // 使用更深的灰色以提高对比度
|
|
|
|
|
+ height: 22px;
|
|
|
|
|
+
|
|
|
|
|
+ .el-switch__core {
|
|
|
|
|
+ border-color: #909399; // 设置边框颜色与关闭状态一致
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ &.is-checked .el-switch__core {
|
|
|
|
|
+ background-color: $primary-color;
|
|
|
|
|
+ border-color: $primary-color; // 选中状态边框与背景一致
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 按钮通用样式
|
|
|
|
|
+//:deep(.el-button) {
|
|
|
|
|
+// //border-radius: $radius-md;
|
|
|
|
|
+// transition: all 0.2s $transition-easing;
|
|
|
|
|
+// font-weight: 500;
|
|
|
|
|
+//
|
|
|
|
|
+// &:focus,
|
|
|
|
|
+// &:hover {
|
|
|
|
|
+// // 由 !important 样式覆盖处理
|
|
|
|
|
+// }
|
|
|
|
|
+//}
|
|
|
|
|
+
|
|
|
|
|
+// 过渡动画 - NTP 字段展开
|
|
|
|
|
+.slide-ntp-enter-active,
|
|
|
|
|
+.slide-ntp-leave-active {
|
|
|
|
|
+ transition: all 0.3s $transition-easing;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.slide-ntp-enter-from {
|
|
|
|
|
+ opacity: 0;
|
|
|
|
|
+ transform: translateY(-10px);
|
|
|
|
|
+ max-height: 0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.slide-ntp-leave-to {
|
|
|
|
|
+ opacity: 0;
|
|
|
|
|
+ transform: translateY(-10px);
|
|
|
|
|
+ max-height: 0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+@keyframes slideDown {
|
|
|
|
|
+ from {
|
|
|
|
|
+ opacity: 0;
|
|
|
|
|
+ transform: translateY(-8px);
|
|
|
|
|
+ }
|
|
|
|
|
+ to {
|
|
|
|
|
+ opacity: 1;
|
|
|
|
|
+ transform: translateY(0);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 响应式设计
|
|
|
|
|
+@media (max-width: 768px) {
|
|
|
|
|
+ .time-settings {
|
|
|
|
|
+ gap: $spacing-lg * 1.5;
|
|
|
|
|
+
|
|
|
|
|
+ .time-section-wrapper {
|
|
|
|
|
+ .section {
|
|
|
|
|
+ padding: $spacing-lg;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .settings-section-wrapper {
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+
|
|
|
|
|
+ .section {
|
|
|
|
|
+ padding: $spacing-lg;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .button-group {
|
|
|
|
|
+ padding: $spacing-lg;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .form-item {
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ align-items: flex-start;
|
|
|
|
|
+ gap: $spacing-sm;
|
|
|
|
|
+
|
|
|
|
|
+ .form-label {
|
|
|
|
|
+ min-width: auto;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .form-control,
|
|
|
|
|
+ .sync-btn {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .ntp-fields {
|
|
|
|
|
+ padding: $spacing-md;
|
|
|
|
|
+ margin-top: $spacing-sm;
|
|
|
|
|
+
|
|
|
|
|
+ .form-item {
|
|
|
|
|
+ margin-bottom: $spacing-md;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .button-group {
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+
|
|
|
|
|
+ .save-btn {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|