Merge branch 'main' of http://192.168.2.166:3180/OMC/ems_frontend_vue3
This commit is contained in:
@@ -11,7 +11,7 @@ VITE_APP_NAME = "Core Network EMS"
|
||||
VITE_APP_CODE = "CN EMS"
|
||||
|
||||
# 应用版本
|
||||
VITE_APP_VERSION = "2.231124.8"
|
||||
VITE_APP_VERSION = "2.231128.8"
|
||||
|
||||
# 接口基础URL地址-不带/后缀
|
||||
VITE_API_BASE_URL = "/omc-api"
|
||||
|
||||
@@ -2,15 +2,16 @@
|
||||
* =============== Zh ===============
|
||||
* - Nginx部署
|
||||
* 删除loading.js同级下同名文件,Nginx代理地址: /omc-api
|
||||
*
|
||||
* Nginx Deployment
|
||||
* Delete the file with the same name under the same level of loading.js, Nginx proxy address: /omc-api
|
||||
*
|
||||
*
|
||||
* - 非Nginx部署
|
||||
* 请将当前文件与loading.js同级,将host变量值修改为数据服务访问地址
|
||||
* !!!注意: 修改当前文件后,建议关闭浏览器后重新访问
|
||||
*
|
||||
* =============== En ===============
|
||||
* - Nginx Deployment
|
||||
* Delete the file with the same name under the same level of loading.js, Nginx proxy address: /omc-api
|
||||
*
|
||||
* Non-Nginx Deployment
|
||||
* - Non-Nginx Deployment
|
||||
* Please make the current file the same level as the loading.js, change the host variable value to the data service access address
|
||||
* !!! Note: After modifying the current file, it is recommended to revisit it after closing the browser.
|
||||
*
|
||||
|
||||
@@ -84,7 +84,7 @@ export function getSysConf() {
|
||||
*/
|
||||
export function transferHelpDoc(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/help-doc`,
|
||||
url: `/helpDoc`,
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
|
||||
@@ -36,18 +36,30 @@ export async function getMMLByNE(neType: string) {
|
||||
export async function sendMMlByNE(
|
||||
neType: string,
|
||||
neId: string,
|
||||
cmdStr: string
|
||||
cmdArr: string[]
|
||||
) {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/api/rest/operationManagement/v1/elementType/${neType}/objectType/mml?ne_id=${neId}`,
|
||||
method: 'post',
|
||||
data: { mml: [cmdStr] },
|
||||
data: { mml: cmdArr },
|
||||
timeout: 180_000,
|
||||
});
|
||||
// 解析数据
|
||||
if (result.code === RESULT_CODE_SUCCESS && Array.isArray(result.data.data)) {
|
||||
result.data = result.data.data[0];
|
||||
result.data = result.data.data;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送文件到网元端
|
||||
* @returns object
|
||||
*/
|
||||
export function transferToNeFile(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/ne/action/pushFile`,
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -31,17 +31,17 @@ export async function getMMLByOMC() {
|
||||
* @param cmdStr 命令串
|
||||
* @returns
|
||||
*/
|
||||
export async function sendMMlByOMC(neId: string, cmdStr: string) {
|
||||
export async function sendMMlByOMC(neId: string, cmdArr: string[]) {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/api/rest/operationManagement/v1/elementType/OMC/objectType/mml?ne_id=${neId}`,
|
||||
method: 'post',
|
||||
data: { mml: [cmdStr] },
|
||||
data: { mml: cmdArr },
|
||||
timeout: 180_000,
|
||||
});
|
||||
// 解析数据
|
||||
if (result.code === RESULT_CODE_SUCCESS && Array.isArray(result.data.data)) {
|
||||
result.data = result.data.data[0];
|
||||
result.data = result.data.data;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -31,17 +31,17 @@ export async function getMMLByUDM() {
|
||||
* @param cmdStr 命令串
|
||||
* @returns
|
||||
*/
|
||||
export async function sendMMlByUDM(neId: string, cmdStr: string) {
|
||||
export async function sendMMlByUDM(neId: string, cmdArr: string[]) {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/api/rest/operationManagement/v1/elementType/UDM/objectType/mml?ne_id=${neId}`,
|
||||
method: 'post',
|
||||
data: { mml: [cmdStr] },
|
||||
data: { mml: cmdArr },
|
||||
timeout: 180_000,
|
||||
});
|
||||
// 解析数据
|
||||
if (result.code === RESULT_CODE_SUCCESS && Array.isArray(result.data.data)) {
|
||||
result.data = result.data.data[0];
|
||||
result.data = result.data.data;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import { request } from '@/plugins/http-fetch';
|
||||
*/
|
||||
export function exportAuth(query: Record<string, any>) {
|
||||
return request({
|
||||
url: '/ne/udm/sub/export',
|
||||
url: '/ne/udm/auth/export',
|
||||
method: 'post',
|
||||
data: query,
|
||||
responseType: 'blob',
|
||||
@@ -22,7 +22,7 @@ export function exportAuth(query: Record<string, any>) {
|
||||
*/
|
||||
export function importAuthData(data: FormData) {
|
||||
return request({
|
||||
url: `/ne/udm/sub/import`,
|
||||
url: `/ne/udm/auth/import`,
|
||||
method: 'post',
|
||||
data,
|
||||
dataType: 'form-data',
|
||||
|
||||
@@ -26,5 +26,8 @@ export async function listBase5G(query: Record<string, any>) {
|
||||
data.total = rows.length;
|
||||
data.rows = rows;
|
||||
}
|
||||
// 模拟数据
|
||||
// data.rows =[{"address":"192.168.1.137:38412","id":"217","name":"","ueNum":0}]
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -16,15 +16,24 @@ export async function listperfData(query: Record<string, any>) {
|
||||
if (query.neType) {
|
||||
querySQL += ` and ne_type like '%${query.neType}%' `;
|
||||
}
|
||||
if (query.taskId) {
|
||||
querySQL += ` and task_id like '%${query.taskId}%' `;
|
||||
}
|
||||
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 {
|
||||
|
||||
@@ -1300,6 +1300,8 @@ export default {
|
||||
clearLog: "Clear Logs",
|
||||
exec: "Execute",
|
||||
cmdAwait: "Waiting for a command to be sent",
|
||||
uploadFileTip: 'Are you sure you want to upload the file?',
|
||||
uploadFileOk: 'File Upload Successful',
|
||||
omcOperate:{
|
||||
noOMC: "No OMC network elements",
|
||||
},
|
||||
|
||||
@@ -1304,6 +1304,8 @@ export default {
|
||||
clearLog: "清除日志",
|
||||
exec: "执行",
|
||||
cmdAwait: "等待发送命令",
|
||||
uploadFileTip: '确认要上传文件吗?',
|
||||
uploadFileOk: '文件上传成功',
|
||||
omcOperate:{
|
||||
noOMC: "暂无OMC网元",
|
||||
},
|
||||
|
||||
@@ -120,6 +120,16 @@ function fnComponentSetName(component: any, to: any) {
|
||||
// 清空导航栏标签
|
||||
tabsStore.clear();
|
||||
|
||||
/**系统使用手册跳转 */
|
||||
function fnClickHelpDoc(language?: string) {
|
||||
const routeData = router.resolve({ name: 'HelpDoc' });
|
||||
let href = routeData.href;
|
||||
if (language) {
|
||||
href = `${routeData.href}?language=${language}`;
|
||||
}
|
||||
window.open(href, '_blank');
|
||||
}
|
||||
|
||||
/**
|
||||
* 国际化翻译转换
|
||||
*/
|
||||
@@ -285,9 +295,8 @@ document.addEventListener('visibilitychange', function () {
|
||||
</a-button>
|
||||
<a-button
|
||||
type="link"
|
||||
href="/help"
|
||||
target="_blank"
|
||||
size="small"
|
||||
@click="fnClickHelpDoc()"
|
||||
v-if="appStore.getHelpDoc !== '#'"
|
||||
>
|
||||
{{ t('loayouts.basic.helpDoc') }}
|
||||
|
||||
@@ -32,6 +32,16 @@ function fnClickAlarm() {
|
||||
router.push({ path: '/faultManage/active-alarm' });
|
||||
}
|
||||
|
||||
/**系统使用手册跳转 */
|
||||
function fnClickHelpDoc(language?: string) {
|
||||
const routeData = router.resolve({ name: 'HelpDoc' });
|
||||
let href = routeData.href;
|
||||
if (language) {
|
||||
href = `${routeData.href}?language=${language}`;
|
||||
}
|
||||
window.open(href, '_blank');
|
||||
}
|
||||
|
||||
/**改变多语言 */
|
||||
function fnChangeLocale(e: any) {
|
||||
changeLocale(e.key);
|
||||
@@ -54,7 +64,7 @@ function fnChangeLocale(e: any) {
|
||||
|
||||
<a-tooltip placement="bottom" v-if="appStore.getHelpDoc !== '#'">
|
||||
<template #title>{{ t('loayouts.rightContent.helpDoc') }}</template>
|
||||
<a-button type="text" href="/help" target="_blank">
|
||||
<a-button type="text" @click="fnClickHelpDoc()">
|
||||
<template #icon>
|
||||
<QuestionCircleOutlined />
|
||||
</template>
|
||||
|
||||
@@ -1330,11 +1330,7 @@ onMounted(() => {
|
||||
<!-- 多列数据渲染 -->
|
||||
<template #bodyCell="{ column, text, record }">
|
||||
<template v-if="column?.key === 'index'">
|
||||
<a-space
|
||||
:size="16"
|
||||
align="center"
|
||||
v-if="!['read-only', 'ro'].includes(text.access)"
|
||||
>
|
||||
<a-space :size="16" align="center">
|
||||
<a-tooltip>
|
||||
<template #title>{{ t('common.editText') }}</template>
|
||||
<a-button type="link" @click.prevent="arrayEdit(text)">
|
||||
@@ -1423,11 +1419,7 @@ onMounted(() => {
|
||||
</template>
|
||||
<template #bodyCell="{ column, text, record }">
|
||||
<template v-if="column?.key === 'index'">
|
||||
<a-space
|
||||
:size="8"
|
||||
align="center"
|
||||
v-if="!['read-only', 'ro'].includes(text.access)"
|
||||
>
|
||||
<a-space :size="8" align="center">
|
||||
<a-tooltip>
|
||||
<template #title>{{ t('common.editText') }}</template>
|
||||
<a-button
|
||||
@@ -1519,6 +1511,7 @@ onMounted(() => {
|
||||
<template #title v-if="item.comment">
|
||||
{{ item.comment }}
|
||||
</template>
|
||||
|
||||
<div>
|
||||
<div
|
||||
v-if="
|
||||
@@ -1529,7 +1522,7 @@ onMounted(() => {
|
||||
<a-input-number
|
||||
v-if="item['type'] === 'int'"
|
||||
v-model:value="modalState.from[item.name]['value']"
|
||||
:disabled="item.name === 'index'"
|
||||
:disabled="['read-only', 'ro'].includes(item.access)"
|
||||
style="width: 100%"
|
||||
></a-input-number>
|
||||
<a-switch
|
||||
@@ -1537,10 +1530,12 @@ onMounted(() => {
|
||||
v-model:checked="modalState.from[item.name]['value']"
|
||||
:checked-children="t('common.switch.open')"
|
||||
:un-checked-children="t('common.switch.shut')"
|
||||
:disabled="['read-only', 'ro'].includes(item.access)"
|
||||
></a-switch>
|
||||
<a-select
|
||||
v-else-if="item['type'] === 'enum'"
|
||||
v-model:value="modalState.from[item.name]['value']"
|
||||
:disabled="['read-only', 'ro'].includes(item.access)"
|
||||
:allow-clear="true"
|
||||
style="width: 100%"
|
||||
>
|
||||
@@ -1555,7 +1550,7 @@ onMounted(() => {
|
||||
<a-input
|
||||
v-else
|
||||
v-model:value="modalState.from[item.name]['value']"
|
||||
:disabled="item.name === 'index'"
|
||||
:disabled="['read-only', 'ro'].includes(item.access)"
|
||||
></a-input>
|
||||
</div>
|
||||
<div v-else>
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref, onMounted, toRaw } from 'vue';
|
||||
import { PageContainer } from '@ant-design-vue/pro-layout';
|
||||
import { message } from 'ant-design-vue/lib';
|
||||
import { Modal, message } from 'ant-design-vue/lib';
|
||||
import CodemirrorEdite from '@/components/CodemirrorEdite/index.vue';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
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 { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface';
|
||||
const { t } = useI18n();
|
||||
|
||||
/**网元参数 */
|
||||
@@ -48,6 +51,7 @@ let state: StateType = reactive({
|
||||
param: [],
|
||||
},
|
||||
from: {
|
||||
uploadLoading: false,
|
||||
sendLoading: false,
|
||||
},
|
||||
autoCompleteValue: '',
|
||||
@@ -88,7 +92,7 @@ function fnSendMML() {
|
||||
return;
|
||||
}
|
||||
|
||||
let cmdStr = '';
|
||||
let cmdArr: string[] = [];
|
||||
const operation = state.mmlSelect.operation;
|
||||
const object = state.mmlSelect.object;
|
||||
// 根据参数取值
|
||||
@@ -126,6 +130,7 @@ function fnSendMML() {
|
||||
|
||||
// 拼装命令
|
||||
const argsStr = argsArr.join(',');
|
||||
let cmdStr = '';
|
||||
if (object && argsStr) {
|
||||
cmdStr = `${operation} ${object} ${argsStr}`;
|
||||
} else if (object) {
|
||||
@@ -133,35 +138,76 @@ function fnSendMML() {
|
||||
} else {
|
||||
cmdStr = `${operation} ${argsStr}`;
|
||||
}
|
||||
cmdStr = cmdStr.trim();
|
||||
cmdArr = [cmdStr.trim()];
|
||||
}
|
||||
|
||||
if (cmdStr) {
|
||||
state.autoCompleteValue = cmdStr;
|
||||
if (cmdArr.length > 0) {
|
||||
state.autoCompleteValue = cmdArr[0];
|
||||
} else {
|
||||
let value = state.autoCompleteValue;
|
||||
if (value.indexOf('\n') !== -1) {
|
||||
value = value.replace(/(\r\n|\n)/g, ';');
|
||||
}
|
||||
cmdStr = value;
|
||||
cmdArr = value.split(';');
|
||||
}
|
||||
|
||||
// 发送
|
||||
state.mmlCmdLog += `${cmdStr}\n`;
|
||||
state.mmlCmdLog += `${cmdArr.join('\n')}\n`;
|
||||
state.from.sendLoading = true;
|
||||
const [neType, neId] = state.neType;
|
||||
sendMMlByNE(neType, neId, cmdStr).then(res => {
|
||||
sendMMlByNE(neType, neId, cmdArr).then(res => {
|
||||
state.from.sendLoading = false;
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
let resultStr = res.data;
|
||||
resultStr = resultStr.replace(/(\r\n|\n)/g, '\n');
|
||||
state.mmlCmdLog += `${resultStr}\n`;
|
||||
let resultArr = res.data;
|
||||
for (const str of resultArr) {
|
||||
const logStr = str.replace(/(\r\n|\n)/g, '\n');
|
||||
state.mmlCmdLog += `${logStr}\n`;
|
||||
}
|
||||
} else {
|
||||
state.mmlCmdLog += `${res.msg}\n`;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**上传变更 */
|
||||
function fnUpload(up: UploadRequestOption, name: string) {
|
||||
Modal.confirm({
|
||||
title: t('common.tipTitle'),
|
||||
content: t('views.mmlManage.uploadFileTip'),
|
||||
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;
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
// 文件转存
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success(t('views.mmlManage.uploadFileOk'), 3);
|
||||
state.from[name] = res.data;
|
||||
} else {
|
||||
message.error(res.msg, 3);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
state.from.uploadLoading = false;
|
||||
hide();
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**规则校验 */
|
||||
function ruleVerification(
|
||||
row: Record<string, any>,
|
||||
@@ -588,6 +634,29 @@ onMounted(() => {
|
||||
{{ k }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-input-group compact v-else-if="item.type === 'file'">
|
||||
<a-input
|
||||
v-model:value="state.from[item.name]"
|
||||
style="width: calc(100% - 32px)"
|
||||
/>
|
||||
<a-upload
|
||||
name="file"
|
||||
list-type="text"
|
||||
:accept="item.filter"
|
||||
:max-count="1"
|
||||
:show-upload-list="false"
|
||||
:custom-request="v => fnUpload(v, item.name)"
|
||||
>
|
||||
<a-button
|
||||
type="primary"
|
||||
:loading="state.from.uploadLoading"
|
||||
>
|
||||
<template #icon>
|
||||
<UploadOutlined />
|
||||
</template>
|
||||
</a-button>
|
||||
</a-upload>
|
||||
</a-input-group>
|
||||
<a-input
|
||||
v-else
|
||||
v-model:value="state.from[item.name]"
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref, onMounted, toRaw } from 'vue';
|
||||
import { PageContainer } from '@ant-design-vue/pro-layout';
|
||||
import { message } from 'ant-design-vue/lib';
|
||||
import { Modal, message } from 'ant-design-vue/lib';
|
||||
import CodemirrorEdite from '@/components/CodemirrorEdite/index.vue';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
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 { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface';
|
||||
const { t } = useI18n();
|
||||
|
||||
/**网元参数 */
|
||||
@@ -45,6 +48,7 @@ let state: StateType = reactive({
|
||||
param: [],
|
||||
},
|
||||
from: {
|
||||
uploadLoading: false,
|
||||
sendLoading: false,
|
||||
},
|
||||
autoCompleteValue: '',
|
||||
@@ -85,7 +89,7 @@ function fnSendMML() {
|
||||
return;
|
||||
}
|
||||
|
||||
let cmdStr = '';
|
||||
let cmdArr: string[] = [];
|
||||
const operation = state.mmlSelect.operation;
|
||||
const object = state.mmlSelect.object;
|
||||
// 根据参数取值
|
||||
@@ -123,6 +127,7 @@ function fnSendMML() {
|
||||
|
||||
// 拼装命令
|
||||
const argsStr = argsArr.join(',');
|
||||
let cmdStr = '';
|
||||
if (object && argsStr) {
|
||||
cmdStr = `${operation} ${object}:${argsStr}`;
|
||||
} else if (object) {
|
||||
@@ -130,34 +135,74 @@ function fnSendMML() {
|
||||
} else {
|
||||
cmdStr = `${operation} ${argsStr}`;
|
||||
}
|
||||
cmdStr = cmdStr.trim();
|
||||
cmdArr = [cmdStr.trim()];
|
||||
}
|
||||
|
||||
if (cmdStr) {
|
||||
state.autoCompleteValue = cmdStr;
|
||||
if (cmdArr.length > 0) {
|
||||
state.autoCompleteValue = cmdArr[0];
|
||||
} else {
|
||||
let value = state.autoCompleteValue;
|
||||
if (value.indexOf('\n') !== -1) {
|
||||
value = value.replace(/(\r\n|\n)/g, ';');
|
||||
}
|
||||
cmdStr = value;
|
||||
cmdArr = value.split(';');
|
||||
}
|
||||
|
||||
// 发送
|
||||
state.mmlCmdLog += `${cmdStr}\n`;
|
||||
state.mmlCmdLog += `${cmdArr.join('\n')}\n`;
|
||||
state.from.sendLoading = true;
|
||||
sendMMlByOMC(state.neId, cmdStr).then(res => {
|
||||
sendMMlByOMC(state.neId, cmdArr).then(res => {
|
||||
state.from.sendLoading = false;
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
let resultStr = res.data;
|
||||
resultStr = resultStr.replace(/(\r\n|\n)/g, '\n');
|
||||
state.mmlCmdLog += `${resultStr}\n`;
|
||||
let resultArr = res.data;
|
||||
for (const str of resultArr) {
|
||||
const logStr = str.replace(/(\r\n|\n)/g, '\n');
|
||||
state.mmlCmdLog += `${logStr}\n`;
|
||||
}
|
||||
} else {
|
||||
state.mmlCmdLog += `${res.msg}\n`;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**上传变更 */
|
||||
function fnUpload(up: UploadRequestOption, name: string) {
|
||||
Modal.confirm({
|
||||
title: t('common.tipTitle'),
|
||||
content: t('views.mmlManage.uploadFileTip'),
|
||||
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;
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
// 文件转存
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success(t('views.mmlManage.uploadFileOk'), 3);
|
||||
state.from[name] = res.data;
|
||||
} else {
|
||||
message.error(res.msg, 3);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
state.from.uploadLoading = false;
|
||||
hide();
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**规则校验 */
|
||||
function ruleVerification(
|
||||
row: Record<string, any>,
|
||||
@@ -563,6 +608,29 @@ onMounted(() => {
|
||||
{{ k }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-input-group compact v-else-if="item.type === 'file'">
|
||||
<a-input
|
||||
v-model:value="state.from[item.name]"
|
||||
style="width: calc(100% - 32px)"
|
||||
/>
|
||||
<a-upload
|
||||
name="file"
|
||||
list-type="text"
|
||||
:accept="item.filter"
|
||||
:max-count="1"
|
||||
:show-upload-list="false"
|
||||
:custom-request="v => fnUpload(v, item.name)"
|
||||
>
|
||||
<a-button
|
||||
type="primary"
|
||||
:loading="state.from.uploadLoading"
|
||||
>
|
||||
<template #icon>
|
||||
<UploadOutlined />
|
||||
</template>
|
||||
</a-button>
|
||||
</a-upload>
|
||||
</a-input-group>
|
||||
<a-input
|
||||
v-else
|
||||
v-model:value="state.from[item.name]"
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref, onMounted, toRaw } from 'vue';
|
||||
import { PageContainer } from '@ant-design-vue/pro-layout';
|
||||
import { message } from 'ant-design-vue/lib';
|
||||
import { Modal, message } from 'ant-design-vue/lib';
|
||||
import CodemirrorEdite from '@/components/CodemirrorEdite/index.vue';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import useNeInfoStore from '@/store/modules/neinfo';
|
||||
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';
|
||||
const { t } = useI18n();
|
||||
|
||||
/**网元参数 */
|
||||
@@ -45,6 +48,7 @@ let state: StateType = reactive({
|
||||
param: [],
|
||||
},
|
||||
from: {
|
||||
uploadLoading: false,
|
||||
sendLoading: false,
|
||||
},
|
||||
autoCompleteValue: '',
|
||||
@@ -85,7 +89,7 @@ function fnSendMML() {
|
||||
return;
|
||||
}
|
||||
|
||||
let cmdStr = '';
|
||||
let cmdArr: string[] = [];
|
||||
const operation = state.mmlSelect.operation;
|
||||
const object = state.mmlSelect.object;
|
||||
// 根据参数取值
|
||||
@@ -123,6 +127,7 @@ function fnSendMML() {
|
||||
|
||||
// 拼装命令
|
||||
const argsStr = argsArr.join(',');
|
||||
let cmdStr = '';
|
||||
if (object && argsStr) {
|
||||
cmdStr = `${operation} ${object}:${argsStr}`;
|
||||
} else if (object) {
|
||||
@@ -130,34 +135,74 @@ function fnSendMML() {
|
||||
} else {
|
||||
cmdStr = `${operation} ${argsStr}`;
|
||||
}
|
||||
cmdStr = cmdStr.trim();
|
||||
cmdArr = [cmdStr.trim()];
|
||||
}
|
||||
|
||||
if (cmdStr) {
|
||||
state.autoCompleteValue = cmdStr;
|
||||
if (cmdArr.length > 0) {
|
||||
state.autoCompleteValue = cmdArr[0];
|
||||
} else {
|
||||
let value = state.autoCompleteValue;
|
||||
if (value.indexOf('\n') !== -1) {
|
||||
value = value.replace(/(\r\n|\n)/g, ';');
|
||||
}
|
||||
cmdStr = value;
|
||||
cmdArr = value.split(';');
|
||||
}
|
||||
|
||||
// 发送
|
||||
state.mmlCmdLog += `${cmdStr}\n`;
|
||||
state.mmlCmdLog += `${cmdArr.join('\n')}\n`;
|
||||
state.from.sendLoading = true;
|
||||
sendMMlByUDM(state.neId, cmdStr).then(res => {
|
||||
sendMMlByUDM(state.neId, cmdArr).then(res => {
|
||||
state.from.sendLoading = false;
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
let resultStr = res.data;
|
||||
resultStr = resultStr.replace(/(\r\n|\n)/g, '\n');
|
||||
state.mmlCmdLog += `${resultStr}\n`;
|
||||
let resultArr = res.data;
|
||||
for (const str of resultArr) {
|
||||
const logStr = str.replace(/(\r\n|\n)/g, '\n');
|
||||
state.mmlCmdLog += `${logStr}\n`;
|
||||
}
|
||||
} else {
|
||||
state.mmlCmdLog += `${res.msg}\n`;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**上传变更 */
|
||||
function fnUpload(up: UploadRequestOption, name: string) {
|
||||
Modal.confirm({
|
||||
title: t('common.tipTitle'),
|
||||
content: t('views.mmlManage.uploadFileTip'),
|
||||
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;
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
// 文件转存
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success(t('views.mmlManage.uploadFileOk'), 3);
|
||||
state.from[name] = res.data;
|
||||
} else {
|
||||
message.error(res.msg, 3);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
state.from.uploadLoading = false;
|
||||
hide();
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**规则校验 */
|
||||
function ruleVerification(
|
||||
row: Record<string, any>,
|
||||
@@ -563,6 +608,29 @@ onMounted(() => {
|
||||
{{ k }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-input-group compact v-else-if="item.type === 'file'">
|
||||
<a-input
|
||||
v-model:value="state.from[item.name]"
|
||||
style="width: calc(100% - 32px)"
|
||||
/>
|
||||
<a-upload
|
||||
name="file"
|
||||
list-type="text"
|
||||
:accept="item.filter"
|
||||
:max-count="1"
|
||||
:show-upload-list="false"
|
||||
:custom-request="v => fnUpload(v, item.name)"
|
||||
>
|
||||
<a-button
|
||||
type="primary"
|
||||
:loading="state.from.uploadLoading"
|
||||
>
|
||||
<template #icon>
|
||||
<UploadOutlined />
|
||||
</template>
|
||||
</a-button>
|
||||
</a-upload>
|
||||
</a-input-group>
|
||||
<a-input
|
||||
v-else
|
||||
v-model:value="state.from[item.name]"
|
||||
|
||||
@@ -75,7 +75,7 @@ type TabeStateType = {
|
||||
/**表格状态 */
|
||||
let tableState: TabeStateType = reactive({
|
||||
loading: false,
|
||||
size: 'middle',
|
||||
size: 'small',
|
||||
striped: false,
|
||||
seached: true,
|
||||
data: [],
|
||||
@@ -88,19 +88,19 @@ let tableColumns: ColumnsType = [
|
||||
dataIndex: 'imsi',
|
||||
align: 'left',
|
||||
sorter: true,
|
||||
width: 200,
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: 'AMF',
|
||||
dataIndex: 'amf',
|
||||
align: 'center',
|
||||
minWidth: 100,
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: 'Status',
|
||||
dataIndex: 'status',
|
||||
align: 'center',
|
||||
minWidth: 100,
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
// {
|
||||
// title: 'KI',
|
||||
@@ -117,14 +117,13 @@ let tableColumns: ColumnsType = [
|
||||
{
|
||||
title: 'Algo Index',
|
||||
dataIndex: 'algoIndex',
|
||||
align: 'center',
|
||||
minWidth: 100,
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('common.operate'),
|
||||
key: 'imsi',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
align: 'left',
|
||||
},
|
||||
];
|
||||
|
||||
@@ -1275,6 +1274,7 @@ onMounted(() => {
|
||||
:hidden="!uploadImportState.msg"
|
||||
:value="uploadImportState.msg"
|
||||
:auto-size="{ minRows: 2, maxRows: 8 }"
|
||||
style="background-color: transparent; color: rgba(0, 0, 0, 0.85)"
|
||||
/>
|
||||
</template>
|
||||
</UploadModal>
|
||||
|
||||
@@ -57,7 +57,7 @@ type TabeStateType = {
|
||||
/**表格状态 */
|
||||
let tableState: TabeStateType = reactive({
|
||||
loading: false,
|
||||
size: 'middle',
|
||||
size: 'small',
|
||||
striped: false,
|
||||
seached: true,
|
||||
data: [],
|
||||
@@ -81,7 +81,7 @@ let tableColumns: ColumnsType = [
|
||||
{
|
||||
title: 'NodeB Name',
|
||||
dataIndex: 'name',
|
||||
align: 'center',
|
||||
align: 'left',
|
||||
width: 2,
|
||||
},
|
||||
{
|
||||
@@ -292,7 +292,7 @@ onMounted(() => {
|
||||
:size="tableState.size"
|
||||
:row-class-name="fnTableStriped"
|
||||
:pagination="tablePagination"
|
||||
:scroll="{ x: 1000, y: 400 }"
|
||||
:scroll="{ y: 450 }"
|
||||
>
|
||||
</a-table>
|
||||
</a-card>
|
||||
|
||||
@@ -78,7 +78,7 @@ type TabeStateType = {
|
||||
/**表格状态 */
|
||||
let tableState: TabeStateType = reactive({
|
||||
loading: false,
|
||||
size: 'middle',
|
||||
size: 'small',
|
||||
striped: false,
|
||||
seached: true,
|
||||
data: [],
|
||||
@@ -111,55 +111,54 @@ let tableColumns: ColumnsType = [
|
||||
{
|
||||
title: 'Subscribed AMBR Temp',
|
||||
dataIndex: 'ambr',
|
||||
align: 'center',
|
||||
minWidth: 100,
|
||||
align: 'left',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: 'Subscribed SNSSAIs Temp',
|
||||
dataIndex: 'sar',
|
||||
align: 'center',
|
||||
minWidth: 100,
|
||||
align: 'left',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: 'RAT Restriction',
|
||||
dataIndex: 'rat',
|
||||
align: 'center',
|
||||
minWidth: 100,
|
||||
align: 'left',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: 'Forbidden Areas Temp',
|
||||
dataIndex: 'arfb',
|
||||
align: 'center',
|
||||
minWidth: 100,
|
||||
align: 'left',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: 'Service Area Restrict Temp',
|
||||
dataIndex: 'nssai',
|
||||
align: 'center',
|
||||
minWidth: 100,
|
||||
align: 'left',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: 'CN Type Restriction',
|
||||
dataIndex: 'cn',
|
||||
align: 'center',
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
title: 'Subscribed Data',
|
||||
dataIndex: 'smData',
|
||||
align: 'center',
|
||||
minWidth: 100,
|
||||
align: 'left',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: 'EPS Flag',
|
||||
dataIndex: 'epsFlag',
|
||||
align: 'center',
|
||||
minWidth: 100,
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: 'Subscribed Data',
|
||||
dataIndex: 'smData',
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('common.operate'),
|
||||
key: 'imsi',
|
||||
align: 'center',
|
||||
align: 'left',
|
||||
fixed: 'right',
|
||||
width: 100,
|
||||
},
|
||||
@@ -2067,6 +2066,7 @@ onMounted(() => {
|
||||
:hidden="!uploadImportState.msg"
|
||||
:value="uploadImportState.msg"
|
||||
:auto-size="{ minRows: 2, maxRows: 8 }"
|
||||
style="background-color: transparent; color: rgba(0, 0, 0, 0.85)"
|
||||
/>
|
||||
</template>
|
||||
</UploadModal>
|
||||
|
||||
@@ -30,6 +30,12 @@ let queryParams = reactive({
|
||||
neType: '',
|
||||
/**记录时间 */
|
||||
beginTime: '',
|
||||
/**任务ID */
|
||||
taskId: '',
|
||||
/**排序字段 */
|
||||
sortField: 'value',
|
||||
/**排序方式 */
|
||||
sortOrder: 'asc',
|
||||
endTime: '',
|
||||
/**当前页数 */
|
||||
pageNum: 1,
|
||||
@@ -43,6 +49,8 @@ function fnQueryReset() {
|
||||
neType: '',
|
||||
beginTime: '',
|
||||
endTime: '',
|
||||
sortField: 'value',
|
||||
sortOrder: 'asc',
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
});
|
||||
@@ -108,34 +116,31 @@ let tableColumns: ColumnsType = [
|
||||
{
|
||||
title: t('views.perfManage.perfData.value'),
|
||||
dataIndex: 'value',
|
||||
key: 'value',
|
||||
align: 'center',
|
||||
sorter: (a: any, b: any) => {
|
||||
return 1;
|
||||
},
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: t('views.perfManage.perfData.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.perfData.endTime'),
|
||||
dataIndex: 'endTime',
|
||||
align: 'center',
|
||||
key: 'end_time',
|
||||
customRender(opt) {
|
||||
if (!opt.value) return '';
|
||||
return parseDateToStr(opt.value);
|
||||
},
|
||||
sorter: (a: any, b: any) => {
|
||||
return 1;
|
||||
},
|
||||
sorter: true,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -176,7 +181,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) {
|
||||
@@ -193,6 +198,18 @@ function fnGetList(pageNum?: number) {
|
||||
});
|
||||
}
|
||||
|
||||
/**表格分页、排序、筛选变化时触发操作, 排序方式,取值为 ascend descend */
|
||||
function fnTableChange(pagination: any, filters: any, sorter: any, extra: any) {
|
||||
const { columnKey, order } = sorter;
|
||||
if (order) {
|
||||
queryParams.sortField = columnKey;
|
||||
queryParams.sortOrder = order.replace('end', '');
|
||||
} else {
|
||||
queryParams.sortOrder = 'asc';
|
||||
}
|
||||
fnGetList(1);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// 初始字典数据
|
||||
Promise.allSettled([getDict('alarm_status')]).then(resArr => {
|
||||
@@ -217,8 +234,11 @@ 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="t('views.perfManage.perfData.type')" name="neType">
|
||||
<a-col :lg="4" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.perfManage.perfData.type')"
|
||||
name="neType"
|
||||
>
|
||||
<a-auto-complete
|
||||
v-model:value="queryParams.neType"
|
||||
:options="useNeInfoStore().getNeSelectOtions"
|
||||
@@ -226,8 +246,21 @@ onMounted(() => {
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="8" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.perfManage.perfData.startTime')" name="queryRangePicker">
|
||||
|
||||
<a-col :lg="4" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.perfManage.perfData.taskId')"
|
||||
name="taskId"
|
||||
>
|
||||
<a-input v-model:value="queryParams.taskId" allow-clear></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :lg="10" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.perfManage.perfData.startTime')"
|
||||
name="queryRangePicker"
|
||||
>
|
||||
<a-range-picker
|
||||
v-model:value="queryRangePicker"
|
||||
allow-clear
|
||||
@@ -316,6 +349,7 @@ onMounted(() => {
|
||||
:data-source="tableState.data"
|
||||
:size="tableState.size"
|
||||
:pagination="tablePagination"
|
||||
@change="fnTableChange"
|
||||
:scroll="{ x: true }"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
<script lang="ts" setup>
|
||||
import { Modal, message } from 'ant-design-vue/lib';
|
||||
import { onMounted, reactive } from 'vue';
|
||||
import useAppStore from '@/store/modules/app';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { transferHelpDoc } from '@/api/index';
|
||||
import { uploadFileChunk } from '@/api/tool/file';
|
||||
import { FileType } from 'ant-design-vue/lib/upload/interface';
|
||||
import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface';
|
||||
import { sessionGet } from '@/utils/cache-session-utils';
|
||||
import { useRouter } from 'vue-router';
|
||||
const appStore = useAppStore();
|
||||
const router = useRouter();
|
||||
const { t, currentLocale, optionsLocale } = useI18n();
|
||||
|
||||
@@ -99,6 +96,16 @@ function fnSave() {
|
||||
});
|
||||
}
|
||||
|
||||
/**系统使用手册跳转 */
|
||||
function fnClickHelpDoc(language?: string) {
|
||||
const routeData = router.resolve({ name: 'HelpDoc' });
|
||||
let href = routeData.href;
|
||||
if (language) {
|
||||
href = `${routeData.href}?language=${language}`;
|
||||
}
|
||||
window.open(href, '_blank');
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
state.language = currentLocale.value;
|
||||
});
|
||||
@@ -168,11 +175,7 @@ onMounted(() => {
|
||||
{{ opt.label }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-button
|
||||
type="link"
|
||||
:href="'/help?language=' + state.language"
|
||||
target="_blank"
|
||||
>
|
||||
<a-button type="link" @click="fnClickHelpDoc(state.language)">
|
||||
<template #icon>
|
||||
<QuestionCircleOutlined />
|
||||
{{ t('views.system.setting.sysHelpDocOpen') }}
|
||||
|
||||
@@ -1501,6 +1501,7 @@ onMounted(() => {
|
||||
:hidden="!uploadImportState.msg"
|
||||
:value="uploadImportState.msg"
|
||||
:auto-size="{ minRows: 2, maxRows: 8 }"
|
||||
style="background-color: transparent; color: rgba(0, 0, 0, 0.85)"
|
||||
/>
|
||||
</template>
|
||||
</UploadModal>
|
||||
|
||||
Reference in New Issue
Block a user