Procházet zdrojové kódy

完善框架

master
chengxuke před 4 roky
rodič
revize
a0e228e176

+ 1
- 1
public/index.html Zobrazit soubor

@@ -11,7 +11,7 @@
11 11
     <noscript>
12 12
       <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
13 13
     </noscript>
14
-    <div id="app"></div>
14
+    <div id="app" style="height: 100%;"></div>
15 15
     <!-- built files will be auto injected -->
16 16
   </body>
17 17
 </html>

+ 8
- 1
src/App.vue Zobrazit soubor

@@ -4,4 +4,11 @@
4 4
   </div>
5 5
 </template>
6 6
 
7
-<style></style>
7
+<style>
8
+html,
9
+body,
10
+#app {
11
+  height: 100%;
12
+  /* width: 100%; */
13
+}
14
+</style>

+ 0
- 1
src/api/user.js Zobrazit soubor

@@ -10,5 +10,4 @@ export const login = (loginname, loginpwd) =>
10 10
       loginname,
11 11
       loginpwd
12 12
     }
13
-    // data: Qs.stringify(username, password)
14 13
   });

+ 25
- 0
src/assets/iconfont/iconfont.css Zobrazit soubor

@@ -0,0 +1,25 @@
1
+@font-face {font-family: "iconfont";
2
+  src: url('iconfont.eot?t=1590732052374'); /* IE9 */
3
+  src: url('iconfont.eot?t=1590732052374#iefix') format('embedded-opentype'), /* IE6-IE8 */
4
+  url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAOEAAsAAAAAB0wAAAM1AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCDBgqCLIIbATYCJAMMCwgABCAFhG0HPRtoBhHVmyfI/oZoHN5XYENSuvSs3eYMhUArpa7z1ufVzRYkn7jc+g9Qf8MYkAAAAAAAwfO13+/c3f3mQFOL2kSrWiORqO7Jk0qINBrNJIpNJz2z3f4W7AqkzhPPEmziybzzAIOiPKQaQGYaXgBcbspwka0wb7uYjqsuvssn4QP7uc/TMTWuducaiHZOlySFAn2IEEP59E50A7SkmesGis963SWIzy8LUuzBCUcBeAwxBOtmz6EGuf+5nN41gAKZHyintffzMQETDGzsARJwgSTofcCG7mc9BHATRw5SbnWHgWAwuwkgPY1aAUhGiWnIFJwI9oqxBlnGhlPNqDtgKfi+/KAIKGwas291t6UMyrvO1GZZu4fAmk4P8JNAAzmAAemsDDbDCE/QuIWuOdGOQVBTeSwrYGp8u/WHBwoBsWOmewHIoJCCdw4zEYXsq07XANijlC6IPkxp1NB3lhRlPXS4c1/fLHH4cGx83DW+UQ/87iGp4aOMWydAjBwrsEOPnD0GXNnAxOV4aXzQzz7ex5/p5jZEMT+u/Jb6BY5gZTOdvh9uKLT7RhOSeVdurd4T3e7JCacPnXwkOyJDnZhQqKHXGvkTk/KQ3CYfKoP8IJ7yb3wED+ku8a8Px1b1VfQOKgiex5omdSQexRJZwASV0fas7qmwB9kexTNB1AlP6m6kSBO22ZBcbFAVT4sCvzFQCLDSIVIKr7/2N/yG/6bhrjuDAeDpK9FhZeieghMFPOulszqWGY1jqrRRmA7TMGsKB+oVIF2wYGFaw7wNl0bfWFhwEp2AwkEsaJykoAafAzY85IIdJ0XgJpuqyR4i9MKIcQFZTAAIQS5A4ecSNEGuUYN/BRsx/IGdoDC4aZT9nB7SRE1h1IINmD/0lhZna0SFmXdst0lzmhMQ38i+90CeZPlIjQvyFAP8py1EHDimGW6wGU4Twco0oJWkE1mrNHVVL0oszYEKMGrBBswfekuL82qLKnz+ju02aW7IqtK+kX1fP+RJ1gGthUunrFu5xH/aQsSBY5rhBq1wmgjW6lYDWkm6Af61Sq1qrqswWV48v0AGn4e5iA6VaDE06t5v1G168RPicQkCAAAA') format('woff2'),
5
+  url('iconfont.woff?t=1590732052374') format('woff'),
6
+  url('iconfont.ttf?t=1590732052374') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
7
+  url('iconfont.svg?t=1590732052374#iconfont') format('svg'); /* iOS 4.1- */
8
+}
9
+
10
+.iconfont {
11
+  font-family: "iconfont" !important;
12
+  font-size: 16px;
13
+  font-style: normal;
14
+  -webkit-font-smoothing: antialiased;
15
+  -moz-osx-font-smoothing: grayscale;
16
+}
17
+
18
+.icon-kaisuohuansuo:before {
19
+  content: "\e629";
20
+}
21
+
22
+.icon-ren:before {
23
+  content: "\e605";
24
+}
25
+

