{"id":1455,"date":"2024-06-05T20:30:04","date_gmt":"2024-06-05T12:30:04","guid":{"rendered":"http:\/\/www.jh1999.cn\/?p=1455"},"modified":"2024-11-22T10:35:52","modified_gmt":"2024-11-22T02:35:52","slug":"intraweb%e8%be%93%e5%87%bahtml%e6%8a%a5%e5%91%8a","status":"publish","type":"post","link":"http:\/\/www.jh1999.cn\/?p=1455","title":{"rendered":"Intraweb\u8f93\u51fahtml\u62a5\u544a"},"content":{"rendered":"<div class=\"gb-container gb-container-9e8df5d6\">\n\n<p class=\"wp-block-paragraph\">Intraweb + IWDbGrid\uff0c\u642d\u914dMSSQL\uff0c\u80fd\u5b9e\u73b0\u4ece\u8868\u683c\u5230\u62a5\u544a\u7684\u6240\u89c1\u5373\u6240\u5f97\u3002\u5373\u4f5c\u4e1a\u5458\u5728\u8868\u683c\u91cc\u67e5\u8be2\u6216\u7f16\u8f91\u7684\u6570\u636e\uff0c\u53ef\u4ee5\u5373\u65f6\u8f93\u51fa\u6210html\u6587\u4ef6\uff0c\u65e2\u53ef\u4ee5\u5f53\u62a5\u544a\u6253\u5370\u51fa\u6765\uff0c\u4e5f\u53ef\u4ee5\u4f5c\u4e3a\u90ae\u4ef6\u7684\u9644\u4ef6\uff0c\u53d1\u5230\u6709\u9700\u6c42\u7684\u90ae\u7bb1\u91cc\u53bb\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u628a\u6570\u636e\u63a7\u4ef6\u91cc\u7684\u6570\u636e\u8f93\u51fa\u6210html\u6587\u4ef6\u7684\u4ee3\u7801\u5982\u4e0b\uff0c\u4e0d\u540c\u7248\u672c\u53ef\u80fd\u6709\u4e9b\u8bb8\u4e0d\u540c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>procedure TIWUserSession.Enq2Html(sTitle:String);\nvar\n  i:Integer;\n  sField,sLine:String;\n  sDesc,sWidth:String;\n  slData:TStringList;\n  sFileName,sRealFile,sUrlFile:String;\nbegin\n  if not qBatch.Active then exit;\n  \/\/\u521b\u5efa\u6570\u636e\u6e05\u5355\n  slData:=TStringList.Create;\n  slData.Add('&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;');\n  slData.Add('&lt;title&gt;\u9879\u76ee\u7ba1\u7406\u7cfb\u7edf-\u67e5\u8be2\u7ed3\u679c&lt;\/title&gt;');\n  slData.Add('&lt;meta http-queiv=\"content-type\" content=\"text\/html;charset=utf-8\"&gt;&lt;\/head&gt;');\n  slData.Add('&lt;body&gt;&lt;div align=\"center\"&gt;'+sTitle+'&lt;\/div&gt;&lt;br&gt;');\n  slData.Add('&lt;table border=\"1\" width=\"100%\"&gt;&lt;tbody&gt;&lt;tr&gt;');\n  \/\/\u52a0\u680f\u4f4d\u5934\n  sLine:='';\n  if not qFields.Active then qFields.Open;\n  for i:=0 to qBatch.Fields.Count-1 do\n  begin\n    sField:=qBatch.Fields.Fields&#91;i].FieldName;\n    if qFields.Locate('FieldName',sField,&#91;])then\n    begin\n      sDesc:=qFields.FieldByName('FieldDesc').AsString;\n      sWidth:=qFields.FieldByName('ViewWidth').AsString;\n    end;\n    sLine:=sLine+'&lt;th width='''+sWidth+'''&gt;'+sDesc+'&lt;\/th&gt;';\n  end;\n  slData.Add('&lt;\/tr&gt;'); \/\/\u8868\u5934\u7ed3\u675f\n  slData.Add(sLine);\n  \/\/\u52a0\u8868\u4e2d\u5185\u5bb9\n  qBatch.First;\n  while not qBatch.Eof do\n  begin\n    sLine:='&lt;tr&gt;';\n    for i:=0 to qBatch.Fields.Count-1 do\n    begin\n      sLine:=sLine+'&lt;td&gt;'+qBatch.Fields.Fields&#91;i].AsString+'&lt;\/td&gt;';\n    end;\n    sLine:=sLine+'&lt;\/tr&gt;';\n    slData.Add(sLine);\n    qBatch.Next;\n  end;\n  sFileName:=sys_UsID + FormatDateTime('HHMMSS',now())+'.html';\n  sRealFile:=IWServerController.ContentPath+'temp\\'+sFileName;\n  if FileExists(sRealFile) then DeleteFile(sRealFile);\n  slData.SaveToFile(sRealFile,TEncoding.UTF8);\n  slData.Free;\n  sUrlFile:='\/temp\/'+sFileName;\n  webApplication.NewWindow(sUrlFile);\nend;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7528IWHtmlLabel\u63a7\u4ef6\u663e\u793a\u4e00\u4e2a\u8868\u683c\uff0c\u4ee5\u4e0b\u4f8b\u662f\u8868\u683c\u5f62\u5f0f\u663e\u793a\u4ea7\u54c1\u5173\u952e\u4fe1\u606f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>procedure TfmmpdPhoto.awGridAsyncLinkClick(Sender: TObject;\n  EventParams: TStringList; RowIndex, ColumnIndex: Integer);\nvar\n  sValue,sLine:String;\n  i1,i2:Integer;\n  slData:TStringList;\nbegin\n  inherited;\n  sValue:=awGrid.Cells&#91;ColumnIndex,RowIndex];\n  sValue:=StringReplace(sValue,' ','',&#91;rfReplaceAll]);\n  i1:=14;\n  i2:=pos('title=',sValue);\n  sValue:=copy(sValue,i1,i2-i1-1);\n  qMaster.Locate('RecId',sValue,&#91;]);\n  UserSession.sys_Value1:=sValue; \/\/\u8bb0\u5f55ID\n  slData:=TStringList.Create;\n  slData.Add('&lt;table border=\"0\" width=\"100%\">&lt;tr>');\n  sLine:='&lt;th width=\"50%\">&lt;\/th>&lt;th width=\"50%\">&lt;\/th>';\n  slData.Add(sLine);\n  sLine:='&lt;tr>&lt;td>'+'\u7f16\u53f7\uff1a'+qMaster.FieldByName('pdNum').AsString+'&lt;\/td>';\n  sLine:=sLine+'&lt;td>'+'\u578b\u53f7\uff1a'+qMaster.FieldByName('pdType').AsString+'&lt;\/td>';\n  sLine:=sLine+'&lt;\/tr>';\n  slData.Add(sLine);\n  sLine:='&lt;tr>&lt;td>'+'\u529f\u7387\uff1a'+qMaster.FieldByName('pdPower').AsString+'W&lt;\/td>';\n  sLine:=sLine+'&lt;td>'+'\u7535\u538b\uff1a'+qMaster.FieldByName('pdVoltage').AsString+'V&lt;\/td>';\n  sLine:=sLine+'&lt;\/tr>';\n  slData.Add(sLine);\n  sLine:='&lt;tr>&lt;td>'+'\u98ce\u529b\uff1a'+qMaster.FieldByName('pdWind').AsString+'&lt;\/td>';\n  sLine:=sLine+'&lt;td>'+'\u566a\u97f3\uff1a'+qMaster.FieldByName('pdNoise').AsString+'dB&lt;\/td>';\n  sLine:=sLine+'&lt;\/tr>';\n  slData.Add(sLine);\n  sLine:='&lt;tr>&lt;td>'+'\u7279\u6027\uff1a'+qMaster.FieldByName('pdDesc').AsString+'&lt;\/td>';\n  sLine:=sLine+'&lt;td>'+'\u5b58\u653e\uff1a'+qMaster.FieldByName('pdLocation').AsString+'&lt;\/td>';\n  sLine:=sLine+'&lt;\/tr>';\n  slData.Add(sLine);\n  sLine:='&lt;tr>&lt;td>'+'\u5907\u6ce8\uff1a'+qMaster.FieldByName('Remark').AsString+'&lt;\/td>';\n  sLine:=sLine+'&lt;\/tr>';\n  slData.Add(sLine);\n  UserSession.sys_Value2:=slData.Text;\n  TfmmpdProd.Create(webApplication).Show;\nend;<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"728\" src=\"http:\/\/www.jh1999.cn\/wp-content\/uploads\/2024\/06\/KongFu51-1024x728.jpg\" alt=\"\" class=\"wp-image-2329\" style=\"width:437px;height:auto\" srcset=\"http:\/\/www.jh1999.cn\/wp-content\/uploads\/2024\/06\/KongFu51-1024x728.jpg 1024w, http:\/\/www.jh1999.cn\/wp-content\/uploads\/2024\/06\/KongFu51-300x213.jpg 300w, http:\/\/www.jh1999.cn\/wp-content\/uploads\/2024\/06\/KongFu51-768x546.jpg 768w, http:\/\/www.jh1999.cn\/wp-content\/uploads\/2024\/06\/KongFu51-1536x1092.jpg 1536w, http:\/\/www.jh1999.cn\/wp-content\/uploads\/2024\/06\/KongFu51-2048x1456.jpg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n<div class=\"gb-shapes\"><div class=\"gb-shape gb-shape-1\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 1200 211.2\" preserveAspectRatio=\"none\"><path d=\"M1200 188.4v22.8H0v-22.8C84.3 78.9 321.1 0 600 0s515.7 78.9 600 188.4z\"\/><\/svg><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Intraweb + IWDbGrid\uff0c\u642d\u914dMSSQL\uff0c\u80fd\u5b9e\u73b0\u4ece\u8868\u683c\u5230\u62a5\u544a\u7684\u6240\u89c1\u5373\u6240\u5f97\u3002\u5373\u4f5c\u4e1a\u5458\u5728\u8868\u683c\u91cc\u67e5\u8be2\u6216 &#8230; <a title=\"Intraweb\u8f93\u51fahtml\u62a5\u544a\" class=\"read-more\" href=\"http:\/\/www.jh1999.cn\/?p=1455\" aria-label=\"Read more about Intraweb\u8f93\u51fahtml\u62a5\u544a\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-1455","post","type-post","status-publish","format-standard","hentry","category-kfbj"],"_links":{"self":[{"href":"http:\/\/www.jh1999.cn\/index.php?rest_route=\/wp\/v2\/posts\/1455","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.jh1999.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.jh1999.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.jh1999.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.jh1999.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1455"}],"version-history":[{"count":5,"href":"http:\/\/www.jh1999.cn\/index.php?rest_route=\/wp\/v2\/posts\/1455\/revisions"}],"predecessor-version":[{"id":2331,"href":"http:\/\/www.jh1999.cn\/index.php?rest_route=\/wp\/v2\/posts\/1455\/revisions\/2331"}],"wp:attachment":[{"href":"http:\/\/www.jh1999.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.jh1999.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1455"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.jh1999.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}