Commit 4b23b387145b66a2f7561985ef5ca50600fbe67e
1 parent
e7610b68
feat(pagination): 优化组件
Showing
7 changed files
with
14 additions
and
4 deletions
Show diff stats
build/Form/Form.js
@@ -52,6 +52,10 @@ angular.module("esNgAntd").directive("esForm", function (esNgAntd) { | @@ -52,6 +52,10 @@ angular.module("esNgAntd").directive("esForm", function (esNgAntd) { | ||
52 | link: function ($scope, $element, $attrs, $controllers, $transclude) { | 52 | link: function ($scope, $element, $attrs, $controllers, $transclude) { |
53 | esNgAntd.createStyle("ant-form", style); | 53 | esNgAntd.createStyle("ant-form", style); |
54 | 54 | ||
55 | + if ($scope.form !== undefined) { | ||
56 | + $scope.form = $scope; | ||
57 | + } | ||
58 | + | ||
55 | if ($scope.name) { | 59 | if ($scope.name) { |
56 | let inputs = $element[0].querySelectorAll("input"); | 60 | let inputs = $element[0].querySelectorAll("input"); |
57 | 61 |
build/Pagination/Pagination.html
@@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
21 | </button> | 21 | </button> |
22 | </li> | 22 | </li> |
23 | <li class="ant-pagination-options"> | 23 | <li class="ant-pagination-options"> |
24 | - <es-select ng-if="showSizeChanger==='true'" class="ant-pagination-options-size-changer" size="{{size}}" value="{{defaultPageSize}}" get-popup-container="getPopupContainer" on-change="handleSelectChange(value)"> | 24 | + <es-select ng-if="showSizeChanger==='true'" class="ant-pagination-options-size-changer" size="{{size}}" value="{{state.defaultPageSize}}" get-popup-container="getPopupContainer" on-change="handleSelectChange(value)"> |
25 | <es-select-option value="10">10 条/页</es-select-option> | 25 | <es-select-option value="10">10 条/页</es-select-option> |
26 | <es-select-option value="20">20 条/页</es-select-option> | 26 | <es-select-option value="20">20 条/页</es-select-option> |
27 | <es-select-option value="50">50 条/页</es-select-option> | 27 | <es-select-option value="50">50 条/页</es-select-option> |
build/Pagination/Pagination.js
@@ -31,6 +31,7 @@ angular.module("esNgAntd").directive("esPagination", function (esNgAntd) { | @@ -31,6 +31,7 @@ angular.module("esNgAntd").directive("esPagination", function (esNgAntd) { | ||
31 | pageSize: null, | 31 | pageSize: null, |
32 | pageNum: null, | 32 | pageNum: null, |
33 | pageNumList: null, | 33 | pageNumList: null, |
34 | + defaultPageSize: $scope.defaultPageSize || 10, | ||
34 | }; | 35 | }; |
35 | $scope.watch = { | 36 | $scope.watch = { |
36 | total: function (newVal, oldVal) { | 37 | total: function (newVal, oldVal) { |
src/Form/Form.js
@@ -20,6 +20,10 @@ class Form { | @@ -20,6 +20,10 @@ class Form { | ||
20 | 20 | ||
21 | constructor() { | 21 | constructor() { |
22 | esNgAntd.createStyle("ant-form", style); | 22 | esNgAntd.createStyle("ant-form", style); |
23 | + | ||
24 | + if (this.form !== undefined) { | ||
25 | + this.form = $scope; | ||
26 | + } | ||
23 | 27 | ||
24 | if (this.props.name) { | 28 | if (this.props.name) { |
25 | let inputs = $element[0].querySelectorAll("input"); | 29 | let inputs = $element[0].querySelectorAll("input"); |
src/Pagination/Pagination.html
@@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
23 | </button> | 23 | </button> |
24 | </li> | 24 | </li> |
25 | <li className="ant-pagination-options"> | 25 | <li className="ant-pagination-options"> |
26 | - {showSizeChanger === 'true' && <es-select className="ant-pagination-options-size-changer" size="{{size}}" value={defaultPageSize} get-popup-container="getPopupContainer" on-change="handleSelectChange(value)"> | 26 | + {showSizeChanger === 'true' && <es-select className="ant-pagination-options-size-changer" size="{{size}}" value={state.defaultPageSize} get-popup-container="getPopupContainer" on-change="handleSelectChange(value)"> |
27 | <es-select-option value="10">10 条/页</es-select-option> | 27 | <es-select-option value="10">10 条/页</es-select-option> |
28 | <es-select-option value="20">20 条/页</es-select-option> | 28 | <es-select-option value="20">20 条/页</es-select-option> |
29 | <es-select-option value="50">50 条/页</es-select-option> | 29 | <es-select-option value="50">50 条/页</es-select-option> |
src/Pagination/Pagination.js
webpack.config.js
@@ -6,13 +6,13 @@ module.exports = { | @@ -6,13 +6,13 @@ module.exports = { | ||
6 | entry: "./build/index.js", | 6 | entry: "./build/index.js", |
7 | output: { | 7 | output: { |
8 | // bpms | 8 | // bpms |
9 | - // path: "/Usersc/shann/Project/essa/bpms/bpms-webapp/src/main/webapp/lib/ng-antd", | 9 | + path: "/Users/shann/Project/essa/bpms/bpms-webapp/src/main/webapp/lib/ng-antd", |
10 | // boss | 10 | // boss |
11 | // path: "/Users/shann/Project/essa/boss/trunk/vendor-lib/ng-antd", | 11 | // path: "/Users/shann/Project/essa/boss/trunk/vendor-lib/ng-antd", |
12 | // mvo | 12 | // mvo |
13 | // path: "/Users/shann/Project/essa/mvo/mvo-webapp/public/browser-vendor/ng-antd", | 13 | // path: "/Users/shann/Project/essa/mvo/mvo-webapp/public/browser-vendor/ng-antd", |
14 | // local | 14 | // local |
15 | - path: path.resolve(__dirname, "dist"), | 15 | + // path: path.resolve(__dirname, "dist"), |
16 | filename: "ng-antd.js", | 16 | filename: "ng-antd.js", |
17 | }, | 17 | }, |
18 | module: { | 18 | module: { |