binární
src/assets/iconfont/iconfont.eot Zobrazit soubor


+ 32
- 0
src/assets/iconfont/iconfont.svg Zobrazit soubor

@@ -0,0 +1,32 @@
1
+<?xml version="1.0" standalone="no"?>
2
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+<!--
4
+2013-9-30: Created.
5
+-->
6
+<svg>
7
+<metadata>
8
+Created by iconfont
9
+</metadata>
10
+<defs>
11
+
12
+<font id="iconfont" horiz-adv-x="1024" >
13
+  <font-face
14
+    font-family="iconfont"
15
+    font-weight="500"
16
+    font-stretch="normal"
17
+    units-per-em="1024"
18
+    ascent="896"
19
+    descent="-128"
20
+  />
21
+    <missing-glyph />
22
+    
23
+    <glyph glyph-name="kaisuohuansuo" unicode="&#58921;" d="M825.611627 412.588105 392.464533 412.588105 392.464533 584.672392c0 75.091232 61.095473 136.186705 136.186705 136.186705 75.096349 0 136.192845-61.095473 136.192845-136.186705 0-25.822109 20.935822-46.75793 46.75793-46.75793 25.822109 0 46.75793 20.935822 46.75793 46.75793 0 126.660748-103.047957 229.702566-229.708705 229.702566S298.948673 711.33314 298.948673 584.672392l0-172.084287-67.25373 0c-25.716708 0-46.75793-21.041222-46.75793-46.75793l0-363.974665c0-25.716708 21.041222-46.75793 46.75793-46.75793l593.916684 0c25.716708 0 46.75793 21.041222 46.75793 46.75793L872.369557 365.831198C872.369557 391.547907 851.328335 412.588105 825.611627 412.588105zM567.353702 189.571822l0-87.700411c0-20.890796-17.093307-37.984103-37.984103-37.984103l-1.430582 0c-20.890796 0-37.984103 17.093307-37.984103 37.984103l0 87.701434c-18.328437 12.419867-30.375821 33.411971-30.375821 57.219189 0 38.149878 30.92636 69.076238 69.075215 69.076238 38.149878 0 69.076238-30.92636 69.076238-69.076238C597.730547 222.983793 585.68214 201.992713 567.353702 189.571822z"  horiz-adv-x="1024" />
24
+
25
+    
26
+    <glyph glyph-name="ren" unicode="&#58885;" d="M880.864 191.654c-56.813 25.397-141.118 90.818-265.945 113.298 31.924 34.36 56.084 88.097 80.937 151.754 14.403 36.893 11.935 68.343 11.935 113.121 0 33.073 6.193 86.156-1.97 115.329-27.533 98.59-97.1 125.79-178.61 125.79-81.577 0-151.229-27.328-178.71-126.087-8.097-29.083-1.888-82.044-1.888-115.037 0-44.875-2.422-76.432 12.019-113.383 25.044-63.984 48.854-117.644 80.655-151.86-123.826-22.89-207.498-87.822-263.95-113.138C58.523 139.055 57.95 81.704 57.95 81.704v-97.42l940.724 0.112v97.308s-0.547 57.548-117.809 109.95z"  horiz-adv-x="1024" />
27
+
28
+    
29
+
30
+
31
+  </font>
32
+</defs></svg>

