【问题标题】:Jhipster generator doesn't generate filter panel in UIJhipster 生成器不会在 UI 中生成过滤器面板
【发布时间】:2018-02-04 15:38:40
【问题描述】:

我正在使用 jhipster 为我的 Web 应用程序生成 CRUD。 通过配置 jdl 生成器,我希望在 UI 中看到每个实体的搜索面板。但它只是在后端生成 EntityQueryService 类,它工作正常 它可以在 API 文档页面的 swagger-ui 中访问
是否有任何 UI 库可以帮助我按预期格式或任何谓词过滤器面板传递参数?

谢谢。

【问题讨论】:

    标签: filter jhipster


    【解决方案1】:

    最后我添加了如下手动搜索面板:

      <div class="container-fluid">
            <div class="row">
                <jhi-alert-error></jhi-alert-error>
                <div class="col-sm-4">
                    <label for="field_billOrgType">organization</label>
                    <select id="field_billOrgType" ng-model="vm.searchModel.billOrgType">
                        <option ng-repeat="x in vm.Utilities" value="{{x.key}}">{{x.name}} - {{x.key}}</option>
                    </select>
                </div>
                </div>
            </div>
    

    我的控制器:

    ( function () {
        'use strict';
         angular
             .module('ebppApp')
             .factory('TmpBill', TmpBill);
     TmpBill.$inject = ['$resource'];
     function TmpBill($resource) {
         var resourceUrl = 'api/tmp-bills/:id';
    
         return $resource(resourceUrl, {}, {
             'search': {
                 method: 'GET'
                 , isArray: true
                 , url: 'api/tmp-bills?:billOrgType',
                 params: {
                     billOrgType: '@billOrgType'
                 }
                 }
             }
         });
     } })();
    
         function search() {
    
             TmpBill.search({
    
                 billOrgType: vm.searchModel.billOrgType ? "billOrgType.equals=" + vm.searchModel.billOrgType : ''
                 page: vm.page - 1,
                 size: vm.itemsPerPage,
                 sort: sort()
             }, onSuccess, onError);
             function sort() {
                 var result = [vm.predicate + ',' + (vm.reverse ? 'asc' : 'desc')];
                 if (vm.predicate !== 'id') {
                     result.push('id');
                 }
                 return result;
             }
    
             function onSuccess(data, headers) {
                 vm.links = ParseLinks.parse(headers('link'));
                 vm.totalItems = headers('X-Total-Count');
                 vm.queryCount = vm.totalItems;
                 vm.tmpBills = data;
                 // vm.page = pagingParams.page;
             }
    
             function onError(error) {
                 AlertService.error(error.data.message);
             }
         }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-08-09
      • 2011-12-21
      • 2018-09-18
      • 2021-07-31
      • 2015-12-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多