fix: 导出带取消操作按钮

This commit is contained in:
TsMask
2024-10-28 10:53:48 +08:00
parent 3c058ec107
commit c735aeba6d
2 changed files with 95 additions and 105 deletions

View File

@@ -1,10 +1,11 @@
<script setup lang="ts">
import { reactive, ref, onMounted, toRaw } from 'vue';
import { PageContainer } from 'antdv-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 { ProModal } from 'antdv-pro-modal';
import { message, Modal, Form, notification } from 'ant-design-vue/es';
import { SizeType } from 'ant-design-vue/es/config-provider';
import { MenuInfo } from 'ant-design-vue/es/menu/src/interface';
import { ColumnsType } from 'ant-design-vue/es/table';
import UploadModal from '@/components/UploadModal/index.vue';
import TableColumnsDnd from '@/components/TableColumnsDnd/index.vue';
import useNeInfoStore from '@/store/modules/neinfo';
@@ -184,11 +185,11 @@ function fnTableSelectedRowKeys(keys: (string | number)[]) {
/**对话框对象信息状态类型 */
type ModalStateType = {
/**新增框或修改框是否显示 */
visibleByEdit: boolean;
openByEdit: boolean;
/**批量新增新增框是否显示 */
visibleByBatch: boolean;
openByBatch: boolean;
/**批量新增删除框是否显示 */
visibleByBatchDel: boolean;
openByBatchDel: boolean;
/**标题 */
title: string;
/**表单数据 */
@@ -203,9 +204,9 @@ type ModalStateType = {
/**对话框对象信息状态 */
let modalState: ModalStateType = reactive({
visibleByEdit: false,
visibleByBatch: false,
visibleByBatchDel: false,
openByEdit: false,
openByBatch: false,
openByBatchDel: false,
title: 'UDM鉴权用户',
from: {
num: 1,
@@ -271,7 +272,7 @@ function fnModalVisibleByEdit(row?: Record<string, any>) {
if (!row) {
modalStateFrom.resetFields(); //重置表单
modalState.title = t('common.addText') + t('views.neUser.auth.authInfo');
modalState.visibleByEdit = true;
modalState.openByEdit = true;
} else {
if (modalState.confirmLoading) return;
const hide = message.loading(t('common.loading'), 0);
@@ -283,7 +284,7 @@ function fnModalVisibleByEdit(row?: Record<string, any>) {
modalState.from = Object.assign(modalState.from, res.data);
modalState.title =
t('common.editText') + t('views.neUser.auth.authInfo');
modalState.visibleByEdit = true;
modalState.openByEdit = true;
} else {
message.error(t('common.getInfoFail'), 2);
}
@@ -303,7 +304,7 @@ function fnModalVisibleByBatch() {
modalStateBatchDelFrom.resetFields(); //重置表单
modalState.title =
t('views.neUser.auth.batchDelText') + t('views.neUser.auth.authInfo');
modalState.visibleByBatchDel = true;
modalState.openByBatchDel = true;
}
/**
@@ -349,7 +350,7 @@ function fnModalOk() {
fnGetList(1);
}, timerS * 1000);
}
modalState.visibleByEdit = false;
modalState.openByEdit = false;
modalStateFrom.resetFields();
} else {
if (from.num === 1) {
@@ -396,7 +397,7 @@ function fnBatchDelModalOk() {
duration: timerS,
});
setTimeout(() => {
modalState.visibleByBatchDel = false;
modalState.openByBatchDel = false;
modalState.confirmLoading = false;
modalStateBatchDelFrom.resetFields();
fnGetList(1);
@@ -421,7 +422,7 @@ function fnBatchDelModalOk() {
* 进行表达规则校验
*/
function fnBatchDelModalCancel() {
modalState.visibleByBatchDel = false;
modalState.openByBatchDel = false;
modalStateBatchDelFrom.resetFields();
}
@@ -430,7 +431,7 @@ function fnBatchDelModalCancel() {
* 进行表达规则校验
*/
function fnModalCancel() {
modalState.visibleByEdit = false;
modalState.openByEdit = false;
modalStateFrom.resetFields();
}
@@ -598,7 +599,7 @@ function fnGetList(pageNum?: number) {
/**对话框表格信息导入对象信息状态类型 */
type ModalUploadImportStateType = {
/**是否显示 */
visible: boolean;
open: boolean;
/**标题 */
title: string;
/**是否上传中 */
@@ -613,7 +614,7 @@ type ModalUploadImportStateType = {
/**对话框表格信息导入对象信息状态 */
let uploadImportState: ModalUploadImportStateType = reactive({
visible: false,
open: false,
title: t('components.UploadModal.uploadTitle'),
loading: false,
msg: '',
@@ -639,12 +640,12 @@ function fnModalUploadImportOpen() {
uploadImportState.from.typeVal = 'default';
uploadImportState.from.typeData = undefined;
uploadImportState.loading = false;
uploadImportState.visible = true;
uploadImportState.open = true;
}
/**对话框表格信息导入关闭窗口 */
function fnModalUploadImportClose() {
uploadImportState.visible = false;
uploadImportState.open = false;
fnGetList(1);
}
@@ -776,7 +777,7 @@ onMounted(() => {
<a-card :bordered="false" :body-style="{ padding: '0px' }">
<!-- 插槽-卡片左侧侧 -->
<template #title>
<div class="button-container">
<a-flex wrap="wrap" gap="small">
<a-button type="primary" @click.prevent="fnModalVisibleByEdit()">
<template #icon>
<PlusOutlined />
@@ -825,9 +826,6 @@ onMounted(() => {
ok-text="TXT"
ok-type="default"
@confirm="fnExportList('txt')"
:show-cancel="false"
cancel-text="CSV"
@cancel="fnExportList('csv')"
>
<a-button type="dashed">
<template #icon><ExportOutlined /></template>
@@ -852,9 +850,6 @@ onMounted(() => {
ok-text="TXT"
ok-type="default"
@confirm="fnRecordExport('txt')"
:show-cancel="false"
cancel-text="CSV"
@cancel="fnRecordExport('csv')"
:disabled="tableState.selectedRowKeys.length <= 0"
>
<a-button
@@ -865,12 +860,12 @@ onMounted(() => {
{{ t('views.neUser.auth.checkExport') }}
</a-button>
</a-popconfirm>
</div>
</a-flex>
</template>
<!-- 插槽-卡片右侧 -->
<template #extra>
<div class="button-container">
<a-space :size="8" align="center">
<a-tooltip>
<template #title>{{ t('common.searchBarText') }}</template>
<a-switch
@@ -915,7 +910,7 @@ onMounted(() => {
</template>
</a-dropdown>
</a-tooltip>
</div>
</a-space>
</template>
<!-- 表格列表 -->
@@ -974,7 +969,7 @@ onMounted(() => {
:destroyOnClose="true"
:keyboard="false"
:mask-closable="false"
:visible="modalState.visibleByEdit"
:open="modalState.openByEdit"
:title="modalState.title"
:confirm-loading="modalState.confirmLoading"
@ok="fnModalOk"
@@ -986,7 +981,7 @@ onMounted(() => {
:label-col="{ span: 6 }"
:labelWrap="true"
>
<a-row :gutter="16">
<a-row>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.neUser.auth.numAdd')"
@@ -1004,7 +999,7 @@ onMounted(() => {
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="16">
<a-row>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
label="IMSI"
@@ -1025,7 +1020,7 @@ onMounted(() => {
{{ t('views.neUser.auth.imsiTip2') }}<br />
{{ t('views.neUser.auth.imsiTip3') }}
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip>
</template>
</a-input>
@@ -1041,7 +1036,7 @@ onMounted(() => {
</a-col>
</a-row>
<a-row :gutter="16">
<a-row>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
label="AMF"
@@ -1058,7 +1053,7 @@ onMounted(() => {
<template #title>
{{ t('views.neUser.auth.amfTip') }}
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip>
</template>
</a-input>
@@ -1082,7 +1077,7 @@ onMounted(() => {
<template #title>
{{ t('views.neUser.auth.algoIndexTip') }}
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip>
</template>
</a-input-number>
@@ -1108,7 +1103,7 @@ onMounted(() => {
<template #title>
{{ t('views.neUser.auth.kiTip') }}
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip>
</template>
</a-input>
@@ -1131,7 +1126,7 @@ onMounted(() => {
<template #title>
{{ t('views.neUser.auth.opcTip') }}
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip>
</template>
</a-input>
@@ -1145,7 +1140,7 @@ onMounted(() => {
:destroyOnClose="true"
:keyboard="false"
:mask-closable="false"
:visible="modalState.visibleByBatchDel"
:open="modalState.openByBatchDel"
:title="modalState.title"
:confirm-loading="modalState.confirmLoading"
@ok="fnBatchDelModalOk"
@@ -1157,7 +1152,7 @@ onMounted(() => {
:label-col="{ span: 6 }"
:labelWrap="true"
>
<a-row :gutter="16">
<a-row>
<a-col :lg="24" :md="24" :xs="24">
<a-form-item
:label="t('views.neUser.auth.startIMSI')"
@@ -1177,7 +1172,7 @@ onMounted(() => {
{{ t('views.neUser.auth.imsiTip2') }}<br />
{{ t('views.neUser.auth.imsiTip3') }}
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
<InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip>
</template>
</a-input>
@@ -1208,7 +1203,7 @@ onMounted(() => {
:loading="uploadImportState.loading"
@upload="fnModalUploadImportUpload"
@close="fnModalUploadImportClose"
v-model:visible="uploadImportState.visible"
v-model:open="uploadImportState.open"
:ext="['.txt']"
:size="10"
>