diff --git a/src/packages/components/Charts/MyComponents/AlarmList/config.ts b/src/packages/components/Charts/MyComponents/AlarmList/config.ts index 02452da..7ba26af 100644 --- a/src/packages/components/Charts/MyComponents/AlarmList/config.ts +++ b/src/packages/components/Charts/MyComponents/AlarmList/config.ts @@ -2,6 +2,8 @@ import { PublicConfigClass } from '@/packages/public' import { CreateComponentType } from '@/packages/index.d' import { AlarmListConfig } from './index' import dataJson from './data.json' +import { cloneDeep } from 'lodash' +import { chartInitConfig } from '@/settings/designSetting' export enum FontWeightEnum { NORMAL = '常规', BOLD = '加粗', @@ -22,7 +24,7 @@ export const FontStyleObject = { [FontStyleEnum.ITALIC]: 'italic', } export const option = { - sceneCode:"", + sceneCode: "", dataset: dataJson, header: ['报警事件', '时间', '所属企业', '状态'], headerTextColor: '#B4B4B4', @@ -37,21 +39,15 @@ export const option = { headerHeight: 28, itemHeight: 28, fontSize: 12, - title: '近60分钟报警信息', - titleSize: 16, - titleColor: '#eee', + titleText: '近60分钟报警信息', fontWeight: 'normal', fontStyle: 'italc', - paddingX: 50, - paddingY: -25, - letterSpacing: 0.5, isShowButton: false } export default class Config extends PublicConfigClass implements CreateComponentType { public key = AlarmListConfig.key public chartConfig = AlarmListConfig - public option = option - - + public option = cloneDeep(option) + public attr = { ...chartInitConfig, x: 0, y: 0, w: 500, h: 325, zIndex: 1 } } diff --git a/src/packages/components/Charts/MyComponents/AlarmList/index.vue b/src/packages/components/Charts/MyComponents/AlarmList/index.vue index 07ebcc6..56942ce 100644 --- a/src/packages/components/Charts/MyComponents/AlarmList/index.vue +++ b/src/packages/components/Charts/MyComponents/AlarmList/index.vue @@ -1,66 +1,46 @@ \ No newline at end of file + diff --git a/src/packages/components/Charts/MyComponents/LineDropdown/mock.json b/src/packages/components/Charts/MyComponents/LineDropdown/mock.json new file mode 100644 index 0000000..4e71645 --- /dev/null +++ b/src/packages/components/Charts/MyComponents/LineDropdown/mock.json @@ -0,0 +1,104 @@ +{ + "day": [ + { + "alarm_count": 1, + "hour": 6 + }, + { + "alarm_count": 1, + "hour": 7 + }, + { + "alarm_count": 59, + "hour": 12 + }, + { + "alarm_count": 71, + "hour": 13 + } + ], + "week": [ + { + "dayOfWeek": 1, + "alarm_count": 14 + }, + { + "dayOfWeek": 2, + "alarm_count": 15 + }, + { + "dayOfWeek": 3, + "alarm_count": 132 + } + ], + "month": [ + { + "alarm_count": 13, + "day": 17 + }, + { + "alarm_count": 75, + "day": 18 + }, + { + "alarm_count": 94, + "day": 19 + }, + { + "alarm_count": 34, + "day": 20 + }, + { + "alarm_count": 23, + "day": 21 + }, + { + "alarm_count": 6, + "day": 22 + }, + { + "alarm_count": 14, + "day": 25 + }, + { + "alarm_count": 15, + "day": 26 + }, + { + "alarm_count": 132, + "day": 27 + } + ], + "quarter": [ + { + "alarm_count": 18, + "month": 7 + }, + { + "alarm_count": 406, + "month": 8 + } + ], + "year": [ + { + "alarm_count": 10, + "month": 4 + }, + { + "alarm_count": 10, + "month": 5 + }, + { + "alarm_count": 10, + "month": 6 + }, + { + "alarm_count": 18, + "month": 7 + }, + { + "alarm_count": 406, + "month": 8 + } + ] +} \ No newline at end of file diff --git a/src/packages/components/Charts/MyComponents/LineDropdown/select.vue b/src/packages/components/Charts/MyComponents/LineDropdown/select.vue new file mode 100644 index 0000000..39e2284 --- /dev/null +++ b/src/packages/components/Charts/MyComponents/LineDropdown/select.vue @@ -0,0 +1,159 @@ + + + + + \ No newline at end of file diff --git a/src/packages/components/Charts/MyComponents/LineGraph01/config.ts b/src/packages/components/Charts/MyComponents/LineGraph01/config.ts index 7edf90b..f5d01c0 100644 --- a/src/packages/components/Charts/MyComponents/LineGraph01/config.ts +++ b/src/packages/components/Charts/MyComponents/LineGraph01/config.ts @@ -4,6 +4,7 @@ import { CreateComponentType } from '@/packages/index.d' import cloneDeep from 'lodash/cloneDeep' import { chartInitConfig } from '@/settings/designSetting' import dataJson from './data.json' + export interface DataSourceItem { dataname: string; values: number[]; @@ -17,7 +18,9 @@ export interface DatasType { dataSource: DataSourceItem[]; } - +const otherOption = { + titleText: '报警处置情况' +} export const includes = ['legend', 'xAxis', 'yAxis', 'grid'] export const seriesItem = { type: 'line', @@ -57,6 +60,34 @@ export const seriesItem = { } } export const option = { + ...otherOption, + sceneCode: 'T04', + dateTime: { + selectValue: 'day', + dataset: [ + { + label: '当天', + value: 'day' + }, + { + label: '本周', + value: 'week' + }, + { + label: '当月', + value: 'month' + }, + { + label: '本季度', + value: 'quarter' + }, + { + label: '当年', + value: 'year' + } + ] + }, + dataset: { source: dataJson.dataSource[0].datavalues }, diff --git a/src/packages/components/Charts/MyComponents/LineGraph01/config.vue b/src/packages/components/Charts/MyComponents/LineGraph01/config.vue index 415af52..bfbbace 100644 --- a/src/packages/components/Charts/MyComponents/LineGraph01/config.vue +++ b/src/packages/components/Charts/MyComponents/LineGraph01/config.vue @@ -1,6 +1,5 @@