业务95值
This commit is contained in:
@@ -348,3 +348,62 @@ export function reviewBusiness(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
/** ------------------业务95值计算------------------- */
|
||||
// 查询列表
|
||||
export function listTaskStatic(data) {
|
||||
return request({
|
||||
url: '/system/taskStatistics/list',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 新增
|
||||
export function addTaskStatic(data) {
|
||||
return request({
|
||||
url: '/system/taskStatistics',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 交换机级联接口
|
||||
export function switchNameTree(data) {
|
||||
return request({
|
||||
url: '/system/switchManagement/getAllSwitchNameTree',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export function updateRelate(data) {
|
||||
return request({
|
||||
url: '/system/taskStatistics/updateRelateData',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 重新计算
|
||||
export function taskRecaculate(data) {
|
||||
return request({
|
||||
url: '/system/taskStatistics/recaculate',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 相关数据
|
||||
export function taskRelate(data) {
|
||||
return request({
|
||||
url: '/system/taskStatistics/getRelateData',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 查看图形
|
||||
export function taskRraphical(data) {
|
||||
return request({
|
||||
url: '/system/taskStatistics/getRraphicalMsg',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -728,6 +728,13 @@ export function getRegistList(query) {
|
||||
data: query
|
||||
})
|
||||
}
|
||||
export function bindBusByClient(query) {
|
||||
return request({
|
||||
url: 'system/registration/bindBusinessByClientIds',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
export function networkList(query) {
|
||||
return request({
|
||||
url: '/rocketmq/networkInterface/list',
|
||||
|
||||
@@ -303,7 +303,7 @@ aside {
|
||||
border-color: transparent;
|
||||
color: #606266;
|
||||
font-weight: 700;
|
||||
cursor: not-allowed;
|
||||
cursor: auto!important;
|
||||
resize: none;
|
||||
}
|
||||
.el-input.is-disabled .el-input__icon {
|
||||
|
||||
@@ -65,11 +65,22 @@
|
||||
},
|
||||
methods: {
|
||||
getList(title, dataXY) {
|
||||
console.log('dataXY===',dataXY);
|
||||
const lineDataListIntance = echarts.init(document.getElementById('lineChart' + this.num));
|
||||
let titleList = {text: title, x: '50%', y: '3%', textAlign: 'center',textStyle: {fontSize: 16}};
|
||||
if (dataXY && dataXY.titleVal) {
|
||||
titleList = Object.assign({},titleList, dataXY.titleVal);
|
||||
}
|
||||
let legendData = dataXY && dataXY.legend ? dataXY.legend : {};
|
||||
if (dataXY && dataXY.legend && dataXY.legend.formatter) {
|
||||
let formatData = {
|
||||
// formatter: function(params) {
|
||||
// const customSuffix = 'xxxxx';
|
||||
// return `${params} ${customSuffix}`;
|
||||
// },
|
||||
};
|
||||
legendData = Object.assign({}, legendData, formatData);
|
||||
}
|
||||
let series = [];
|
||||
if (dataXY && dataXY.dataList && dataXY.dataList.length > 0) {
|
||||
dataXY.dataList.forEach(item => {
|
||||
@@ -96,7 +107,7 @@
|
||||
}
|
||||
let option = {
|
||||
title: [titleList],
|
||||
legend: dataXY && dataXY.legend ? dataXY.legend : {},
|
||||
legend: legendData,
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
@@ -108,9 +119,9 @@
|
||||
},
|
||||
grid: {
|
||||
top: dataXY && dataXY.gridTop || '80px',
|
||||
left: '2%',
|
||||
left: dataXY && dataXY.gridLeft || '2%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
bottom: dataXY && dataXY.gridBotm || '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<template v-for="(formItem,index) of formList">
|
||||
<h4 v-if="formItem && formItem.config && formItem.config.title" style="color: #000;" class="form-header h4">{{formItem.config.title}}</h4>
|
||||
<el-row style="color: #606266;">
|
||||
<el-col v-for="(formVal,key,index) of formItem['controls']" :span="formVal.span" v-if="!formVal.hidden" :class="formItem.config.colSpan" :style="formVal.style">
|
||||
<el-col v-for="(formVal,key,index) of formItem['controls']" :span="formVal.span" v-if="!formVal.hidden" :class="formItem.config.colSpan" :style="formVal.style" style="vertical-align: top;">
|
||||
<template v-if="formVal.type === 'button'">
|
||||
<el-button :type="formVal.btnType || 'primary'" size="mini" class="ml10" @click="(val) => handleChange(key,val,formVal)">{{formVal.label}}</el-button>
|
||||
</template>
|
||||
@@ -62,6 +62,32 @@
|
||||
</el-select>
|
||||
</template>
|
||||
|
||||
<template v-else-if="formVal.type === 'treeSelect'">
|
||||
<Treeselect
|
||||
v-model="ruleForm[key]"
|
||||
:multiple="formVal.multiple"
|
||||
:searchable="formVal.searchable"
|
||||
:options="formVal.options"
|
||||
:disabled="toBoolean(formVal.disabled || formItem.config.readonly)"
|
||||
:placeholder="toBoolean(formVal.disabled || formItem.config.readonly) ? null : formVal.placeholder || `请选择${formVal.label}`"
|
||||
:clearable="formVal.clearable !== false"
|
||||
@[formVal.eventName]="(val) => handleChange(key,val,formVal)">
|
||||
</Treeselect>
|
||||
</template>
|
||||
|
||||
<template v-else-if="formVal.type === 'cascader'">
|
||||
<el-cascader
|
||||
v-model="ruleForm[key]"
|
||||
class="w100"
|
||||
:ref="(el) => { if (el) this.cascaderRefs[key] = el; }"
|
||||
:props="{ multiple: true, checkStrictly: true }"
|
||||
:options="formVal.options"
|
||||
:disabled="toBoolean(formVal.disabled || formItem.config.readonly)"
|
||||
:placeholder="toBoolean(formVal.disabled || formItem.config.readonly) ? null : formVal.placeholder || `请选择${formVal.label}`"
|
||||
@[formVal.eventName]="(val) => handleChange(key,val,formVal)">
|
||||
</el-cascader>
|
||||
</template>
|
||||
|
||||
<template v-else-if="formVal.type === 'radio'">
|
||||
<template v-if="toBoolean(formVal.disabled || formItem.config.readonly)">
|
||||
<el-select
|
||||
@@ -108,7 +134,7 @@
|
||||
v-model="ruleForm[key]"
|
||||
:class="toBoolean(formVal.disabled || formItem.config.readonly) ? 'timeSty' : null"
|
||||
: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}`"
|
||||
@[formVal.eventName]="(val) => handleChange(key,val,formVal)"
|
||||
></el-time-picker>
|
||||
</template>
|
||||
@@ -119,8 +145,9 @@
|
||||
:class="toBoolean(formVal.disabled || formItem.config.readonly) ? 'timeSty' : null"
|
||||
type="date"
|
||||
: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}`"
|
||||
:format="formVal.format || 'yyyy-MM-dd'"
|
||||
:value-format="formVal.valueFormat || 'yyyy-MM-dd'"
|
||||
@[formVal.eventName]="(val) => handleChange(key,val,formVal)"
|
||||
></el-date-picker>
|
||||
</template>
|
||||
@@ -131,7 +158,7 @@
|
||||
:class="toBoolean(formVal.disabled || formItem.config.readonly) ? 'timeSty' : null"
|
||||
type="datetime"
|
||||
: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}`"
|
||||
:format="formVal.format || 'yyyy-MM-dd HH:mm:ss'"
|
||||
:value-format="formVal.valueFormat || 'yyyy-MM-dd HH:mm:ss'"
|
||||
@[formVal.eventName]="(val) => handleChange(key,val,formVal)"
|
||||
@@ -144,6 +171,7 @@
|
||||
:class="toBoolean(formVal.disabled || formItem.config.readonly) ? 'timeSty' : null"
|
||||
type="month"
|
||||
:disabled="toBoolean(formVal.disabled || formItem.config.readonly)"
|
||||
:placeholder="toBoolean(formVal.disabled || formItem.config.readonly) ? null : formVal.placeholder || `请选择${formVal.label}`"
|
||||
:format="formVal.format || 'yyyy-MM'"
|
||||
:value-format="formVal.valueFormat || 'yyyy-MM'"
|
||||
@[formVal.eventName]="(val) => handleChange(key,val,formVal)"
|
||||
@@ -180,6 +208,21 @@
|
||||
></el-date-picker>
|
||||
</template>
|
||||
|
||||
<template v-else-if="formVal.type === 'datetimerange'">
|
||||
<el-date-picker
|
||||
v-model="ruleForm[key]"
|
||||
:class="toBoolean(formVal.disabled || formItem.config.readonly) ? 'timeSty' : null"
|
||||
type="datetimerange"
|
||||
:disabled="toBoolean(formVal.disabled || formItem.config.readonly)"
|
||||
:format="formVal.format || 'yyyy-MM-dd HH:mm:ss'"
|
||||
:value-format="formVal.valueFormat || 'yyyy-MM-dd HH:mm:ss'"
|
||||
:range-separator="formVal.separator || '至'"
|
||||
:start-placeholder="formVal.start || '开始日期时间'"
|
||||
:end-placeholder="formVal.end || '结束日期时间'"
|
||||
@[formVal.eventName]="(val) => handleChange(key,val,formVal)"
|
||||
></el-date-picker>
|
||||
</template>
|
||||
|
||||
<template v-else-if="formVal.type === 'transfer'">
|
||||
<el-transfer
|
||||
v-model="ruleForm[key]"
|
||||
@@ -217,8 +260,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Treeselect from "@riophae/vue-treeselect"
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css"
|
||||
export default {
|
||||
name: 'Form',
|
||||
components: {Treeselect},
|
||||
props: {
|
||||
formList: {
|
||||
type: Array,
|
||||
@@ -236,7 +282,8 @@
|
||||
data() {
|
||||
return {
|
||||
rules: {},
|
||||
ruleForm: {}
|
||||
ruleForm: {},
|
||||
cascaderRefs: {},
|
||||
// formList: [
|
||||
// {porp: 'name', label: '姓名', span: 24, type: 'input',rules: {required: true, message: '请输入活动名称', trigger: 'blur'}},
|
||||
// {porp: 'age', label: '下拉', span: 24, type: 'select',options:[{value: '1', label: '10'},{value: '2', label: '20'}]},
|
||||
@@ -286,6 +333,25 @@
|
||||
if (valid) {
|
||||
this.formList.forEach(val => {
|
||||
Object.keys(val.controls).forEach(item => {
|
||||
// if (val.controls[item].type === 'cascader') {
|
||||
// // 获取当前 cascader 的实例
|
||||
// const cascaderInstance = this.cascaderRefs[item];
|
||||
// console.log('cascaderInstance===',cascaderInstance);
|
||||
// if (cascaderInstance) {
|
||||
// // 调用 getCheckedNodes,获取选中节点(支持多选,返回数组)
|
||||
// const checkedNodes = cascaderInstance.getCheckedNodes();
|
||||
// console.log('checkedNodes===',checkedNodes);
|
||||
// // // 处理节点信息:例如提取 age、label、value 等(根据你的需求)
|
||||
// // const cascaderData = checkedNodes.map(node => ({
|
||||
// // value: node.value,
|
||||
// // label: node.label,
|
||||
// // age: node.age, // 你的自定义属性(如之前提到的 age)
|
||||
// // path: node.path // 节点完整路径
|
||||
// // }));
|
||||
// // // 将处理后的节点信息存入提交数据 forList(键可自定义,如 `${key}Detail`)
|
||||
// // forList[`${key}Detail`] = cascaderData;
|
||||
// }
|
||||
// }
|
||||
if (item !== 'id' && val.controls[item] && val.controls[item]['hidden']) {
|
||||
forList[item] = null;
|
||||
} else {
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
<template #tempMonth="{ valueKey, row, column }">
|
||||
<span v-if="row && row[valueKey]">{{row[valueKey]}}/{{row.createTime.slice(0, 7)}}</span>
|
||||
</template>
|
||||
<template #tempStatus="{ row, column }">
|
||||
<dict-tag :options="dict.type.task_status" :value="row.taskStatus"/>
|
||||
</template>
|
||||
</TableList>
|
||||
</div>
|
||||
</template>
|
||||
@@ -34,10 +37,10 @@
|
||||
<script>
|
||||
import EchartsBar from "@/components/echartsList/bar.vue";
|
||||
import TableList from "@/components/table/index.vue";
|
||||
import {listBandWidth, avgDetailMsg, recalBandWidth} from "@/api/disRevenue/earnManage"
|
||||
import {listTaskStatic, taskRecaculate} from "@/api/disRevenue/earnManage"
|
||||
export default {
|
||||
name: 'busValueCount',
|
||||
dicts: ['eps_bandwidth_type'],
|
||||
dicts: ['eps_bandwidth_type', 'task_status'],
|
||||
components: {TableList, EchartsBar},
|
||||
props: {
|
||||
activeName: {
|
||||
@@ -64,16 +67,16 @@
|
||||
id: {label: `ID`},
|
||||
taskName: {label: `任务名称`, minWidth: '250', visible: true},
|
||||
businessName: {label: `业务名称`, minWidth: '150', visible: true},
|
||||
resourceGroupNameType: { label: `包含资源类型`, minWidth: '200'},
|
||||
resourceGroupName: { label: `包含资源`, minWidth: '200'},
|
||||
businessId: {label: `计算类型`, minWidth: '150'},
|
||||
bandwidth95Daily: {label: `95值(Mbit)`, minWidth: '200',visible: true},
|
||||
avgMonthlyBandwidth95: {label: `月均日95值(Mbit)`, minWidth: '200',visible: true},
|
||||
js: {label: `外部数据记录95值(Mbit)`, minWidth: '200',visible: true},
|
||||
timelist: {label: `时间段`, minWidth: '200',visible: true},
|
||||
machineCode: {label: `任务状态`, minWidth: '150',visible: true},
|
||||
updatatime: {label: `修改时间`, minWidth: '150'},
|
||||
createDatetime: {label: `创建时间`, minWidth: '150'},
|
||||
resourceType: { label: `包含资源类型`, minWidth: '200'},
|
||||
includedResources: { label: `包含资源`, minWidth: '200'},
|
||||
calculationType: {label: `计算类型`, minWidth: '150'},
|
||||
percentile95: {label: `95值(Mbit)`, minWidth: '200',visible: true},
|
||||
monthlyAvgPercentile95: {label: `月均日95值(Mbit)`, minWidth: '200',visible: true},
|
||||
js: {label: `外部数据记录95值(Mbit)`, minWidth: '200'},
|
||||
timeRange: {label: `时间段`, minWidth: '200',visible: true},
|
||||
taskStatus: {label: `任务状态`, minWidth: '150', slotName: 'tempStatus', visible: true},
|
||||
updateTime: {label: `修改时间`, minWidth: '150'},
|
||||
createTime: {label: `创建时间`, minWidth: '150'},
|
||||
},
|
||||
config: {
|
||||
tableButton: {
|
||||
@@ -85,7 +88,7 @@
|
||||
{content: '相关数据', fnCode: 'edit', type: 'text', icon: 'el-icon-tickets', hasPermi: 'earnManage:server:relevantData'},
|
||||
{content: '重新计算', fnCode: 'calculate', type: 'text', icon: 'el-icon-brush', hasPermi: 'earnManage:server:calculate'},
|
||||
{content: '图形查看', fnCode: 'echartView', type: 'text', icon: 'el-icon-data-analysis', hasPermi: 'earnManage:server:graphicAnalysis'},
|
||||
{}
|
||||
{},{}
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -93,15 +96,6 @@
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
bandwidthType: undefined,
|
||||
hardwareSn: undefined,
|
||||
bandwidth95Daily: undefined,
|
||||
bandwidth95Monthly: undefined,
|
||||
packageBandwidthDaily: undefined,
|
||||
avgMonthlyBandwidth95: undefined,
|
||||
effectiveBandwidth95Daily: undefined,
|
||||
effectiveBandwidth95Monthly: undefined,
|
||||
effectiveAvgMonthlyBandwidth95: undefined,
|
||||
},
|
||||
}
|
||||
},
|
||||
@@ -122,15 +116,7 @@
|
||||
let newParams = {...this.queryParams};
|
||||
delete newParams['total'];
|
||||
newParams['calculationMode'] = this.activeName;
|
||||
if (newParams && newParams.bandwidthType && !newParams['startTime']) {
|
||||
this.$refs['queryRef'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
listBandWidth(newParams).then(response => {
|
||||
listTaskStatic(newParams).then(response => {
|
||||
this.tableList = response.rows;
|
||||
this.queryParams.total = response.total;
|
||||
this.loading = false;
|
||||
@@ -188,6 +174,9 @@
|
||||
case 'add':
|
||||
this.$router.push({
|
||||
path:'/earnManage/busValueCount/edit/index',
|
||||
query: {
|
||||
calculationMode: this.activeName
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 'edit':
|
||||
@@ -195,8 +184,9 @@
|
||||
path:'/earnManage/busValueCount/list/index',
|
||||
query:{
|
||||
id: rowData.id,
|
||||
bandwidthType: rowData && rowData.bandwidthType,
|
||||
resourceType: rowData && rowData.resourceType
|
||||
resourceType: rowData && rowData.resourceType,
|
||||
calculationType: rowData && rowData.calculationType,
|
||||
calculationMode: this.activeName
|
||||
}
|
||||
});
|
||||
break;
|
||||
@@ -205,33 +195,23 @@
|
||||
path:'/earnManage/busValueCount/chart/index',
|
||||
query:{
|
||||
id: rowData.id,
|
||||
bandwidthType: rowData && rowData.bandwidthType,
|
||||
taskName: rowData && rowData.taskName,
|
||||
calculationType: rowData && rowData.calculationType,
|
||||
resourceType: rowData && rowData.resourceType
|
||||
}
|
||||
});
|
||||
// this.graphicAnalysis(selectList);
|
||||
break;
|
||||
case 'createData':
|
||||
this.$router.push({
|
||||
path:'/earnManage/server/edit/index',
|
||||
query:{
|
||||
resourceType: 1
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 'calculate':
|
||||
let fnType = recalBandWidth;
|
||||
if (rowData && rowData.bandwidthType === '4') {
|
||||
fnType = avgDetailMsg;
|
||||
}
|
||||
fnType(rowData.id).then(res => {
|
||||
// let fnType = taskRecaculate;
|
||||
taskRecaculate({id: rowData.id}).then(res => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("操作成功!");
|
||||
}).catch(() => {});
|
||||
break;
|
||||
case 'export':
|
||||
let paramsList = Object.assign(this.queryParams,rowData, {resourceType: 1,calculationMode: this.activeName});
|
||||
this.download("system/bandwidth/export", paramsList, `服务器带宽收益_${new Date().getTime()}.xlsx`, null, 'json');
|
||||
let paramsList = Object.assign(this.queryParams,rowData, {calculationMode: this.activeName});
|
||||
this.download("system/taskStatistics/export", paramsList, `业务95值计算_${new Date().getTime()}.xlsx`, null, 'json');
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
@@ -6,18 +6,19 @@
|
||||
|
||||
<script setup>
|
||||
import Form from '@/components/form/index.vue';
|
||||
import {listAllBusinessList, calculateAvg, getBandWidth, updateBandWidth} from "@/api/disRevenue/earnManage"
|
||||
import {listAllResourList} from "@/api/disRevenue/resource"
|
||||
import {listAllBusinessList, addTaskStatic, switchNameTree} from "@/api/disRevenue/earnManage"
|
||||
import {listAllSwitchName, getRegistList} from "@/api/disRevenue/resource"
|
||||
export default {
|
||||
name: 'busValueCount_Details',
|
||||
components: {Form},
|
||||
dicts: ['rm_topology_type'],
|
||||
dicts: ['resource_type', 'caculate_type'],
|
||||
data() {
|
||||
return {
|
||||
ruleForm: {},
|
||||
formList: [],
|
||||
switchNameList: [],
|
||||
paramsData: {}
|
||||
paramsData: {},
|
||||
busNameList: {},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -32,34 +33,90 @@
|
||||
config: {title: '基本信息', colSpan: 'disBlock'},
|
||||
controls: {
|
||||
id: {label: 'ID',hidden: true},
|
||||
clientId: {label: '任务名称', span: 12, type: 'input',required: true},
|
||||
taskName: {label: '任务名称', span: 12, type: 'input',required: true},
|
||||
businessName: {label: '业务名称', span: 12, type: 'select', options:[]},
|
||||
businessId: {label: '包含资源类型', span: 12, type: 'select', options: [],required: true},
|
||||
monthTime: {label: '包含资源', span: 12, type: 'select', options: [],required: true},
|
||||
js: {label: '计算类型', span: 12, type: 'select', options: [],required: true},
|
||||
resourceType: {label: '包含资源类型', span: 12, type: 'select', eventName: 'change', options: this.dict.type.resource_type, required: true},
|
||||
includedResourcesTree: {label: '包含资源', span: 12, type: 'treeSelect', options: [], searchable: true, multiple: true, required: true, hidden: this.ruleForm.resourceType && this.ruleForm.resourceType === '1' ? false : true},
|
||||
includedResources: {label: '包含资源', span: 12, type: 'cascader', options: [], required: true, hidden: this.ruleForm.resourceType && this.ruleForm.resourceType === '2' ? false : true},
|
||||
calculationType: {label: '计算类型', span: 12, type: 'select', options: this.dict.type.caculate_type, eventName: 'change', required: true},
|
||||
startTime: {label: '时间段', span: 12, type: 'month', hidden: this.ruleForm.calculationType && this.ruleForm.calculationType === '2' ? false : true},
|
||||
endTime: {label: '时间段', span: 12, type: 'datetimerange', hidden: this.ruleForm.calculationType && this.ruleForm.calculationType === '1' ? false : true},
|
||||
}
|
||||
}];
|
||||
},
|
||||
// 获取交换机下拉
|
||||
switchList() {
|
||||
listAllBusinessList().then(val => {
|
||||
this.formList[0].controls.businessName['options'] = val && val.data.map(item => {
|
||||
return Object.assign({label: item.businessName, value: item.id});
|
||||
this.busNameList[item.businessName] = item;
|
||||
return Object.assign({label: item.businessName, value: item.businessName});
|
||||
});
|
||||
});
|
||||
},
|
||||
// 包含资源
|
||||
includeDataList(num) {
|
||||
if (num === '1') {
|
||||
getRegistList({resourceType: 1}).then(val => {
|
||||
this.formList[0].controls.includedResourcesTree['options'] = val && val.data.map(item => {
|
||||
return Object.assign({label: item.clientId, id: item.clientId});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
switchNameTree().then(val => {
|
||||
this.switchNameList = val && val;
|
||||
this.formList[0].controls.includedResources['options'] = val && val.data;
|
||||
});
|
||||
}
|
||||
},
|
||||
// 监听事件
|
||||
callback(result, dataVal, formVal) {
|
||||
if (result && result.fnCode) {
|
||||
switch (result.fnCode) {
|
||||
case 'submit':
|
||||
this.switchNameList.find(item => {
|
||||
if (item.resourceName === dataVal['nodeName']) {
|
||||
dataVal['hardwareSn'] = item.hardwareSn;
|
||||
case 'resourceType':
|
||||
if (dataVal) {
|
||||
if (dataVal === '1') {
|
||||
this.formList[0].controls.includedResourcesTree['hidden'] = false;
|
||||
this.formList[0].controls.includedResources['hidden'] = true;
|
||||
} else if (dataVal === '2') {
|
||||
this.formList[0].controls.includedResources['hidden'] = false;
|
||||
this.formList[0].controls.includedResourcesTree['hidden'] = true;
|
||||
}
|
||||
});
|
||||
dataVal['resourceType'] = this.paramsData.resourceType;
|
||||
calculateAvg(dataVal).then(response => {
|
||||
this.includeDataList(dataVal);
|
||||
} else {
|
||||
this.formList[0].controls.includedResourcesTree['hidden'] = true;
|
||||
this.formList[0].controls.includedResources['hidden'] = true;
|
||||
}
|
||||
// if (dataVal) {}
|
||||
// this.includeDataList(dataVal);
|
||||
break;
|
||||
case 'calculationType':
|
||||
if (dataVal) {
|
||||
if (dataVal === '1') {
|
||||
this.formList[0].controls.startTime['hidden'] = true;
|
||||
this.formList[0].controls.endTime['hidden'] = false;
|
||||
} else if (dataVal === '2') {
|
||||
this.formList[0].controls.startTime['hidden'] = false;
|
||||
this.formList[0].controls.endTime['hidden'] = true;
|
||||
}
|
||||
} else {
|
||||
this.formList[0].controls.startTime['hidden'] = true;
|
||||
this.formList[0].controls.endTime['hidden'] = true;
|
||||
}
|
||||
break;
|
||||
case 'submit':
|
||||
dataVal['calculationMode'] = this.paramsData.calculationMode;
|
||||
if (dataVal.includedResourcesTree) {
|
||||
dataVal.includedResources = dataVal.includedResources.toString();
|
||||
delete dataVal.includedResourcesTree;
|
||||
}
|
||||
if (dataVal && dataVal.businessName) {
|
||||
dataVal['businessCode'] = this.busNameList[dataVal.businessName].id;
|
||||
}
|
||||
if (dataVal && dataVal.endTime) {
|
||||
dataVal.startTime = dataVal.endTime[0];
|
||||
dataVal.endTime = dataVal.endTime[1];
|
||||
}
|
||||
console.log('dataVal===',dataVal);
|
||||
addTaskStatic(dataVal).then(response => {
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
this.$router.push("/earnManage/busValueCount");
|
||||
}).catch(() => {
|
||||
|
||||
@@ -3,19 +3,43 @@
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane v-for="item of timeList" label="item" name="item"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<TableList :columns="columns" :config="{colTopHiddenIcon: true}" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
|
||||
<TableList :columns="columns" :config="{colTopHiddenIcon: true}" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList">
|
||||
<template #tempBusinessName="{ row, column }">
|
||||
<div>
|
||||
<div :style="{background: row && row['flag95'] ? '#fffe01' : 'none'}">
|
||||
<!-- 非编辑状态:显示文本 -->
|
||||
<template v-if="!row.editStatus">
|
||||
<span>{{ row.businessName }}</span>
|
||||
<span>{{ row.outSpeed }}</span>
|
||||
<el-button icon="el-icon-edit" type="text" @click="rowDataChange(row)"></el-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<!-- 编辑状态:显示输入框 -->
|
||||
<el-col :span="16">
|
||||
<el-input
|
||||
v-model="row.businessName"
|
||||
v-model="row.outSpeed"
|
||||
size="mini"
|
||||
@keyup.enter="callback({fnCode: 'edit'}, row)"
|
||||
@blur="callback({fnCode: 'edit'}, row)"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-button size="mini" type="primary" @click="callback({fnCode: 'submit'}, row)">确定</el-button>
|
||||
<el-button size="mini" @click="callback({fnCode: 'cancel'}, row)">取消</el-button>
|
||||
</el-col>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<template #tempTotalSpeed="{ row, column }">
|
||||
<div :style="{background: row && row['flag95'] ? '#fffe01' : 'none'}">
|
||||
<!-- 非编辑状态:显示文本 -->
|
||||
<template v-if="!row.editStatus">
|
||||
<span>{{ row.outSpeed }}</span>
|
||||
<el-button icon="el-icon-edit" type="text" @click="rowDataChange(row)"></el-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<!-- 编辑状态:显示输入框 -->
|
||||
<el-col :span="16">
|
||||
<el-input
|
||||
v-model="row.outSpeed"
|
||||
size="mini"
|
||||
@keyup.enter="callback({fnCode: 'edit'}, row)"
|
||||
@blur="callback({fnCode: 'edit'}, row)"
|
||||
@@ -37,7 +61,7 @@
|
||||
|
||||
<script setup name="ServerEdit">
|
||||
import TableList from "@/components/table/index.vue"
|
||||
import {relatedBandWidth} from "@/api/disRevenue/earnManage";
|
||||
import {updateRelate, taskRelate} from "@/api/disRevenue/earnManage";
|
||||
export default {
|
||||
name: 'busValCount_relevantData',
|
||||
components: {TableList},
|
||||
@@ -45,19 +69,21 @@
|
||||
return {
|
||||
roleList: [],
|
||||
loading: true,
|
||||
total: 0,
|
||||
serverId: '',
|
||||
// 列显隐信息
|
||||
columns: [],
|
||||
paramsData: {},
|
||||
timeList: [],
|
||||
activeName: '',
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.paramsData = this.$route.query && this.$route.query;
|
||||
this.serverId = this.$route.query && this.$route.query.id;
|
||||
this.columsList(this.$route.query && this.$route.query.bandwidthType);
|
||||
this.columsList();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
@@ -75,32 +101,28 @@
|
||||
// 服务器
|
||||
if (this.paramsData && this.paramsData.resourceType === '1') {
|
||||
this. columns = {
|
||||
businessCode: {label: `业务代码`, minWidth: '120',visible: true},
|
||||
businessId: {label: `业务代码`, minWidth: '120',visible: true},
|
||||
clientId: {label: `ClientID`,minWidth: '160',visible: true},
|
||||
time: {label: `时间`,minWidth: '160',visible: true},
|
||||
createTime: {label: `时间`,minWidth: '160',visible: true},
|
||||
outSpeed: {label: `总发送流量值(bit/s)`, minWidth: '150', slotName: 'tempBusinessName',visible: true},
|
||||
};
|
||||
} else {
|
||||
this. columns = {
|
||||
businessCode: {label: `交换机接口`, minWidth: '220',visible: true},
|
||||
time: {label: `时间`,minWidth: '160',visible: true},
|
||||
createTime: {label: `时间`,minWidth: '160',visible: true},
|
||||
putSpeed: {label: `总接收流量值(bit/s)`, minWidth: '150', visible: true},
|
||||
outSpeed: {label: `总发送流量值(bit/s)`, minWidth: '150', visible: true},
|
||||
totalSpeed: {label: `流量值最大值(bit/s)`, minWidth: '150', slotName: 'tempBusinessName',visible: true},
|
||||
totalSpeed: {label: `流量值最大值(bit/s)`, minWidth: '150', slotName: 'tempTotalSpeed',visible: true},
|
||||
};
|
||||
}
|
||||
},
|
||||
/** 查询角色列表 */
|
||||
getList() {
|
||||
let params = {};
|
||||
if (this.activeName) {
|
||||
params['time'] = this.activeName;
|
||||
}
|
||||
this.loading = true;
|
||||
relatedBandWidth(Object.assign( this.queryParams, {id: this.serverId}, params)).then(response => {
|
||||
taskRelate(Object.assign( this.queryParams, {id: this.paramsData && this.paramsData.id}, {calculationMode: this.paramsData.calculationMode})).then(response => {
|
||||
this.loading = false;
|
||||
this.roleList = response && response.rows;
|
||||
this.total = response && response.total || response && response.data.length;
|
||||
this.queryParams.total = response.total;
|
||||
})
|
||||
},
|
||||
goBack() {
|
||||
@@ -112,8 +134,15 @@
|
||||
case 'submit':
|
||||
if (this.loading) return;
|
||||
this.loading = true;
|
||||
this.$set(rowData, 'editStatus', false);
|
||||
this.getList();
|
||||
let params = {
|
||||
id: this.paramsData.id,
|
||||
needSpeed: rowData.outSpeed,
|
||||
needTime: rowData.createTime
|
||||
};
|
||||
updateRelate(params).then(res => {
|
||||
this.$set(rowData, 'editStatus', false);
|
||||
this.getList();
|
||||
});
|
||||
break;
|
||||
case 'cancel':
|
||||
this.$set(rowData, 'editStatus', false);
|
||||
|
||||
@@ -1,26 +1,51 @@
|
||||
<template>
|
||||
<div style="height: calc(100vh)!important">
|
||||
<EchartsLine :lineData="lineDataParams" :title="lineDataParams.title" class="w100 h40 mt20 mb20"></EchartsLine>
|
||||
<EchartsLine :lineData="lineDataParams" :title="lineDataParams.title" style="height: 400px;" class="w100 mt20 mb20"></EchartsLine>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import EchartsLine from "@/components/echartsList/line.vue";
|
||||
import {taskRraphical} from "@/api/disRevenue/earnManage";
|
||||
export default {
|
||||
name: "busValCount_viewChart",
|
||||
components: {EchartsLine},
|
||||
data() {
|
||||
return {
|
||||
lineDataParams: {
|
||||
paramsData: {},
|
||||
echartData: {
|
||||
title: 'tux',
|
||||
yAxisName: '',
|
||||
legend: {orient: 'vertical',bottom: '1%', formatter: true},
|
||||
gridBotm: '10%',
|
||||
hiddenTime: true,
|
||||
lineXData: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sa', 'Sun'],
|
||||
data: [120, 132, 101, 134, 90, 230, 210]
|
||||
dataList: [
|
||||
{name: '总发送流量值', data: []},
|
||||
]
|
||||
},
|
||||
lineDataParams: {},
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
methods: {}
|
||||
created() {
|
||||
this.paramsData = this.$route && this.$route.query;
|
||||
this.chartList();
|
||||
},
|
||||
methods: {
|
||||
chartList() {
|
||||
taskRraphical({id: this.paramsData.id}).then(res => {
|
||||
console.log('res====',res);
|
||||
if(res && res.data) {
|
||||
let content = '最后一个值:' + res.data.other.lastInSpeedGb;
|
||||
this.echartData.title = '【' + this.paramsData.taskName + '】';
|
||||
this.echartData.yAxisName = '单位' + res.data.other.recommendedUnit || '';
|
||||
this.echartData.lineXData = res.data.xData || [];
|
||||
this.echartData.dataList[0].data = res.data.yData['netOutSpeedData'] || [];
|
||||
}
|
||||
this.lineDataParams = this.echartData;
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -40,7 +40,8 @@
|
||||
formList: [],
|
||||
scriptList: {},
|
||||
paramsData: {},
|
||||
config: {}
|
||||
config: {},
|
||||
busNameList: {},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -133,7 +134,8 @@
|
||||
getBusinessNames() {
|
||||
listAllBusinessList().then(val => {
|
||||
this.formList[0].controls.businessName['options'] = val && val.data.map(item => {
|
||||
return Object.assign({label: item.businessName, value: item.id});
|
||||
this.busNameList[item.businessName] = item;
|
||||
return Object.assign({label: item.businessName, value: item.businessName});
|
||||
});
|
||||
});
|
||||
},
|
||||
@@ -141,14 +143,13 @@
|
||||
getBusScriptNames() {
|
||||
getAllBusScriptName().then(val => {
|
||||
this.formList[0].controls.scriptName['options'] = val && val.data.map(item => {
|
||||
this.scriptList[item.id] = item;
|
||||
return Object.assign({label: item.scriptName, value: item.id});
|
||||
this.scriptList[item.scriptName] = item;
|
||||
return Object.assign({label: item.scriptName, value: item.scriptName});
|
||||
});
|
||||
});
|
||||
},
|
||||
// 监听事件
|
||||
callback(result, dataVal, formVal) {
|
||||
console.log('result===',result);
|
||||
if (result && result.fnCode) {
|
||||
switch (result.fnCode) {
|
||||
case 'scriptName':
|
||||
@@ -160,6 +161,7 @@
|
||||
break;
|
||||
case 'submit':
|
||||
this.loading = true;
|
||||
dataVal['businessCode'] = this.busNameList[dataVal.businessName].id;
|
||||
let fnType = addBusDeploy;
|
||||
if (dataVal && dataVal.id) {
|
||||
fnType = updateBusDeploy;
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
<div class="app-container pageTopForm">
|
||||
<el-form :model="queryParams" ref="queryRef" v-show="showSearch" size="small" label-width="130px">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="ClientID" prop="nodeName">
|
||||
<el-form-item label="ClientID" prop="clientId">
|
||||
<el-select
|
||||
v-model="queryParams.nodeName"
|
||||
v-model="queryParams.clientId"
|
||||
placeholder="请选择ClientID"
|
||||
clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
v-for="dict in clientList"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"/>
|
||||
@@ -39,6 +39,7 @@
|
||||
<script setup name="RevenueMethod">
|
||||
import TableList from "@/components/table/index.vue"
|
||||
import {listRecord} from "@/api/disRevenue/earnManage"
|
||||
import {getRegistList} from "@/api/disRevenue/resource"
|
||||
export default {
|
||||
name: 'revenueMethod',
|
||||
dicts: ['sys_normal_disable'],
|
||||
@@ -56,7 +57,7 @@
|
||||
columns: {
|
||||
id: {label: `ID`, visible: false},
|
||||
createTime: {label: `修改时间`, visible: true},
|
||||
nodeName: {label: `ClientID`, minWidth: '130', visible: true},
|
||||
clientId: {label: `ClientID`, minWidth: '130', visible: true},
|
||||
hardwareSn: {label: `硬件SN`},
|
||||
changeContent: {label: `修改内容`, minWidth: '350', visible: true},
|
||||
creatBy: {label: `修改人`, width: '80', visible: true},
|
||||
@@ -73,11 +74,13 @@
|
||||
{content: '导出', fnCode: 'export', type: 'warning', icon: 'el-icon-download', hasPermi: 'earnManage:revenueMethod:export'},
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
clientList: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.fnClientList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询角色列表 */
|
||||
@@ -89,7 +92,13 @@
|
||||
this.loading = false;
|
||||
})
|
||||
},
|
||||
|
||||
fnClientList() {
|
||||
getRegistList({}).then(val => {
|
||||
this.clientList = val && val.data.map(item => {
|
||||
return Object.assign({label: item.clientId, value: item.clientId});
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
placeholder="请选择业务名称"
|
||||
clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.eps_bandwidth_type"
|
||||
v-for="dict in busNameList"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"/>
|
||||
@@ -146,7 +146,7 @@
|
||||
<script>
|
||||
import EchartsBar from "@/components/echartsList/bar.vue";
|
||||
import TableList from "@/components/table/index.vue";
|
||||
import {listBandWidth, avgDetailMsg, recalBandWidth} from "@/api/disRevenue/earnManage"
|
||||
import {listBandWidth, avgDetailMsg, recalBandWidth, listAllBusinessList} from "@/api/disRevenue/earnManage"
|
||||
export default {
|
||||
name: 'ServerTabs',
|
||||
dicts: ['eps_bandwidth_type'],
|
||||
@@ -161,6 +161,7 @@
|
||||
activeName: {
|
||||
handler(val) {
|
||||
this.getList();
|
||||
this.busList();
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
@@ -221,6 +222,7 @@
|
||||
effectiveBandwidth95Monthly: undefined,
|
||||
effectiveAvgMonthlyBandwidth95: undefined,
|
||||
},
|
||||
busNameList: []
|
||||
}
|
||||
},
|
||||
// created() {
|
||||
@@ -234,6 +236,13 @@
|
||||
// });
|
||||
// },
|
||||
methods: {
|
||||
busList() {
|
||||
listAllBusinessList().then(val => {
|
||||
this.busNameList = val && val.data.map(item => {
|
||||
return Object.assign({label: item.businessName, value: item.businessName});
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 查询角色列表 */
|
||||
getList(num) {
|
||||
this.loading = true;
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
|
||||
<script setup>
|
||||
import Form from '@/components/form/index.vue';
|
||||
import {addMachine, getHandle, updateTopology, getRegistList} from "@/api/disRevenue/resource"
|
||||
import {addMachine, getHandle, updateTopology, getRegistList, bindBusByClient} from "@/api/disRevenue/resource";
|
||||
import {listAllBusinessList} from "@/api/disRevenue/earnManage";
|
||||
export default {
|
||||
name: 'serverRegister_Edit',
|
||||
components: {Form},
|
||||
@@ -22,6 +23,7 @@
|
||||
serverNameList: [],
|
||||
serverPortList: [],
|
||||
interfaceNameList: [],
|
||||
busNameList: {},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -29,13 +31,26 @@
|
||||
if (this.paramsData && this.paramsData.id) {
|
||||
this.getFormDataList(this.paramsData.id);
|
||||
}
|
||||
this.registList();
|
||||
if (this.paramsData && this.paramsData.type && this.paramsData.type === 'edit') {
|
||||
this.fnBusNameList();
|
||||
} else {
|
||||
this.registList();
|
||||
}
|
||||
this.fnFormList();
|
||||
},
|
||||
methods: {
|
||||
// formList集合
|
||||
fnFormList(objVal) {
|
||||
if (this.paramsData && this.paramsData.readonly) {
|
||||
if (this.paramsData && this.paramsData.type && this.paramsData.type === 'edit') {
|
||||
this.formList = [{
|
||||
config: {title: '基本信息',labelWidth: '140px', colSpan: 'disBlock'},
|
||||
controls: {
|
||||
id: {label: 'ID',hidden: true},
|
||||
businessName: {label: '业务名称', span: 12, type: 'select', options:[], required: true},
|
||||
deployDevice: {label: '服务器列表', span: 12, type: 'textarea', rows: 15, required: true},
|
||||
}
|
||||
}];
|
||||
} else if (this.paramsData && this.paramsData.readonly) {
|
||||
this.formList = [{
|
||||
config: {title: '基本信息',labelWidth: '140px', readonly: true},
|
||||
controls: {
|
||||
@@ -81,11 +96,11 @@
|
||||
heartbeatInterval: {label: '心跳时间间隔', span: 12, type: 'input'},
|
||||
heartbeatCount: {label: '心跳次数', span: 12, type: 'input'},
|
||||
businessName: {label: '业务名称', span: 12, type: 'input'},
|
||||
onlogicalNodeIde20: {label: '逻辑节点标识', span: 12, type: 'input'},
|
||||
logicalNodeId: {label: '逻辑节点标识', span: 12, type: 'input'},
|
||||
onlineStatus: {label: '在线状态', span: 12, type: 'select', options: this.dict.type.rm_register_online_state},
|
||||
registrationStatus: {label: '注册状态', span: 12, type: 'select', options: this.dict.type.rm_register_status},
|
||||
createTime: {label: '注册时间', span: 12, type: 'input'},
|
||||
upTime: {label: '上机时间', span: 12, type: 'input'},
|
||||
onboardTime: {label: '上机时间', span: 12, type: 'input'},
|
||||
agentVersion: {label: 'agent版本', span: 12, type: 'input'},
|
||||
machineCode: {label: '金山machineCode', span: 12, type: 'input'},
|
||||
}
|
||||
@@ -101,10 +116,20 @@
|
||||
}];
|
||||
}
|
||||
},
|
||||
// clientId
|
||||
registList() {
|
||||
getRegistList({resourceType: 1}).then(res => {
|
||||
this.formList[0].controls.clientId['options'] = res && res.data.map(item => {
|
||||
return Object.assign({label: item.clientId, value: item.id});
|
||||
return Object.assign({label: item.clientId, value: item.clientId});
|
||||
});
|
||||
});
|
||||
},
|
||||
// 业务名称
|
||||
fnBusNameList() {
|
||||
listAllBusinessList().then(res => {
|
||||
this.formList[0].controls.businessName['options'] = res && res.data.map(item => {
|
||||
this.busNameList[item.businessName] = item;
|
||||
return Object.assign({label: item.businessName, value: item.businessName});
|
||||
});
|
||||
});
|
||||
},
|
||||
@@ -121,23 +146,31 @@
|
||||
if (result && result.fnCode) {
|
||||
switch (result.fnCode) {
|
||||
case 'submit':
|
||||
let content = '<p style="font-size: 1rem;font-weight: 600;">确认添加machineCode</p>' +
|
||||
'<p style="height: 0px;margin-bottom: 50px;">一旦添加machineCode后,将不能修改</p>';
|
||||
this.$modal.confirm(content, {submitTitle: '确认添加'}).then(() => {
|
||||
let fnType = addMachine;
|
||||
if (dataVal && dataVal.id) {
|
||||
fnType = updateTopology;
|
||||
}
|
||||
if(this.loading) return;
|
||||
this.loading = true;
|
||||
fnType(dataVal).then(response => {
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
if (this.paramsData && this.paramsData.type && this.paramsData.type === 'edit') {
|
||||
dataVal['businessCode'] = this.busNameList[dataVal.businessName].id;
|
||||
bindBusByClient(dataVal).then(res => {
|
||||
this.$modal.msgSuccess(res.msg);
|
||||
this.$router.push("/resource/serverRegister");
|
||||
this.loading = false;
|
||||
}).catch(() => {
|
||||
this.$modal.msgError("操作失败")
|
||||
});
|
||||
}).catch(() => {});
|
||||
} else {
|
||||
let content = '<p style="font-size: 1rem;font-weight: 600;">确认添加machineCode</p>' +
|
||||
'<p style="height: 0px;margin-bottom: 50px;">一旦添加machineCode后,将不能修改</p>';
|
||||
this.$modal.confirm(content, {submitTitle: '确认添加'}).then(() => {
|
||||
let fnType = addMachine;
|
||||
if (dataVal && dataVal.id) {
|
||||
fnType = updateTopology;
|
||||
}
|
||||
if(this.loading) return;
|
||||
this.loading = true;
|
||||
fnType(dataVal).then(response => {
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
this.$router.push("/resource/serverRegister");
|
||||
this.loading = false;
|
||||
}).catch(() => {
|
||||
this.$modal.msgError("操作失败")
|
||||
});
|
||||
}).catch(() => {});
|
||||
}
|
||||
break;
|
||||
case 'cancel':
|
||||
this.$router.push("/resource/serverRegister");
|
||||
|
||||
@@ -104,8 +104,8 @@
|
||||
</template>
|
||||
</TableList>
|
||||
<!-- 查看执行结果弹窗 -->
|
||||
<el-dialog title="命令执行结果" :visible.sync="open" width="800px" append-to-body>
|
||||
<div class="block">
|
||||
<el-dialog title="命令执行结果" :visible.sync="open" width="800px" height="300px" append-to-body>
|
||||
<div class="block" style="max-height: calc(100vh - 125px);overflow: auto;">
|
||||
<template v-if="timelineList && timelineList.length > 0">
|
||||
<el-timeline :reverse="true">
|
||||
<el-timeline-item v-for="item of timelineList" :timestamp="item.createTime" placement="top">
|
||||
@@ -166,7 +166,6 @@
|
||||
columns: {
|
||||
id: { label: `ID`,width: '80'},
|
||||
clientId: { label: `clientID`, minWidth: '200'},
|
||||
switchName: { label: `clientID`, minWidth: '200'},
|
||||
hardwareSn: { label: `设备SN`,minWidth: '250'},
|
||||
ip1Isp: { label: `IP1-运营商`, visible: true, minWidth: '150'},
|
||||
ip1Province: { label: `IP1-省`, visible: true, minWidth: '150'},
|
||||
@@ -212,14 +211,15 @@
|
||||
onlineStatus: { label: `在线状态`, slotName: 'tempOnlineStatus', minWidth: '120', visible: true },
|
||||
multiPublicIpStatus: { label: `多公网IP状态`, slotName: 'tempMultipubStatus', minWidth: '120', visible: true },
|
||||
createTime:{ label: `注册时间`,minWidth: '160'},
|
||||
upTime:{ label: `上机时间`,minWidth: '160'},
|
||||
onboardTime:{ label: `上机时间`,minWidth: '160'},
|
||||
agentVersion:{ label: `agent版本`,minWidth: '160'},
|
||||
machineCode:{ label: `金山machineCode`,minWidth: '160'},
|
||||
},
|
||||
config: {
|
||||
tableButton: {
|
||||
top: [
|
||||
{content: '新增', fnCode: 'add', type: 'primary', icon: 'el-icon-plus', hasPermi: 'resource:serverRegister:add'},
|
||||
{content: '添加金山machineCode', fnCode: 'add', type: 'primary', icon: 'el-icon-plus', hasPermi: 'resource:serverRegister:add'},
|
||||
{content: '修改业务名称', fnCode: 'edit', type: 'success', icon: 'el-icon-edit', hasPermi: 'resource:serverRegister:edit'},
|
||||
{content: '导出', fnCode: 'export', type: 'warning', icon: 'el-icon-download', hasPermi: 'resource:serverRegister:export'},
|
||||
],
|
||||
line: [
|
||||
@@ -347,7 +347,7 @@
|
||||
case 'edit':
|
||||
this.$router.push({
|
||||
path:'/resource/serverRegister/edit',
|
||||
query: {id: rowData.id}
|
||||
query: {id: rowData.id, type: 'edit'}
|
||||
});
|
||||
break;
|
||||
case 'details':
|
||||
|
||||
@@ -33,13 +33,15 @@
|
||||
loading: false,
|
||||
currTimeList: {},
|
||||
defaultTimes: [],
|
||||
firstTabTime: {},
|
||||
firstTabTimeArr: [],
|
||||
activeName: 'first',
|
||||
paramsData: {},
|
||||
// 第一栏
|
||||
firstChartTrans: {},
|
||||
formFirst: {
|
||||
cpuNum: 'CPU数量', sysLocation: '操作系统', sysObjectID: '操作系统架构', hwStackSystemMac: '最大进程数', sysUpTime: '硬盘-总可用空间',
|
||||
entPhysicalName: '系统启动时间', sysContact: '系统描述', entPhysicalSoftwareRev: '系统正确运行时间', sysName: '系统本地时间', sysDescr: '总内存'
|
||||
memorySizeTotalCollect: '总内存', systemCpuNum: 'CPU数量', systemSwOsCollect: '操作系统', systemSwArchCollect: '操作系统架构', kernelMaxprocCollect: '最大进程数', systemDiskSizeTotalCollect: '硬盘-总可用空间',
|
||||
systemBoottimeCollect: '系统启动时间', systemUptimeCollect: '系统正确运行时间', systemLocaltimeCollect: '系统本地时间', systemUnameCollect: '系统描述'
|
||||
},
|
||||
formData: {},
|
||||
firstChartList: [],
|
||||
@@ -131,6 +133,7 @@
|
||||
titleVal: {textAlign: 'left', left: '1%'},
|
||||
yAxisName: ' ',
|
||||
gridTop: '35%',
|
||||
gridLeft: '-7%',
|
||||
legend: {top: '15%', left: '10%'},
|
||||
lineXData: [],
|
||||
dataList: [
|
||||
@@ -258,12 +261,16 @@
|
||||
created() {
|
||||
let startData = '';
|
||||
let endData = '';
|
||||
let todyTime = '';
|
||||
const year = new Date().getFullYear();
|
||||
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 prevDay = String(new Date().getDate() - 1).padStart(2, '0');
|
||||
startData = `${year}-${month}-${prevDay} 00:00:00`;
|
||||
endData = `${year}-${month}-${day} 00:00:00`;
|
||||
endData = `${year}-${month}-${day} 23:59:59`;
|
||||
todyTime = `${year}-${month}-${day}`;
|
||||
this.firstTabTime = {startTime: todyTime + ' 00:00:00', endTime: todyTime + ' 23:59:59'};
|
||||
this.firstTabTimeArr = [todyTime + ' 00:00:00', todyTime + ' 23:59:59'];
|
||||
this.currTimeList = {startTime: startData, endTime: endData};
|
||||
this.defaultTimes = [startData, endData];
|
||||
this.paramsData = this.$route && this.$route.query;
|
||||
@@ -274,16 +281,16 @@
|
||||
this.loading = false;
|
||||
if (this.activeName === 'first') {
|
||||
await Promise.all([
|
||||
this.getMonitorData(this.currTimeList),
|
||||
this.getCpuLoadData(this.currTimeList),
|
||||
this.getCpuTimeData(this.currTimeList),
|
||||
this.getProcNumData(this.currTimeList),
|
||||
this.getUserNumData(this.currTimeList),
|
||||
this.getSwapSizeFreeData(this.currTimeList),
|
||||
this.getMemoryUtilizationData(this.currTimeList),
|
||||
this.getSwapSizePercentData(this.currTimeList),
|
||||
this.getMemorySizeAvailableData(this.currTimeList),
|
||||
this.getMemorySizePercentData(this.currTimeList),
|
||||
this.getMonitorData(),
|
||||
this.getCpuLoadData(this.firstTabTime),
|
||||
this.getCpuTimeData(this.firstTabTime),
|
||||
this.getProcNumData(this.firstTabTime),
|
||||
this.getUserNumData(this.firstTabTime),
|
||||
this.getSwapSizeFreeData(this.firstTabTime),
|
||||
this.getMemoryUtilizationData(this.firstTabTime),
|
||||
this.getSwapSizePercentData(this.firstTabTime),
|
||||
this.getMemorySizeAvailableData(this.firstTabTime),
|
||||
this.getMemorySizePercentData(this.firstTabTime),
|
||||
]);
|
||||
this.loading = true;
|
||||
} else {
|
||||
@@ -303,7 +310,7 @@
|
||||
let cpuData = JSON.parse(JSON.stringify(this.resultData[0]));
|
||||
cpuLoadData(Object.assign({},{clientId: this.paramsData.clientId}, val)).then(res => {
|
||||
cpuData['fnEvent'] = 'getCpuLoadData';
|
||||
cpuData.dateDataTrans['dateRange'] = this.defaultTimes;
|
||||
cpuData.dateDataTrans['dateRange'] = this.firstTabTimeArr;
|
||||
if (res && res.data) {
|
||||
cpuData.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'] : [];
|
||||
@@ -322,7 +329,7 @@
|
||||
let memData = JSON.parse(JSON.stringify(this.resultData[1]));
|
||||
cpuTimeData(Object.assign({},{clientId: this.paramsData.clientId}, val)).then(res => {
|
||||
memData['fnEvent'] = 'getCpuTimeData';
|
||||
memData.dateDataTrans['dateRange'] = this.defaultTimes;
|
||||
memData.dateDataTrans['dateRange'] = this.firstTabTimeArr;
|
||||
if (res && res.data) {
|
||||
memData.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'] : [];
|
||||
@@ -343,7 +350,7 @@
|
||||
let procData = JSON.parse(JSON.stringify(this.resultData[2]));
|
||||
procNum(Object.assign({},{clientId: this.paramsData.clientId}, val)).then(res => {
|
||||
procData['fnEvent'] = 'getProcNumData';
|
||||
procData.dateDataTrans['dateRange'] = this.defaultTimes;
|
||||
procData.dateDataTrans['dateRange'] = this.firstTabTimeArr;
|
||||
if (res && res.data) {
|
||||
procData.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'] : [];
|
||||
@@ -360,7 +367,7 @@
|
||||
let userNumData = JSON.parse(JSON.stringify(this.resultData[3]));
|
||||
serverUserNum(Object.assign({},{clientId: this.paramsData.clientId}, val)).then(res => {
|
||||
userNumData['fnEvent'] = 'getUserNumData';
|
||||
userNumData.dateDataTrans['dateRange'] = this.defaultTimes;
|
||||
userNumData.dateDataTrans['dateRange'] = this.firstTabTimeArr;
|
||||
if (res && res.data) {
|
||||
userNumData.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'] : [];
|
||||
@@ -376,7 +383,7 @@
|
||||
let swapSizeFreeData = JSON.parse(JSON.stringify(this.resultData[4]));
|
||||
swapSizeFree(Object.assign({},{clientId: this.paramsData.clientId}, val)).then(res => {
|
||||
swapSizeFreeData['fnEvent'] = 'getSwapSizeFreeData';
|
||||
swapSizeFreeData.dateDataTrans['dateRange'] = this.defaultTimes;
|
||||
swapSizeFreeData.dateDataTrans['dateRange'] = this.firstTabTimeArr;
|
||||
if (res && res.data) {
|
||||
swapSizeFreeData.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'] : [];
|
||||
@@ -392,7 +399,7 @@
|
||||
let memoryUtilizaData = JSON.parse(JSON.stringify(this.resultData[5]));
|
||||
memoryUtilization(Object.assign({},{clientId: this.paramsData.clientId}, val)).then(res => {
|
||||
memoryUtilizaData['fnEvent'] = 'getMemoryUtilizationData';
|
||||
memoryUtilizaData.dateDataTrans['dateRange'] = this.defaultTimes;
|
||||
memoryUtilizaData.dateDataTrans['dateRange'] = this.firstTabTimeArr;
|
||||
if (res && res.data) {
|
||||
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'] : [];
|
||||
@@ -408,7 +415,7 @@
|
||||
let swapSizePercentData = JSON.parse(JSON.stringify(this.resultData[6]));
|
||||
swapSizePercent(Object.assign({},{clientId: this.paramsData.clientId}, val)).then(res => {
|
||||
swapSizePercentData['fnEvent'] = 'getSwapSizePercentData';
|
||||
swapSizePercentData.dateDataTrans['dateRange'] = this.defaultTimes;
|
||||
swapSizePercentData.dateDataTrans['dateRange'] = this.firstTabTimeArr;
|
||||
if (res && res.data) {
|
||||
swapSizePercentData.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'] : [];
|
||||
@@ -424,7 +431,7 @@
|
||||
let memorySizeAvailData = JSON.parse(JSON.stringify(this.resultData[7]));
|
||||
memorySizeAvailable(Object.assign({},{clientId: this.paramsData.clientId}, val)).then(res => {
|
||||
memorySizeAvailData['fnEvent'] = 'getMemorySizeAvailableData';
|
||||
memorySizeAvailData.dateDataTrans['dateRange'] = this.defaultTimes;
|
||||
memorySizeAvailData.dateDataTrans['dateRange'] = this.firstTabTimeArr;
|
||||
if (res && res.data) {
|
||||
memorySizeAvailData.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'] : [];
|
||||
@@ -440,7 +447,7 @@
|
||||
let memorySizePercentData = JSON.parse(JSON.stringify(this.resultData[8]));
|
||||
memorySizePercent(Object.assign({},{clientId: this.paramsData.clientId}, val)).then(res => {
|
||||
memorySizePercentData['fnEvent'] = 'getMemorySizePercentData';
|
||||
memorySizePercentData.dateDataTrans['dateRange'] = this.defaultTimes;
|
||||
memorySizePercentData.dateDataTrans['dateRange'] = this.firstTabTimeArr;
|
||||
if (res && res.data) {
|
||||
memorySizePercentData.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'] : [];
|
||||
@@ -522,6 +529,7 @@
|
||||
spaceEcharts(Object.assign({}, {mount : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
|
||||
if (res && res.data) {
|
||||
mountEcharts.title = titleName + content.echartFors[0].title;
|
||||
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.dataList[0] = {
|
||||
name: content.echartFors[0].oneName,
|
||||
@@ -549,6 +557,7 @@
|
||||
spaceRate(Object.assign({}, {mount : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
|
||||
if (res && res.data) {
|
||||
mountEcharts.title = titleName + content.echartFors[1].title;
|
||||
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.dataList[0] = {
|
||||
name: content.echartFors[1].oneName,
|
||||
@@ -604,14 +613,15 @@
|
||||
return trafficEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
|
||||
if (res && res.data) {
|
||||
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.dataList[0] = {
|
||||
name: content.echartFors[0].oneName,
|
||||
data: res.data && res.data.yData['inSpeedData'] || []
|
||||
data: res.data && res.data.yData['netInSpeedData'] || []
|
||||
};
|
||||
netEcharts.dataVal.dataList[1] = {
|
||||
name: content.echartFors[0].twoName,
|
||||
data: res.data && res.data.yData['outSpeedData'] || []
|
||||
data: res.data && res.data.yData['netOutSpeedData'] || []
|
||||
};
|
||||
mountCollect['echartList'][0] = netEcharts;
|
||||
this.$set(this.secondChartList, titleName, mountCollect);
|
||||
@@ -631,6 +641,7 @@
|
||||
return droppedEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
|
||||
if (res && res.data) {
|
||||
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.dataList[0] = {
|
||||
name: content.echartFors[1].oneName,
|
||||
@@ -697,6 +708,7 @@
|
||||
return speedEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
|
||||
if (res && res.data) {
|
||||
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.dataList[0] = {
|
||||
name: content.echartFors[0].oneName,
|
||||
@@ -724,6 +736,7 @@
|
||||
return timesEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
|
||||
if (res && res.data) {
|
||||
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.dataList[0] = {
|
||||
name: content.echartFors[1].oneName,
|
||||
@@ -751,6 +764,7 @@
|
||||
return bytesEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
|
||||
if (res && res.data) {
|
||||
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.dataList[0] = {
|
||||
name: content.echartFors[2].oneName,
|
||||
@@ -817,6 +831,7 @@
|
||||
return cpuUtilEcharts(Object.assign({}, {id : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
|
||||
if (res && res.data) {
|
||||
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.dataList[0] = {
|
||||
name: content.echartFors[0].oneName,
|
||||
@@ -840,6 +855,7 @@
|
||||
return dockerMemEcharts(Object.assign({}, {id : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
|
||||
if (res && res.data) {
|
||||
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.dataList[0] = {
|
||||
name: content.echartFors[1].oneName,
|
||||
@@ -863,6 +879,7 @@
|
||||
return dockerSpeedEcharts(Object.assign({}, {id : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
|
||||
if (res && res.data) {
|
||||
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.dataList[0] = {
|
||||
name: content.echartFors[2].oneName,
|
||||
|
||||
@@ -58,9 +58,10 @@
|
||||
<!-- 弹窗 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||
<template v-if="clientList && clientList.length > 0">
|
||||
<el-checkbox-group v-model="checkboxGroup" size="min" :disabled="dialogData['timeline'] ? false : true" @change="handleCheckedCitiesChange">
|
||||
<el-checkbox-button style="margin-right: 10px;" v-for="city in clientList" :label="city" :key="city">{{city}}</el-checkbox-button>
|
||||
</el-checkbox-group>
|
||||
<el-radio-group v-model="checkboxGroup" :disabled="dialogData['timeline'] ? false : true" size="mini" @input="handleCheckedCitiesChange">
|
||||
<el-radio-button style="margin-right: 10px;" v-for="city in clientList" :label="city" :key="city">{{city}}</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
<div v-if="dialogData['timeline']" class="block mt10">
|
||||
<el-timeline :reverse="true">
|
||||
<template v-for="(timeline,key,index) of dialogData.timelineList">
|
||||
@@ -129,14 +130,13 @@
|
||||
}
|
||||
},
|
||||
open: false,
|
||||
checkboxGroup: [],
|
||||
checkboxGroup: '',
|
||||
title: '',
|
||||
dialogData: {
|
||||
timeline: false,
|
||||
timelineList: {}
|
||||
},
|
||||
clientList: [],
|
||||
changeClientMap: [],
|
||||
changeRowData: {},
|
||||
}
|
||||
},
|
||||
@@ -179,10 +179,8 @@
|
||||
},
|
||||
|
||||
fnDetails(num, row){
|
||||
this.checkboxGroup = [];
|
||||
this.changeClientMap = [];
|
||||
this.checkboxGroup = '';
|
||||
this.changeRowData = row;
|
||||
this.dialogData['timelineList'] = {};
|
||||
this.clientList = [];
|
||||
this.open = true;
|
||||
if (num === 1) {
|
||||
@@ -194,37 +192,32 @@
|
||||
this.dialogData['timeline'] = true;
|
||||
this.clientList = row.sucessClientIds;
|
||||
if (this.clientList && this.clientList.length > 0) {
|
||||
this.checkboxGroup = [this.clientList[0]];
|
||||
this.handleCheckedCitiesChange([this.clientList[0]]);
|
||||
this.checkboxGroup = this.clientList[0];
|
||||
this.handleCheckedCitiesChange(this.clientList[0]);
|
||||
}
|
||||
} else {
|
||||
this.title = '执行失败设备';
|
||||
this.dialogData['timeline'] = true;
|
||||
this.clientList = row.failClientIds;
|
||||
if (this.clientList && this.clientList.length > 0) {
|
||||
this.checkboxGroup = [this.clientList[0]];
|
||||
this.handleCheckedCitiesChange([this.clientList[0]]);
|
||||
this.checkboxGroup = this.clientList[0];
|
||||
this.handleCheckedCitiesChange(this.clientList[0]);
|
||||
}
|
||||
}
|
||||
},
|
||||
// 选中clientId
|
||||
handleCheckedCitiesChange(val) {
|
||||
let differentValues = val.filter(item => !new Set(this.changeClientMap).has(item));
|
||||
if (differentValues && differentValues.length > 0) {
|
||||
this.changeClientMap = val;
|
||||
getScriptResultBySn({clientId: differentValues[0], scriptId: this.changeRowData.id}).then(val => {
|
||||
handleCheckedCitiesChange(valModel) {
|
||||
if (valModel) {
|
||||
getScriptResultBySn({clientId: valModel, scriptId: this.changeRowData.id}).then(val => {
|
||||
if ( val && val.data && val.data.scriptResult && val.data.scriptResult.length > 0) {
|
||||
this.$set(this.dialogData['timelineList'], differentValues[0], val.data.scriptResult);
|
||||
this.dialogData['timelineList'] = {};
|
||||
this.$set(this.dialogData['timelineList'], valModel, val.data.scriptResult);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$modal.msgError("操作失败")
|
||||
}).catch(error => {
|
||||
this.dialogData['timelineList'] = {};
|
||||
});
|
||||
} else {
|
||||
let delDifferentVal = this.changeClientMap.filter(item => !new Set(val).has(item));
|
||||
if (delDifferentVal && delDifferentVal.length > 0) {
|
||||
this.changeClientMap = val;
|
||||
this.$delete(this.dialogData['timelineList'], delDifferentVal[0]);
|
||||
}
|
||||
this.$delete(this.dialogData['timelineList'], valModel);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -292,14 +285,14 @@
|
||||
::v-deep .lastBtnSty .el-form-item__content{
|
||||
margin-left: 10px!important;
|
||||
}
|
||||
::v-deep .el-checkbox-button__inner{
|
||||
::v-deep .el-radio-button__inner{
|
||||
border-radius: 4px!important;
|
||||
border-left: 1px solid #DCDFE6!important;
|
||||
}
|
||||
::v-deep .el-checkbox-button.is-checked .el-checkbox-button__inner{
|
||||
::v-deep .el-radio-button.is-checked .el-radio-button__inner{
|
||||
box-shadow: none!important;
|
||||
}
|
||||
::v-deep .el-checkbox-button.is-focus .el-checkbox-button__inner{
|
||||
::v-deep .el-radio-button.is-focus .el-radio-button__inner{
|
||||
border-color: #1890ff!important;
|
||||
}
|
||||
::v-deep .el-timeline .el-timeline-item:last-child .el-timeline-item__tail {
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
loading: false,
|
||||
currTimeList: {},
|
||||
defaultTimes: [],
|
||||
firstTabTime: {},
|
||||
firstTabTimeArr: [],
|
||||
activeName: 'first',
|
||||
paramsData: {},
|
||||
// 第一栏
|
||||
@@ -178,12 +180,16 @@
|
||||
created() {
|
||||
let startData = '';
|
||||
let endData = '';
|
||||
let todyTime = '';
|
||||
const year = new Date().getFullYear();
|
||||
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 prevDay = String(new Date().getDate() - 1).padStart(2, '0');
|
||||
startData = `${year}-${month}-${prevDay} 00:00:00`;
|
||||
endData = `${year}-${month}-${day} 00:00:00`;
|
||||
endData = `${year}-${month}-${day} 23:59:59`;
|
||||
todyTime = `${year}-${month}-${day}`;
|
||||
this.firstTabTime = {startTime: todyTime + ' 00:00:00', endTime: todyTime + ' 23:59:59'};
|
||||
this.firstTabTimeArr = [todyTime + ' 00:00:00', todyTime + ' 23:59:59'];
|
||||
this.currTimeList = {startTime: startData, endTime: endData};
|
||||
this.defaultTimes = [startData, endData];
|
||||
this.paramsData = this.$route && this.$route.query;
|
||||
@@ -195,9 +201,9 @@
|
||||
if (this.activeName === 'first') {
|
||||
await Promise.all([
|
||||
this.getMonitorData(),
|
||||
this.getCpuData(this.currTimeList),
|
||||
this.getMemData(this.currTimeList),
|
||||
this.getPowerData(this.currTimeList)
|
||||
this.getCpuData(this.firstTabTime),
|
||||
this.getMemData(this.firstTabTime),
|
||||
this.getPowerData(this.firstTabTime)
|
||||
]);
|
||||
this.loading = true;
|
||||
} else {
|
||||
@@ -215,7 +221,7 @@
|
||||
},
|
||||
getCpuData(val) {
|
||||
let cpuData = JSON.parse(JSON.stringify(this.resultData[0]));
|
||||
cpuData.dateDataTrans['dateRange'] = this.defaultTimes;
|
||||
cpuData.dateDataTrans['dateRange'] = this.firstTabTimeArr;
|
||||
cpuData['fnEvent'] = 'getCpuData';
|
||||
switchCpuData(Object.assign({},{clientId: this.paramsData.clientId}, val)).then(res => {
|
||||
if (res && res.data) {
|
||||
@@ -231,7 +237,7 @@
|
||||
},
|
||||
getMemData(val) {
|
||||
let memData = JSON.parse(JSON.stringify(this.resultData[1]));
|
||||
memData.dateDataTrans['dateRange'] = this.defaultTimes;
|
||||
memData.dateDataTrans['dateRange'] = this.firstTabTimeArr;
|
||||
memData['fnEvent'] = 'getMemData';
|
||||
switchMemData(Object.assign({},{clientId: this.paramsData.clientId}, val)).then(res => {
|
||||
if (res && res.data) {
|
||||
@@ -247,7 +253,7 @@
|
||||
},
|
||||
getPowerData(val) {
|
||||
let powerData = JSON.parse(JSON.stringify(this.resultData[2]));
|
||||
powerData.dateDataTrans['dateRange'] = this.defaultTimes;
|
||||
powerData.dateDataTrans['dateRange'] = this.firstTabTimeArr;
|
||||
powerData['fnEvent'] = 'getPowerData';
|
||||
switchPowerData(Object.assign({},{clientId: this.paramsData.clientId}, val)).then(res => {
|
||||
if (res && res.data) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<script setup>
|
||||
import Form from '@/components/form/index.vue';
|
||||
import {listAllSwitchName, resNameBtType, addTopology, getTopology, updateTopology, postInterFaceName} from "@/api/disRevenue/resource"
|
||||
import {listAllSwitchName, resNameBtType, addTopology, getTopology, updateTopology, postInterFaceName,getRegistList} from "@/api/disRevenue/resource"
|
||||
export default {
|
||||
name: 'TopologyDetails',
|
||||
components: {Form},
|
||||
@@ -76,15 +76,15 @@
|
||||
},
|
||||
// 获取服务器下拉
|
||||
fnServerNameList(){
|
||||
resNameBtType({resourceType: 1}).then(val => {
|
||||
this.serverNameList = val && val;
|
||||
this.formList[0].controls.serverClientId['options'] = val && val.map(item => {
|
||||
getRegistList({resourceType: 1}).then(val => {
|
||||
this.serverNameList = val && val.data;
|
||||
this.formList[0].controls.serverClientId['options'] = val && val.data.map(item => {
|
||||
if (this.paramsData && this.paramsData.id) {
|
||||
if (item.resourceName === this.ruleForm.serverClientId) {
|
||||
if (item.clientId === this.ruleForm.serverClientId) {
|
||||
this.fnServerPortList({serverIp: item.ipAddress});
|
||||
}
|
||||
}
|
||||
return Object.assign({label: item.resourceName, value: item.resourceName});
|
||||
return Object.assign({label: item.clientId, value: item.clientId});
|
||||
});
|
||||
});
|
||||
},
|
||||
@@ -125,7 +125,7 @@
|
||||
case 'serverClientId':
|
||||
let serverIp = '';
|
||||
this.serverNameList.find(item => {
|
||||
if (item.resourceName === dataVal) {
|
||||
if (item.clientId === dataVal) {
|
||||
serverIp = item.ipAddress;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user