fix:修改巡检报表数据源管理access_token为accessToken
Showing
1 changed file
with
27 additions
and
29 deletions
@@ -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 |
-
Please register or login to post a comment