Authored by wangtao

Merge branch 'master-mj' of http://113.200.75.45:82/monitor_v3/hg-monitor-web into master-mj

@@ -153,7 +153,7 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'xmSelect', 'lay @@ -153,7 +153,7 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'xmSelect', 'lay
153 form.render(); 153 form.render();
154 if (pollName) { 154 if (pollName) {
155 var url = common.domainName + '/inspection-report/dataSource/findByPollName'; 155 var url = common.domainName + '/inspection-report/dataSource/findByPollName';
156 - $.get(url, {'pollName': pollName, 'access_token': accessToken}, function (res) { 156 + $.get(url, {'pollName': pollName, 'accessToken': accessToken}, function (res) {
157 if (res.object) { 157 if (res.object) {
158 let data = res.object; 158 let data = res.object;
159 var $form = $("#datasourceAddForm"); 159 var $form = $("#datasourceAddForm");
@@ -223,26 +223,25 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'xmSelect', 'lay @@ -223,26 +223,25 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'xmSelect', 'lay
223 form.on('submit(datasource-add-submit)', function (data) { 223 form.on('submit(datasource-add-submit)', function (data) {
224 var bean = data.field; 224 var bean = data.field;
225 var loading = layer.load(2); 225 var loading = layer.load(2);
226 - $.ajax({ 226 + admin.req({
227 type: 'post', 227 type: 'post',
228 url: common.domainName + '/inspection-report/dataSource/saveOrUpdate', 228 url: common.domainName + '/inspection-report/dataSource/saveOrUpdate',
229 contentType: "application/json; charset=utf-8", 229 contentType: "application/json; charset=utf-8",
230 - data: JSON.stringify(bean),  
231 - success: function (res) {  
232 - layer.close(loading);  
233 - if (res.success) {  
234 - layer.msg('保存成功', {  
235 - offset: '15px'  
236 - , icon: 1  
237 - , time: 2000  
238 - }, function () {  
239 - layer.closeAll();  
240 - table.reload('datasource_table', {});  
241 - })  
242 - } else {  
243 - layer.msg(res.msg, {offset: '15px', icon: 7, time: 1500});  
244 - return false  
245 - } 230 + data: JSON.stringify(bean)
  231 + }).done(function (res) {
  232 + layer.close(loading);
  233 + if (res.success) {
  234 + layer.msg('保存成功', {
  235 + offset: '15px'
  236 + , icon: 1
  237 + , time: 2000
  238 + }, function () {
  239 + layer.closeAll();
  240 + table.reload('datasource_table', {});
  241 + })
  242 + } else {
  243 + layer.msg(res.msg, {offset: '15px', icon: 7, time: 1500});
  244 + return false
246 } 245 }
247 }); 246 });
248 247
@@ -252,18 +251,17 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'xmSelect', 'lay @@ -252,18 +251,17 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'xmSelect', 'lay
252 admin.req({ 251 admin.req({
253 url: `${common.domainName}/inspection-report/dataSource/findAllDatabase`, 252 url: `${common.domainName}/inspection-report/dataSource/findAllDatabase`,
254 method: 'GET', 253 method: 'GET',
255 - async: false,  
256 - success: function (res) {  
257 - data = res.data;  
258 - if (res && res.data) {  
259 - var options = "<option value=''>=请选择=</option>";  
260 - $.each(res.data, function (i, v) {  
261 - options += '<option value="' + v + '">' + v + '</option>';  
262 - });  
263 - $('#instance').html($(options));  
264 - }  
265 - form.render('select'); 254 + async: false
  255 + }).done(function (res) {
  256 + data = res.data;
  257 + if (res && res.data) {
  258 + var options = "<option value=''>=请选择=</option>";
  259 + $.each(res.data, function (i, v) {
  260 + options += '<option value="' + v + '">' + v + '</option>';
  261 + });
  262 + $('#instance').html($(options));
266 } 263 }
  264 + form.render('select');
267 }); 265 });
268 } 266 }
269 267
@@ -52,7 +52,7 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common', @@ -52,7 +52,7 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common',
52 elem: '#datasource_table' 52 elem: '#datasource_table'
53 , url: domainName + '/inspection-report/dataSource/page' 53 , url: domainName + '/inspection-report/dataSource/page'
54 , where: { 54 , where: {
55 - access_token: accessToken, 55 + accessToken: accessToken,
56 datasourceName: $('#datasourceSearchForm').find("input[name='keyword']").val(), 56 datasourceName: $('#datasourceSearchForm').find("input[name='keyword']").val(),
57 } 57 }
58 , height: 'full-200' 58 , height: 'full-200'
@@ -217,7 +217,7 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common', @@ -217,7 +217,7 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common',
217 curr: 1 217 curr: 1
218 } 218 }
219 , where: { 219 , where: {
220 - access_token: accessToken, 220 + accessToken: accessToken,
221 datasourceName: $('#datasourceSearchForm').find("input[name='keyword']").val(), 221 datasourceName: $('#datasourceSearchForm').find("input[name='keyword']").val(),
222 } 222 }
223 }); 223 });
@@ -493,7 +493,7 @@ layui.define(['table', 'form', 'laydate', 'laytpl', 'common', 'sessions', 'xmSel @@ -493,7 +493,7 @@ layui.define(['table', 'form', 'laydate', 'laytpl', 'common', 'sessions', 'xmSel
493 $.get(url, { 493 $.get(url, {
494 "pollName": pollName, 494 "pollName": pollName,
495 "content": content, 495 "content": content,
496 - 'access_token': accessToken 496 + 'accessToken': accessToken
497 }, function (res) { 497 }, function (res) {
498 if (res.success) { 498 if (res.success) {
499 let optionHtml = '<option value="">请选择</option>'; 499 let optionHtml = '<option value="">请选择</option>';