业务95值计算、服务器收益和交换机收益的图形分析、自定义列、修复bug

This commit is contained in:
康冉冉
2025-10-31 20:38:21 +08:00
parent d7963d69a5
commit d7dd17a38b
47 changed files with 667 additions and 396 deletions

View File

@@ -123,6 +123,40 @@ export function graAvgMonthly(data) {
}) })
} }
/** ------------------服务器和交换机的 图形分析------------------- */
// 服务器日
export function serverGraphDaily(data) {
return request({
url: '/system/epsTrafficData/getServerGraphicalAnalysisDaily',
method: 'post',
data: data
})
}
// 服务器月
export function serverGraphMonth(data) {
return request({
url: '/system/epsTrafficData/getServerGraphicalAnalysisMonthy',
method: 'post',
data: data
})
}
// 交换机日
export function switchGraphDaily(data) {
return request({
url: '/system/switchInfoDetails/getGraphicalAnalysisDaily',
method: 'post',
data: data
})
}
// 交换机月
export function switchGraphMonth(data) {
return request({
url: '/system/switchInfoDetails/getGraphicalAnalysisMonthy',
method: 'post',
data: data
})
}
/** ------------------业务管理------------------- */ /** ------------------业务管理------------------- */
// 查询列表 // 查询列表
@@ -407,3 +441,11 @@ export function taskRraphical(data) {
data: data data: data
}) })
} }
// 获取月均日95时间
export function getAvgTimeList(data) {
return request({
url: '/system/taskStatistics/getAvgTimeList',
method: 'post',
data: data
})
}

View File

@@ -1,9 +1,26 @@
import request from '@/utils/request' import request from '@/utils/request'
// 获取路由 // 获取路由
export const getRouters = () => { export const getRouters = () => {
return request({ return request({
url: '/system/menu/getRouters', url: '/system/menu/getRouters',
method: 'get' method: 'get'
}) })
} }
// 保存自定义列表列
export function addColumnList(data) {
return request({
url: '/system/columnConfig/addColumnConfig',
method: 'post',
data: data
})
}
// 获取自定义列表列
export function getColumnList(data) {
return request({
url: '/system/columnConfig/getColumnConfigByUserId',
method: 'post',
data: data
})
}

View File

@@ -9,9 +9,9 @@
</el-tooltip> </el-tooltip>
<el-tooltip class="item" effect="dark" content="显隐列" placement="top" v-if="Object.keys(columns).length > 0"> <el-tooltip class="item" effect="dark" content="显隐列" placement="top" v-if="Object.keys(columns).length > 0">
<el-button size="mini" circle icon="el-icon-menu" @click="showColumn()" v-if="showColumnsType == 'transfer'"/> <el-button size="mini" circle icon="el-icon-menu" @click="showColumn()" v-if="showColumnsType == 'transfer'"/>
<el-dropdown trigger="click" :hide-on-click="false" style="padding-left: 12px" v-if="showColumnsType == 'checkbox'"> <el-dropdown trigger="click" :hide-on-click="false" style="padding-left: 12px" v-if="showColumnsType == 'checkbox'" @visible-change="handleDropdownVisibleChange">
<el-button size="mini" circle icon="el-icon-menu" /> <el-button size="mini" circle icon="el-icon-menu" />
<el-dropdown-menu slot="dropdown" style="max-height: calc(100% - 320px); overflow: auto;"> <el-dropdown-menu slot="dropdown" style="max-height: calc(100% - 320px);min-height: 200px; overflow: auto;">
<!-- 全选/反选 按钮 --> <!-- 全选/反选 按钮 -->
<el-dropdown-item> <el-dropdown-item>
<el-checkbox :indeterminate="isIndeterminate" v-model="isChecked" @change="toggleCheckAll"> 列展示 </el-checkbox> <el-checkbox :indeterminate="isIndeterminate" v-model="isChecked" @change="toggleCheckAll"> 列展示 </el-checkbox>
@@ -38,6 +38,7 @@
</template> </template>
<script> <script>
import {addColumnList, getColumnList} from "@/api/menu";
export default { export default {
name: "RightToolbar", name: "RightToolbar",
data() { data() {
@@ -76,6 +77,10 @@ export default {
type: Number, type: Number,
default: 10 default: 10
}, },
modelIdent: {
type: String,
default: ''
}
}, },
computed: { computed: {
style() { style() {
@@ -120,6 +125,9 @@ export default {
} }
} }
}, },
mounted() {
this.fnColumnList();
},
methods: { methods: {
// 搜索 // 搜索
toggleSearch() { toggleSearch() {
@@ -172,6 +180,41 @@ export default {
// Object.values(this.columns).forEach((col) => (col.visible = newValue)) // Object.values(this.columns).forEach((col) => (col.visible = newValue))
} }
this.$emit("columnsChange", this.columns); this.$emit("columnsChange", this.columns);
},
// 获取列
fnColumnList() {
let newCol = JSON.parse(JSON.stringify(this.columns));
getColumnList({pageRoute: this.modelIdent}).then(res => {
if (res && res.data && res.data.columnConfig) {
let newData = JSON.parse(res.data.columnConfig);
Object.keys(newCol).forEach(keyName => {
if (newData[keyName]) {
newCol[keyName].visible = true;
} else {
newCol[keyName].visible = false;
}
this.$set(this.columns, keyName, newCol[keyName]);
});
this.$emit("columnsChange", null, newCol);
}
}).catch(() => {
this.$emit("columnsChange", null, this.columns);
});
},
// 列选项栏关闭时
handleDropdownVisibleChange(isVisible) {
let params = {userId: this.$store.state.user.id, pageRoute: this.modelIdent};
if (!isVisible) {
let columnVisible = {};
Object.keys(this.columns).forEach(keyName => {
if (this.columns[keyName] && this.columns[keyName].visible) {
columnVisible[keyName] = true;
}
});
params['columnConfig'] = JSON.stringify(columnVisible);
addColumnList(params).then(res => {
});
}
} }
}, },
} }

View File

