Commit 978c606f257c2548b1cc8dcd22cb6799dd9d593f

Authored by xp.Huang
2 parents abc14825 ccb2030b

Merge branch 'fix/DEFECT-1436' into 'main_dev'

fix: DEFECT-1436修复MQTT设备绑定参数设置modbus下发指令错误

See merge request yunteng/thingskit-scada!93
... ... @@ -22,26 +22,26 @@
22 22 <meta name="mobile-web-app-capable" content="yes">
23 23 <meta name="theme-color" content="#d89000">
24 24
25   - <link rel="stylesheet" href="./js/plugin/layui/css/layui.css?v=1690081039465">
  25 + <link rel="stylesheet" href="./js/plugin/layui/css/layui.css?v=1690365980745">
26 26
27 27 <!-- load configure file -->
28   - <script src="./js/config/config.js?v=1690081039465"></script>
  28 + <script src="./js/config/config.js?v=1690365980745"></script>
29 29
30 30 <!-- crypto-js -->
31   - <script src="./js/plugin/crypto-js/crypto-js.js?v=1690081039465"></script>
  31 + <script src="./js/plugin/crypto-js/crypto-js.js?v=1690365980745"></script>
32 32
33 33 <!-- storage persistent -->
34   - <script src="./js/const/persistentStorage.js?v=1690081039465"></script>
  34 + <script src="./js/const/persistentStorage.js?v=1690365980745"></script>
35 35 <!-- Global const -->
36   - <script src="./js/const/const.js?v=1690081039465"></script>
  36 + <script src="./js/const/const.js?v=1690365980745"></script>
37 37
38 38 <!-- Axios -->
39   - <script src="./js/plugin/axios/axios.min.js?v=1690081039465"></script>
40   - <script src="./js/plugin/axios/DefHttp.js?v=1690081039465"></script>
41   - <script src="./js/api/index.js?v=1690081039465"></script>
  39 + <script src="./js/plugin/axios/axios.min.js?v=1690365980745"></script>
  40 + <script src="./js/plugin/axios/DefHttp.js?v=1690365980745"></script>
  41 + <script src="./js/api/index.js?v=1690365980745"></script>
42 42
43 43 <!-- load script -->
44   - <script src="./js/config/loadScript.js?v=1690081039465"></script>
  44 + <script src="./js/config/loadScript.js?v=1690365980745"></script>
45 45
46 46 <!-- act editor -->
47 47 <!-- <script src="https://oss.yuntengcloud.com/iotdocs/thingskit-scada/ace.js"></script> -->
... ... @@ -54,7 +54,7 @@
54 54 <!-- <script src="https://vjs.zencdn.net/7.10.2/video.min.js"></script> -->
55 55 <!-- <script src="https://oss.yuntengcloud.com/iotdocs/thingskit-scada/video.min.js"></script> -->
56 56
57   - <script src="./js/plugin/layui/layui.js?v=1690081039465"></script>
  57 + <script src="./js/plugin/layui/layui.js?v=1690365980745"></script>
58 58 <!-- <link rel="stylesheet" href="https://cdnjs.loli.net/ajax/libs/layui/2.6.8/css/layui.min.css"
59 59 integrity="sha512-iQBJbsNHXUcgEIgWThd2dr8tOdKPvICwqjPEZYY81z3eMya44A5MiAqfWSCh+Ee1YzNYkdrI982Qhwgr8LEYOQ=="
60 60 crossorigin="anonymous" referrerpolicy="no-referrer" />
... ... @@ -63,7 +63,7 @@
63 63 crossorigin="anonymous" referrerpolicy="no-referrer"></script> -->
64 64
65 65 <!-- 引入修改样式 -->
66   - <link rel="stylesheet" href="./styles/formatChange.css?v=1690081039465">
  66 + <link rel="stylesheet" href="./styles/formatChange.css?v=1690365980745">
67 67
68 68 <script type="text/javascript">
69 69 /**
... ... @@ -306,7 +306,7 @@
306 306 var supportedDomain = (hostName.substring(hostName.length - 8, hostName.length) === '.draw.io') ||
307 307 (hostName.substring(hostName.length - 13, hostName.length) === '.diagrams.net');
308 308
309   - const releaseVersion = '1690081039465'
  309 + const releaseVersion = '1690365980745'
310 310 const appMinSrc = Enable_OSS ? `${OSS_Prefix}app.min.js?v=${releaseVersion}` : `js/app.min.js?v=${releaseVersion}`
311 311 function loadAppJS() {
312 312 mxscript(appMinSrc, function () {
... ...
... ... @@ -6371,7 +6371,7 @@ DataFormatPanel.prototype.addDataFont = function (container) {
6371 6371 const { additional = {} } = dataSources[0] || {}
6372 6372 const { [enumBindKey.EFFECT_SCOPE]: effectScope = 1000 } = additional
6373 6373 linkageIntervalSelect(effectScope)
6374   - form.val(CONTAINER_FILTER, additional)
  6374 + form.val(CONTAINER_FILTER, additional)
6375 6375 }
6376 6376
6377 6377 const refresh = echoRefreshFn
... ... @@ -15165,6 +15165,7 @@ class HandleDataSource {
15165 15165 const { nodeId, attr } = record
15166 15166 const node = this.getNodeByNodeId(nodeId)
15167 15167 const { data } = message
  15168 + if (!node) return
15168 15169 const type = this.getComponentType(node)
15169 15170
15170 15171 if (node && type === this.componentType.FLOWMETER) {
... ... @@ -15684,7 +15685,6 @@ class HandleDataSource {
15684 15685 * @return {*}
15685 15686 */
15686 15687 getNodeByNodeId(nodeId) {
15687   - // const nodeId = this.getNodeIdByCmdId(subscriptionId)
15688 15688 return this.contentAllCell.find(item => item.id === nodeId)
15689 15689 }
15690 15690
... ... @@ -16032,6 +16032,7 @@ class HandleDataInteraction {
16032 16032 if (content.transportType === 'TCP' || content.commandType === '1') return
16033 16033 const jsonCommand = content.jsonCommand || ''
16034 16034 let defaultValue = { [enumConst.ATTR_PLACEHOLDER]: 0 }
  16035 + if (!document.getElementById(enumActionEl.EDITOR)) return
16035 16036 const editor = ace.edit(enumActionEl.EDITOR, {
16036 16037 maxLines: 18, // 最大行数,超过会自动出现滚动条
16037 16038 minLines: 10, // 最小行数,还未到最大行数时,编辑器会自动伸缩大小
... ... @@ -16214,8 +16215,11 @@ class HandleDataInteraction {
16214 16215
16215 16216 if (commandType == enumCommandType.MODBUS) {
16216 16217 value = data[enumActionEl.CUSTOM_TCP_COMMAND]
16217   - const { method } = additional
  16218 + const { method, deviceCode } = additional || {}
  16219 +
16218 16220 const validate = new Validate([
  16221 + { value: deviceCode, required: true, message: '未找到设备地址码' },
  16222 + { value: method, required: true, message: '未找到Modbus命令操作类型' },
16219 16223 { value, required: true, message: '下发值是必填项' },
16220 16224 ...(method == '05' ? [{ value, message: '下发类型必须为0或1', validator(value) { return value == 0 || value == 1 } }] : []),
16221 16225 ...(method == '06' ? [{ value, message: '下发类型必须为整型', validator(value) { return !isNaN(value) && Number(value) % 1 === 0 } }, { value, message: '最大值不能超过65535', validator(value) { return Number(value) <= parseInt('ffff', 16) } }] : []),
... ...