diff --git a/public/player/player.html b/public/player/player.html index 81f4f25..3e4d55c 100644 --- a/public/player/player.html +++ b/public/player/player.html @@ -39,7 +39,7 @@ function create() { jessibuca = new Jessibuca({ container: $container, // 播放器容器 若为 string ,则底层调用的是 document.getElementById('id') - videoBuffer: 0.2, // 设置最大缓冲时长,单位秒,播放器会自动消除延迟 + videoBuffer: 3, // 设置最大缓冲时长,单位秒,播放器会自动消除延迟 isResize: true, // 1. 当为`true`的时候:视频画面做等比缩放后,高或宽对齐canvas区域,画面不被拉伸,但有黑边。 等同于 `setScaleMode(1)` 2. 当为`false`的时候:视频画面完全填充canvas区域,画面会被拉伸。等同于 `setScaleMode(0)` loadingText: '视频加载中', // 加载过程中文案 useMSE: false, // 是否开启MediaSource硬解码 视频编码只支持H.264视频(Safari on iOS不支持)不支持 forceNoOffscreen 为 false (开启离屏渲染) diff --git a/public/player/player.html b/public/player/player.html index 81f4f25..3e4d55c 100644 --- a/public/player/player.html +++ b/public/player/player.html @@ -39,7 +39,7 @@ function create() { jessibuca = new Jessibuca({ container: $container, // 播放器容器 若为 string ,则底层调用的是 document.getElementById('id') - videoBuffer: 0.2, // 设置最大缓冲时长,单位秒,播放器会自动消除延迟 + videoBuffer: 3, // 设置最大缓冲时长,单位秒,播放器会自动消除延迟 isResize: true, // 1. 当为`true`的时候:视频画面做等比缩放后,高或宽对齐canvas区域,画面不被拉伸,但有黑边。 等同于 `setScaleMode(1)` 2. 当为`false`的时候:视频画面完全填充canvas区域,画面会被拉伸。等同于 `setScaleMode(0)` loadingText: '视频加载中', // 加载过程中文案 useMSE: false, // 是否开启MediaSource硬解码 视频编码只支持H.264视频(Safari on iOS不支持)不支持 forceNoOffscreen 为 false (开启离屏渲染) diff --git a/src/api/alarm/dangerAssessment/statistics.ts b/src/api/alarm/dangerAssessment/statistics.ts new file mode 100644 index 0000000..2bdedcf --- /dev/null +++ b/src/api/alarm/dangerAssessment/statistics.ts @@ -0,0 +1,44 @@ +/** + * 安全生产隐患评估 + */ +import request from '../../index' + +// 单位近一个月报警分析 +export function getDeptAlarmRecord() { + return request({ + url: 'statistics/dept/record', + method: 'get', + }) +} + +// 单位报警时间曲线 +export function getDeptAlarmDate() { + return request({ + url: 'statistics/dept/alarm/date', + method: 'get', + }) +} + +// 隐患分类 +export function getDangerCategory() { + return request({ + url: 'statistics/dangerCategory', + method: 'get', + }) +} + +// 区域隐患分类 +export function getAreaDanger() { + return request({ + url: 'statistics/areaDanger', + method: 'get', + }) +} + +// 单位安全隐患分类 +export function getDeptDanger() { + return request({ + url: 'statistics/deptDanger', + method: 'get', + }) +} diff --git a/public/player/player.html b/public/player/player.html index 81f4f25..3e4d55c 100644 --- a/public/player/player.html +++ b/public/player/player.html @@ -39,7 +39,7 @@ function create() { jessibuca = new Jessibuca({ container: $container, // 播放器容器 若为 string ,则底层调用的是 document.getElementById('id') - videoBuffer: 0.2, // 设置最大缓冲时长,单位秒,播放器会自动消除延迟 + videoBuffer: 3, // 设置最大缓冲时长,单位秒,播放器会自动消除延迟 isResize: true, // 1. 当为`true`的时候:视频画面做等比缩放后,高或宽对齐canvas区域,画面不被拉伸,但有黑边。 等同于 `setScaleMode(1)` 2. 当为`false`的时候:视频画面完全填充canvas区域,画面会被拉伸。等同于 `setScaleMode(0)` loadingText: '视频加载中', // 加载过程中文案 useMSE: false, // 是否开启MediaSource硬解码 视频编码只支持H.264视频(Safari on iOS不支持)不支持 forceNoOffscreen 为 false (开启离屏渲染) diff --git a/src/api/alarm/dangerAssessment/statistics.ts b/src/api/alarm/dangerAssessment/statistics.ts new file mode 100644 index 0000000..2bdedcf --- /dev/null +++ b/src/api/alarm/dangerAssessment/statistics.ts @@ -0,0 +1,44 @@ +/** + * 安全生产隐患评估 + */ +import request from '../../index' + +// 单位近一个月报警分析 +export function getDeptAlarmRecord() { + return request({ + url: 'statistics/dept/record', + method: 'get', + }) +} + +// 单位报警时间曲线 +export function getDeptAlarmDate() { + return request({ + url: 'statistics/dept/alarm/date', + method: 'get', + }) +} + +// 隐患分类 +export function getDangerCategory() { + return request({ + url: 'statistics/dangerCategory', + method: 'get', + }) +} + +// 区域隐患分类 +export function getAreaDanger() { + return request({ + url: 'statistics/areaDanger', + method: 'get', + }) +} + +// 单位安全隐患分类 +export function getDeptDanger() { + return request({ + url: 'statistics/deptDanger', + method: 'get', + }) +} diff --git a/src/components.d.ts b/src/components.d.ts index 965339c..0d54fa5 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -20,6 +20,7 @@ AuthAll: typeof import('./components/AuthAll/index.vue')['default'] BarChartHorizontal: typeof import('./components/Echart/BarChartHorizontal.vue')['default'] BarChartVertical: typeof import('./components/Echart/BarChartVertical.vue')['default'] + BarChartVerticalDynamics: typeof import('./components/Echart/BarChartVerticalDynamics.vue')['default'] BarCodeBind: typeof import('./components/BarCodeBind/index.vue')['default'] BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default'] BenchCol: typeof import('./components/benchCol/index.vue')['default'] @@ -27,6 +28,7 @@ CertificationMonitor: typeof import('./components/Sample/certificationMonitor.vue')['default'] CertificationRecords: typeof import('./components/Sample/certificationRecords.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] + copy: typeof import('./components/Echart/LineChart copy.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] @@ -43,6 +45,7 @@ ImagesUpload: typeof import('./components/ImagesUpload/index.vue')['default'] ImageUpload: typeof import('./components/ImageUpload/index.vue')['default'] LineChart: typeof import('./components/Echart/LineChart.vue')['default'] + LineChartDynamics: typeof import('./components/Echart/LineChartDynamics.vue')['default'] MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default'] NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] diff --git a/public/player/player.html b/public/player/player.html index 81f4f25..3e4d55c 100644 --- a/public/player/player.html +++ b/public/player/player.html @@ -39,7 +39,7 @@ function create() { jessibuca = new Jessibuca({ container: $container, // 播放器容器 若为 string ,则底层调用的是 document.getElementById('id') - videoBuffer: 0.2, // 设置最大缓冲时长,单位秒,播放器会自动消除延迟 + videoBuffer: 3, // 设置最大缓冲时长,单位秒,播放器会自动消除延迟 isResize: true, // 1. 当为`true`的时候:视频画面做等比缩放后,高或宽对齐canvas区域,画面不被拉伸,但有黑边。 等同于 `setScaleMode(1)` 2. 当为`false`的时候:视频画面完全填充canvas区域,画面会被拉伸。等同于 `setScaleMode(0)` loadingText: '视频加载中', // 加载过程中文案 useMSE: false, // 是否开启MediaSource硬解码 视频编码只支持H.264视频(Safari on iOS不支持)不支持 forceNoOffscreen 为 false (开启离屏渲染) diff --git a/src/api/alarm/dangerAssessment/statistics.ts b/src/api/alarm/dangerAssessment/statistics.ts new file mode 100644 index 0000000..2bdedcf --- /dev/null +++ b/src/api/alarm/dangerAssessment/statistics.ts @@ -0,0 +1,44 @@ +/** + * 安全生产隐患评估 + */ +import request from '../../index' + +// 单位近一个月报警分析 +export function getDeptAlarmRecord() { + return request({ + url: 'statistics/dept/record', + method: 'get', + }) +} + +// 单位报警时间曲线 +export function getDeptAlarmDate() { + return request({ + url: 'statistics/dept/alarm/date', + method: 'get', + }) +} + +// 隐患分类 +export function getDangerCategory() { + return request({ + url: 'statistics/dangerCategory', + method: 'get', + }) +} + +// 区域隐患分类 +export function getAreaDanger() { + return request({ + url: 'statistics/areaDanger', + method: 'get', + }) +} + +// 单位安全隐患分类 +export function getDeptDanger() { + return request({ + url: 'statistics/deptDanger', + method: 'get', + }) +} diff --git a/src/components.d.ts b/src/components.d.ts index 965339c..0d54fa5 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -20,6 +20,7 @@ AuthAll: typeof import('./components/AuthAll/index.vue')['default'] BarChartHorizontal: typeof import('./components/Echart/BarChartHorizontal.vue')['default'] BarChartVertical: typeof import('./components/Echart/BarChartVertical.vue')['default'] + BarChartVerticalDynamics: typeof import('./components/Echart/BarChartVerticalDynamics.vue')['default'] BarCodeBind: typeof import('./components/BarCodeBind/index.vue')['default'] BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default'] BenchCol: typeof import('./components/benchCol/index.vue')['default'] @@ -27,6 +28,7 @@ CertificationMonitor: typeof import('./components/Sample/certificationMonitor.vue')['default'] CertificationRecords: typeof import('./components/Sample/certificationRecords.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] + copy: typeof import('./components/Echart/LineChart copy.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] @@ -43,6 +45,7 @@ ImagesUpload: typeof import('./components/ImagesUpload/index.vue')['default'] ImageUpload: typeof import('./components/ImageUpload/index.vue')['default'] LineChart: typeof import('./components/Echart/LineChart.vue')['default'] + LineChartDynamics: typeof import('./components/Echart/LineChartDynamics.vue')['default'] MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default'] NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] diff --git a/src/components/Echart/BarChartVertical.vue b/src/components/Echart/BarChartVertical.vue index b42624a..d1414f0 100644 --- a/src/components/Echart/BarChartVertical.vue +++ b/src/components/Echart/BarChartVertical.vue @@ -46,7 +46,7 @@ return { top: 30, left: 20, - right: 20, + right: 30, bottom: 30, containLabel: true, // 是否包含坐标轴的刻度标签 } @@ -243,10 +243,6 @@ type: Boolean, default: true, }, - isAutomaticCarousel: { // 图表是否自动轮播 - type: Boolean, - default: false, - }, tooltipTextColor: { type: String, default: '#737373', @@ -255,6 +251,11 @@ type: String, default: '#fff', }, + /** x轴标签倾斜 */ + rotate: { + type: Number, + default: 45, + }, }) // 图表对象 @@ -350,23 +351,13 @@ axisLabel: { color: props.fontColor, fontSize: 11, - rotate: 45, + rotate: props.rotate, }, splitLine: { show: false, }, }, ], - dataZoom: [ - // 滑动条 - { - xAxisIndex: 0, // 这里是从X轴的0刻度开始 - show: false, // 是否显示滑动条,不影响使用 - type: 'inside', // 这个 dataZoom 组件是 slider 型 dataZoom 组件 - startValue: 0, // 开始位置。 - endValue: 1, // 一次性展示几个。(如果startValue设定为0,那么页面展示数就是endValue+1,比如此例页面展示2个) - }, - ], series: [] as barSeriesOption[], } // 标题 @@ -487,9 +478,6 @@ function initChart() { chart = init(chartRef.value as HTMLElement, tdTheme) const option = buildOption() - // if (props.isAutomaticCarousel) { - // automaticCarousel(option, chart, 3000, 3) - // } chart.setOption({}) nextTick(() => { chart.resize() @@ -500,9 +488,6 @@ function refreshChart() { if (chart) { const option = buildOption() - if (props.isAutomaticCarousel) { - automaticCarousel(option, chart, 3000, 2) - } chart.setOption(option as unknown as ECBasicOption, true) } } diff --git a/public/player/player.html b/public/player/player.html index 81f4f25..3e4d55c 100644 --- a/public/player/player.html +++ b/public/player/player.html @@ -39,7 +39,7 @@ function create() { jessibuca = new Jessibuca({ container: $container, // 播放器容器 若为 string ,则底层调用的是 document.getElementById('id') - videoBuffer: 0.2, // 设置最大缓冲时长,单位秒,播放器会自动消除延迟 + videoBuffer: 3, // 设置最大缓冲时长,单位秒,播放器会自动消除延迟 isResize: true, // 1. 当为`true`的时候:视频画面做等比缩放后,高或宽对齐canvas区域,画面不被拉伸,但有黑边。 等同于 `setScaleMode(1)` 2. 当为`false`的时候:视频画面完全填充canvas区域,画面会被拉伸。等同于 `setScaleMode(0)` loadingText: '视频加载中', // 加载过程中文案 useMSE: false, // 是否开启MediaSource硬解码 视频编码只支持H.264视频(Safari on iOS不支持)不支持 forceNoOffscreen 为 false (开启离屏渲染) diff --git a/src/api/alarm/dangerAssessment/statistics.ts b/src/api/alarm/dangerAssessment/statistics.ts new file mode 100644 index 0000000..2bdedcf --- /dev/null +++ b/src/api/alarm/dangerAssessment/statistics.ts @@ -0,0 +1,44 @@ +/** + * 安全生产隐患评估 + */ +import request from '../../index' + +// 单位近一个月报警分析 +export function getDeptAlarmRecord() { + return request({ + url: 'statistics/dept/record', + method: 'get', + }) +} + +// 单位报警时间曲线 +export function getDeptAlarmDate() { + return request({ + url: 'statistics/dept/alarm/date', + method: 'get', + }) +} + +// 隐患分类 +export function getDangerCategory() { + return request({ + url: 'statistics/dangerCategory', + method: 'get', + }) +} + +// 区域隐患分类 +export function getAreaDanger() { + return request({ + url: 'statistics/areaDanger', + method: 'get', + }) +} + +// 单位安全隐患分类 +export function getDeptDanger() { + return request({ + url: 'statistics/deptDanger', + method: 'get', + }) +} diff --git a/src/components.d.ts b/src/components.d.ts index 965339c..0d54fa5 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -20,6 +20,7 @@ AuthAll: typeof import('./components/AuthAll/index.vue')['default'] BarChartHorizontal: typeof import('./components/Echart/BarChartHorizontal.vue')['default'] BarChartVertical: typeof import('./components/Echart/BarChartVertical.vue')['default'] + BarChartVerticalDynamics: typeof import('./components/Echart/BarChartVerticalDynamics.vue')['default'] BarCodeBind: typeof import('./components/BarCodeBind/index.vue')['default'] BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default'] BenchCol: typeof import('./components/benchCol/index.vue')['default'] @@ -27,6 +28,7 @@ CertificationMonitor: typeof import('./components/Sample/certificationMonitor.vue')['default'] CertificationRecords: typeof import('./components/Sample/certificationRecords.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] + copy: typeof import('./components/Echart/LineChart copy.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] @@ -43,6 +45,7 @@ ImagesUpload: typeof import('./components/ImagesUpload/index.vue')['default'] ImageUpload: typeof import('./components/ImageUpload/index.vue')['default'] LineChart: typeof import('./components/Echart/LineChart.vue')['default'] + LineChartDynamics: typeof import('./components/Echart/LineChartDynamics.vue')['default'] MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default'] NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] diff --git a/src/components/Echart/BarChartVertical.vue b/src/components/Echart/BarChartVertical.vue index b42624a..d1414f0 100644 --- a/src/components/Echart/BarChartVertical.vue +++ b/src/components/Echart/BarChartVertical.vue @@ -46,7 +46,7 @@ return { top: 30, left: 20, - right: 20, + right: 30, bottom: 30, containLabel: true, // 是否包含坐标轴的刻度标签 } @@ -243,10 +243,6 @@ type: Boolean, default: true, }, - isAutomaticCarousel: { // 图表是否自动轮播 - type: Boolean, - default: false, - }, tooltipTextColor: { type: String, default: '#737373', @@ -255,6 +251,11 @@ type: String, default: '#fff', }, + /** x轴标签倾斜 */ + rotate: { + type: Number, + default: 45, + }, }) // 图表对象 @@ -350,23 +351,13 @@ axisLabel: { color: props.fontColor, fontSize: 11, - rotate: 45, + rotate: props.rotate, }, splitLine: { show: false, }, }, ], - dataZoom: [ - // 滑动条 - { - xAxisIndex: 0, // 这里是从X轴的0刻度开始 - show: false, // 是否显示滑动条,不影响使用 - type: 'inside', // 这个 dataZoom 组件是 slider 型 dataZoom 组件 - startValue: 0, // 开始位置。 - endValue: 1, // 一次性展示几个。(如果startValue设定为0,那么页面展示数就是endValue+1,比如此例页面展示2个) - }, - ], series: [] as barSeriesOption[], } // 标题 @@ -487,9 +478,6 @@ function initChart() { chart = init(chartRef.value as HTMLElement, tdTheme) const option = buildOption() - // if (props.isAutomaticCarousel) { - // automaticCarousel(option, chart, 3000, 3) - // } chart.setOption({}) nextTick(() => { chart.resize() @@ -500,9 +488,6 @@ function refreshChart() { if (chart) { const option = buildOption() - if (props.isAutomaticCarousel) { - automaticCarousel(option, chart, 3000, 2) - } chart.setOption(option as unknown as ECBasicOption, true) } } diff --git a/src/components/Echart/BarChartVerticalDynamics.vue b/src/components/Echart/BarChartVerticalDynamics.vue new file mode 100644 index 0000000..2ba92d2 --- /dev/null +++ b/src/components/Echart/BarChartVerticalDynamics.vue @@ -0,0 +1,531 @@ + + + + + diff --git a/public/player/player.html b/public/player/player.html index 81f4f25..3e4d55c 100644 --- a/public/player/player.html +++ b/public/player/player.html @@ -39,7 +39,7 @@ function create() { jessibuca = new Jessibuca({ container: $container, // 播放器容器 若为 string ,则底层调用的是 document.getElementById('id') - videoBuffer: 0.2, // 设置最大缓冲时长,单位秒,播放器会自动消除延迟 + videoBuffer: 3, // 设置最大缓冲时长,单位秒,播放器会自动消除延迟 isResize: true, // 1. 当为`true`的时候:视频画面做等比缩放后,高或宽对齐canvas区域,画面不被拉伸,但有黑边。 等同于 `setScaleMode(1)` 2. 当为`false`的时候:视频画面完全填充canvas区域,画面会被拉伸。等同于 `setScaleMode(0)` loadingText: '视频加载中', // 加载过程中文案 useMSE: false, // 是否开启MediaSource硬解码 视频编码只支持H.264视频(Safari on iOS不支持)不支持 forceNoOffscreen 为 false (开启离屏渲染) diff --git a/src/api/alarm/dangerAssessment/statistics.ts b/src/api/alarm/dangerAssessment/statistics.ts new file mode 100644 index 0000000..2bdedcf --- /dev/null +++ b/src/api/alarm/dangerAssessment/statistics.ts @@ -0,0 +1,44 @@ +/** + * 安全生产隐患评估 + */ +import request from '../../index' + +// 单位近一个月报警分析 +export function getDeptAlarmRecord() { + return request({ + url: 'statistics/dept/record', + method: 'get', + }) +} + +// 单位报警时间曲线 +export function getDeptAlarmDate() { + return request({ + url: 'statistics/dept/alarm/date', + method: 'get', + }) +} + +// 隐患分类 +export function getDangerCategory() { + return request({ + url: 'statistics/dangerCategory', + method: 'get', + }) +} + +// 区域隐患分类 +export function getAreaDanger() { + return request({ + url: 'statistics/areaDanger', + method: 'get', + }) +} + +// 单位安全隐患分类 +export function getDeptDanger() { + return request({ + url: 'statistics/deptDanger', + method: 'get', + }) +} diff --git a/src/components.d.ts b/src/components.d.ts index 965339c..0d54fa5 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -20,6 +20,7 @@ AuthAll: typeof import('./components/AuthAll/index.vue')['default'] BarChartHorizontal: typeof import('./components/Echart/BarChartHorizontal.vue')['default'] BarChartVertical: typeof import('./components/Echart/BarChartVertical.vue')['default'] + BarChartVerticalDynamics: typeof import('./components/Echart/BarChartVerticalDynamics.vue')['default'] BarCodeBind: typeof import('./components/BarCodeBind/index.vue')['default'] BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default'] BenchCol: typeof import('./components/benchCol/index.vue')['default'] @@ -27,6 +28,7 @@ CertificationMonitor: typeof import('./components/Sample/certificationMonitor.vue')['default'] CertificationRecords: typeof import('./components/Sample/certificationRecords.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] + copy: typeof import('./components/Echart/LineChart copy.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] @@ -43,6 +45,7 @@ ImagesUpload: typeof import('./components/ImagesUpload/index.vue')['default'] ImageUpload: typeof import('./components/ImageUpload/index.vue')['default'] LineChart: typeof import('./components/Echart/LineChart.vue')['default'] + LineChartDynamics: typeof import('./components/Echart/LineChartDynamics.vue')['default'] MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default'] NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] diff --git a/src/components/Echart/BarChartVertical.vue b/src/components/Echart/BarChartVertical.vue index b42624a..d1414f0 100644 --- a/src/components/Echart/BarChartVertical.vue +++ b/src/components/Echart/BarChartVertical.vue @@ -46,7 +46,7 @@ return { top: 30, left: 20, - right: 20, + right: 30, bottom: 30, containLabel: true, // 是否包含坐标轴的刻度标签 } @@ -243,10 +243,6 @@ type: Boolean, default: true, }, - isAutomaticCarousel: { // 图表是否自动轮播 - type: Boolean, - default: false, - }, tooltipTextColor: { type: String, default: '#737373', @@ -255,6 +251,11 @@ type: String, default: '#fff', }, + /** x轴标签倾斜 */ + rotate: { + type: Number, + default: 45, + }, }) // 图表对象 @@ -350,23 +351,13 @@ axisLabel: { color: props.fontColor, fontSize: 11, - rotate: 45, + rotate: props.rotate, }, splitLine: { show: false, }, }, ], - dataZoom: [ - // 滑动条 - { - xAxisIndex: 0, // 这里是从X轴的0刻度开始 - show: false, // 是否显示滑动条,不影响使用 - type: 'inside', // 这个 dataZoom 组件是 slider 型 dataZoom 组件 - startValue: 0, // 开始位置。 - endValue: 1, // 一次性展示几个。(如果startValue设定为0,那么页面展示数就是endValue+1,比如此例页面展示2个) - }, - ], series: [] as barSeriesOption[], } // 标题 @@ -487,9 +478,6 @@ function initChart() { chart = init(chartRef.value as HTMLElement, tdTheme) const option = buildOption() - // if (props.isAutomaticCarousel) { - // automaticCarousel(option, chart, 3000, 3) - // } chart.setOption({}) nextTick(() => { chart.resize() @@ -500,9 +488,6 @@ function refreshChart() { if (chart) { const option = buildOption() - if (props.isAutomaticCarousel) { - automaticCarousel(option, chart, 3000, 2) - } chart.setOption(option as unknown as ECBasicOption, true) } } diff --git a/src/components/Echart/BarChartVerticalDynamics.vue b/src/components/Echart/BarChartVerticalDynamics.vue new file mode 100644 index 0000000..2ba92d2 --- /dev/null +++ b/src/components/Echart/BarChartVerticalDynamics.vue @@ -0,0 +1,531 @@ + + + + + diff --git a/src/components/Echart/LineChart.vue b/src/components/Echart/LineChart.vue index 4213084..72666b2 100644 --- a/src/components/Echart/LineChart.vue +++ b/src/components/Echart/LineChart.vue @@ -39,7 +39,7 @@ return { top: 30, left: 10, - right: 20, + right: 30, bottom: 10, containLabel: true, // 是否包含坐标轴的刻度标签 } @@ -187,10 +187,6 @@ type: Boolean, default: true, }, - isAutomaticCarousel: { // 图表是否自动轮播 - type: Boolean, - default: false, - }, tooltipTextColor: { type: String, default: '#737373', @@ -290,16 +286,6 @@ }, }, ], - dataZoom: [ - // 滑动条 - { - xAxisIndex: 0, // 这里是从X轴的0刻度开始 - show: false, // 是否显示滑动条,不影响使用 - type: 'inside', // 这个 dataZoom 组件是 slider 型 dataZoom 组件 - startValue: 0, // 开始位置。 - endValue: 1, // 一次性展示几个。(如果startValue设定为0,那么页面展示数就是endValue+1,比如此例页面展示2个) - }, - ], series: [] as lineSeriesOption[], } // 标题 @@ -378,9 +364,6 @@ function initChart() { chart = init(chartRef.value as HTMLElement, tdTheme) const option = buildOption() - // if (props.isAutomaticCarousel) { - // automaticCarousel(option, chart, 3000, 6) - // } chart.setOption({}) chart.resize() } @@ -390,9 +373,6 @@ if (chart) { console.log('渲染折线图') const option = buildOption() - if (props.isAutomaticCarousel) { - automaticCarousel(option, chart, 3000, 3) - } chart.setOption(option as unknown as ECBasicOption, true) chart.resize() } diff --git a/public/player/player.html b/public/player/player.html index 81f4f25..3e4d55c 100644 --- a/public/player/player.html +++ b/public/player/player.html @@ -39,7 +39,7 @@ function create() { jessibuca = new Jessibuca({ container: $container, // 播放器容器 若为 string ,则底层调用的是 document.getElementById('id') - videoBuffer: 0.2, // 设置最大缓冲时长,单位秒,播放器会自动消除延迟 + videoBuffer: 3, // 设置最大缓冲时长,单位秒,播放器会自动消除延迟 isResize: true, // 1. 当为`true`的时候:视频画面做等比缩放后,高或宽对齐canvas区域,画面不被拉伸,但有黑边。 等同于 `setScaleMode(1)` 2. 当为`false`的时候:视频画面完全填充canvas区域,画面会被拉伸。等同于 `setScaleMode(0)` loadingText: '视频加载中', // 加载过程中文案 useMSE: false, // 是否开启MediaSource硬解码 视频编码只支持H.264视频(Safari on iOS不支持)不支持 forceNoOffscreen 为 false (开启离屏渲染) diff --git a/src/api/alarm/dangerAssessment/statistics.ts b/src/api/alarm/dangerAssessment/statistics.ts new file mode 100644 index 0000000..2bdedcf --- /dev/null +++ b/src/api/alarm/dangerAssessment/statistics.ts @@ -0,0 +1,44 @@ +/** + * 安全生产隐患评估 + */ +import request from '../../index' + +// 单位近一个月报警分析 +export function getDeptAlarmRecord() { + return request({ + url: 'statistics/dept/record', + method: 'get', + }) +} + +// 单位报警时间曲线 +export function getDeptAlarmDate() { + return request({ + url: 'statistics/dept/alarm/date', + method: 'get', + }) +} + +// 隐患分类 +export function getDangerCategory() { + return request({ + url: 'statistics/dangerCategory', + method: 'get', + }) +} + +// 区域隐患分类 +export function getAreaDanger() { + return request({ + url: 'statistics/areaDanger', + method: 'get', + }) +} + +// 单位安全隐患分类 +export function getDeptDanger() { + return request({ + url: 'statistics/deptDanger', + method: 'get', + }) +} diff --git a/src/components.d.ts b/src/components.d.ts index 965339c..0d54fa5 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -20,6 +20,7 @@ AuthAll: typeof import('./components/AuthAll/index.vue')['default'] BarChartHorizontal: typeof import('./components/Echart/BarChartHorizontal.vue')['default'] BarChartVertical: typeof import('./components/Echart/BarChartVertical.vue')['default'] + BarChartVerticalDynamics: typeof import('./components/Echart/BarChartVerticalDynamics.vue')['default'] BarCodeBind: typeof import('./components/BarCodeBind/index.vue')['default'] BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default'] BenchCol: typeof import('./components/benchCol/index.vue')['default'] @@ -27,6 +28,7 @@ CertificationMonitor: typeof import('./components/Sample/certificationMonitor.vue')['default'] CertificationRecords: typeof import('./components/Sample/certificationRecords.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] + copy: typeof import('./components/Echart/LineChart copy.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] @@ -43,6 +45,7 @@ ImagesUpload: typeof import('./components/ImagesUpload/index.vue')['default'] ImageUpload: typeof import('./components/ImageUpload/index.vue')['default'] LineChart: typeof import('./components/Echart/LineChart.vue')['default'] + LineChartDynamics: typeof import('./components/Echart/LineChartDynamics.vue')['default'] MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default'] NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] diff --git a/src/components/Echart/BarChartVertical.vue b/src/components/Echart/BarChartVertical.vue index b42624a..d1414f0 100644 --- a/src/components/Echart/BarChartVertical.vue +++ b/src/components/Echart/BarChartVertical.vue @@ -46,7 +46,7 @@ return { top: 30, left: 20, - right: 20, + right: 30, bottom: 30, containLabel: true, // 是否包含坐标轴的刻度标签 } @@ -243,10 +243,6 @@ type: Boolean, default: true, }, - isAutomaticCarousel: { // 图表是否自动轮播 - type: Boolean, - default: false, - }, tooltipTextColor: { type: String, default: '#737373', @@ -255,6 +251,11 @@ type: String, default: '#fff', }, + /** x轴标签倾斜 */ + rotate: { + type: Number, + default: 45, + }, }) // 图表对象 @@ -350,23 +351,13 @@ axisLabel: { color: props.fontColor, fontSize: 11, - rotate: 45, + rotate: props.rotate, }, splitLine: { show: false, }, }, ], - dataZoom: [ - // 滑动条 - { - xAxisIndex: 0, // 这里是从X轴的0刻度开始 - show: false, // 是否显示滑动条,不影响使用 - type: 'inside', // 这个 dataZoom 组件是 slider 型 dataZoom 组件 - startValue: 0, // 开始位置。 - endValue: 1, // 一次性展示几个。(如果startValue设定为0,那么页面展示数就是endValue+1,比如此例页面展示2个) - }, - ], series: [] as barSeriesOption[], } // 标题 @@ -487,9 +478,6 @@ function initChart() { chart = init(chartRef.value as HTMLElement, tdTheme) const option = buildOption() - // if (props.isAutomaticCarousel) { - // automaticCarousel(option, chart, 3000, 3) - // } chart.setOption({}) nextTick(() => { chart.resize() @@ -500,9 +488,6 @@ function refreshChart() { if (chart) { const option = buildOption() - if (props.isAutomaticCarousel) { - automaticCarousel(option, chart, 3000, 2) - } chart.setOption(option as unknown as ECBasicOption, true) } } diff --git a/src/components/Echart/BarChartVerticalDynamics.vue b/src/components/Echart/BarChartVerticalDynamics.vue new file mode 100644 index 0000000..2ba92d2 --- /dev/null +++ b/src/components/Echart/BarChartVerticalDynamics.vue @@ -0,0 +1,531 @@ + + + + + diff --git a/src/components/Echart/LineChart.vue b/src/components/Echart/LineChart.vue index 4213084..72666b2 100644 --- a/src/components/Echart/LineChart.vue +++ b/src/components/Echart/LineChart.vue @@ -39,7 +39,7 @@ return { top: 30, left: 10, - right: 20, + right: 30, bottom: 10, containLabel: true, // 是否包含坐标轴的刻度标签 } @@ -187,10 +187,6 @@ type: Boolean, default: true, }, - isAutomaticCarousel: { // 图表是否自动轮播 - type: Boolean, - default: false, - }, tooltipTextColor: { type: String, default: '#737373', @@ -290,16 +286,6 @@ }, }, ], - dataZoom: [ - // 滑动条 - { - xAxisIndex: 0, // 这里是从X轴的0刻度开始 - show: false, // 是否显示滑动条,不影响使用 - type: 'inside', // 这个 dataZoom 组件是 slider 型 dataZoom 组件 - startValue: 0, // 开始位置。 - endValue: 1, // 一次性展示几个。(如果startValue设定为0,那么页面展示数就是endValue+1,比如此例页面展示2个) - }, - ], series: [] as lineSeriesOption[], } // 标题 @@ -378,9 +364,6 @@ function initChart() { chart = init(chartRef.value as HTMLElement, tdTheme) const option = buildOption() - // if (props.isAutomaticCarousel) { - // automaticCarousel(option, chart, 3000, 6) - // } chart.setOption({}) chart.resize() } @@ -390,9 +373,6 @@ if (chart) { console.log('渲染折线图') const option = buildOption() - if (props.isAutomaticCarousel) { - automaticCarousel(option, chart, 3000, 3) - } chart.setOption(option as unknown as ECBasicOption, true) chart.resize() } diff --git a/src/components/Echart/LineChartDynamics.vue b/src/components/Echart/LineChartDynamics.vue new file mode 100644 index 0000000..2a2f063 --- /dev/null +++ b/src/components/Echart/LineChartDynamics.vue @@ -0,0 +1,420 @@ + + + + + diff --git a/public/player/player.html b/public/player/player.html index 81f4f25..3e4d55c 100644 --- a/public/player/player.html +++ b/public/player/player.html @@ -39,7 +39,7 @@ function create() { jessibuca = new Jessibuca({ container: $container, // 播放器容器 若为 string ,则底层调用的是 document.getElementById('id') - videoBuffer: 0.2, // 设置最大缓冲时长,单位秒,播放器会自动消除延迟 + videoBuffer: 3, // 设置最大缓冲时长,单位秒,播放器会自动消除延迟 isResize: true, // 1. 当为`true`的时候:视频画面做等比缩放后,高或宽对齐canvas区域,画面不被拉伸,但有黑边。 等同于 `setScaleMode(1)` 2. 当为`false`的时候:视频画面完全填充canvas区域,画面会被拉伸。等同于 `setScaleMode(0)` loadingText: '视频加载中', // 加载过程中文案 useMSE: false, // 是否开启MediaSource硬解码 视频编码只支持H.264视频(Safari on iOS不支持)不支持 forceNoOffscreen 为 false (开启离屏渲染) diff --git a/src/api/alarm/dangerAssessment/statistics.ts b/src/api/alarm/dangerAssessment/statistics.ts new file mode 100644 index 0000000..2bdedcf --- /dev/null +++ b/src/api/alarm/dangerAssessment/statistics.ts @@ -0,0 +1,44 @@ +/** + * 安全生产隐患评估 + */ +import request from '../../index' + +// 单位近一个月报警分析 +export function getDeptAlarmRecord() { + return request({ + url: 'statistics/dept/record', + method: 'get', + }) +} + +// 单位报警时间曲线 +export function getDeptAlarmDate() { + return request({ + url: 'statistics/dept/alarm/date', + method: 'get', + }) +} + +// 隐患分类 +export function getDangerCategory() { + return request({ + url: 'statistics/dangerCategory', + method: 'get', + }) +} + +// 区域隐患分类 +export function getAreaDanger() { + return request({ + url: 'statistics/areaDanger', + method: 'get', + }) +} + +// 单位安全隐患分类 +export function getDeptDanger() { + return request({ + url: 'statistics/deptDanger', + method: 'get', + }) +} diff --git a/src/components.d.ts b/src/components.d.ts index 965339c..0d54fa5 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -20,6 +20,7 @@ AuthAll: typeof import('./components/AuthAll/index.vue')['default'] BarChartHorizontal: typeof import('./components/Echart/BarChartHorizontal.vue')['default'] BarChartVertical: typeof import('./components/Echart/BarChartVertical.vue')['default'] + BarChartVerticalDynamics: typeof import('./components/Echart/BarChartVerticalDynamics.vue')['default'] BarCodeBind: typeof import('./components/BarCodeBind/index.vue')['default'] BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default'] BenchCol: typeof import('./components/benchCol/index.vue')['default'] @@ -27,6 +28,7 @@ CertificationMonitor: typeof import('./components/Sample/certificationMonitor.vue')['default'] CertificationRecords: typeof import('./components/Sample/certificationRecords.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] + copy: typeof import('./components/Echart/LineChart copy.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] @@ -43,6 +45,7 @@ ImagesUpload: typeof import('./components/ImagesUpload/index.vue')['default'] ImageUpload: typeof import('./components/ImageUpload/index.vue')['default'] LineChart: typeof import('./components/Echart/LineChart.vue')['default'] + LineChartDynamics: typeof import('./components/Echart/LineChartDynamics.vue')['default'] MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default'] NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] diff --git a/src/components/Echart/BarChartVertical.vue b/src/components/Echart/BarChartVertical.vue index b42624a..d1414f0 100644 --- a/src/components/Echart/BarChartVertical.vue +++ b/src/components/Echart/BarChartVertical.vue @@ -46,7 +46,7 @@ return { top: 30, left: 20, - right: 20, + right: 30, bottom: 30, containLabel: true, // 是否包含坐标轴的刻度标签 } @@ -243,10 +243,6 @@ type: Boolean, default: true, }, - isAutomaticCarousel: { // 图表是否自动轮播 - type: Boolean, - default: false, - }, tooltipTextColor: { type: String, default: '#737373', @@ -255,6 +251,11 @@ type: String, default: '#fff', }, + /** x轴标签倾斜 */ + rotate: { + type: Number, + default: 45, + }, }) // 图表对象 @@ -350,23 +351,13 @@ axisLabel: { color: props.fontColor, fontSize: 11, - rotate: 45, + rotate: props.rotate, }, splitLine: { show: false, }, }, ], - dataZoom: [ - // 滑动条 - { - xAxisIndex: 0, // 这里是从X轴的0刻度开始 - show: false, // 是否显示滑动条,不影响使用 - type: 'inside', // 这个 dataZoom 组件是 slider 型 dataZoom 组件 - startValue: 0, // 开始位置。 - endValue: 1, // 一次性展示几个。(如果startValue设定为0,那么页面展示数就是endValue+1,比如此例页面展示2个) - }, - ], series: [] as barSeriesOption[], } // 标题 @@ -487,9 +478,6 @@ function initChart() { chart = init(chartRef.value as HTMLElement, tdTheme) const option = buildOption() - // if (props.isAutomaticCarousel) { - // automaticCarousel(option, chart, 3000, 3) - // } chart.setOption({}) nextTick(() => { chart.resize() @@ -500,9 +488,6 @@ function refreshChart() { if (chart) { const option = buildOption() - if (props.isAutomaticCarousel) { - automaticCarousel(option, chart, 3000, 2) - } chart.setOption(option as unknown as ECBasicOption, true) } } diff --git a/src/components/Echart/BarChartVerticalDynamics.vue b/src/components/Echart/BarChartVerticalDynamics.vue new file mode 100644 index 0000000..2ba92d2 --- /dev/null +++ b/src/components/Echart/BarChartVerticalDynamics.vue @@ -0,0 +1,531 @@ + + + + + diff --git a/src/components/Echart/LineChart.vue b/src/components/Echart/LineChart.vue index 4213084..72666b2 100644 --- a/src/components/Echart/LineChart.vue +++ b/src/components/Echart/LineChart.vue @@ -39,7 +39,7 @@ return { top: 30, left: 10, - right: 20, + right: 30, bottom: 10, containLabel: true, // 是否包含坐标轴的刻度标签 } @@ -187,10 +187,6 @@ type: Boolean, default: true, }, - isAutomaticCarousel: { // 图表是否自动轮播 - type: Boolean, - default: false, - }, tooltipTextColor: { type: String, default: '#737373', @@ -290,16 +286,6 @@ }, }, ], - dataZoom: [ - // 滑动条 - { - xAxisIndex: 0, // 这里是从X轴的0刻度开始 - show: false, // 是否显示滑动条,不影响使用 - type: 'inside', // 这个 dataZoom 组件是 slider 型 dataZoom 组件 - startValue: 0, // 开始位置。 - endValue: 1, // 一次性展示几个。(如果startValue设定为0,那么页面展示数就是endValue+1,比如此例页面展示2个) - }, - ], series: [] as lineSeriesOption[], } // 标题 @@ -378,9 +364,6 @@ function initChart() { chart = init(chartRef.value as HTMLElement, tdTheme) const option = buildOption() - // if (props.isAutomaticCarousel) { - // automaticCarousel(option, chart, 3000, 6) - // } chart.setOption({}) chart.resize() } @@ -390,9 +373,6 @@ if (chart) { console.log('渲染折线图') const option = buildOption() - if (props.isAutomaticCarousel) { - automaticCarousel(option, chart, 3000, 3) - } chart.setOption(option as unknown as ECBasicOption, true) chart.resize() } diff --git a/src/components/Echart/LineChartDynamics.vue b/src/components/Echart/LineChartDynamics.vue new file mode 100644 index 0000000..2a2f063 --- /dev/null +++ b/src/components/Echart/LineChartDynamics.vue @@ -0,0 +1,420 @@ + + + + + diff --git a/src/utils/Array.ts b/src/utils/Array.ts new file mode 100644 index 0000000..8c73e19 --- /dev/null +++ b/src/utils/Array.ts @@ -0,0 +1,63 @@ +import _ from 'lodash' +// 常见数组操作 + +// 两个数组求交集 +export const intersectionArray = (list1: any[], list2: any[]) => { + return list1.filter(v => list2.includes(v)) +} +// 差集 -- 常用于 表格中多选删除 +export const differenceArray = (list1: any[], list2: any[]) => { + return list1.filter(v => !list2.includes(v)) +} +// 补集 +export const complementaryArray = (list1: any[], list2: any[]) => { + return list1.filter((v) => { return !(list2.includes(v)) }) + .concat(list2.filter((v) => { return !(list1.includes(v)) })) +} +// 并集 +export const unionArray = (list1: any[], list2: any[]) => { + return list1.concat(list2.filter((v) => { return !(list1.includes(v)) })) +} +// 一维数组去重 +export const uniqueArray = (list: any) => { + return [...new Set(list)] +} +// 二维数组根据 某一属性 去重 +export const uniqueMultiArray = (list: any, attribute: string) => { + const res = new Map() + return list.filter((a: any) => !res.has(a[attribute]) && res.set(a[attribute], 1)) +} +// 一维数组或对象拷贝 +export const cloneArray = (data: any) => { + return JSON.parse(JSON.stringify(data)) +} +// 多维数组或对象深拷贝 +export const deepClone = (data: any) => { + return _.cloneDeep(data) +} +// 数组操作-下拉框操作(已经选择的数据不能再选) +/** + * @param list 下拉框初始数据(所有) + * @param list1 已经选择的数据 + * @param current 当前数据 可为空 + * @param attribute 属性(即绑定在 list1哪个属性上) + */ +export const setSelectList = (list: any[], list1: any[], current: string, attribute: string, attribute2 = 'value') => { + const select = [...new Set(list1.map((item: any) => item[attribute]))].filter((item: string) => item !== current) + return list.filter((item) => { return !select.includes(item[attribute2]) }) +} +// 几个数组的交集 +export function intersectionManyArray(...arrays) { + console.log(...arrays, '1111111111') + // 获取第一个数组作为初始交集 + let intersection = arrays.shift() + + // 遍历剩余的数组 + while (arrays.length) { + // 过滤当前交集,只保留那些也在当前数组中的元素 + intersection = intersection.filter(item => arrays[0].includes(item)) + // 移动到下一个数组 + arrays.shift() + } + return intersection +} diff --git a/public/player/player.html b/public/player/player.html index 81f4f25..3e4d55c 100644 --- a/public/player/player.html +++ b/public/player/player.html @@ -39,7 +39,7 @@ function create() { jessibuca = new Jessibuca({ container: $container, // 播放器容器 若为 string ,则底层调用的是 document.getElementById('id') - videoBuffer: 0.2, // 设置最大缓冲时长,单位秒,播放器会自动消除延迟 + videoBuffer: 3, // 设置最大缓冲时长,单位秒,播放器会自动消除延迟 isResize: true, // 1. 当为`true`的时候:视频画面做等比缩放后,高或宽对齐canvas区域,画面不被拉伸,但有黑边。 等同于 `setScaleMode(1)` 2. 当为`false`的时候:视频画面完全填充canvas区域,画面会被拉伸。等同于 `setScaleMode(0)` loadingText: '视频加载中', // 加载过程中文案 useMSE: false, // 是否开启MediaSource硬解码 视频编码只支持H.264视频(Safari on iOS不支持)不支持 forceNoOffscreen 为 false (开启离屏渲染) diff --git a/src/api/alarm/dangerAssessment/statistics.ts b/src/api/alarm/dangerAssessment/statistics.ts new file mode 100644 index 0000000..2bdedcf --- /dev/null +++ b/src/api/alarm/dangerAssessment/statistics.ts @@ -0,0 +1,44 @@ +/** + * 安全生产隐患评估 + */ +import request from '../../index' + +// 单位近一个月报警分析 +export function getDeptAlarmRecord() { + return request({ + url: 'statistics/dept/record', + method: 'get', + }) +} + +// 单位报警时间曲线 +export function getDeptAlarmDate() { + return request({ + url: 'statistics/dept/alarm/date', + method: 'get', + }) +} + +// 隐患分类 +export function getDangerCategory() { + return request({ + url: 'statistics/dangerCategory', + method: 'get', + }) +} + +// 区域隐患分类 +export function getAreaDanger() { + return request({ + url: 'statistics/areaDanger', + method: 'get', + }) +} + +// 单位安全隐患分类 +export function getDeptDanger() { + return request({ + url: 'statistics/deptDanger', + method: 'get', + }) +} diff --git a/src/components.d.ts b/src/components.d.ts index 965339c..0d54fa5 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -20,6 +20,7 @@ AuthAll: typeof import('./components/AuthAll/index.vue')['default'] BarChartHorizontal: typeof import('./components/Echart/BarChartHorizontal.vue')['default'] BarChartVertical: typeof import('./components/Echart/BarChartVertical.vue')['default'] + BarChartVerticalDynamics: typeof import('./components/Echart/BarChartVerticalDynamics.vue')['default'] BarCodeBind: typeof import('./components/BarCodeBind/index.vue')['default'] BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default'] BenchCol: typeof import('./components/benchCol/index.vue')['default'] @@ -27,6 +28,7 @@ CertificationMonitor: typeof import('./components/Sample/certificationMonitor.vue')['default'] CertificationRecords: typeof import('./components/Sample/certificationRecords.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] + copy: typeof import('./components/Echart/LineChart copy.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] Copyright: typeof import('./components/Copyright/index.vue')['default'] DeptSelect: typeof import('./components/DeptSelect/index.vue')['default'] @@ -43,6 +45,7 @@ ImagesUpload: typeof import('./components/ImagesUpload/index.vue')['default'] ImageUpload: typeof import('./components/ImageUpload/index.vue')['default'] LineChart: typeof import('./components/Echart/LineChart.vue')['default'] + LineChartDynamics: typeof import('./components/Echart/LineChartDynamics.vue')['default'] MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default'] NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default'] NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default'] diff --git a/src/components/Echart/BarChartVertical.vue b/src/components/Echart/BarChartVertical.vue index b42624a..d1414f0 100644 --- a/src/components/Echart/BarChartVertical.vue +++ b/src/components/Echart/BarChartVertical.vue @@ -46,7 +46,7 @@ return { top: 30, left: 20, - right: 20, + right: 30, bottom: 30, containLabel: true, // 是否包含坐标轴的刻度标签 } @@ -243,10 +243,6 @@ type: Boolean, default: true, }, - isAutomaticCarousel: { // 图表是否自动轮播 - type: Boolean, - default: false, - }, tooltipTextColor: { type: String, default: '#737373', @@ -255,6 +251,11 @@ type: String, default: '#fff', }, + /** x轴标签倾斜 */ + rotate: { + type: Number, + default: 45, + }, }) // 图表对象 @@ -350,23 +351,13 @@ axisLabel: { color: props.fontColor, fontSize: 11, - rotate: 45, + rotate: props.rotate, }, splitLine: { show: false, }, }, ], - dataZoom: [ - // 滑动条 - { - xAxisIndex: 0, // 这里是从X轴的0刻度开始 - show: false, // 是否显示滑动条,不影响使用 - type: 'inside', // 这个 dataZoom 组件是 slider 型 dataZoom 组件 - startValue: 0, // 开始位置。 - endValue: 1, // 一次性展示几个。(如果startValue设定为0,那么页面展示数就是endValue+1,比如此例页面展示2个) - }, - ], series: [] as barSeriesOption[], } // 标题 @@ -487,9 +478,6 @@ function initChart() { chart = init(chartRef.value as HTMLElement, tdTheme) const option = buildOption() - // if (props.isAutomaticCarousel) { - // automaticCarousel(option, chart, 3000, 3) - // } chart.setOption({}) nextTick(() => { chart.resize() @@ -500,9 +488,6 @@ function refreshChart() { if (chart) { const option = buildOption() - if (props.isAutomaticCarousel) { - automaticCarousel(option, chart, 3000, 2) - } chart.setOption(option as unknown as ECBasicOption, true) } } diff --git a/src/components/Echart/BarChartVerticalDynamics.vue b/src/components/Echart/BarChartVerticalDynamics.vue new file mode 100644 index 0000000..2ba92d2 --- /dev/null +++ b/src/components/Echart/BarChartVerticalDynamics.vue @@ -0,0 +1,531 @@ + + + + + diff --git a/src/components/Echart/LineChart.vue b/src/components/Echart/LineChart.vue index 4213084..72666b2 100644 --- a/src/components/Echart/LineChart.vue +++ b/src/components/Echart/LineChart.vue @@ -39,7 +39,7 @@ return { top: 30, left: 10, - right: 20, + right: 30, bottom: 10, containLabel: true, // 是否包含坐标轴的刻度标签 } @@ -187,10 +187,6 @@ type: Boolean, default: true, }, - isAutomaticCarousel: { // 图表是否自动轮播 - type: Boolean, - default: false, - }, tooltipTextColor: { type: String, default: '#737373', @@ -290,16 +286,6 @@ }, }, ], - dataZoom: [ - // 滑动条 - { - xAxisIndex: 0, // 这里是从X轴的0刻度开始 - show: false, // 是否显示滑动条,不影响使用 - type: 'inside', // 这个 dataZoom 组件是 slider 型 dataZoom 组件 - startValue: 0, // 开始位置。 - endValue: 1, // 一次性展示几个。(如果startValue设定为0,那么页面展示数就是endValue+1,比如此例页面展示2个) - }, - ], series: [] as lineSeriesOption[], } // 标题 @@ -378,9 +364,6 @@ function initChart() { chart = init(chartRef.value as HTMLElement, tdTheme) const option = buildOption() - // if (props.isAutomaticCarousel) { - // automaticCarousel(option, chart, 3000, 6) - // } chart.setOption({}) chart.resize() } @@ -390,9 +373,6 @@ if (chart) { console.log('渲染折线图') const option = buildOption() - if (props.isAutomaticCarousel) { - automaticCarousel(option, chart, 3000, 3) - } chart.setOption(option as unknown as ECBasicOption, true) chart.resize() } diff --git a/src/components/Echart/LineChartDynamics.vue b/src/components/Echart/LineChartDynamics.vue new file mode 100644 index 0000000..2a2f063 --- /dev/null +++ b/src/components/Echart/LineChartDynamics.vue @@ -0,0 +1,420 @@ + + + + + diff --git a/src/utils/Array.ts b/src/utils/Array.ts new file mode 100644 index 0000000..8c73e19 --- /dev/null +++ b/src/utils/Array.ts @@ -0,0 +1,63 @@ +import _ from 'lodash' +// 常见数组操作 + +// 两个数组求交集 +export const intersectionArray = (list1: any[], list2: any[]) => { + return list1.filter(v => list2.includes(v)) +} +// 差集 -- 常用于 表格中多选删除 +export const differenceArray = (list1: any[], list2: any[]) => { + return list1.filter(v => !list2.includes(v)) +} +// 补集 +export const complementaryArray = (list1: any[], list2: any[]) => { + return list1.filter((v) => { return !(list2.includes(v)) }) + .concat(list2.filter((v) => { return !(list1.includes(v)) })) +} +// 并集 +export const unionArray = (list1: any[], list2: any[]) => { + return list1.concat(list2.filter((v) => { return !(list1.includes(v)) })) +} +// 一维数组去重 +export const uniqueArray = (list: any) => { + return [...new Set(list)] +} +// 二维数组根据 某一属性 去重 +export const uniqueMultiArray = (list: any, attribute: string) => { + const res = new Map() + return list.filter((a: any) => !res.has(a[attribute]) && res.set(a[attribute], 1)) +} +// 一维数组或对象拷贝 +export const cloneArray = (data: any) => { + return JSON.parse(JSON.stringify(data)) +} +// 多维数组或对象深拷贝 +export const deepClone = (data: any) => { + return _.cloneDeep(data) +} +// 数组操作-下拉框操作(已经选择的数据不能再选) +/** + * @param list 下拉框初始数据(所有) + * @param list1 已经选择的数据 + * @param current 当前数据 可为空 + * @param attribute 属性(即绑定在 list1哪个属性上) + */ +export const setSelectList = (list: any[], list1: any[], current: string, attribute: string, attribute2 = 'value') => { + const select = [...new Set(list1.map((item: any) => item[attribute]))].filter((item: string) => item !== current) + return list.filter((item) => { return !select.includes(item[attribute2]) }) +} +// 几个数组的交集 +export function intersectionManyArray(...arrays) { + console.log(...arrays, '1111111111') + // 获取第一个数组作为初始交集 + let intersection = arrays.shift() + + // 遍历剩余的数组 + while (arrays.length) { + // 过滤当前交集,只保留那些也在当前数组中的元素 + intersection = intersection.filter(item => arrays[0].includes(item)) + // 移动到下一个数组 + arrays.shift() + } + return intersection +} diff --git a/src/views/alarm/dangerAssessment/assessment/list.vue b/src/views/alarm/dangerAssessment/assessment/list.vue index fca5e5a..f0b5f8b 100644 --- a/src/views/alarm/dangerAssessment/assessment/list.vue +++ b/src/views/alarm/dangerAssessment/assessment/list.vue @@ -1,9 +1,11 @@ + + + + + diff --git a/src/components/Echart/LineChart.vue b/src/components/Echart/LineChart.vue index 4213084..72666b2 100644 --- a/src/components/Echart/LineChart.vue +++ b/src/components/Echart/LineChart.vue @@ -39,7 +39,7 @@ return { top: 30, left: 10, - right: 20, + right: 30, bottom: 10, containLabel: true, // 是否包含坐标轴的刻度标签 } @@ -187,10 +187,6 @@ type: Boolean, default: true, }, - isAutomaticCarousel: { // 图表是否自动轮播 - type: Boolean, - default: false, - }, tooltipTextColor: { type: String, default: '#737373', @@ -290,16 +286,6 @@ }, }, ], - dataZoom: [ - // 滑动条 - { - xAxisIndex: 0, // 这里是从X轴的0刻度开始 - show: false, // 是否显示滑动条,不影响使用 - type: 'inside', // 这个 dataZoom 组件是 slider 型 dataZoom 组件 - startValue: 0, // 开始位置。 - endValue: 1, // 一次性展示几个。(如果startValue设定为0,那么页面展示数就是endValue+1,比如此例页面展示2个) - }, - ], series: [] as lineSeriesOption[], } // 标题 @@ -378,9 +364,6 @@ function initChart() { chart = init(chartRef.value as HTMLElement, tdTheme) const option = buildOption() - // if (props.isAutomaticCarousel) { - // automaticCarousel(option, chart, 3000, 6) - // } chart.setOption({}) chart.resize() } @@ -390,9 +373,6 @@ if (chart) { console.log('渲染折线图') const option = buildOption() - if (props.isAutomaticCarousel) { - automaticCarousel(option, chart, 3000, 3) - } chart.setOption(option as unknown as ECBasicOption, true) chart.resize() } diff --git a/src/components/Echart/LineChartDynamics.vue b/src/components/Echart/LineChartDynamics.vue new file mode 100644 index 0000000..2a2f063 --- /dev/null +++ b/src/components/Echart/LineChartDynamics.vue @@ -0,0 +1,420 @@ + + + + + diff --git a/src/utils/Array.ts b/src/utils/Array.ts new file mode 100644 index 0000000..8c73e19 --- /dev/null +++ b/src/utils/Array.ts @@ -0,0 +1,63 @@ +import _ from 'lodash' +// 常见数组操作 + +// 两个数组求交集 +export const intersectionArray = (list1: any[], list2: any[]) => { + return list1.filter(v => list2.includes(v)) +} +// 差集 -- 常用于 表格中多选删除 +export const differenceArray = (list1: any[], list2: any[]) => { + return list1.filter(v => !list2.includes(v)) +} +// 补集 +export const complementaryArray = (list1: any[], list2: any[]) => { + return list1.filter((v) => { return !(list2.includes(v)) }) + .concat(list2.filter((v) => { return !(list1.includes(v)) })) +} +// 并集 +export const unionArray = (list1: any[], list2: any[]) => { + return list1.concat(list2.filter((v) => { return !(list1.includes(v)) })) +} +// 一维数组去重 +export const uniqueArray = (list: any) => { + return [...new Set(list)] +} +// 二维数组根据 某一属性 去重 +export const uniqueMultiArray = (list: any, attribute: string) => { + const res = new Map() + return list.filter((a: any) => !res.has(a[attribute]) && res.set(a[attribute], 1)) +} +// 一维数组或对象拷贝 +export const cloneArray = (data: any) => { + return JSON.parse(JSON.stringify(data)) +} +// 多维数组或对象深拷贝 +export const deepClone = (data: any) => { + return _.cloneDeep(data) +} +// 数组操作-下拉框操作(已经选择的数据不能再选) +/** + * @param list 下拉框初始数据(所有) + * @param list1 已经选择的数据 + * @param current 当前数据 可为空 + * @param attribute 属性(即绑定在 list1哪个属性上) + */ +export const setSelectList = (list: any[], list1: any[], current: string, attribute: string, attribute2 = 'value') => { + const select = [...new Set(list1.map((item: any) => item[attribute]))].filter((item: string) => item !== current) + return list.filter((item) => { return !select.includes(item[attribute2]) }) +} +// 几个数组的交集 +export function intersectionManyArray(...arrays) { + console.log(...arrays, '1111111111') + // 获取第一个数组作为初始交集 + let intersection = arrays.shift() + + // 遍历剩余的数组 + while (arrays.length) { + // 过滤当前交集,只保留那些也在当前数组中的元素 + intersection = intersection.filter(item => arrays[0].includes(item)) + // 移动到下一个数组 + arrays.shift() + } + return intersection +} diff --git a/src/views/alarm/dangerAssessment/assessment/list.vue b/src/views/alarm/dangerAssessment/assessment/list.vue index fca5e5a..f0b5f8b 100644 --- a/src/views/alarm/dangerAssessment/assessment/list.vue +++ b/src/views/alarm/dangerAssessment/assessment/list.vue @@ -1,9 +1,11 @@ + + + + + diff --git a/src/components/Echart/LineChart.vue b/src/components/Echart/LineChart.vue index 4213084..72666b2 100644 --- a/src/components/Echart/LineChart.vue +++ b/src/components/Echart/LineChart.vue @@ -39,7 +39,7 @@ return { top: 30, left: 10, - right: 20, + right: 30, bottom: 10, containLabel: true, // 是否包含坐标轴的刻度标签 } @@ -187,10 +187,6 @@ type: Boolean, default: true, }, - isAutomaticCarousel: { // 图表是否自动轮播 - type: Boolean, - default: false, - }, tooltipTextColor: { type: String, default: '#737373', @@ -290,16 +286,6 @@ }, }, ], - dataZoom: [ - // 滑动条 - { - xAxisIndex: 0, // 这里是从X轴的0刻度开始 - show: false, // 是否显示滑动条,不影响使用 - type: 'inside', // 这个 dataZoom 组件是 slider 型 dataZoom 组件 - startValue: 0, // 开始位置。 - endValue: 1, // 一次性展示几个。(如果startValue设定为0,那么页面展示数就是endValue+1,比如此例页面展示2个) - }, - ], series: [] as lineSeriesOption[], } // 标题 @@ -378,9 +364,6 @@ function initChart() { chart = init(chartRef.value as HTMLElement, tdTheme) const option = buildOption() - // if (props.isAutomaticCarousel) { - // automaticCarousel(option, chart, 3000, 6) - // } chart.setOption({}) chart.resize() } @@ -390,9 +373,6 @@ if (chart) { console.log('渲染折线图') const option = buildOption() - if (props.isAutomaticCarousel) { - automaticCarousel(option, chart, 3000, 3) - } chart.setOption(option as unknown as ECBasicOption, true) chart.resize() } diff --git a/src/components/Echart/LineChartDynamics.vue b/src/components/Echart/LineChartDynamics.vue new file mode 100644 index 0000000..2a2f063 --- /dev/null +++ b/src/components/Echart/LineChartDynamics.vue @@ -0,0 +1,420 @@ + + + + + diff --git a/src/utils/Array.ts b/src/utils/Array.ts new file mode 100644 index 0000000..8c73e19 --- /dev/null +++ b/src/utils/Array.ts @@ -0,0 +1,63 @@ +import _ from 'lodash' +// 常见数组操作 + +// 两个数组求交集 +export const intersectionArray = (list1: any[], list2: any[]) => { + return list1.filter(v => list2.includes(v)) +} +// 差集 -- 常用于 表格中多选删除 +export const differenceArray = (list1: any[], list2: any[]) => { + return list1.filter(v => !list2.includes(v)) +} +// 补集 +export const complementaryArray = (list1: any[], list2: any[]) => { + return list1.filter((v) => { return !(list2.includes(v)) }) + .concat(list2.filter((v) => { return !(list1.includes(v)) })) +} +// 并集 +export const unionArray = (list1: any[], list2: any[]) => { + return list1.concat(list2.filter((v) => { return !(list1.includes(v)) })) +} +// 一维数组去重 +export const uniqueArray = (list: any) => { + return [...new Set(list)] +} +// 二维数组根据 某一属性 去重 +export const uniqueMultiArray = (list: any, attribute: string) => { + const res = new Map() + return list.filter((a: any) => !res.has(a[attribute]) && res.set(a[attribute], 1)) +} +// 一维数组或对象拷贝 +export const cloneArray = (data: any) => { + return JSON.parse(JSON.stringify(data)) +} +// 多维数组或对象深拷贝 +export const deepClone = (data: any) => { + return _.cloneDeep(data) +} +// 数组操作-下拉框操作(已经选择的数据不能再选) +/** + * @param list 下拉框初始数据(所有) + * @param list1 已经选择的数据 + * @param current 当前数据 可为空 + * @param attribute 属性(即绑定在 list1哪个属性上) + */ +export const setSelectList = (list: any[], list1: any[], current: string, attribute: string, attribute2 = 'value') => { + const select = [...new Set(list1.map((item: any) => item[attribute]))].filter((item: string) => item !== current) + return list.filter((item) => { return !select.includes(item[attribute2]) }) +} +// 几个数组的交集 +export function intersectionManyArray(...arrays) { + console.log(...arrays, '1111111111') + // 获取第一个数组作为初始交集 + let intersection = arrays.shift() + + // 遍历剩余的数组 + while (arrays.length) { + // 过滤当前交集,只保留那些也在当前数组中的元素 + intersection = intersection.filter(item => arrays[0].includes(item)) + // 移动到下一个数组 + arrays.shift() + } + return intersection +} diff --git a/src/views/alarm/dangerAssessment/assessment/list.vue b/src/views/alarm/dangerAssessment/assessment/list.vue index fca5e5a..f0b5f8b 100644 --- a/src/views/alarm/dangerAssessment/assessment/list.vue +++ b/src/views/alarm/dangerAssessment/assessment/list.vue @@ -1,9 +1,11 @@ + + + + + diff --git a/src/components/Echart/LineChart.vue b/src/components/Echart/LineChart.vue index 4213084..72666b2 100644 --- a/src/components/Echart/LineChart.vue +++ b/src/components/Echart/LineChart.vue @@ -39,7 +39,7 @@ return { top: 30, left: 10, - right: 20, + right: 30, bottom: 10, containLabel: true, // 是否包含坐标轴的刻度标签 } @@ -187,10 +187,6 @@ type: Boolean, default: true, }, - isAutomaticCarousel: { // 图表是否自动轮播 - type: Boolean, - default: false, - }, tooltipTextColor: { type: String, default: '#737373', @@ -290,16 +286,6 @@ }, }, ], - dataZoom: [ - // 滑动条 - { - xAxisIndex: 0, // 这里是从X轴的0刻度开始 - show: false, // 是否显示滑动条,不影响使用 - type: 'inside', // 这个 dataZoom 组件是 slider 型 dataZoom 组件 - startValue: 0, // 开始位置。 - endValue: 1, // 一次性展示几个。(如果startValue设定为0,那么页面展示数就是endValue+1,比如此例页面展示2个) - }, - ], series: [] as lineSeriesOption[], } // 标题 @@ -378,9 +364,6 @@ function initChart() { chart = init(chartRef.value as HTMLElement, tdTheme) const option = buildOption() - // if (props.isAutomaticCarousel) { - // automaticCarousel(option, chart, 3000, 6) - // } chart.setOption({}) chart.resize() } @@ -390,9 +373,6 @@ if (chart) { console.log('渲染折线图') const option = buildOption() - if (props.isAutomaticCarousel) { - automaticCarousel(option, chart, 3000, 3) - } chart.setOption(option as unknown as ECBasicOption, true) chart.resize() } diff --git a/src/components/Echart/LineChartDynamics.vue b/src/components/Echart/LineChartDynamics.vue new file mode 100644 index 0000000..2a2f063 --- /dev/null +++ b/src/components/Echart/LineChartDynamics.vue @@ -0,0 +1,420 @@ + + + + + diff --git a/src/utils/Array.ts b/src/utils/Array.ts new file mode 100644 index 0000000..8c73e19 --- /dev/null +++ b/src/utils/Array.ts @@ -0,0 +1,63 @@ +import _ from 'lodash' +// 常见数组操作 + +// 两个数组求交集 +export const intersectionArray = (list1: any[], list2: any[]) => { + return list1.filter(v => list2.includes(v)) +} +// 差集 -- 常用于 表格中多选删除 +export const differenceArray = (list1: any[], list2: any[]) => { + return list1.filter(v => !list2.includes(v)) +} +// 补集 +export const complementaryArray = (list1: any[], list2: any[]) => { + return list1.filter((v) => { return !(list2.includes(v)) }) + .concat(list2.filter((v) => { return !(list1.includes(v)) })) +} +// 并集 +export const unionArray = (list1: any[], list2: any[]) => { + return list1.concat(list2.filter((v) => { return !(list1.includes(v)) })) +} +// 一维数组去重 +export const uniqueArray = (list: any) => { + return [...new Set(list)] +} +// 二维数组根据 某一属性 去重 +export const uniqueMultiArray = (list: any, attribute: string) => { + const res = new Map() + return list.filter((a: any) => !res.has(a[attribute]) && res.set(a[attribute], 1)) +} +// 一维数组或对象拷贝 +export const cloneArray = (data: any) => { + return JSON.parse(JSON.stringify(data)) +} +// 多维数组或对象深拷贝 +export const deepClone = (data: any) => { + return _.cloneDeep(data) +} +// 数组操作-下拉框操作(已经选择的数据不能再选) +/** + * @param list 下拉框初始数据(所有) + * @param list1 已经选择的数据 + * @param current 当前数据 可为空 + * @param attribute 属性(即绑定在 list1哪个属性上) + */ +export const setSelectList = (list: any[], list1: any[], current: string, attribute: string, attribute2 = 'value') => { + const select = [...new Set(list1.map((item: any) => item[attribute]))].filter((item: string) => item !== current) + return list.filter((item) => { return !select.includes(item[attribute2]) }) +} +// 几个数组的交集 +export function intersectionManyArray(...arrays) { + console.log(...arrays, '1111111111') + // 获取第一个数组作为初始交集 + let intersection = arrays.shift() + + // 遍历剩余的数组 + while (arrays.length) { + // 过滤当前交集,只保留那些也在当前数组中的元素 + intersection = intersection.filter(item => arrays[0].includes(item)) + // 移动到下一个数组 + arrays.shift() + } + return intersection +} diff --git a/src/views/alarm/dangerAssessment/assessment/list.vue b/src/views/alarm/dangerAssessment/assessment/list.vue index fca5e5a..f0b5f8b 100644 --- a/src/views/alarm/dangerAssessment/assessment/list.vue +++ b/src/views/alarm/dangerAssessment/assessment/list.vue @@ -1,9 +1,11 @@ +