You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

166 lines
5.8 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>点击单元格变色</title>
<link rel="stylesheet" href="../../../component/layui/css/layui.css" />
<link rel="stylesheet" href="../../../component/pear/css/module/toast.css" />
<style>
th {
color: #303133;
background-color: #f5f7fa;
}
.layui-card {
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0) !important;
margin-bottom: 0 !important;
}
.layui-form-item {
margin-bottom: 0;
}
.layui-table td,
.layui-table th {
font-size: 12px;
}
.bp {
background-color: rgba(23, 179, 163, .1);
padding: 5px 10px;
height: 32px;
line-height: 30px;
font-size: 12px;
color: #17b3a3;
border-radius: 4px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border: 1px solid rgba(23, 179, 163, .2);
white-space: nowrap;
}
.xp {
background-color: rgba(144, 147, 153, .1);
padding: 5px 10px;
height: 32px;
line-height: 30px;
font-size: 12px;
color: #909399;
border-radius: 4px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border: 1px solid rgba(144, 147, 153, .2);
white-space: nowrap;
}
</style>
</head>
<body class="layui-form">
<div class="layui-card">
<div class="layui-card-body">
<div class="layui-form-item layui-inline">
<button class="layui-btn layui-btn-sm" lay-submit lay-filter="add">
<i class="layui-icon layui-icon-add-1"></i>
新 增
</button>
</div>
<table class="layui-table" id="myTable"></table>
</div>
</div>
<script src="../../../component/layui/layui.js"></script>
<script src="../../../component/pear/xm-select.js"></script>
<script>
layui.extend({
toast: '../../../component/pear/module/toast' // {/}的意思即代表采用自有路径,即不跟随 base 路径
}).use(['toast'], function () {
var $ = layui.jquery;
var table = layui.table;
var form = layui.form;
table.render({
elem: '#myTable',
url: '/QingLong/zbdc/getFill',
where: {
km_code: "xxyl",
level_filter: "",
page: 1,
limit: 100
},
cellExpandedMode: "tips",
height: 'full-70',
cols: [
[
{ title: '序号', align: 'center', width: "60", type: 'numbers', rowspan: 2 },
{ title: '类别', field: 'level', align: 'center', width: "160", rowspan: 2 },
{ title: '主要设备', field: 'level', align: 'center', width: "160", rowspan: 2 },
{ title: '品牌', field: 'level', align: 'center', width: "110", rowspan: 2 },
{ title: '型号', field: 'level', align: 'center', width: "110", rowspan: 2 },
{ title: '现状', field: 'level', align: 'center', colspan: 3 },
{ title: '工作状态', field: 'level', align: 'center', colspan: 6 },
{ title: '网络带宽MB', field: 'level', align: 'center', width: "135", rowspan: 2 },
{ title: '网络服务供应商', field: 'level', align: 'center', width: "135", rowspan: 2 },
{ title: '操作', align: 'center', width: "110", rowspan: 2 }
],
[
{ title: '具体装备情况', field: 'level', align: 'center', width: "115", rowspan: 2 },
{ title: '台数', field: 'level', align: 'center', width: "60", rowspan: 2 },
{ title: '启用日期', field: 'level', align: 'center', width: "110", rowspan: 2 },
{ title: '正常使用(台)', field: 'level', align: 'center', width: "110", rowspan: 2 },
{ title: '待修(台)', field: 'level', align: 'center', width: "90", rowspan: 2 },
{ title: '在修(台)', field: 'level', align: 'center', width: "90", rowspan: 2 },
{ title: '闲置(台)', field: 'level', align: 'center', width: "90", rowspan: 2 },
{ title: '其他(台)', field: 'level', align: 'center', width: "90", rowspan: 2 },
{ title: '其它(说明原因)', field: 'level', align: 'center', width: "125", rowspan: 2 },
]
],
// skin: 'line',
defaultToolbar: [],
parseData: function (res) {
for (var i = 0; i < res.data.length; i++) {
res.data[i].level = "2024-04-28";
}
return res;
}
});
form.on('submit(add)', function () {
layer.open({
type: 2,
title: '新增',
shade: 0.1,
area: ['930px', '512px'],
content: './xxjszb_jchj_add.html'
});
// 阻止表单的默认提交行为
return false;
});
});
</script>
</body>
</html>