用html+javascript打造公文一键排版系统8:附件及标题排版

最近工作有点忙,所 以没能及时完善公文一键排版系统,现在只好熬夜更新一下。

有时公文有包括附件,招照公文排版规范:

附件应当另面编排,并在版记之前,与公文正文一起装订。“附件”二字及附件顺序号用3号黑体字顶格编排在版心左上角第一行。附件标题居中编排在版心第三行。附件顺序号和附件标题应当与附件说明的表述一致。附件格式要求同正文。

如附件与正文不能一起装订,应当在附件左上角第一行顶格编排公文的发文字号并在其后标注“附件”二字及附件顺序号。

 这里我们先实现附件与公文正文一起装订的情况,暂时不考虑附件与正文不能一起装订的情况。

要对附件及附件标题进行排版,首先要判断并确认附件及附件标题。

“附件”标识行,如果只有一个附件时,通常内容就是“附件”两个字。这时我们可以这样判断:

//功能:判断字符串是否为“附件”“附件x”“附件x-x”,其中x为阿拉伯数字
//输入:p:字符串
//输出:true:是;false:否
//记录:20230726创建
function isAttachment(p) 
{return "附件"==p ? true : false;
}

如果有多个附件“附件”标识行的内容就是附件x或附件x-x,其中x为阿拉伯数字。

我们可以用正则表达式来判断:

//功能:判断字符串是否为“附件”“附件x”“附件x-x”,其中x为阿拉伯数字
//输入:p:字符串
//输出:true:是;false:否
//记录:20230726创建
function isAttachment(p) 
{//return "附件"==p ? true : false;return (/^(附件){1}([\d|-]*)$/.test(p)); 
}

如果我们在输入公文“附件”标识行时不小心在“附”和“件”之间添加了空格呢?我们也要考虑这种情况并给予温馨提示,把上面的代码再进一步改进如下:

//功能:判断字符串是否为“附件”“附件x”“附件x-x”,其中x为阿拉伯数字
//输入:p:字符串
//输出:true:是;false:否
//记录:20230726创建
function isAttachment(p) 
{//return "附件"==p ? true : false;//return (/^(附件){1}([\d|-]*)$/.test(p)); return (/^(附){1}\s*(件){1}([\d|-]*)$/.test(p)); 
}

由于附件标题的格式与正文的标题格式是一致的,所 以我们只需要调用 isAstatement()来进行判断就行了。

与对落款判断和排版一样,我们把前后相连两个段落内容放在一起进行判断:

//功能:判断相连两段文字是否为附件及标题
//输入:p1:前一段;p2:后一段
//输出:true:是;false:否
//记录:20230726创建
function isAttachmentTitle(p1, p2)
{if (! isAttachment(p1))//前一段内容是“附件”?{return false;//不是}return (! isAstatement(p2));	//后一段是否为一句话
}//isAttachmentTitle()

如果确定两个段落内容是附件及附件标题,那么我们就可以进行排版了:

