123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551 |
- /*
- var g;
- var loadParams = {
- "listId" : '404',
- "condition" : 'IS_DEL=0'
- };
-
- //初始化列表
- function initComplete(){
-
- g = $("#maingrid").quiGrid({
- columns: [
- {name: 'FD_OBJECTID404', hide : true},
- {display : '组织机构',name : 'SC_DEPT_ID_404_SHOW' ,align :'center' ,width:'25%',showTitle:true },
- {display : '引用系统',name : 'SC_REFERENCE_SYS_404', align : 'center',width : '20%',showTitle:true},
- {display : '引用地址',name : 'SC_SYSURL_404', align : 'center',width : '40%',showTitle:true},
- {display : '是否启用',name : 'SC_IS_MINITAB_404', align : 'center',width : '15%',showTitle:true}
- ],
- url :$.pathname() + '/ws/crud/CRUDService/queryQui',
- params : loadParams,
- sortName : 'FD_OBJECTID404',
- sortOrder : 'desc nulls last',
- rownumbers:true,
- checkbox:true,
- height: '100%',
- width:"100%",
- pageSize: 10,
- percentWidthMode:true,
- //顶部图标按钮栏
- toolbar:
- {
- items: [
- { text: '查询', click: search, iconClass: 'icon_view', disabled: false },
- { line: true },
- { text: '新增', click: onAdd, iconClass: 'icon_add', disabled: false },
- { line: true },
- { text: '删除', click: onDelete, iconClass: 'icon_delete', disabled: false },
- { line: true },
- { text: '修改', click: onEdit, iconClass: 'icon_edit', disabled: false },
- { line: true }
- ]
- }
- });
-
- }
-
- *//**
- * 修改
- *//*
- function onEdit(){
- var rows = g.getSelectedRows();
- if(rows.length==0){
- top.Dialog.alert("请选择一条记录");
- return;
- }
- if(rows.length>1){
- top.Dialog.alert("只能选择一条记录");
- return;
- }
- var fd_id = rows[0].FD_OBJECTID404;
- var iframe =parent.document.getElementsByName("frmright")[0];
- iframe.src = $.pathname()+"/page/system/externalSystem/add_external.jsp?"+fd_id;
- }
-
- *//**
- * 新增
- *//*
- function onAdd(){
- var url = "add_external.jsp";
- window.parent.document.getElementById("frmright").
- setAttribute("src", "/nwyj/page/system/externalSystem/"+encodeURI(url));
- }
- *//**
- * 删除
- *//*
- function onDelete(){
- var rows = g.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要删除的记录!");
- return;
- }
- var ids = "";
- for ( var i = 0; i < rowsLength; i++) {
- ids += rows[i].FD_OBJECTID404 + ",";
- }
- top.Dialog.confirm("确定要删除吗?|删除", function() {
- // 删除记录
- $.post($.pathname() +"/ws/crud/CRUDService/delete/", {
- "objectIDs" : ids,
- classid : 404
- }, function(result) {
- if (result.Msg.sucsess == true) {
- $.messager.alert("删除成功",null,null,null,1);
- // 刷新表格数据
- g.loadData();
- } else {
- top.Dialog.alert("删除失败!");
- }
- }, "json");
-
- });
- }
-
- *//**
- * 返回主页面
- *//*
- function goBack() {
- //获取iframe中的元素值
- var iframe =parent.document.getElementsByName("frmright")[0];
- iframe.src = $.pathname()+"/page/system/externalSystem/externalList.jsp";
- }
- *//**
- * 获取部门信息
- *//*
- $(function(){
- var url = $.pathname() + '/ws/alert/AlertTransferService/queryDept';
- $.ajax({
- url : url,
- type : 'post',
- dataType : 'text',
- timeout : 60000,
- success : function(data){
- $("#SC_DEPT_ID_404").data("data",JSON.parse(data));
- $("#SC_DEPT_ID_404").render();
- },
- error : function(){
- $.messager.alert('部门获取失败');
- }
- });
- });
- *//**
- * 表单重置
- *//*
- function resetForm(){
- $("#fillForm")[0].reset();
- $("#fillForm .selectTree").resetValue();
- };
- *//**
- * 表单验证(新增调用)
- *//*
- function addValidateForm(containerId) {
- var valid = $(containerId).validationEngine({returnIsValid: true});
- if(valid){
- if($("#title").text()=="修改外部系统引用配置"){
- updataExternal();
- } else {
- addExternal();
- }
-
- }else{
- top.Dialog.alert('不符合填写要求,请重新填写');
- }
- }
- *//**
- * 引用网址验证
- * @returns {Boolean}
- *//*
- function func1(){
- var url = $("#SC_SYSURL_404").val() ;
-
-
-
-
- var strRegex = "^((https|http|ftp|rtsp|mms)?://)"
- + "?(([0-9a-zA-Z_!~*'().&=+$%-]+: )?[0-9a-zA-Z_!~*'().&=+$%-]+@)?" //ftp的user@
- + "(([0-9]{1,3}/.){3}[0-9]{1,3}" // IP形式的URL- 199.194.52.184
- + "|" // 允许IP和DOMAIN(域名)
- + "([0-9a-zA-Z_!~*'()-]+/.)*" // 域名- www.
- + "([0-9a-zA-Z][0-9a-zA-Z-]{0,61})?[0-9a-zA-Z]/." // 二级域名
- + "[a-zA-Z]{2,6})" // first level domain- .com or .museum
- + "(:[0-9]{1,4})?" // 端口- :80
- + "((/?)|"
- + "(/[0-9a-zA-Z_!~*'().;?:@&=+$,%#-]+)+/?)$";
- var re=new RegExp(strRegex);
- if(re.test(url)){
- return true ;
- }
- return false ;
- }
- *//**
- * 增加
- *//*
- function addExternal(){
- $form = $('#fillForm');
- var url = $.pathname() + '/ws/crud/CRUDService/create';
- $.ajax({
- url : url,
- type : 'post',
- data : $form.serialize(),
- dataType : 'text',
- timeout : 60000,
- success : function(data){
- goBack();
- $.messager.alert("保存成功",null,null,null,1);
- },
- error : function(){
- $.messager.alert('操作失败');
- }
- });
- }
- *//**
- * 修改表单显示
- *//*
- $(function(){
- //修改表单信息,获取记录
- if((window.location.href).indexOf('?')>-1){
- var fd_id = (window.location.href).split('?')[1];
- $("#title").text("修改外部系统引用配置");
- var url = $.pathname() + "/ws/crud/CRUDService/getDataById/";
- var params = {
- classid : '404',
- objectID : fd_id
- };
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data){
- $('#fillForm').ajaxWrite({data:data});
- var name = data.list[0].value;
- $('#fillForm input[name="classid"]').val('404');
- $("#AcceptUserTree").attr("selectedValue",name);
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
- });
- *//**
- * 修改
- *//*
- function updataExternal(){
- $form = $('#fillForm');
- var params = "classid=404&"+$form.serialize();
- var url = $.pathname() + '/ws/crud/CRUDService/update';
- $.ajax({
- url : url,
- type : 'post',
- data : params,
- dataType : 'text',
- timeout : 60000,
- success : function(data){
- goBack();
- $.messager.alert("保存成功",null,null,null,1);
- },
- error : function(){
- $.messager.alert('操作失败');
- }
- });
- };
- //查询
- function search() {
- var condition = " 1=1 AND IS_DEL='0' ";
-
- //级织机构
- var dept = $('#SC_DEPT_ID_404').attr('selectedValue');
- if (dept != "") {
- condition += " AND SC_DEPT_ID LIKE '%" + dept + "%'";
- }
-
- //引用系统
- var sys = $("#SC_REFERENCE_SYS_404").val().trim();
- if(sys != ""){
- condition += " AND SC_REFERENCE_SYS LIKE '%" + sys +"%'";
- }
-
- //引用地址
- var sysurl = $("#SC_SYSURL_404").val();
- if(sysurl != ""){
- condition += " AND SC_SYSURL LIKE '%" + sysurl +"%'";
- }
- //是否启用
- var isMinitab= $('input:radio[name="SC_IS_MINITAB_404"]:checked').val();
- if(isMinitab!=2){
- condition += " AND SC_IS_MINITAB LIKE '%"+isMinitab+"%'";
- }
- // 重置加载列表的参数
- g.setOptions({
- params : {
- "listId" : '404',
- "condition" : condition
- }
- });
- g.setNewPage(1);
- g.loadData();// 刷新列表
- }
- */
- /**
- * 功能:
- *
- *
- * @author
- * @date 2015/10/12
- */
- External = function() {
- /**定义变量**/
- var _this = this;
- _this.listGrid = null;//数据列表
- $queryForm = null;//查询区域表单
- $searchButt = null;//查询按钮
- $more = null;//更多
- _this.loadParams = null;//列表加载参数
- /**私有方法**/
- /***新增信息***/
- _this.addForm = function(){
- $('#frmright',window.parent.document).attr('src',$.pathname()+'/page/system/externalSystem/add_external.jsp?fd_id=');
- };
-
- /***修改信息***/
- _this.editForm = function(){
- var rows = _this.listGrid.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要修改的记录!");
- return;
- } else if (rowsLength > 1) {
- top.Dialog.alert("请选中一条要修改的记录!");
- return;
- } else {
- var fd_id = _this.listGrid.getSelectedRow().FD_OBJECTID404;
- $('#frmright',window.parent.document).attr('src',$.pathname()+'/page/system/externalSystem/add_external.jsp?fd_id='+fd_id);
- }
- };
- /***删除信息***/
- _this.del = function(){
- var rows = _this.listGrid.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要删除的记录!");
- return;
- }
- var ids = "";
- for ( var i = 0; i < rowsLength; i++) {
- ids += rows[i].FD_OBJECTID404 + ",";
- }
- var url = $.pathname() +"/ws/crud/CRUDService/delete/";
- var params = {
- objectIDs : ids,
- classid : 404
- };
- top.Dialog.confirm("确定要删除吗?|删除", function() {
- $.request.del(url,params,function(result){
- if (result.Msg.sucsess == true) {
- top.Dialog.alert("删除成功!");
- // 刷新表格数据
- _this.listGrid.loadData();
- } else {
- top.Dialog.alert("删除失败!");
- }
- });
- });
- };
-
- function spliceArr(str, arr){
- var cond = "AND( ";
- for(var key in arr){
- cond += str + " = '" + arr[key] + "' OR " ;
- }
- cond = cond.slice(0, cond.length-3);
- cond += ")";
- return cond;
- };
-
- //查询
- function search(){
- var condition = " IS_DEL='0' AND SC_DEPT_ID IS NOT NULL ";
-
- //级织机构
- var dept = $('#SC_DEPT_ID_404').attr('relValue');
-
- if (dept != "" && dept != undefined && dept != null) {
- var arr = dept.split(",");
- condition += spliceArr("SC_DEPT_ID",arr);
- }
-
- //引用系统
- var sys = $("#TM_NAME_404").val().trim();
- if(sys != ""){
- condition += " AND TM_NAME LIKE '%" + sys +"%'";
- }
-
- //引用地址
- var sysurl = $("#TM_URL_404").val();
- if(sysurl != ""){
- condition += " AND TM_URL LIKE '%" + sysurl +"%'";
- }
- //是否启用
- var isMinitab= $('input:radio[name="TM_USE_404"]:checked').val();
- if(isMinitab!=2){
- condition += " AND TM_USE = '"+isMinitab+"'";
- }
-
- _this.listGrid.setOptions( {
- params : {"listId" : '404', "condition" : condition}
- });
- //页号重置为1
- _this.listGrid.setNewPage(1);
- _this.listGrid.loadData();//加载数据
- }
- return {
- init : function() {
- //列表加载参数
- _this.loadParams = {
- listId : '404',
- condition : "is_del='0' and is_external='0'"
- };
- /**grid载入数据**/
- _this.listGrid = $("#dataGrid").quiGrid({
- //title : "定时任务管理数据列表",
- columns : [{name: 'FD_OBJECTID404', hide : true},
- {display : '组织机构',name : 'SC_DEPT_ID_404_SHOW' ,align :'center' ,width:'15%',showTitle:true,
- render:function(rowdata, rowindex, value, column){
- return "" == value ? "所有机构" : value ;
- }},
- {display : '归属模块',name : 'TM_AREAID_404_SHOW' ,align :'center' ,width:'10%',showTitle:true },
- {display : '引用系统',name : 'TM_NAME_404', align : 'center',width : '10%',showTitle:true},
- {display : '引用地址',name : 'TM_URL_404', align : 'center',width : '45%',showTitle:true},
- {display : '是否启用',name : 'TM_USE_404', align : 'center',width : '10%',showTitle:true,
- render : function(rowdata, rowindex, value, column){
- return "1" == value ? "是" : "否";
- }
- },
- {display : '是否为4A登陆',name : 'IS_FORUA_404_SHOW', align : 'center',width : '10%',showTitle:true}],
-
- url : $.pathname() + '/ws/crud/CRUDService/queryQui',
- params : _this.loadParams,
- sortName : 'updatedate',
- sortOrder : 'desc',//asc
- rownumbers : true,
- checkbox : true,
- width : "100%",
- pageSize : 10,
- percentWidthMode : true,
- toolbar:
- {
- items: [{ text: '查询', click: search, iconClass: 'icon_view', disabled: false },
- { line: true },
- { text: '新增', click: _this.addForm, iconClass: 'icon_add', disabled: false },
- { line: true },
- { text: '删除', click: _this.del, iconClass: 'icon_delete', disabled: false },
- { line: true },
- { text: '修改', click: _this.editForm, iconClass: 'icon_edit', disabled: false },
- { line: true }]
- }
- });
-
- $('.l-bar-group').find('select').change(function (){
- setTimeout(function(){
- $(top.parent.document.body).find("#frmright").css("height",$(window.document.body).height()+20);
- },1000);
-
- });
-
- /*
- _this.listGrid = $("#dataGrid").quiGrid({
- //title : "定时任务管理数据列表",
- columns : [{name: 'FD_ID', hide : true},
- {display : '组织机构',name : 'DEPT' ,align :'center' ,width:'15%',showTitle:true },
- {display : '归属模块',name : 'AREA' ,align :'center' ,width:'15%',showTitle:true },
- {display : '引用系统',name : 'NAME', align : 'center',width : '15%',showTitle:true},
- {display : '引用地址',name : 'URL', align : 'center',width : '45%',showTitle:true},
- {display : '是否启用',name : 'USE', align : 'center',width : '10%',showTitle:true,
- render : function(rowdata, rowindex, value, column){
- return "1" == value ? "是" : "否";
- }
- }],
-
- url : $.pathname() + '/ws/cockpit/CockpitService/getGridExternal',
- params : _this.loadParams,
- sortName : 'updatedate',
- sortOrder : 'desc',//asc
- rownumbers : true,
- checkbox : true,
- width : "100%",
- pageSize : 10,
- percentWidthMode : true,
- toolbar:
- {
- items: [{ text: '查询', click: search, iconClass: 'icon_view', disabled: false },
- { line: true },
- { text: '新增', click: _this.addForm, iconClass: 'icon_add', disabled: false },
- { line: true },
- { text: '删除', click: _this.del, iconClass: 'icon_delete', disabled: false },
- { line: true },
- { text: '修改', click: _this.editForm, iconClass: 'icon_edit', disabled: false },
- { line: true }]
- }
- });*/
- }
- };
- }();
- /*{"total":"","rows":[{"SC_IMGURL_404":null,"FD_OBJECTID_404":"404144964198185400000004100000","FD_OBJECTID404":"404144964198185400000004100000","IS_DEL_404":"0","SC_REFERENCE_SYS_404":"sss","SC_SYSURL_404":"ddd","SC_DEPT_ID_404":"15CC8A55C3DE0ED0E0530113960A6CC1","UPDATEDATE_404":"2015-12-09 14:19:41","SC_IS_MINITAB_404":"是","classid":"404"},{"SC_IMGURL_404":null,"FD_OBJECTID_404":"404144962669979000000003100000","FD_OBJECTID404":"404144962669979000000003100000","IS_DEL_404":"0","SC_REFERENCE_SYS_404":"sdfsafasf","SC_SYSURL_404":"http://localhost:9090/nwyj/index.com","SC_DEPT_ID_404":"52CBA051D490487DA2D1F258EB8F595D","UPDATEDATE_404":"2015-12-09 10:04:59","SC_IS_MINITAB_404":"是","classid":"404"}]}
- {"pager.totalRows":24,"pager.pageNo":1,"rows":[{"FD_OBJECTID":"1065614455","MSG_TIME":"2015-12-08 11:42:43","REC_NAME":"管理员","REC_USER_TEL":"13811111112","MSG_TYPE":"短信发送","MSG_STAT":"0","SENDNAME":"u117","DEPT_NAME":"广东电网公司","MSG_CONTENT":"短信测试管理员","MSG_TITLE":"短信测试","SUB_STAT":"null"},{"FD_OBJECTID":"1795121006","MSG_TIME":"2015-12-08 11:41:35","REC_NAME":"管理员","REC_USER_TEL":"13811111112","MSG_TYPE":"短信发送","MSG_STAT":"0","SENDNAME":"u117","DEPT_NAME":"广东电网公司","MSG_CONTENT":"12312312312312","MSG_TITLE":"111","SUB_STAT":"null"},{"FD_OBJECTID":"1581457072","MSG_TIME":"2015-12-08 10:50:07","REC_NAME":"管理员","REC_USER_TEL":"13811111112","MSG_TYPE":"短信发送","MSG_STAT":"0","SENDNAME":"u117","DEPT_NAME":"广东电网公司","MSG_CONTENT":"短信测试添加范本","MSG_TITLE":"测试短信1051","SUB_STAT":"null"},{"FD_OBJECTID":"1096960595","MSG_TIME":"2015-12-03 20:25:12","REC_NAME":"管理员","REC_USER_TEL":"13811111112","MSG_TYPE":"短信发送","MSG_STAT":"0","SENDNAME":"u115","DEPT_NAME":"广东电网公司","MSG_CONTENT":"短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试短信测试","MSG_TITLE":"短信测试","SUB_STAT":"null"},{"FD_OBJECTID":"1643373815","MSG_TIME":"2015-12-03 15:17:42","REC_NAME":"管理员","REC_USER_TEL":"13811111112","MSG_TYPE":"短信发送","MSG_STAT":"0","SENDNAME":"u117","DEPT_NAME":"广东电网公司","MSG_CONTENT":"测试短信发送短信调用","MSG_TITLE":"测试短信发送短信调用","SUB_STAT":"null"},{"FD_OBJECTID":"1294213819","MSG_TIME":"2015-12-01 19:21:38","REC_NAME":"管理员","REC_USER_TEL":"13811111112","MSG_TYPE":"短信发送","MSG_STAT":"0","SENDNAME":"u117","DEPT_NAME":"广东电网公司","MSG_CONTENT":"短信测试啊啊","MSG_TITLE":"短信测试啊","SUB_STAT":"null"},{"FD_OBJECTID":"1789238164","MSG_TIME":"2015-12-01 14:53:31","REC_NAME":"赵六","REC_USER_TEL":"444","MSG_TYPE":"短信发送","MSG_STAT":"0","SENDNAME":"管理员","DEPT_NAME":"广电信息中心","MSG_CONTENT":"123","MSG_TITLE":"121","SUB_STAT":"null"},{"FD_OBJECTID":"1372703574","MSG_TIME":"2015-12-01 14:53:31","REC_NAME":"张三","REC_USER_TEL":"111","MSG_TYPE":"短信发送","MSG_STAT":"0","SENDNAME":"管理员","DEPT_NAME":"广电信息中心","MSG_CONTENT":"123","MSG_TITLE":"121","SUB_STAT":"null"},{"FD_OBJECTID":"1632657547","MSG_TIME":"2015-12-01 14:52:56","REC_NAME":"张三","REC_USER_TEL":"111","MSG_TYPE":"短信发送","MSG_STAT":"0","SENDNAME":"管理员","DEPT_NAME":"广电信息中心","MSG_CONTENT":"111","MSG_TITLE":"222","SUB_STAT":"null"},{"FD_OBJECTID":"1519607922","MSG_TIME":"2015-12-01 14:52:56","REC_NAME":"王五","REC_USER_TEL":"333","MSG_TYPE":"短信发送","MSG_STAT":"0","SENDNAME":"管理员","DEPT_NAME":"广电信息中心","MSG_CONTENT":"111","MSG_TITLE":"222","SUB_STAT":"null"}]}
- */
- $(function() {
- External.init();
- //部门id--响应范围用到
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
-
- var deptUrl="/nwyj/ws/orgInDeptService/OrgInDeptService/getDeptRootById";
- $.post(deptUrl, {"deptId" : deptId}, function(data) {
- $("#SC_DEPT_ID_404").data("data", data);
- $("#SC_DEPT_ID_404").render();
-
- }, "json");
-
- //父部门id
- var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
- //响应范围下拉框的初始化
- var deptUrl = $.pathname() + '/ws/dept/DeptService/getDepartTree';
- //响应范围,发布单位下拉框
- $.post(deptUrl,{id:parentId,name:''},function(data){
- $("#SC_DEPT_ID_404").data("data",data);
- $("#SC_DEPT_ID_404").render();
- }, "json");
-
-
- });
|