Commit 1108ceb713a2998f011e35ff01c45716145977a9
1 parent
87909fce
fix: DEFECT-736 reset default color after color picker clean color
Showing
2 changed files
with
31 additions
and
2 deletions
... | ... | @@ -20,7 +20,7 @@ |
20 | 20 | }, |
21 | 21 | defaultValue: { |
22 | 22 | type: String, |
23 | - default: null, | |
23 | + default: '', | |
24 | 24 | }, |
25 | 25 | }); |
26 | 26 | |
... | ... | @@ -54,6 +54,7 @@ |
54 | 54 | const onClear = () => { |
55 | 55 | emit('update:value', props.defaultValue); |
56 | 56 | unref(picker)?.hide(); |
57 | + unref(picker)?.setColor(props.defaultValue); | |
57 | 58 | }; |
58 | 59 | |
59 | 60 | const getOption = computed<ColorPicker.Options>(() => { | ... | ... |
... | ... | @@ -28,6 +28,11 @@ export enum Gradient { |
28 | 28 | SECOND = 'second', |
29 | 29 | THIRD = 'third', |
30 | 30 | } |
31 | +export enum GradientColor { | |
32 | + FIRST = '#67e0e3', | |
33 | + SECOND = '#37a2da', | |
34 | + THIRD = '#fd666d', | |
35 | +} | |
31 | 36 | |
32 | 37 | export enum visualOptionField { |
33 | 38 | FONT_COLOR = 'fontColor', |
... | ... | @@ -48,6 +53,9 @@ export const modeOne: FormSchema[] = [ |
48 | 53 | label: '数值字体颜色', |
49 | 54 | component: 'ColorPicker', |
50 | 55 | changeEvent: 'update:value', |
56 | + componentProps: { | |
57 | + defaultValue: '#000', | |
58 | + }, | |
51 | 59 | }, |
52 | 60 | ]; |
53 | 61 | |
... | ... | @@ -57,6 +65,9 @@ export const modeTwo: FormSchema[] = [ |
57 | 65 | label: '数值字体颜色', |
58 | 66 | component: 'ColorPicker', |
59 | 67 | changeEvent: 'update:value', |
68 | + componentProps: { | |
69 | + defaultValue: '#000', | |
70 | + }, | |
60 | 71 | }, |
61 | 72 | { |
62 | 73 | field: visualOptionField.UNIT, |
... | ... | @@ -71,6 +82,9 @@ export const modeTwo: FormSchema[] = [ |
71 | 82 | label: '图标颜色', |
72 | 83 | component: 'ColorPicker', |
73 | 84 | changeEvent: 'update:value', |
85 | + componentProps: { | |
86 | + defaultValue: '#367BFF', | |
87 | + }, | |
74 | 88 | }, |
75 | 89 | { |
76 | 90 | field: visualOptionField.ICON, |
... | ... | @@ -81,7 +95,6 @@ export const modeTwo: FormSchema[] = [ |
81 | 95 | const color = formModel[visualOptionField.ICON_COLOR]; |
82 | 96 | return { |
83 | 97 | color, |
84 | - defaultValue: '#367BFF', | |
85 | 98 | }; |
86 | 99 | }, |
87 | 100 | }, |
... | ... | @@ -93,6 +106,9 @@ export const modeThree: FormSchema[] = [ |
93 | 106 | label: '数值字体颜色', |
94 | 107 | component: 'ColorPicker', |
95 | 108 | changeEvent: 'update:value', |
109 | + componentProps: { | |
110 | + defaultValue: '#000', | |
111 | + }, | |
96 | 112 | }, |
97 | 113 | { |
98 | 114 | field: visualOptionField.UNIT, |
... | ... | @@ -107,6 +123,9 @@ export const modeThree: FormSchema[] = [ |
107 | 123 | label: '一阶段颜色', |
108 | 124 | component: 'ColorPicker', |
109 | 125 | changeEvent: 'update:value', |
126 | + componentProps: { | |
127 | + defaultValue: GradientColor.FIRST, | |
128 | + }, | |
110 | 129 | }, |
111 | 130 | { |
112 | 131 | field: visualOptionField.FIRST_PHASE_VALUE, |
... | ... | @@ -122,6 +141,9 @@ export const modeThree: FormSchema[] = [ |
122 | 141 | label: '二阶段颜色', |
123 | 142 | component: 'ColorPicker', |
124 | 143 | changeEvent: 'update:value', |
144 | + componentProps: { | |
145 | + defaultValue: GradientColor.SECOND, | |
146 | + }, | |
125 | 147 | }, |
126 | 148 | { |
127 | 149 | field: visualOptionField.SECOND_PHASE_VALUE, |
... | ... | @@ -139,6 +161,9 @@ export const modeThree: FormSchema[] = [ |
139 | 161 | label: '三阶段颜色', |
140 | 162 | component: 'ColorPicker', |
141 | 163 | changeEvent: 'update:value', |
164 | + componentProps: { | |
165 | + defaultValue: GradientColor.THIRD, | |
166 | + }, | |
142 | 167 | }, |
143 | 168 | { |
144 | 169 | field: visualOptionField.THIRD_PHASE_VALUE, |
... | ... | @@ -159,6 +184,9 @@ export const modeFour: FormSchema[] = [ |
159 | 184 | label: '数值字体颜色', |
160 | 185 | component: 'ColorPicker', |
161 | 186 | changeEvent: 'update:value', |
187 | + componentProps: { | |
188 | + defaultValue: '#000', | |
189 | + }, | |
162 | 190 | }, |
163 | 191 | { |
164 | 192 | field: visualOptionField.UNIT, | ... | ... |