新增批量删除接口
This commit is contained in:
@@ -98,9 +98,9 @@ export function addAuth(data: Record<string, any>) {
|
|||||||
* @param data 鉴权对象
|
* @param data 鉴权对象
|
||||||
* @returns object
|
* @returns object
|
||||||
*/
|
*/
|
||||||
export function batchAuth(neID: string, data: Record<string, any>) {
|
export function batchAuth( data: Record<string, any>) {
|
||||||
return request({
|
return request({
|
||||||
url: `/udmUserManage/v1/auth/${neID}/${data.num}`,
|
url: `/udmUserManage/v1/auth/${data.neID}/${data.num}`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
});
|
});
|
||||||
@@ -117,3 +117,17 @@ export function delAuth(neId: string, data: Record<string, any>) {
|
|||||||
method: 'delete',
|
method: 'delete',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除鉴权
|
||||||
|
* @param data 鉴权对象
|
||||||
|
* @returns object
|
||||||
|
*/
|
||||||
|
export function batchDelAuth(neId:string,data: Record<string, any>) {
|
||||||
|
return request({
|
||||||
|
url: `/udmUserManage/v1/auth/${neId}/${data.imsi}/${data.num}`,
|
||||||
|
method: 'delete',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -128,12 +128,13 @@ export default {
|
|||||||
loadData: "LoadData",
|
loadData: "LoadData",
|
||||||
num:'Number allocation',
|
num:'Number allocation',
|
||||||
batchAddText: 'Batch Add',
|
batchAddText: 'Batch Add',
|
||||||
|
batchDelText: 'Batch Del',
|
||||||
},
|
},
|
||||||
sub:{
|
sub:{
|
||||||
export: 'Export',
|
export: 'Export',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
loadData: "LoadData"
|
loadData: "LoadData"
|
||||||
},
|
},
|
||||||
base5G: {
|
base5G: {
|
||||||
neTypePlease: 'Query network element type',
|
neTypePlease: 'Query network element type',
|
||||||
neType: 'AMF Type',
|
neType: 'AMF Type',
|
||||||
|
|||||||
@@ -128,12 +128,13 @@ export default {
|
|||||||
loadData: "更新数据",
|
loadData: "更新数据",
|
||||||
num:'放号数',
|
num:'放号数',
|
||||||
batchAddText: '批量新增',
|
batchAddText: '批量新增',
|
||||||
|
batchDelText: '批量删除',
|
||||||
},
|
},
|
||||||
sub:{
|
sub:{
|
||||||
export: '导出',
|
export: '导出',
|
||||||
import: '导入',
|
import: '导入',
|
||||||
loadData: "更新数据"
|
loadData: "更新数据"
|
||||||
},
|
},
|
||||||
base5G: {
|
base5G: {
|
||||||
neTypePlease: '查询网元类型',
|
neTypePlease: '查询网元类型',
|
||||||
neType: 'AMF网元类型',
|
neType: 'AMF网元类型',
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import useNeInfoStore from '@/store/modules/neinfo';
|
|||||||
import useI18n from '@/hooks/useI18n';
|
import useI18n from '@/hooks/useI18n';
|
||||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||||
import { saveAs } from 'file-saver';
|
import { saveAs } from 'file-saver';
|
||||||
|
import { formItemProps } from 'ant-design-vue/lib/form';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
@@ -161,12 +162,16 @@ type ModalStateType = {
|
|||||||
visibleByEdit: boolean;
|
visibleByEdit: boolean;
|
||||||
/**批量新增新增框是否显示 */
|
/**批量新增新增框是否显示 */
|
||||||
visibleByBatch: boolean;
|
visibleByBatch: boolean;
|
||||||
|
/**批量新增删除框是否显示 */
|
||||||
|
visibleByBatchDel: boolean;
|
||||||
/**标题 */
|
/**标题 */
|
||||||
title: string;
|
title: string;
|
||||||
/**表单数据 */
|
/**表单数据 */
|
||||||
from: Record<string, any>;
|
from: Record<string, any>;
|
||||||
/**表单数据 */
|
/**表单数据 */
|
||||||
BatchForm: Record<string, any>;
|
BatchForm: Record<string, any>;
|
||||||
|
/**表单数据 */
|
||||||
|
BatchDelForm: Record<string, any>;
|
||||||
/**确定按钮 loading */
|
/**确定按钮 loading */
|
||||||
confirmLoading: boolean;
|
confirmLoading: boolean;
|
||||||
/**更新加载数据按钮 loading */
|
/**更新加载数据按钮 loading */
|
||||||
@@ -178,8 +183,10 @@ let modalState: ModalStateType = reactive({
|
|||||||
visibleByView: false,
|
visibleByView: false,
|
||||||
visibleByEdit: false,
|
visibleByEdit: false,
|
||||||
visibleByBatch: false,
|
visibleByBatch: false,
|
||||||
|
visibleByBatchDel: false,
|
||||||
title: 'UDM鉴权用户',
|
title: 'UDM鉴权用户',
|
||||||
from: {
|
from: {
|
||||||
|
id:'',
|
||||||
imsi: '',
|
imsi: '',
|
||||||
amf: '',
|
amf: '',
|
||||||
ki: '',
|
ki: '',
|
||||||
@@ -194,6 +201,10 @@ let modalState: ModalStateType = reactive({
|
|||||||
algoIndex: '',
|
algoIndex: '',
|
||||||
opc: '',
|
opc: '',
|
||||||
},
|
},
|
||||||
|
BatchDelForm: {
|
||||||
|
num: '',
|
||||||
|
imsi: '',
|
||||||
|
},
|
||||||
confirmLoading: false,
|
confirmLoading: false,
|
||||||
loadDataLoading: false,
|
loadDataLoading: false,
|
||||||
});
|
});
|
||||||
@@ -210,7 +221,7 @@ const modalStateFrom = Form.useForm(
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
/**对话框内表单属性和校验规则 */
|
/**对话框内批量添加表单属性和校验规则 */
|
||||||
const modalStateBatchFrom = Form.useForm(
|
const modalStateBatchFrom = Form.useForm(
|
||||||
modalState.BatchForm,
|
modalState.BatchForm,
|
||||||
reactive({
|
reactive({
|
||||||
@@ -226,6 +237,18 @@ const modalStateBatchFrom = Form.useForm(
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/**对话框内批量删除表单属性和校验规则 */
|
||||||
|
const modalStateBatchDelFrom = Form.useForm(
|
||||||
|
modalState.BatchDelForm,
|
||||||
|
reactive({
|
||||||
|
num: [{ required: true, message: '放号数不能为空' },
|
||||||
|
{ min: 1, max: 100, message: '放号数必须小于等于100' }],
|
||||||
|
imsi: [{ required: true, message: 'IMSI不能为空' }],
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对话框弹出显示为 新增或者修改
|
* 对话框弹出显示为 新增或者修改
|
||||||
* @param noticeId 网元id, 不传为新增
|
* @param noticeId 网元id, 不传为新增
|
||||||
@@ -266,7 +289,7 @@ function fnModalVisibleByBatch(batchFlag?: number) {
|
|||||||
} else {
|
} else {
|
||||||
modalStateBatchFrom.resetFields(); //重置表单
|
modalStateBatchFrom.resetFields(); //重置表单
|
||||||
modalState.title = '批量删除鉴权信息';
|
modalState.title = '批量删除鉴权信息';
|
||||||
modalState.visibleByBatch = true;
|
modalState.visibleByBatchDel = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -313,7 +336,7 @@ function fnModalOk() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对话框弹出确认执行函数
|
* 对话框弹出 批量操作确认执行函数
|
||||||
* 进行表达规则校验
|
* 进行表达规则校验
|
||||||
*/
|
*/
|
||||||
function fnBatchModalOk() {
|
function fnBatchModalOk() {
|
||||||
@@ -324,7 +347,8 @@ function fnBatchModalOk() {
|
|||||||
const from = toRaw(modalState.BatchForm);
|
const from = toRaw(modalState.BatchForm);
|
||||||
const neID = queryParams.neId || '-';
|
const neID = queryParams.neId || '-';
|
||||||
// const result = from.id ? updateAuth(from) : addAuth(neID, from);
|
// const result = from.id ? updateAuth(from) : addAuth(neID, from);
|
||||||
const result = batchAuth(neID, from);
|
from.neID=neID;
|
||||||
|
const result = batchAuth(from);
|
||||||
const hide = message.loading({ content: t('common.loading') });
|
const hide = message.loading({ content: t('common.loading') });
|
||||||
result
|
result
|
||||||
.then(res => {
|
.then(res => {
|
||||||
@@ -608,7 +632,12 @@ onMounted(() => {
|
|||||||
</template>
|
</template>
|
||||||
{{ t('views.neUser.auth.batchAddText') }}
|
{{ t('views.neUser.auth.batchAddText') }}
|
||||||
</a-button>
|
</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
|
<a-popconfirm
|
||||||
title="确认要重新加载数据吗?"
|
title="确认要重新加载数据吗?"
|
||||||
ok-text="确认"
|
ok-text="确认"
|
||||||
@@ -753,7 +782,7 @@ onMounted(() => {
|
|||||||
:label-col="{ span: 7 }"
|
:label-col="{ span: 7 }"
|
||||||
>
|
>
|
||||||
<a-row :gutter="16">
|
<a-row :gutter="16">
|
||||||
<a-col :lg="12" :md="12" :xs="24">
|
<a-col :lg="12" :md="12" :xs="24"> {{ modalState.from }}
|
||||||
<a-form-item
|
<a-form-item
|
||||||
label="IMSI"
|
label="IMSI"
|
||||||
name="imsi"
|
name="imsi"
|
||||||
@@ -761,6 +790,7 @@ onMounted(() => {
|
|||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
v-model:value="modalState.from.imsi"
|
v-model:value="modalState.from.imsi"
|
||||||
|
:disabled="modalState.from.id!=''"
|
||||||
allow-clear
|
allow-clear
|
||||||
placeholder="请输入IMSI"
|
placeholder="请输入IMSI"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user