成本测算导出-单位下拉框
This commit is contained in:
		
							parent
							
								
									4ecd7d8f64
								
							
						
					
					
						commit
						85169a3d9b
					
				| 
						 | 
				
			
			@ -710,6 +710,18 @@ public class RecosMeasurecosFormPlugin extends AbstractFormPlugin implements Upl
 | 
			
		|||
                    // 添加数据验证规则
 | 
			
		||||
                    sheet.addValidationData(dataValidation1);
 | 
			
		||||
                    break;
 | 
			
		||||
                case "单位":
 | 
			
		||||
                    // 1. 设置下拉项数据
 | 
			
		||||
                    String[] products2 = {"%", "KVA", "m2", "m3","点位","个","套","项"};
 | 
			
		||||
                    DataValidationHelper helper2 = sheet.getDataValidationHelper();
 | 
			
		||||
                    DataValidationConstraint constraint2 = helper2.createExplicitListConstraint(products2);
 | 
			
		||||
                    int totalRowCount2 = sheet.getLastRowNum() + 1;
 | 
			
		||||
                    System.out.println("总行数 (包括空行): " + totalRowCount2);
 | 
			
		||||
                    CellRangeAddressList addressList2 = new CellRangeAddressList(4, totalRowCount2-1, colIndex, colIndex); // 从 A2 到 A10 作为下拉列表范围
 | 
			
		||||
                    DataValidation dataValidation2 = helper2.createValidation(constraint2, addressList2);
 | 
			
		||||
                    // 添加数据验证规则
 | 
			
		||||
                    sheet.addValidationData(dataValidation2);
 | 
			
		||||
                    break;
 | 
			
		||||
                default:
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue