<script setup lang="ts">
import { reactive, ref, onMounted, toRaw } from 'vue';
import { PageContainer } from '@ant-design-vue/pro-layout';
import { message, Modal, Form, notification } from 'ant-design-vue/lib';
import { SizeType } from 'ant-design-vue/lib/config-provider';
import { MenuInfo } from 'ant-design-vue/lib/menu/src/interface';
import { ColumnsType } from 'ant-design-vue/lib/table';
import UploadModal from '@/components/UploadModal/index.vue';
import {
  loadSub,
  listSub,
  getSub,
  updateSub,
  addSub,
  delSub,
  importSubData,
  exportSub,
  batchAddSub,
  batchDelSub,
} from '@/api/neUser/sub';
import useNeInfoStore from '@/store/modules/neinfo';
import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import saveAs from 'file-saver';
const { t } = useI18n();

/**网元参数 */
let neOtions = ref<Record<string, any>[]>([]);

/**查询参数 */
let queryParams = reactive({
  /**网元ID */
  neId: undefined,
  /**移动编号 */
  imsi: '',
  /**移动号 */
  msisdn: '',
  /**排序字段 */
  sortField: 'imsi',
  /**排序方式 */
  sortOrder: 'asc',
  /**当前页数 */
  pageNum: 1,
  /**每页条数 */
  pageSize: 20,
});

/**查询参数重置 */
function fnQueryReset() {
  queryParams = Object.assign(queryParams, {
    imsi: '',
    msisdn: '',
    sortField: 'imsi',
    sortOrder: 'asc',
    pageNum: 1,
    pageSize: 20,
  });
  tablePagination.current = 1;
  tablePagination.pageSize = 20;
  fnGetList();
}

/**表格状态类型 */
type TabeStateType = {
  /**加载等待 */
  loading: boolean;
  /**紧凑型 */
  size: SizeType;
  /**搜索栏 */
  seached: boolean;
  /**记录数据 */
  data: object[];
};

/**表格状态 */
let tableState: TabeStateType = reactive({
  loading: false,
  size: 'middle',
  seached: true,
  data: [],
});

/**表格字段列 */
let tableColumns: ColumnsType = [
  {
    title: 'IMSI',
    dataIndex: 'imsi',
    align: 'center',
    fixed: 'left',
    width: 5,
  },
  {
    title: 'MSISDN',
    dataIndex: 'msisdn',
    align: 'center',
    fixed: 'left',
    width: 5,
  },
  {
    title: 'Subscribed AMBR Temp',
    dataIndex: 'ambr',
    align: 'center',
    width: 5,
  },
  {
    title: 'Subscribed SNSSAIs Temp',
    dataIndex: 'sar',
    align: 'center',
    width: 5,
  },
  {
    title: 'RAT Restriction',
    dataIndex: 'rat',
    align: 'center',
    width: 5,
  },
  {
    title: 'Forbidden Areas Temp',
    dataIndex: 'arfb',
    align: 'center',
    width: 5,
  },
  {
    title: 'Service Area Restrict Temp',
    dataIndex: 'nssai',
    align: 'center',
    width: 5,
  },
  {
    title: 'CN Type Restriction',
    dataIndex: 'cn',
    align: 'center',
    width: 5,
  },
  {
    title: 'Subscribed Data',
    dataIndex: 'smData',
    align: 'center',
    width: 10,
  },
  {
    title: 'EPS Flag',
    dataIndex: 'epsFlag',
    align: 'center',
    width: 2,
  },
  {
    title: t('common.operate'),
    key: 'imsi',
    align: 'center',
    fixed: 'right',
    width: 5,
  },
];

/**表格分页器参数 */
let tablePagination = reactive({
  /**当前页数 */
  current: 1,
  /**每页条数 */
  pageSize: 20,
  /**默认的每页条数 */
  defaultPageSize: 20,
  /**指定每页可以显示多少条 */
  pageSizeOptions: ['10', '20', '50', '100'],
  /**只有一页时是否隐藏分页器 */
  hideOnSinglePage: false,
  /**是否可以快速跳转至某页 */
  showQuickJumper: true,
  /**是否可以改变 pageSize */
  showSizeChanger: true,
  /**数据总数 */
  total: 0,
  showTotal: (total: number) => t('common.tablePaginationTotal', { total }),
  onChange: (page: number, pageSize: number) => {
    tablePagination.current = page;
    tablePagination.pageSize = pageSize;
    queryParams.pageNum = page;
    queryParams.pageSize = pageSize;
    fnGetList();
  },
});

/**表格紧凑型变更操作 */
function fnTableSize({ key }: MenuInfo) {
  tableState.size = key as SizeType;
}

/**对话框对象信息状态类型 */
type ModalStateType = {
  /**详情框是否显示 */
  visibleByView: boolean;
  /**新增框或修改框是否显示 */
  visibleByEdit: boolean;
  /**批量新增否显示 */
  visibleByBatch: boolean;
  /**批量删除否显示 */
  visibleByBatchDel: boolean;
  /**标题 */
  title: string;
  /**表单数据 */
  from: Record<string, any>;
  /**表单数据 */
  BatchForm: Record<string, any>;
  /**表单数据 */
  BatchDelForm: Record<string, any>;
  /**确定按钮 loading */
  confirmLoading: boolean;
  /**更新加载数据按钮 loading */
  loadDataLoading: boolean;
};

/**对话框对象信息状态 */
let modalState: ModalStateType = reactive({
  visibleByView: false,
  visibleByEdit: false,
  visibleByBatch: false,
  visibleByBatchDel: false,
  title: 'UDM签约用户',
  from: {
    id: '',
    msisdn: '',
    imsi: '',
    ambr: 'def_ambr',
    nssai: 'def_nssai',
    rat: '',
    arfb: 'def_arfb',
    sar: 'def_sar',
    cn: '',
    smData: '',
    smfSel: 'def_snssai',
    epsDat: '',
    neId: '',
    epsFlag: '1',
    epsOdb: [2],
    hplmnOdb: [3, 4],
    ard: [1, 7],
    epstpl: 'def_eps',
    contextId: '1',
    apnContext: '',
    staticIp: '',
  },
  BatchForm: {
    num: '',
    msisdn: '',
    imsi: '',
    ambr: 'def_ambr',
    nssai: 'def_nssai',
    rat: '',
    arfb: 'def_arfb',
    sar: 'def_sar',
    cn: '',
    smData: '',
    smfSel: 'def_snssai',
    epsDat: '',
    neId: '',
    epsFlag: '1',
    epsOdb: [2],
    hplmnOdb: [3, 4],
    ard: [1, 7],
    epstpl: 'def_eps',
    contextId: '1',
    apnContext: '',
    staticIp: '',
  },
  BatchDelForm: {
    num: '',
    imsi: '',
  },
  confirmLoading: false,
  loadDataLoading: false,
});

