Browse Source

时间滑块

master
lijunjie 3 years ago
parent
commit
c95a526bc8
  1. 21130
      _ide_helper.php
  2. 20
      app/Http/Controllers/IndexController.php
  3. 4
      composer.json
  4. 998
      composer.lock
  5. 2
      config/database.php
  6. 8
      public/script/http/index.js

21130
_ide_helper.php

File diff suppressed because it is too large

20
app/Http/Controllers/IndexController.php

@ -7,6 +7,7 @@ use App\Http\Services\CommonService;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Redis;
class IndexController extends BaseController
{
@ -263,7 +264,26 @@ class IndexController extends BaseController
public function store()
{
$time = time();
// echo Cache::get('pelma');
$pelma_key = "pelma:1";
//按时间添加
// Redis::zadd($pelma_key, $time, 'a' . $time);
// Redis::zadd($pelma_key, 1, 'a' . $time);
//删除过期
// Redis::ZREMRANGEBYSCORE($pelma_key, 0, ($time - 60));
//获取最大时间
// $data = Redis::ZREVRANGE($pelma_key, 0, 0);
//获得指定时间
// $data = Redis::ZRANGEBYSCORE($pelma_key, 19, 29);
// var_dump($data);
$data = request('pelma');
Cache::put('pelma', $data);

4
composer.json

@ -9,9 +9,11 @@
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^9.19",
"laravel/sanctum": "^3.0",
"laravel/tinker": "^2.7"
"laravel/tinker": "^2.7",
"predis/predis": "^2.0"
},
"require-dev": {
"barryvdh/laravel-ide-helper": "^2.12",
"fakerphp/faker": "^1.9.1",
"laravel/pint": "^1.0",
"laravel/sail": "^1.0.1",

998
composer.lock

File diff suppressed because it is too large

2
config/database.php

@ -121,7 +121,7 @@ return [
'redis' => [
'client' => env('REDIS_CLIENT', 'phpredis'),
'client' => env('REDIS_CLIENT', 'predis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),

8
public/script/http/index.js

@ -1,4 +1,4 @@
var timer_shaft_value = 0
var timer_shaft = 0
const AppInfo = {
data() {
return {
@ -44,10 +44,10 @@ const AppInfo = {
if (this.timer_shaft_value == this.timer_shaft_max) {
this.openTimerShaft();
this.crontabTimerShaft();
timer_shaft_value = 0;
timer_shaft = 0;
} else {
clearInterval(this.timer);
timer_shaft_value = this.timer_shaft_value;
timer_shaft = this.timer_shaft_value;
}
},
@ -101,7 +101,7 @@ function pressure(dom, item) {
function setTimer() {
let timer = null
$.get('/tabularData?item=' + item).done(function (data) {
$.get('/tabularData?item=' + item + "&timer_shaft=" + timer_shaft).done(function (data) {
if (data) {//根据返回状态判断
let pressure = data.pressure
myChart.setOption({

Loading…
Cancel
Save