first commit
This commit is contained in:
155
unpackage/dist/dev/mp-weixin/pages/index/index.js
vendored
Normal file
155
unpackage/dist/dev/mp-weixin/pages/index/index.js
vendored
Normal file
@@ -0,0 +1,155 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const _sfc_main = {
|
||||
__name: "index",
|
||||
setup(__props) {
|
||||
const loading = common_vendor.ref(true);
|
||||
const infoList = common_vendor.ref([
|
||||
{
|
||||
name: "成员管理",
|
||||
src: "../../static/组 19378.png"
|
||||
},
|
||||
{
|
||||
name: "企业信息填报",
|
||||
src: "../../static/组 19387.png"
|
||||
},
|
||||
{
|
||||
name: "区域设置",
|
||||
src: "../../static/组 20253.png"
|
||||
},
|
||||
{
|
||||
name: "检查表",
|
||||
src: "../../static/组 20254.png"
|
||||
},
|
||||
{
|
||||
name: "检查记录",
|
||||
src: "../../static/组 20255.png"
|
||||
},
|
||||
{
|
||||
name: "证照管理",
|
||||
src: "../../static/组 20256.png"
|
||||
},
|
||||
{
|
||||
name: "隐患排查",
|
||||
src: "../../static/组 20257.png"
|
||||
},
|
||||
{
|
||||
name: "隐患销号申请",
|
||||
src: "../../static/组 20258.png"
|
||||
},
|
||||
{
|
||||
name: "设备登记",
|
||||
src: "../../static/组 20259.png"
|
||||
}
|
||||
]);
|
||||
const ViewDetails = (item) => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/plandetail/plandetail?id=${item.id}`
|
||||
});
|
||||
};
|
||||
const goDetails = (item) => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/Inspectionresult/Inspectionresult?id=${item.id}`
|
||||
});
|
||||
};
|
||||
const Inspectionwarning = () => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/Inspectionwarning/Inspectionwarning"
|
||||
});
|
||||
};
|
||||
const my = () => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/personalcenter/my"
|
||||
});
|
||||
};
|
||||
const handleMenuClick = (item) => {
|
||||
const menuRoutes = {
|
||||
"成员管理": "/pages/membermanagemen/membermanagemen",
|
||||
"企业信息填报": "/pages/corporateInformation/corporateInformation",
|
||||
"区域设置": "/pages/area/management",
|
||||
"检查表": "/pages/checklist/checklist",
|
||||
"检查记录": "/pages/Inspectionlog/Inspectionlog",
|
||||
"证照管理": "/pages/Idphotomanagement/Idphotomanagement",
|
||||
"隐患排查": "/pages/hiddendanger/Inspection",
|
||||
"隐患销号申请": "/pages/closeout/application",
|
||||
"设备登记": "/pages/equipmentregistration/equipmentregistration"
|
||||
// 可以在这里添加其他菜单的跳转路径
|
||||
};
|
||||
const url = menuRoutes[item.name];
|
||||
if (url) {
|
||||
common_vendor.index.navigateTo({ url });
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: "功能开发中", icon: "none" });
|
||||
}
|
||||
};
|
||||
const checkPlanParams = common_vendor.ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: ""
|
||||
});
|
||||
const checkPlanData = common_vendor.ref([]);
|
||||
const getCheckPlanLists = async () => {
|
||||
try {
|
||||
const res = await request_api.getCheckPlanList(checkPlanParams.value);
|
||||
console.log(res);
|
||||
if (res.code === 0) {
|
||||
checkPlanData.value = res.data.records;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
const formatDate = (dateStr) => {
|
||||
if (!dateStr)
|
||||
return "";
|
||||
return dateStr.split(" ")[0];
|
||||
};
|
||||
common_vendor.onLoad(() => {
|
||||
getCheckPlanLists();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.f(infoList.value, (item, index, i0) => {
|
||||
return {
|
||||
a: item.src,
|
||||
b: common_vendor.t(item.name),
|
||||
c: index,
|
||||
d: common_vendor.o(($event) => handleMenuClick(item), index)
|
||||
};
|
||||
}),
|
||||
b: checkPlanData.value.length === 0
|
||||
}, checkPlanData.value.length === 0 ? {} : {}, {
|
||||
c: common_vendor.f(checkPlanData.value, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.name),
|
||||
b: common_vendor.t(item.runModeName),
|
||||
c: common_vendor.t(item.cycle),
|
||||
d: common_vendor.t(formatDate(item.planStartTime)),
|
||||
e: common_vendor.t(formatDate(item.planEndTime)),
|
||||
f: item.progress + "%",
|
||||
g: common_vendor.t(item.progress),
|
||||
h: common_vendor.t(item.totalCount),
|
||||
i: common_vendor.t(item.totalCount - item.finishedCount),
|
||||
j: common_vendor.t(item.finishedCount),
|
||||
k: common_vendor.o(($event) => ViewDetails(item), item.id),
|
||||
l: common_vendor.o(($event) => goDetails(item), item.id),
|
||||
m: item.id
|
||||
};
|
||||
}),
|
||||
d: common_assets._imports_0,
|
||||
e: common_assets._imports_1,
|
||||
f: common_assets._imports_2,
|
||||
g: common_assets._imports_3,
|
||||
h: common_vendor.o(($event) => Inspectionwarning()),
|
||||
i: common_assets._imports_4,
|
||||
j: common_vendor.o(($event) => my())
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1cf27b2a"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
Reference in New Issue
Block a user