openatc-components 0.2.7 → 0.2.8

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.
@@ -1,20 +1,9 @@
1
- /**
2
- * Copyright (c) 2020 kedacom
3
- * OpenATC is licensed under Mulan PSL v2.
4
- * You can use this software according to the terms and conditions of the Mulan PSL v2.
5
- * You may obtain a copy of Mulan PSL v2 at:
6
- * http://license.coscl.org.cn/MulanPSL2
7
- * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
8
- * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
9
- * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
10
- * See the Mulan PSL v2 for more details.
11
- **/
12
1
  <template>
13
2
  <div class="components-container board">
14
3
  <div class="common-board-column">
15
4
  <div class="common-board-column-header" style="position:relative">
16
5
  <span>{{$t('openatccomponents.pattern.stage')+(subIndex+1)}}</span>
17
- <span v-if="isRing" style="position: absolute;right: 0;">
6
+ <span v-if="this.contrloType === 'stage'" style="position: absolute;right: 0;">
18
7
  <el-button type="primary" @click="deleteStage(subIndex)" icon="el-icon-close"></el-button>
19
8
  </span>
20
9
  </div>
@@ -28,8 +17,7 @@
28
17
  </el-col>
29
18
  <el-col :span="12">
30
19
  <el-input-number
31
- v-if="isRing"
32
- class="stage-value"
20
+ v-if="this.contrloType === 'stage'"
33
21
  :controls="false"
34
22
  size="small"
35
23
  :disabled="true"
@@ -37,8 +25,7 @@
37
25
  v-model.number="stage.stageSplit">
38
26
  </el-input-number>
39
27
  <el-input-number
40
- v-if="!isRing"
41
- class="stage-value"
28
+ v-if="this.contrloType === 'ring' || !this.contrloType"
42
29
  :controls="false"
43
30
  size="small"
44
31
  v-model.number="stage.split"
@@ -53,74 +40,57 @@
53
40
  {{this.$t('openatccomponents.pattern.phase')}}
54
41
  </el-col>
55
42
  <el-col :span="12">
56
- <SelectCrossPhase
57
- v-if="isRing"
58
- type="phases"
59
- :pattern="false"
60
- :phaseOption="coordphaseOption"
61
- multiple
62
- :row="stage"
63
- style="width:100%;">
64
- </SelectCrossPhase>
65
- <!-- <el-select v-if="isRing" v-model="stage.phases" multiple :placeholder="$t('openatccomponents.common.select')">
43
+ <el-select v-if="this.contrloType === 'stage'" v-model="stage.stages" multiple :placeholder="$t('openatccomponents.common.select')">
66
44
  <el-option
67
45
  v-for="item in coordphaseOption"
68
46
  :key="item.value"
69
47
  :label="$t('openatccomponents.pattern.phase') + item.value"
70
48
  :value="item.value">
71
49
  </el-option>
72
- </el-select> -->
50
+ </el-select>
73
51
  <el-input
74
- v-if="!isRing"
75
- class="stage-value"
52
+ v-if="this.contrloType === 'ring' || !this.contrloType"
76
53
  size="small"
77
- :value="stage.phases.join(',')"
54
+ :value="stage.stageKanban?stage.stageKanban.join(','):''"
78
55
  ref="type"
79
- style="width:100%;align:left;"
80
56
  :disabled="true">
81
57
  </el-input>
82
58
  </el-col>
83
59
  </el-row>
84
- <el-row :gutter="0" v-if="isRing">
60
+ <el-row :gutter="0" v-if="this.contrloType === 'stage'">
85
61
  <el-col :span="12">
86
62
  {{this.$t('openatccomponents.pattern.green')}}
87
63
  </el-col>
88
64
  <el-col :span="12">
89
65
  <el-input-number
90
- class="stage-value"
91
66
  size="small"
92
67
  :controls="false"
93
- :min="0"
94
68
  v-model.number="stage.green"
95
69
  @change="stageSplitChange">
96
70
  </el-input-number>
97
71
  </el-col>
98
72
  </el-row>
99
- <el-row :gutter="0" v-if="isRing">
73
+ <el-row :gutter="0" v-if="this.contrloType === 'stage'">
100
74
  <el-col :span="12">
101
75
  {{this.$t('openatccomponents.pattern.yellow')}}
102
76
  </el-col>
103
77
  <el-col :span="12">
104
78
  <el-input-number
105
- class="stage-value"
106
79
  size="small"
107
80
  :controls="false"
108
- :min="0"
109
81
  v-model.number="stage.yellow"
110
82
  @change="stageSplitChange">
111
83
  </el-input-number>
112
84
  </el-col>
113
85
  </el-row>
