Commit a4fe715a206df80848f6f3f8dfbc2b2887e3ad3d

Authored by fengwotao
2 parents 1d745027 37658165

Merge branch 'main' into dev-ft

... ... @@ -21,7 +21,8 @@ VITE_PROXY = [["/api","https://dev.thingskit.com/api"],["/thingskit-drawio","htt
21 21 # 实时数据的ws地址
22 22 # VITE_WEB_SOCKET = ws://localhost:8080/api/ws/plugins/telemetry?token=
23 23 # VITE_WEB_SOCKET = ws://44.99.141.212:8080/api/ws/plugins/telemetry?token=
24   -VITE_WEB_SOCKET = ws://121.37.251.8:8080/api/ws/plugins/telemetry?token=
  24 +VITE_WEB_SOCKET = ws://dev.thingskit.com/api/ws/plugins/telemetry?token=
  25 +# VITE_WEB_SOCKET = ws://121.37.251.8:8080/api/ws/plugins/telemetry?token=
25 26
26 27 # Delete console
27 28 VITE_DROP_CONSOLE = true
... ...
... ... @@ -21,6 +21,7 @@
21 21 fontSize,
22 22 } from '../../detail/config/util';
23 23 import { Tooltip } from 'ant-design-vue';
  24 + import { useThrottleFn } from '@vueuse/shared';
24 25
25 26 const props = defineProps({
26 27 add: {
... ... @@ -81,23 +82,28 @@
81 82 return (_radio: number) => {};
82 83 };
83 84
84   - watch(
85   - () => props.value.value,
86   - (newValue) => {
87   - const updateFn = getUpdateValueFn(props.layout.componentType);
88   - unref(chartRef)?.setOption((updateFn(newValue || 0) as unknown as EChartsOption) || {});
89   - }
90   - );
91   -
92   - watch(
93   - () => props.radio,
94   - () => {
95   - const option = beforeUpdateFn(props.layout.componentType);
96   - setTimeout(() => {
97   - unref(chartRef)?.setOption((option(unref(getRadio)) as unknown as EChartsOption) || {});
98   - });
99   - }
100   - );
  85 + const updateChartValue = useThrottleFn((newValue) => {
  86 + const updateFn = getUpdateValueFn(props.layout.componentType);
  87 + unref(chartRef)?.setOption((updateFn(newValue || 0) as unknown as EChartsOption) || {});
  88 + }, 500);
  89 +
  90 + watch(() => props.value.value, updateChartValue);
  91 +
  92 + const updateChartFont = useThrottleFn(() => {
  93 + const option = beforeUpdateFn(props.layout.componentType);
  94 + setTimeout(() => {
  95 + unref(chartRef)?.setOption((option(unref(getRadio)) as unknown as EChartsOption) || {});
  96 + });
  97 + }, 500);
  98 +
  99 + watch(() => props.radio, updateChartFont);
  100 +
  101 + const updateChartType = useThrottleFn(() => {
  102 + unref(chartRef)?.clear();
  103 + unref(chartRef)?.setOption(props?.layout?.chartOption || {});
  104 + }, 500);
  105 +
  106 + watch(() => props.layout.chartOption, updateChartType);
101 107
102 108 let timeout: Nullable<number> = null;
103 109
... ...
... ... @@ -239,7 +239,7 @@ export const getGradient = (key: Gradient, record: GradientInfo[] = []) => {
239 239 };
240 240
241 241 export const update_instrument_1_font = (radio: number) => {
242   - const basicFontSize = fontSize({ radio, basic: 10, max: 20 });
  242 + const basicFontSize = fontSize({ radio, basic: 20, max: 25, min: 12 });
243 243 return {
244 244 series: [
245 245 {
... ... @@ -256,7 +256,7 @@ export const update_instrument_1_font = (radio: number) => {
256 256
257 257 export const update_instrument_2_font = (radio: number) => {
258 258 const axisLabelFontSize = fontSize({ radio, basic: 10, max: 16 });
259   - const detailFontSize = fontSize({ radio, basic: 12 });
  259 + const detailFontSize = fontSize({ radio, basic: 20, max: 25, min: 12 });
260 260 return {
261 261 series: [
262 262 {
... ...
... ... @@ -219,7 +219,7 @@
219 219 </Tooltip>
220 220 </span> -->
221 221 </div>
222   - <div>{{ item.updateTime || item.createTime }}</div>
  222 + <div>{{ item.createTime }}</div>
223 223 </div>
224 224 </section>
225 225 </Card>
... ...