diff --git a/src/api/mmlManage/neOperate.ts b/src/api/mmlManage/neOperate.ts index 0be5b6e9..48777a4d 100644 --- a/src/api/mmlManage/neOperate.ts +++ b/src/api/mmlManage/neOperate.ts @@ -51,15 +51,3 @@ export async function sendMMlByNE( } return result; } - -/** - * 发送文件到网元端 - * @returns object - */ -export function transferToNeFile(data: Record) { - return request({ - url: `/ne/action/pushFile`, - method: 'post', - data, - }); -} diff --git a/src/api/perfManage/goldTarget.ts b/src/api/perfManage/goldTarget.ts index e1f1785c..36ded63f 100644 --- a/src/api/perfManage/goldTarget.ts +++ b/src/api/perfManage/goldTarget.ts @@ -8,6 +8,7 @@ import { parseObjLineToHump } from '@/utils/parse-utils'; * @returns object */ export async function listgoldData(query: Record) { + console.log(query); let totalSQL = 'select count(*) as total from gold_kpi where 1=1 '; 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 '; @@ -15,17 +16,23 @@ export async function listgoldData(query: Record) { // 查询 let querySQL = ''; if (query.neType) { - querySQL += ` and ne_type like '%${query.neType}%' `; + querySQL += ` and gold_kpi.ne_type like '%${query.neType}%' `; } if (query.beginTime) { querySQL += ` and start_time >= '${query.beginTime}' `; } 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') { sortSql += ' asc '; } else { diff --git a/src/api/tool/file.ts b/src/api/tool/file.ts index 0a7f9ec6..8ffe4982 100644 --- a/src/api/tool/file.ts +++ b/src/api/tool/file.ts @@ -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 { encode } from 'js-base64'; @@ -194,3 +198,33 @@ export function chunkUpload(data: FormData) { 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; +} diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index d4432e3d..4821a3cc 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -1319,5 +1319,12 @@ export default { noChange: "No change in interface settings", }, }, + tool: { + help: { + download: "Download", + pdfViewer: "In-browser preview", + pdfViewerErr: "Sorry, your browser does not support PDF preview!", + } + }, }, }; diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 02ef0078..5c106a0a 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -495,7 +495,6 @@ export default { }, sub: { subInfo:'签约信息', - neTypePlease: '查询网元类型', neType: 'UDM网元类型', export: '导出', exportConfirm: '确认导出全部签约用户数据吗?', @@ -530,15 +529,12 @@ export default { ardTip:'接入控制标志(Access-Restriction-Data),可用于区分2G/3G/LTE用户,便于为2G/3G/LTE网络共存时,对不同类型用户进行区分服务', }, base5G: { - neTypePlease: '查询网元类型', neType: 'AMF网元对象', }, ue: { - neTypePlease: '查询网元类型', neType: 'SMF网元对象', }, ims: { - neTypePlease: '查询网元类型', neType: 'IMS网元对象', }, }, @@ -1323,5 +1319,12 @@ export default { noChange: "接口设置无变更", }, }, + tool: { + help: { + download: "下载", + pdfViewer: "浏览器内预览", + pdfViewerErr: "很抱歉,您的浏览器不支持 PDF 预览!", + } + }, }, }; diff --git a/src/views/mmlManage/neOperate/index.vue b/src/views/mmlManage/neOperate/index.vue index a388ae39..c36e1487 100644 --- a/src/views/mmlManage/neOperate/index.vue +++ b/src/views/mmlManage/neOperate/index.vue @@ -8,8 +8,7 @@ import useNeInfoStore from '@/store/modules/neinfo'; import { regExpIPv4, regExpIPv6 } from '@/utils/regular-utils'; import useI18n from '@/hooks/useI18n'; import { getMMLByNE, sendMMlByNE } from '@/api/mmlManage/neOperate'; -import { transferToNeFile } from '@/api/mmlManage/neOperate'; -import { uploadFileChunk } from '@/api/tool/file'; +import { uploadFileToNE } from '@/api/tool/file'; import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface'; const { t } = useI18n(); @@ -177,20 +176,8 @@ function fnUpload(up: UploadRequestOption, name: string) { onOk() { const hide = message.loading(t('common.loading'), 0); state.from.uploadLoading = true; - uploadFileChunk(up.file as File, 5, 'import') - .then(res => { - // 文件上传 - if (res.code === RESULT_CODE_SUCCESS) { - const [neType, neId] = state.neType; - return transferToNeFile({ - uploadPath: res.data.fileName, - neType: neType, - neId: neId, - }); - } else { - return res; - } - }) + const [neType, neId] = state.neType; + uploadFileToNE(neType, neId, up.file as File, 5) .then(res => { // 文件转存 if (res.code === RESULT_CODE_SUCCESS) { diff --git a/src/views/mmlManage/omcOperate/index.vue b/src/views/mmlManage/omcOperate/index.vue index 8d13fb6a..faf1d9e0 100644 --- a/src/views/mmlManage/omcOperate/index.vue +++ b/src/views/mmlManage/omcOperate/index.vue @@ -8,8 +8,7 @@ import useNeInfoStore from '@/store/modules/neinfo'; import { regExpIPv4, regExpIPv6 } from '@/utils/regular-utils'; import useI18n from '@/hooks/useI18n'; import { getMMLByOMC, sendMMlByOMC } from '@/api/mmlManage/omcOperate'; -import { transferToNeFile } from '@/api/mmlManage/neOperate'; -import { uploadFileChunk } from '@/api/tool/file'; +import { uploadFileToNE } from '@/api/tool/file'; import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface'; const { t } = useI18n(); @@ -173,19 +172,7 @@ function fnUpload(up: UploadRequestOption, name: string) { onOk() { const hide = message.loading(t('common.loading'), 0); state.from.uploadLoading = true; - uploadFileChunk(up.file as File, 5, 'import') - .then(res => { - // 文件上传 - if (res.code === RESULT_CODE_SUCCESS) { - return transferToNeFile({ - uploadPath: res.data.fileName, - neType: 'OMC', - neId: state.neId, - }); - } else { - return res; - } - }) + uploadFileToNE('OMC', state.neId, up.file as File, 5) .then(res => { // 文件转存 if (res.code === RESULT_CODE_SUCCESS) { diff --git a/src/views/mmlManage/udmOperate/index.vue b/src/views/mmlManage/udmOperate/index.vue index 5071fd78..4a1a3b5a 100644 --- a/src/views/mmlManage/udmOperate/index.vue +++ b/src/views/mmlManage/udmOperate/index.vue @@ -9,8 +9,7 @@ import { regExpIPv4, regExpIPv6 } from '@/utils/regular-utils'; import useI18n from '@/hooks/useI18n'; import { getMMLByUDM, sendMMlByUDM } from '@/api/mmlManage/udmOperate'; import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface'; -import { uploadFileChunk } from '@/api/tool/file'; -import { transferToNeFile } from '@/api/mmlManage/neOperate'; +import { uploadFileToNE } from '@/api/tool/file'; const { t } = useI18n(); /**网元参数 */ @@ -173,19 +172,7 @@ function fnUpload(up: UploadRequestOption, name: string) { onOk() { const hide = message.loading(t('common.loading'), 0); state.from.uploadLoading = true; - uploadFileChunk(up.file as File, 5, 'import') - .then(res => { - // 文件上传 - if (res.code === RESULT_CODE_SUCCESS) { - return transferToNeFile({ - uploadPath: res.data.fileName, - neType: 'UDM', - neId: state.neId, - }); - } else { - return res; - } - }) + uploadFileToNE('UDM', state.neId, up.file as File, 5) .then(res => { // 文件转存 if (res.code === RESULT_CODE_SUCCESS) { diff --git a/src/views/perfManage/goldTarget/index.vue b/src/views/perfManage/goldTarget/index.vue index afee5e2c..b717f13e 100644 --- a/src/views/perfManage/goldTarget/index.vue +++ b/src/views/perfManage/goldTarget/index.vue @@ -29,6 +29,10 @@ let queryParams = reactive({ /**记录时间 */ beginTime: '', endTime: '', + /**排序字段 */ + sortField: 'value', + /**排序方式 */ + sortOrder: 'asc', /**当前页数 */ pageNum: 1, /**每页条数 */ @@ -41,6 +45,8 @@ function fnQueryReset() { neType: '', beginTime: '', endTime: '', + sortField: 'value', + sortOrder: 'asc', pageNum: 1, pageSize: 20, }); @@ -81,29 +87,24 @@ let tableColumns: ColumnsType = [ title: t('views.perfManage.goldTarget.enTitle'), dataIndex: 'enTitle', align: 'center', - sorter: (a: any, b: any) => { - return 1; - }, }, { title: t('views.perfManage.goldTarget.value'), dataIndex: 'value', + key: 'value', align: 'center', - sorter: (a: any, b: any) => { - return 1; - }, + sorter: true, }, { title: t('views.perfManage.goldTarget.startTime'), dataIndex: 'startTime', + key: 'start_time', align: 'center', customRender(opt) { if (!opt.value) return ''; return parseDateToStr(opt.value); }, - sorter: (a: any, b: any) => { - return 1; - }, + sorter: true, }, { title: t('views.perfManage.goldTarget.endTime'), @@ -153,7 +154,7 @@ function fnTableSize({ key }: MenuInfo) { function fnGetList(pageNum?: number) { if (tableState.loading) return; tableState.loading = true; - if(pageNum){ + if (pageNum) { queryParams.pageNum = pageNum; } 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(() => { // 获取网元网元列表 useNeInfoStore().fnNelist(); @@ -189,7 +203,10 @@ onMounted(() => { - + { - + { :loading="tableState.loading" :data-source="tableState.data" :size="tableState.size" + @change="fnTableChange" :pagination="tablePagination" :scroll="{ x: true }" > diff --git a/src/views/tool/help/index.vue b/src/views/tool/help/index.vue index 08a7079a..7fd32d5c 100644 --- a/src/views/tool/help/index.vue +++ b/src/views/tool/help/index.vue @@ -79,7 +79,13 @@ function fnDownload() { /**系统使用手册跳转 */ 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(() => { @@ -104,11 +110,11 @@ onMounted(() => { - 浏览器内打开 + {{ t('views.tool.help.pdfViewer') }} - 下载 + {{ t('views.tool.help.download') }} @@ -126,7 +132,9 @@ onMounted(() => {
+ { :annotations-filter="['Link']" @annotation="fnAnnotation" > - +