Merge remote-tracking branch 'origin/main' into multi-tenant

This commit is contained in:
TsMask
2025-01-16 20:59:41 +08:00
8 changed files with 109 additions and 23 deletions

View File

@@ -63,7 +63,11 @@ export async function getAlarmSet() {
} }
} }
if (Object.keys(resultData).length === 0) { if (Object.keys(resultData).length === 0) {
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR[language], data: {} }; return {
code: RESULT_CODE_ERROR,
msg: RESULT_MSG_ERROR[language],
data: {},
};
} }
return { return {
code: RESULT_CODE_SUCCESS, code: RESULT_CODE_SUCCESS,
@@ -117,7 +121,11 @@ export async function updateAlarmSet(data: Record<string, any>) {
} }
// 无变更时 // 无变更时
if (resultNum === 0) { if (resultNum === 0) {
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR[language], data: 0 }; return {
code: RESULT_CODE_ERROR,
msg: RESULT_MSG_ERROR[language],
data: 0,
};
} }
return { return {
code: RESULT_CODE_SUCCESS, code: RESULT_CODE_SUCCESS,
@@ -166,11 +174,10 @@ export async function getForwardSet() {
*/ */
export async function updateForwardSet(data: Record<string, any>) { export async function updateForwardSet(data: Record<string, any>) {
// return false; // return false;
console.log(data) let obj: any = [
let obj:any=[ { interface: 'Email', to_user: data.emailObj },
{interface:"Email",to_user:data.emailObj}, { interface: 'SMS', to_user: data.smsObj },
{interface:"SMS",to_user:data.smsObj} ];
]
const result = await request({ const result = await request({
url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='forwardAlarm'`, url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='forwardAlarm'`,
method: 'put', method: 'put',

View File

@@ -7,8 +7,10 @@ declare module '*.vue' {
export default component; export default component;
} }
// "vue3-smooth-dnd": "^0.0.6"
declare module 'vue3-smooth-dnd'; declare module 'vue3-smooth-dnd';
// "intl-tel-input": "^25.2.0"
declare module 'intl-tel-input/intlTelInputWithUtils' { declare module 'intl-tel-input/intlTelInputWithUtils' {
import intlTelInput from 'intl-tel-input'; import intlTelInput from 'intl-tel-input';
export default intlTelInput; export default intlTelInput;

View File

@@ -129,7 +129,7 @@ async function fnGetList(reload: boolean = false) {
const res = await listAllNeInfo({ bandStatus: true }); const res = await listAllNeInfo({ bandStatus: true });
tableState.data = res.data; tableState.data = res.data;
} catch (error) { } catch (error) {
console.log(error); console.error(error);
tableState.data = []; tableState.data = [];
} }
tableState.loading = false; tableState.loading = false;

View File

@@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref, onMounted, toRaw } from 'vue'; import { reactive, ref, onMounted, toRaw, computed } from 'vue';
import { Form, message, Modal } from 'ant-design-vue'; import { Form, message, Modal } from 'ant-design-vue';
import { SizeType } from 'ant-design-vue/es/config-provider'; import { SizeType } from 'ant-design-vue/es/config-provider';
import { ColumnsType } from 'ant-design-vue/es/table'; import { ColumnsType } from 'ant-design-vue/es/table';
@@ -74,50 +74,68 @@ let tableState: TabeStateType = reactive({
/**表格字段列 */ /**表格字段列 */
let tableColumns = ref<ColumnsType>([ let tableColumns = ref<ColumnsType>([
{ // {
title: t('common.rowId'), // title: t('common.rowId'),
dataIndex: 'index', // dataIndex: 'index',
align: 'left', // align: 'left',
width: 80, // width: 80,
}, // },
{ {
title: t('views.neData.baseStation.name'), title: t('views.neData.baseStation.name'),
dataIndex: 'name', dataIndex: 'name',
align: 'left', align: 'left',
width: 150, resizable: true,
width: 120,
minWidth: 100,
maxWidth: 250,
ellipsis: true, ellipsis: true,
}, },
{ {
title: t('views.neData.baseStation.position'), title: t('views.neData.baseStation.position'),
dataIndex: 'position', dataIndex: 'position',
align: 'left', align: 'left',
resizable: true,
width: 150, width: 150,
minWidth: 100,
maxWidth: 400,
ellipsis: true, ellipsis: true,
}, },
{ {
title: t('views.neData.baseStation.address'), title: t('views.neData.baseStation.address'),
dataIndex: 'address', dataIndex: 'address',
align: 'left', align: 'left',
resizable: true,
width: 100, width: 100,
minWidth: 100,
maxWidth: 200,
}, },
{ {
title: t('views.neData.baseStation.nbName'), title: t('views.neData.baseStation.nbName'),
dataIndex: 'nbName', dataIndex: 'nbName',
align: 'left', align: 'left',
resizable: true,
width: 100, width: 100,
minWidth: 100,
maxWidth: 200,
}, },
{ {
title: t('views.neData.baseStation.ueNum'), title: t('views.neData.baseStation.ueNum'),
dataIndex: 'ueNum', dataIndex: 'ueNum',
align: 'left', align: 'left',
resizable: true,
width: 80, width: 80,
minWidth: 80,
maxWidth: 120,
}, },
{ {
title: t('views.neData.baseStation.state'), title: t('views.neData.baseStation.state'),
dataIndex: 'state', dataIndex: 'state',
key: 'state', key: 'state',
align: 'left', align: 'left',
resizable: true,
width: 80, width: 80,
minWidth: 80,
maxWidth: 120,
}, },
{ {
title: t('views.neData.baseStation.time'), title: t('views.neData.baseStation.time'),
@@ -125,7 +143,6 @@ let tableColumns = ref<ColumnsType>([
width: 150, width: 150,
customRender(opt) { customRender(opt) {
const record = opt.value; const record = opt.value;
console.log(opt);
if (record.state === 'OFF') { if (record.state === 'OFF') {
return record.offTime || '-'; return record.offTime || '-';
} }
@@ -261,6 +278,20 @@ function fnGetList() {
}); });
} }
const stateNum = computed(() => {
let onNum = 0;
let offNum = 0;
tableState.data.forEach((item: any) => {
if (item.state === 'ON') {
onNum += 1;
}
if (item.state === 'OFF') {
offNum += 1;
}
});
return [onNum, offNum];
});
/**对话框对象信息状态类型 */ /**对话框对象信息状态类型 */
type ModalStateType = { type ModalStateType = {
/**新增框或修改框是否显示 */ /**新增框或修改框是否显示 */
@@ -344,7 +375,7 @@ function fnModalOk() {
.then(e => { .then(e => {
modalState.confirmLoading = true; modalState.confirmLoading = true;
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
let result: any = modalState.title.startsWith('Edit') let result: any = from.state
? editAMFNbState(neID, from) ? editAMFNbState(neID, from)
: addAMFNbState(neID, from); : addAMFNbState(neID, from);
result result
@@ -506,6 +537,14 @@ onMounted(() => {
<!-- 插槽-卡片右侧 --> <!-- 插槽-卡片右侧 -->
<template #extra> <template #extra>
<a-space :size="8" align="center"> <a-space :size="8" align="center">
<div>
{{ t('views.neData.baseStation.online') }}:
<strong style="color: green">{{ stateNum[0] }} </strong>
{{ t('views.neData.baseStation.offline') }}:
<strong style="color: red">
{{ stateNum[1] }}
</strong>
</div>
<a-tooltip> <a-tooltip>
<template #title>{{ t('common.reloadText') }}</template> <template #title>{{ t('common.reloadText') }}</template>
<a-button type="text" @click.prevent="fnGetList()"> <a-button type="text" @click.prevent="fnGetList()">
@@ -524,12 +563,13 @@ onMounted(() => {
:data-source="tableState.data" :data-source="tableState.data"
:size="tableState.size" :size="tableState.size"
:pagination="tablePagination" :pagination="tablePagination"
:scroll="{ x: tableColumns.length * 120 }"
:row-selection="{ :row-selection="{
type: 'checkbox', type: 'checkbox',
selectedRowKeys: tableState.selectedRowKeys, selectedRowKeys: tableState.selectedRowKeys,
onChange: fnTableSelectedRowKeys, onChange: fnTableSelectedRowKeys,
}" }"
:scroll="{ x: tableColumns.length * 120, y: 'calc(100vh - 480px)' }"
@resizeColumn="(w:number, col:any) => (col.width = w)"
> >
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'state'"> <template v-if="column.key === 'state'">

View File

@@ -237,8 +237,13 @@ function fnModalEditOk(from: Record<string, any>) {
item.neName = from.neName; item.neName = from.neName;
item.ip = from.ip; item.ip = from.ip;
item.port = from.port; item.port = from.port;
if (item.status !== '2') { if (res.data.online) {
item.status = res.data.online ? '1' : '0'; item.status = '1';
if (res.data.standby) {
item.status = '3';
}
} else {
item.status = '0';
} }
Object.assign(item.serverState, res.data); Object.assign(item.serverState, res.data);
const resouresUsage = parseResouresUsage(item.serverState); const resouresUsage = parseResouresUsage(item.serverState);

View File

@@ -438,7 +438,6 @@ function fnModalCancel() {
* 选择性能指标,填充进当前计算公式的值 * 选择性能指标,填充进当前计算公式的值
*/ */
function fnSelectPer(s: any, option: any) { function fnSelectPer(s: any, option: any) {
console.log(option);
modalState.from.expression += `'${option.label}'`; modalState.from.expression += `'${option.label}'`;
} }

View File

@@ -1106,6 +1106,39 @@ onBeforeUnmount(() => {
</a-tooltip> </a-tooltip>
</span> </span>
</template> </template>
<template v-if="column.key === 'avg'">
<span>
{{ t('views.perfManage.kpiOverView.avgValue') }}
<a-tooltip placement="bottom">
<template #title>
<span>Average value over the time range</span>
</template>
<InfoCircleOutlined />
</a-tooltip>
</span>
</template>
<template v-if="column.key === 'max'">
<span>
{{ t('views.perfManage.kpiOverView.maxValue') }}
<a-tooltip placement="bottom">
<template #title>
<span>Maximum value in time range</span>
</template>
<InfoCircleOutlined />
</a-tooltip>
</span>
</template>
<template v-if="column.key === 'min'">
<span>
{{ t('views.perfManage.kpiOverView.minValue') }}
<a-tooltip placement="bottom">
<template #title>
<span>Minimum value in the time range</span>
</template>
<InfoCircleOutlined />
</a-tooltip>
</span>
</template>
</template> </template>
</a-table> </a-table>
</div> </div>

View File

@@ -532,7 +532,7 @@ function fnModalVisibleByVive(id: string | number) {
/**对话框tab查看 */ /**对话框tab查看 */
function fnViveTab(action: any) { function fnViveTab(action: any) {
console.log('fnViveTab', action); // console.log('fnViveTab', action);
if (modalState.viewFrom.action === action) return; if (modalState.viewFrom.action === action) return;
modalState.viewFrom.action = action; modalState.viewFrom.action = action;
modalState.viewFrom.content = ''; modalState.viewFrom.content = '';