瀏覽代碼

new page ready

Changpeng Duan 5 年之前
父節點
當前提交
478c7dea96

+ 13 - 0
src/api/getApiRes.js

@@ -244,3 +244,16 @@ export function GetLastVerionFirmwareinfo(postdata) {
     let url = headapi + 'v1/AdminSettings/GetLastVerionFirmwareinfo';
     return getApiBasic(url, postdata);
 }
+
+// 添加固件
+export function FirmwareAdd(postdata) {
+    // 添加固件
+    let url = headapi + 'v1/AdminSettings/FirmwareAdd';
+    return getApiBasic(url, postdata);
+}
+// 查询所有信号记录,包含手机信号和Wifi信号
+export function LogFullDetectedQueryByDetector(postdata) {
+    // 查询所有信号记录,包含手机信号和Wifi信号
+    let url = headapi + 'v1/Detector/LogFullDetectedQueryByDetector';
+    return getApiBasic(url, postdata);
+}

+ 12 - 6
src/components/BigRader.vue

@@ -36,14 +36,20 @@
             totalRs: function (val) {
                 let that = this;
                 this.timeShow = val.RunTime;
-                if(!val.RegionDetRs){
-                    return false
-                }
-                if (val.RegionDetRs[0].WarnNum != 0) {
-                    that.RaderState = 1
+                if (val.RegionDetRs) {
+                    if (val.RegionDetRs[0].WarnNum != 0) {
+                        that.RaderState = 1
+                    } else {
+                        that.RaderState = 0
+                    }
                 } else {
-                    that.RaderState = 0
+                    if (val.DetRs.WarnNum != 0) {
+                        that.RaderState = 1
+                    } else {
+                        that.RaderState = 0
+                    }
                 }
+
             },
         },
     }

+ 25 - 13
src/components/HistoryRecord.vue

@@ -11,37 +11,43 @@
             <el-table
                     :data="tableData"
                     stripe
+                    :default-sort = "{prop: 'date', order: 'descending'}"
                     style="width: 100%">
                 <el-table-column
-                        prop="Macstr"
-                        label="MAC"
+                        prop="Name"
+                        label="名称"
                         width="140">
                     <template slot-scope="scope">
                         <i :class="[{'blue':scope.row.DangerLevel == -1},{'yellow':scope.row.DangerLevel != -1}]"></i>
-                        {{ scope.row.Macstr }}
+                        <el-tooltip class="item" effect="dark" :content="scope.row.Name" placement="top-start">
+                            <span>
+                                    {{ scope.row.Name.length > 9 ?  scope.row.Name.substr(0,9)+'...' : scope.row.Name }}
+                            </span>
+                        </el-tooltip>
                     </template>
                 </el-table-column>
                 <el-table-column
-                        prop="EditTime"
+                        prop="Ctime"
                         label="日期"
+                        sortable
                         :formatter="filterFmtDate"
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="RegionName"
+                        prop="Location"
                         label="地点"
                         width="">
                     <template slot-scope="scope">
-                        <el-tooltip class="item" effect="dark" :content="scope.row.RegionName" placement="top-start">
+                        <el-tooltip class="item" effect="dark" :content="scope.row.Location" placement="top-start">
                             <span>
-                                    {{ scope.row.RegionName.length > 6 ?  scope.row.RegionName.substr(0,6)+'...' : scope.row.RegionName }}
+                                    {{ scope.row.Location.length > 6 ?  scope.row.Location.substr(0,6)+'...' : scope.row.Location }}
                             </span>
                         </el-tooltip>
                     </template>
                 </el-table-column>
                 <el-table-column
-                        prop="SignalIntensity"
-                        label="信号强度">
+                        prop="SignaType"
+                        label="类型">
                 </el-table-column>
             </el-table>
             <br>
