diff --git a/src/api/disRevenue/earnManage.js b/src/api/disRevenue/earnManage.js index 7c32ce0..328f2d2 100644 --- a/src/api/disRevenue/earnManage.js +++ b/src/api/disRevenue/earnManage.js @@ -66,6 +66,63 @@ export function calculateAvg(data) { }) } +// 包端----图 +export function graPackage(data) { + return request({ + url: '/system/bandwidth/graphicalAnalysisPackage', + method: 'post', + data: data + }) +} +// 95宽带值Mbps/月---图 +export function graMonthly(data) { + return request({ + url: '/system/bandwidth/graphicalAnalysisMonthly', + method: 'post', + data: data + }) +} +// 有效-95宽带值Mbps/月---图 +export function graEffectiveMonthly(data) { + return request({ + url: '/system/bandwidth/graphicalAnalysisEffectiveMonthly', + method: 'post', + data: data + }) +} +// 有效-95宽带值Mbps/日---图 +export function graEffectiveDaily(data) { + return request({ + url: '/system/bandwidth/graphicalAnalysisEffectiveDaily', + method: 'post', + data: data + }) +} +// 有效月均日95值----图 +export function graEffectiveAvgMonthly(data) { + return request({ + url: '/system/bandwidth/graphicalAnalysisEffectiveAvgMonthly', + method: 'post', + data: data + }) +} +// 95宽带值/日----图 +export function graDaily(data) { + return request({ + url: '/system/bandwidth/graphicalAnalysisDaily', + method: 'post', + data: data + }) +} +// 月均日95值----图 +export function graAvgMonthly(data) { + return request({ + url: '/system/bandwidth/graphicalAnalysisAvgMonthly', + method: 'post', + data: data + }) +} + /** ------------------业务管理------------------- */ // 查询列表 diff --git a/src/api/disRevenue/resource.js b/src/api/disRevenue/resource.js index 57bc974..b13f48d 100644 --- a/src/api/disRevenue/resource.js +++ b/src/api/disRevenue/resource.js @@ -51,6 +51,15 @@ export function updateregisterType(data) { data: data }) } +// 修改注册状态 +export function resNameBtType(data) { + return request({ + url: '/system/registration/selectAllResourceNameByType', + method: 'post', + data: data + }) +} + /** ----------------拓扑管理 ------------ */ // 查询列表 @@ -93,6 +102,14 @@ export function delTopology(Ids) { method: 'delete' }) } +// 服务器网口 +export function postInterFaceName(data) { + return request({ + url: '/system/interfaceName/getAllNames', + method: 'post', + data: data + }) +} /** ----------------资源分组------------ */ // 查询列表 diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 1635c26..78f1085 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -89,6 +89,9 @@ div:focus { .p20 { padding: 20px; } +.mtb10 { + margin: 10px 0; +} .fontSize15 { font-size: 15px; } diff --git a/src/components/echartsList/bar.vue b/src/components/echartsList/bar.vue index a1c86a9..88803f1 100644 --- a/src/components/echartsList/bar.vue +++ b/src/components/echartsList/bar.vue @@ -1,6 +1,6 @@ @@ -20,6 +20,10 @@ type: String, default: null }, + dateShowType: { + type: String, + default: null + }, chartData: { type: Function, default: () => { @@ -44,20 +48,16 @@ methods: { getList(title, dataXY) { const barDataListIntance = echarts.init(document.getElementById('barChart' + this.num)); - let titleSet = {}; - if (dataXY && dataXY.titleVal) { - titleSet = { + let option = { + title: [{ text: title, x: dataXY && dataXY.titleVal && dataXY.titleVal.x || '50%', y: dataXY && dataXY.titleVal && dataXY.titleVal.y || '3%', textAlign: dataXY && dataXY.titleVal && dataXY.titleVal.textAlign || 'center', textStyle: { - fontSize: 14 + fontSize: dataXY && dataXY.titleVal && dataXY.titleVal.fontSize || 16 }, - }; - } - let option = { - title: [titleSet], + }], tooltip: { trigger: 'axis', axisPointer: { @@ -83,7 +83,7 @@ splitLine: { show: false }, // x轴标签样式(保留标签便于阅读) axisLabel: { - show: false + show: dataXY && dataXY.hidAxisLabel ? false : true } } ], @@ -97,7 +97,7 @@ // 去掉y轴刻度线 axisTick: { show: false }, // 去掉y轴网格线(横向网格) - splitLine: { show: false }, + splitLine: { show: dataXY && dataXY.hidSplitLine ? false : true }, // Y轴标签样式(保留标签便于阅读) axisLabel: { show: true @@ -128,7 +128,7 @@ // console.log(props.chartData(val)); // this.getList(this.title, {data: this.barData.data, lineData: days, yAxis: this.barData && this.barData.yAxis}); let newbarData = {...this.barData}; - newbarData['lineData'] = days; + newbarData['lineData'] = days && days.length > 0 ? days: this.barData.lineXData; this.getList(this.title, newbarData); } } diff --git a/src/components/echartsList/dateTimeSelect.vue b/src/components/echartsList/dateTimeSelect.vue index b2a8562..4c39e7d 100644 --- a/src/components/echartsList/dateTimeSelect.vue +++ b/src/components/echartsList/dateTimeSelect.vue @@ -2,18 +2,25 @@
@@ -22,27 +29,38 @@ import {onMounted} from "vue"; export default { name: 'dateTimeSelect', - props: {}, + props: { + dateShowType: { + type: String, + default: null + } + }, data() { return { dateRange: [], - isActive: 'DAY' + isActive: '' } }, // DOM 挂载完成后 mounted() { // 可以访问 DOM 元素 setTimeout(() => { - this.getLastDays(6); + // this.getLastDays(6); + // this.getDaysOfPreviousMonth(); + this.$emit("dataChange", this.isActive, []); }, 500); }, methods: { toggle(val, num) { this.isActive = val; - if (val && val !== 'MONTH') { - this.getLastDays(num - 1); - } else { + if (val && val === 'MONTH') { this.getDaysOfPreviousMonth(); + } else if (val && val === 'THREEMONTH') { + this.getLastThreeMonths(); + } else if (val && val === 'HALFYEAR') { + this.getLastSixMonths(); + } else { + this.getLastDays(num - 1); } }, dateChange() { @@ -66,6 +84,7 @@ } this.$emit("dataChange", this.isActive, dayList); }, + // 获取前一个月的所有日期 getDaysOfPreviousMonth(star, end) { const currentDate = new Date(); const currentYear = currentDate.getFullYear(); @@ -91,7 +110,55 @@ currentDay.setDate(currentDay.getDate() + 1); } this.$emit("dataChange", this.isActive, oneMonthDays); - } + }, + // 获取前三个月的月 + getLastThreeMonths() { + const threeMonths = []; + const today = new Date(); // 当前日期 + const currentYear = today.getFullYear(); + const currentMonth = today.getMonth(); // 月份从0开始(0=1月,11=12月) + // 循环获取前3个月(i=0: 前1个月,i=1: 前2个月,i=2: 前3个月) + for (let i = 1; i <= 3; i++) { + // 计算目标月份(当前月 - i) + let targetMonth = currentMonth - i; + let targetYear = currentYear; + // 处理月份溢出(如1月-1=12月,年份减1) + if (targetMonth < 0) { + targetMonth += 12; + targetYear -= 1; + } + // 格式化月份为两位数(如5月→'05') + const monthStr = String(targetMonth + 1).padStart(2, '0'); // 加1是因为月份从0开始 + threeMonths.push(`${targetYear}-${monthStr}`); + } + console.log('threeMonths===',threeMonths); + this.$emit("dataChange", this.isActive, threeMonths); + }, + // 前半年 + getLastSixMonths() { + const result = []; + const today = new Date(); // 当前日期 + const currentYear = today.getFullYear(); + const currentMonth = today.getMonth(); // 月份从0开始(0=1月,11=12月) + + // 循环获取前6个月(i=1: 前1个月,i=6: 前6个月) + for (let i = 1; i <= 6; i++) { + let targetMonth = currentMonth - i; + let targetYear = currentYear; + + // 处理月份跨年份(如1月-1=12月,年份减1) + if (targetMonth < 0) { + targetMonth += 12; + targetYear -= 1; + } + + // 格式化月份为两位数(如5月→'05') + const monthStr = String(targetMonth + 1).padStart(2, '0'); // 加1转为实际月份(1-12) + result.push(`${targetYear}-${monthStr}`); + } + + return result; + }, } } diff --git a/src/components/echartsList/line.vue b/src/components/echartsList/line.vue index 55ddc5a..0376caa 100644 --- a/src/components/echartsList/line.vue +++ b/src/components/echartsList/line.vue @@ -1,6 +1,6 @@ @@ -20,6 +20,10 @@ type: String, default: null }, + dateShowType: { + type: String, + default: null + }, chartData: { type: Function, default: () => { @@ -81,7 +85,7 @@ type: 'value', name: '单位Mbps', splitLine: { - show: false, + show: true, }, }, series: [ @@ -100,8 +104,8 @@ // }) }, dataChangeValue(val, days) { - // console.log(props.chartData(val)); - this.getList(this.title, {data: this.lineData.data, lineXData: days}); + let lineDataList = days && days.length > 0 ? days: this.lineData.lineXData; + this.getList(this.title, {data: this.lineData.data, lineXData: lineDataList}); } } } diff --git a/src/components/form/index.vue b/src/components/form/index.vue index fac0893..addd689 100644 --- a/src/components/form/index.vue +++ b/src/components/form/index.vue @@ -1,6 +1,6 @@