projecteqareaview.js 1.98 KB
let action = null;

layui.config({
    base: "/js/",
    version: 111
}).use(['system'], function () {
    var form = layui.form,
        $ = layui.jquery,
        system = layui.system,
        sysU = new system.u(),
        areaName = 'configure',
        tableName = 'BaseProject';

    action = {
     
    }

    var app = {
        data: {
            cols: null,
            tableIns: null,
            tableElem: "mainList",
          
            selectOption: {
                //返回的数据 用于后续操作
                selectData: {

                }
            }
        },
        methods: {
            initTable: function () {
                let options = {
                    elem: "#" + app.data.tableElem,
                    url: `/${areaName}/${tableName}/Load`,
                    cols: sysU.columnRecord(app.data.tableElem, app.data.cols),
                    toolbar: '#toolbarTable',
                }
                app.data.tableIns = sysU.initTable(options);
            },
            initFrom: function () {
                //sysU.initSelect(app.data.selectOption);
                debugger
                var imgInfo = "暂未设计车间设备区域布局图",
                    projectName = "".GetUrlParam("projectName"),
                    imgSrcKey = "".GetUrlParam("projectCode"),
                    eqAreaImgList = sysU.arrFilterByProperty("DictType", "eq_area_img"),
                    dic = eqAreaImgList.filter(item => item["DictLabel"] == imgSrcKey);
                if (dic.length == 1) {              
                    $("#eq_area_img").attr("src", dic[0].DictValue);
                    imgInfo = "车间设备区域布局图";
                } 
                $("#projectNameEle").text(`${projectName}${imgInfo}`).show();
            },
        

        },
        registerEvent: function () {

        },
      
        init: function () {
            app.registerEvent();
            app.methods.initFrom();
        }
    };
    app.init();
});