//功能:设置附件及附件标题格式
//输入:p1:附件;p2:附件标题
//输出:附件及附件标题格式化后的字符串
//记录:20230726创建
function setAttachmentTitleFmt(p1, p2)
{//附件 与 附件标题之间要间隔一行return '<p style="margin:0px; font-family:黑体; font-size:' + mtfs + 'pt; line-height:"'	+ rs +'">' + p1 + '</p><p style="margin:0px; font-size:28pt; line-height:"'	+ rs +'">&nbsp;</p><p style="margin:0px; text-align:center; font-family:' + dtfn + '; font-size:' + dtfs + 'pt; line-height:"'	+ rs +'">' + p2 + '</p>';}//setAttachmentTitleFmt(p1, p2)

如果我们想智能化和人性化一些,那么可以对在输入公文“附件”标识行时不小心在“附”和“件”之间添加了空格这种情况进行检测并给予温馨提示,我们要添加一个函数isAttachmentWithSpace() ,利用正则表达式来检测字符串中是否包含空格:

//功能:判断字符串是否为“附s件”“附s件x”“附s件x-x”,其中s为空格,x为阿拉伯数字
//输入:p:字符串
//输出:true:是;false:否
//记录:20230726创建
function isAttachmentWithSpace(p) 
{//return "附件"==p ? true : false;return (/^(附){1}\s+(件){1}([\d|-]*)$/.test(p)); 
}

然后为字符串增加一个删除所有空格的方法.eliminateSpace():

//功能:删除字符串中的所有空格
//记录:20230726创建
String.prototype.eliminateSpace = function()
{return this.replace(/\s*/g,"");
}

再修改完善setAttachmentTitleFmt()函数,引入上面增加的函数isAttachmentWithSpace() 和.eliminateSpace():

//功能:设置附件及附件标题格式
//输入:p1:附件;p2:附件标题
//输出:附件及附件标题格式化后的字符串
//记录:20230726创建
function setAttachmentTitleFmt(p1, p2)
{//附件 与 附件标题之间要间隔一行//return '<p style="margin:0px; font-family:黑体; font-size:' + mtfs + 'pt; line-height:"'	+ rs +'">' + p1 + '</p><p style="margin:0px; font-size:28pt; line-height:"'	+ rs +'">&nbsp;</p><p style="margin:0px; text-align:center; font-family:' + dtfn + '; font-size:' + dtfs + 'pt; line-height:"'	+ rs +'">' + p2 + '</p>';return '<p style="margin:0px; font-family:黑体; font-size:' + mtfs + 'pt; line-height:'	+ rs + 'pt">'  +  (isAttachmentWithSpace(p1)  ? p1.eliminateSpace() + '<span style="color:red; font-style:italic;padding-left:15pt">*公文一键排版系统温馨提示:本行多余的空格已删除</span>' : p1) + '</p><p style="margin:0px; font-size:' + mtfs + 'pt; line-height:'	+ rs + 'pt">&nbsp;</p><p style="margin:0px; text-align:center; font-family:' + dtfn + '; font-size:' + dtfs + 'pt; line-height:' + rs +'pt">' + p2 + '</p>';
}//setAttachmentTitleFmt(p1, p2)

这样,程序在遇到输入公文“附件”标识行时不小心在“附”和“件”之间添加了空格呢这种情况会改正并给予温馨提示:

*公文一键排版系统温馨提示:本行多余的空格已删除

 最后我们修改setDocFmt(),对附件和附件标题进行判断和排版:

//功能:设置公文格式Set document format
//输入:无
//输出:无
//记录:20230726添加对附件及附件标题格式的处理代码
function setDocFmt()
{taDbg.value += "\n---setDocFmt()\n";getArg(); //读取预设参数var t = getClearInfoArray();//标题if (cbDocTilte){t[0]  = setDocTitle(t[0]) + '</p><p style="margin:0px; line-height:"' + rs +'">&nbsp;';}var i =  (cbDocTilte ? 1 : 0);//增:2023-07-16while (i < t.length){if (i < t.length-1)//20230726增加{if (isBadging(t[i],t[i+1]))//是落款?{//落款前加空行t[i-1] += '</p><p style="margin:0px; line-height:"' + rs +'">&nbsp;';//设置落款t[i] = setBadging(t[i],t[i+1]);t[i+1] = null;taDbg.value += "\nt[" + (i-1) + "]=" + t[i-1] + "\nt[" + i +"]=" + t[i] + "\nt[" +(i+1) +"]=" + t[i+1];//i++;//i++;i += 2;continue;}if (isAttachmentTitle(t[i],t[i+1]))	  //是附件及附件标题?{t[i] = setAttachmentTitleFmt(t[i],t[i+1]);t[i+1] = null;taDbg.value += "\nt[" + (i-1) + "]=" + t[i-1] + "\nt[" + i +"]=" + t[i] + "\nt[" +(i+1) +"]=" + t[i+1];//i++;//i++;i += 2;continue;}}//ift[i] = setParaFmt(t[i]);i++;}//while()alert(t.join(''));edRichBody.innerHTML = t.join(''); 
}//setDocFmt() 

之前我们在调用 isBadging(t[i],t[i+1])将前后相连两个段落内容放在一起判断是否为落款时,没有考虑t[i]为最后一个段落,t[i+1]=undefined 这种情况,现在调用isAttachmentTitle(t[i],t[i+1])是否为附件及附件标题时,也面临 同样的情况,所以这里我们增加了

 if (i < t.length-1)//20230726增加
{
//*****
}

代码运行效果如下:

 

完整代码如下:

<!DOCTYPE HTML>
<HTML>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Author" content="PurpleEndurer">
<title>公文一键排版系统</title><script type="text/javascript">
var aFontName = ["方正小标宋简体",//0"黑体",//1"微软雅黑",//2"仿宋_GB2312",//3"仿宋",//4"楷体_GB2312",//5"楷体",//6"宋体",//7"Arial",//8"Wingdings 2"//9
];//sId:select control id, iDefSel:default selected
function showFontNameSel(sId, iDefSel)
{document.write('<select id="', sId, '" width="50">');for (var i = 0; i < aFontName.length; i++){document.write('<option value="', aFontName[i], '"');document.write(i==iDefSel ? ' selected>' : '>');document.write(aFontName[i],'</option>');}document.write('</select>');
}var aFontSize = [['初号', 42],//0['小初', 36],//1['一号', 26],//2['小一', 24],//3['二号', 22],//4['小二', 18],//5['三号', 16],//6['小三', 15],//7['四号', 14],//8['小四', 12],//9['五号', 10.5], //10['小五', 9],//11['六号', 7.5],//12['小六', 6.5],//13['七号', 5.5],//14['八号', 5]//15
];//sId:select control id, iDefSel:default selected
function showFontSizeSel(sId, iDefSel)
{document.write('<select id="', sId, '">');for (var i = 0; i < aFontSize.length; i++){document.write('<option value="',aFontSize[i][1], '"');document.write(i==iDefSel ? ' selected>' : '>');document.write(aFontSize[i][0],'</option>');}document.write('</select>');
}var aAlign = [["左对齐","left"],//0["居中对齐","center"],//1["右对齐","right"],//2["两端分散对齐","justify"]//3
];//sId:select control id, iDefSel:default selected
function showAlignSel(sId, iDefSel)
{document.write('<select id="', sId, '">');for (var i = 0; i < aAlign.length; i++){document.write('<option value="',aAlign[i][1], '"');document.write(i==iDefSel ? ' selected>' : '>');document.write(aAlign[i][0],'</option>');}document.write('</select>');
}//showAlignSel()function setDocTitle(s)
{
/*//标题字体名 font name//var o = document.getElementById('selDocTitleFontName');var dtfn = document.getElementById('selDocTitleFontName').value;//alert(fn);//标题字号 font sizevar dtfs = document.getElementById('selDocTitleFontSize').value;//alert(fs);//标题对齐方式 text alignvar dtta = document.getElementById('selDocTitleAlign').value;//alert(ta);//标题行距 row spacing//var rs  = document.getElementById('tbRowSp').value;//return '<span style="font-family:' + fn + ';font-size:' + fs +';text-align:' + ta + ';">' + s + '</span>';
*/	return '<p style="font-family:' + dtfn + ';font-size:' + dtfs +'pt; text-align:' + dtta + '; line-height:' +  rs + 'pt;">' + s;
}//setDocTitle()//去除<P>中的属性
function stripPattribs(s)
{var i = s.indexOf('>');return  ((-1 != i) ? s.substr(i+1)	: s);
}//去除HTML代码
String.prototype.stripHTML = function() 
{var reTag = /<(?:.|\s)*?>/g;  //var	reTag = /<[^>]+>/gi;	//过滤所有html标签,但不包括html标签内的内容 return this.replace(reTag,"");
}String.prototype.trim = function() 
{//去除首尾空格return this.replace(/(^\s*)|(\s*$)/g, ""); /*var t = this.replace(/(^\s*)|(\s*$)/g, ""); return t =t.replace(/(^&nbsp;*)|(&nbsp*$)/g, ""); */
} String.prototype.ltrim = function() 
{ return this.replace(/(^\s*)/g, ""); 
} String.prototype.rtrim = function() 
{ return this.replace(/(\s*$)/g, ""); 
} //判断是否为中文标点符号
String.prototype.isCnPunctuation = function() 
{ 
/*var reg = /[\u3002|\uff1f|\uff01|\uff0c|\u3001|\uff1b|\uff1a|\u201c|\u201d|\u2018|\u2019|\uff08|\uff09|\u300a|\u300b|\u3008|\u3009|\u3010|\u3011|\u300e|\u300f|\u300c|\u300d|\ufe43|\ufe44|\u3014|\u3015|\u2026|\u2014|\uff5e|\ufe4f|\uffe5]/;return (reg.test(this)) ? true : false;
*/return (/[\u3002|\uff1f|\uff01|\uff0c|\u3001|\uff1b|\uff1a|\u201c|\u201d|\u2018|\u2019|\uff08|\uff09|\u300a|\u300b|\u3008|\u3009|\u3010|\u3011|\u300e|\u300f|\u300c|\u300d|\ufe43|\ufe44|\u3014|\u3015|\u2026|\u2014|\uff5e|\ufe4f|\uffe5]/.test(this)) ? true : false;  
}//判断是否为英文标点符号
String.prototype.isEnPunctuation = function() 
{ 
/*var reg = /[\x21-\x2f\x3a-\x40\x5b-\x60\x7B-\x7F]/;return (reg.test(c)) ? true : false;
*/return (/[\x21-\x2f\x3a-\x40\x5b-\x60\x7B-\x7F]/.test(this)) ? true : false;  
}//功能:判断是否为中文或英文标点符号
String.prototype.isPunctuation = function() 
{ //return ((/[\x21-\x2f\x3a-\x40\x5b-\x60\x7B-\x7F]/.test(this)) || (/[\u3002|\uff1f|\uff01|\uff0c|\u3001|\uff1b|\uff1a|\u201c|\u201d|\u2018|\u2019|\uff08|\uff09|\u300a|\u300b|\u3008|\u3009|\u3010|\u3011|\u300e|\u300f|\u300c|\u300d|\ufe43|\ufe44|\u3014|\u3015|\u2026|\u2014|\uff5e|\ufe4f|\uffe5]/.test(this))) ? true : false; return (this.isEnPunctuation() || this.isCnPunctuation()) ? true : false; }//判断是否为纯半角阿拉伯数字串
String.prototype.isArabicNumEn = function() 
{return  /^\d+$/.test(this);
}//判断是否为纯全角阿拉伯数字串
String.prototype.isArabicNumCn = function() 
{//[\uff10|\uff11|\uff12|\uff13|\uff14|\uff15|\uff16|\uff17|\uff18|\uff19]=[0|1|2|3|4|5|6|7|8|9]return (/^[\uff10|\uff11|\uff12|\uff13|\uff14|\uff15|\uff16|\uff17|\uff18|\uff19]+$/.test(this));
}//判断是否为纯全角或纯半角阿拉伯数字串
String.prototype.isPureArabicNum = function() 
{//[\uff10|\uff11|\uff12|\uff13|\uff14|\uff15|\uff16|\uff17|\uff18|\uff19]=[0|1|2|3|4|5|6|7|8|9]return (this.isArabicNumEn() || this.isArabicNumCn());
}//判断是否为全阿拉伯数字串(全角或半角阿拉伯数字均可)
String.prototype.isArabicNum = function() 
{//[\uff10|\uff11|\uff12|\uff13|\uff14|\uff15|\uff16|\uff17|\uff18|\uff19]=[0|1|2|3|4|5|6|7|8|9]return (/^[\d|\uff10|\uff11|\uff12|\uff13|\uff14|\uff15|\uff16|\uff17|\uff18|\uff19]+$/.test(this));
}function getClearInfoArray()
{var s = edRichBody.innerHTML.replace(/<br(?:.|\s)*?>/gi,'</p><p>');var t = s.split('<p');taDbg.value += "\n---getClearInfoArray()\n";for (var i=0; i < t.length; i++){taDbg.value += "\nt[" + i + "]=" + t[i];}    while (t[0].length==0 || t[0]=='></p>'){taDbg.value += "\nshift: " + t[0];t.shift();}while (t[t.length-1].length==0 || t[t.length-1]=='></p>'){taDbg.value += "\npop: " + t[t.length-1];t.pop();}for (var i=0; i < t.length; i++){t[i] = stripPattribs(t[i]);//t[i] = t[i].replace(/<(?!img|p|\/p|br|a|\/a).*?>/gi, '');//t[i] = t[i].replace(/<(?!img|a|\/a).*?>/gi, '');t[i] = t[i].stripHTML();//以下两句顺序不能颠倒t[i] = t[i].replace(/&nbsp;/ig, ''); //去除空格代码	  &nbsp;t[i] = t[i].trim(); //去除首尾空格}while (t[t.length-1].length==0 || t[t.length-1]=='></p>'){taDbg.value += "\npop: " + t[t.length-1];t.pop();}taDbg.value += "\n---\n";for (var i=0; i < t.length; i++){taDbg.value += "\nt[" + i + "]=" + t[i];} return t;
}function clearDocFmt()
{
/*var s = edRichBody.innerHTML;var t = s.split('<p');//var i = 0;taDbg.value += "\n---clearDocFmt()\n";for (var i=0; i < t.length; i++){taDbg.value += "\nt[" + i + "]=" + t[i];}    while (t[0].length==0 || t[0]=='></p>'){taDbg.value += "\nshift: " + t[0];t.shift();}while (t[t.length-1].length==0 || t[t.length-1]=='></p>'){taDbg.value += "\npop: " + t[t.length-1];t.pop();}for (var i=0; i < t.length; i++){t[i] = stripPattribs(t[i]);//t[i] = t[i].replace(/<(?!img|p|\/p|br|a|\/a).*?>/gi, '');//t[i] = t[i].replace(/<(?!img|a|\/a).*?>/gi, '');t[i] = t[i].stripHTML();t[i] = t[i].trim(); //去除首尾空格t[i] = t[i].replace(/&nbsp;/ig, ''); //去除空格代码	  &nbsp;}while (t[t.length-1].length==0 || t[t.length-1]=='></p>'){taDbg.value += "\npop: " + t[t.length-1];t.pop();}taDbg.value += "\n---\n";for (var i=0; i < t.length; i++){taDbg.value += "\nt[" + i + "]=" + t[i];}    //t.unshift('<p>');s = t.join('</p><p>');s = '<p>' + s;
*/var s = '<p>' + getClearInfoArray().join('</p><p>');//alert(s);edRichBody.innerHTML = s;//alert(edRichBody.innerHTML);
}                    //功能:是否以标点符号结束Is aunctuation at the end of the string
String.prototype.isEndWithPunctuation = function()
{
/*var c = this.substring(this.length-1);return c.isPunctuation();
*/return this.substring(this.length-1).isPunctuation();
}//语句结束符号字符串,考虑到三级标题序号可能包括英语句号,此处不将英语句号列为语句结束符号
var sStatementEndPunctuation = '。!?…!?';//功能:获取段落文字中的第一个语句结束符号位置
//输入:p:字符串
//输出:第一个语句结束符号位置
//记录:20230726更新
function getFirstPunctuationPos(p)
{//taDbg.value += '\n ---getFirstPunctuationPos(' + p + ')\n';var r = p.length, n;for (var i = 0; i < p.length; i++){n = p.indexOf(p[i]);if ( (-1 != n) && (n < r) ){r = n;//taDbg.value += '\n' + p[i] + ': n=' + n + '    r=' + r;}}return r;
}//getFirstPunctuationPos(p)//功能:判断字符串是否只有一句话
//输入:p:字符串
//输出:true:是一句话;false:不是一句话
function isAstatement(p)
{
/*for  (var i = 0; i < sStatementEndPunctuation.length; i++){var n = p.indexOf(sStatementEndPunctuation[i]);if  (n !=-1 &&  n == p.length-1) {return  true;}}return false;
*/var n = getFirstPunctuationPos(p);return  ((( -1 != n) &&  (n == p.length-1)) ? true : false);
}/*
//功能:标题是否单独成行 Is paragraph title a single line?	 
//输入:t:文字
//输出:true:是独立标题行,false:不是独立标题行
function ptIsALine(t)
{return isAstatement(t) ;
} //ptIsALine(t)    
*///功能:设置一级标题set paragraph format with primay title 
//输入:t:文字
//输出:格式化字符串
function setParaTitle1(t)
{var r;if (isAstatement(t))	//(ptIsALine(t))	 //标题是否单独成行{//return '<p style="font-family:' + fn + ';font-size:' + fs +'pt; text-align:' + ta + '; line-height:' +  rs + 'pt;">' + s;r = '<p style="margin:0; font-family:' + pt1fn + ';font-size:' + pt1fs +'pt; line-height:' +  rs + 'pt; text-indent: '+ sn +'em;">' + t;}else{//标题不单独成行var n = getFirstPunctuationPos(t);//t.indexOf('。');r = '<p style="margin:0; line-height:' +  rs + 'pt; text-indent: '+ sn +'em; font-family:' + mtfn + '"><span style="font-family:' + pt1fn + ';font-size:' + pt1fs +'pt;" >' + t.substring(0, n) + '</span>' + 	t.substring(n);}taDbg.value += "\n---setParaTitle1:" + r;return r;
} //setParaTitle1(t)//功能:设置二级标题set paragraph format with secondary title 
//输入:t:文字
//输出:格式化字符串
function setParaTitle2(t)
{taDbg.value += "\n---setParaTitle2:" + t;var r;//var b = document.getElementById("cbSecondaryTitleStrong").checked; //是否加粗if  (isAstatement(t))//(ptIsALine(t))	 //标题是否单独成行{//return '<p style="font-family:' + fn + ';font-size:' + fs +'pt; text-align:' + ta + '; line-height:' +  rs + 'pt;">' + s;r = '<p style="margin:0; font-family:' + st2fn + ';font-size:' + st2fs +'pt; line-height:' +  rs + 'pt; text-indent: '+ sn +'em;' + (st2Strong ? 'font-weight: bold;' : '') + '">' + t;}else{//标题不单独成行var n = getFirstPunctuationPos(t);r = '<p style="margin:0; line-height:' +  rs + 'pt; text-indent: '+ sn +'em; font-size:' + st2fs +'pt; font-family:' + mtfn + '"><span style="font-family:' + st2fn +  (st2Strong ? ';font-weight: bold;' : '') + '" >' + t.substring(0, n) + '</span>' + 	t.substring(n);}return r;
}//setParaTitle2(t)//功能:在段落文本末尾添加缺少标点符号的提示文本
//输入:q:待添加提示的文本
//输出:添加提示后的文本
//记录:20230726修改变量strMissPunctuation
function appendMissPunctuationPrompt(q)
{//const strMissPunctuation = "*公文一键排版系统温馨提示:此处是否遗漏标点符号";const strMissPunctuation = '<span style="color:red; font-weight:bold;font-style:italic;">*公文一键排版系统温馨提示:此处是否遗漏标点符号</span>';var k = q.lastIndexOf(strMissPunctuation); /*//alert(q);if (-1 != k)//是否已包含缺少标点符号的提示文本?{q = q.substring(0, k);//已包含则舍弃//alert(q);}q += '<span style="color:red; font-weight:bold;">' + strMissPunctuation + '</span>';
*///q = (-1 != k ?  q.substring(0, k) : q) +   '<span style="color:red; font-weight:bold;">' + strMissPunctuation + '</span>';q = (-1 != k ?  q.substring(0, k) : q) +  strMissPunctuation;return q;//return (-1 != k ?  q.substring(0, k) : q) +   '<span style="color:red; font-weight:bold;">' + strMissPunctuation + '</span>';
}//appendMissPunctuationPrompt()//功能:设置三级标题set paragraph format with third title 
//输入:t:文字
//输出:格式化字符串
function setParaTitle3(t)
{taDbg.value += "\n---setParaTitle3:" + t;var r;//var b = document.getElementById("cbThirdTitleString").checked; //是否加粗if  (isAstatement(t))//(ptIsALine(t))	 //标题是否单独成行{//return '<p style="font-family:' + fn + ';font-size:' + fs +'pt; text-align:' + ta + '; line-height:' +  rs + 'pt;">' + s;r = '<p style="margin:0; font-family:' + mtfn + ';font-size:' + mtfs +'pt; line-height:' +  rs + 'pt; text-indent: '+ sn +'em;' + (tt3Strong ? 'font-weight: bold;' : '') + '">' + t;}else{//标题不单独成行var n = getFirstPunctuationPos(t);r = '<p style="margin:0; line-height:' +  rs + 'pt; text-indent: '+ sn + 'em; font-size:' + mtfs + 'pt; font-family:' + mtfn + '">' + (tt3Strong ? '<span style="font-weight: bold;">' : '')  + t.substring(0, n) + (tt3Strong ? '</span>' : '') + t.substring(n);if ( !r.isEndWithPunctuation()){r = appendMissPunctuationPrompt(r);}}//ifreturn r;
}//setParaTitle3(t)//是否为只包含一二三四五六七八九十的字符串
String.prototype.isCnNum = function() 
{//[\u4e00|\u4e8c|\u4e09|\u56db|\u4e94|\u516d|\u4e03|\u516b|\u4e5d|\u5341] = [一二三四五六七八九十]return (/^[\u4e00|\u4e8c|\u4e09|\u56db|\u4e94|\u516d|\u4e03|\u516b|\u4e5d|\u5341]+$/.test(this));
}//Is the paragraph with primary title?一级标题
function isIncludePrimaryTitle(p)
{var t = p.indexOf('、');return ((-1 != t) && (p.substring(0,t).isCnNum())) ? true : false;//return /^[\u4e00|\u4e8c|\u4e09|\u56db|\u4e94|\u516d|\u4e03|\u516b|\u4e5d|\u5341]+[\u3001]{1}/.test(p); //可匹配“ 十一、三四”中的“十一、”//return /^\s*[\u4e00|\u4e8c|\u4e09|\u56db|\u4e94|\u516d|\u4e03|\u516b|\u4e5d|\u5341]+[\u3001]{1}/.test(p); //可匹配“   十一、三四”或“ 十一、三四”中的“十一、”//(\b[\u4e00|\u4e8c|\u4e09|\u56db|\u4e94|\u516d|\u4e03|\u516b|\u4e5d|\u5341])*[\u3001]{1},可匹配“十一、三四”中的顿号//\b[\u4e00|\u4e8c|\u4e09|\u56db|\u4e94|\u516d|\u4e03|\u516b|\u4e5d|\u5341]*[\u3001]{1},可匹配“a十一、三四”中的“十一、”
}//isIncludePrimaryTitle(p)//Is a secondary title serial number with parenthesis是带小括号的二级标题序号吗?
function isT2SNwithParenthesis(p)
{var t = p[0];if (t == '('){t = p.indexOf(')');if ((-1 != t) && ((p.substring(1,t)).isCnNum())) {return true;}}//ifif (t == '('){t= p.indexOf(')');if ((-1 != t) && (p.substring(1,t).isCnNum())) {return true;}}//ifreturn false;//二级标题	
}//isSNwithParenthesis(p)//Is the paragraph with secondary title?二级标题
function isIncludeSecondaryTitle(p)
{var t = p[0];//t = p.substring(0, 1);if (-1!= "㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩".indexOf(t)){return true;}if (isT2SNwithParenthesis(p)){return true;//二级标题}return false;
}//isIncludeSecondaryTitle(p)//Is the paragraph with third title?三级标题
function isIncludeThirdTitle(p)
{var t = p.indexOf('.');if (-1==t){t = p.indexOf('.');}return ((-1 != t) && p.substring(0,t).isPureArabicNum()) ? true : false;
}//isIncludeThirdTitle(p)//功能:获取文字串的标题级别
//输入:p:文字串
//输出:1:一级标题,2:二级标题,3:三级标题,0:其它
function getTitleLevel(p)
{taDbg.value += "\n---getTitleLevel:" + p;//var t = p[0];//t = p.substring(0, 1);if  (isIncludeSecondaryTitle(p))//(t=='(' || t=='(' ){//alert(t);return 2;//二级标题}if (isIncludePrimaryTitle(p))//一级标题{return 1;}if (isIncludeThirdTitle(p))//三级标题{return 3;}return 0;
}//getTitleLevel(p)//功能:设置段落格式set paragraph format
//输入:p:段落文字
//输出:设置格式的文本
function setParaFmt(p)
{switch (getTitleLevel(p)){case 1:t = setParaTitle1(p);//一级标题break;case 2:t = setParaTitle2(p);//二级标题break;case 3:t = setParaTitle3(p);//三级标题break;default:	//main text正文t = '<p style="margin:0; line-height:' +  rs + 'pt; text-indent: '+ sn +'em;font-family:' + mtfn + '; font-size:'+ mtfs + 'pt;">' + p;}//switch//taDbg.value += "\n---setParaFmt:" + t;return t;
}//setParaFmt(p)function getArg()
{// 排版内容包括公文标题cbDocTilte  = document.getElementById('cbDocTilte').checked;//标题字体名 document title font namedtfn = document.getElementById('selDocTitleFontName').value;//alert(fn);//标题字号 document title font sizedtfs = document.getElementById('selDocTitleFontSize').value;//alert(fs);//标题对齐方式 document title text aligndtta = document.getElementById('selDocTitleAlign').value;//一级标题字号 primary title font namept1fn = document.getElementById('selPrimaryTitleFontName').value;//一级标题字号  primary titlefont sizept1fs = document.getElementById('selPrimaryTitleFontSize').value;//二级标题字号 psecondary title font namest2fn = document.getElementById('selSecondaryTitleFontName').value;//二级标题字号  secondary title font sizest2fs = document.getElementById('selSecondaryTitleFontSize').value;//二级标题字体加粗  secondary title strongst2Strong	 = document.getElementById('cbSecondaryTitleStrong').checked;//三级标题字体加粗  third title strongtt3Strong = document.getElementById('cbThirdTitleStrong').checked;//正文字体名称mtfn = document.getElementById('selMainTextFontName').value;//正文字体字号mtfs = document.getElementById('selMainTextFontSize').value;//行距 row spacingrs  = document.getElementById('tbRowSp').value;//首行行首空格数sn  = document.getElementById('tbLeadSpNum').value;
}//	  getArg()//增:2023-07-16
//判断dddd年dd月dd日是否符合闰年等规则
String.prototype.isRightDateCn = function()
{return (/^(?:(?!0000)[0-9]{4}([年]{1})(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([月]{1})0?2\2(?:29))([日]{1})$/.test(this));
}//增:2023-07-16
//判断是否为dddd年dd月dd日格式
String.prototype.isDateCn = function()
{//年=\u5e74,月=\u6708,日=\u65e5//return (/^(\d{4})([\u5e74]{1})(\d{1,2})([\u6708]{1})\d{1,2}([\u65e5]{1})$/.test(this)); return (/^(\d{4})([年]{1})(\d{1,2})([月]{1})\d{1,2}([日]{1})$/.test(this)); 
}//增:2023-07-16
//功能:判断是否为落款
//输入:t1:落款单位,t2:落款日期
//输出:true:是落款;false:非落款
function isBadging(t1,t2)
{if (isAstatement(t1))//落款单位末尾是否带符号?{return false;//带符号,不是落款}taDbg.value += "\n--- isBadging()\n" + t1 + '\n' + t2;return (t2.isDateCn());
}//isBadging(t1,t2)//增:2023-07-22
//功能:利用canvas取字符串宽度
//输入:s:字符串,f:字体
//输出:字符串宽度
function getStrWidth(s, f)
{//alert(s);var canvas = getStrWidth.canvas || (getStrWidth.canvas = document.createElement("canvas"));var ctx = canvas.getContext("2d"); ctx.font = f;return ctx.measureText(s).width;
}//geStrWidth()//增:2023-07-16,改2023-07-22
//功能:设置落款格式
//输入:t1:落款单位,t2:落款日期
//输出:格式化后的落款单位和落款日期代码
function setBadging(t1,t2)
{var r = new Array();var f =  mtfs+ 'pt' + ' '+ mtfn;//顺序不能颠倒!//noSealvar iSize1 = getStrWidth(t1, f);var iSize2 = getStrWidth(t2, f);//document.write('<p>' + iSize1 + "  "  + iSize2);if (iSize2 > iSize1){//如成文日期长于发文机关署名,应当使成文日期右空二字编排,并相应增加发文机关署名右空字数。r[0] = '<p style="line-height:' + rs + 'pt; font-family:' + mtfn + ';font-size:' + mtfs + 'pt; text-align:right; margin:0 ' + Math.ceil((iSize2 - iSize1)/2 + 48) + 'px 0 0">' + t1;//1em=16px,2em=32px,3em=48pxr[1] = '<p style="line-height:' + rs + 'pt; font-family:' + mtfn + ';font-size:' + mtfs + 'pt; text-align:right; margin:0 2em 0 0">' + t2;}else{//单一机关行文时,在正文(或附件说明)下空一行右空二字编排发文机关署名,在发文机关署名下一行编排成文日期,首字比发文机关署名首字右移二字r[0] = '<p style="line-height:' + rs + 'pt; font-family:' + mtfn + ';font-size:' + mtfs + 'pt; text-align:right; margin:0 2em 0 0">' + t1;r[1] = '<p style="line-height:' + rs + 'pt; font-family:' + mtfn + ';font-size:' + mtfs + 'pt; text-align:right; margin: 0 ' + (iSize1 - iSize2) + 'px 0 0">' + t2;}return r.join('');
}//setBadging()//功能:判断字符串是否为“附件:”
//输入:p:字符串
//输出:true:是;false:否
//记录:20230726创建
function isAttachmentWithColon(p) 
{return "附件:"==p.substr(0, 3) ? true : false;
}//功能:判断字符串是否为“附s件”“附s件x”“附s件x-x”,其中s为空格,x为阿拉伯数字
//输入:p:字符串
//输出:true:是;false:否
//记录:20230726创建
function isAttachmentWithSpace(p) 
{//return "附件"==p ? true : false;return (/^(附){1}\s+(件){1}([\d|-]*)$/.test(p)); 
}//功能:判断字符串是否为“附件”“附件x”“附件x-x”,其中x为阿拉伯数字
//输入:p:字符串
//输出:true:是;false:否
//记录:20230726创建
function isAttachment(p) 
{//return "附件"==p ? true : false;//return (/^(附件){1}([\d|-]*)$/.test(p)); return (/^(附){1}\s*(件){1}([\d|-]*)$/.test(p)); 
}//功能:判断相连两段文字是否为附件及标题
//输入:p1:前一段;p2:后一段
//输出:true:是;false:否
//记录:20230726创建
function isAttachmentTitle(p1, p2)
{if (! isAttachment(p1))//前一段内容是“附件”?{return false;//不是}return (! isAstatement(p2));	//后一段是否为一句话
}//isAttachmentTitle()    //功能:删除字符串中的所有空格
//记录:20230726创建
String.prototype.eliminateSpace = function()
{return this.replace(/\s*/g,"");
}//功能:设置附件及附件标题格式
//输入:p1:附件;p2:附件标题
//输出:附件及附件标题格式化后的字符串
//记录:20230726创建
function setAttachmentTitleFmt(p1, p2)
{//附件 与 附件标题之间要间隔一行//return '<p style="margin:0px; font-family:黑体; font-size:' + mtfs + 'pt; line-height:"'	+ rs +'">' + p1 + '</p><p style="margin:0px; font-size:28pt; line-height:"'	+ rs +'">&nbsp;</p><p style="margin:0px; text-align:center; font-family:' + dtfn + '; font-size:' + dtfs + 'pt; line-height:"'	+ rs +'">' + p2 + '</p>';return '<p style="margin:0px; font-family:黑体; font-size:' + mtfs + 'pt; line-height:'	+ rs + 'pt">'  +  (isAttachmentWithSpace(p1)  ? p1.eliminateSpace() + '<span style="color:red; font-style:italic;padding-left:15pt">*公文一键排版系统温馨提示:本行多余的空格已删除</span>' : p1) + '</p><p style="margin:0px; font-size:' + mtfs + 'pt; line-height:'	+ rs + 'pt">&nbsp;</p><p style="margin:0px; text-align:center; font-family:' + dtfn + '; font-size:' + dtfs + 'pt; line-height:' + rs +'pt">' + p2 + '</p>';
}//setAttachmentTitleFmt(p1, p2)//功能:设置公文格式Set document format
//输入:无
//输出:无
//记录:20230726添加对附件及附件标题格式的处理代码
function setDocFmt()
{taDbg.value += "\n---setDocFmt()\n";getArg(); //读取预设参数var t = getClearInfoArray();//标题if (cbDocTilte){t[0]  = setDocTitle(t[0]) + '</p><p style="margin:0px; line-height:"' + rs +'">&nbsp;';}
/*for (var i = (cbDocTilte ? 1: 0); i < t.length; i++){t[i] = setParaFmt(t[i]);}
*/var i =  (cbDocTilte ? 1 : 0);//增:2023-07-26while (i < t.length){if (i < t.length-1)//20230716增加{if (isBadging(t[i],t[i+1]))//是落款?{//落款前加空行t[i-1] += '</p><p style="margin:0px; line-height:"' + rs +'">&nbsp;';//设置落款t[i] = setBadging(t[i],t[i+1]);t[i+1] = null;taDbg.value += "\nt[" + (i-1) + "]=" + t[i-1] + "\nt[" + i +"]=" + t[i] + "\nt[" +(i+1) +"]=" + t[i+1];//i++;//i++;i += 2;continue;}if (isAttachmentTitle(t[i],t[i+1]))	  //是附件及附件标题?{t[i] = setAttachmentTitleFmt(t[i],t[i+1]);t[i+1] = null;taDbg.value += "\nt[" + (i-1) + "]=" + t[i-1] + "\nt[" + i +"]=" + t[i] + "\nt[" +(i+1) +"]=" + t[i+1];//i++;//i++;i += 2;continue;}}//ift[i] = setParaFmt(t[i]);i++;}//while()alert(t.join(''));edRichBody.innerHTML = t.join(''); 
}//setDocFmt() </script></head><body>
<fieldset  style="width: 1100px;"><legend>实时编辑区</legend>
<iframe id="editor" width="1200px" height="400px" style="border: solid 1px;"></iframe>
</fieldset>
<p><input type="button" id="btnclearDocFmt" value="清除格式" onclick="clearDocFmt()" /><input type="button" id="btnsetDocFmt" value="一键排版" onclick="setDocFmt()" /><input type="button" id="btnShowSrc" value="显示源码" onclick="showSrc()" style="background:yellow; border-radius: 25px;" /><input type="button" id="btnB" value="B" title="加粗/正常"  style="font-weight:bolder" onclick="execCmd('bold',false,null)" /><input type="button" id="btnItalic" value="I" title="斜体/正常"  style="font-weight:bolder;font-style:italic" onclick="execCmd('italic',false,null)" /><input type="button" id="btnUnderline" value="I" title="下划线"  style="font-weight:bolder;text-decoration:underline" onclick="execCmd('underline',false,null)" />
</p>
<fieldset style="width: 1200px;"><legend>参数设置</legend>公文标题:<input type="checkbox" checked id="cbDocTilte">排版内容包括公文标题<script>showFontNameSel("selDocTitleFontName", 0);document.write(' ');showFontSizeSel("selDocTitleFontSize", 4);document.write(' ');showAlignSel("selDocTitleAlign", 1);</script><p>正文一级标题:<script>showFontNameSel("selPrimaryTitleFontName", 1);document.write(' ');showFontSizeSel("selPrimaryTitleFontSize", 6);</script></p><p>正文二级标题:<script>showFontNameSel("selSecondaryTitleFontName", 5);document.write(' ');showFontSizeSel("selSecondaryTitleFontSize", 6);</script><input type="checkbox" checked id="cbSecondaryTitleStrong">粗体</p><p>正文三级标题:<input type="checkbox" checked id="cbThirdTitleStrong">粗体</p><p>正文:	<script>showFontNameSel("selMainTextFontName", 3);document.write(' ');showFontSizeSel("selMainTextFontSize", 6);document.write(' ');</script>行距(行间距):<input type="text" id="tbRowSp" value="28" size="2"><!--  row spacing//-->  段落首行行首空格数:<input type="text" id="tbLeadSpNum" value="2" size="2"></P></fieldset><p>调试信息</p>
<textarea id="taDbg" style="width: 1225px; height: 200px">调试信息</textarea><script type="text/javascript">const edRich = document.getElementById("editor");
const taDbg = document.getElementById("taDbg");
const btnShowSrc = document.getElementById("btnShowSrc");//排版内容是否包括公文标题
var cbDocTilte;		//  = document.getElementById('cbDocTilte').value;
//标题字体名 document title font name
var dtfn;	// = document.getElementById('selDocTitleFontName').value;
//标题字号 document title font size
var dtfs;	// = document.getElementById('selDocTitleFontSize').value;
//标题对齐方式 document title text align
var dtta;// = document.getElementById('selDocTitleAlign').value;//一级标题字号 font name
var pt1fn;	// = document.getElementById('selPrimaryTitleFontName').value;
//一级标题字号 font size
var pt1fs;	// = document.getElementById('selPrimaryTitleFontSize').value;//二级标题字号 psecondary title font name
var st2fn;	// = document.getElementById('selSecondaryTitleFontName').value;
//二级标题字号  secondary title font size
var st2fs;	// = document.getElementById('selSecondaryTitleFontSize').value;
//二级标题字体加粗  secondary title strong
var st2Strong;	// = document.getElementById('cbSecondaryTitleStrong').value;//三级标题字体加粗  third title strong
var tt3Strong;	//	 = document.getElementById('cbThirdTitleStrong').value;//行距 row spacingvar rs;		//  = document.getElementById('tbRowSp').value;
//首行行首空格数var sn;		//  = document.getElementById('tbLeadSpNum').value;//正文字体名称
var mtfn;	// = document.getElementById('selMainTextFontName').value;//正文字体字号
var mtfs;	// = document.getElementById('selMainTextFontSize').value;       
var edRichDoc;
var edRichBody;
//var edRichHTML;
if (typeof(edRich) !="undefined"){edRichDoc = edRich.contentWindow.document;edRichDoc.designMode = "on";edRichDoc.contentEditable = true;edRichBody = 	edRichDoc.body;edRichBody.innerHTML = '<p><a href="http://blog.csdn.net/purpleendurer">http://blog.csdn.net/purpleendurer</a></p><p></p><p style="font-family:方正小标宋简体;font-size:22pt; text-align:center; line-height:28pt;"><p align="center" style="text-align:center;text-indent:24.0pt;line-height:28.0pt"><span lang="EN-US" style="font-size:22.0pt;font-family:方正小标宋简体;mso-hansi-font-family:黑体;color:black">SQL</span><span style="font-size:22.0pt;font-family:方正小标宋简体;mso-hansi-font-family:黑体;color:black">注入基础<span lang="EN-US"><o:p></o:p></span></span></p><p style="text-indent:24.0pt;line-height:28.0pt;font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;word-spacing:0px"><span style="font-size:16.0pt;font-family:黑体;color:black">一、<span lang="EN-US">SQL</span>注入分类<span lang="EN-US"><o:p></o:p></span></span></p><p style="text-indent:24.0pt;line-height:28.0pt;font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;word-spacing:0px"><b><span style="font-size:16.0pt;font-family:楷体_GB2312;color:black">(一)什么是<span lang="EN-US">SQL</span>注入<span lang="EN-US">?<o:p></o:p></span></span></b></p><p style="text-indent:24.0pt;line-height:28.0pt;font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;word-spacing:0px"><span lang="EN-US" style="font-size:16.0pt;font-family:仿宋_GB2312;color:black">SLQ</span><span style="font-size:16.0pt;font-family:仿宋_GB2312;color:black">注入<span lang="EN-US">(</span>英文<span lang="EN-US">: Sqlinject)</span>:当<span lang="EN-US">web</span>应用向后台数据库传递<span lang="EN-US">SQL</span>语句进行数据库操作时,如果对用户输入的参数没有经过严格的过滤,那么用户可以构造特殊的<span lang="EN-US">sq1</span>语句,从而带入到数据库中执行,获取或修改数据库中的数据。<span lang="EN-US"><o:p></o:p></span></span></p><p>测试1</p><p style="text-indent:24.0pt;line-height:28.0pt;font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;word-spacing:0px">河池市××××局</p><p>2023年7月22日</p><p>测试2</p><p>广西壮族自治区河池市××××局</p><p>2023年7月22日</p><p>测试3</p><p>河池市××局</p><p>2023年7月22日</p><p>测试4</p><p>河池市×局</p><p>2023年7月22日</p><p>附件</p><p>附件标题</p><p>附件:</p><p>附件标题</p><p>附  件</p><p>附件标题</p>';
}
else
{window.alert("undefined");
}function replaceStr(s1,s2)
{try{var r = document.body.createTextRange();if (r.findText(s1)){r.expand('charactor');r.select();r.text = s2;r.scrollIntoView();}else{alert('"'+s+'" not found!');}}catch (e){alert(e.description);}
}function showSrc()
{if (btnShowSrc.value=="显示源码"){edRichBody.innerText = edRichBody.innerHTML;//edRichBody.innerText = edRichBody.innerHTML.replace('</p>','</p>'+chr(10));	  //edRichBody.innerText = edRichBody.innerText.replace('<\/p>','<\/p>'+chr(10)+chr(13));	  btnShowSrc.value = "显示预览";btnShowSrc.style.background = "cyan";}else{edRichBody.innerHTML = edRichBody.innerText;//edRichBody.innerHTML = edRichBody.innerText.replace(chr(10)+chr(13),'');btnShowSrc.value = "显示源码";btnShowSrc.style.background = "yellow";}
}function execCmd(cmd,f,v)
{edRichDoc.execCommand(cmd,f,v);
}
</script>
</body>
</html>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/10957.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Python(四十六)列表

❤️ 专栏简介&#xff1a;本专栏记录了我个人从零开始学习Python编程的过程。在这个专栏中&#xff0c;我将分享我在学习Python的过程中的学习笔记、学习路线以及各个知识点。 ☀️ 专栏适用人群 &#xff1a;本专栏适用于希望学习Python编程的初学者和有一定编程基础的人。无…

【Java基础教程】(四十八)集合体系篇 · 上:全面解析 Collection、List、Set常用子接口及集合元素迭代遍历方式~【文末送书】

Java基础教程之集合体系 上 &#x1f539;本章学习目标1️⃣ 类集框架介绍2️⃣ 单列集合顶层接口&#xff1a;Collection3️⃣ List 子接口3.1 ArrayList 类&#x1f50d; 数组&#xff08;Array&#xff09;与列表&#xff08;ArrayList&#xff09;有什么区别?3.2 LinkedL…

在 ArcGIS Pro 中使用 H3 创建蜂窝六边形

H3是Uber开发的分层索引系统,它使用六边形来平铺地球表面。H3在二十面体(一个具有20个三角形面和12个顶点的形状)上构建其六边形网格。由于仅用六边形不可能平铺二十面体,因此每个分辨率需要12个五边形来完成网格。分层索引网格意味着每个六边形都可以细分为子单元六边形。…

给jupter设置新环境

文章目录 给jupternotebook设置新环境遇到的报错添加路径的方法 给jupternotebook设置新环境 # 先在anaconda界面新建环境 conda env list # 查看conda prompt下的有的环境变量 带星号的是当前活跃的 activate XXXX pip install ipykernel ipython ipython kernel install --u…

如何安装mmcv?官网解答

pip install -U openmim mim install mmcv

【高分论文密码】大尺度空间模拟预测与数字制图教程

详情点击链接&#xff1a;【高分论文密码】大尺度空间模拟预测与数字制图 一&#xff0c;R语言空间数据及数据挖掘关键技术 1、R语言空间数据及应用特点 1)R语言基础与数据科学 2)R空间矢量数据 3)R栅格数据 2、R语言空间数据挖掘关键技术 二&#xff0c;R语言空间数据高…

素描基础知识

素描基础入门 1.基础线条 1.1 握笔姿势及长线条 2.排线 2.1 不同姿势画排线 2.1.1 姿势画排线 2.1.2 用手腕画排线 2.1.3 小拇指画排线 2.1.4 叠加排线 2.1.5交叉排线 2.2 纸张擦法 2.3 排线学习榜样 2.4 四种常见的排线 3、定向连线 4、一点透视 4.1 透视的规律 4.2 焦点透视…

SpringCloudAlibaba:服务网关之Gateway的cors跨域问题

目录 一&#xff1a;解决问题 二&#xff1a;什么是跨域 三&#xff1a;cors跨域是什么&#xff1f; 一&#xff1a;解决问题 遇到错误&#xff1a; 前端请求时报错 解决&#xff1a; 网关中添加配置文件&#xff0c;注意springboot版本&#xff0c;添加配置。 springboo…

Hive 调优集锦(1)

一、前言 1.1 概念 Hive 依赖于 HDFS 存储数据&#xff0c;Hive 将 HQL 转换成 MapReduce 执行&#xff0c;所以说 Hive 是基于Hadoop 的一个数据仓库工具&#xff0c;实质就是一款基于 HDFS 的 MapReduce 计算框架&#xff0c;对存储在HDFS 中的数据进行分析和管理。 1.2 架…

删除每行中的最大值

给你一个 m x n 大小的矩阵 grid &#xff0c;由若干正整数组成。 执行下述操作&#xff0c;直到 grid 变为空矩阵&#xff1a; 从每一行删除值最大的元素。如果存在多个这样的值&#xff0c;删除其中任何一个。 将删除元素中的最大值与答案相加。 注意 每执行一次操作&…

HBase有写入数据,页面端显示无数据量

写了一个测试类&#xff0c;插入几条数据&#xff0c;测试HBase的数据量。很简单的功能&#xff0c;这就出现问题了。。网页端可以看到&#xff0c;能够看到读写请求&#xff0c;但是不管是内存、还是磁盘&#xff0c;都没有数据。 于是就想到去HDFS查看&#xff0c;也是有数据…

windows命令行

参考:https://blog.csdn.net/u014419722/article/details/130427423 1、 创建文件夹&#xff08;mkdir或md&#xff09; 创建单个文件&#xff1a;mkdir cmd_test 创建二级文件&#xff1a;mkdir cmd_test\456\123 创建多个文件&#xff1a;mkdir cmd_test\000 cmd_test\111 2…

idea快速运行vue项目

目录 一、前提 二、步骤 安装vue.js插件 添加脚本 进行如下配置 一、前提 安装好node.js环境并初始化完成和安装好依赖 二、步骤 安装vue.js插件 打开idea,然后在File–Settings–Plugins–Makerplace下找到vue.js插件,安装并重启idea 添加脚本 进行如下配置 在Sctipts中根…

Linux复习——基础知识

作者简介:一名云计算网络运维人员、每天分享网络与运维的技术与干货。 座右铭:低头赶路,敬事如仪 个人主页:网络豆的主页​​​​​ 1. 有关早期linux系统中 sysvin的init的7个级别描述正确的是( )[选择1项] A. init 1 关机状态 B. init 2 字符界面多用户模式 …

【MySQL进阶(三)】 InnoDB体系架构之内存池(buffer pool)

InnoDB体系架构之内存池 一、InnoDB 体系结构二、缓冲池 buffer pool内部结构free 链&#xff08;管理空闲缓冲页&#xff09;怎么知道数据页是否被缓存&#xff1f; flush 链表&#xff08;管理脏页&#xff09;1. 脏页2. 链表结构3. 刷盘时机 LRU 链表&#xff08;控制数据热…

影视行业案例 | 燕千云助力大地影院集团搭建智能一体化IT服务管理平台

影视行业过去三年受新冠肺炎疫情影响&#xff0c;经历了一定程度的冲击和调整&#xff0c;但也展现出了强大的韧性和潜力。2023年中国影视产业规模可能达到2600亿元左右&#xff0c;同比增长11%左右。影视行业的发展趋势主要表现在内容创新、模式创新和产业融合三个方面&#x…

ICC2如何计算Gate Count?

我正在「拾陆楼」和朋友们讨论有趣的话题&#xff0c;你⼀起来吧&#xff1f;知识星球入口 我们认为gate count等于standard cell(非physical only)总面积 / 最小驱动二输入与非门面积。 ICC2没有专门的命令去报告gate count&#xff0c;只能自己计算&#xff0c;使用report_d…

面试题:什么是闭包?

一、怎么理解闭包&#xff1f; 简单理解&#xff1a;闭包 内层函数 外层函数的变量 下面是一组简单的闭包代码&#xff1a; function outer() {let count 1function inner() {console.log(count)}inner() } outer()闭包有两个注意点&#xff1a; 闭包一定有return吗&#x…

如何利用设备数字化平台推动精益制造?

人工智能驱动技术的不断发展&#xff0c;尤其是基于机器学习的预测分析工具的使用&#xff0c;为制造业带来了全新的效率和价值水平。一直以来&#xff0c;精益生产&#xff08;也叫精益制造&#xff09;在制造业中扮演着重要角色&#xff0c;而现在通过与工业 4.0的融合&#…

word怎么转换成pdf?分享几种转换方法

word怎么转换成pdf&#xff1f;将Word文档转换成PDF文件有几个好处。首先&#xff0c;PDF文件通常比Word文档更容易在不同设备和操作系统上查看和共享。其次&#xff0c;PDF文件通常比Word文档更难以修改&#xff0c;这使得它们在需要保护文件内容的情况下更加安全可靠。最后&a…