调整企业管理

This commit is contained in:
aixianling
2022-03-14 12:07:48 +08:00
parent 66fad244d9
commit f2508c5823
3 changed files with 337 additions and 287 deletions

View File

@@ -0,0 +1,35 @@
<template>
<section class="AppCompany">
<component :is="currentComponent" :instance="instance" :dict="dict" :permissions="permissions"/>
</section>
</template>
<script>
import List from "./components/List";
import Sta from "./components/Statistics";
export default {
name: "AppCompany",
label: "企业管理",
components: {List, Sta},
props: {
instance: Function,
dict: Object,
permissions: Function
},
computed: {
currentComponent() {
return this.$route.hash == "#sta" ? Sta : List
}
},
created() {
}
}
</script>
<style lang="scss" scoped>
.AppCompany {
height: 100%;
}
</style>

View File

@@ -54,7 +54,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item required label="地区" prop="areaId" :rules="[{required: true, message: '请选择发布地区'}]"> <el-form-item required label="地区" prop="areaId" :rules="[{required: true, message: '请选择发布地区'}]">
<ai-area-get :instance="instance" v-model="dialogForm.areaId" :name.sync="dialogForm.areaName" /> <ai-area-get :instance="instance" v-model="dialogForm.areaId" :name.sync="dialogForm.areaName"/>
</el-form-item> </el-form-item>
<el-form-item required label="企业CORP_ID" prop="corpId" :rules="[{required: true, message: '请输入企业CORP_ID'}]"> <el-form-item required label="企业CORP_ID" prop="corpId" :rules="[{required: true, message: '请输入企业CORP_ID'}]">
<el-input v-model.trim="dialogForm.corpId" placeholder="请输入企业CORP_ID" clearable :maxLength="50"/> <el-input v-model.trim="dialogForm.corpId" placeholder="请输入企业CORP_ID" clearable :maxLength="50"/>
@@ -66,7 +66,8 @@
<el-input v-model.trim="dialogForm.corpSecret" placeholder="请输入企业CORP_SECRET" clearable :maxLength="50"/> <el-input v-model.trim="dialogForm.corpSecret" placeholder="请输入企业CORP_SECRET" clearable :maxLength="50"/>
</el-form-item> </el-form-item>
<el-form-item label="企业通讯录SECRET" prop="corpAddressBookSecret"> <el-form-item label="企业通讯录SECRET" prop="corpAddressBookSecret">
<el-input v-model.trim="dialogForm.corpAddressBookSecret" placeholder="请输入企业通讯录SECRET" clearable :maxLength="50"/> <el-input v-model.trim="dialogForm.corpAddressBookSecret" placeholder="请输入企业通讯录SECRET" clearable
:maxLength="50"/>
</el-form-item> </el-form-item>
<el-form-item label="访问地址" prop="accessUrl" :rules="[{required: true, message: '请输入访问地址'}]"> <el-form-item label="访问地址" prop="accessUrl" :rules="[{required: true, message: '请输入访问地址'}]">
<el-input v-model.trim="dialogForm.accessUrl" placeholder="请输入访问地址" clearable <el-input v-model.trim="dialogForm.accessUrl" placeholder="请输入访问地址" clearable
@@ -156,7 +157,7 @@ export default {
this.$refs.saasForm.validate(v => { this.$refs.saasForm.validate(v => {
if (v) { if (v) {
this.saasList.map(item => { this.saasList.map(item => {
if(item.id == this.dialogForm.saasId) { if (item.id == this.dialogForm.saasId) {
this.dialogForm.saasName = item.name this.dialogForm.saasName = item.name
} }
}) })
@@ -190,7 +191,7 @@ export default {
}, },
handleSync(corpId) { handleSync(corpId) {
this.$confirm("是否确定同步该企业数据?").then(() => { this.$confirm("是否确定同步该企业数据?").then(() => {
this.instance.post("/appCorpStat/syncData?corpId="+corpId, null, {}).then(res => { this.instance.post("/appCorpStat/syncData?corpId=" + corpId, null, {}).then(res => {
if (res?.code == 0) { if (res?.code == 0) {
this.getTableData(); this.getTableData();
this.$message.success("同步成功!"); this.$message.success("同步成功!");
@@ -202,10 +203,8 @@ export default {
window.open(accessUrl, "_blank"); window.open(accessUrl, "_blank");
}, },
toStatistics(item) { toStatistics(item) {
this.$emit('change', { let {corpId} = item
type: 'Statistics', this.$router.push({query: {corpId}, hash: "#sta"})
params: item
})
}, },
}, },
created() { created() {

View File

@@ -10,23 +10,23 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="5"> <el-col :span="5">
<div class="title">群总数</div> <div class="title">群总数</div>
<div class="num">{{info.groupCount}}</div> <div class="num">{{ info.groupCount }}</div>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<div class="title">成员总数</div> <div class="title">成员总数</div>
<div class="num">{{info.userCount}}</div> <div class="num">{{ info.userCount }}</div>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<div class="title">成员活跃总数</div> <div class="title">成员活跃总数</div>
<div class="num">{{info.activeCount}}</div> <div class="num">{{ info.activeCount }}</div>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<div class="title">居民总人数</div> <div class="title">居民总人数</div>
<div class="num">{{info.residentCount}}</div> <div class="num">{{ info.residentCount }}</div>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<div class="title">群成员总数</div> <div class="title">群成员总数</div>
<div class="num">{{info.groupuserCount}}</div> <div class="num">{{ info.groupuserCount }}</div>
</el-col> </el-col>
</el-row> </el-row>
</template> </template>
@@ -34,7 +34,9 @@
<ai-card title="统计信息" class="chart-content"> <ai-card title="统计信息" class="chart-content">
<template #title> <template #title>
<div class="tabs"> <div class="tabs">
<div class="item" v-for="(item, index) in tabs" :key="index" :class="index == activeIndex ? 'active' : ''" @click="tabClick(index)">{{item}}</div> <div class="item" v-for="(item, index) in tabs" :key="index" :class="index == activeIndex ? 'active' : ''"
@click="tabClick(index)">{{ item }}
</div>
</div> </div>
</template> </template>
<template #content> <template #content>
@@ -61,7 +63,8 @@
icon="el-icon-refresh-right" icon="el-icon-refresh-right"
size="small" size="small"
@click="resetSearch" @click="resetSearch"
>重置</el-button >重置
</el-button
> >
</template> </template>
</ai-search-bar> </ai-search-bar>
@@ -75,7 +78,8 @@
</ai-table> </ai-table>
</div> </div>
<div class="table" v-else-if="activeIndex == 3"> <div class="table" v-else-if="activeIndex == 3">
<ai-table :tableData="userList" :total="userPage.total" :current.sync="userPage.current" :size.sync="userPage.size" <ai-table :tableData="userList" :total="userPage.total" :current.sync="userPage.current"
:size.sync="userPage.size"
@getList="getUserTableData" :col-configs="userColConfigs" :dict="dict"> @getList="getUserTableData" :col-configs="userColConfigs" :dict="dict">
<!-- <el-table-column slot="options" align="center" label="操作" fixed="right" width="240px"> <!-- <el-table-column slot="options" align="center" label="操作" fixed="right" width="240px">
<div class="table-options" slot-scope="{ row }"> <div class="table-options" slot-scope="{ row }">
@@ -91,18 +95,18 @@
</template> </template>
<script> <script>
import * as echarts from 'echarts' import * as echarts from 'echarts'
export default {
export default {
name: 'Statistics', name: 'Statistics',
props: { props: {
instance: Function, instance: Function,
dict: Object, dict: Object,
permissions: Function, permissions: Function,
params: Object
}, },
data () { data() {
return { return {
info: {}, info: {},
activeIndex: 0, activeIndex: 0,
@@ -120,10 +124,10 @@
computed: { computed: {
colConfigs() { colConfigs() {
return [ return [
{label: "群名", prop: "name", width:200}, {label: "群名", prop: "name", width: 200},
{label: "创建时间", prop: "createTime", align: 'center', width:150}, {label: "创建时间", prop: "createTime", align: 'center', width: 150},
{label: "群成员数", prop: "memberCount", align: 'center', width:100}, {label: "群成员数", prop: "memberCount", align: 'center', width: 100},
{label: "群主ID", prop: "owner", align: 'center', width:150}, {label: "群主ID", prop: "owner", align: 'center', width: 150},
{label: "群公告", prop: "notice"}, {label: "群公告", prop: "notice"},
] ]
}, },
@@ -133,19 +137,24 @@
{label: "姓名", prop: "name", align: 'center'}, {label: "姓名", prop: "name", align: 'center'},
{label: "添加好友人数", prop: "residentCount", align: 'center'} {label: "添加好友人数", prop: "residentCount", align: 'center'}
] ]
},
params() {
return this.$route.query || {}
} }
}, },
mounted() { created() {
this.getInfo()
this.getTableData() this.getTableData()
this.getUserTableData() this.getUserTableData()
}, },
mounted() {
this.getInfo()
},
methods: { methods: {
chartInit() { chartInit() {
var option = {} var option = {}
if(this.activeIndex != 1) { if (this.activeIndex != 1) {
option = { option = {
tooltip: { tooltip: {
trigger: 'axis' trigger: 'axis'
@@ -194,7 +203,7 @@
}, },
] ]
}; };
}else { } else {
option = { option = {
tooltip: { tooltip: {
trigger: 'item' trigger: 'item'
@@ -233,7 +242,7 @@
getCharInfo() { getCharInfo() {
this.instance.post(`/appCorpStat/getLatestThreeMonthStat?corpId=${this.params.corpId}`).then(res => { this.instance.post(`/appCorpStat/getLatestThreeMonthStat?corpId=${this.params.corpId}`).then(res => {
if (res.code === 0) { if (res.code === 0) {
if(res.data && res.data.length) { if (res.data && res.data.length) {
this.listData = [] this.listData = []
this.listData[0] = res.data.map(v => v.groupCount) this.listData[0] = res.data.map(v => v.groupCount)
this.listData[1] = res.data.map(v => v.userCount) this.listData[1] = res.data.map(v => v.userCount)
@@ -248,7 +257,7 @@
this.instance.post(`/wxcp/wxgroup/groupStatistic?corpId=${this.params.corpId}`).then(res => { this.instance.post(`/wxcp/wxgroup/groupStatistic?corpId=${this.params.corpId}`).then(res => {
if (res.code === 0) { if (res.code === 0) {
if(res.data) { if (res.data) {
this.pieData = [] this.pieData = []
Object.getOwnPropertyNames(res.data).forEach((key) => { Object.getOwnPropertyNames(res.data).forEach((key) => {
var e = { var e = {
@@ -270,7 +279,7 @@
getTableData() { getTableData() {
this.instance.post(`/wxcp/wxgroup/list?corpId=${this.params.corpId}&current=${this.page.current}&size=${this.page.size}&innerMemberId=${this.innerMemberId}`,).then(res => { this.instance.post(`/wxcp/wxgroup/list?corpId=${this.params.corpId}&current=${this.page.current}&size=${this.page.size}&innerMemberId=${this.innerMemberId}`,).then(res => {
if (res.code === 0) { if (res.code === 0) {
if(res.data) { if (res.data) {
this.gropList = res.data.records this.gropList = res.data.records
this.page.total = res.data.total this.page.total = res.data.total
} }
@@ -280,22 +289,20 @@
getUserTableData() { getUserTableData() {
this.instance.post(`/wxcp/wxuser/userStat?corpId=${this.params.corpId}&current=${this.userPage.current}&size=${this.userPage.size}&mainDepartment=1`,).then(res => { this.instance.post(`/wxcp/wxuser/userStat?corpId=${this.params.corpId}&current=${this.userPage.current}&size=${this.userPage.size}&mainDepartment=1`,).then(res => {
if (res.code === 0) { if (res.code === 0) {
if(res.data) { if (res.data) {
this.userList = res.data.records this.userList = res.data.records
this.userPage.total = res.data.total this.userPage.total = res.data.total
} }
} }
}) })
}, },
onBack () { onBack() {
this.$emit('change', { this.$router.push({})
type: 'list'
})
}, },
tabClick(index) { tabClick(index) {
this.activeIndex = index this.activeIndex = index
this.myChart.dispose() this.myChart.dispose()
if(index != 2 && index != 3) { if (index != 2 && index != 3) {
this.$nextTick(() => { this.$nextTick(() => {
this.myChart = echarts.init(document.getElementById("echart")); this.myChart = echarts.init(document.getElementById("echart"));
this.chartInit() this.chartInit()
@@ -303,62 +310,71 @@
} }
} }
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.cover { .cover {
display: block; display: block;
width: 300px; width: 300px;
height: 140px; height: 140px;
margin: 20px auto; margin: 20px auto;
} }
.subTitle { .subTitle {
text-align: center; text-align: center;
font-size: 12px; font-size: 12px;
font-weight: normal; font-weight: normal;
} }
.title{
.title {
line-height: 60px; line-height: 60px;
font-size: 18px; font-size: 18px;
text-align: center; text-align: center;
color: #666; color: #666;
} }
.num{
.num {
font-size: 32px; font-size: 32px;
font-weight: 700; font-weight: 700;
text-align: center; text-align: center;
padding-bottom: 20px; padding-bottom: 20px;
} }
.tabs{
.item{ .tabs {
.item {
display: inline-block; display: inline-block;
padding: 0 20px; padding: 0 20px;
line-height: 54px; line-height: 54px;
cursor: pointer; cursor: pointer;
} }
.active{
.active {
color: #26f; color: #26f;
border-bottom: 2px solid #26f; border-bottom: 2px solid #26f;
} }
} }
.chart-content{
.chart-content {
height: calc(100% - 240px); height: calc(100% - 240px);
::v-deep .ai-card__body{
::v-deep .ai-card__body {
height: calc(100% - 70px); height: calc(100% - 70px);
} }
.echart{
.echart {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.table{
.table {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow-y: scroll; overflow-y: scroll;
} }
} }
::v-deep .ai-detail__content--wrapper{
::v-deep .ai-detail__content--wrapper {
height: 100%; height: 100%;
} }
</style> </style>