MS-CIAZDCOIXVRW\Administrator 3 лет назад
Родитель
Сommit
f1344dc9fb
5 измененных файлов с 178 добавлено и 216 удалено
  1. 66 22
      package-lock.json
  2. 1 0
      package.json
  3. 89 194
      src/components/PeopleRecord.vue
  4. 2 0
      src/main.js
  5. 20 0
      vue.config.js

+ 66 - 22
package-lock.json

@@ -8,6 +8,7 @@
       "name": "people-record",
       "version": "0.1.0",
       "dependencies": {
+        "axios": "^1.2.1",
         "core-js": "^3.6.5",
         "echarts": "^5.2.2",
         "element-ui": "^2.15.6",
@@ -3150,8 +3151,7 @@
     "node_modules/asynckit": {
       "version": "0.4.0",
       "resolved": "https://registry.nlark.com/asynckit/download/asynckit-0.4.0.tgz",
-      "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=",
-      "dev": true
+      "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
     },
     "node_modules/atob": {
       "version": "2.1.2",
@@ -3208,6 +3208,29 @@
       "integrity": "sha1-1h9G2DslGSUOJ4Ta9bCUeai0HFk=",
       "dev": true
     },
+    "node_modules/axios": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npmjs.org/axios/-/axios-1.2.1.tgz",
+      "integrity": "sha512-I88cFiGu9ryt/tfVEi4kX2SITsvDddTajXTOFmt2uK1ZVA8LytjtdeyefdQWEf5PU8w+4SSJDoYnggflB5tW4A==",
+      "dependencies": {
+        "follow-redirects": "^1.15.0",
+        "form-data": "^4.0.0",
+        "proxy-from-env": "^1.1.0"
+      }
+    },
+    "node_modules/axios/node_modules/form-data": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
+      "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
+      "dependencies": {
+        "asynckit": "^0.4.0",
+        "combined-stream": "^1.0.8",
+        "mime-types": "^2.1.12"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
     "node_modules/babel-eslint": {
       "version": "10.1.0",
       "resolved": "https://registry.npmmirror.com/babel-eslint/download/babel-eslint-10.1.0.tgz",
@@ -4457,7 +4480,6 @@
       "version": "1.0.8",
       "resolved": "https://registry.nlark.com/combined-stream/download/combined-stream-1.0.8.tgz",
       "integrity": "sha1-w9RaizT9cwYxoRCoolIGgrMdWn8=",
-      "dev": true,
       "dependencies": {
         "delayed-stream": "~1.0.0"
       },
@@ -5699,7 +5721,6 @@
       "version": "1.0.0",
       "resolved": "https://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz",
       "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
-      "dev": true,
       "engines": {
         "node": ">=0.4.0"
       }
@@ -7129,10 +7150,9 @@
       }
     },
     "node_modules/follow-redirects": {
-      "version": "1.14.6",
-      "resolved": "https://registry.npmmirror.com/follow-redirects/download/follow-redirects-1.14.6.tgz",
-      "integrity": "sha512-fhUl5EwSJbbl8AR+uYL2KQDxLkdSjZGR36xy46AO7cOMTrCMON6Sa28FmAnC2tRTDbd/Uuzz3aJBv7EBN7JH8A==",
-      "dev": true,
+      "version": "1.15.2",
+      "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
+      "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==",
       "funding": [
         {
           "type": "individual",
@@ -9812,7 +9832,6 @@
       "version": "1.51.0",
       "resolved": "https://registry.npmmirror.com/mime-db/download/mime-db-1.51.0.tgz?cache=0&sync_timestamp=1636426033377&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fmime-db%2Fdownload%2Fmime-db-1.51.0.tgz",
       "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==",
-      "dev": true,
       "engines": {
         "node": ">= 0.6"
       }
@@ -9821,7 +9840,6 @@
       "version": "2.1.34",
       "resolved": "https://registry.npmmirror.com/mime-types/download/mime-types-2.1.34.tgz?cache=0&sync_timestamp=1636432373429&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fmime-types%2Fdownload%2Fmime-types-2.1.34.tgz",
       "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==",
-      "dev": true,
       "dependencies": {
         "mime-db": "1.51.0"
       },
@@ -12101,6 +12119,11 @@
         "node": ">= 0.10"
       }
     },
+    "node_modules/proxy-from-env": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
+      "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
+    },
     "node_modules/prr": {
       "version": "1.0.1",
       "resolved": "https://registry.nlark.com/prr/download/prr-1.0.1.tgz",
@@ -18833,8 +18856,7 @@
     "asynckit": {
       "version": "0.4.0",
       "resolved": "https://registry.nlark.com/asynckit/download/asynckit-0.4.0.tgz",
-      "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=",
-      "dev": true
+      "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
     },
     "atob": {
       "version": "2.1.2",
@@ -18877,6 +18899,28 @@
       "integrity": "sha1-1h9G2DslGSUOJ4Ta9bCUeai0HFk=",
       "dev": true
     },
+    "axios": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npmjs.org/axios/-/axios-1.2.1.tgz",
+      "integrity": "sha512-I88cFiGu9ryt/tfVEi4kX2SITsvDddTajXTOFmt2uK1ZVA8LytjtdeyefdQWEf5PU8w+4SSJDoYnggflB5tW4A==",
+      "requires": {
+        "follow-redirects": "^1.15.0",
+        "form-data": "^4.0.0",
+        "proxy-from-env": "^1.1.0"
+      },
+      "dependencies": {
+        "form-data": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
+          "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
+          "requires": {
+            "asynckit": "^0.4.0",
+            "combined-stream": "^1.0.8",
+            "mime-types": "^2.1.12"
+          }
+        }
+      }
+    },
     "babel-eslint": {
       "version": "10.1.0",
       "resolved": "https://registry.npmmirror.com/babel-eslint/download/babel-eslint-10.1.0.tgz",
@@ -19893,7 +19937,6 @@
       "version": "1.0.8",
       "resolved": "https://registry.nlark.com/combined-stream/download/combined-stream-1.0.8.tgz",
       "integrity": "sha1-w9RaizT9cwYxoRCoolIGgrMdWn8=",
-      "dev": true,
       "requires": {
         "delayed-stream": "~1.0.0"
       }
@@ -20877,8 +20920,7 @@
     "delayed-stream": {
       "version": "1.0.0",
       "resolved": "https://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz",
-      "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
-      "dev": true
+      "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
     },
     "delegates": {
       "version": "1.0.0",
@@ -22041,10 +22083,9 @@
       }
     },
     "follow-redirects": {
-      "version": "1.14.6",
-      "resolved": "https://registry.npmmirror.com/follow-redirects/download/follow-redirects-1.14.6.tgz",
-      "integrity": "sha512-fhUl5EwSJbbl8AR+uYL2KQDxLkdSjZGR36xy46AO7cOMTrCMON6Sa28FmAnC2tRTDbd/Uuzz3aJBv7EBN7JH8A==",
-      "dev": true
+      "version": "1.15.2",
+      "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
+      "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA=="
     },
     "for-in": {
       "version": "1.0.2",
@@ -24106,14 +24147,12 @@
     "mime-db": {
       "version": "1.51.0",
       "resolved": "https://registry.npmmirror.com/mime-db/download/mime-db-1.51.0.tgz?cache=0&sync_timestamp=1636426033377&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fmime-db%2Fdownload%2Fmime-db-1.51.0.tgz",
-      "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==",
-      "dev": true
+      "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g=="
     },
     "mime-types": {
       "version": "2.1.34",
       "resolved": "https://registry.npmmirror.com/mime-types/download/mime-types-2.1.34.tgz?cache=0&sync_timestamp=1636432373429&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fmime-types%2Fdownload%2Fmime-types-2.1.34.tgz",
       "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==",
-      "dev": true,
       "requires": {
         "mime-db": "1.51.0"
       }
@@ -25990,6 +26029,11 @@
         "ipaddr.js": "1.9.1"
       }
     },
