⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fcrep.js

📁 一个完整的
💻 JS
📖 第 1 页 / 共 5 页
字号:
					if (blnPressDown==false) {
						cmdMiddle.setAttribute("fcDown","0")
						curTD.vAlign=""
					}
					else {
						cmdTopv.setAttribute("fcDown","0")
						cmdMiddle.setAttribute("fcDown","0")
						cmdBottomv.setAttribute("fcDown","1")
						cmdTopv.className="tblclassup"
						cmdMiddle.className="tblclassup"
						curTD.vAlign="bottom"
					}
				}
			}
		}		
	}
	blnChange=true
	hideTxt()
	SaveoRedoOneRecord()	//在改变之后保存住位置,备redo时装入
}
function showFontProperty(tdobj){	
	if (tdobj.align=="left") {
		cmdLeft.setAttribute("fcDown","1")
		cmdLeft.className="divmenutrue"
	}
	else {
		cmdLeft.setAttribute("fcDown","0")
		cmdLeft.className="tblclassup"
	}
	if (tdobj.align=="center") {
		cmdCenter.setAttribute("fcDown","1")
		cmdCenter.className="divmenutrue"
	}
	else {
		cmdCenter.setAttribute("fcDown","0")
		cmdCenter.className="tblclassup"
	}
	if (tdobj.align=="right") {
		cmdRight.setAttribute("fcDown","1")
		cmdRight.className="divmenutrue"
	}
	else {
		cmdRight.setAttribute("fcDown","0")
		cmdRight.className="tblclassup"
	}
	if (tdobj.vAlign=="top") {
		cmdTopv.setAttribute("fcDown","1")
		cmdTopv.className="divmenutrue"
	}
	else {
		cmdTopv.setAttribute("fcDown","0")
		cmdTopv.className="tblclassup"
	}
	if (tdobj.vAlign=="middle") {
		cmdMiddle.setAttribute("fcDown","1")
		cmdMiddle.className="divmenutrue"
	}
	else {
		cmdMiddle.setAttribute("fcDown","0")
		cmdMiddle.className="tblclassup"
	}
	if (tdobj.vAlign=="bottom") {
		cmdBottomv.setAttribute("fcDown","1")
		cmdBottomv.className="divmenutrue"
	}
	else {
		cmdBottomv.setAttribute("fcDown","0")
		cmdBottomv.className="tblclassup"
	}

//跟踪B I U
	if (tdobj.style.fontWeight=="bold") {
		cmdFontBold.setAttribute("fcDown","1")
		cmdFontBold.className="divmenutrue"
	}
	else {
		cmdFontBold.setAttribute("fcDown","0")
		cmdFontBold.className="tblclassup"
	}
	
	if (tdobj.style.fontStyle=="italic") {
		cmdFontItalic.setAttribute("fcDown","1")
		cmdFontItalic.className="divmenutrue"
	}
	else {
		cmdFontItalic.setAttribute("fcDown","0")
		cmdFontItalic.className="tblclassup"
	}
	if (tdobj.style.textDecorationUnderline==true) {
		cmdFontU.setAttribute("fcDown","1")
		cmdFontU.className="divmenutrue"
	}
	else {
		cmdFontU.setAttribute("fcDown","0")
		cmdFontU.className="tblclassup"
	}
	
	var strFont=tdobj.style.fontFamily	
	var lngFontSize=parseInt(tdobj.style.fontSize)
	switch(strFont)	{
	case "宋体":
		cboFont.selectedIndex =0
		break;
	case "仿宋_GB2312":
		cboFont.selectedIndex =1
		break;
	case "黑体":
		cboFont.selectedIndex =2
		break;
	case "楷体_GB2312":
		cboFont.selectedIndex =3
		break;
	case "隶书":
		cboFont.selectedIndex =4
		break;
	case "幼圆":
		cboFont.selectedIndex =5
		break;
	case "Arial":
		cboFont.selectedIndex =6
		break;
	case "Courier":
		cboFont.selectedIndex =7
		break;
	default:
		cboFont.selectedIndex =0
		break;	
	}			

	switch(lngFontSize)	{
	case 4:
		cboFontSize.selectedIndex =0
		break;	
	case 6:
		cboFontSize.selectedIndex =1
		break;	
	case 8:
		cboFontSize.selectedIndex =2
		break;
	case 9:	
	case 10:
	case 11:	
	case 12:
		cboFontSize.selectedIndex =lngFontSize - 6
		break;	
	case 14:
		cboFontSize.selectedIndex =7
		break;	
	case 16:
		cboFontSize.selectedIndex =8
		break;	
	case 18:
		cboFontSize.selectedIndex =9
		break;	
	case 20:
		cboFontSize.selectedIndex =10
		break;	
	case 22:
		cboFontSize.selectedIndex =11
		break;	
	case 24:
		cboFontSize.selectedIndex =12
		break;
	case 26:
		cboFontSize.selectedIndex =13
		break;	
	case 28:
		cboFontSize.selectedIndex =14
		break;	
	case 36:
		cboFontSize.selectedIndex =15
		break;	
	case 48:
		cboFontSize.selectedIndex =16
		break;		
	case 72:
		cboFontSize.selectedIndex =17
		break;		
	default:
		cboFontSize.selectedIndex =8
		break;			
	}
	//show(tdobj.bgColor)
	if(isSpace(tdobj.bgColor)){
		sel1.selectedIndex=0
	}
	else {
		for(var i=1;i<sel1.options.length;i++){
			if(sel1.options(i).style.backgroundColor==tdobj.bgColor){
				sel1.selectedIndex=i
				break
			}
		}
	}
	if(isSpace(tdobj.style.color)){
		sel2.selectedIndex=0
	}
	else {
		for(var i=1;i<sel2.options.length;i++){
			if(sel2.options(i).style.backgroundColor==tdobj.style.color){
				sel2.selectedIndex=i
				break
			}
		}
	}
}

