This commit is contained in:
2023-11-29 11:52:01 +08:00
10 changed files with 111 additions and 82 deletions

View File

@@ -51,15 +51,3 @@ export async function sendMMlByNE(
} }
return result; return result;
} }
/**
* 发送文件到网元端
* @returns object
*/
export function transferToNeFile(data: Record<string, any>) {
return request({
url: `/ne/action/pushFile`,
method: 'post',
data,
});
}

View File

@@ -8,6 +8,7 @@ import { parseObjLineToHump } from '@/utils/parse-utils';
* @returns object * @returns object
*/ */
export async function listgoldData(query: Record<string, any>) { export async function listgoldData(query: Record<string, any>) {
console.log(query);
let totalSQL = 'select count(*) as total from gold_kpi where 1=1 '; let totalSQL = 'select count(*) as total from gold_kpi where 1=1 ';
let rowsSQL = let rowsSQL =
'SELECT gold_kpi.*,kpi_title.en_title FROM gold_kpi LEFT JOIN kpi_title on gold_kpi.kpi_id=kpi_title.kpi_id where 1=1 '; 'SELECT gold_kpi.*,kpi_title.en_title FROM gold_kpi LEFT JOIN kpi_title on gold_kpi.kpi_id=kpi_title.kpi_id where 1=1 ';
@@ -15,17 +16,23 @@ export async function listgoldData(query: Record<string, any>) {
// 查询 // 查询
let querySQL = ''; let querySQL = '';
if (query.neType) { if (query.neType) {
querySQL += ` and ne_type like '%${query.neType}%' `; querySQL += ` and gold_kpi.ne_type like '%${query.neType}%' `;
} }
if (query.beginTime) { if (query.beginTime) {
querySQL += ` and start_time >= '${query.beginTime}' `; querySQL += ` and start_time >= '${query.beginTime}' `;
} }
if (query.endTime) { if (query.endTime) {
querySQL += ` and start_time <= '${query.endTime}' `; querySQL += ` and end_time <= '${query.endTime}' `;
} }
// 排序 // 排序
let sortSql = ' order by start_time '; let sortSql = ' order by ';
if (query.sortField) {
sortSql += ` ${query.sortField} `;
}else{
sortSql += ` start_time `;
}
if (query.sortOrder === 'asc') { if (query.sortOrder === 'asc') {
sortSql += ' asc '; sortSql += ' asc ';
} else { } else {

View File

@@ -1,4 +1,8 @@
import { RESULT_CODE_ERROR, RESULT_CODE_SUCCESS, RESULT_MSG_ERROR } from '@/constants/result-constants'; import {
RESULT_CODE_ERROR,
RESULT_CODE_SUCCESS,
RESULT_MSG_ERROR,
} from '@/constants/result-constants';
import { request, language } from '@/plugins/http-fetch'; import { request, language } from '@/plugins/http-fetch';
import { encode } from 'js-base64'; import { encode } from 'js-base64';
@@ -194,3 +198,33 @@ export function chunkUpload(data: FormData) {
dataType: 'form-data', dataType: 'form-data',
}); });
} }
/**
* 上传切片文件并发送文件到网元端
* @param neType 网元类型, UPF
* @param neId 网元标识, 001
* @param fileData 文件对象
* @param chunkSize 数据块大小MB默认1MB
* @returns
*/
export async function uploadFileToNE(
neType: string,
neId: string,
fileData: File,
chunkSize: number = 1
) {
const uploadChunkRes = await uploadFileChunk(fileData, chunkSize, 'import');
if (uploadChunkRes.code === RESULT_CODE_SUCCESS) {
const transferToNeFileRes = await request({
url: `/ne/action/pushFile`,
method: 'post',
data: {
uploadPath: uploadChunkRes.data.fileName,
neType,
neId,
},
});
return transferToNeFileRes;
}
return uploadChunkRes;
}

View File

@@ -1319,5 +1319,12 @@ export default {
noChange: "No change in interface settings", noChange: "No change in interface settings",
}, },
}, },
tool: {
help: {
download: "Download",
pdfViewer: "In-browser preview",
pdfViewerErr: "Sorry, your browser does not support PDF preview!",
}
},
}, },
}; };

