| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- <template>
- <el-tabs v-model="activeTabName" type="border-card">
- <el-tab-pane label="企业方" name="first">
- <div>
- <div class="content" v-if="comChatUsers && comChatUsers.list">
- <el-table :data="comChatUsers.list" border>
- <el-table-column :className="`clickable`" prop="username" label="企业名称" width="400">
- <template slot-scope="scope">
- <span @click="goCompany(scope.row)">{{scope.row.username}}</span>
- </template>
- </el-table-column>
- <el-table-column prop="lastChatTimeFormat" label="最近聊天" width="160"></el-table-column>
- <el-table-column prop="totalChatTime" label="总计聊天时长" width="160"></el-table-column>
- <el-table-column prop="totalChatUsers" label="总计聊天用户数" width="120"></el-table-column>
- <el-table-column prop="totalSendMessage" label="总计发送消息数" width="120"></el-table-column>
- </el-table>
- </div>
- <el-pagination
- class="order-footer"
- background
- layout="prev, pager, next"
- :page-size="20"
- :total="Number(comChatUsers.total)"
- @current-change="handleCurrentChangeCom"
- />
- </div>
- </el-tab-pane>
- <el-tab-pane label="开发者" name="second">
- <div>
- <div class="content" v-if="devChatUsers && devChatUsers.list">
- <el-table :data="devChatUsers.list" border>
- <el-table-column :className="`clickable`" prop="username" label="开发者名称" width="400">
- <template slot-scope="scope">
- <span @click="goRooterUser(scope.row)">{{scope.row.username}}</span>
- </template>
- </el-table-column>
- <el-table-column prop="lastChatTimeFormat" label="最近聊天" width="160"></el-table-column>
- <el-table-column prop="totalChatTime" label="总计聊天时长" width="160"></el-table-column>
- <el-table-column prop="totalChatUsers" label="总计聊天用户数" width="120"></el-table-column>
- <el-table-column prop="totalSendMessage" label="总计发送消息数" width="120"></el-table-column>
- </el-table>
- </div>
- <el-pagination
- class="order-footer"
- background
- layout="prev, pager, next"
- :page-size="20"
- :total="Number(devChatUsers.total)"
- @current-change="handleCurrentChangeDev"
- />
- </div>
- </el-tab-pane>
- </el-tabs>
- </template>
- <script>
- export default {
- data() {
- return {
- activeTabName: "first",
- pageDev: 1,
- pageCom: 1,
- devChatUsers: "",
- comChatUsers: ""
- };
- },
- mounted() {
- this.getDevChatUsers();
- this.getComChatUsers();
- },
- methods: {
- async getDevChatUsers() {
- const page = this.pageDev;
- const homePageType = 2;
- const data = {
- page,
- homePageType
- };
- let res = await this.$post("/api/admin/chat/chatUsers", data);
- if (res && res.status === 1) {
- this.devChatUsers = res.data;
- console.log(this.devChatUsers);
- }
- },
- async getComChatUsers() {
- const page = this.pageCom;
- const homePageType = 1;
- const data = {
- page,
- homePageType
- };
- let res = await this.$post("/api/admin/chat/chatUsers", data);
- if (res && res.status === 1) {
- this.comChatUsers = res.data;
- console.log(this.comChatUsers);
- }
- },
- handleCurrentChangeCom(val) {
- this.pageCom = val;
- this.getComChatUsers();
- },
- handleCurrentChangeDev(val) {
- this.pageDev = val;
- this.getDevChatUsers();
- },
- goCompany(row) {
- window.open(
- this.$store.state.domainConfig.siteUrl + `/company/${row.uid}`
- );
- },
- goRooterUser() {
- window.open(
- this.$store.state.domainConfig.siteUrl + `/rooter/user/${row.uid}`
- );
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .count-list {
- padding-bottom: 10px;
- display: flex;
- align-items: center;
- }
- .count-item {
- margin-right: 20px;
- font-size: 16px;
- }
- .content {
- white-space: nowrap;
- overflow-x: hidden;
- }
- .btn {
- width: 80px;
- }
- .order-footer {
- margin-top: 10px;
- }
- .clickable {
- cursor: pointer;
- color: #409eff;
- }
- </style>
|