openatc-components 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,7 +24,7 @@
24
24
  :rotatable="false"
25
25
  @select="handleSelectIcon(item)"
26
26
  @dragstop="boxDragStop(item, ...arguments)"
27
- @resizestop="boxResizeStop(item, ...arguments)"
27
+ @resize="boxResizeStop"
28
28
  @rotatestop="boxRotateStop(item, ...arguments)"
29
29
  >
30
30
  <div v-if="UsageMode === 'draw'" class="centerText" :class="{'defaultBg': chooseIndex !== CountdownData.index, 'highlightBg': chooseIndex === CountdownData.index }" :style="{'width': item.w + 'px', 'height': item.h + 'px'}">
@@ -60,7 +60,8 @@ export default {
60
60
  reset: true,
61
61
  phaseCountdownList: [],
62
62
  phaseCountdownIcon: 999,
63
- Fontsize: 20 // 倒计时默认字号
63
+ Fontsize: 20, // 倒计时默认字号
64
+ minCountdownSize: 30 // 限制最小倒计时区域大小
64
65
  }
65
66
  },
66
67
  watch: {
@@ -133,17 +134,20 @@ export default {
133
134
  },
134
135
  methods: {
135
136
  boxDragStop (origin, final) {
136
- this.item = JSON.parse(JSON.stringify(final))
137
+ let info = this.handleMinCountdownSize(final)
138
+ this.item = JSON.parse(JSON.stringify(info))
137
139
  this.$emit('handleSelectIcon', this.CountdownData)
138
140
  this.handleChangeData()
139
141
  },
140
- boxResizeStop (origin, final) {
141
- this.resetSvg()
142
- this.item = JSON.parse(JSON.stringify(final))
142
+ boxResizeStop (final) {
143
+ let info = this.handleMinCountdownSize(final)
144
+ // this.resetSvg()
145
+ this.item = JSON.parse(JSON.stringify(info))
143
146
  this.handleChangeData()
144
147
  },
145
148
  boxRotateStop (origin, final) {
146
- this.item = JSON.parse(JSON.stringify(final))
149
+ let info = this.handleMinCountdownSize(final)
150
+ this.item = JSON.parse(JSON.stringify(info))
147
151
  this.handleChangeData()
148
152
  },
149
153
  resetSvg () {
@@ -171,6 +175,14 @@ export default {
171
175
  let fields = Object.keys(this.item)
172
176
  this.$emit('changeTimeItem', data, fields)
173
177
  this.handleSelectIcon()
178
+ },
179
+ handleMinCountdownSize (final) {
180
+ let info = JSON.parse(JSON.stringify(final))
181
+ if (info.w < 30 || info.h < 30) {
182
+ info.w = 30
183
+ info.h = 30
184
+ }
185
+ return info
174
186
  }
175
187
  },
176
188
  created () {