123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- function initComplete(){
- /**
- * 工具条
- */
- var roleCons = roleButtonArr();
- var toolBarOpt1 = {
- items:[
- {text: '新增', click: "addUnit", iconClass: 'add1_tem',id:"10000"},
- {text: '删除', click: "deleteUnit", iconClass: 'delete_tem',id:"10002"},
- {text: '修改', click: "updateUnit", iconClass: 'update_tem',id:"10001"},
- {text: '查看', click: "onView", iconClass: 'view_tem',id:"10003"}
- ],
-
- roleCons:roleCons
- };
- /**
- * 树形列
- */
- var grid_option1 = {
- columns: [
- { display: '源站名称', name: 'NAME_219', align: 'center', width: "30%",isPrimaryKey:true,
- render : function(rowdata, value) {
- return '<a href="javascript:void(0)" '
- + 'onclick=jumpPage("'
- + rowdata.FD_OBJECTID219
- +'")>'+ rowdata.NAME_219 +'</a>';
- }
- },
- { display: '源站URL', name: 'SOURCE_URL_219', align: 'center', width: "70%"}
- ],
- rownumbers : true,
- checkbox : true,
- pageSize : 10,
- percentWidthMode : true
- };
-
- var options1={
- url :'/nwyj/ws/crud/CRUDService/queryQui',
- params:loadParams,
- height: '100%',
- width:"100%",
- gridOptions:grid_option1,
- singleRecodeOptions:{a:"aa"},
- paperOpration:{showInput:"true"},
- toolBarOptions:toolBarOpt1
- };
- g=gridAndSingleRecode=$("#maingrid").quickgridAndSingleRecode(options1);
- }
- //点击查看
- function jumpPage(id){
- window.location.href="configuration-update.jsp?"+id;
- }
- //新增
- function addUnit(){
- window.location.href="configuration-update.jsp";
- }
- //修改
- function updateUnit(){
- 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_OBJECTID219;
- window.location.href="configuration-update.jsp?"+fd_id;
- }
- //删除
- function deleteUnit(){
- 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_OBJECTID219 + ",";
- }
-
- top.Dialog.confirm("确定要删除吗?|删除", function() {
- // 删除记录
- $.post($.pathname() +"/ws/crud/CRUDService/delete/", {
- "objectIDs" : ids,
- classid : 219
- }, function(result) {
- if (result.Msg.sucsess == true) {
- $.messager.alert("删除成功",null,null,null,1);
- // 刷新表格数据
- g.rend();
- } else {
- top.Dialog.alert("删除失败!");
- }
- }, "json");
-
- });
-
-
- }
- //详情
- function onView(){
- 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_OBJECTID219;
- window.location.href="configuration-update.jsp?"+fd_id;
- }
|