wuyouming666
2023-09-14 09c655782b6f9996bc084e6f0c9721d0f2574aa8
1、解决vuex切换页面样式混乱 2、修改plc地址
11个文件已修改
97 ■■■■■ 已修改文件
CanadaMes-ui/src/store/index.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/Action.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/Parameter.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/Sign.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/State.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/alarm.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/home/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plcaction.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/S7control.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/resources/sql/canadames.sql 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/store/index.js
@@ -10,9 +10,9 @@
  modules: {
    tags,
  },
  state: {
    tagData: {} // 存储标签数据的对象
  },
  // state: {
  //   tagData: {} // 存储标签数据的对象
  // },
  mutations: {
    // 更新标签数据
    updateTagData(state, payload) {
CanadaMes-ui/src/views/Electrical/Action.vue
@@ -139,6 +139,7 @@
          }
          let obj = JSON.parse(msg.data);
          if (obj.params ){
          this.record.params[0] = obj.params[0];
          for (let a = 0; a <= this.record.params[0].length - 1; a++) {
@@ -148,7 +149,7 @@
              this.record.xyData[a].value = this.record.params[0][a].toString();
            }
          }
        }
          // console.log(this.record.xyData);
          this.$forceUpdate();
        };
@@ -181,7 +182,7 @@
</script>
 
 
<style>
<style scoped>
.kuai_div {
  /* width: 30%; */
  margin-bottom: 30px;
CanadaMes-ui/src/views/Electrical/Parameter.vue
@@ -102,13 +102,23 @@
          }
          let obj = JSON.parse(msg.data);
          if (obj.params && obj.state){
          this.record.params[0] = obj.params[0];
          this.record.state = obj.state[0];
          if (obj.state && obj.state.length > 0) {
  let isButtonDisabled = this.record.state.includes(1);
  this.isButtonDisabled = isButtonDisabled;
          let isButtonDisabled = this.record.state.includes(1);
          // 判断state中是否存在1
          //console.log(isButtonDisabled)
          this.isButtonDisabled = isButtonDisabled; // 将判断结果保存到变量isButtonDisabled中
         // 将判断结果保存到变量isButtonDisabled中
          for (let a = 0; a <= this.record.params[0].length - 1; a++) {
            if (!this.record.xyData[a]) {
@@ -117,7 +127,8 @@
              this.record.xyData[a].value = this.record.params[0][a];
            }
          }
        }
      }
          //console.log(this.record.xyData);
          this.$forceUpdate();
        };
