diff --git a/ALOps_sys_fe/alops-ui/src/views/QandA/Aiassistant/index.vue b/ALOps_sys_fe/alops-ui/src/views/QandA/Aiassistant/index.vue index 2d2bec6d..eaca675a 100644 --- a/ALOps_sys_fe/alops-ui/src/views/QandA/Aiassistant/index.vue +++ b/ALOps_sys_fe/alops-ui/src/views/QandA/Aiassistant/index.vue @@ -79,21 +79,23 @@ export default { methods: { sendMessage() { if (!this.newMessage.trim()) return; + console.log("%c 🍃: sendMessage -> this.newMessage ", "font-size:16px;background-color:#46f583;color:black;", this.newMessage) // 添加用户消息 this.messages.push({ text: this.newMessage, sender: 'customer', time: this.formatTime(new Date()) }); - + let newMessageContent = this.newMessage; // 模拟自动回复 setTimeout(() => { - this.autoReply(this.newMessage); + this.autoReply(newMessageContent); }, 1000); this.newMessage = ''; }, async autoReply(userMessage) { + console.log("%c 🇱🇺: autoReply -> userMessage ", "font-size:16px;background-color:#c70b31;color:white;", userMessage) let replyText = ''; let res = await knowledgeAsk({question: userMessage }); if (res.code == 200) { diff --git a/ALOps_sys_fe/alops-ui/src/views/device/deviceInformation/index.vue b/ALOps_sys_fe/alops-ui/src/views/device/deviceInformation/index.vue index cf700599..728c7382 100644 --- a/ALOps_sys_fe/alops-ui/src/views/device/deviceInformation/index.vue +++ b/ALOps_sys_fe/alops-ui/src/views/device/deviceInformation/index.vue @@ -21,6 +21,7 @@ + 分钟 diff --git a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/detail.vue b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/detail.vue index e2b30f31..b6aa6ae1 100644 --- a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/detail.vue +++ b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/detail.vue @@ -247,7 +247,7 @@ export default { components: { History, Interface, Vlan, Routing, LineChart, Veneer}, data() { return { - DateValue: [dayjs().subtract(1, 'month').format('YYYY-MM-DD HH:mm:ss'),dayjs().format('YYYY-MM-DD HH:mm:ss')], + DateValue: [dayjs().subtract(1, 'week').format('YYYY-MM-DD HH:mm:ss'),dayjs().format('YYYY-MM-DD HH:mm:ss')], selectedTab: 1, tabs: [ { name: '历史预警' }, @@ -447,62 +447,73 @@ mounted() { } ] }) + const value = this.details.cpuUtilization / 100; usedmemory3.setOption({ + series: [ + { + type: 'liquidFill', + radius: '47%', + center: ['25%', '45%'], + color: [ + { + type: 'linear', + x: 0, + y: 0, + x2: 0, + y2: 1, + colorStops: [ + { + offset: 0, + color: '#446bf5', + }, + { + offset: 1, + color: '#2ca3e2', + }, + ], + globalCoord: false, + }, + ], + data: [value, value], // data个数代表波浪数 + backgroundStyle: { + borderWidth: 1, + color: 'RGBA(51, 66, 127, 0.7)', + }, + label: { + normal: { + textStyle: { + fontSize: 50, + color: '#fff', + }, + formatter: function(params) { + return Math.round(params.value * 100) + '%'; + } + }, + }, + outline: { + // show: false + borderDistance: 0, + itemStyle: { + borderWidth: 2, + borderColor: '#112165', + }, + }, + } + ], title: [ { text: 'CPU占用', - left: '45%', - top: '55%', + left: '25%', + top: '75%', textAlign: 'center', textStyle: { fontSize: '14', fontWeight: '400', color: '#6AA0E4', textAlign: 'center', - textShadowColor: '#000', }, }, - ], - series: { - type: 'pie', - radius: ['90%', "100%"], - hoverAnimation: false, - data: [ - { - value: this.details.cpuUtilization, - label: { - normal: { - color: '#6AA0E4', - fontSize: 22, - fontWeight: 'bold', - formatter: function(params) { - return params.value + '%'; - }, - position: 'center', - show: true, - } - }, - itemStyle: { - normal: { - color: '#6AA0E4' - } - } - },{ - value: 100-this.details.cpuUtilization, - name: '', - labelLine: { - show: false - }, - itemStyle: { - normal: { - color: '#D8D8D8' - }, - emphasis:{ - color:'#D8D8D8' - } - } - }] - } + ] }) usedmemory4.setOption({ title: [ @@ -602,42 +613,20 @@ mounted() { params.forEach(function(item) { let value = item.value; let unit = ''; - - // 处理不同数据的显示格式 - if (item.seriesName === '设备温度') { - unit = '℃'; - } else if (item.seriesName === '健康度') { - // 获取原始健康度值 - 修复访问方式 - // 通过映射关系反向计算原始值 - let originalValue; - switch(value) { - case 100: originalValue = 1; break; - case 75: originalValue = 2; break; - case 50: originalValue = 3; break; - case 25: originalValue = 4; break; - default: originalValue = 0; - } - - let statusText = ''; - switch(originalValue) { - case 1: statusText = '健康'; break; - case 2: statusText = '良好'; break; - case 3: statusText = '一般'; break; - case 4: statusText = '需维护'; break; - default: statusText = '未知'; - } - result += item.marker + item.seriesName + ': ' + value + '% (' + statusText + ')
'; - return; - } else { - unit = '%'; - } + + // 处理不同数据的显示格式 + if (item.seriesName === '设备温度') { + unit = '℃'; + } else { + unit = '%'; + } result += item.marker + item.seriesName + ': ' + value + unit + '
'; }); return result; } }, legend: { - data: ['设备温度', 'CPU使用率', '内存使用率', '健康度'], + data: ['设备温度', 'CPU使用率', '内存使用率'], textStyle: { color: '#718096' } @@ -764,43 +753,6 @@ mounted() { }] } } - }, - { - name: '健康度', - type: 'bar', - // 将健康度值映射为对应的百分比:1->100, 2->75, 3->50, 4->25 - // 使用对象格式存储数据,同时包含映射值和原始值 - data: details.healthList.map(value => { - const valueMap = {1: 100, 2: 75, 3: 50, 4: 25}; - // 使用value属性表示显示的值,原始值可以通过自定义字段存储 - return { - value: valueMap[value] || 0, - originalValue: value - }; - }), - itemStyle: { - color: function(params) { - // 获取原始健康度值进行颜色映射 - const originalValue = params.data && params.data.originalValue !== undefined ? - params.data.originalValue : params.value; - // 使用switch语句替代对象查找,确保每个case都有break - switch(originalValue) { - case 1: return '#48bb78'; // 健康 - 绿色 - case 2: return '#4299e1'; // 良好 - 蓝色 - case 3: return '#ed8936'; // 一般 - 橙色 - case 4: return '#f56565'; // 需维护 - 红色 - default: return '#a0aec0'; // 默认灰色 - } - } - }, - barWidth: '40%', - emphasis: { - itemStyle: { - shadowBlur: 10, - shadowOffsetX: 0, - shadowColor: 'rgba(0, 0, 0, 0.5)' - } - } } ] }); diff --git a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/inMonitor/message/index.vue b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/inMonitor/message/index.vue index abd2e46a..c4be9c7c 100644 --- a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/inMonitor/message/index.vue +++ b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/inMonitor/message/index.vue @@ -52,7 +52,7 @@ - + @@ -72,7 +72,7 @@ {{ parseTime(scope.row.handleTime) || '--' }} - + diff --git a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/inMonitor/rules/index.vue b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/inMonitor/rules/index.vue index c60599d1..51922bce 100644 --- a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/inMonitor/rules/index.vue +++ b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/inMonitor/rules/index.vue @@ -34,8 +34,8 @@ type="index" > - - + +