<template>
  <div class="p-2">
    <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
      <div v-show="showSearch" class="mb-[10px]">
        <el-card shadow="hover">
          <el-form ref="queryFormRef" :model="queryParams" :inline="true">
            <el-form-item label="门店" prop="parentStoreId">
              <el-select v-model="queryParams.parentStoreId" placeholder="请选择">
                <el-option v-for="item in parentStoreList" :key="item.value" :label="item.label" :value="item.value" />
              </el-select>
            </el-form-item>
            <el-form-item label="上级" prop="vestInUser">
              <el-select v-model="queryParams.vestInUserId" placeholder="请选择">
                <el-option v-for="item in vestInUserList" :key="item.value" :label="item.label" :value="item.value" />
              </el-select>
            </el-form-item>
            <el-form-item label="代理" prop="vestInUser">
              <el-input v-model="queryParams.vestInUser" placeholder="请输入" clearable @keyup.enter="handleQuery" />
            </el-form-item>

            <el-form-item>
              <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
              <el-button icon="Refresh" @click="resetQuery">重置</el-button>
            </el-form-item>
          </el-form>
        </el-card>
      </div>
    </transition>

    <el-card shadow="never">
      <template #header>
        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:sysStore:add']">新增门店</el-button>
          </el-col>
          <!-- <el-col :span="1.5">
            <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:sysStore:edit']"
              >修改</el-button
            >
          </el-col>
          <el-col :span="1.5">
            <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:sysStore:remove']"
              >删除</el-button
            >
          </el-col>
          <el-col :span="1.5">
            <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['system:sysStore:export']">导出</el-button>
          </el-col> -->
          <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
        </el-row>
      </template>

      <el-table v-loading="loading" border :data="sysStoreList" @selection-change="handleSelectionChange">
        <el-table-column label="序号" type="index" width="80px" align="center" />
        <el-table-column label="门店信息" align="center" width="380px">
          <template #default="scope">
            <el-row>
              <el-col :span="6"> <img :src="scope.row.storeLogoUrl" style="width: 40px; height: 40px" class="qr-code" /> </el-col>
              <el-col :span="18">
                <el-row>
                  <el-col :span="24">
                    <div>门店简称:{{ scope.row.storeShortName }}</div>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="8">
                    <div>编号:{{ scope.row.storeCode }}</div>
                  </el-col>
                  <el-col :span="16">
                    <div>上级门店:{{ scope.row.parentStore }}</div>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </template>
        </el-table-column>
        <el-table-column label="门店地址" align="center" prop="address" />
        <el-table-column label="客服信息" align="center">
          <template #default="scope">
            <el-row>
              <el-col :span="6"> <img :src="scope.row.serviceQrCodeUrl" style="width: 40px; height: 40px" class="qr-code" /></el-col>
              <el-col :span="18">
                <el-row>
                  <el-col :span="24">
                    <div>{{ scope.row.serviceName }} {{ scope.row.servicePhone }}</div>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="24">
                    <div>代理:何记得/13767684932</div>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </template>
        </el-table-column>
        <el-table-column label="有效期" align="center">
          <template #default="scope">
            <el-row>
              <el-col>
                <span>有效期起:{{ formatDate(scope.row.startDate) }}</span>
              </el-col>
            </el-row>
            <el-row>
              <el-col>
                <span>
                  有效期止: <span :class="{ 'text-danger': isEndDateNear(scope.row.endDate) }">{{ formatDate(scope.row.endDate) }}</span>
                </span>
              </el-col>
            </el-row>
          </template>
        </el-table-column>
        <el-table-column label="授权状态" align="center">
          <template #default="scope">
            <dict-tag :options="usage_type" :value="scope.row.usageType" />
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
          <template #default="scope">
            <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:sysStore:edit']">编辑</el-button>

            <el-button link type="primary" icon="Edit" @click="assignServiceInfo(scope.row)" v-hasPermi="['system:sysStore:edit']">服务</el-button>

            <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:sysStore:remove']">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
    </el-card>
    <!-- 添加或修改门店信息对话框 -->
    <el-dialog :title="dialog.title" v-model="dialog.visible" width="800px" append-to-body>
      <el-form ref="sysStoreFormRef" :model="form" :rules="rules" label-width="120px">
        <el-row :gutter="10">
          <el-col :span="17">
            <el-form-item label="门店logo：" prop="storeLogo">
              <imageUpload v-model="form.storeLogo" :limit="1" :isShowTip="false" />
            </el-form-item>
            <el-form-item label="所属品牌：" prop="brandId">
              <el-select v-model="form.brandId">
                <el-option v-for="item in brandList" :key="item.value" :label="item.label" :value="item.value" />
              </el-select>
            </el-form-item>
            <el-form-item label="门店类型：" prop="storeType">
              <el-radio-group v-model="form.storeType">
                <el-radio v-for="dict in store_type" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="归属用户：" prop="vestInUserId" v-if="form.storeType == '0'">
              <el-select v-model="form.vestInUserId">
                <el-option v-for="item in vestInUserList" :key="item.value" :label="item.label" :value="item.value" />
              </el-select>
            </el-form-item>
            <el-form-item label="上级门店：" prop="parentStoreId" v-if="form.storeType == '1'">
              <el-select v-model="form.parentStoreId">
                <el-option v-for="item in parentStoreList" :key="item.value" :label="item.label" :value="item.value" />
              </el-select>
            </el-form-item>
            <el-form-item label="门店编号：" prop="storeCode">
              <el-input v-model="form.storeCode" placeholder="请输入" />
            </el-form-item>
            <el-form-item label="门店全称：" prop="storeFullName">
              <el-input v-model="form.storeFullName" placeholder="请输入" />
            </el-form-item>
            <el-form-item label="门店简称：" prop="storeShortName">
              <el-input v-model="form.storeShortName" placeholder="请输入" />
            </el-form-item>
            <el-form-item label="连锁代码：" prop="chainCode">
              <el-input v-model="form.chainCode" placeholder="请输入" />
            </el-form-item>
            <el-form-item label="电话：" prop="phonenumber">
              <el-input v-model="form.phonenumber" placeholder="请输入" />
            </el-form-item>
            <el-form-item label="城市：" prop="codeArr">
              <el-cascader
                v-model="form.codeArr"
                :options="regionData"
                placeholder="请选择"
                @change="handleChange"
                style="width: 400px"
              ></el-cascader>
            </el-form-item>
            <el-form-item label="地址：" prop="address">
              <el-input v-model="form.address" placeholder="请输入" style="width: 400px" />
            </el-form-item>
            <el-form-item label="门店级别：" prop="storeLevel">
              <el-radio-group v-model="form.storeLevel">
                <el-radio v-for="dict in store_level" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="有效期：">
              <el-date-picker
                style="width: 220px"
                v-model="form.dateRange"
                type="daterange"
                range-separator="-"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                @change="handleSearch"
              />
            </el-form-item>

            <el-form-item label="使用类型：" prop="usageType">
              <el-radio-group v-model="form.usageType">
                <el-radio v-for="dict in filteredUsageType" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="7" style="margin-top: 320px">
            <el-form-item label=" " prop="status">
              <el-checkbox v-model="form.status">停止经营</el-checkbox>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
          <el-button @click="cancel">取 消</el-button>
        </div>
      </template>
    </el-dialog>
    <!-- 指定客服dialog -->
    <!-- 指定服务弹出框 -->
    <el-dialog :title="serviceDialog.title" v-model="serviceDialog.visible" width="700px" append-to-body class="service-dialog">
      <div class="mb-[20px]">
        <el-input v-model="serviceForm.searchValue" placeholder="输入客服名称/手机号" clearable @keyup.enter="handleServiceQuery" class="!w-[240px]">
          <template #prefix>
            <el-icon class="el-input__icon"><Search /></el-icon>
          </template>
        </el-input>
      </div>
      <el-table :data="serviceList" :border="false" highlight-current-row @current-change="handleCurrentChange" class="service-table">
        <el-table-column label="序号" type="index" width="60" align="center" />
        <el-table-column label="客服名称" prop="serviceName" min-width="100" align="center" />
        <el-table-column label="客服二维码" prop="qrCode" width="140" align="center">
          <template #default="scope">
            <img :src="scope.row.qrCode" style="width: 35px; height: 35px" class="qr-code" />
          </template>
        </el-table-column>
        <el-table-column label="客服手机号" prop="phonenumber" min-width="120" align="center" />
        <el-table-column label="操作" align="center" width="80">
          <template #default="scope">
            <el-button type="primary" size="small" @click="handleSelectService(scope.row)">选择</el-button>
          </template>
        </el-table-column>
      </el-table>
      <div class="flex items-center justify-between mt-[15px] px-[10px]">
        <div class="text-[14px] text-[#606266]">共 {{ serviceTotal }} 条</div>
        <div class="flex items-center gap-[8px]">
          <el-pagination
            v-model:current-page="serviceQueryParams.pageNum"
            v-model:page-size="serviceQueryParams.pageSize"
            :total="serviceTotal"
            :pager-count="9"
            layout="prev, pager, next"
            @current-change="getServiceList"
            small
            background
            class="!m-0 custom-pagination"
          />
          <div class="text-[14px] text-[#606266]">
            前往
            <el-input v-model="serviceQueryParams.pageNum" class="!w-[40px] !mx-[4px] !text-center jump-page-input" @keyup.enter="getServiceList" />
            页
          </div>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script setup name="SysStore" lang="ts">
