src/main/resources/static/js/education/grade/myStudent.js
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
var GET_TABLE_URL = '/user/student?gradeId=';
var EDIT_DATA_URL = 'http://localhost:8080/user/student/add.html?studentId=';
var DELETE_DATA_URL = "http://localhost:8080/user/student/delete";
var TABLE_LIST_NAME = 'studentList';
layui.use(['table','jquery','form'], function () {
var gradeId = document.getElementById("gradeId").value
console.log(gradeId)
var table = layui.table;
// 菜单表格渲染
var url = GET_TABLE_URL+gradeId;
console.log(url)
table.render({
elem: '#tableList',
with: 600,
url: url,
parseData: function (res) { //res 即为原始返回的数据
return {
"code": res.code, //解析接口状态
"msg": res.message, //解析提示文本
"count": res.data.total, //解析数据长度
"data": res.data.studentList //解析数据列表
}
},
page: true,
cols: [
[
{ field: 'id',title: 'ID',sort: true,fixed: 'left'},
{ field: 'username', title: '学生姓名'},
{ field: 'password', title: '学生密码'},
{ field: 'age', title: '年纪'},
{ field: 'sex', title: '性别'},
{ field: 'gradeName', title: '班级'},
{ title: '操作', fixed: 'right',align: 'center', toolbar: '#barTool'},
]
]
});
// 编辑当前行数据
function editCurrentLine (id) {
layer.open({
title :'编辑菜单',
type: 2,
content: EDIT_DATA_URL+id,
area: ['600px', '400px'],
cancel: function(){
table.reload('tableList', {
url: GET_TABLE_URL,
where: {'page': 1, 'limit': 10},
});
}
})
}
// 删除当前行数据
function deleteCurrentLine(obj) {
$.post(DELETE_DATA_URL, obj, function (data) {
后面还有 47 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。