@@ -65,35 +65,39 @@
}, },
methods: { methods: {
getList(title, dataXY) { getList(title, dataXY) {
console.log('dataXY===',dataXY);
const lineDataListIntance = echarts.init(document.getElementById('lineChart' + this.num)); const lineDataListIntance = echarts.init(document.getElementById('lineChart' + this.num));
let titleList = {text: title, x: '50%', y: '3%', textAlign: 'center',textStyle: {fontSize: 16}}; let titleList = [{text: title, x: '50%', y: '3%', textAlign: 'center',textStyle: {fontSize: 16}}];
if (dataXY && dataXY.titleVal) { if (dataXY && dataXY.titleSubtext) {
titleList = Object.assign({},titleList, dataXY.titleVal); titleList.push(dataXY.titleSubtext);
} else if (dataXY && dataXY.titleVal) {
titleList[0] = Object.assign({},titleList[0], dataXY.titleVal);
} }
let legendData = dataXY && dataXY.legend ? dataXY.legend : {}; let legendData = dataXY && dataXY.legend ? dataXY.legend : {};
if (dataXY && dataXY.legend && dataXY.legend.formatter) { if (dataXY && dataXY.legend && dataXY.legend.formatter) {
let formatData = { let formatData = {
// formatter: function(params) { formatter: function(params) {
// const customSuffix = 'xxxxx'; const customSuffix = dataXY && dataXY.content && dataXY.content[params] || ' ';
// return `${params} ${customSuffix}`; return `${params} ${customSuffix}`;
// }, },
}; };
legendData = Object.assign({}, legendData, formatData); legendData = Object.assign({}, legendData, formatData);
} }
let series = []; let series = [];
if (dataXY && dataXY.dataList && dataXY.dataList.length > 0) { if (dataXY && dataXY.dataList && dataXY.dataList.length > 0) {
dataXY.dataList.forEach(item => { dataXY.dataList.forEach(item => {
series.push({ let str = {
name: item && item.name || '', name: item && item.name || '',
type: 'line', type: 'line',
// showSymbol: false, // showSymbol: false,
symbol: 'circle', symbol: 'circle',
areaStyle: {
opacity: 0.6
},
data: item && item.data || [] data: item && item.data || []
}); };
if (!(item && item.areaStyleNone)) {
str['areaStyle'] = {
opacity: 0.6
};
}
series.push(str);
}); });
} else { } else {
series = [{ series = [{
@@ -106,7 +110,7 @@
}]; }];
} }
let option = { let option = {
title: [titleList], title: titleList,
legend: legendData, legend: legendData,
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
@@ -135,18 +139,20 @@
}, },
axisLabel: { axisLabel: {
formatter: function(value) { formatter: function(value) {
// 每4个字符换一行根据实际文本长度调整 if (value) {
const maxLength = 11; // 每4个字符换一行根据实际文本长度调整
let result = ''; const maxLength = 11;
let count = 0; let result = '';
for (let i = 0; i < value.length; i++) { let count = 0;
count++; for (let i = 0; i < value.length; i++) {
result += value[i]; count++;
if (count % maxLength === 0 && i !== value.length - 1) { result += value[i];
result += '\n'; // 换行 if (count % maxLength === 0 && i !== value.length - 1) {
} result += '\n'; // 换行
} }
return result; }
return result;
}
}, },
// lineHeight: 10, // 行高(确保换行后不重叠) // lineHeight: 10, // 行高(确保换行后不重叠)
}, },
@@ -154,7 +160,7 @@
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
name: dataXY?.yAxisName || '单位Mbps', name: dataXY?.yAxisName || ' ',
min: 0, // 自定义最小刻度(根据业务需求调整,如 0 min: 0, // 自定义最小刻度(根据业务需求调整,如 0
max: dataXY && dataXY.data && dataXY.data.length > 0 ? null : dataXY && dataXY.dataList && dataXY.dataList[0] && dataXY.dataList[0].data.length > 0 ? null : 100, max: dataXY && dataXY.data && dataXY.data.length > 0 ? null : dataXY && dataXY.dataList && dataXY.dataList[0] && dataXY.dataList[0].data.length > 0 ? null : 100,
splitLine: { splitLine: {

View File

@@ -80,7 +80,7 @@
v-model="ruleForm[key]" v-model="ruleForm[key]"
class="w100" class="w100"
:ref="(el) => { if (el) this.cascaderRefs[key] = el; }" :ref="(el) => { if (el) this.cascaderRefs[key] = el; }"
:props="{ multiple: true, checkStrictly: true }" :props="{ multiple: true}"
:options="formVal.options" :options="formVal.options"
:disabled="toBoolean(formVal.disabled || formItem.config.readonly)" :disabled="toBoolean(formVal.disabled || formItem.config.readonly)"
:placeholder="toBoolean(formVal.disabled || formItem.config.readonly) ? null : formVal.placeholder || `请选择${formVal.label}`" :placeholder="toBoolean(formVal.disabled || formItem.config.readonly) ? null : formVal.placeholder || `请选择${formVal.label}`"

View File

@@ -7,7 +7,7 @@
<el-button :type="item.type" plain size="mini" :icon="item.icon" @click="handleClick(item,{})" :hasPermi="[item.hasPermi]">{{item.content}}</el-button> <el-button :type="item.type" plain size="mini" :icon="item.icon" @click="handleClick(item,{})" :hasPermi="[item.hasPermi]">{{item.content}}</el-button>
</el-col> </el-col>
</template> </template>
<right-toolbar v-if="!(config && config.colTopHiddenIcon)" :showSearch.sync="showSearch" @queryTable="renderList" @columnsChange="columnsChange" :columns="columns"></right-toolbar> <right-toolbar v-if="!(config && config.colTopHiddenIcon)" :modelIdent="this.modelIdent" :showSearch.sync="showSearch" @queryTable="renderList" @columnsChange="columnsChange" :columns="columns"></right-toolbar>
</el-row> </el-row>
<!-- 表格数据 --> <!-- 表格数据 -->
<el-table v-loading="loading" :data="tableList" :ref="config && config.tableKey ? `tableRef_${config.tableKey}` : `selChangeList`" :key="tableKey" highlight-selection-row @select-all="handleSelectAll" @select="handleSelectionChange"> <el-table v-loading="loading" :data="tableList" :ref="config && config.tableKey ? `tableRef_${config.tableKey}` : `selChangeList`" :key="tableKey" highlight-selection-row @select-all="handleSelectAll" @select="handleSelectionChange">
@@ -89,30 +89,34 @@
export default { export default {
name: 'table-list', name: 'table-list',
props: { props: {
tableList: { modelIdent: {
type: Array, type: String,
default: () => [] default: ''
}, },
columns: { tableList: {
type: Object, type: Array,
default: () => {} default: () => []
}, },
queryParams: { columns: {
type: Object, type: Object,
default: { default: () => {}
total: 0, },
pageNum: 1, queryParams: {
pageSize: 10, type: Object,
layout: 'total, sizes, prev, pager, next, jumper' default: {
} total: 0,
}, pageNum: 1,
config: { pageSize: 10,
type: Object, layout: 'total, sizes, prev, pager, next, jumper'
default: () => ({
colHiddenCheck: false,
colTopHiddenIcon: false
})
} }
},
config: {
type: Object,
default: () => ({
colHiddenCheck: false,
colTopHiddenIcon: false
})
}
}, },
data() { data() {
return { return {
@@ -134,6 +138,11 @@
} }
} }
}, },
created() {
if (!(this.config && this.config.colTopHiddenIcon)) {
this.$modal.loading();
}
},
methods: { methods: {
// 所有方法都抛出到父组件里去 // 所有方法都抛出到父组件里去
handleClick(result, row) { handleClick(result, row) {
@@ -272,7 +281,10 @@
this.$emit("fnRenderList"); this.$emit("fnRenderList");
}, },
// columns改变时触发重新计算样式并渲染列表(解决:新增列,多选框和操作按钮错位) // columns改变时触发重新计算样式并渲染列表(解决:新增列,多选框和操作按钮错位)
columnsChange() { columnsChange(val, col) {
if (col) {
this.$modal.closeLoading();
}
this.tableKey++; this.tableKey++;
}, },
} }

View File

@@ -1,141 +1,141 @@
import router from '@/router' import router from '@/router'
import { MessageBox, } from 'element-ui' import { MessageBox, } from 'element-ui'
import { login, logout, getInfo, refreshToken } from '@/api/login' import { login, logout, getInfo, refreshToken } from '@/api/login'
import { getToken, setToken, setExpiresIn, removeToken } from '@/utils/auth' import { getToken, setToken, setExpiresIn, removeToken } from '@/utils/auth'
import { isEmpty } from "@/utils/validate" import { isEmpty } from "@/utils/validate"
import defAva from '@/assets/images/profile.jpg' import defAva from '@/assets/images/profile.jpg'
const user = { const user = {
state: { state: {
token: getToken(), token: getToken(),
id: '', id: '',
name: '', name: '',
nickName: '', nickName: '',
avatar: '', avatar: '',
roles: [], roles: [],
permissions: [] permissions: []
}, },
mutations: { mutations: {
SET_TOKEN: (state, token) => { SET_TOKEN: (state, token) => {
state.token = token state.token = token
}, },
SET_EXPIRES_IN: (state, time) => { SET_EXPIRES_IN: (state, time) => {
state.expires_in = time state.expires_in = time
}, },
SET_ID: (state, id) => { SET_ID: (state, id) => {
state.id = id state.id = id
}, },
SET_NAME: (state, name) => { SET_NAME: (state, name) => {
state.name = name state.name = name
}, },
SET_NICK_NAME: (state, nickName) => { SET_NICK_NAME: (state, nickName) => {
state.nickName = nickName state.nickName = nickName
}, },
SET_AVATAR: (state, avatar) => { SET_AVATAR: (state, avatar) => {
state.avatar = avatar state.avatar = avatar
}, },
SET_ROLES: (state, roles) => { SET_ROLES: (state, roles) => {
state.roles = roles state.roles = roles
}, },
SET_PERMISSIONS: (state, permissions) => { SET_PERMISSIONS: (state, permissions) => {
state.permissions = permissions state.permissions = permissions
} }
}, },
actions: { actions: {
// 登录 // 登录
Login({ commit }, userInfo) { Login({ commit }, userInfo) {
const username = userInfo.username.trim() const username = userInfo.username.trim()
const password = userInfo.password const password = userInfo.password
const code = userInfo.code const code = userInfo.code
const uuid = userInfo.uuid const uuid = userInfo.uuid
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
login(username, password, code, uuid).then(res => { login(username, password, code, uuid).then(res => {
let data = res.data let data = res.data
setToken(data.access_token) setToken(data.access_token)
commit('SET_TOKEN', data.access_token) commit('SET_TOKEN', data.access_token)
setExpiresIn(data.expires_in) setExpiresIn(data.expires_in)
commit('SET_EXPIRES_IN', data.expires_in) commit('SET_EXPIRES_IN', data.expires_in)
resolve() resolve()
}).catch(error => { }).catch(error => {
reject(error) reject(error)
}) })
}) })
}, },
// 获取用户信息 // 获取用户信息
GetInfo({ commit, state }) { GetInfo({ commit, state }) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getInfo().then(res => { getInfo().then(res => {
const user = res.user const user = res.user
const avatar = (isEmpty(user.avatar)) ? defAva : user.avatar const avatar = (isEmpty(user.avatar)) ? defAva : user.avatar
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组 if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
commit('SET_ROLES', res.roles) commit('SET_ROLES', res.roles)
commit('SET_PERMISSIONS', res.permissions) commit('SET_PERMISSIONS', res.permissions)
} else { } else {
commit('SET_ROLES', ['ROLE_DEFAULT']) commit('SET_ROLES', ['ROLE_DEFAULT'])
} }
commit('SET_ID', user.userId) commit('SET_ID', user.userId)
commit('SET_NAME', user.userName) commit('SET_NAME', user.userName)
commit('SET_NICK_NAME', user.nickName) commit('SET_NICK_NAME', user.nickName)
commit('SET_AVATAR', avatar) commit('SET_AVATAR', avatar)
/* 初始密码提示 */ /* 初始密码提示 */
if(res.isDefaultModifyPwd) { if(res.isDefaultModifyPwd) {
MessageBox.confirm('您的密码还是初始密码,请修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { MessageBox.confirm('您的密码还是初始密码,请修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
router.push({ name: 'Profile', params: { activeTab: 'resetPwd' } }) router.push({ name: 'Profile', params: { activeTab: 'resetPwd' } })
}).catch(() => {}) }).catch(() => {})
} }
/* 过期密码提示 */ /* 过期密码提示 */
if(!res.isDefaultModifyPwd && res.isPasswordExpired) { if(!res.isDefaultModifyPwd && res.isPasswordExpired) {
MessageBox.confirm('您的密码已过期,请尽快修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { MessageBox.confirm('您的密码已过期,请尽快修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
router.push({ name: 'Profile', params: { activeTab: 'resetPwd' } }) router.push({ name: 'Profile', params: { activeTab: 'resetPwd' } })
}).catch(() => {}) }).catch(() => {})
} }
resolve(res) resolve(res)
}).catch(error => { }).catch(error => {
reject(error) reject(error)
}) })
}) })
}, },
// 刷新token // 刷新token
RefreshToken({commit, state}) { RefreshToken({commit, state}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
refreshToken(state.token).then(res => { refreshToken(state.token).then(res => {
setExpiresIn(res.data) setExpiresIn(res.data)
commit('SET_EXPIRES_IN', res.data) commit('SET_EXPIRES_IN', res.data)
resolve() resolve()
}).catch(error => { }).catch(error => {
reject(error) reject(error)
}) })
}) })
}, },
// 退出系统 // 退出系统
LogOut({ commit, state }) { LogOut({ commit, state }) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
logout(state.token).then(() => { logout(state.token).then(() => {
commit('SET_TOKEN', '') commit('SET_TOKEN', '')
commit('SET_ROLES', []) commit('SET_ROLES', [])
commit('SET_PERMISSIONS', []) commit('SET_PERMISSIONS', [])
removeToken() removeToken()
resolve() resolve()
}).catch(error => { }).catch(error => {
reject(error) reject(error)
}) })
}) })
}, },
// 前端 登出 // 前端 登出
FedLogOut({ commit }) { FedLogOut({ commit }) {
return new Promise(resolve => { return new Promise(resolve => {
commit('SET_TOKEN', '') commit('SET_TOKEN', '')
removeToken() removeToken()
resolve() resolve()
}) })
} }
} }
} }
export default user export default user

View File

@@ -20,7 +20,7 @@
</el-form> </el-form>
<!-- 表格数据 --> <!-- 表格数据 -->
<TableList class="w100 h100" :columns="columns" :config="config" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList class="w100 h100" :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<template #tempDay="{ valueKey, row, column }"> <template #tempDay="{ valueKey, row, column }">
<span v-if="row && row[valueKey]">{{row[valueKey]}}/{{row.createTime}}</span> <span v-if="row && row[valueKey]">{{row[valueKey]}}/{{row.createTime}}</span>
</template> </template>

View File

@@ -61,9 +61,13 @@
}); });
}); });
} else { } else {
this.$modal.loading();
switchNameTree().then(val => { switchNameTree().then(val => {
this.switchNameList = val && val; this.switchNameList = val && val;
this.formList[0].controls.includedResources['options'] = val && val.data; this.formList[0].controls.includedResources['options'] = val && val.data;
this.$modal.closeLoading();
}).catch(() => {
this.$modal.closeLoading();
}); });
} }
}, },
@@ -104,8 +108,15 @@
break; break;
case 'submit': case 'submit':
dataVal['calculationMode'] = this.paramsData.calculationMode; dataVal['calculationMode'] = this.paramsData.calculationMode;
if (dataVal.includedResources) {
let newArr = [];
dataVal.includedResources.forEach(item => {
newArr.push(item[1]);
});
dataVal.includedResources = newArr.toString();
}
if (dataVal.includedResourcesTree) { if (dataVal.includedResourcesTree) {
dataVal.includedResources = dataVal.includedResources.toString(); dataVal.includedResources = dataVal.includedResourcesTree.toString();
delete dataVal.includedResourcesTree; delete dataVal.includedResourcesTree;
} }
if (dataVal && dataVal.businessName) { if (dataVal && dataVal.businessName) {
@@ -115,7 +126,6 @@
dataVal.startTime = dataVal.endTime[0]; dataVal.startTime = dataVal.endTime[0];
dataVal.endTime = dataVal.endTime[1]; dataVal.endTime = dataVal.endTime[1];
} }
console.log('dataVal===',dataVal);
addTaskStatic(dataVal).then(response => { addTaskStatic(dataVal).then(response => {
this.$modal.msgSuccess(response.msg); this.$modal.msgSuccess(response.msg);
this.$router.push("/earnManage/busValueCount"); this.$router.push("/earnManage/busValueCount");

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="item of timeList" label="item" name="item"></el-tab-pane> <el-tab-pane v-for="item of timeList" :label="item" :name="item"></el-tab-pane>
</el-tabs> </el-tabs>
<TableList :columns="columns" :config="{colTopHiddenIcon: true}" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList"> <TableList :columns="columns" :config="{colTopHiddenIcon: true}" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList">
<template #tempBusinessName="{ row, column }"> <template #tempBusinessName="{ row, column }">
@@ -53,9 +53,9 @@
</div> </div>
</template> </template>
</TableList> </TableList>
<div style="float: right;margin-top: 20px;"> <div style="float: right;margin-top: 20px;">
<el-button type="primary" @click="goBack">返回</el-button> <el-button type="primary" @click="goBack">返回</el-button>
</div> </div>
</div> </div>
</template> </template>
@@ -84,19 +84,21 @@
created() { created() {
this.paramsData = this.$route.query && this.$route.query; this.paramsData = this.$route.query && this.$route.query;
this.columsList(); this.columsList();
this.getList();
}, },
methods: { methods: {
handleClick(){ handleClick(){
this.getList(); this.getList(this.activeName);
}, },
rowDataChange(row) { rowDataChange(row) {
this.$set(row, 'editStatus', true); this.$set(row, 'editStatus', true);
}, },
columsList(num) { columsList(num) {
if (num && num === '4') { if (this.paramsData && this.paramsData.calculationType === '2') {
this.timeList = ['2025-10-01', '2025-10-02', '2025-10-03', '2025-10-04', '2025-10-05']; this.timeList = this.getCurrentMonthDates();
this.activeName = this.timeList[0]; this.activeName = this.timeList[0];
this.getList(this.activeName);
} else {
this.getList();
} }
// 服务器 // 服务器
if (this.paramsData && this.paramsData.resourceType === '1') { if (this.paramsData && this.paramsData.resourceType === '1') {
@@ -108,25 +110,29 @@
}; };
} else { } else {
this. columns = { this. columns = {
businessCode: {label: `交换机接口`, minWidth: '220',visible: true}, name: {label: `交换机接口`, minWidth: '220',visible: true},
createTime: {label: `时间`,minWidth: '160',visible: true}, createTime: {label: `时间`,minWidth: '160',visible: true},
putSpeed: {label: `总接收流量值(bit/s)`, minWidth: '150', visible: true}, inSpeed: {label: `总接收流量值(bit/s)`, minWidth: '150', visible: true},
outSpeed: {label: `总发送流量值(bit/s)`, minWidth: '150', visible: true}, outSpeed: {label: `总发送流量值(bit/s)`, minWidth: '150', visible: true},
totalSpeed: {label: `流量值最大值(bit/s)`, minWidth: '150', slotName: 'tempTotalSpeed',visible: true}, maxSpeed: {label: `流量值最大值(bit/s)`, minWidth: '150', slotName: 'tempTotalSpeed',visible: true},
}; };
} }
}, },
/** 查询角色列表 */ /** 查询角色列表 */
getList() { getList(time) {
this.loading = true; this.loading = true;
taskRelate(Object.assign( this.queryParams, {id: this.paramsData && this.paramsData.id}, {calculationMode: this.paramsData.calculationMode})).then(response => { let params = {calculationMode: this.paramsData.calculationMode};
if (time) {
params['avgTime'] = time;
}
taskRelate(Object.assign( this.queryParams, {id: this.paramsData && this.paramsData.id}, params)).then(response => {
this.loading = false; this.loading = false;
this.roleList = response && response.rows; this.roleList = response && response.rows;
this.queryParams.total = response.total; this.queryParams.total = response.total;
}) })
}, },
goBack() { goBack() {
this.$router.go(-1); this.$router.push("/earnManage/busValueCount");
}, },
callback(result, rowData, selectChange) { callback(result, rowData, selectChange) {
if (result && result.fnCode) { if (result && result.fnCode) {
@@ -139,6 +145,9 @@
needSpeed: rowData.outSpeed, needSpeed: rowData.outSpeed,
needTime: rowData.createTime needTime: rowData.createTime
}; };
if (this.paramsData && this.paramsData.resourceType === '2') {
params['needSpeed'] = rowData.maxSpeed;
}
updateRelate(params).then(res => { updateRelate(params).then(res => {
this.$set(rowData, 'editStatus', false); this.$set(rowData, 'editStatus', false);
this.getList(); this.getList();
@@ -152,6 +161,18 @@
} }
} }
}, },
// 补零函数将单个数字1-9转为两位数01-09
padZero(num) {
return num < 10 ? `0${num}` : num;
},
// 获取当前月所有日期的函数
getCurrentMonthDates() {
return getAvgTimeList({id: this.paramsData && this.paramsData.id}).then(res => {
console.log(res);
return res;
});
},
} }
} }
</script> </script>