import { listSysStore, getSysStore, delSysStore, addSysStore, updateSysStore, assignService } from '@/api/store/sysStore/index';
import { SysStoreVO, SysStoreQuery, SysStoreForm } from '@/api/store/sysStore/types';
import { listTenant } from '@/api/system/tenant/index';
import { listUser } from '@/api/system/user/index';
import { listSysService, getSysService } from '@/api/store/sysService/index';
import { SysServiceVO } from '@/api/store/sysService/types';

import { regionData } from 'element-china-area-data';
import { Search } from '@element-plus/icons-vue';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { store_level, store_type, usage_type } = toRefs<any>(proxy?.useDict('store_level', 'store_type', 'usage_type'));

const sysStoreList = ref<SysStoreVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);

const queryFormRef = ref<ElFormInstance>();
const sysStoreFormRef = ref<ElFormInstance>();
import { useRoute } from 'vue-router';

const route = useRoute();
const type = route.query.type; // 从 URL 获取 ?type=active

const brandList = ref<any>([]);
const vestInUserList = ref<any>([]);
const parentStoreList = ref<any>([]);

const dialog = reactive<DialogOption>({
  visible: false,
  title: ''
});

// 指定服务弹出框相关数据
const serviceDialog = reactive<DialogOption>({
  visible: false,
  title: '指定服务'
});