@@ -145,7 +156,7 @@
};
</script>
<style>
<style scoped>
.kuai_div {
  width: calc(100% / 2);
  margin-bottom: 15px;
@@ -153,6 +164,7 @@
.el-input__inner {
  border: 1px solid black;
  border: none;
}
.in_mc {
@@ -162,7 +174,7 @@
.blue-button {
  background-color: skyblue;
  color: #fff;
}
#btn_div {
  width: 100%;
CanadaMes-ui/src/views/Electrical/Sign.vue
@@ -225,7 +225,7 @@
</script>
<style>
<style >
* {
  margin: 0;
  padding: 0;
CanadaMes-ui/src/views/Electrical/State.vue
@@ -16,7 +16,7 @@
    <el-form label-width="100px" style="display: flex;flex-wrap: wrap;" :model="messagepack.data">
      <div class="kuai_div" v-for="item in this.record.xyData" :key="item.name">
        <el-input style="width: 280px;" class="in_mc" v-model="item.name"></el-input>
        <el-input style="width: 280px;" class="in_mc" v-model="item.name" readonly></el-input>
        <el-input v-model="item.value" readonly="readonly" style="width: 90px;"></el-input>
      </div>
@@ -151,11 +151,11 @@
</script>
<style>
* {
<style scoped>
/* * {
  margin: 0px;
  padding: 0px;
}
} */
.kuai_div {
  width: 30%;
CanadaMes-ui/src/views/Electrical/alarm.vue
@@ -211,7 +211,7 @@
</script>
<style>
<style >
.kuai_div {
  /* width: 30%; */
  margin-bottom: 30px;
CanadaMes-ui/src/views/home/index.vue
@@ -79,7 +79,7 @@
    margin: 0 auto;
    background-repeat: no-repeat;
    /* background-size: 100% 100%; */
    background-size: 1660px 560px;
    background-size: 1660px 560px  ;
    background-attachment: local;
    width: 1660px;
}
springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java
@@ -15,13 +15,13 @@
                e.printStackTrace();
            }
            List<Short> arraylist = S7control.getinstance().ReadWord("DB100.DBW0", 12);
            List<Short> state = S7control.getinstance().ReadWord("DB103.DBW0", 10);
            List<Short> arraylist = S7control.getinstance().ReadWord("DB100.0", 12);
            List<Short> state = S7control.getinstance().ReadWord("DB103.0", 10);
            JSONObject jsonObject = new JSONObject();
//            new short[]{65545,65545, 65545, 65545, 65545, 65545, 65545, 65545, 65545,65545, 65545, 65545}
            //            new short[]{65545,65545, 65545, 65545, 65545, 65545, 65545, 65545, 65545, 65545}
//            new short[]{1,1, 1, 1, 1, 1, 2, 33, 2,3, 4, 5}
            //            new short[]{0,0, 0, 0, 0, 0, 0, 0, 0, 0}
            jsonObject.append("params",  arraylist );
            jsonObject.append("state",  state);
            jsonObject.append("state",   state);
            WebSocketServer sendwServer = WebSocketServer.sessionMap.get("Parameter");
            if (sendwServer != null) {
                sendwServer.sendMessage(jsonObject.toString());
@@ -31,7 +31,7 @@
            if (webSocketServer != null) {
                List<String> messages = webSocketServer.getMessages();
                String addressList = "DB100.DBW0";
                String addressList = "DB100.0";
                if (!messages.isEmpty()) {
                    // 将最后一个消息转换为 short 类型的列表
springboot-vue3/src/main/java/com/example/springboot/component/Plcaction.java
@@ -21,7 +21,7 @@
//      JSONObject jsonObject = new JSONObject();
//      jsonObject.append("params", new short[]{1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0});
 List<Boolean> paramlist = S7control.getinstance().ReadBits("DB2.DBX0.0 ", 26);
 List<Boolean> paramlist = S7control.getinstance().ReadBits("DB2.0.0 ", 26);
//      Boolean[] values = {true, true,true, true,true, true,true, true,true, true,true, true,true, true,true, true,true, true,true, true,true, true,true, true,false, true};
//      List<Boolean> paramlist = new ArrayList<>(Arrays.asList(values));
      if (paramlist == null) {
@@ -47,7 +47,7 @@
          List<String> messages = webSocketServer.getMessages();
          String addressList = "DB100.DBW0";
          String addressList = "DB100.0";
          if (!messages.isEmpty()) {
            // 将最后一个消息转换为整数类型的列表
springboot-vue3/src/main/java/com/example/springboot/component/S7control.java
@@ -11,8 +11,8 @@
    S7PLC s7PLC; // PLC通讯类实例
    private EPlcType plcType = EPlcType.S1200; // 西门子PLC类型
    private String ip = "127.0.0.1"; // plc ip地址
    private int port = 21; // plc 端口号
    private String ip = "192.168.10.1"; // plc ip地址
    private int port = 102; // plc 端口号
    private static volatile S7control instance = null;
springboot-vue3/src/main/resources/sql/canadames.sql
@@ -1,17 +1,17 @@
/*
 Navicat MySQL Data Transfer
 Source Server         : server-150
 Source Server         : 本地
 Source Server Type    : MySQL
 Source Server Version : 80019
 Source Host           : 10.153.19.150:3306
 Source Server Version : 80022
 Source Host           : localhost:3306
 Source Schema         : canadames
 Target Server Type    : MySQL
 Target Server Version : 80019
 Target Server Version : 80022
 File Encoding         : 65001
 Date: 13/09/2023 09:48:14
 Date: 14/09/2023 09:47:12
*/
SET NAMES utf8mb4;
@@ -27,7 +27,7 @@
  `timeon` datetime(0) NULL DEFAULT NULL COMMENT '开始时间',
  `endTime` datetime(0) NULL DEFAULT NULL COMMENT '结束时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1338 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
) ENGINE = InnoDB AUTO_INCREMENT = 1378 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of alarmmg
@@ -150,7 +150,7 @@
  `width` decimal(10, 2) NULL DEFAULT NULL,
  `height` decimal(10, 2) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of glass
@@ -203,7 +203,7 @@
  `order_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '订单号',
  `state` int NULL DEFAULT NULL COMMENT '状态(0:按此订单号出片,1结束出片)',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of order_out
@@ -394,8 +394,8 @@
INSERT INTO `role_permission` VALUES (69, 2, 26, 1, '2021-11-28 15:07:54', '2021-11-28 15:07:54');
INSERT INTO `role_permission` VALUES (70, 2, 27, 1, '2021-11-28 15:07:54', '2021-11-28 15:07:54');
INSERT INTO `role_permission` VALUES (71, 2, 28, 1, '2021-11-28 15:07:54', '2021-11-28 15:07:54');
INSERT INTO `role_permission` VALUES (72, 2, 30, 0, '2023-08-24 08:55:34', '2023-08-24 08:55:34');
INSERT INTO `role_permission` VALUES (73, 2, 29, 0, '2023-08-24 08:56:15', '2023-08-28 15:33:14');
INSERT INTO `role_permission` VALUES (72, 2, 30, 1, '2023-08-24 08:55:34', '2023-08-24 08:55:34');
INSERT INTO `role_permission` VALUES (73, 2, 29, 1, '2023-08-24 08:56:15', '2023-08-28 15:33:14');
INSERT INTO `role_permission` VALUES (74, 2, 1, 1, '2023-08-30 16:29:46', '2023-08-30 16:29:46');
-- ----------------------------
@@ -431,9 +431,9 @@
INSERT INTO `storage_cage` VALUES (9, NULL, NULL, 1, 5, 1, 1500.00, NULL, NULL, 1, NULL);
INSERT INTO `storage_cage` VALUES (10, NULL, NULL, 1, 5, 2, 1600.00, NULL, NULL, 0, NULL);
INSERT INTO `storage_cage` VALUES (11, NULL, NULL, 1, 6, 1, 1600.00, NULL, NULL, 0, NULL);
INSERT INTO `storage_cage` VALUES (12, '12', 'NG2202301', 1, 6, 2, 1602.00, 0.00, 2.00, 2, '2');
INSERT INTO `storage_cage` VALUES (12, '12', 'NG2202301', 1, 6, 2, 1602.00, 0.00, 2.00, 1, '2');
INSERT INTO `storage_cage` VALUES (13, NULL, NULL, 1, 7, 1, 1600.00, NULL, NULL, 0, NULL);
INSERT INTO `storage_cage` VALUES (14, '122', 'NG2202302', 1, 7, 2, 1500.00, 2.00, 2.00, 3, '3');
INSERT INTO `storage_cage` VALUES (14, NULL, NULL, 1, 7, 2, 1500.00, NULL, NULL, 0, NULL);
INSERT INTO `storage_cage` VALUES (15, NULL, NULL, 1, 8, 1, 1500.00, NULL, NULL, 0, NULL);
INSERT INTO `storage_cage` VALUES (16, NULL, NULL, 1, 8, 2, 1500.00, NULL, NULL, 0, NULL);
INSERT INTO `storage_cage` VALUES (17, NULL, NULL, 1, 9, 1, 1500.00, NULL, NULL, 1, NULL);
@@ -1323,7 +1323,7 @@
  `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
) ENGINE = InnoDB AUTO_INCREMENT = 23 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of user
@@ -1331,13 +1331,11 @@
INSERT INTO `user` VALUES (1, 0, '', 0, 1, 'admin', 'b2f0c414a5ffb6944c424bc18ae3a8a0', NULL, NULL, NULL, 1, '2023-08-25 08:58:58', '2023-09-05 16:12:28');
INSERT INTO `user` VALUES (2, 1, '1-', 1, 2, 'user1', '601b99523f82de29f87771d5f95accdc', 'user1@qq.com', NULL, NULL, 1, '2021-11-28 14:31:39', '2021-11-28 15:09:36');
INSERT INTO `user` VALUES (3, 1, '1-', 1, 2, 'user2', 'f403c87893db29eb71b21905b57bbd0d', 'user2@qq.com', NULL, NULL, 1, '2021-11-28 14:31:39', '2021-11-28 15:09:36');
INSERT INTO `user` VALUES (9, 1, '1-', 1, 1, 'yttttttttttt', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '666@qq.com', NULL, NULL, 1, '2023-08-23 20:35:32', '2023-08-23 20:35:32');
INSERT INTO `user` VALUES (10, 1, '1-', 1, 2, '767655555', '500637c0d48b442a3be6d4fce12e0910', NULL, NULL, NULL, 1, '2023-08-23 20:42:58', '2023-08-23 20:42:58');
INSERT INTO `user` VALUES (11, 1, '1-', 1, 5, 'uiuyiuy', 'e046c4175152aa3001d2c71c5bc1aee5', '767676767tt@qq.com', NULL, NULL, 1, '2023-08-23 20:43:42', '2023-08-23 20:43:42');
INSERT INTO `user` VALUES (13, 1, '1-', 1, 2, 'user3', '500637c0d48b442a3be6d4fce12e0910', '2265557345@qq.com', NULL, NULL, 1, '2023-08-24 09:58:40', '2023-08-24 09:58:40');
INSERT INTO `user` VALUES (13, 1, '1-', 1, 2, 'user3', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '2265557345@qq.com', NULL, NULL, 1, '2023-08-24 09:58:40', '2023-08-24 09:58:40');
INSERT INTO `user` VALUES (15, 1, '1-', 1, 2, '99999', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '2267666@qq.com', NULL, NULL, 1, '2023-08-25 09:37:05', '2023-08-28 14:37:27');
INSERT INTO `user` VALUES (16, 1, '1-', 1, 2, '5656tttt', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '5454@qq.com', NULL, NULL, 1, '2023-08-28 14:17:44', '2023-08-28 14:37:24');
INSERT INTO `user` VALUES (17, 1, '1-', 1, 2, '6767ttt', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '225@qq.com', NULL, NULL, 1, '2023-08-28 14:20:05', '2023-08-28 14:23:53');
INSERT INTO `user` VALUES (18, 1, '1-', 1, 2, '8989ttt', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '224@qq.com', NULL, NULL, 1, '2023-08-28 14:26:17', '2023-08-28 14:37:22');
INSERT INTO `user` VALUES (19, 1, '1-', 1, 5, '8080ttt', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '87@qq.com', NULL, NULL, 1, '2023-08-28 14:34:39', '2023-08-29 16:03:38');