View File

@@ -1,6 +1,9 @@
<template> <template>
<div style="height: calc(100vh)!important"> <div style="height: calc(100vh)!important">
<EchartsLine :lineData="lineDataParams" :title="lineDataParams.title" style="height: 400px;" class="w100 mt20 mb20"></EchartsLine> <EchartsLine :lineData="lineDataParams && lineDataParams.chart || {}" :title="lineDataParams.chart && lineDataParams.chart.title || ''" style="height:500px;" class="w100 mt20 mb20"></EchartsLine>
<div style="float: right;margin-top: 20px;">
<el-button type="primary" @click="goBack">返回</el-button>
</div>
</div> </div>
</template> </template>
@@ -15,16 +18,20 @@
paramsData: {}, paramsData: {},
echartData: { echartData: {
title: 'tux', title: 'tux',
titleSubtext: {subtext: '', bottom: '14%', x: '50%', textAlign: 'center', subtextStyle: {fontWeight: 'bold', fontSize: 14}},
yAxisName: '', yAxisName: '',
legend: {orient: 'vertical',bottom: '1%', formatter: true}, content: {},
gridBotm: '10%', legend: {orient: 'vertical',bottom: '0%', formatter: true},
gridBotm: '20%',
hiddenTime: true, hiddenTime: true,
lineXData: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sa', 'Sun'], lineXData: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sa', 'Sun'],
dataList: [ dataList: [
{name: '总发送流量值', data: []}, {name: '总发送流量值', data: []},
{name: '总接收流量值', data: []},
{name: '95带宽值', areaStyleNone: true, data: []},
] ]
}, },
lineDataParams: {}, lineDataParams: {chart: {}},
} }
}, },
created() { created() {
@@ -33,18 +40,41 @@
}, },
methods: { methods: {
chartList() { chartList() {
let newChartData = JSON.parse(JSON.stringify(this.echartData));
if (this.paramsData && this.paramsData.resourceType === '1') {
newChartData.dataList.splice(1,1);
}
if (this.paramsData && this.paramsData.calculationType === '2') {
newChartData.dataList[newChartData.dataList.length - 1].name = '月均日95值';
}
taskRraphical({id: this.paramsData.id}).then(res => { taskRraphical({id: this.paramsData.id}).then(res => {
console.log('res====',res);
if(res && res.data) { if(res && res.data) {
let content = '最后一个值:' + res.data.other.lastInSpeedGb; let outContent = `最后一个值:${res && res.data && res.data.other && res.data.other.lastOutSpeedGb ? res.data.other.lastOutSpeedGb + 'G' : '0'} 平均值:${res && res.data && res.data.other && res.data.other.avgOutSpeedGb ? res.data.other.avgOutSpeedGb + 'G' : '0'} 最大值:${res && res.data && res.data.other && res.data.other.maxOutSpeedGb ? res.data.other.maxOutSpeedGb + 'G' : '0'}`;
this.echartData.title = '' + this.paramsData.taskName + '】'; let inContent = `最后一个值:${res && res.data && res.data.other && res.data.other.lastInSpeedGb ? res.data.other.lastInSpeedGb + 'G' : '0'} 平均值:${res && res.data && res.data.other && res.data.other.avgInSpeedGb ? res.data.other.avgInSpeedGb + 'G' : '0'} 最大值:${res && res.data && res.data.other && res.data.other.maxInSpeedGb ? res.data.other.maxInSpeedGb + 'G' : '0'}`;
this.echartData.yAxisName = '单位' + res.data.other.recommendedUnit || ''; let kdContent = `(${res && res.data && res.data.percentile95 ? res.data.percentile95 + 'mbit' : '0'} out)`;
this.echartData.lineXData = res.data.xData || []; newChartData.title = '【' + this.paramsData.taskName + '】';
this.echartData.dataList[0].data = res.data.yData['netOutSpeedData'] || []; newChartData.titleSubtext.subtext = res && res.data && res.data.timeRange || ' ';
newChartData.content[newChartData.dataList[0].name] = outContent;
newChartData.yAxisName = res && res.data && res.data.other && res.data.other.recommendedUnit ? '单位' + res.data.other.recommendedUnit : '';
newChartData.lineXData = res && res.data && res.data.xData || [];
newChartData.dataList[0].data = res && res.data && res.data.yData && res.data.yData['netOutSpeedData'] || [];
if (this.paramsData && this.paramsData.resourceType === '1') {
newChartData.content[newChartData.dataList[1].name] = kdContent;
newChartData.dataList[1].data = res && res.data && res.data.yData && res.data.yData['percentile95'] || [];
} else {
newChartData.content[newChartData.dataList[1].name] = inContent;
newChartData.content[newChartData.dataList[2].name] = kdContent;
newChartData.dataList[1].data = res && res.data && res.data.yData && res.data.yData['netInSpeedData'] || [];
newChartData.dataList[2].data = res && res.data && res.data.yData && res.data.yData['percentile95'] || [];
}
} }
this.lineDataParams = this.echartData; this.$set(this.lineDataParams, 'chart', newChartData);
}); });
}, },
goBack() {
this.$router.push("/earnManage/busValueCount");
},
} }
} }
</script> </script>

View File

@@ -17,7 +17,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :queryParams="queryParams" :modelIdent="this.$options.name" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<template #tempBusinessName="{ row, column }"> <template #tempBusinessName="{ row, column }">
<div> <div>
<!-- 非编辑状态显示文本 --> <!-- 非编辑状态显示文本 -->

View File

@@ -17,7 +17,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :queryParams="queryParams" :modelIdent="this.$options.name" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<template #tempBusinessName="{ row, column }"> <template #tempBusinessName="{ row, column }">
<div> <div>
<!-- 非编辑状态显示文本 --> <!-- 非编辑状态显示文本 -->

View File

@@ -17,7 +17,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :queryParams="queryParams" :modelIdent="this.$options.name" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<template #tempStatus="{ row, column }"> <template #tempStatus="{ row, column }">
<dict-tag :options="dict.type.eps_business_review_status" :value="row.reviewStatus"/> <dict-tag :options="dict.type.eps_business_review_status" :value="row.reviewStatus"/>
</template> </template>

View File

@@ -17,7 +17,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"></TableList> <TableList :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"></TableList>
</div> </div>
</template> </template>

View File