const serviceForm = reactive({
  searchValue: ''
});

const serviceList = ref<any[]>([]);
const serviceTotal = ref(0);
const currentService = ref<any>(null);

const serviceQueryParams = reactive({
  pageNum: 1,
  pageSize: 10,
  searchValue: ''
});

const initFormData: SysStoreForm = {
  id: undefined,
  storeLogo: undefined,
  brandId: undefined,
  brandName: undefined,
  storeType: '0',
  areaCode: undefined,
  province: undefined,
  city: undefined,
  district: undefined,
  vestInUserId: undefined,
  vestInUser: undefined,
  parentStoreId: undefined,
  parentStore: undefined,
  storeCode: undefined,
  storeFullName: undefined,
  storeShortName: undefined,
  chainCode: undefined,
  phonenumber: undefined,
  address: undefined,
  storeLevel: '1',
  usageType: '1',
  startDate: undefined,
  endDate: undefined,
  status: undefined,
  remark: undefined,
  serviceId: undefined,
  dateRange: [],
  codeArr: []
};
const data = reactive<PageData<SysStoreForm, SysStoreQuery>>({
  form: { ...initFormData },
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    id: undefined,
    vestInUserId: undefined,
    vestInUser: undefined,
    parentStoreId: undefined,
    parentStore: undefined,
    params: {}
  },
  rules: {
    storeLogo: [{ required: true, message: '门店logo不能为空', trigger: 'blur' }],
    brandId: [{ required: true, message: '所属品牌不能为空', trigger: 'blur' }],
    storeCode: [{ required: true, message: '门店编号不能为空', trigger: 'blur' }],
    storeFullName: [{ required: true, message: '门店全称不能为空', trigger: 'blur' }],
    storeShortName: [{ required: true, message: '门店简称不能为空', trigger: 'blur' }],
    chainCode: [{ required: true, message: '连锁代码不能为空', trigger: 'blur' }],
    phonenumber: [{ required: true, message: '电话不能为空', trigger: 'blur' }],
    codeArr: [{ required: true, message: '城市不能为空', trigger: 'blur' }],
    vestInUserId: [{ required: true, message: '归属用户不能为空', trigger: 'blur' }],
    parentStoreId: [{ required: true, message: '上级门店不能为空', trigger: 'blur' }]
  }
});

