Files
threeonecheck_web/unpackage/dist/dev/mp-weixin/pages/plandetail/plandetail.js
2025-12-29 14:59:44 +08:00

56 lines
2.5 KiB
JavaScript

"use strict";
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
const _sfc_main = {
__name: "plandetail",
setup(__props) {
const loading = common_vendor.ref(true);
const planData = common_vendor.ref(null);
const progressPercent = common_vendor.computed(() => {
if (!planData.value || !planData.value.totalCount)
return 0;
return Math.round(planData.value.currentIndex / planData.value.totalCount * 100);
});
const fetchTaskDetail = async (oneTableId) => {
try {
const startRes = await request_api.enterCheckPlan(oneTableId);
if (startRes.code === 0 && startRes.data) {
const taskId = startRes.data.taskId;
const detailRes = await request_api.getCheckTaskDetail(taskId);
if (detailRes.code === 0 && detailRes.data) {
planData.value = detailRes.data;
loading.value = false;
}
}
} catch (error) {
console.error("获取任务详情失败:", error);
} finally {
loading.value = false;
}
};
common_vendor.onLoad((options) => {
if (options.id) {
fetchTaskDetail(options.id);
}
});
return (_ctx, _cache) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
return common_vendor.e({
a: common_vendor.t(((_a = planData.value) == null ? void 0 : _a.name) || "加载中..."),
b: common_vendor.t((_b = planData.value) == null ? void 0 : _b.taskId),
c: common_vendor.t((_c = planData.value) == null ? void 0 : _c.checkPointId),
d: common_vendor.t(((_d = planData.value) == null ? void 0 : _d.status) === 1 ? "进行中" : "已完成"),
e: progressPercent.value + "%",
f: common_vendor.t(((_e = planData.value) == null ? void 0 : _e.currentIndex) || 0),
g: common_vendor.t(((_f = planData.value) == null ? void 0 : _f.totalCount) || 0),
h: ((_g = planData.value) == null ? void 0 : _g.point) || "",
i: common_vendor.t(((_h = planData.value) == null ? void 0 : _h.result) || "暂无结果"),
j: common_vendor.t(((_i = planData.value) == null ? void 0 : _i.remark) || "暂无备注"),
k: ((_j = planData.value) == null ? void 0 : _j.isLast) === false
}, ((_k = planData.value) == null ? void 0 : _k.isLast) === false ? {} : {});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-432c3f4c"]]);
wx.createPage(MiniProgramPage);