This commit is contained in:
lai
2023-12-14 11:33:49 +08:00
5 changed files with 85 additions and 15 deletions

View File

@@ -17,5 +17,5 @@ export function parseUrlPath(path: string) {
const baseUrl = import.meta.env.PROD
? sessionGet('baseUrl') || import.meta.env.VITE_API_BASE_URL
: import.meta.env.VITE_API_BASE_URL;
return `${baseUrl}${path}`;
return `${baseUrl}${path}?r=${Math.random().toFixed(2)}`;
}

View File

@@ -64,6 +64,22 @@ let state: StateType = reactive({
function fnTreeSelect(_: any, info: any) {
state.mmlSelect = info.node.dataRef;
state.from = {};
// 遍历判断是否有初始value
if (Array.isArray(state.mmlSelect.param)) {
for (const param of state.mmlSelect.param) {
if (typeof param.value !== 'undefined' && param.value != '') {
const valueType = param.type;
if (['enum', 'int'].includes(valueType)) {
state.from[param.name] = Number(param.value);
} else if (valueType === 'bool') {
state.from[param.name] = Boolean(param.value);
} else {
state.from[param.name] = param.value;
}
}
}
}
state.autoCompleteValue =
`${state.mmlSelect.operation} ${state.mmlSelect.object}`.trim();
// state.mmlCmdLog = '';
@@ -569,7 +585,7 @@ onMounted(() => {
</template>
<a-form
layout="vertical"
layout="horizontal"
autocomplete="off"
:validate-on-rule-change="false"
:validateTrigger="[]"
@@ -587,8 +603,15 @@ onMounted(() => {
<a-textarea :placeholder="t('common.ipnutPlease')" auto-size />
</a-auto-complete>
</a-form-item>
</a-form>
<template v-if="state.mmlSelect.operation && state.mmlSelect.param">
<template v-if="state.mmlSelect.operation && state.mmlSelect.param">
<a-form
layout="vertical"
autocomplete="off"
:validate-on-rule-change="false"
:validateTrigger="[]"
>
<a-divider orientation="left">
{{ t('views.mmlManage.cmdParamPanel') }}
</a-divider>
@@ -664,8 +687,8 @@ onMounted(() => {
</a-form-item>
</a-col>
</a-row>
</template>
</a-form>
</a-form>
</template>
</a-card>
<!-- 命令展示 -->

View File

@@ -60,6 +60,22 @@ let state: StateType = reactive({
function fnTreeSelect(_: any, info: any) {
state.mmlSelect = info.node.dataRef;
state.from = {};
// 遍历判断是否有初始value
if (Array.isArray(state.mmlSelect.param)) {
for (const param of state.mmlSelect.param) {
if (typeof param.value !== 'undefined' && param.value != '') {
const valueType = param.type;
if (['enum', 'int'].includes(valueType)) {
state.from[param.name] = Number(param.value);
} else if (valueType === 'bool') {
state.from[param.name] = Boolean(param.value);
} else {
state.from[param.name] = param.value;
}
}
}
}
state.autoCompleteValue =
`${state.mmlSelect.operation} ${state.mmlSelect.object}`.trim();
// state.mmlCmdLog = '';
@@ -537,7 +553,7 @@ onMounted(() => {
</template>
<a-form
layout="vertical"
layout="horizontal"
autocomplete="off"
:validate-on-rule-change="false"
:validateTrigger="[]"
@@ -555,8 +571,15 @@ onMounted(() => {
<a-textarea :placeholder="t('common.ipnutPlease')" auto-size />
</a-auto-complete>
</a-form-item>
</a-form>
<template v-if="state.mmlSelect.operation && state.mmlSelect.param">
<template v-if="state.mmlSelect.operation && state.mmlSelect.param">
<a-form
layout="vertical"
autocomplete="off"
:validate-on-rule-change="false"
:validateTrigger="[]"
>
<a-divider orientation="left">
{{ t('views.mmlManage.cmdParamPanel') }}
</a-divider>
@@ -632,8 +655,8 @@ onMounted(() => {
</a-form-item>
</a-col>
</a-row>
</template>
</a-form>
</a-form>
</template>
</a-card>
<!-- 命令展示 -->

View File

@@ -60,6 +60,22 @@ let state: StateType = reactive({
function fnTreeSelect(_: any, info: any) {
state.mmlSelect = info.node.dataRef;
state.from = {};
// 遍历判断是否有初始value
if (Array.isArray(state.mmlSelect.param)) {
for (const param of state.mmlSelect.param) {
if (typeof param.value !== 'undefined' && param.value != '') {
const valueType = param.type;
if (['enum', 'int'].includes(valueType)) {
state.from[param.name] = Number(param.value);
} else if (valueType === 'bool') {
state.from[param.name] = Boolean(param.value);
} else {
state.from[param.name] = param.value;
}
}
}
}
state.autoCompleteValue =
`${state.mmlSelect.operation} ${state.mmlSelect.object}`.trim();
// state.mmlCmdLog = '';
@@ -542,7 +558,7 @@ onMounted(() => {
</template>
<a-form
layout="vertical"
layout="horizontal"
autocomplete="off"
:validate-on-rule-change="false"
:validateTrigger="[]"
@@ -560,8 +576,15 @@ onMounted(() => {
<a-textarea :placeholder="t('common.ipnutPlease')" auto-size />
</a-auto-complete>
</a-form-item>
</a-form>
<template v-if="state.mmlSelect.operation && state.mmlSelect.param">
<template v-if="state.mmlSelect.operation && state.mmlSelect.param">
<a-form
layout="vertical"
autocomplete="off"
:validate-on-rule-change="false"
:validateTrigger="[]"
>
<a-divider orientation="left">
{{ t('views.mmlManage.cmdParamPanel') }}
</a-divider>
@@ -637,8 +660,8 @@ onMounted(() => {
</a-form-item>
</a-col>
</a-row>
</template>
</a-form>
</a-form>
</template>
</a-card>
<!-- 命令展示 -->

View File

@@ -454,6 +454,7 @@ const modalStateFrom = Form.useForm(
modalState.from,
reactive({
imsi: [{ required: true, message: 'IMSI' + t('common.unableNull') }],
msisdn: [{ required: true, message: 'MSISDN' + t('common.unableNull') }],
staticIp: [
{ required: true, message: 'static ip' + t('common.unableNull') },
],
@@ -473,7 +474,7 @@ const modalStateFrom = Form.useForm(
function fnModalOk() {
const from = Object.assign({}, toRaw(modalState.from));
let validateNames = ['imsi', 'staticIp'];
let validateNames = ['imsi', 'msisdn', 'staticIp'];
if (from.id === '') {
validateNames.push('smData');
@@ -573,7 +574,7 @@ function fnBatchModalOk() {
modalState.confirmLoading = true;
let ardArr = [0, 0, 0, 0, 0, 0, 0, 0];
let hplmnArr = [0, 0, 0, 0, 0, 0, 0, 0];
let odbArr = [0, 0, 0, 0, 0, 0, 0, 0,0];
let odbArr = [0, 0, 0, 0, 0, 0, 0, 0, 0];
from.ard.forEach((item: any) => {
ardArr[item] = 1;