diff --git a/2.md b/2.md deleted file mode 100644 index e69de29b..00000000 diff --git a/README.md b/README.md index 2356879c..42fe6e1b 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ npm run lint ### 3.图表组件库 图表:echarts5.0 -地图:amCharts +地图:amCharts4 拖拽 & Resize:Vue-grid-layout  https://jbaysolutions.github.io/vue-grid-layout/guide/ ### 4.响应式方案 @@ -51,7 +51,7 @@ https://www.lodashjs.com/ 多个单词时,应该以高阶的 (通常是一般化描述的) 单词开头,以描述性的修饰词结尾 eg:`SearchButtonClear.vue` 反例:`ClearSearchButton.vue` - **文件夹** -使用小写,单词间使用连字符`-`连接,或使用驼峰格式 +使用小写,单词间使用连字符`-`连接,或使用驼峰格式 eg:`right-box`、`rightBox` diff --git a/src/views/charts/Chart.vue b/src/views/charts/Chart.vue index b463738e..8f19c0e6 100644 --- a/src/views/charts/Chart.vue +++ b/src/views/charts/Chart.vue @@ -299,13 +299,12 @@ import { isMapLine, isMapBlock, isSingleValueWithEcharts, - isSingleValueWithEchartsTemp, + isSingleValueWithPercent, isRelationShip, isTabs, isGroup, isSankey, isIpBasicInfo, - isIpOpenPort, isIpHostedDomain, isDomainWhois, isDomainDnsRecord, @@ -441,9 +440,7 @@ export default { isEchartsWithStatistics: isEchartsWithStatistics(props.chartInfo.type), isSingleValue: isSingleValue(props.chartInfo.type), isSingleValueWithEcharts: isSingleValueWithEcharts(props.chartInfo.type), - isSingleValueWithEchartsTemp: isSingleValueWithEchartsTemp( - props.chartInfo.type - ), + isSingleValueWithPercent: isSingleValueWithPercent(props.chartInfo.type), isRelationShip: isRelationShip(props.chartInfo.type), isTable: isTable(props.chartInfo.type), isBasicTable: isBasicTable(props.chartInfo.type), @@ -458,7 +455,6 @@ export default { isSankey: isSankey(props.chartInfo.type), isIpBasicInfo: isIpBasicInfo(props.chartInfo.type), isIpHostedDomain: isIpHostedDomain(props.chartInfo.type), - isIpOpenPort: isIpOpenPort(props.chartInfo.type), isDomainWhois: isDomainWhois(props.chartInfo.type), isDomainDnsRecord: isDomainDnsRecord(props.chartInfo.type), isCryptocurrencyEventList: isCryptocurrencyEventList( diff --git a/src/views/charts/Panel.vue b/src/views/charts/Panel.vue index bf3b3579..cc53392b 100644 --- a/src/views/charts/Panel.vue +++ b/src/views/charts/Panel.vue @@ -45,7 +45,11 @@ import { ref } from 'vue' import { panelTypeAndRouteMapping } from '@/utils/constants' import { api, getPanelList, getChartList } from '@/utils/api' import { getNowTime } from '@/utils/date-util' -import { getGroupHeight, getTypeCategory } from '@/views/charts/charts/tools' +import { + isGroup, + isBlock, + getGroupHeight +} from './charts/tools' export default { name: 'Panel', @@ -115,7 +119,7 @@ export default { recursionParamsConvert (chart) { chart.params = chart.params ? JSON.parse(chart.params) : {} chart.firstShow = false - if (chart.type === 94) { + if (isGroup(chart.type)) { chart.oldH = chart.h /* chart.params = { collapse: false @@ -125,10 +129,10 @@ export default { chart.h = 1 } } - if (chart.type === 95) { + if (isBlock(chart.type)) { let sumGroup = 0 chart.children.forEach(item => { - if (item.type === 94) { + if (isGroup(item.type)) { sumGroup++ } }) diff --git a/src/views/charts/PanelChart.vue b/src/views/charts/PanelChart.vue index ec923183..fb1fecdd 100644 --- a/src/views/charts/PanelChart.vue +++ b/src/views/charts/PanelChart.vue @@ -26,7 +26,7 @@ { setTimeout(() => { - if(!(this.chartInfo.type === 33 || this.chartInfo.type === 34) ){ + if(!(isIpHostedDomain(this.chartInfo.type) || isAppRelatedDomain(this.chartInfo.type)) ){ this.loading = false }else if(!this.chartData || this.chartData.length === 0){ this.loading = false } }, 200) }) - } else if (this.chartInfo.type === 94) { + } else if (isGroup(this.chartInfo.type)) { this.chartInfo.children = [...this.chartInfo.children] - } else if (this.chartInfo.type === 95) { + } else if (isBlock(this.chartInfo.type)) { if (!this.chartInfo.firstShow) { this.chartInfo.firstShow = true } else { @@ -410,7 +410,7 @@ export default { isEchartsWithStatistics: isEchartsWithStatistics(props.chartInfo.type), isSingleValue: isSingleValue(props.chartInfo.type), isSingleValueWithEcharts: isSingleValueWithEcharts(props.chartInfo.type), - isSingleValueWithEchartsTemp: isSingleValueWithEchartsTemp(props.chartInfo.type), + isSingleValueWithPercent: isSingleValueWithPercent(props.chartInfo.type), isRelationShip: isRelationShip(props.chartInfo.type), isTable: isTable(props.chartInfo.type), isActiveIpTable: isActiveIpTable(props.chartInfo.type), @@ -424,7 +424,7 @@ export default { isSankey: isSankey(props.chartInfo.type), isIpBasicInfo: isIpBasicInfo(props.chartInfo.type), isIpHostedDomain: isIpHostedDomain(props.chartInfo.type), - isIpOpenPort: isIpOpenPort(props.chartInfo.type), + isIpOpenPortBar: isIpOpenPortBar(props.chartInfo.type), isDomainWhois: isDomainWhois(props.chartInfo.type), isDomainDnsRecord: isDomainDnsRecord(props.chartInfo.type), isCryptocurrencyEventList: isCryptocurrencyEventList(props.chartInfo.type), diff --git a/src/views/charts/PanelChartList.vue b/src/views/charts/PanelChartList.vue index 7f3a0423..1b05f62e 100644 --- a/src/views/charts/PanelChartList.vue +++ b/src/views/charts/PanelChartList.vue @@ -22,7 +22,7 @@ :y="item.y" :static="item.static" :ref="'grid-item' + item.id" - :isResizable = "item.type === 'group' ? false: null" + :isResizable="isGroup ? false: null" dragAllowFrom=".chart-header" dragIgnoreFrom=".chart-header__tools" v-bind="anchorPoint(item)" @@ -188,18 +188,7 @@ export default { }) setTimeout(() => { this.copyDataList.forEach(item => { - // if (item.type === 95) { - // console.log(item.h, item.name) - // item.children.forEach(children => { - // console.log(children.name, children.h, children.y) - // }) - // let parentH = 1.5 - // parentH += getGroupHeight(item.children) - // if (parentH !== item.h) { - // item.h = parentH - // } - // } - if (item.type === 94 && !item.firstShow) { + if (isGroup(item.type) && !item.firstShow) { item.firstShow = true this.copyDataList = [...this.copyDataList] this.emitter.emit('groupParentCalcHeight', { chart: item, childrenList: this.copyDataList }) diff --git a/src/views/charts/charts/ChartBlock.vue b/src/views/charts/charts/ChartBlock.vue index b1171777..27afd319 100644 --- a/src/views/charts/charts/ChartBlock.vue +++ b/src/views/charts/charts/ChartBlock.vue @@ -10,24 +10,36 @@