Commit aede6582 authored by Jeff nan's avatar Jeff nan

feat

parent e4661791
......@@ -220,11 +220,18 @@ function initVueApp(savedData) {
return this.getResultRows(this.vocalResult);
},
getResultRows(result) {
const cleaned = this.omitUsageFields(result) || {};
return Object.keys(cleaned).map((k) => ({ key: k, value: cleaned[k] }));
},
// 去掉前端不适配的用量字段
omitUsageFields(obj) {
if (obj == null || typeof obj !== 'object') return obj;
const hideKeys = { ai_amount: 1, ai_balance: 1, token_usage: 1 };
const data = result || {};
return Object.keys(data)
.filter((k) => !hideKeys[k])
.map((k) => ({ key: k, value: data[k] }));
const out = {};
Object.keys(obj).forEach((k) => {
if (!hideKeys[k]) out[k] = obj[k];
});
return out;
},
async getAuthKey() {
// courseware 同名事件不能并发监听:并行调用会互相覆盖,只保留最后一次
......@@ -2649,13 +2656,13 @@ function initVueApp(savedData) {
data.task_uuid = this.task_uuid;
}
if (this.subtitlesResult != null) {
data.subtitlesResult = this.subtitlesResult;
data.subtitlesResult = this.omitUsageFields(this.subtitlesResult);
}
if (this.vocalTaskUuid) {
data.vocalTaskUuid = this.vocalTaskUuid;
}
if (this.vocalResult != null) {
data.vocalResult = this.vocalResult;
data.vocalResult = this.omitUsageFields(this.vocalResult);
}
window.courseware.setData(data, function () {
}, key);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment