fix: add black

This commit is contained in:
zzc
2026-04-21 23:09:36 +08:00
parent b52d832986
commit f86e4b5b9a
2 changed files with 26 additions and 0 deletions

View File

@@ -54,6 +54,8 @@ instance.interceptors.request.use(
} }
if (store.getters['user/appId']) { if (store.getters['user/appId']) {
config.headers['x-app-id'] = store.getters['user/appId'] config.headers['x-app-id'] = store.getters['user/appId']
} else {
config.headers['x-app-id'] = '69665538a49b8ae3be50fe5d'
} }
if (config.method === 'get' && config.params) { if (config.method === 'get' && config.params) {
config.params = Vue.prototype.$baseLodash.pickBy(config.params, Vue.prototype.$baseLodash.identity) config.params = Vue.prototype.$baseLodash.pickBy(config.params, Vue.prototype.$baseLodash.identity)

View File

@@ -63,6 +63,9 @@
<el-form-item> <el-form-item>
<el-button icon="el-icon-search" type="primary" @click="handleQuery">查询</el-button> <el-button icon="el-icon-search" type="primary" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
<el-button :type="excludeAcquaintance ? 'primary' : 'default'" @click="toggleExcludeAcquaintance">去掉熟人</el-button>
<el-button :type="onlyUserId === true ? 'primary' : 'default'" @click="toggleOnlyUserId(true)">只显示有用户请求</el-button>
<el-button :type="onlyUserId === false ? 'primary' : 'default'" @click="toggleOnlyUserId(false)">只显示无用户请求</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
@@ -183,6 +186,8 @@
}, },
data() { data() {
return { return {
excludeAcquaintance: false,
onlyUserId: null, // null: all, true: only with user, false: only without user
eventNameMap, eventNameMap,
eventTypeMap, eventTypeMap,
appMap, appMap,
@@ -281,6 +286,13 @@
pageSize: 10000, // 获取足够多的数据进行前端统计,或者应该依赖后端聚合接口 pageSize: 10000, // 获取足够多的数据进行前端统计,或者应该依赖后端聚合接口
} }
if (this.excludeAcquaintance) {
params.excludeAcquaintance = true
}
if (this.onlyUserId !== null) {
params.onlyUserId = this.onlyUserId
}
const { data } = await getTrackingLogsList(params) const { data } = await getTrackingLogsList(params)
this.list = data.list || [] this.list = data.list || []
@@ -322,6 +334,18 @@
this.pageSize = val this.pageSize = val
this.currentPage = 1 this.currentPage = 1
}, },
toggleExcludeAcquaintance() {
this.excludeAcquaintance = !this.excludeAcquaintance
this.fetchData()
},
toggleOnlyUserId(value) {
if (this.onlyUserId === value) {
this.onlyUserId = null // Toggle off if already selected
} else {
this.onlyUserId = value
}
this.fetchData()
},
handleCurrentChange(val) { handleCurrentChange(val) {
this.currentPage = val this.currentPage = val
}, },