const { queryParams, form, rules } = toRefs(data);

/** 查询门店信息列表 */
const getList = async () => {
  loading.value = true;
  const res = await listSysStore(queryParams.value);
  sysStoreList.value = res.rows;
  total.value = res.total;
  loading.value = false;
};

// 获取品牌列表
const getBrandList = async () => {
  try {
    const queryParams = {
      pageNum: 1
    } as any;
    const res = await listTenant(queryParams);
    if (res.rows && Array.isArray(res.rows)) {
      brandList.value = res.rows.map((item) => ({
        value: item.id,
        label: item.companyName
      }));
    }
  } catch (error) {
    console.error('获取品牌列表失败:', error);
    brandList.value = [];
  }
};

// 获取主门店列表
const getParentStoreList = async () => {
  try {
    const queryParams = {
      pageNum: 1,
      storeType: '0'
    } as any;
    const res = await listSysStore(queryParams);
    if (res.rows && Array.isArray(res.rows)) {
      parentStoreList.value = res.rows.map((item) => ({
        value: item.id,
        label: item.storeFullName
      }));
    }
  } catch (error) {
    console.error('获取门店列表失败:', error);
    parentStoreList.value = [];
  }
};
// 获取用户列表
const getVestInUserList = async () => {
  try {
    const queryParams = {
      pageNum: 1
      // identity: '0'
    } as any;
    const res = await listUser(queryParams);
    if (res.rows && Array.isArray(res.rows)) {
      vestInUserList.value = res.rows.map((item) => ({
        value: item.userId,
        label: item.userName
      }));
    }
  } catch (error) {
    console.error('获取用户列表失败:', error);
    vestInUserList.value = [];
  }
};

// 判断 endDate 是否 <= 今天 + 30天
const isEndDateNear = (endDate) => {
  if (!endDate) return false;

  const today = new Date();
  const startOfToday = new Date(today.getFullYear(), today.getMonth(), today.getDate()); // 今天 00:00:00

  const thirtyDaysLater = new Date(startOfToday);
  thirtyDaysLater.setDate(startOfToday.getDate() + 30); // 今天 + 30天，也是 00:00:00

  const end = new Date(endDate);
  const endOfDate = new Date(end.getFullYear(), end.getMonth(), end.getDate()); // 忽略时间部分

  return endOfDate <= thirtyDaysLater;
};