/**表单中多选的OPTION */
const modalStateFromOption = reactive({
  ardJson: [
    { label: 'UTRAN Not Allowed', value: 0 },
    { label: 'GERAN Not Allowed', value: 1 },
    { label: 'GAN Not Allowed', value: 2 },
    { label: 'I HSPA Evolution Not Allowed', value: 3 },
    { label: 'WB E-UTRAN Not Allowed', value: 4 },
    { label: 'HO To Non-3GPP Access Not Allowed', value: 5 },
    { label: 'NB IoT Not Allowed', value: 6 },
    { label: 'Enhanced Coverage Not Allowed', value: 7 },
  ],
  odbJson: [
    {
      label:
        'Barring of all outgoing international calls except those directed to the home PLMN country and outgoing inter-zonal calls barred',
      value: 0,
    },
    { label: 'All Packet Oriented Services Barred', value: 1 },
    { label: 'Roamer Access HPLMN-AP Barred', value: 2 },
    { label: 'Roamer Access to VPLMN-AP Barred', value: 3 },
    { label: 'Barring of all outgoing calls', value: 4 },
    { label: 'Barring of all outgoing international calls', value: 5 },
    {
      label:
        'Barring of all outgoing international calls except those directed to the home PLMN country',
      value: 6,
    },
    { label: 'Barring of outgoing inter-zonal calls', value: 7 },
    {
      label:
        'Barring of all outgoing inter-zonal calls except those directed to the home PLMN country barred',
      value: 7,
    },
  ],
  hplmnOdb: [
    { label: 'HPLMN specific barring type 1', value: 0 },
    { label: 'HPLMN specific barring type 2', value: 1 },
    { label: 'HPLMN specific barring type 3', value: 2 },
    { label: 'HPLMN specific barring type 4', value: 3 },
    { label: 'HPLMN specific barring type 5', value: 4 },
    { label: 'HPLMN specific barring type 6', value: 5 },
    { label: 'HPLMN specific barring type 7', value: 6 },
    { label: 'HPLMN specific barring type 8', value: 7 },
  ],
});

/**
 * 针对修改框的截取每位数值
 * @param num 二进制值: 10001 n:长度有几位
 */
function PrefixZero(num: any, n: any) {
  return (Array(n).join('0') + num).slice(-n);
}

/**
 * 对话框弹出显示为 批量新增,批量删除
 * @param noticeId 网元id, 不传为新增
 */
function fnModalVisibleByBatch(batchFlag?: number) {
  if (batchFlag) {
    modalStateBatchFrom.resetFields(); //重置表单
    modalState.title = '批量添加签约信息';
    modalState.visibleByBatch = true;
  } else {
    modalStateBatchFrom.resetFields(); //重置表单
    modalState.title = '批量删除签约信息';
    modalState.visibleByBatchDel = true;
  }
}

/**
 * 对话框弹出显示为 新增或者修改
 * @param noticeId 网元id, 不传为新增
 */
function fnModalVisibleByEdit(imsi?: string) {
  if (!imsi) {
    modalStateFrom.resetFields();
    modalState.title = '添加签约信息';
    modalState.visibleByEdit = true;
  } else {
    if (modalState.confirmLoading) return;
    const hide = message.loading('正在打开...', 0);
    modalState.confirmLoading = true;
    const neID = queryParams.neId || '-';
    getSub(neID, imsi).then(res => {
      modalState.confirmLoading = false;
      hide();
      if (res.code === RESULT_CODE_SUCCESS) {
        let ardAll = parseInt(res.data.ard).toString(2).padStart(8, '0');
        let hplAll = parseInt(res.data.hplmnOdb).toString(2).padStart(8, '0');
        let odbAll = parseInt(res.data.epsOdb).toString(2).padStart(9, '0');
        const ardArray: any[] = [];
        const hplmnArray: any[] = [];
        const epsOdbArray: any[] = [];
        for (let i = 0; i < ardAll.length; i++) {
          if (PrefixZero(ardAll, ardAll.length).charAt(i) === '1') {
            ardArray.push(i);
          }
        }

        for (let i = 0; i < hplAll.length; i++) {
          if (PrefixZero(hplAll, hplAll.length).charAt(i) === '1') {
            hplmnArray.push(i);
          }
        }
        for (let i = 0; i < odbAll.length; i++) {
          if (PrefixZero(odbAll, odbAll.length).charAt(i) === '1') {
            epsOdbArray.push(i);
          }
        }
        res.data.ard = ardArray;
        res.data.hplmnOdb = hplmnArray;
        res.data.epsOdb = epsOdbArray;

        modalState.from = Object.assign(modalState.from, res.data);
        modalState.title = '修改签约信息';
        modalState.visibleByEdit = true;
      } else {
        message.error(`获取签约信息失败`, 2);
      }
    });
  }
}

/**对话框内表单属性和校验规则 */
const modalStateFrom = Form.useForm(
  modalState.from,
  reactive({
    imsi: [{ required: true, message: 'IMSI不能为空' }],
    smData: [{ required: true, message: 'Subscribed SM Data不能为空' }],
  })
);

/**
 * 对话框弹出确认执行函数
 * 进行表达规则校验
 */
