From 49ac2fd3699933cf9f1594d036dca32b89913546 Mon Sep 17 00:00:00 2001 From: xuesinan <1404152492@qq.com> Date: Mon, 1 Nov 2021 11:49:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=A2=E5=A4=B4=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 139 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 83 insertions(+), 56 deletions(-) diff --git a/index.html b/index.html index 11dea05..8d3e6f7 100644 --- a/index.html +++ b/index.html @@ -105,6 +105,13 @@ -->
选择模板
@@ -232,6 +239,8 @@ curIndex: 0, // 当前选择的模板 tempList: [{name: '模板1', organizer: '国家体育总局社会体育指导中心', title: ''}, {name: '模板2', organizer: '', title: ''}, {name: '模板3', organizer: '', title: ''}], tempData: {}, + checkArr: [], + templateId: 0, // 选中的模板id init() { this.dom = document.querySelector("div[data-root=p1449927427387301888]"); @@ -258,9 +267,9 @@ if (success && code === 200) { that.token = data.token; // 查询培训计划 - that.getTrainPlan() + that.getTrainPlan(); // 查询所有模板 - that.getAllTemp(); + // that.getAllTemp(); } else { console.log('msg: ', msg); } @@ -288,29 +297,17 @@ .then(function(res) { const { success, code, data, msg } = res; if (success && code === 200) { - // if (!data) { - // that.showOrHide(1, -1, 0, 0); - // } else { - // that.dom.querySelector('.train-name').value = data.name; - // that.dom.querySelector('.train-desc').value = data.description; - // let start = that.format(data.startTime); - // that.dom.querySelector('.train-start-time').value = that.format(data.startTime); - // that.dom.querySelector('.train-end-time').value = that.format(data.endTime); - // that.fileId = data.fileId; - // that.filePath = data.path; - // that.dom.querySelector('.file-name').innerHTML = data.name; - // console.log(data.startTime, start) - - // if (data && data.checkStatus === 0) { - // that.showOrHide(1, 0, 1, 0); - // } else if (data && data.checkStatus === 2) { - // that.showOrHide(1, 2, 1, 1); - // that.dom.querySelector('.reason').innerHTML = data.rejectCause; - // } else { - // that.showOrHide(2, 0, 0, 0); - // } - // } - // that.tempData = data; + that.getAllTemp(); + if (data) { + if (data.checkStatus === 0) { + that.dom.querySelector('.status-box').style.display = 'flex'; + } + + that.templateId = data.templateId; + that.tempData = data.trainingInfos; + that.renderTempData(); + } + } else { console.log('msg: ', msg); } @@ -365,6 +362,7 @@ } temps[index].classList.add("border-blue-400"); this.curIndex = index; + this.templateId = obj.id; this.getTempData(obj.id); }, @@ -403,12 +401,14 @@ // 渲染模板 renderTemp() { let that = this; - // this.tempList let html = ''; - for (let j = 0; j < that.tempList.length; j++) { - html += `${data.question}
- +${data.question}
- +${data.question}
`; - html += `${data.question}
- +