609 lines
23 KiB
JavaScript
609 lines
23 KiB
JavaScript
"use strict";
|
||
const common_vendor = require("../../../common/vendor.js");
|
||
const common_config = require("../../../common/config.js");
|
||
function getTenantId() {
|
||
try {
|
||
return common_vendor.index.getStorageSync("backend-tenant-id") || "";
|
||
} catch (e) {
|
||
common_vendor.index.__f__("error", "at pages-subpackage/champion/components/training-tab.vue:176", "获取 tenantId 失败:", e);
|
||
return "";
|
||
}
|
||
}
|
||
const _sfc_main = {
|
||
name: "TrainingTab",
|
||
data() {
|
||
return {
|
||
// 陪练列表相关数据
|
||
trainingList: [],
|
||
trainingLoading: false,
|
||
trainingTotal: 0,
|
||
trainingPage: {
|
||
current: 1,
|
||
size: 10
|
||
},
|
||
trainingQuery: {
|
||
participantName: "",
|
||
participantPhone: "",
|
||
finishStatus: ""
|
||
},
|
||
// 状态选项
|
||
finishStatusOptions: [
|
||
{ value: "init", label: "初始状态" },
|
||
{ value: "finished", label: "完成状态" }
|
||
],
|
||
finishStatusIndex: -1,
|
||
// -1表示未选择,不发送finishStatus参数
|
||
// 陪练操作菜单
|
||
selectedTrainingItem: null,
|
||
showTrainingActionMenu: false,
|
||
// 陪练中列表弹出框
|
||
showTrainingItemListPopup: false,
|
||
trainingItemList: [],
|
||
trainingItemLoading: false,
|
||
trainingItemTotal: 0,
|
||
trainingItemPage: {
|
||
current: 1,
|
||
size: 10
|
||
},
|
||
currentTrainingParentId: "",
|
||
// 存储每个陪练项的答案输入
|
||
trainingItemAnswers: {}
|
||
};
|
||
},
|
||
mounted() {
|
||
this.fetchTrainingList();
|
||
},
|
||
methods: {
|
||
// 状态选择改变事件
|
||
onFinishStatusChange(e) {
|
||
const index = parseInt(e.detail.value);
|
||
this.finishStatusIndex = index;
|
||
if (index >= 0 && index < this.finishStatusOptions.length) {
|
||
this.trainingQuery.finishStatus = this.finishStatusOptions[index].value;
|
||
} else {
|
||
this.trainingQuery.finishStatus = "";
|
||
this.finishStatusIndex = 0;
|
||
}
|
||
this.onTrainingSearch();
|
||
},
|
||
// 获取状态标签
|
||
getFinishStatusLabel(status) {
|
||
if (status === "init") {
|
||
return "初始状态";
|
||
} else if (status === "finished") {
|
||
return "完成状态";
|
||
}
|
||
return status || "";
|
||
},
|
||
// 陪练列表相关方法
|
||
onTrainingSearch() {
|
||
this.trainingPage.current = 1;
|
||
this.fetchTrainingList({ force: true });
|
||
},
|
||
onTrainingRefresh() {
|
||
this.trainingPage.current = 1;
|
||
this.fetchTrainingList({ force: true });
|
||
},
|
||
onTrainingReachBottom() {
|
||
if (this.trainingLoading)
|
||
return;
|
||
if (this.trainingList.length >= this.trainingTotal)
|
||
return;
|
||
this.trainingPage.current += 1;
|
||
this.fetchTrainingList();
|
||
},
|
||
async fetchTrainingList({ force = false } = {}) {
|
||
var _a, _b, _c, _d, _e, _f;
|
||
if (this.trainingLoading && !force) {
|
||
return;
|
||
}
|
||
this.trainingLoading = true;
|
||
try {
|
||
const queryParams = {
|
||
current: this.trainingPage.current,
|
||
size: this.trainingPage.size
|
||
};
|
||
const trimmedParticipantName = (_b = (_a = this.trainingQuery) == null ? void 0 : _a.participantName) == null ? void 0 : _b.trim();
|
||
const trimmedParticipantPhone = (_d = (_c = this.trainingQuery) == null ? void 0 : _c.participantPhone) == null ? void 0 : _d.trim();
|
||
const finishStatus = (_e = this.trainingQuery) == null ? void 0 : _e.finishStatus;
|
||
if (trimmedParticipantName) {
|
||
queryParams.participantName = trimmedParticipantName;
|
||
}
|
||
if (trimmedParticipantPhone) {
|
||
queryParams.participantPhone = trimmedParticipantPhone;
|
||
}
|
||
if (finishStatus) {
|
||
queryParams.finishStatus = finishStatus;
|
||
}
|
||
const queryString = Object.keys(queryParams).map((key) => `${key}=${encodeURIComponent(queryParams[key])}`).join("&");
|
||
const url = `${common_config.getApiUrl("/api/trainingMain/list")}?${queryString}`;
|
||
const tenantId = getTenantId();
|
||
const headers = {};
|
||
if (tenantId) {
|
||
headers["X-Tenant-Id"] = tenantId;
|
||
queryParams.tenantId = tenantId;
|
||
}
|
||
const finalQueryString = Object.keys(queryParams).map((key) => `${key}=${encodeURIComponent(queryParams[key])}`).join("&");
|
||
const finalUrl = `${common_config.getApiUrl("/api/trainingMain/list")}?${finalQueryString}`;
|
||
const res = await common_vendor.index.request({
|
||
url: finalUrl,
|
||
method: "POST",
|
||
header: headers,
|
||
timeout: 1e4
|
||
});
|
||
if (res.statusCode === 200 && res.data && res.data.success) {
|
||
const records = Array.isArray(res.data.data) ? res.data.data : [];
|
||
if (this.trainingPage.current === 1 || force) {
|
||
this.trainingList = records;
|
||
} else {
|
||
this.trainingList = this.trainingList.concat(records);
|
||
}
|
||
this.trainingTotal = Number(res.data.total) || 0;
|
||
} else {
|
||
this.trainingList = [];
|
||
this.trainingTotal = 0;
|
||
common_vendor.index.showToast({
|
||
title: ((_f = res.data) == null ? void 0 : _f.message) || "获取陪练列表失败",
|
||
icon: "none"
|
||
});
|
||
}
|
||
} catch (error) {
|
||
common_vendor.index.__f__("error", "at pages-subpackage/champion/components/training-tab.vue:334", "获取陪练列表失败:", error);
|
||
common_vendor.index.showToast({
|
||
title: "获取陪练列表失败,请稍后重试",
|
||
icon: "none"
|
||
});
|
||
} finally {
|
||
this.trainingLoading = false;
|
||
}
|
||
},
|
||
// 陪练操作菜单相关方法
|
||
onTrainingActionBtnClick(item) {
|
||
if (this.selectedTrainingItem && this.selectedTrainingItem.id === item.id && this.showTrainingActionMenu) {
|
||
this.closeTrainingActionMenu();
|
||
return;
|
||
}
|
||
this.selectedTrainingItem = item;
|
||
this.showTrainingActionMenu = true;
|
||
},
|
||
closeTrainingActionMenu() {
|
||
this.showTrainingActionMenu = false;
|
||
this.selectedTrainingItem = null;
|
||
},
|
||
async startTraining(item) {
|
||
this.closeTrainingActionMenu();
|
||
this.currentTrainingParentId = item.id || "";
|
||
this.trainingItemList = [];
|
||
this.showTrainingItemListPopup = true;
|
||
await this.fetchTrainingItemListAll(item.id || "");
|
||
},
|
||
closeTrainingItemListPopup() {
|
||
this.showTrainingItemListPopup = false;
|
||
this.currentTrainingParentId = "";
|
||
this.trainingItemPage.current = 1;
|
||
this.trainingItemList = [];
|
||
this.trainingItemAnswers = {};
|
||
},
|
||
onTrainingItemListReachBottom() {
|
||
if (this.trainingItemLoading)
|
||
return;
|
||
if (this.trainingItemList.length >= this.trainingItemTotal)
|
||
return;
|
||
this.trainingItemPage.current += 1;
|
||
this.fetchTrainingItemList();
|
||
},
|
||
async fetchTrainingItemListAll(parentId) {
|
||
var _a;
|
||
if (!parentId) {
|
||
common_vendor.index.showToast({
|
||
title: "缺少父ID参数",
|
||
icon: "none"
|
||
});
|
||
return;
|
||
}
|
||
this.trainingItemLoading = true;
|
||
try {
|
||
const tenantId = getTenantId();
|
||
const queryParams = {
|
||
parentId
|
||
};
|
||
if (tenantId) {
|
||
queryParams.tenantId = tenantId;
|
||
}
|
||
const queryString = Object.keys(queryParams).filter((key) => queryParams[key] !== null && queryParams[key] !== void 0 && queryParams[key] !== "").map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(queryParams[key])}`).join("&");
|
||
const url = `${common_config.getApiUrl("/api/trainingItem/listAll")}?${queryString}`;
|
||
const headers = {
|
||
"Content-Type": "application/json"
|
||
};
|
||
if (tenantId) {
|
||
headers["X-Tenant-Id"] = tenantId;
|
||
}
|
||
const res = await common_vendor.index.request({
|
||
url,
|
||
method: "POST",
|
||
header: headers,
|
||
timeout: 3e4
|
||
});
|
||
if (res.statusCode === 200 && res.data && res.data.success) {
|
||
const records = Array.isArray(res.data.data) ? res.data.data : [];
|
||
this.trainingItemList = records;
|
||
this.trainingItemTotal = Number(res.data.count) || records.length;
|
||
this.initTrainingItemAnswers(records);
|
||
} else {
|
||
this.trainingItemList = [];
|
||
this.trainingItemTotal = 0;
|
||
common_vendor.index.showToast({
|
||
title: ((_a = res.data) == null ? void 0 : _a.message) || "获取陪练中列表失败",
|
||
icon: "none"
|
||
});
|
||
}
|
||
} catch (error) {
|
||
common_vendor.index.__f__("error", "at pages-subpackage/champion/components/training-tab.vue:443", "获取陪练中列表失败:", error);
|
||
common_vendor.index.showToast({
|
||
title: "获取陪练中列表失败,请稍后重试",
|
||
icon: "none"
|
||
});
|
||
} finally {
|
||
this.trainingItemLoading = false;
|
||
}
|
||
},
|
||
async fetchTrainingItemList({ force = false } = {}) {
|
||
var _a;
|
||
if (this.trainingItemLoading && !force) {
|
||
return;
|
||
}
|
||
if (!this.currentTrainingParentId) {
|
||
return;
|
||
}
|
||
this.trainingItemLoading = true;
|
||
try {
|
||
const queryParams = {
|
||
current: this.trainingItemPage.current,
|
||
size: this.trainingItemPage.size,
|
||
parentId: this.currentTrainingParentId
|
||
};
|
||
const tenantId = getTenantId();
|
||
if (tenantId) {
|
||
queryParams.tenantId = tenantId;
|
||
}
|
||
const queryString = Object.keys(queryParams).filter((key) => queryParams[key] !== null && queryParams[key] !== void 0 && queryParams[key] !== "").map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(queryParams[key])}`).join("&");
|
||
const url = `${common_config.getApiUrl("/api/trainingItem/list")}?${queryString}`;
|
||
const headers = {};
|
||
if (tenantId) {
|
||
headers["X-Tenant-Id"] = tenantId;
|
||
}
|
||
const res = await common_vendor.index.request({
|
||
url,
|
||
method: "GET",
|
||
header: headers,
|
||
timeout: 3e4
|
||
});
|
||
if (res.statusCode === 200 && res.data && res.data.success) {
|
||
const records = Array.isArray(res.data.data) ? res.data.data : [];
|
||
if (this.trainingItemPage.current === 1 || force) {
|
||
this.trainingItemList = records;
|
||
this.initTrainingItemAnswers(records);
|
||
} else {
|
||
this.trainingItemList = this.trainingItemList.concat(records);
|
||
this.initTrainingItemAnswers(records);
|
||
}
|
||
this.trainingItemTotal = Number(res.data.total) || 0;
|
||
} else {
|
||
this.trainingItemList = [];
|
||
this.trainingItemTotal = 0;
|
||
common_vendor.index.showToast({
|
||
title: ((_a = res.data) == null ? void 0 : _a.message) || "获取陪练中列表失败",
|
||
icon: "none"
|
||
});
|
||
}
|
||
} catch (error) {
|
||
common_vendor.index.__f__("error", "at pages-subpackage/champion/components/training-tab.vue:516", "获取陪练中列表失败:", error);
|
||
common_vendor.index.showToast({
|
||
title: "获取陪练中列表失败,请稍后重试",
|
||
icon: "none"
|
||
});
|
||
} finally {
|
||
this.trainingItemLoading = false;
|
||
}
|
||
},
|
||
formatDateTime(value) {
|
||
if (!value) {
|
||
return "";
|
||
}
|
||
const date = new Date(value);
|
||
if (Number.isNaN(date.getTime())) {
|
||
return "";
|
||
}
|
||
const year = date.getFullYear();
|
||
const month = String(date.getMonth() + 1).padStart(2, "0");
|
||
const day = String(date.getDate()).padStart(2, "0");
|
||
const hours = String(date.getHours()).padStart(2, "0");
|
||
const minutes = String(date.getMinutes()).padStart(2, "0");
|
||
const seconds = String(date.getSeconds()).padStart(2, "0");
|
||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||
},
|
||
// 初始化陪练项答案输入
|
||
initTrainingItemAnswers(records) {
|
||
if (!Array.isArray(records))
|
||
return;
|
||
records.forEach((item) => {
|
||
if (item.id) {
|
||
if (!this.trainingItemAnswers.hasOwnProperty(item.id)) {
|
||
this.$set(this.trainingItemAnswers, item.id, item.answer || "");
|
||
}
|
||
}
|
||
});
|
||
},
|
||
// 继续按钮处理
|
||
async handleContinue(item) {
|
||
var _a, _b;
|
||
if (!item || !item.id) {
|
||
common_vendor.index.showToast({
|
||
title: "记录ID不能为空",
|
||
icon: "none"
|
||
});
|
||
return;
|
||
}
|
||
if (!this.currentTrainingParentId) {
|
||
common_vendor.index.showToast({
|
||
title: "缺少父ID参数",
|
||
icon: "none"
|
||
});
|
||
return;
|
||
}
|
||
try {
|
||
common_vendor.index.showLoading({
|
||
title: "提交中..."
|
||
});
|
||
const tenantId = getTenantId();
|
||
const answer = this.trainingItemAnswers[item.id] || "";
|
||
const payload = {
|
||
id: item.id,
|
||
parentId: this.currentTrainingParentId,
|
||
answer
|
||
};
|
||
if (tenantId) {
|
||
payload.tenantId = tenantId;
|
||
}
|
||
const headers = {
|
||
"Content-Type": "application/json"
|
||
};
|
||
if (tenantId) {
|
||
headers["X-Tenant-Id"] = tenantId;
|
||
}
|
||
const res = await common_vendor.index.request({
|
||
url: common_config.getApiUrl("/api/trainingItem/traningNext"),
|
||
method: "POST",
|
||
data: payload,
|
||
header: headers,
|
||
timeout: 15e3
|
||
});
|
||
common_vendor.index.hideLoading();
|
||
if (res.statusCode === 200 && res.data && (res.data.success || res.data.code === 200)) {
|
||
const newItems = Array.isArray(res.data.data) ? res.data.data : [];
|
||
if (newItems.length > 0) {
|
||
const newItem = newItems[0];
|
||
const index = this.trainingItemList.findIndex((i) => i.id === item.id);
|
||
if (index !== -1) {
|
||
const oldId = item.id;
|
||
if (newItem.question !== void 0) {
|
||
this.$set(this.trainingItemList[index], "question", newItem.question);
|
||
}
|
||
if (newItem.id !== void 0) {
|
||
this.$set(this.trainingItemList[index], "id", newItem.id);
|
||
}
|
||
if (newItem.parentId !== void 0) {
|
||
this.$set(this.trainingItemList[index], "parentId", newItem.parentId);
|
||
}
|
||
if (newItem.id && newItem.id !== oldId) {
|
||
const oldAnswer = this.trainingItemAnswers[oldId] || "";
|
||
this.$delete(this.trainingItemAnswers, oldId);
|
||
this.$set(this.trainingItemAnswers, newItem.id, oldAnswer);
|
||
} else {
|
||
this.$set(this.trainingItemAnswers, item.id, "");
|
||
}
|
||
}
|
||
}
|
||
common_vendor.index.showToast({
|
||
title: ((_a = res.data) == null ? void 0 : _a.message) || "提交成功",
|
||
icon: "success"
|
||
});
|
||
} else {
|
||
common_vendor.index.showToast({
|
||
title: ((_b = res.data) == null ? void 0 : _b.message) || "提交失败",
|
||
icon: "none"
|
||
});
|
||
}
|
||
} catch (error) {
|
||
common_vendor.index.hideLoading();
|
||
common_vendor.index.__f__("error", "at pages-subpackage/champion/components/training-tab.vue:664", "提交失败:", error);
|
||
common_vendor.index.showToast({
|
||
title: (error == null ? void 0 : error.message) || "提交失败,请重试",
|
||
icon: "none"
|
||
});
|
||
}
|
||
},
|
||
// 结束按钮处理
|
||
async handleEnd(item) {
|
||
var _a, _b;
|
||
if (!this.currentTrainingParentId) {
|
||
common_vendor.index.showToast({
|
||
title: "父ID不能为空",
|
||
icon: "none"
|
||
});
|
||
return;
|
||
}
|
||
try {
|
||
common_vendor.index.showLoading({
|
||
title: "提交中..."
|
||
});
|
||
const tenantId = getTenantId();
|
||
const payload = {
|
||
parentId: this.currentTrainingParentId
|
||
};
|
||
if (tenantId) {
|
||
payload.tenantId = tenantId;
|
||
}
|
||
const headers = {
|
||
"Content-Type": "application/json"
|
||
};
|
||
if (tenantId) {
|
||
headers["X-Tenant-Id"] = tenantId;
|
||
}
|
||
const res = await common_vendor.index.request({
|
||
url: common_config.getApiUrl("/api/trainingItem/traningFinish"),
|
||
method: "POST",
|
||
data: payload,
|
||
header: headers,
|
||
timeout: 15e3
|
||
});
|
||
common_vendor.index.hideLoading();
|
||
if (res.statusCode === 200 && res.data && (res.data.success || res.data.code === 200)) {
|
||
common_vendor.index.showToast({
|
||
title: ((_a = res.data) == null ? void 0 : _a.message) || "提交成功",
|
||
icon: "success"
|
||
});
|
||
this.closeTrainingItemListPopup();
|
||
this.trainingPage.current = 1;
|
||
this.fetchTrainingList({ force: true });
|
||
this.$emit("refresh-training-list");
|
||
} else {
|
||
common_vendor.index.showToast({
|
||
title: ((_b = res.data) == null ? void 0 : _b.message) || "提交失败",
|
||
icon: "none"
|
||
});
|
||
}
|
||
} catch (error) {
|
||
common_vendor.index.hideLoading();
|
||
common_vendor.index.__f__("error", "at pages-subpackage/champion/components/training-tab.vue:738", "提交失败:", error);
|
||
common_vendor.index.showToast({
|
||
title: (error == null ? void 0 : error.message) || "提交失败,请重试",
|
||
icon: "none"
|
||
});
|
||
}
|
||
}
|
||
}
|
||
};
|
||
if (!Array) {
|
||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||
_easycom_uni_icons2();
|
||
}
|
||
const _easycom_uni_icons = () => "../../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
||
if (!Math) {
|
||
_easycom_uni_icons();
|
||
}
|
||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||
return common_vendor.e({
|
||
a: common_vendor.t($data.trainingTotal),
|
||
b: common_vendor.t($data.finishStatusIndex === -1 ? "状态" : $data.finishStatusOptions[$data.finishStatusIndex].label),
|
||
c: common_vendor.n($data.finishStatusIndex === -1 ? "toolbar-picker-placeholder" : "toolbar-picker-text"),
|
||
d: common_vendor.p({
|
||
type: "bottom",
|
||
size: "14",
|
||
color: "#999"
|
||
}),
|
||
e: $data.finishStatusOptions,
|
||
f: $data.finishStatusIndex >= 0 ? $data.finishStatusIndex : 0,
|
||
g: common_vendor.o((...args) => $options.onFinishStatusChange && $options.onFinishStatusChange(...args), "d8"),
|
||
h: common_vendor.o((...args) => $options.onTrainingSearch && $options.onTrainingSearch(...args), "3c"),
|
||
i: $data.trainingQuery.participantName,
|
||
j: common_vendor.o(($event) => $data.trainingQuery.participantName = $event.detail.value, "5c"),
|
||
k: common_vendor.o((...args) => $options.onTrainingSearch && $options.onTrainingSearch(...args), "55"),
|
||
l: $data.trainingQuery.participantPhone,
|
||
m: common_vendor.o(($event) => $data.trainingQuery.participantPhone = $event.detail.value, "09"),
|
||
n: common_vendor.p({
|
||
type: "refresh",
|
||
size: "18",
|
||
color: "#2A68FF"
|
||
}),
|
||
o: common_vendor.o((...args) => $options.onTrainingRefresh && $options.onTrainingRefresh(...args), "e2"),
|
||
p: common_vendor.f($data.trainingList, (item, index, i0) => {
|
||
return common_vendor.e({
|
||
a: common_vendor.t((item.title || "陪").charAt(0)),
|
||
b: common_vendor.t(item.title || "未命名陪练"),
|
||
c: "4ed90893-2-" + i0,
|
||
d: common_vendor.o(($event) => $options.onTrainingActionBtnClick(item), item.id || index),
|
||
e: $data.selectedTrainingItem && $data.selectedTrainingItem.id === item.id && $data.showTrainingActionMenu
|
||
}, $data.selectedTrainingItem && $data.selectedTrainingItem.id === item.id && $data.showTrainingActionMenu ? {
|
||
f: common_vendor.o(($event) => $options.startTraining(item), item.id || index),
|
||
g: common_vendor.o(() => {
|
||
}, item.id || index)
|
||
} : {}, {
|
||
h: item.scenario
|
||
}, item.scenario ? {
|
||
i: common_vendor.t(item.scenario)
|
||
} : {}, {
|
||
j: item.participantName
|
||
}, item.participantName ? {
|
||
k: common_vendor.t(item.participantName)
|
||
} : {}, {
|
||
l: item.participantPhone
|
||
}, item.participantPhone ? {
|
||
m: common_vendor.t(item.participantPhone)
|
||
} : {}, {
|
||
n: item.finishStatus
|
||
}, item.finishStatus ? {
|
||
o: common_vendor.t($options.getFinishStatusLabel(item.finishStatus))
|
||
} : {}, {
|
||
p: item.endTime
|
||
}, item.endTime ? {
|
||
q: common_vendor.t($options.formatDateTime(item.endTime))
|
||
} : {}, {
|
||
r: item.id || index,
|
||
s: $data.selectedTrainingItem && $data.selectedTrainingItem.id === item.id ? 1 : ""
|
||
});
|
||
}),
|
||
q: common_vendor.p({
|
||
type: "more-filled",
|
||
size: "20",
|
||
color: "#999"
|
||
}),
|
||
r: !$data.trainingLoading && !$data.trainingList.length
|
||
}, !$data.trainingLoading && !$data.trainingList.length ? {} : {}, {
|
||
s: $data.trainingLoading && $data.trainingList.length
|
||
}, $data.trainingLoading && $data.trainingList.length ? {} : {}, {
|
||
t: $data.showTrainingActionMenu
|
||
}, $data.showTrainingActionMenu ? {
|
||
v: common_vendor.o((...args) => $options.closeTrainingActionMenu && $options.closeTrainingActionMenu(...args), "ce")
|
||
} : {}, {
|
||
w: common_vendor.o((...args) => $options.onTrainingReachBottom && $options.onTrainingReachBottom(...args), "c2"),
|
||
x: $data.showTrainingItemListPopup
|
||
}, $data.showTrainingItemListPopup ? {
|
||
y: common_vendor.o((...args) => $options.closeTrainingItemListPopup && $options.closeTrainingItemListPopup(...args), "63")
|
||
} : {}, {
|
||
z: $data.showTrainingItemListPopup
|
||
}, $data.showTrainingItemListPopup ? common_vendor.e({
|
||
A: common_vendor.p({
|
||
type: "close",
|
||
size: "20",
|
||
color: "#999"
|
||
}),
|
||
B: common_vendor.o((...args) => $options.closeTrainingItemListPopup && $options.closeTrainingItemListPopup(...args), "8a"),
|
||
C: common_vendor.f($data.trainingItemList, (item, index, i0) => {
|
||
return common_vendor.e({
|
||
a: common_vendor.t((item.question || "题").charAt(0)),
|
||
b: common_vendor.t(item.question || "未命名题目"),
|
||
c: item.answer
|
||
}, item.answer ? {
|
||
d: common_vendor.t(item.answer)
|
||
} : {}, {
|
||
e: $data.trainingItemAnswers[item.id],
|
||
f: common_vendor.o(($event) => $data.trainingItemAnswers[item.id] = $event.detail.value, item.id || index),
|
||
g: common_vendor.o(($event) => $options.handleContinue(item), item.id || index),
|
||
h: common_vendor.o(($event) => $options.handleEnd(item), item.id || index),
|
||
i: item.id || index
|
||
});
|
||
}),
|
||
D: !$data.trainingItemLoading && !$data.trainingItemList.length
|
||
}, !$data.trainingItemLoading && !$data.trainingItemList.length ? {} : {}, {
|
||
E: $data.trainingItemLoading && $data.trainingItemList.length
|
||
}, $data.trainingItemLoading && $data.trainingItemList.length ? {} : {}, {
|
||
F: common_vendor.o((...args) => $options.onTrainingItemListReachBottom && $options.onTrainingItemListReachBottom(...args), "e4"),
|
||
G: common_vendor.o(() => {
|
||
}, "1d")
|
||
}) : {});
|
||
}
|
||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-4ed90893"]]);
|
||
wx.createComponent(Component);
|
||
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages-subpackage/champion/components/training-tab.js.map
|