function fnModalOk() {
  let validateNames = ['imsi'];

  if (modalState.from.id === '') {
    validateNames.push('smData');
  }
  modalStateFrom
    .validate(validateNames)
    .then(e => {
      modalState.confirmLoading = true;
      const from = toRaw(modalState.from);
      let ardArr = [0, 0, 0, 0, 0, 0, 0, 0];
      let hplmnArr = [0, 0, 0, 0, 0, 0, 0, 0];
      let odbArr = [0, 0, 0, 0, 0, 0, 0, 0];

      from.ard.forEach((item: any) => {
        ardArr[item] = 1;
      });

      from.hplmnOdb.forEach((item: any) => {
        hplmnArr[item] = 1;
      });

      from.epsOdb.forEach((item: any) => {
        odbArr[item] = 1;
      });

      from.epsOdb = '' + parseInt(odbArr.join(''), 2);
      from.hplmnOdb = '' + parseInt(hplmnArr.join(''), 2);
      from.ard = '' + parseInt(ardArr.join(''), 2);
      from.cn = '3';
      const neID = queryParams.neId || '-';
      const result = from.id ? updateSub(neID, from) : addSub(neID, from);
      const hide = message.loading({ content: t('common.loading') });
      result
        .then(res => {
          if (res.code === RESULT_CODE_SUCCESS) {
            message.success({
              content: t('common.msgSuccess', { msg: modalState.title }),
              duration: 3,
            });
            modalState.visibleByEdit = false;
            modalStateFrom.resetFields();
            fnGetList();
          } else {
            message.error({
              content: `${res.msg}`,
              duration: 3,
            });
          }
        })
        .finally(() => {
          hide();
          modalState.confirmLoading = false;
        });
    })
    .catch(e => {
      message.error(t('common.errorFields', { num: e.errorFields.length }), 3);
    });
}

/**对话框内批量添加表单属性和校验规则 */
const modalStateBatchFrom = Form.useForm(
  modalState.BatchForm,
  reactive({
    num: [{ required: true, message: '放号数不能为空' }],
    imsi: [{ required: true, message: 'IMSI不能为空' }],
    msisdn: [{ required: true, message: 'MSISDN不能为空' }],
    smData: [{ required: true, message: 'Subscribed SM Data不能为空' }],
  })
);

/**
 * 对话框弹出 批量新增操作确认执行函数
 * 进行表达规则校验
 */
function fnBatchModalOk() {
  modalStateBatchFrom
    .validate()
    .then(e => {
      modalState.confirmLoading = true;
      const from = toRaw(modalState.BatchForm);
      let ardArr = [0, 0, 0, 0, 0, 0, 0, 0];
      let hplmnArr = [0, 0, 0, 0, 0, 0, 0, 0];
      let odbArr = [0, 0, 0, 0, 0, 0, 0, 0];

      from.ard.forEach((item: any) => {
        ardArr[item] = 1;
      });

      from.hplmnOdb.forEach((item: any) => {
        hplmnArr[item] = 1;
      });

      from.epsOdb.forEach((item: any) => {
        odbArr[item] = 1;
      });

      from.epsOdb = '' + parseInt(odbArr.join(''), 2);
      from.hplmnOdb = '' + parseInt(hplmnArr.join(''), 2);
      from.ard = '' + parseInt(ardArr.join(''), 2);
      from.cn = '3';
      const neID = queryParams.neId || '-';
      // const result = from.id ? updateAuth(from) : addAuth(neID, from);
      from.neID = neID;
      const result = batchAddSub(from);
      const hide = message.loading({ content: t('common.loading') });
      result
        .then(res => {
          if (res.code === RESULT_CODE_SUCCESS) {
            message.success({
              content: t('common.msgSuccess', { msg: modalState.title }),
              duration: 3,
            });
            modalState.visibleByBatch = false;
            modalStateBatchFrom.resetFields();
            fnGetList();
          } else {
            message.error({
              content: `${res.msg}`,
              duration: 3,
            });
          }
        })
        .finally(() => {
          1;
          hide();
          from.epsOdb = [];
          from.hplmnOdb = [];
          from.ard = [];
          modalState.confirmLoading = false;
        });
    })
    .catch(e => {
      message.error(t('common.errorFields', { num: e.errorFields.length }), 3);
    });
}

/**对话框内批量添加表单属性和校验规则 */
const modalStateBatchDelFrom = Form.useForm(
  modalState.BatchDelForm,
  reactive({
    num: [{ required: true, message: '放号数不能为空' }],
    imsi: [{ required: true, message: 'IMSI不能为空' }],
  })
);

/**
 * 对话框弹出 批量删除确认执行函数
 * 进行表达规则校验
 */
function fnBatchDelModalOk() {
  modalStateBatchDelFrom
    .validate()
    .then(e => {
      modalState.confirmLoading = true;
      const from = toRaw(modalState.BatchDelForm);

      const neID = queryParams.neId || '-';
      // const result = from.id ? updateAuth(from) : addAuth(neID, from);
      from.neID = neID;
      const result = batchDelSub(from);
      const hide = message.loading({ content: t('common.loading') });
      result
        .then(res => {
          if (res.code === RESULT_CODE_SUCCESS) {
            message.success({
              content: t('common.msgSuccess', { msg: modalState.title }),
              duration: 3,
            });
            modalState.visibleByBatchDel = false;
            modalStateBatchDelFrom.resetFields();
            fnGetList();
          } else {
            message.error({
              content: `${res.msg}`,
              duration: 3,
            });
          }
        })
        .finally(() => {
          hide();
          modalState.confirmLoading = false;
        });
    })
    .catch(e => {
      message.error(t('common.errorFields', { num: e.errorFields.length }), 3);
    });
}

/**
 * 对话框弹出关闭执行函数
 * 进行表达规则校验
 */
function fnModalCancel() {
  modalState.visibleByEdit = false;
  modalState.visibleByView = false;
  modalStateFrom.resetFields();
}

/**
 * 批量添加对话框弹出关闭执行函数
 * 进行表达规则校验
 */
function fnBatchModalCancel() {
  modalState.visibleByBatch = false;
  modalState.visibleByView = false;
  modalStateBatchFrom.resetFields();
}

/**
 * 批量删除对话框弹出关闭执行函数
 * 进行表达规则校验
 */
function fnBatchDelModalCancel() {
  modalState.visibleByBatchDel = false;
  modalState.visibleByView = false;
  modalStateBatchDelFrom.resetFields();
}

/**
 * UDM签约用户删除
 * @param imsi 网元编号ID
 */
function fnRecordDelete(imsi: string) {
  const neID = queryParams.neId;
  if (!neID) return;
  Modal.confirm({
    title: '提示',
    content: `确认删除IMSI编号为: ${imsi} 的签约用户嘛?`,
    onOk() {
      const key = 'delSub';
      message.loading({ content: '请稍等...', key });
      delSub(neID, imsi).then(res => {
        if (res.code === RESULT_CODE_SUCCESS) {
          message.success({
            content: `删除成功`,
            key,
            duration: 2,
          });
          fnGetList();
        } else {
          message.error({
            content: `${res.msg}`,
            key: key,
            duration: 2,
          });
        }
      });
    },
  });
}

