WEB 適用業務明細画面HTML(PYTHON.400/QHTMLSRC.DSPDTA)

最終更新: 2025-11-27
0001.00 <!DOCTYPE html>                                                            
0002.00 % import ibm_db2                                                                 
0003.00 <html lang="ja">                                                           
0004.00   <head>                                                                   
0005.00     <meta charset="utf-8">                                                 
0006.00 	  <meta http-equiv="Content-Language" content="ja">                       
0007.00 	  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">     
0008.00 	  <meta http-equiv="Pragma" content="no-cache">                           
0009.00 	  <meta http-equiv="cache-control" content="no-cache">                    
0010.00 	  <meta http-equiv="Expires" content="-1">                                
0011.00 	  <meta http-equiv="X-UA-Compatible" content="IE=edge"/>                  
0012.00 	  <meta name="viewport" content="width=device-width, initial-scale=1.0"/> 
0013.00     <title>$TEXT</title>                                             
0014.00     <style>                                                                
0015.00       html {                                                                     
0016.00         font-family: "BIZ UPDGothic", Meiryo, sans-serif;                        
0017.00         accent-color: rgb(26, 115, 232);                                         
0018.00         color: #555;                                                             
0019.00       }                                                                          
0020.00       body {                                                                     
0021.00         padding: 1em 4em;                                                        
0022.00       }                                                                          
0023.00       input {                                                                    
0024.00         font-family: inherit;          
0025.00         font-size: inherit;            
0026.00         color: inherit;                
0027.00       }                                
0028.00       input:read-only {                
0029.00         border-color: transparent;     
0030.00       }                                
0031.00       h1 {                             
0032.00         font-size: 2.4em;              
0033.00         font-weight: normal;           
0034.00         color: #8888ff;                
0035.00       }                                
0036.00       fieldset {                       
0037.00         border: 0;                     
0038.00         margin: 1em 0;                 
0039.00       }                                
0040.00       label {                          
0041.00         display: flex;                 
0042.00         align-items: baseline;         
0043.00         gap: 0 0.7em;                  
0044.00       }                                
0045.00       .name {                          
0046.00         flex: none;                    
0047.00         width: 8em;                    
0048.00       }                                            
0049.00       button > img {                            
0050.00         width: 1.2em;                              
0051.00         height: 1.2em;                             
0052.00         object-fit: contain;                       
0053.00         vertical-align: text-bottom;               
0054.00         margin-right: 0.3em;                       
0055.00       }                                            
0056.00       .dspmod {                                    
0057.00         position: absolute;                        
0058.00         top: 1em;                                  
0059.00         right: 3em;                                
0060.00         font-size: 2.5em;                          
0061.00         color: #8888ff;                            
0062.00       }                                            
0063.00     </style>                                 
0064.00   </head>                                    
0065.00   <body>                                     
0066.00     <form action="/DSPDTA" method="post">    
0067.00       <header>                               
0068.00         <h1>$TEXT</h1>                 
0069.00       </header>                              
0070.00       <main>                                 
0072.00         <div class="dspmod"> 表示 </div>                                                                      
0073.00 % elif dspmod == 'CHGPTN':                                                                                                
0074.00         <div class="dspmod"> 変更 </div>                                                                      
0075.00 % else:                                                                                                                   
0076.00         <div class="dspmod"> 入力 </div>                                                                      
0077.00 % end                                                                                                                     
0078.00         <div class="content">                                                                                       
0079.00           <div class="buttons">                                                                                     
0080.00             <button type="submit" formaction="/end"><img src="/icon/END.SVG"> 終了 </button>            
0081.00 % if dspmod == "CHGPTN":                                                                                                  
0082.00             <button type="submit" formaction="/update"><img src="/icon/UPDATE.SVG"> 更新 </button>      
0083.00             <button type="submit" formaction="/delete"><img src="/icon/DELETE.SVG"> 削除 </button>      
0084.00             <button type="submit" class="default" formaction="/init"><img src="/icon/BACK.SVG"> 戻る </but 
0085.00 % elif dspmod == "INPPTN":                                                                                                
0086.00             <button type="submit" formaction="/insert"><img src="/icon/UPDATE.SVG"> 更新 </button>      
0087.00             <button type="submit" class="default" formaction="/init"><img src="/icon/BACK.SVG"> 変更 </but 
0088.00 % else:                                                                                                                   
0089.00             <button type="submit" class="default" formaction="/init"><img src="/icon/BACK.SVG"> 戻る </but 
0090.00 % end                                                                                                                     
0091.00           </div>                                                                                                    
0092.00           <fieldset class="db-keys">                                                                                
0093.00             <label>                                                                                                 
0094.00               <span class="name">$COLHDG</span>                                                               
0095.00               <span class="value">                                                                                  
0096.00                 <input type="text" name="$FLD" value="{{values[0].get('$FLD', '')}}"                     
0097.00                   size="$SIZE" maxlength="$FLDLEN"   {{"readonly" if dspmod == "DSPPTN" else ""}}$ALIGN> 
0098.00               </span>                                                                                 
0099.00             </label>                                                                                  
0100.00           </fieldset>                                                                                 
0101.00         </div>                                                                                        
0102.00       </main>                                                                                         
0103.00       <footer>                                                                                        
0104.00       </footer>                                                                                       
0105.00     </form>                                                                                           
0106.00   </body>                                                                                             
0107.00 </html>                                                                                               

[解説]

DSPDTA はWEB明細画面として使われるHTMLテンプレートです。

092.00           <fieldset class="db-keys">                                                                                
0093.00             <label>                                                                                                 
0094.00               <span class="name">$COLHDG</span>                                                               
0095.00               <span class="value">                                                                                  
0096.00                 <input type="text" name="$FLD" value="{{values[0].get('$FLD', '')}}"                     
0097.00                   size="$SIZE" maxlength="$FLDLEN"   {{"readonly" if dspmod == "DSPPTN" else ""}}$ALIGN> 
0098.00               </span>                                                                                 
0099.00             </label>                                                                                  
0100.00           </fieldset>

がフィールドの記述であり
$COLHDG = フィールドの欄見出し
$FLD  = フィールド名
$FLDLEN = フィールド長
$SIZE = フィールド長 + 1

に置換えられます。