html <input type="text" />加上readonly后在各种浏览器的差异。

1 <html>
2 <body>  
3   <p>Name:<input type="text" name="email" /></p>
4   <p>Country:<input type="text" name="country" 
5   value="China" readonly="readonly" /></p> 
6 </body>
7 </html>

上述代码在ie中:可以获得焦点,光标可进入,不能输入,但是按backspace键后,页面会后退跳转。

  在chrome中:可以得到焦点,光标不可进入

  在firebox中:可以得到焦点,光标也可进入。按backspace键,不起任何作用。

转载于:https://www.cnblogs.com/taojietx/p/5287213.html

<!-- 第三者责任 --> <table id="ItemKindThird" name="ItemKindThird" class="common" cellpadding="1" cellspacing="1"> <thead> <tr style="display: none"> <td width="18%" align="center"> </td> <td width="9%" align="center"> </td> <td width="9%" align="center"> </td> <td width="9%" align="center"> </td> <td width="9%" align="center"> </td> <td width="9%" align="center"> </td> <td width="12%" align="center"> </td> <td width="12%" align="center"> </td> <td width="13%" align="center"> </td> </tr> <tr> <td class="left" colspan="9"><strong><bean:message key="prompt.thirdPartyLibility2"/></strong></td> </tr> <tr> <td width="18%" class="white" align="center"><bean:message key="GuItemKindDto.kindCode" /> <font color="red">*</font></td> <td width="9%" class="white" align="center"><bean:message key="GuItemKindDto.numberSumInsured"/> <font color="red">*</font></td> <td width="9%" class="white" align="center"><bean:message key="GuItemKindDto.thirdSumInsured" /> <font color="red">*</font></td> <logic:equal name='ggRiskDto' property='calculator' value='100'> <TD class="white" align="center" width="9%"><bean:message key="GuItemKindDto.rate"/>(%) <font color="red">*</font></TD> </logic:equal> <logic:notEqual name='ggRiskDto' property='calculator' value='100'> <TD class="white" align="center" width="9%"><bean:message key="GuItemKindDto.rate"/>(‰) <font color="red">*</font></TD> </logic:notEqual> <td width="9%" class="white" align="center"><bean:message key="GuItemKindDto.shortRateFlag" /> <font color="red">*</font></td> <td width="9%" class="white" align="center"><bean:message key="GuItemKindDto.shortRate" /></td> <td width="12%" class="white" align="center"><bean:message key="GuItemKindDto.uwPremium" /></td> <td width="12%" class="white" align="center"><bean:message key="GuItemKindDto.grossPremium" /> <font color="red">*</font></td> <td width="13%" class="white" align="center"></td> </tr> </thead> <tbody> <% List guThirdItemKindDtoList = (List) request.getAttribute("guItemKindThirdList"); if (guThirdItemKindDtoList != null) { int lengthThirdList = guThirdItemKindDtoList.size(); for (int index = 0; index < lengthThirdList; index++) { request.setAttribute("guThirdItemKindDto", guThirdItemKindDtoList.get(index)); %> <logic:notEmpty name = "guThirdItemKindDto" property="sumInsured"> <logic:equal parameter="businessType" value="Endor"> <bean:define name="guThirdItemKindDto" property="guPolicyItemKindDto" id="thirdGuPolicyItemKindDto" /> </logic:equal> <tr> <td class="white"> <input name="ThirdGuItemKindFlag" type="hidden" endorFlag="B" value="<bean:write name='guThirdItemKindDto' property='flag'/>" title="<bean:write name='thirdGuPolicyItemKindDto' property='flag'/>"> <input name="ThirdGuItemKindProjectCode" type="hidden" value="<bean:write name='guThirdItemKindDto' property='projectCode'/>"> <input name="ThirdGuItemKindKindCode" class="codecode" type="text" style="width: 30%" readonly title="<bean:write name='thirdGuPolicyItemKindDto' property='kindCode'/>" value="<bean:write name='guThirdItemKindDto' property='kindCode'/>"> <input name="ThirdGuItemKindKindName" class="readonly" type="text" style="width: 65%" readonly title="<bean:write name='thirdGuPolicyItemKindDto' property='kindName'/>" value="<bean:write name='guThirdItemKindDto' property='kindName'/>"> <logic:present name="guThirdItemKindDto" property="subProposalNo"> <input name="ThirdGuItemKindSubProposalNo" type="hidden" value="<bean:write name='guThirdItemKindDto' property='subProposalNo'/>"> </logic:present> <logic:present name="guThirdItemKindDto" property="countFlag"> <logic:notEqual name="guThirdItemKindDto" property="countFlag" value="0"> <input name="ThirdGuItemKindCountFlag" type="hidden" value="<bean:write name='guThirdItemKindDto' property='countFlag'/>"> </logic:notEqual> </logic:present> <input name="ThirdGuItemKindSurrenderInd" type="hidden" value="0"> <input name="ThirdGuItemKindItemNo" type="hidden" value="<%=request.getAttribute("itemNo")%>"> <input name="ThirdGuItemKindItemDetailNo" type="hidden" value="0"> <input name="ThirdGuItemKindPlanCode" type="hidden" value="<bean:write name='guThirdItemKindDto' property='planCode'/>"> <input name="ThirdGuItemKindRiskCode" type="hidden" value="<bean:write name='guThirdItemKindDto' property='riskCode'/>"> <input name="ThirdGuItemKindCompanyCode" type="hidden" value="<%=request.getAttribute("companyCode")%>"> <input name="ThirdGuItemKindItemCode" type="hidden" value="<bean:write name='guThirdItemKindDto' property='itemCode'/>"> <input name="ThirdGuItemKindReSpecialInd" type="hidden" value="<bean:write name='guThirdItemKindDto' property='reSpecialInd'/>"> <input name="ThirdGuItemKindStartDate" type="hidden" value="<bean:write name='guThirdItemKindDto' property='startDate'/>" title="<bean:write name='thirdGuPolicyItemKindDto' property='startDate'/>"> <input name="ThirdGuItemKindEndDate" type="hidden" value="<bean:write name='guThirdItemKindDto' property='endDate'/>" title="<bean:write name='thirdGuPolicyItemKindDto' property='endDate'/>"> <input name="ThirdGuItemKindCurrency" type="hidden" onchange=" " value="<bean:write name='guThirdItemKindDto' property='currency'/>" title="<bean:write name='thirdGuPolicyItemKindDto' property='currency'/>" > <input name="ThirdGuItemKindItemKindNo" type="hidden" title="<bean:write name='thirdGuPolicyItemKindDto' property='itemKindNo'/>" value="<bean:write name='guThirdItemKindDto' property='itemKindNo'/>"> <input name="ThirdGuItemKindItemDetailCode" class="codecode" type="text" style="display:none;width: 30%" title="<bean:write name='thirdGuPolicyItemKindDto' property='itemDetailCode'/>" value="<bean:write name='guThirdItemKindDto' property='itemDetailCode'/>" ondblclick="getField(this, 'ItemKindThird', '<bean:message key='alert.message.sameItemDetailCode' />');code_CodeSelect(this,'itemDetailCodeByRiskCode','0,1','Y','riskCode=<%=request.getAttribute("riskCode")%>','');" onkeyup="getField(this, 'ItemKindThird', '<bean:message key='alert.message.sameItemDetailCode' />');code_CodeSelect(this,'itemDetailCodeByRiskCode','0,1','Y','riskCode=<%=request.getAttribute("riskCode")%>','');" onchange="getField(this, 'ItemKindThird', '<bean:message key='alert.message.sameItemDetailCode' />');code_CodeChange(this,'itemDetailCodeByRiskCode','0,1','Y','riskCode=<%=request.getAttribute("riskCode")%>','');"> <input name="ThirdGuItemKindItemDetailList" class="readonly" type="text" style="display:none;width: 65%" readonly title="<bean:write name='thirdGuPolicyItemKindDto' property='itemDetailList'/>" value="<bean:write name='guThirdItemKindDto' property='itemDetailList'/>"> <input name="ThirdGuItemKindKindInd" type="hidden" value="<bean:write name='guThirdItemKindDto' property='kindInd'/>"> </td> <td class="white"> <input name="ThirdGuItemKindCalculateInd" class="codecode" type="text" style="width:30%" title="<bean:write name='thirdGuPolicyItemKindDto' property='calculateInd'/>" value="<bean:write name='guThirdItemKindDto' property='calculateInd'/>" ondblclick="getField(this,'ItemKindThird');code_CodeSelect(this,'calculateInd','0,1','Y','02,CalculateInd','setGuItemKindCalculateIndOnchange();');" onkeyup="getField(this,'ItemKindThird');code_CodeSelect(this,'calculateInd','0,1','Y','02,CalculateInd','setGuItemKindCalculateIndOnchange();');" onchange="getField(this,'ItemKindThird');code_CodeChange(this,'calculateInd','0,1','Y','02,CalculateInd','setGuItemKindCalculateIndOnchange();');"> <input name="ThirdGuItemKindCalculateIndName" class="readonly" type="text" style="width:65%" readonly title="<app:localeName name="thirdGuPolicyItemKindDto" property="calculateInd,CalculateInd" codeType="ggCodeCodeName" filter="true" />" value="<app:localeName name="guThirdItemKindDto" property="calculateInd,CalculateInd" codeType="ggCodeCodeName" filter="true" />"> </td> <td class="white"> <input name="ThirdGuItemKindSumInsured" class="common01" type="text" style="width: 100%" title="<bean:write name='thirdGuPolicyItemKindDto' property='sumInsured'/>" value="<bean:write name='guThirdItemKindDto' property='sumInsured'/>" onchange="calculatorPremium(this,'<bean:message key="alert.message.kindcodeMustInput"/>','<bean:message key="alert.message.zeroError"/>','Third');"> </td> <td class="white"> <input name="ThirdGuItemKindRate" class="common01" type="text" style="width: 100%" title="<bean:write name='thirdGuPolicyItemKindDto' property='rate' format="#,##0.000000"/>" value="<bean:write name='guThirdItemKindDto' property='rate' format="#,##0.000000"/>" onchange="calculatorPremium(this,'<bean:message key="alert.message.kindcodeMustInput"/>','<bean:message key="alert.message.zeroError"/>','Third');"> <input name="GuCalculator" type="hidden" value="100"> </td> <td class="white"> <input name="ThirdGuItemKindShortRateFlag" class="codecode" type="text" style="width: 30%" title="<bean:write name='thirdGuPolicyItemKindDto' property='shortRateFlag'/>" value="<bean:write name='guThirdItemKindDto' property='shortRateFlag'/>" ondblclick="getField(this, 'ItemKindThird', '<bean:message key="alert.message.kindcodeMustInput"/>', '<bean:message key="alert.message.zeroError"/>');code_CodeSelect(this,'shortRateFlag','0,1','Y','02,ShortRateFlag','changeGuItemKindShortRateFlag();');" onkeyup="getField(this, 'ItemKindThird', '<bean:message key="alert.message.kindcodeMustInput"/>', '<bean:message key="alert.message.zeroError"/>');code_CodeSelect(this,'shortRateFlag','0,1','Y','02,ShortRateFlag','changeGuItemKindShortRateFlag();');" onchange="getField(this, 'ItemKindThird', '<bean:message key="alert.message.kindcodeMustInput"/>', '<bean:message key="alert.message.zeroError"/>');code_CodeChange(this,'shortRateFlag','0,1','Y','02,ShortRateFlag','changeGuItemKindShortRateFlag();');"> <input name="ThirdGuItemKindShortRateFlagName" class="common01" type="text" style="width: 65%" readonly title="<app:localeName name="thirdGuPolicyItemKindDto" property="shortRateFlag,ShortRateFlag" codeType="ggCodeCodeName" filter="true" />" value="<app:localeName name="guThirdItemKindDto" property="shortRateFlag,ShortRateFlag" codeType="ggCodeCodeName" filter="true" />"> </td> <td class="white"> <input name="ThirdGuItemKindShortRate" type="hidden" value="<bean:write name='guThirdItemKindDto' property='shortRate' format="0.00"/>" title="<bean:write name='thirdGuPolicyItemKindDto' property='shortRate' format="0.00"/>"> <input name="ThirdGuItemKindShortRateNumerator" class="common01" readonly="readonly" type="text" style="width: 42%" value="<bean:write name='guThirdItemKindDto' property='shortRateNumerator' format="#"/>" title="<bean:write name='thirdGuPolicyItemKindDto' property='shortRateNumerator' format="#"/>" onchange="calculatorPremium(this,'<bean:message key="alert.message.kindcodeMustInput"/>','<bean:message key="alert.message.zeroError"/>','Third');">/ <input name="ThirdGuItemKindShortRateDenominator" class="common01" readonly="readonly" type="text" style="width: 42%" value="<bean:write name='guThirdItemKindDto' property='shortRateDenominator' format="#"/>" title="<bean:write name='thirdGuPolicyItemKindDto' property='shortRateDenominator' format="#"/>" onchange="calculatorPremium(this,'<bean:message key="alert.message.kindcodeMustInput"/>','<bean:message key="alert.message.zeroError"/>','Third');"> </td> <td class="white"> <input name="ThirdGuItemKindUwPremium" class="readonly" type="text" style="width: 100%" readonly title="<bean:write name='thirdGuPolicyItemKindDto' property='uwPremium'/>" value="<bean:write name='guThirdItemKindDto' property='uwPremium'/>" onchange=" "> <input name="ThirdGuItemKindOriginUWPremium" class="common01" type="hidden" style="width: 100%" value="<bean:write name='guThirdItemKindDto' property='originUWPremium'/>"> </td> <td class="white"> <input name="ThirdGuItemKindGrossPremium" class="common01" type="text" style="width: 100%" title="<bean:write name='thirdGuPolicyItemKindDto' property='grossPremium'/>" value="<bean:write name='guThirdItemKindDto' property='grossPremium'/>" onchange=""> <input name="ThirdGuItemKindOriginGrossPremium" class="common01" type="hidden" value="<bean:write name='guThirdItemKindDto' property='originGrossPremium'/>"> </td> <td class="white" align="center"> <input name="button_ThirdKindLimitKind_Edit" class="smallbutton" type="button" style="cursor: hand" value="<bean:message key="button.limit"/>" onclick="showSubPageForPrpall(this,'span_ThirdKindLimitKind_SubPage');"> <SPAN id="span_ThirdKindLimitKind_SubPage" name="span_ThirdKindLimitKind_SubPage" style="display: none; position: absolute; width: 790; background-color: FFFFFF;"> <jsp:include page="/prpall/plugin/common/riskclass/07/itemengineering/ThirdKindLimitKind.jsp" /> </SPAN> <INPUT name="button_ItemKindThird_Delete" class="smallbutton" type="button" value="<bean:message key="button.delete"/>" ind="ind" onclick="deleteRowInTable(this,'ItemKindThird',1,1);afterEndorDeleteItemKind(this, 'Third', '')"> </td> </tr> </logic:notEmpty> <% } } %> </tbody> <tfoot> <TR> <TD class="title02" colspan="9"> <P align="left"><input name="button_ItemKindThird_Insert" class="button" type="button" style="cursor:hand" ind="ind" value="<bean:message key='button.add'/>" onclick="insertEngineeringThridItemKind(this, 'ItemKindThird', 1, '<bean:message key='alert.message.aThirdKindOfAItem' />')"> </P> </TD> </TR> </tfoot> </table> button_ItemKindThird_Insert 这个按钮在投保的时候存在,但为什么批改的时候这个按钮没了,请分析原因
07-22
<%@page import="com.haitaiinc.inpordnurse.ylz.dto.common.Bm_ygxx00DTO"%> <%@page import="com.haitaiinc.common.CommUtil"%> <%@ page import="com.haitaiinc.servlet.JSP,com.haitaiinc.util.Dict,com.haitaiinc.htdb.sd_haitai2.dto.*"%> <%@page import="com.haitaiinc.htdb.sd_haitai2.dto.Inpatient"%> <%@page import="com.haitaiinc.common.CommonAction"%> <%@page import="com.haitaiinc.htcpoe.InpordSystemConfig"%> <%@page import="com.haitaiinc.util.Dict"%> <%@page import="com.haitaiinc.Util"%> <%@page import="java.text.SimpleDateFormat"%> <%@page import="java.util.Calendar"%> <%@page import="java.util.Date"%> <%@page import="java.util.List"%> <%@page import="java.util.ArrayList"%> <%@page import="com.haitaiinc.servlet.JSP"%> <%@page import="com.haitaiinc.common.Const"%> <%@page import="com.haitaiinc.util.Dict"%> <%@page import="com.haitaiinc.inpordnurse.ylz.dto.yrqd.Bm_bqks00DTO"%> <jsp:useBean id="token" class="java.lang.String" scope="request"></jsp:useBean> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=7" ></meta> <%=JSP.getHtCSSDef(request)%> <%=JSP.getPageCSSDef(request) %> <%=JSP.getHtJSDef(request)%> <script src="ht-5.0/ht-core.js" type="text/javascript"></script> <script src="<%=request.getContextPath() %>/js/jquery-1.8.3.js"></script> <script src="<%=request.getContextPath() %>/js/jquery-ui-1.11.4/jquery-ui.js"></script> <link href="<%=request.getContextPath() %>/js/jquery-ui-1.11.4/jquery-ui.css" rel="stylesheet" type="text/css" /> <script src="<%=request.getContextPath() %>/js/showLoading.js"></script> <script src="<%=request.getContextPath() %>/js/orderdrug/common-edit-drug.js"></script> <script src="/nurse-business-extend/extendforylz/commjs/nurse-synthetical-oprate.js"></script> <% String titleName = "病区收入统计"; String currentTime = Util.getCurrentDate("yyyy-MM-dd"); SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd"); Calendar calendar=Calendar.getInstance(); String currentday = simpleDateFormat.format(calendar.getTime()); calendar.add(Calendar.MONTH,-1); String lastmonth = simpleDateFormat.format(calendar.getTime()); //医嘱检索结果区下方增加空白区域显示医嘱的特殊说明 String showDesc = "false"; showDesc = "true"; List<Bm_bqks00DTO> bqksList = (ArrayList)request.getAttribute("bqksList"); List<Bm_ygxx00DTO> yhryList = (ArrayList)request.getAttribute("yshsList"); String[] monthsList = {"1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"}; %> <title><%=titleName%></title> <script type="text/javascript" src="js/json2.js"></script> <script type="text/javascript"> </script> <style> html{height:100%;overflow:hidden;} .div-radio { margin: 0px 0px 0px 0px; } .div-inline1{ margin-top: 5px; margin-left: -6px; padding-left: 10px; height: 25px; } </style> </head> <body style="height:100%"> <div id="qrDiv" style="height:100%;"> <form name="searchForm" id="searchForm" method="post"> <table cellpadding="1" cellspacing="1" style="table-layout: fixed;width: 100%; height:100%;"> <colgroup> <col id="colId" width="100%"> </colgroup> <tr> <td class="main_bg_search" style="width: 100%;" colspan="2"> <table width="100%" border="0" cellpadding="0" cellspacing="0" align="center"> <tr> <td> <div class="div-inline">  科室: <select id="bqks" name="bqks" style="width: 120px;height: 23px;" onchange="changeYhry(this);"> <option selected="selected" value="">全部</option> <% for(int j=0; bqksList!=null&&j<bqksList.size();j++){ Bm_bqks00DTO sd = bqksList.get(j); %> <option value="<%=Util.toString(sd.getKsh000()) %>"><%=Util.toString(sd.getBmmc00()) %></option> <%} %> </select> </div>  <div class="div-inline"> <span> <label><input type="radio" style="margin-left: -10px;" name="itemStatus" value="xmlb" checked="checked" onclick="checkYhry(this);searchList();"/>按项目类别</label> <label><input type="radio" name="itemStatus" value="jtxm" onclick="checkYhry(this);searchList();" />按具体项目</label> <label><input type="radio" name="itemStatus" value="yhry" onclick="checkYhry(this);searchList();" /> 按医护人员: <select id="yhry" name="yhry" disabled="disabled" style="width: 120px;height: 23px;"> <option selected="selected" value="">全部</option> <% for(int j=0; yhryList!=null&&j<yhryList.size();j++){ Bm_ygxx00DTO sd = yhryList.get(j); %> <option value="<%=Util.toString(sd.getYgbh00()) %>"><%=Util.toString(sd.getZwxm00()) %></option> <%} %> </select> </label> </span> </div>  </td> </tr> <tr> <td>    <div class="div-inline div-checkbox-or-radio div-inline1"> <span> <label><input type="radio" checked="checked" style="margin-left: -10px;" name="timeTypes" value="0" onclick="checkTime(this);"/> 月份: <select id="months" name="months" style="width: 120px;height: 22px;margin-top: 1px;"> <option selected="selected" value="0">当前月份</option> <% for(int j=0; monthsList!=null&&j<monthsList.length;j++){ %> <option value="<%=j+1 %>"><%=monthsList[j] %></option> <%} %> </select> </label> </span> </div>   <div class="div-inline div-checkbox-or-radio div-inline1" style="margin-bottom: 3px;"> <span> <label><input type="radio" style="margin-left: -10px;" name="timeTypes" value="1" onclick="checkTime(this);"/> 时间: <input type="text" readonly name="startTime" id="startTime" style="width: 100px;" disabled="disabled" onclick="fPopUpCalendarDlg(startTime);searchList();" value="<%=Util.format(lastmonth, "yyyy-MM-dd")%>" /> - <input type="text" readonly name="endTime" id="endTime" style="width: 100px;" disabled="disabled" onclick="fPopUpCalendarDlg(endTime);searchList();" value="<%=Util.format(currentday, "yyyy-MM-dd")%>" /> </label> </span> </div> <div class="div-inline" style="margin-bottom: 5px;"> <input type="button" class="order_button" value="查  询" id='queryBtn' onclick="searchList();"/>   <input type="button" class="order_button" value="导出Excel" id='exportExcelBtn' onclick="exportExcel();"/>   </div> </td> </tr> </table> </td> </tr> <tr id="listTr"> <td id="dataTd" height="84.5%" width="100%" align="left" valign="top"> <table cellpadding="1" cellspacing="1" style="table-layout: fixed;width: 100%; height:100%;"> <tr> <td height="100%" width="100%" ><!-- 医嘱信息展示列表区 --> <div id="listshow" style="overflow:hidden;height:100%;width:100%;" ></div> </td> </tr> </table> </td> </tr> </table> </form> </div> <div id="swElement" style="display: none;"> </div> </body> <script type="text/javascript"> var token = "<%=token%>"; var menu = "<%=titleName%>"; searchList(); //展示统计列表 function searchList(){ showLoading(); var url = "do?module=inpordnurse&action=YlzBqsrtj&method=searchIncomeStatisticsList"; $("#listshow").html(""); Haitai.Ajax.request({ url : url, params:{ token:token }, form : searchForm, callback : function(text){ closeLoading(); ht("listshow").html(text,false); } }); } function checkYhry(obj){ if(obj.value=="xmlb"&&obj.checked){ $("#yhry").attr("disabled",true); }else if(obj.value=="jtxm"&&obj.checked){ $("#yhry").attr("disabled",true); }else{ $("#yhry").attr("disabled",false); } } function checkTime(obj){ if(obj.value=="0"&&obj.checked){ $("#startTime").attr("disabled",true); $("#endTime").attr("disabled",true); $("#months").attr("disabled",false); }else{ $("#startTime").attr("disabled",false); $("#endTime").attr("disabled",false); $("#months").attr("disabled",true); } searchList(); } function checkIsNull(str){ if(str==null||str==""||str==undefined){ return true; }else{ return false; } } //选择科室联动变化医护人员下拉框数据,护士不变,医生随科室切换变化 function changeYhry(obj){ var xzks00 = obj.value; if(xzks00!=""){ var url = "do?module=inpordnurse&action=YlzBqsrtj&method=searchYhryByXzks"; Haitai.Ajax.request({ url : url, params:{ token:token, xzks00:xzks00 }, form : searchForm, callback : function(text){ if(checkIsNull(text)){ var yhryObj = $("#yhry"); yhryObj.html(""); yhryObj.append($("<option selected=\"selected\" value=\"\">全部</option>")); }else{ var retJson = eval("("+text+")"); var yhryObj = $("#yhry"); yhryObj.html(""); yhryObj.append($("<option selected=\"selected\" value=\"\">全部</option>")); for(var i=0;i<retJson.length;i++){ yhryObj.append($("<option value=\""+retJson[i].ygbh00+"\">"+retJson[i].zwxm00+"</option>")); } } } }); } } function exportExcel(){ } </script> </html>exportExcel帮我导出excel
07-16
QGridLayout * villageLayout = new QGridLayout(); // 创建 QWebEngineView 实例 QWebEngineView* webView = new QWebEngineView(parent); // 全面启用WebEngine功能 webView->settings()->setAttribute(QWebEngineSettings::AutoLoadImages, true); webView->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true); webView->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true); webView->settings()->setAttribute(QWebEngineSettings::LocalStorageEnabled, true); webView->settings()->setAttribute(QWebEngineSettings::PlaybackRequiresUserGesture, false); webView->settings()->setAttribute(QWebEngineSettings::AllowRunningInsecureContent, true); webView->settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls, true); webView->settings()->setAttribute(QWebEngineSettings::SpatialNavigationEnabled, true); webView->settings()->setAttribute(QWebEngineSettings::LinksIncludedInFocusChain, true); // 原始信息保持不变 QString info = "<h1><img src=\"http://127.0.0.1:8090/api/v1/public/system/exam/get-temp?path=/uploads/web/contents/202508/08/324653451ede48ac8eeb573e7f4d840c.png\" alt=\"\" data-href=\"\" style=\"\"/>\uD83E\uDD23\uD83D\uDE0C\uD83D\uDE04 <a href=\"https://www.baidu.com/\" target=\"_blank\">百度</a> </h1><table style=\"width: auto;\"><tbody><tr><th colSpan=\"1\" rowSpan=\"1\" width=\"auto\">1</th><th colSpan=\"1\" rowSpan=\"1\" width=\"auto\">2</th><th colSpan=\"1\" rowSpan=\"1\" width=\"auto\">3</th></tr><tr><td colSpan=\"1\" rowSpan=\"1\" width=\"auto\">4</td><td colSpan=\"1\" rowSpan=\"1\" width=\"auto\">5</td><td colSpan=\"1\" rowSpan=\"1\" width=\"auto\">6</td></tr></tbody></table><h3 style=\"line-height: 1.5;\"><span style=\"color: rgb(255, 77, 79); font-family: "Times New Roman";\">签收单</span></h3><ul><li>1</li><li>2</li></ul><ol><li>3</li><li>4</li></ol><div data-w-e-type=\"todo\"><input type=\"checkbox\" disabled >1212</div><pre><code > webView->settings()->setAttribute(QWebEngineSettings::AutoLoadImages, true);</code></pre><p><br></p><hr/><p><br></p><div data-w-e-type=\"video\" data-w-e-is-void>\n<video poster=\"\" controls=\"true\" width=\"auto\" height=\"auto\"><source src=\"http://127.0.0.1:8090/api/v1/public/system/exam/get-temp?path=/uploads/web/contents/202508/11/f6b2d6301cd34b6db1a03841a3b33000.mp4\" type=\"video/mp4\"/></video>\n</div><p><br></p>"; // 创建完整的HTML文档 QString styledInfo = "<!DOCTYPE html>" "<html>" "<head>" "<meta charset=\"UTF-8\">" "<style>" "table { border-collapse: collapse !important; border: 1px solid black !important; width: auto; }" "th, td { border: 1px solid black !important; padding: 8px !important; text-align: left; }" "th { background-color: #f2f2f2 !important; font-weight: bold; }" "ul, ol { margin: 10px 0; padding-left: 20px; }" "li { margin: 5px 0; }" "video { max-width: 100%; height: auto; border: 1px solid #ccc; display: block; margin: 10px 0; }" "pre { background-color: #f5f5f5; padding: 10px; border-radius: 4px; overflow-x: auto; }" "hr { margin: 15px 0; border: 0; border-top: 1px solid #eee; }" "</style>" "</head>" "<body>" + info + "</body>" "</html>"; webView->setHtml(styledInfo, QUrl("http://127.0.0.1:8090/")); villageLayout->addWidget(webView); ui->widgetImage->setLayout(villageLayout); \uD83E\uDD23\uD83D\uDE0C\uD83D\uDE04 qt无法识别此编码
08-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值