Browse Source

发布

tiaosheng-msz
xuesinan 4 years ago
parent
commit
81c010c1b3
  1. 176
      index.html

176
index.html

@ -20,13 +20,13 @@
<div class="w-full p-4 bg-gray-100">
<!-- 日常任务面板-->
<div class="content p-3 h-46 bg-white rounded-lg">
<!-- <div class="content p-3 h-46 bg-white rounded-lg">
<div class="h-6 mb-2 bg-gray-100"></div>
<div class="h-6 mb-2 bg-gray-100"></div>
<div class="h-6 mb-2 bg-gray-100"></div>
<div class="h-6 mb-2 bg-gray-100"></div>
<div class="h-6 bg-gray-100"></div>
</div>
</div> -->
</div>
<div class="task-bar h-96 w-full bg-gray-100 p-4">
<div class="flex mb-3">
@ -37,64 +37,75 @@
</div>
</div> -->
<div class="flex-1" style="height: 13rem;">
<div class="flex-1" style="height: 30rem;">
<div class="rounded-lg bg-white p-3" style="height: 100%;">
<button class="bg-blue-500 py-2 px-5 rounded text-white" onclick="alert('hello')">测试组建1</button>
<button class="bg-blue-500 py-2 px-5 rounded text-white" onclick="p100.show()">测试组建2</button>
<div data-tname="考勤" data-pid="1451447721818071040" data-uid="1217647686598135808" data-rid="rid333" data-tid="tid444" data-did="did555" style="height:50px;width:100%">
<div data-root="p1449944565242142720" style="height:100%;width:100%;">
<div class="train-release">
<div class="title"></div>
<div class="flex justify-between">
<div class="text-sm">培训发布</div>
<button class="release-btn px-2.5 h-6 bg-blue-500 text-sm rounded text-white" onclick="p1449944565242142720.release()">发布</button>
</div>
<div class="mt-2.5 px-2 flex justify-between items-center w-full h-8 border border-gray-200 rounded-sm text-sm">
<p class="file-name text-gray-400 truncate" style="width: calc(100vw - 9rem)"></p>
<button class="text-xs text-blue-400 border border-blue-400 rounded-full w-10 h-5" onclick="p1449944565242142720.checkFile()">查看</button>
<div class="certificate-box px-2 py-1.5 flex justify-between w-full border border-gray-200 rounded-sm text-sm">
<p class="w-20 flex-shrink-0 text-gray-400">红头文件</p>
<div class="certificate py-1 flex justify-end" style="max-width: 100px; max-height: 100px;">
<img style="max-width: 100%; max-height: 100%;" onclick="p1449944565242142720.bigImg()" src="http://test.tall.wiki/staticrec/plan.png" />
</div>
</div>
<div class="student-box mt-2.5 px-2 flex justify-between items-center w-full h-8 border border-gray-200 rounded-sm text-sm" style="display: none;">
<p style="color: #999999;">报名人员</p>
<button class="check-btn text-xs text-blue-400 border border-blue-400 rounded-full w-10 h-5" onclick="p1449944565242142720.studentList()">查看</button>
</div>
<div class="img-preview fixed z-10 inset-0 bg-black bg-opacity-60 p-4 flex justify-center items-center" style="display: none;">
<img id="img" src="http://test.tall.wiki/staticrec/plan.png" />
</div>
<div class="mt-2.5 py-1 w-full border border-gray-200 rounded-sm">
<div class="select-teacher px-2 flex justify-between items-center w-full text-sm">
<p class="text-gray-400 truncate w-20">导师委派</p>
<div class="flex justify-end rounded-md startBtnBox" style="width: calc(100% - 5rem)" onclick="p1449944565242142720.show()">
<div class="startBtn mr-1 text-right" style="width: calc(100% - 15px);">请选择委派导师</div>
<img class="direction-icon" style="width: 15px;" src="https://www.tall.wiki/staticrec/icon/down.svg" />
</div>
<div class="student-box mt-2.5 px-2 py-1.5 flex justify-between items-center w-full border border-gray-200 rounded-sm text-sm">
<p style="color: #999999;">报名人员</p>
<button class="check-btn text-xs text-blue-400 border border-blue-400 rounded-full w-10 h-5" onclick="p1449944565242142720.studentList()">查看</button>
</div>
<div class="mt-2.5 py-1.5 w-full border border-gray-200 rounded-sm">
<div class="select-teacher px-2 flex justify-between items-center w-full text-sm">
<p class="text-gray-400 truncate w-20">导师委派</p>
<div class="flex justify-end rounded-md startBtnBox" style="width: calc(100% - 5rem)" onclick="p1449944565242142720.show()">
<div class="startBtn mr-1 text-right" style="width: calc(100% - 15px);">请选择委派导师</div>
<img class="direction-icon" style="width: 15px;" src="https://www.tall.wiki/staticrec/icon/down.svg" />
</div>
</div>
<ul class="teacher-list flex mt-2 px-2" style="display: none;">
<ul class="teacher-list flex mt-2 px-2" style="display: none;">
</ul>
</div>
</ul>
</div>
<div class="border-2 w-full mt-2.5 flex justify-between p-2 text-sm selected-teacher" style="display: none;">
<p class="mb-1" style="color: #999999;">导师委派</p>
<div class="flex justify-between rounded-md leading-6">
<div class="mr-1">导师</div>
<div class="">未接受</div>
</div>
<div class="flex justify-between rounded-md leading-6">
<div class="mr-1">导师</div>
<div class="text-green-400">已接受</div>
</div>
<div class="flex justify-between rounded-md leading-6">
<div class="mr-1">导师</div>
<div class="text-yellow-400">已拒绝</div>
</div>
<div class="text-xs text-red-400">拒绝原因:拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因</div>
<div class="selected-teacher mt-2.5 p-2 border border-gray-200 rounded-sm w-full text-sm" style="display: none;">
<p class="mb-1" style="color: #999999;">导师委派</p>
<div class="flex justify-between rounded-md leading-7">
<div class="mr-1">导师</div>
<div class="">未接受</div>
</div>
<div class="flex justify-between rounded-md leading-7">
<div class="mr-1">导师</div>
<div class="text-green-500">已接受</div>
</div>
<div class="flex justify-between rounded-md leading-7">
<div class="mr-1">导师</div>
<div class="text-yellow-500">已拒绝</div>
</div>
<div class="text-xs text-yellow-500 leading-5">拒绝原因:拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因</div>
</div>
<div class="mt-4 flex justify-center items-center w-full text-sm">
<button class="border border-blue-500 bg-blue-500 text-white rounded-sm" style="width: 45%; height: 34px;" onclick="p1449944565242142720.release()">发布</button>
</div>
</div>
</div>
<script>
document.querySelector('.img-preview').onclick = function(e){
e = window.event || e;
let parentApp = document.getElementById('img');
if(!parentApp.contains(e.target)){
document.querySelector('.img-preview').style.display = 'none';
}
}
var p1449944565242142720 = {
token: '',
projectId: '',
@ -331,41 +342,56 @@
return false;
}
let ids = [];
for (let i = 0; i < that.selectedTeachers.length; i++) {
ids.push(that.selectedTeachers[i].id);
}
let teacherList = that.dom.querySelector('.selected-teacher'); // 选择导师
let teacherSelect = that.dom.querySelector('.select-teacher'); // 已委派的导师
let releaseBtn = that.dom.querySelector('.release-btn'); // 发布按钮
teacherList.style.display = 'block';
teacherSelect.style.display = 'flex';
releaseBtn.style.display = 'none';
let studentBox = that.dom.querySelector('.student-box'); // 查看学员
studentBox.style.display = 'block';
// let ids = [];
// for (let i = 0; i < that.selectedTeachers.length; i++) {
// ids.push(that.selectedTeachers[i].id);
// }
// fetch(`https://test.tall.wiki/gateway/sports/teacher/appoint`, {
// headers: new Headers({
// 'Authorization': 'Bearer ' + that.token,
// 'Content-Type': 'application/json; charset=utf-8'
// }),
// method: 'POST',
// body: JSON.stringify({
// planId: that.planId,
// teacherIds: ids
// })
// })
// .then(function(response) {
// return response.json();
// })
// .then(function(res) {
// const { success, code, data, msg } = res;
// if (success && code === 200) {
// let teacherList = that.dom.querySelector('.selected-teacher'); // 选择导师
// let teacherSelect = that.dom.querySelector('.select-teacher'); // 已委派的导师
// let releaseBtn = that.dom.querySelector('.release-btn'); // 发布按钮
// teacherList.style.display = 'block';
// teacherSelect.style.display = 'flex';
// releaseBtn.style.display = 'none';
// let studentBox = that.dom.querySelector('.student-box'); // 查看学员
// studentBox.style.display = 'block';
// } else {
// console.log('msg: ', msg);
// }
// });
},
fetch(`https://test.tall.wiki/gateway/sports/teacher/appoint`, {
headers: new Headers({
'Authorization': 'Bearer ' + that.token,
'Content-Type': 'application/json; charset=utf-8'
}),
method: 'POST',
body: JSON.stringify({
planId: that.planId,
teacherIds: ids
})
})
.then(function(response) {
return response.json();
})
.then(function(res) {
const { success, code, data, msg } = res;
if (success && code === 200) {
let teacherList = that.dom.querySelector('.selected-teacher'); // 选择导师
let teacherSelect = that.dom.querySelector('.select-teacher'); // 已委派的导师
let releaseBtn = that.dom.querySelector('.release-btn'); // 发布按钮
teacherList.style.display = 'block';
teacherSelect.style.display = 'none';
releaseBtn.style.display = 'none';
let studentBox = that.dom.querySelector('.student-box'); // 查看学员
studentBox.style.display = 'block';
} else {
console.log('msg: ', msg);
}
});
// 预览
bigImg() {
document.querySelector('.img-preview').style.display = 'flex';
},
// 查看红头文件

Loading…
Cancel
Save