Prechádzať zdrojové kódy

Merge branch 'master' of https://git.cocorobo.cn/jack/EvenManage

zengyicheng 2 rokov pred
rodič
commit
54012864a2

+ 60 - 37
src/App.vue

@@ -2,11 +2,7 @@
   <div id="app" :class="{}">
     <div class="app_head">
       <div class="logo" @click="goTo('/course')"></div>
-      <span
-        style="margin-left: 10px; color: #fff; font-weight: 600"
-        @click="goTo('/course')"
-        >广东省案例征集</span
-      >
+      <span style="margin-left: 10px; color: #fff; font-weight: 600" @click="goTo('/course')">广东省案例征集</span>
       <div class="user_head" v-if="this.$store.state.isLogin">
         <!-- <div class="noticeBox">
           <i class="noticeI" @click="goTo('/works')"></i>
@@ -15,7 +11,7 @@
           }}</span>
         </div> -->
         <span class="user_name">{{
-          this.$store.state.userInfo ? this.$store.state.userInfo.name : "用户"
+            this.$store.state.userInfo ? this.$store.state.userInfo.name : "用户"
         }}</span>
         <div @click="exit">
           <i class="exitI"></i>
@@ -23,31 +19,21 @@
         </div>
       </div>
     </div>
-    <div
-      style="width: 100%; height: 100%"
-      :class="{
-        ggheight: true,
-      }"
-    >
+    <div style="width: 100%; height: 100%" :class="{
+      ggheight: true,
+    }">
       <!-- main 内容 -->
       <keep-alive v-if="$route.meta.keepAlive">
         <!-- 这里是会被缓存的视图组件 -->
-        <router-view
-          v-if="$route.meta.keepAlive"
-          :class="{ pb_body: isShowNav }"
-        />
+        <router-view v-if="$route.meta.keepAlive" :class="{ pb_body: isShowNav }" />
       </keep-alive>
       <!-- 这里是不被缓存的视图组件 -->
-      <router-view
-        v-if="!$route.meta.keepAlive"
-        :class="{ pb_body: isShowNav }"
-      />
+      <router-view v-if="!$route.meta.keepAlive" :class="{ pb_body: isShowNav }" />
 
       <!-- 底部导航 -->
       <footer-nav
-        v-if="isShowNav && $store.state.userInfo.type == 2"
-        :luyou="this.$store.state.luyou"
-      ></footer-nav>
+        v-if="isShowNav && ($store.state.userInfo.type == 2 || $store.state.userInfo.type == 3 || $store.state.userInfo.type == 4)"
+        :nav="nav" :luyou="this.$store.state.luyou"></footer-nav>
     </div>
   </div>
 </template>