// 过滤：只显示 value 在 1 到 3 之间的选项
const filteredUsageType = computed(() => {
  return usage_type.value.filter((item) => {
    const value = Number(item.value);
    return !isNaN(value) && value >= 1 && value <= 3;
  });
});

// 构建映射表：code => name
const areaCodeToName: Record<string, string> = {};

function buildAreaMap(data: any[]) {
  data.forEach((node) => {
    areaCodeToName[node.value] = node.label;
    if (node.children) buildAreaMap(node.children);
  });
}

// 初始化时构建一次
buildAreaMap(regionData);

// 然后 handleChange 改为：
const handleChange = (val: string[]) => {
  form.value.areaCode = val.join(',');
  form.value.province = areaCodeToName[val[0]] || '';
  form.value.city = areaCodeToName[val[1]] || '';
  form.value.district = areaCodeToName[val[2]] || '';
};

/** 取消按钮 */
const cancel = () => {
  reset();
  dialog.visible = false;
};

const handleSearch = () => {};

// 字典label工具
function getDictLabel(dictList: any[], value: string) {
  if (!dictList || !Array.isArray(dictList)) return value || '--';
  const found = dictList.find((item) => item.value === value);
  return found ? found.label : value || '--';
}

function formatDate(date) {
  if (!date) return '';
  const d = new Date(date);
  if (isNaN(d.getTime())) return ''; // 处理无效日期
  const year = d.getFullYear();
  const month = String(d.getMonth() + 1).padStart(2, '0');
  const day = String(d.getDate()).padStart(2, '0');
  return `${year}-${month}-${day}`;
}

/** 表单重置 */
const reset = () => {
  form.value = { ...initFormData };
  sysStoreFormRef.value?.resetFields();
};

/** 搜索按钮操作 */
const handleQuery = () => {
  queryParams.value.pageNum = 1;
  getList();
};

/** 重置按钮操作 */
const resetQuery = () => {
  queryFormRef.value?.resetFields();
  queryParams.value.vestInUserId = undefined;
  handleQuery();
};

/** 多选框选中数据 */
const handleSelectionChange = (selection: SysStoreVO[]) => {
  ids.value = selection.map((item) => item.id);
  single.value = selection.length != 1;
  multiple.value = !selection.length;
};

/** 新增按钮操作 */
const handleAdd = () => {
  reset();
  dialog.visible = true;
  dialog.title = '添加门店信息';
};

/** 修改按钮操作 */
const handleUpdate = async (row?: SysStoreVO) => {
  reset();
  const _id = row?.id || ids.value[0];
  const res = await getSysStore(_id);
  Object.assign(form.value, res.data);

  // 处理地址数据，将 areaCode 字符串转换为数组
  if (form.value.areaCode) {
    form.value.codeArr = form.value.areaCode.split(',');
  }

  dialog.visible = true;
  dialog.title = '修改门店信息';
};

// 获取服务列表
const getServiceList = async () => {
  const res = await listSysService(serviceQueryParams);
  serviceList.value = res.rows;
  serviceTotal.value = res.total;
};

// 搜索服务
const handleServiceQuery = () => {
  serviceQueryParams.searchValue = serviceForm.searchValue;
  getServiceList();
};

// 选择当前行
const handleCurrentChange = (val: any) => {
  currentService.value = val;
};

// 选择服务
const handleSelectService = async (row: SysServiceVO) => {
  if (!form.value.id) {
    proxy?.$modal.msgError('门店信息不存在');
    return;
  }

  try {
    loading.value = true;
    currentService.value = row;

    // 构造完整的表单数据
    const params: SysStoreForm = {
      id: form.value.id,
      serviceId: row.id
    } as SysStoreForm;

    const response = await assignService(params);

    proxy?.$modal.msgSuccess('指定服务成功');
    serviceDialog.visible = false;
    await getList();
  } catch (error: any) {
    console.error('指定服务失败:', error);

    // 尝试获取更详细的错误信息
    let errorMsg = '指定服务失败';
    if (error.response?.data?.msg) {
      errorMsg = error.response.data.msg;
    } else if (error.message) {
      errorMsg = error.message;
    }

    proxy?.$modal.msgError(`${errorMsg}，请重试`);
  } finally {
    loading.value = false;
  }
};

