chore(uni-admin): 同步官方 2.5.1 框架文件
来源: gitee.com/dcloud/uni-admin master (2.5.1, 2025-04-24)。含 uni-stat-tabs 组件更新、uni-id-users/uni-id-log validator、uni-stat 页面修复、菜单初始数据与 DB schema 更新;版本号对齐 2.5.1。
This commit is contained in:
@@ -373,7 +373,7 @@
|
||||
"permission": [],
|
||||
"enable": true,
|
||||
"menu_id": "uni-stat-error-js",
|
||||
"name": "js报错",
|
||||
"name": "代码错误",
|
||||
"icon": "",
|
||||
"url": "/pages/uni-stat/error/js/js",
|
||||
"sort": 2171,
|
||||
|
||||
@@ -21,9 +21,11 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="dispaly-grid">
|
||||
<view v-for="(item,index) in chartsData" :key="index" class="uni-stat--x uni-charts-box1">
|
||||
<view class="label-text" style="margin: 5px 0 20px 0;">{{chartsData[index].title}}</view>
|
||||
<qiun-data-charts type="ring" :chartData="chartsData[index]" echartsH5 echartsApp :errorMessage="errorMessage"/>
|
||||
<view v-for="(item,index) in chartsData" :key="index" class="uni-stat--x uni-charts-box1 charts-box">
|
||||
<view class="label-text" style="padding: 5px 0 20px 0;">{{chartsData[index].title}}</view>
|
||||
<view style="flex:1;">
|
||||
<qiun-data-charts type="column" :eopts="eopts" :chartData="chartsData[index]" echartsH5 echartsApp tooltipFormat="platformTooltipCustom" :errorMessage="errorMessage"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -47,6 +49,33 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
eopts:{
|
||||
// color: ["#91CB74","#1890FF","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],
|
||||
grid:{
|
||||
left: 100,
|
||||
right: 100,
|
||||
bottom:50
|
||||
},
|
||||
xAxis:{
|
||||
boundaryGap: true,
|
||||
axisTick:{
|
||||
alignWithLabel:true,
|
||||
interval:0
|
||||
},
|
||||
axisLabel :{
|
||||
interval:0,
|
||||
rotate:-30,
|
||||
align:'left'
|
||||
}
|
||||
|
||||
},
|
||||
extra: {
|
||||
column: {
|
||||
type:'group',
|
||||
width: 120,
|
||||
}
|
||||
}
|
||||
},
|
||||
query: {
|
||||
dimension: "day",
|
||||
appid: '',
|
||||
@@ -165,6 +194,7 @@
|
||||
|
||||
if (type === 'day') {
|
||||
options.unshift({
|
||||
type:"",
|
||||
field: `day_total_devices`,
|
||||
title: `总设备数对比`,
|
||||
series: [{
|
||||
@@ -176,22 +206,28 @@
|
||||
this[goal] = options
|
||||
const platformsData = res.result.data
|
||||
const platforms = {}
|
||||
let categories = []
|
||||
platformsData.forEach(p => {
|
||||
platforms[p._id] = p.name
|
||||
categories.push(p.name)
|
||||
})
|
||||
|
||||
for (const chart of this[goal]) {
|
||||
const pie = chart.series[0].data
|
||||
let pie = chart.series[0].data
|
||||
chart.categories = categories
|
||||
const p = JSON.parse(JSON.stringify(platforms))
|
||||
let total = 0
|
||||
let tableList = []
|
||||
for (const item of data) {
|
||||
for (const key in item) {
|
||||
if (chart.field === key) {
|
||||
const id = item.platform_id
|
||||
const slice = {
|
||||
name: p[id],
|
||||
value: item[key]
|
||||
value: item[key],
|
||||
}
|
||||
pie.push(slice)
|
||||
total += item[key]
|
||||
tableList.push(slice)
|
||||
delete p[id]
|
||||
}
|
||||
}
|
||||
@@ -201,8 +237,18 @@
|
||||
name: p[key],
|
||||
value: 0
|
||||
}
|
||||
pie.push(slice)
|
||||
tableList.push(slice)
|
||||
}
|
||||
// 计算总数
|
||||
tableList.map(item=>{
|
||||
item.total = total
|
||||
return item
|
||||
})
|
||||
|
||||
categories.forEach(v=>{
|
||||
const item = tableList.find(i=>i.name === v)
|
||||
chart.series[0].data.push(item)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -217,4 +263,9 @@
|
||||
padding: 10px;
|
||||
height: 420px;
|
||||
}
|
||||
|
||||
.charts-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<uni-datetime-picker type="datetimerange" :end="new Date().getTime()" v-model="query.start_time" returnType="timestamp" :clearIcon="false" class="uni-stat-datetime-picker" :class="{'uni-stat__actived': currentDateTab < 0 && !!query.start_time.length}" @change="useDatetimePicker" />
|
||||
</view>
|
||||
<view class="uni-stat--x">
|
||||
<uni-stat-tabs label="平台选择" type="boldLine" mode="platform" v-model="query.platform_id" @change="changePlatform" />
|
||||
<uni-stat-tabs costom label="平台选择" type="boldLine" mode="platform" v-model="query.platform_id" @change="changePlatform" />
|
||||
<uni-data-select v-if="query.platform_id && query.platform_id.indexOf('==') === -1" collection="uni-stat-app-channels" :where="channelQuery" class="p-channel" field="_id as value, channel_name as text" orderby="text asc" label="渠道/场景值选择" v-model="query.channel_id" />
|
||||
</view>
|
||||
<uni-stat-panel :items="panelData" :contrast="true" />
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
<view class="uni-stat--x">
|
||||
<uni-stat-tabs label="平台选择" type="boldLine" mode="platform" v-model="query.platform" @change="platformChange" />
|
||||
</view>
|
||||
<!-- #ifdef WEB -->
|
||||
<uni-notice-bar showGetMore showIcon class="mb-m pointer" text="若用户昵称均为匿名用户,代表用户在发起支付前没有使用uni-id进行登录,建议接入uni-id,点击查看详情" @click="toUniIdDoc" />
|
||||
<!-- #endif -->
|
||||
|
||||
<unicloud-db ref="udb" :collection="collectionList" field="user_id,nickname,provider,provider_pay_type,uni_platform,status,type,order_no,out_trade_no,transaction_id,device_id,client_ip,openid,description,err_msg,total_fee,refund_fee,refund_count,refund_list,provider_appid,appid,user_order_success,create_date,pay_date,notify_date,cancel_date" :where="where" page-data="replace"
|
||||
:orderby="orderby" :getcount="true" :page-size="options.pageSize" :page-current="options.pageCurrent"
|
||||
@@ -473,6 +476,11 @@
|
||||
url: `/pages/system/user/list?id=${user_id}`
|
||||
});
|
||||
},
|
||||
toUniIdDoc() {
|
||||
// #ifdef WEB
|
||||
window.open("https://doc.dcloud.net.cn/uniCloud/uni-id/summary.html");
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
query: {
|
||||
|
||||
@@ -34,21 +34,24 @@ export default [{
|
||||
field: 'active_user_count',
|
||||
tooltip: '访问过应用内任意页面的总用户数(去重)',
|
||||
value: 0
|
||||
}, {
|
||||
},
|
||||
{
|
||||
title: '次均停留时长',
|
||||
field: 'avg_user_session_time',
|
||||
computed: 'user_duration/active_user_count',
|
||||
formatter: ':',
|
||||
tooltip: '平均每次打开应用停留在应用内的总时长,即应用停留总时长/启动次数',
|
||||
value: 0,
|
||||
stat: 'avg'
|
||||
}, {
|
||||
title: '人均停留时长 ',
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
title: '人均停留时长',
|
||||
field: 'avg_user_time',
|
||||
computed: 'user_duration/user_session_times',
|
||||
formatter: ':',
|
||||
tooltip: '平均每个用户停留在应用内的总时长,即应用停留总时长/活跃用户',
|
||||
value: 0,
|
||||
stat: 'avg'
|
||||
}, {
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
title: '总用户数',
|
||||
field: 'total_users',
|
||||
tooltip: '从添加统计到当前选择时间的总用户数(去重)',
|
||||
|
||||
Reference in New Issue
Block a user