老师,请回答
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<!-- <link rel='stylesheet' href='./css/pop.css' /> -->
<link rel='stylesheet' href='./layui/css/layui.css' />
<script src="config.js"></script>
<script src="./layui/layui.js"></script>
<script src='./js/jquery-1.10.2.min_65682a2.js'></script>
<style>
.lll{
width: 64px;
position: absolute;
right: 53px;
top: 22px;
}
.one{
/* background:rgb(6,127,146) ; */
background:#1B55A0;
color: #fff!important;
}
#pro{
margin: 0 auto;
/* margin-top: 15px; */
margin-top:35px;
font-size:18px;
width:1500px;
/* min-width: 1200px;
max-width: 1500px; */
}
#pro .one{
/* background:rgb(6,127,146) ; */
background:#1B55A0;
color: #fff!important;
width: 100px !important;
}
#pro td{
color: #000;
height: 38px;
text-align: center;
padding: 5px 10px;
}
#test1{
text-align: center;
}
#pro2{
margin: 0 auto;
margin-top: 15px;
font-size:18px;
}
#pro2 td{
color: #000;
height: 38px;
text-align: center;
padding: 5px 10px;
width: 150px;
}
.jwxiu{
background: #1B55A0;
color: #ffffff;
padding: 5px;
cursor: pointer;
}
.sear_box{
width: 600px;
margin: 0px auto;
position: relative;
}
.sear{
position: absolute;
top: 3px;
left: 64px;
width: 635px;
height: 40px;
border: none;
}
.jwxlk{
position: absolute;
left: 10px;
top: 1px;
}
.jwxlk select{
height: 36px;
border: 0px;
background: #f2f2f2;
}
.layui-input{
padding-left: 100px;
padding-right: 50px;
border-radius: 8px;
background: #f2f2f2;
}
.layui-icon{
position: absolute;
top:3px;
right: 10px;
}
.dingbu{
height: 55px;
width: 1500px;
background-color: #ffffff;
padding-top: 15px;
/* position: fixed; */
left: 0;
top: 0;
}
.people{
padding-left: 200px;
width: 1200px;
height: 500px;
margin-top: 90px;
}
.plook{
height: 50px;
width: 800px;
margin-left: 250px;
margin-bottom: 20px;
}
.touxiang{
width: 50px;
height: 50px;
background: #1e64a9;
color: #FFFFFF;
border-radius: 50%;
font-size: 16px;
line-height: 50px;
text-align: center;
float: left;
}
.xiangxi{
height: 49px;
width: 720px;
border-bottom: 1px solid #e7e7e6;
float: left;
font-size: 20px;
line-height: 49px;
margin-left: 20px;
}
.chakan{
float: right;
margin-right: 20px;
color: #808080;
cursor: pointer;
}
a{
text-decoration:none;
color:#808080;
}
.ck{
color: #000000;
display: inline-block;
width: 300px;
}
.ck:hover{
color: #000000;
}
.xinzeng{
width: 100px;
height: 35px;
background-color: #e7e7e6;
position: absolute;
top: 1px;
right: -250px;
border-radius: 8px;
font-size: 20px;
line-height: 35px;
text-align: center;
}
.xinzeng a{
display: inline-block;
width: 80px;
}
</style>
</head>
<body>
<div class="dingbu">
<div class="sear_box">
<div class="jwxlk">
<select name="interest" lay-filter="aihao">
<option value="">搜索</option>
<option value="010">按名称</option>
<option value="021">按编号</option>
</select>
</div>
<input type="text" placeholder="请输入内容" class="layui-input">
<i class="layui-icon sousuo" style="font-size: 28px; color: #000000;"></i>
<div class="xinzeng" onclick="xinzeng()">添加</div>
</div>
</div>
<table id='pro' border="2">
<thead>
<tr>
<td class="one">项目名称</td>
<td class="one">所在地</td>
<td class="one">投资额</td>
<td class="one">开工时间</td>
<td class="one">竣工时间</td>
<td class="one">建设单位</td>
<td class="one">监理单位</td>
<td class="one">施工</td>
<td class="one">状态</td>
<td class="one">操作</td>
</tr>
</thead>
<tbody id='databox'>
</tbody>
</table>
<div id="test1"></div>
<script>
$(function(){
$(document).on("click",".jinxingzhong",function () {
alert(1);
console.log($(this).attr('kl'))
})
xx(1,1,'')
})
function xx(current,init,projectName){
var user = sessionStorage.getItem("deluid");
var add_people = sessionStorage.getItem("add_people");
$.ajax({
url:Projecttable_listBySY, //请求的页面的url
type:"post", //请求的类型,post或get
data:{
pageSize: 10,
pageNum:current,
projectName:projectName,
userId:user
},
success:function(data){
if(add_people==''){
$(".xinzeng").show()
}else if(add_people==0){
$(".xinzeng").show()
}else if(add_people==1){
$(".xinzeng").hide()
}
// layui.use('laytpl', function(){
// var laytpl=layui.laytpl
// var getTpl = datalist.innerHTML
// ,view = document.getElementById('databox');
// laytpl(getTpl).render(data.rows, function(html){
// view.innerHTML = html;
// });
// })
var ht=''
for(i=0;i<data.rows.length;i++){
var p1="<td></td>"
if(data.rows[i].zhuangtai==1){
p1="<td>未完成</td>"
}else if(data.rows[i].zhuangtai==2){
p1="<td>进行中</td>"
}
var p2='<td></td>'
if(data.rows[i].state==0){
p2="<td onclick='chuli(\"" + data.rows[i].id+ "\",\"" + data.rows[i].state+ "\")'><span class='jwxiu'>未开始</span></td>"
}else if(data.rows[i].state==1){
p2="<td onclick='chuli(\"" + data.rows[i].id + "\")'><span class='jwxiu'>进行中<span></td>"
}else if(data.rows[i].state==2){
p2="<td>完成</td>"
}
ht+=
"<tr>"+
"<td>"+data.rows[i].projectName+"</td>"+
"<td>"+data.rows[i].lprojectTypeName+"</td>"+
"<td>"+data.rows[i].leaderName+"</td>"+
"<td>"+data.rows[i].ownerUnit+"</td>"+
"<td>"+data.rows[i].projectLocation+"</td>"+
"<td>"+data.rows[i].leaderName+"</td>"+
"<td>"+data.rows[i].ownerUnit+"</td>"+
"<td>"+data.rows[i].projectLocation+"</td>"+
p1+
p2
"<tr>"
}
$('#databox').html(ht)
if(init==1){
layui.use('laypage', function(){
var laypage = layui.laypage;
//执行一个laypage实例
laypage.render({
elem: 'test1' //注意,这里的 test1 是 ID,不用加 # 号
,count: data.total
,limit:10
,jump: function(obj, first){
xx(obj.curr,0,projectName)
}
});
});
}
}
})
}
function xinzeng(){
location.href='JXMSJTJ.html'
}
function chuli(val,asd){
console.log(val,asd,'0000000000000')
layui.use('layer', function(){
layer.confirm("是否结束当前项目", {
icon: 3,
title: '提示'
}, function(index) {
$.ajax({
url:Projecttable_achieve, //请求的页面的url
type:"post", //请求的类型,post或get
data:{
id:val
},
success:function(data){
if(asd!=0){
layer.open({
title: '项目进度',
area: ['700px', '70%'],
offset: '100px',
type: 1,
content: $('#slist')
});
}
if(data.data){
console.log(data.data,'data.data22222222')
var ht=''
for(i=0;i<data.data.length;i++){
var p1="<td></td>"
if(data.data[i].state==0){
p1="<td>未开始</td>"
}else if(data.data[i].state==1){
p1="<td>进行中</td>"
}else if(data.data[i].state==2){
p1="<td>完成</td>"
}
ht+=
"<tr>"+
"<td>"+data.data[i].projectName+"</td>"+
"<td>"+data.data[i].username+"</td>"+
p1+
"<td>"+data.data[i].createDate+"</td>"+
"</tr>"
$('#pro_body').html(ht)
}
}else{
xx(1,1,'')
}
}
})
layer.close(index);
}, function(index) {
layer.close(index);
});
});
}
function sear(){
var name=$('#search').val()
xx(1,1,name)
}
</script>
</body>
<div id='slist' style="display: none;">
<!-- <div id='slist' > -->
<table id='pro2' >
<thead>
<tr>
<td class="one">表格名称</td>
<td class="one">姓名</td>
<td class="one">状态</td>
<td class="one">开始时间</td>
</tr>
</thead>
<tbody id='pro_body'>
</tbody>
</table>
</div>
</html>
这个页面为什么不显示表格里的数据啊,只可以显示表头数据
正在回答 回答被采纳积分+1
- 参与学习 人
- 提交作业 239 份
- 解答问题 10739 个
本阶段带你深入前端开发的肌理,通过ES6基础知识和前端主流高级框架的学习,助你快速构建企业级移动webAPP应用,进入职场的终极battle
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星