@@ -32,7 +32,7 @@
</el-col> </el-col>
</el-form> </el-form>
<!-- 表格数据 --> <!-- 表格数据 -->
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"></TableList> <TableList :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"></TableList>
</div> </div>
</template> </template>
@@ -56,11 +56,11 @@
// 列显隐信息 // 列显隐信息
columns: { columns: {
id: {label: `ID`, visible: false}, id: {label: `ID`, visible: false},
createTime: {label: `修改时间`, visible: true}, updateTime: {label: `修改时间`, visible: true},
clientId: {label: `ClientID`, minWidth: '130', visible: true}, clientId: {label: `ClientID`, minWidth: '130', visible: true},
hardwareSn: {label: `硬件SN`}, hardwareSn: {label: `硬件SN`},
changeContent: {label: `修改内容`, minWidth: '350', visible: true}, changeContent: {label: `修改内容`, minWidth: '350', visible: true},
creatBy: {label: `修改人`, width: '80', visible: true}, updateBy: {label: `修改人`, width: '80', visible: true},
}, },
// 查询参数 // 查询参数
queryParams: { queryParams: {

View File

@@ -2,9 +2,9 @@
<div style="height: calc(100vh)!important"> <div style="height: calc(100vh)!important">
<div style="height: 90px;"> <div style="height: 90px;">
<el-form ref="noticeRef" :model="form" label-width="80px"> <el-form ref="noticeRef" :model="form" label-width="80px">
<el-form-item label="节点名称" prop="noticeType"> <el-form-item label="ClientID" prop="clientId">
<!-- allow-create default-first-option 搜索下拉框中没有的数据并展示查询 --> <!-- allow-create default-first-option 搜索下拉框中没有的数据并展示查询 -->
<el-select v-model="form.noticeType" multiple filterable placeholder="请选择节点名称" @change="handleChange"> <el-select v-model="form.clientId" multiple filterable placeholder="请选择ClientID" @change="handleChange">
<el-option <el-option
v-for="item in selectChangeList" v-for="item in selectChangeList"
:key="item.value" :key="item.value"
@@ -19,26 +19,31 @@
<el-date-picker <el-date-picker
v-model="timeList[item.value]" v-model="timeList[item.value]"
:style="{width: '300px!important', marginRight: '10px'}" :style="{width: '300px!important', marginRight: '10px'}"
:type="item.value === '1' ? 'datetimerange' : 'monthrange'" :type="item.value === '1' ? 'daterange' : 'monthrange'"
:start-placeholder="item.value === '2' ? '开始日期' : '开始时间'" :start-placeholder="item.value === '2' ? '开始日期' : '开始时间'"
:end-placeholder="item.value === '2' ? '结束日期' : '结束时间'" :end-placeholder="item.value === '2' ? '结束日期' : '结束时间'"
range-separator="" range-separator=""
:format="item.value === '2' ? 'yyyy-MM' : 'yyyy-MM-dd HH:mm:ss'" :format="item.value === '2' ? 'yyyy-MM' : 'yyyy-MM-dd'"
:value-format="item.value === '2' ? 'yyyy-MM' : 'yyyy-MM-dd HH:mm:ss'" :value-format="item.value === '2' ? 'yyyy-MM' : 'yyyy-MM-dd'"
:default-time="item.value === '1' ? ['12:00:00', '12:00:00'] : null"
@change="(val) => dateChange(val, item.value)"/> @change="(val) => dateChange(val, item.value)"/>
</template> </template>
</div> </div>
<div style="height: calc(100vh - 160px);overflow: scroll;"> <div style="height: calc(100vh - 160px);overflow: scroll;">
<template v-for="(item,index) of echartListData"> <!-- <template v-for="(item,index) of echartListData">-->
<template v-if="item && item.dateShowType === 'day'"> <!-- <template v-if="item && item.dateShowType === 'day'">-->
<EchartsLine v-show="switchData[item.indexVal].checkType" :chartData="(valData) => chartDataEvent(valData, item.fnEvent)" :dateShowType="item.dateShowType" <!-- <EchartsLine v-show="switchData[item.indexVal].checkType" :chartData="(valData) => chartDataEvent(valData, item.fnEvent)" :dateShowType="item.dateShowType"-->
:lineData="item.resultData" :title="item.titleList + switchData[item.indexVal].label" class="w100 h40 mt20 mb20" style="border: 1.5px solid #878787;"></EchartsLine> <!-- :lineData="item.resultData" :title="item.titleList + switchData[item.indexVal].label" class="w100 h40 mt20 mb20" style="border: 1.5px solid #878787;"></EchartsLine>-->
</template> <!-- </template>-->
<template v-if="item && item.dateShowType === 'month'"> <!-- <template v-if="item && item.dateShowType === 'month'">-->
<EchartsBar v-show="switchData[item.indexVal].checkType" :chartData="(valData) => chartDataEvent(valData, item.fnEvent)" :dateShowType="item.dateShowType" <!-- <EchartsBar v-show="switchData[item.indexVal].checkType" :chartData="(valData) => chartDataEvent(valData, item.fnEvent)" :dateShowType="item.dateShowType"-->
:barData="item.resultData" :title="item.titleList + switchData[item.indexVal].label" class="w100 h40 mt20 mb20" style="border: 1.5px solid #878787;"></EchartsBar> <!-- :barData="item.resultData" :title="item.titleList + switchData[item.indexVal].label" class="w100 h40 mt20 mb20" style="border: 1.5px solid #878787;"></EchartsBar>-->
</template> <!-- </template>-->
<!-- </template>-->
<template v-for="(item,index) of echartListData['day']">
<EchartsLine v-show="switchData[item.indexVal].checkType" :lineData="item" :title="item.title" class="w100 mt20 mb20" style="border: 1.5px solid #878787;height:60%;"></EchartsLine>
</template>
<template v-for="(item,index) of echartListData['month']">
<EchartsLine v-show="switchData[item.indexVal].checkType" :lineData="item" :title="item.title " class="w100 mt20 mb20" style="border: 1.5px solid #878787;height:60%;"></EchartsLine>
</template> </template>
</div> </div>
</div> </div>
@@ -48,8 +53,8 @@
import Form from '@/components/form/index.vue'; import Form from '@/components/form/index.vue';
import EchartsLine from "@/components/echartsList/line.vue"; import EchartsLine from "@/components/echartsList/line.vue";
import EchartsBar from "@/components/echartsList/bar.vue"; import EchartsBar from "@/components/echartsList/bar.vue";
import {graPackage, graMonthly, graEffectiveMonthly, graEffectiveDaily, graEffectiveAvgMonthly, graDaily, graAvgMonthly} from "@/api/disRevenue/earnManage" import {graPackage, graMonthly, graEffectiveMonthly, graEffectiveDaily, graEffectiveAvgMonthly, graDaily, graAvgMonthly, serverGraphDaily, serverGraphMonth, switchGraphDaily, switchGraphMonth} from "@/api/disRevenue/earnManage"
import {listAllResourList} from "@/api/disRevenue/resource"; import {listAllResourList, getRegistList} from "@/api/disRevenue/resource";
export default { export default {
name: 'AnalysisChart', name: 'AnalysisChart',
components: {Form, EchartsLine, EchartsBar}, components: {Form, EchartsLine, EchartsBar},
@@ -59,7 +64,7 @@
type: String, type: String,
default: "1000" default: "1000"
}, },
noticeType: { clientId: {
type: Array, type: Array,
default: [] default: []
} }
@@ -81,15 +86,27 @@
storageKey: '', storageKey: '',
selectChangeList: [], selectChangeList: [],
switchData: [], switchData: [],
disabledList: {}, echartListData: {},
echartListData: [],
typeObj: {}, typeObj: {},
paramsVal: {}, paramsVal: {},
resourceType: '', resourceType: '',
lineDataParams: { echartData: {
lineXData: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sa', 'Sun'], title: 'tux',
data: [120, 132, 101, 134, 90, 230, 210] titleSubtext: {subtext: '', bottom: '14%', x: '50%', textAlign: 'center', subtextStyle: {fontWeight: 'bold', fontSize: 14}},
yAxisName: ' ',
content: {},
legend: {orient: 'vertical',bottom: '0%', formatter: true},
gridTop: '60px',
gridBotm: '25%',
hiddenTime: true,
lineXData: [],
dataList: [
{name: '发送流量值', data: []},
{name: '金山API记录的发送流量值', data: []},
{name: '95带宽值/日', areaStyleNone: true, data: []},
]
}, },
lineDataParams: {chart: {}},
} }
}, },
created() {}, created() {},
@@ -121,27 +138,21 @@
} }
}, },
fnNodeName(type){ fnNodeName(type){
listAllResourList({resourceType: type}).then(val => { getRegistList({resourceType: type}).then(val => {
this.selectChangeList = val && val.map(item => { this.selectChangeList = val && val.data.map(item => {
return Object.assign({label: item.resourceName, value: item.resourceName}); return Object.assign({label: item.clientId, value: item.clientId});
}); });
}); });
}, },
// 下拉数据改变时触发 // 下拉数据改变时触发
handleChange(eventVal) { handleChange(eventVal) {
if (this.resourceType === 1) { this.paramsVal = {
this.paramsVal = { clientIds: eventVal.toString()
nodeNames: eventVal };
}; this.echartListData = {};
} else {
this.paramsVal = {
switchNames: eventVal
};
}
this.echartListData = [];
this.paramsVal['calculationMode'] = this.activeName; this.paramsVal['calculationMode'] = this.activeName;
let dayList = this.getDaysOfPreviousMonth(); let dayList = {startTime: this.timeList['1'][0], endTime: this.timeList['1'][1]};
let monthList = this.getLastMonths(); let monthList = {startTime: this.timeList['2'][0], endTime: this.timeList['2'][1]};
this.graDailyList(dayList); this.graDailyList(dayList);
this.graMonthlyList(monthList); this.graMonthlyList(monthList);
// this.graPackageList(dayList); // this.graPackageList(dayList);
@@ -152,7 +163,20 @@
}, },
// 时间变化时 // 时间变化时
dateChange(val, idNum){ dateChange(val, idNum){
console.log('id=====',idNum, 'val===',val); // console.log('id=====',idNum, 'val===',val);
this.paramsVal['calculationMode'] = this.activeName;
let timeStr = {startTime: val[0], endTime: val[1]};
if (idNum === '1') {
this.timeList['1'] = val;
if (this.paramsVal && this.paramsVal.clientIds) {
this.graDailyList(timeStr);
}
} else if (idNum === '2') {
this.timeList['2'] = val;
if (this.paramsVal && this.paramsVal.clientIds) {
this.graMonthlyList(timeStr);
}
}
}, },
// 初始化 // 初始化
processData(list) { processData(list) {
@@ -160,42 +184,56 @@
let nameListArr = []; let nameListArr = [];
let showNameList = []; let showNameList = [];
list.forEach(item => { list.forEach(item => {
let name = this.resourceType === 1 ? item.nodeName : item.uplinkSwitch; if (this.paramsData && this.paramsData.resourceType === '1') {
if (!nameArr.includes(name)) { if (item && item.clientId) {
item.label = name; let name = item.clientId;
item.value = name; if (!nameArr.includes(name)) {
nameArr.push(name); item.label = name;
nameListArr.push(item); item.value = name;
nameArr.push(name);
nameListArr.push(item);
}
}
} else if (this.paramsData && this.paramsData.resourceType === '2') {
if (item && item.serverClientId) {
let name = item.serverClientId;
if (!nameArr.includes(name)) {
item.label = name;
item.value = name;
nameArr.push(name);
nameListArr.push(item);
}
}
} }
}); });
if (this.noticeType && this.noticeType.length > 0) { if (this.clientId && this.clientId.length > 0) {
this.form.noticeType = this.noticeType; this.form.clientId = this.clientId;
} else { } else {
if (nameArr && nameArr.length > 0) { if (nameArr && nameArr.length > 0) {
if (nameListArr.length >=2) { if (nameListArr.length >=2) {
this.form.noticeType = [nameListArr[0].label, nameListArr[1].label]; this.form.clientId = [nameListArr[0].label, nameListArr[1].label];
} else { } else {
this.form.noticeType = [nameListArr[0].label]; this.form.clientId = [nameListArr[0].label];
} }
} }
} }
showNameList = this.form.noticeType; showNameList = this.form.clientId;
this.echartListData = []; this.echartListData = {};
let dayList = this.getBeforDay();
let monthList = this.getLastMonths(2);
this.timeList['1'] = [dayList.startTime, dayList.endTime];
this.timeList['2'] = [monthList.startTime, monthList.endTime];
if (showNameList && showNameList.length > 0) { if (showNameList && showNameList.length > 0) {
if (this.resourceType === 1) { if (this.resourceType === 1) {
this.paramsVal = { this.paramsVal = {
nodeNames: showNameList clientIds: showNameList.toString()
}; };
} else { } else {
this.paramsVal = { this.paramsVal = {
switchNames: showNameList clientIds: showNameList.toString()
}; };
} }
this.paramsVal['calculationMode'] = this.activeName; this.paramsVal['calculationMode'] = this.activeName;
let dayList = this.getBeforDay();
let monthList = this.getLastMonths(2);
this.timeList['1'] = [dayList.startTime + ' 00:00:00', dayList.endTime + ' 00:00:00'];
this.timeList['2'] = [monthList.startTime, monthList.endTime];
this.graDailyList(dayList); this.graDailyList(dayList);
this.graMonthlyList(monthList); this.graMonthlyList(monthList);
// this.graPackageList(dayList); // this.graPackageList(dayList);
@@ -205,38 +243,70 @@
// this.graEffectiveAvgMonthlyList(dayList); // this.graEffectiveAvgMonthlyList(dayList);
} }
}, },
// 95带宽值Mbps/日---图表 // 95带宽值Mbps/日---图表 serverGraphDaily, serverGraphMonth, switchGraphDaily, switchGraphMonth
graDailyList(timeArr){ graDailyList(timeArr){
graDaily(Object.assign({resourceType: this.resourceType, bandwidthType: 1} ,this.paramsVal, timeArr)).then(res => { let fnType = serverGraphDaily;
if (this.resourceType === 2) {
fnType = switchGraphDaily;
}
let newChartData = JSON.parse(JSON.stringify(this.echartData));
fnType(Object.assign({} ,this.paramsVal, timeArr)).then(res => {
if (res && res.data && res.data.length > 0) { if (res && res.data && res.data.length > 0) {
let chartList = [];
res.data.forEach((item, index) => { res.data.forEach((item, index) => {
item.titleList = this.resourceType === 1 ? '' + item.nodeName + '】【' + item.businessName + '' : '' + item.nodeName + '】【' + item.interfaceName + '】【' + item.businessName + '】'; let outContent = `最后一个值:${item && item.other && item.other.lastOutSpeedGb ? item.other.lastOutSpeedGb + 'G' : '0'} 平均值:${item && item.other && item.other.avgOutSpeedGb ? item.other.avgOutSpeedGb + 'G' : '0'} 最大值:${item && item.other && item.other.maxOutSpeedGb ? item.other.maxOutSpeedGb + 'G' : '0'}`;
item.resultData['hiddenTime'] = true; let inContent = `最后一个值:${item && item.other && item.other.lastInSpeedGb ? item.other.lastInSpeedGb + 'G' : '0'} 平均值:${item && item.other && item.other.avgInSpeedGb ? item.other.avgInSpeedGb + 'G' : '0'} 最大值:${item && item.other && item.other.maxInSpeedGb ? item.other.maxInSpeedGb + 'G' : '0'}`;
let dataList = Object.assign({dateShowType: 'day', fnEvent: 'graDailyList'},item, this.typeObj[1]); let kdContent = `(${item && item.percentile95 ? item.percentile95 + 'mbit' : '0'} out)`;
this.$set(this.echartListData, index * 7, dataList); newChartData.title = item && item.name;
this.$set(this.disabledList, index * 7, dataList); newChartData.yAxisName = item && item.other && item.other.recommendedUnit ? '单位' + item.other.recommendedUnit : ' ';
newChartData.titleSubtext.subtext = item && item.timeRange || ' ';
newChartData.content[newChartData.dataList[0].name] = outContent;
newChartData.content[newChartData.dataList[1].name] = inContent;
newChartData.content[newChartData.dataList[2].name] = kdContent;
newChartData.lineXData = item && item.xData || [];
newChartData.dataList[0].data = item && item.yData && item.yData['netOutSpeedData'] || [];
newChartData.dataList[1].data = item && item.yData && item.yData['netInSpeedData'] || [];
newChartData.dataList[2].data = item && item.yData && item.yData['percentile95'] || [];
let dataList = Object.assign({}, newChartData, this.typeObj[1]);
chartList.push(dataList);
}); });
this.disabledList[1] = {disabled: false}; this.$set(this.echartListData, 'day', chartList);
} else { } else {
this.disabledList[1] = {disabled: true}; this.$set(this.echartListData, 'day', []);
this.$set(this.echartListData, 0, {});
} }
}); });
}, },
// 95带宽值Mbps/月---图表 // 95带宽值Mbps/月---图表 serverGraphDaily, serverGraphMonth, switchGraphDaily, switchGraphMonth
graMonthlyList(timeArr){ graMonthlyList(timeArr){
graMonthly(Object.assign({resourceType: this.resourceType, bandwidthType: 2}, this.paramsVal, timeArr)).then(res => { let fnType = serverGraphMonth;
if (this.resourceType === 2) {
fnType = switchGraphMonth;
}
let newChartData = JSON.parse(JSON.stringify(this.echartData));
newChartData.dataList[newChartData.dataList.length - 1].name = '95带宽值/月';
fnType(Object.assign({}, this.paramsVal, timeArr)).then(res => {
if (res && res.data && res.data.length > 0) { if (res && res.data && res.data.length > 0) {
let chartList = [];
res.data.forEach((item, index) => { res.data.forEach((item, index) => {
item.titleList = this.resourceType === 1 ? '' + item.nodeName + '】【' + item.businessName + '' : '' + item.nodeName + '】【' + item.interfaceName + '】【' + item.businessName + '】'; let outContent = `最后一个值:${item && item.other && item.other.lastOutSpeedGb ? item.other.lastOutSpeedGb + 'G' : '0'} 平均值:${item && item.other && item.other.avgOutSpeedGb ? item.other.avgOutSpeedGb + 'G' : '0'} 最大值:${item && item.other && item.other.maxOutSpeedGb ? item.other.maxOutSpeedGb + 'G' : '0'}`;
item.resultData['hiddenTime'] = true; let inContent = `最后一个值:${item && item.other && item.other.lastInSpeedGb ? item.other.lastInSpeedGb + 'G' : '0'} 平均值:${item && item.other && item.other.avgInSpeedGb ? item.other.avgInSpeedGb + 'G' : '0'} 最大值:${item && item.other && item.other.maxInSpeedGb ? item.other.maxInSpeedGb + 'G' : '0'}`;
let dataList = Object.assign({dateShowType: 'month', fnEvent: 'graMonthlyList'},item, this.typeObj[2]); let kdContent = `(${item && item.percentile95 ? item.percentile95 + 'mbit' : '0'} out)`;
this.$set(this.echartListData, index * 7 + 1, dataList); newChartData.title = item && item.name;
newChartData.yAxisName = item && item.other && item.other.recommendedUnit ? '单位' + item.other.recommendedUnit : ' ';
newChartData.titleSubtext.subtext = item && item.timeRange || ' ';
newChartData.content[newChartData.dataList[0].name] = outContent;
newChartData.content[newChartData.dataList[1].name] = inContent;
newChartData.content[newChartData.dataList[2].name] = kdContent;
newChartData.lineXData = item && item.xData || [];
newChartData.dataList[0].data = item && item.yData && item.yData['netOutSpeedData'] || [];
newChartData.dataList[1].data = item && item.yData && item.yData['netInSpeedData'] || [];
newChartData.dataList[2].data = item && item.yData && item.yData['percentile95'] || [];
let dataList = Object.assign({}, newChartData, this.typeObj[2]);
chartList.push(dataList);
}); });
// let dataList = Object.assign({dateShowType: 'month', fnEvent: 'graMonthlyList'},res.data, this.typeObj[2]); this.$set(this.echartListData, 'month', chartList);
// this.$set(this.echartListData, 1, dataList);
} else { } else {
this.$set(this.echartListData, 1, {}); this.$set(this.echartListData, 'month', []);
} }
}); });
}, },
@@ -338,8 +408,8 @@
const month = String(new Date().getMonth() + 1).padStart(2, '0'); // 0=1月11=12月 const month = String(new Date().getMonth() + 1).padStart(2, '0'); // 0=1月11=12月
const day = String(new Date().getDate()).padStart(2, '0'); // 当前日如8 const day = String(new Date().getDate()).padStart(2, '0'); // 当前日如8
const prevDay = String(new Date().getDate() - 1).padStart(2, '0'); const prevDay = String(new Date().getDate() - 1).padStart(2, '0');
startData = `${year}-${month}-${prevDay} 00:00:00`; startData = `${year}-${month}-${prevDay}`;
endData = `${year}-${month}-${day} 00:00:00`; endData = `${year}-${month}-${day}`;
return {startTime: startData, endTime: endData}; return {startTime: startData, endTime: endData};
}, },
// 获取前一个月的所有日期 // 获取前一个月的所有日期

