Commit 1ad14ae73a0539cc01eb64be6dc12c29ac295145

Authored by 陈鑫涛
1 parent 1ac15412

动态环图的字体大小和距离移动

src/views/bigscreenDesigner/designer/tools/configure/pieCharts/widget-active-ring-chart.js
... ... @@ -276,6 +276,22 @@ export const widgetActiveRingChart= {
276 276 ],
277 277 value: 'normal'
278 278 },
  279 + {
  280 + type: 'el-input-number',
  281 + label: '水平偏移',
  282 + name: 'digitalLeft',
  283 + required: false,
  284 + placeholder: '',
  285 + value: 0,
  286 + },
  287 + {
  288 + type: 'el-input-number',
  289 + label: '垂直偏移',
  290 + name: 'digitalTop',
  291 + required: false,
  292 + placeholder: '',
  293 + value: 0,
  294 + }
279 295 ],
280 296 },
281 297 {
... ...
src/views/bigscreenDesigner/designer/widget/pie/widgetActiveRingChart.vue
... ... @@ -114,7 +114,6 @@ export default {
114 114 },
115 115 created() {
116 116 this.optionsStyle = this.value.position;
117   - console.log("🚀 ~ created ~ this.optionsStyle:", this.optionsStyle)
118 117 this.optionsData = this.value.data;
119 118 this.optionsSetup = this.value.setup;
120 119 this.editorOptions();
... ... @@ -134,6 +133,8 @@ export default {
134 133 this.setTitleConfig();
135 134 //基础数据修改
136 135 this.setOptionsConfig();
  136 + console.log(this.optionsSetup,'this.optionsSetup');
  137 +
137 138  
138 139 },
139 140 //提示语设置
... ... @@ -274,9 +275,21 @@ export default {
274 275 this.isRouterAlive=false;
275 276 this.$nextTick(function(){
276 277 this.isRouterAlive=true;
  278 + this.$nextTick(() => this.moveDigitalFlop())
  279 + })
  280 + },
  281 + moveDigitalFlop() {
  282 + this.$nextTick(() => {
  283 + // 真实数字容器 class = active-ring-info
  284 + const box = this.$el.querySelector('.active-ring-info')
  285 + if (!box) return
  286 + const dx = this.optionsSetup.digitalLeft || 0
  287 + const dy = this.optionsSetup.digitalTop || 0
  288 + // 直接 translate 即可
  289 + box.style.left = dx + 'px'
  290 + box.style.top = dy + 'px'
277 291 })
278 292 },
279   -
280 293 }
281 294 };
282 295  
... ... @@ -314,4 +327,5 @@ export default {
314 327 font-size: 18px!important;
315 328 }
316 329 }
  330 +
317 331 </style>
... ...