114
- <el-row :gutter="0" v-if="isRing">
86
+ <el-row :gutter="0" v-if="this.contrloType === 'stage'">
115
87
  <el-col :span="12">
116
88
  {{this.$t('openatccomponents.pattern.red')}}
117
89
  </el-col>
118
90
  <el-col :span="12">
119
91
  <el-input-number
120
- class="stage-value"
121
92
  size="small"
122
93
  :controls="false"
123
- :min="0"
124
94
  v-model.number="stage.red"
125
95
  @change="stageSplitChange">
126
96
  </el-input-number>
@@ -133,12 +103,11 @@
133
103
  </template>
134
104
  <script>
135
105
  import draggable from 'vuedraggable'
136
- import SelectCrossPhase from '../SelectCrossPhase/index.vue'
106
+
137
107
  export default {
138
- name: 'stage-bord',
108
+ name: 'stage-board',
139
109
  components: {
140
- draggable,
141
- SelectCrossPhase
110
+ draggable
142
111
  },
143
112
  data () {
144
113
  return {
@@ -158,8 +127,8 @@ export default {
158
127
  return []
159
128
  }
160
129
  },
161
- isRing: {
162
- type: Boolean
130
+ contrloType: {
131
+ type: String
163
132
  },
164
133
  options: {
165
134
  type: Object,
@@ -172,7 +141,7 @@ export default {
172
141
  default () {
173
142
  return {
174
143
  split: 0,
175
- // stages: [],
144
+ stages: [],
176
145
  phases: [],
177
146
  stageSplit: 0,
178
147
  green: 0,
@@ -193,30 +162,23 @@ export default {
193
162
  created () {
194
163
  },
195
164
  watch: {
196
- // stage: {
197
- // handler: function () {
198
- // if (this.isRing) {
199
- // let n = this.rowIndex
200
- // const globalParamModel = this.$store.getters.globalParamModel
201
- // let pattern = globalParamModel.getParamsByType('patternList')[n]
202
- // globalParamModel.getParamsByType('patternList')[n].cycle = this.getMaxCycle(pattern)
203
- // }
204
- // },
205
- // deep: true
206
- // }
165
+ stage: {
166
+ handler: function () {
167
+ if (this.contrloType) {
168
+ let n = this.rowIndex
169
+ const globalParamModel = this.$store.getters.globalParamModel
170
+ let pattern = globalParamModel.getParamsByType('patternList')[n]
171
+ globalParamModel.getParamsByType('patternList')[n].cycle = this.getMaxCycle(pattern)
172
+ }
173
+ },
174
+ deep: true
175
+ }
207
176
  },
208
177
  mounted () {
209
178
  },
210
179
  methods: {
211
180
  deleteStage (index) {
212
181
  this.stageInfo.splice(index, 1)
213
- this.stageInfo.forEach((item, index) => {
214
- item.key = index
215
- })
216
- // let n = this.rowIndex
217
- // const globalParamModel = this.$store.getters.globalParamModel
218
- // let pattern = globalParamModel.getParamsByType('patternList')[n]
219
- // globalParamModel.getParamsByType('patternList')[n].cycle = this.getMaxCycle(pattern)
220
182
  },
221
183
  getMaxCycle (pattern) {
222
184
  let rings = pattern.stagesList
@@ -265,23 +227,16 @@ export default {
265
227
  width: 100%;
266
228
  height: auto;
267
229
  margin: 5px 0;
268
- text-align: left;
269
230
  line-height: 40px;
231
+ // color: #FFFFFF;
270
232
  padding: 1px 1px;
271
233
  box-sizing: border-box;
272
234
  }
273
235
  .el-button--primary:hover, .el-button--primary:focus{
274
236
  background: #299BCC;
275
237
  border-color: #299BCC;
276
- color: #FFFFFF;
277
- }
278
- .stage-value {
279
- text-align: left;
280
- width: 100%;
238
+ // color: #FFFFFF;
281
239
  }
282
240
  </style>
283
241
  <style lang="scss">
284
- .stage-value .el-input__inner {
285
- text-align: center;
286
- }
287
242
  </style>
@@ -11,7 +11,6 @@
11
11
  :patternList="patternList"
12
12
  :controlPhase="controlPhase"
13
13
  :showCondition="showCondition"
14
- :allPatternList="allPatternList"
15
14
  :localPatternList="localPatternList"
16
15
  :phaseList="phaseList"
17
16
  :showBarrier="showBarrier"
@@ -508,9 +507,6 @@ export default {
508
507
  type: Boolean,
509
508
  default: false
510
509
  },
511
- allPatternList: {
512
- type: Array
513
- },
514
510
  controlPhase: {
515
511
  type: Object
516
512
  },