From 3cd25b6bb9ec57ae86ff09df13099e2d63a0a7fb Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期一, 10 十月 2022 15:30:32 +0800
Subject: [PATCH] 添加登录日志

---
 src/views/personalCenter/components/SubAccount.vue |    9 +
 src/views/subAccount/index.vue                     |   30 +++
 src/api/user.ts                                    |   65 ++++----
 src/views/subAccount/entryLog.vue                  |  306 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 374 insertions(+), 36 deletions(-)

diff --git a/src/api/user.ts b/src/api/user.ts
index 894f84e..e7d645e 100644
--- a/src/api/user.ts
+++ b/src/api/user.ts
@@ -1,6 +1,5 @@
-import request from "./index";
-import qs from "qs";
-
+import request from "./index"
+import qs from "qs"
 
 /* 鑾峰彇浼氬憳鐢ㄦ埛鍒楄〃
 "inputText": "string",
@@ -14,8 +13,8 @@
     url: "/saas/api-u/user/findUserList",
     method: "post",
     data: params
-  });
-};
+  })
+}
 
 /* 鑾峰彇杩愯惀鐢ㄦ埛鍒楄〃
 "inputText": "string",
@@ -29,24 +28,24 @@
     url: "/saas/api-u/user/findManagerList",
     method: "post",
     data: params
-  });
-};
+  })
+}
 
 export const saveSubUser = (params: any) => {
   return request({
     url: "/saas/api-u/user/saveSubUser",
     method: "post",
     data: params
-  });
-};
+  })
+}
 
 export const saveMember = (params: any) => {
   return request({
     url: "/saas/api-u/user/saveUser",
     method: "post",
     data: params
-  });
-};
+  })
+}
 /* 
   鑾峰彇褰撳墠鐢ㄦ埛鍙鑿滃崟
 */
@@ -54,65 +53,69 @@
   return request({
     url: "/saas/api-u/menu/tree",
     method: "get"
-  });
-};
-
+  })
+}
 
 export const getDataTree = (params) => {
   return request({
     url: "/saas/api-u/user/dataTree",
     method: "post",
     data: params
-  });
-};
-
-
+  })
+}
 
 export const saveManager = (params: any) => {
   return request({
     url: "/saas/api-u/user/saveManager",
     method: "post",
     data: params
-  });
-};
+  })
+}
 
 export const statisticByUser = (params: any) => {
   return request({
     url: "/saas/api-s/statistic/statisticByUser",
     method: "post",
     data: params
-  });
-};
-
+  })
+}
 
 export const getUserMenus = (query: any) => {
   return request({
     url: "/saas/api-u/users/findById",
     method: "post",
     data: qs.stringify(query)
-  });
-};
+  })
+}
 
 export const updataUser = (params: any) => {
   return request({
     url: "/saas/api-u/users/saveAuth",
     method: "post",
     data: params
-  });
-};
+  })
+}
 
 export const enableMenu = (params: any) => {
   return request({
     url: "/saas/api-u/menu/enableMenu",
     method: "post",
     data: params
-  });
-};
+  })
+}
 
 export const deleteUser = (params: any) => {
   return request({
     url: "/saas/api-u/user/deleteUser",
     method: "post",
     data: params
-  });
-};
+  })
+}
+
+export const findEntryLog = (params: any) => {
+  return request({
+    url: "/cloud/api-u/user/entryLog",
+    method: "post",
+    data: params
+  })
+}
diff --git a/src/views/personalCenter/components/SubAccount.vue b/src/views/personalCenter/components/SubAccount.vue
index f886f23..d3c5800 100644
--- a/src/views/personalCenter/components/SubAccount.vue
+++ b/src/views/personalCenter/components/SubAccount.vue
@@ -1,6 +1,6 @@
 <template>
   <div class="sub-account" v-if="!isShowAdd && !isShowRelate">
-    <div class="head-name">瀛愯处鎴风鐞�</div>
+    <div class="head-name" v-show="showHeadName">瀛愯处鍙风鐞�</div>
     <div class="search">
       <div class="left">
         <div class="id">
