Browse Source

整理

master
lijunjie 3 years ago
parent
commit
2aa5c57fd5
  1. 162
      app/Http/Controllers/IndexController.php
  2. 6
      config/custom.php
  3. 65
      resources/views/http/lora22.blade.php
  4. 30
      resources/views/http/lora23.blade.php

162
app/Http/Controllers/IndexController.php

@ -108,138 +108,6 @@ class IndexController extends BaseController
'pressure' => $chunk3,
'foot' => [36.2, 80, 36.1, 75, 35.9, 79, 36.3, 80]
];
// $chunk = [
// // data1[0],
// // data1[1],
// // data1[2],
// // data1[3],
// // data1[4],
// // data1[5],
// // data1[6],
// // data1[7],
// // data1[8],
// // data1[9],
// // data1[10],
// // data1[11],
// // data1[12],
// [
// 1,1,0
// ],
// [
// 10,10,0.1
// ],
// [
// 20,20,0.2
// ],
// [
// 30,30,0.3
// ],
// [
// 40,40,0.4
// ], [40,40,0.4], [50,50,0.5], [60,60,0.6], [70,70,0.7], [80,80,0.8], [90,90,0.9], [99,99,1],
//
// ];
//
// $data = [$request_data['item']*50, 0, 0, 50, 100, 150, 200, 200, 150,100, 0,
// 2, 0, 100, 100, 100, 100, 100, 100, 100,100, 0,
// 3, 0, 100, 200, 300, 100, 100, 0, 0, 0, 0,
// 4, 0, 100, 200, 300, 100, 100, 0, 0, 0, 0,
// 5, 0, 100, 200, 300, 100, 100, 0, 0, 0, 0,
// 6, 0, 100, 200, 300, 100, 100, 0, 0, 0, 0,
// 7, 0, 100, 200, 300, 100, 100, 0, 0, 0, 0,
// 8, 0, 100, 200, 300, 100, 100, 0, 0, 0, 0,
// 9, 0, 100, 200, 300, 100, 100, 0, 0, 0, 0,
// 10, 0, 100, 200, 300, 100, 100, 0, 0, 0, 0,
// 11, 0, 100, 200, 300, 100, 100, 0, 0, 0, 0,
// ];
//
//// for ($i = 0; $i < 121; $i++){
////
////
//// $chunk[intval($i / 11)][$i % 11] = [
//// $i % 11,
//// intval($i / 11),
//// $data[$i],
//// ];
//// }
// $chunk = [];
//
// for ($i = 0; $i < 121; $i++){
//
//
// $chunk[] = [
// $i % 11,
// intval($i / 11),
// $data[$i] / 300,
// ];
// }
// dump($chunk);
//
//
// $chunk2 = [];
// foreach ($chunk as $key1 => $items){
// foreach ($items as $key2 => $cell){
// $chunk2[$key1][$key2] = $cell[2];
//
// if (($key2 - 1) >= 0){
// $value = $cell[2] - $chunk[$key1][$key2 - 1][2];
//
// $increase = $value / 3;
// for ($i = 1; $i <= 3; $i++){
//
//
// $chunk2[$key1][$key2 + $i] = $cell[2] + $increase * $i;
// }
// }
// }
// }
// dump($chunk2);
// 模拟数据3
// $chunk = [];
// for ($i = 0; $i <= 32; $i++){
// for ($j = 0; $j <= 32; $j++){
// $num1 = $num2 = 0;
// if ($j > 6 && $j <= 16){
// $num1 = $j - 6;
// } elseif ($j > 16 && $j <= 26){
// $num1 = 27 - $j;
// }
// if ($i > 6 && $i <= 16){
// $num2 = $i - 6;
// } elseif ($i > 16 && $i <= 26){
// $num2 = 27 - $i;
// }
// if (!empty($num1) && !empty($num2)){
// $chunk[] = [
// $j,
// $i,
// ($num1 + $num2) / 30,
// ];
// } else {
// $chunk[] = [
// $j,
// $i,
// 0,
// ];
// }
// }
// }
// return [
// 'pressure' => $chunk,
// 'foot' => [36.2, 80, 36.1, 75, 35.9, 79, 36.3, 80]
// ];
}
@ -512,26 +380,26 @@ class IndexController extends BaseController
return [
'设备1' => [
[
$time,
70,
]
],
// return [
// '设备1' => [
// [
// $time,
// 70,
// ]
// ],
// '设备2' => [
// [
// $time,
// 80,
// ]
// ],
'设备3' => [
[
$time,
90,
]
],
];
// '设备3' => [
// [
// $time,
// 90,
// ]
// ],
//
// ];
}
}

6
config/custom.php

@ -1,11 +1,17 @@
<?php
return [
//手环mac地址
'lora_mac' => [
"616162626363",
"616162626364",
"616162626365",
"616162626366",
"616162626367",
"616162626368",
"616162626369",
"616162626370",
"616162626371",
"616162626372",
],
];

65
resources/views/http/lora22.blade.php

@ -1,65 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN" style="height: 100%">
<head>
<meta charset="utf-8">
<script type="text/javascript" src="/script/jquery.min.js"></script>
<script type="text/javascript" src="/script/vue.js"></script>
<script src="/script/axios.min.js"></script>
<!-- 引入样式 -->
<link rel="stylesheet" href="/style/element-plus.css" rel="external nofollow" target="_blank" />
<!-- 引入组件库 -->
<script src="/script/element-plus.js" rel="external nofollow" ></script>
</head>
<body style="height: 100%; margin: 0">
<div id="app">
<div class="block">
<el-slider v-model="timer_shaft_value" :min="timer_shaft_min" :max="timer_shaft_max" :marks="marks"> </el-slider>
</div>
</div>
<script type="text/javascript" src="/script/jquery.min.js"></script>
<script type="text/javascript">
const AppInfo = {
data() {
return {
timer_shaft_value: 5,
timer_shaft_min:1,
timer_shaft_max:5,
marks: {
1: "1",
2: "2",
3: "3",
4: "4",
},
}
},
mounted() {
var _this = this;
// 每隔5分钟定时刷新
this.timer = setInterval(() => {
this.timer_shaft_value += 1;
this.timer_shaft_min += 1;
this.timer_shaft_max += 1;
let marks = {};
for (let i = this.timer_shaft_max - 5; i < this.timer_shaft_max; i++) {
marks[i] = i.toString();
}
this.marks = marks;
console.log(this.marks)
}, 1000 * 1)
},
beforeDestroy() {
clearInterval(this.timer);
},
};
const app = Vue.createApp(AppInfo);
app.use(ElementPlus);
app.mount("#app");
</script>
</body>
</html>

30
resources/views/http/lora23.blade.php

@ -1,30 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<style>
* {margin:0; padding:0;}
html,body{height:100%;}
.box {height:100%;background: #020622;}
html {
/*在根元素中计算基准值字体大小,设备宽度 / 设计稿宽度 * 100*/
font-size: calc(100vw /1920 * 100 );
}
#box {
width: 19.2rem;
height: 1rem;
background-color: aqua;
font-size: 1rem;
}
</style>
<body>
<div id="box">
测试rem
</div>
</body>
</html>
Loading…
Cancel
Save