zengyicheng 3 gadi atpakaļ
vecāks
revīzija
ae4f2916cf

+ 1 - 1
dist/index.html

@@ -25,4 +25,4 @@
       height: 100%;
       width: 100%;
       background: #e6eaf0;
-    }</style><link href=./static/css/app.52259c25eeed45eb8c6b068d2417f70a.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.fed1de90e0941b3846db.js></script><script type=text/javascript src=./static/js/vendor.57c88615aac160d2c474.js></script><script type=text/javascript src=./static/js/app.2852685e610795d005d6.js></script></body></html>
+    }</style><link href=./static/css/app.6aca562c280b061c0141cddb4a1f0d23.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.fed1de90e0941b3846db.js></script><script type=text/javascript src=./static/js/vendor.57c88615aac160d2c474.js></script><script type=text/javascript src=./static/js/app.1264ab147a547ed7f99e.js></script></body></html>

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/css/app.52259c25eeed45eb8c6b068d2417f70a.css.map


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/css/app.6aca562c280b061c0141cddb4a1f0d23.css


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/css/app.6aca562c280b061c0141cddb4a1f0d23.css.map


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/js/app.1264ab147a547ed7f99e.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/js/app.1264ab147a547ed7f99e.js.map


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/js/app.2852685e610795d005d6.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/js/app.2852685e610795d005d6.js.map


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/js/manifest.fed1de90e0941b3846db.js.map


BIN
src/assets/icon/deleteN.png


BIN
src/assets/icon/ellipsis.png


BIN
src/assets/icon/noteHorn.png


BIN
src/assets/icon/save.png


+ 262 - 0
src/components/pages/note.vue

