Commit e62711ae by chenwq

feat(环境配置): 将默认环境索引改为2并添加日报模板列表

修改config.js中的默认环境索引为2以匹配预发布环境
在supervisorDaily.js中添加dailyReportTempList集中管理日报模板,替换多处硬编码的模板检查逻辑
1 parent 0d7f0f0a
...@@ -18,7 +18,7 @@ export const appId = "wx570d9331f9ace0bd"; ...@@ -18,7 +18,7 @@ export const appId = "wx570d9331f9ace0bd";
* 4预发布 * 4预发布
* 5cdptest * 5cdptest
*/ */
let index = 1; let index = 2;
const accountInfo = wx.getAccountInfoSync(); const accountInfo = wx.getAccountInfoSync();
const systemInfo = wx.getSystemInfoSync(); const systemInfo = wx.getSystemInfoSync();
const envName = accountInfo.miniProgram.envVersion; const envName = accountInfo.miniProgram.envVersion;
......
...@@ -35,6 +35,7 @@ Page({ ...@@ -35,6 +35,7 @@ Page({
tabActive: "", tabActive: "",
tabList: [], tabList: [],
dataAttrName: "tmlpFormData", dataAttrName: "tmlpFormData",
dailyReportTempList: ["qinggai-temp-001", "uuid-temp-001", "uuid-temp-011"],
/** 模版表单数据对象 /** 模版表单数据对象
* { 模版key: [ 模版下面的表单项数据对象 ] } * { 模版key: [ 模版下面的表单项数据对象 ] }
*/ */
...@@ -161,7 +162,7 @@ Page({ ...@@ -161,7 +162,7 @@ Page({
radioEvent(e) { radioEvent(e) {
let pAttr = e.target.id; let pAttr = e.target.id;
let { attr } = e.detail; let { attr } = e.detail;
let { tmlpFormData, tmlpObj, trainTmlpSuffix, tmlpCode } = this.data; let { tmlpFormData, tmlpObj, trainTmlpSuffix, tmlpCode, dailyReportTempList } = this.data;
tmlpObj["organizeTraining" + trainTmlpSuffix]?.forEach((item) => { tmlpObj["organizeTraining" + trainTmlpSuffix]?.forEach((item) => {
if (!item.name.includes("isTrainingOrganized")) { if (!item.name.includes("isTrainingOrganized")) {
item.isHide = tmlpFormData[attr] == "否" ? true : false; item.isHide = tmlpFormData[attr] == "否" ? true : false;
...@@ -181,7 +182,7 @@ Page({ ...@@ -181,7 +182,7 @@ Page({
} }
const pAttrList = Object.keys(allRuleObj); const pAttrList = Object.keys(allRuleObj);
console.log(tmlpCode, "pAttrList---"); console.log(tmlpCode, "pAttrList---");
if (["qinggai-temp-001", "uuid-temp-001"].includes(tmlpCode)) { if (dailyReportTempList.includes(tmlpCode)) {
pAttrList.forEach((pAttrItem) => { pAttrList.forEach((pAttrItem) => {
tmlpObj[pAttrItem].forEach((item) => { tmlpObj[pAttrItem].forEach((item) => {
if (!item.name.includes("dayOffStatus")) { if (!item.name.includes("dayOffStatus")) {
...@@ -304,6 +305,7 @@ Page({ ...@@ -304,6 +305,7 @@ Page({
currentYear, currentYear,
selectedMonth, selectedMonth,
selectedWeek, selectedWeek,
dailyReportTempList
} = this.data; } = this.data;
console.log(tmlpEditList, "tmlpEditList"); console.log(tmlpEditList, "tmlpEditList");
console.log(tmlpCode, "tmlpCode"); console.log(tmlpCode, "tmlpCode");
...@@ -337,7 +339,7 @@ Page({ ...@@ -337,7 +339,7 @@ Page({
} }
this.setData({ this.setData({
hasDailyValue: false, hasDailyValue: false,
isTodayEdit: ["qinggai-temp-001", "uuid-temp-001"].includes(tmlpCode), isTodayEdit: dailyReportTempList.includes(tmlpCode),
}); });
wx.$util.showLoading(); wx.$util.showLoading();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!