@@ -62,7 +68,7 @@
         data() {
             return {
                 pageination: {
-                    pageItem: 10,
+                    pageItem: 8,
                     pageoptions: pageOptions(),
                     total: 30,
                     pageIndex: 1,
@@ -72,7 +78,7 @@
                 recordsTotal: 0,
                 tableData: [],
                 allTableData: [],
-                limit: '10',
+                limit: '9',
                 multipleSort: false,
                 loading: true,
                 fileList: [],
@@ -84,8 +90,14 @@
         watch: {
             historyRs: function (val) {
                 this.loading = false;
-                this.allTableData = val.Rs;
-                this.recordsTotal = val.Rs.length;
+                if(!val.Rs){
+                    this.allTableData = [];
+                    this.recordsTotal = 0;
+                }else{
+                    this.allTableData = val.Rs;
+                    this.recordsTotal = val.Rs.length;
+                }
+
                 // 设置分页数据
                 this.setPaginations();
             },

+ 1 - 3
src/components/Watching.vue

@@ -40,15 +40,13 @@
         watch: {
             totalRs: function (val) {
                 let that = this;
-                that.list = [];
+                // that.list = [];
                 that.readyList = [];
                 // 逐行显示
                 if(val.RegionDetRs){
-                    console.log(that.list);
                     that.wordDisplay(val.RegionDetRs);
                 }
                 if(val.DetRs){
-                    console.log(that.list);
                     that.wordDisplay([val.DetRs]);
                 }
             },

+ 3 - 1
src/views/Equip.vue

@@ -42,8 +42,10 @@
                 :data="tableData"
                 is-horizontal-resize
                 :default-sort="{prop: 'date', order: 'descending'}"
-                v-loading="loading" element-loading-background="rgba(0, 0, 0, 0.8)"
+                v-loading="loading"
+                element-loading-background="rgba(0, 0, 0, 0.8)"
                 class=""
+                @selection-change="handleSelectionChange"
                 stripe
         >
             <el-table-column

+ 45 - 9
src/views/Hardware.vue

@@ -19,7 +19,7 @@
                     <el-button size="small" type="primary">点击上传</el-button>
                 </el-upload>
                 <em class="addMemo" v-show="fileList.length == 0" @click="addMemo">
-                    <i></i>添加备注
+                    <i></i>添加固件
                 </em>
             </div>
         </div>
@@ -59,7 +59,7 @@
                 <el-button size="small" type="primary" @click="startUpdate">开始更新</el-button>
                 <div class="version">
                     <em>NEW</em>
-                    <span>最新固件版本:v.2.0.1版本固件</span>
+                    <span>最新固件版本:v{{LastVerion}} {{VersionTime}}</span>
                 </div>
                 <el-tooltip class="item" effect="dark" content="一键更新全部设备固件" placement="top">
                     <i class="question"></i>
@@ -74,6 +74,7 @@
                     :default-sort="{prop: 'date', order: 'descending'}"
                     v-loading="loading" element-loading-background="rgba(0, 0, 0, 0.8)"
                     class=""
+                    @selection-change="handleSelectionChange"
                     stripe
             >
                 <el-table-column
@@ -94,6 +95,13 @@
                         prop="Location"
                         label="位置"
                 >
+                    <template slot-scope="scope">
+                        <el-tooltip class="item" effect="dark" :content="scope.row.Location" placement="top-start">
+                            <span>
+                                    {{ scope.row.Location.length > 11 ?  scope.row.Location.substr(0,11)+'...' : scope.row.Location }}
+                            </span>
+                        </el-tooltip>
+                    </template>
                 </el-table-column>
                 <el-table-column
                         prop="FirmwareVersion"
@@ -143,6 +151,12 @@
             >
                 <div class="dialogContent">
                     <el-row :gutter="20">
+                        <el-col :span="20">
+                            <label>
+                                固件版本号
+                            </label>
+                            <el-input type="text" v-model="dialog.version"></el-input>
+                        </el-col>
                         <el-col :span="20">
                             <label>
                                 备注
@@ -176,11 +190,15 @@
         GetChildRegionSelect,
         GetLastVerionFirmwareinfo,
         RegionPictureGetByRegionId,
+        FirmwareAdd,
     } from '../api/getApiRes.js'
+
     let qs = require('qs');
     export default {
         data() {
             return {
+                LastVerion: '',
+                VersionTime: '',
                 // dialog
                 dialog_state: false,
                 dialog_title: '添加备注',
@@ -224,9 +242,9 @@
                     pageIndex: 1,
                 },
                 dialog: {
-                    name: 10,
-                    region: 10,
-                    memo: '',
+                    version: '',
+                    updateContent: '',
+                    key : '',
                 },
                 draw: 1,
                 start: 0,
@@ -241,6 +259,7 @@
         },
         mounted() {
             this.getTableQuery();
+            this.getGetLastVerionFirmwareinfo();
         },
         methods: {
             // 页面数据查询
@@ -278,6 +297,22 @@
                     }
                 })
             },
+            getGetLastVerionFirmwareinfo() {
+                 let that = this;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                GetLastVerionFirmwareinfo(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.LastVerion = json.Firmware.Version;
+                        that.VersionTime = globalfmtDate(json.Firmware.CreateTime);
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
             // 获取下级列表
             getGetChildRegionSelect(regionId, level) {
                 let that = this;
@@ -386,7 +421,7 @@
                 if (!this.multipleSelection.length) {
                     this.$message({
                         showClose: true,
-                        message: '错了哦,需要先选中至少一条记录',
+                        message: '错了哦,需要先选中至少一个设备',
                         type: 'error'
                     });
                     return false
@@ -398,7 +433,7 @@
                 if (!this.multipleSelection.length) {
                     this.$message({
                         showClose: true,
-                        message: '错了哦,需要先选中一条记录',
+                        message: '错了哦,需要先选中一个设备',
                         type: 'error'
                     });
                     return false
@@ -406,7 +441,7 @@
                 if (this.multipleSelection.length > 1) {
                     this.$message({
                         showClose: true,
-                        message: '错了哦,只能选中一条记录',
+                        message: '错了哦,只能选中一个设备',
                         type: 'error'
                     });
                     return false
@@ -426,6 +461,7 @@
                 let dialog_type = that.dialog_type;
                 let name = that.field_name;
                 let id = that.field_id;
+
             },
             // 添加备注
             addMemo() {
@@ -437,7 +473,7 @@
                 if (!this.multipleSelection.length) {
                     this.$message({
                         showClose: true,
-                        message: '错了哦,需要先选中一条记录',
+                        message: '错了哦,需要先选中一个设备',
                         type: 'error'
                     });
                     return false

+ 20 - 4
src/views/Main.vue

@@ -90,7 +90,8 @@
         RegionWifixyInfolist,
         Detector06GInfolist,
         LogWifiDetectedQueryByDetector,
-        GetStaticinfo
+        GetStaticinfo,
+        LogFullDetectedQueryByDetector
     } from '../api/getApiRes.js'
 
     let qs = require('qs');
@@ -111,6 +112,7 @@
                 ScanRs: [],
                 historyRs: [],
                 equipRs: [],
+                autoTime: 115000,//定时刷新的时间间隔
                 // pageLevel: 1,//当前为楼层
                 // pageLevel: 2,//当前为楼层区域
                 // pageLevel: 3,//当前为房间
@@ -125,7 +127,7 @@
             // 定时查询
             that.timer = setInterval(() => {
                 that.getDate();
-            }, 1115000);
+            }, that.autoTime);
         },
         destroyed() {
             //页面销毁时清除定时器
@@ -167,7 +169,8 @@
                     // 区域检测实时记录
                     that.getRegionDetInfolist(postdata);
                     // 历史检测记录
-                    that.getLogWifiDetectedQueryByDetector(postdata);
+                    // that.getLogWifiDetectedQueryByDetector(postdata);
+                    that.getLogFullDetectedQueryByDetector(postdata);
                     // 0-6G
                     that.getDetector06GInfolist(postdata);
                     that.getGetStaticinfo(postdata);
@@ -190,7 +193,8 @@
                     that.getSingleDetInfolist(postdata);
                     that.getDetector06GInfolist(postdata);
                     // 历史检测记录
-                    that.getLogWifiDetectedQueryByDetector(postdata);
+                    // that.getLogWifiDetectedQueryByDetector(postdata);
+                    that.getLogFullDetectedQueryByDetector(postdata);
                 }
             },
             getDetector06GInfolist(postdata) {
@@ -248,6 +252,18 @@
                     }
                 })
             },
+            getLogFullDetectedQueryByDetector(postdata) {
+                let that = this;
+                LogFullDetectedQueryByDetector(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        console.log(json);
+                        that.historyRs = json;
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
             wordDisplay(word) {
                 let index = 0;
                 let that = this;

+ 6 - 2
src/views/Qrcodemanage.vue

@@ -52,6 +52,9 @@
                 :data="tableData"
                 class=""
                 stripe
+                is-horizontal-resize
+                v-loading="loading"
+                element-loading-background="rgba(0, 0, 0, 0.8)"
                 @selection-change="handleSelectionChange"
         >
             <el-table-column
@@ -197,6 +200,7 @@
     export default {
         data() {
             return {
+                loading: true,
                 // dialog
                 dialog_state: false,
                 dialog_title: '添加二维码',
@@ -298,8 +302,8 @@
             },
             // 页面数据查询
             getTableQuery() {
-                // let that = this;
-                // that.loading = true;
+                let that = this;
+                that.loading = false;
                 // let url = headapi + '?ctl=ajax&mod=dial&act=taskListQuery';//获取
                 // let param = {
                 //     'taskstatus': that.panel.taskstatus,