@@ -0,0 +1,262 @@
+<template>
+  <div class="pb_content" style="background: unset">
+    <div
+      class="pb_content_body"
+      style="
+        background: #fff;
+        padding: 0px 25px;
+        box-sizing: border-box;
+        border-radius: 5px;
+        width: 500px !important;
+        max-width: 500px !important;
+      "
+    >
+      <div class="pb_head">
+        <span>便签</span>
+        <div class="addNote" @click="addNote">添加便签</div>
+      </div>
+      <div class="searchNote">
+        <span style="width: 100%">
+          <el-input placeholder="搜索..." v-model="noteC" clearable> </el-input>
+        </span>
+        <el-button type="primary">查询</el-button>
+      </div>
+      <div class="noteList">
+        <div class="noteBg" v-for="(item, index) in noteList" :key="index">
+          <el-input
+            type="textarea"
+            autosize
+            v-model="item.content"
+            resize="none"
+          >
+          </el-input>
+          <div class="ellipsis" @click="openTc(index)">
+            <img src="../../assets/icon/ellipsis.png" alt="" />
+          </div>
+          <div class="noteHorn">
+            <img src="../../assets/icon/noteHorn.png" alt="" />
+          </div>
+          <div class="tc" v-if="isNone == index + 1">
+            <div class="first" @click="saveNote(item.nid, item.content)">
+              <div class="save">
+                <img src="../../assets/icon/save.png" alt="" />
+              </div>
+              <div>保存笔记</div>
+            </div>
+            <div class="first" @click="deleteNote(item.nid)">
+              <div class="delete">
+                <img src="../../assets/icon/deleteN.png" alt="" />
+              </div>
+              <div>删除笔记</div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="noneDiv" @click="isNone = 0" v-if="isNone != 0"></div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      tableHeight: "500px",
+      page: 1,
+      total: 0,
+      formLabelWidth: "100px",
+      userid: this.$route.query.userid,
+      noteC: "",
+      noteContent: "",
+      noteList: [],
+      isNone: 0,
+    };
+  },
+  methods: {
+    openTc(i) {
+      this.isNone = i + 1;
+    },
+    getNote() {
+      let params = {
+        uid: this.userid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectNote", params)
+        .then((res) => {
+          this.noteList = res.data[0];
+        })
+        .catch((err) => {
+          this.isLoading = false;
+          console.error(err);
+        });
+    },
+    addNote() {
+      let params = {
+        uid: this.userid,
+        c: "",
+      };
+      this.ajax
+        .get(this.$store.state.api + "insertNote", params)
+        .then((res) => {
+          this.$message({
+            message: "新增成功",
+            type: "success",
+          });
+          this.getNote();
+        })
+        .catch((err) => {
+          this.$message.error("新增失败");
+          console.error(err);
+        });
+    },
+    saveNote(nid, c) {
+      let params = {
+        nid: nid,
+        c: c,
+      };
+      this.ajax
+        .get(this.$store.state.api + "updateNote", params)
+        .then((res) => {
+          this.$message({
+            message: "修改成功",
+            type: "success",
+          });
+          this.getNote();
+        })
+        .catch((err) => {
+          this.$message.error("修改失败");
+          console.error(err);
+        });
+    },
+    deleteNote(nid) {
+      let params = {
+        nid: nid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "deleteNote", params)
+        .then((res) => {
+          this.$message({
+            message: "删除成功",
+            type: "success",
+          });
+          this.getNote();
+        })
+        .catch((err) => {
+          this.$message.error("删除失败");
+          console.error(err);
+        });
+    },
+  },
+  created() {
+    this.getNote();
+  },
+};
+</script>
+
+<style scoped>
+.pb_head {
+  display: flex;
+  justify-content: space-between;
+}
+
+.pb_head {
+  margin: 0 !important;
+  width: 100% !important;
+  border-bottom: 1px solid #ebebeb;
+  padding: 10px 0;
+}
+.addNote {
+  background: #458bdf;
+  color: #fff;
+  font-size: 16px;
+  width: 110px;
+  text-align: center;
+  line-height: 40px;
+  height: 40px;
+  border-radius: 5px;
+  cursor: pointer;
+}
+.searchNote {
+  display: flex;
+  margin: 20px 0;
+}
+.searchNote >>> .el-input__inner {
+  background: #f1f1f1;
+}
+.searchNote >>> .el-button--primary {
+  margin-left: 20px;
+  background-color: #2268bc !important;
+}
+.noteList {
+  padding: 5px 0;
+}
+.noteBg {
+  background: #fff7d1;
+  min-height: 100px;
+  position: relative;
+  border-radius: 5px;
+  margin-bottom: 15px;
+}
+.noteHorn {
+  width: 1rem;
+  position: absolute;
+  bottom: -5px;
+  right: 0;
+}
+.ellipsis {
+  width: 2rem;
+  position: absolute;
+  top: 5px;
+  right: 20px;
+  cursor: pointer;
+  z-index: 99;
+}
+.noteHorn > img,
+.ellipsis > img,
+.save > img,
+.delete > img {
+  width: 100%;
+  height: 100%;
+}
+.noteBg >>> .el-textarea__inner {
+  background: transparent;
+  border: none;
+  min-height: 100px !important;
+  padding-top: 10px;
+}
+.tc {
+  position: absolute;
+  top: 30px;
+  width: 110px;
+  background: #fffffb;
+  right: -35px;
+  box-shadow: 1px 2px 4px 0px #e8e8e8;
+  z-index: 99;
+}
+.first {
+  display: flex;
+  flex-direction: row;
+  justify-content: center;
+  align-items: center;
+  height: 40px;
+  cursor: pointer;
+}
+.save,
+.delete {
+  width: 1.5rem;
+}
+.noneDiv {
+  width: 500px;
+  min-height: 1000px;
+  background: transparent;
+  position: absolute;
+  top: 0;
+  left: 50%;
+  transform: translate(-50%, 0);
+  z-index: 9;
+}
+.first > div:nth-child(2) {
+  margin-left: 5px;
+  margin-top: -5px;
+}
+</style>

+ 114 - 106
src/router/index.js

@@ -14,113 +14,121 @@ import login from '@/components/login'
 import ask from '@/components/pages/ask'
 import addCourse from '@/components/pages/addCourse'
 import library from '@/components/pages/library'
