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:'