View File

@@ -495,7 +495,6 @@ export default {
}, },
sub: { sub: {
subInfo:'签约信息', subInfo:'签约信息',
neTypePlease: '查询网元类型',
neType: 'UDM网元类型', neType: 'UDM网元类型',
export: '导出', export: '导出',
exportConfirm: '确认导出全部签约用户数据吗?', exportConfirm: '确认导出全部签约用户数据吗?',
@@ -530,15 +529,12 @@ export default {
ardTip:'接入控制标志(Access-Restriction-Data),可用于区分2G/3G/LTE用户,便于为2G/3G/LTE网络共存时,对不同类型用户进行区分服务', ardTip:'接入控制标志(Access-Restriction-Data),可用于区分2G/3G/LTE用户,便于为2G/3G/LTE网络共存时,对不同类型用户进行区分服务',
}, },
base5G: { base5G: {
neTypePlease: '查询网元类型',
neType: 'AMF网元对象', neType: 'AMF网元对象',
}, },
ue: { ue: {
neTypePlease: '查询网元类型',
neType: 'SMF网元对象', neType: 'SMF网元对象',
}, },
ims: { ims: {
neTypePlease: '查询网元类型',
neType: 'IMS网元对象', neType: 'IMS网元对象',
}, },
}, },
@@ -1323,5 +1319,12 @@ export default {
noChange: "接口设置无变更", noChange: "接口设置无变更",
}, },
}, },
tool: {
help: {
download: "下载",
pdfViewer: "浏览器内预览",
pdfViewerErr: "很抱歉,您的浏览器不支持 PDF 预览!",
}
},
}, },
}; };

View File

