فهرست منبع

扫描监视器

yuang 4 سال پیش
والد
کامیت
a03f1935a6
3فایلهای تغییر یافته به همراه93 افزوده شده و 0 حذف شده
  1. 13 0
      app/Http/Controllers/ScanDeviceMonitorController.php
  2. 78 0
      resources/views/maintenance/scanDevice/index.blade.php
  3. 2 0
      routes/web.php

+ 13 - 0
app/Http/Controllers/ScanDeviceMonitorController.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use Illuminate\Http\Request;
+
+class ScanDeviceMonitorController extends Controller
+{
+    public function index()
+    {
+        return view('maintenance.scanDevice.index');
+    }
+}

+ 78 - 0
resources/views/maintenance/scanDevice/index.blade.php

@@ -0,0 +1,78 @@
+@extends('layouts.app')
+@section('title')扫描设备监视器@endsection
+@section('content')
+    <div class="d-none" id="list">
+        <!--            表格-->
+        <table class="table table-striped table-bordered table-hover text-nowrap waybill-table td-min-width-80"
+               style="background: #fff;" id="table">
+            <tr v-for="(item,i) in details.data" :key="i">
+                <td class="td-warm text-muted"><span>@{{ i+1 }}</span></td>
+                <td class="td-warm text-muted"><span>@{{ item.name }}</span></td>
+                <td class="td-warm text-muted">
+                    <span
+                        :class="item.active?'badge badge-pill badge-success':'badge badge-pill badge-danger'">
+                        @{{ item.active ? '正常':'掉线' }}
+                    </span>
+                </td>
+                <td class="td-warm text-muted"><span>@{{ item.macAddress }}</span></td>
+                <td class="td-warm text-muted"><span>@{{ item.receiveTime }}</span></td>
+            </tr>
+        </table>
+    </div>
+
+
+@endsection
+
+@section('lastScript')
+    <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>{{--新版2--}}
+    <script>
+        let vue = new Vue({
+            el: "#list",
+            data: {
+                selectTr: '',
+                details: [],
+            },
+            created() {
+                let url = this.getBaseUrl();
+                url += '/api/report/scanDeviceMonitor/list';
+                axios.get(url, this.search).then(res => {
+                    this.details = res.data;
+                });
+            },
+            mounted: function () {
+                $('#list').removeClass('d-none');
+                this.rendingHeader();
+            },
+            methods: {
+                //根据环境获取不同的url
+                getBaseUrl() {
+                    let url = '';
+                    let env = "{{ config('app.env') }}";
+                    if (env === 'local') {
+                        url = 'http://127.0.0.1:8111'
+                    } else if (env === 'production') {
+                        url = 'https://stat.baoshi56.com'
+                    }
+                    return url;
+                },
+                rendingHeader() {
+                    let column = [
+                        {name: 'name', value: '名称', neglect: true, class: "td-cool"},
+                        {name: 'active', value: '状态', neglect: true, class: "td-warm"},
+                        {name: 'macAddress', value: 'macAddress', neglect: true, class: "td-warm"},
+                        {name: 'receiveTime', value: '最近一次上传时间', neglect: true, class: "td-warm"},
+                    ];
+                    new Header({
+                        el: "table",
+                        name: "details",
+                        column: column,
+                        data: this.details,
+                        restorationColumn: 'id',
+                        fixedTop: ($('#form_div').height()) + ($('#btn').height()) + 2,
+                    }).init();
+                },
+            },
+        });
+    </script>
+@endsection
+

+ 2 - 0
routes/web.php

@@ -390,6 +390,8 @@ Route::group(['middleware' => 'auth'], function ($route) {
         Route::post('mail/updateTemplate', 'SendEmailsController@updateTemplate')->name('mail.updateTemplate');
         Route::post('mail/updateRemark', 'SendEmailsController@updateRemark')->name('mail.updateRemark');
         Route::post('mail/active', 'SendEmailsController@active')->name('mail.active');
+
+        Route::get("scanDevice/monitor", 'ScanDeviceMonitorController@index');
     });
     $route->get('maintenance', function () {
         return view('maintenance.index');