From 4642b1a6ae5c8cd245aeabcc9cccce260b405542 Mon Sep 17 00:00:00 2001 From: "liang.chao" <1360241448@qq.com> Date: Wed, 2 Apr 2025 18:53:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86=E5=89=8D?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/static/js/system/processes.js | 60 +++++++++---------- .../resources/static/js/system/userMge.js | 25 ++++---- .../static/pages/processes/processes.html | 2 +- .../resources/static/pages/user/userMge.html | 2 +- 4 files changed, 41 insertions(+), 48 deletions(-) diff --git a/src/main/resources/static/js/system/processes.js b/src/main/resources/static/js/system/processes.js index d22e245..a3407a4 100644 --- a/src/main/resources/static/js/system/processes.js +++ b/src/main/resources/static/js/system/processes.js @@ -1,12 +1,12 @@ let form, layer, dtree, table, tableIns; let pageNum = 1, limitSize = 10; // 默认第一页,分页数量为10 -let orgData,selectOrgId=""; +let orgData, selectOrgId = ""; layui.config({ base: "../../js/layui-v2.6.8/dtree/", //此处路径请自行处理, 可以使用绝对路径 }).extend({ dtree: 'dtree' -}).use(['form', 'layer', 'table','dtree', 'laydate'], function () { +}).use(['form', 'layer', 'table', 'dtree', 'laydate'], function () { form = layui.form; layer = layui.layer; table = layui.table; @@ -20,10 +20,11 @@ layui.config({ 'processId': obj.value, 'status': obj.elem.checked ? 1 : 0 } - params={ - encryptedData:encryptCBC(JSON.stringify(params)) + params = { + encryptedData: encryptCBC(JSON.stringify(params)) } - ajaxRequest(url, "POST", params, true, function () {}, function (result) { + ajaxRequest(url, "POST", params, true, function () { + }, function (result) { console.log(result) reloadData(); if (result.status === 200) { @@ -89,24 +90,26 @@ function initTable(dataList, limit, page) { cols: [ [ //表头 - {title: "序号", width: 80, unresize: true, align: "center", + { + title: "序号", width: 80, unresize: true, align: "center", templet: function (d) { return (page - 1) * limit + d.LAY_INDEX; } }, {field: "professionName", title: "专业", unresize: true, align: "center"}, {field: "processName", title: "工序", unresize: true, align: "center"}, - {field: "status", title: "状态", align: "center",templet: '#is-state'}, - {field: "createTime", title: "创建时间", align: "center",templet: 'center'}, - {title: "操作", unresize: true, width: 300, align: "center", + {field: "status", title: "状态", align: "center", templet: '#is-state'}, + {field: "createTime", title: "创建时间", align: "center", templet: 'center'}, + { + title: "操作", unresize: true, width: 300, align: "center", templet: function (d) { let html = ''; // let updaetpwd=""; - let del="" - let edit=""; - html=edit+del; - if(d.delFlag==1){ + let del = "" + let edit = ""; + html = edit + del; + if (d.delFlag == 1) { return ''; } return html; @@ -127,21 +130,15 @@ function initTable(dataList, limit, page) { // 获取参数 function getReqParams(page, limit, type) { let obj = {}; - if (!type) { - obj = { - page: page + "", - limit: limit + "", - keyWord: $('#keyWord').val(), - - }; - } else { - obj = { - page: '1', - limit: '10', - keyWord: '', - }; + if (type === 2) { + $('#keyWord').val('') + layui.form.render(); } - console.log(obj) + obj = { + page: page + "", + limit: limit + "", + keyWord: $('#keyWord').val(), + }; obj={ encryptedData:encryptCBC(JSON.stringify(obj)) } @@ -151,7 +148,7 @@ function getReqParams(page, limit, type) { // 查询/重置 function query(type) { pageNum = 1; - pages(1, limitSize); + pages(1, limitSize, type); } @@ -173,6 +170,7 @@ function reloadData() { } openIframe2("addMajorTemp", title, "child/addMajorForm.html", '800px', '200px', param); }*/ + //新增/修改工序 function addProcesses(processId) { let title = '新增工序' @@ -182,7 +180,7 @@ function addProcesses(processId) { let param = { 'processId': processId } - console.log(param+"param") + console.log(param + "param") openIframe2("addProcessesTemp", title, "child/addProcessesForm.html", '800px', '300px', param); } @@ -196,8 +194,8 @@ function delData(processId) { let params = { 'processId': processId } - params={ - encryptedData:encryptCBC(JSON.stringify(params)) + params = { + encryptedData: encryptCBC(JSON.stringify(params)) } ajaxRequest(url, "DELETE", params, true, function () { }, function (result) { diff --git a/src/main/resources/static/js/system/userMge.js b/src/main/resources/static/js/system/userMge.js index 255f59d..23c73d0 100644 --- a/src/main/resources/static/js/system/userMge.js +++ b/src/main/resources/static/js/system/userMge.js @@ -144,22 +144,17 @@ function initTable(dataList, limit, page) { // 获取参数 function getReqParams(page, limit, type) { let obj = {}; - if (!type) { - obj = { - page: page + "", - limit: limit + "", - keyWord: $('#keyWord').val(), - }; - } else { - obj = { - page: '1', - limit: '10', - keyWord: '', - }; + if (type === 2) { + $('#keyWord').val('') + layui.form.render(); } - console.log(obj) obj = { - encryptedData: encryptCBC(JSON.stringify(obj)) + page: page + "", + limit: limit + "", + keyWord: $('#keyWord').val(), + }; + obj={ + encryptedData:encryptCBC(JSON.stringify(obj)) } return obj; } @@ -182,7 +177,7 @@ function query(type) { }); }*/ pageNum = 1; - pages(1, limitSize); + pages(1, limitSize,type); } diff --git a/src/main/resources/static/pages/processes/processes.html b/src/main/resources/static/pages/processes/processes.html index f8294ad..435cdb8 100644 --- a/src/main/resources/static/pages/processes/processes.html +++ b/src/main/resources/static/pages/processes/processes.html @@ -30,7 +30,7 @@
-