Authored by zhichao

fix:修改巡检报表数据源管理access_token为accessToken

@@ -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,12 +223,12 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'xmSelect', 'lay @@ -223,12 +223,12 @@ 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) { 230 + data: JSON.stringify(bean)
  231 + }).done(function (res) {
232 layer.close(loading); 232 layer.close(loading);
233 if (res.success) { 233 if (res.success) {
234 layer.msg('保存成功', { 234 layer.msg('保存成功', {
@@ -243,7 +243,6 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'xmSelect', 'lay @@ -243,7 +243,6 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'xmSelect', 'lay
243 layer.msg(res.msg, {offset: '15px', icon: 7, time: 1500}); 243 layer.msg(res.msg, {offset: '15px', icon: 7, time: 1500});
244 return false 244 return false
245 } 245 }
246 - }  
247 }); 246 });
248 247
249 }) 248 })
@@ -252,8 +251,8 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'xmSelect', 'lay @@ -252,8 +251,8 @@ 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) { 254 + async: false
  255 + }).done(function (res) {
257 data = res.data; 256 data = res.data;
258 if (res && res.data) { 257 if (res && res.data) {
259 var options = "<option value=''>=请选择=</option>"; 258 var options = "<option value=''>=请选择=</option>";
@@ -263,7 +262,6 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'xmSelect', 'lay @@ -263,7 +262,6 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'xmSelect', 'lay
263 $('#instance').html($(options)); 262 $('#instance').html($(options));
264 } 263 }
265 form.render('select'); 264 form.render('select');
266 - }  
267 }); 265 });
268 } 266 }
269 267