fix: MML管理文件类型判断
This commit is contained in:
@@ -1666,7 +1666,9 @@ export default {
|
|||||||
requireIpv6: "{display} Not a legitimate IPV6 address.",
|
requireIpv6: "{display} Not a legitimate IPV6 address.",
|
||||||
requireEnum: "{display} is not a reasonable enumeration value.",
|
requireEnum: "{display} is not a reasonable enumeration value.",
|
||||||
requireBool: "{display} is not a reasonable boolean value.",
|
requireBool: "{display} is not a reasonable boolean value.",
|
||||||
|
requireFile: "{display} is not a value that matches the parameter file type.",
|
||||||
cmdQuickEntry: "Command Quick Entry",
|
cmdQuickEntry: "Command Quick Entry",
|
||||||
|
cmdQuickEntryHelp: "Line feed (Shift + Enter), Execute (Enter)",
|
||||||
cmdParamPanel: "Parameter Panel",
|
cmdParamPanel: "Parameter Panel",
|
||||||
clearForm: "Reset",
|
clearForm: "Reset",
|
||||||
clearLog: "Clear Logs",
|
clearLog: "Clear Logs",
|
||||||
|
|||||||
@@ -1666,7 +1666,9 @@ export default {
|
|||||||
requireIpv6: "{display} 不是合法的IPV6地址",
|
requireIpv6: "{display} 不是合法的IPV6地址",
|
||||||
requireEnum: "{display} 不是合理的枚举值",
|
requireEnum: "{display} 不是合理的枚举值",
|
||||||
requireBool: "{display} 不是合理的布尔类型的值",
|
requireBool: "{display} 不是合理的布尔类型的值",
|
||||||
|
requireFile: "{display} 不是符合参数文件类型的值",
|
||||||
cmdQuickEntry: "命令快速输入",
|
cmdQuickEntry: "命令快速输入",
|
||||||
|
cmdQuickEntryHelp: "换行(Shift + Enter) 执行发送(Enter)",
|
||||||
cmdParamPanel: "参数面板",
|
cmdParamPanel: "参数面板",
|
||||||
clearForm: "重置",
|
clearForm: "重置",
|
||||||
clearLog: "清除日志",
|
clearLog: "清除日志",
|
||||||
|
|||||||
@@ -314,6 +314,15 @@ function ruleVerification(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'file':
|
||||||
|
if (filter) {
|
||||||
|
const arr: string[] = filter.split(',');
|
||||||
|
const itemArr = arr.filter(item => value.endsWith(item));
|
||||||
|
if (itemArr.length === 0) {
|
||||||
|
return [false, t('views.mmlManage.requireFile', { display })];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
console.warn(t('views.mmlManage.requireUn', { display }), type);
|
console.warn(t('views.mmlManage.requireUn', { display }), type);
|
||||||
@@ -642,7 +651,10 @@ onMounted(() => {
|
|||||||
:validate-on-rule-change="false"
|
:validate-on-rule-change="false"
|
||||||
:validateTrigger="[]"
|
:validateTrigger="[]"
|
||||||
>
|
>
|
||||||
<a-form-item :label="t('views.mmlManage.cmdQuickEntry')">
|
<a-form-item
|
||||||
|
:label="t('views.mmlManage.cmdQuickEntry')"
|
||||||
|
:help="t('views.mmlManage.cmdQuickEntryHelp')"
|
||||||
|
>
|
||||||
<!-- 非UPF通用4100 -->
|
<!-- 非UPF通用4100 -->
|
||||||
<a-auto-complete
|
<a-auto-complete
|
||||||
v-if="state.neType[0] !== 'UPF'"
|
v-if="state.neType[0] !== 'UPF'"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ let neOptions = ref<Record<string, any>[]>([]);
|
|||||||
/**对象信息状态类型 */
|
/**对象信息状态类型 */
|
||||||
type StateType = {
|
type StateType = {
|
||||||
/**网元ID */
|
/**网元ID */
|
||||||
neId: string;
|
neId: string | undefined;
|
||||||
/**命令数据 tree */
|
/**命令数据 tree */
|
||||||
mmlTreeData: any[];
|
mmlTreeData: any[];
|
||||||
/**命令选中 */
|
/**命令选中 */
|
||||||
@@ -37,7 +37,7 @@ type StateType = {
|
|||||||
|
|
||||||
/**对象信息状态 */
|
/**对象信息状态 */
|
||||||
let state: StateType = reactive({
|
let state: StateType = reactive({
|
||||||
neId: '',
|
neId: undefined,
|
||||||
mmlTreeData: [],
|
mmlTreeData: [],
|
||||||
mmlSelect: {
|
mmlSelect: {
|
||||||
title: '',
|
title: '',
|
||||||
@@ -108,6 +108,13 @@ function fnSendMML() {
|
|||||||
if (state.from.sendLoading) {
|
if (state.from.sendLoading) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!state.neId) {
|
||||||
|
message.warning({
|
||||||
|
content: t('views.mmlManage.udmOpesrate.noOMC'),
|
||||||
|
duration: 5,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let cmdArr: string[] = [];
|
let cmdArr: string[] = [];
|
||||||
const operation = state.mmlSelect.operation;
|
const operation = state.mmlSelect.operation;
|
||||||
@@ -196,13 +203,21 @@ function fnSendMML() {
|
|||||||
|
|
||||||
/**上传变更 */
|
/**上传变更 */
|
||||||
function fnUpload(up: UploadRequestOption, name: string) {
|
function fnUpload(up: UploadRequestOption, name: string) {
|
||||||
|
const neId = state.neId;
|
||||||
|
if (!neId) {
|
||||||
|
message.warning({
|
||||||
|
content: t('views.mmlManage.udmOpesrate.noOMC'),
|
||||||
|
duration: 5,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: t('common.tipTitle'),
|
title: t('common.tipTitle'),
|
||||||
content: t('views.mmlManage.uploadFileTip'),
|
content: t('views.mmlManage.uploadFileTip'),
|
||||||
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;
|
||||||
uploadFileToNE('OMC', state.neId, up.file as File, 5)
|
uploadFileToNE('OMC', neId, up.file as File, 5)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
// 文件转存
|
// 文件转存
|
||||||
if (res.code === RESULT_CODE_SUCCESS) {
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
@@ -308,6 +323,15 @@ function ruleVerification(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'file':
|
||||||
|
if (filter) {
|
||||||
|
const arr: string[] = filter.split(',');
|
||||||
|
const itemArr = arr.filter(item => value.endsWith(item));
|
||||||
|
if (itemArr.length === 0) {
|
||||||
|
return [false, t('views.mmlManage.requireFile', { display })];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
console.warn(t('views.mmlManage.requireUn', { display }), type);
|
console.warn(t('views.mmlManage.requireUn', { display }), type);
|
||||||
@@ -486,15 +510,16 @@ onMounted(() => {
|
|||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||||
if (res.data.length > 0) {
|
if (res.data.length > 0) {
|
||||||
let arr: Record<string, any>[] = [];
|
// 获取可用OMC
|
||||||
res.data.forEach(i => {
|
const omcArr = useNeInfoStore().getNeSelectOtions.find(
|
||||||
if (i.neType === 'OMC') {
|
item => item.value === 'OMC'
|
||||||
arr.push({ value: i.neId, label: i.neName });
|
);
|
||||||
}
|
if (omcArr) {
|
||||||
});
|
neOptions.value = omcArr.children;
|
||||||
neOptions.value = arr;
|
}
|
||||||
if (arr.length > 0) {
|
// 是否有可选项
|
||||||
state.neId = arr[0].value;
|
if (neOptions.value.length > 0) {
|
||||||
|
state.neId = neOptions.value[0].value;
|
||||||
// 获取列表数据
|
// 获取列表数据
|
||||||
fnGetList();
|
fnGetList();
|
||||||
}
|
}
|
||||||
@@ -588,7 +613,10 @@ onMounted(() => {
|
|||||||
:validate-on-rule-change="false"
|
:validate-on-rule-change="false"
|
||||||
:validateTrigger="[]"
|
:validateTrigger="[]"
|
||||||
>
|
>
|
||||||
<a-form-item :label="t('views.mmlManage.cmdQuickEntry')">
|
<a-form-item
|
||||||
|
:label="t('views.mmlManage.cmdQuickEntry')"
|
||||||
|
:help="t('views.mmlManage.cmdQuickEntryHelp')"
|
||||||
|
>
|
||||||
<a-auto-complete
|
<a-auto-complete
|
||||||
v-model:value="state.autoCompleteValue"
|
v-model:value="state.autoCompleteValue"
|
||||||
:dropdown-match-select-width="500"
|
:dropdown-match-select-width="500"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ let neOptions = ref<Record<string, any>[]>([]);
|
|||||||
/**对象信息状态类型 */
|
/**对象信息状态类型 */
|
||||||
type StateType = {
|
type StateType = {
|
||||||
/**网元ID */
|
/**网元ID */
|
||||||
neId: string;
|
neId: string | undefined;
|
||||||
/**命令数据 tree */
|
/**命令数据 tree */
|
||||||
mmlTreeData: any[];
|
mmlTreeData: any[];
|
||||||
/**命令选中 */
|
/**命令选中 */
|
||||||
@@ -37,7 +37,7 @@ type StateType = {
|
|||||||
|
|
||||||
/**对象信息状态 */
|
/**对象信息状态 */
|
||||||
let state: StateType = reactive({
|
let state: StateType = reactive({
|
||||||
neId: '',
|
neId: undefined,
|
||||||
mmlTreeData: [],
|
mmlTreeData: [],
|
||||||
mmlSelect: {
|
mmlSelect: {
|
||||||
title: '',
|
title: '',
|
||||||
@@ -108,6 +108,13 @@ function fnSendMML() {
|
|||||||
if (state.from.sendLoading) {
|
if (state.from.sendLoading) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!state.neId) {
|
||||||
|
message.warning({
|
||||||
|
content: t('views.mmlManage.udmOpesrate.noUDM'),
|
||||||
|
duration: 5,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let cmdArr: string[] = [];
|
let cmdArr: string[] = [];
|
||||||
const operation = state.mmlSelect.operation;
|
const operation = state.mmlSelect.operation;
|
||||||
@@ -196,13 +203,21 @@ function fnSendMML() {
|
|||||||
|
|
||||||
/**上传变更 */
|
/**上传变更 */
|
||||||
function fnUpload(up: UploadRequestOption, name: string) {
|
function fnUpload(up: UploadRequestOption, name: string) {
|
||||||
|
const neId = state.neId;
|
||||||
|
if (!neId) {
|
||||||
|
message.warning({
|
||||||
|
content: t('views.mmlManage.udmOpesrate.noUDM'),
|
||||||
|
duration: 5,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: t('common.tipTitle'),
|
title: t('common.tipTitle'),
|
||||||
content: t('views.mmlManage.uploadFileTip'),
|
content: t('views.mmlManage.uploadFileTip'),
|
||||||
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;
|
||||||
uploadFileToNE('UDM', state.neId, up.file as File, 5)
|
uploadFileToNE('UDM', neId, up.file as File, 5)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
// 文件转存
|
// 文件转存
|
||||||
if (res.code === RESULT_CODE_SUCCESS) {
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
@@ -308,6 +323,15 @@ function ruleVerification(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'file':
|
||||||
|
if (filter) {
|
||||||
|
const arr: string[] = filter.split(',');
|
||||||
|
const itemArr = arr.filter(item => value.endsWith(item));
|
||||||
|
if (itemArr.length === 0) {
|
||||||
|
return [false, t('views.mmlManage.requireFile', { display })];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
console.warn(t('views.mmlManage.requireUn', { display }), type);
|
console.warn(t('views.mmlManage.requireUn', { display }), type);
|
||||||
@@ -486,15 +510,16 @@ onMounted(() => {
|
|||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||||
if (res.data.length > 0) {
|
if (res.data.length > 0) {
|
||||||
let arr: Record<string, any>[] = [];
|
// 获取可用UDM
|
||||||
res.data.forEach(i => {
|
const udmArr = useNeInfoStore().getNeSelectOtions.find(
|
||||||
if (i.neType === 'UDM') {
|
item => item.value === 'UDM'
|
||||||
arr.push({ value: i.neId, label: i.neName });
|
);
|
||||||
}
|
if (udmArr) {
|
||||||
});
|
neOptions.value = udmArr.children;
|
||||||
neOptions.value = arr;
|
}
|
||||||
if (arr.length > 0) {
|
// 是否有可选项
|
||||||
state.neId = arr[0].value;
|
if (neOptions.value.length > 0) {
|
||||||
|
state.neId = neOptions.value[0].value;
|
||||||
// 获取列表数据
|
// 获取列表数据
|
||||||
fnGetList();
|
fnGetList();
|
||||||
} else {
|
} else {
|
||||||
@@ -593,7 +618,10 @@ onMounted(() => {
|
|||||||
:validate-on-rule-change="false"
|
:validate-on-rule-change="false"
|
||||||
:validateTrigger="[]"
|
:validateTrigger="[]"
|
||||||
>
|
>
|
||||||
<a-form-item :label="t('views.mmlManage.cmdQuickEntry')">
|
<a-form-item
|
||||||
|
:label="t('views.mmlManage.cmdQuickEntry')"
|
||||||
|
:help="t('views.mmlManage.cmdQuickEntryHelp')"
|
||||||
|
>
|
||||||
<a-auto-complete
|
<a-auto-complete
|
||||||
v-model:value="state.autoCompleteValue"
|
v-model:value="state.autoCompleteValue"
|
||||||
:dropdown-match-select-width="500"
|
:dropdown-match-select-width="500"
|
||||||
|
|||||||
Reference in New Issue
Block a user