Commit 74259d512684e367bd2e5018422bfdfeea86a3cd

Authored by xp.Huang
2 parents 8894b5a8 22e00dac

Merge branch 'feat/dynamic-title-switch' into 'main_dev'

feat: 文本组件新增标题控制

See merge request yunteng/thingskit-scada!75
@@ -102,7 +102,7 @@ function copyFileUsageOssServer(cb) { @@ -102,7 +102,7 @@ function copyFileUsageOssServer(cb) {
102 const outPath = './build/oss' 102 const outPath = './build/oss'
103 103
104 for (const filePath of copyFileList) { 104 for (const filePath of copyFileList) {
105 - src(path.resolve(__dirname, filePath), {allowEmpty:true}) 105 + src(path.resolve(__dirname, filePath), { allowEmpty: true })
106 .pipe((dest(outPath))) 106 .pipe((dest(outPath)))
107 } 107 }
108 108
@@ -22,26 +22,26 @@ @@ -22,26 +22,26 @@
22 <meta name="mobile-web-app-capable" content="yes"> 22 <meta name="mobile-web-app-capable" content="yes">
23 <meta name="theme-color" content="#d89000"> 23 <meta name="theme-color" content="#d89000">
24 24
25 - <link rel="stylesheet" href="./js/plugin/layui/css/layui.css?v=1686710985762"> 25 + <link rel="stylesheet" href="./js/plugin/layui/css/layui.css?v=1687228273654">
26 26
27 <!-- load configure file --> 27 <!-- load configure file -->
28 - <script src="./js/config/config.js?v=1686710985762"></script> 28 + <script src="./js/config/config.js?v=1687228273654"></script>
29 29
30 <!-- crypto-js --> 30 <!-- crypto-js -->
31 - <script src="./js/plugin/crypto-js/crypto-js.js?v=1686710985762"></script> 31 + <script src="./js/plugin/crypto-js/crypto-js.js?v=1687228273654"></script>
32 32
33 <!-- storage persistent --> 33 <!-- storage persistent -->
34 - <script src="./js/const/persistentStorage.js?v=1686710985762"></script> 34 + <script src="./js/const/persistentStorage.js?v=1687228273654"></script>
35 <!-- Global const --> 35 <!-- Global const -->
36 - <script src="./js/const/const.js?v=1686710985762"></script> 36 + <script src="./js/const/const.js?v=1687228273654"></script>
37 37
38 <!-- Axios --> 38 <!-- Axios -->
39 - <script src="./js/plugin/axios/axios.min.js?v=1686710985762"></script>  
40 - <script src="./js/plugin/axios/DefHttp.js?v=1686710985762"></script>  
41 - <script src="./js/api/index.js?v=1686710985762"></script> 39 + <script src="./js/plugin/axios/axios.min.js?v=1687228273654"></script>
  40 + <script src="./js/plugin/axios/DefHttp.js?v=1687228273654"></script>
  41 + <script src="./js/api/index.js?v=1687228273654"></script>
42 42
43 <!-- load script --> 43 <!-- load script -->
44 - <script src="./js/config/loadScript.js?v=1686710985762"></script> 44 + <script src="./js/config/loadScript.js?v=1687228273654"></script>
45 45
46 <!-- act editor --> 46 <!-- act editor -->
47 <!-- <script src="https://oss.yuntengcloud.com/iotdocs/thingskit-scada/ace.js"></script> --> 47 <!-- <script src="https://oss.yuntengcloud.com/iotdocs/thingskit-scada/ace.js"></script> -->
@@ -54,7 +54,7 @@ @@ -54,7 +54,7 @@
54 <!-- <script src="https://vjs.zencdn.net/7.10.2/video.min.js"></script> --> 54 <!-- <script src="https://vjs.zencdn.net/7.10.2/video.min.js"></script> -->
55 <!-- <script src="https://oss.yuntengcloud.com/iotdocs/thingskit-scada/video.min.js"></script> --> 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=1686710985762"></script> 57 + <script src="./js/plugin/layui/layui.js?v=1687228273654"></script>
58 <!-- <link rel="stylesheet" href="https://cdnjs.loli.net/ajax/libs/layui/2.6.8/css/layui.min.css" 58 <!-- <link rel="stylesheet" href="https://cdnjs.loli.net/ajax/libs/layui/2.6.8/css/layui.min.css"
59 integrity="sha512-iQBJbsNHXUcgEIgWThd2dr8tOdKPvICwqjPEZYY81z3eMya44A5MiAqfWSCh+Ee1YzNYkdrI982Qhwgr8LEYOQ==" 59 integrity="sha512-iQBJbsNHXUcgEIgWThd2dr8tOdKPvICwqjPEZYY81z3eMya44A5MiAqfWSCh+Ee1YzNYkdrI982Qhwgr8LEYOQ=="
60 crossorigin="anonymous" referrerpolicy="no-referrer" /> 60 crossorigin="anonymous" referrerpolicy="no-referrer" />
@@ -63,7 +63,7 @@ @@ -63,7 +63,7 @@
63 crossorigin="anonymous" referrerpolicy="no-referrer"></script> --> 63 crossorigin="anonymous" referrerpolicy="no-referrer"></script> -->
64 64
65 <!-- 引入修改样式 --> 65 <!-- 引入修改样式 -->
66 - <link rel="stylesheet" href="./styles/formatChange.css?v=1686710985762"> 66 + <link rel="stylesheet" href="./styles/formatChange.css?v=1687228273654">
67 67
68 <script type="text/javascript"> 68 <script type="text/javascript">
69 /** 69 /**
@@ -306,7 +306,7 @@ @@ -306,7 +306,7 @@
306 var supportedDomain = (hostName.substring(hostName.length - 8, hostName.length) === '.draw.io') || 306 var supportedDomain = (hostName.substring(hostName.length - 8, hostName.length) === '.draw.io') ||
307 (hostName.substring(hostName.length - 13, hostName.length) === '.diagrams.net'); 307 (hostName.substring(hostName.length - 13, hostName.length) === '.diagrams.net');
308 308
309 - const releaseVersion = '1686710985762' 309 + const releaseVersion = '1687228273654'
310 const appMinSrc = Enable_OSS ? `${OSS_Prefix}app.min.js?v=${releaseVersion}` : `js/app.min.js?v=${releaseVersion}` 310 const appMinSrc = Enable_OSS ? `${OSS_Prefix}app.min.js?v=${releaseVersion}` : `js/app.min.js?v=${releaseVersion}`
311 function loadAppJS() { 311 function loadAppJS() {
312 mxscript(appMinSrc, function () { 312 mxscript(appMinSrc, function () {
@@ -3405,7 +3405,6 @@ EditorUi.prototype.lightboxFit = function(maxHeight) @@ -3405,7 +3405,6 @@ EditorUi.prototype.lightboxFit = function(maxHeight)
3405 var h = pageFormat.height; 3405 var h = pageFormat.height;
3406 // var h = pageFormat.height / graph.view.scale; 3406 // var h = pageFormat.height / graph.view.scale;
3407 var s = Math.min(max, Math.min(cw / w, ch / h)); 3407 var s = Math.min(max, Math.min(cw / w, ch / h));
3408 - console.log({w, h, scale: graph.view.scale, cw, ch, s})  
3409 graph.view.scaleAndTranslate(s, 3408 graph.view.scaleAndTranslate(s,
3410 (margin + cw - w * s) / (2 * s) - bounds.x / graph.view.scale, 3409 (margin + cw - w * s) / (2 * s) - bounds.x / graph.view.scale,
3411 (margin + ch - h * s) / (2 * s) - bounds.y / graph.view.scale); 3410 (margin + ch - h * s) / (2 * s) - bounds.y / graph.view.scale);
@@ -6647,9 +6647,9 @@ DataFormatPanel.prototype.addDataFont = function (container) { @@ -6647,9 +6647,9 @@ DataFormatPanel.prototype.addDataFont = function (container) {
6647 6647
6648 function getAlarmListSubmitValue(filed = {}) { 6648 function getAlarmListSubmitValue(filed = {}) {
6649 console.log(field?.devicesInfo) 6649 console.log(field?.devicesInfo)
6650 - if(!field?.devicesInfo) { 6650 + if (!field?.devicesInfo) {
6651 UseLayUi.errorMsg('请先进行设备绑定!') 6651 UseLayUi.errorMsg('请先进行设备绑定!')
6652 - return 6652 + return
6653 } 6653 }
6654 const value = { 6654 const value = {
6655 configurationId, 6655 configurationId,
@@ -8129,6 +8129,7 @@ DataFormatPanel.prototype.addDataFont = function (container) { @@ -8129,6 +8129,7 @@ DataFormatPanel.prototype.addDataFont = function (container) {
8129 SLAVE_DEVICE_ID: 'slaveDeviceId', 8129 SLAVE_DEVICE_ID: 'slaveDeviceId',
8130 ATTR: 'attr', 8130 ATTR: 'attr',
8131 GATEWAY: 'GATEWAY', 8131 GATEWAY: 'GATEWAY',
  8132 + TITLE: 'title'
8132 } 8133 }
8133 8134
8134 const enumDisplayType = HandleDynamicEffect.enumDisplayType 8135 const enumDisplayType = HandleDynamicEffect.enumDisplayType
@@ -8165,6 +8166,16 @@ DataFormatPanel.prototype.addDataFont = function (container) { @@ -8165,6 +8166,16 @@ DataFormatPanel.prototype.addDataFont = function (container) {
8165 ` 8166 `
8166 } 8167 }
8167 8168
  8169 + function generateTitle() {
  8170 + return `
  8171 + <div class="layui-form-item" style="margin-bottom: 0px">
  8172 + <div class="layui-input-block" style="margin-left: 0px;">
  8173 + <input name="${enumConst.TITLE}" class="layui-input" lay-verType="tips" />
  8174 + </div>
  8175 + </div>
  8176 + `
  8177 + }
  8178 +
8168 /** 8179 /**
8169 * @description 添加一条记录 8180 * @description 添加一条记录
8170 */ 8181 */
@@ -8179,6 +8190,7 @@ DataFormatPanel.prototype.addDataFont = function (container) { @@ -8179,6 +8190,7 @@ DataFormatPanel.prototype.addDataFont = function (container) {
8179 <td> 8190 <td>
8180 <input autocomplete="off" lay-verType="tips" lay-verify="required" type="number" name="${enumConst.MAX}" class="layui-input ${enumActionEl.MAX_FILTER}"> 8191 <input autocomplete="off" lay-verType="tips" lay-verify="required" type="number" name="${enumConst.MAX}" class="layui-input ${enumActionEl.MAX_FILTER}">
8181 </td> 8192 </td>
  8193 + ${IS_DISPLAY && `<td>${generateTitle()}</td>`}
8182 <td style="text-align: center;"> 8194 <td style="text-align: center;">
8183 <button type="button" class="layui-btn layui-btn-primary layui-border-red ${enumActionEl.DEL_BTN_EL}">删除</button> 8195 <button type="button" class="layui-btn layui-btn-primary layui-border-red ${enumActionEl.DEL_BTN_EL}">删除</button>
8184 </td> 8196 </td>
@@ -8347,6 +8359,7 @@ DataFormatPanel.prototype.addDataFont = function (container) { @@ -8347,6 +8359,7 @@ DataFormatPanel.prototype.addDataFont = function (container) {
8347 ${IS_RUNNING ? '<th style="text-align:center">类型</th>' : ''} 8359 ${IS_RUNNING ? '<th style="text-align:center">类型</th>' : ''}
8348 <th style="text-align:center">最小值(>=)</th> 8360 <th style="text-align:center">最小值(>=)</th>
8349 <th style="text-align:center">最大值(<=)</th> 8361 <th style="text-align:center">最大值(<=)</th>
  8362 + ${IS_DISPLAY ? '<th style="text-align:center">标签</th>' : ''}
8350 <th style="text-align:center">操作</th> 8363 <th style="text-align:center">操作</th>
8351 </tr> 8364 </tr>
8352 </thead> 8365 </thead>
@@ -14409,7 +14422,7 @@ class DispatchCenter { @@ -14409,7 +14422,7 @@ class DispatchCenter {
14409 const template = AlarmListComponent.createAlarmItem(data.items) 14422 const template = AlarmListComponent.createAlarmItem(data.items)
14410 $(`#${id}`).find('.list-wrapper').html(template) 14423 $(`#${id}`).find('.list-wrapper').html(template)
14411 } else { 14424 } else {
14412 - $(`#${id}`).find('.list-wrapper').html(`<div>暂无数据</div>`) 14425 + $(`#${id}`).find('.list-wrapper').html(`<div>暂无数据</div>`)
14413 } 14426 }
14414 if (autoPlay) { 14427 if (autoPlay) {
14415 const wrapperHeight = $(`#${id}`).height() 14428 const wrapperHeight = $(`#${id}`).height()
@@ -16381,6 +16394,7 @@ class HandleDynamicEffect { @@ -16381,6 +16394,7 @@ class HandleDynamicEffect {
16381 } else if (condition.type === HandleDynamicEffect.enumDisplayType.HIDDEN) { 16394 } else if (condition.type === HandleDynamicEffect.enumDisplayType.HIDDEN) {
16382 isShow = false 16395 isShow = false
16383 } 16396 }
  16397 + console.log(condition)
16384 const updateFn = () => { 16398 const updateFn = () => {
16385 if (!isShow) { 16399 if (!isShow) {
16386 Object.keys(HandleDynamicEffect.enumActType).forEach(key => { 16400 Object.keys(HandleDynamicEffect.enumActType).forEach(key => {
@@ -16393,7 +16407,10 @@ class HandleDynamicEffect { @@ -16393,7 +16407,10 @@ class HandleDynamicEffect {
16393 const temp = this.actNodeMapping.get(node.id) 16407 const temp = this.actNodeMapping.get(node.id)
16394 temp.display = true 16408 temp.display = true
16395 } 16409 }
16396 - 16410 + if (condition.title) {
  16411 + node.setAttribute('label', condition.title)
  16412 + console.log(node)
  16413 + }
16397 node.setVisible(isShow) 16414 node.setVisible(isShow)
16398 } 16415 }
16399 this.insertOnceUpdateFn(node, updateFn) 16416 this.insertOnceUpdateFn(node, updateFn)