diff --git a/public/image/lora2/background1.png b/public/image/lora2/background1.png new file mode 100644 index 0000000..31c5fd9 Binary files /dev/null and b/public/image/lora2/background1.png differ diff --git a/public/image/lora2/kk1_1.png b/public/image/lora2/kk1_1.png new file mode 100644 index 0000000..60c6183 Binary files /dev/null and b/public/image/lora2/kk1_1.png differ diff --git a/public/image/lora2/kk1_2.png b/public/image/lora2/kk1_2.png new file mode 100644 index 0000000..c509849 Binary files /dev/null and b/public/image/lora2/kk1_2.png differ diff --git a/public/image/lora2/kk1_3.png b/public/image/lora2/kk1_3.png new file mode 100644 index 0000000..e10cd92 Binary files /dev/null and b/public/image/lora2/kk1_3.png differ diff --git a/public/image/lora2/kk1_4.png b/public/image/lora2/kk1_4.png new file mode 100644 index 0000000..82b2ffa Binary files /dev/null and b/public/image/lora2/kk1_4.png differ diff --git a/public/image/lora2/kk2_1.png b/public/image/lora2/kk2_1.png new file mode 100644 index 0000000..68c79c4 Binary files /dev/null and b/public/image/lora2/kk2_1.png differ diff --git a/public/image/lora2/kk2_2.png b/public/image/lora2/kk2_2.png new file mode 100644 index 0000000..871ddc3 Binary files /dev/null and b/public/image/lora2/kk2_2.png differ diff --git a/public/image/lora2/kk2_3.png b/public/image/lora2/kk2_3.png new file mode 100644 index 0000000..88a114e Binary files /dev/null and b/public/image/lora2/kk2_3.png differ diff --git a/public/image/lora2/kk_biaoti.png b/public/image/lora2/kk_biaoti.png new file mode 100644 index 0000000..da73a63 Binary files /dev/null and b/public/image/lora2/kk_biaoti.png differ diff --git a/public/image/lora2/logo.png b/public/image/lora2/logo.png new file mode 100644 index 0000000..a540b55 Binary files /dev/null and b/public/image/lora2/logo.png differ diff --git a/public/image/lora2/top.png b/public/image/lora2/top.png new file mode 100644 index 0000000..c17cfb4 Binary files /dev/null and b/public/image/lora2/top.png differ diff --git a/public/image/lora2/top_1.png b/public/image/lora2/top_1.png new file mode 100644 index 0000000..1b3fe48 Binary files /dev/null and b/public/image/lora2/top_1.png differ diff --git a/public/script/http/lora2.js b/public/script/http/lora2.js new file mode 100644 index 0000000..46552ce --- /dev/null +++ b/public/script/http/lora2.js @@ -0,0 +1,317 @@ +var dom1 = document.getElementById('container1'); +var dom2 = document.getElementById('container2'); +lineGraph(dom1, '温度', '℃') +lineGraph2(dom2, '血氧', '%') + +function lineGraph(dom, title, unit){ + var myChart = echarts.init(dom, null, { + renderer: 'canvas', + useDirtyRect: false +}); +var app = {}; +var ROOT_PATH = ''; +var option; +var dataAll = []; + +$.get( + ROOT_PATH + '/loraData', + function (_rawData) { + _rawData.forEach(value => dataAll.push(value)); + run(_rawData); + } +); +function run(_rawData) { + _rawData.unshift(["Income","Life Expectancy","Population","Country","Year"]) + // var countries = ['Australia', 'Canada', 'China', 'Cuba', 'Finland', 'France', 'Germany', 'Iceland', 'India', 'Japan', 'North Korea', 'South Korea', 'New Zealand', 'Norway', 'Poland', 'Russia', 'Turkey', 'United Kingdom', 'United States']; + const countries = [title]; + const datasetWithFilters = []; + const seriesList = []; + echarts.util.each(countries, function (country) { + var datasetId = 'dataset_' + country; + datasetWithFilters.push({ + id: datasetId, + fromDatasetId: 'dataset_raw', + transform: { + type: 'filter', + config: { + and: [ + // { dimension: 'Year', gte: 1950 }, + { dimension: 'Country', '=': country } + ] + } + } + }); + seriesList.push({ + type: 'line', + datasetId: datasetId, + showSymbol: false, + smooth: true, + name: country, + endLabel: { + show: true, + formatter: function (params) { + return params.value[3] + ': ' + params.value[0] + unit; + } + }, + labelLayout: { + moveOverlap: 'shiftY' + }, + emphasis: { + focus: 'series' + }, + encode: { + x: 'Year', + y: 'Income', + label: ['Country', 'Income'], + itemName: 'Year', + tooltip: ['Income'] + } + }); + }); + option = { + animationDuration: 10000, + dataset: [ + { + id: 'dataset_raw', + source: _rawData + }, + ...datasetWithFilters + ], + tooltip: { + order: 'valueDesc', + trigger: 'axis' + }, + xAxis: { + type: 'category', + nameLocation: 'middle' + }, + yAxis: [ + { + scale: false, + name: '体温', + min: 30, + max: 40, + }, + { + type: 'value', + name: '血氧', + min: 0, + max: 100, + position: 'left', + offset: 30, + axisLabel: { + formatter: '{value} °C' + } + } + ], + grid: { + right: 140 + }, + series: seriesList + }; + myChart.setOption(option); +} + +setInterval(function () { + $.get( + ROOT_PATH + '/loraData?item=' + title, + function (_rawData2) { + + if (dataAll.length > 40){ + dataAll.shift(); + dataAll.shift(); + } + + _rawData2.forEach(value => dataAll.push(value)); + + _rawData = [["Income","Life Expectancy","Population","Country","Year"]]; + dataAll.forEach(value => _rawData.push(value)); + + myChart.setOption({ + dataset: [ + { + source: _rawData + } + ], + }); + + let original = ''; + dataAll.forEach((elem, index) => { + original += elem[3] + elem[0]; + if (elem[3] == "血氧") { + original += '%' + } else { + original += '℃' + } + original += ' ' + }) + + $(".sound-code-chunk-default-content").html(original); + + + } + ); + + + +}, 1000); + + +if (option && typeof option === 'object') { + myChart.setOption(option); +} + +window.addEventListener('resize', myChart.resize); + +} + +function lineGraph2(dom, title, unit){ + var myChart = echarts.init(dom, null, { + renderer: 'canvas', + useDirtyRect: false + }); + var app = {}; + var ROOT_PATH = ''; + var option; + var dataAll = []; + + $.get( + ROOT_PATH + '/loraData', + function (_rawData) { + _rawData.forEach(value => dataAll.push(value)); + run(_rawData); + } + ); + function run(_rawData) { + _rawData.unshift(["Income","Life Expectancy","Population","Country","Year"]) + // var countries = ['Australia', 'Canada', 'China', 'Cuba', 'Finland', 'France', 'Germany', 'Iceland', 'India', 'Japan', 'North Korea', 'South Korea', 'New Zealand', 'Norway', 'Poland', 'Russia', 'Turkey', 'United Kingdom', 'United States']; + const countries = [title]; + const datasetWithFilters = []; + const seriesList = []; + echarts.util.each(countries, function (country) { + var datasetId = 'dataset_' + country; + datasetWithFilters.push({ + id: datasetId, + fromDatasetId: 'dataset_raw', + transform: { + type: 'filter', + config: { + and: [ + // { dimension: 'Year', gte: 1950 }, + { dimension: 'Country', '=': country } + ] + } + } + }); + seriesList.push({ + type: 'line', + datasetId: datasetId, + showSymbol: false, + smooth: true, + name: country, + endLabel: { + show: true, + formatter: function (params) { + return params.value[3] + ': ' + params.value[0] + unit; + } + }, + labelLayout: { + moveOverlap: 'shiftY' + }, + emphasis: { + focus: 'series' + }, + encode: { + x: 'Year', + y: 'Income', + label: ['Country', 'Income'], + itemName: 'Year', + tooltip: ['Income'] + } + }); + }); + option = { + animationDuration: 10000, + dataset: [ + { + id: 'dataset_raw', + source: _rawData + }, + ...datasetWithFilters + ], + tooltip: { + order: 'valueDesc', + trigger: 'axis' + }, + xAxis: { + type: 'category', + nameLocation: 'middle' + }, + yAxis: { + scale: false, + name: 'Income' + }, + grid: { + right: 140 + }, + color:[ + 'rgba(231,82,27,0.94)' + ], + series: seriesList + }; + myChart.setOption(option); + } + + setInterval(function () { + $.get( + ROOT_PATH + '/loraData?item=' + title, + function (_rawData2) { + + if (dataAll.length > 40){ + dataAll.shift(); + dataAll.shift(); + } + + _rawData2.forEach(value => dataAll.push(value)); + + _rawData = [["Income","Life Expectancy","Population","Country","Year"]]; + dataAll.forEach(value => _rawData.push(value)); + + myChart.setOption({ + dataset: [ + { + source: _rawData + } + ], + }); + + let original = ''; + dataAll.forEach((elem, index) => { + original += elem[3] + elem[0]; + if (elem[3] == "血氧") { + original += '%' + } else { + original += '℃' + } + original += ' ' + }) + + $(".sound-code-chunk-default-content").html(original); + + + } + ); + + + + }, 1000); + + + if (option && typeof option === 'object') { + myChart.setOption(option); + } + + window.addEventListener('resize', myChart.resize); + +} + diff --git a/public/style/http/lora2.css b/public/style/http/lora2.css new file mode 100644 index 0000000..b4ec9a4 --- /dev/null +++ b/public/style/http/lora2.css @@ -0,0 +1,105 @@ +* {margin:0; padding:0;} +html,body{height:100%;} +.box { + height:100%; + background: #020723; + background-image:url("/image/lora2/background1.png"); + background-size: 100% 100%; + background-repeat: no-repeat; +} + +html { + /*在根元素中计算基准值字体大小,设备宽度 / 设计稿宽度 * 100*/ + font-size: calc(100vw /1920 * 100 ); +} +.box{ + font-size: 0.18rem; +} +/*头部*/ +.title{ + height: 0.64rem; + display: -webkit-flex; + display: flex; + position: relative; +} +.school{ + width: 2.06rem; + height: 0.64rem; + position: relative; +} +.school-logo{ + width: 1.68rem; + height: 0.43rem; + position:absolute; + bottom: 0; + right: 0; + padding:0; + margin:0; +} +.college{ + width: 1.71rem; +} +.college-text{ + margin-top: 0.35rem; + margin-left: 0.15rem; + font-family: Source Han Sans CN; + font-size: 0.18rem; + font-weight: 400; + color: #FFFFFF; +} +.menu{ + position:absolute; + left: 0; + right: 0; + margin:auto; + width: 15.43rem; + height: 0.64rem; + background-image:url("/image/lora2/top.png"); + background-size: 100% 100%; + background-repeat: no-repeat; +} + +/*设备列表*/ +.device{ + width: 2.99rem; + height: 18.56rem; + padding-top: 0.56rem; +} +.device-frame{ + width: 2.4rem; + height: 100%; + margin-left: 0.34rem; +} +.device-cell1{ + width: 2.4rem; + height: 0.64rem; + margin-bottom: 0.1rem; + padding-left: 0.36rem; + + background: linear-gradient(90deg, rgba(0,250,255,0.84), rgba(0,250,255,0)); + border-radius: 0.32rem; +} + +.device-cell2{ + width: 2.4rem; + height: 0.64rem; + margin-bottom: 0.1rem; + padding: 0.015rem; + background: linear-gradient(90deg, rgba(0,250,255,0.5), rgba(0,250,255,0.1)); + border-radius: 0.32rem; +} +.device-cell{ + width: 100%; + height: 100%; + background: #101010; + border-radius: 0.32rem; + background-image:url("/image/lora2/background1.png"); +} + +.device-online{ + width: 0.12rem; + height: 0.12rem; + background: #31EDB1; + border-radius: 0.06rem; +} + diff --git a/resources/views/http/lora2.blade.php b/resources/views/http/lora2.blade.php index 6f4ffb2..77f81b2 100644 --- a/resources/views/http/lora2.blade.php +++ b/resources/views/http/lora2.blade.php @@ -2,617 +2,68 @@ + - - - - -
- -
-
-
@{{device.name}}
-
- 在线 -
-
- 离线 + + +
+
+
+ +
+
+
+ 信息与计算机学院
-
-
-
-
-
- - - - - - + - - diff --git a/resources/views/http/lora23.blade.php b/resources/views/http/lora23.blade.php new file mode 100644 index 0000000..170b7ef --- /dev/null +++ b/resources/views/http/lora23.blade.php @@ -0,0 +1,30 @@ + + + + + + + + +
+ 测试rem + +
+ +