Skip to content

Commit

Permalink
create repo
Browse files Browse the repository at this point in the history
  • Loading branch information
lf7817 committed Jul 12, 2017
1 parent 6e119c0 commit e882701
Show file tree
Hide file tree
Showing 57 changed files with 6,122 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015","stage-2"]
}
7 changes: 7 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
"extends": "standard",
"plugins": [
"standard",
"promise"
]
};
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
node_modules/
21 changes: 21 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/pty.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/watcherTasks.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
# pty
葡萄园自动灌溉控制系统
6 changes: 6 additions & 0 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Created by fan on 2017/7/11.
*/
import requireDir from 'require-dir'

requireDir('./tasks')
38 changes: 38 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "pty",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "gulp dev"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.25.0",
"babel-polyfill": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"browser-sync": "^2.18.12",
"del": "^3.0.0",
"eslint": "^4.2.0",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.1.0",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^4.0.0",
"gulp-babel": "^6.1.2",
"gulp-cached": "^1.1.1",
"gulp-imagemin": "^3.3.0",
"gulp-plumber": "^1.1.0",
"gulp-requirejs-optimize": "^1.2.0",
"gulp-sass": "^3.1.0",
"gulp-sequence": "^0.4.6",
"gulp-sourcemaps": "^2.6.0",
"require-dir": "^0.3.2"
}
}
Binary file added src/images/560b355eccf2d.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/btn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/btn_hover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/w7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="zh-ch">
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="lib/normalize.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="lib/jedate/skin/jedate.css">
<link rel="stylesheet" href="lib/layer/skin/default/layer.css">
<script src="lib/require.js" data-main="js/app.js"></script>
<style>
.wicon {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAQCAYAAADj5tSrAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNi8xNS8xNGnF/oAAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzVxteM2AAAAoElEQVQ4jWPceOnNfwYqAz9dYRQ+E7UtwAaGjyUsDAyYYUgJ2HT5LXZLcEmSCnA6duOlN///////H0bDALl8dPH/////Z8FuNW6Qtvw2nL3lyjsGBgYGhlmRqnj1kGwJuqHIlhJlCXq8EOITEsdqCXLEbbr8FisfFkTo+vBZRFZwERNEFFkCiw90nxJtCalxQmzegltCzVyP1RJq5HZ8AABuNZr0628DMwAAAABJRU5ErkJggg==");
background-repeat: no-repeat;
background-position: right center;
}
.datainp {
width: 200px;
height: 30px;
border: 1px #A5D2EC solid;
padding-left: 10px;
}
</style>
</head>
<body>
<div class="app-head">
<h1 class="app-title">葡萄园自动灌溉控制系统</h1>
<div class="app-date">
<label>日期</label><input name="date" type="text" value="2017-07-12" readonly/> <br/>
<label>时间</label><input name="time" type="text" value="14:23:06" readonly/>
<label>星期</label><input name="day" type="text" value="" readonly/>
</div>
</div>
<div class="app-container">
<div id="view-router" class="app-router"></div>
<div id="menu" class="app-menu">
<ul>
<li><a href="#/home" class="active">主画面</a></li>
<li><a href="#/report">运行记录</a></li>
<li><a href="#/warning">报警信息</a></li>
<li><a href="#/user">用户管理</a></li>
<li><a href="javascript:;">退出系统</a></li>
</ul>
</div>
</div>
</body>
</html>
29 changes: 29 additions & 0 deletions src/js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
require.config({
baseUrl: 'lib',
paths: {
'jquery': 'jquery.min',
'art-template': 'template-web',
'jedate': 'jedate/jquery.jedate.min',
'layer': 'layer/layer',
'module': '../js/modules',
'router': '../js/router',
'page': '../js/pages',
'tpl': '../template'
},
shim: {
'director': {
exports: 'Router'
},
'WebVideoCtrl': {
exports: 'WebVideoCtrl'
}
}
})

require(['domReady!', 'router/router'], (doc, router) => {
router.init()
setInterval(() => {
let date = new Date()

}, 1000)
})
9 changes: 9 additions & 0 deletions src/js/modules/clock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Created by lf on 2017/7/12.
*/
define(function () {
var day = ['日', '一', '二', '三', '四', '五', '六']
return function () {

}
})
5 changes: 5 additions & 0 deletions src/js/modules/ma.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
define([], function () {
return function () {
alert('i called the module aa')
}
})
5 changes: 5 additions & 0 deletions src/js/modules/mb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
define([], function () {
return function () {
alert('i called the module b')
}
})
5 changes: 5 additions & 0 deletions src/js/modules/mc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
define([], function () {
return function () {
alert('i called the module c')
}
})
12 changes: 12 additions & 0 deletions src/js/pages/pa.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* eslint-disable no-undef */
define(['art-template', 'module/ma', 'text!tpl/pa.html'], function (template, ma, tpl) {
function render (el, data) {
var render = template.compile(tpl)
var html = render(data)
document.getElementById(el).innerHTML = html
}
return function () {
render('router-view', {str: '我是页面AA'})
ma()
}
})
12 changes: 12 additions & 0 deletions src/js/pages/pb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* eslint-disable no-undef */
define(['art-template', 'module/mb', 'text!tpl/pb.html'], function (template, mb, tpl) {
function render (el, data) {
var render = template.compile(tpl)
var html = render(data)
document.getElementById(el).innerHTML = html
}
return function () {
render('router-view', {str: '我是页面B'})
mb()
}
})
12 changes: 12 additions & 0 deletions src/js/pages/pc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* eslint-disable no-undef */
define(['art-template', 'module/mc', 'text!tpl/pc.html'], function (template, mc, tpl) {
function render (el, data) {
var render = template.compile(tpl)
var html = render(data)
document.getElementById(el).innerHTML = html
}
return function () {
render('router-view', {str: '我是页面C'})
mc()
}
})
4 changes: 4 additions & 0 deletions src/js/router/router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
define(['router/routes', 'director'], function (Routes, Router) {
var router = Router(Routes)
return router
})
5 changes: 5 additions & 0 deletions src/js/router/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
define({
'/aa': () => { require(['page/pa'], (a) => {a()}) },
'/bb': () => { require(['page/pb'], (b) => {b()}) },
'/cc': () => { require(['page/pc'], (c) => {c()}) },
})
Loading

0 comments on commit e882701

Please sign in to comment.