View File

@@ -2,10 +2,10 @@
<div class="app-container" style="height: calc(100vh)!important"> <div class="app-container" style="height: calc(100vh)!important">
<el-tabs class="h100" v-model="activeName" @tab-click="handleClick"> <el-tabs class="h100" v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="1000计算方式" name="1000"> <el-tab-pane label="1000计算方式" name="1000">
<AnalysisChart ref="childRef" v-if="activeName === '1000'" :activeName="activeName" :noticeType="noticeType"></AnalysisChart> <AnalysisChart ref="childRef" v-if="activeName === '1000'" :activeName="activeName" :clientId="clientId"></AnalysisChart>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="1024计算方式" name="1024"> <el-tab-pane label="1024计算方式" name="1024">
<AnalysisChart ref="childRef" v-if="activeName === '1024'" :activeName="activeName" :noticeType="noticeType"></AnalysisChart> <AnalysisChart ref="childRef" v-if="activeName === '1024'" :activeName="activeName" :clientId="clientId"></AnalysisChart>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
@@ -20,7 +20,7 @@
data() { data() {
return { return {
activeName: '', activeName: '',
noticeType: [], clientId: [],
} }
}, },
created() {}, created() {},
@@ -53,7 +53,7 @@
// }, // },
methods: { methods: {
handleClick() { handleClick() {
this.noticeType = this.$refs.childRef.form.noticeType; this.clientId = this.$refs.childRef.form.clientId;
} }
} }
} }

View File

