ref: v3变更,,完成整合,同步v2.2508.4 -250902
This commit is contained in:
@@ -20,6 +20,7 @@ import { getPCFRule } from '@/api/ne/neConfig';
|
||||
import { uploadFileToNE } from '@/api/tool/file';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { saveAs } from 'file-saver';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const { t } = useI18n();
|
||||
const neStore = useNeStore();
|
||||
/**网元参数 */
|
||||
@@ -36,8 +37,10 @@ const pcfRuleOption = ref<Record<string, any[]>>({
|
||||
|
||||
/**查询参数 */
|
||||
let queryParams = reactive({
|
||||
/**网元ID */
|
||||
neId: undefined,
|
||||
/**核心网标识 */
|
||||
coreUid: currentCoreUid(),
|
||||
/**网元标识 */
|
||||
neUid: undefined,
|
||||
/**移动编号 */
|
||||
imsi: '',
|
||||
/**号码 */
|
||||
@@ -279,7 +282,9 @@ const modalStateFrom = Form.useForm(
|
||||
* @param noticeId 网元id, 不传为新增
|
||||
*/
|
||||
function fnModalVisibleByEdit(row?: Record<string, any>) {
|
||||
getPCFRule(queryParams.neId)
|
||||
const neUid = queryParams.neUid || '-';
|
||||
const coreUid = queryParams.coreUid || '-';
|
||||
getPCFRule(coreUid, neUid)
|
||||
.then((data: any) => {
|
||||
pcfRuleOption.value = data;
|
||||
})
|
||||
@@ -330,7 +335,8 @@ function fnModalVisibleByEdit(row?: Record<string, any>) {
|
||||
*/
|
||||
function fnModalOk() {
|
||||
const from = JSON.parse(JSON.stringify(modalState.from));
|
||||
const neId = queryParams.neId || '-';
|
||||
const neUid = queryParams.neUid || '-';
|
||||
const coreUid = queryParams.coreUid || '-';
|
||||
from.rfsp = Number(from.rfsp) || 0;
|
||||
// 处理多选框数据
|
||||
let pccRules = modalState.from.pccRules;
|
||||
@@ -369,21 +375,24 @@ function fnModalOk() {
|
||||
if (modalState.isBatch) {
|
||||
if (modalState.type === 'add') {
|
||||
result = addPCFRule({
|
||||
neId: neId,
|
||||
coreUid: coreUid,
|
||||
neUid: neUid,
|
||||
num: from.num,
|
||||
paramData: from,
|
||||
});
|
||||
}
|
||||
if (modalState.type === 'update') {
|
||||
result = editPCFRule({
|
||||
neId: neId,
|
||||
coreUid: coreUid,
|
||||
neUid: neUid,
|
||||
num: from.num,
|
||||
paramData: from,
|
||||
});
|
||||
}
|
||||
if (modalState.type === 'delete') {
|
||||
result = delPCFRule({
|
||||
neId: neId,
|
||||
coreUid: coreUid,
|
||||
neUid: neUid,
|
||||
num: from.num,
|
||||
imsi: from.imsi,
|
||||
});
|
||||
@@ -391,14 +400,16 @@ function fnModalOk() {
|
||||
} else {
|
||||
if (modalState.type === 'add') {
|
||||
result = addPCFRule({
|
||||
neId: neId,
|
||||
coreUid: coreUid,
|
||||
neUid: neUid,
|
||||
num: 0,
|
||||
paramData: from,
|
||||
});
|
||||
}
|
||||
if (modalState.type === 'update') {
|
||||
result = editPCFRule({
|
||||
neId: neId,
|
||||
coreUid: coreUid,
|
||||
neUid: neUid,
|
||||
num: 0,
|
||||
paramData: from,
|
||||
});
|
||||
@@ -465,7 +476,9 @@ function fnModalCancel() {
|
||||
* @param type 类型
|
||||
*/
|
||||
function fnModalVisibleByBatch(type: 'delete' | 'add' | 'update') {
|
||||
getPCFRule(queryParams.neId)
|
||||
const neUid = queryParams.neUid || '-';
|
||||
const coreUid = queryParams.coreUid || '-';
|
||||
getPCFRule(coreUid, neUid)
|
||||
.then((data: any) => {
|
||||
pcfRuleOption.value = data;
|
||||
console.log(data);
|
||||
@@ -495,8 +508,9 @@ function fnModalVisibleByBatch(type: 'delete' | 'add' | 'update') {
|
||||
* @param imsi 网元编号ID
|
||||
*/
|
||||
function fnRecordDelete(imsi: string) {
|
||||
const neId = queryParams.neId;
|
||||
if (!neId) return;
|
||||
const neUid = queryParams.neUid || '-';
|
||||
const coreUid = queryParams.coreUid || '-';
|
||||
if (!coreUid || !neUid) return;
|
||||
let imsiMsg = imsi;
|
||||
if (imsi === '0') {
|
||||
imsiMsg = `${tableState.selectedRowKeys[0]}... ${tableState.selectedRowKeys.length}`;
|
||||
@@ -509,7 +523,8 @@ function fnRecordDelete(imsi: string) {
|
||||
onOk() {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
delPCFRule({
|
||||
neId: neId,
|
||||
coreUid: coreUid,
|
||||
neUid: neUid,
|
||||
imsi: imsi,
|
||||
})
|
||||
.then(res => {
|
||||
@@ -535,11 +550,13 @@ function fnRecordDelete(imsi: string) {
|
||||
|
||||
/**列表导出 */
|
||||
function fnExportList(type: string) {
|
||||
const neId = queryParams.neId;
|
||||
if (!neId) return;
|
||||
const neUid = queryParams.neUid || '-';
|
||||
const coreUid = queryParams.coreUid || '-';
|
||||
if (!coreUid || !neUid) return;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
exportPCFRule({
|
||||
neId: neId,
|
||||
coreUid: coreUid,
|
||||
neUid: neUid,
|
||||
fileType: type,
|
||||
})
|
||||
.then(res => {
|
||||
@@ -548,7 +565,7 @@ function fnExportList(type: string) {
|
||||
content: t('common.msgSuccess', { msg: t('common.export') }),
|
||||
duration: 3,
|
||||
});
|
||||
saveAs(res.data, `PCFRlue_${neId}_${Date.now()}.${type}`);
|
||||
saveAs(res.data, `PCFRlue_${neUid}_${Date.now()}.${type}`);
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
@@ -622,14 +639,15 @@ function fnModalUploadImportClose() {
|
||||
|
||||
/**对话框表格信息导入上传 */
|
||||
function fnModalUploadImportUpload(file: File) {
|
||||
const neId = queryParams.neId;
|
||||
if (!neId) {
|
||||
const neUid = queryParams.neUid || '-';
|
||||
const coreUid = queryParams.coreUid || '-';
|
||||
if (!neUid || !coreUid) {
|
||||
return Promise.reject('Unknown network element');
|
||||
}
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
uploadImportState.loading = true;
|
||||
// 上传文件
|
||||
uploadFileToNE('PCF', neId, file, 3)
|
||||
uploadFileToNE('PCF', neUid, coreUid, file, 3)
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
return res.data;
|
||||
@@ -643,7 +661,8 @@ function fnModalUploadImportUpload(file: File) {
|
||||
if (!filePath) return;
|
||||
// 文件导入
|
||||
return importPCFRule({
|
||||
neId: neId,
|
||||
neUid: neUid,
|
||||
coreUid: coreUid,
|
||||
fileType: 'txt',
|
||||
filePath: filePath,
|
||||
});
|
||||
@@ -706,7 +725,7 @@ onMounted(() => {
|
||||
return;
|
||||
}
|
||||
if (neOtions.value.length > 0) {
|
||||
queryParams.neId = neOtions.value[0].value;
|
||||
queryParams.neUid = neOtions.value[0].value;
|
||||
}
|
||||
|
||||
// 获取列表数据
|
||||
@@ -725,9 +744,9 @@ onMounted(() => {
|
||||
<a-form :model="queryParams" name="queryParams" layout="horizontal">
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item label="PCF" name="neId ">
|
||||
<a-form-item label="PCF" name="neUid ">
|
||||
<a-select
|
||||
v-model:value="queryParams.neId"
|
||||
v-model:value="queryParams.neUid"
|
||||
:options="neOtions"
|
||||
:placeholder="t('common.selectPlease')"
|
||||
@change="fnGetList(1)"
|
||||
|
||||
Reference in New Issue
Block a user