獲取點擊單元格值 (一列的)
在下圖的事件中雙擊打開的頁面中 寫上
// str = params.split("&")[0].split("=")[1]; //獲取點擊單元格值
D70CB04B-86B0-4723-9264-CCDE0E0BCDB1.png
1573725279(1).jpg
202FC142-061E-4f70-B2E2-57D282DCA82B.png
獲取單元格某一個的值
例:獲取A5的值
var str = report.getCell("A5").getValue() //獲取報表格中值
DCE189D8-2148-4884-AF5D-9C90E54E099B.png
點擊跳轉(zhuǎn)窗口 url時:
var url ="/modules/cba4b529-0267-4525-b249-01e639de1860/hw6N11Mgqq/hwN8dDcKh6/hw1yQjIqEj/hwWXNMPkUR/hwsaFzrEZE.html?jh=" + str + "&rq=" + rqa+"";
window.open(url, "_blank");
點擊跳轉(zhuǎn)窗口 src時:
document.getElementById("iframepage8").src = "/modules/cba4b529-0267-4525-b249-01e639de1860/hw6N11Mgqq/hwN8dDcKh6/hw1yQjIqEj/hwWXNMPkUR/hwvNw03snC.html?jh=" + jha + "&rq=" + rqa;
js中向數(shù)據(jù)庫取值
//獲取數(shù)據(jù)庫信息
hwDas.get({
host: vmd.workspace.dataServiceIp, //固定地址
url: 'znyqt/xbznyqt/ylyczd/ylyczdjg' //數(shù)據(jù)服務(wù)地址
}, {}, {
'jh': jha //向數(shù)據(jù)庫傳參,jh是數(shù)據(jù)庫字段
},
function(result) { //獲取數(shù)據(jù)庫數(shù)據(jù)
var data = result.data[0].datas;
var ycxx = data[0].fjbz;// fjbz是數(shù)據(jù)庫字段
if (result.isSucceed) {
var data = result.data[0].datas;
var ycxx = data[0].fjbz;
} else {
vmd.alert("錯誤", "壓力異常獲取失敗淹接!"); //獲取失敗時彈窗
console.log(result.errMsg);
}
},
function(msg) {//異常時執(zhí)行
}
);
js中向數(shù)據(jù)庫保存
//信息入庫
var jg = hwTextArea.getValue() //獲取分析結(jié)果信息
if (jg) {
var hostUrl = {
host: vmd.workspace.dataServiceIp, //固定寫法
url: "znyqt/xbznyqt/ylyczd/fzfxa" //數(shù)據(jù)服務(wù)地址
};
var headers = {};
var params = {};
var datas = { //在修改中 向數(shù)據(jù)庫傳參和要修改的數(shù)據(jù) 都放在這里
jh: jha, //向數(shù)據(jù)庫傳數(shù)據(jù),jh,ylrq,ylfxjg是數(shù)據(jù)庫字段
ylrq: rq,
ylfxjg: jg
};
hwDas.edit(hostUrl, headers, params, datas, function(result) {
if (result.isSucceed) {
console.log(result);
} else {
vmd.alert("錯誤", "壓力異常分析保存失斄欧埂镶苞!"); //保存失敗時彈窗
console.log(result.errMsg);
}
}, function(msg) {
console.log(msg);
});
alert("保存成功")
location = location //刷新當(dāng)前頁面
} else {
alert("請輸入壓力分析結(jié)果")
}