@@ -59,8 +45,10 @@ export default {
   name: "App",
   data() {
     return {
-      isShowNav: true, // 是否显示导航 Tab
-      navTabs: ["/anliList"], // 导航
+      isShowNav: false, // 是否显示导航 Tab
+      navTabs: ["/anliList", '/user', '/score', '/data', '/notice'], // 导航
+      navTabs2: ["/anliList", '/score', '/data', '/notice'], // 导航
+      nav: [],
     };
   },
   components: {
@@ -79,6 +67,7 @@ export default {
         this.$store.commit("update", ["isLogin", true]);
         // var info = JSON.parse(window.sessionStorage.getItem("userInfo"));
         this.$store.commit("update", ["userInfo", userInfo]);
+        this.routerP();
       } else {
         this.$store.commit("update", ["isLogin", false]);
         Message({
@@ -92,21 +81,31 @@ export default {
       }
     },
     routerP() {
-      const { navTabs } = this.$data;
+      const { navTabs, navTabs2 } = this.$data;
+      const { userInfo } = this.$store.state;
       let router_path = this.$route.path;
       console.log(router_path);
-      if (router_path != "/login") {
+      if (router_path != "/login" && !userInfo.type) {
         this.isLogin();
+        return;
       }
       var a = 0;
-      for (var i = 0; i < navTabs.length; i++) {
-        if (router_path == navTabs[i]) {
-          this.isShowNav = true;
+      if (userInfo.type == 2 || userInfo.type == 4) {
+        if(navTabs.indexOf(router_path) != -1){
           a = 1;
-          break;
+          this.isShowNav = true
         }
+        this.nav = navTabs
+      } else if (userInfo.type == 3) {
+        if(navTabs2.indexOf(router_path) != -1){
+          a = 1;
+          this.isShowNav = true
+        }
+        this.nav = navTabs
       }
+
       if (a == 0) {
+        this.nav = []
         this.isShowNav = false;
       }
     },
@@ -128,18 +127,27 @@ export default {
   },
   watch: {
     $route(to, from) {
-      const { navTabs } = this.$data;
+      const { navTabs, navTabs2 } = this.$data;
+      const { userInfo } = this.$store.state;
       const toPath = to.path;
       const fromName = from.name;
+
       var a = 0;
-      for (var i = 0; i < navTabs.length; i++) {
-        if (toPath == navTabs[i]) {
-          this.isShowNav = true;
+      if (userInfo.type == 2 || userInfo.type == 4) {
+        if(navTabs.indexOf(toPath) != -1){
+          a = 1;
+          this.isShowNav = true
+        }
+        this.nav = navTabs
+      } else if (userInfo.type == 3) {
+        if(navTabs2.indexOf(toPath) != -1){
           a = 1;
-          break;
+          this.isShowNav = true
         }
+        this.nav = navTabs2
       }
       if (a == 0) {
+        this.nav = []
         this.isShowNav = false;
       }
     },
@@ -155,10 +163,12 @@ export default {
   margin: 0;
   padding: 0;
 }
+
 body {
   font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
     "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
 }
+
 #app {
   height: 100%;
   width: 100%;
@@ -185,6 +195,7 @@ body {
   align-items: center;
   min-width: 1000px;
 }
+
 .logo {
   height: 60px;
   width: 60px;
@@ -192,6 +203,7 @@ body {
   background-size: 100% 100%;
   margin-left: 20px;
 }
+
 .pb_body {
   margin-left: 220px;
   width: calc(100% - 240px) !important;
@@ -199,7 +211,7 @@ body {
   min-width: 750px;
   display: inline-block;
   /* height: calc(100% - 100px); */
-  min-height: 750px;
+  /* min-height: 750px; */
   background: #fff;
   margin-top: 20px;
   border-radius: 5px;
@@ -220,15 +232,18 @@ body {
   padding: 10px 5px;
   border-bottom: 1px solid #eee;
 }
+
 .pb_content {
   /* height: 100%; */
 }
+
 .pb_content_body {
   width: 94%;
   margin: 10px auto;
   /* overflow: auto;
 	  height: calc(100% - 120px); */
 }
+
 .user_head {
   display: flex;
   align-items: center;
@@ -237,15 +252,18 @@ body {
   font-size: 18px;
   font-weight: 600;
 }
+
 .user_head .user_name {
   color: #fff;
   margin-right: 10px;
 }
+
 .user_head div {
   display: flex;
   align-items: center;
   cursor: pointer;
 }
+
 .user_head .exitI {
   background-image: url("./assets/exit.png");
   width: 25px;
@@ -256,6 +274,7 @@ body {
   vertical-align: text-top;
   background-repeat: no-repeat;
 }
+
 .noticeBox {
   position: relative;
   margin-right: 10px;
@@ -272,6 +291,7 @@ body {
   background-repeat: no-repeat;
   cursor: pointer;
 }
+
 .noticeBox span {
   position: absolute;
   background: red;
@@ -287,12 +307,15 @@ body {
   top: -3px;
   right: -3px;
 }
+
 .stuWidth {
   min-width: 1180px;
 }
+
 .gHeight {
   height: 100%;
 }
+
 html::-webkit-scrollbar {
   /*滚动条整体样式*/
   width: 6px;

+ 1 - 1
src/components/login.vue

@@ -309,7 +309,7 @@ export default {
               _this.$store.commit("update", ["userInfo", _this.userInfo]);
               if (isU == 1) {
                 this.$router.push("/eventCenter");
-              }else if(isU == 2){
+              }else if(isU == 2 || isU == 3 || isU == 4){
                 this.$router.push("/anliList");
               }
               // console.log(_this.$store.state);

+ 77 - 53
src/components/pages/munAdmin/anliList.vue

@@ -1,54 +1,58 @@
 <template>
-  <div style="width: 100%">
-    <el-main>
-      <div class="tou">案例管理</div>
-      <div class="touTop">
-        <div class="touLeft">
-          <div>
-            <div>案例分类</div>
-            <el-select v-model="anliType" clearable>
-              <el-option value="0" label="所有分类"></el-option>
-            </el-select>
-          </div>
-          <div>
-            <div>案例筛选</div>
-            <el-select v-model="anliBox" clearable>
-              <el-option value="0" label="全部"></el-option>
-            </el-select>
-          </div>
+  <div class="pb_content">
+    <div class="pb_head">
+      <div>
+        <span>案例管理</span>
+      </div>
+    </div>
+    <div class="touTop">
+      <div class="touLeft">
+        <div>
+          <div>案例分类</div>
+          <el-select v-model="anliType" clearable>
+            <el-option value="0" label="所有分类"></el-option>
+          </el-select>
         </div>
-        <div class="touRight">
-          <div></div>
-          <div><el-button>分配案例</el-button></div>
+        <div>
+          <div>案例筛选</div>
+          <el-select v-model="anliBox" clearable>
+            <el-option value="0" label="全部"></el-option>
+          </el-select>
         </div>
       </div>
-      <div class="anliBox">
-        <div v-for="(a, aIndex) in tableData" :key="aIndex" class="anLi">
-          <div class="anliImg"><img :src="a.info.cover[0].url" alt="" /></div>
-          <div class="anliBot">
-            <div class="detailBox">
-              <div>{{ a.info.title }}</div>
-              <div>{{ a.time }}</div>
+      <div class="touRight">
+        <div></div>
+        <div>
+          <el-button>分配案例</el-button>
+        </div>
+      </div>
+    </div>
+    <div class="anliBox">
+      <div v-for="(a, aIndex) in tableData" :key="aIndex" class="anLi">
+        <div class="anliImg"><img :src="a.info.cover[0].url" alt="" /></div>
+        <div class="anliBot">
+          <div class="detailBox">
+            <div>{{ a.info.title }}</div>
+            <div>{{ a.time }}</div>
+          </div>
+          <div class="anliButton">
+            <div>
+              <el-button>查看</el-button>
             </div>
-            <div class="anliButton">
-              <div><el-button>查看</el-button></div>
-              <div><el-button>评分</el-button></div>
-              <div><el-button>推荐</el-button></div>
+            <div>
+              <el-button>评分</el-button>
+            </div>
+            <div>
+              <el-button>推荐</el-button>
             </div>
           </div>
         </div>
       </div>
-    </el-main>
+    </div>
     <div class="student_page">
-      <el-pagination
-        background
-        layout="prev, pager, next"
-        :page-size="10"
-        :total="total"
-        v-if="page && tableData.length"
-        style="padding-bottom: 20px"
-        @current-change="handleCurrentChange"
-      ></el-pagination>
+      <el-pagination background layout="prev, pager, next" :page-size="10" :total="total"
+        v-if="page && tableData.length" style="padding-bottom: 20px" @current-change="handleCurrentChange">
+      </el-pagination>
     </div>
   </div>
 </template>
@@ -106,8 +110,9 @@ export default {
 </style>
 
 <style scoped>
-.disUoloadSty >>> .el-upload--picture-card {
-  display: none; /* 上传按钮隐藏 */
+.disUoloadSty>>>.el-upload--picture-card {
+  display: none;
+  /* 上传按钮隐藏 */
 }
 
 .tou {
@@ -115,68 +120,83 @@ export default {
   height: 50px;
   font-size: 30px;
 }
+
 .touTop {
-  margin-top: 15px;
+  margin: 15px auto;
   display: flex;
   flex-direction: row;
   flex-wrap: nowrap;
   align-items: center;
   justify-content: space-between;
+  width: 95%;
 }
+
 .touLeft {
   display: flex;
   flex-direction: row;
   flex-wrap: nowrap;
   align-items: center;
 }
-.touLeft > div {
+
+.touLeft>div {
   display: flex;
   flex-direction: row;
   flex-wrap: nowrap;
   align-items: center;
 }
-.touLeft > div > div {
+
+.touLeft>div>div {
   margin-right: 10px;
 }
-.touRight > div:nth-child(2) > .el-button {
+
+.touRight>div:nth-child(2)>.el-button {
   background: #2268bd;
   color: #fff;
 }
+
 .student_page {
   width: 95%;
   margin: 0 auto;
 }
+
 .anliBox {
   display: flex;
   flex-direction: row;
   flex-wrap: wrap;
   align-items: center;
-  margin-top: 25px;
+  margin: 25px auto 0;
+  width: 95%;
 }
+
 .anLi {
   width: 280px;
   margin-right: 20px;
   box-shadow: 3px 1px 15px 3px #f0f0f2;
 }
+
 .anliImg {
   width: 100%;
   height: 170px;
 }
-.anliImg > img {
+
+.anliImg>img {
   width: 100%;
   height: 100%;
 }
+
 .anliBot {
   background: #fff;
   border: 1px solid #f5f5f5;
   padding: 5px 0 10px 0;
   box-sizing: border-box;
 }
+
 .detailBox {
   padding: 0 0 0 10px;
   box-sizing: border-box;
 }
-.detailBox > div:nth-child(1) {
+
+.detailBox>div:nth-child(1) {
   font-size: 20px;
   width: 250px;
   white-space: nowrap;
@@ -184,11 +204,13 @@ export default {
   text-overflow: ellipsis;
   word-break: break-word;
 }
-.detailBox > div:nth-child(2) {
+
+.detailBox>div:nth-child(2) {
   color: #999;
   margin-top: 5px;
   font-size: 14px;
 }
+
 .anliButton {
   display: flex;
   flex-direction: row;
@@ -197,10 +219,12 @@ export default {
   justify-content: center;
   padding: 10px 0 0 0;
 }
-.anliButton > div {
+
+.anliButton>div {
   margin-right: 5px;
 }
-.anliButton > div > .el-button {
+
+.anliButton>div>.el-button {
   background: #409efe;
   color: #fff;
   width: 80px;

+ 356 - 0
src/components/pages/munAdmin/data.vue

@@ -0,0 +1,356 @@
+<template>
+  <div class="pb_content">
+    <div class="pb_head">
+      <div>
+        <span>我的资料</span>
+      </div>
+    </div>
+    <div class="pb_content_body" style="position: relative; width: 100%">
+      <div style="width: 100%; margin: 0px auto">
+        <!-- <div class="data_nav">
+          <span @click="type = 1" :class="{ active: type == 1 }">我的资料</span>
+          <span @click="type = 2" :class="{ active: type == 2 }">修改密码</span>
+        </div> -->
+        <el-form v-if="type == 1" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px"
+          class="demo-ruleForm">
+          <!-- <el-form-item label="姓名" prop="teacherName">
+            <el-input
+              v-model="ruleForm.name"
+              style="width: 250px"
+              placeholder="请输入名字"
+            ></el-input>
+          </el-form-item> -->
+          <el-form-item label="姓名" prop="name">
+            <el-input v-model="ruleForm.name" style="width: 300px" placeholder="请输入昵称"></el-input>
+          </el-form-item>
+          <el-form-item label="手机号码" prop="phone">
+            <el-input v-model="ruleForm.phone" style="width: 300px" placeholder="请输入手机号码"></el-input>
+          </el-form-item>
+          <el-form-item label="账号">
+            <el-input v-model="ruleForm.username" disabled style="width: 300px" placeholder="请输入昵称"></el-input>
+          </el-form-item>
+          <el-form-item label="地区" prop="sBySchool">
+            <el-input v-model="ruleForm.region" disabled style="width: 300px" placeholder=""></el-input>
+          </el-form-item>
+          <el-form-item label="学校" prop="sBySchool">
+            <el-input v-model="ruleForm.school" disabled style="width: 300px" placeholder=""></el-input>
+            <!-- <el-select v-model="ruleForm.sBySchool" clearable placeholder="请选择学校" disabled>
+              <el-option :value="ruleForm.sBySchool"> </el-option>
+            </el-select> -->
+          </el-form-item>
+          <el-form-item label="个人简介" prop="intro">
+            <el-input v-model="ruleForm.remark" type="textarea" :rows="5" resize="none" placeholder="想说点什么..."
+              style="width: 300px"></el-input>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" @click="submitForm('ruleForm')">修改</el-button>
+          </el-form-item>
+        </el-form>
+        <div class="password" v-if="type == 2">
+          <div class="input_box">
+            <span>原密码</span>
+            <el-input class="input" v-model="opassword" placeholder="请输入原密码"></el-input>
+          </div>
+          <div class="input_box">
+            <span>修改密码</span>
+            <el-input class="input" v-model="password" placeholder="请输入修改密码"></el-input>
+          </div>
+          <div class="input_box">
+            <span></span>
+            <div class="input">
+              <el-button type="primary" @click="updatePassword">修改</el-button>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    var validatePass = (rule, value, callback) => {
+      if (value == "") {
+        return;
+      }
+      var reg =
+        /^[A-Za-z\d]+([-_.][A-Za-z\d]+)*@([A-Za-z\d]+[-.])+[A-Za-z\d]{2,4}$/;
+      if (!reg.test(value)) {
+        callback(new Error("请输入正确的邮箱"));
+      } else {
+        callback();
+      }
+    };
+    var validatePass1 = (rule, value, callback) => {
+      var reg = /^1\d{10}$/;
+      if (!reg.test(value)) {
+        callback(new Error("请输入正确的手机号码"));
+      } else {
+        callback();
+      }
+    };
+    return {
+      type: 1,
+      ruleForm: {
+        name: "",
+        type: "",
+        region: "",
+        phone: "",
+        school: "",
+        remark: "",
+      },
+      opassword: "",
+      password: "",
+      userinfo: "",
+      schoolJuri: [],
+      orgJuri: [],
+      userid: this.$store.state.userInfo.userid,
+      rules: {
+        pass: [{ validator: validatePass, trigger: "blur" }],
+        name: [{ required: true, message: "请输入你的名字", trigger: "blur" }],
+        mail: [
+          {
+            required: true,
+            message: "请输入你的邮箱",
+            trigger: "blur",
+          },
+        ],
+        phone: [
+          // { required: true, message: "请输入你的手机号码", trigger: "blur" },
+
+          {
+            required: true,
+            validator: validatePass1,
+            trigger: "blur",
+          },
+        ],
+      },
+    };
+  },
+  methods: {
+    submitForm(formName) {
+      this.$refs[formName];
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          let params = [
+            {
+              username: this.ruleForm.name,
+              phone: this.ruleForm.phone,
+              intro: this.ruleForm.remark,
+              userid: this.userid,
+
+            },
+          ];
+          this.ajax
+            .post(this.$store.state.api + "updateRaceUser", params)
+            .then((res) => {
+              this.$message({
+                message: "修改成功",
+                type: "success",
+              });
+              this.getUser();
+            })
+            .catch((err) => {
+              this.$message.error("修改失败");
+              console.error(err);
+            });
+        } else {
+          return false;
+        }
+      });
+
+    },
+    getUser() {
+      let params = { uid: this.userid };
+      this.ajax
+        .get(this.$store.state.api + "getRaceUser", params)
+        .then((res) => {
+          this.userinfo = res.data[0][0];
+          // this.$cookies.set("userInfo", this.userinfo, -1);
+          this.$cookies.set("teacherInfo", res.data[0][0], -1);
+          this.$store.commit("update", ["userInfo", this.userinfo]);
+          console.log(res.data[0][0]);
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+    getDetail() {
+      let params = { uid: this.userid };
+      this.ajax
+        .get(this.$store.state.api + "getRaceUser", params)
+        .then((res) => {
+          if (res.data[0][0]) {
+            this.ruleForm = res.data[0][0];
+            console.log(res.data[0][0]);
+          }
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+    updatePassword() {
+      if (this.password.length < 6) {
+        this.$message.error("密码长度不少于6位");
+        return;
+      }
+      let params = [
+        {
+          userid: this.userid,
+          opassword: this.opassword,
+          password: this.password,
+        },
+      ];
+      this.ajax
+        .post(this.$store.state.api + "updatePassword", params)
+        .then((res) => {
+          if (res.data[0] && res.data[0].success == 1) {
+            this.$message.success("修改成功");
+            this.opassword = "";
+            this.password = "";
+          } else {
+            this.$message.error("修改失败,原密码不正确");
+          }
+        })
+        .catch((err) => {
+          this.$message.error("修改失败");
+          console.error(err);
+        });
+    },
+  },
+  created() {
+    this.getDetail();
+  },
+};
+</script>
+
+<style scoped>
+.formTop {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  margin: 20px 0;
+}
+
+.formTop>>>.el-form {
+  margin: 0 auto;
+}
+
+.tx {
+  width: 100px;
+  /* margin-right: 15px; */
+  min-width: 50px;
+  min-height: 50px;
+}
+
+.emailImg {
+  width: 30px;
+  margin-right: 5px;
+}
+
+.tx>img,
+.emailImg>img {
+  width: 100%;
+  height: 100%;
+}
+
+.right {
+  display: flex;
+  flex-direction: column;
+  align-items: flex-start;
+}
+
+.name {
+  color: #3c88dd;
+  font-size: 20px;
+  margin-bottom: 10px;
+}
+
+.email {
+  color: #acacac;
+  font-size: 18px;
+}
+
+.rightBottom {
+  display: flex;
+  align-items: center;
+}
+
+.demo-ruleForm {
+  width: 100%;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: flex-start;
+  background: #fff;
+}
+
+/* .demo-ruleForm >>> .el-form-item__label:before {
+  content: "*";
+  color: #f56c6c;
+  margin-right: 4px;
+}
+.demo-ruleForm >>> .el-form-item__label:nth-child(3) {
+  content: "";
+} */
+.demo-ruleForm>>>.el-form-item__content {
+  width: 300px;
+}
+
+.data_nav {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  width: 100%;
+  margin: 10px 0;
+}
+
+.data_nav span {
+  box-sizing: border-box;
+  padding: 8px 5px;
+  cursor: pointer;
+  color: #444444;
+  height: 35px;
+}
+
+.data_nav span+span {
+  margin-left: 10px;
+}
+
+.data_nav .active {
+  color: #4aa3ff;
+  border-bottom: 2px solid #409eff;
+}
+
+.password {
+  height: 511px;
+  padding: 50px 0 0 0;
+  box-sizing: border-box;
+  /* display: flex;
+  justify-content: center;
+  align-items: center;
+  flex-direction: column; */
+}
+
+.input_box {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.input_box span {
+  width: 100px;
+  font-size: 14px;
+  text-align: right;
+  padding: 0 12px 0 0;
+}
+
+.input_box .input {
+  width: 300px;
+}
+
+.input_box+.input_box {
+  margin-top: 20px;
+}
+</style>

+ 20 - 0
src/components/pages/munAdmin/notice.vue

@@ -0,0 +1,20 @@
+<template>
+    <div class="pb_content">
+    <div class="pb_head">
+      <div>
+        <span>通知公告</span>
+      </div>
+    </div>
+    
+  </div>
+</template>
+
+<script>
+export default {
+
+}
+</script>
+
+<style>
+
+</style>

+ 20 - 0
src/components/pages/munAdmin/score.vue

@@ -0,0 +1,20 @@
+<template>
+      <div class="pb_content">
+    <div class="pb_head">
+      <div>
+        <span>评分管理</span>
+      </div>
+    </div>
+      
+    </div>
+  </template>
+  
+  <script>
+  export default {
+  
+  }
+  </script>
+  
+  <style scoped>
+  
+  </style>

+ 20 - 0
src/components/pages/munAdmin/user.vue

@@ -0,0 +1,20 @@
+<template>
+  <div class="pb_content">
+    <div class="pb_head">
+      <div>
+        <span>账号管理</span>
+      </div>
+    </div>
+
+  </div>
+</template>
+
+<script>
+export default {
+
+}
+</script>
+
+<style scoped>
+
+</style>

+ 90 - 77
src/components/register.vue

@@ -4,10 +4,7 @@
       <div style="width: 100%; margin: 0px auto">
         <div class="formTop">
           <div class="tx">
-            <img
-              :src="ruleForm.headportrait ? ruleForm.headportrait : tx"
-              alt
-            />
+            <img :src="ruleForm.headportrait ? ruleForm.headportrait : tx" alt />
           </div>
         </div>
         <div class="reBox">
@@ -22,26 +19,15 @@
                 style="width: 300px"
                 placeholder="请输入市区"
               ></el-input> -->
-              <el-cascader
-                size="large"
-                style="width: 300px"
-                clearable
-                :options="region"
-                v-model="selectedOptions"
-                @change="handleChange"
-                placeholder="请选择市区"
-              >
+              <el-cascader size="large" style="width: 300px" clearable :options="region" v-model="selectedOptions"
+                @change="handleChange" placeholder="请选择市区">
               </el-cascader>
             </div>
           </div>
           <div class="first">
             <div>详细地址</div>
             <div>
-              <el-input
-                v-model="ruleForm.address"
-                style="width: 300px"
-                placeholder="请输入详细地址"
-              ></el-input>
+              <el-input v-model="ruleForm.address" style="width: 300px" placeholder="请输入详细地址"></el-input>
             </div>
           </div>
           <div class="first">
@@ -50,19 +36,10 @@
               学校
             </div>
             <div>
-              <el-select
-                v-model="ruleForm.school"
-                filterable
-                clearable
-                @clear="clearSchoolList"
-                placeholder="请输入学校"
-              >
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
+              <el-select v-model="ruleForm.school" filterable clearable @clear="clearSchoolList" :allow-create="false"
+                @focus="remoteMethodclick" remote placeholder="请输入学校" :remote-method="remoteMethod" :loading="loading"
+                no-data-text="暂未查询到此学校">
+                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
             </div>
@@ -73,11 +50,7 @@
               姓名
             </div>
             <div>
-              <el-input
-                v-model="ruleForm.name"
-                style="width: 300px"
-                placeholder="请输入姓名"
-              ></el-input>
+              <el-input v-model="ruleForm.name" style="width: 300px" placeholder="请输入姓名"></el-input>
             </div>
           </div>
           <div class="first">
@@ -86,11 +59,7 @@
               联系方式
             </div>
             <div>
-              <el-input
-                v-model="ruleForm.phone"
-                style="width: 300px"
-                placeholder="请输入手机号或邮箱"
-              ></el-input>
+              <el-input v-model="ruleForm.phone" style="width: 300px" placeholder="请输入手机号或邮箱"></el-input>
             </div>
           </div>
           <div class="isButton">
@@ -100,16 +69,8 @@
         </div>
       </div>
     </div>
-    <el-dialog
-      :show-close="false"
-      title="提交成功"
-      :visible.sync="dialogVisibleSuccess"
-      :append-to-body="true"
-      width="600px"
-      :close-on-click-modal="false"
-      :before-close="handleClose"
-      class="dialog_diy"
-    >
+    <el-dialog :show-close="false" title="提交成功" :visible.sync="dialogVisibleSuccess" :append-to-body="true"
+      width="600px" :close-on-click-modal="false" :before-close="handleClose" class="dialog_diy">
       <div class="s_box">
         <div class="s_top">
           <span>恭喜您</span>
@@ -128,18 +89,11 @@
         </div>
       </div>
       <span slot="footer" class="dialog-footer">
-        <el-button
-          type="primary"
-          class="tag-read"
-          style="
+        <el-button type="primary" class="tag-read" style="
             background: rgb(112, 183, 79);
             border-color: rgb(112, 183, 79);
             margin-right: 50px;
-          "
-          @click="copy"
-          :data-clipboard-text="copyText"
-          >复制账号</el-button
-        >
+          " @click="copy" :data-clipboard-text="copyText">复制账号</el-button>
         <el-button type="primary" @click="goTo('/login')">返回登陆</el-button>
       </span>
     </el-dialog>
@@ -176,7 +130,7 @@ export default {
       num: "",
       dialogVisibleSuccess: false,
       copyText: "",
-      isloading:false,
+      isloading: false,
     };
   },
   //   mounted() {
@@ -201,6 +155,16 @@ export default {
       }
       this.ruleForm.region = "广东省" + loc;
     },
+    remoteMethodclick() {
+      if (!this.options.length) {
+        var _option = []
+        for (var i = 0; i < 10; i++) {
+          var _a = this.randomNum(0, 10);
+          _option.push(this.list[_a])
+        }
+        this.options = _option
+      }
+    },
     remoteMethod(query) {
       if (query !== "") {
         this.loading = true;
@@ -211,13 +175,21 @@ export default {
           });
         }, 200);
       } else {
-        this.options = [];
+        // this.options = [];
+        var _option = []
+        for (var i = 0; i < 10; i++) {
+          var _a = this.randomNum(0, 10);
+          _option.push(this.list[_a])
+        }
+        this.options = _option
       }
     },
     clearSchoolList() {
-      this.options = [];
+      // var _option = []
+      this.ruleForm.school = ""
     },
     getSchool() {
+      this.isloading = true;
       let params = {
         n: "",
       };
@@ -228,8 +200,16 @@ export default {
           this.list = this.schoolList.map((item) => {
             return { value: item.id, label: item.name };
           });
+          var _option = []
+          for (var i = 0; i < 10; i++) {
+            var _a = this.randomNum(0, this.list.length);
+            _option.push(this.list[_a])
+          }
+          this.options = _option
+          this.isloading = false;
         })
         .catch((err) => {
+          this.isloading = false;
           console.error(err);
         });
     },
@@ -274,6 +254,19 @@ export default {
           console.error(err);
         });
     },
+    randomNum(minNum, maxNum) {
+      switch (arguments.length) {
+        case 1:
+          return parseInt(Math.random() * minNum + 1, 10);
+          break;
+        case 2:
+          return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
+          break;
+        default:
+          return 0;
+          break;
+      }
+    },
     copy() {
       this.copyText = this.num;
       var clipboard = new Clipboard(".tag-read");
@@ -296,32 +289,33 @@ export default {
 </script>
 
 <style scoped>
-.dialog_diy >>> .el-dialog__header {
+.dialog_diy>>>.el-dialog__header {
   background: #3c3c3c !important;
   padding: 15px 20px;
 }
 
-.dialog_diy >>> .el-dialog__title {
+.dialog_diy>>>.el-dialog__title {
   color: #fff;
 }
 
-.dialog_diy >>> .el-dialog__headerbtn {
+.dialog_diy>>>.el-dialog__headerbtn {
   top: 19px;
 }
 
-.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
+.dialog_diy>>>.el-dialog__headerbtn .el-dialog__close {
   color: #fff;
 }
 
-.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
+.dialog_diy>>>.el-dialog__headerbtn .el-dialog__close:hover {
   color: #fff;
 }
 
-.dialog_diy >>> .el-dialog__body,
-.dialog_diy >>> .el-dialog__footer {
+.dialog_diy>>>.el-dialog__body,
+.dialog_diy>>>.el-dialog__footer {
   background: #fafafa;
 }
-.dialog_diy >>> .el-dialog__footer {
+
+.dialog_diy>>>.el-dialog__footer {
   display: flex;
   justify-content: center;
 }
@@ -333,31 +327,37 @@ export default {
   width: 100%;
   height: 100%;
 }
+
 .pb_content_body {
   background: #fff;
   padding: 20px 0;
   width: 500px;
   border-radius: 5px;
 }
+
 .formTop {
   display: flex;
   align-items: center;
   justify-content: center;
   margin: 20px 0;
 }
-.formTop >>> .el-form {
+
+.formTop>>>.el-form {
   margin: 0 auto;
 }
+
 .tx {
   width: 100px;
   /* margin-right: 15px; */
   min-width: 50px;
   min-height: 50px;
 }
-.tx > img {
+
+.tx>img {
   width: 100%;
   height: 100%;
 }
+
 .reBox {
   width: 100%;
   display: flex;
@@ -367,11 +367,13 @@ export default {
   justify-content: center;
   align-items: center;
 }
+
 .first {
   margin: 5px 0;
   width: 300px;
 }
-.first > div:nth-child(1) {
+
+.first>div:nth-child(1) {
   margin-bottom: 5px;
   font-weight: bold;
   display: flex;
@@ -380,17 +382,21 @@ export default {
   justify-content: flex-start;
   align-items: center;
 }
-.first > div:nth-child(2) > .el-select {
+
+.first>div:nth-child(2)>.el-select {
   width: 300px;
 }
+
 .isButton {
   margin-top: 20px;
 }
-.isButton >>> .el-button {
+
+.isButton>>>.el-button {
   background: #5492ff !important;
   color: #fff !important;
   cursor: pointer;
 }
+
 .copyright {
   position: absolute;
   left: 20px;
@@ -411,6 +417,7 @@ export default {
   flex-direction: column;
   font-size: 22px;
 }
+
 .s_top span:nth-child(1) {
   font-size: 26px;
 }
@@ -424,26 +431,32 @@ export default {
 .s_content .title {
   font-size: 18px;
 }
+
 .s_content .content {
   padding: 50px 0;
   display: flex;
   flex-direction: column;
   align-items: center;
 }
-.s_content .content div + div {
+
+.s_content .content div+div {
   margin-top: 20px;
 }
+
 .s_content .content .user {
   font-size: 20px;
   color: rgb(64, 145, 234);
 }
+
 .s_content .content .password {
   font-size: 24px;
   color: rgb(64, 145, 234);
 }
+
 .s_content .tips1 {
   color: rgb(162, 162, 162);
 }
+
 .s_content .tips2 {
   font-size: 18px;
 }

+ 53 - 13
src/components/tools/leftBar.vue

@@ -2,14 +2,8 @@
   <div class="bottom">
     <el-row class="tac">
       <el-col :span="12">
-        <el-menu
-          :default-active="path"
-          background-color="#fff"
-          text-color="#777"
-          active-text-color="#fff"
-          router
-        >
-          <el-menu-item index="/anliList">
+        <el-menu :default-active="path" background-color="#fff" text-color="#777" active-text-color="#fff" router>
+          <el-menu-item index="/anliList" v-if="nav.indexOf('/anliList') != -1">
             <div class="img" v-if="path == '/anliList'">
               <img src="../../assets/icon/course-active.svg" alt="" />
             </div>
@@ -18,6 +12,42 @@
             </div>
             <span>案例管理</span>
           </el-menu-item>
+          <el-menu-item index="/user" v-if="nav.indexOf('/user') != -1">
+            <div class="img" v-if="path == '/user'">
+              <img src="../../assets/icon/user-active.png" alt="" />
+            </div>
+            <div class="img" v-else>
+              <img src="../../assets/icon/user.png" alt="" />
+            </div>
+            <span>账号管理</span>
+          </el-menu-item>
+          <el-menu-item index="/score" v-if="nav.indexOf('/score') != -1">
+            <div class="img" v-if="path == '/score'">
+              <img src="../../assets/icon/works-active.png" alt="" />
+            </div>
+            <div class="img" v-else>
+              <img src="../../assets/icon/works.png" alt="" />
+            </div>
+            <span>评分查看</span>
+          </el-menu-item>
+          <el-menu-item index="/data" v-if="nav.indexOf('/data') != -1">
+            <div class="img" v-if="path == '/data'">
+              <img src="../../assets/icon/data-active.png" alt="" />
+            </div>
+            <div class="img" v-else>
+              <img src="../../assets/icon/data.png" alt="" />
+            </div>
+            <span>我的资料</span>
+          </el-menu-item>
+          <el-menu-item index="/notice" v-if="nav.indexOf('/notice') != -1">
+            <div class="img" v-if="path == '/notice'">
+              <img src="../../assets/icon/notice-active.png" alt="" />
+            </div>
+            <div class="img" v-else>
+              <img src="../../assets/icon/notice.png" alt="" />
+            </div>
+            <span>通知公告</span>
+          </el-menu-item>
         </el-menu>
       </el-col>
     </el-row>
@@ -28,6 +58,7 @@
 export default {
   props: {
     luyou: Number,
+    nav: Array
   },
   data() {
     return {
@@ -64,37 +95,46 @@ export default {
   border-radius: 5px;
   overflow: hidden;
 }
+
 .item {
   margin: 5px 20%;
   float: left;
 }
+
 .item p {
   margin: 0;
   font-size: 15px;
 }
+
 .active {
   color: #108b70;
 }
-.bottom >>> .el-menu-item.is-active {
+
+.bottom>>>.el-menu-item.is-active {
   background: #3d67bc !important;
 }
-.tac >>> .el-col-12 {
+
+.tac>>>.el-col-12 {
   width: 100%;
 }
-.tac >>> .el-menu {
+
+.tac>>>.el-menu {
   border-right: none;
 }
-.tac >>> .el-menu-item {
+
+.tac>>>.el-menu-item {
   display: flex;
   justify-content: center;
   align-items: center;
 }
+
 .img {
   width: 20px;
   padding-right: 5px;
   padding-bottom: 3px;
 }
-.img > img {
+
+.img>img {
   width: 100%;
   height: 100%;
 }

+ 21 - 8
src/components/tools/wangEnduit.vue

@@ -68,25 +68,25 @@ export default {
         "head", //标题
         "bold", //加粗
         "fontSize", //字体大小
-        "fontName", //字体
-        "italic", //斜体
-        "underline", //下划线
-        "strikeThrough", //删除线
+        // "fontName", //字体
+        // "italic", //斜体
+        // "underline", //下划线
+        // "strikeThrough", //删除线
         "indent", //缩进
-        "lineHeight", //行高
+        // "lineHeight", //行高
         // "foreColor",
         // "backColor",
         // "link",
         "list",
-        "todo",
+        // "todo",
         "justify",
-        "quote",
+        // "quote",
         // "emoticon",
         "image",
         // "video",
         "table",
         // "code",
-        "splitLine",
+        // "splitLine",
         "undo",
         "redo",
       ];
@@ -149,6 +149,19 @@ export default {
           }
         }
       };
+      //配置 自定义处理粘贴的文本内容
+      this.editor.config.pasteTextHandle = function (content) {
+        if (content == '' && !content) return ''
+        var str = content
+        str = str.replace(/<xml>[\s\S]*?<\/xml>/ig, '')
+        str = str.replace(/<style>[\s\S]*?<\/style>/ig, '')
+        str = str.replace(/<\/?[^>]*>/g, '')
+        str = str.replace(/[ | ]*\n/g, '\n')
+        str = str.replace(/&nbsp;/ig, '')
+        // console.log('****', content)
+        // console.log('****', str)
+        return str
+      };
       this.editor.config.onchange = (html) => {
         this.info_ = html; // 绑定当前逐渐地值
         this.$emit("change", this.info_); // 将内容同步到父组件中

+ 38 - 2
src/router/index.js

@@ -9,6 +9,10 @@ import addRace from '@/components/pages/race/addRace'
 import anliDetail from '@/components/pages/race/eventCenter/anliDetail'
 import demo from '@/components/pages/demo'
 import anliList from '@/components/pages/munAdmin/anliList'
+import data from '@/components/pages/munAdmin/data'
+import notice from '@/components/pages/munAdmin/notice'
+import score from '@/components/pages/munAdmin/score'
+import user from '@/components/pages/munAdmin/user'
 
 
 Vue.use(Router).use(ElementUI)
@@ -61,9 +65,41 @@ const router = new Router({
         name: 'anliList',
         component: anliList,
         meta: {
-            requireAuth: false // 不需要鉴权
+            requireAuth: true // 不需要鉴权
+        }
+    },
+    {
+        path: '/data',
+        name: 'data',
+        component: data,
+        meta: {
+            requireAuth: true // 不需要鉴权
+        }
+    },
+    {
+        path: '/notice',
+        name: 'notice',
+        component: notice,
+        meta: {
+            requireAuth: true // 不需要鉴权
+        }
+    },
+    {
+        path: '/score',
+        name: 'score',
+        component: score,
+        meta: {
+            requireAuth: true // 不需要鉴权
+        }
+    },
+    {
+        path: '/user',
+        name: 'user',
+        component: user,
+        meta: {
+            requireAuth: true // 不需要鉴权
         }
-    }, ]
+    },]
 })
 
 router.beforeEach((to, from, next) => {