浏览代码

能源设施

hsshuxian 9 月之前
父节点
当前提交
2c1431b457
共有 2 个文件被更改,包括 31 次插入29 次删除
  1. 23 28
      ems-ui/src/views/basecfg/emsfacs/index.vue
  2. 8 1
      ems-ui/src/views/prediction/prod.vue

+ 23 - 28
ems-ui/src/views/basecfg/emsfacs/index.vue

@@ -66,10 +66,9 @@
                     textAlign: 'center',
                     cursor: 'pointer',
                     color: scope.row.enable === 0 ? 'rgb(255,159,159)' : 'rgb(117,186,255)',
-                    backgroundColor: scope.row.enable === 0 ? 'rgb(255,235,235)' : 'rgb(232,244,255)'
-        }"
-              >
-        {{ scope.row.enable === 0 ? '关闭' : '启用' }}
+                    backgroundColor: scope.row.enable === 0 ? 'rgb(255,235,235)' : 'rgb(232,244,255)'}">
+
+                {{ scope.row.enable === 0 ? '关闭' : '启用' }}
       </span>
             </template>
           </el-table-column>
@@ -132,9 +131,7 @@
                     v-model="attrValuesMap[attr.attrKey]"
                     placeholder="点击编辑"
                     size="small"
-                   @blur="updateAttrValue(attr.attrKey, attrValuesMap[attr.attrKey])"
-
-                  >
+                   @blur="updateAttrValue(attr.attrKey, attrValuesMap[attr.attrKey])">
                   </el-input>
                 </li>
               </ul>
@@ -396,8 +393,6 @@ export default {
     this.$set(this.form, 'customAttrs', []);
 
 
-
-
   },
   methods: {
     /** 查询能源设施/系统列表 */
@@ -417,7 +412,11 @@ export default {
     // 表单重置
     reset() {
       this.form = this.$options.data().form
+      this.attrList = []; // 重置属性列表
+      this.attrValuesMap = {}; // 重置属性值映射
+      this.form.customAttrs = []; // 重置自定义属性
       this.resetForm('form')
+
     },
     /** 搜索按钮操作 */
     handleQuery() {
@@ -451,7 +450,6 @@ export default {
         console.log('修改按钮展示的数据', this.form)
         this.open = true
         this.title = '修改能源设施'
-        // 获取自定义属性值
       })
     },
      /** 提交按钮 */
@@ -484,7 +482,6 @@ export default {
           });
         }
       });
-
        // 添加自定义属性数据
        this.form.customAttrs.forEach(customAttr => {
          const attrName= customAttr.attrName;
@@ -671,7 +668,6 @@ export default {
     if (this.form.customAttrs.length > 0) {
       this.form.customAttrs.splice(index, 1);
     }
-
   },
 
   /**模型属性*/
@@ -688,7 +684,6 @@ export default {
     });
   },
   handleModelChange(modelCode) {
-    console.log("新增的界面进入",modelCode)
     if (modelCode) {
       this.getModelByCode(modelCode);
       console.log("新增的界面进入",this.form.facsCode)
@@ -722,18 +717,18 @@ export default {
         if (attrValueObj) {
           attrValuesMap[attr.attrKey] = attrValueObj.attrValue;
         } else {
-          // 如果没有找到匹配的 attrValue,则设置为 '暂无数据'
+          // 如果没有找到匹配的 attrValue,则设置为 ' '
           attrValuesMap[attr.attrKey] = '';
         }
       });
 
       // 更新 attrValuesMap 到组件的数据中
       this.attrValuesMap = attrValuesMap;
-      // 打印更新后的 attrValuesMap,用于调试
       console.log("Updated attrValuesMap", this.attrValuesMap);
 
+
     });
-  },
+  }
 }
 
 }
@@ -746,33 +741,33 @@ export default {
 }
 
 .divider {
-  border-bottom: 2px solid #ebeef5; /* 这是Element UI的默认边框颜色,你可以根据需要调整 */
-  margin: 10px 0; /* 这是横线与内容的间距,你可以根据需要调整 */
+  border-bottom: 2px solid #ebeef5;
+  margin: 10px 0;
 }
 
 .section-title {
-  font-size: 18px; /* 标题字体大小 */
-  font-weight: bold; /* 字体加粗 */
+  font-size: 18px;
+  font-weight: bold;
 }
 
 .attr-list-container {
-  border: 1px solid #ccc; /* 给ul添加外框 */
-  padding: 10px; /* 内边距 */
-  margin: 10px 0; /* 外边距 */
-  font-weight: bold; /* 加粗标题 */
+  border: 1px solid #ccc;
+  padding: 10px;
+  margin: 10px 0;
+  font-weight: bold;
 }
 
 .attr-list-container h3 {
-  font-weight: bold; /* 加粗标题 */
+  font-weight: bold;
 }
 
 .attr-item {
-  list-style-type: none; /* 移除列表项前的默认符号 */
-  margin-bottom: 5px; /* 列表项之间的间距 */
+  list-style-type: none;
+  margin-bottom: 5px;
 }
 
 .attr-name {
-  font-weight: bold; /* 加粗属性名称 */
+  font-weight: bold;
 }
 
 

+ 8 - 1
ems-ui/src/views/prediction/prod.vue

@@ -127,7 +127,6 @@
         </template>
       </el-table-column>
     </el-table>
-
     <pagination
         v-show="total>0"
         :total="total"
@@ -286,6 +285,8 @@ export default {
     resetQuery() {
       this.resetForm('queryForm');
       this.handleQuery();
+
+
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
@@ -293,11 +294,17 @@ export default {
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
     },
+    handle(selection) {
+      this.ids = selection.map(item => item.id);
+      this.single = selection.length !== 1;
+      this.multiple =!selection.length;
+    },
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
       this.open = true;
       this.title = '添加电力产能预测';
+
     },
     /** 修改按钮操作 */
     handleUpdate(row) {