|
@@ -2,33 +2,46 @@
|
|
<div class="page-container main-view">
|
|
<div class="page-container main-view">
|
|
|
|
|
|
<el-row :gutter="10" class="page-query-box" v-if="result_tabel.value">
|
|
<el-row :gutter="10" class="page-query-box" v-if="result_tabel.value">
|
|
|
|
+ <el-col>
|
|
|
|
+ 统计截止时间为: {{currentDate }}
|
|
|
|
+ <el-date-picker
|
|
|
|
+ v-model="selected_date"
|
|
|
|
+ type="date"
|
|
|
|
+ placeholder="年-月-日"
|
|
|
|
+ :disabled-date="disabledDate"
|
|
|
|
+ :size="size"
|
|
|
|
+ :calendar-change="changeResultTable()"
|
|
|
|
+ :clear="clearResultTable()"
|
|
|
|
+ />
|
|
|
|
+ </el-col>
|
|
|
|
+
|
|
<el-col :span="6" :xs="6">
|
|
<el-col :span="6" :xs="6">
|
|
- <el-statistic title="客户表去水ID个数" :value="result_tabel.value.customer_num" />
|
|
|
|
|
|
+ <el-statistic group-separator="" title="客户表去水ID个数" :value="result_tabel.value.customer_num" />
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6" :xs="6">
|
|
<el-col :span="6" :xs="6">
|
|
- <el-statistic title="累计社群人数" :value="result_tabel.value.community_num" />
|
|
|
|
|
|
+ <el-statistic group-separator="" title="累计社群人数" :value="result_tabel.value.community_num" />
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6" :xs="6">
|
|
<el-col :span="6" :xs="6">
|
|
- <el-statistic title="已退群的ID个数" :value="result_tabel.value.withdrawed_num" />
|
|
|
|
|
|
+ <el-statistic group-separator="" title="已退群的ID个数" :value="result_tabel.value.withdrawed_num" />
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6" :xs="6">
|
|
<el-col :span="6" :xs="6">
|
|
- <el-statistic title="目前社群内人数" :value="result_tabel.value.in_community_num" />
|
|
|
|
|
|
+ <el-statistic group-separator="" title="目前社群内人数" :value="result_tabel.value.in_community_num" />
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="6" :xs="6">
|
|
<el-col :span="6" :xs="6">
|
|
- <el-statistic title="重复在群的ID的数量" :value="result_tabel.value.in_many_group_num" />
|
|
|
|
|
|
+ <el-statistic group-separator="" title="重复在群的ID的数量" :value="result_tabel.value.in_many_group_num" />
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6" :xs="6">
|
|
<el-col :span="6" :xs="6">
|
|
- <el-statistic title="今日新增客户人数" :value="result_tabel.value.number_of_new_customers_added_today" />
|
|
|
|
|
|
+ <el-statistic group-separator="" title="今日新增客户人数" :value="result_tabel.value.number_of_new_customers_added_today" />
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6" :xs="6">
|
|
<el-col :span="6" :xs="6">
|
|
- <el-statistic title="7日内新增客户人数" :value="result_tabel.value.number_of_new_customers_added_within_7_days" />
|
|
|
|
|
|
+ <el-statistic group-separator="" title="7日内新增客户人数" :value="result_tabel.value.number_of_new_customers_added_within_7_days" />
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6" :xs="6">
|
|
<el-col :span="6" :xs="6">
|
|
- <el-statistic title="30日内新增客户人数" :value="result_tabel.value.number_of_new_customers_added_within_30_days" />
|
|
|
|
|
|
+ <el-statistic group-separator="" title="30日内新增客户人数" :value="result_tabel.value.number_of_new_customers_added_within_30_days" />
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
-
|
|
|
|
|
|
+
|
|
<el-row :gutter="0" class="page-query-box">
|
|
<el-row :gutter="0" class="page-query-box">
|
|
<DifinCollapse
|
|
<DifinCollapse
|
|
:show="dataContainer.showSearch"
|
|
:show="dataContainer.showSearch"
|
|
@@ -144,7 +157,7 @@
|
|
|
|
|
|
<el-button plain type="primary" @click="downloadJoinGuoptTable">
|
|
<el-button plain type="primary" @click="downloadJoinGuoptTable">
|
|
<SvgIcon :style="'width:23px;height:23px;'" name="svg:download.svg"></SvgIcon>
|
|
<SvgIcon :style="'width:23px;height:23px;'" name="svg:download.svg"></SvgIcon>
|
|
- 加入群表
|
|
|
|
|
|
+ 入群表
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
|
<el-button plain type="primary" @click="downloadDeleteFriendTable">
|
|
<el-button plain type="primary" @click="downloadDeleteFriendTable">
|
|
@@ -152,11 +165,26 @@
|
|
删除朋友表
|
|
删除朋友表
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
|
- <el-button plain type="primary" @click="downloadDeleteFriendTable">
|
|
|
|
|
|
+ <el-button plain type="primary" @click="downloadGroupUserTable">
|
|
<SvgIcon :style="'width:23px;height:23px;'" name="svg:download.svg"></SvgIcon>
|
|
<SvgIcon :style="'width:23px;height:23px;'" name="svg:download.svg"></SvgIcon>
|
|
- 删除朋友表
|
|
|
|
|
|
+ 用户表
|
|
</el-button>
|
|
</el-button>
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ <el-button plain type="primary" @click="downloadResultTable">
|
|
|
|
+ <SvgIcon :style="'width:23px;height:23px;'" name="svg:download.svg"></SvgIcon>
|
|
|
|
+ 结论表
|
|
|
|
+ </el-button>
|
|
|
|
+
|
|
|
|
+ <el-button plain type="primary" @click="downloadTrollsTable">
|
|
|
|
+ <SvgIcon :style="'width:23px;height:23px;'" name="svg:download.svg"></SvgIcon>
|
|
|
|
+ 水军表
|
|
|
|
+ </el-button>
|
|
|
|
+
|
|
|
|
+ <el-button plain type="primary" @click="downloadWithdrawalGroupTable">
|
|
|
|
+ <SvgIcon :style="'width:23px;height:23px;'" name="svg:download.svg"></SvgIcon>
|
|
|
|
+ 退群表
|
|
|
|
+ </el-button>
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
<div class="table-container">
|
|
<div class="table-container">
|
|
<el-table :data="tableData" stripe style="width: 100%" border fit v-loading="loading">
|
|
<el-table :data="tableData" stripe style="width: 100%" border fit v-loading="loading">
|
|
@@ -169,53 +197,6 @@
|
|
<el-table-column prop="status" width="100" label="客户状态" />
|
|
<el-table-column prop="status" width="100" label="客户状态" />
|
|
<el-table-column prop="createTime" width="180" label="创建时间" />
|
|
<el-table-column prop="createTime" width="180" label="创建时间" />
|
|
<el-table-column prop="updateTime" width="180" label="更新时间" />
|
|
<el-table-column prop="updateTime" width="180" label="更新时间" />
|
|
- <el-table-column label="操作" width = "230">
|
|
|
|
- <template #default="scope">
|
|
|
|
- <el-button
|
|
|
|
- :text="true"
|
|
|
|
- type="primary"
|
|
|
|
- @click="
|
|
|
|
- handleEdit(scope.row, {
|
|
|
|
- isShow: false,
|
|
|
|
- afterTitle: ' - 编辑',
|
|
|
|
- })
|
|
|
|
- "
|
|
|
|
- >
|
|
|
|
- 编辑
|
|
|
|
- </el-button>
|
|
|
|
- <el-button
|
|
|
|
- :text="true"
|
|
|
|
- type="success"
|
|
|
|
- @click="
|
|
|
|
- handleEdit(scope.row, {
|
|
|
|
- isShow: false,
|
|
|
|
- afterTitle: ' - 编辑',
|
|
|
|
- })
|
|
|
|
- "
|
|
|
|
- >
|
|
|
|
- 增加积分
|
|
|
|
- </el-button>
|
|
|
|
- <el-button
|
|
|
|
- :text="true"
|
|
|
|
- type="danger"
|
|
|
|
- @click="
|
|
|
|
- handleEdit(scope.row, {
|
|
|
|
- isShow: false,
|
|
|
|
- afterTitle: ' - 编辑',
|
|
|
|
- })
|
|
|
|
- "
|
|
|
|
- >
|
|
|
|
- 扣减积分
|
|
|
|
- </el-button>
|
|
|
|
- <el-button
|
|
|
|
- :text="true"
|
|
|
|
- type="danger"
|
|
|
|
- @click="handleDetails([scope.row])"
|
|
|
|
- >
|
|
|
|
- 禁用
|
|
|
|
- </el-button>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
</el-table>
|
|
</el-table>
|
|
</div>
|
|
</div>
|
|
<div class="pagination-container">
|
|
<div class="pagination-container">
|
|
@@ -245,25 +226,34 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
<script setup>
|
|
<script setup>
|
|
import {
|
|
import {
|
|
defineComponent,
|
|
defineComponent,
|
|
onBeforeUnmount,
|
|
onBeforeUnmount,
|
|
ref,
|
|
ref,
|
|
reactive,
|
|
reactive,
|
|
|
|
+ nextTick ,
|
|
|
|
+ onMounted,
|
|
getCurrentInstance,
|
|
getCurrentInstance,
|
|
onActivated,
|
|
onActivated,
|
|
} from 'vue';
|
|
} from 'vue';
|
|
- // import axios from 'axios';
|
|
|
|
- import { useRouter } from 'vue-router';
|
|
|
|
|
|
+ import { useRouter } from 'vue-router';
|
|
import { debounceFn } from '@/common/debounceAndThrottle';
|
|
import { debounceFn } from '@/common/debounceAndThrottle';
|
|
- import { messageSuccess } from '@/action/messagePrompt.js';
|
|
|
|
|
|
+ import { messageSuccess,messageError} from '@/action/messagePrompt.js';
|
|
import { saveAs } from 'file-saver';
|
|
import { saveAs } from 'file-saver';
|
|
import {service} from '@/http/request.js'
|
|
import {service} from '@/http/request.js'
|
|
const size = ref('default')
|
|
const size = ref('default')
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
const result_tabel = reactive({})//获取结论表
|
|
const result_tabel = reactive({})//获取结论表
|
|
|
|
+ const selected_date = ref('') //这个日期用来控制结论表数据看板的展示当前选中的日期进行展示
|
|
|
|
+ const formattedDate = ref('');
|
|
|
|
+ let currentDate = ref('')
|
|
|
|
+ let isFromDatePicker = false;
|
|
const dataContainer = reactive({
|
|
const dataContainer = reactive({
|
|
loading: false,
|
|
loading: false,
|
|
showSearch: true,
|
|
showSearch: true,
|
|
@@ -335,6 +325,11 @@
|
|
const config= reactive({
|
|
const config= reactive({
|
|
total: 38,
|
|
total: 38,
|
|
})
|
|
})
|
|
|
|
+
|
|
|
|
+//只能选择当天以前的日期
|
|
|
|
+const disabledDate = (time) => {
|
|
|
|
+ return time.getTime() > Date.now()
|
|
|
|
+}
|
|
|
|
|
|
/** 获取数据列表 */
|
|
/** 获取数据列表 */
|
|
const getDataList = debounceFn(function () {
|
|
const getDataList = debounceFn(function () {
|
|
@@ -356,17 +351,37 @@
|
|
}, 70);
|
|
}, 70);
|
|
getDataList();
|
|
getDataList();
|
|
|
|
|
|
- //获取结论表数据
|
|
|
|
- const getDataResultTabe = ()=>{
|
|
|
|
- service("/data/info").then((res)=>{
|
|
|
|
|
|
+ const setCurrentDate = ()=> {
|
|
|
|
+ const now = new Date();
|
|
|
|
+ const year = now.getFullYear();
|
|
|
|
+ const month = (now.getMonth() + 1).toString().padStart(2, '0');
|
|
|
|
+ const day = now.getDate().toString().padStart(2, '0');
|
|
|
|
+ currentDate.value = `${year}年${month}月${day}日23:59:59`;
|
|
|
|
+ }
|
|
|
|
+ setCurrentDate();
|
|
|
|
+
|
|
|
|
+ //默认获取当天结论表数据
|
|
|
|
+ const getDataResultTabe = ()=>{
|
|
|
|
+ if (!isFromDatePicker) { // 根据标识变量判断是否执行
|
|
|
|
+ let now = new Date();
|
|
|
|
+ let month = (now.getMonth() + 1).toString().padStart(2, '0');
|
|
|
|
+ let day = now.getDate().toString().padStart(2, '0');
|
|
|
|
+ let formattedDate = `${month}${day}`;
|
|
|
|
+ service("/data/result_info",{
|
|
|
|
+ params:{
|
|
|
|
+ date:formattedDate
|
|
|
|
+ }
|
|
|
|
+ }).then((res)=>{
|
|
|
|
|
|
const dataObj = res[0];
|
|
const dataObj = res[0];
|
|
result_tabel.value = convertToNumber(dataObj)
|
|
result_tabel.value = convertToNumber(dataObj)
|
|
|
|
|
|
console.log(result_tabel);
|
|
console.log(result_tabel);
|
|
})
|
|
})
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- getDataResultTabe();
|
|
|
|
|
|
+ getDataResultTabe();
|
|
|
|
+
|
|
|
|
|
|
// 定义一个函数用于递归地将对象中的数字字符串转为数字类型
|
|
// 定义一个函数用于递归地将对象中的数字字符串转为数字类型
|
|
const convertToNumber = (obj) => {
|
|
const convertToNumber = (obj) => {
|
|
@@ -382,7 +397,43 @@
|
|
typeof value === 'string' && /^\d+$/.test(value)? Number(value) : convertToNumber(value)
|
|
typeof value === 'string' && /^\d+$/.test(value)? Number(value) : convertToNumber(value)
|
|
])
|
|
])
|
|
);
|
|
);
|
|
- };
|
|
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ //选择日期展示当天的结论表看板数据
|
|
|
|
+ function changeResultTable () {
|
|
|
|
+
|
|
|
|
+ if(selected_date.value === null)return
|
|
|
|
+ if(typeof selected_date.value === "string")return
|
|
|
|
+ console.log("changeResultTable方法被调用了");
|
|
|
|
+ isFromDatePicker = true; // 在日期组件触发时设置为true
|
|
|
|
+ if(typeof selected_date.value === "object"){
|
|
|
|
+ const dateObj = selected_date.value;
|
|
|
|
+ const month = (dateObj.getMonth() + 1).toString().padStart(2, '0');
|
|
|
|
+ const day = dateObj.getDate().toString().padStart(2, '0');
|
|
|
|
+ formattedDate.value = `${month}${day}`;
|
|
|
|
+ }
|
|
|
|
+ console.log( formattedDate.value);
|
|
|
|
+ service('/data/result_info',{
|
|
|
|
+ params:{
|
|
|
|
+ date:formattedDate.value
|
|
|
|
+ }
|
|
|
|
+ }).then((res)=>{
|
|
|
|
+ const dataObj = res[0];
|
|
|
|
+ result_tabel.value = convertToNumber(dataObj)
|
|
|
|
+ console.log(result_tabel);
|
|
|
|
+ isFromDatePicker = false; // 请求完成后重置为false
|
|
|
|
+ }).catch((err)=>{
|
|
|
|
+ if(err){
|
|
|
|
+ messageError("没有数据,请选着其他日期")
|
|
|
|
+ isFromDatePicker = false;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //清除日期后回复当天的结论表数据看板信息
|
|
|
|
+ function clearResultTable(){
|
|
|
|
+ getDataResultTabe();
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
//下载入群表格excel
|
|
//下载入群表格excel
|
|
@@ -413,6 +464,57 @@
|
|
console.error('下载文件出错:', error);
|
|
console.error('下载文件出错:', error);
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ //下载群用户表格excel
|
|
|
|
+ function downloadGroupUserTable(){
|
|
|
|
+ service("/data/group_user",{
|
|
|
|
+ responseType: 'arraybuffer' // 设置响应类型为arraybuffer,用于接收二进制数据
|
|
|
|
+ }).then((res)=>{
|
|
|
|
+ const blob = new Blob([res], {type:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});
|
|
|
|
+ saveAs(blob, '用户表格.xlsx'); // 使用file-saver保存文件
|
|
|
|
+ messageSuccess('导出成功!');
|
|
|
|
+ }).catch((error)=>{
|
|
|
|
+ console.error('下载文件出错:', error);
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ //下载结论表格excel
|
|
|
|
+ function downloadResultTable(){
|
|
|
|
+ service("/data/result",{
|
|
|
|
+ responseType: 'arraybuffer' // 设置响应类型为arraybuffer,用于接收二进制数据
|
|
|
|
+ }).then((res)=>{
|
|
|
|
+ const blob = new Blob([res], {type:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});
|
|
|
|
+ saveAs(blob, '结论表格.xlsx'); // 使用file-saver保存文件
|
|
|
|
+ messageSuccess('导出成功!');
|
|
|
|
+ }).catch((error)=>{
|
|
|
|
+ console.error('下载文件出错:', error);
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //下载水军表格excel
|
|
|
|
+ function downloadTrollsTable(){
|
|
|
|
+ service("/data/trolls",{
|
|
|
|
+ responseType: 'arraybuffer' // 设置响应类型为arraybuffer,用于接收二进制数据
|
|
|
|
+ }).then((res)=>{
|
|
|
|
+ const blob = new Blob([res], {type:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});
|
|
|
|
+ saveAs(blob, '水军表格.xlsx'); // 使用file-saver保存文件
|
|
|
|
+ messageSuccess('导出成功!');
|
|
|
|
+ }).catch((error)=>{
|
|
|
|
+ console.error('下载文件出错:', error);
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //下载退群表格excel
|
|
|
|
+ function downloadWithdrawalGroupTable(){
|
|
|
|
+ service("/data/withdrawal",{
|
|
|
|
+ responseType: 'arraybuffer' // 设置响应类型为arraybuffer,用于接收二进制数据
|
|
|
|
+ }).then((res)=>{
|
|
|
|
+ const blob = new Blob([res], {type:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});
|
|
|
|
+ saveAs(blob, '退群表格.xlsx'); // 使用file-saver保存文件
|
|
|
|
+ messageSuccess('导出成功!');
|
|
|
|
+ }).catch((error)=>{
|
|
|
|
+ console.error('下载文件出错:', error);
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
const handleEdit = (rows,list)=>{
|
|
const handleEdit = (rows,list)=>{
|
|
let {username,contact,weibanId, city} = rows
|
|
let {username,contact,weibanId, city} = rows
|
|
@@ -434,6 +536,8 @@
|
|
dataContainer.form = {};
|
|
dataContainer.form = {};
|
|
handleQuery();
|
|
handleQuery();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang='scss'>
|
|
<style scoped lang='scss'>
|