Просмотр исходного кода

增加闸机管理模块,闸机管理的进出记录查询页完成

linan 5 лет назад
Родитель
Сommit
0f0d25c64e

+ 8 - 0
src/router/routes.js

@@ -7,6 +7,8 @@ import CameraManagement from '../views/deviceManagement/CameraManagement.vue'
 import SubDeviceAdmin from '../views/deviceManagement/SubDeviceAdmin.vue'
 /* 区域管理 */
 import AreaInfo from '../views/areaManagement/AreaInfo.vue'
+/* 闸机管理 */
+import EnterOut from '../views/gateMachineManagement/EnterOut.vue'
 /* 消息管理 */
 import MessageBind from '../views/messageManagement/MessageBind.vue'
 import MessagePoint from '../views/messageManagement/MessagePoint.vue'
@@ -71,6 +73,12 @@ export default [
 				name: 'areaInfo',
 				component: AreaInfo
 			},
+			// 闸机管理
+			{
+				path: '/enterOut',
+				name: 'enterOut',
+				component: EnterOut
+			},
 			// 消息管理
 			{
 				path: '/messageBind',

+ 26 - 8
src/views/Home/mencCofig.js

@@ -49,37 +49,55 @@ export const menuData = [
         disabled: false,
         childList: [ 
             {
-                optionName: '区域信息',
+                optionName: '区域目录',
+                index: '2-1',
+                routerName: "areaInfo"
+            },
+            {
+                optionName: '区域查询',
                 index: '2-1',
                 routerName: "areaInfo"
             }
         ]
     },
+    {
+        optionName: "闸机管理",
+        iconClassName: "el-icon-unlock",
+        index: '3',
+        disabled: false,
+        childList: [ 
+            {
+                optionName: '进出记录',
+                index: '3-1',
+                routerName: "enterOut"
+            }
+        ]
+    },
     // 无子菜单的
     {
         optionName: "消息管理",
         iconClassName: "el-icon-message",
-        index: '3',
+        index: '4',
         disabled: false,
         childList: [ 
             {
                 optionName: '消息绑定',
-                index: '3-1',
+                index: '4-1',
                 routerName: "messageBind"
             },
             {
                 optionName: '消息点',
-                index: '3-2',
+                index: '4-2',
                 routerName: "messagePoint"
             },
             {
                 optionName: '消息模板',
-                index: '3-3',
+                index: '4-3',
                 routerName: "messageTemplate"
             },
             {
                 optionName: '服务提供商',
-                index: '3-4',
+                index: '4-4',
                 routerName: "messageServicMer"
             }
             
@@ -88,12 +106,12 @@ export const menuData = [
     {
         optionName: "树目录结构",
         iconClassName: "el-icon-coordinate",
-        index: '4',
+        index: '5',
         disabled: false,
         childList: [ 
             {
                 optionName: '树目录管理',
-                index: '4-1',
+                index: '5-1',
                 routerName: "treeManagement"
             }
         ]

+ 137 - 0
src/views/gateMachineManagement/EnterOut.vue

@@ -0,0 +1,137 @@
+<template>
+    <div class="EnterOut">
+        <header class="header">
+            <el-button-group>
+                <el-button :type="isLookOut?'primary':''" @click="lookEnter">查看出</el-button>
+                <el-button :type="isLookOut?'':'primary'" @click="lookOut">查看入</el-button>
+            </el-button-group>
+        </header>
+        <section class="section">
+            <el-table :data="EnterOutList">
+                <el-table-column prop="id" label="序号" width="120px"></el-table-column>
+                <el-table-column prop="recordInfo.name" label="机器名字"></el-table-column>
+                <el-table-column prop="useInfo.name" label="出入者"></el-table-column>
+                <el-table-column prop="useInfo.idNumber" label="出入者身份证号"></el-table-column>
+                <el-table-column prop="useInfo.name" label="出入者"></el-table-column>
+                <el-table-column prop="updated" label="进出时间"></el-table-column>
+                <el-table-column fixed="right" label="操作" width="200">
+                    <template slot-scope="scope">
+                        <el-button
+                            @click="look(scope.row.useInfo.imgUrl)"
+                            type="text"
+                            size="small"
+                        >查看出入者照片</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+            <el-row type="flex" justify="end">
+                <el-col :span="8" class="pagination">
+                    <el-pagination
+                        @current-change="pageChange"
+                        background
+                        layout="prev, pager, next"
+                        :page-count="5"
+                    ></el-pagination>
+                </el-col>
+            </el-row>
+
+            <el-dialog title="提示" center :visible.sync="showDialog" width="30%">
+                <img
+                    class="img"
+                    src="http://121.36.134.218:88/10123_0bbced8b3c7a418bbb52ff58469eee1c.jpg"
+                    alt="没有照片"
+                />
+                <span slot="footer">
+                    <el-button @click="showDialog = false">取 消</el-button>
+                    <el-button type="primary" @click="showDialog = false">确 定</el-button>
+                </span>
+            </el-dialog>
+        </section>
+    </div>
+</template>
+
+<script>
+import { mapActions } from "vuex";
+
+// 每页数据条数
+const pageSize = 10;
+
+export default {
+    name: "EnterOut",
+    data() {
+        return {
+            EnterOutList: [],
+            isLookOut: true,
+            showDialog: true,
+            userImgUrl: "",
+            pageSize,
+            page: 1
+        };
+    },
+    created() {},
+    methods: {
+        ...mapActions(["fetch"]),
+        getEnterOutList() {
+            let api = this.isLookOut
+                ? "/analyse/uface/out"
+                : "/analyse/uface/in";
+            let data = {
+                pageSize: this.pageSize,
+                page: this.page
+            };
+            this.fetch({
+                api,
+                method: "GET",
+                data,
+                success: res => {
+                    console.log(res);
+                },
+                fail: err => {
+                    console.log(err);
+                    if (err.errMsg) this.$message.error(err.errMsg);
+                    else this.$message.error("服务器发生异常");
+                }
+            });
+        },
+        // 页码改变
+        pageChange(p) {
+            console.log(p);
+            this.page = p;
+            // this.getEnterOutList();
+        },
+        // 点击 查看出
+        lookOut() {
+            this.isLookOut = false;
+            // this.getEnterOutList();
+        },
+        // 点击 查看入
+        lookEnter() {
+            this.isLookOut = true;
+            // this.getEnterOutList();
+        },
+        // 查看出入者照片
+        look(imgUrl) {
+            console.log(imgUrl);
+            this.userImgUrl = imgUrl;
+            this.showDialog = true;
+        }
+    }
+};
+</script>
+
+<style lang="scss" scoped>
+.EnterOut {
+    .header {
+        margin-bottom: 10px;
+    }
+    .section {
+        img {
+            width: 100%;
+        }
+    }
+}
+
+.pagination {
+    margin-top: 20px;
+}
+</style>

+ 8 - 293
src/views/template/Ac.vue

@@ -1,312 +1,31 @@
-
 <template>
-    <div class="DeviceInfo">
-        <el-row :gutter="20">
-            <el-col :span="2">
-                <span style="line-height:32px;">工具栏:</span>
-            </el-col>
-            <el-col :span="12">
-                <el-input
-                    placeholder="请输入内容"
-                    v-model="searchParams.keywords"
-                    class="input-with-select"
-                    @keyup.enter.native="doSearch"
-                >
-                    <el-select
-                        v-model="searchParams.hardTypeId"
-                        class="input-with-select-select"
-                        slot="prepend"
-                        placeholder="请选择"
-                    >
-                        <el-option
-                            v-for="(type,key) in typeList"
-                            :label="type.name"
-                            :value="type.id"
-                            :key="key"
-                        ></el-option>
-                    </el-select>
-                    <el-button slot="append" icon="el-icon-search" @click="doSearch"></el-button>
-                </el-input>
-            </el-col>
-            <el-col :span="8">
-                <el-button @click="add" type="primary" icon="el-icon-document-add">新建</el-button>
-            </el-col>
-        </el-row>
-        <hr style="border-top: 2px solid #eee;margin: 10px 0;">
-        <el-row>
-            <el-table :data="deviceList">
-                <el-table-column prop="id" label="序号" width="120px"></el-table-column>
-                <el-table-column prop="name" label="名称"></el-table-column>
-                <el-table-column prop="deviceNo" label="MAC/SN"></el-table-column>
-                <el-table-column prop="sVer" label="软件版本"></el-table-column>
-                <el-table-column prop="hVer" label="硬件版本"></el-table-column>
-                <el-table-column prop="meta.period" label="数据频率"></el-table-column>
-                <el-table-column prop="status" label="在线状态"></el-table-column>
-                <el-table-column prop="description" label="描述"></el-table-column>
-                <el-table-column label="最后一次">
-                    <template slot-scope="scope">
-                        <span>{{ new Date(scope.row.updated).toLocaleDateString() }}</span>
-                    </template>
-                </el-table-column>
-                <el-table-column fixed="right" label="操作" width="200">
-                    <template slot-scope="scope">
-                        <el-button
-                            @click="handlePlay(scope.row)"
-                            type="text"
-                            v-if="isCamera(scope.row.hardTypeId)"
-                        >播放</el-button>
-                        <el-button @click="edit(scope.row)" type="text" size="small">编辑</el-button>
-                        <el-popconfirm title="是否删除此设备的信息?" @onConfirm="del(scope.row)">
-                            <el-button slot="reference" type="text" size="small">删除</el-button>
-                        </el-popconfirm>
-                        <el-button @click="subDeviceAdmin(scope.row)" type="text" size="small">子设备管理</el-button>
-                    </template>
-                </el-table-column>
-            </el-table>
-        </el-row>
-
-        <!-- 设备信息新建、编辑 -->
-        <el-dialog :title="isAdd?'新建设备信息':'编辑设备信息'" :visible.sync="isShowDialog" append-to-body>
-            <el-form :model="formData" label-width="100px">
-                <el-form-item label="名称:">
-                    <el-input v-model="formData.name" placeholder="请输入名称"></el-input>
-                </el-form-item>
-                <el-form-item label="设备类型:">
-                    <el-select
-                        v-for="(arrItem,key) in typeTree"
-                        :key="key"
-                        v-model="selectArr[key]"
-                        filterable
-                        placeholder="请选择"
-                        value-key="id"
-                        @change="selectedEvt"
-                        @focus="position=key"
-                    >
-                        <el-option
-                            v-for="item in arrItem"
-                            :key="item.id"
-                            :value="item.id"
-                            :label="item.name"
-                        ></el-option>
-                    </el-select>
-                </el-form-item>
-                <el-form-item label="MAC/SN:">
-                    <el-input v-model="formData.deviceNo" placeholder="MAC或者SN"></el-input>
-                </el-form-item>
-                <el-form-item label="配置信息:">
-                    <el-input
-                        type="textarea"
-                        autosize
-                        :rows="2"
-                        v-model="formData.meta"
-                        placeholder="先用json做配置,后期可不同类型不同编辑框"
-                    ></el-input>
-                </el-form-item>
-                <el-form-item label="描述:">
-                    <el-input
-                        type="textarea"
-                        :rows="4"
-                        v-model="formData.description"
-                        placeholder="输入描述"
-                    ></el-input>
-                </el-form-item>
-            </el-form>
-            <div slot="footer">
-                <el-button @click="isShowDialog=false">取 消</el-button>
-                <el-button type="primary" @click="save">保 存</el-button>
-            </div>
-        </el-dialog>
-        <!-- 摄像头播放 -->
-        <el-dialog :title="videoData.title" :visible.sync="isShowVideo">
-            <rtsp-player :rtspData="videoData"></rtsp-player>
-        </el-dialog>
+    <div class="EnterOut">
+        EnterOut
     </div>
 </template>
 
 <script>
 import { mapActions } from "vuex";
-import rtspPlayer from "../common/rtsp-player/index";
 
 export default {
-    name: "DeviceInfo",
-    components: { rtspPlayer },
+    name: "EnterOut",
     data() {
         return {
-            typeList: [],
-            typeTree: [],
-            deviceList: [],
-            position: null,
-            selectArr: [],
-            isShowDialog: false,
-            searchParams: {
-                hardTypeId: null,
-                keywords: ""
-            },
-            formData: {
-                name: "",
-                hardTypeId: null,
-                deviceNo: "",
-                description: "",
-                meta: ""
-            },
-            isShowVideo: false,
-            videoData: {
-                title: null,
-                rtsp: null,
-                ws: null
-            },
-            isAdd: true
+           
         };
     },
     created() {
-        this.loadTypeList();
-        this.doSearch();
+        
     },
     methods: {
         ...mapActions(["fetch"]),
-        doSearch() {
-            if (this.searchParams.hardTypeId < 0) {
-                this.$message.info("请先选择分类");
-                return;
-            }
-            this.fetch({
-                api: "/device/device-communication/list",
-                method: "GET",
-                data: {
-                    orgId: 1,
-                    hardTypeId: this.searchParams.hardTypeId,
-                    keywords: this.searchParams.keywords
-                }, //目前只有一个组织,其他参数调整钟
-                success: res => {
-                    this.deviceList = res;
-                },
-                fail: err => {
-                    console.log("555");
-                    if (err.errCode == "request_not_authorize") {
-                        this.$message({
-                            message: "请重新登录",
-                            type: "warning"
-                        });
-                    }
-                    console.log(err);
-                }
-            });
-        },
-        // 设备信息新建、编辑里的 选择设备类型
-        selectedEvt(item) {
-            //获取下一级列表
-            this.loadTypeList(item);
-        },
-        add() {
-            this.isAdd = true
-            this.formData = {
-                orgId: 1,
-                name: "",
-                hardTypeId: null,
-                deviceNo: "",
-                description: "",
-                meta: ""
-            }
-            if (this.formData.id) delete this.formData.id;
-            this.isShowDialog = true;
-        },
-        loadTypeList(pid = -1) {
+         get() {
             this.fetch({
-                api: "/device/device-type/list-parent",
+                api: "aaa",
                 method: "GET",
-                data: { parentId: pid }, // 动态加载
-                success: res => {
-                    if (pid < 0) {
-                        this.typeList = res;
-                        this.typeTree.push(this.typeList);
-                    } else {
-                        console.log("222");
-                        if (res.length > 0)
-                            this.typeTree.splice(
-                                this.position + 1,
-                                this.typeTree.length,
-                                res
-                            );
-                        else
-                            this.typeTree.splice(
-                                this.position + 1,
-                                this.typeTree.length
-                            );
-                        this.selectArr.splice(
-                            this.position + 1,
-                            this.selectArr.length
-                        );
-                    }
-                }
-            });
-        },
-        isCamera(hid) {
-            if (hid === 4 || hid === 5 || hid === 6) return true;
-            else return false;
-        },
-        // 播放
-        handlePlay(row) {
-            console.log(row);
-            this.videoData = {
-                rtsp: row.meta.rtsp,
-                ws: row.meta.ws,
-                title: row.name
-            };
-            this.isShowVideo = true;
-        },
-        // 编辑
-        edit(row) {
-            console.log(row);
-            this.isAdd = false
-            // 判断是为了重复点击不会重复格式化
-            if(typeof row.meta == "object"){
-                row.meta = JSON.stringify(row.meta, null, 4);
-            }
-                // orgId: 1,
-                // name: "",
-                // hardTypeId: null,
-                // deviceNo: "",
-                // description: "",
-                // meta: ""
-            
-            if (this.formData.id) {
-                delete this.formData.id;
-                delete this.formData.name;
-                delete this.formData.hardTypeId;
-                delete this.formData.deviceNo;
-                delete this.formData.meta;
-                delete this.formData.description;
-            }
-            this.formData = Object.assign({}, this.formData, row);
-            this.isShowDialog = true;
-        },
-        // 删除
-        del(row) {
-            console.log(row);
-        },
-        // 子设备管理
-        subDeviceAdmin(row) {
-            this.$router.push({
-                path: "/subDeviceAdmin",
-                query: row
-            });
-        },
-        // 编辑的保存按钮
-        save() {
-            this.formData.hardTypeId = this.selectArr[
-                this.selectArr.length - 1
-            ];
-            let api = this.isAdd
-                ? "/device/device-communication/add"
-                : "/device/device/device-communication/update";
-            this.formData.meta = JSON.parse(this.formData.meta);
-            this.fetch({
-                api,
-                data: this.formData,
+                data: {},
                 success: res => {
                     console.log(res);
-                    this.doSearch(); //重新加载
-                    this.isShowDialog = false;
                 },
                 fail: err => {
                     console.log(err);
@@ -321,8 +40,4 @@ export default {
 
 <style lang="scss" scoped>
 
-
-.input-with-select-select {
-    width: 180px;
-}
 </style>

+ 1 - 1
vue.config.js

@@ -16,7 +16,7 @@ module.exports = {
   devServer: {
     disableHostCheck: true
     // proxy: {
-    //   '/api': {                //这里最好有一个 /
+    //   '/': {                //这里最好有一个 /
     //     target: 'http://115.238.57.190:8010',         // 服务器端接口地址
     //     ws: true,            //如果要代理 websockets,配置这个参数
     //     // 如果是https接口,需要配置这个参数