function ExitMe() {
	//用于点击了工具栏上的按钮后将焦点给到文本框上
	window.setTimeout("try {txtMyGrid.focus()} catch (e){}", 10);
}
function InitOutTable() {
//初始化表格以外的东西:滚动条,div的边框,运行时显示的按钮等
//用于打开一个表将这些东西调动后(用进入时运行事件)又打开一个表时恢复
	t.parentNode.style.borderLeft="1px solid";
	t.parentNode.style.borderRight="1px solid";
	t.parentNode.style.borderTop="1px solid";
	t.parentNode.style.borderBottom="1px solid";
	grid.hideHscroll=false;
	grid.hideVscroll=false;
	t.parentNode.style.backgroundImage="";
	t.parentNode.style.backgroundColor="";
	fcPage.style.display="none"
	fcShowAll.style.display="none"
	for(var i=0;i<5;i++){fcButton[i].style.display="none"}
	txtMyGrid.style.display="none"
	tc.style.display="none"
	fc_curpage=1
	fc_allpages=1
}
//*****************************************************************************************
//常用函数 end
//*****************************************************************************************
function SaveReport() {
	t.setAttribute("graph",escape(oGraph.documentElement.xml))
	CopytHtml()
	var s1=document.title 
	if(isSpace(s1)){
		//新增存盘
		var sRet=window.showModalDialog("input.htm",s1,"status:no;dialogHeight:120px;dialogWidth:400px;dialogTop:180;dialogLeft:250px") 
		if(typeof sRet=="undefined") return
		
		var s2=SqlToField("select fstrTableName from fcCell where fstrTableName='"+escape(sRet)+"'")
		if(s2!=""){
			alert("报表名称:"+sRet+"的报表已存在,请另取一个报表名称。")	
			return
		}
		//var sql="Insert into fcCell (fstrTableName,fstrTable,fstrTable1) values ('"+escape(sRet)+"','"+escape(t.outerHTML)+"','"+escape(tCopy.innerHTML)+"')"
		
		var sql="<fstrtablename>"+escape(sRet)+"</fstrtablename><fstrtable>"+escape(t.outerHTML)+"</fstrtable><fstrtable1>"+escape(tCopy.innerHTML)+"</fstrtable1>"
		document.title=sRet
		var sR=fc_insertClob(sql)
	}
	else {
		//修改存盘
//		var sql="Update fcCell set fstrTable='"+escape(t.outerHTML)+"',fstrTable1='"+escape(tCopy.innerHTML)+"' Where fstrTableName='"+escape(s1)+"'"
		var sql="<fstrtablename>"+escape(s1)+"</fstrtablename><fstrtable>"+escape(t.outerHTML)+"</fstrtable><fstrtable1>"+escape(tCopy.innerHTML)+"</fstrtable1>"
		document.title=s1
		var sR=fc_updateClob(sql)
	}
	if(isSpace(sR)){
		alert("保存成功!")
	}
	else{
		alert(sR)
	}
	blnChange=false
}
function SaveAsReport() {
	t.setAttribute("graph",escape(oGraph.documentElement.xml))
	CopytHtml()
	var sRet=window.showModalDialog("input.htm","","status:no;dialogHeight:120px;dialogWidth:400px;dialogTop:180;dialogLeft:250px") 
	if(typeof sRet=="undefined") return
	var s2=SqlToField("select fstrTableName from fcCell where fstrTableName='"+escape(sRet)+"'")
	if(s2!=""){
		alert("报表名称:"+sRet+"的报表已存在,请另取一个报表名称。")	
		return
	}
//	var sql="Insert into fcCell (fstrTableName,fstrTable,fstrTable1) values ('"+escape(sRet)+"','"+escape(t.outerHTML)+"','"+escape(tCopy.innerHTML)+"')"
//	var sR=fc_insert(sql)
	var sql="<fstrtablename>"+escape(sRet)+"</fstrtablename><fstrtable>"+escape(t.outerHTML)+"</fstrtable><fstrtable1>"+escape(tCopy.outerHTML)+"</fstrtable1>"
	var sR=fc_insertClob(sql)
	if(isSpace(sR)){
		document.title=sRet
		alert("保存成功!")
	}
	else{
		alert(sR)
	}
	blnChange=false
}
function NewReport() {
	//先检查是否要保存当前报表
	CheckReportChange()
	var sTab='<TABLE borderColor=lightgrey borderColorDark=white cellPadding=0 cellSpacing=0 frame=box id=t style="BORDER-COLLAPSE: collapse; BORDER-BOTTOM: 1px solid; BORDER-LEFT: 1px solid; BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid;  CURSOR: default; FILTER: alpha(opacity=90);TABLE-LAYOUT: fixed; POSITION: absolute; LEFT: 0px; TOP: 0px" '
			+'onmousedown="t_onmousedown()" onmousemove="t_onmousemove()" onmouseup="t_onmouseup()" >'
			+'<COLGROUP id=tg><COL style="width:35" align=middle class=fixedStyle><COL style="width:70"><COL style="width:70"><COL style="width:70"><COL style="width:70"><COL style="width:70"><COL style="width:70"><COL style="width:70"><COL style="width:70"><COL style="width:70"><COL style="width:70"></COLGROUP>'
			+'<THEAD><TR style="height:21" align=middle class=fixedStyle ><TD></TD><TD>A</TD><TD>B</TD><TD>C</TD><TD>D</TD><TD>E</TD><TD>F</TD><TD>G</TD><TD>H</TD><TD>I</TD><TD>J</TD></TR></THEAD>'
			+'<TBODY>'
			+'<TR style="height:21"><TD>1</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR>'
			+'<TR style="height:21"><TD>2</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>3</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>4</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>5</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>6</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>7</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>8</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>9</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>10</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>11</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>12</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>13</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>14</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>15</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>16</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>17</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>18</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>19</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>20</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>21</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>22</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>23</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD>24</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR style="height:21"><TD >25</TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR>'
			+'</TBODY></TABLE>'
	t.outerHTML=sTab	
	CopytHtml()
	document.title=""
	grid.reload(sTab)	
	
	initoUndooRedo()
	
	oFormula=new ActiveXObject("Microsoft.XMLDOM")
	oFormula.async ="false";
	oFormula.loadXML("<root></root>")
	oGraph=new ActiveXObject("Microsoft.XMLDOM")
	oGraph.async ="false";
	oGraph.loadXML("<root></root>")
	blnChange=false
}
function LoadReport(TableName,sFilter) {
//TableName为打开的报表名称。
//sFilter为联查报表时的过滤条件串
	//先检查是否要保存当前报表
	//show("aaa")
	CheckReportChange()
	ShowWait.style.display="block";
	//var sql="select fstrTable from fcCell Where fstrTableName='"+escape(TableName)+"'"
	//var sTab=unescape(SqlToField(sql))
	var sTab=unescape(fc_loadClob("<no>"+escape(TableName)+"</no>"))
	var sTab1=unescape(fc_loadClob1("<no>"+escape(TableName)+"</no>"))
	/*
	var sRet=fc_loadClob1("<no>"+escape(TableName)+"</no>")
	var oTab=new ActiveXObject("Microsoft.XMLDOM")
	oTab.async ="false";
	oTab.loadXML("<root>"+sRet+"</root>")
	var sTab=unescape(oTab.documentElement.childNodes(0).text)
	var sTab1=unescape(oTab.documentElement.childNodes(1).text)
*/
	//去掉id=t
	sTab1=fc_RepStr(sTab1," id=t "," ")
	tCopy.innerHTML=sTab1

	//去掉尾部的?字符
	//if(sTab.substring(sTab.length-1,sTab.length)!=">")
	//	sTab=sTab.substring(0,sTab.length-1)

	t.outerHTML=sTab	
	//CopytHtml()	

	document.title=TableName
	grid.reload(sTab)
	InitOutTable()
//----------------------
	initoUndooRedo()
		
	LoadAllFormula()
//	oGraph=new ActiveXObject("Microsoft.XMLDOM")
//	oGraph.async ="false";
//	oGraph.loadXML("<root></root>")
	LoadGraph(1)
	queryToolbar.style.display="none"
	//装入运行时的设置参数
	if(blnRunMode) {
		
		//查询SQL
		queryToolbar.style.display="block"
		initButton()
		var s1=t.getAttribute("queryorder")
		if(s1=="1" && arguments.length==1){
			//直接出查询条件对话框
			fc_wherexml=""	//清空条件变量
			fc_getwhere()
		}
		else {
			//LoadWhereToSql()
			//用于打开统计表时,需要装入缺省条件进行查询
			if (arguments.length==2){
				fc_wherexml=sFilter
			}
			else {
				if(isSpace(t.getAttribute("initwhere")))
					fc_wherexml=""
				else 
					fc_wherexml=t.getAttribute("initwhere")
				
				
			}
			fc_wherexml=unescape(fc_wherexml)
		
			fc_curpage=1
			fc_executesql(1,fc_wherexml)//1 为页号,fc_wherexml为条件数据的XML串
			//-----------------------------------
		}
		var arySend=t.getAttribute("runpara")
		if(arySend!=null){
			eval(unescape(arySend))
		}
	}
	//当外部是自动表格尺寸时
	if (grid.autosize){
		grid.hideVscroll=true
		grid.hideHscroll=true
		grid.autosize=true
	}
	//----------------------
	//运行模式中的参数内容:
	/*
		隐藏行标列标和边框:
		t.rows(0).style.display="none";
		t.childNodes(0).childNodes(0).style.pixelWidth=0;
		t.border=0;
		t.style.borderLeft="";
		t.style.borderRight="";
		t.style.borderTop="";
		t.style.borderBottom="";
		
		隐藏滚动条:
		grid.hideVscroll=true;
		grid.hideHscroll=true;
		
		不能修改行高列宽
		grid.AdjustRowHeight=false;
		grid.AdjustColWidth=false;
		
		只读
		(不能增删行增删列,除设了回车键后移动到何单元此属性之外的单元(不能录入和点击进入),不出现兰框
		grid.ReadOnly=true;
		
		在固定列上能否拖动修改
	*/
	//----------------------
	blnChange=false
	window.setTimeout("ShowWait.style.display='none';", 10);	
}
function PrintReport(){
	grid.prn.inPrint=1
	grid.print()
}
function PreviewReport() {
	grid.prn.inPrint=0
	grid.print()
}
function cmdBlockCopy(){
	if (tc.style.display =="none")
		return
//检查区域是否有合并的单元格	
/*	if (lngStatus==3 || lngStatus==4){
		alert("选择的区域内有合并单元格,不能做块复制!")
		return
	}	
*/
//块复制
	var i,j,clipboard=""
	//var sColno,eColno	
	//blockObjAry=new Array()
	//blockObjAry[0]=eRowSort-sRowSort
	//blockObjAry[1]=eColSort-sColSort
	//var inx=2
	for (i=sRowSort;i<=eRowSort;i++){
	/*
		sColno=sCol
		eColno=eCol
		var osFind=oCoor.documentElement.selectNodes("//record[row='" + i + "' and col='" +sCol +"']")
		if (osFind.length>=1)		
			sColno=parseInt(osFind.item(0).childNodes.item(2).text)
		var osFind=oCoor.documentElement.selectNodes("//record[row='" + i + "' and col='" +eCol +"']")
		if (osFind.length>=1)		
			eColno=parseInt(osFind.item(0).childNodes.item(2).text)			
	*/
		for (j=sColSort;j<=eColSort;j++){
			var arr=PhyToLog(i,j)
			var curTD=t.rows(arr[0]).cells(arr[1])
		//	blockObjAry[inx]=c

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -