Commit c432342225853ad5e77ad9313e21714149e76e50
1 parent
ae10fe48
update
Showing
10 changed files
with
257 additions
and
29 deletions
.gitignore
| @@ -9,6 +9,7 @@ test_coverage/ | @@ -9,6 +9,7 @@ test_coverage/ | ||
| 9 | .idea | 9 | .idea |
| 10 | .DS_Store | 10 | .DS_Store |
| 11 | *.iml | 11 | *.iml |
| 12 | +tmp | ||
| 12 | 13 | ||
| 13 | # git忽略空文件夹,按照惯例,空文件夹下放置.gitkeep文件避免文件夹被忽略不上传。 | 14 | # git忽略空文件夹,按照惯例,空文件夹下放置.gitkeep文件避免文件夹被忽略不上传。 |
| 14 | !.gitkeep | 15 | !.gitkeep |
| 15 | \ No newline at end of file | 16 | \ No newline at end of file |
pom.xml
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | <groupId>com.bsth</groupId> | 5 | <groupId>com.bsth</groupId> |
| 6 | <artifactId>bsth_control</artifactId> | 6 | <artifactId>bsth_control</artifactId> |
| 7 | <version>0.0.1-SNAPSHOT</version> | 7 | <version>0.0.1-SNAPSHOT</version> |
| 8 | - <packaging>jar</packaging> | 8 | + <packaging>war</packaging> |
| 9 | 9 | ||
| 10 | <parent> | 10 | <parent> |
| 11 | <groupId>org.springframework.boot</groupId> | 11 | <groupId>org.springframework.boot</groupId> |
src/main/resources/static/index.html
| @@ -279,8 +279,13 @@ tr.row-active td { | @@ -279,8 +279,13 @@ tr.row-active td { | ||
| 279 | 279 | ||
| 280 | <script src="assets/js/common.js"></script> | 280 | <script src="assets/js/common.js"></script> |
| 281 | 281 | ||
| 282 | - | ||
| 283 | -<!-- TODO:angularJS相关库 --> | 282 | +<!-- angularJS相关库 --> |
| 283 | +<script src="assets/bower_components/angular/angular.min.js"></script> | ||
| 284 | +<script src="assets/bower_components/angular-sanitize/angular-sanitize.min.js"></script> | ||
| 285 | +<script src="assets/bower_components/angular-touch/angular-touch.min.js"></script> | ||
| 286 | +<script src="assets/bower_components/angular-ui-router/release/angular-ui-router.min.js"></script> | ||
| 287 | +<script src="assets/bower_components/oclazyload/dist/ocLazyLoad.min.js"></script> | ||
| 288 | +<script src="assets/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script> | ||
| 284 | 289 | ||
| 285 | 290 | ||
| 286 | <script type="text/javascript"> | 291 | <script type="text/javascript"> |
| @@ -345,6 +350,7 @@ $(function(){ | @@ -345,6 +350,7 @@ $(function(){ | ||
| 345 | } | 350 | } |
| 346 | return r; | 351 | return r; |
| 347 | } | 352 | } |
| 353 | + | ||
| 348 | </script> | 354 | </script> |
| 349 | </body> | 355 | </body> |
| 350 | </html> | 356 | </html> |
| 351 | \ No newline at end of file | 357 | \ No newline at end of file |
src/main/resources/static/pages/schedulePlan/Gruntfile.js
0 → 100644
| 1 | +module.exports = function (grunt) { | ||
| 2 | + // grunt配置,插件配置 | ||
| 3 | + grunt.initConfig({ | ||
| 4 | + // 调用grunt相关api,用于读取package.json文件信息 | ||
| 5 | + // pkg相当于定义了一个变量,可以通过 <%== 变量 %>在后面调用 | ||
| 6 | + pkg: grunt.file.readJSON('package.json'), | ||
| 7 | + | ||
| 8 | + // 这里插件的每个子任务代表一个功能,子任务名就用文件夹名,便于管理 | ||
| 9 | + | ||
| 10 | + // clean清除插件配置 | ||
| 11 | + clean: { | ||
| 12 | + demo: { // demo模块 | ||
| 13 | + src: ['app/demo/tmp/', 'app/demo/dist/'] | ||
| 14 | + } | ||
| 15 | + }, | ||
| 16 | + | ||
| 17 | + // unglify压缩插件配置 | ||
| 18 | + uglify: { | ||
| 19 | + demo: { // demo模块 | ||
| 20 | + files: { | ||
| 21 | + 'app/demo/dist/demo1.min.js': ['app/demo/demo1.js'] | ||
| 22 | + } | ||
| 23 | + } | ||
| 24 | + }, | ||
| 25 | + | ||
| 26 | + // replace文本替换插件配置 | ||
| 27 | + replace: { | ||
| 28 | + demo: { // demo模块 | ||
| 29 | + src: ["app/demo/demo1.html"], | ||
| 30 | + dest: "app/demo/tmp/", | ||
| 31 | + "replacements": [{ | ||
| 32 | + from: /(<script src=\")([^\"]*?)(.js\")/mg, | ||
| 33 | + to: '$1dist/$2.min$3' | ||
| 34 | + }] | ||
| 35 | + } | ||
| 36 | + }, | ||
| 37 | + | ||
| 38 | + // static-inline静态文件插入替换插件配置 | ||
| 39 | + staticinline: { | ||
| 40 | + demoo: { // demo模块 | ||
| 41 | + options: { | ||
| 42 | + basepath: 'app/demo/' // 查找路径 | ||
| 43 | + }, | ||
| 44 | + files: { | ||
| 45 | + 'app/demo/dist/demo1.dist.html': 'app/demo/tmp/demo1.html' | ||
| 46 | + } | ||
| 47 | + } | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + }); | ||
| 51 | + | ||
| 52 | + // grunt加载的插件 | ||
| 53 | + grunt.loadNpmTasks("grunt-contrib-clean"); | ||
| 54 | + grunt.loadNpmTasks("grunt-contrib-uglify"); | ||
| 55 | + grunt.loadNpmTasks("grunt-static-inline"); | ||
| 56 | + grunt.loadNpmTasks("grunt-text-replace"); | ||
| 57 | + | ||
| 58 | + | ||
| 59 | + // 定义grunt任务列表 | ||
| 60 | + /* | ||
| 61 | + 这里定义了一组任务,并且制定到default任务下,可以一键grunt执行 | ||
| 62 | + 任务组有顺序,如下说明: | ||
| 63 | + 1、clean 清除 dist、tmp目录,准备重新生成 | ||
| 64 | + 2、uglify 压缩指定的脚本到dist目录,脚本后缀名为.min.js结尾 | ||
| 65 | + 3、replace 将指定的html文件复制到tmp目录下,将其中的js后缀名替换成.min.js | ||
| 66 | + 4、staticinline 将.min.js的内容inline-内联插入到tmp的html文件中,然后重命名为.dist.html到dist目录中 | ||
| 67 | + */ | ||
| 68 | + grunt.registerTask('default', ['clean', 'uglify', 'replace', 'staticinline']); | ||
| 69 | + | ||
| 70 | +}; | ||
| 0 | \ No newline at end of file | 71 | \ No newline at end of file |
src/main/resources/static/pages/schedulePlan/app/demo/demo1.html
0 → 100644
| 1 | +<div class="page-head"> | ||
| 2 | + <div class="page-title"> | ||
| 3 | + <h1>AngularJS Demo测试1</h1> | ||
| 4 | + </div> | ||
| 5 | +</div> | ||
| 6 | + | ||
| 7 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | ||
| 9 | + <li><span class="active">计划调度</span> <i class="fa fa-circle"></i></li> | ||
| 10 | + <li><span class="active">demo</span> <i class="fa fa-circle"></i></li> | ||
| 11 | + <li><span class="active">demo1</span></li> | ||
| 12 | +</ul> | ||
| 13 | + | ||
| 14 | +<!-- 这里装载整个AngularJS module --> | ||
| 15 | +<div id="demo1" class="row" ng-app="notesApp"> | ||
| 16 | + <!-- 这里装载control控制器 --> | ||
| 17 | + <div class="col-md-12" ng-controller="MainCtrl as mainCtrl"> | ||
| 18 | + <div class="portlet light portlet-fit portlet-datatable bordered"> | ||
| 19 | + <h1>Hello 控制器</h1> | ||
| 20 | + <button ng-click="mainCtrl.open('first')">打开第一个tab</button> | ||
| 21 | + <button ng-click="mainCtrl.open('second')">打开第二个tab</button> | ||
| 22 | + | ||
| 23 | + <div ng-switch on="mainCtrl.tab"> | ||
| 24 | + <div ng-switch-when="first"> | ||
| 25 | + <div ng-controller="SubCtrl as subCtrl1"> | ||
| 26 | + <h3>第一个tab</h3> | ||
| 27 | + <ul> | ||
| 28 | + <li ng-repeat="item in subCtrl1.list"> | ||
| 29 | + <span ng-bind="item.label"></span> | ||
| 30 | + </li> | ||
| 31 | + </ul> | ||
| 32 | + <button ng-click="subCtrl1.add()">添加更多的项目</button> | ||
| 33 | + </div> | ||
| 34 | + </div> | ||
| 35 | + <div ng-switch-when="second"> | ||
| 36 | + <div ng-controller="SubCtrl as subCtrl2"> | ||
| 37 | + <h3>第二个tab</h3> | ||
| 38 | + <ul> | ||
| 39 | + <li ng-repeat="item in subCtrl2.list"> | ||
| 40 | + <span ng-bind="item.label"></span> | ||
| 41 | + </li> | ||
| 42 | + </ul> | ||
| 43 | + <button ng-click="subCtrl2.add()">添加更多的项目</button> | ||
| 44 | + </div> | ||
| 45 | + </div> | ||
| 46 | + </div> | ||
| 47 | + | ||
| 48 | + | ||
| 49 | + </div> | ||
| 50 | + </div> | ||
| 51 | +</div> | ||
| 52 | + | ||
| 53 | +<!--<script src="demo1.js"></script>--> | ||
| 54 | +<script src="demo1.js" inline="true"></script> | ||
| 55 | + | ||
| 56 | +<script type="text/javascript"> | ||
| 57 | + // 手动初始化 | ||
| 58 | + angular.bootstrap(document.getElementById("demo1"), ["notesApp"]); | ||
| 59 | +</script> |
src/main/resources/static/pages/schedulePlan/app/demo/demo1.js
0 → 100644
| 1 | +// 保证每个module名字空间名字不一样,否则会报错,这个AngularJS启动时会检查 | ||
| 2 | +// 除非必要,创建module,control等尽量不要使用变量名,用module点语法创建下去,防止全局变量名冲突 | ||
| 3 | + | ||
| 4 | +angular.module("notesApp", []) | ||
| 5 | + .controller("MainCtrl", [function() { | ||
| 6 | + var self = this; | ||
| 7 | + self.tab = "first"; | ||
| 8 | + self.open = function(tab) { | ||
| 9 | + self.tab = tab; | ||
| 10 | + }; | ||
| 11 | + }]) | ||
| 12 | + .controller("SubCtrl", [function() { | ||
| 13 | + var self = this; | ||
| 14 | + self.list = [ | ||
| 15 | + {id: 1, label: "Item 0"}, | ||
| 16 | + {id: 2, label: "Item 1"} | ||
| 17 | + ]; | ||
| 18 | + self.add = function() { | ||
| 19 | + self.list.push({ | ||
| 20 | + id: self.list.length + 1, | ||
| 21 | + label: "Item " + self.list.length | ||
| 22 | + }); | ||
| 23 | + }; | ||
| 24 | + }]); |
src/main/resources/static/pages/schedulePlan/app/demo/dist/demo1.dist.html
0 → 100644
| 1 | +<div class="page-head"> | ||
| 2 | + <div class="page-title"> | ||
| 3 | + <h1>AngularJS Demo测试1</h1> | ||
| 4 | + </div> | ||
| 5 | +</div> | ||
| 6 | + | ||
| 7 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | ||
| 9 | + <li><span class="active">计划调度</span> <i class="fa fa-circle"></i></li> | ||
| 10 | + <li><span class="active">demo</span> <i class="fa fa-circle"></i></li> | ||
| 11 | + <li><span class="active">demo1</span></li> | ||
| 12 | +</ul> | ||
| 13 | + | ||
| 14 | +<!-- 这里装载整个AngularJS module --> | ||
| 15 | +<div id="demo1" class="row" ng-app="notesApp"> | ||
| 16 | + <!-- 这里装载control控制器 --> | ||
| 17 | + <div class="col-md-12" ng-controller="MainCtrl as mainCtrl"> | ||
| 18 | + <div class="portlet light portlet-fit portlet-datatable bordered"> | ||
| 19 | + <h1>Hello 控制器</h1> | ||
| 20 | + <button ng-click="mainCtrl.open('first')">打开第一个tab</button> | ||
| 21 | + <button ng-click="mainCtrl.open('second')">打开第二个tab</button> | ||
| 22 | + | ||
| 23 | + <div ng-switch on="mainCtrl.tab"> | ||
| 24 | + <div ng-switch-when="first"> | ||
| 25 | + <div ng-controller="SubCtrl as subCtrl1"> | ||
| 26 | + <h3>第一个tab</h3> | ||
| 27 | + <ul> | ||
| 28 | + <li ng-repeat="item in subCtrl1.list"> | ||
| 29 | + <span ng-bind="item.label"></span> | ||
| 30 | + </li> | ||
| 31 | + </ul> | ||
| 32 | + <button ng-click="subCtrl1.add()">添加更多的项目</button> | ||
| 33 | + </div> | ||
| 34 | + </div> | ||
| 35 | + <div ng-switch-when="second"> | ||
| 36 | + <div ng-controller="SubCtrl as subCtrl2"> | ||
| 37 | + <h3>第二个tab</h3> | ||
| 38 | + <ul> | ||
| 39 | + <li ng-repeat="item in subCtrl2.list"> | ||
| 40 | + <span ng-bind="item.label"></span> | ||
| 41 | + </li> | ||
| 42 | + </ul> | ||
| 43 | + <button ng-click="subCtrl2.add()">添加更多的项目</button> | ||
| 44 | + </div> | ||
| 45 | + </div> | ||
| 46 | + </div> | ||
| 47 | + | ||
| 48 | + | ||
| 49 | + </div> | ||
| 50 | + </div> | ||
| 51 | +</div> | ||
| 52 | + | ||
| 53 | +<!--<script src="dist/demo1.min.js"></script>--> | ||
| 54 | +<script>angular.module("notesApp",[]).controller("MainCtrl",[function(){var a=this;a.tab="first",a.open=function(b){a.tab=b}}]).controller("SubCtrl",[function(){var a=this;a.list=[{id:1,label:"Item 0"},{id:2,label:"Item 1"}],a.add=function(){a.list.push({id:a.list.length+1,label:"Item "+a.list.length})}}]);</script> | ||
| 55 | + | ||
| 56 | +<script type="text/javascript"> | ||
| 57 | + // 手动初始化 | ||
| 58 | + angular.bootstrap(document.getElementById("demo1"), ["notesApp"]); | ||
| 59 | +</script> |
src/main/resources/static/pages/schedulePlan/app/demo/dist/demo1.min.js
0 → 100644
| 1 | +angular.module("notesApp",[]).controller("MainCtrl",[function(){var a=this;a.tab="first",a.open=function(b){a.tab=b}}]).controller("SubCtrl",[function(){var a=this;a.list=[{id:1,label:"Item 0"},{id:2,label:"Item 1"}],a.add=function(){a.list.push({id:a.list.length+1,label:"Item "+a.list.length})}}]); | ||
| 0 | \ No newline at end of file | 2 | \ No newline at end of file |
src/main/resources/static/pages/schedulePlan/app/other/.gitkeep
0 → 100644
src/main/resources/static/pages/schedulePlan/package.json
| 1 | { | 1 | { |
| 2 | - "version": "0.0.0", | ||
| 3 | - "private": true, | ||
| 4 | - "name": "angular-phonecat", | ||
| 5 | - "description": "A tutorial application for AngularJS", | ||
| 6 | - "license": "MIT", | ||
| 7 | - "devDependencies": { | ||
| 8 | - "bower": "^1.3.1", | ||
| 9 | - "http-server": "^0.6.1", | ||
| 10 | - "shelljs": "^0.2.6", | ||
| 11 | - "tmp": "0.0.23" | ||
| 12 | - }, | ||
| 13 | - "scripts": { | ||
| 14 | - "postinstall": "bower install", | 2 | + "version": "0.0.0", |
| 3 | + "private": true, | ||
| 4 | + "name": "bsth-control-scheduleplan", | ||
| 5 | + "description": "巴士拓华调度系统改版 计划调度模块", | ||
| 6 | + "devDependencies": { | ||
| 7 | + "bower": "^1.3.1", | ||
| 8 | + "grunt": "^0.4.5", | ||
| 9 | + "grunt-contrib-clean": "^1.0.0", | ||
| 10 | + "grunt-contrib-uglify": "^1.0.1", | ||
| 11 | + "grunt-static-inline": "^0.1.9", | ||
| 12 | + "grunt-text-replace": "^0.4.0", | ||
| 13 | + "http-server": "^0.6.1", | ||
| 14 | + "karma": "^0.13.22", | ||
| 15 | + "karma-chrome-launcher": "^1.0.1", | ||
| 16 | + "karma-coverage": "^1.0.0", | ||
| 17 | + "karma-jasmine": "^1.0.2", | ||
| 18 | + "karma-junit-reporter": "^1.0.0", | ||
| 19 | + "protractor": "^3.3.0", | ||
| 20 | + "shelljs": "^0.2.6", | ||
| 21 | + "tmp": "0.0.23" | ||
| 22 | + }, | ||
| 23 | + "scripts": { | ||
| 24 | + "postinstall": "bower install", | ||
| 25 | + "prestart": "npm install", | ||
| 26 | + "start": "http-server -a 0.0.0.0 -p 8000", | ||
| 27 | + "pretest": "npm install", | ||
| 28 | + "test": "node node_modules/karma/bin/karma start test/karma.conf.js", | ||
| 29 | + "test-single-run": "node node_modules/karma/bin/karma start test/karma.conf.js --single-run", | ||
| 30 | + "preupdate-webdriver": "npm install", | ||
| 31 | + "update-webdriver": "webdriver-manager update", | ||
| 32 | + "preprotractor": "npm run update-webdriver", | ||
| 33 | + "protractor": "protractor test/protractor-conf.js", | ||
| 15 | 34 | ||
| 16 | - "prestart": "npm install", | ||
| 17 | - "start": "http-server -a 0.0.0.0 -p 8000", | ||
| 18 | 35 | ||
| 19 | - "pretest": "npm install", | ||
| 20 | - "test": "node node_modules/karma/bin/karma start test/karma.conf.js", | ||
| 21 | - "test-single-run": "node node_modules/karma/bin/karma start test/karma.conf.js --single-run", | ||
| 22 | - | ||
| 23 | - "preupdate-webdriver": "npm install", | ||
| 24 | - "update-webdriver": "webdriver-manager update", | ||
| 25 | - | ||
| 26 | - "preprotractor": "npm run update-webdriver", | ||
| 27 | - "protractor": "protractor test/protractor-conf.js" | ||
| 28 | - | ||
| 29 | - } | 36 | + "build": "grunt" |
| 37 | + } | ||
| 30 | } | 38 | } |