WebRoot/res/js/noticeList.js

(开头部分) 5KB

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

layui.use(['form','layer','laydate','table','laytpl'],function(){
    var form = layui.form,
        layer = parent.layer === undefined ? layui.layer : top.layer,
        $ = layui.jquery,
        laytpl = layui.laytpl,
        table = layui.table;

    //列表
    var tableIns = table.render({
        elem: '#noticeList',
        url : '/CMS/notice/list.html',
        request: {
        	pageName: 'curr' 
        	,limitName: 'nums'
        },
        where: {
            searchKey: $(".searchVal").val()
        },
        cellMinWidth : 95,
        page : true,
        height : "full-125",
        limit : 10,
        limits : [10,15,20,25],
        id : "noticeListTable",
        cols : [[
            {type: "checkbox", fixed:"left", width:50},
            {field: 'id', title: 'ID', width:60, align:"center"},
            {field: 'title', title: '公告标题', width:350},
            {field: 'author', title: '发布者', align:'center'},
            {field: 'auth', title: '浏览权限',  align:'center',templet:"#noticeStatus"},
            {field: 'date', title: '发布时间', align:'center', minWidth:110 },
            {title: '操作', width:170, templet:'#noticeListBar',fixed:"right",align:"center"}
        ]]
    });


    //搜索
    $(".search_btn").on("click",function(){
        table.reload("noticeListTable",{
            page: {curr: 1},
            where: { searchKey: $(".searchVal").val() }
        });
    });

    //编辑公告
    function addNotice(edit){
        var index = layui.layer.open({
            title : "编辑公告",
            type : 2,
            content : "/CMS/notice/addPage.html",
            success : function(layero, index){
                var body = layui.layer.getChildFrame('body', index);
                if(edit){
                	body.find("#opType").val(1);
                	body.find("#id").val(edit.id);
                	body.find("#title").val(edit.title);
                    body.find("#status").val(edit.auth);
                    body.find("#author").val(edit.author);
                    body.find("#notice_content").val(edit.content);
                    form.render();
后面还有 86 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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