56 lines
1.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* 版 本 PIT-ADMS V7.0.3 敏捷开发框架
* Copyright (c) 2013-2018 Hexagon PPM
* 创建人:研发部
* 日 期2017.04.11
* 描 述:数据库管理
*/
var keyValue = "";
var acceptClick;
var bootstrap = function ($, learun) {
"use strict";
var selectedRow = learun.frameTab.currentIframe().selectedRow;
var page = {
init: function () {
page.bind();
page.initData();
},
bind: function () {
$('#F_DbType').lrDataItemSelect({ code: 'DbVersion' });
$('#lr_test').on('click', function () {
var dbType = $('#F_DbType').lrselectGet();
if (!dbType) {
learun.alert.error('请选择数据库类型');
return false;
}
var connection = $('#F_DbConnection').val();
if (!connection) {
learun.alert.error('请填写数据库连接串');
return false;
}
$.lrPostForm(top.$.rootUrl + '/LR_SystemModule/DatabaseLink/TestConnection', { connection: connection, dbType: dbType, keyValue: keyValue });
});
},
initData: function () {
if (!!selectedRow) {
keyValue = selectedRow.F_DatabaseLinkId;
$('#form').lrSetFormData(selectedRow);
}
}
};
// 保存数据
acceptClick = function (callBack) {
if (!$('#form').lrValidform()) {
return false;
}
var postData = $('#form').lrGetFormData(keyValue);
$.lrSaveForm(top.$.rootUrl + '/LR_SystemModule/DatabaseLink/SaveForm?keyValue=' + keyValue, postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack();
}
});
};
page.init();
}