Commit ba4ca8667b704b999e2327fae8201edc8b02fdfb
Merge branch 'perf/board-control-add-range' into 'main_dev'
feat:看板组件仪表盘增加选取最大值字段 See merge request yunteng/thingskit-front!752
Showing
27 changed files
with
348 additions
and
105 deletions
| @@ -123,6 +123,12 @@ | @@ -123,6 +123,12 @@ | ||
| 123 | }; | 123 | }; |
| 124 | 124 | ||
| 125 | const handleCopy = (record: DataSourceType) => { | 125 | const handleCopy = (record: DataSourceType) => { |
| 126 | + const { key } = props.componentConfig || {}; | ||
| 127 | + if (key == 'HumidityComponent2' && props.dataSource.length >= 6) { | ||
| 128 | + createMessage.warning('绑定的数据源不能超过6条~'); | ||
| 129 | + return; | ||
| 130 | + } | ||
| 131 | + | ||
| 126 | if (props.dataSource.length >= DATA_SOURCE_LIMIT_NUMBER) { | 132 | if (props.dataSource.length >= DATA_SOURCE_LIMIT_NUMBER) { |
| 127 | createMessage.warning('绑定的数据源不能超过10条~'); | 133 | createMessage.warning('绑定的数据源不能超过10条~'); |
| 128 | return; | 134 | return; |
| @@ -113,6 +113,11 @@ | @@ -113,6 +113,11 @@ | ||
| 113 | }; | 113 | }; |
| 114 | 114 | ||
| 115 | const handleNewRecord = () => { | 115 | const handleNewRecord = () => { |
| 116 | + const { componentKey } = unref(selectWidgetKeys); | ||
| 117 | + if (componentKey === 'HumidityComponent2' && unref(dataSource).length >= 6) { | ||
| 118 | + createMessage.warning('绑定的数据源不能超过6条~'); | ||
| 119 | + return; | ||
| 120 | + } | ||
| 116 | if (unref(dataSource).length >= DATA_SOURCE_LIMIT_NUMBER) { | 121 | if (unref(dataSource).length >= DATA_SOURCE_LIMIT_NUMBER) { |
| 117 | createMessage.warning('绑定的数据源不能超过10条~'); | 122 | createMessage.warning('绑定的数据源不能超过10条~'); |
| 118 | return; | 123 | return; |
| @@ -13,6 +13,8 @@ export const option: PublicPresetOptions = { | @@ -13,6 +13,8 @@ export const option: PublicPresetOptions = { | ||
| 13 | [ComponentConfigFieldEnum.SHOW_DEVICE_NAME]: false, | 13 | [ComponentConfigFieldEnum.SHOW_DEVICE_NAME]: false, |
| 14 | [ComponentConfigFieldEnum.CONTROL_BAR_COLOR]: '#0072ff', | 14 | [ComponentConfigFieldEnum.CONTROL_BAR_COLOR]: '#0072ff', |
| 15 | [ComponentConfigFieldEnum.FONT_COLOR]: '#000000', | 15 | [ComponentConfigFieldEnum.FONT_COLOR]: '#000000', |
| 16 | + [ComponentConfigFieldEnum.MIN_NUMBER]: 0, | ||
| 17 | + [ComponentConfigFieldEnum.MAX_NUMBER]: 100, | ||
| 16 | }; | 18 | }; |
| 17 | 19 | ||
| 18 | export default class Config extends PublicConfigClass implements CreateComponentType { | 20 | export default class Config extends PublicConfigClass implements CreateComponentType { |
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | import { useForm, BasicForm } from '/@/components/Form'; | 3 | import { useForm, BasicForm } from '/@/components/Form'; |
| 4 | import { PublicFormInstaceType } from '/@/views/visual/dataSourceBindPanel/index.type'; | 4 | import { PublicFormInstaceType } from '/@/views/visual/dataSourceBindPanel/index.type'; |
| 5 | import { option } from './config'; | 5 | import { option } from './config'; |
| 6 | + import { nextTick } from 'vue'; | ||
| 6 | 7 | ||
| 7 | const [register, { getFieldsValue, setFieldsValue, resetFields }] = useForm({ | 8 | const [register, { getFieldsValue, setFieldsValue, resetFields }] = useForm({ |
| 8 | schemas: [ | 9 | schemas: [ |
| @@ -21,6 +22,46 @@ | @@ -21,6 +22,46 @@ | ||
| 21 | defaultValue: option.fontColor, | 22 | defaultValue: option.fontColor, |
| 22 | }, | 23 | }, |
| 23 | { | 24 | { |
| 25 | + field: ComponentConfigFieldEnum.MIN_NUMBER, | ||
| 26 | + label: '最小值', | ||
| 27 | + component: 'InputNumber', | ||
| 28 | + defaultValue: option.minNumber, | ||
| 29 | + componentProps: ({ formActionType }) => { | ||
| 30 | + const { setFieldsValue } = formActionType; | ||
| 31 | + return { | ||
| 32 | + placeholder: '请输入最小值', | ||
| 33 | + onChange: async (e) => { | ||
| 34 | + if ((typeof e === 'string' || typeof e === 'object') && !e) { | ||
| 35 | + await nextTick(); | ||
| 36 | + setFieldsValue({ [ComponentConfigFieldEnum.MIN_NUMBER]: 0 }); | ||
| 37 | + } | ||
| 38 | + }, | ||
| 39 | + }; | ||
| 40 | + }, | ||
| 41 | + }, | ||
| 42 | + { | ||
| 43 | + field: ComponentConfigFieldEnum.MAX_NUMBER, | ||
| 44 | + label: '最大值', | ||
| 45 | + component: 'InputNumber', | ||
| 46 | + defaultValue: option.maxNumber, | ||
| 47 | + componentProps: ({ formModel, formActionType }) => { | ||
| 48 | + const { setFieldsValue } = formActionType; | ||
| 49 | + return { | ||
| 50 | + placeholder: '请输入最大值', | ||
| 51 | + min: formModel[ComponentConfigFieldEnum.MIN_NUMBER] + 100, | ||
| 52 | + onChange: async (e) => { | ||
| 53 | + if (!e) { | ||
| 54 | + await nextTick(); | ||
| 55 | + setFieldsValue({ | ||
| 56 | + [ComponentConfigFieldEnum.MAX_NUMBER]: | ||
| 57 | + formModel[ComponentConfigFieldEnum.MIN_NUMBER] + 100, | ||
| 58 | + }); | ||
| 59 | + } | ||
| 60 | + }, | ||
| 61 | + }; | ||
| 62 | + }, | ||
| 63 | + }, | ||
| 64 | + { | ||
| 24 | field: ComponentConfigFieldEnum.SHOW_DEVICE_NAME, | 65 | field: ComponentConfigFieldEnum.SHOW_DEVICE_NAME, |
| 25 | label: '显示设备名称', | 66 | label: '显示设备名称', |
| 26 | component: 'Checkbox', | 67 | component: 'Checkbox', |
| @@ -17,8 +17,6 @@ | @@ -17,8 +17,6 @@ | ||
| 17 | const sliderValue = ref<number>(33); | 17 | const sliderValue = ref<number>(33); |
| 18 | const oldSliderValue = ref<number>(33); | 18 | const oldSliderValue = ref<number>(33); |
| 19 | const noSendValue = ref<number>(0); | 19 | const noSendValue = ref<number>(0); |
| 20 | - const sMin = ref<number>(0); | ||
| 21 | - const sMax = ref<number>(100); | ||
| 22 | const sliderEl = ref<Nullable<InstanceType<typeof Slider>>>(null); | 20 | const sliderEl = ref<Nullable<InstanceType<typeof Slider>>>(null); |
| 23 | 21 | ||
| 24 | const { loading, sendCommand } = useSendCommand(); | 22 | const { loading, sendCommand } = useSendCommand(); |
| @@ -26,28 +24,39 @@ | @@ -26,28 +24,39 @@ | ||
| 26 | const getDesign = computed(() => { | 24 | const getDesign = computed(() => { |
| 27 | const { option, persetOption } = props.config; | 25 | const { option, persetOption } = props.config; |
| 28 | const { componentInfo, attribute, attributeRename, attributeName } = option; | 26 | const { componentInfo, attribute, attributeRename, attributeName } = option; |
| 29 | - const { controlBarColor: persetControlBarColor, fonColor: persetFontColor } = | ||
| 30 | - persetOption || {}; | ||
| 31 | - const { controlBarColor, fontColor } = componentInfo || {}; | 27 | + const { |
| 28 | + controlBarColor: persetControlBarColor, | ||
| 29 | + fonColor: persetFontColor, | ||
| 30 | + minNumber: persetMinNumber, | ||
| 31 | + maxNumber: persetMaxNumber, | ||
| 32 | + } = persetOption || {}; | ||
| 33 | + const { controlBarColor, fontColor, minNumber, maxNumber } = componentInfo || {}; | ||
| 32 | return { | 34 | return { |
| 33 | attribute: attributeRename || attributeName || attribute, | 35 | attribute: attributeRename || attributeName || attribute, |
| 34 | controlBarColor: controlBarColor ?? persetControlBarColor, | 36 | controlBarColor: controlBarColor ?? persetControlBarColor, |
| 35 | fontColor: fontColor ?? persetFontColor, | 37 | fontColor: fontColor ?? persetFontColor, |
| 38 | + minNumber: minNumber ?? persetMinNumber, | ||
| 39 | + maxNumber: maxNumber ?? persetMaxNumber, | ||
| 36 | }; | 40 | }; |
| 37 | }); | 41 | }); |
| 38 | 42 | ||
| 39 | const index = ref<number>(0); | 43 | const index = ref<number>(0); |
| 44 | + const afterValue = ref<number>(0); //点击Slider获取的值 | ||
| 40 | 45 | ||
| 41 | const handleChange = async (e) => { | 46 | const handleChange = async (e) => { |
| 42 | index.value++; | 47 | index.value++; |
| 48 | + afterValue.value = e; | ||
| 43 | if (index.value == 1) { | 49 | if (index.value == 1) { |
| 44 | oldSliderValue.value = unref(sliderValue); | 50 | oldSliderValue.value = unref(sliderValue); |
| 51 | + return; //这个是因为设置了最大值时,当sliderValue的值大于最大值时只会显示设置的最大值,会执行一次change | ||
| 45 | } | 52 | } |
| 46 | sliderValue.value = e; | 53 | sliderValue.value = e; |
| 47 | }; | 54 | }; |
| 48 | 55 | ||
| 49 | const handleAfterChange = async () => { | 56 | const handleAfterChange = async () => { |
| 50 | unref(sliderEl)?.blur(); | 57 | unref(sliderEl)?.blur(); |
| 58 | + if (unref(sliderValue) == unref(afterValue)) return; | ||
| 59 | + sliderValue.value = afterValue.value; //这一步是因为当我们是点击不是拖动时候,会让值更新不了,所以需要赋值一次 | ||
| 51 | }; | 60 | }; |
| 52 | 61 | ||
| 53 | const handleBlur = async () => { | 62 | const handleBlur = async () => { |
| @@ -90,8 +99,8 @@ | @@ -90,8 +99,8 @@ | ||
| 90 | :style="{ '--slider-color': getDesign.controlBarColor }" | 99 | :style="{ '--slider-color': getDesign.controlBarColor }" |
| 91 | class="no-drag" | 100 | class="no-drag" |
| 92 | :value="sliderValue" | 101 | :value="sliderValue" |
| 93 | - :min="sMin" | ||
| 94 | - :max="sMax" | 102 | + :min="getDesign.minNumber" |
| 103 | + :max="getDesign.maxNumber" | ||
| 95 | @change="handleChange" | 104 | @change="handleChange" |
| 96 | @afterChange="handleAfterChange" | 105 | @afterChange="handleAfterChange" |
| 97 | @blur="handleBlur" | 106 | @blur="handleBlur" |
| @@ -57,7 +57,7 @@ | @@ -57,7 +57,7 @@ | ||
| 57 | componentProps: ({ formActionType }) => { | 57 | componentProps: ({ formActionType }) => { |
| 58 | const { setFieldsValue } = formActionType; | 58 | const { setFieldsValue } = formActionType; |
| 59 | return { | 59 | return { |
| 60 | - placeholder: '请输入最小值', | 60 | + placeholder: '请输入最大值', |
| 61 | min: 100, | 61 | min: 100, |
| 62 | onChange: async (e) => { | 62 | onChange: async (e) => { |
| 63 | if (!e) { | 63 | if (!e) { |
| @@ -63,7 +63,7 @@ | @@ -63,7 +63,7 @@ | ||
| 63 | componentProps: ({ formActionType }) => { | 63 | componentProps: ({ formActionType }) => { |
| 64 | const { setFieldsValue } = formActionType; | 64 | const { setFieldsValue } = formActionType; |
| 65 | return { | 65 | return { |
| 66 | - placeholder: '请输入最小值', | 66 | + placeholder: '请输入最大值', |
| 67 | min: 100, | 67 | min: 100, |
| 68 | onChange: async (e) => { | 68 | onChange: async (e) => { |
| 69 | if (!e) { | 69 | if (!e) { |
| @@ -22,6 +22,7 @@ export enum GradientColor { | @@ -22,6 +22,7 @@ export enum GradientColor { | ||
| 22 | export const option: PublicPresetOptions = { | 22 | export const option: PublicPresetOptions = { |
| 23 | [ComponentConfigFieldEnum.FONT_COLOR]: '#FD7347', | 23 | [ComponentConfigFieldEnum.FONT_COLOR]: '#FD7347', |
| 24 | [ComponentConfigFieldEnum.SHOW_DEVICE_NAME]: false, | 24 | [ComponentConfigFieldEnum.SHOW_DEVICE_NAME]: false, |
| 25 | + [ComponentConfigFieldEnum.MAX_NUMBER]: 100, | ||
| 25 | [ComponentConfigFieldEnum.SHOW_TIME]: false, | 26 | [ComponentConfigFieldEnum.SHOW_TIME]: false, |
| 26 | [ComponentConfigFieldEnum.UNIT]: '℃', | 27 | [ComponentConfigFieldEnum.UNIT]: '℃', |
| 27 | [ComponentConfigFieldEnum.POINTER_COLOR]: '#15E2C6', | 28 | [ComponentConfigFieldEnum.POINTER_COLOR]: '#15E2C6', |
| 1 | <script lang="ts" setup> | 1 | <script lang="ts" setup> |
| 2 | + import { nextTick } from 'vue'; | ||
| 2 | import { ComponentConfigFieldEnum } from '../../../enum'; | 3 | import { ComponentConfigFieldEnum } from '../../../enum'; |
| 3 | import { option, Gradient, GradientColor } from './config'; | 4 | import { option, Gradient, GradientColor } from './config'; |
| 4 | import { useForm, BasicForm } from '/@/components/Form'; | 5 | import { useForm, BasicForm } from '/@/components/Form'; |
| @@ -29,10 +30,18 @@ | @@ -29,10 +30,18 @@ | ||
| 29 | defaultValue: option.pointerColor, | 30 | defaultValue: option.pointerColor, |
| 30 | }, | 31 | }, |
| 31 | { | 32 | { |
| 32 | - field: ComponentConfigFieldEnum.UNIT, | ||
| 33 | - label: '数值单位', | ||
| 34 | - component: 'Input', | ||
| 35 | - defaultValue: option.unit, | 33 | + field: ComponentConfigFieldEnum.FIRST_PHASE_COLOR, |
| 34 | + label: '起始颜色', | ||
| 35 | + component: 'ColorPicker', | ||
| 36 | + changeEvent: 'update:value', | ||
| 37 | + defaultValue: GradientColor.FIRST, | ||
| 38 | + }, | ||
| 39 | + { | ||
| 40 | + field: ComponentConfigFieldEnum.SECOND_PHASE_COLOR, | ||
| 41 | + label: '结尾颜色', | ||
| 42 | + component: 'ColorPicker', | ||
| 43 | + changeEvent: 'update:value', | ||
| 44 | + defaultValue: GradientColor.SECOND, | ||
| 36 | }, | 45 | }, |
| 37 | // { | 46 | // { |
| 38 | // field: ComponentConfigFieldEnum.INSTRUMENT_PANEL_WIDTH, | 47 | // field: ComponentConfigFieldEnum.INSTRUMENT_PANEL_WIDTH, |
| @@ -55,18 +64,31 @@ | @@ -55,18 +64,31 @@ | ||
| 55 | }, | 64 | }, |
| 56 | 65 | ||
| 57 | { | 66 | { |
| 58 | - field: ComponentConfigFieldEnum.FIRST_PHASE_COLOR, | ||
| 59 | - label: '起始颜色', | ||
| 60 | - component: 'ColorPicker', | ||
| 61 | - changeEvent: 'update:value', | ||
| 62 | - defaultValue: GradientColor.FIRST, | 67 | + field: ComponentConfigFieldEnum.UNIT, |
| 68 | + label: '数值单位', | ||
| 69 | + component: 'Input', | ||
| 70 | + defaultValue: option.unit, | ||
| 63 | }, | 71 | }, |
| 64 | { | 72 | { |
| 65 | - field: ComponentConfigFieldEnum.SECOND_PHASE_COLOR, | ||
| 66 | - label: '结尾颜色', | ||
| 67 | - component: 'ColorPicker', | ||
| 68 | - changeEvent: 'update:value', | ||
| 69 | - defaultValue: GradientColor.SECOND, | 73 | + field: ComponentConfigFieldEnum.MAX_NUMBER, |
| 74 | + label: '最大值', | ||
| 75 | + component: 'InputNumber', | ||
| 76 | + defaultValue: 100, | ||
| 77 | + componentProps: ({ formActionType }) => { | ||
| 78 | + const { setFieldsValue } = formActionType; | ||
| 79 | + return { | ||
| 80 | + placeholder: '请输入最大值', | ||
| 81 | + min: 100, | ||
| 82 | + onChange: async (e) => { | ||
| 83 | + if (!e) { | ||
| 84 | + await nextTick(); | ||
| 85 | + setFieldsValue({ | ||
| 86 | + [ComponentConfigFieldEnum.MAX_NUMBER]: 100, | ||
| 87 | + }); | ||
| 88 | + } | ||
| 89 | + }, | ||
| 90 | + }; | ||
| 91 | + }, | ||
| 70 | }, | 92 | }, |
| 71 | ], | 93 | ], |
| 72 | showActionButtonGroup: false, | 94 | showActionButtonGroup: false, |
| @@ -97,12 +119,14 @@ | @@ -97,12 +119,14 @@ | ||
| 97 | showDeviceName: item[ComponentConfigFieldEnum.SHOW_DEVICE_NAME], | 119 | showDeviceName: item[ComponentConfigFieldEnum.SHOW_DEVICE_NAME], |
| 98 | showTime: item[ComponentConfigFieldEnum.SHOW_TIME], | 120 | showTime: item[ComponentConfigFieldEnum.SHOW_TIME], |
| 99 | pointerColor: item[ComponentConfigFieldEnum.POINTER_COLOR], | 121 | pointerColor: item[ComponentConfigFieldEnum.POINTER_COLOR], |
| 122 | + maxNumber: item[ComponentConfigFieldEnum.MAX_NUMBER], | ||
| 100 | } as ComponentInfo; | 123 | } as ComponentInfo; |
| 101 | }; | 124 | }; |
| 102 | 125 | ||
| 103 | const setFormValues = (data: Recordable) => { | 126 | const setFormValues = (data: Recordable) => { |
| 104 | // return setFieldsValue(data); | 127 | // return setFieldsValue(data); |
| 105 | - const { gradientInfo, unit, fontColor, showDeviceName, pointerColor, showTime } = data; | 128 | + const { gradientInfo, unit, fontColor, showDeviceName, pointerColor, showTime, maxNumber } = |
| 129 | + data; | ||
| 106 | const firstRecord = gradientInfo.find((item) => item.key === Gradient.FIRST); | 130 | const firstRecord = gradientInfo.find((item) => item.key === Gradient.FIRST); |
| 107 | const secondRecord = gradientInfo.find((item) => item.key === Gradient.SECOND); | 131 | const secondRecord = gradientInfo.find((item) => item.key === Gradient.SECOND); |
| 108 | 132 | ||
| @@ -116,6 +140,7 @@ | @@ -116,6 +140,7 @@ | ||
| 116 | [ComponentConfigFieldEnum.SECOND_PHASE_VALUE]: 1, | 140 | [ComponentConfigFieldEnum.SECOND_PHASE_VALUE]: 1, |
| 117 | [ComponentConfigFieldEnum.SECOND_PHASE_COLOR]: secondRecord?.color, | 141 | [ComponentConfigFieldEnum.SECOND_PHASE_COLOR]: secondRecord?.color, |
| 118 | [ComponentConfigFieldEnum.POINTER_COLOR]: pointerColor, | 142 | [ComponentConfigFieldEnum.POINTER_COLOR]: pointerColor, |
| 143 | + [ComponentConfigFieldEnum.MAX_NUMBER]: maxNumber, | ||
| 119 | }; | 144 | }; |
| 120 | return setFieldsValue(value); | 145 | return setFieldsValue(value); |
| 121 | }; | 146 | }; |
| @@ -31,9 +31,17 @@ | @@ -31,9 +31,17 @@ | ||
| 31 | instrumentPanelColor: presetInstrumentPanelColor, | 31 | instrumentPanelColor: presetInstrumentPanelColor, |
| 32 | gradientInfo: presetGradientInfo, | 32 | gradientInfo: presetGradientInfo, |
| 33 | showTime: persetShowTime, | 33 | showTime: persetShowTime, |
| 34 | + maxNumber: persetMaxNumber, | ||
| 34 | } = persetOption || {}; | 35 | } = persetOption || {}; |
| 35 | - const { unit, fontColor, pointerColor, instrumentPanelColor, gradientInfo, showTime } = | ||
| 36 | - componentInfo || {}; | 36 | + const { |
| 37 | + unit, | ||
| 38 | + fontColor, | ||
| 39 | + pointerColor, | ||
| 40 | + instrumentPanelColor, | ||
| 41 | + gradientInfo, | ||
| 42 | + showTime, | ||
| 43 | + maxNumber, | ||
| 44 | + } = componentInfo || {}; | ||
| 37 | return { | 45 | return { |
| 38 | unit: unit ?? presetUnit, | 46 | unit: unit ?? presetUnit, |
| 39 | fontColor: fontColor ?? presetFontColor, | 47 | fontColor: fontColor ?? presetFontColor, |
| @@ -42,6 +50,7 @@ | @@ -42,6 +50,7 @@ | ||
| 42 | instrumentPanelColor: instrumentPanelColor ?? presetInstrumentPanelColor, | 50 | instrumentPanelColor: instrumentPanelColor ?? presetInstrumentPanelColor, |
| 43 | gradientInfo: gradientInfo ?? presetGradientInfo, | 51 | gradientInfo: gradientInfo ?? presetGradientInfo, |
| 44 | showTime: showTime ?? persetShowTime, | 52 | showTime: showTime ?? persetShowTime, |
| 53 | + maxNumber: maxNumber || persetMaxNumber, | ||
| 45 | }; | 54 | }; |
| 46 | }); | 55 | }); |
| 47 | 56 | ||
| @@ -49,13 +58,6 @@ | @@ -49,13 +58,6 @@ | ||
| 49 | if (!isArray(array)) { | 58 | if (!isArray(array)) { |
| 50 | return; | 59 | return; |
| 51 | } | 60 | } |
| 52 | - // const item: any = []; | ||
| 53 | - // array.forEach((value, index) => { | ||
| 54 | - // item[index] = | ||
| 55 | - // index == 0 | ||
| 56 | - // ? { offset: value.value == 100 ? 1 : 0, color: value.color } | ||
| 57 | - // : { offset: Number((value.value / 100).toFixed(1)), color: value.color }; | ||
| 58 | - // }); | ||
| 59 | const colorList = array.map((item) => ({ | 61 | const colorList = array.map((item) => ({ |
| 60 | offset: item.value, | 62 | offset: item.value, |
| 61 | color: item.color, | 63 | color: item.color, |
| @@ -64,7 +66,7 @@ | @@ -64,7 +66,7 @@ | ||
| 64 | }; | 66 | }; |
| 65 | 67 | ||
| 66 | const options = (): EChartsOption => { | 68 | const options = (): EChartsOption => { |
| 67 | - const { unit, fontColor, pointerColor, gradientInfo } = unref(getDesign); | 69 | + const { unit, fontColor, pointerColor, gradientInfo, maxNumber } = unref(getDesign); |
| 68 | 70 | ||
| 69 | const instrumentPanelColor = getStageColor(gradientInfo); | 71 | const instrumentPanelColor = getStageColor(gradientInfo); |
| 70 | // getStageColor(gradientInfo); | 72 | // getStageColor(gradientInfo); |
| @@ -72,6 +74,8 @@ | @@ -72,6 +74,8 @@ | ||
| 72 | series: [ | 74 | series: [ |
| 73 | { | 75 | { |
| 74 | type: 'gauge', | 76 | type: 'gauge', |
| 77 | + min: 0, | ||
| 78 | + max: maxNumber, | ||
| 75 | center: ['50%', '60%'], | 79 | center: ['50%', '60%'], |
| 76 | startAngle: 150, | 80 | startAngle: 150, |
| 77 | endAngle: 30, | 81 | endAngle: 30, |
| @@ -25,6 +25,7 @@ export const option: PublicPresetOptions = { | @@ -25,6 +25,7 @@ export const option: PublicPresetOptions = { | ||
| 25 | [ComponentConfigFieldEnum.UNIT]: '℃', | 25 | [ComponentConfigFieldEnum.UNIT]: '℃', |
| 26 | [ComponentConfigFieldEnum.POINTER_COLOR]: '#15E2C6', | 26 | [ComponentConfigFieldEnum.POINTER_COLOR]: '#15E2C6', |
| 27 | [ComponentConfigFieldEnum.INSTRUMENT_PANEL_COLOR]: '#61D4C5', | 27 | [ComponentConfigFieldEnum.INSTRUMENT_PANEL_COLOR]: '#61D4C5', |
| 28 | + [ComponentConfigFieldEnum.MAX_NUMBER]: 100, | ||
| 28 | [ComponentConfigFieldEnum.GRADIENT_INFO]: [ | 29 | [ComponentConfigFieldEnum.GRADIENT_INFO]: [ |
| 29 | { key: Gradient.FIRST, value: 0, color: GradientColor.FIRST }, | 30 | { key: Gradient.FIRST, value: 0, color: GradientColor.FIRST }, |
| 30 | { key: Gradient.SECOND, value: 1, color: GradientColor.SECOND }, | 31 | { key: Gradient.SECOND, value: 1, color: GradientColor.SECOND }, |
| 1 | <script lang="ts" setup> | 1 | <script lang="ts" setup> |
| 2 | + import { nextTick } from 'vue'; | ||
| 2 | import { ComponentConfigFieldEnum } from '../../../enum'; | 3 | import { ComponentConfigFieldEnum } from '../../../enum'; |
| 3 | import { option, Gradient, GradientColor } from './config'; | 4 | import { option, Gradient, GradientColor } from './config'; |
| 4 | import { useForm, BasicForm } from '/@/components/Form'; | 5 | import { useForm, BasicForm } from '/@/components/Form'; |
| @@ -22,10 +23,10 @@ | @@ -22,10 +23,10 @@ | ||
| 22 | defaultValue: option.fontColor, | 23 | defaultValue: option.fontColor, |
| 23 | }, | 24 | }, |
| 24 | { | 25 | { |
| 25 | - field: ComponentConfigFieldEnum.PROGRESS_BAR_CIRCLE, | ||
| 26 | - label: '显示进度条圆形', | ||
| 27 | - component: 'Checkbox', | ||
| 28 | - defaultValue: option.progressBarCircle, | 26 | + field: ComponentConfigFieldEnum.UNIT, |
| 27 | + label: '数值单位', | ||
| 28 | + component: 'Input', | ||
| 29 | + defaultValue: option.unit, | ||
| 29 | }, | 30 | }, |
| 30 | { | 31 | { |
| 31 | field: ComponentConfigFieldEnum.FIRST_PHASE_COLOR, | 32 | field: ComponentConfigFieldEnum.FIRST_PHASE_COLOR, |
| @@ -42,10 +43,10 @@ | @@ -42,10 +43,10 @@ | ||
| 42 | defaultValue: GradientColor.SECOND, | 43 | defaultValue: GradientColor.SECOND, |
| 43 | }, | 44 | }, |
| 44 | { | 45 | { |
| 45 | - field: ComponentConfigFieldEnum.UNIT, | ||
| 46 | - label: '数值单位', | ||
| 47 | - component: 'Input', | ||
| 48 | - defaultValue: option.unit, | 46 | + field: ComponentConfigFieldEnum.PROGRESS_BAR_CIRCLE, |
| 47 | + label: '显示进度条圆形', | ||
| 48 | + component: 'Checkbox', | ||
| 49 | + defaultValue: option.progressBarCircle, | ||
| 49 | }, | 50 | }, |
| 50 | { | 51 | { |
| 51 | field: ComponentConfigFieldEnum.SHOW_DEVICE_NAME, | 52 | field: ComponentConfigFieldEnum.SHOW_DEVICE_NAME, |
| @@ -59,6 +60,27 @@ | @@ -59,6 +60,27 @@ | ||
| 59 | component: 'Checkbox', | 60 | component: 'Checkbox', |
| 60 | defaultValue: option.showTime, | 61 | defaultValue: option.showTime, |
| 61 | }, | 62 | }, |
| 63 | + { | ||
| 64 | + field: ComponentConfigFieldEnum.MAX_NUMBER, | ||
| 65 | + label: '最大值', | ||
| 66 | + component: 'InputNumber', | ||
| 67 | + defaultValue: 100, | ||
| 68 | + componentProps: ({ formActionType }) => { | ||
| 69 | + const { setFieldsValue } = formActionType; | ||
| 70 | + return { | ||
| 71 | + placeholder: '请输入最大值', | ||
| 72 | + min: 100, | ||
| 73 | + onChange: async (e) => { | ||
| 74 | + if (!e) { | ||
| 75 | + await nextTick(); | ||
| 76 | + setFieldsValue({ | ||
| 77 | + [ComponentConfigFieldEnum.MAX_NUMBER]: 100, | ||
| 78 | + }); | ||
| 79 | + } | ||
| 80 | + }, | ||
| 81 | + }; | ||
| 82 | + }, | ||
| 83 | + }, | ||
| 62 | ], | 84 | ], |
| 63 | showActionButtonGroup: false, | 85 | showActionButtonGroup: false, |
| 64 | labelWidth: 120, | 86 | labelWidth: 120, |
| @@ -88,12 +110,21 @@ | @@ -88,12 +110,21 @@ | ||
| 88 | showDeviceName: item[ComponentConfigFieldEnum.SHOW_DEVICE_NAME], | 110 | showDeviceName: item[ComponentConfigFieldEnum.SHOW_DEVICE_NAME], |
| 89 | showTime: item[ComponentConfigFieldEnum.SHOW_TIME], | 111 | showTime: item[ComponentConfigFieldEnum.SHOW_TIME], |
| 90 | progressBarCircle: item[ComponentConfigFieldEnum.PROGRESS_BAR_CIRCLE], | 112 | progressBarCircle: item[ComponentConfigFieldEnum.PROGRESS_BAR_CIRCLE], |
| 113 | + maxNumber: item[ComponentConfigFieldEnum.MAX_NUMBER], | ||
| 91 | } as ComponentInfo; | 114 | } as ComponentInfo; |
| 92 | }; | 115 | }; |
| 93 | 116 | ||
| 94 | const setFormValues = (data: Recordable) => { | 117 | const setFormValues = (data: Recordable) => { |
| 95 | // return setFieldsValue(data); | 118 | // return setFieldsValue(data); |
| 96 | - const { gradientInfo, unit, fontColor, showDeviceName, progressBarCircle, showTime } = data; | 119 | + const { |
| 120 | + gradientInfo, | ||
| 121 | + unit, | ||
| 122 | + fontColor, | ||
| 123 | + showDeviceName, | ||
| 124 | + progressBarCircle, | ||
| 125 | + showTime, | ||
| 126 | + maxNumber, | ||
| 127 | + } = data; | ||
| 97 | const firstRecord = gradientInfo.find((item) => item.key === Gradient.FIRST); | 128 | const firstRecord = gradientInfo.find((item) => item.key === Gradient.FIRST); |
| 98 | const secondRecord = gradientInfo.find((item) => item.key === Gradient.SECOND); | 129 | const secondRecord = gradientInfo.find((item) => item.key === Gradient.SECOND); |
| 99 | 130 | ||
| @@ -107,6 +138,7 @@ | @@ -107,6 +138,7 @@ | ||
| 107 | [ComponentConfigFieldEnum.SECOND_PHASE_VALUE]: 1, | 138 | [ComponentConfigFieldEnum.SECOND_PHASE_VALUE]: 1, |
| 108 | [ComponentConfigFieldEnum.SECOND_PHASE_COLOR]: secondRecord?.color, | 139 | [ComponentConfigFieldEnum.SECOND_PHASE_COLOR]: secondRecord?.color, |
| 109 | [ComponentConfigFieldEnum.PROGRESS_BAR_CIRCLE]: progressBarCircle, | 140 | [ComponentConfigFieldEnum.PROGRESS_BAR_CIRCLE]: progressBarCircle, |
| 141 | + [ComponentConfigFieldEnum.MAX_NUMBER]: maxNumber, | ||
| 110 | }; | 142 | }; |
| 111 | return setFieldsValue(value); | 143 | return setFieldsValue(value); |
| 112 | }; | 144 | }; |
| @@ -32,6 +32,7 @@ | @@ -32,6 +32,7 @@ | ||
| 32 | progressBarCircle: presetProgressBarCircle, | 32 | progressBarCircle: presetProgressBarCircle, |
| 33 | gradientInfo: presetGradientInfo, | 33 | gradientInfo: presetGradientInfo, |
| 34 | showTime: persetShowTime, | 34 | showTime: persetShowTime, |
| 35 | + maxNumber: persetMaxNumber, | ||
| 35 | } = persetOption || {}; | 36 | } = persetOption || {}; |
| 36 | const { | 37 | const { |
| 37 | unit, | 38 | unit, |
| @@ -41,6 +42,7 @@ | @@ -41,6 +42,7 @@ | ||
| 41 | progressBarCircle, | 42 | progressBarCircle, |
| 42 | instrumentPanelColor, | 43 | instrumentPanelColor, |
| 43 | showTime, | 44 | showTime, |
| 45 | + maxNumber, | ||
| 44 | } = componentInfo || {}; | 46 | } = componentInfo || {}; |
| 45 | return { | 47 | return { |
| 46 | unit: unit ?? presetUnit, | 48 | unit: unit ?? presetUnit, |
| @@ -51,6 +53,7 @@ | @@ -51,6 +53,7 @@ | ||
| 51 | progressBarCircle: progressBarCircle ?? presetProgressBarCircle, | 53 | progressBarCircle: progressBarCircle ?? presetProgressBarCircle, |
| 52 | gradientInfo: gradientInfo ?? presetGradientInfo, | 54 | gradientInfo: gradientInfo ?? presetGradientInfo, |
| 53 | showTime: showTime ?? persetShowTime, | 55 | showTime: showTime ?? persetShowTime, |
| 56 | + maxNumber: maxNumber || persetMaxNumber, | ||
| 54 | }; | 57 | }; |
| 55 | }); | 58 | }); |
| 56 | 59 | ||
| @@ -68,7 +71,7 @@ | @@ -68,7 +71,7 @@ | ||
| 68 | const titleValue = ref<number>(20); | 71 | const titleValue = ref<number>(20); |
| 69 | 72 | ||
| 70 | const options = (): EChartsOption => { | 73 | const options = (): EChartsOption => { |
| 71 | - const { unit, fontColor, progressBarCircle, gradientInfo } = unref(getDesign); | 74 | + const { unit, fontColor, progressBarCircle, gradientInfo, maxNumber } = unref(getDesign); |
| 72 | const instrumentPanelColor = getStageColor(gradientInfo); | 75 | const instrumentPanelColor = getStageColor(gradientInfo); |
| 73 | return { | 76 | return { |
| 74 | title: { | 77 | title: { |
| @@ -85,6 +88,8 @@ | @@ -85,6 +88,8 @@ | ||
| 85 | { | 88 | { |
| 86 | type: 'gauge', | 89 | type: 'gauge', |
| 87 | center: ['50%', '50%'], | 90 | center: ['50%', '50%'], |
| 91 | + min: 0, | ||
| 92 | + max: maxNumber, | ||
| 88 | startAngle: '90', | 93 | startAngle: '90', |
| 89 | endAngle: '-270', | 94 | endAngle: '-270', |
| 90 | progress: { | 95 | progress: { |
| @@ -64,7 +64,7 @@ | @@ -64,7 +64,7 @@ | ||
| 64 | case 1: | 64 | case 1: |
| 65 | return (offsetList.value = [ | 65 | return (offsetList.value = [ |
| 66 | ['0%', '0%'], | 66 | ['0%', '0%'], |
| 67 | - ['0%', '10%'], | 67 | + ['0%', '15%'], |
| 68 | ]); | 68 | ]); |
| 69 | break; | 69 | break; |
| 70 | case 2: | 70 | case 2: |
| @@ -119,7 +119,7 @@ | @@ -119,7 +119,7 @@ | ||
| 119 | : ['0%', '60%'], | 119 | : ['0%', '60%'], |
| 120 | ]); | 120 | ]); |
| 121 | break; | 121 | break; |
| 122 | - case 6 || 7 || 8 || 9 || 10: | 122 | + case 6: |
| 123 | return (offsetList.value = [ | 123 | return (offsetList.value = [ |
| 124 | index == 0 | 124 | index == 0 |
| 125 | ? ['0%', '-55%'] | 125 | ? ['0%', '-55%'] |
| @@ -256,23 +256,6 @@ | @@ -256,23 +256,6 @@ | ||
| 256 | chartInstance.value.setOption(options()); | 256 | chartInstance.value.setOption(options()); |
| 257 | }; | 257 | }; |
| 258 | 258 | ||
| 259 | - // const randomFn = () => { | ||
| 260 | - // gaugeData[0].value = +(Math.random() * 100).toFixed(2); | ||
| 261 | - // gaugeData[1].value = +(Math.random() * 100).toFixed(2); | ||
| 262 | - // useIntervalFn(() => { | ||
| 263 | - // unref(chartInstance)?.setOption({ | ||
| 264 | - // series: [ | ||
| 265 | - // { | ||
| 266 | - // data: gaugeData, | ||
| 267 | - // pointer: { | ||
| 268 | - // show: false, | ||
| 269 | - // }, | ||
| 270 | - // }, | ||
| 271 | - // ], | ||
| 272 | - // }); | ||
| 273 | - // }, 3000); | ||
| 274 | - // }; | ||
| 275 | - | ||
| 276 | const { forEachGroupMessage } = useReceiveMessage(); | 259 | const { forEachGroupMessage } = useReceiveMessage(); |
| 277 | const { getNumberValue } = useReceiveValue(); | 260 | const { getNumberValue } = useReceiveValue(); |
| 278 | const updateFn: MultipleDataFetchUpdateFn = (message, deviceId, attribute) => { | 261 | const updateFn: MultipleDataFetchUpdateFn = (message, deviceId, attribute) => { |
| @@ -21,6 +21,7 @@ export const option: PublicPresetOptions = { | @@ -21,6 +21,7 @@ export const option: PublicPresetOptions = { | ||
| 21 | [ComponentConfigFieldEnum.FONT_COLOR]: '#FD7347', | 21 | [ComponentConfigFieldEnum.FONT_COLOR]: '#FD7347', |
| 22 | [ComponentConfigFieldEnum.SHOW_DEVICE_NAME]: false, | 22 | [ComponentConfigFieldEnum.SHOW_DEVICE_NAME]: false, |
| 23 | [ComponentConfigFieldEnum.SHOW_TIME]: false, | 23 | [ComponentConfigFieldEnum.SHOW_TIME]: false, |
| 24 | + [ComponentConfigFieldEnum.MAX_NUMBER]: 100, | ||
| 24 | [ComponentConfigFieldEnum.UNIT]: 'kw', | 25 | [ComponentConfigFieldEnum.UNIT]: 'kw', |
| 25 | }; | 26 | }; |
| 26 | 27 |
| 1 | <script lang="ts" setup> | 1 | <script lang="ts" setup> |
| 2 | + import { nextTick } from 'vue'; | ||
| 2 | import { ComponentConfigFieldEnum } from '../../../enum'; | 3 | import { ComponentConfigFieldEnum } from '../../../enum'; |
| 3 | import { option } from './config'; | 4 | import { option } from './config'; |
| 4 | import { useForm, BasicForm } from '/@/components/Form'; | 5 | import { useForm, BasicForm } from '/@/components/Form'; |
| @@ -32,6 +33,27 @@ | @@ -32,6 +33,27 @@ | ||
| 32 | component: 'Checkbox', | 33 | component: 'Checkbox', |
| 33 | defaultValue: option.showTime, | 34 | defaultValue: option.showTime, |
| 34 | }, | 35 | }, |
| 36 | + { | ||
| 37 | + field: ComponentConfigFieldEnum.MAX_NUMBER, | ||
| 38 | + label: '最大值', | ||
| 39 | + component: 'InputNumber', | ||
| 40 | + defaultValue: 100, | ||
| 41 | + componentProps: ({ formActionType }) => { | ||
| 42 | + const { setFieldsValue } = formActionType; | ||
| 43 | + return { | ||
| 44 | + placeholder: '请输入最大值', | ||
| 45 | + min: 100, | ||
| 46 | + onChange: async (e) => { | ||
| 47 | + if (!e) { | ||
| 48 | + await nextTick(); | ||
| 49 | + setFieldsValue({ | ||
| 50 | + [ComponentConfigFieldEnum.MAX_NUMBER]: 100, | ||
| 51 | + }); | ||
| 52 | + } | ||
| 53 | + }, | ||
| 54 | + }; | ||
| 55 | + }, | ||
| 56 | + }, | ||
| 35 | ], | 57 | ], |
| 36 | showActionButtonGroup: false, | 58 | showActionButtonGroup: false, |
| 37 | labelWidth: 120, | 59 | labelWidth: 120, |
| @@ -48,18 +70,20 @@ | @@ -48,18 +70,20 @@ | ||
| 48 | unit: item[ComponentConfigFieldEnum.UNIT], | 70 | unit: item[ComponentConfigFieldEnum.UNIT], |
| 49 | showDeviceName: item[ComponentConfigFieldEnum.SHOW_DEVICE_NAME], | 71 | showDeviceName: item[ComponentConfigFieldEnum.SHOW_DEVICE_NAME], |
| 50 | showTime: item[ComponentConfigFieldEnum.SHOW_TIME], | 72 | showTime: item[ComponentConfigFieldEnum.SHOW_TIME], |
| 73 | + maxNumber: item[ComponentConfigFieldEnum.MAX_NUMBER], | ||
| 51 | } as ComponentInfo; | 74 | } as ComponentInfo; |
| 52 | }; | 75 | }; |
| 53 | 76 | ||
| 54 | const setFormValues = (data: Recordable) => { | 77 | const setFormValues = (data: Recordable) => { |
| 55 | // return setFieldsValue(data); | 78 | // return setFieldsValue(data); |
| 56 | - const { unit, fontColor, showDeviceName, showTime } = data; | 79 | + const { unit, fontColor, showDeviceName, showTime, maxNumber } = data; |
| 57 | 80 | ||
| 58 | const value = { | 81 | const value = { |
| 59 | [ComponentConfigFieldEnum.UNIT]: unit, | 82 | [ComponentConfigFieldEnum.UNIT]: unit, |
| 60 | [ComponentConfigFieldEnum.FONT_COLOR]: fontColor, | 83 | [ComponentConfigFieldEnum.FONT_COLOR]: fontColor, |
| 61 | [ComponentConfigFieldEnum.SHOW_DEVICE_NAME]: showDeviceName, | 84 | [ComponentConfigFieldEnum.SHOW_DEVICE_NAME]: showDeviceName, |
| 62 | [ComponentConfigFieldEnum.SHOW_TIME]: showTime, | 85 | [ComponentConfigFieldEnum.SHOW_TIME]: showTime, |
| 86 | + [ComponentConfigFieldEnum.MAX_NUMBER]: maxNumber, | ||
| 63 | }; | 87 | }; |
| 64 | return setFieldsValue(value); | 88 | return setFieldsValue(value); |
| 65 | }; | 89 | }; |
| @@ -30,9 +30,17 @@ | @@ -30,9 +30,17 @@ | ||
| 30 | instrumentPanelColor: presetInstrumentPanelColor, | 30 | instrumentPanelColor: presetInstrumentPanelColor, |
| 31 | gradientInfo: presetGradientInfo, | 31 | gradientInfo: presetGradientInfo, |
| 32 | showTime: persetShowTime, | 32 | showTime: persetShowTime, |
| 33 | + maxNumber: persetMaxNumber, | ||
| 33 | } = persetOption || {}; | 34 | } = persetOption || {}; |
| 34 | - const { unit, fontColor, pointerColor, instrumentPanelColor, gradientInfo, showTime } = | ||
| 35 | - componentInfo || {}; | 35 | + const { |
| 36 | + unit, | ||
| 37 | + fontColor, | ||
| 38 | + pointerColor, | ||
| 39 | + instrumentPanelColor, | ||
| 40 | + gradientInfo, | ||
| 41 | + showTime, | ||
| 42 | + maxNumber, | ||
| 43 | + } = componentInfo || {}; | ||
| 36 | return { | 44 | return { |
| 37 | unit: unit ?? presetUnit, | 45 | unit: unit ?? presetUnit, |
| 38 | fontColor: fontColor ?? presetFontColor, | 46 | fontColor: fontColor ?? presetFontColor, |
| @@ -41,17 +49,20 @@ | @@ -41,17 +49,20 @@ | ||
| 41 | instrumentPanelColor: instrumentPanelColor ?? presetInstrumentPanelColor, | 49 | instrumentPanelColor: instrumentPanelColor ?? presetInstrumentPanelColor, |
| 42 | gradientInfo: gradientInfo ?? presetGradientInfo, | 50 | gradientInfo: gradientInfo ?? presetGradientInfo, |
| 43 | showTime: showTime ?? persetShowTime, | 51 | showTime: showTime ?? persetShowTime, |
| 52 | + maxNumber: maxNumber || persetMaxNumber, | ||
| 44 | }; | 53 | }; |
| 45 | }); | 54 | }); |
| 46 | 55 | ||
| 47 | const options = (): EChartsOption => { | 56 | const options = (): EChartsOption => { |
| 48 | - const { unit, fontColor, pointerColor } = unref(getDesign); | 57 | + const { unit, fontColor, pointerColor, maxNumber } = unref(getDesign); |
| 49 | 58 | ||
| 50 | // getStageColor(gradientInfo); | 59 | // getStageColor(gradientInfo); |
| 51 | return { | 60 | return { |
| 52 | series: [ | 61 | series: [ |
| 53 | { | 62 | { |
| 54 | type: 'gauge', | 63 | type: 'gauge', |
| 64 | + min: 0, | ||
| 65 | + max: maxNumber, | ||
| 55 | progress: { | 66 | progress: { |
| 56 | show: true, | 67 | show: true, |
| 57 | width: unref(getRatio) ? 6 * unref(getRatio) : 6, | 68 | width: unref(getRatio) ? 6 * unref(getRatio) : 6, |
| @@ -13,6 +13,7 @@ export const option: PublicPresetOptions = { | @@ -13,6 +13,7 @@ export const option: PublicPresetOptions = { | ||
| 13 | [ComponentConfigFieldEnum.FONT_COLOR]: '#FD7347', | 13 | [ComponentConfigFieldEnum.FONT_COLOR]: '#FD7347', |
| 14 | [ComponentConfigFieldEnum.SHOW_DEVICE_NAME]: false, | 14 | [ComponentConfigFieldEnum.SHOW_DEVICE_NAME]: false, |
| 15 | [ComponentConfigFieldEnum.SHOW_TIME]: false, | 15 | [ComponentConfigFieldEnum.SHOW_TIME]: false, |
| 16 | + [ComponentConfigFieldEnum.MAX_NUMBER]: 100, | ||
| 16 | [ComponentConfigFieldEnum.UNIT]: '℃', | 17 | [ComponentConfigFieldEnum.UNIT]: '℃', |
| 17 | }; | 18 | }; |
| 18 | 19 |
| 1 | <script lang="ts" setup> | 1 | <script lang="ts" setup> |
| 2 | + import { nextTick } from 'vue'; | ||
| 2 | import { ComponentConfigFieldEnum } from '../../../enum'; | 3 | import { ComponentConfigFieldEnum } from '../../../enum'; |
| 3 | import { option } from './config'; | 4 | import { option } from './config'; |
| 4 | import { useForm, BasicForm } from '/@/components/Form'; | 5 | import { useForm, BasicForm } from '/@/components/Form'; |
| @@ -31,6 +32,27 @@ | @@ -31,6 +32,27 @@ | ||
| 31 | component: 'Checkbox', | 32 | component: 'Checkbox', |
| 32 | defaultValue: option.showTime, | 33 | defaultValue: option.showTime, |
| 33 | }, | 34 | }, |
| 35 | + { | ||
| 36 | + field: ComponentConfigFieldEnum.MAX_NUMBER, | ||
| 37 | + label: '最大值', | ||
| 38 | + component: 'InputNumber', | ||
| 39 | + defaultValue: 100, | ||
| 40 | + componentProps: ({ formActionType }) => { | ||
| 41 | + const { setFieldsValue } = formActionType; | ||
| 42 | + return { | ||
| 43 | + placeholder: '请输入最大值', | ||
| 44 | + min: 100, | ||
| 45 | + onChange: async (e) => { | ||
| 46 | + if (!e) { | ||
| 47 | + await nextTick(); | ||
| 48 | + setFieldsValue({ | ||
| 49 | + [ComponentConfigFieldEnum.MAX_NUMBER]: 100, | ||
| 50 | + }); | ||
| 51 | + } | ||
| 52 | + }, | ||
| 53 | + }; | ||
| 54 | + }, | ||
| 55 | + }, | ||
| 34 | ], | 56 | ], |
| 35 | showActionButtonGroup: false, | 57 | showActionButtonGroup: false, |
| 36 | labelWidth: 120, | 58 | labelWidth: 120, |
| @@ -31,28 +31,30 @@ | @@ -31,28 +31,30 @@ | ||
| 31 | fontColor: presetFontColor, | 31 | fontColor: presetFontColor, |
| 32 | unit: presetUnit, | 32 | unit: presetUnit, |
| 33 | showTime: persetShowTime, | 33 | showTime: persetShowTime, |
| 34 | + maxNumber: persetMaxNumber, | ||
| 34 | } = persetOption || {}; | 35 | } = persetOption || {}; |
| 35 | - const { unit, fontColor, showTime } = componentInfo || {}; | 36 | + const { unit, fontColor, showTime, maxNumber } = componentInfo || {}; |
| 36 | return { | 37 | return { |
| 37 | unit: unit ?? presetUnit, | 38 | unit: unit ?? presetUnit, |
| 38 | fontColor: fontColor ?? presetFontColor, | 39 | fontColor: fontColor ?? presetFontColor, |
| 39 | attribute: attributeRename || attributeName || attribute, | 40 | attribute: attributeRename || attributeName || attribute, |
| 40 | showTime: persetShowTime || showTime, | 41 | showTime: persetShowTime || showTime, |
| 42 | + maxNumber: maxNumber || persetMaxNumber, | ||
| 41 | }; | 43 | }; |
| 42 | }); | 44 | }); |
| 43 | 45 | ||
| 44 | const options = (): EChartsOption => { | 46 | const options = (): EChartsOption => { |
| 45 | - const { unit, fontColor } = unref(getDesign); | 47 | + const { unit, fontColor, maxNumber } = unref(getDesign); |
| 46 | return { | 48 | return { |
| 47 | series: [ | 49 | series: [ |
| 48 | { | 50 | { |
| 49 | type: 'gauge', | 51 | type: 'gauge', |
| 52 | + min: 0, | ||
| 53 | + max: maxNumber, | ||
| 50 | radius: '50%', | 54 | radius: '50%', |
| 51 | center: ['50%', '60%'], | 55 | center: ['50%', '60%'], |
| 52 | startAngle: 200, | 56 | startAngle: 200, |
| 53 | endAngle: -20, | 57 | endAngle: -20, |
| 54 | - min: 0, | ||
| 55 | - max: 100, | ||
| 56 | splitNumber: 10, | 58 | splitNumber: 10, |
| 57 | itemStyle: { | 59 | itemStyle: { |
| 58 | color: fontColor, | 60 | color: fontColor, |
| @@ -120,7 +122,7 @@ | @@ -120,7 +122,7 @@ | ||
| 120 | startAngle: 200, | 122 | startAngle: 200, |
| 121 | endAngle: -20, | 123 | endAngle: -20, |
| 122 | min: 0, | 124 | min: 0, |
| 123 | - max: 100, | 125 | + max: maxNumber, |
| 124 | itemStyle: { | 126 | itemStyle: { |
| 125 | color: fontColor, | 127 | color: fontColor, |
| 126 | }, | 128 | }, |
| @@ -30,6 +30,7 @@ export const option: PublicPresetOptions = { | @@ -30,6 +30,7 @@ export const option: PublicPresetOptions = { | ||
| 30 | [ComponentConfigFieldEnum.UNIT]: 'km/h', | 30 | [ComponentConfigFieldEnum.UNIT]: 'km/h', |
| 31 | [ComponentConfigFieldEnum.SHOW_DEVICE_NAME]: false, | 31 | [ComponentConfigFieldEnum.SHOW_DEVICE_NAME]: false, |
| 32 | [ComponentConfigFieldEnum.SHOW_TIME]: false, | 32 | [ComponentConfigFieldEnum.SHOW_TIME]: false, |
| 33 | + [ComponentConfigFieldEnum.MAX_NUMBER]: 100, | ||
| 33 | }; | 34 | }; |
| 34 | 35 | ||
| 35 | export default class Config extends PublicConfigClass implements CreateComponentType { | 36 | export default class Config extends PublicConfigClass implements CreateComponentType { |
| @@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
| 4 | import { PublicFormInstaceType } from '/@/views/visual/dataSourceBindPanel/index.type'; | 4 | import { PublicFormInstaceType } from '/@/views/visual/dataSourceBindPanel/index.type'; |
| 5 | import { Gradient, GradientColor, option } from './config'; | 5 | import { Gradient, GradientColor, option } from './config'; |
| 6 | import { ComponentInfo } from '/@/views/visual/palette/types'; | 6 | import { ComponentInfo } from '/@/views/visual/palette/types'; |
| 7 | + import { nextTick } from 'vue'; | ||
| 7 | 8 | ||
| 8 | const [register, { getFieldsValue, setFieldsValue, resetFields }] = useForm({ | 9 | const [register, { getFieldsValue, setFieldsValue, resetFields }] = useForm({ |
| 9 | schemas: [ | 10 | schemas: [ |
| @@ -87,6 +88,27 @@ | @@ -87,6 +88,27 @@ | ||
| 87 | component: 'Checkbox', | 88 | component: 'Checkbox', |
| 88 | defaultValue: option.showTime, | 89 | defaultValue: option.showTime, |
| 89 | }, | 90 | }, |
| 91 | + { | ||
| 92 | + field: ComponentConfigFieldEnum.MAX_NUMBER, | ||
| 93 | + label: '最大值', | ||
| 94 | + component: 'InputNumber', | ||
| 95 | + defaultValue: 100, | ||
| 96 | + componentProps: ({ formActionType }) => { | ||
| 97 | + const { setFieldsValue } = formActionType; | ||
| 98 | + return { | ||
| 99 | + placeholder: '请输入最大值', | ||
| 100 | + min: 100, | ||
| 101 | + onChange: async (e) => { | ||
| 102 | + if (!e) { | ||
| 103 | + await nextTick(); | ||
| 104 | + setFieldsValue({ | ||
| 105 | + [ComponentConfigFieldEnum.MAX_NUMBER]: 100, | ||
| 106 | + }); | ||
| 107 | + } | ||
| 108 | + }, | ||
| 109 | + }; | ||
| 110 | + }, | ||
| 111 | + }, | ||
| 90 | ], | 112 | ], |
| 91 | showActionButtonGroup: false, | 113 | showActionButtonGroup: false, |
| 92 | labelWidth: 120, | 114 | labelWidth: 120, |
| @@ -119,11 +141,12 @@ | @@ -119,11 +141,12 @@ | ||
| 119 | unit: value[ComponentConfigFieldEnum.UNIT], | 141 | unit: value[ComponentConfigFieldEnum.UNIT], |
| 120 | showDeviceName: value[ComponentConfigFieldEnum.SHOW_DEVICE_NAME], | 142 | showDeviceName: value[ComponentConfigFieldEnum.SHOW_DEVICE_NAME], |
| 121 | showTime: value[ComponentConfigFieldEnum.SHOW_TIME], | 143 | showTime: value[ComponentConfigFieldEnum.SHOW_TIME], |
| 144 | + maxNumber: value[ComponentConfigFieldEnum.MAX_NUMBER], | ||
| 122 | } as ComponentInfo; | 145 | } as ComponentInfo; |
| 123 | }; | 146 | }; |
| 124 | 147 | ||
| 125 | const setFormValues = (data: ComponentInfo) => { | 148 | const setFormValues = (data: ComponentInfo) => { |
| 126 | - const { gradientInfo, unit, fontColor, showDeviceName, showTime } = data; | 149 | + const { gradientInfo, unit, fontColor, showDeviceName, showTime, maxNumber } = data; |
| 127 | const firstRecord = gradientInfo.find((item) => item.key === Gradient.FIRST); | 150 | const firstRecord = gradientInfo.find((item) => item.key === Gradient.FIRST); |
| 128 | const secondRecord = gradientInfo.find((item) => item.key === Gradient.SECOND); | 151 | const secondRecord = gradientInfo.find((item) => item.key === Gradient.SECOND); |
| 129 | const thirdRecord = gradientInfo.find((item) => item.key === Gradient.THIRD); | 152 | const thirdRecord = gradientInfo.find((item) => item.key === Gradient.THIRD); |
| @@ -132,6 +155,7 @@ | @@ -132,6 +155,7 @@ | ||
| 132 | [ComponentConfigFieldEnum.FONT_COLOR]: fontColor, | 155 | [ComponentConfigFieldEnum.FONT_COLOR]: fontColor, |
| 133 | [ComponentConfigFieldEnum.SHOW_DEVICE_NAME]: showDeviceName, | 156 | [ComponentConfigFieldEnum.SHOW_DEVICE_NAME]: showDeviceName, |
| 134 | [ComponentConfigFieldEnum.SHOW_TIME]: showTime, | 157 | [ComponentConfigFieldEnum.SHOW_TIME]: showTime, |
| 158 | + [ComponentConfigFieldEnum.MAX_NUMBER]: maxNumber, | ||
| 135 | [ComponentConfigFieldEnum.FIRST_PHASE_VALUE]: firstRecord?.value, | 159 | [ComponentConfigFieldEnum.FIRST_PHASE_VALUE]: firstRecord?.value, |
| 136 | [ComponentConfigFieldEnum.FIRST_PHASE_COLOR]: firstRecord?.color, | 160 | [ComponentConfigFieldEnum.FIRST_PHASE_COLOR]: firstRecord?.color, |
| 137 | [ComponentConfigFieldEnum.SECOND_PHASE_VALUE]: secondRecord?.value, | 161 | [ComponentConfigFieldEnum.SECOND_PHASE_VALUE]: secondRecord?.value, |
| @@ -37,15 +37,17 @@ | @@ -37,15 +37,17 @@ | ||
| 37 | unit: presetUnit, | 37 | unit: presetUnit, |
| 38 | gradientInfo: presetGradientInfo, | 38 | gradientInfo: presetGradientInfo, |
| 39 | showTime: persetShowTime, | 39 | showTime: persetShowTime, |
| 40 | + maxNumber: persetMaxNumber, | ||
| 40 | } = persetOption || {}; | 41 | } = persetOption || {}; |
| 41 | 42 | ||
| 42 | - const { unit, fontColor, gradientInfo, showTime } = componentInfo || {}; | 43 | + const { unit, fontColor, gradientInfo, showTime, maxNumber } = componentInfo || {}; |
| 43 | return { | 44 | return { |
| 44 | unit: unit ?? presetUnit, | 45 | unit: unit ?? presetUnit, |
| 45 | fontColor: fontColor ?? presetFontColor, | 46 | fontColor: fontColor ?? presetFontColor, |
| 46 | gradientInfo: gradientInfo ?? presetGradientInfo, | 47 | gradientInfo: gradientInfo ?? presetGradientInfo, |
| 47 | attribute: attributeRename || attributeName || attribute, | 48 | attribute: attributeRename || attributeName || attribute, |
| 48 | showTime: showTime || persetShowTime, | 49 | showTime: showTime || persetShowTime, |
| 50 | + maxNumber: maxNumber || persetMaxNumber, | ||
| 49 | }; | 51 | }; |
| 50 | }); | 52 | }); |
| 51 | 53 | ||
| @@ -55,7 +57,7 @@ | @@ -55,7 +57,7 @@ | ||
| 55 | }; | 57 | }; |
| 56 | 58 | ||
| 57 | const options = (): EChartsOption => { | 59 | const options = (): EChartsOption => { |
| 58 | - const { gradientInfo, unit, fontColor } = unref(getDesign); | 60 | + const { gradientInfo, unit, fontColor, maxNumber } = unref(getDesign); |
| 59 | const firstRecord = getGradient(Gradient.FIRST, gradientInfo); | 61 | const firstRecord = getGradient(Gradient.FIRST, gradientInfo); |
| 60 | const secondRecord = getGradient(Gradient.SECOND, gradientInfo); | 62 | const secondRecord = getGradient(Gradient.SECOND, gradientInfo); |
| 61 | const thirdRecord = getGradient(Gradient.THIRD, gradientInfo); | 63 | const thirdRecord = getGradient(Gradient.THIRD, gradientInfo); |
| @@ -69,18 +71,18 @@ | @@ -69,18 +71,18 @@ | ||
| 69 | .join('') | 71 | .join('') |
| 70 | ); | 72 | ); |
| 71 | 73 | ||
| 72 | - const firstGradient = firstRecord?.value ? firstRecord.value / max : 0.3; | ||
| 73 | - const secondGradient = secondRecord?.value ? secondRecord.value / max : 0.7; | 74 | + const firstGradient = firstRecord?.value ? firstRecord.value / maxNumber : 0.3; |
| 75 | + const secondGradient = secondRecord?.value ? secondRecord.value / maxNumber : 0.7; | ||
| 74 | 76 | ||
| 75 | return { | 77 | return { |
| 76 | series: [ | 78 | series: [ |
| 77 | { | 79 | { |
| 78 | type: 'gauge', | 80 | type: 'gauge', |
| 79 | min: 0, | 81 | min: 0, |
| 80 | - max, | 82 | + max: maxNumber, |
| 81 | axisLine: { | 83 | axisLine: { |
| 82 | lineStyle: { | 84 | lineStyle: { |
| 83 | - width: 20, | 85 | + width: unref(getRatio) ? 20 * unref(getRatio) : 20, |
| 84 | color: [ | 86 | color: [ |
| 85 | [firstGradient, firstRecord?.color || GradientColor.FIRST], | 87 | [firstGradient, firstRecord?.color || GradientColor.FIRST], |
| 86 | [secondGradient, secondRecord?.color || GradientColor.SECOND], | 88 | [secondGradient, secondRecord?.color || GradientColor.SECOND], |
| @@ -94,33 +96,33 @@ | @@ -94,33 +96,33 @@ | ||
| 94 | }, | 96 | }, |
| 95 | }, | 97 | }, |
| 96 | axisTick: { | 98 | axisTick: { |
| 97 | - distance: -30, | 99 | + distance: unref(getRatio) ? -30 * unref(getRatio) : -30, |
| 98 | length: 8, | 100 | length: 8, |
| 99 | splitNumber: max / 100, | 101 | splitNumber: max / 100, |
| 100 | lineStyle: { | 102 | lineStyle: { |
| 101 | color: '#fff', | 103 | color: '#fff', |
| 102 | - width: 2, | 104 | + width: unref(getRatio) ? 2 * unref(getRatio) : 2, |
| 103 | }, | 105 | }, |
| 104 | }, | 106 | }, |
| 105 | splitLine: { | 107 | splitLine: { |
| 106 | - distance: -10, | ||
| 107 | - length: 30, | 108 | + distance: unref(getRatio) ? -10 * unref(getRatio) : -10, |
| 109 | + length: unref(getRatio) ? unref(getRatio) * 30 : 30, | ||
| 108 | lineStyle: { | 110 | lineStyle: { |
| 109 | color: '#fff', | 111 | color: '#fff', |
| 110 | - width: 4, | 112 | + width: unref(getRatio) ? unref(getRatio) * 4 : 4, |
| 111 | }, | 113 | }, |
| 112 | }, | 114 | }, |
| 113 | axisLabel: { | 115 | axisLabel: { |
| 114 | color: 'inherit', | 116 | color: 'inherit', |
| 115 | - distance: 5, | ||
| 116 | - fontSize: 6, | 117 | + distance: unref(getRatio) ? unref(getRatio) * 5 : 5, |
| 118 | + fontSize: unref(getRatio) ? unref(getRatio) * 6 : 6, | ||
| 117 | }, | 119 | }, |
| 118 | detail: { | 120 | detail: { |
| 119 | valueAnimation: true, | 121 | valueAnimation: true, |
| 120 | formatter: `{value} ${unit ?? ''}`, | 122 | formatter: `{value} ${unit ?? ''}`, |
| 121 | color: fontColor || 'inherit', | 123 | color: fontColor || 'inherit', |
| 122 | offsetCenter: [0, '70%'], | 124 | offsetCenter: [0, '70%'], |
| 123 | - fontSize: 14, | 125 | + fontSize: unref(getRatio) ? unref(getRatio) * 14 : 14, |
| 124 | }, | 126 | }, |
| 125 | data: [ | 127 | data: [ |
| 126 | { | 128 | { |
| @@ -12,6 +12,7 @@ import { ComponentConfigFieldEnum } from '/@/views/visual/packages/enum'; | @@ -12,6 +12,7 @@ import { ComponentConfigFieldEnum } from '/@/views/visual/packages/enum'; | ||
| 12 | export const option: PublicPresetOptions = { | 12 | export const option: PublicPresetOptions = { |
| 13 | multipleDataSourceComponent: true, | 13 | multipleDataSourceComponent: true, |
| 14 | [ComponentConfigFieldEnum.FONT_COLOR]: '#000', | 14 | [ComponentConfigFieldEnum.FONT_COLOR]: '#000', |
| 15 | + [ComponentConfigFieldEnum.MAX_NUMBER]: 100, | ||
| 15 | [ComponentConfigFieldEnum.UNIT]: '℃', | 16 | [ComponentConfigFieldEnum.UNIT]: '℃', |
| 16 | [ComponentConfigFieldEnum.SHOW_DEVICE_NAME]: false, | 17 | [ComponentConfigFieldEnum.SHOW_DEVICE_NAME]: false, |
| 17 | [ComponentConfigFieldEnum.BACKGROUND_COLOR]: '#377dff', | 18 | [ComponentConfigFieldEnum.BACKGROUND_COLOR]: '#377dff', |
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | import { useForm, BasicForm } from '/@/components/Form'; | 3 | import { useForm, BasicForm } from '/@/components/Form'; |
| 4 | import { PublicFormInstaceType } from '/@/views/visual/dataSourceBindPanel/index.type'; | 4 | import { PublicFormInstaceType } from '/@/views/visual/dataSourceBindPanel/index.type'; |
| 5 | import { option } from './config'; | 5 | import { option } from './config'; |
| 6 | + import { nextTick } from 'vue'; | ||
| 6 | const [register, { getFieldsValue, setFieldsValue, resetFields }] = useForm({ | 7 | const [register, { getFieldsValue, setFieldsValue, resetFields }] = useForm({ |
| 7 | schemas: [ | 8 | schemas: [ |
| 8 | { | 9 | { |
| @@ -23,7 +24,27 @@ | @@ -23,7 +24,27 @@ | ||
| 23 | defaultValue: option.backgroundColor, | 24 | defaultValue: option.backgroundColor, |
| 24 | }, | 25 | }, |
| 25 | }, | 26 | }, |
| 26 | - | 27 | + { |
| 28 | + field: ComponentConfigFieldEnum.MAX_NUMBER, | ||
| 29 | + label: '最大值', | ||
| 30 | + component: 'InputNumber', | ||
| 31 | + defaultValue: 100, | ||
| 32 | + componentProps: ({ formActionType }) => { | ||
| 33 | + const { setFieldsValue } = formActionType; | ||
| 34 | + return { | ||
| 35 | + placeholder: '请输入最大值', | ||
| 36 | + min: 100, | ||
| 37 | + onChange: async (e) => { | ||
| 38 | + if (!e) { | ||
| 39 | + await nextTick(); | ||
| 40 | + setFieldsValue({ | ||
| 41 | + [ComponentConfigFieldEnum.MAX_NUMBER]: 100, | ||
| 42 | + }); | ||
| 43 | + } | ||
| 44 | + }, | ||
| 45 | + }; | ||
| 46 | + }, | ||
| 47 | + }, | ||
| 27 | { | 48 | { |
| 28 | field: ComponentConfigFieldEnum.UNIT, | 49 | field: ComponentConfigFieldEnum.UNIT, |
| 29 | label: '数值单位', | 50 | label: '数值单位', |
| 1 | <script lang="ts" setup> | 1 | <script lang="ts" setup> |
| 2 | import { option } from './config'; | 2 | import { option } from './config'; |
| 3 | import { ComponentPropsConfigType } from '../../../index.type'; | 3 | import { ComponentPropsConfigType } from '../../../index.type'; |
| 4 | - import { Progress } from 'ant-design-vue'; | 4 | + import { Slider } from 'ant-design-vue'; |
| 5 | import { DeviceName } from '/@/views/visual/commonComponents/DeviceName'; | 5 | import { DeviceName } from '/@/views/visual/commonComponents/DeviceName'; |
| 6 | import { useReceiveMessage } from '../../../hook/useReceiveMessage'; | 6 | import { useReceiveMessage } from '../../../hook/useReceiveMessage'; |
| 7 | import { buildUUID } from '/@/utils/uuid'; | 7 | import { buildUUID } from '/@/utils/uuid'; |
| @@ -28,6 +28,7 @@ | @@ -28,6 +28,7 @@ | ||
| 28 | deviceName?: string; | 28 | deviceName?: string; |
| 29 | attributeName?: string; | 29 | attributeName?: string; |
| 30 | deviceRename?: string; | 30 | deviceRename?: string; |
| 31 | + maxNumber?: number; | ||
| 31 | } | 32 | } |
| 32 | 33 | ||
| 33 | const defaultValue: PercentType[] = [ | 34 | const defaultValue: PercentType[] = [ |
| @@ -58,10 +59,11 @@ | @@ -58,10 +59,11 @@ | ||
| 58 | unit: presetUnit, | 59 | unit: presetUnit, |
| 59 | fontColor: presetFontColor, | 60 | fontColor: presetFontColor, |
| 60 | backgroundColor: persetBackgroundColor, | 61 | backgroundColor: persetBackgroundColor, |
| 62 | + maxNumber: persetMaxNumber, | ||
| 61 | } = persetOption || {}; | 63 | } = persetOption || {}; |
| 62 | return { | 64 | return { |
| 63 | dataSource: dataSource.map((item) => { | 65 | dataSource: dataSource.map((item) => { |
| 64 | - const { unit, fontColor, backgroundColor } = item.componentInfo || {}; | 66 | + const { unit, fontColor, backgroundColor, maxNumber } = item.componentInfo || {}; |
| 65 | const { attribute, attributeRename, deviceName, deviceRename, deviceId, attributeName } = | 67 | const { attribute, attributeRename, deviceName, deviceRename, deviceId, attributeName } = |
| 66 | item; | 68 | item; |
| 67 | return { | 69 | return { |
| @@ -71,7 +73,7 @@ | @@ -71,7 +73,7 @@ | ||
| 71 | deviceName: deviceRename || deviceName, | 73 | deviceName: deviceRename || deviceName, |
| 72 | attribute, | 74 | attribute, |
| 73 | attributeName: attributeRename || attributeName, | 75 | attributeName: attributeRename || attributeName, |
| 74 | - | 76 | + maxNumber: maxNumber || persetMaxNumber, |
| 75 | id: deviceId, | 77 | id: deviceId, |
| 76 | } as PercentType; | 78 | } as PercentType; |
| 77 | }), | 79 | }), |
| @@ -122,24 +124,39 @@ | @@ -122,24 +124,39 @@ | ||
| 122 | > | 124 | > |
| 123 | </div> | 125 | </div> |
| 124 | <div> | 126 | <div> |
| 125 | - <Progress :strokeColor="item.backgroundColor" :percent="item.value" :showInfo="false" /> | 127 | + <!-- <Progress :strokeColor="item.backgroundColor" :percent="item.value" :showInfo="false" /> --> |
| 128 | + <Slider | ||
| 129 | + ref="sliderEl" | ||
| 130 | + :style="{ '--slider-color': item.backgroundColor }" | ||
| 131 | + :value="item.value" | ||
| 132 | + :disabled="true" | ||
| 133 | + :min="0" | ||
| 134 | + :max="item.maxNumber" | ||
| 135 | + /> | ||
| 126 | </div> | 136 | </div> |
| 127 | </div> | 137 | </div> |
| 128 | <!-- <UpdateTime :time="time" /> --> | 138 | <!-- <UpdateTime :time="time" /> --> |
| 129 | </main> | 139 | </main> |
| 130 | </template> | 140 | </template> |
| 131 | <style lang="less" scoped> | 141 | <style lang="less" scoped> |
| 132 | - // :deep(.ant-progress-success-bg, .ant-progress-bg) { | ||
| 133 | - // background: '#2196F3' !important; | ||
| 134 | - // } | ||
| 135 | - // :deep(.ant-slider-handle) { | ||
| 136 | - // all: unset; | ||
| 137 | - // } | ||
| 138 | - // :deep(.ant-slider-track) { | ||
| 139 | - // background: var(--slider-color) !important; | ||
| 140 | - // height: 8px; | ||
| 141 | - // } | ||
| 142 | - // :deep(.ant-slider-rail) { | ||
| 143 | - // height: 8px; | ||
| 144 | - // } | 142 | + :deep(.ant-progress-success-bg, .ant-progress-bg) { |
| 143 | + background: #2196f3 !important; | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + :deep(.ant-slider-handle) { | ||
| 147 | + all: unset; | ||
| 148 | + } | ||
| 149 | + | ||
| 150 | + :deep(.ant-slider-track) { | ||
| 151 | + background: var(--slider-color) !important; | ||
| 152 | + height: 8px; | ||
| 153 | + } | ||
| 154 | + | ||
| 155 | + :deep(.ant-slider-rail) { | ||
| 156 | + height: 8px; | ||
| 157 | + } | ||
| 158 | + | ||
| 159 | + :deep(.ant-slider-disabled) { | ||
| 160 | + cursor: auto !important; | ||
| 161 | + } | ||
| 145 | </style> | 162 | </style> |
| @@ -60,6 +60,8 @@ export interface ComponentInfo { | @@ -60,6 +60,8 @@ export interface ComponentInfo { | ||
| 60 | instrumentPanelColor?: string; | 60 | instrumentPanelColor?: string; |
| 61 | // instrumentPanelWidth?: string | number; | 61 | // instrumentPanelWidth?: string | number; |
| 62 | progressBarCircle?: Boolean; | 62 | progressBarCircle?: Boolean; |
| 63 | + lineColor?: string; | ||
| 64 | + maxNumber?: number; | ||
| 63 | [key: string]: any; | 65 | [key: string]: any; |
| 64 | } | 66 | } |
| 65 | 67 |