diff --git a/src/api/cs-device-boot/capacity.ts b/src/api/cs-device-boot/capacity.ts new file mode 100644 index 0000000..27a8a48 --- /dev/null +++ b/src/api/cs-device-boot/capacity.ts @@ -0,0 +1,15 @@ +import createAxios from '@/utils/request' + +// 更新组和指标关系 +export function getDevCapacity(devId: string) { + let form = new FormData() + form.append('id', devId) + return createAxios({ + url: '/cs-device-boot/capacity/getDevCapacity', + method: 'post', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: form + }) +} diff --git a/src/api/cs-harmonic-boot/stable.ts b/src/api/cs-harmonic-boot/stable.ts new file mode 100644 index 0000000..aae4036 --- /dev/null +++ b/src/api/cs-harmonic-boot/stable.ts @@ -0,0 +1,20 @@ +import createAxios from '@/utils/request' + +// 更新组和指标关系 +export function queryCommonStatisticalByTime(data: any) { + return createAxios({ + url: '/cs-harmonic-boot/stable/queryCommonStatisticalByTime', + method: 'post', + data: Object.assign( + { + devId: '', + endTime: '', + frequency: '', + startTime: '', + statisticalId: '', + valueType: '', + }, + data + ), + }) +} diff --git a/src/components/echarts/MyEchart.vue b/src/components/echarts/MyEchart.vue index 61d2e90..0d4a036 100644 --- a/src/components/echarts/MyEchart.vue +++ b/src/components/echarts/MyEchart.vue @@ -6,6 +6,7 @@ import { onBeforeUnmount, onMounted, ref, defineExpose, watch } from 'vue' import echarts from './echarts' import 'echarts/lib/component/dataZoom' + const chartRef = ref() const props = defineProps(['options']) @@ -71,54 +72,8 @@ const initChart = () => { bottom: '40px', containLabel: true }, - xAxis: [ - { - type: 'category', - axisTick: { show: false }, - axisLine: { - lineStyle: { - color: '#000' - } - }, - axisLabel: { - textStyle: { - fontFamily: 'dinproRegular', - color: '#000', - fontSize: '12' - } - }, - ...(props.options.xAxis || null) - } - ], - yAxis: [ - { - type: 'value', - - nameTextStyle: { - color: '#000' - }, - minInterval: 1, - axisLine: { - show: true, - lineStyle: { - color: '#000' - } - }, - axisLabel: { - color: '#000', - fontSize: 14 - }, - splitLine: { - lineStyle: { - // 使用深浅的间隔色 - color: ['#000'], - type: 'dashed', - opacity: 0.5 - } - }, - ...(props.options.yAxis || null) - } - ], + xAxis: handlerXAxis(), + yAxis: handlerYAxis(), dataZoom: [ { type: 'inside', @@ -133,7 +88,7 @@ const initChart = () => { height: 13, bottom: '20px', end: 100, - ...(props.options.dataZoom|| null) + ...(props.options.dataZoom || null) } ], color: [ @@ -152,6 +107,80 @@ const initChart = () => { ...props.options.options }) } +const handlerYAxis = () => { + let temp = { + type: 'value', + + nameTextStyle: { + color: '#000' + }, + minInterval: 1, + axisLine: { + show: true, + lineStyle: { + color: '#000' + } + }, + axisLabel: { + color: '#000', + fontSize: 14 + }, + splitLine: { + lineStyle: { + // 使用深浅的间隔色 + color: ['#000'], + type: 'dashed', + opacity: 0.5 + } + } + } + // props.options.xAxis 是数组还是对象 + if (Array.isArray(props.options.yAxis)) { + return props.options.yAxis.map((item: any) => { + return { + ...item, + ...temp + } + }) + } else { + return { + ...props.options.yAxis, + ...temp + } + } +} +const handlerXAxis = () => { + let temp = { + type: 'category', + axisTick: { show: false }, + axisLine: { + lineStyle: { + color: '#000' + } + }, + axisLabel: { + textStyle: { + fontFamily: 'dinproRegular', + color: '#000', + fontSize: '12' + } + } + } + // props.options.xAxis 是数组还是对象 + if (Array.isArray(props.options.xAxis)) { + return props.options.xAxis.map((item: any) => { + return { + ...item, + ...temp + } + }) + } else { + return { + ...props.options.xAxis, + ...temp + } + } +} onMounted(() => { initChart() window.addEventListener('resize', resizeHandler) diff --git a/src/layouts/admin/index.vue b/src/layouts/admin/index.vue index 87e136c..d29ea36 100644 --- a/src/layouts/admin/index.vue +++ b/src/layouts/admin/index.vue @@ -98,7 +98,7 @@ const init = async () => { icon: 'el-icon-List', menu_type: 'tab', url: '', - component: '/src/views/govern/device/control/index.vue', + component: '/src/views/govern/analyze/APF/index.vue', keepalive: 'auth/role', extend: 'none', children: [] diff --git a/src/views/govern/analyze/APF/index.vue b/src/views/govern/analyze/APF/index.vue new file mode 100644 index 0000000..d4270cb --- /dev/null +++ b/src/views/govern/analyze/APF/index.vue @@ -0,0 +1,305 @@ + + + + + diff --git a/src/views/govern/device/control/popup.vue b/src/views/govern/device/control/popup.vue index 54c4510..4b071fb 100644 --- a/src/views/govern/device/control/popup.vue +++ b/src/views/govern/device/control/popup.vue @@ -102,18 +102,7 @@ const init = () => { axisLine: { show: true }, - minInterval: 1, - interval: parseInt( - ( - (arr - .map(item => item.statisticalData) - .sort((a, b) => { - return b - a - })[0] * - 1.5) / - 5 - ).toFixed(0) - ), + minInterval: 0.1, min: 0, max: parseInt( ( diff --git a/src/views/govern/device/manage/index.vue b/src/views/govern/device/manage/index.vue index e74a548..bfdfee0 100644 --- a/src/views/govern/device/manage/index.vue +++ b/src/views/govern/device/manage/index.vue @@ -63,7 +63,7 @@ defineOptions({ name: 'govern/device/manage' }) -import MangePopup from './managePopup.vue' +import MangePopup from './popup.vue' import DeviceTree from '@/components/tree/govern/deviceTree.vue' import { mainHeight } from '@/utils/layout' import { queryByCode, queryByid, queryCsDictTree } from '@/api/system-boot/dictTree'