123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- <!-- 系统管理 -->
- <div id="systemList" class="plg-tab-container">
- <div class="view">
- <div id="system" class="grid-container-full"></div>
- </div>
- </div>
- <script type="text/javascript">
- /**
- * guoj
- * 2018.11.01
- * 系统管理
- */
- (function () {
- var guodids = "";
- var system = { "search": "%", "pageNum": 1, "pageSize": 10 };
- var opts = {
- //terrace显示全部,card分页显示
- skin: "card",
- //renderer:"grid",
- columns: [
- { id: "p_id", name: "系统ID", type: 'txt', width: "130", hidden: true },
- { id: "p_systemid", name: "系统编号", type: 'ro', width: "100" },
- { id: "p_systemname", name: "系统名称", type: 'ro', width: "100" },
- { id: "p_modifierid", name: "修饰物", type: 'ro', width: "100" },
- { id: "p_modifiername", name: "修饰名", type: 'ro', width: "100" },
- { id: "p_platformid", name: "板状", type: 'ro', width: "100" },
- { id: "p_enable", name: "是否启用", type: 'ch', width: "100" },
- { id: "p_createtime", name: "创建时间", type: 'ro', width: "150" },
- { id: "p_lastmodifytime", name: "最后修改时间", type: 'ro', width: "150" },
- { id: "p_creatorid", name: "创建人", type: 'ro', width: "100" },
- { id: "p_creatorname", name: "创建人名称", type: 'ro', width: "100" },
- {
- id: "op", name: "操作", type: 'button', align: "left", fixed: 'right', width: "*", render: function (v, record) {
- return "删除^system_deleteClick,修改^system_updataClick";
- }
- }
- ],
- // multiselect: true,
- toolbar: [
- { type: "newcolumn", offset: 10 },
- { type: "input", name: "search", label: "系统编号/名称:", tooltip: 'll', width: 260 },
- { type: "newcolumn", offset: 10 },
- { type: "button", name: "querywork", width: 50, value: "查询" }, { type: "newcolumn" },
- { type: "button", name: "sys_Reset", width: 50, className: " normal",value: "重置" }, { type: "newcolumn" },
- { type: "button", name: "impandexpBtn", width: 80, offsetLeft: 10, className: "plg-toolbar-right normal", value: "<i class='layui-icon layui-icon-file-b'></i>导入/导出" }, { type: "newcolumn" },
- { type: "button", name: "addBtn", width: 50, offsetLeft: 10, className: "plg-toolbar-right", value: "<i class='layui-icon layui-icon-add-1'></i>新增" }, { type: "newcolumn" },],
- formData: [
- { type: "settings", position: "label-left", width: 300, labelWidth: 80 },
- { type: "hidden", name: "p_id", label: "id:", tooltip: 'll', width: 100 },
- { type: "input", name: "p_systemid", label: "系统编号:", tooltip: 'll', width: 260, editable: false, validate: "NotEmpty", required: true },
- { type: "input", name: "p_systemname", label: "系统名称:", tooltip: 'll', width: 260, validate: "NotEmpty", required: true },
- { type: "input", name: "p_modifierid", label: "修饰物:", tooltip: 'll', width: 260 },
- { type: "input", name: "p_modifiername", label: "修饰名:", tooltip: 'll', width: 260 },
- { type: "input", name: "p_platformid", label: "板状:", tooltip: 'll', width: 260 },
- { type: "checkbox", name: "p_enable", label: "是否启用:", tooltip: 'll', width: 260 }],
- imagePath: "/prologui/assets/PlgGrid",
- // /api/service-users/
- url: "/api/service-users/sys/getIPlgFxSystemPage/v1.0",//数据接口
- type: "POST",//数据提交方式,默认为get
- // pagebar: {
- // buttons: [
- // { text: "<i class='layui-icon layui-icon-delete '></i>删除", className: "layui-btn layui-btn-primary layui-btn-sm", name: "delete" }
- // ],
- // type: 'simple' //full simple
- // },
- // contentType: "application/json",
- params: system,//查询提交参数,分页参数默认为pageNum,pageSize
- page: true, //是否启用分页
- totalCount: "totalCount" //总记录数字段,默认totalCount
- };
- //分页参数 pageSize pageNum
- var grid = new PlgGrid(opts);
- grid.renderTo("system");
- grid.loadData();
- //单击事件
- grid.on("onRowSelect", function (id, ind) {
- guodids = id;
- });
- //按钮添加方法
- grid.attachToolBarEvent("onButtonClick", function (name) {
- if (name == "querywork") {
- var fdata = grid.getToolBarForm().getFormData();
- grid.setParams(fdata);
- grid.reload();
- }
- if (name == "addBtn") {
- grid.showDialog(0, '新增', 400, 500, { url: "/api/service-users/sys/insertPlgFxSystem/v1.0", type: 'post', contentType: 'application/json' });
- }
- if (name == "impandexpBtn") {
- utilImportGJ("/download/工作台模板.xlsx", "/api/service-users/container/deleteContainer/v1.0");
- }
- if (name == "sys_Reset") {
- grid.getToolBarForm().clear();
- }
- });
- //双击事件
- grid.on("onRowDblClicked", function (id, ids) {
- grid.showDialog(1, '编辑', 400, 500, { url: "/api/service-users/sys/updatePlgFxSystem/v1.0", type: 'put', contentType: 'application/json' });
- });
- //删除
- window.system_deleteClick = function (rid, data) {
- var data = { "id": rid };
- utilDelete("/api/service-users/sys/deletePlgFxSystemById/v1.0", "post", data, function (data) {
- layer.msg(data.message);
- grid.reload();
- });
- }
- //修改
- window.system_updataClick = function (rid, data) {
- grid.selectRowById(rid);
- grid.showDialog(1, '编辑', 400, 500, { url: "/api/service-users/sys/updatePlgFxSystem/v1.0", type: 'put', contentType: 'application/json' });
- }
- })()
- </script>
|