@@ -3,7 +3,7 @@
<!-- 表格数据 --> <!-- 表格数据 -->
<el-table v-loading="loading" :data="roleList"> <el-table v-loading="loading" :data="roleList">
<template v-for="(item,index) of columns"> <template v-for="(item,index) of columns">
<el-table-column :label="item.label" :prop="item.prop" :sortable="item.sortable" :width="item.width" v-if="item.visible" :show-overflow-tooltip="true"> <el-table-column :label="item.label" :prop="item.prop" :sortable="item.sortable" :width="item.width" :minWidth="item.minWidth" v-if="item.visible" :show-overflow-tooltip="true">
<template v-if="item.slotName" #default="scope"> <template v-if="item.slotName" #default="scope">
<span v-if="scope.row && scope.row[item.prop]">{{scope.row[item.prop]}}/{{scope.row.createTime}}</span> <span v-if="scope.row && scope.row[item.prop]">{{scope.row[item.prop]}}/{{scope.row.createTime}}</span>
</template> </template>
@@ -48,13 +48,13 @@
} }
this. columns = [ this. columns = [
{label: `业务名称`, minWidth: '120', prop: 'businessName',visible: true}, {label: `业务名称`, minWidth: '120', prop: 'businessName',visible: true},
{label: `时间`,minWidth: '160', prop: 'createTime', visible: !type}, {label: `时间`, minWidth: '160', prop: 'createTime', visible: !type},
{label: `95带宽值/日(Mbit)`, prop: 'bandwidth95Daily', slotName: true, visible: type}, {label: `95带宽值/日(Mbit)`, prop: 'bandwidth95Daily', slotName: true, visible: type},
// {label: `有效95带宽值Mbps/日`, prop: 'effectiveAvgMonthlyBandwidth95', slotName: true, visible: type}, // {label: `有效95带宽值Mbps/日`, prop: 'effectiveAvgMonthlyBandwidth95', slotName: true, visible: type},
// {label: `包端带宽值Mbps/日`, prop: 'packageBandwidthDaily', slotName: true, visible: type}, // {label: `包端带宽值Mbps/日`, prop: 'packageBandwidthDaily', slotName: true, visible: type},
{label: `流量端口`, prop: 'name', width: '550', visible: !type}, {label: `流量端口`, prop: 'name', minWidth: '350', visible: !type},
{label: `发送流量值bytes/s`, minWidth: '150', prop: 'outSpeed', visible: !type}, {label: `发送流量值bytes/s`, minWidth: '150', prop: 'outSpeed', visible: !type},
{label: `金山API记录的发送流量值bites/s`, minWidth: '250', prop: 'machineCode', visible: !type}, {label: `金山API记录的发送流量值bites/s`, minWidth: '220', prop: 'machineCode', visible: !type},
]; ];
}, },
/** 查询角色列表 */ /** 查询角色列表 */
@@ -64,7 +64,9 @@
this.loading = false; this.loading = false;
this.roleList = response && response.rows; this.roleList = response && response.rows;
this.total = response && response.total || response && response.data.length; this.total = response && response.total || response && response.data.length;
}) }).catch(() => {
this.loading = false;
});
}, },
goBack() { goBack() {
this.$router.go(-1); this.$router.go(-1);

View File

@@ -132,7 +132,7 @@
</el-form> </el-form>
<!-- 表格数据 --> <!-- 表格数据 -->
<TableList class="w100 h100" :columns="columns" :config="config" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList class="w100 h100" :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<template #tempDay="{ valueKey, row, column }"> <template #tempDay="{ valueKey, row, column }">
<span v-if="row && row[valueKey]">{{row[valueKey]}}/{{row.createTime}}</span> <span v-if="row && row[valueKey]">{{row[valueKey]}}/{{row.createTime}}</span>
</template> </template>

View File

@@ -33,7 +33,7 @@
</el-col> </el-col>
</el-form> </el-form>
<!-- 表格数据 --> <!-- 表格数据 -->
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<template #tempRevenue="{ row, column }"> <template #tempRevenue="{ row, column }">
<dict-tag :options="dict.type.eps_revenue_method" :value="row.revenueMethod"/> <dict-tag :options="dict.type.eps_revenue_method" :value="row.revenueMethod"/>
</template> </template>

View File

@@ -3,7 +3,7 @@
<!-- 表格数据 --> <!-- 表格数据 -->
<el-table v-loading="loading" :data="roleList"> <el-table v-loading="loading" :data="roleList">
<template v-for="(item,index) of columns"> <template v-for="(item,index) of columns">
<el-table-column :label="item.label" :prop="item.prop" :sortable="item.sortable" :width="item.width" v-if="item.visible" :show-overflow-tooltip="true"> <el-table-column :label="item.label" :prop="item.prop" :sortable="item.sortable" :width="item.width" :minWidth="item.minWidth" v-if="item.visible" :show-overflow-tooltip="true">
<template v-if="item.slotName" #default="scope"> <template v-if="item.slotName" #default="scope">
<span v-if="scope.row && scope.row[item.prop]">{{scope.row[item.prop]}}/{{scope.row.createTime}}</span> <span v-if="scope.row && scope.row[item.prop]">{{scope.row[item.prop]}}/{{scope.row.createTime}}</span>
</template> </template>
@@ -68,7 +68,9 @@
this.loading = false; this.loading = false;
this.roleList = response && response.rows; this.roleList = response && response.rows;
this.total = response && response.total || response && response.data.length; this.total = response && response.total || response && response.data.length;
}) }).catch(() => {
this.loading = false;
});
}, },
goBack() { goBack() {
this.$router.back(); this.$router.back();

View File

@@ -160,7 +160,7 @@
</el-form> </el-form>
<!-- 表格数据 --> <!-- 表格数据 -->
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<!-- 资源类型 --> <!-- 资源类型 -->
<template #tempType="{ row, column }"> <template #tempType="{ row, column }">
<dict-tag :options="dict.type.rm_topology_type" :value="row.interfaceLinkDeviceType"/> <dict-tag :options="dict.type.rm_topology_type" :value="row.interfaceLinkDeviceType"/>
@@ -213,13 +213,12 @@
uplinkSwitch: { label: `交换机名称`, minWidth: '180', visible: true }, uplinkSwitch: { label: `交换机名称`, minWidth: '180', visible: true },
hardwareSn: { label: `硬件SN`, minWidth: '200'}, hardwareSn: { label: `硬件SN`, minWidth: '200'},
interfaceName: { label: `接口名称`, minWidth: '120',visible: true }, interfaceName: { label: `接口名称`, minWidth: '120',visible: true },
interfaceLinkDeviceType: { label: `接口连接设备类型`, slotName: 'tempType',minWidth: '180', interfaceLinkDeviceType: { label: `接口连接设备类型`, slotName: 'tempType',minWidth: '180', visible: true },
slotHeaderName: '不同的类型统计方式不一样当类型是服务器时使用的是接口的接收流量95带宽值Mbs/日和95带宽值Mbs/月统计的是交换机接口的接收流量当类型是机房出口的时候95带宽值Mbs/日和95带宽值Mbs/月统计的是交换机接口的发送流量', visible: true },
interfaceRemark: {label: `接口备注`,minWidth: '150'}, interfaceRemark: {label: `接口备注`,minWidth: '150'},
bandwidth95Daily: { label: `95带宽值/日(Mbit)`, minWidth: '200', slotName: 'tempDay', visible: true }, bandwidth95Daily: { label: `95带宽值/日(Mbit)`, minWidth: '200', slotName: 'tempDay', visible: true },
bandwidth95Monthly: { label: `95带宽值/月(Mbit)`, minWidth: '200', slotName: 'tempMonth', visible: true}, bandwidth95Monthly: { label: `95带宽值/月(Mbit)`, minWidth: '200', slotName: 'tempMonth', visible: true},
avgMonthlyBandwidth95: {label: `月均日95值(Mbit`, minWidth: '200', slotName: 'tempDay', visible: true}, avgMonthlyBandwidth95: {label: `月均日95值(Mbit`, minWidth: '200', slotName: 'tempDay', visible: true},
clientId: {label: `ClientID`,minWidth: '150'}, serverClientId: {label: `ClientID`,minWidth: '150'},
businessId: {label: `业务代码`,minWidth: '150'}, businessId: {label: `业务代码`,minWidth: '150'},
businessName: {label: `业务名称`,minWidth: '100'}, businessName: {label: `业务名称`,minWidth: '100'},
// nodeName: { label: `服务器节点名称`, minWidth: '200'}, // nodeName: { label: `服务器节点名称`, minWidth: '200'},
@@ -237,7 +236,7 @@
top: [ top: [
{content: '导出', fnCode: 'export', type: 'warning', icon: 'el-icon-download', hasPermi: 'earnManage:switch:export'}, {content: '导出', fnCode: 'export', type: 'warning', icon: 'el-icon-download', hasPermi: 'earnManage:switch:export'},
{content: '图形分析', fnCode: 'echartView', type: 'success', icon: 'el-icon-data-analysis', hasPermi: 'earnManage:switch:graphicAnalysis'}, {content: '图形分析', fnCode: 'echartView', type: 'success', icon: 'el-icon-data-analysis', hasPermi: 'earnManage:switch:graphicAnalysis'},
{content: '生成接口月均日95值', fnCode: 'createData', type: 'success', icon: 'el-icon-data-analysis', hasPermi: 'earnManage:switch:add'}, // {content: '生成接口月均日95值', fnCode: 'createData', type: 'success', icon: 'el-icon-data-analysis', hasPermi: 'earnManage:switch:add'},
], ],
line: [ line: [
{content: '相关数据', fnCode: 'edit', type: 'text', icon: 'el-icon-tickets', hasPermi: 'earnManage:switch:relevantData'}, {content: '相关数据', fnCode: 'edit', type: 'text', icon: 'el-icon-tickets', hasPermi: 'earnManage:switch:relevantData'},

View File

@@ -32,7 +32,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<template #tempStatus="{ row, column }"> <template #tempStatus="{ row, column }">
<dict-tag :options="dict.type.rm_register_online_state" :value="row.status"/> <dict-tag :options="dict.type.rm_register_online_state" :value="row.status"/>
</template> </template>

View File

@@ -46,7 +46,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<template #tempType="{ row, column }"> <template #tempType="{ row, column }">
<dict-tag :options="dict.type.rm_topology_type" :value="row.connectedDeviceType"/> <dict-tag :options="dict.type.rm_topology_type" :value="row.connectedDeviceType"/>
</template> </template>

View File

@@ -32,7 +32,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<template #tempType="{ row, column }"> <template #tempType="{ row, column }">
<dict-tag :options="dict.type.rm_topology_type" :value="row.connectedDeviceType"/> <dict-tag :options="dict.type.rm_topology_type" :value="row.connectedDeviceType"/>
</template> </template>

View File

@@ -48,7 +48,7 @@
</el-col> </el-col>
</el-form> </el-form>
<input type="file" ref="fileInput" @change="handleFileChange" style="display: none;"> <input type="file" ref="fileInput" @change="handleFileChange" style="display: none;">
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"></TableList> <TableList :columns="columns" :modelIdent="this.$options.name" :config="config" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"></TableList>
<!-- 新建文件夹 --> <!-- 新建文件夹 -->
<el-dialog title="新建文件夹" :visible.sync="open" width="500px" append-to-body> <el-dialog title="新建文件夹" :visible.sync="open" width="500px" append-to-body>
<el-form ref="noticeRef" :rules="rules" :model="formList" label-width="90px"> <el-form ref="noticeRef" :rules="rules" :model="formList" label-width="90px">

View File

@@ -17,7 +17,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<!-- <template #tempTooltip="{ row, column }">--> <!-- <template #tempTooltip="{ row, column }">-->
<!-- <span class="verticalAlign">{{column.label}}</span>--> <!-- <span class="verticalAlign">{{column.label}}</span>-->
<!-- <el-tooltip trigger="click" effect="dark" placement="top">--> <!-- <el-tooltip trigger="click" effect="dark" placement="top">-->

View File

@@ -32,7 +32,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<template #tempStatus="{ row, column }"> <template #tempStatus="{ row, column }">
<dict-tag :options="dict.type.policy_status" :value="row.status"/> <dict-tag :options="dict.type.policy_status" :value="row.status"/>
</template> </template>

View File

@@ -17,7 +17,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<template #tempType="{ row, column }"> <template #tempType="{ row, column }">
<dict-tag :options="dict.type.rm_topology_type" :value="row.connectedDeviceType"/> <dict-tag :options="dict.type.rm_topology_type" :value="row.connectedDeviceType"/>
</template> </template>

View File

@@ -75,7 +75,7 @@
</el-form> </el-form>
<!-- 表格数据 --> <!-- 表格数据 -->
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<!-- 资源类型 --> <!-- 资源类型 -->
<template #tempType="{ row, column }"> <template #tempType="{ row, column }">
<dict-tag :options="dict.type.rm_register_resource_type" :value="row.resourceType"/> <dict-tag :options="dict.type.rm_register_resource_type" :value="row.resourceType"/>

View File

@@ -49,7 +49,7 @@
</el-col> </el-col>
</el-form> </el-form>
<input type="file" ref="fileInput" @change="handleFileChange" style="display: none;"> <input type="file" ref="fileInput" @change="handleFileChange" style="display: none;">
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<!-- <template v-slot:tableExpand="slotProps">--> <!-- <template v-slot:tableExpand="slotProps">-->
<!-- <div v-for="(val, key) of expandList" style="padding: 5px 0 5px 70px;">--> <!-- <div v-for="(val, key) of expandList" style="padding: 5px 0 5px 70px;">-->
<!-- <div style="width: 150px;" class="ml10 disInlineBlock">{{val}}</div>--> <!-- <div style="width: 150px;" class="ml10 disInlineBlock">{{val}}</div>-->

View File

@@ -77,7 +77,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<template #tempType="{ row, column }"> <template #tempType="{ row, column }">
<div @click="fnDetails(row, '1')"> <div @click="fnDetails(row, '1')">
<a href="javascript:;" style="color: #51afff;text-decoration: underline;">{{row.connectedDeviceType}}</a> <a href="javascript:;" style="color: #51afff;text-decoration: underline;">{{row.connectedDeviceType}}</a>

View File

@@ -221,8 +221,8 @@
policyName: {label: '策略名称', span: 12, type: 'input', required: true}, policyName: {label: '策略名称', span: 12, type: 'input', required: true},
priority: {label: '优先级', span: 12, type: 'input', hidden: this.paramsData && this.paramsData.readonly ? false : true}, priority: {label: '优先级', span: 12, type: 'input', hidden: this.paramsData && this.paramsData.readonly ? false : true},
status: {label: '策略状态', span: 12, type: 'select',options: this.dict.type.policy_status, hidden: this.paramsData && this.paramsData.readonly ? false : true}, status: {label: '策略状态', span: 12, type: 'select',options: this.dict.type.policy_status, hidden: this.paramsData && this.paramsData.readonly ? false : true},
deployTime: {label: '下发策略时间', span: 12, type: 'date', hidden: this.paramsData && this.paramsData.readonly ? false : true}, deployTime: {label: '下发策略时间', span: 12, type: 'datetime', hidden: this.paramsData && this.paramsData.readonly ? false : true},
createTime: {label: '创建时间', span: 12, type: 'date', hidden: this.paramsData && this.paramsData.readonly ? false : true}, createTime: {label: '创建时间', span: 12, type: 'datetime', hidden: this.paramsData && this.paramsData.readonly ? false : true},
createBy: {label: '创建人', span: 12, type: 'input',hidden: this.paramsData && this.paramsData.readonly ? false : true}, createBy: {label: '创建人', span: 12, type: 'input',hidden: this.paramsData && this.paramsData.readonly ? false : true},
deployDevice: {label: '部署设备', span: 12, type: 'textarea', rows:15, required: true}, deployDevice: {label: '部署设备', span: 12, type: 'textarea', rows:15, required: true},
description: {label: '描述', span: 12, type: 'textarea'}, description: {label: '描述', span: 12, type: 'textarea'},

View File

@@ -32,7 +32,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<template #tempStatus="{ row, column }"> <template #tempStatus="{ row, column }">
<dict-tag :options="dict.type.policy_status" :value="row.status"/> <dict-tag :options="dict.type.policy_status" :value="row.status"/>
</template> </template>

View File

@@ -89,7 +89,7 @@
</el-form> </el-form>
<!-- 表格数据 --> <!-- 表格数据 -->
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<!-- 多公网IP状态 --> <!-- 多公网IP状态 -->
<template #tempMultipubStatus="{ row, column }"> <template #tempMultipubStatus="{ row, column }">
<dict-tag :options="dict.type.rm_moreip_status" :value="row.multiPublicIpStatus"/> <dict-tag :options="dict.type.rm_moreip_status" :value="row.multiPublicIpStatus"/>

View File

@@ -71,7 +71,7 @@
titleVal: {textAlign: 'left', left: '1%'}, titleVal: {textAlign: 'left', left: '1%'},
yAxisName: ' ', yAxisName: ' ',
gridTop: '35%', gridTop: '35%',
legend: {top: '15%', left: '10%'}, legend: {top: '22%', left: '10%'},
lineXData: [], lineXData: [],
dataList: [ dataList: [
{name: 'CPU正常运行时间', data: []}, {name: 'CPU正常运行时间', data: []},
@@ -133,7 +133,6 @@
titleVal: {textAlign: 'left', left: '1%'}, titleVal: {textAlign: 'left', left: '1%'},
yAxisName: ' ', yAxisName: ' ',
gridTop: '35%', gridTop: '35%',
gridLeft: '-7%',
legend: {top: '15%', left: '10%'}, legend: {top: '15%', left: '10%'},
lineXData: [], lineXData: [],
dataList: [ dataList: [
@@ -226,7 +225,7 @@
formList: {type: '接口类型', status: '运行状态', speed: '速度'}, formList: {type: '接口类型', status: '运行状态', speed: '速度'},
formModel: {}, formModel: {},
echartFors: [ echartFors: [
{title: '的流量(Kbps)', oneName: '入站流量', twoName: '出站流量'}, {title: '的流量', oneName: '入站流量', twoName: '出站流量'},
{title: '的丢包数(个)', oneName: '入站丢包', twoName: '出站丢包'}, {title: '的丢包数(个)', oneName: '入站丢包', twoName: '出站丢包'},
], ],
echartList: [] echartList: []
@@ -302,7 +301,7 @@
this.formData = {formFirst: this.formFirst}; this.formData = {formFirst: this.formFirst};
serverMonitorData({clientId: this.paramsData.clientId}).then(res => { serverMonitorData({clientId: this.paramsData.clientId}).then(res => {
if (res && res.data) { if (res && res.data) {
this.formData['formValue'] = res.data; this.$set(this.formData, 'formValue', res.data);
} }
}); });
}, },
@@ -404,6 +403,9 @@
memoryUtilizaData.dataVal.lineXData = res && res.data && res.data['xData'] && res.data['xData'].length > 0 ? res.data['xData'] : memoryUtilizaData.dataVal.lineXData = res && res.data && res.data['xData'] && res.data['xData'].length > 0 ? res.data['xData'] :
this.firstChartTrans && this.firstChartTrans['timeList'] && this.firstChartTrans['timeList'].length > 0 ? this.firstChartTrans['timeList'] : []; this.firstChartTrans && this.firstChartTrans['timeList'] && this.firstChartTrans['timeList'].length > 0 ? this.firstChartTrans['timeList'] : [];
memoryUtilizaData.dataVal.dataList[0].data = res && res.data && res.data['yData'] && res.data['yData']['memoryUtilizationData'] && res.data['yData']['memoryUtilizationData'].length > 0 ? res.data['yData']['memoryUtilizationData'] : []; memoryUtilizaData.dataVal.dataList[0].data = res && res.data && res.data['yData'] && res.data['yData']['memoryUtilizationData'] && res.data['yData']['memoryUtilizationData'].length > 0 ? res.data['yData']['memoryUtilizationData'] : [];
if (memoryUtilizaData.dataVal.dataList[0].data.length > 0 && memoryUtilizaData.dataVal.dataList[0].data.some(num => num < 0)) {
memoryUtilizaData.dataVal.gridLeft = '-7%';
}
} }
// this.firstChartList[2] = powerData; // this.firstChartList[2] = powerData;
this.$set(this.firstChartList, 5, memoryUtilizaData); this.$set(this.firstChartList, 5, memoryUtilizaData);
@@ -529,7 +531,7 @@
spaceEcharts(Object.assign({}, {mount : titleName,clientId: this.paramsData.clientId}, times)).then(res => { spaceEcharts(Object.assign({}, {mount : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) { if (res && res.data) {
mountEcharts.title = titleName + content.echartFors[0].title; mountEcharts.title = titleName + content.echartFors[0].title;
mountEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ''; mountEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';
mountEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || []; mountEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
mountEcharts.dataVal.dataList[0] = { mountEcharts.dataVal.dataList[0] = {
name: content.echartFors[0].oneName, name: content.echartFors[0].oneName,
@@ -557,7 +559,7 @@
spaceRate(Object.assign({}, {mount : titleName,clientId: this.paramsData.clientId}, times)).then(res => { spaceRate(Object.assign({}, {mount : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) { if (res && res.data) {
mountEcharts.title = titleName + content.echartFors[1].title; mountEcharts.title = titleName + content.echartFors[1].title;
mountEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ''; mountEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';
mountEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || []; mountEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
mountEcharts.dataVal.dataList[0] = { mountEcharts.dataVal.dataList[0] = {
name: content.echartFors[1].oneName, name: content.echartFors[1].oneName,
@@ -613,7 +615,7 @@
return trafficEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => { return trafficEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) { if (res && res.data) {
netEcharts.title = titleName + content.echartFors[0].title; netEcharts.title = titleName + content.echartFors[0].title;
netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ''; netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || []; netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
netEcharts.dataVal.dataList[0] = { netEcharts.dataVal.dataList[0] = {
name: content.echartFors[0].oneName, name: content.echartFors[0].oneName,
@@ -641,7 +643,7 @@
return droppedEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => { return droppedEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) { if (res && res.data) {
netEcharts.title = titleName + content.echartFors[1].title; netEcharts.title = titleName + content.echartFors[1].title;
netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ''; netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || []; netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
netEcharts.dataVal.dataList[0] = { netEcharts.dataVal.dataList[0] = {
name: content.echartFors[1].oneName, name: content.echartFors[1].oneName,
@@ -708,7 +710,7 @@
return speedEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => { return speedEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) { if (res && res.data) {
netEcharts.title = titleName + content.echartFors[0].title; netEcharts.title = titleName + content.echartFors[0].title;
netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ''; netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || []; netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
netEcharts.dataVal.dataList[0] = { netEcharts.dataVal.dataList[0] = {
name: content.echartFors[0].oneName, name: content.echartFors[0].oneName,
@@ -736,7 +738,7 @@
return timesEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => { return timesEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) { if (res && res.data) {
netEcharts.title = titleName + content.echartFors[1].title; netEcharts.title = titleName + content.echartFors[1].title;
netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ''; netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || []; netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
netEcharts.dataVal.dataList[0] = { netEcharts.dataVal.dataList[0] = {
name: content.echartFors[1].oneName, name: content.echartFors[1].oneName,
@@ -764,7 +766,7 @@
return bytesEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => { return bytesEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) { if (res && res.data) {
netEcharts.title = titleName + content.echartFors[2].title; netEcharts.title = titleName + content.echartFors[2].title;
netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ''; netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || []; netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
netEcharts.dataVal.dataList[0] = { netEcharts.dataVal.dataList[0] = {
name: content.echartFors[2].oneName, name: content.echartFors[2].oneName,
@@ -831,7 +833,7 @@
return cpuUtilEcharts(Object.assign({}, {id : titleName,clientId: this.paramsData.clientId}, times)).then(res => { return cpuUtilEcharts(Object.assign({}, {id : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) { if (res && res.data) {
netEcharts.title = titleName + content.echartFors[0].title; netEcharts.title = titleName + content.echartFors[0].title;
netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ''; netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || []; netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
netEcharts.dataVal.dataList[0] = { netEcharts.dataVal.dataList[0] = {
name: content.echartFors[0].oneName, name: content.echartFors[0].oneName,
@@ -855,7 +857,7 @@
return dockerMemEcharts(Object.assign({}, {id : titleName,clientId: this.paramsData.clientId}, times)).then(res => { return dockerMemEcharts(Object.assign({}, {id : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) { if (res && res.data) {
netEcharts.title = titleName + content.echartFors[1].title; netEcharts.title = titleName + content.echartFors[1].title;
netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ''; netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || []; netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
netEcharts.dataVal.dataList[0] = { netEcharts.dataVal.dataList[0] = {
name: content.echartFors[1].oneName, name: content.echartFors[1].oneName,
@@ -879,7 +881,7 @@
return dockerSpeedEcharts(Object.assign({}, {id : titleName,clientId: this.paramsData.clientId}, times)).then(res => { return dockerSpeedEcharts(Object.assign({}, {id : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) { if (res && res.data) {
netEcharts.title = titleName + content.echartFors[2].title; netEcharts.title = titleName + content.echartFors[2].title;
netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ''; netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || []; netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
netEcharts.dataVal.dataList[0] = { netEcharts.dataVal.dataList[0] = {
name: content.echartFors[2].oneName, name: content.echartFors[2].oneName,
@@ -922,6 +924,7 @@
// 检查函数是否存在,避免报错 // 检查函数是否存在,避免报错
if (typeof this[fnName] === 'function') { if (typeof this[fnName] === 'function') {
this.defaultTimes = valData.timeArr; this.defaultTimes = valData.timeArr;
this.firstTabTimeArr = valData.timeArr;
// 调用实际函数,并传递参数(如选中的值、当前项) // 调用实际函数,并传递参数(如选中的值、当前项)
this[fnName]({startTime: valData.timeArr[0], endTime: valData.timeArr[1]}, tabName); this[fnName]({startTime: valData.timeArr[0], endTime: valData.timeArr[1]}, tabName);
} else { } else {

View File

@@ -32,7 +32,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<template #tempMethod="{ row, column }"> <template #tempMethod="{ row, column }">
<dict-tag :options="dict.type.policy_method" :value="row.executionMethod"/> <dict-tag :options="dict.type.policy_method" :value="row.executionMethod"/>
</template> </template>

View File

@@ -1,4 +1,4 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<Form ref="formRef" :formList="formList" :ruleFormData="ruleForm" :config="this.paramsData && this.paramsData.readonly ? {labelWidth: '140px', buttonGroup: []} : {labelWidth: '140px'}" @fnClick="callback"></Form> <Form ref="formRef" :formList="formList" :ruleFormData="ruleForm" :config="this.paramsData && this.paramsData.readonly ? {labelWidth: '140px', buttonGroup: []} : {labelWidth: '140px'}" @fnClick="callback"></Form>
<el-button v-if="this.paramsData && this.paramsData.readonly" style="float: right;margin-top: 12px;margin-left: 10px;" @click="callback({fnCode: 'cancel'})">返回</el-button> <el-button v-if="this.paramsData && this.paramsData.readonly" style="float: right;margin-top: 12px;margin-left: 10px;" @click="callback({fnCode: 'cancel'})">返回</el-button>

View File

@@ -32,7 +32,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<template #tempFirst="{ row, column }"> <template #tempFirst="{ row, column }">
<div @click="fnDetails(1,row)"> <div @click="fnDetails(1,row)">
<a href="javascript:;" style="color: #51afff;text-decoration: underline;">{{row.offlineNum}}</a> <a href="javascript:;" style="color: #51afff;text-decoration: underline;">{{row.offlineNum}}</a>

View File

@@ -212,7 +212,7 @@
getMonitorPolicy(id).then(val => { getMonitorPolicy(id).then(val => {
if (val && val.data) { if (val && val.data) {
if (val.data && val.data.policy){ if (val.data && val.data.policy){
val.data.policy['deployDevice'] = val.data.policy.deployDevice.split('/n'); val.data.policy['deployDevice'] = val.data.policy.deployDevice.split('\n');
// val.data.policy['status'] = Number(val.data.policy.status); // val.data.policy['status'] = Number(val.data.policy.status);
this.ruleFormData = val.data.policy; this.ruleFormData = val.data.policy;
} }

View File

@@ -32,7 +32,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<template #tempType="{ row, column }"> <template #tempType="{ row, column }">
<dict-tag :options="dict.type.switch_type" :value="row.switchType"/> <dict-tag :options="dict.type.switch_type" :value="row.switchType"/>
</template> </template>

View File

@@ -33,7 +33,7 @@
</el-form> </el-form>
<!-- 表格数据 --> <!-- 表格数据 -->
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<!-- 资源类型 --> <!-- 资源类型 -->
<template #tempType="{ row, column }"> <template #tempType="{ row, column }">
<dict-tag :options="dict.type.rm_register_resource_type" :value="row.resourceType"/> <dict-tag :options="dict.type.rm_register_resource_type" :value="row.resourceType"/>
@@ -208,7 +208,7 @@
case 'echartView': case 'echartView':
this.$router.push({ this.$router.push({
path:'/resource/switchRegister/monitorChart', path:'/resource/switchRegister/monitorChart',
query: {clientId: rowData.hardwareSn} query: {clientId: rowData.clientId}
}); });
break; break;
case 'monitorStrategy': case 'monitorStrategy':

View File

@@ -126,7 +126,7 @@
formModel: {}, formModel: {},
echartFors: [ echartFors: [
{title: '的丢包数', oneName: '入站丢包', twoName: '出站丢包'}, {title: '的丢包数', oneName: '入站丢包', twoName: '出站丢包'},
{title: '的Bites总数', oneName: '端口发送Bites总数', twoName: '端口接收Bites总数'}, // {title: '的Bites总数', oneName: '端口发送Bites总数', twoName: '端口接收Bites总数'},
{title: '的错误包数量', oneName: '错误的入站数据包数量', twoName: '错误的出战数据包数量'}, {title: '的错误包数量', oneName: '错误的入站数据包数量', twoName: '错误的出战数据包数量'},
{title: '的网络速率', oneName: '端口实时接收速率', twoName: '端口实时发送速率'}, {title: '的网络速率', oneName: '端口实时接收速率', twoName: '端口实时发送速率'},
], ],
@@ -215,7 +215,7 @@
this.formData = {formFirst: this.formFirst}; this.formData = {formFirst: this.formFirst};
switchMonitorData({clientId: this.paramsData.clientId}).then(res => { switchMonitorData({clientId: this.paramsData.clientId}).then(res => {
if (res && res.data) { if (res && res.data) {
this.formData['formValue'] = res.data; this.$set(this.formData, 'formValue', res.data);
} }
}); });
}, },
@@ -325,19 +325,19 @@
switchNetDetails({clientId: this.paramsData.clientId, ifDescr: titleName}).then(async res => { switchNetDetails({clientId: this.paramsData.clientId, ifDescr: titleName}).then(async res => {
this.secondChartList[keyName].formModel = res && res.data || []; this.secondChartList[keyName].formModel = res && res.data || [];
if (await this.getNetDiscards(times ,titleName, keyName)) { if (await this.getNetDiscards(times ,titleName, keyName)) {
if (await this.getNetTotal(times, titleName, keyName)) { // if (await this.getNetTotal(times, titleName, keyName)) {
if (await this.getNetErrDisc(times, titleName, keyName)) { if (await this.getNetErrDisc(times, titleName, keyName)) {
this.getNetSpeed(times, titleName, keyName); this.getNetSpeed(times, titleName, keyName);
} }
} // }
} }
}).catch(async error => { }).catch(async error => {
if (await this.getNetDiscards(times ,titleName, keyName)) { if (await this.getNetDiscards(times ,titleName, keyName)) {
if (await this.getNetTotal(times, titleName, keyName)) { // if (await this.getNetTotal(times, titleName, keyName)) {
if (await this.getNetErrDisc(times, titleName, keyName)) { if (await this.getNetErrDisc(times, titleName, keyName)) {
this.getNetSpeed(times, titleName, keyName); this.getNetSpeed(times, titleName, keyName);
} }
} // }
} }
}); });
}, },
@@ -351,6 +351,7 @@
return switchNetDiscards(Object.assign({}, {ifDescr : titleName,clientId: this.paramsData.clientId}, times)).then(res => { return switchNetDiscards(Object.assign({}, {ifDescr : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) { if (res && res.data) {
netEcharts.title = titleName + content.echartFors[0].title; netEcharts.title = titleName + content.echartFors[0].title;
netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || []; netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
// 入 // 入
netEcharts.dataVal.dataList[0] = { netEcharts.dataVal.dataList[0] = {
@@ -380,6 +381,7 @@
return switchNeTotal(Object.assign({}, {ifDescr : titleName, clientId: this.paramsData.clientId}, times)).then(res => { return switchNeTotal(Object.assign({}, {ifDescr : titleName, clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) { if (res && res.data) {
netEcharts.title = titleName + content.echartFors[1].title; netEcharts.title = titleName + content.echartFors[1].title;
netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || []; netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
// 入 // 入
netEcharts.dataVal.dataList[0] = { netEcharts.dataVal.dataList[0] = {
@@ -408,17 +410,18 @@
netEcharts.fnEvent = 'getNetErrDisc'; netEcharts.fnEvent = 'getNetErrDisc';
return switchNetErrDiscard(Object.assign({}, {ifDescr : titleName, clientId: this.paramsData.clientId}, times)).then(res => { return switchNetErrDiscard(Object.assign({}, {ifDescr : titleName, clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) { if (res && res.data) {
netEcharts.title = titleName + content.echartFors[2].title; netEcharts.title = titleName + content.echartFors[1].title;
netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || []; netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
netEcharts.dataVal.dataList[0] = { netEcharts.dataVal.dataList[0] = {
name: content.echartFors[2].oneName, name: content.echartFors[1].oneName,
data: res.data && res.data.yData['netInErrDiscardsData'] || [] data: res.data && res.data.yData['netInErrDiscardsData'] || []
}; };
netEcharts.dataVal.dataList[1] = { netEcharts.dataVal.dataList[1] = {
name: content.echartFors[2].twoName, name: content.echartFors[1].twoName,
data: res.data && res.data.yData['netOutErrDiscardsData'] || [] data: res.data && res.data.yData['netOutErrDiscardsData'] || []
}; };
mountCollect['echartList'][2] = netEcharts; mountCollect['echartList'][1] = netEcharts;
this.$set(this.secondChartList, keyName, mountCollect); this.$set(this.secondChartList, keyName, mountCollect);
return true; return true;
} }
@@ -435,17 +438,18 @@
netEcharts.fnEvent = 'getNetSpeed'; netEcharts.fnEvent = 'getNetSpeed';
return switchNetSpeed(Object.assign({}, {ifDescr : titleName, clientId: this.paramsData.clientId}, times)).then(res => { return switchNetSpeed(Object.assign({}, {ifDescr : titleName, clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) { if (res && res.data) {
netEcharts.title = titleName + content.echartFors[3].title; netEcharts.title = titleName + content.echartFors[2].title;
netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || []; netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
netEcharts.dataVal.dataList[0] = { netEcharts.dataVal.dataList[0] = {
name: content.echartFors[3].oneName, name: content.echartFors[2].oneName,
data: res.data && res.data.yData['netInSpeedData'] || [] data: res.data && res.data.yData['netInSpeedData'] || []
}; };
netEcharts.dataVal.dataList[1] = { netEcharts.dataVal.dataList[1] = {
name: content.echartFors[3].twoName, name: content.echartFors[2].twoName,
data: res.data && res.data.yData['netOutSpeedData'] || [] data: res.data && res.data.yData['netOutSpeedData'] || []
}; };
mountCollect['echartList'][3] = netEcharts; mountCollect['echartList'][2] = netEcharts;
this.$set(this.secondChartList, keyName, mountCollect); this.$set(this.secondChartList, keyName, mountCollect);
// return true; // return true;
this.$modal.closeLoading(); this.$modal.closeLoading();
@@ -499,6 +503,7 @@
return moduleLowThreshold(Object.assign({}, {moudleName : titleName,clientId: this.paramsData.clientId}, times)).then(res => { return moduleLowThreshold(Object.assign({}, {moudleName : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) { if (res && res.data) {
netEcharts.title = titleName + content.echartFors[0].title; netEcharts.title = titleName + content.echartFors[0].title;
netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || []; netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
// 入 // 入
netEcharts.dataVal.dataList[0] = { netEcharts.dataVal.dataList[0] = {
@@ -528,6 +533,7 @@
return modulePower(Object.assign({}, {moudleName : titleName, clientId: this.paramsData.clientId}, times)).then(res => { return modulePower(Object.assign({}, {moudleName : titleName, clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) { if (res && res.data) {
netEcharts.title = titleName + content.echartFors[1].title; netEcharts.title = titleName + content.echartFors[1].title;
netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || []; netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
// 入 // 入
netEcharts.dataVal.dataList[0] = { netEcharts.dataVal.dataList[0] = {
@@ -597,6 +603,7 @@
return mpuCpuUse(Object.assign({}, {mpuName : titleName,clientId: this.paramsData.clientId}, times)).then(res => { return mpuCpuUse(Object.assign({}, {mpuName : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) { if (res && res.data) {
netEcharts.title = titleName + content.echartFors[0].title; netEcharts.title = titleName + content.echartFors[0].title;
netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || []; netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
// 入 // 入
netEcharts.dataVal.dataList[0] = { netEcharts.dataVal.dataList[0] = {
@@ -621,6 +628,7 @@
return mpuMemUse(Object.assign({}, {mpuName : titleName, clientId: this.paramsData.clientId}, times)).then(res => { return mpuMemUse(Object.assign({}, {mpuName : titleName, clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) { if (res && res.data) {
netEcharts.title = titleName + content.echartFors[1].title; netEcharts.title = titleName + content.echartFors[1].title;
netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || []; netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
// 入 // 入
netEcharts.dataVal.dataList[0] = { netEcharts.dataVal.dataList[0] = {
@@ -645,6 +653,7 @@
return mpuTemperature(Object.assign({}, {mpuName : titleName, clientId: this.paramsData.clientId}, times)).then(res => { return mpuTemperature(Object.assign({}, {mpuName : titleName, clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) { if (res && res.data) {
netEcharts.title = titleName + content.echartFors[2].title; netEcharts.title = titleName + content.echartFors[2].title;
netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || []; netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
// 入 // 入
netEcharts.dataVal.dataList[0] = { netEcharts.dataVal.dataList[0] = {
@@ -705,6 +714,7 @@
return pwrCurrent(Object.assign({}, {pwrName : titleName,clientId: this.paramsData.clientId}, times)).then(res => { return pwrCurrent(Object.assign({}, {pwrName : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) { if (res && res.data) {
netEcharts.title = titleName + content.echartFors[0].title; netEcharts.title = titleName + content.echartFors[0].title;
netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || []; netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
// 入 // 入
netEcharts.dataVal.dataList[0] = { netEcharts.dataVal.dataList[0] = {
@@ -729,6 +739,7 @@
return pwrVoltage(Object.assign({}, {pwrName : titleName, clientId: this.paramsData.clientId}, times)).then(res => { return pwrVoltage(Object.assign({}, {pwrName : titleName, clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) { if (res && res.data) {
netEcharts.title = titleName + content.echartFors[1].title; netEcharts.title = titleName + content.echartFors[1].title;
netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || []; netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
// 入 // 入
netEcharts.dataVal.dataList[0] = { netEcharts.dataVal.dataList[0] = {
@@ -798,6 +809,7 @@
// 检查函数是否存在,避免报错 // 检查函数是否存在,避免报错
if (typeof this[fnName] === 'function') { if (typeof this[fnName] === 'function') {
this.defaultTimes = valData.timeArr; this.defaultTimes = valData.timeArr;
this.firstTabTimeArr = valData.timeArr;
// 调用实际函数,并传递参数(如选中的值、当前项) // 调用实际函数,并传递参数(如选中的值、当前项)
this[fnName]({startTime: valData.timeArr[0], endTime: valData.timeArr[1]}, tabName, key); this[fnName]({startTime: valData.timeArr[0], endTime: valData.timeArr[1]}, tabName, key);
} else { } else {

View File

@@ -123,13 +123,15 @@
this.fnInterFaceNameList({switchIp: switchIp}); this.fnInterFaceNameList({switchIp: switchIp});
break; break;
case 'serverClientId': case 'serverClientId':
let serverIp = ''; if (dataVal) {
this.serverNameList.find(item => { // let serverIp = '';
if (item.clientId === dataVal) { // this.serverNameList.find(item => {
serverIp = item.ipAddress; // if (item.clientId === dataVal) {
} // serverIp = item.ipAddress;
}); // }
this.fnServerPortList({serverIp: serverIp}); // });
this.fnServerPortList({clientId: dataVal});
}
break; break;
case 'submit': case 'submit':
this.switchNameList.find(item => { this.switchNameList.find(item => {
@@ -138,8 +140,8 @@
} }
}); });
this.serverNameList.find(item => { this.serverNameList.find(item => {
if (item.resourceName === dataVal['serverClientId'] || item.resourceName === dataVal['serverClientId']) { if (item.clientId === dataVal['serverClientId']) {
dataVal['serverClientId'] = item.resourceName; dataVal['serverClientId'] = item.clientId;
dataVal['serverSn'] = item.hardwareSn; dataVal['serverSn'] = item.hardwareSn;
} }
}); });

View File

@@ -17,7 +17,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<template #tempType="{ row, column }"> <template #tempType="{ row, column }">
<dict-tag :options="dict.type.rm_topology_type" :value="row.connectedDeviceType"/> <dict-tag :options="dict.type.rm_topology_type" :value="row.connectedDeviceType"/>
</template> </template>

View File

@@ -18,7 +18,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange"> <TableList :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<template #tempTitle="{ row, column }"> <template #tempTitle="{ row, column }">
<div @click="fnDetails(row)"> <div @click="fnDetails(row)">
<a href="javascript:;" style="color: #51afff;">{{row.title}}</a> <a href="javascript:;" style="color: #51afff;">{{row.title}}</a>