This commit is contained in:
lai
2024-02-19 14:45:43 +08:00
8 changed files with 157 additions and 44 deletions

View File

@@ -11,6 +11,7 @@ export function exportAuth(query: Record<string, any>) {
method: 'post', method: 'post',
data: query, data: query,
responseType: 'blob', responseType: 'blob',
timeout: 180_000,
}); });
} }
@@ -78,6 +79,7 @@ export function updateAuth(data: Record<string, any>) {
url: `/ne/udm/auth/${data.neId}`, url: `/ne/udm/auth/${data.neId}`,
method: 'put', method: 'put',
data: data, data: data,
timeout: 180_000,
}); });
} }
@@ -91,6 +93,7 @@ export function addAuth(data: Record<string, any>) {
url: `/ne/udm/auth/${data.neId}`, url: `/ne/udm/auth/${data.neId}`,
method: 'post', method: 'post',
data: data, data: data,
timeout: 180_000,
}); });
} }
@@ -104,6 +107,7 @@ export function batchAuth(data: Record<string, any>) {
url: `/ne/udm/auth/${data.neID}/${data.num}`, url: `/ne/udm/auth/${data.neID}/${data.num}`,
method: 'post', method: 'post',
data: data, data: data,
timeout: 180_000,
}); });
} }
@@ -129,5 +133,6 @@ export function batchDelAuth(data: Record<string, any>) {
return request({ return request({
url: `/ne/udm/auth/${data.neID}/${data.imsi}/${data.num}`, url: `/ne/udm/auth/${data.neID}/${data.imsi}/${data.num}`,
method: 'delete', method: 'delete',
timeout: 180_000,
}); });
} }

View File

@@ -80,6 +80,7 @@ export function updateSub(neId: string, data: Record<string, any>) {
url: `/ne/udm/sub/${neId}`, url: `/ne/udm/sub/${neId}`,
method: 'put', method: 'put',
data: data, data: data,
timeout: 180_000,
}); });
} }
@@ -93,6 +94,7 @@ export function addSub(neID: string, data: Record<string, any>) {
url: `/ne/udm/sub/${neID}`, url: `/ne/udm/sub/${neID}`,
method: 'post', method: 'post',
data: data, data: data,
timeout: 180_000,
}); });
} }
@@ -106,6 +108,7 @@ export function batchAddSub(data: Record<string, any>) {
url: `/ne/udm/sub/${data.neID}/${data.num}`, url: `/ne/udm/sub/${data.neID}/${data.num}`,
method: 'post', method: 'post',
data: data, data: data,
timeout: 180_000,
}); });
} }
@@ -131,5 +134,6 @@ export function batchDelSub(data: Record<string, any>) {
return request({ return request({
url: `/ne/udm/sub/${data.neID}/${data.imsi}/${data.num}`, url: `/ne/udm/sub/${data.neID}/${data.imsi}/${data.num}`,
method: 'delete', method: 'delete',
timeout: 180_000,
}); });
} }

View File

@@ -1,5 +1,5 @@
<template> <template>
<codemirror <Codemirror
:model-value="modelValue" :model-value="modelValue"
:placeholder="props.placeholder" :placeholder="props.placeholder"
:style="props.editorStyle" :style="props.editorStyle"

View File

