From 30a669b650d59a3d7979ead78dae89e57fdb703a Mon Sep 17 00:00:00 2001 From: wangjiuyun <1595161655@qq.com> Date: Sat, 7 Jun 2025 22:24:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=90=8C=E9=80=89=E6=8B=A9=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=96=B0=E5=A2=9E=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/static/ruoyi/js/ry-ui.js | 373 +++++++++--------- .../resources/templates/project/info/add.html | 18 +- .../templates/project/info/edit.html | 18 +- .../templates/project/info/project.html | 7 +- .../templates/project/info/selectAgent.html | 35 +- .../project/info/selectCustomer.html | 28 ++ .../templates/project/info/selectPartner.html | 27 ++ 7 files changed, 299 insertions(+), 207 deletions(-) diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js index 6af8ab82..bc6df51c 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js @@ -9,7 +9,7 @@ var table = { // 当前实例配置 options: {}, // 设置实例配置 - set: function(id) { + set: function (id) { if ($.common.getLength(table.config) > 1 && $.common.isNotEmpty(event)) { var tableId = $.common.isEmpty(id) ? $(event.currentTarget).parents(".bootstrap-table").find("table.table").attr("id") || $(event.currentTarget).parents(".bootstrap-tree-table").find("table.table").attr("id") : id; if ($.common.isNotEmpty(tableId)) { @@ -18,7 +18,7 @@ var table = { } }, // 获取实例配置 - get: function(id) { + get: function (id) { return table.config[id]; }, // 记住选择实例组 @@ -34,7 +34,7 @@ var table = { // 表格封装处理 table: { // 初始化表格参数 - init: function(options) { + init: function (options) { var defaults = { id: "bootstrap-table", type: 0, // 0 代表bootstrapTable 1代表bootstrapTreeTable @@ -157,30 +157,30 @@ var table = { }); }, // 获取实例ID,如存在多个返回#id1,#id2 delimeter分隔符 - getOptionsIds: function(separator) { + getOptionsIds: function (separator) { var _separator = $.common.isEmpty(separator) ? "," : separator; - var optionsIds = ""; - $.each(table.config, function(key, value){ + var optionsIds = ""; + $.each(table.config, function (key, value) { optionsIds += "#" + key + _separator; }); return optionsIds.substring(0, optionsIds.length - 1); }, // 查询条件 - queryParams: function(params) { + queryParams: function (params) { table.set(); var curParams = { // 传递参数查询参数 - pageSize: params.limit, - pageNum: params.offset / params.limit + 1, - searchValue: params.search, - orderByColumn: params.sort, - isAsc: params.order + pageSize: params.limit, + pageNum: params.offset / params.limit + 1, + searchValue: params.search, + orderByColumn: params.sort, + isAsc: params.order }; var currentId = $.common.isEmpty(table.options.formId) ? $('form').attr('id') : table.options.formId; - return $.extend(curParams, $.common.formToJSON(currentId)); + return $.extend(curParams, $.common.formToJSON(currentId)); }, // 请求获取数据后处理回调函数 - responseHandler: function(res) { + responseHandler: function (res) { if (typeof table.get(this.id).responseHandler == "function") { table.get(this.id).responseHandler(res); } @@ -191,19 +191,19 @@ var table = { } else { if ($.common.isNotEmpty(thisOptions.rememberSelected) && thisOptions.rememberSelected) { var column = $.common.isEmpty(thisOptions.uniqueId) ? thisOptions.columns[1].field : thisOptions.uniqueId; - $.each(res.rows, function(i, row) { + $.each(res.rows, function (i, row) { row.state = $.inArray(row[column], table.rememberSelectedIds[thisOptions.id]) !== -1; }) } - return { rows: res.rows, total: res.total }; + return {rows: res.rows, total: res.total}; } } else { $.modal.alertWarning(res.msg); - return { rows: [], total: 0 }; + return {rows: [], total: 0}; } }, // 初始化事件 - initEvent: function() { + initEvent: function () { // 实例ID信息 var optionsIds = $.table.getOptionsIds(); // 监听事件处理 @@ -247,10 +247,10 @@ var table = { // 非多个禁用 $('#' + toolbar + ' .multiple').toggleClass('disabled', !rows.length); // 非单个禁用 - $('#' + toolbar + ' .single').toggleClass('disabled', rows.length!=1); + $('#' + toolbar + ' .single').toggleClass('disabled', rows.length != 1); }); // 图片预览事件 - $(optionsIds).off("click").on("click", '.img-circle', function() { + $(optionsIds).off("click").on("click", '.img-circle', function () { var src = $(this).attr('src'); var target = $(this).data('target'); if ($.common.equals("self", target)) { @@ -268,7 +268,7 @@ var table = { } }); // 单击tooltip事件 - $(optionsIds).on("click", '.tooltip-show', function() { + $(optionsIds).on("click", '.tooltip-show', function () { var target = $(this).data('target'); var input = $(this).prev(); if ($.common.equals("copy", target)) { @@ -285,7 +285,7 @@ var table = { }); }, // 当所有数据被加载时触发 - onLoadSuccess: function(data) { + onLoadSuccess: function (data) { if (typeof table.options.onLoadSuccess == "function") { table.options.onLoadSuccess(data); } @@ -301,8 +301,8 @@ var table = { serialNumber: function (index, tableId) { var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId; var tableParams = $("#" + currentId).bootstrapTable('getOptions'); - var pageSize = $.common.isNotEmpty(tableParams.pageSize) ? tableParams.pageSize: table.options.pageSize; - var pageNumber = $.common.isNotEmpty(tableParams.pageNumber) ? tableParams.pageNumber: table.options.pageNumber; + var pageSize = $.common.isNotEmpty(tableParams.pageSize) ? tableParams.pageSize : table.options.pageSize; + var pageNumber = $.common.isNotEmpty(tableParams.pageNumber) ? tableParams.pageNumber : table.options.pageNumber; if (table.options.sidePagination == 'client') { return index + 1; } @@ -316,8 +316,8 @@ var table = { var _target = $.common.isEmpty(target) ? 'copy' : target; if (_value.length > _length) { _text = _value.substr(0, _length) + "..."; - _value = _value.replace(/\'/g,"'"); - _value = _value.replace(/\"/g,"""); + _value = _value.replace(/\'/g, "'"); + _value = _value.replace(/\"/g, """); var actions = []; actions.push($.common.sprintf('', _value)); actions.push($.common.sprintf('%s', _target, _value, _text)); @@ -334,7 +334,7 @@ var table = { actions.push(''); actions.push('
'); actions.push(''); return actions.join(''); @@ -356,7 +356,7 @@ var table = { } }, // 搜索-默认第一个form - search: function(formId, tableId, pageNumber, pageSize) { + search: function (formId, tableId, pageNumber, pageSize) { table.set(tableId); table.options.formId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; var params = $.common.isEmpty(tableId) ? $("#" + table.options.id).bootstrapTable('getOptions') : $("#" + tableId).bootstrapTable('getOptions'); @@ -368,21 +368,21 @@ var table = { } if ($.common.isNotEmpty(tableId)) { $("#" + tableId).bootstrapTable('refresh', params); - } else{ + } else { $("#" + table.options.id).bootstrapTable('refresh', params); } }, // 导出数据 - exportExcel: function(formId) { + exportExcel: function (formId) { table.set(); - $.modal.confirm("确定导出所有" + table.options.modalName + "吗?", function() { + $.modal.confirm("确定导出所有" + table.options.modalName + "吗?", function () { var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; var params = $("#" + table.options.id).bootstrapTable('getOptions'); var dataParam = $("#" + currentId).serializeArray(); - dataParam.push({ "name": "orderByColumn", "value": params.sortName }); - dataParam.push({ "name": "isAsc", "value": params.sortOrder }); + dataParam.push({"name": "orderByColumn", "value": params.sortName}); + dataParam.push({"name": "isAsc", "value": params.sortOrder}); $.modal.loading("正在导出数据,请稍候..."); - $.post(table.options.exportUrl, dataParam, function(result) { + $.post(table.options.exportUrl, dataParam, function (result) { if (result.code == web_status.SUCCESS) { window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true; } else if (result.code == web_status.WARNING) { @@ -395,8 +395,8 @@ var table = { }); }, // 下载模板 - importTemplate: function() { - $.get(activeWindow().table.options.importTemplateUrl, function(result) { + importTemplate: function () { + $.get(activeWindow().table.options.importTemplateUrl, function (result) { if (result.code == web_status.SUCCESS) { window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true; } else if (result.code == web_status.WARNING) { @@ -407,7 +407,7 @@ var table = { }); }, // 导入数据 - importExcel: function(formId, width, height) { + importExcel: function (formId, width, height) { table.set(); var currentId = $.common.isEmpty(formId) ? 'importTpl' : formId; var _width = $.common.isEmpty(width) ? "400" : width; @@ -424,7 +424,7 @@ var table = { btn: [' 导入', ' 取消'], // 弹层外区域关闭 shadeClose: true, - btn1: function(index, layero){ + btn1: function (index, layero) { var file = layero.find('#file').val(); if (file == '' || (!$.common.endWith(file, '.xls') && !$.common.endWith(file, '.xlsx'))) { $.modal.msgWarning("请选择后缀为 “xls”或“xlsx”的文件。"); @@ -442,12 +442,12 @@ var table = { type: 'POST', success: function (result) { if (result.code == web_status.SUCCESS) { - $.modal.close(index); + $.modal.close(index); $.modal.closeAll(); $.modal.alertSuccess(result.msg); $.table.refresh(); } else if (result.code == web_status.WARNING) { - $.modal.close(index); + $.modal.close(index); $.modal.enable(); $.modal.alertWarning(result.msg) } else { @@ -457,14 +457,14 @@ var table = { } }, complete: function () { - layero.find('#file').val(''); + layero.find('#file').val(''); } }); } }); }, // 刷新表格 - refresh: function(tableId, pageNumber, pageSize, url) { + refresh: function (tableId, pageNumber, pageSize, url) { var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId; var params = $("#" + currentId).bootstrapTable('getOptions'); if ($.common.isEmpty(pageNumber)) { @@ -484,12 +484,12 @@ var table = { }); }, // 刷新options配置 - refreshOptions: function(options, tableId) { + refreshOptions: function (options, tableId) { var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId; $("#" + currentId).bootstrapTable('refreshOptions', options); }, // 查询表格指定列值 deDuplication( true去重、false不去重) - selectColumns: function(column, deDuplication) { + selectColumns: function (column, deDuplication) { var distinct = $.common.isEmpty(deDuplication) ? true : deDuplication; var rows = $.map($("#" + table.options.id).bootstrapTable('getSelections'), function (row) { return $.common.getItemField(row, column); @@ -505,11 +505,11 @@ var table = { return distinct ? $.common.uniqueFn(rows) : rows; }, // 获取当前页选中或者取消的行ID - affectedRowIds: function(rows) { + affectedRowIds: function (rows) { var column = $.common.isEmpty(table.options.uniqueId) ? table.options.columns[1].field : table.options.uniqueId; var rowIds; if ($.isArray(rows)) { - rowIds = $.map(rows, function(row) { + rowIds = $.map(rows, function (row) { return $.common.getItemField(row, column); }); } else { @@ -518,7 +518,7 @@ var table = { return rowIds; }, // 查询表格首列值deDuplication( true去重、false不去重) - selectFirstColumns: function(deDuplication) { + selectFirstColumns: function (deDuplication) { var distinct = $.common.isEmpty(deDuplication) ? true : deDuplication; var rows = $.map($("#" + table.options.id).bootstrapTable('getSelections'), function (row) { return $.common.getItemField(row, table.options.columns[1].field); @@ -534,12 +534,12 @@ var table = { return distinct ? $.common.uniqueFn(rows) : rows; }, // 回显数据字典 - selectDictLabel: function(datas, value) { + selectDictLabel: function (datas, value) { if ($.common.isEmpty(datas) || $.common.isEmpty(value)) { return ''; } var actions = []; - $.each(datas, function(index, dict) { + $.each(datas, function (index, dict) { if (dict.dictValue == ('' + value)) { var listClass = $.common.equals("default", dict.listClass) || $.common.isEmpty(dict.listClass) ? "" : "badge badge-" + dict.listClass; var cssClass = $.common.isNotEmpty(dict.cssClass) ? dict.cssClass : listClass; @@ -553,15 +553,15 @@ var table = { return actions.join(''); }, // 回显数据字典(字符串数组) - selectDictLabels: function(datas, value, separator) { + selectDictLabels: function (datas, value, separator) { if ($.common.isEmpty(datas) || $.common.isEmpty(value)) { return ''; } var currentSeparator = $.common.isEmpty(separator) ? "," : separator; var actions = []; - $.each(value.split(currentSeparator), function(i, val) { + $.each(value.split(currentSeparator), function (i, val) { var match = false - $.each(datas, function(index, dict) { + $.each(datas, function (index, dict) { if (dict.dictValue == ('' + val)) { var listClass = $.common.equals("default", dict.listClass) || $.common.isEmpty(dict.listClass) ? "" : "badge badge-" + dict.listClass; actions.push($.common.sprintf("%s", listClass, dict.dictLabel)); @@ -576,22 +576,22 @@ var table = { return actions.join(''); }, // 显示表格指定列 - showColumn: function(column, tableId) { + showColumn: function (column, tableId) { var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId; $("#" + currentId).bootstrapTable('showColumn', column); }, // 隐藏表格指定列 - hideColumn: function(column, tableId) { + hideColumn: function (column, tableId) { var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId; $("#" + currentId).bootstrapTable('hideColumn', column); }, // 显示所有表格列 - showAllColumns: function(tableId) { + showAllColumns: function (tableId) { var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId; $("#" + currentId).bootstrapTable('showAllColumns'); }, // 隐藏所有表格列 - hideAllColumns: function(tableId) { + hideAllColumns: function (tableId) { var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId; $("#" + currentId).bootstrapTable('hideAllColumns'); } @@ -599,7 +599,7 @@ var table = { // 表格树封装处理 treeTable: { // 初始化表格 - init: function(options) { + init: function (options) { var defaults = { id: "bootstrap-tree-table", type: 1, // 0 代表bootstrapTable 1代表bootstrapTreeTable @@ -651,17 +651,17 @@ var table = { }); }, // 条件查询 - search: function(formId) { + search: function (formId) { var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; var params = $.common.formToJSON(currentId); $.bttTable.bootstrapTreeTable('refresh', $.extend(params, table.options.ajaxParams)); }, // 刷新 - refresh: function() { + refresh: function () { $.bttTable.bootstrapTreeTable('refresh'); }, // 查询表格树指定列值deDuplication( true去重、false不去重) - selectColumns: function(column, deDuplication) { + selectColumns: function (column, deDuplication) { var distinct = $.common.isEmpty(deDuplication) ? true : deDuplication; var rows = $.map($.bttTable.bootstrapTreeTable('getSelections'), function (row) { return $.common.getItemField(row, column); @@ -669,7 +669,7 @@ var table = { return distinct ? $.common.uniqueFn(rows) : rows; }, // 请求获取数据后处理回调函数,校验异常状态提醒 - responseHandler: function(res) { + responseHandler: function (res) { if (typeof table.options.responseHandler == "function") { table.options.responseHandler(res); } @@ -681,7 +681,7 @@ var table = { } }, // 当所有数据被加载时触发 - onLoadSuccess: function(data) { + onLoadSuccess: function (data) { if (typeof table.options.onLoadSuccess == "function") { table.options.onLoadSuccess(data); } @@ -691,7 +691,7 @@ var table = { // 表单封装处理 form: { // 表单重置 - reset: function(formId, tableId, pageNumber, pageSize) { + reset: function (formId, tableId, pageNumber, pageSize) { table.set(tableId); formId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; $("#" + formId)[0].reset(); @@ -709,9 +709,9 @@ var table = { resetDate(); }, // 获取选中复选框项 - selectCheckeds: function(name) { + selectCheckeds: function (name) { var checkeds = ""; - $('input:checkbox[name="' + name + '"]:checked').each(function(i) { + $('input:checkbox[name="' + name + '"]:checked').each(function (i) { if (0 == i) { checkeds = $(this).val(); } else { @@ -721,7 +721,7 @@ var table = { return checkeds; }, // 获取选中下拉框项 - selectSelects: function(name) { + selectSelects: function (name) { var selects = ""; $('#' + name + ' option:selected').each(function (i) { if (0 == i) { @@ -736,7 +736,7 @@ var table = { // 弹出层封装处理 modal: { // 显示图标 - icon: function(type) { + icon: function (type) { var icon = ""; if (type == modal_status.WARNING) { icon = 0; @@ -750,27 +750,27 @@ var table = { return icon; }, // 消息提示 - msg: function(content, type) { + msg: function (content, type) { if (type != undefined) { - top.layer.msg(content, { icon: $.modal.icon(type), time: 1000, shift: 5 }); + top.layer.msg(content, {icon: $.modal.icon(type), time: 1000, shift: 5}); } else { - top.layer.msg(content); + top.layer.msg(content); } }, // 错误消息 - msgError: function(content) { + msgError: function (content) { $.modal.msg(content, modal_status.FAIL); }, // 成功消息 - msgSuccess: function(content) { + msgSuccess: function (content) { $.modal.msg(content, modal_status.SUCCESS); }, // 警告消息 - msgWarning: function(content) { + msgWarning: function (content) { $.modal.msg(content, modal_status.WARNING); }, // 弹出提示 - alert: function(content, type) { + alert: function (content, type) { top.layer.alert(content, { icon: $.modal.icon(type), title: "系统提示", @@ -779,31 +779,31 @@ var table = { }); }, // 错误提示 - alertError: function(content) { + alertError: function (content) { $.modal.alert(content, modal_status.FAIL); }, // 成功提示 - alertSuccess: function(content) { + alertSuccess: function (content) { $.modal.alert(content, modal_status.SUCCESS); }, // 警告提示 - alertWarning: function(content) { + alertWarning: function (content) { $.modal.alert(content, modal_status.WARNING); }, // 消息提示,重新加载页面 - msgReload: function(msg, type) { + msgReload: function (msg, type) { top.layer.msg(msg, { - icon: $.modal.icon(type), - time: 500, - shade: [0.1, '#8F8F8F'] - }, - function() { - $.modal.reload(); - }); + icon: $.modal.icon(type), + time: 500, + shade: [0.1, '#8F8F8F'] + }, + function () { + $.modal.reload(); + }); }, // 消息提示成功并刷新父窗体 - msgSuccessReload: function(msg) { - $.modal.msgReload(msg, modal_status.SUCCESS); + msgSuccessReload: function (msg) { + $.modal.msgReload(msg, modal_status.SUCCESS); }, // 获取iframe页的DOM getChildFrame: function (index) { @@ -858,7 +858,7 @@ var table = { height = ($(window).height() - 50); } if ($.common.isEmpty(callback)) { - callback = function(index, layero) { + callback = function (index, layero) { var iframeWin = layero.find('iframe')[0]; iframeWin.contentWindow.submitHandler(index, layero); } @@ -876,7 +876,7 @@ var table = { // 弹层外区域关闭 shadeClose: true, yes: callback, - cancel: function(index) { + cancel: function (index) { return true; }, success: function () { @@ -886,9 +886,9 @@ var table = { }, // 弹出层指定参数选项 openOptions: function (options) { - var _url = $.common.isEmpty(options.url) ? "/404.html" : options.url; - var _title = $.common.isEmpty(options.title) ? "系统窗口" : options.title; - var _width = $.common.isEmpty(options.width) ? "800" : options.width; + var _url = $.common.isEmpty(options.url) ? "/404.html" : options.url; + var _title = $.common.isEmpty(options.title) ? "系统窗口" : options.title; + var _width = $.common.isEmpty(options.width) ? "800" : options.width; var _height = $.common.isEmpty(options.height) ? ($(window).height() - 50) : options.height; var _btn = [' 确认', ' 关闭']; // 如果是移动端,就使用自适应大小弹窗 @@ -897,12 +897,12 @@ var table = { _height = 'auto'; } if ($.common.isEmpty(options.yes)) { - options.yes = function(index, layero) { + options.yes = function (index, layero) { options.callBack(index, layero); } } var btnCallback = {}; - if (options.btn instanceof Array){ + if (options.btn instanceof Array) { for (var i = 1, len = options.btn.length; i < len; i++) { var btn = options["btn" + (i + 1)]; if (btn) { @@ -968,11 +968,11 @@ var table = { btn: ['确定', '关闭'], // 弹层外区域关闭 shadeClose: true, - yes: function(index, layero) { + yes: function (index, layero) { var iframeWin = layero.find('iframe')[0]; iframeWin.contentWindow.submitHandler(index, layero); }, - cancel: function(index) { + cancel: function (index) { return true; }, success: function () { @@ -992,7 +992,7 @@ var table = { closeItem(dataId); }, // 右侧弹出窗口打开 - popupRight: function(title, url){ + popupRight: function (title, url) { var width = 150; if (top.location !== self.location) { if ($(top.window).outerWidth() < 400) { @@ -1016,22 +1016,22 @@ var table = { closeItem(dataId); }, // 禁用按钮 - disable: function() { + disable: function () { var doc = window.top == window.parent ? top.window.document : window.parent.document; $("a[class*=layui-layer-btn]", doc).addClass("layer-disabled"); }, // 启用按钮 - enable: function() { + enable: function () { var doc = window.top == window.parent ? top.window.document : window.parent.document; $("a[class*=layui-layer-btn]", doc).removeClass("layer-disabled"); }, // 打开遮罩层 loading: function (message) { - $.blockUI({ message: '