...
|
...
|
@@ -153,7 +153,7 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'xmSelect', 'lay |
|
|
form.render();
|
|
|
if (pollName) {
|
|
|
var url = common.domainName + '/inspection-report/dataSource/findByPollName';
|
|
|
$.get(url, {'pollName': pollName, 'access_token': accessToken}, function (res) {
|
|
|
$.get(url, {'pollName': pollName, 'accessToken': accessToken}, function (res) {
|
|
|
if (res.object) {
|
|
|
let data = res.object;
|
|
|
var $form = $("#datasourceAddForm");
|
...
|
...
|
@@ -223,26 +223,25 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'xmSelect', 'lay |
|
|
form.on('submit(datasource-add-submit)', function (data) {
|
|
|
var bean = data.field;
|
|
|
var loading = layer.load(2);
|
|
|
$.ajax({
|
|
|
admin.req({
|
|
|
type: 'post',
|
|
|
url: common.domainName + '/inspection-report/dataSource/saveOrUpdate',
|
|
|
contentType: "application/json; charset=utf-8",
|
|
|
data: JSON.stringify(bean),
|
|
|
success: function (res) {
|
|
|
layer.close(loading);
|
|
|
if (res.success) {
|
|
|
layer.msg('保存成功', {
|
|
|
offset: '15px'
|
|
|
, icon: 1
|
|
|
, time: 2000
|
|
|
}, function () {
|
|
|
layer.closeAll();
|
|
|
table.reload('datasource_table', {});
|
|
|
})
|
|
|
} else {
|
|
|
layer.msg(res.msg, {offset: '15px', icon: 7, time: 1500});
|
|
|
return false
|
|
|
}
|
|
|
data: JSON.stringify(bean)
|
|
|
}).done(function (res) {
|
|
|
layer.close(loading);
|
|
|
if (res.success) {
|
|
|
layer.msg('保存成功', {
|
|
|
offset: '15px'
|
|
|
, icon: 1
|
|
|
, time: 2000
|
|
|
}, function () {
|
|
|
layer.closeAll();
|
|
|
table.reload('datasource_table', {});
|
|
|
})
|
|
|
} else {
|
|
|
layer.msg(res.msg, {offset: '15px', icon: 7, time: 1500});
|
|
|
return false
|
|
|
}
|
|
|
});
|
|
|
|
...
|
...
|
@@ -252,18 +251,17 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'xmSelect', 'lay |
|
|
admin.req({
|
|
|
url: `${common.domainName}/inspection-report/dataSource/findAllDatabase`,
|
|
|
method: 'GET',
|
|
|
async: false,
|
|
|
success: function (res) {
|
|
|
data = res.data;
|
|
|
if (res && res.data) {
|
|
|
var options = "<option value=''>=请选择=</option>";
|
|
|
$.each(res.data, function (i, v) {
|
|
|
options += '<option value="' + v + '">' + v + '</option>';
|
|
|
});
|
|
|
$('#instance').html($(options));
|
|
|
}
|
|
|
form.render('select');
|
|
|
async: false
|
|
|
}).done(function (res) {
|
|
|
data = res.data;
|
|
|
if (res && res.data) {
|
|
|
var options = "<option value=''>=请选择=</option>";
|
|
|
$.each(res.data, function (i, v) {
|
|
|
options += '<option value="' + v + '">' + v + '</option>';
|
|
|
});
|
|
|
$('#instance').html($(options));
|
|
|
}
|
|
|
form.render('select');
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
|