Changpeng Duan před 5 roky
rodič
revize
62b8e7959b
3 změnil soubory, kde provedl 150 přidání a 109 odebrání
  1. 5 0
      src/api/getApiRes.js
  2. 9 2
      src/assets/css/panel.css
  3. 136 107
      src/views/Equip.vue

+ 5 - 0
src/api/getApiRes.js

@@ -109,6 +109,11 @@ export function DetectorAdd(postdata) {
     let url = headapi + 'v1/Detector/Add';
     return getApiBasic(url, postdata);
 }
+// 添加检测设备
+export function DetectorEdit(postdata) {
+    let url = headapi + 'v1/Detector/Edit';
+    return getApiBasic(url, postdata);
+}
 
 // 检测设备详情
 export function DetectorDetail(postdata) {

+ 9 - 2
src/assets/css/panel.css

@@ -127,7 +127,7 @@
 }
 .el-table th, .el-table tr {
     background: none;
-    color: #6DC1FF;
+    color: #fff;
 }
 
 .el-table, .el-table__expanded-cell {
@@ -326,7 +326,7 @@
     display: none!important;
 }
 .el-pagination.is-background .el-pager li:not(.disabled).active {
-    color: #002540;
+    color: #fff;
     background-color: #6DC1FF;
 }
 .el-pagination__total {
@@ -424,3 +424,10 @@
 .pull-right {
     float: right;
 }
+.el-pagination {
+    float: right;
+}
+td /deep/ .el-button--primary {
+    border-color: #04E3FD;
+    color: #04E3FD;
+}

+ 136 - 107
src/views/Equip.vue

@@ -24,21 +24,21 @@
                             <el-option
                                     v-for="item in panel.regionidOptions"
                                     :key="item.Id"
-                                    :label="item.DisplayName"
+                                    :label="item.Name"
                                     :value="item.Id">
                             </el-option>
                         </el-select>
                     </div>
-                    <div class="pline">
-                        <em>登记时间:</em>
-                        <el-date-picker
-                                v-model="panel.time1"
-                                type="daterange"
-                                range-separator="至"
-                                start-placeholder="开始日期"
-                                end-placeholder="结束日期">
-                        </el-date-picker>
-                    </div>
+                    <!--<div class="pline">-->
+                        <!--<em>登记时间:</em>-->
+                        <!--<el-date-picker-->
+                                <!--v-model="panel.time1"-->
+                                <!--type="daterange"-->
+                                <!--range-separator="至"-->
+                                <!--start-placeholder="开始日期"-->
+                                <!--end-placeholder="结束日期">-->
+                        <!--</el-date-picker>-->
+                    <!--</div>-->
                     <div class="pline">
                         <el-button size="medium" type="primary" @click="query">查询</el-button>
                     </div>
@@ -81,19 +81,19 @@
                     label="标签名"
             >
             </el-table-column>
-            <el-table-column
-                    prop="Location"
-                    label="位置"
-                    width="260"
-            >
-                <template slot-scope="scope">
-                    <el-tooltip class="item" effect="dark" :content="scope.row.Location" placement="top-start">
-                            <span>
-                                    {{ scope.row.Location.length > 22 ?  scope.row.Location.substr(0,22)+'...' : scope.row.Location }}
-                            </span>
-                    </el-tooltip>
-                </template>
-            </el-table-column>
+            <!--<el-table-column-->
+                    <!--prop="Location"-->
+                    <!--label="位置"-->
+                    <!--width="260"-->
+            <!--&gt;-->
+                <!--<template slot-scope="scope">-->
+                    <!--<el-tooltip class="item" effect="dark" :content="scope.row.Location" placement="top-start">-->
+                            <!--<span>-->
+                                    <!--{{ scope.row.Location.length > 22 ?  scope.row.Location.substr(0,22)+'...' : scope.row.Location }}-->
+                            <!--</span>-->
+                    <!--</el-tooltip>-->
+                <!--</template>-->
+            <!--</el-table-column>-->
             <el-table-column
                     prop="FirmwareVersion"
                     label="软件版本"
@@ -107,15 +107,17 @@
             >
             </el-table-column>
             <el-table-column
-                    prop="LastOnline"
-                    label="最近上线"
+                    prop="StatusChangeTime"
+                    label="登机时间"
                     sortable
+                    :formatter="filterTime"
             >
             </el-table-column>
             <el-table-column
-                    prop="Dayfind"
-                    label="当日报警"
+                    prop="StatusChangeTime"
+                    label="最后上报时间"
                     sortable
+                    :formatter="filterTime"
             >
             </el-table-column>
             <el-table-column
@@ -136,19 +138,29 @@
                     <span class="red" v-if="scope.row.Status == 4">已离线</span>
                 </template>
             </el-table-column>
+            <!--<el-table-column-->
+                    <!--prop="WorkMode"-->
+                    <!--label="工作模式"-->
+                    <!--sortable-->
+            <!--&gt;-->
+                <!--<template slot-scope="scope">-->
+                    <!--<span v-if="scope.row.Status == 1">普通</span>-->
+                    <!--<span class="red" v-if="scope.row.Status == 2">演示</span>-->
+                    <!--<span class="yellow" v-if="scope.row.Status == 3">测试</span>-->
+                <!--</template>-->
+            <!--</el-table-column>-->
             <el-table-column
                     prop="address"
                     label="操作记录"
                     width="220"
             >
                 <template slot-scope="scope">
-                    <el-button class="" type="text" @click="goPhoneRecord(scope.row)">手机信号记录</el-button>
-                    <el-button class="" type="text" @click="goWifiRecord(scope.row)">WiFi记录</el-button>
-                    <!--<el-button class="" type="text" @click="goPoster(scope.row)">时间轴</el-button> 这个需要先不做-->
-                    <el-button v-if="scope.row.Status == 1" class="yellow" type="text" @click="pauseRow(scope.row)">禁用
-                    </el-button>
-                    <el-button v-if="scope.row.Status == 0" class="green" type="text" @click="runRow(scope.row)">启用
-                    </el-button>
+                    <!--<el-button class="" type="text" @click="goPhoneRecord(scope.row)">手机信号记录</el-button>-->
+                    <el-button class="" type="primary" size="small" @click="goWifiRecord(scope.row)">监测记录</el-button>
+                    <!--<el-button v-if="scope.row.Status == 1" class="yellow" type="text" @click="pauseRow(scope.row)">禁用-->
+                    <!--</el-button>-->
+                    <!--<el-button v-if="scope.row.Status == 0" class="green" type="text" @click="runRow(scope.row)">启用-->
+                    <!--</el-button>-->
                 </template>
             </el-table-column>
         </el-table>
@@ -177,18 +189,6 @@
                         <el-input v-model="dialog.mac" @keyup.native="autoCompleteMac"
                                   :disabled="dialog_type == 2"></el-input>
                     </el-col>
-                    <el-col :span="12">
-                        <label>
-                            标签名*
-                        </label>
-                        <el-input v-model="dialog.tagname"></el-input>
-                    </el-col>
-                    <el-col :span="12">
-                        <label>
-                            购买来源
-                        </label>
-                        <el-input v-model="dialog.purchasesrc"></el-input>
-                    </el-col>
                     <el-col :span="12">
                         <label>
                             设备所属区域
@@ -206,10 +206,23 @@
                     </el-col>
                     <el-col :span="12">
                         <label>
-                            坐标说明
+                            标签名*
                         </label>
-                        <el-input v-model="dialog.coords_memo "></el-input>
+                        <el-input v-model="dialog.tagname"></el-input>
                     </el-col>
+                    <!--<el-col :span="12">-->
+                        <!--<label>-->
+                            <!--购买来源-->
+                        <!--</label>-->
+                        <!--<el-input v-model="dialog.purchasesrc"></el-input>-->
+                    <!--</el-col>-->
+                   <!---->
+                    <!--<el-col :span="12">-->
+                        <!--<label>-->
+                            <!--坐标说明-->
+                        <!--</label>-->
+                        <!--<el-input v-model="dialog.coords_memo "></el-input>-->
+                    <!--</el-col>-->
                     <el-col :span="12">
                         <label>
                             备注
@@ -221,7 +234,8 @@
                             位置标注
                         </label>
                         <div class="imgContianer">
-                            <img :src="dialog.plateImgSrc" alt="">
+                            <!--<img :src="dialog.plateImgSrc" alt="">-->
+                            <img src="../assets/img/main/grid.png" alt="">
                             <div class="pointers" @click="addPoint">
                                 <i v-for="point in dialog.points"
                                    :style="{left:point.x*1+'px',top:point.y * 1+'px'}"></i>
@@ -243,6 +257,8 @@
         DetectorEditStatus,
         RegionPictureGetByRegionId,
         DetectorAdd,
+        RegionList,
+        DetectorList,
         DetectorEdit,
         GetDetectorCoords,
         GeFullRegionSelect,
@@ -277,6 +293,7 @@
                     regionIdRoomOptions: [],
                     points: [],
                     CoordsId: 0,
+                    status: 0,
                 },
                 tabIndex: 0,
                 tabs: [
@@ -338,20 +355,21 @@
                 // 查询检测设备。上级区域id,区域id必传。regionid传0,查询supregionid对应所有子区域的检测设备。 如果supregionid,regionid都传0,默认查询企业ID下所有检测设备
                 let param = {
                     token: localStorage.token,
-                    supregionid: this.panel.regionid,//
-                    regionId: 0,//
+                    mac: this.panel.mac,//
+                    regionId: that.panel.regionId,//
+                    name: that.panel.tagname,//标签名
                     comid: 1,//
-                    tagname: that.panel.tagname,//标签名
                     start: 1,//
                     tableMax: 9999,//
                 };
                 let postdata = qs.stringify(param);
-                DetectorQuery(postdata).then(res => {
+                DetectorList(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         that.loading = false;
                         if (json.Rs) {
                             that.allTableData = json.Rs;
+                            console.log(json.Rs);
                             that.recordsTotal = json.Rs.length;
                         } else {
                             that.allTableData = [];
@@ -371,7 +389,7 @@
                     token: localStorage.token,
                 };
                 let postdata = qs.stringify(param);
-                GeFullRegionSelect(postdata).then(res => {
+                RegionList(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         if (!json.Rs) {
@@ -392,7 +410,7 @@
                     token: localStorage.token,
                 };
                 let postdata = qs.stringify(param);
-                GeFullRegionSelect(postdata).then(res => {
+                RegionList(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         that.dialog.regionlevelOneIdOptions = json.Rs;
@@ -410,23 +428,25 @@
                     regionId: regionId,
                 };
                 let postdata = qs.stringify(param);
-                GeFullRegionSelect(postdata).then(res => {
+                RegionList(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
-                        if (level == 1) {
-                            console.log(json.Rs);
-                            that.dialog.regionlevelOneIdOptions = json.Rs;
-                            that.dialog.regionlevelOneId = regionId;
-                        } else {
-                            if (json.Rs) {
-                                console.log(123);
-                                that.dialog.regionIdRoomOptions = json.Rs;
-                                that.dialog.regionId = regionId;
-                            } else {
-                                that.dialog.regionIdRoomOptions = [];
-                                that.dialog.regionId = '';
-                            }
-                        }
+                        that.dialog.regionlevelOneIdOptions = json.Rs;
+                        that.dialog.regionlevelOneId = regionId;
+                        // if (level == 1) {
+                        //     console.log(json.Rs);
+                        //     that.dialog.regionlevelOneIdOptions = json.Rs;
+                        //     that.dialog.regionlevelOneId = regionId;
+                        // } else {
+                        //     if (json.Rs) {
+                        //         console.log(123);
+                        //         that.dialog.regionIdRoomOptions = json.Rs;
+                        //         that.dialog.regionId = regionId;
+                        //     } else {
+                        //         that.dialog.regionIdRoomOptions = [];
+                        //         that.dialog.regionId = '';
+                        //     }
+                        // }
                     } else {
                         that.$message.error(json.Memo + ',错误代码:' + json.Code);
                     }
@@ -599,33 +619,37 @@
                 this.dialog.location = row.Location;
                 this.dialog.purchasesrc = row.PurchaseSrc;
                 this.dialog.memo = row.Memo;
-                this.dialogGetGetChildRegionSelect(row.RegionId, 1);
-                this.dialog.coords_memo = row.coords_memo;
+                this.dialog.regionlevelOneId = row.RegionId;
+                this.dialog.status = row.Status;
+                // this.dialog.coords_memo = row.coords_memo;
 
                 // 重载地区列表
                 this.getGeFullRegionSelect();
 
-                let param = {
-                    token: localStorage.token,
-                    detectorId: row.Id,
-                };
-                let postdata = qs.stringify(param);
-                GetDetectorCoords(postdata).then(res => {
-                    let json = res;
-                    if (json.Code == 0) {
-                        if (json.Rs.length != 0) {
-                            console.log(json.Rs[0]);
-                            that.dialog.points = [{x: json.Rs[0].Width, y: json.Rs[0].Height}];
-                            that.dialog.CoordsId = json.Rs[0].CoordsId;
-                            that.dialog.coords_memo = json.Rs[0].Memo;
-                        } else {
-                            that.dialog.points = [{x: 0, y: 0}];
-                            that.dialog.CoordsId = 0;
-                        }
-                    } else {
-                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
-                    }
-                })
+                that.dialog.points = [{x: row.X, y: row.Y}];
+
+                // let param = {
+                //     token: localStorage.token,
+                //     detectorId: row.Id,
+                // };
+                // let postdata = qs.stringify(param);
+                // GetDetectorCoords(postdata).then(res => {
+                //     let json = res;
+                //     if (json.Code == 0) {
+                //         if (json.Rs.length != 0) {
+                //             console.log(json.Rs[0]);
+                //             // that.dialog.points = [{x: json.Rs[0].X, y: json.Rs[0].Y}];
+                //             that.dialog.points = [{x: json.Rs.X, y: json.Rs.Y}];
+                //             // that.dialog.CoordsId = json.Rs[0].CoordsId;
+                //             // that.dialog.coords_memo = json.Rs[0].Memo;
+                //         } else {
+                //             that.dialog.points = [{x: 0, y: 0}];
+                //             that.dialog.CoordsId = 0;
+                //         }
+                //     } else {
+                //         that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                //     }
+                // })
             },
             // 自动补全MAC
             autoCompleteMac() {
@@ -702,7 +726,7 @@
                     mac: that.dialog.mac,
                     comId: 1,
                     regionId: that.dialog.regionId,
-                    tagname: that.dialog.tagname,
+                    name: that.dialog.tagname,
                     HardwareVersion: that.dialog.HardwareVersion,
                     FirmwareVersion: that.dialog.FirmwareVersion,
                     FirmwareScanM4Version: that.dialog.FirmwareScanM4Version,
@@ -711,7 +735,7 @@
                     purchasesrc: that.dialog.purchasesrc,
                     x: that.dialog.points[0].x,
                     y: that.dialog.points[0].y,
-                    coords_memo: that.dialog.coords_memo,
+                    // coords_memo: that.dialog.coords_memo,
                     memo: that.dialog.memo,
                 };
                 let postdata = qs.stringify(param);
@@ -760,11 +784,11 @@
                 this.selectRegionLabel(that.dialog.regionId);
                 let param = {
                     token: localStorage.token,
-                    detectorid: that.dialog.eqId,
+                    id : that.dialog.eqId,
                     mac: that.dialog.mac,
                     comId: 1,
                     regionId: that.dialog.regionId,
-                    tagname: that.dialog.tagname,
+                    name: that.dialog.tagname,
                     HardwareVersion: that.dialog.HardwareVersion,
                     FirmwareVersion: that.dialog.FirmwareVersion,
                     FirmwareScanM4Version: that.dialog.FirmwareScanM4Version,
@@ -777,6 +801,7 @@
                     memo: that.dialog.memo,
                     coordsType: 1,//坐标状态 0:禁用, 1:启用, 9:删除,没有就传0
                     coordsID: that.dialog.CoordsId,
+                    status: that.dialog.status,
                 };
 
                 let postdata = qs.stringify(param);
@@ -846,15 +871,16 @@
                     regionId: regionID,
                 };
                 let postdata = qs.stringify(param);
-                RegionPictureGetByRegionId(postdata).then(res => {
-                    let json = res;
-                    that.dialog.plateImgSrc = '';
-                    if (json.Code == 0) {
-                        that.dialog.plateImgSrc = json.EncodeString;
-                    } else {
-                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
-                    }
-                })
+                that.dialog.plateImgSrc = '../assets/img/main/grid.png'
+                // RegionPictureGetByRegionId(postdata).then(res => {
+                //     let json = res;
+                //     that.dialog.plateImgSrc = '';
+                //     if (json.Code == 0) {
+                //         that.dialog.plateImgSrc = json.EncodeString;
+                //     } else {
+                //         that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                //     }
+                // })
             },
             // 启用
             runRow(row) {
@@ -890,6 +916,9 @@
                         that.dialog.location = item.Name;
                     }
                 });
+            },
+            filterTime(val, row, column) {
+                return nonTfmtDate(column,10);
             }
         },
         watch: {