From f43146a590a10c1f77f51bff2ff234aecd86dbdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=E5=98=89=E9=98=B3?= Date: Thu, 8 Feb 2018 21:25:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=89=8D=E7=AB=AF=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fjy/spring/controller/NavController.java | 6 +- .../fjy/spring/interceptor/WebAppConfig.java | 2 +- src/main/resources/static/js/admin.js | 40 ++-- src/main/resources/static/js/homePage.js | 2 +- src/main/resources/static/js/homework.js | 94 +++++++++ src/main/resources/static/js/managecourse.js | 94 +++++++++ src/main/resources/static/js/manageuser.js | 92 +++++++++ src/main/resources/templates/home/admin.html | 184 ++++++------------ .../resources/templates/home/homework.html | 129 ++++++++++++ .../templates/home/managecourse.html | 119 +++++++++++ .../resources/templates/home/manageuser.html | 101 ++++++++++ 11 files changed, 726 insertions(+), 137 deletions(-) create mode 100644 src/main/resources/static/js/homework.js create mode 100644 src/main/resources/static/js/managecourse.js create mode 100644 src/main/resources/static/js/manageuser.js create mode 100644 src/main/resources/templates/home/homework.html create mode 100644 src/main/resources/templates/home/managecourse.html create mode 100644 src/main/resources/templates/home/manageuser.html diff --git a/src/main/java/com/fjy/spring/controller/NavController.java b/src/main/java/com/fjy/spring/controller/NavController.java index f37469e..9234d86 100644 --- a/src/main/java/com/fjy/spring/controller/NavController.java +++ b/src/main/java/com/fjy/spring/controller/NavController.java @@ -25,17 +25,17 @@ public class NavController { return "/home/home"; } - @GetMapping(value = {"/feedback"}) + @GetMapping(value = {"/home/feedback"}) public String toFeedbackPage(){ return "/home/feedback"; } - @GetMapping(value = {"/about"}) + @GetMapping(value = {"/home/about"}) public String toAboutPage(){ return "/home/about"; } - @GetMapping(value = {"/user"}) + @GetMapping(value = {"/home/user"}) public String toUserPage(){ return "/home/user"; } diff --git a/src/main/java/com/fjy/spring/interceptor/WebAppConfig.java b/src/main/java/com/fjy/spring/interceptor/WebAppConfig.java index bd31d1c..f3f3ad8 100644 --- a/src/main/java/com/fjy/spring/interceptor/WebAppConfig.java +++ b/src/main/java/com/fjy/spring/interceptor/WebAppConfig.java @@ -6,7 +6,7 @@ import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -/*@Configuration*/ +@Configuration public class WebAppConfig implements WebMvcConfigurer { /** diff --git a/src/main/resources/static/js/admin.js b/src/main/resources/static/js/admin.js index 26f9a07..8525bda 100644 --- a/src/main/resources/static/js/admin.js +++ b/src/main/resources/static/js/admin.js @@ -2,19 +2,8 @@ var Main = { data() { return { activeIndex: '1', - formInline: { - user: '', - region: '' - }, form: { - name: '', - region: '', - date1: '', - date2: '', - delivery: false, - type: [], - resource: '', - desc: '' + content: '', }, feedbackData:[ { @@ -24,6 +13,30 @@ var Main = { } ], logData:[ + { + ip:'127.0.0.1', + header:'bug', + time:'2018-2-3', + username:'root' + }, + { + ip:'127.0.0.1', + header:'bug', + time:'2018-2-3', + username:'root' + }, + { + ip:'127.0.0.1', + header:'bug', + time:'2018-2-3', + username:'root' + }, + { + ip:'127.0.0.1', + header:'bug', + time:'2018-2-3', + username:'root' + }, { ip:'127.0.0.1', header:'bug', @@ -34,6 +47,9 @@ var Main = { } }, methods: { + ClickToJump(targe){ + window.location.href="http://localhost:8080/cms/" + targe; + }, handleSelect(key, keyPath) { console.log(key, keyPath); }, diff --git a/src/main/resources/static/js/homePage.js b/src/main/resources/static/js/homePage.js index 3f56948..e365b5c 100644 --- a/src/main/resources/static/js/homePage.js +++ b/src/main/resources/static/js/homePage.js @@ -201,7 +201,7 @@ var Main = { } }) console.log(this.$refs.content.value) - this.openSuccess("成功","反馈成功!") + this.openNotiSuccess("成功","反馈成功!") //this.$options.methods.openNotiSuccess.bind(this)(); //alert('submit!'); } else { diff --git a/src/main/resources/static/js/homework.js b/src/main/resources/static/js/homework.js new file mode 100644 index 0000000..f644aac --- /dev/null +++ b/src/main/resources/static/js/homework.js @@ -0,0 +1,94 @@ +var Main = { + data() { + return { + activeIndex: '1', + formInline: { + user: '', + region: '' + }, + tableData3: [{ + id:'1', + date: '2016-05-03', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }, { + id:'2', + date: '2016-05-02', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }, { + id:'3', + date: '2016-05-04', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }, { + id:'4', + date: '2016-05-01', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }, { + id:'5', + date: '2016-05-08', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }, { + id:'6', + date: '2016-05-06', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }, { + id:'7', + date: '2016-05-07', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }], + multipleSelection: [] + } + }, + methods: { + togglePost(url){ + axios({ + url: 'http://localhost:8080/cms/'+url, + method: 'post', + data: { + id:this.multipleSelection + }, + transformRequest: [function (data) { + // Do whatever you want to transform the data + let ret = '' + for (let it in data) { + ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&' + } + return ret + }], + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + }) + }, + handleSelect(key, keyPath) { + console.log(key, keyPath); + }, + ClickToJump(targe){ + window.location.href="http://localhost:8080/cms/" + targe; + }, + toggleSelection(rows) { + if (rows) { + rows.forEach(row => { + this.$refs.multipleTable.toggleRowSelection(row); + }); + } else { + this.$refs.multipleTable.clearSelection(); + } + }, + handleSelectionChange(val) { + this.multipleSelection = val; + console.log(val) + }, + onSubmit() { + console.log('submit!'); + } + } +} +var Ctor = Vue.extend(Main) +new Ctor().$mount('#app') \ No newline at end of file diff --git a/src/main/resources/static/js/managecourse.js b/src/main/resources/static/js/managecourse.js new file mode 100644 index 0000000..f644aac --- /dev/null +++ b/src/main/resources/static/js/managecourse.js @@ -0,0 +1,94 @@ +var Main = { + data() { + return { + activeIndex: '1', + formInline: { + user: '', + region: '' + }, + tableData3: [{ + id:'1', + date: '2016-05-03', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }, { + id:'2', + date: '2016-05-02', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }, { + id:'3', + date: '2016-05-04', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }, { + id:'4', + date: '2016-05-01', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }, { + id:'5', + date: '2016-05-08', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }, { + id:'6', + date: '2016-05-06', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }, { + id:'7', + date: '2016-05-07', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }], + multipleSelection: [] + } + }, + methods: { + togglePost(url){ + axios({ + url: 'http://localhost:8080/cms/'+url, + method: 'post', + data: { + id:this.multipleSelection + }, + transformRequest: [function (data) { + // Do whatever you want to transform the data + let ret = '' + for (let it in data) { + ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&' + } + return ret + }], + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + }) + }, + handleSelect(key, keyPath) { + console.log(key, keyPath); + }, + ClickToJump(targe){ + window.location.href="http://localhost:8080/cms/" + targe; + }, + toggleSelection(rows) { + if (rows) { + rows.forEach(row => { + this.$refs.multipleTable.toggleRowSelection(row); + }); + } else { + this.$refs.multipleTable.clearSelection(); + } + }, + handleSelectionChange(val) { + this.multipleSelection = val; + console.log(val) + }, + onSubmit() { + console.log('submit!'); + } + } +} +var Ctor = Vue.extend(Main) +new Ctor().$mount('#app') \ No newline at end of file diff --git a/src/main/resources/static/js/manageuser.js b/src/main/resources/static/js/manageuser.js new file mode 100644 index 0000000..93a35c6 --- /dev/null +++ b/src/main/resources/static/js/manageuser.js @@ -0,0 +1,92 @@ +var Main = { + data() { + return { + activeIndex: '1', + tableData3: [{ + id:'1', + date: '2016-05-03', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }, { + id:'2', + date: '2016-05-02', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }, { + id:'3', + date: '2016-05-04', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }, { + id:'4', + date: '2016-05-01', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }, { + id:'5', + date: '2016-05-08', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }, { + id:'6', + date: '2016-05-06', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }, { + id:'7', + date: '2016-05-07', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }], + multipleSelection: [] + } + }, + methods: { + togglePost(url){ + /*axios({ + url: 'http://localhost:8080/cms/'+url, + method: 'post', + data: { + id:this.multipleSelection + }, + transformRequest: [function (data) { + // Do whatever you want to transform the data + let ret = '' + for (let it in data) { + ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&' + } + return ret + }], + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + })*/ + console.log(this.multipleSelection) + //console.log(this.$refs.id.value); + }, + handleSelect(key, keyPath) { + console.log(key, keyPath); + }, + ClickToJump(targe){ + window.location.href="http://localhost:8080/cms/" + targe; + }, + toggleSelection(rows) { + if (rows) { + rows.forEach(row => { + this.$refs.multipleTable.toggleRowSelection(row); + }); + } else { + this.$refs.multipleTable.clearSelection(); + } + }, + handleSelectionChange(val) { + this.multipleSelection = val; + console.log(val) + }, + onSubmit() { + console.log('submit!'); + } + } +} +var Ctor = Vue.extend(Main) +new Ctor().$mount('#app') \ No newline at end of file diff --git a/src/main/resources/templates/home/admin.html b/src/main/resources/templates/home/admin.html index d8cfa0d..1df2fd1 100644 --- a/src/main/resources/templates/home/admin.html +++ b/src/main/resources/templates/home/admin.html @@ -36,103 +36,70 @@ - -
- 用户名
- 学号 -
-
- 首页
- 个人中心
- 关于
- 意见反馈 -
-
+ + +
+ 用户名
+ 学号 +
+
+ 首页 +
+ 个人中心 +
+ 关于 +
+ 意见反馈 +
+
+
+ + +
+ 管理员
+ 管理员号 +
+
+ 用户管理 +
+ 课程/老师管理 +
+ 作业管理 +
+ 公告/日志 +
+
+
- -

添加老师

- - - - - - - - - - - - 添加 - - -

添加课程

- - - - - - - - - - - - 添加 - - -

添加作业

- - - - - - - - - - - - - - - - - - - - - - - - 添加 - - -

发布公告

- - - - - - 添加 - - -

添加管理员

- - - - - - - - - - - - 添加 - - + + +

发布公告

+ + + + + + 添加 + + +
+ + 近期登陆日志
+ +
- +
@@ -155,36 +122,13 @@
- - -
- -
- 近期登陆日志 -
-
- - - - - - - - - - -
-
-
-
-
+ + diff --git a/src/main/resources/templates/home/homework.html b/src/main/resources/templates/home/homework.html new file mode 100644 index 0000000..0f64057 --- /dev/null +++ b/src/main/resources/templates/home/homework.html @@ -0,0 +1,129 @@ + + + + + 作业管理 + + + + + + + + + + + +
+ + + + + 首页 + + + 选项1 + 选项2 + 选项3 + + 关于 + 意见反馈 + 登出 + + + + + + +
+ 用户名
+ 学号 +
+
+ 首页
+ 个人中心
+ 关于
+ 意见反馈 +
+
+
+ + +
+ 管理员
+ 管理员号 +
+
+ 用户管理
+ 课程/老师管理
+ 作业管理
+ 公告/日志 +
+
+
+ + + + +

添加作业

+ + + + + + + + + + + + + + + + + + + + + + + + 添加 + + +
+
+ + + +
+ + +
+
+
+ + + + diff --git a/src/main/resources/templates/home/managecourse.html b/src/main/resources/templates/home/managecourse.html new file mode 100644 index 0000000..9f1fa8d --- /dev/null +++ b/src/main/resources/templates/home/managecourse.html @@ -0,0 +1,119 @@ + + + + + 课程|老师 管理 + + + + + + + + + + + +
+ + + + + 首页 + + + 选项1 + 选项2 + 选项3 + + 关于 + 意见反馈 + 登出 + + + + + + +
+ 用户名
+ 学号 +
+
+ 首页
+ 个人中心
+ 关于
+ 意见反馈 +
+
+
+ + +
+ 管理员
+ 管理员号 +
+
+ 用户管理
+ 课程/老师管理
+ 作业管理
+ 公告/日志 +
+
+
+ + + + + +

添加课程

+ + + + + + + + + + + + 添加 + + +
+ + + + + +
+ + +
+
+
+ + + + diff --git a/src/main/resources/templates/home/manageuser.html b/src/main/resources/templates/home/manageuser.html new file mode 100644 index 0000000..f7e4bd9 --- /dev/null +++ b/src/main/resources/templates/home/manageuser.html @@ -0,0 +1,101 @@ + + + + + 用户管理 + + + + + + + + + + + +
+ + + + + 首页 + + + 选项1 + 选项2 + 选项3 + + 关于 + 意见反馈 + 登出 + + + + + + +
+ 用户名
+ 学号 +
+
+ 首页
+ 个人中心
+ 关于
+ 意见反馈 +
+
+
+ + +
+ 管理员
+ 管理员号 +
+
+ 用户管理
+ 课程/老师管理
+ 作业管理
+ 公告/日志 +
+
+
+ + + + + + +
+ + +
+
+
+ + + +