task_parameter = { first : '(0)', last : '(0)', count : 20 }; function task_list_init() { var str = ''; str += ''; str += ''; str += '' str += '
  0
rankidtitleprocessName
'; $('#content').html(str); $('#next').click(function() { task_list_next(); }); $('#prev').click(function() { task_list_prev(); }); task_parameter.first = '(0)'; task_parameter.last = '(0)'; task_list_next(); } function task_list_next(id) { var id = (id ? id : task_parameter.last); $.ajax({ type : 'get', dataType : 'json', url : '../jaxrs/task/list/' + id + '/next/' + task_parameter.count, xhrFields : { 'withCredentials' : true }, crossDomain : true }).done(function(json) { if (json.type == 'success') { if (json.data.length > 0) { task_parameter.first = json.data[0].id; task_parameter.last = json.data[json.data.length - 1].id; } else { task_parameter.first = '(0)'; } task_list_grid(json); } }).always(function(json) { $('#result').html(JSON.stringify(json, null, 4)); }); } function task_list_prev(id) { var id = (id ? id : task_parameter.first); $.ajax({ type : 'get', dataType : 'json', url : '../jaxrs/task/list/' + id + '/prev/' + task_parameter.count, xhrFields : { 'withCredentials' : true }, crossDomain : true }).done(function(json) { if (json.type == 'success') { if (json.data.length > 0) { task_parameter.first = json.data[0].id; task_parameter.last = json.data[json.data.length - 1].id; } else { task_parameter.last = '(0)'; } task_list_grid(json); } }).always(function(json) { $('#result').html(JSON.stringify(json, null, 4)); }); } function task_listWithApplication_init() { var str = ''; str += ''; str += ''; str += ''; str += '' str += '
  0
applicationFlag
rankidtitleprocessName
'; $('#content').html(str); $('#next').click(function() { task_listWithApplication_next(); }); $('#prev').click(function() { task_listWithApplication_prev(); }); task_parameter.first = '(0)'; task_parameter.last = '(0)'; } function task_listWithApplication_next(id) { var id = (id ? id : task_parameter.last); $.ajax({ type : 'get', dataType : 'json', url : '../jaxrs/task/list/' + task_parameter.last + '/next/' + task_parameter.count + '/application/' + $('#applicationFlag').val(), xhrFields : { 'withCredentials' : true }, crossDomain : true }).done(function(json) { if (json.type == 'success') { if (json.data.length > 0) { task_parameter.first = json.data[0].id; task_parameter.last = json.data[json.data.length - 1].id; } else { task_parameter.first = '(0)'; } task_list_grid(json); } }).always(function(json) { $('#result').html(JSON.stringify(json, null, 4)); }); } function task_listWithApplication_prev(id) { var id = (id ? id : task_parameter.first); $.ajax({ type : 'get', dataType : 'json', url : '../jaxrs/task/list/' + id + '/prev/' + task_parameter.count + '/application/' + $('#applicationFlag').val(), xhrFields : { 'withCredentials' : true }, crossDomain : true }).done(function(json) { if (json.type == 'success') { if (json.data.length > 0) { task_parameter.first = json.data[0].id; task_parameter.last = json.data[json.data.length - 1].id; } else { task_parameter.last = '(0)'; } task_list_grid(json); } }).always(function(json) { $('#result').html(JSON.stringify(json, null, 4)); }); } function task_listWithProcess_init() { var str = ''; str += ''; str += ''; str += ''; str += '' str += '
  0
processFlag
rankidtitleprocessName
'; $('#content').html(str); $('#next').click(function() { task_listWithProcess_next(); }); $('#prev').click(function() { task_listWithProcess_prev(); }); task_parameter.first = '(0)'; task_parameter.last = '(0)'; } function task_listWithProcess_next(id) { var id = (id ? id : task_parameter.last); $.ajax({ type : 'get', dataType : 'json', url : '../jaxrs/task/list/' + id + '/next/' + task_parameter.count + '/process/' + $('#processFlag').val(), xhrFields : { 'withCredentials' : true }, crossDomain : true }).done(function(json) { if (json.type == 'success') { if (json.data.length > 0) { task_parameter.first = json.data[0].id; task_parameter.last = json.data[json.data.length - 1].id; } else { task_parameter.first = '(0)'; } task_list_grid(json); } }).always(function(json) { $('#result').html(JSON.stringify(json, null, 4)); }); } function task_listWithProcess_prev(id) { var id = (id ? id : task_parameter.first); $.ajax({ type : 'get', dataType : 'json', url : '../jaxrs/task/list/' + id + '/prev/' + task_parameter.count + '/process/' + $('#processFlag').val(), xhrFields : { 'withCredentials' : true }, crossDomain : true }).done(function(json) { if (json.type == 'success') { if (json.data.length > 0) { task_parameter.first = json.data[0].id; task_parameter.last = json.data[json.data.length - 1].id; } else { task_parameter.last = '(0)'; } task_list_grid(json); } }).always(function(json) { $('#result').html(JSON.stringify(json, null, 4)); }); } function task_list_grid(json) { if (json.data && json.data.length > 0) { str = ''; $.each(json.data, function(index, item) { str += ''; str += '' + item.rank + ''; str += '' + item.id + ''; str += '' + item.title + ''; str += '' + item.processName + ''; str += ''; }); $('#total').html(json.count); $('#grid').html(str); } else { $('#total').html('0'); $('#grid').html(''); } } function task_listCountWithApplication() { $('#result').html(''); $.ajax({ type : 'get', dataType : 'json', url : '../jaxrs/task/list/count/application', xhrFields : { 'withCredentials' : true }, crossDomain : true }).always(function(json) { $('#result').html(JSON.stringify(json, null, 4)); }); } function task_listCountWithProcess_init() { $('#result').html(''); str = ''; str += ''; str += ''; str += '
get
applicationFlag:
'; $('#content').html(str); $('#get').click(function() { task_listCountWithProcess($('#applicationFlag').val()); }); } function task_listCountWithProcess(applicationFlag) { $('#result').html(''); $.ajax({ type : 'get', dataType : 'json', url : '../jaxrs/task/list/count/application/' + applicationFlag + '/process', xhrFields : { 'withCredentials' : true }, crossDomain : true }).always(function(json) { $('#result').html(JSON.stringify(json, null, 4)); }); } function task_countWithPerson_init() { $('#result').html(''); str = ''; str += ''; str += ''; str += '
get
person:
'; $('#content').html(str); $('#get').click(function() { task_countWithPerson($('#person').val()); }); } function task_countWithPerson(person) { $('#result').html(''); $.ajax({ type : 'get', dataType : 'json', url : '../jaxrs/task/count/' + person, xhrFields : { 'withCredentials' : true }, crossDomain : true }).always(function(json) { $('#result').html(JSON.stringify(json, null, 4)); }); } function task_get_init() { $('#result').html(''); str = ''; str += ''; str += ''; str += ''; str += ''; str += '
get reference process update reset
id:
routeName:
opinion:
identityList: