<template>
    <div class="app-container">
        <!-- 搜索区域卡片 -->
        <el-card class="box-card" shadow="never">
            <el-form :model="queryParams" ref="queryForm" @submit.native.prevent :inline="true" v-show="showSearch" label-width="100px">
                <el-form-item label="优惠券名称" prop="title">
                    <el-input v-model="queryParams.title" placeholder="请输入优惠券类型名称" clearable prefix-icon="el-icon-ticket" style="width: 240px" @keyup.enter.native="handleQuery" />
                </el-form-item>
                <el-form-item label="优惠券类型" prop="discountWay">
                    <el-select v-model="queryParams.discountWay" placeholder="请选择优惠券类型" clearable style="width: 240px">
                        <el-option v-for="dict in dict.type.coupon_type" :key="dict.value" :label="dict.label" :value="dict.value" />
                    </el-select>
                </el-form-item>
                <el-form-item label="三方品牌" prop="couponTypeThirdPartyId">
                    <el-select v-model="queryParams.couponTypeThirdPartyId" placeholder="请选择三方品牌" clearable style="width: 240px">
                        <el-option v-for="third in thirdPartyList" :key="third.id" :label="third.name" :value="third.id" />
                    </el-select>
                </el-form-item>
                <el-form-item label="有效期">
                    <el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" style="width: 240px" :picker-options="pickerOptions"> </el-date-picker>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
                    <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
                </el-form-item>
            </el-form>
        </el-card>

        <!-- 操作工具栏 -->
        <el-card class="box-card table-card" shadow="never">
            <div slot="header" class="clearfix">
                <el-row :gutter="10" class="mb8">
                    <el-col :span="1.5">
                        <el-button type="primary" plain icon="el-icon-plus" @click="handleAdd" v-hasPermi="['coupon:type:add']">新增</el-button>
                    </el-col>
                    <el-col :span="1.5">
                        <el-button type="warning" plain icon="el-icon-download" @click="handleExport" v-hasPermi="['coupon:type:export']">导出</el-button>
                    </el-col>
                    <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
                </el-row>
            </div>

            <!-- 数据列表 -->
            <Page uri="/mapi/coupon/type/list" :request-params="queryParams" ref="pagination">
                <el-table-column label="编号" align="center" prop="id" min-width="80" />
                <el-table-column label="名称" align="center" prop="title" min-width="150" :show-overflow-tooltip="true" />
                <el-table-column label="图片" align="center" prop="imgUrl" width="80">
                    <template slot-scope="scope">
                        <image-preview :src="scope.row.imgUrl" :width="60" :height="60" />
                    </template>
                </el-table-column>
                <el-table-column label="优惠券类型" align="center" prop="discountWay" width="120">
                    <template slot-scope="scope">
                        <dict-tag :options="dict.type.coupon_type" :value="scope.row.discountWay" />
                    </template>
                </el-table-column>
                <el-table-column label="券值" align="center" prop="deductAmount" min-width="150">
                    <template slot-scope="scope">
                        <div class="amount-info">
                            <el-tag size="mini" type="danger" v-if="scope.row.discountWay == 0"> 满{{ formatAmount(scope.row.minAmount) }}元减{{ formatAmount(scope.row.deductAmount) }}元 </el-tag>
                            <el-tag size="mini" type="success" v-if="scope.row.discountWay == 1"> 满{{ scope.row.minAmount }}件减{{ scope.row.deductAmount }}件 </el-tag>
                            <el-tag size="mini" type="warning" v-if="scope.row.discountWay == 2"> {{ scope.row.discountRate }}% 折扣 </el-tag>
                        </div>
                    </template>
                </el-table-column>
                <el-table-column label="有效期" align="center" prop="startDate" width="200">
                    <template slot-scope="scope">
                        <span>{{ scope.row.startDate }} 至 {{ scope.row.endDate }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="库存信息" align="center" min-width="200">
                    <template slot-scope="scope">
                        <div class="stock-info">
                            <el-tag size="mini" type="info">库存：{{ scope.row.couponStock }}</el-tag>
                            <el-tag size="mini" type="success">已发：{{ scope.row.couponSendNum }}</el-tag>
                            <el-tag size="mini" type="warning">已用：{{ scope.row.couponUseNum }}</el-tag>
                        </div>
                    </template>
                </el-table-column>
                <el-table-column label="发放方式" align="center" prop="sendWay" width="120">
                    <template slot-scope="scope">
                        <dict-tag :options="dict.type.coupon_send_way" :value="parseInt(scope.row.sendWay)" />
                    </template>
                </el-table-column>
                <el-table-column label="适用范围" align="center" prop="useScope" width="120">
                    <template slot-scope="scope">
                        <el-tag size="mini" type="primary" v-if="scope.row.useScope == 1">全部衣服</el-tag>
                        <el-tag size="mini" type="warning" v-if="scope.row.useScope == 2">指定衣服</el-tag>
                    </template>
                </el-table-column>

                <el-table-column label="三方品牌" align="center" prop="couponTypeThirdPartyId" width="120">
                    <template slot-scope="scope">
                        <span v-if="scope.row.couponTypeThirdPartyId">
                            {{ getThirdPartyName(scope.row.couponTypeThirdPartyId) }}
                        </span>
                        <span v-else>--</span>
                    </template>
                </el-table-column>
                <el-table-column label="状态" align="center" width="100">
                    <template slot-scope="scope">
                        <el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"> </el-switch>
                    </template>
                </el-table-column>
                <el-table-column label="操作" align="center" width="200" fixed="right">
                    <template slot-scope="scope">
                        <el-button type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['coupon:type:edit']">修改</el-button>
                        <el-button type="text" icon="el-icon-s-shop" @click="handleSetClothItems(scope.row)" v-if="scope.row.useScope == 2" v-hasPermi="['coupon:type:list']">指定衣物</el-button>
                        <el-button type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['coupon:type:remove']">删除</el-button>
                    </template>
                </el-table-column>
            </Page>
        </el-card>

        <!-- 添加或修改优惠券类型对话框 -->
        <el-dialog :title="title" :visible.sync="open" width="850px" append-to-body :close-on-click-modal="false">
            <el-tabs v-model="activeTab">
                <!-- 基本信息 Tab -->
                <el-tab-pane label="基本信息" name="basic">
                    <el-form ref="form" :model="form" :rules="rules" label-width="120px">
                        <el-card class="box-card" shadow="never">
                            <el-row :gutter="20">
                                <el-col :span="12">
                                    <el-form-item label="优惠券类型" prop="discountWay">
                                        <el-select v-model="form.discountWay" placeholder="请选择优惠券类型" clearable :disabled="disabled" style="width: 100%" @change="changeDiscountWay">
                                            <el-option v-for="dict in dict.type.coupon_type" :key="dict.value" :label="dict.label" :value="dict.value" />
                                        </el-select>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="优惠券名称" prop="title">
                                        <el-input v-model="form.title" placeholder="请输入优惠券类型名称" maxlength="100" show-word-limit />
                                    </el-form-item>
                                </el-col>
                                <el-col :span="24">
                                    <el-form-item label="优惠券图片" prop="imgUrl">
                                        <image-upload v-model="form.imgUrl" />
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="有效期" prop="duringDate">
                                        <el-date-picker v-model="form.duringDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" style="width: 100%"> </el-date-picker>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="三方品牌" prop="couponTypeThirdPartyId">
                                        <el-select v-model="form.couponTypeThirdPartyId" placeholder="请选择三方品牌" clearable style="width: 100%">
                                            <el-option v-for="third in thirdPartyList" :key="third.id" :label="third.name" :value="third.id" />
                                        </el-select>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-card>

                        <!-- 优惠规则 -->
                        <el-card class="box-card" shadow="never">
                            <div slot="header">
                                <span>优惠规则</span>
                            </div>
                            <el-row :gutter="20">
                                <el-col :span="24">
                                    <template v-if="form.discountWay == 0">
                                        <el-col :span="12">
                                            <el-form-item label="满减金额" prop="minAmount">
                                                <el-input-number v-model="form.minAmount" placeholder="请输入满减金额" :precision="2" :min="0" :max="999999" style="width: 100%" />
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="抵扣金额" prop="deductAmount">
                                                <el-input-number v-model="form.deductAmount" placeholder="请输入抵扣金额" :precision="2" :min="0" :max="999999" style="width: 100%" />
                                            </el-form-item>
                                        </el-col>
                                    </template>
                                    <template v-if="form.discountWay == 1">
                                        <el-col :span="12">
                                            <el-form-item label="满减件数" prop="minAmount">
                                                <el-input-number v-model="form.minAmount" placeholder="请输入满减件数" :min="0" :max="999999" style="width: 100%" />
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="抵扣件数" prop="deductAmount">
                                                <el-input-number v-model="form.deductAmount" placeholder="请输入抵扣件数" :min="0" :max="99" style="width: 100%" />
                                            </el-form-item>
                                        </el-col>
                                    </template>
                                    <template v-if="form.discountWay == 2">
                                        <el-col :span="12">
                                            <el-form-item label="折扣率" prop="discountRate">
                                                <el-input-number v-model="form.discountRate" placeholder="请输入折扣率" :step="1" :min="1" :max="99" >
                                                    <template slot="append">%</template>
                                                </el-input-number>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="最大折扣金额" prop="deductAmount">
                                                <el-input-number v-model="form.deductAmount" placeholder="请输入最大折扣金额" :step="1" :min="1" :max="999" />
                                            </el-form-item>
                                        </el-col>
                                    </template>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="库存数量" prop="couponStock">
                                        <el-input-number v-model="form.couponStock" placeholder="请输入库存数量" :step="1" :min="0" style="width: 100%" />
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-card>
                    </el-form>
                </el-tab-pane>

                <!-- 使用规则 Tab -->
                <el-tab-pane label="使用规则" name="rules">
                    <el-form ref="formRules" :model="form" :rules="rules" label-width="120px">
                        <el-card class="box-card" shadow="never">
                            <el-row :gutter="20">
                                <el-col :span="24">
                                    <el-form-item label="发放方式" prop="sendWay">
                                        <el-radio-group v-model="form.sendWay">
                                            <el-radio v-for="dict in dict.type.coupon_send_way" :key="parseInt(dict.value)" :label="parseInt(dict.value)">{{ dict.label }}</el-radio>
                                        </el-radio-group>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="24">
                                    <el-form-item label="适用范围" prop="useScope">
                                        <el-radio-group v-model="form.useScope">
                                            <el-radio :label="1">全部衣服</el-radio>
                                            <el-radio :label="2">指定衣服</el-radio>
                                        </el-radio-group>
                                        <span class="help-text">若指定衣服，请在操作里面添加衣服</span>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="24">
                                    <el-form-item label="适用门店" prop="selectStoreIds">
                                        <el-transfer v-model="form.selectStoreIds" :data="form.storeVOS" :filterable="true" :titles="['待选择的门店', '已选择的门店']"> </el-transfer>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="24">
                                    <el-form-item label="优惠券说明" prop="description">
                                        <el-input type="textarea" v-model="form.description" placeholder="请输入优惠券使用说明" :rows="3" maxlength="200" show-word-limit />
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="状态" prop="status">
                                        <el-radio-group v-model="form.status">
                                            <el-radio-button v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio-button>
                                        </el-radio-group>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-card>
                    </el-form>
                </el-tab-pane>
            </el-tabs>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="submitForm">确 定</el-button>
                <el-button @click="cancel">取 消</el-button>
            </div>
        </el-dialog>
    </div>
</template>

<script>
import { listType, getType, delType, addType, updateType, updateTypeStatus } from '@/api/coupon/type'
import { listThirdParty } from '@/api/coupon/thirdParty'

export default {
    name: 'Type',
    dicts: ['sys_normal_disable', 'coupon_send_way', 'sys_yes_no', 'coupon_type'],
    data() {
        return {
            // 遮罩层
            loading: true,
            // 选中数组
            ids: [],
            // 非单个禁用
            single: true,
            // 非多个禁用
            multiple: true,
            // 显示搜索条件
            showSearch: true,
            // 总条数
            total: 0,
            // 优惠券类型表格数据
            typeList: [],
            // 弹出层标题
            title: '',
            // 是否显示弹出层
            open: false,
            // 查询参数
            queryParams: {
                title: null,
                startDate: null,
                endDate: null
            },
            // 表单参数
            form: {},
            // 表单校验
            rules: {
                discountWay: [{ required: true, message: '优惠券类型不能为空', trigger: 'blur' }],
                title: [{ required: true, message: '优惠券类型名称不能为空', trigger: 'blur' }],
                description: [{ required: true, message: '优惠券类型描述不能为空', trigger: 'blur' }],
                imgUrl: [{ required: true, message: '优惠券类型图片不能为空', trigger: 'blur' }],
                duringDate: [{ required: true, message: '有效期不能为空', trigger: 'blur' }],
                startDate: [{ required: true, message: '有效期开始日期不能为空', trigger: 'blur' }],
                endDate: [{ required: true, message: '有效期结束日期不能为空', trigger: 'blur' }],
                status: [{ required: true, message: '状态不能为空', trigger: 'blur' }],
                isUnique: [{ required: true, message: '是否单件抵扣券不能为空', trigger: 'blur' }],
                sendWay: [{ required: true, message: '发放方式不能为空', trigger: 'blur' }],
                deductAmount: [{ required: true, message: '抵用金额不能为空', trigger: 'blur' }],
                canDeductRecharge: [{ required: true, message: '是否可抵用充值不能为空', trigger: 'blur' }],
                deductRechargeAmount: [{ required: true, message: '抵用充值金额不能为空', trigger: 'blur' }],
                minAmount: [{ required: true, message: '满减最小件数不能为空', trigger: 'blur' }]
            },
            // 日期范围
            dateRange: [],
            disabled: false,
            thirdPartyList: [],
            pickerOptions: {
                shortcuts: [
                    {
                        text: '最近一周',
                        onClick(picker) {
                            const end = new Date()
                            const start = new Date()
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
                            picker.$emit('pick', [start, end])
                        }
                    },
                    {
                        text: '最近一个月',
                        onClick(picker) {
                            const end = new Date()
                            const start = new Date()
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
                            picker.$emit('pick', [start, end])
                        }
                    },
                    {
                        text: '最近三个月',
                        onClick(picker) {
                            const end = new Date()
                            const start = new Date()
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
                            picker.$emit('pick', [start, end])
                        }
                    }
                ]
            },
            activeTab: 'basic' // 当前激活的tab页
        }
    },
    created() {
        this.getThirdPartyList()
        this.getList()
    },
    methods: {
      handleChange(val) {
        console.log('Current value:', val, 'Type:', typeof val);
      },
        formatAmount(amount) {
          if (!amount) return '0'
            return parseFloat(amount).toFixed(2)
        },
        getThirdPartyList() {
            listThirdParty({ pageSize: 99999, pageNum: 1, status: '0' }).then((response) => {
                this.thirdPartyList = response.rows
            })
        },
        /** 查询优惠券类型列表 */
        getList() {
            this.loading = true
            if (null != this.dateRange && '' != this.dateRange) {
                this.queryParams['startDate'] = this.dateRange[0]
                this.queryParams['endDate'] = this.dateRange[1]
            } else {
                delete this.queryParams.startDate
                delete this.queryParams.endDate
            }
            this.$nextTick(() => {
                this.$refs.pagination.handleSearch(true)
            })
        },
        // 取消按钮
        cancel() {
          this.reset()
          this.open = false
            // this.handleClose()
        },
        // 表单重置
        reset() {
            this.form = {
                id: null,
                title: null,
                description: null,
                imgUrl: null,
                startDate: null,
                endDate: null,
                status: '0',
                isUnique: 'Y',
                canManual: 'Y',
                canDeductRecharge: 'N',
                deductRechargeAmount: null,
                deductAmount: null,
                couponTypeThirdPartyId: null,
                delFlag: null,
                createById: null,
                createBy: null,
                createTime: null,
                updateById: null,
                updateBy: null,
                updateTime: null,
                remark: null,
                duringDate: [],
                selectStoreIds: [],
                useScope: 1,
                sendWay: null,
                couponStock: 0
            }

            // 重置所有表单
            if (this.$refs.form) {
                this.$refs.form.resetFields()
            }
            if (this.$refs.formRules) {
                this.$refs.formRules.resetFields()
            }

            // 重置标签页
            this.activeTab = 'basic'
        },
        changeDiscountWay() {
            this.form.minAmount = 1
            if (this.form.discountWay == 2) {
                this.form.deductAmount = 1
            } else {
                this.form.deductAmount = 0
            }
            this.form = JSON.parse(JSON.stringify(this.form))
        },
        /** 搜索按钮操作 */
        handleQuery() {
            this.getList()
        },
        /** 重置按钮操作 */
        resetQuery() {
            this.resetForm('queryForm')
            this.handleQuery()
        },
        // 多选框选中数据
        handleSelectionChange(selection) {
            this.ids = selection.map((item) => item.id)
            this.single = selection.length !== 1
            this.multiple = !selection.length
        },
        /** 新增按钮操作 */
        handleAdd() {
            this.reset()
            this.disabled = false
            getType().then((response) => {
                var duringDate = []
                response.data.duringDate = duringDate
                response.data.status = '0'
                response.data.isUnique = 'Y'
                response.data.canManual = 'Y'
                response.data.canDeductRecharge = 'N'
                this.form = response.data
                this.open = true
                this.title = '添加优惠券类型'
            })
        },
        /** 修改按钮操作 */
        handleUpdate(row) {
            this.reset()
            const id = row.id || this.ids
            getType(id).then((response) => {
                var duringDate = []
                duringDate.push(response.data.startDate)
                duringDate.push(response.data.endDate)
                response.data.duringDate = duringDate
                this.form = response.data
                console.log(this.form)
                this.open = true
                this.title = '修改优惠券类型'
                this.disabled = true
            })
        },
        /** 提交按钮 */
        submitForm() {
            Promise.all([
                new Promise(resolve => {
                    this.$refs.form.validate(valid => {
                        resolve(valid)
                    })
                }),
                new Promise(resolve => {
                    this.$refs.formRules.validate(valid => {
                        resolve(valid)
                    })
                })
            ]).then(([basicValid, rulesValid]) => {
                if (basicValid && rulesValid) {
                    // 处理日期
                    if (this.form.duringDate && this.form.duringDate.length > 0) {
                        this.form.startDate = this.form.duringDate[0]
                        this.form.endDate = this.form.duringDate[1]
                    }

                    // 处理折扣类型
                    if (this.form.discountWay === '2') {
                        this.form.isUnique = null
                    }

                    const action = this.form.id ? updateType(this.form) : addType(this.form)
                    action.then(response => {
                        this.$modal.msgSuccess(this.form.id ? '修改成功' : '新增成功')
                        this.open = false
                        this.getList()
                    }).catch(() => {
                        // 错误处理
                    })
                }
            })
        },
        /** 删除按钮操作 */
        handleDelete(row) {
            const ids = row.id || this.ids
            this.$modal
                .confirm('是否确认删除优惠券类型编号为"' + ids + '"的数据项？')
                .then(function () {
                    return delType(ids)
                })
                .then(() => {
                    this.getList()
                    this.$modal.msgSuccess('删除成功')
                })
                .catch(() => {})
        },
        /** 导出按钮操作 */
        handleExport() {
            if (null != this.dateRange && '' != this.dateRange) {
                this.queryParams['startDate'] = this.dateRange[0]
                this.queryParams['endDate'] = this.dateRange[1]
            } else {
                delete this.queryParams.startDate
                delete this.queryParams.endDate
            }
            this.download(
                'mapi/coupon/type/export',
                {
                    ...this.queryParams
                },
                `type_${new Date().getTime()}.xlsx`
            )
        },
        checkClose(done) {
            this.$confirm('是否关闭表单，关闭后数据将丢失？')
                .then(function () {
                    done()
                })
                .then(() => {})
                .catch(() => {})
        },
        handleStatusChange(row) {
            let text = row.status === '0' ? '启用' : '停用'
            this.$confirm('确认要' + text + ' ' + row.name + ' 吗？')
                .then(function () {
                    return updateTypeStatus(row.id, row.status)
                })
                .then(() => {
                    this.$modal.msgSuccess(text + '成功')
                })
                .catch(function () {
                    row.status = row.status === '0' ? '1' : '0'
                })
        },
        handleSetClothItems(row) {
            this.$tab.openPage(row.title + '的可使用衣物', '/coupon/typeApplyCloth/' + row.id)
        },
        getThirdPartyName(id) {
            const third = this.thirdPartyList.find((item) => item.id === id)
            return third ? third.name : '--'
        },
        handleClose(done) {
            if (this.isFormChanged()) {
                this.$confirm('确认关闭？未保存的数据将会丢失', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    this.reset()
                    this.open = false
                    if (typeof done === 'function') {
                        done()
                    }
                }).catch(() => {})
            } else {
                this.reset()
                this.open = false
                if (typeof done === 'function') {
                    done()
                }
            }
        },
        isFormChanged() {
            if (!this.form) return false
            return Object.keys(this.form).some(key => {
                return this.form[key] !== null && this.form[key] !== undefined
            })
        }
    }
}
</script>

