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 | 52 | link: function ($scope, $element, $attrs, $controllers, $transclude) { |
| 53 | 53 | esNgAntd.createStyle("ant-form", style); |
| 54 | 54 | |
| 55 | + if ($scope.form !== undefined) { | |
| 56 | + $scope.form = $scope; | |
| 57 | + } | |
| 58 | + | |
| 55 | 59 | if ($scope.name) { |
| 56 | 60 | let inputs = $element[0].querySelectorAll("input"); |
| 57 | 61 | ... | ... |
build/Pagination/Pagination.html
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | </button> |
| 22 | 22 | </li> |
| 23 | 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 | 25 | <es-select-option value="10">10 条/页</es-select-option> |
| 26 | 26 | <es-select-option value="20">20 条/页</es-select-option> |
| 27 | 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 | 31 | pageSize: null, |
| 32 | 32 | pageNum: null, |
| 33 | 33 | pageNumList: null, |
| 34 | + defaultPageSize: $scope.defaultPageSize || 10, | |
| 34 | 35 | }; |
| 35 | 36 | $scope.watch = { |
| 36 | 37 | total: function (newVal, oldVal) { | ... | ... |
src/Form/Form.js
src/Pagination/Pagination.html
| ... | ... | @@ -23,7 +23,7 @@ |
| 23 | 23 | </button> |
| 24 | 24 | </li> |
| 25 | 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 | 27 | <es-select-option value="10">10 条/页</es-select-option> |
| 28 | 28 | <es-select-option value="20">20 条/页</es-select-option> |
| 29 | 29 | <es-select-option value="50">50 条/页</es-select-option> | ... | ... |
src/Pagination/Pagination.js
webpack.config.js
| ... | ... | @@ -6,13 +6,13 @@ module.exports = { |
| 6 | 6 | entry: "./build/index.js", |
| 7 | 7 | output: { |
| 8 | 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 | 10 | // boss |
| 11 | 11 | // path: "/Users/shann/Project/essa/boss/trunk/vendor-lib/ng-antd", |
| 12 | 12 | // mvo |
| 13 | 13 | // path: "/Users/shann/Project/essa/mvo/mvo-webapp/public/browser-vendor/ng-antd", |
| 14 | 14 | // local |
| 15 | - path: path.resolve(__dirname, "dist"), | |
| 15 | + // path: path.resolve(__dirname, "dist"), | |
| 16 | 16 | filename: "ng-antd.js", |
| 17 | 17 | }, |
| 18 | 18 | module: { | ... | ... |