// 确认选择服务
const confirmSelectService = () => {
  if (!currentService.value) {
    proxy?.$modal.msgError('请选择一个服务');
    return;
  }
};

// 打开指定服务弹出框
const assignServiceInfo = async (row: SysStoreVO) => {
  form.value.id = row.id;
  serviceDialog.visible = true;
  getServiceList();
};

/** 提交按钮 */
const submitForm = () => {
  sysStoreFormRef.value?.validate(async (valid: boolean) => {
    if (valid) {
      buttonLoading.value = true;
      if (form.value.id) {
        await updateSysStore(form.value).finally(() => (buttonLoading.value = false));
      } else {
        await addSysStore(form.value).finally(() => (buttonLoading.value = false));
      }
      proxy?.$modal.msgSuccess('操作成功');
      dialog.visible = false;
      await getList();
    }
  });
};

/** 删除按钮操作 */
const handleDelete = async (row?: SysStoreVO) => {
  const _ids = row?.id || ids.value;
  await proxy?.$modal.confirm('是否确认删除门店信息编号为"' + _ids + '"的数据项？').finally(() => (loading.value = false));
  await delSysStore(_ids);
  proxy?.$modal.msgSuccess('删除成功');
  await getList();
};

/** 导出按钮操作 */
const handleExport = () => {
  proxy?.download(
    'system/sysStore/export',
    {
      ...queryParams.value
    },
    `sysStore_${new Date().getTime()}.xlsx`
  );
};

// ✅ 监听 route.query.type 变化
watch(
  () => route.query.type,
  (newType, oldType) => {
    console.log('type 变化了:', oldType, '→', newType);
    // 这里可以重新加载数据
    if (newType === 'active') {
      queryParams.value.usageType = '1';
    } else if (newType === 'expiring') {
      queryParams.value.usageType = '9';
    } else if (newType === 'trialing') {
      queryParams.value.usageType = '3';
    } else if (newType === 'disabled') {
      queryParams.value.usageType = '2,0';
    }
    getList();
  },
  { immediate: true } // 可选：页面加载时也执行一次
);

onMounted(() => {
  getList();
  getBrandList();
  getVestInUserList();
  getParentStoreList();
});
</script>

<style lang="scss">
.service-dialog {
  .el-dialog__body {
    padding: 20px;
  }

  .service-table {
    .el-table__header {
      th {
        background-color: #f5f7fa;
        color: #606266;
        font-weight: normal;
      }
    }

    .el-table__row {
      td {
        padding: 8px 0;
      }
    }

    .qr-code {
      border: 1px solid #dcdfe6;
      border-radius: 4px;
    }
  }

  .custom-pagination {
    --el-pagination-button-bg-color: transparent;

    .el-pager {
      .number {
        margin: 0 4px;
        min-width: 24px;
        height: 24px;
        line-height: 24px;
        border-radius: 2px;
        font-weight: normal;

        &.is-active {
          background-color: var(--el-color-primary);
          color: #fff;
        }
      }
    }

    .btn-prev,
    .btn-next {
      margin: 0;
      min-width: 24px;
      height: 24px;
      line-height: 24px;
      border-radius: 2px;
      padding: 0;

      &:hover {
        color: var(--el-color-primary);
      }
    }
  }

  .jump-page-input {
    :deep(.el-input__inner) {
      padding: 0;
      text-align: center;
      height: 24px;
      line-height: 24px;
      border-radius: 2px;
    }
  }
}
</style>
