| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- @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() {
- window.tempTip.show("功能关闭,移至SWMS系统进行操作");
- return
- 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://api-back.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
|