+import note from '@/components/pages/note'
 
 Vue.use(Router).use(ElementUI)
 
 export default new Router({
-  routes: [
-    {
-      path: '/class',
-      name: 'class',
-      component: classA,
-      meta: {
-        requireAuth: ''
-      }
-    },
-    // {
-    //   path: '/',
-    //   redirect: '/course',
-    // },
-    {
-      path: '/course',
-      component: course,
-      meta: {
-        requireAuth: '' // 是否需要判断是否登录,这里是需要判断
-      }
-    },
-    {
-      path: '/course/courseDetail',
-      component: courseDetail,
-      meta: {
-        requireAuth: '' // 是否需要判断是否登录,这里是需要判断
-      }
-    },
-    {
-      path: '/course/addCourse',
-      component: addCourse,
-      meta: {
-        requireAuth: '' // 是否需要判断是否登录,这里是需要判断
-      }
-    },
-    {
-      path: '/data',
-      name: 'data',
-      component: data,
-      meta: {
-        requireAuth: '' // 是否需要判断是否登录,这里是需要判断
-      }
-    }, {
-      path: '/notice',
-      name: 'notice',
-      component: notice,
-      meta: {
-        requireAuth: '' // 是否需要判断是否登录,这里是需要判断
-      }
-    },
-    {
-      path: '/student',
-      name: 'student',
-      component: student,
-      meta: {
-        requireAuth: '' // 是否需要判断是否登录,这里是需要判断
-      }
-    },
-    {
-      path: '/ask',
-      name: 'ask',
-      component: ask,
-      meta: {
-        requireAuth: '' // 是否需要判断是否登录,这里是需要判断
-      }
-    },
-    {
-      path: '/ask/askList',
-      name: 'askList',
-      component: () => import('@/components/pages/askList'),
-      meta: {
-      }
-    },
-    {
-      path: '/works',
-      name: 'works',
-      component: works,
-      meta: {
-        requireAuth: '' // 是否需要判断是否登录,这里是需要判断
-      }
-    },
-    {
-      path: '/worksDetail',
-      name: 'worksDetail',
-      component: worksDetail,
-      meta: {
-        requireAuth: '' // 是否需要判断是否登录,这里是需要判断
-      }
-    },
-    {
-      path: '/library',
-      name: 'library',
-      component: library,
-      meta: {
-        requireAuth: '' // 是否需要判断是否登录,这里是需要判断
-      }
-    },
-    {
-      path: '/login',
-      name: 'login',
-      component: login,
-      meta: {
-        requireAuth: '' // 不需要鉴权
-      }
-    }
-  ]
-})
+    routes: [{
+            path: '/class',
+            name: 'class',
+            component: classA,
+            meta: {
+                requireAuth: ''
+            }
+        },
+        // {
+        //   path: '/',
+        //   redirect: '/course',
+        // },
+        {
+            path: '/course',
+            component: course,
+            meta: {
+                requireAuth: '' // 是否需要判断是否登录,这里是需要判断
+            }
+        },
+        {
+            path: '/course/courseDetail',
+            component: courseDetail,
+            meta: {
+                requireAuth: '' // 是否需要判断是否登录,这里是需要判断
+            }
+        },
+        {
+            path: '/course/addCourse',
+            component: addCourse,
+            meta: {
+                requireAuth: '' // 是否需要判断是否登录,这里是需要判断
+            }
+        },
+        {
+            path: '/data',
+            name: 'data',
+            component: data,
+            meta: {
+                requireAuth: '' // 是否需要判断是否登录,这里是需要判断
+            }
+        }, {
+            path: '/notice',
+            name: 'notice',
+            component: notice,
+            meta: {
+                requireAuth: '' // 是否需要判断是否登录,这里是需要判断
+            }
+        },
+        {
+            path: '/student',
+            name: 'student',
+            component: student,
+            meta: {
+                requireAuth: '' // 是否需要判断是否登录,这里是需要判断
+            }
+        },
+        {
+            path: '/ask',
+            name: 'ask',
+            component: ask,
+            meta: {
+                requireAuth: '' // 是否需要判断是否登录,这里是需要判断
+            }
+        },
+        {
+            path: '/ask/askList',
+            name: 'askList',
+            component: () =>
+                import ('@/components/pages/askList'),
+            meta: {}
+        },
+        {
+            path: '/works',
+            name: 'works',
+            component: works,
+            meta: {
+                requireAuth: '' // 是否需要判断是否登录,这里是需要判断
+            }
+        },
+        {
+            path: '/worksDetail',
+            name: 'worksDetail',
+            component: worksDetail,
+            meta: {
+                requireAuth: '' // 是否需要判断是否登录,这里是需要判断
+            }
+        },
+        {
+            path: '/library',
+            name: 'library',
+            component: library,
+            meta: {
+                requireAuth: '' // 是否需要判断是否登录,这里是需要判断
+            }
+        },
+        {
+            path: '/login',
+            name: 'login',
+            component: login,
+            meta: {
+                requireAuth: '' // 不需要鉴权
+            }
+        },
+        {
+            path: '/note',
+            name: 'note',
+            component: note,
+            meta: {
+                requireAuth: '' // 不需要鉴权
+            }
+        }
+    ]
+})

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels