You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
251 lines
5.7 KiB
251 lines
5.7 KiB
|
|
|
|
// 等于 = 0,
|
|
//不等于 = 1,
|
|
//小于 = 2,
|
|
//大于 = 3,
|
|
//小于等于 = 4,
|
|
//大于等于 = 5,
|
|
//范围内 = 6,
|
|
//范围外 = 7,
|
|
//包含 = 8,
|
|
//头部包含 = 9,
|
|
//尾部包含 = 10,
|
|
//不包含 = 11
|
|
|
|
//数值型 = 0,
|
|
//字符型 = 1,
|
|
//日期型 = 2,
|
|
//布尔值 = 3
|
|
function GetDataTypeString() {
|
|
var obj = new Array();
|
|
var ii = { value: 0, Str: "数值型" }; obj.push(ii);
|
|
var ii = { value: 1, Str: "字符型" }; obj.push(ii);
|
|
var ii = { value: 2, Str: "日期型" }; obj.push(ii);
|
|
var ii = { value: 3, Str: "布尔值" }; obj.push(ii);
|
|
|
|
return obj;
|
|
}
|
|
|
|
|
|
function GetDataTypeByNum(Num) {
|
|
var Str="";
|
|
switch(Num)
|
|
{
|
|
case "0": Str = "数值型";
|
|
break;
|
|
case "1": Str = "字符型";
|
|
break;
|
|
case "2": Str = "日期型";
|
|
break;
|
|
case "3": Str = "布尔值";
|
|
break;
|
|
}
|
|
|
|
return Str;
|
|
}
|
|
|
|
function ReplaceALL(str, f, e) {//吧f替换成e
|
|
|
|
var reg = new RegExp(f, "g")
|
|
var newstr = str.replace(reg, e);
|
|
return newstr;
|
|
|
|
}
|
|
|
|
|
|
function GetLogStringALL() {
|
|
var obj = new Array();
|
|
var ii = { value: 0, Str: "等于" }; obj.push(ii);
|
|
var ii = { value: 1, Str: "不等于" }; obj.push(ii);
|
|
var ii = { value: 2, Str: "小于" }; obj.push(ii);
|
|
var ii = { value: 3, Str: "大于" }; obj.push(ii);
|
|
var ii = { value: 4, Str: "小于等于" }; obj.push(ii);
|
|
var ii = { value: 5, Str: "大于等于" }; obj.push(ii);
|
|
var ii = { value: 6, Str: "范围内" }; obj.push(ii);
|
|
var ii = { value: 7, Str: "范围外" }; obj.push(ii);
|
|
var ii = { value: 8, Str: "包含" }; obj.push(ii);
|
|
var ii = { value: 9, Str: "头部包含" }; obj.push(ii);
|
|
var ii = { value: 10, Str: "尾部包含" }; obj.push(ii);
|
|
var ii = { value: 11, Str: "不包含" }; obj.push(ii);
|
|
return obj;
|
|
}
|
|
|
|
function GetLogStringByNum(Num) {
|
|
switch (Num)
|
|
{
|
|
case 0: return "等于";
|
|
case 1: return "不等于";
|
|
case 2: return "小于";
|
|
case 3: return "大于";
|
|
case 4: return "小于等于";
|
|
case 5: return "大于等于";
|
|
case 6: return "范围内";
|
|
case 7: return "范围外";
|
|
case 8: return "包含";
|
|
case 9: return "头部包含";
|
|
case 10: return "尾部包含";
|
|
case 11: return "不包含";
|
|
|
|
}
|
|
return "";
|
|
}
|
|
|
|
|
|
function GetLogString(str) {
|
|
var obj = new Array();
|
|
var LogALL = GetLogStringALL();
|
|
|
|
switch (str) {
|
|
case "字符型":
|
|
for (var i = 0; i <= 11; i++) {
|
|
obj.push(LogALL[i]);
|
|
}
|
|
break;
|
|
case "日期型":
|
|
case "数值型":
|
|
for (var i = 0; i <= 7; i++) {
|
|
obj.push(LogALL[i]);
|
|
}
|
|
break;
|
|
case "布尔值":
|
|
obj.push(LogALL[0]);
|
|
obj.push(LogALL[1]);
|
|
break;
|
|
}
|
|
return obj;
|
|
}
|
|
|
|
|
|
function GetCLogString(str) {
|
|
|
|
switch (str) {
|
|
case "1"://字符型
|
|
return "0,1,2,3,4,5,6,7,8,9,10,11";
|
|
case "2"://日期型
|
|
case "0"://数值型
|
|
return "0,1,2,3,4,5,6,7";
|
|
case "3"://布尔值
|
|
return "0,1";
|
|
|
|
}
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
function checkboxToNumStr(checkbox)
|
|
{
|
|
if (checkbox.checked) {
|
|
return '1';
|
|
}
|
|
else { return '0';}
|
|
}
|
|
|
|
|
|
//合并单元格
|
|
function Merger(gridName, CellName) {
|
|
|
|
//得到显示到界面的id集合
|
|
var mya = $("#" + gridName + "").getDataIDs();
|
|
//当前显示多少条
|
|
var length = mya.length;
|
|
for (var i = 0; i < length; i++) {
|
|
//从上到下获取一条信息
|
|
var before = $("#" + gridName + "").jqGrid('getRowData', mya[i]);
|
|
//定义合并行数
|
|
var rowSpanTaxCount = 1;
|
|
for (j = i + 1; j <= length; j++) {
|
|
//和上边的信息对比 如果值一样就合并行数+1 然后设置rowspan 让当前单元格隐藏
|
|
var end = $("#" + gridName + "").jqGrid('getRowData', mya[j]);
|
|
if (before[CellName] == end[CellName]) {
|
|
rowSpanTaxCount++;
|
|
$("#" + gridName + "").setCell(mya[j], CellName, '', { display: 'none' });
|
|
|
|
}
|
|
else {
|
|
rowSpanTaxCount = 1;
|
|
break;
|
|
}
|
|
|
|
$("#" + CellName + "" + mya[i] + "").attr("rowspan", rowSpanTaxCount);
|
|
}
|
|
}
|
|
}
|
|
|
|
/*
|
|
* 浏览器全屏
|
|
*/
|
|
function fullScreen() {
|
|
|
|
var el = document.documentElement;
|
|
|
|
var rfs = el.requestFullScreen || el.webkitRequestFullScreen;
|
|
|
|
if (typeof rfs != "undefined" && rfs) {
|
|
|
|
rfs.call(el);
|
|
|
|
} else if (typeof window.ActiveXObject != "undefined") {
|
|
|
|
var wscript = new ActiveXObject("WScript.Shell");
|
|
|
|
if (wscript != null) {
|
|
|
|
wscript.SendKeys("{F11}");
|
|
|
|
}
|
|
|
|
} else if (el.msRequestFullscreen) {
|
|
|
|
el.msRequestFullscreen();
|
|
|
|
} else if (el.oRequestFullscreen) {
|
|
|
|
el.oRequestFullscreen();
|
|
|
|
} else {
|
|
|
|
alert("浏览器不支持全屏调用,请按F11键切换全屏!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*
|
|
* 浏览器退出全屏
|
|
*/
|
|
function exitFullScreen() {
|
|
|
|
var el = document;
|
|
|
|
var cfs = el.cancelFullScreen || el.webkitCancelFullScreen || el.exitFullScreen;
|
|
|
|
if (typeof cfs != "undefined" && cfs) {
|
|
|
|
cfs.call(el);
|
|
|
|
} else if (typeof window.ActiveXObject != "undefined") {
|
|
|
|
var wscript = new ActiveXObject("WScript.Shell");
|
|
|
|
if (wscript != null) {
|
|
|
|
wscript.SendKeys("{F11}");
|
|
|
|
}
|
|
|
|
} else if (el.msExitFullscreen) {
|
|
|
|
el.msExitFullscreen();
|
|
|
|
} else if (el.oRequestFullscreen) {
|
|
|
|
el.oCancelFullScreen();
|
|
|
|
} else {
|
|
|
|
alert( "浏览器不支持全屏调用,请按F11键切换全屏!" );
|
|
}
|
|
|
|
}
|