@@ -253,6 +253,9 @@
   computed: {
     taskOptions() {
       return this.VideoPhotoData.tasks.filter((item) => !item.isDelete)
+    },
+    showHeadName() {
+      return this.$route.path === "/personalCenter"
     }
   },
   data() {
@@ -605,6 +608,10 @@
       })
     },
     findUserList() {
+      if (this.inputText.length) {
+        this.inputText = this.inputText.trim()
+      }
+
       findUserList({
         inputText: this.inputText,
         page: this.page,
diff --git a/src/views/subAccount/entryLog.vue b/src/views/subAccount/entryLog.vue
new file mode 100644
index 0000000..588dfbb
--- /dev/null
+++ b/src/views/subAccount/entryLog.vue
@@ -0,0 +1,306 @@
+<template>
+  <div class="sub-account">
+    <div class="search">
+      <div class="left">
+        <div class="id">
+          鐢ㄦ埛鍚�/濮撳悕/鎵嬫満鍙�
+          <el-input v-model="inputText" placeholder="璇疯緭鍏�" clearable></el-input>
+        </div>
+      </div>
+
+      <div class="right">
+        <div class="button searchBtn" @click="lookUp">鎼滅储</div>
+      </div>
+    </div>
+    <div class="table-area">
+      <el-table
+        id="multipleTable"
+        ref="multipleTable"
+        :data="dataList"
+        :fit="true"
+        :default-sort="{ prop: 'createTime', order: 'descending' }"
+      >
+        <el-table-column type="index" label="搴忓彿" width="80" align="center"></el-table-column>
+        <el-table-column prop="username" label="鐢ㄦ埛鍚�" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="trueName" label="濮撳悕" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="phoneNum" label="鎵嬫満鍙�" show-overflow-tooltip></el-table-column>
+        <el-table-column label="鐧诲綍缁撴灉" width="100">
+          <template slot-scope="scope">
+            <div v-if="scope.row.success" class="status green ">鎴愬姛</div>
+            <div v-else class="status">澶辫触</div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="createTime" label="鐧诲綍鏃堕棿" show-overflow-tooltip></el-table-column>
+      </el-table>
+      <div>
+        <el-pagination
+          @current-change="refrash"
+          @size-change="handleSizeChange"
+          :current-page="page"
+          :page-size="size"
+          layout="total, sizes, prev, pager, next, jumper"
+          :page-sizes="[5, 10, 15, 20, 25]"
+          :total="total"
+          background
+        ></el-pagination>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { findEntryLog } from "@/api/user"
+
+export default {
+  data() {
+    return {
+      dataList: [],
+      inputText: "",
+      page: 1,
+      size: 10, //鍒嗛〉鐩稿叧
+      total: 0 //鎬绘暟,
+    }
+  },
+  async created() {
+    this.lookUp()
+  },
+  mounted() {},
+  methods: {
+    handleSizeChange(size) {
+      this.size = size
+      this.lookUp()
+    },
+    //鍒嗛〉鍔熻兘
+    refrash(page) {
+      this.page = page
+      this.lookUp()
+    },
+    reset() {
+      this.inputText = ""
+      this.timeLength = null
+    },
+    async lookUp() {
+      if (this.inputText.length) {
+        this.inputText = this.inputText.trim()
+      }
+
+      let res = await findEntryLog({ page: this.page, size: this.size, inputText: this.inputText })
+      this.dataList = res.data.list
+      this.total = res.data.total
+    }
+  }
+}
+</script>
+
+<style scoped lang="scss">
+.sub-account {
+  padding: 20px;
+  .searchBtn {
+    width: 50px;
+    height: 25px;
+    line-height: 25px;
+    font-size: 14px;
+    text-align: center;
+    color: #fff;
+    background: #0065ff;
+    margin-right: 20px;
+  }
+  .right {
+    display: flex;
+  }
+  .search {
+    display: flex;
+    font-size: 14px;
+    border-bottom: 1px solid #e9ebee;
+    margin-top: 30px;
+    padding-bottom: 20px;
+    .left,
+    .right,
+    .id,
+    .time,
+    .cluster {
+      display: flex;
+      align-items: center;
+      .el-select {
+        width: auto;
+      }
+    }
+
+    .id .el-input ::v-deep {
+      width: 200px;
+    }
+
+    .cluster::v-deep .el-input {
+      width: 300px;
+
+      margin-left: 10px;
+      margin-right: 20px;
+      .el-input__icon {
+        line-height: 32px;
+      }
+      input {
+        border-radius: 0;
+
+        &::-webkit-input-placeholder {
+          color: #999;
+        }
+
+        &:focus {
+          border-color: #0065ff;
+        }
+      }
+    }
+
+    .el-input ::v-deep {
+      width: 200px;
+      margin-left: 10px;
+      margin-right: 20px;
+      height: 32px;
+      line-height: 32px;
+      input {
+        border-radius: 0;
+        height: 32px;
+        line-height: 32px;
+        &::-webkit-input-placeholder {
+          color: #999;
+        }
+
+        &:focus {
+          border-color: #0065ff;
+        }
+      }
+    }
+
+    .el-date-editor {
+      width: 318px;
+      height: 40px;
+      margin-left: 10px;
+      margin-right: 20px;
+      border-radius: 0;
+
+      &::-webkit-input-placeholder {
+        color: #999;
+      }
+
+      &.is-active {
+        border-color: #0065ff;
+      }
+    }
+  }
+  .el-table ::v-deep {
+    background-color: rgb(233, 235, 238);
+    padding: 1px;
+
+    &::after {
+      display: none;
+    }
+
+    td.index .cell {
+      padding-left: 16px;
+      padding-right: 4px;
+    }
+
+    .has-gutter tr th {
+      background: #f0f3f5;
+      font-size: 16px;
+      color: #3d3d3d;
+      font-weight: 700;
+    }
+
+    td .cell {
+      color: #3d3d3d;
+    }
+
+    tr:hover > td.el-table__cell {
+      background-color: #fff;
+    }
+
+    .el-table__row--striped .el-table__cell {
+      background-color: #f0f5fa !important;
+    }
+    tr:hover > td.el-table__cell {
+      background-color: #fff;
+    }
+
+    .el-table__row--striped .el-table__cell {
+      background-color: #f0f5fa !important;
+    }
+
+    .status {
+      color: #ff4b33;
+
+      &.green {
+        color: #36b24a;
+      }
+    }
+
+    .option {
+      margin-right: 10px;
+      font-size: 14px;
+      color: rgb(0, 101, 255);
+      cursor: pointer;
+    }
+  }
+
+  .el-pagination ::v-deep {
+    margin-top: 30px;
+    text-align: center;
+    height: 24px;
+    .el-pagination__sizes {
+      margin-right: 0;
+    }
+
+    button {
+      margin: 0;
+      background-color: #fff;
+      border: 1px solid #c0c5cc;
+      border-radius: 2px;
+    }
+
+    .number {
+      background-color: #fff;
+
+      &:not(.disabled):hover {
+        color: #0065ff;
+      }
+
+      &:not(.disabled).active {
+        background-color: #0065ff;
+        color: #fff;
+      }
+    }
+
+    .el-input .el-input__inner {
+      padding-left: 0;
+
+      &:hover,
+      &:focus {
+        border-color: #0065ff;
+      }
+    }
+  }
+
+  .el-select ::v-deep {
+    .el-select__tags-text {
+      color: #3d3d3d;
+    }
+  }
+}
+</style>
+
+<style>
+.el-date-table td.start-date span,
+.el-date-table td.end-date span {
+  background-color: #0065ff;
+}
+
+.el-button--text span {
+  color: #0065ff;
+}
+
+.el-button.is-plain:hover,
+.el-button.is-plain:focus {
+  color: #0065ff;
+  border-color: #0065ff;
+}
+</style>
diff --git a/src/views/subAccount/index.vue b/src/views/subAccount/index.vue
index 66bf956..da3f27e 100644
--- a/src/views/subAccount/index.vue
+++ b/src/views/subAccount/index.vue
@@ -12,7 +12,18 @@
 
     <!-- 涓昏鍐呭 -->
     <div class="content">
-      <SubAccount></SubAccount>
+      <div style="padding: 20px;">
+        <el-tabs v-model="activeName" @tab-click="handleClick">
+          <el-tab-pane name="account">
+            <span slot="label"><i class="el-icon-s-home"></i> 瀛愯处鍙风鐞�</span>
+            <SubAccount></SubAccount>
+          </el-tab-pane>
+          <el-tab-pane name="point">
+            <span slot="label"><i class="el-icon-s-platform"></i> 鐧诲綍鏃ュ織</span>
+            <EntryLog></EntryLog>
+          </el-tab-pane>
+        </el-tabs>
+      </div>
     </div>
 
     <!-- 椤靛熬 -->
@@ -22,17 +33,28 @@
 
 <script>
 import IndexHeader from "@/components/IndexHeader"
-// import DevList from "@/views/report/components/DevList"
 import SubAccount from "@/views/personalCenter/components/SubAccount.vue"
-// import SettingBox from "@/views/report/components/SettingBox"
+import EntryLog from "./entryLog.vue"
+
 import Footer from "@/components/Footer"
 
 export default {
   components: {
     IndexHeader,
-    SubAccount
+    SubAccount,
+    EntryLog
     // SettingBox,
     // Footer
+  },
+  data() {
+    return {
+      activeName: "account"
+    }
+  },
+  methods: {
+    handleClick(tab, event) {
+      // console.log(tab, event, this.activeName)
+    }
   }
 }
 </script>

--
Gitblit v1.8.0