/**列表导出 */
function fnExportList(type: string) {
  const neID = queryParams.neId;
  if (!neID) return;
  const key = 'exportSub';
  message.loading({ content: '请稍等...', key });
  exportSub({
    neId: neID,
    type: type,
  }).then(res => {
    if (res.code === RESULT_CODE_SUCCESS) {
      message.success({
        content: `已完成导出`,
        key,
        duration: 2,
      });
      saveAs(res.data, `UDMSub_${Date.now()}.${type}`);
    } else {
      message.error({
        content: `${res.msg}`,
        key,
        duration: 2,
      });
    }
  });
}

/**重新加载数据 */
function fnLoadData() {
  const neID = queryParams.neId;
  if (tableState.loading || !neID) return;
  modalState.loadDataLoading = true;
  tablePagination.total = 0;
  tableState.data = [];
  tableState.loading = true; // 表格loading
  loadSub(neID).then(res => {
    if (res.code === RESULT_CODE_SUCCESS) {
      notification.success({
        message: t('views.neUser.sub.loadData'),
        description: t('views.neUser.sub.loadDataTip', { num: res.data }),
        duration: 10,
      });
      // 延迟3s后关闭loading刷新列表
      setTimeout(() => {
        modalState.loadDataLoading = false;
        tableState.loading = false; // 表格loading
        fnQueryReset();
      }, 3000);
    } else {
      message.error({
        content: `获取数据失败`,
        duration: 3,
      });
    }
  });
}

/**查询网元列表 */
function fnGetList() {
  if (tableState.loading) return;
  tableState.loading = true;
  listSub(toRaw(queryParams)).then(res => {
    if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
      tablePagination.total = res.total;
      tableState.data = res.rows;
    }
    tableState.loading = false;
  });
}

/**对话框表格信息导入对象信息状态类型 */
type ModalUploadImportStateType = {
  /**是否显示 */
  visible: boolean;
  /**标题 */
  title: string;
  /**是否上传中 */
  loading: boolean;
  /**上传结果信息 */
  msg: string;
};

/**对话框表格信息导入对象信息状态 */
let uploadImportState: ModalUploadImportStateType = reactive({
  visible: false,
  title: '数据导入',
  loading: false,
  msg: '',
});

/**对话框表格信息导入弹出窗口 */
function fnModalUploadImportOpen() {
  uploadImportState.msg = '';
  uploadImportState.loading = false;
  uploadImportState.visible = true;
}

/**对话框表格信息导入关闭窗口 */
function fnModalUploadImportClose() {
  uploadImportState.visible = false;
  fnGetList();
}

/**对话框表格信息导入上传 */
function fnModalUploadImportUpload(file: File) {
  let formData = new FormData();
  formData.append('file', file);
  const neID = queryParams.neId;
  if (!neID) {
    return Promise.reject('未知网元');
  }
  const hide = message.loading('正在上传...', 0);
  uploadImportState.loading = true;
  importSubData(neID, formData)
    .then(res => {
      uploadImportState.msg = res.msg;
    })
    .catch((err: { code: number; msg: string }) => {
      message.error(`上传失败 ${err.msg}`);
    })
    .finally(() => {
      hide();
      uploadImportState.loading = false;
    });
}

onMounted(() => {
  // 获取网元网元列表
  useNeInfoStore()
    .fnNelist()
    .then(res => {
      if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
        if (res.data.length > 0) {
          let arr: Record<string, any>[] = [];
          res.data.forEach(i => {
            if (i.neType === 'UDM') {
              arr.push({ value: i.neId, label: i.neName });
            }
          });
          neOtions.value = arr;
          if (arr.length > 0) {
            queryParams.neId = arr[0].value;
          }
        }
      } else {
        message.warning({
          content: `暂无网元列表数据`,
          duration: 2,
        });
      }
    })
    .finally(() => {
      // 获取列表数据
      fnGetList();
    });
});
</script>

