Merge remote-tracking branch 'origin/main' into multi-tenant
This commit is contained in:
@@ -129,7 +129,7 @@ async function fnGetList(reload: boolean = false) {
|
||||
const res = await listAllNeInfo({ bandStatus: true });
|
||||
tableState.data = res.data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
console.error(error);
|
||||
tableState.data = [];
|
||||
}
|
||||
tableState.loading = false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<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 { SizeType } from 'ant-design-vue/es/config-provider';
|
||||
import { ColumnsType } from 'ant-design-vue/es/table';
|
||||
@@ -74,50 +74,68 @@ let tableState: TabeStateType = reactive({
|
||||
|
||||
/**表格字段列 */
|
||||
let tableColumns = ref<ColumnsType>([
|
||||
{
|
||||
title: t('common.rowId'),
|
||||
dataIndex: 'index',
|
||||
align: 'left',
|
||||
width: 80,
|
||||
},
|
||||
// {
|
||||
// title: t('common.rowId'),
|
||||
// dataIndex: 'index',
|
||||
// align: 'left',
|
||||
// width: 80,
|
||||
// },
|
||||
{
|
||||
title: t('views.neData.baseStation.name'),
|
||||
dataIndex: 'name',
|
||||
align: 'left',
|
||||
width: 150,
|
||||
resizable: true,
|
||||
width: 120,
|
||||
minWidth: 100,
|
||||
maxWidth: 250,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: t('views.neData.baseStation.position'),
|
||||
dataIndex: 'position',
|
||||
align: 'left',
|
||||
resizable: true,
|
||||
width: 150,
|
||||
minWidth: 100,
|
||||
maxWidth: 400,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: t('views.neData.baseStation.address'),
|
||||
dataIndex: 'address',
|
||||
align: 'left',
|
||||
resizable: true,
|
||||
width: 100,
|
||||
minWidth: 100,
|
||||
maxWidth: 200,
|
||||
},
|
||||
{
|
||||
title: t('views.neData.baseStation.nbName'),
|
||||
dataIndex: 'nbName',
|
||||
align: 'left',
|
||||
resizable: true,
|
||||
width: 100,
|
||||
minWidth: 100,
|
||||
maxWidth: 200,
|
||||
},
|
||||
{
|
||||
title: t('views.neData.baseStation.ueNum'),
|
||||
dataIndex: 'ueNum',
|
||||
align: 'left',
|
||||
resizable: true,
|
||||
width: 80,
|
||||
minWidth: 80,
|
||||
maxWidth: 120,
|
||||
},
|
||||
{
|
||||
title: t('views.neData.baseStation.state'),
|
||||
dataIndex: 'state',
|
||||
key: 'state',
|
||||
align: 'left',
|
||||
resizable: true,
|
||||
width: 80,
|
||||
minWidth: 80,
|
||||
maxWidth: 120,
|
||||
},
|
||||
{
|
||||
title: t('views.neData.baseStation.time'),
|
||||
@@ -125,7 +143,6 @@ let tableColumns = ref<ColumnsType>([
|
||||
width: 150,
|
||||
customRender(opt) {
|
||||
const record = opt.value;
|
||||
console.log(opt);
|
||||
if (record.state === 'OFF') {
|
||||
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 = {
|
||||
/**新增框或修改框是否显示 */
|
||||
@@ -344,7 +375,7 @@ function fnModalOk() {
|
||||
.then(e => {
|
||||
modalState.confirmLoading = true;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
let result: any = modalState.title.startsWith('Edit')
|
||||
let result: any = from.state
|
||||
? editAMFNbState(neID, from)
|
||||
: addAMFNbState(neID, from);
|
||||
result
|
||||
@@ -506,6 +537,14 @@ onMounted(() => {
|
||||
<!-- 插槽-卡片右侧 -->
|
||||
<template #extra>
|
||||
<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>
|
||||
<template #title>{{ t('common.reloadText') }}</template>
|
||||
<a-button type="text" @click.prevent="fnGetList()">
|
||||
@@ -524,12 +563,13 @@ onMounted(() => {
|
||||
:data-source="tableState.data"
|
||||
:size="tableState.size"
|
||||
:pagination="tablePagination"
|
||||
:scroll="{ x: tableColumns.length * 120 }"
|
||||
:row-selection="{
|
||||
type: 'checkbox',
|
||||
selectedRowKeys: tableState.selectedRowKeys,
|
||||
onChange: fnTableSelectedRowKeys,
|
||||
}"
|
||||
:scroll="{ x: tableColumns.length * 120, y: 'calc(100vh - 480px)' }"
|
||||
@resizeColumn="(w:number, col:any) => (col.width = w)"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'state'">
|
||||
|
||||
@@ -237,8 +237,13 @@ function fnModalEditOk(from: Record<string, any>) {
|
||||
item.neName = from.neName;
|
||||
item.ip = from.ip;
|
||||
item.port = from.port;
|
||||
if (item.status !== '2') {
|
||||
item.status = res.data.online ? '1' : '0';
|
||||
if (res.data.online) {
|
||||
item.status = '1';
|
||||
if (res.data.standby) {
|
||||
item.status = '3';
|
||||
}
|
||||
} else {
|
||||
item.status = '0';
|
||||
}
|
||||
Object.assign(item.serverState, res.data);
|
||||
const resouresUsage = parseResouresUsage(item.serverState);
|
||||
|
||||
@@ -438,7 +438,6 @@ function fnModalCancel() {
|
||||
* 选择性能指标,填充进当前计算公式的值
|
||||
*/
|
||||
function fnSelectPer(s: any, option: any) {
|
||||
console.log(option);
|
||||
modalState.from.expression += `'${option.label}'`;
|
||||
}
|
||||
|
||||
|
||||
@@ -1106,6 +1106,39 @@ onBeforeUnmount(() => {
|
||||
</a-tooltip>
|
||||
</span>
|
||||
</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>
|
||||
</a-table>
|
||||
</div>
|
||||
|
||||
@@ -532,7 +532,7 @@ function fnModalVisibleByVive(id: string | number) {
|
||||
|
||||
/**对话框tab查看 */
|
||||
function fnViveTab(action: any) {
|
||||
console.log('fnViveTab', action);
|
||||
// console.log('fnViveTab', action);
|
||||
if (modalState.viewFrom.action === action) return;
|
||||
modalState.viewFrom.action = action;
|
||||
modalState.viewFrom.content = '';
|
||||
|
||||
Reference in New Issue
Block a user