<style lang="scss" scoped>
.app-container {
    padding: 20px;
    background-color: #f5f7fa;

    .box-card {
        margin-bottom: 20px;
        transition: all 0.3s ease-in-out;

        &.table-card {
            margin-bottom: 0;
        }

        &:hover {
            box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
        }
    }

    .el-card__header {
        padding: 15px 20px;
        border-bottom: 1px solid #ebeef5;
        background-color: #fafafa;
    }

    .el-card__body {
        padding: 20px;
    }

    .amount-info,
    .stock-info {
        .el-tag {
            margin: 0 4px;
            transition: all 0.3s ease;

            &:first-child {
                margin-left: 0;
            }

            &:last-child {
                margin-right: 0;
            }

            &:hover {
                transform: translateY(-1px);
            }
        }
    }

    .el-table {
        .el-table__header th {
            background-color: #fafafa;
            color: #606266;
            font-weight: bold;
        }

        .el-table__row {
            transition: all 0.3s ease;

            &:hover {
                background-color: #f5f7fa;
            }
        }
    }

    .help-text {
        margin-left: 10px;
        color: #909399;
        font-size: 13px;
    }

    .el-transfer {
        display: flex;
        justify-content: center;
        margin: 15px 0;
    }

    .el-transfer-panel {
        width: 300px;
    }

    .el-transfer-panel__header {
        background-color: #fafafa;
    }

    .dialog-footer {
        text-align: center;
        padding-top: 20px;
    }
}
</style>
