openatc-components 0.1.101 → 0.1.103

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.
@@ -181,38 +181,61 @@ export default {
181
181
  'pattern': pattern,
182
182
  'phases': phaseData
183
183
  }
184
+ let isValidata = []
184
185
  for (let j = 0; j < newPha.length; j++) {
185
186
  let comNum = (newPha[j].length / 4) * 1700 * 0.8
186
- if (newPha[j].flowperhour > comNum) {
187
- this.$confirm(this.$t('openatccomponents.overview.maxFlow'),
188
- this.$t('openatccomponents.common.alarm'), {
189
- confirmButtonText: this.$t('openatccomponents.common.confirm'),
190
- cancelButtonText: this.$t('openatccomponents.common.cancel'),
191
- type: 'warning'
192
- }).then(() => {
193
- getDuration(reqData).then(data => {
194
- if (data.data.success) {
195
- _that.$message({
196
- type: 'success',
197
- message: _that.$t('openatccomponents.pattern.success')
198
- })
199
- for (let i = 0; i < _that.rings.rings.length; i++) {
200
- for (let j = 0; j < _that.rings.rings[i].length; j++) {
201
- for (let h = 0; h < data.data.data.phase.length; h++) {
202
- if (_that.rings.rings[i][j].id === data.data.data.phase[h].id) {
203
- _that.rings.rings[i][j].value = data.data.data.phase[h].duration
204
- // _that.rings[i][j].cycle = data.data.data.phase[h].cycle
205
- }
187
+ isValidata.push(newPha[j].flowperhour > comNum)
188
+ }
189
+ if (isValidata.includes(true)) {
190
+ this.$confirm(this.$t('openatccomponents.overview.maxFlow'),
191
+ this.$t('openatccomponents.common.alarm'), {
192
+ confirmButtonText: this.$t('openatccomponents.common.confirm'),
193
+ cancelButtonText: this.$t('openatccomponents.common.cancel'),
194
+ type: 'warning'
195
+ }).then(() => {
196
+ getDuration(reqData).then(data => {
197
+ if (data.data.success) {
198
+ _that.$message({
199
+ type: 'success',
200
+ message: _that.$t('openatccomponents.pattern.success')
201
+ })
202
+ for (let i = 0; i < _that.rings.rings.length; i++) {
203
+ for (let j = 0; j < _that.rings.rings[i].length; j++) {
204
+ for (let h = 0; h < data.data.data.phase.length; h++) {
205
+ if (_that.rings.rings[i][j].id === data.data.data.phase[h].id) {
206
+ _that.rings.rings[i][j].value = data.data.data.phase[h].duration
207
+ // _that.rings[i][j].cycle = data.data.data.phase[h].cycle
206
208
  }
207
209
  }
208
210
  }
209
211
  }
210
- }).catch(error => {
211
- console.log(error)
212
- })
213
- }).catch(() => {
212
+ }
213
+ }).catch(error => {
214
+ console.log(error)
214
215
  })
215
- }
216
+ }).catch(() => {
217
+ })
218
+ } else {
219
+ getDuration(reqData).then(data => {
220
+ if (data.data.success) {
221
+ _that.$message({
222
+ type: 'success',
223
+ message: _that.$t('openatccomponents.pattern.success')
224
+ })
225
+ for (let i = 0; i < _that.rings.rings.length; i++) {
226
+ for (let j = 0; j < _that.rings.rings[i].length; j++) {
227
+ for (let h = 0; h < data.data.data.phase.length; h++) {
228
+ if (_that.rings.rings[i][j].id === data.data.data.phase[h].id) {
229
+ _that.rings.rings[i][j].value = data.data.data.phase[h].duration
230
+ // _that.rings[i][j].cycle = data.data.data.phase[h].cycle
231
+ }
232
+ }
233
+ }
234
+ }
235
+ }
236
+ }).catch(error => {
237
+ console.log(error)
238
+ })
216
239
  }
217
240
  },
218
241
  addMin () {