target/classes/static/js/user/teacher/index.js

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

var GET_TABLE_URL = '/user/teacher';
var EDIT_DATA_URL = 'http://localhost:8080/user/teacher/add.html?teacherId=';
var DELETE_DATA_URL = "http://localhost:8080/user/teacher/delete";

var TABLE_LIST_NAME = 'teacherList';

layui.use(['table','form'], function () {
    var table = layui.table;
    // 菜单表格渲染
    table.render({
        elem: '#tableList',
//        height: 312,
        url: GET_TABLE_URL,
        parseData: function (res) { //res 即为原始返回的数据
            return {
                "code": res.code, //解析接口状态
                "msg": res.message, //解析提示文本
                "count": res.data.total, //解析数据长度
                "data": res.data.teacherList //解析数据列表
            }
        },
        page: true,
        cols: [
            [
                { field: 'id',title: 'ID',sort: true,fixed: 'left'},
                { field: 'username', title: '教师姓名'},
                { field: 'password', title: '教师密码'},
                { field: 'age', title: '年纪'},
                { field: 'sex', title: '性别'},
                { field: 'phone', 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) {
            if (data.code === 200) {
                layer.msg('删除成功');
            } else {
                layer.msg('删除成功');
            }
后面还有 31 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。