feat: 添加独立的支付通道管理功能
This commit is contained in:
@@ -0,0 +1,167 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"sale/internal/models"
|
||||
"sale/internal/utils"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type PaymentChannelHandler struct{}
|
||||
|
||||
func NewPaymentChannelHandler() *PaymentChannelHandler {
|
||||
return &PaymentChannelHandler{}
|
||||
}
|
||||
|
||||
func (h *PaymentChannelHandler) List(c *gin.Context) {
|
||||
var channels []models.PaymentChannel
|
||||
utils.DB.Order("sort_order ASC, id ASC").Find(&channels)
|
||||
c.JSON(http.StatusOK, gin.H{"data": channels})
|
||||
}
|
||||
|
||||
func (h *PaymentChannelHandler) GetByID(c *gin.Context) {
|
||||
id, _ := strconv.Atoi(c.Param("id"))
|
||||
var channel models.PaymentChannel
|
||||
if err := utils.DB.First(&channel, id).Error; err != nil {
|
||||
c.JSON(http.StatusNotFound, gin.H{"error": "Payment channel not found"})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{"data": channel})
|
||||
}
|
||||
|
||||
func (h *PaymentChannelHandler) Create(c *gin.Context) {
|
||||
var req struct {
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
Type string `json:"type"`
|
||||
Icon string `json:"icon"`
|
||||
FeeRate float64 `json:"fee_rate"`
|
||||
MinAmount float64 `json:"min_amount"`
|
||||
MaxAmount float64 `json:"max_amount"`
|
||||
Config string `json:"config"`
|
||||
IsEnabled bool `json:"is_enabled"`
|
||||
SortOrder int `json:"sort_order"`
|
||||
}
|
||||
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
var existing models.PaymentChannel
|
||||
if err := utils.DB.Where("code = ?", req.Code).First(&existing).Error; err == nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "支付通道代码已存在"})
|
||||
return
|
||||
}
|
||||
|
||||
channel := models.PaymentChannel{
|
||||
Name: req.Name,
|
||||
Code: req.Code,
|
||||
Type: req.Type,
|
||||
Icon: req.Icon,
|
||||
FeeRate: req.FeeRate,
|
||||
MinAmount: req.MinAmount,
|
||||
MaxAmount: req.MaxAmount,
|
||||
Config: req.Config,
|
||||
IsEnabled: req.IsEnabled,
|
||||
SortOrder: req.SortOrder,
|
||||
}
|
||||
|
||||
if err := utils.DB.Create(&channel).Error; err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "Failed to create payment channel"})
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusCreated, gin.H{"data": channel})
|
||||
}
|
||||
|
||||
func (h *PaymentChannelHandler) Update(c *gin.Context) {
|
||||
id, _ := strconv.Atoi(c.Param("id"))
|
||||
var channel models.PaymentChannel
|
||||
if err := utils.DB.First(&channel, id).Error; err != nil {
|
||||
c.JSON(http.StatusNotFound, gin.H{"error": "Payment channel not found"})
|
||||
return
|
||||
}
|
||||
|
||||
var req struct {
|
||||
Name *string `json:"name"`
|
||||
Code *string `json:"code"`
|
||||
Type *string `json:"type"`
|
||||
Icon *string `json:"icon"`
|
||||
FeeRate *float64 `json:"fee_rate"`
|
||||
MinAmount *float64 `json:"min_amount"`
|
||||
MaxAmount *float64 `json:"max_amount"`
|
||||
Config *string `json:"config"`
|
||||
IsEnabled *bool `json:"is_enabled"`
|
||||
SortOrder *int `json:"sort_order"`
|
||||
}
|
||||
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
updates := make(map[string]interface{})
|
||||
if req.Name != nil {
|
||||
updates["name"] = *req.Name
|
||||
}
|
||||
if req.Code != nil && *req.Code != channel.Code {
|
||||
var existing models.PaymentChannel
|
||||
if err := utils.DB.Where("code = ? AND id != ?", *req.Code, id).First(&existing).Error; err == nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "支付通道代码已存在"})
|
||||
return
|
||||
}
|
||||
updates["code"] = *req.Code
|
||||
}
|
||||
if req.Type != nil {
|
||||
updates["type"] = *req.Type
|
||||
}
|
||||
if req.Icon != nil {
|
||||
updates["icon"] = *req.Icon
|
||||
}
|
||||
if req.FeeRate != nil {
|
||||
updates["fee_rate"] = *req.FeeRate
|
||||
}
|
||||
if req.MinAmount != nil {
|
||||
updates["min_amount"] = *req.MinAmount
|
||||
}
|
||||
if req.MaxAmount != nil {
|
||||
updates["max_amount"] = *req.MaxAmount
|
||||
}
|
||||
if req.Config != nil {
|
||||
updates["config"] = *req.Config
|
||||
}
|
||||
if req.IsEnabled != nil {
|
||||
updates["is_enabled"] = *req.IsEnabled
|
||||
}
|
||||
if req.SortOrder != nil {
|
||||
updates["sort_order"] = *req.SortOrder
|
||||
}
|
||||
|
||||
utils.DB.Model(&channel).Updates(updates)
|
||||
c.JSON(http.StatusOK, gin.H{"data": channel})
|
||||
}
|
||||
|
||||
func (h *PaymentChannelHandler) Delete(c *gin.Context) {
|
||||
id, _ := strconv.Atoi(c.Param("id"))
|
||||
if err := utils.DB.Delete(&models.PaymentChannel{}, id).Error; err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "Failed to delete payment channel"})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{"message": "Payment channel deleted successfully"})
|
||||
}
|
||||
|
||||
func (h *PaymentChannelHandler) Toggle(c *gin.Context) {
|
||||
id, _ := strconv.Atoi(c.Param("id"))
|
||||
var channel models.PaymentChannel
|
||||
if err := utils.DB.First(&channel, id).Error; err != nil {
|
||||
c.JSON(http.StatusNotFound, gin.H{"error": "Payment channel not found"})
|
||||
return
|
||||
}
|
||||
channel.IsEnabled = !channel.IsEnabled
|
||||
utils.DB.Save(&channel)
|
||||
c.JSON(http.StatusOK, gin.H{"data": channel})
|
||||
}
|
||||
@@ -23,6 +23,7 @@ func SetupRoutes(r *gin.Engine) {
|
||||
articleHandler := handlers.NewArticleHandler()
|
||||
uploadHandler := handlers.NewUploadHandler()
|
||||
bannerHandler := handlers.NewBannerHandler()
|
||||
paymentChannelHandler := handlers.NewPaymentChannelHandler()
|
||||
|
||||
r.Use(middlewares.CORSMiddleware())
|
||||
|
||||
@@ -220,6 +221,15 @@ func SetupRoutes(r *gin.Engine) {
|
||||
adminBanners.DELETE("/:id", bannerHandler.Delete)
|
||||
adminBanners.PUT("/:id/toggle", bannerHandler.ToggleActive)
|
||||
}
|
||||
|
||||
adminPaymentChannels := admin.Group("/payment-channels")
|
||||
{
|
||||
adminPaymentChannels.GET("", paymentChannelHandler.List)
|
||||
adminPaymentChannels.POST("", paymentChannelHandler.Create)
|
||||
adminPaymentChannels.PUT("/:id", paymentChannelHandler.Update)
|
||||
adminPaymentChannels.DELETE("/:id", paymentChannelHandler.Delete)
|
||||
adminPaymentChannels.PUT("/:id/toggle", paymentChannelHandler.Toggle)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type PaymentChannel struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
Name string `gorm:"size:50;not null" json:"name"`
|
||||
Code string `gorm:"size:30;not null;uniqueIndex" json:"code"`
|
||||
Type string `gorm:"size:20;not null" json:"type"`
|
||||
Icon string `gorm:"size:255" json:"icon"`
|
||||
FeeRate float64 `gorm:"default:0" json:"fee_rate"`
|
||||
MinAmount float64 `gorm:"default:0" json:"min_amount"`
|
||||
MaxAmount float64 `gorm:"default:0" json:"max_amount"`
|
||||
Config string `gorm:"type:text" json:"config"`
|
||||
IsEnabled bool `gorm:"default:true" json:"is_enabled"`
|
||||
SortOrder int `gorm:"default:0" json:"sort_order"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
||||
}
|
||||
|
||||
func (PaymentChannel) TableName() string {
|
||||
return "payment_channels"
|
||||
}
|
||||
@@ -77,6 +77,7 @@ func AutoMigrate() {
|
||||
&models.SupplierAuthorization{},
|
||||
&models.Article{},
|
||||
&models.Banner{},
|
||||
&models.PaymentChannel{},
|
||||
)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to migrate database: %v", err)
|
||||
|
||||
@@ -168,4 +168,10 @@ export const adminApi = {
|
||||
updateBanner: (id: number, data: any) => api.put(`/admin/banners/${id}`, data),
|
||||
deleteBanner: (id: number) => api.delete(`/admin/banners/${id}`),
|
||||
toggleBanner: (id: number) => api.put(`/admin/banners/${id}/toggle`),
|
||||
|
||||
getPaymentChannels: () => api.get('/admin/payment-channels'),
|
||||
createPaymentChannel: (data: any) => api.post('/admin/payment-channels', data),
|
||||
updatePaymentChannel: (id: number, data: any) => api.put(`/admin/payment-channels/${id}`, data),
|
||||
deletePaymentChannel: (id: number) => api.delete(`/admin/payment-channels/${id}`),
|
||||
togglePaymentChannel: (id: number) => api.put(`/admin/payment-channels/${id}/toggle`),
|
||||
}
|
||||
|
||||
@@ -126,6 +126,7 @@
|
||||
"ticketManagement": "Ticket Management",
|
||||
"articleManagement": "Article Management",
|
||||
"bannerManagement": "Banner Management",
|
||||
"paymentManagement": "Payment",
|
||||
"systemSettings": "System Settings",
|
||||
"menuManagement": "Menu Management",
|
||||
"smtpSettings": "SMTP Settings",
|
||||
|
||||
@@ -126,6 +126,7 @@
|
||||
"ticketManagement": "チケット管理",
|
||||
"articleManagement": "記事管理",
|
||||
"bannerManagement": "バナー管理",
|
||||
"paymentManagement": "支払い管理",
|
||||
"systemSettings": "システム設定",
|
||||
"menuManagement": "メニュー管理",
|
||||
"smtpSettings": "SMTP設定",
|
||||
|
||||
@@ -126,6 +126,7 @@
|
||||
"ticketManagement": "工单管理",
|
||||
"articleManagement": "资讯管理",
|
||||
"bannerManagement": "轮播图管理",
|
||||
"paymentManagement": "支付管理",
|
||||
"systemSettings": "系统设置",
|
||||
"menuManagement": "菜单管理",
|
||||
"smtpSettings": "SMTP设置",
|
||||
|
||||
@@ -57,6 +57,10 @@
|
||||
<el-icon><Picture /></el-icon>
|
||||
<span class="nav-text">{{ $t('admin.bannerManagement') }}</span>
|
||||
</router-link>
|
||||
<router-link to="/admin/payment" class="nav-link">
|
||||
<el-icon><Wallet /></el-icon>
|
||||
<span class="nav-text">{{ $t('admin.paymentManagement') }}</span>
|
||||
</router-link>
|
||||
<router-link to="/admin/settings" class="nav-link">
|
||||
<el-icon><Setting /></el-icon>
|
||||
<span class="nav-text">{{ $t('admin.systemSettings') }}</span>
|
||||
@@ -156,7 +160,7 @@
|
||||
import { ref, computed } from 'vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { DataAnalysis, User, Folder, Stamp, Goods, List, Van, Trophy, ChatDotSquare, Setting, Document, Picture, Compass, Fold, Expand, HomeFilled, FullScreen, ArrowDown, SwitchButton, ArrowRight } from '@element-plus/icons-vue'
|
||||
import { DataAnalysis, User, Folder, Stamp, Goods, List, Van, Trophy, ChatDotSquare, Setting, Document, Picture, Compass, Fold, Expand, HomeFilled, FullScreen, ArrowDown, SwitchButton, ArrowRight, Wallet } from '@element-plus/icons-vue'
|
||||
import { useUserStore } from '../store/user'
|
||||
import { useCartStore } from '../store/cart'
|
||||
|
||||
@@ -182,6 +186,7 @@ const pageTitles: Record<string, string> = {
|
||||
'/admin/tickets': '工单管理',
|
||||
'/admin/articles': '资讯管理',
|
||||
'/admin/banners': '轮播图管理',
|
||||
'/admin/payment': '支付管理',
|
||||
'/admin/settings': '系统设置'
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ const routes = [
|
||||
{ path: 'settings', name: 'AdminSettings', component: () => import('../views/admin/Settings.vue') },
|
||||
{ path: 'articles', name: 'AdminArticles', component: () => import('../views/admin/Articles.vue') },
|
||||
{ path: 'banners', name: 'AdminBanners', component: () => import('../views/admin/Banners.vue') },
|
||||
{ path: 'payment', name: 'AdminPayment', component: () => import('../views/admin/PaymentChannels.vue') },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -0,0 +1,305 @@
|
||||
<template>
|
||||
<div class="payment-page">
|
||||
<div class="page-header">
|
||||
<el-button type="primary" @click="openAdd">添加通道</el-button>
|
||||
</div>
|
||||
<div class="table-card">
|
||||
<el-table :data="channels">
|
||||
<el-table-column prop="id" label="ID" width="80" />
|
||||
<el-table-column prop="name" label="通道名称" />
|
||||
<el-table-column prop="code" label="通道代码" width="120" />
|
||||
<el-table-column prop="type" label="类型" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag size="small">{{ getTypeName(row.type) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="费率" width="100">
|
||||
<template #default="{ row }">
|
||||
{{ (row.fee_rate * 100).toFixed(2) }}%
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="金额限制" width="180">
|
||||
<template #default="{ row }">
|
||||
{{ row.min_amount }} - {{ row.max_amount || '∞' }} 元
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="80">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.is_enabled ? 'success' : 'info'" size="small">
|
||||
{{ row.is_enabled ? '启用' : '禁用' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort_order" label="排序" width="80" />
|
||||
<el-table-column label="操作" width="180">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" size="small" @click="editChannel(row)">编辑</el-button>
|
||||
<el-button link :type="row.is_enabled ? 'warning' : 'success'" size="small" @click="toggleChannel(row)">
|
||||
{{ row.is_enabled ? '禁用' : '启用' }}
|
||||
</el-button>
|
||||
<el-button link type="danger" size="small" @click="deleteChannel(row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-dialog v-model="showAdd" :title="editing ? '编辑支付通道' : '添加支付通道'" width="600px">
|
||||
<el-form :model="form" label-width="100px">
|
||||
<el-form-item label="通道名称" required>
|
||||
<el-input v-model="form.name" placeholder="如:支付宝" />
|
||||
</el-form-item>
|
||||
<el-form-item label="通道代码" required>
|
||||
<el-input v-model="form.code" placeholder="如:alipay" :disabled="!!editing" />
|
||||
</el-form-item>
|
||||
<el-form-item label="支付类型" required>
|
||||
<el-select v-model="form.type" placeholder="选择支付类型">
|
||||
<el-option label="支付宝" value="alipay" />
|
||||
<el-option label="微信支付" value="wechat" />
|
||||
<el-option label="银行卡" value="bank" />
|
||||
<el-option label="USDT" value="usdt" />
|
||||
<el-option label="其他" value="other" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="图标">
|
||||
<el-input v-model="form.icon" placeholder="图标URL" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手续费率">
|
||||
<el-input-number v-model="form.fee_rate" :min="0" :max="1" :step="0.001" :precision="4" />
|
||||
<span style="margin-left: 10px; color: rgba(255,255,255,0.5)">{{ (form.fee_rate * 100).toFixed(2) }}%</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="最小金额">
|
||||
<el-input-number v-model="form.min_amount" :min="0" :precision="2" />
|
||||
</el-form-item>
|
||||
<el-form-item label="最大金额">
|
||||
<el-input-number v-model="form.max_amount" :min="0" :precision="2" />
|
||||
</el-form-item>
|
||||
<el-form-item label="配置信息">
|
||||
<el-input v-model="form.config" type="textarea" :rows="4" placeholder="JSON格式的配置信息" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序">
|
||||
<el-input-number v-model="form.sort_order" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="启用状态">
|
||||
<el-switch v-model="form.is_enabled" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="showAdd = false">取消</el-button>
|
||||
<el-button type="primary" @click="saveChannel" :loading="saving">保存</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { adminApi } from '../../api'
|
||||
|
||||
const channels = ref<any[]>([])
|
||||
const showAdd = ref(false)
|
||||
const editing = ref<any>(null)
|
||||
const saving = ref(false)
|
||||
|
||||
const form = reactive({
|
||||
name: '',
|
||||
code: '',
|
||||
type: 'alipay',
|
||||
icon: '',
|
||||
fee_rate: 0,
|
||||
min_amount: 0,
|
||||
max_amount: 0,
|
||||
config: '',
|
||||
is_enabled: true,
|
||||
sort_order: 0
|
||||
})
|
||||
|
||||
const typeNames: Record<string, string> = {
|
||||
alipay: '支付宝',
|
||||
wechat: '微信支付',
|
||||
bank: '银行卡',
|
||||
usdt: 'USDT',
|
||||
other: '其他'
|
||||
}
|
||||
|
||||
function getTypeName(type: string) {
|
||||
return typeNames[type] || type
|
||||
}
|
||||
|
||||
async function fetchChannels() {
|
||||
try {
|
||||
const res: any = await adminApi.getPaymentChannels()
|
||||
channels.value = res.data || []
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
function openAdd() {
|
||||
editing.value = null
|
||||
Object.assign(form, {
|
||||
name: '',
|
||||
code: '',
|
||||
type: 'alipay',
|
||||
icon: '',
|
||||
fee_rate: 0,
|
||||
min_amount: 0,
|
||||
max_amount: 0,
|
||||
config: '',
|
||||
is_enabled: true,
|
||||
sort_order: 0
|
||||
})
|
||||
showAdd.value = true
|
||||
}
|
||||
|
||||
function editChannel(row: any) {
|
||||
editing.value = row
|
||||
Object.assign(form, {
|
||||
name: row.name,
|
||||
code: row.code,
|
||||
type: row.type,
|
||||
icon: row.icon || '',
|
||||
fee_rate: row.fee_rate || 0,
|
||||
min_amount: row.min_amount || 0,
|
||||
max_amount: row.max_amount || 0,
|
||||
config: row.config || '',
|
||||
is_enabled: row.is_enabled,
|
||||
sort_order: row.sort_order || 0
|
||||
})
|
||||
showAdd.value = true
|
||||
}
|
||||
|
||||
async function saveChannel() {
|
||||
if (!form.name || !form.code || !form.type) {
|
||||
ElMessage.warning('请填写必填项')
|
||||
return
|
||||
}
|
||||
saving.value = true
|
||||
try {
|
||||
if (editing.value) {
|
||||
await adminApi.updatePaymentChannel(editing.value.id, form)
|
||||
} else {
|
||||
await adminApi.createPaymentChannel(form)
|
||||
}
|
||||
ElMessage.success('保存成功')
|
||||
showAdd.value = false
|
||||
editing.value = null
|
||||
await fetchChannels()
|
||||
} catch (error: any) {
|
||||
const msg = error.response?.data?.error || '保存失败'
|
||||
ElMessage.error(msg)
|
||||
} finally {
|
||||
saving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function toggleChannel(row: any) {
|
||||
try {
|
||||
await adminApi.togglePaymentChannel(row.id)
|
||||
ElMessage.success(row.is_enabled ? '已禁用' : '已启用')
|
||||
await fetchChannels()
|
||||
} catch (error: any) {
|
||||
ElMessage.error(error.response?.data?.error || '操作失败')
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteChannel(id: number) {
|
||||
await ElMessageBox.confirm('确定删除此支付通道?', '确认删除')
|
||||
await adminApi.deletePaymentChannel(id)
|
||||
ElMessage.success('删除成功')
|
||||
await fetchChannels()
|
||||
}
|
||||
|
||||
onMounted(fetchChannels)
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.payment-page { padding: 0; }
|
||||
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
|
||||
.table-card { background: #2d2d44; border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 12px; padding: 20px; }
|
||||
|
||||
:deep(.el-table) {
|
||||
--el-table-bg-color: transparent;
|
||||
--el-table-tr-bg-color: transparent;
|
||||
--el-table-header-bg-color: rgba(255, 255, 255, 0.03);
|
||||
--el-table-row-hover-bg-color: rgba(255, 255, 255, 0.06);
|
||||
--el-table-border-color: rgba(255, 255, 255, 0.06);
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
:deep(.el-table th) {
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
:deep(.el-table td) {
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
:deep(.el-tag) {
|
||||
background: rgba(78, 110, 242, 0.15);
|
||||
color: #4e6ef2;
|
||||
border: none;
|
||||
}
|
||||
|
||||
:deep(.el-tag--success) {
|
||||
background: rgba(67, 207, 124, 0.15);
|
||||
color: #43cf7c;
|
||||
}
|
||||
|
||||
:deep(.el-tag--warning) {
|
||||
background: rgba(230, 162, 60, 0.15);
|
||||
color: #e6a23c;
|
||||
}
|
||||
|
||||
:deep(.el-tag--info) {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
:deep(.el-dialog) {
|
||||
background: #2d2d44;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
:deep(.el-dialog__header) {
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
|
||||
padding: 16px 20px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
:deep(.el-dialog__title) {
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
:deep(.el-dialog__headerbtn .el-dialog__close) {
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
&:hover { color: #fff; }
|
||||
}
|
||||
|
||||
:deep(.el-dialog__footer) {
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.06);
|
||||
padding: 16px 20px;
|
||||
}
|
||||
|
||||
:deep(.el-form-item__label) {
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
}
|
||||
|
||||
:deep(.el-input__wrapper),
|
||||
:deep(.el-textarea__inner),
|
||||
:deep(.el-select .el-input__wrapper) {
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
box-shadow: none;
|
||||
&:hover, &:focus { border-color: #4e6ef2; }
|
||||
}
|
||||
|
||||
:deep(.el-input__inner),
|
||||
:deep(.el-textarea__inner) {
|
||||
color: #fff;
|
||||
&::placeholder { color: rgba(255, 255, 255, 0.3); }
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user