@@ -8,8 +8,7 @@ import useNeInfoStore from '@/store/modules/neinfo';
import { regExpIPv4, regExpIPv6 } from '@/utils/regular-utils'; import { regExpIPv4, regExpIPv6 } from '@/utils/regular-utils';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import { getMMLByNE, sendMMlByNE } from '@/api/mmlManage/neOperate'; import { getMMLByNE, sendMMlByNE } from '@/api/mmlManage/neOperate';
import { transferToNeFile } from '@/api/mmlManage/neOperate'; import { uploadFileToNE } from '@/api/tool/file';
import { uploadFileChunk } from '@/api/tool/file';
import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface'; import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface';
const { t } = useI18n(); const { t } = useI18n();
@@ -177,20 +176,8 @@ function fnUpload(up: UploadRequestOption, name: string) {
onOk() { onOk() {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
state.from.uploadLoading = true; state.from.uploadLoading = true;
uploadFileChunk(up.file as File, 5, 'import') const [neType, neId] = state.neType;
.then(res => { uploadFileToNE(neType, neId, up.file as File, 5)
// 文件上传
if (res.code === RESULT_CODE_SUCCESS) {
const [neType, neId] = state.neType;
return transferToNeFile({
uploadPath: res.data.fileName,
neType: neType,
neId: neId,
});
} else {
return res;
}
})
.then(res => { .then(res => {
// 文件转存 // 文件转存
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {

View File

@@ -8,8 +8,7 @@ import useNeInfoStore from '@/store/modules/neinfo';
import { regExpIPv4, regExpIPv6 } from '@/utils/regular-utils'; import { regExpIPv4, regExpIPv6 } from '@/utils/regular-utils';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import { getMMLByOMC, sendMMlByOMC } from '@/api/mmlManage/omcOperate'; import { getMMLByOMC, sendMMlByOMC } from '@/api/mmlManage/omcOperate';
import { transferToNeFile } from '@/api/mmlManage/neOperate'; import { uploadFileToNE } from '@/api/tool/file';
import { uploadFileChunk } from '@/api/tool/file';
import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface'; import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface';
const { t } = useI18n(); const { t } = useI18n();
@@ -173,19 +172,7 @@ function fnUpload(up: UploadRequestOption, name: string) {
onOk() { onOk() {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
state.from.uploadLoading = true; state.from.uploadLoading = true;
uploadFileChunk(up.file as File, 5, 'import') uploadFileToNE('OMC', state.neId, up.file as File, 5)
.then(res => {
// 文件上传
if (res.code === RESULT_CODE_SUCCESS) {
return transferToNeFile({
uploadPath: res.data.fileName,
neType: 'OMC',
neId: state.neId,
});
} else {
return res;
}
})
.then(res => { .then(res => {
// 文件转存 // 文件转存
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {

View File

@@ -9,8 +9,7 @@ import { regExpIPv4, regExpIPv6 } from '@/utils/regular-utils';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import { getMMLByUDM, sendMMlByUDM } from '@/api/mmlManage/udmOperate'; import { getMMLByUDM, sendMMlByUDM } from '@/api/mmlManage/udmOperate';
import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface'; import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface';
import { uploadFileChunk } from '@/api/tool/file'; import { uploadFileToNE } from '@/api/tool/file';
import { transferToNeFile } from '@/api/mmlManage/neOperate';
const { t } = useI18n(); const { t } = useI18n();
/**网元参数 */ /**网元参数 */
@@ -173,19 +172,7 @@ function fnUpload(up: UploadRequestOption, name: string) {
onOk() { onOk() {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
state.from.uploadLoading = true; state.from.uploadLoading = true;
uploadFileChunk(up.file as File, 5, 'import') uploadFileToNE('UDM', state.neId, up.file as File, 5)
.then(res => {
// 文件上传
if (res.code === RESULT_CODE_SUCCESS) {
return transferToNeFile({
uploadPath: res.data.fileName,
neType: 'UDM',
neId: state.neId,
});
} else {
return res;
}
})
.then(res => { .then(res => {
// 文件转存 // 文件转存
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {

View File

@@ -29,6 +29,10 @@ let queryParams = reactive({
/**记录时间 */ /**记录时间 */
beginTime: '', beginTime: '',
endTime: '', endTime: '',
/**排序字段 */
sortField: 'value',
/**排序方式 */
sortOrder: 'asc',
/**当前页数 */ /**当前页数 */
pageNum: 1, pageNum: 1,
/**每页条数 */ /**每页条数 */
@@ -41,6 +45,8 @@ function fnQueryReset() {
neType: '', neType: '',
beginTime: '', beginTime: '',
endTime: '', endTime: '',
sortField: 'value',
sortOrder: 'asc',
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
}); });
@@ -81,29 +87,24 @@ let tableColumns: ColumnsType = [
title: t('views.perfManage.goldTarget.enTitle'), title: t('views.perfManage.goldTarget.enTitle'),
dataIndex: 'enTitle', dataIndex: 'enTitle',
align: 'center', align: 'center',
sorter: (a: any, b: any) => {
return 1;
},
}, },
{ {
title: t('views.perfManage.goldTarget.value'), title: t('views.perfManage.goldTarget.value'),
dataIndex: 'value', dataIndex: 'value',
key: 'value',
align: 'center', align: 'center',
sorter: (a: any, b: any) => { sorter: true,
return 1;
},
}, },
{ {
title: t('views.perfManage.goldTarget.startTime'), title: t('views.perfManage.goldTarget.startTime'),
dataIndex: 'startTime', dataIndex: 'startTime',
key: 'start_time',
align: 'center', align: 'center',
customRender(opt) { customRender(opt) {
if (!opt.value) return ''; if (!opt.value) return '';
return parseDateToStr(opt.value); return parseDateToStr(opt.value);
}, },
sorter: (a: any, b: any) => { sorter: true,
return 1;
},
}, },
{ {
title: t('views.perfManage.goldTarget.endTime'), title: t('views.perfManage.goldTarget.endTime'),
@@ -153,7 +154,7 @@ function fnTableSize({ key }: MenuInfo) {
function fnGetList(pageNum?: number) { function fnGetList(pageNum?: number) {
if (tableState.loading) return; if (tableState.loading) return;
tableState.loading = true; tableState.loading = true;
if(pageNum){ if (pageNum) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
if (!queryRangePicker.value) { if (!queryRangePicker.value) {
@@ -170,6 +171,19 @@ function fnGetList(pageNum?: number) {
}); });
} }
/**表格分页、排序、筛选变化时触发操作, 排序方式,取值为 ascend descend */
function fnTableChange(pagination: any, filters: any, sorter: any, extra: any) {
console.log(sorter);
const { columnKey, order } = sorter;
if (order) {
queryParams.sortField = columnKey;
queryParams.sortOrder = order.replace('end', '');
} else {
queryParams.sortOrder = 'asc';
}
fnGetList(1);
}
onMounted(() => { onMounted(() => {
// 获取网元网元列表 // 获取网元网元列表
useNeInfoStore().fnNelist(); useNeInfoStore().fnNelist();
@@ -189,7 +203,10 @@ onMounted(() => {
<a-form :model="queryParams" name="queryParams" layout="horizontal"> <a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item :label="t('views.perfManage.goldTarget.type')" name="neType"> <a-form-item
:label="t('views.perfManage.goldTarget.type')"
name="neType"
>
<a-auto-complete <a-auto-complete
v-model:value="queryParams.neType" v-model:value="queryParams.neType"
:options="useNeInfoStore().getNeSelectOtions" :options="useNeInfoStore().getNeSelectOtions"
@@ -198,7 +215,10 @@ onMounted(() => {
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="8" :md="12" :xs="24"> <a-col :lg="8" :md="12" :xs="24">
<a-form-item :label="t('views.perfManage.goldTarget.startTime')" name="queryRangePicker"> <a-form-item
:label="t('views.perfManage.goldTarget.startTime')"
name="queryRangePicker"
>
<a-range-picker <a-range-picker
v-model:value="queryRangePicker" v-model:value="queryRangePicker"
allow-clear allow-clear
@@ -286,6 +306,7 @@ onMounted(() => {
:loading="tableState.loading" :loading="tableState.loading"
:data-source="tableState.data" :data-source="tableState.data"
:size="tableState.size" :size="tableState.size"
@change="fnTableChange"
:pagination="tablePagination" :pagination="tablePagination"
:scroll="{ x: true }" :scroll="{ x: true }"
> >

View File

@@ -79,7 +79,13 @@ function fnDownload() {
/**系统使用手册跳转 */ /**系统使用手册跳转 */
function fnClickHelpDoc() { function fnClickHelpDoc() {
window.open(docUrl.value, '_blank'); // 浏览器支持 PDF 预览
if (navigator.pdfViewerEnabled) {
window.open(docUrl.value, '_blank');
} else {
// 浏览器不支持 PDF 预览
alert(t('views.tool.help.pdfViewerErr'));
}
} }
onMounted(() => { onMounted(() => {
@@ -104,11 +110,11 @@ onMounted(() => {
<a-space :size="12" align="center"> <a-space :size="12" align="center">
<a-button type="default" @click="fnClickHelpDoc()"> <a-button type="default" @click="fnClickHelpDoc()">
<template #icon><ToTopOutlined /> </template> <template #icon><ToTopOutlined /> </template>
浏览器内打开 {{ t('views.tool.help.pdfViewer') }}
</a-button> </a-button>
<a-button type="primary" @click="fnDownload()"> <a-button type="primary" @click="fnDownload()">
<template #icon><DownloadOutlined /></template> <template #icon><DownloadOutlined /></template>
下载 {{ t('views.tool.help.download') }}
</a-button> </a-button>
</a-space> </a-space>
</a-col> </a-col>
@@ -126,7 +132,9 @@ onMounted(() => {
</a-col> </a-col>
<a-col :span="20" class="right"> <a-col :span="20" class="right">
<div class="right-view"> <div class="right-view">
<a-spin size="large" style="margin: 50%" v-if="pages === 0" />
<VuePDF <VuePDF
v-else
:pdf="pdf" :pdf="pdf"
:page="viewPage" :page="viewPage"
:scale="viewScale" :scale="viewScale"
@@ -134,7 +142,7 @@ onMounted(() => {
:annotations-filter="['Link']" :annotations-filter="['Link']"
@annotation="fnAnnotation" @annotation="fnAnnotation"
> >
<a-spin style="margin: 50%" /> <a-spin size="large" style="margin: 50%" />
</VuePDF> </VuePDF>
</div> </div>
</a-col> </a-col>