+    "proxy-from-env": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
+      "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
+    },
     "prr": {
       "version": "1.0.1",
       "resolved": "https://registry.nlark.com/prr/download/prr-1.0.1.tgz",

+ 1 - 0
package.json

@@ -8,6 +8,7 @@
     "lint": "vue-cli-service lint"
   },
   "dependencies": {
+    "axios": "^1.2.1",
     "core-js": "^3.6.5",
     "echarts": "^5.2.2",
     "element-ui": "^2.15.6",

+ 89 - 194
src/components/PeopleRecord.vue

@@ -21,27 +21,32 @@
         </div>
         <!-- 实时监测表格区域 -->
         <div class="watch-form">
-          <el-table :data="tableData1.slice(0, 5)" border style="width: 100%">
+          <el-table :data="tableData" border style="width: 100%" height="517">
             <el-table-column label="捕获" header-align="center" width="100">
               <template slot-scope="{ row }">
-                <img :src="row.url" style="width: 82px; height: 60px" />
+                <img
+                  :src="row.pictureScene"
+                  style="width: 82px; height: 82px"
+                />
               </template>
             </el-table-column>
             <el-table-column label="识别" header-align="center">
               <template slot-scope="{ row }">
                 <div class="watch-form-list">
-                  <div>
-                    <img :src="row.msg.url" style="width: 82px; height: 60px" />
+                  <div class="table_left">
+                    <img
+                      :src="row.pictureTemplate"
+                      style="width: 82px; height: 82px"
+                    />
                   </div>
-                  <div>
-                    <div>姓名:{{ row.msg.name }}</div>
-                    <div>识别ID:{{ row.msg.id }}</div>
-                    <div>车牌:{{ row.msg.number }}</div>
+                  <div class="table_center">
+                    <div>识别ID:{{ row.recognitionId }}</div>
+                    <div>姓名:{{ row.personName }}</div>
+                    <div>身份:{{ row.identity }}</div>
                   </div>
-                  <div>
-                    <div>身份:{{ row.msg.type }}</div>
-                    <div>位置:{{ row.msg.place }}</div>
-                    <div>时间:{{ row.msg.time }}</div>
+                  <div class="table_right">
+                    <div>时间:{{ row.dateTime }}</div>
+                    <div>位置:{{ row.address }}</div>
                   </div>
                 </div>
               </template>
@@ -68,36 +73,41 @@
           <div class="record-form-time">
             <div class="time">
               <el-date-picker
-                v-model="value"
                 type="date"
                 size="mini"
                 :editable="false"
                 placeholder="选择日期"
+                value-format="yyyy-MM-dd"
+                v-model="dateTime"
+                @change="getRecordData"
               >
               </el-date-picker>
             </div>
           </div>
           <!-- 表格数据 -->
           <div class="record-form-list">
-            <el-table :data="tableData1" style="width: 100%" height="428">
+            <el-table :data="recordList" style="width: 100%" height="428">
               <el-table-column
-                prop="msg.name"
+                prop="name"
                 label="姓名"
                 align="center"
                 width="76"
               >
               </el-table-column>
               <el-table-column
-                prop="msg.number"
-                label="车牌号"
+                prop="address"
+                label="地址"
                 align="center"
                 width="89"
+                show-overflow-tooltip
               >
               </el-table-column>
-              <el-table-column label="时间" align="center" width="76">
-                <template slot-scope="{ row }">
-                  {{ row.msg.time.split(" ")[1] }}
-                </template>
+              <el-table-column
+                prop="time"
+                label="时间"
+                align="center"
+                width="76"
+              >
               </el-table-column>
             </el-table>
           </div>
@@ -143,179 +153,8 @@ export default {
   name: "HelloWorld",
   data() {
     return {
-      // 时间选择器绑定的值
-      value: "",
       // 人员数据
-      tableData1: [
-        {
-          url: "https://img1.baidu.com/it/u=402105144,1124774539&fm=26&fmt=auto",
-          msg: {
-            url: "https://img0.baidu.com/it/u=3538708005,999399332&fm=26&fmt=auto",
-            id: "42938",
-            time: "2018-12-23 14:32:26",
-            name: "王力宏啊",
-            place: "1号机动车出口",
-            number: "赣BU2569",
-            type: "教师",
-          },
-        },
-        {
-          url: "https://img1.baidu.com/it/u=3499031637,1598196688&fm=26&fmt=auto",
-          msg: {
-            url: "https://img2.baidu.com/it/u=3434449357,84195486&fm=26&fmt=auto",
-            id: "42938",
-            time: "2018-12-23 14:32:26",
-            name: "吴亦凡",
-            place: "1号机动车出口",
-            number: "赣BU2569",
-            type: "教师",
-          },
-        },
-        {
-          url: "https://img1.baidu.com/it/u=3499031637,1598196688&fm=26&fmt=auto",
-          msg: {
-            url: "https://img2.baidu.com/it/u=3434449357,84195486&fm=26&fmt=auto",
-            id: "42938",
-            time: "2018-12-23 14:32:26",
-            name: "吴亦凡",
-            place: "1号机动车出口",
-            number: "赣BU2569",
-            type: "家长",
-          },
-        },
-        {
-          url: "https://img1.baidu.com/it/u=3499031637,1598196688&fm=26&fmt=auto",
-          msg: {
-            url: "https://img2.baidu.com/it/u=3434449357,84195486&fm=26&fmt=auto",
-            id: "42938",
-            time: "2018-12-23 14:32:26",
-            name: "吴亦凡",
-            place: "1号机动车出口",
-            number: "赣BU2569",
-            type: "临时人员",
-          },
-        },
-        {
-          url: "https://img1.baidu.com/it/u=3499031637,1598196688&fm=26&fmt=auto",
-          msg: {
-            url: "https://img2.baidu.com/it/u=3434449357,84195486&fm=26&fmt=auto",
-            id: "42938",
-            time: "2018-12-23 14:32:26",
-            name: "吴亦凡",
-            place: "1号机动车出口",
-            number: "赣BU2569",
-            type: "学生",
-          },
-        },
-        {
-          url: "https://img1.baidu.com/it/u=3499031637,1598196688&fm=26&fmt=auto",
-          msg: {
-            url: "https://img2.baidu.com/it/u=3434449357,84195486&fm=26&fmt=auto",
-            id: "42938",
-            time: "2018-12-23 14:32:26",
-            name: "吴亦凡",
-            place: "1号机动车出口",
-            number: "赣BU2569",
-            type: "教师",
-          },
-        },
-        {
-          url: "https://img1.baidu.com/it/u=3499031637,1598196688&fm=26&fmt=auto",
-          msg: {
-            url: "https://img2.baidu.com/it/u=3434449357,84195486&fm=26&fmt=auto",
-            id: "42938",
-            time: "2018-12-23 14:32:26",
-            name: "吴亦凡",
-            place: "1号机动车出口",
-            number: "赣BU2569",
-            type: "家长",
-          },
-        },
-        {
-          url: "https://img1.baidu.com/it/u=3499031637,1598196688&fm=26&fmt=auto",
-          msg: {
-            url: "https://img2.baidu.com/it/u=3434449357,84195486&fm=26&fmt=auto",
-            id: "42938",
-            time: "2018-12-23 14:32:26",
-            name: "吴亦凡",
-            place: "1号机动车出口",
-            number: "赣BU2569",
-            type: "临时人员",
-          },
-        },
-        {
-          url: "https://img1.baidu.com/it/u=3499031637,1598196688&fm=26&fmt=auto",
-          msg: {
-            url: "https://img2.baidu.com/it/u=3434449357,84195486&fm=26&fmt=auto",
-            id: "42938",
-            time: "2018-12-23 14:32:26",
-            name: "吴亦凡",
-            place: "1号机动车出口",
-            number: "赣BU2569",
-            type: "学生",
-          },
-        },
-        {
-          url: "https://img1.baidu.com/it/u=3499031637,1598196688&fm=26&fmt=auto",
-          msg: {
-            url: "https://img2.baidu.com/it/u=3434449357,84195486&fm=26&fmt=auto",
-            id: "42938",
-            time: "2018-12-23 14:32:26",
-            name: "吴亦凡",
-            place: "1号机动车出口",
-            number: "赣BU2569",
-            type: "教师",
-          },
-        },
-        {
-          url: "https://img1.baidu.com/it/u=3499031637,1598196688&fm=26&fmt=auto",
-          msg: {
-            url: "https://img2.baidu.com/it/u=3434449357,84195486&fm=26&fmt=auto",
-            id: "42938",
-            time: "2018-12-23 14:32:26",
-            name: "吴亦凡",
-            place: "1号机动车出口",
-            number: "赣BU2569",
-            type: "家长",
-          },
-        },
-        {
-          url: "https://img1.baidu.com/it/u=3499031637,1598196688&fm=26&fmt=auto",
-          msg: {
-            url: "https://img2.baidu.com/it/u=3434449357,84195486&fm=26&fmt=auto",
-            id: "42938",
-            time: "2018-12-23 14:32:26",
-            name: "吴亦凡",
-            place: "1号机动车出口",
-            number: "赣BU2569",
-            type: "临时人员",
-          },
-        },
-        {
-          url: "https://img1.baidu.com/it/u=3499031637,1598196688&fm=26&fmt=auto",
-          msg: {
-            url: "https://img2.baidu.com/it/u=3434449357,84195486&fm=26&fmt=auto",
-            id: "42938",
-            time: "2018-12-23 14:32:26",
-            name: "吴亦凡",
-            place: "1号机动车出口",
-            number: "赣BU2569",
-            type: "学生",
-          },
-        },
-        {
-          url: "https://img1.baidu.com/it/u=3499031637,1598196688&fm=26&fmt=auto",
-          msg: {
-            url: "https://img2.baidu.com/it/u=3434449357,84195486&fm=26&fmt=auto",
-            id: "42938",
-            time: "2018-12-23 14:32:26",
-            name: "吴亦凡",
-            place: "1号机动车出口",
-            number: "赣BU2569",
-            type: "教师",
-          },
-        },
-      ],
+      tableData: [],
       // 折线图表配置
       lineOption: {
         tooltip: {
@@ -437,13 +276,53 @@ export default {
           },
         ],
       },
+      // 历史记录列表
+      recordList: [],
+      // 时间选择框选择的时间值
+      dateTime: null,
     };
   },
   mounted() {
     // 初始化图表
     this.initChart();
+    this.getData();
+    this.getRecordData();
   },
   methods: {
+    async getData() {
+      let res = await this.$axios({
+        url: "/popup-api/access/record/realTime",
+        method: "get",
+        params: {
+          page: 1,
+          size: null,
+        },
+      });
+      console.log(res);
+      if (res.data.status == 20001) {
+        this.tableData = res.data.data;
+      } else {
+        this.$message.error(res.data.desc);
+      }
+    },
+    // 获取历史记录列表数据
+    async getRecordData() {
+      let res = await this.$axios({
+        url: "/popup-api/access/record/history",
+        method: "get",
+        params: {
+          dateTime: this.dateTime,
+          page: 1,
+          size: null,
+        },
+      });
+      // console.log(res);
+      if (res.data.status == 20001) {
+        this.recordList = res.data.data;
+      } else {
+        this.$message.error(res.data.desc);
+      }
+    },
     // 创建图表
     initChart() {
       var chartLineDom = document.getElementById("line");
@@ -523,7 +402,23 @@ export default {
         border: 1px solid #58beff;
         .watch-form-list {
           display: flex;
-          justify-content: space-between;
+          justify-content: space-evenly;
+
+          .table_left {
+            flex: 1;
+          }
+          .table_center {
+            flex: 2;
+            display: flex;
+            flex-direction: column;
+            margin-left: 10px;
+            div{
+              flex: 1;
+            }
+          }
+          .table_right {
+            flex: 2;
+          }
         }
       }
     }

+ 2 - 0
src/main.js

@@ -1,8 +1,10 @@
 import Vue from 'vue'
 import App from './App.vue'
+import axios from 'axios'
 import ElementUI from 'element-ui';
 import 'element-ui/lib/theme-chalk/index.css';
 
+Vue.prototype.$axios = axios
 Vue.use(ElementUI);
 
 Vue.config.productionTip = false

+ 20 - 0
vue.config.js

@@ -0,0 +1,20 @@
+module.exports = {
+    assetsDir: 'static',
+    parallel: false,
+    publicPath: './',
+    devServer: {
+        open: true,
+        //以上的ip和端口是我们本机的;下面为需要跨域的
+        proxy: {
+            //配置跨域
+            '/popup-api': {
+                target: 'http://192.168.161.100:8087',
+                //这里后台的地址模拟的;应该填写你们真实的后台接口
+                changOrigin: true,//允许跨域
+                pathRewrite: {
+                    '^/popup-api': ''//请求的时候使用这个api就可以
+                }
+            },
+        }
+    }
+}