openatc-components 0.5.78 → 0.5.80

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openatc-components",
3
- "version": "0.5.78",
3
+ "version": "0.5.80",
4
4
  "description": "A Vue.js project",
5
5
  "author": "openatc developer",
6
6
  "private": false,
@@ -1484,6 +1484,7 @@ const en = {
1484
1484
  'addplan': 'Click the Add button to add the greenwave Optimize plan',
1485
1485
  'createconfig': 'Click the Edit button to start the configuration',
1486
1486
  'operation': 'Operation',
1487
+ 'simulation': 'Simulation',
1487
1488
  'isdelete': 'Is delete',
1488
1489
  'nochooseplan': 'No route selected!',
1489
1490
  'namerepeat': 'Duplicate route name!',
@@ -1274,6 +1274,7 @@ const ru = {
1274
1274
  'addplan': 'Нажмите кнопку «Добавить» чтобы добавить план координации «зеленой волны»',
1275
1275
  'createconfig': 'Нажмите кнопку редактирования, чтобы начать создание конфигурации',
1276
1276
  'operation': 'Действие',
1277
+ 'simulation': 'Симуляция',
1277
1278
  'isdelete': 'Удалить?',
1278
1279
  'nochooseplan': 'Не выбрана ни одна схема!',
1279
1280
  'namerepeat': 'Название дублируется!',
@@ -1481,6 +1481,7 @@ const zh = {
1481
1481
  'addplan': '点击添加按钮添加绿波协调计划',
1482
1482
  'createconfig': '点击编辑按钮开始生成配置',
1483
1483
  'operation': '操作',
1484
+ 'simulation': '仿真',
1484
1485
  'isdelete': '是否删除',
1485
1486
  'nochooseplan': '未选中任何方案!',
1486
1487
  'namerepeat': '名称重复!',
@@ -45,7 +45,8 @@
45
45
  :maxTableHeight="maxTableHeight"
46
46
  :opt="item.devs"
47
47
  :isAllowedExpand="isAllowedExpand"
48
- @onNewPatternListChange="onNewPatternListChange"/>
48
+ @onNewPatternListChange="onNewPatternListChange"
49
+ @onSimulation="onSimulation"/>
49
50
  </div>
50
51
  </div>
51
52
  </el-tab-pane>
@@ -66,7 +67,8 @@
66
67
  :opt="opt.optPatternList && opt.optPatternList.length > 0 ? opt.optPatternList[0].devs : {}"
67
68
  :isAllowedExpand="isAllowedExpand"
68
69
  :maxTableHeight="maxTableHeight"
69
- @onNewPatternListChange="onNewPatternListChange"/>
70
+ @onNewPatternListChange="onNewPatternListChange"
71
+ @onSimulation="onSimulation"/>
70
72
  </div>
71
73
  <PlanContent v-show="false"
72
74
  :schemeData="schemeData"
@@ -446,6 +448,10 @@ export default {
446
448
  editableTab.devs = devList
447
449
  // this.refreshChart()
448
450
  },
451
+ onSimulation (row) {
452
+ // 向外转发仿真事件(宿主可监听处理)
453
+ this.$emit('onSimulation', row)
454
+ },
449
455
  afterEnter () {
450
456
  if (this.chooseId === 0) {
451
457
  return false
@@ -11,7 +11,7 @@
11
11
  **/
12
12
  <template>
13
13
  <div class="app-container" ref="pattern-container">
14
- <el-table :data="newPatternList" :max-height="tableHeight" id="footerBtn" :show-header="isShowTableHeader">
14
+ <el-table :data="newPatternList" :max-height="tableHeight" id="footerBtn" :show-header="isShowTableHeader" :key="tableKey">
15
15
  <el-table-column :type="isAllowedExpand ? 'expand' : ''" v-if="isAllowedExpand">
16
16
  <template slot-scope="scope">
17
17
  <div v-if="isAllowedExpand && isSingleCrossMode" class="optimizetype">
@@ -138,6 +138,11 @@
138
138
  </div>
139
139
  </template>
140
140
  </el-table-column>
141
+ <el-table-column align="center" :label="$t('openatccomponents.greenwaveoptimize.operation')" width="90" v-if="isShowOperation()">
142
+ <template slot-scope="scope">
143
+ <el-button type="primary" size="small" @click="$emit('onSimulation', scope.row)">{{$t('openatccomponents.greenwaveoptimize.simulation')}}</el-button>
144
+ </template>
145
+ </el-table-column>
141
146
  </el-table>
142
147
  </div>
143
148
  </template>
@@ -204,6 +209,12 @@ export default {
204
209
  }
205
210
  }
206
211
  return max
212
+ },
213
+ tableKey () {
214
+ // tableColums / isAllowedExpand 变化会动态增减列,element-ui 的列注册仅在
215
+ // mounted 时按 DOM 位置记录一次,实例复用会导致列顺序错乱,
216
+ // 因此列配置变化时通过 key 强制重建表格,保证列顺序与配置一致
217
+ return `${(this.tableColums || []).join(',')}#${this.isAllowedExpand}`
207
218
  }
208
219
  },
209
220
  data () {
@@ -338,6 +349,10 @@ export default {
338
349
  }
339
350
  return res
340
351
  },
352
+ isShowOperation () {
353
+ // 操作列仅在显式配置 tableColums 包含 'operation' 时显示,避免未配置的宿主意外显示
354
+ return !!(this.tableColums && this.tableColums.length > 0 && this.tableColums.find(item => item === 'operation'))
355
+ },
341
356
  getPeriod (row) {
342
357
  let period = row.timeperiodrange || row.period
343
358
  let res = ''