diff --git a/api/commonRequest.js b/api/commonRequest.js index 3816391..b2eebb8 100644 --- a/api/commonRequest.js +++ b/api/commonRequest.js @@ -1,6 +1,6 @@ let aqEnnable = true // 参数加密开关 //后端路径 -const commonUrl = "http://10.138.225.233:18080/zhgd/"; +const commonUrl = "http://127.0.0.1:18080/zhgd/"; //前端路径 const URL_IP="http://10.138.225.233:21624/zhgd-web" /* 登录相关 */ diff --git a/js/consQuality/consQuality.js b/js/consQuality/consQuality.js index 618fa20..2a05905 100644 --- a/js/consQuality/consQuality.js +++ b/js/consQuality/consQuality.js @@ -363,7 +363,6 @@ function detectionRecord(button,construction){ if(button !== ''){ let buttons = document.getElementsByClassName('button-style'); let isSelected = button.style.color === "rgb(81, 170, 209)"; - for (let i = 0; i < buttons.length; i++) { buttons[i].style.border = ''; buttons[i].style.color = ''; @@ -377,9 +376,6 @@ function detectionRecord(button,construction){ detectionRecord('',''); } } - - const url = commonUrl + "screen/largeScreen/constructionQuality/detectionRecord"; - const params = { "roleCode": roleCode, "orgId": orgId, @@ -387,6 +383,66 @@ function detectionRecord(button,construction){ "bidCode": bidCode, "construction": construction } + console.log(construction) + console.log(construction=='table') + if(construction=='table'){ + $(".echarts-div").css("display","none"); + $("#data-table-div").css("display","block"); + getDataTable(); + }else{ + $(".echarts-div").css("display","block"); + $("#data-table-div").css("display","none"); + getDetectionRecord(params); + } + +} + +//施工质量列表 +function getDataTable(){ + const url = commonUrl + "screen/largeScreen/constructionQuality/getDevDataList"; + table.render({ + elem: '#data-table', + url: url, + skin: 'line', + headers:{ + decrypt:"decrypt", + "Authorization":token + }, + where: { + roleCode: roleCode, + orgId: orgId, + userId: userId, + bidCode: bidCode, + }, + cols: [[ + {field: 'number', width:80,title: '序号', align: 'center', type: 'numbers', fixed: 'left'}, + {field: 'name', align: 'center', title: '区域名称'}, + {field: 'bidName', align: 'center', title: '工程名称'}, + {field: 'val', align: 'center', title: '本次沉降'}, + {field: 'hisVal', align: 'center', title: '累计沉降'}, + {field: 'createTime', align: 'center', title: '检测时间'}, + {field: 'jcUser', align: 'center', title: '检测人'}, + {field: 'jhUser', align: 'center', title: '校核人'}, + {field: 'devCode', align: 'center', title: '仪器型号计量编号'} + ]], + initComplete: function () { + // 在表格渲染完成后,重新渲染序号列 + var that = this.elem.next(); + var tool = that.children('.layui-table-box').children('.layui-table-fixed').children('.layui-table-body').children('.layui-table'); + tool.find("tr").each(function (index, item) { + $(this).find('td[data-field="LAY_TABLE_INDEX"]').text(index + 1); + }); + }, + page: true, //开启分页 + loading: true, //数据加载中。。。 + limits: [5, 10, 20, 100], + limit: 7 + }) +} + +//查询echars +function getDetectionRecord(params){ + const url = commonUrl + "screen/largeScreen/constructionQuality/detectionRecord"; let encryptStr = encryptCBC(JSON.stringify(params)); ajaxRequest(url, "POST", encryptStr, true, function () { }, function (result) { @@ -416,6 +472,8 @@ function detectionRecord(button,construction){ }, "application/json",aqEnnable); } + + //检测记录对比echarts图表 function detectionRecordEcharts(extractedData){ var myChart = echarts.init(document.getElementById('dome')); diff --git a/js/pages/home/navigation.js b/js/pages/home/navigation.js index 59fda51..6539a05 100644 --- a/js/pages/home/navigation.js +++ b/js/pages/home/navigation.js @@ -1,4 +1,6 @@ let element, layer, form, bidCode; +let talkAbout=false; + layui.use(['layer', 'element'], function () { element = layui.element; layer = layui.layer; @@ -43,6 +45,121 @@ layui.use(['layer', 'element'], function () { } }) }); +let loading; +// 检查浏览器是否支持语音识别 API + if ('webkitSpeechRecognition' in window) { + const recognition = new webkitSpeechRecognition(); // 创建一个 SpeechRecognition 对象 + recognition.continuous = false; // 是否持续识别,这里设置为 false + recognition.lang = 'zh-CN'; // 设置识别的语言,这里设置为中文 + recognition.interimResults = false; // 是否返回临时识别结果 + // 当语音识别开始时触发 + recognition.onstart = function() { + loading = layer.load(2, { + shade: false ,//0.1透明度的白色背景 + content:'
语音识别中......
', + success: function (layerContentStyle) { // 设置loading样式 + layerContentStyle.find('.layui-layer-content').css({ + 'padding-left': '45px', + 'text-align': 'left', + 'width': '175px', + 'line-height':'30px' + }); + } + }); + + }; + // 当语音识别结束时触发 + recognition.onend = function() { + talkAbout=false; + layer.close(loading); + loading = layer.load(2, { + shade: false ,//0.1透明度的白色背景 + time: 1000, + content:'
正在检测中......
', + success: function (layerContentStyle) { // 设置loading样式 + layerContentStyle.find('.layui-layer-content').css({ + 'padding-left': '45px', + 'text-align': 'left', + 'width': '175px', + 'line-height':'30px' + }); + } + }); + + }; + // 当识别到一个结果时触发 + recognition.onresult = function(event) { + layer.close(loading); + const transcript = event.results[0][0].transcript; // 获取识别的文本 + if(transcript){ + let openUrl='' + if(transcript.indexOf("首页")!=-1){ + openUrl ='../index/index.html' + }else if(transcript.indexOf("视频监控")!=-1){ + openUrl ='../video/video.html' + }else if(transcript.indexOf("组塔检测")!=-1){ + openUrl ='../towerAssInspect/towerAssInspect.html' + }else if(transcript.indexOf("作业环境")!=-1){ + openUrl ='../operEnvironment/operEnvironment.html' + }else if(transcript.indexOf("施工质量")!=-1){ + openUrl ='../consQuality/consQuality.html' + }else if(transcript.indexOf("人员管控")!=-1){ + openUrl ='../personnelControl/personnelControl.html' + }else if(transcript.indexOf("出入管理")!=-1){ + openUrl ='../accessMge/accessMge.html' + }else if(transcript.indexOf("告警管理")!=-1){ + openUrl ='../alarmMge/alarmMge.html' + }else { + console.log("识别结果异常"); + layer.msg('指令不正确', { + icon: 6, + time: 1000 + }); + return ; + } + console.log(openUrl) + if(openUrl){ + const li= $('#nav-right ul li'); + for (let i = 0; i
+
沉降点记录
桩基成孔
地面压实
大体积混凝土温控检测
-
+
+
+
+
diff --git a/pages/home/navigation.html b/pages/home/navigation.html index 6b85563..3bf2ab2 100644 --- a/pages/home/navigation.html +++ b/pages/home/navigation.html @@ -20,7 +20,7 @@