|
|
@@ -1,8 +1,7 @@
|
|
|
<template>
|
|
|
<div class="layout-container">
|
|
|
<!-- 菜单栏 -->
|
|
|
- <From :form-items="dynamicFormItems" @formSubmitted="handleFormSubmitted" @formReset="handleFormReset"
|
|
|
- @formChangeSelect="handleFormChange" />
|
|
|
+ <From :form-items="dynamicFormItems" @formSubmitted="handleFormSubmitted" @formReset="handleFormReset" />
|
|
|
|
|
|
<div class="btn">
|
|
|
<el-button type="" v-if="formSearch.appIds && selectData.length > 0" @click="clearSelection">取消全选</el-button>
|
|
|
@@ -45,8 +44,8 @@
|
|
|
<el-table-column prop="totalVideo" label="视频播放总数" width="110" />
|
|
|
<el-table-column prop="totalIncome" label="用户贡献(当日/总共)" sortable width="200">
|
|
|
<template #default="scope">
|
|
|
- {{ roundPrice(scope.row.todayIncome === 0 ? '0.00' : scope.row.todayIncome ?? '0.00') }} /
|
|
|
- {{ roundPrice(scope.row.totalIncome === 0 ? '0.00' : scope.row.totalIncome ?? '0.00') }}
|
|
|
+ {{ roundPrice(scope.row.todayIncome === 0 ? '0.000' : scope.row.todayIncome ?? '0.000', 3) }} /
|
|
|
+ {{ roundPrice(scope.row.totalIncome === 0 ? '0.000' : scope.row.totalIncome ?? '0.000', 3) }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="communicationOperator" label="通信运营商" width="130" />
|
|
|
@@ -152,7 +151,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { onBeforeMount, ref, reactive, nextTick, watch } from "vue";
|
|
|
+import { onBeforeMount, ref, reactive, nextTick } from "vue";
|
|
|
import From from "@/components/from/index.vue";
|
|
|
import Table from "@/components/table/index.vue";
|
|
|
import Layer from '@/components/layer/index.vue'
|
|
|
@@ -160,7 +159,7 @@ import { FullScreen } from '@element-plus/icons'
|
|
|
import { ElMessage, ElLoading } from 'element-plus'
|
|
|
import {
|
|
|
getUserList, riskBannedUser, riskLockUser, appUserEcpm, getRevenueByTime,
|
|
|
- batchAudit, batchBanned, batchDeblock, appUserGetDitchList, getUserForIosList
|
|
|
+ batchAudit, batchBanned, batchDeblock
|
|
|
} from '@/api/userModule.js'
|
|
|
import { ditchList } from '@/api/outBagModule.js'
|
|
|
import { appList } from "@/api/formworkErection.js";
|
|
|
@@ -192,7 +191,6 @@ const formSearch = ref({
|
|
|
appIds: undefined, //所属应用
|
|
|
registryTimeBegin: getTodayRangeLocal(),// 注册时间
|
|
|
registryTimeEnd: undefined,// 注册时间
|
|
|
- appType: undefined,
|
|
|
page: 1,// 当前页码
|
|
|
limit: 20,// 当前页数量(查询量)
|
|
|
});
|
|
|
@@ -220,21 +218,6 @@ const settingData = async () => {
|
|
|
type: 'input',
|
|
|
needEnterEvent: true
|
|
|
},
|
|
|
- {
|
|
|
- label: "应用类型",
|
|
|
- prop: "appType",
|
|
|
- type: "select",
|
|
|
- options: [
|
|
|
- {
|
|
|
- label: "Android",
|
|
|
- value: 1,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "IOS",
|
|
|
- value: 2,
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
{
|
|
|
label: '所属应用',
|
|
|
prop: 'appIds',
|
|
|
@@ -264,82 +247,36 @@ const settingData = async () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-async function handleFormChange(item, e) {
|
|
|
- console.log("实时表单数据:", item.prop, e)
|
|
|
- if (item.prop === 'appType') {
|
|
|
- // IOS
|
|
|
- if (e === 2) {
|
|
|
- dynamicFormItems.value[4] = {
|
|
|
- label: '渠道来源',
|
|
|
- prop: 'ditchId',
|
|
|
- type: 'select',
|
|
|
- clearable: false,
|
|
|
- defaultVal: ditchOptionsIos.value[0].value,
|
|
|
- options: ditchOptionsIos.value,
|
|
|
- }
|
|
|
- dynamicFormItems.value[3] = {}
|
|
|
- } else {
|
|
|
- dynamicFormItems.value[4] = {
|
|
|
- label: '渠道来源',
|
|
|
- prop: 'ditchId',
|
|
|
- type: 'select',
|
|
|
- // clearable: false,
|
|
|
- defaultVal: ditchOptions.value[0].value,
|
|
|
- options: ditchOptions.value,
|
|
|
- }
|
|
|
-
|
|
|
- dynamicFormItems.value[3] = {
|
|
|
- label: '所属应用',
|
|
|
- prop: 'appIds',
|
|
|
- type: 'select',
|
|
|
- clearable: false,
|
|
|
- defaultVal: null,
|
|
|
- options: appsOptions.value,
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
const firstApp = ref('')
|
|
|
-const ditchOptions = ref([])
|
|
|
-const ditchOptionsIos = ref([])
|
|
|
-const appsOptions = ref([])
|
|
|
-
|
|
|
-
|
|
|
-// 设置表单数据
|
|
|
+//渠道来源
|
|
|
const getApiOptions = async () => {
|
|
|
try {
|
|
|
// 并发获取数据
|
|
|
- const [{ data: ditchData }, { data: appData }, { data: iosDitch }] = await Promise.all([
|
|
|
+ const [{ data: ditchData }, { data: appData }] = await Promise.all([
|
|
|
ditchList({ page: 1, limit: 9999 }),
|
|
|
- appList({ page: 1, limit: 9999 }),
|
|
|
- appUserGetDitchList({ page: 1, limit: 9999 })
|
|
|
+ appList({ page: 1, limit: 9999 })
|
|
|
])
|
|
|
- ditchOptions.value = ditchData.map(item => ({
|
|
|
+
|
|
|
+ const ditchOptions = ditchData.map(item => ({
|
|
|
label: item.ditchName,
|
|
|
value: item.ditchId
|
|
|
}))
|
|
|
|
|
|
- appsOptions.value = appData.map(item => ({
|
|
|
+ const appsOptions = appData.map(item => ({
|
|
|
label: item.appName,
|
|
|
value: item.appId
|
|
|
}))
|
|
|
|
|
|
- ditchOptionsIos.value = iosDitch.map(item => ({
|
|
|
- label: item.ditchName,
|
|
|
- value: item.ditchId
|
|
|
- }))
|
|
|
// 赋值到表单项
|
|
|
- dynamicFormItems.value[4].options = ditchOptions.value
|
|
|
- dynamicFormItems.value[3].options = appsOptions.value
|
|
|
+ dynamicFormItems.value[3].options = ditchOptions
|
|
|
+ dynamicFormItems.value[2].options = appsOptions
|
|
|
|
|
|
- //如果有应用列表,默认选第一个
|
|
|
- if (appsOptions.value.length > 0) {
|
|
|
+ // 如果有应用列表,默认选第一个
|
|
|
+ if (appsOptions.length > 0) {
|
|
|
// const firstApp = appsOptions[0].value
|
|
|
- firstApp.value = appsOptions.value[0].value
|
|
|
- dynamicFormItems.value[3].defaultVal = firstApp.value
|
|
|
+ firstApp.value = appsOptions[0].value
|
|
|
+ dynamicFormItems.value[2].defaultVal = firstApp.value
|
|
|
formSearch.value.appIds = firstApp.value
|
|
|
}
|
|
|
|
|
|
@@ -369,7 +306,7 @@ const getList = async (timeout = 5000) => {
|
|
|
// getRevenueByTime({ ...param })
|
|
|
]) */
|
|
|
|
|
|
- const listRes = formSearch.value.appType === 2 ? await getUserForIosList({ ...formSearch.value }) : await getUserList({ ...formSearch.value })
|
|
|
+ const listRes = await getUserList({ ...formSearch.value })
|
|
|
// 列表当日总收益
|
|
|
const totalEarnings = listRes.data.reduce((acc, cur) => acc + (cur.todayIncome || 0), 0)
|
|
|
|
|
|
@@ -397,15 +334,14 @@ const changeTableData = (type) => {
|
|
|
|
|
|
// 搜索
|
|
|
const handleFormSubmitted = (formData) => {
|
|
|
- console.log("接收到子组件传递的数据", formData);
|
|
|
+ // console.log("接收到子组件传递的数据", formData);
|
|
|
formSearch.value.page = page.pageNum;
|
|
|
formSearch.value.limit = page.pageSize;
|
|
|
formSearch.value.nickName = formData.nickName;
|
|
|
formSearch.value.userId = formData.userId;
|
|
|
formSearch.value.ditchId = formData.ditchId;
|
|
|
formSearch.value.userStatus = formData.userStatus;
|
|
|
- formSearch.value.appType = formData.appType;
|
|
|
- formSearch.value.appIds = formData.appType === 2 ? undefined : formData.appIds;
|
|
|
+ formSearch.value.appIds = formData.appIds;
|
|
|
formSearch.value.registryTimeBegin = convertUTCToBeijing(formData.registryTimeBegin, false) || undefined
|
|
|
formSearch.value.registryTimeEnd = convertUTCToBeijing(formData.registryTimeEnd, false) || undefined
|
|
|
|
|
|
@@ -422,7 +358,6 @@ const handleFormReset = () => {
|
|
|
appIds: undefined, //所属应用
|
|
|
registryTimeBegin: getTodayRangeLocal(),// 注册时间
|
|
|
registryTimeEnd: undefined,// 注册时间
|
|
|
- appType: undefined,
|
|
|
page: 1,// 当前页码
|
|
|
limit: 20,// 当前页数量(查询量)
|
|
|
};
|
|
|
@@ -819,7 +754,7 @@ const getData = (data) => {
|
|
|
ditchName: item.ditchName,
|
|
|
todayVideo: item.todayVideo,
|
|
|
totalVideo: item.totalVideo,
|
|
|
- totalIncome: `${roundPrice(item.todayIncome === 0 ? '0.00' : item.todayIncome ?? '0.00')} / ${roundPrice(item.totalIncome === 0 ? '0.00' : item.totalIncome ?? '0.00')}`,
|
|
|
+ totalIncome: `${roundPrice(item.todayIncome === 0 ? '0.000' : item.todayIncome ?? '0.000', 3)} / ${roundPrice(item.totalIncome === 0 ? '0.000' : item.totalIncome ?? '0.000',3)}`,
|
|
|
communicationOperator: item.communicationOperator,
|
|
|
loginRecordList: item.loginRecordList?.length
|
|
|
? `${item.loginRecordList[0].deviceBrand} ${item.loginRecordList[0].deviceModel}`
|