MS-CIAZDCOIXVRW\Administrator před 3 roky
rodič
revize
f46df784bf
2 změnil soubory, kde provedl 16 přidání a 12 odebrání
  1. 13 9
      src/components/PeopleRecord.vue
  2. 3 3
      vue.config.js

+ 13 - 9
src/components/PeopleRecord.vue

@@ -40,13 +40,13 @@
               size="small"
               clearable
               v-model="keyword"
-              @change="handleChange"
+              @input="handleChange"
             >
             </el-input>
           </div>
         </div>
         <!-- 实时监测表格区域 -->
-        <div class="watch-form">
+        <div class="watch-form" v-if="tableData.length">
           <el-table
             v-loading="loading"
             element-loading-text="加载中"
@@ -187,6 +187,8 @@ export default {
       pop_imgurl: null,
       // 实时监测表格加载中效果
       loading: false,
+      // 数据总条数
+      total: 0,
     };
   },
   created() {
@@ -214,18 +216,18 @@ export default {
     async getData() {
       this.loading = true;
       let res = await this.$axios({
-        url: "/accessRecord/access/record/realTime",
+        url: "/studentsportrait/accessRecord/access/record/realTime",
         method: "get",
         params: {
           page: this.page,
-          // size: null,
           dateTime: this.timeValue,
           keyWord: this.keyword,
         },
       });
       // console.log(res);
       if (res.data.status == 20001) {
-        this.tableData = [...this.tableData, ...res.data.data];
+        this.total = res.data.data.totalCount;
+        this.tableData = [...this.tableData, ...res.data.data.list];
       } else {
         this.$message.error(res.data.desc);
       }
@@ -234,7 +236,7 @@ export default {
     // 获取人员比例数据
     async getRatioData() {
       let res = await this.$axios({
-        url: "/accessRecord/access/record/ratios",
+        url: "/studentsportrait/accessRecord/access/record/ratios",
         method: "get",
       });
       // console.log(res);
@@ -247,7 +249,7 @@ export default {
     // 获取7小时人流量数据
     async getTrafficData() {
       let res = await this.$axios({
-        url: "/accessRecord/access/record/traffic",
+        url: "/studentsportrait/accessRecord/access/record/traffic",
         method: "get",
       });
       // console.log(res);
@@ -270,8 +272,10 @@ export default {
     },
     // 实时监测表格滑动到底部加载更多回调
     moretable() {
-      this.page += 1;
-      this.getData();
+      if (this.tableData.length < this.total) {
+        this.page += 1;
+        this.getData();
+      }
     },
     // 创建折线图
     getLineChart() {

+ 3 - 3
vue.config.js

@@ -1,14 +1,14 @@
 module.exports = {
     assetsDir: 'static',
     parallel: false,
-    publicPath: '/accessRecordH5/',
+    publicPath: '/studentsportrait/accessRecordH5/',
     devServer: {
         open: true,
         proxy: {
             //配置跨域
-            '/accessRecord': {
+            '/studentsportrait': {
                 // target: 'http://192.168.161.100:8087',
-                target: 'https://chtech.ncjti.edu.cn/studentsportrait/accessRecord',
+                target: 'https://chtech.ncjti.edu.cn',
                 //这里后台的地址模拟的;应该填写你们真实的后台接口
                 changOrigin: true,//允许跨域
                 pathRewrite: {