binární
src/assets/iconfont/iconfont.ttf Zobrazit soubor


binární
src/assets/iconfont/iconfont.woff Zobrazit soubor


+ 1
- 1
src/store/index.js Zobrazit soubor

@@ -47,7 +47,7 @@ export default new Vuex.Store({
47 47
         commit("SET_USERIFNO", []);
48 48
         removeToken();
49 49
         clearStore();
50
-        resolve()
50
+        resolve("您已被登出!")
51 51
           // })
52 52
           .catch(error => {
53 53
             reject(error);

+ 23
- 7
src/views/common/login.vue Zobrazit soubor

@@ -1,10 +1,12 @@
1 1
 <template>
2 2
   <div class="wrap">
3
-    <form ref="loginForm" :model="loginForm">
4
-      <input type="text" v-model="loginForm.username" />
5
-      <input type="text" v-model="loginForm.password" />
6
-    </form>
7
-    <button @click="login_by_username">登陆</button>
3
+    <div class="loginInner">
4
+      <form ref="loginForm" :model="loginForm">
5
+        <input type="text" v-model="loginForm.username" />
6
+        <input type="text" v-model="loginForm.password" />
7
+      </form>
8
+      <button @click="login_by_username">登陆</button>
9
+    </div>
8 10
   </div>
9 11
 </template>
10 12
 
@@ -25,7 +27,7 @@ export default {
25 27
   },
26 28
   methods: {
27 29
     login_by_username() {
28
-      console.log("login" + this.loginForm);
30
+      // console.log("login" + this.loginForm);
29 31
       this.$store
30 32
         .dispatch("login_username", this.loginForm)
31 33
         .then(() => {
@@ -40,4 +42,18 @@ export default {
40 42
 };
41 43
 </script>
42 44
 
43
-<style></style>
45
+<style lang="scss" scoped>
46
+.wrap {
47
+  height: 100%;
48
+  display: flex;
49
+  justify-content: center;
50
+  align-items: center;
51
+  background: pink;
52
+  .loginInner {
53
+    width: 350px;
54
+    height: 250px;
55
+    background: white;
56
+    border-radius: 5px;
57
+  }
58
+}
59
+</style>

+ 28
- 4
src/views/module/layout.vue Zobrazit soubor

@@ -1,11 +1,35 @@
1 1
 <template>
2
-  <div>
3
-    <router-view></router-view>
2
+  <div class="wrap clearfix">
3
+    <div class="left_bar">
4
+      <left-navbar />
5
+    </div>
6
+    <div class="right_content">
7
+      <layout-content />
8
+    </div>
4 9
   </div>
5 10
 </template>
6 11
 
7 12
 <script>
8
-export default {};
13
+import leftNavbar from "./layout_navbar";
14
+import layoutContent from "./layout_content";
15
+export default {
16
+  components: {
17
+    leftNavbar,
18
+    layoutContent
19
+  }
20
+};
9 21
 </script>
10 22
 
11
-<style></style>
23
+<style lang="scss" scoped>
24
+.wrap {
25
+  // display: flex;
26
+  .left_bar {
27
+    float: left;
28
+    width: 20%;
29
+  }
30
+  .right_content {
31
+    float: right;
32
+    width: 80%;
33
+  }
34
+}
35
+</style>

+ 45
- 0
src/views/module/layout_content.vue Zobrazit soubor

@@ -0,0 +1,45 @@
1
+<template>
2
+  <div class="wrap">
3
+    <div class="content_top">
4
+      <h3>星火燎原智慧课堂管理平台</h3>
5
+      <span @click="loginout">退出</span>
6
+    </div>
7
+    <div class="content_bottom">
8
+      <router-view></router-view>
9
+    </div>
10
+  </div>
11
+</template>
12
+
13
+<script>
14
+export default {
15
+  methods: {
16
+    loginout() {
17
+      this.$store.dispatch("loginOut").then(res => {
18
+        this.$Message.error(res);
19
+        this.$router.push("/login");
20
+      });
21
+    }
22
+  }
23
+};
24
+</script>
25
+
26
+<style lang="scss" scoped>
27
+.wrap {
28
+  // width: 100%;
29
+  .content_top {
30
+    // width: 100%;
31
+    padding: 0 20px;
32
+    height: 70px;
33
+    line-height: 70px;
34
+    background: #6098ff;
35
+    color: white;
36
+    display: flex;
37
+    justify-content: space-between;
38
+    span {
39
+      &:hover {
40
+        cursor: pointer;
41
+      }
42
+    }
43
+  }
44
+}
45
+</style>

+ 87
- 0
src/views/module/layout_navbar.vue Zobrazit soubor

@@ -0,0 +1,87 @@
1
+<template>
2
+  <Collapse simple>
3
+    <Panel name="1">
4
+      史蒂夫·乔布斯
5
+      <p slot="content">
6
+        史蒂夫·乔布斯(Steve
7
+        Jobs),1955年2月24日生于美国加利福尼亚州旧金山,美国发明家、企业家、美国苹果公司联合创办人。
8
+      </p>
9
+    </Panel>
10
+    <Panel name="2">
11
+      斯蒂夫·盖瑞·沃兹尼亚克
12
+      <p slot="content">
13
+        斯蒂夫·盖瑞·沃兹尼亚克(Stephen Gary
14
+        Wozniak),美国电脑工程师,曾与史蒂夫·乔布斯合伙创立苹果电脑(今之苹果公司)。斯蒂夫·盖瑞·沃兹尼亚克曾就读于美国科罗拉多大学,后转学入美国著名高等学府加州大学伯克利分校(UC
15
+        Berkeley)并获得电机工程及计算机(EECS)本科学位(1987年)。
16
+      </p>
17
+    </Panel>
18
+    <Panel name="3">
19
+      乔纳森·伊夫
20
+      <p slot="content">
21
+        乔纳森·伊夫是一位工业设计师,现任Apple公司设计师兼资深副总裁,英国爵士。他曾参与设计了iPod,iMac,iPhone,iPad等众多苹果产品。除了乔布斯,他是对苹果那些著名的产品最有影响力的人。
22
+      </p>
23
+    </Panel>
24
+  </Collapse>
25
+</template>
26
+
27
+<script>
28
+export default {
29
+  data() {
30
+    return {
31
+      isCollapsed: false,
32
+      keepAliveList: [],
33
+      title: "Home",
34
+      showSettingPage: false,
35
+      showSuggestionPage: false,
36
+      menu: [
37
+        {
38
+          name: "主页",
39
+          to: "home",
40
+          icon: "md-apps",
41
+          children: []
42
+        },
43
+        {
44
+          name: "菜单分类1",
45
+          to: "user",
46
+          icon: "ios-create-outline",
47
+          children: [
48
+            {
49
+              name: "子菜单1",
50
+              to: "user"
51
+            },
52
+            {
53
+              name: "子菜单2",
54
+              to: "menu"
55
+            },
56
+            {
57
+              name: "子菜单3",
58
+              to: "shared_report"
59
+            }
60
+          ]
61
+        },
62
+        {
63
+          name: "菜单分类2",
64
+          to: "user2",
65
+          icon: "ios-archive-outline",
66
+          children: [
67
+            {
68
+              name: "子菜单2-1",
69
+              to: "firewall"
70
+            },
71
+            {
72
+              name: "子菜单2-2",
73
+              to: "navi_page"
74
+            }
75
+          ]
76
+        }
77
+      ]
78
+    };
79
+  }
80
+};
81
+</script>
82
+
83
+<style lang="scss" scoped>
84
+// .wrap {
85
+//   width: ;
86
+// }
87
+</style>

Načítá se…
Zrušit
Uložit