Skip to content

Commit

Permalink
Merge pull request #63 from ffan-fe/dev
Browse files Browse the repository at this point in the history
small fix
  • Loading branch information
bcguan2008 committed May 18, 2017
2 parents 116c256 + 0ef2a35 commit 95c98df
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 588 deletions.
18 changes: 18 additions & 0 deletions example/app/components/omniTable/OmniTable.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ export default class OmniTableController extends Base {
class="f-input f-input-lg">`*/
},
{
label: '门店名称',
type: 'select',
name: 'storeName',
options: [{
text: 'qqqqq',
value: '11111'
}]
/*tpl: `<input type="text"
placeholder="{{field.placeholder}}"
ng-model="vm.query[field.name]"
class="f-input f-input-lg">`*/
},
{
type: 'text',
label: '商户名称',
name: 'merchantName'
},
Expand All @@ -72,10 +86,14 @@ export default class OmniTableController extends Base {
name: 'plazaName'
},
{
type: 'text',

label: '门店名称1',
name: 'storeName1'
},
{
type: 'text',

label: '商户名称1',
name: 'merchantName1'
},
Expand Down
35 changes: 0 additions & 35 deletions lib/Directive/bpFieldError.js

This file was deleted.

44 changes: 0 additions & 44 deletions lib/Directive/bpLargeThan.js

This file was deleted.

29 changes: 0 additions & 29 deletions lib/Directive/index.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,12 @@
import dateModelFormat from './dateModelFormat.js'
import dateViewFormat from './dateViewFormat.js'
import BpFieldError from './bpFieldError.js'
import BpLargeThan from './bpLargeThan.js'
import fEnter from './f-enter.js'
import fBindHtml from './f-bind-html.js'

let bpDirectives = angular.module('bp.directives', [])
.directive('dateModelFormat', ()=>dateModelFormat)
.directive('dateViewFormat', ()=>dateViewFormat)
.directive('bpFieldError', ($compile) => {
'ngInject'
return new BpFieldError($compile);
})
.directive('bpLargeThan', () => new BpLargeThan())
.directive('fEnter', () => fEnter)
.directive('fBindHtml', () => fBindHtml)
.filter('error', function (Errors) {
return function (name, customMessages) {
if (customMessages) {
customMessages = JSON.parse(customMessages);
}

let errors = angular.extend({}, Errors, customMessages);
console.info('extended errors', errors);

return errors[name] || name;
};
})
.constant('Errors', {
email: '不是有效格式的邮件地址',
url: '不是有效格式的url',
required: '此项不能为空',
same: '此项必须与密码相同',
max: '超过上限',
min: '低于下限',
number: '必须为数字',
parse: '根据验证规则,已重置无效值'
});

export default bpDirectives;
13 changes: 12 additions & 1 deletion lib/OmniTable/OmniTable.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<form class="f-form f-form-horizontal f-advanced-search-form" ng-if="vm.search">
<div class="f-row" style="margin-left: -20px; margin-right: -20px;">
<div ng-repeat="field in vm.viewSearch" class="f-col-8" style="padding-left: 20px; padding-right: 20px;">
<div class="f-row f-form-item">
<div class="f-row f-form-item" ng-if="field.type == 'text'">
<div class="f-col-5 f-form-item-label"><label class="">{{field.label}}</label></div>
<div class="f-col-19 f-form-item-control-wrapper">
<div class="f-form-item-control has-success">
Expand All @@ -13,6 +13,17 @@
</div>
</div>
</div>
<div class="f-row f-form-item" ng-if="field.type == 'select'">
<div class="f-col-5 f-form-item-label"><label class="">{{field.label}}</label></div>
<div class="f-col-19 f-form-item-control-wrapper">
<div class="f-form-item-control has-success">
<select class="f-input f-input-lg"
ng-options="option.value as option.text for option in field.options"
ng-model="vm.query[field.name]">
</select>
</div>
</div>
</div>
</div>
</div>
<div class="f-row">
Expand Down
Loading

0 comments on commit 95c98df

Please sign in to comment.