From a56259ffabbdd3dba89d60e4da2c06a1b88e6220 Mon Sep 17 00:00:00 2001 From: ZY <zc857179121@qq.com> Date: 星期六, 10 五月 2025 14:57:20 +0800 Subject: [PATCH] 123 --- src/main/java/com/zy/asrs/controller/DevopsController.java | 155 ++++++++++++---- src/main/java/com/zy/core/properties/SlaveProperties.java | 4 src/main/java/com/zy/core/model/protocol/StaProtocol.java | 1 src/main/java/com/zy/asrs/domain/devops/DevopsMessage.java | 4 src/main/webapp/views/index.html | 2 src/main/java/com/zy/asrs/domain/devops/ErrorType.java | 4 src/main/java/com/zy/asrs/domain/vo/SiteTableVo.java | 8 src/main/webapp/static/css/devops.css | 167 ++++++++++++++++++ src/main/webapp/views/devops.html | 163 +---------------- src/main/resources/application.yml | 4 10 files changed, 323 insertions(+), 189 deletions(-) diff --git a/src/main/java/com/zy/asrs/controller/DevopsController.java b/src/main/java/com/zy/asrs/controller/DevopsController.java index 115bc3f..0af0a64 100644 --- a/src/main/java/com/zy/asrs/controller/DevopsController.java +++ b/src/main/java/com/zy/asrs/controller/DevopsController.java @@ -6,7 +6,6 @@ import com.core.common.R; import com.zy.asrs.domain.devops.DevopsMessage; import com.zy.asrs.domain.devops.ErrorType; -import com.zy.asrs.domain.vo.SiteTableVo; import com.zy.asrs.entity.BasDevp; import com.zy.asrs.entity.WrkMast; import com.zy.asrs.mapper.WrkMastMapper; @@ -20,7 +19,6 @@ import com.zy.core.enums.CrnStatusType; import com.zy.core.enums.SlaveType; import com.zy.core.model.CrnSlave; -import com.zy.core.model.DevpSlave; import com.zy.core.model.protocol.CrnProtocol; import com.zy.core.model.protocol.StaProtocol; import com.zy.core.properties.SlaveProperties; @@ -30,9 +28,7 @@ import org.springframework.web.bind.annotation.RestController; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; @RestController @RequestMapping("/devops") @@ -59,15 +55,26 @@ //鍏堟煡璇㈠爢鍨涙満鏄惁鍦ㄥ伐浣� WrkMast working = wrkMastMapper.selectWorking(crnSlave.getId()); for (WrkMast wrkMast : wrkMasts) { + CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, wrkMast.getCrnNo()); + CrnProtocol crnProtocol = crnThread.getCrnProtocol(); + if (crnProtocol == null) { + crnProtocol = new CrnProtocol(); + } devopsMessage = new DevopsMessage(); devopsMessage.setWrkNo(wrkMast.getWrkNo()); if (working != null) { //鍦ㄥ伐浣滐紝鍒欏垽鏂槸鍚︽湭褰撳墠杩欐潯 if (working.getWrkNo().equals(wrkMast.getWrkNo())) { - devopsMessage.setError("璇ュ伐浣滄。姝e湪鍑哄簱锛岃绋嶅悗"); + if (crnProtocol.getTaskNo().intValue() == working.getWrkNo()) { + devopsMessage.setError("璇ュ伐浣滄。姝e湪鎵ц锛岃绋嶅悗"); + } else { + devopsMessage.setError("璇ュ伐浣滄。鐘舵�佷笉瀵癸紝涓庡爢鍨涙満鐨勫伐浣滃彿涓嶅尮閰�"); + devopsMessage.setMethod("缁撳悎浠诲姟鎯呭喌杩涜鎿嶄綔;濡傛灉瀹為檯宸插畬鎴愶紝灏卞皢宸ヤ綔妗e畬鎴�;濡傛灉鏈畬鎴愶紝鍒欒皟鏁村伐浣滄。鐘舵��"); + } } else { - devopsMessage.setError(working.getWrkNo() + "鍙峰伐浣滄。姝e湪鍑哄簱锛岃绋嶅悗"); + devopsMessage.setError(working.getWrkNo() + "鍙峰伐浣滄。姝e湪鎵ц锛岃绋嶅悗"); } + devopsMessages.add(devopsMessage); continue; } DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1); @@ -75,23 +82,21 @@ List<ErrorType> staError = isStaError(staProtocol, wrkMast); for (ErrorType type : staError) { if (!Cools.isEmpty(devopsMessage.getError())) { - devopsMessage.setError(devopsMessage.getError() + "\n" + type.getDesc()); - devopsMessage.setMethod(devopsMessage.getMethod() + "\n" + type.getMethod()); + devopsMessage.setError(devopsMessage.getError() + ";" + type.getDesc()); + devopsMessage.setMethod(devopsMessage.getMethod() + ";" + type.getMethod()); } else { - devopsMessage.setError(type.getDesc()+ ";"); - devopsMessage.setMethod(type.getMethod()+ ";" ); + devopsMessage.setError(type.getDesc()); + devopsMessage.setMethod(type.getMethod()); } } - CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, wrkMast.getCrnNo()); - CrnProtocol crnProtocol = crnThread.getCrnProtocol(); List<ErrorType> crnError = isCrnError(crnProtocol, wrkMast); for (ErrorType type : crnError) { if (!Cools.isEmpty(devopsMessage.getError())) { - devopsMessage.setError(devopsMessage.getError() + "\n" + type.getDesc()); - devopsMessage.setMethod(devopsMessage.getMethod() + "\n" + type.getMethod()); + devopsMessage.setError(devopsMessage.getError() + ";" + type.getDesc()); + devopsMessage.setMethod(devopsMessage.getMethod() + ";" + type.getMethod()); } else { - devopsMessage.setError(type.getDesc()+ ";"); - devopsMessage.setMethod(type.getMethod()+ ";"); + devopsMessage.setError(type.getDesc()); + devopsMessage.setMethod(type.getMethod()); } } devopsMessages.add(devopsMessage); @@ -174,32 +179,104 @@ @PostMapping("/site/list") @ManagerAuth(memo = "绔欑偣淇℃伅琛�") public R siteTable() { - List<SiteTableVo> list = new ArrayList<>(); - // 鍐呭瓨鏁版嵁 - Map<Integer, StaProtocol> station = new HashMap<>(); - for (DevpSlave devp : slaveProperties.getDevp()) { - DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); - station.putAll(devpThread.getStation()); - } + List<DevopsMessage> devopsMessages = new ArrayList<>(); + DevopsMessage devopsMessage; + List<Integer> outSta = slaveProperties.getOutSta(); + List<Integer> inSta = slaveProperties.getInSta(); // 鎸佷箙鏁版嵁 List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<BasDevp>().orderBy("dev_no")); - for (BasDevp devp : basDevps) { - StaProtocol staProtocol = station.get(devp.getDevNo()); - if (null == staProtocol) { - continue; + for (Integer out : outSta) { + for (BasDevp devp : basDevps) { + if (devp.getDevNo().equals(out)) { + devopsMessage = new DevopsMessage(); + devopsMessage.setStaNo(out); + devopsMessage.setType("鍑哄簱绔欑偣"); + if (devp.getLoading().equalsIgnoreCase("Y")) { + devopsMessage.setError(ErrorType.YOUWU.getDesc()); + devopsMessage.setMethod("璇峰皢鐗╂枡鎸蛋锛屾墠鑳藉嚭搴�"); + } else { + List<ErrorType> crnError = isOutStaError(devp); + for (ErrorType type : crnError) { + if (!Cools.isEmpty(devopsMessage.getError())) { + devopsMessage.setError(devopsMessage.getError() + ";" + type.getDesc()); + devopsMessage.setMethod(devopsMessage.getMethod() + ";" + type.getMethod()); + } else { + devopsMessage.setError(type.getDesc()); + devopsMessage.setMethod(type.getMethod()); + } + } + } + devopsMessages.add(devopsMessage); + } } - SiteTableVo vo = new SiteTableVo(); - vo.setDevNo(devp.getDevNo()); // 绔欑偣缂栧彿 - vo.setWorkNo(staProtocol.getWorkNo()); // 宸ヤ綔鍙� - vo.setAutoing(staProtocol.isAutoing() ? "Y" : "N"); // 鑷姩 - vo.setLoading(staProtocol.isLoading() ? "Y" : "N"); // 鏈夌墿 - vo.setInEnable(staProtocol.isInEnable() ? "Y" : "N"); // 鍙叆 - vo.setOutEnable(staProtocol.isOutEnable() ? "Y" : "N"); // 鍙嚭 - vo.setPakMk(staProtocol.isPakMk()?"Y":"N"); // 鍏ュ簱鏍囪 - vo.setStaNo(staProtocol.getStaNo()); // 鐩爣绔� - vo.setEmptyMk(staProtocol.isEmptyMk()?"Y":"N"); // 绌烘澘淇″彿 - list.add(vo); } - return R.ok().add(list); + for (Integer in : inSta) { + for (BasDevp devp : basDevps) { + if (devp.getDevNo().equals(in)) { + devopsMessage = new DevopsMessage(); + devopsMessage.setStaNo(in); + devopsMessage.setType("鍏ュ簱绔欑偣"); + if (devp.getLoading().equalsIgnoreCase("Y")) { + List<ErrorType> crnError = isInStaError(devp); + for (ErrorType type : crnError) { + if (!Cools.isEmpty(devopsMessage.getError())) { + devopsMessage.setError(devopsMessage.getError() + ";" + type.getDesc()); + devopsMessage.setMethod(devopsMessage.getMethod() + ";" + type.getMethod()); + } else { + devopsMessage.setError(type.getDesc()); + devopsMessage.setMethod(type.getMethod()); + } + } + } else { + devopsMessage.setError(ErrorType.WUWU.getDesc()); + devopsMessage.setMethod(ErrorType.WUWU.getMethod()); + } + devopsMessages.add(devopsMessage); + } + } + } + return R.ok().add(devopsMessages); + } + + private List<ErrorType> isOutStaError(BasDevp devp) { + List<ErrorType> types = new ArrayList<>(); + // 鑷姩 + if (devp.getAutoing().equalsIgnoreCase("Y")) { + types.add(ErrorType.FEIZIDONG); + } + + // 鏈夌墿 + if (devp.getLoading().equalsIgnoreCase("Y")) { + types.add(ErrorType.YOUWU); + } // 宸ヤ綔鍙锋槸鍚︿负0 + if (devp.getWrkNo() != null) { + types.add(ErrorType.GONGZUOHAO); + } + // 鐩爣绔欑偣 + //TODO +// if (devp.getStaNo() == null) { +// types.add(ErrorType.STANO); +// } + + return types; + } + + private List<ErrorType> isInStaError(BasDevp devp) { + List<ErrorType> types = new ArrayList<>(); + + // 鑷姩 + if (devp.getAutoing().equalsIgnoreCase("Y")) { + types.add(ErrorType.FEIZIDONG); + } + + // 宸ヤ綔鍙锋槸鍚︿负0 + if (devp.getWrkNo() != null) { + types.add(ErrorType.GONGZUOHAO); + } + // 鐩爣绔欑偣 +// if (staProtocol.getStaNo() == null) { +// types.add(ErrorType.STANO); +// } + return types; } } diff --git a/src/main/java/com/zy/asrs/domain/devops/DevopsMessage.java b/src/main/java/com/zy/asrs/domain/devops/DevopsMessage.java index 7266424..5c744f5 100644 --- a/src/main/java/com/zy/asrs/domain/devops/DevopsMessage.java +++ b/src/main/java/com/zy/asrs/domain/devops/DevopsMessage.java @@ -7,6 +7,10 @@ @Data public class DevopsMessage implements Serializable { + private String type; + + private Integer staNo; + private Integer wrkNo; private String error; diff --git a/src/main/java/com/zy/asrs/domain/devops/ErrorType.java b/src/main/java/com/zy/asrs/domain/devops/ErrorType.java index 80a4e21..6630750 100644 --- a/src/main/java/com/zy/asrs/domain/devops/ErrorType.java +++ b/src/main/java/com/zy/asrs/domain/devops/ErrorType.java @@ -4,7 +4,7 @@ * 鍫嗗灈鏈虹姸鎬佹灇涓� */ public enum ErrorType { - ERROR(10000, "绔欑偣瀵硅薄涓虹┖","鑱旂郴鎶�鏈汉鍛�"), + ERROR(10000, "绔欑偣瀵硅薄涓虹┖","鏈繛鎺ュ埌plc"), WUWU(10001, "绔欑偣鏃犵墿", "璇锋鏌ユ墭鐩樻槸鍚﹁蛋鍒颁綅"), YOUWU(10002, "绔欑偣鏈夌墿", "璇锋鏌ュ厜鐢垫槸鍚﹁惤鐏�"), STANO(10003, "鐩爣绔欑偣瀛樺湪绔欑偣鍙�", "缂哄皯鐩爣绔欑偣"), @@ -12,7 +12,7 @@ GONGZUOHAO(10005, "鐩爣绔欑偣瀛樺湪宸ヤ綔鍙�", "鐩爣绔欑偣瀛樺湪宸ヤ綔鍙凤紝璇锋鏌�"), - WORKING(11001, "鍫嗗灈鏈哄伐浣滀腑", "鍫嗗灈鏈哄伐浣滀腑"), + WORKING(11001, "鍫嗗灈鏈哄伐浣滀腑", "鍫嗗灈鏈轰笂瀛樺湪宸ヤ綔鍙�"), HOME(11002, "璐у弶涓嶅湪鍘熶綅", "璇峰皢璐у弶鍥炰腑"), CRNGONGZUOHAO(11003, "鍫嗗灈鏈哄瓨鍦ㄥ伐浣滃彿", "鍫嗗灈鏈哄瓨鍦ㄥ伐浣滃彿锛岃妫�鏌ヨ浠诲姟鏄惁宸茬粡瀹屾垚"), LOAD(11004, "鍫嗗灈鏈虹殑杞界墿鍙版湁鐗�", "鍫嗗灈鏈虹殑杞界墿鍙版湁鐗╋紝璇锋鏌ュ厜鐢�"), diff --git a/src/main/java/com/zy/asrs/domain/vo/SiteTableVo.java b/src/main/java/com/zy/asrs/domain/vo/SiteTableVo.java index 42b7bc9..93fbb92 100644 --- a/src/main/java/com/zy/asrs/domain/vo/SiteTableVo.java +++ b/src/main/java/com/zy/asrs/domain/vo/SiteTableVo.java @@ -19,6 +19,11 @@ // 鏈夌墿 private String loading = "-"; + // 鑳藉叆 + private String inCan = "-"; + + // 鑳藉嚭 + private String outCan = "-"; // 鍙叆 private String inEnable = "-"; @@ -26,6 +31,9 @@ // 鍙嚭 private String outEnable = "-"; + private String barcode ; + + // 闇�姹�1 private String pakMk = "-"; diff --git a/src/main/java/com/zy/core/model/protocol/StaProtocol.java b/src/main/java/com/zy/core/model/protocol/StaProtocol.java index 2e3fb74..5a62815 100644 --- a/src/main/java/com/zy/core/model/protocol/StaProtocol.java +++ b/src/main/java/com/zy/core/model/protocol/StaProtocol.java @@ -54,6 +54,7 @@ // 闅斿绔欑偣锛堝彴杞︿綅缃級 private String nearbySta; + private String barcode; //lfd鍏ュ簱鍗拌 褰搒tamp>=2鏃舵墠鍏ュ簱 private Integer stamp = 0; diff --git a/src/main/java/com/zy/core/properties/SlaveProperties.java b/src/main/java/com/zy/core/properties/SlaveProperties.java index b2e19a4..18acf34 100644 --- a/src/main/java/com/zy/core/properties/SlaveProperties.java +++ b/src/main/java/com/zy/core/properties/SlaveProperties.java @@ -26,6 +26,10 @@ private boolean doubleDeep; + private List<Integer> inSta = new ArrayList<>(); + + private List<Integer> outSta = new ArrayList<>(); + private List<Integer> doubleLocs = new ArrayList<>(); private int groupCount; diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 1c74300..80b9f2b 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -8,7 +8,7 @@ name: @pom.build.finalName@ datasource: driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver - url: jdbc:sqlserver://127.0.0.1:1433;databasename=devopsasrs + url: jdbc:sqlserver://127.0.0.1:1433;databasename=ytflasrs username: sa password: sa@123 mvc: @@ -38,6 +38,8 @@ # 涓嬩綅鏈洪厤缃� wcs-slave: + inSta: 102,104 + outSta: 101,103 # 鍙屾繁 doubleDeep: true # 鍙屾繁搴撲綅鎺掑彿 diff --git a/src/main/webapp/static/css/devops.css b/src/main/webapp/static/css/devops.css new file mode 100644 index 0000000..899f116 --- /dev/null +++ b/src/main/webapp/static/css/devops.css @@ -0,0 +1,167 @@ +body { + /*padding: 10px;*/ + background-color: #6CA7A8; +} +main { + background-color: #fff; + height: 96%; + border-radius: 5px; + box-shadow: 0 0 3px rgba(0,0,0,.3); + margin-bottom: 8px; +} +.button-window { + float: left; + width: 100%; + height: 100%; + padding: 10px; + border-radius: 5px; + box-shadow: 0 0 3px rgba(0 0 0 .3); +} +.main-board { + padding-left: 1%; + float: left; + width: 50%; + height: 100%; + overflow: auto; +} +.main-board:first-child { + border-right: 1px solid #cad9ea; +} + +/* 琛ㄦ牸 */ +.plc-log-header { + height: 15%; +} +.plc-log-body { + height: 100%; + overflow: auto; +} + +/* 鍏ュ嚭搴撴ā寮� */ +.io-mode-oper { + height: 100%; + /*overflow: hidden;*/ + padding: 10px 20px; +} +.io-mode-oper fieldset { + padding: 15px 0 10px 0; + border-width: 1px; + border-style: solid; + height: 100%; +} +.io-mode-oper legend { + text-align: center; + padding: 0 10px; + font-size: 16px; + font-weight: 300; +} + +/* 绔欑偣琛ㄦ牸 */ +#site-table { + font-size: 12px; + border-collapse: collapse; + margin: 0 auto; + text-align: center; +} +#site-table td, #site-table th { + border: 1px solid #cad9ea; + color: #666; + height: 25px; +} +#site-table thead th { + background-color: #CCE8EB; + +} +#site-table tr:nth-child(odd) { + background: #fff; +} +#site-table tr:nth-child(even) { + background: #F5FAFA; +} + + + +/* plc寮傚父琛ㄦ牸 */ +#plc-error-table { + font-size: 12px; + border-collapse: collapse; + margin: 0 auto; +} +#plc-error-table td, #plc-error-table th { + border: 1px solid #cad9ea; + color: #666; + height: 25px; + text-align: left; + padding-left: 5px; +} +#plc-error-table thead th { + background-color: #CCE8EB; + width: 100px; +} +#plc-error-table td { + color: red; +} +#plc-error-table tr:nth-child(odd) { + background: #fff; +} +#plc-error-table tr:nth-child(even) { + background: #F5FAFA; +} + + + + +/* 璇︽儏寮瑰嚭灞� */ +#site-detl { + padding: 30px 10px 0 25px; + overflow: hidden; +} +#site-detl form { + overflow: hidden; +} +.form-item { + margin-bottom: 10px; +} +.form-label { + display: inline-block; + width: 70px; + text-align: right; +} +.form-input { + display: inline-block; + padding-left: 15px; +} +.form-input input { + outline-style: none ; + border: 1px solid #ccc; + border-radius: 3px; + padding: 5px 8px; + width: 150px; + font-size: 14px; + font-weight: bolder; +} +.form-input input:focus{ + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6) +} +.form-button-container { + text-align: center; +} +.form-button { + margin: 10px 10px; + width: 50px; + height: 30px; + color:white; + background-color:cornflowerblue; + border-radius: 3px; + border-width: 0; + outline: none; + font-size: 15px; + text-align: center; + cursor: pointer; +} +.form-button:hover { + opacity: 0.7; +} \ No newline at end of file diff --git a/src/main/webapp/views/devops.html b/src/main/webapp/views/devops.html index 4f35f2d..53e1d06 100644 --- a/src/main/webapp/views/devops.html +++ b/src/main/webapp/views/devops.html @@ -9,7 +9,7 @@ content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"> <link rel="stylesheet" type="text/css" href="../static/css/normalize.css"> <link rel="stylesheet" type="text/css" href="../static/css/common.css"> - <link rel="stylesheet" type="text/css" href="../static/css/pipeline.css"> + <link rel="stylesheet" type="text/css" href="../static/css/devops.css?v=3"> <script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script> <script type="text/javascript" src="../static/js/common.js"></script> <script type="text/javascript" src="../static/js/layer/layer.js"></script> @@ -57,7 +57,7 @@ <div id="plc-error" class="main-board" style="padding-left: 10px"> <div class="plc-log-body"> <div> - <span style="color: #1E9FFF">鍑哄簱宸ヤ綔妗�:</span> + <span style="color: #1E9FFF">宸ヤ綔妗�:</span> </div> <table id="plc-error-table"> <thead> @@ -77,24 +77,18 @@ <!-- 绔欑偣鐘舵�佹暟鎹洃鎺х増 --> <div id="site-monitor" class="main-board"> <div> - <span style="color: #1E9FFF">鏃犳硶鍏ュ簱鍘熷洜鍒ゆ柇:</span> + <span style="color: #1E9FFF">鏃犳硶鍑哄叆搴撳師鍥犲垽鏂�:</span> </div> <!-- 琛ㄦ牸 --> <!--鍥哄畾琛ㄥご table 鍔爐able-layout: fixed; th 鍔� position:sticky;top: 0;--> - <table id="site-table" style="table-layout: fixed;"> + <table id="site-table" > <!-- 琛ㄥご --> <thead style="position:sticky;top: 0;"> <tr> - <th>绔欏彿</th> - <th>宸ヤ綔鍙�</th> - <th>鑷姩</th> - <th>鏈夌墿</th> - <th>鍙叆</th> - <th>鍙嚭</th> - <th>鍏ュ簱鏍囪</th> - <th>鐩爣绔�</th> - <th>淇℃伅</th> - <th>楂樹綆搴撲綅</th> + <th style="width: 180px">绫诲瀷</th> + <th style="width: 150px">绔欏彿</th> + <th style="width: 400px">涓嶇鍚堢殑鏉′欢</th> + <th style="width: 300px">瑙e喅</th> </tr> </thead> <!-- 琛ㄦ牸鍐呭 --> @@ -102,45 +96,9 @@ </table> </div> </main> - <footer> - <textarea id="output"></textarea> - </footer> - <div id="site-detl" style="display: none"> - <form> - <div class="form-item"> - <label class="form-label">绔欏彿:</label> - <div class="form-input"> - <input id="siteId" name="siteId" class="layui-input" lay-verify="required|number" - autocomplete="off" disabled="disabled"> - </div> - </div> - <div class="form-item"> - <label class="form-label">宸ヤ綔鍙�:</label> - <div class="form-input"> - <input id="workNo" name="workNo" type="number" class="layui-input" lay-verify="number" - autocomplete="off"> - </div> - </div> - <div class="form-item"> - <label class="form-label">鐩爣绔�:</label> - <div class="form-input"> - <input id="staNo" name="staNo" type="number" class="layui-input" lay-verify="number" - autocomplete="off"> - </div> - </div> - <div class="form-item"> - <label class="form-label">鍏ュ簱鏍囪:</label> - <div class="form-input"> - <input id="pakMk" name="pakMk" type="text" class="layui-input" autocomplete="off"> - </div> - </div> - <div class="form-item form-button-container"> - <button class="form-button" id="save">淇濆瓨</button> - <button class="form-button" id="cancel" style="background-color: #D0D0D0">鍙栨秷</button> - </div> - </form> - </div> + + </div> </div> @@ -154,7 +112,7 @@ // 瀹為檯琛屾暟 var plcErrorTableFullRows = 0; var siteTableFullRows = 0; - var outputDom = document.getElementById("output"); + //var outputDom = document.getElementById("output"); $(document).ready(function () { initPlcErrorTable(); getPlcError(); @@ -167,7 +125,7 @@ starGetSite(); }, 1000); setInterval(function () { - getSiteOutput(); + //getSiteOutput(); }, 500); function starGetSite() { @@ -221,16 +179,11 @@ } for (var i = 1; i <= table.length; i++) { var tr = tableEl.find("tr").eq(i); - setVal(tr.children("td").eq(0), table[i - 1].devNo); - setVal(tr.children("td").eq(1), table[i - 1].workNo); - setVal(tr.children("td").eq(2), table[i - 1].autoing); - setVal(tr.children("td").eq(3), table[i - 1].loading); - setVal(tr.children("td").eq(4), table[i - 1].inEnable); - setVal(tr.children("td").eq(5), table[i - 1].outEnable); - setVal(tr.children("td").eq(6), table[i - 1].pakMk); - setVal(tr.children("td").eq(7), table[i - 1].staNo); - setVal(tr.children("td").eq(8), table[i - 1].emptyMk); - setVal(tr.children("td").eq(9), table[i - 1].locType1); + tr.children("td").eq(0).html(table[i - 1].type); + tr.children("td").eq(1).html(table[i - 1].staNo); + tr.children("td").eq(2).html(table[i - 1].error); + tr.children("td").eq(3).html(table[i - 1].method); + } } else if (res.code === 403) { window.location.href = baseUrl + "/login"; @@ -239,30 +192,6 @@ } } }); - } - - // 杈撻�佽澶囨棩蹇楄緭鍑� - function getSiteOutput() { - $.ajax({ - url: baseUrl + "/site/output/site", - headers: {'token': localStorage.getItem('token')}, - method: 'POST', - success: function (res) { - if (res.code === 200) { - output(res.data); - } else if (res.code === 403) { - window.location.href = baseUrl + "/login"; - } else { - alert(res.msg); - } - } - }) - } - - // 鏃ュ織杈撳嚭妗� - function output(content) { - outputDom.value += content; - outputDom.scrollTop = outputDom.scrollHeight; } // ------------------------------------------------------------------------------------------------ @@ -311,70 +240,12 @@ " <td></td>\n" + " <td></td>\n" + " <td></td>\n" + - " <td></td>\n" + - " <td></td>\n" + - " <td></td>\n" + - " <td></td>\n" + - " <td></td>\n" + - " <td></td>\n" + " </tr>\n"; } $('#site-table tbody').after(html); } - // 璇︽儏鎿嶄綔 ------------------------------------------------------------------------- - var layerDetl; - $(document).on('dblclick ', '#site-table tr', function () { - stop = true - var siteId = $(this).children("td").eq(0).html(); - if (siteId !== null && siteId !== "") { - layerDetl = layer.open({ - type: 1, - title: false, - shadeClose: true, - offset: 'rt', - anim: 5, - shade: [0], - area: ['340px', '255px'], - closeBtn: 0, - content: $("#site-detl"), - success: function (layero, index) { - http.get(baseUrl + "/site/detl/" + siteId, null, function (res) { - $('#siteId').val(siteId); - $('#workNo').val(res.data.workNo); - $('#staNo').val(res.data.staNo); - $('#pakMk').val(res.data.pakMk); - }) - }, - end: function () { - $('#siteId').val(""); - $('#workNo').val(""); - $('#staNo').val(""); - $('#pakMk').val(""); - stop = false - } - }) - } - }); - - $(document).on('click ', '#save', function () { - http.post(baseUrl + "/site/detl/update", { - siteId: $('#siteId').val(), - workNo: $('#workNo').val(), - staNo: $('#staNo').val(), - pakMk: $('#pakMk').val() - }, function (res) { - layer.msg("淇敼鎴愬姛", {icon: 1,}); - }) - }) - $(document).on('click ', '#cancel', function () { - $('#siteId').val(""); - $('#workNo').val(""); - $('#staNo').val(""); - $('#pakMk').val(""); - layer.close(layerDetl); - }) </script> </html> \ No newline at end of file diff --git a/src/main/webapp/views/index.html b/src/main/webapp/views/index.html index 1e7d256..69ec17e 100644 --- a/src/main/webapp/views/index.html +++ b/src/main/webapp/views/index.html @@ -24,7 +24,7 @@ <li><a id="console" onclick="nav(this.id)" class="nav-select" href="#">涓绘帶鍥�</a></li> <li><a id="pipeline" onclick="nav(this.id)" class="nav-unselect" href="#">杈撻�佽澶�</a></li> <li><a id="crn" onclick="nav(this.id)" class="nav-unselect" href="#">鍫嗗灈鏈�</a></li> - <li><a id="devops" onclick="nav(this.id)" class="nav-unselect" href="#">鐩戞帶</a></li> + <li><a id="devops" onclick="nav(this.id)" class="nav-unselect" href="#">鎵ц妫�娴�</a></li> </ul> </div> </div> -- Gitblit v1.9.1