layui.use(["index", "api", "tpl", "dialog", "laypage"], function () { var $ = layui.$, table = layui.table, element = layui.element, form = layui.form, admin = layui.admin, laypage = layui.laypage; var LIST_TABLE_URL = layui.api.getMockApiUrl("detail", "list"); var DELETE_TABLE_URL = layui.api.getMockApiUrl("detail", "detail"); var where = {}; var FORM_QUERY_ID = "lay-form-submit"; // form seach ElementId var LIST_TABLE_ID = "listTable"; // table ElementId var DETAIL_TABLE_ID = "detailTable"; var LIST_TABLE_COLS = [{ field: "id", title: "id", align: "left", hide: true }, { field: "name", title: "源库", align: "left" }, { field: "ip", title: "源库对象名", align: "left" }, { field: "port", title: "目标库", align: "left" }, { field: "sid", title: "目标库对象名", align: "left" }, { fixed: "right", title: "操作", width: 150, align: "left", toolbar: "#cellOperating" }]; var DETAIL_TABLE_COLS = [{ field: "id", title: "id", align: "left", hide: true }, { field: "name", title: "源库列名", align: "left" }, { field: "ip", title: "类型", align: "left" }, { field: "port", title: "目标库列", align: "left" }, { field: "sid", title: "类型", align: "left" }]; init(); form.on("submit(" + FORM_QUERY_ID + ")", function (data) { console.log("查询:", data.field); getTableData(); }); //单元格 操作列中 操作事件 table.on("tool(" + LIST_TABLE_ID + ")", function (obj) { var data = obj.data; var layEvent = obj.event; if (layEvent === "detail") { detailDialog(data); } }); function init() { getDetail(); getSetting(); getTableData(); } function getDetail() { //api 请求得到结果 var data = { id: '5cb92069c3492', name: 'CRM->SCRM[FUL' }; var html = `