<template>
  <PageContainer>
    <a-card
      v-show="tableState.seached"
      :bordered="false"
      :body-style="{ marginBottom: '24px', paddingBottom: 0 }"
    >
      <!-- 表格搜索栏 -->
      <a-form :model="queryParams" name="queryParams" layout="horizontal">
        <a-row :gutter="16">
          <a-col :lg="6" :md="12" :xs="24">
            <a-form-item :label="t('views.neUser.sub.neType')" name="neId ">
              <a-select
                v-model:value="queryParams.neId"
                :options="neOtions"
                allow-clear
                :placeholder="t('views.neUser.sub.neTypePlease')"
              />
            </a-form-item>
          </a-col>
          <a-col :lg="6" :md="12" :xs="24">
            <a-form-item label="IMSI" name="imsi">
              <a-input
                v-model:value="queryParams.imsi"
                allow-clear
                placeholder="查询IMSI"
              ></a-input>
            </a-form-item>
          </a-col>
          <a-col :lg="6" :md="12" :xs="24">
            <a-form-item label="MSISDN" name="msisdn">
              <a-input
                v-model:value="queryParams.msisdn"
                allow-clear
                placeholder="查询MSISDN"
              ></a-input>
            </a-form-item>
          </a-col>
          <a-col :lg="6" :md="12" :xs="24">
            <a-form-item>
              <a-space :size="8">
                <a-button type="primary" @click.prevent="fnGetList">
                  <template #icon>
                    <SearchOutlined />
                  </template>
                  {{ t('common.search') }}
                </a-button>
                <a-button type="default" @click.prevent="fnQueryReset">
                  <template #icon>
                    <ClearOutlined />
                  </template>
                  {{ t('common.reset') }}
                </a-button>
              </a-space>
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-card>

    <a-card :bordered="false" :body-style="{ padding: '0px' }">
      <!-- 插槽-卡片左侧侧 -->
      <template #title>
        <a-space :size="8" align="center">
          <a-button type="primary" @click.prevent="fnModalVisibleByEdit()">
            <template #icon>
              <PlusOutlined />
            </template>
            {{ t('common.addText') }}
          </a-button>

          <a-button type="primary" @click.prevent="fnModalVisibleByBatch(1)">
            <template #icon>
              <PlusOutlined />
            </template>
            {{ t('views.neUser.auth.batchAddText') }}
          </a-button>
          <a-button
            type="primary"
            danger
            ghost
            @click.prevent="fnModalVisibleByBatch(0)"
          >
            <template #icon>
              <DeleteOutlined />
            </template>
            {{ t('views.neUser.auth.batchDelText') }}
          </a-button>
          <a-popconfirm
            :title="t('views.neUser.sub.loadDataConfirm')"
            :ok-text="t('common.ok')"
            :cancel-text="t('common.cancel')"
            :disabled="modalState.loadDataLoading"
            @confirm="fnLoadData"
          >
            <a-button
              type="dashed"
              danger
              :disabled="modalState.loadDataLoading"
              :loading="modalState.loadDataLoading"
            >
              <template #icon>
                <SyncOutlined />
              </template>
              {{ t('views.neUser.sub.loadData') }}
            </a-button>
          </a-popconfirm>

          <a-button type="dashed" @click.prevent="fnModalUploadImportOpen">
            <template #icon>
              <ImportOutlined />
            </template>
            {{ t('views.neUser.sub.import') }}
          </a-button>

          <a-popconfirm
            :title="t('views.neUser.sub.exportConfirm')"
            ok-text="TXT"
            ok-type="default"
            @confirm="fnExportList('txt')"
            cancel-text="CSV"
            @cancel="fnExportList('csv')"
          >
            <a-button type="dashed">
              <template #icon>
                <ExportOutlined />
              </template>
              {{ t('views.neUser.sub.export') }}
            </a-button>
          </a-popconfirm>
        </a-space>
      </template>

      <!-- 插槽-卡片右侧 -->
      <template #extra>
        <a-space :size="8" align="center">
          <a-tooltip>
            <template #title>{{ t('common.searchBarText') }}</template>
            <a-switch
              v-model:checked="tableState.seached"
              :checked-children="t('common.switch.show')"
              :un-checked-children="t('common.switch.hide')"
              size="small"
            />
          </a-tooltip>
          <a-tooltip>
            <template #title>{{ t('common.reloadText') }}</template>
            <a-button type="text" @click.prevent="fnGetList">
              <template #icon>
                <ReloadOutlined />
              </template>
            </a-button>
          </a-tooltip>
          <a-tooltip>
            <template #title>{{ t('common.sizeText') }}</template>
            <a-dropdown trigger="click">
              <a-button type="text">
                <template #icon>
                  <ColumnHeightOutlined />
                </template>
              </a-button>
              <template #overlay>
                <a-menu
                  :selected-keys="[tableState.size as string]"
                  @click="fnTableSize"
                >
                  <a-menu-item key="default">{{
                    t('common.size.default')
                  }}</a-menu-item>
                  <a-menu-item key="middle">{{
                    t('common.size.middle')
                  }}</a-menu-item>
                  <a-menu-item key="small">{{
                    t('common.size.small')
                  }}</a-menu-item>
                </a-menu>
              </template>
            </a-dropdown>
          </a-tooltip>
        </a-space>
      </template>

      <!-- 表格列表 -->
      <a-table
        class="table"
        row-key="imsi"
        :columns="tableColumns"
        :loading="tableState.loading"
        :data-source="tableState.data"
        :size="tableState.size"
        :pagination="tablePagination"
        :scroll="{ x: 2500, y: 400 }"
      >
        <template #bodyCell="{ column, record }">
          <template v-if="column.key === 'imsi'">
            <a-space :size="8" align="center">
              <a-tooltip>
                <template #title>{{ t('common.editText') }}</template>
                <a-button
                  type="link"
                  @click.prevent="fnModalVisibleByEdit(record.imsi)"
                >
                  <template #icon>
                    <FormOutlined />
                  </template>
                </a-button>
              </a-tooltip>
              <a-tooltip>
                <template #title>{{ t('common.deleteText') }}</template>
                <a-button
                  type="link"
                  @click.prevent="fnRecordDelete(record.imsi)"
                >
                  <template #icon>
                    <DeleteOutlined />
                  </template>
                </a-button>
              </a-tooltip>
            </a-space>
          </template>
        </template>
      </a-table>
    </a-card>

    <!-- 新增框或修改框 -->
    <a-modal
      width="1000px"
      :keyboard="false"
      :mask-closable="false"
      :visible="modalState.visibleByEdit"
      :title="modalState.title"
      :confirm-loading="modalState.confirmLoading"
      @ok="fnModalOk"
      @cancel="fnModalCancel"
    >
      <a-form
        name="modalStateFrom"
        layout="horizontal"
        :label-col="{ span: 7.5 }"
        :labelWrap="true"
      >
        <a-row :gutter="16">
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item
              label="IMSI"
              name="imsi"
              v-bind="modalStateFrom.validateInfos.imsi"
            >
              <a-input
                v-model:value="modalState.from.imsi"
                allow-clear
                placeholder="请输入IMSI"
              >
                <template #prefix>
                  <a-tooltip placement="topLeft">
                    <template #title>
                      SUPI=MCC+MNC+MSIN MCC=移动国家号码, 由三位数字组成
                      MNC=移动网络号，由两位数字组成
                      MSIN=移动客户识别码,采用等长10位数字构成
                    </template>
                    <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
                  </a-tooltip>
                </template>
              </a-input>
            </a-form-item>
          </a-col>
          <!-- <a-col :lg="12" :md="12" :xs="24">
            <a-form-item
              label="cn"
              name="cn"
              v-bind="modalStateFrom.validateInfos.cn"
            >
              <a-input
                v-model:value="modalState.from.cn"
                allow-clear
                placeholder="请输入cn"
              ></a-input>
            </a-form-item>
          </a-col> -->
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item
              label="MSISDN"
              name="msisdn"
              v-bind="modalStateFrom.validateInfos.msisdn"
            >
              <a-input
                v-model:value="modalState.from.msisdn"
                allow-clear
                placeholder="请输入msisdn"
              >
                <template #prefix>
                  <a-tooltip placement="topLeft">
                    <template #title> 参数最大长度32 </template>
                    <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
                  </a-tooltip>
                </template>
              </a-input>
            </a-form-item>
          </a-col>
        </a-row>

        <a-row :gutter="16">
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item
              label="5G Subscribed UE AMBR template"
              name="ambr"
              v-bind="modalStateFrom.validateInfos.ambr"
            >
              <a-input v-model:value="modalState.from.ambr" allow-clear>
              </a-input>
            </a-form-item>
          </a-col>
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item
              label="5G Subscribed SNSSAIs template"
              name="nssai"
              v-bind="modalStateFrom.validateInfos.nssai"
            >
              <a-input v-model:value="modalState.from.nssai" allow-clear>
              </a-input>
            </a-form-item>
          </a-col>
        </a-row>

        <a-row :gutter="16">
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item label="5G UE Usage Type" name="ueType">
              <a-input value="1" allow-clear> </a-input>
            </a-form-item>
          </a-col>
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item label="5G Forbidden Areas template" name="arfb">
              <a-input v-model:value="modalState.from.arfb" allow-clear>
                <template #prefix>
                  <a-tooltip placement="topLeft">
                    <template #title>
                      限制区域模板,在模板指定的限制区域中,UE 不允许与网络通信
                    </template>
                    <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
                  </a-tooltip>
                </template>
              </a-input>
            </a-form-item>
          </a-col>
        </a-row>

        <a-row :gutter="16">
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item
              label="5G Service Area Restriction template"
              name="sar"
            >
              <a-input v-model:value="modalState.from.sar" allow-clear>
                <template #prefix>
                  <a-tooltip placement="topLeft">
                    <template #title>
                      服务区域限制模板,定义允许的区域,UE
                      在这些区域中可以和网络通信;定义不允许的区,UE
                      和网络在这些区域中,不允许发起Service Request 或 SM
                      信令来获取用户服务
                    </template>
                    <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
                  </a-tooltip>
                </template>
              </a-input>
            </a-form-item>
          </a-col>
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item label="5G RFSP Index" name="rfsp">
              <a-input value="1" allow-clear>
                <template #prefix>
                  <a-tooltip placement="topLeft">
                    <template #title>
                      RFSP 索引,在 NG-RAN中,特定RRM配置的索引,参数介于0到127之间
                    </template>
                    <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
                  </a-tooltip>
                </template>
              </a-input>
            </a-form-item>
          </a-col>
        </a-row>

        <a-row :gutter="16">
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item label="5G MICO mode" name="mico">
              <a-tooltip title="签约的MICO业务标志位">
                <a-select value="1">
                  <a-select-option value="1">Enable</a-select-option>
                  <a-select-option value="0">Disable</a-select-option>
                </a-select>
              </a-tooltip>
            </a-form-item>
          </a-col>

          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item
              label="5G Subscribed SMF Selection Data template"
              name="smfSel"
            >
              <a-input v-model:value="modalState.from.smfSel" allow-clear>
                <template #prefix>
                  <a-tooltip placement="topLeft">
                    <template #title> 参数最大长度为16 </template>
                    <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
                  </a-tooltip>
                </template>
              </a-input>
            </a-form-item>
          </a-col>
        </a-row>

        <a-row :gutter="16" v-if="!modalState.from.id">
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item
              label="Subscribed SM Data"
              name="smData"
              v-bind="modalStateFrom.validateInfos.smData"
            >
              <a-input v-model:value="modalState.from.smData" allow-clear>
                <template #prefix>
                  <a-tooltip placement="topLeft">
                    <template #title> 参数最大长度为128 </template>
                    <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
                  </a-tooltip>
                </template>
              </a-input>
            </a-form-item>
          </a-col>

          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item label="4G EPS flag" name="epsFlag">
              <a-tooltip title="是否开启4G EPS 服务,0=不开启,1=开启">
                <a-select v-model:value="modalState.from.epsFlag">
                  <a-select-option value="1">Enable</a-select-option>
                  <a-select-option value="0">Disable</a-select-option>
                </a-select>
              </a-tooltip>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="16" v-else>
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item label="Subscribed SM Data" name="smData">
              <a-input v-model:value="modalState.from.smData" allow-clear>
                <template #prefix>
                  <a-tooltip placement="topLeft">
                    <template #title> 参数最大长度为128 </template>
                    <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
                  </a-tooltip>
                </template>
              </a-input>
            </a-form-item>
          </a-col>

          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item label="4G EPS flag" name="epsFlag">
              <a-tooltip title="是否开启4G EPS 服务,0=不开启,1=开启">
                <a-select v-model:value="modalState.from.epsFlag">
                  <a-select-option value="1">Enable</a-select-option>
                  <a-select-option value="0">Disable</a-select-option>
                </a-select>
              </a-tooltip>
            </a-form-item>
          </a-col>
        </a-row>
        <a-form-item
          label="4G EPS ODB"
          name="epsOdb"
          v-bind="modalStateFrom.validateInfos.epsOdb"
        >
          <a-tooltip
            title="ODB(Operator-Determined Barring)运营商决定的闭锁,即用户接入EPS网络的业务能力由运营商决定.选中 ---对应服务被允许 未选 --- 对应服务被禁止"
          >
            <a-select
              v-model:value="modalState.from.epsOdb"
              mode="multiple"
              style="width: 100%"
              placeholder="Please select"
              :options="modalStateFromOption.odbJson"
              @change=""
            >
            </a-select>
          </a-tooltip>
        </a-form-item>

        <a-form-item label="4G HPLMN odb" name="hplmnOdb">
          <a-tooltip
            title="HPLMN-ODB
                归属运营商决定的闭锁,即用户接入EPS网络的业务能力由用户归宿运营商决定.选中 --- 对应服务被允许 未选 -- 对应服务被禁止"
          >
            <a-select
              v-model:value="modalState.from.hplmnOdb"
              mode="multiple"
              style="width: 100%"
              placeholder="Please select"
              :options="modalStateFromOption.hplmnOdb"
              @change=""
            >
            </a-select>
          </a-tooltip>
        </a-form-item>

        <a-form-item label="4G Access Restriction Data" name="ard">
          <a-tooltip
            title="接入控制标志(Access-Restriction-Data),可用于区分2G/3G/LTE用户,便于为2G/3G/LTE网络共存时,对不同类型用户进行区分服务"
          >
            <a-select
              v-model:value="modalState.from.ard"
              mode="multiple"
              style="width: 100%"
              placeholder="Please select"
              :options="modalStateFromOption.ardJson"
              @change=""
            >
              <template #suffixIcon>
                <a-tooltip placement="topLeft">
                  <template #title>
                    指定手机用户上网时使用的静态IP地址,为空时表示使用动态IP地址
                  </template>
                  <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
                </a-tooltip>
              </template>
            </a-select>
          </a-tooltip>
        </a-form-item>

        <a-row :gutter="16">
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item
              label="4G EPS User Template Name"
              name="epstpl"
              v-bind="modalStateFrom.validateInfos.epstpl"
            >
              <a-tooltip title="参数最大长度为16">
                <a-input
                  v-model:value="modalState.from.epstpl"
                  allow-clear
                  placeholder="请输入4G EPS User Template Name"
                >
                </a-input>
              </a-tooltip>
            </a-form-item>
          </a-col>
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item
              label="4G Context ID"
              name="contextId"
              v-bind="modalStateFrom.validateInfos.contextId"
            >
              <a-tooltip title="签约APN 上下文ID,必须从APN Context list 中选择">
                <a-input
                  v-model:value="modalState.from.contextId"
                  allow-clear
                  placeholder="请输入4G Context ID"
                >
                </a-input>
              </a-tooltip>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="16">
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item
              label="4G Static IP"
              name="staticIp"
              v-bind="modalStateFrom.validateInfos.staticIp"
            >
              <a-input
                v-model:value="modalState.from.staticIp"
                allow-clear
                placeholder="静态IP地址"
              >
                <template #prefix>
                  <a-tooltip placement="topLeft">
                    <template #title>
                      指定手机用户上网时使用的静态IP地址,为空时表示使用动态IP地址
                    </template>
                    <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
                  </a-tooltip>
                </template>
              </a-input>
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-modal>

    <!-- 批量增加框 -->
    <a-modal
      width="1000px"
      :keyboard="false"
      :mask-closable="false"
      :visible="modalState.visibleByBatch"
      :title="modalState.title"
      :confirm-loading="modalState.confirmLoading"
      @ok="fnBatchModalOk"
      @cancel="fnBatchModalCancel"
    >
      <a-form
        name="modalStateBatchFrom"
        layout="horizontal"
        :label-col="{ span: 7.5 }"
        :labelWrap="true"
      >
        <a-row :gutter="16">
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item
              :label="t('views.neUser.auth.num')"
              name="num"
              v-bind="modalStateBatchFrom.validateInfos.num"
            >
              <a-input
                v-model:value="modalState.BatchForm.num"
                allow-clear
                placeholder="请输入放号数"
              ></a-input>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="16">
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item
              label="IMSI"
              name="imsi"
              v-bind="modalStateBatchFrom.validateInfos.imsi"
            >
              <a-input
                v-model:value="modalState.BatchForm.imsi"
                allow-clear
                placeholder="请输入IMSI"
              >
                <template #prefix>
                  <a-tooltip placement="topLeft">
                    <template #title>
                      SUPI=MCC+MNC+MSIN MCC=移动国家号码, 由三位数字组成
                      MNC=移动网络号，由两位数字组成
                      MSIN=移动客户识别码,采用等长10位数字构成
                    </template>
                    <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
                  </a-tooltip>
                </template>
              </a-input>
            </a-form-item>
          </a-col>
          <!-- <a-col :lg="12" :md="12" :xs="24">
            <a-form-item
              label="cn"
              name="cn"
              v-bind="modalStateBatchFrom.validateInfos.cn"
            >
              <a-input
                v-model:value="modalState.from.cn"
                allow-clear
                placeholder="请输入cn"
              ></a-input>
            </a-form-item>
          </a-col> -->
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item
              label="MSISDN"
              name="msisdn"
              v-bind="modalStateBatchFrom.validateInfos.msisdn"
            >
              <a-input
                v-model:value="modalState.BatchForm.msisdn"
                allow-clear
                placeholder="请输入msisdn"
              >
                <template #prefix>
                  <a-tooltip placement="topLeft">
                    <template #title> 参数最大长度32 </template>
                    <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
                  </a-tooltip>
                </template>
              </a-input>
            </a-form-item>
          </a-col>
        </a-row>

        <a-row :gutter="16">
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item label="5G Subscribed UE AMBR template" name="ambr">
              <a-input v-model:value="modalState.BatchForm.ambr" allow-clear>
              </a-input>
            </a-form-item>
          </a-col>
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item
              label="5G Subscribed SNSSAIs template"
              name="nssai"
              v-bind="modalStateBatchFrom.validateInfos.nssai"
            >
              <a-input v-model:value="modalState.BatchForm.nssai" allow-clear>
              </a-input>
            </a-form-item>
          </a-col>
        </a-row>

        <a-row :gutter="16">
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item label="5G UE Usage Type" name="ueType">
              <a-input value="1" allow-clear> </a-input>
            </a-form-item>
          </a-col>
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item label="5G Forbidden Areas template" name="arfb">
              <a-input v-model:value="modalState.BatchForm.arfb" allow-clear>
                <template #prefix>
                  <a-tooltip placement="topLeft">
                    <template #title>
                      限制区域模板,在模板指定的限制区域中,UE 不允许与网络通信
                    </template>
                    <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
                  </a-tooltip>
                </template>
              </a-input>
            </a-form-item>
          </a-col>
        </a-row>

        <a-row :gutter="16">
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item
              label="5G Service Area Restriction template"
              name="sar"
            >
              <a-input v-model:value="modalState.BatchForm.sar" allow-clear>
                <template #prefix>
                  <a-tooltip placement="topLeft">
                    <template #title>
                      服务区域限制模板,定义允许的区域,UE
                      在这些区域中可以和网络通信;定义不允许的区,UE
                      和网络在这些区域中,不允许发起Service Request 或 SM
                      信令来获取用户服务
                    </template>
                    <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
                  </a-tooltip>
                </template>
              </a-input>
            </a-form-item>
          </a-col>
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item label="5G RFSP Index" name="rfsp">
              <a-input value="1" allow-clear>
                <template #prefix>
                  <a-tooltip placement="topLeft">
                    <template #title>
                      RFSP 索引,在 NG-RAN中,特定RRM配置的索引,参数介于0到127之间
                    </template>
                    <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
                  </a-tooltip>
                </template>
              </a-input>
            </a-form-item>
          </a-col>
        </a-row>

        <a-row :gutter="16">
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item label="5G MICO mode" name="mico">
              <a-tooltip title="签约的MICO业务标志位">
                <a-select value="1">
                  <a-select-option value="1">Enable</a-select-option>
                  <a-select-option value="0">Disable</a-select-option>
                </a-select>
              </a-tooltip>
            </a-form-item>
          </a-col>

          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item
              label="5G Subscribed SMF Selection Data template"
              name="smfSel"
            >
              <a-input v-model:value="modalState.BatchForm.smfSel" allow-clear>
                <template #prefix>
                  <a-tooltip placement="topLeft">
                    <template #title> 参数最大长度为16 </template>
                    <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
                  </a-tooltip>
                </template>
              </a-input>
            </a-form-item>
          </a-col>
        </a-row>

        <a-row :gutter="16">
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item
              label="Subscribed SM Data"
              name="smData"
              v-bind="modalStateBatchFrom.validateInfos.smData"
            >
              <a-input v-model:value="modalState.BatchForm.smData" allow-clear>
                <template #prefix>
                  <a-tooltip placement="topLeft">
                    <template #title> 参数最大长度为128 </template>
                    <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
                  </a-tooltip>
                </template>
              </a-input>
            </a-form-item>
          </a-col>

          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item label="4G EPS flag" name="epsFlag">
              <a-tooltip title="是否开启4G EPS 服务,0=不开启,1=开启">
                <a-select v-model:value="modalState.BatchForm.epsFlag">
                  <a-select-option value="1">Enable</a-select-option>
                  <a-select-option value="0">Disable</a-select-option>
                </a-select>
              </a-tooltip>
            </a-form-item>
          </a-col>
        </a-row>

        <a-form-item label="4G EPS ODB" name="epsOdb">
          <a-tooltip
            title="ODB(Operator-Determined Barring)运营商决定的闭锁,即用户接入EPS网络的业务能力由运营商决定.选中 ---对应服务被允许 未选 --- 对应服务被禁止"
          >
            <a-select
              v-model:value="modalState.BatchForm.epsOdb"
              mode="multiple"
              style="width: 100%"
              placeholder="Please select"
              :options="modalStateFromOption.odbJson"
              @change=""
            >
            </a-select>
          </a-tooltip>
        </a-form-item>

        <a-form-item label="4G HPLMN odb" name="hplmnOdb">
          <a-tooltip
            title="HPLMN-ODB
                归属运营商决定的闭锁,即用户接入EPS网络的业务能力由用户归宿运营商决定.选中 --- 对应服务被允许 未选 -- 对应服务被禁止"
          >
            <a-select
              v-model:value="modalState.BatchForm.hplmnOdb"
              mode="multiple"
              style="width: 100%"
              placeholder="Please select"
              :options="modalStateFromOption.hplmnOdb"
              @change=""
            >
            </a-select>
          </a-tooltip>
        </a-form-item>

        <a-form-item label="4G Access Restriction Data" name="ard">
          <a-tooltip
            title="接入控制标志(Access-Restriction-Data),可用于区分2G/3G/LTE用户,便于为2G/3G/LTE网络共存时,对不同类型用户进行区分服务"
          >
            <a-select
              v-model:value="modalState.BatchForm.ard"
              mode="multiple"
              style="width: 100%"
              placeholder="Please select"
              :options="modalStateFromOption.ardJson"
              @change=""
            >
              <template #suffixIcon>
                <a-tooltip placement="topLeft">
                  <template #title>
                    指定手机用户上网时使用的静态IP地址,为空时表示使用动态IP地址
                  </template>
                  <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
                </a-tooltip>
              </template>
            </a-select>
          </a-tooltip>
        </a-form-item>

        <a-row :gutter="16">
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item label="4G EPS User Template Name" name="epstpl">
              <a-tooltip title="参数最大长度为16">
                <a-input
                  v-model:value="modalState.BatchForm.epstpl"
                  allow-clear
                  placeholder="请输入4G EPS User Template Name"
                >
                </a-input>
              </a-tooltip>
            </a-form-item>
          </a-col>
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item label="4G Context ID" name="contextId">
              <a-tooltip title="签约APN 上下文ID,必须从APN Context list 中选择">
                <a-input
                  v-model:value="modalState.BatchForm.contextId"
                  allow-clear
                  placeholder="请输入4G Context ID"
                >
                </a-input>
              </a-tooltip>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="16">
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item label="4G Static IP" name="staticIp">
              <a-input
                v-model:value="modalState.BatchForm.staticIp"
                allow-clear
                placeholder="静态IP地址"
              >
                <template #prefix>
                  <a-tooltip placement="topLeft">
                    <template #title>
                      指定手机用户上网时使用的静态IP地址,为空时表示使用动态IP地址
                    </template>
                    <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
                  </a-tooltip>
                </template>
              </a-input>
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-modal>

    <!-- 批量删除框 -->
    <a-modal
      width="1000px"
      :keyboard="false"
      :mask-closable="false"
      :visible="modalState.visibleByBatchDel"
      :title="modalState.title"
      :confirm-loading="modalState.confirmLoading"
      @ok="fnBatchDelModalOk"
      @cancel="fnBatchDelModalCancel"
    >
      <a-form
        name="modalStateBatchDelFrom"
        layout="horizontal"
        :label-col="{ span: 7.5 }"
        :labelWrap="true"
      >
        <a-row :gutter="16">
          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item
              :label="t('views.neUser.sub.num')"
              name="num"
              v-bind="modalStateBatchDelFrom.validateInfos.num"
            >
              <a-input
                v-model:value="modalState.BatchDelForm.num"
                allow-clear
                placeholder="请输入放号数"
              ></a-input>
            </a-form-item>
          </a-col>

          <a-col :lg="12" :md="12" :xs="24">
            <a-form-item
              :label="t('views.neUser.sub.startIMSI')"
              name="imsi"
              v-bind="modalStateBatchDelFrom.validateInfos.imsi"
            >
              <a-input
                v-model:value="modalState.BatchDelForm.imsi"
                allow-clear
                placeholder="请输入IMSI"
              >
                <template #prefix>
                  <a-tooltip placement="topLeft">
                    <template #title>
                      SUPI=MCC+MNC+MSIN MCC=移动国家号码, 由三位数字组成
                      MNC=移动网络号，由两位数字组成
                      MSIN=移动客户识别码,采用等长10位数字构成
                    </template>
                    <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
                  </a-tooltip>
                </template>
              </a-input>
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-modal>

    <!-- 上传导入表格数据文件框 -->
    <UploadModal
      :title="uploadImportState.title"
      :loading="uploadImportState.loading"
      @upload="fnModalUploadImportUpload"
      @close="fnModalUploadImportClose"
      v-model:visible="uploadImportState.visible"
      :ext="['.csv', '.txt']"
    >
      <template #default>
        <a-textarea
          :disabled="true"
          :hidden="!uploadImportState.msg"
          :value="uploadImportState.msg"
          :auto-size="{ minRows: 2, maxRows: 8 }"
        />
      </template>
    </UploadModal>
  </PageContainer>
</template>

<style lang="less" scoped>
.table :deep(.ant-pagination) {
  padding: 0 24px;
}
</style>