@@ -175,20 +175,28 @@ function fnSendMML() {
// 发送 // 发送
state.from.sendLoading = true; state.from.sendLoading = true;
const [neType, neId] = state.neType; const [neType, neId] = state.neType;
sendMMlByNE(neType, neId, cmdArr).then(res => { sendMMlByNE(neType, neId, cmdArr)
state.from.sendLoading = false; .then(res => {
if (res.code === RESULT_CODE_SUCCESS) { state.from.sendLoading = false;
let resultArr = res.data; if (res.code === RESULT_CODE_SUCCESS) {
for (let i = 0; i < resultArr.length; i++) { let resultArr = res.data;
const str = resultArr[i]; for (let i = 0; i < resultArr.length; i++) {
const logStr = str.replace(/(\r\n|\n)/g, '\n'); const str = resultArr[i];
const cmdStr = cmdArr[i]; const logStr = str.replace(/(\r\n|\n)/g, '\n');
state.mmlCmdLog += `${cmdStr}\n${logStr}\n`; const cmdStr = cmdArr[i];
state.mmlCmdLog += `${cmdStr}\n${logStr}\n`;
}
} else {
state.mmlCmdLog += `${res.msg}\n`;
} }
} else { })
state.mmlCmdLog += `${res.msg}\n`; .finally(() => {
} // 控制台滚动底部
}); const container = document.getElementsByClassName('cm-scroller')[0];
if (container) {
container.scrollTop = container.scrollHeight;
}
});
} }
/**上传变更 */ /**上传变更 */
@@ -475,6 +483,28 @@ function fnAutoCompleteChange(value: any, _: any) {
} }
} }
/**自动完成按键触发 */
function fnAutoCompleteKeydown(evt: any) {
if (evt.key === 'Enter') {
// 阻止默认的换行行为
evt.preventDefault();
// 按下 Shift + Enter 键时换行
if (evt.shiftKey) {
// 插入换行符
const textarea = evt.target;
const start = textarea.selectionStart;
const end = textarea.selectionEnd;
const text = textarea.value;
textarea.value = text.substring(0, start) + '\n' + text.substring(end);
state.autoCompleteValue = textarea.value;
// 更新光标位置
textarea.selectionStart = textarea.selectionEnd = start + 1;
} else {
fnSendMML();
}
}
}
onMounted(() => { onMounted(() => {
// 获取网元网元列表 // 获取网元网元列表
neInfoStore.fnNelist().then(res => { neInfoStore.fnNelist().then(res => {
@@ -599,6 +629,7 @@ onMounted(() => {
@search="fnAutoCompleteSearch" @search="fnAutoCompleteSearch"
@select="fnAutoCompleteSelect" @select="fnAutoCompleteSelect"
@change="fnAutoCompleteChange" @change="fnAutoCompleteChange"
@keydown="fnAutoCompleteKeydown"
> >
<a-textarea :placeholder="t('common.inputPlease')" auto-size /> <a-textarea :placeholder="t('common.inputPlease')" auto-size />
</a-auto-complete> </a-auto-complete>

View File

@@ -170,20 +170,28 @@ function fnSendMML() {
// 发送 // 发送
state.from.sendLoading = true; state.from.sendLoading = true;
sendMMlByOMC(state.neId, cmdArr).then(res => { sendMMlByOMC(state.neId, cmdArr)
state.from.sendLoading = false; .then(res => {
if (res.code === RESULT_CODE_SUCCESS) { state.from.sendLoading = false;
let resultArr = res.data; if (res.code === RESULT_CODE_SUCCESS) {
for (let i = 0; i < resultArr.length; i++) { let resultArr = res.data;
const str = resultArr[i]; for (let i = 0; i < resultArr.length; i++) {
const logStr = str.replace(/(\r\n|\n)/g, '\n'); const str = resultArr[i];
const cmdStr = cmdArr[i]; const logStr = str.replace(/(\r\n|\n)/g, '\n');
state.mmlCmdLog += `${cmdStr}\n${logStr}\n`; const cmdStr = cmdArr[i];
state.mmlCmdLog += `${cmdStr}\n${logStr}\n`;
}
} else {
state.mmlCmdLog += `${res.msg}\n`;
} }
} else { })
state.mmlCmdLog += `${res.msg}\n`; .finally(() => {
} // 控制台滚动底部
}); const container = document.getElementsByClassName('cm-scroller')[0];
if (container) {
container.scrollTop = container.scrollHeight;
}
});
} }
/**上传变更 */ /**上传变更 */
@@ -449,6 +457,28 @@ function fnAutoCompleteChange(value: any, _: any) {
} }
} }
/**自动完成按键触发 */
function fnAutoCompleteKeydown(evt: any) {
if (evt.key === 'Enter') {
// 阻止默认的换行行为
evt.preventDefault();
// 按下 Shift + Enter 键时换行
if (evt.shiftKey) {
// 插入换行符
const textarea = evt.target;
const start = textarea.selectionStart;
const end = textarea.selectionEnd;
const text = textarea.value;
textarea.value = text.substring(0, start) + '\n' + text.substring(end);
state.autoCompleteValue = textarea.value;
// 更新光标位置
textarea.selectionStart = textarea.selectionEnd = start + 1;
} else {
fnSendMML();
}
}
}
onMounted(() => { onMounted(() => {
// 获取网元网元列表 // 获取网元网元列表
useNeInfoStore() useNeInfoStore()
@@ -567,6 +597,7 @@ onMounted(() => {
@search="fnAutoCompleteSearch" @search="fnAutoCompleteSearch"
@select="fnAutoCompleteSelect" @select="fnAutoCompleteSelect"
@change="fnAutoCompleteChange" @change="fnAutoCompleteChange"
@keydown="fnAutoCompleteKeydown"
> >
<a-textarea :placeholder="t('common.inputPlease')" auto-size /> <a-textarea :placeholder="t('common.inputPlease')" auto-size />
</a-auto-complete> </a-auto-complete>

View File

@@ -170,20 +170,28 @@ function fnSendMML() {
// 发送 // 发送
state.from.sendLoading = true; state.from.sendLoading = true;
sendMMlByUDM(state.neId, cmdArr).then(res => { sendMMlByUDM(state.neId, cmdArr)
state.from.sendLoading = false; .then(res => {
if (res.code === RESULT_CODE_SUCCESS) { state.from.sendLoading = false;
let resultArr = res.data; if (res.code === RESULT_CODE_SUCCESS) {
for (let i = 0; i < resultArr.length; i++) { let resultArr = res.data;
const str = resultArr[i]; for (let i = 0; i < resultArr.length; i++) {
const logStr = str.replace(/(\r\n|\n)/g, '\n'); const str = resultArr[i];
const cmdStr = cmdArr[i]; const logStr = str.replace(/(\r\n|\n)/g, '\n');
state.mmlCmdLog += `${cmdStr}\n${logStr}\n`; const cmdStr = cmdArr[i];
state.mmlCmdLog += `${cmdStr}\n${logStr}\n`;
}
} else {
state.mmlCmdLog += `${res.msg}\n`;
} }
} else { })
state.mmlCmdLog += `${res.msg}\n`; .finally(() => {
} // 控制台滚动底部
}); const container = document.getElementsByClassName('cm-scroller')[0];
if (container) {
container.scrollTop = container.scrollHeight;
}
});
} }
/**上传变更 */ /**上传变更 */
@@ -449,6 +457,28 @@ function fnAutoCompleteChange(value: any, _: any) {
} }
} }
/**自动完成按键触发 */
function fnAutoCompleteKeydown(evt: any) {
if (evt.key === 'Enter') {
// 阻止默认的换行行为
evt.preventDefault();
// 按下 Shift + Enter 键时换行
if (evt.shiftKey) {
// 插入换行符
const textarea = evt.target;
const start = textarea.selectionStart;
const end = textarea.selectionEnd;
const text = textarea.value;
textarea.value = text.substring(0, start) + '\n' + text.substring(end);
state.autoCompleteValue = textarea.value;
// 更新光标位置
textarea.selectionStart = textarea.selectionEnd = start + 1;
} else {
fnSendMML();
}
}
}
onMounted(() => { onMounted(() => {
// 获取网元网元列表 // 获取网元网元列表
useNeInfoStore() useNeInfoStore()
@@ -572,6 +602,7 @@ onMounted(() => {
@search="fnAutoCompleteSearch" @search="fnAutoCompleteSearch"
@select="fnAutoCompleteSelect" @select="fnAutoCompleteSelect"
@change="fnAutoCompleteChange" @change="fnAutoCompleteChange"
@keydown="fnAutoCompleteKeydown"
> >
<a-textarea :placeholder="t('common.inputPlease')" auto-size /> <a-textarea :placeholder="t('common.inputPlease')" auto-size />
</a-auto-complete> </a-auto-complete>

View File

@@ -640,7 +640,11 @@ function fnGetList(pageNum?: number) {
} }
tablePagination.total = res.total; tablePagination.total = res.total;
tableState.data = res.rows; tableState.data = res.rows;
if (tablePagination.total <=(queryParams.pageNum - 1) * tablePagination.pageSize &&queryParams.pageNum !== 1) { if (
tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize &&
queryParams.pageNum !== 1
) {
tableState.loading = false; tableState.loading = false;
fnGetList(queryParams.pageNum - 1); fnGetList(queryParams.pageNum - 1);
} }
@@ -1018,7 +1022,11 @@ onMounted(() => {
name="imsi" name="imsi"
v-bind="modalStateFrom.validateInfos.imsi" v-bind="modalStateFrom.validateInfos.imsi"
> >
<a-input v-model:value="modalState.from.imsi" allow-clear :disabled="!!modalState.from.id"> <a-input
v-model:value="modalState.from.imsi"
allow-clear
:disabled="!!modalState.from.id"
>
<template #prefix> <template #prefix>
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
<template #title> <template #title>
@@ -1092,7 +1100,7 @@ onMounted(() => {
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="16" v-if="!modalState.from.id"> <a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
label="KI" label="KI"
@@ -1103,6 +1111,7 @@ onMounted(() => {
v-model:value="modalState.from.ki" v-model:value="modalState.from.ki"
allow-clear allow-clear
:maxlength="32" :maxlength="32"
:disabled="!!modalState.from.id"
> >
<template #prefix> <template #prefix>
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
@@ -1125,6 +1134,7 @@ onMounted(() => {
v-model:value="modalState.from.opc" v-model:value="modalState.from.opc"
allow-clear allow-clear
:maxlength="32" :maxlength="32"
:disabled="!!modalState.from.id"
> >
<template #prefix> <template #prefix>
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">

View File

@@ -70,7 +70,8 @@ function fnDownload() {
fetch(url) fetch(url)
.then(response => response.blob()) .then(response => response.blob())
.then(blob => { .then(blob => {
const fileName = url.substring(url.lastIndexOf('/') + 1); let fileName = url.substring(url.lastIndexOf('/') + 1);
fileName = fileName.split('?')[0];
saveAs(blob, fileName); saveAs(blob, fileName);
}) })
.catch(error => { .catch(error => {