码迷,mamicode.com
首页 > 编程语言 > 详细

springboot+angular dropDownList取值

时间:2019-09-11 15:57:46      阅读:76      评论:0      收藏:0      [点我收藏+]

标签:pageinfo   nts   nat   exception   play   mgr   htm   ltm   request   

controller:

private ResponseDTO buildResponse(HttpServletRequest request, MaterialSearchParameter param, String responseMessage) throws Exception {
   Map<String, Object> tokenMap = this.tokenUtils.getTokenMap(request);
    String tokenCompanyCode = MapUtils.getString(tokenMap, TokenConstants.COMPANY_CODE, "");
    param.setCompanyCode(tokenCompanyCode);
   
   PageInfo<Material> searchPage = this.materialService.listMaterial(param);
   
   Map<String, Object> dropDown = this.buildDropDownMap(tokenCompanyCode);
    Map<String, Object> resultMap = new HashMap<>();
    resultMap.put(Constants.CONSOLE_SEARCH_PAGE, searchPage);
    resultMap.put("dropDown", dropDown);
    
    return ResponseDTO.createBySuccessMessageData("", responseMessage, resultMap);
}

private Map<String, Object> buildDropDownMap(String tokenCompanyCode) {
   Map<String, Object> dropDownMap = new HashMap<>();
   
   List<Map<String, Object>> factoryList = this.factoryMasterService.dropDownList();
   List<Map<String, Object>> destinationList = this.originMasterService.dropDownList(tokenCompanyCode);
   
   dropDownMap.put("factoryList", factoryList);
   dropDownMap.put("destinationList", destinationList);
   return dropDownMap;
}

 


service:
public List<Map<String, Object>> dropDownList() {
   return this.factoryMasterMapper.dropDownList();
}

mapper:
List<Map<String, Object>> dropDownList();

 

xml:
<select id="dropDownList" resultType="java.util.HashMap" parameterType="Object">
   select m33ftycod "code", m33ftycod "value", m33lngengdsc "factoryEngDesc", m33lngchidsc "factoryChiDesc" from mem33
</select>

 


angular页面:
service.ts:
/**   Properties */
dropDown = {
  factoryList: [],
};

 


html:
<span [formGroupName]="index">
  <mat-select [(value)]="element.origin" formControlName="origin" style="min-width: 50px">
    <mat-option value="Undef.">Undef.</mat-option>
    <mat-option [value]="option.code" *ngFor="let option of mrService.dropDown.factoryList">
      {{option.value}}
    </mat-option>
  </mat-select>
</span>

 



springboot+angular dropDownList取值

标签:pageinfo   nts   nat   exception   play   mgr   htm   ltm   request   

原文地址:https://www.cnblogs.com/popo669/p/11506248.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!