Ver código fonte

1

Signed-off-by: lcw <1324309909@qq.com>
lcw 3 anos atrás
pai
commit
aedf7b2a59

+ 1 - 1
index.html

@@ -4,7 +4,7 @@
 <head>
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width,initial-scale=1.0">
-  <title>尚美乐劳动</title>
+  <title>PBL教师端</title>
   <link rel="shortcut icon" type="image/x-icon" href="static/logo.ico">
   <style>
     @charset "utf-8";

+ 18 - 17
src/App.vue

@@ -3,7 +3,7 @@
     <div class="app_head" :class="{stuWidth:$route.path == '/student'}">
       <div class="logo"></div>
       <span style="margin-left: 10px; color: #fff; font-weight: 600"
-        >劳动教育平台-教师端</span
+        >PBL项目管理平台</span
       >
       <div class="user_head" v-if="this.$store.state.isLogin">
         <div class="noticeBox">
@@ -63,8 +63,9 @@ export default {
         "/student",
         "/works",
         "/course/courseDetail",
-        "/ask",
-        "/ask/askList",
+        // "/course/addCourse",
+        // "/ask",
+        // "/ask/askList",
       ], // 导航
     };
   },
@@ -73,9 +74,9 @@ export default {
   },
   created: function () {
     this.routerP();
-    this.getnCount();
+    // this.getnCount();
     setInterval(() => {
-      this.getnCount();
+      // this.getnCount();
     }, 60000);
   },
   methods: {
@@ -86,7 +87,7 @@ export default {
       });
       var _isLogin = this.$cookies.get("tlogin");
       var userInfo = this.$cookies.get("teacherInfo");
-      if (_isLogin == "1" && userInfo) {
+      // if (_isLogin == "1" && userInfo) {
         loading.close();
         this.$store.commit("update", ["isLogin", true]);
         // var info = JSON.parse(window.sessionStorage.getItem("userInfo"));
@@ -95,17 +96,17 @@ export default {
         if(router_path == "/"){
           this.$router.push("/course");
         }
-      } else {
-        this.$store.commit("update", ["isLogin", false]);
-        Message({
-          message: "未登录,请登录",
-          type: "warning",
-        });
-        setTimeout(() => {
-          loading.close();
-          this.$router.push("/login");
-        }, 2000);
-      }
+      // } else {
+      //   this.$store.commit("update", ["isLogin", false]);
+      //   Message({
+      //     message: "未登录,请登录",
+      //     type: "warning",
+      //   });
+      //   setTimeout(() => {
+      //     loading.close();
+      //     this.$router.push("/login");
+      //   }, 2000);
+      // }
     },
     getnCount() {
       let params = {

BIN
src/assets/icon.png


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
src/assets/icon/class-active.svg


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
src/assets/icon/course-active.svg


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
src/assets/icon/data-active.svg


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
src/assets/icon/new-active.svg


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
src/assets/icon/student-active.svg


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
src/assets/icon/work-active.svg


BIN
src/assets/line.png


BIN
src/assets/logo.png


BIN
src/assets/remove.png


BIN
src/assets/workImg.png


+ 27 - 26
src/components/login.vue

@@ -4,7 +4,7 @@
     <div class="login_box" v-show="islogin">
       <div style="padding: 0px 20px">
         <div class="login_title">
-          <span>劳动教育教师端平台</span>
+          <span>PBL项目式平台</span>
         </div>
         <!-- <div class="userLogin">
           <img src="../assets/username.png" />
@@ -47,14 +47,14 @@
           <el-button type="text" @click="islogin = false">立即注册</el-button>
         </div>
         <div class="login_button">
-          <button @click="findPhone()">登录</button>
+          <button @click="login()">登录</button>
         </div>
       </div>
     </div>
     <div class="login_box" v-show="!islogin">
       <div style="padding: 0px 20px">
         <div class="login_title">
-          <span>劳动教育教师端平台</span>
+          <span>PBL项目平台注册</span>
         </div>
         <!-- <div class="userLogin">
           <img src="../assets/username.png" />
@@ -98,18 +98,20 @@
               style="width: 100%"
             ></el-input>
           </el-form-item>
-          <el-form-item label="选择学校" prop="school">
+          <el-form-item label="角色" prop="school">
             <el-select
               v-model="registerForm.school"
               style="width: 80%"
-              placeholder="请选择学校"
+              placeholder="请选择角色"
             >
-              <el-option
+              <!-- <el-option
                 v-for="item in schoolArray"
                 :key="item.id"
                 :label="item.name"
                 :value="item.id"
-              ></el-option>
+              ></el-option> -->
+              <el-option value="1">老师</el-option>
+              <el-option value="2">学生</el-option>
             </el-select>
           </el-form-item>
         </el-form>
@@ -162,7 +164,7 @@ export default {
         if (!reg.test(_this.registerForm.rphoneNum)) {
           callback(new Error("请输入11位手机号"));
         } else {
-          let params = { phone: _this.registerForm.rphoneNum };
+          let params = { un: _this.registerForm.rphoneNum };
           this.ajax
             .get(this.$store.state.api + "findPhone", params)
             .then((res) => {
@@ -214,7 +216,7 @@ export default {
     };
   },
   created() {
-    this.getOrg();
+    // this.getOrg();
   },
   methods: {
     time() {
@@ -237,11 +239,9 @@ export default {
           if (this.time()) {
             let params = [
               {
-                unname: this.registerForm.rphoneNum,
-                upassword: this.registerForm.repassword,
-                sid: "",
-                type: 1,
-                oid: this.registerForm.school,
+                username: this.registerForm.rphoneNum,
+                userpassword: this.registerForm.repassword,
+                type: this.registerForm.school,
               },
             ];
             this.ajax
@@ -270,7 +270,7 @@ export default {
       });
     },
     findPhone() {
-      let params = { phone: this.phoneNum };
+      let params = { un: this.phoneNum };
       this.ajax
         .get(this.$store.state.api + "findPhone", params)
         .then((res) => {
@@ -300,6 +300,7 @@ export default {
       if (this.time()) {
         var _this = this;
         var isU = _this.isU;
+        this.findPhone();
         if (isU == 1) {
           let params = [
             {
@@ -347,17 +348,17 @@ export default {
       //   sessionStorage.removeItem("key");
     },
     //查询学校
-    getOrg() {
-      this.ajax
-        .get(this.$store.state.api + "getAllOrg", "")
-        .then((res) => {
-          this.schoolArray = res.data[0];
-          console.log(res.data[0]);
-        })
-        .catch((err) => {
-          console.error(err);
-        });
-    },
+    // getOrg() {
+    //   this.ajax
+    //     .get(this.$store.state.api + "getAllOrg", "")
+    //     .then((res) => {
+    //       this.schoolArray = res.data[0];
+    //       console.log(res.data[0]);
+    //     })
+    //     .catch((err) => {
+    //       console.error(err);
+    //     });
+    // },
   },
 };
 </script>

+ 1269 - 0
src/components/pages/addCourse.vue

@@ -0,0 +1,1269 @@
+<template>
+	<div class="pb_content">
+		<!-- <div class="pb_head">
+			<span>我的资料</span>
+		</div> -->
+		<div class="pb_content_body">
+			<div class="left">
+				<div class="tips">请跟随下面的步骤,逐步上传你的课程或房间內容:</div>
+				<div class="info_steps">
+					<span class="" :class="steps > 0 ? 'steps_active' : ''"
+						>{{ this.steps > 1 ? "√" : "1" }} </span
+					><span>填写项目基本信息</span>
+				</div>
+				<div class="info_solid"></div>
+				<div class="info_steps">
+					<span class="" :class="steps > 1 ? 'steps_active' : ''"
+						>{{ this.steps > 2 ? "√" : "2" }} </span
+					><span>填写项目阶段性</span>
+				</div>
+				<div class="info_solid"></div>
+				<div class="info_steps">
+					<span class="" :class="steps > 2 ? 'steps_active' : ''"
+						>{{ this.steps > 4 ? "√" : "3" }} </span
+					><span>上传课程内容</span>
+				</div>
+				<div class="info_solid"></div>
+				<div class="info_steps">
+					<span class="" :class="steps > 3 ? 'steps_active' : ''"
+						>{{ this.steps > 4 ? "√" : "4" }} </span
+					><span>上传成功</span>
+				</div>
+			</div>
+			<div class="right">
+				<div v-if="this.steps == 1">
+					<div class="basic_box">
+						<h3 class="info_title">项目内容填写</h3>
+						<div class="big_box">
+							<div class="left_first">
+								<div>
+									<div class="bInfo_title">
+										<span style="color: red">*</span>项目名称
+									</div>
+									<div>
+										<input
+											type="text"
+											placeholder="项目名称"
+											class="binfo_input"
+											v-model="courseName"
+										/>
+									</div>
+								</div>
+								<div style="margin-top: 30px">
+									<div class="bInfo_title">
+										<span style="color: red">*</span>简要描述
+									</div>
+									<div>
+										<textarea
+											rows="4"
+											placeholder="简要描述"
+											class="binfo_input"
+											cols=""
+											v-model="courseText"
+										></textarea>
+									</div>
+								</div>
+								<el-switch
+									v-model="isTeacherSee"
+									active-text="允许给其他老师查看"
+									style="margin: 40px 0 0 25px"
+								>
+								</el-switch>
+							</div>
+							<div class="right_first">
+								<div>
+									<div style="flex: 0.5 1 0%; margin: 0 20px 0 0">
+										<div class="bInfo_title">
+											课程封面
+											<div class="chapter_beizhu">PNG,GIF,JPEG</div>
+										</div>
+										<div class="chapter_uploadBox1">
+											<div
+												class="chapter_add"
+												v-if="unitJson[unitIndex].cover.length == 0"
+												@click="addImg($event)"
+											>
+												<div class="chapter_add_l">+</div>
+												<div class="chapter_add_r">添加文件</div>
+												<input
+													type="file"
+													accept="image/png,image/gif,image/jpeg"
+													style="display: none"
+													@change="beforeUpload1"
+												/>
+											</div>
+											<div
+												v-if="unitJson[unitIndex].cover.length != 0"
+												class="chapter_upload_move"
+												style="height: 100%"
+											>
+												<div class="chapter_upload_t" style="width: 100%"></div>
+												<div class="chapter_upload_o" style="top: 7px">
+													<div class="chapter_upload_l">
+														<div class="chapter_upload_l_i"></div>
+													</div>
+													<div class="chapter_upload_ic">
+														<div class="chapter_upload_ic_l">
+															<div
+																style="
+																	backgroundposition: -5px -131px;
+																	display: block;
+																"
+															></div>
+														</div>
+														<div
+															class="chapter_upload_ic_r"
+															style="cursor: pointer"
+														>
+															<div></div>
+														</div>
+													</div>
+													<div class="chapter_upload_n">
+														{unitJson[unitIndex].cover[0].substr(unitJson[unitIndex].
+														[0].lastIndexOf("/")).slice(1)}
+													</div>
+												</div>
+											</div>
+										</div>
+									</div>
+									<div style="flex: 0.5 1 0%;margin-top: 30px;">
+										<div class="bInfo_title">
+											<span style="color: red">*</span>选择项目成员
+										</div>
+									</div>
+								</div>
+							</div>
+						</div>
+						<div class="line"></div>
+					</div>
+				</div>
+				<div v-if="this.steps == 2">
+					<div class="basic_box">
+						<h3 class="info_title">上传课程阶段性内容:项目阶段填写</h3>
+						<div class="cru_selectBox">
+							<div
+								v-for="(item, index) in unitJson"
+								:key="item.id"
+								class="cru_select"
+								:class="unitIndex == index ? 'cru_selected' : 'cru_select'"
+								@click="unitSet(index)"
+							>
+								第{{ index + 1 }}单元
+							</div>
+							<img
+								src="../../assets/line.png"
+								class="cru_line"
+								:style="{
+									left: offsetLetfPx + 'px',
+								}"
+							/>
+						</div>
+						<div class="chapter_box" style="max-height: 500px">
+							<div>
+								<div class="chapter_contentbox">
+									<div>第{{ unitIndex + 1 }}单元</div>
+									<div>
+										<input
+											type="text"
+											placeholder="单元标题"
+											class="binfo_input"
+											v-model="unitJson[unitIndex].dyName"
+										/>
+									</div>
+									<div
+										v-if="unitJson.length > 1"
+										@click="deleteUnit(unitIndex)"
+									></div>
+								</div>
+								<div class="time">
+									<div class="small_title">
+										开始时间<span style="color: red">*</span>
+									</div>
+									<el-date-picker
+										v-model="unitJson[unitIndex].startTime"
+										type="date"
+										placeholder="选择日期"
+										style="margin-left: 5px"
+									>
+									</el-date-picker>
+									<div class="small_title" style="margin-left: 40px">
+										结束时间<span style="color: red">*</span>
+									</div>
+									<el-date-picker
+										v-model="unitJson[unitIndex].endTime"
+										type="date"
+										placeholder="选择日期"
+										style="margin-left: 5px"
+									>
+									</el-date-picker>
+								</div>
+								<el-switch
+									v-model="unitJson[unitIndex].isTalk"
+									active-text="是否开启评价"
+									style="margin: 40px 0 0 25px"
+								>
+								</el-switch>
+							</div>
+						</div>
+					</div>
+					<div class="chapter_btnbox" @click="addunit">
+						<div class="icon_add">
+							<i></i>
+							<i></i>
+						</div>
+						<div class="chapter_btn_w">新增阶段</div>
+					</div>
+				</div>
+				<div v-if="this.steps == 3">
+					<div class="basic_box">
+						<h3 class="info_title">项目内容填写</h3>
+						<div>
+							<div class="bInfo_title">
+								<span style="color: red">*</span>项目名称
+							</div>
+							<div>
+								<input
+									type="text"
+									placeholder="项目名称"
+									class="binfo_input"
+									v-model="courseName"
+								/>
+							</div>
+						</div>
+						<div>
+							<div class="bInfo_title">
+								<span style="color: red">*</span>简要描述
+							</div>
+							<div>
+								<textarea
+									rows="4"
+									placeholder="简要描述"
+									class="binfo_input"
+									cols=""
+									v-model="courseText"
+								></textarea>
+							</div>
+						</div>
+						<div style="display: flex">
+							<div style="flex: 0.5 1 0%; margin: 0 20px 0 0">
+								<div class="bInfo_title">
+									课程封面
+									<div class="chapter_beizhu">PNG,GIF,JPEG</div>
+								</div>
+								<div class="chapter_uploadBox1">
+									<div
+										class="chapter_add"
+										v-if="unitJson[unitIndex].cover.length == 0"
+										@click="addImg($event)"
+									>
+										<div class="chapter_add_l">+</div>
+										<div class="chapter_add_r">添加文件</div>
+										<input
+											type="file"
+											accept="image/png,image/gif,image/jpeg"
+											style="display: none"
+											@change="beforeUpload1"
+										/>
+									</div>
+								</div>
+							</div>
+							<div style="flex: 0.5 1 0%">
+								<div class="bInfo_title">
+									课程预览视频
+									<div class="chapter_beizhu">MP4,M4V,MOV,AVI</div>
+								</div>
+								<div class="chapter_uploadBox1">
+									<div
+										class="chapter_add"
+										v-if="unitJson[unitIndex].cover.length == 0"
+										@click="addImg($event)"
+									>
+										<div class="chapter_add_l">+</div>
+										<div class="chapter_add_r">添加文件</div>
+										<input
+											type="file"
+											accept="image/png,image/gif,image/jpeg"
+											style="display: none"
+											@change="beforeUpload1"
+										/>
+									</div>
+								</div>
+							</div>
+						</div>
+						<el-switch
+							v-model="isTeacherSee"
+							active-text="允许给其他老师查看"
+							style="margin: 40px 0 0 25px"
+						>
+						</el-switch>
+						<div class="line"></div>
+						<div class="cru_selectBox">
+							<div
+								v-for="(item, index) in unitJson"
+								:key="item.id"
+								class="cru_select"
+								:class="unitIndex == index ? 'cru_selected' : 'cru_select'"
+								@click="unitSet(index)"
+							>
+								第{{ index + 1 }}单元
+							</div>
+							<img
+								src="../../assets/line.png"
+								class="cru_line"
+								:style="{
+									left: offsetLetfPx + 'px',
+								}"
+							/>
+						</div>
+						<div class="chapter_box" style="max-height: 500px">
+							<div>
+								<div class="chapter_contentbox">
+									<div>第{{ unitIndex + 1 }}单元</div>
+									<div>
+										<input
+											type="text"
+											placeholder="单元标题"
+											class="binfo_input"
+											v-model="unitJson[unitIndex].dyName"
+										/>
+									</div>
+									<div
+										v-if="unitJson.length > 1"
+										@click="deleteUnit(unitIndex)"
+									></div>
+								</div>
+								<div class="time">
+									<div class="small_title">
+										开始时间<span style="color: red">*</span>
+									</div>
+									<el-date-picker
+										v-model="unitJson[unitIndex].startTime"
+										type="date"
+										placeholder="选择日期"
+										style="margin-left: 5px"
+									>
+									</el-date-picker>
+									<div class="small_title" style="margin-left: 40px">
+										结束时间<span style="color: red">*</span>
+									</div>
+									<el-date-picker
+										v-model="unitJson[unitIndex].endTime"
+										type="date"
+										placeholder="选择日期"
+										style="margin-left: 5px"
+									>
+									</el-date-picker>
+									<el-switch
+										v-model="unitJson[unitIndex].isTalk"
+										active-text="是否开启评价"
+										style="margin: 10px 0px 0px 30px"
+									>
+									</el-switch>
+								</div>
+							</div>
+						</div>
+						<div class="line"></div>
+						<div class="basic_box" style="margin: 45px 0 0 15px; min-height: 0">
+							<h3 class="info_title">添加教学文档</h3>
+							<el-upload
+								action="#"
+								list-type="picture-card"
+								v-loading="uploadLoading1"
+								:class="{ disUoloadSty: noneBtnImg }"
+								:http-request="beforeUpload1"
+								ref="upload1"
+								:on-preview="handlePictureCardPreview"
+								:on-remove="handle_remove1"
+								:show-file-list="true"
+								:file-list="fileList1"
+								accept="image/*"
+								:limit="1"
+								class="imgLeft"
+							>
+								<i class="el-icon-plus"></i>
+							</el-upload>
+						</div>
+						<div class="line"></div>
+						<div class="basic_box" style="margin: 45px 0 0 15px; min-height: 0">
+							<h3 class="info_title">附件添加</h3>
+							<div class="add_info_box">
+								<button class="info_btn" @click="add($event, unitIndex, j)">
+									添加视频
+									<input
+										type="file"
+										accept="video/mp4,video/quicktime,video/x-msvideo"
+										style="display: none"
+										@change="upload($event, unitIndex, j)"
+									/>
+								</button>
+								<button class="info_btn" @click="add($event, unitIndex, j)">
+									添加附件
+									<input
+										type="file"
+										accept="application/pdf,.ppt,.pptx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"
+										style="display: none"
+										@change="upload($event, unitIndex, j)"
+									/>
+								</button>
+							</div>
+							<div>
+								<div class="add_chapters_box"></div>
+							</div>
+						</div>
+						<div class="line"></div>
+						<div class="basic_box" style="margin: 45px 0 0 15px; min-height: 0">
+							<h3 class="info_title">作业设置</h3>
+							<div class="homework_box">
+								<div
+									class="course_homework"
+									v-for="(item, index) in itemCount"
+									:key="index"
+								>
+									<el-image
+										style="width: 35px; height: 50px"
+										:src="require('../../assets/homework.png')"
+										fit="contain"
+									></el-image>
+									<el-input
+										placeholder="请输入作业名称"
+										v-model="homeworkList[index].name"
+									></el-input>
+								</div>
+								<div>
+									<el-button size="small" type="primary" @click="addHomeworkBox"
+										>点击添加</el-button
+									>
+								</div>
+							</div>
+						</div>
+					</div>
+				</div>
+				<div class="info_btnBox">
+					<button
+						class="info_btn"
+						v-if="this.steps == 1"
+						@click="goTo('/course')"
+					>
+						返回课程
+					</button>
+					<button
+						class="info_btn"
+						v-if="this.steps > 1 && this.steps != 5"
+						@click="lastSteps"
+					>
+						{{ this.steps == 3 ? "返回修改" : "上一步" }}
+					</button>
+					<button class="info_btn" v-if="this.steps < 5" @click="nextSteps">
+						{{ this.steps == 3 ? "确认上传" : "下一步" }}
+					</button>
+				</div>
+			</div>
+		</div>
+	</div>
+</template>
+
+<script>
+	import "../../common/aws-sdk-2.235.1.min.js";
+	import $ from "jquery";
+
+	export default {
+		data() {
+			return {
+				steps: 1,
+				courseName: "",
+				courseText: "",
+				itemCount: 1,
+				uploadLoading1: false,
+				homeworkList: [{ name: "" }],
+				noneBtnImg: false,
+				unitIndex: 0,
+				isTeacherSee: false,
+				unitJson: [
+					{
+						dyName: "", //单元标题
+						startTime: "", //开始时间
+						endTime: "", //结束时间
+						isTalk: false, //是否开启评价
+						cover: [], //课程封面
+						chapterInfo: [
+							{
+								isread: false,
+								chapterid: this.guid(),
+								title: "",
+								courseName: "",
+								chapterData: [],
+								video: [],
+								testData: [],
+								pData: [],
+							},
+						],
+					},
+				],
+				fileList1: [],
+			};
+		},
+		computed: {
+			offsetLetfPx: function () {
+				//addnum可以直接在模板语法里面用,相当于data内的值
+				return (
+					$(".cru_select")[this.unitIndex] &&
+					$(".cru_select")[this.unitIndex].offsetLeft
+				);
+			},
+		},
+		methods: {
+			imgChange(file, fileList) {
+				var _tmp = this.fileList1;
+				this.noneBtnImg = _tmp.length >= 1;
+			},
+			goTo(path) {
+				this.$router.push(path);
+			},
+			guid() {
+				var _num,
+					i,
+					_guid = "";
+				for (i = 0; i < 32; i++) {
+					_guid += Math.floor(Math.random() * 16).toString(16); //随机0  - 16 的数字 转变为16进制的字符串
+					_num = Math.floor((i - 7) / 4); //计算 (i-7)除4
+					if (_num > -1 && _num < 4 && i == 7 + 4 * _num) {
+						//会使guid中间加 "-"   形式为xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+						_guid += "-";
+					}
+				}
+				return _guid;
+			},
+			lastSteps() {
+				this.steps--;
+			},
+			nextSteps() {
+				var a = 1;
+				if (this.steps == 1) {
+					if (this.courseName != "" && this.courseText != "") {
+						this.steps++;
+					} else {
+						this.$message.error("请输入项目名称及简要描述");
+					}
+				} else if (this.steps == 2) {
+					if (
+						this.unitJson[this.unitIndex].dyName != "" &&
+						this.unitJson[this.unitIndex].startTime != "" &&
+						this.unitJson[this.unitIndex].endTime != ""
+					) {
+						this.steps++;
+					} else {
+						this.$message.error("请输入单元标题及开始和结束时间");
+					}
+				}
+			},
+			unitSet(i) {
+				this.unitIndex = i;
+			},
+			time() {
+				if (!this.now) {
+					this.now = new Date().getTime();
+					return true;
+				} else {
+					let time = new Date().getTime();
+					if (time - this.now > 3000) {
+						this.now = time;
+						return true;
+					} else {
+						return false;
+					}
+				}
+			},
+			deleteUnit(i) {
+				var _this = this;
+				if (_this.time()) {
+					_this
+						.$confirm("确定删除此单元吗?", "提示", {
+							confirmButtonText: "确定",
+							cancelButtonText: "取消",
+							type: "warning",
+						})
+						.then(() => {
+							_this.unitJson.splice(i, 1);
+							var a = 0;
+							if (_this.unitIndex > 0) {
+								a = _this.unitIndex - 1;
+							}
+
+							_this.$message.success("删除成功");
+						})
+						.catch(() => {
+							return;
+						});
+				}
+			},
+
+			handlePictureCardPreview(file) {
+				this.dialogImageUrl = file.url;
+			},
+			handle_remove1(file, fileList) {
+				var _tmp = this.fileList1;
+				for (var i = 0, len = _tmp.length; i < len; i++) {
+					if (_tmp[i].uid == file.uid) {
+						_tmp.splice(i, 1);
+						break;
+					}
+					this.fileList1 = _tmp;
+				}
+				this.noneBtnImg = _tmp.length >= 1;
+			},
+			addImg(e) {
+				var el = e.currentTarget;
+				el.getElementsByTagName("input")[0].click();
+			},
+			beforeUpload1(event) {
+				this.uploadLoading1 = true;
+				var file = event.target.files[0];
+				var credentials = {
+					accessKeyId: "AKIATLPEDU37QV5CHLMH",
+					secretAccessKey: "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",
+				}; //秘钥形式的登录上传
+				window.AWS.config.update(credentials);
+				window.AWS.config.region = "cn-northwest-1"; //设置区域
+
+				var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
+				var _this = this;
+
+				if (file) {
+					var params = {
+						Key:
+							file.name.split(".")[0] +
+							new Date().getTime() +
+							"." +
+							file.name.split(".")[1],
+						ContentType: file.type,
+						Body: file,
+						"Access-Control-Allow-Credentials": "*",
+						ACL: "public-read",
+					}; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
+					var options = {
+						partSize: 2048 * 1024 * 1024,
+						queueSize: 2,
+						leavePartsOnError: true,
+					};
+					bucket
+						.upload(params, options)
+						.on("httpUploadProgress", function (evt) {
+							//这里可以写进度条
+							// console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
+						})
+						.send(function (err, data) {
+							_this.uploadLoading1 = false;
+							if (err) {
+								var a = _this.$refs.upload1.uploadFiles;
+								a.splice(a.length - 1, a.length);
+								_this.$message.error("上传失败");
+							} else {
+								//上传成功处理
+								_this.fileList1.push({
+									name: file.name,
+									url: data.Location,
+									uid: file.uid,
+								});
+								_this.imgChange();
+								console.log(data.Location);
+							}
+						});
+				}
+			},
+			addunit() {
+				this.unitJson.push({
+					dyName: "",
+					startTime: "",
+					endTime: "",
+					isTalk: false,
+					cover: [], //课程封面
+					chapterInfo: [
+						{
+							isread: false,
+							chapterid: this.guid(),
+							title: "",
+							courseName: "",
+							chapterData: [],
+							video: [],
+							testData: [],
+							pData: [],
+						},
+					],
+				});
+			},
+			add(e, i) {
+				var el = e.currentTarget;
+				el.getElementsByTagName("input")[0].click();
+			},
+
+			upload(e, i, j) {
+				var input = e.currentTarget;
+				if (input.files.length !== 0) {
+					// create bucket instance
+					var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
+					var file = input.files[0];
+					var _this = this;
+
+					if (file) {
+						var _uploadid = window.localStorage["uploadid"] || "";
+						var params = {
+							Key: file.name,
+							ContentType: file.type,
+							Body: file,
+							"Access-Control-Allow-Credentials": "*",
+							ACL: "public-read",
+						}; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
+						var options = {
+							partSize: 2048 * 1024 * 1024,
+							queueSize: 2,
+							leavePartsOnError: true,
+						};
+						bucket
+							.upload(params, options)
+							.on("httpUploadProgress", function (evt) {})
+							.send(function (err, data) {
+								if (err) {
+									_this.$message.error("上传失败");
+								} else {
+									_this.$message.error("上传成功");
+									this.unitJson[i].chapterInfo[j].chapterData.push({
+										src: data.Location, //视频地址
+										status: false,
+										minutiaName: data.Key, //视频名字
+										typeName: "视频",
+										checkout: false,
+									});
+								}
+							});
+						input.value = "";
+					}
+				}
+			},
+
+			addHomeworkBox() {
+				this.homeworkList.push({ name: "" });
+				this.itemCount++;
+			},
+		},
+		created() {},
+	};
+</script>
+
+<style scoped>
+	.left {
+		border-right: 1px solid rgb(60, 94, 143);
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		min-height: 600px;
+		width: 385px;
+		height: 80%;
+	}
+
+	.tips {
+		color: rgb(128, 128, 128);
+		font-size: 12px;
+		width: 270px;
+		margin: 40px;
+	}
+
+	.pb_content {
+		background: #fff;
+		height: 100%;
+	}
+
+	.pb_content_body {
+		display: flex;
+		margin: 0 auto !important;
+		width: 100% !important;
+		height: 100%;
+	}
+
+	.info_solid {
+		width: 270px;
+		height: 30px;
+		border-left: 1px solid #bdbdbd;
+		margin: 10px 0px 10px 30px;
+	}
+
+	.info_steps {
+		width: 270px;
+		font-size: 0.875rem;
+		display: flex;
+		align-items: center;
+	}
+
+	.info_steps span:nth-child(1) {
+		width: 30px;
+		height: 30px;
+		background: rgba(0, 0, 0, 0.38);
+		display: block;
+		color: #fff;
+		border-radius: 40px;
+		text-align: center;
+		line-height: 30px;
+	}
+
+	.steps_active {
+		background: #3d67bc !important;
+	}
+
+	.info_steps span:nth-child(2) {
+		margin-left: 5px;
+	}
+
+	.right {
+		height: 100%;
+		width: calc(100% - 385px);
+		overflow: auto;
+	}
+
+	.basic_box {
+		width: 80%;
+		min-height: 455px;
+		margin: 50px auto;
+		position: relative;
+	}
+
+	.info_title {
+		font-size: 1.5em;
+	}
+
+	.bInfo_title {
+		font-size: 16px;
+		font-weight: bold;
+		text-align: left;
+		margin-top: 20px;
+		margin-bottom: 10px;
+	}
+
+	.small_title {
+		font-size: 14px;
+		line-height: 40px;
+	}
+
+	.binfo_input {
+		font: inherit;
+		color: currentColor;
+		width: 100%;
+		margin: 0;
+		padding: 15px 14px;
+		display: block;
+		min-width: 0;
+		outline: none;
+		box-sizing: content-box;
+		background: none;
+		-webkit-tap-highlight-color: transparent;
+		border: 1px solid rgba(0, 0, 0, 0.23);
+		border-radius: 4px;
+		box-sizing: border-box;
+	}
+
+	.binfo_input:focus-visible {
+		border: 1px solid rgba(61, 103, 188);
+	}
+
+	.chapter_beizhu {
+		font-size: 12px;
+		font-weight: bold;
+		float: right;
+		color: rgb(128, 128, 128);
+		margin-top: 5px;
+	}
+
+	.chapter_uploadBox1 {
+		text-align: left;
+		background-color: rgb(242, 242, 242);
+		width: 100%;
+		height: 67px;
+		padding: 0px 15px;
+		border-radius: 8px;
+		overflow: hidden;
+		font-size: 16px;
+		box-sizing: border-box;
+		position: relative;
+	}
+
+	.chapter_add {
+		width: 100%;
+		height: 32px;
+		margin-top: 15px;
+		cursor: pointer;
+	}
+
+	.chapter_add_l {
+		margin-left: 5px;
+		width: 30px;
+		height: 30px;
+		float: left;
+		border: 1px solid #aaa;
+		color: #aaa;
+		border-radius: 50%;
+		font-size: 25px;
+		text-align: center;
+	}
+
+	.chapter_add_r {
+		font-size: 18px;
+		height: 40px;
+		line-height: 30px;
+		text-indent: 10px;
+		color: #aaa;
+	}
+
+	.chapter_add_r span {
+		font-size: 12px;
+		color: rgb(204, 204, 204);
+	}
+
+	.chapter_add_input {
+		display: none;
+	}
+
+	.line {
+		width: 100%;
+		border-top: 1px solid;
+		margin-top: 60px;
+	}
+
+	.info_btnBox {
+		width: 100%;
+		display: flex;
+		justify-content: space-evenly;
+		margin: 60px 0;
+	}
+
+	.info_btn {
+		color: #fff;
+		background-color: #3d67bc;
+		padding: 8px 24px;
+		font-size: 0.9375rem;
+		box-shadow: 0px 1px 5px 0px rgb(0 0 0 / 20%), 0px 2px 2px 0px rgb(0 0 0 / 14%),
+			0px 3px 1px -2px rgb(0 0 0 / 12%);
+		min-width: 64px;
+		font-weight: 500;
+		border-radius: 4px;
+		box-sizing: border-box;
+		border: none;
+		cursor: pointer;
+	}
+
+	.info_btn:hover {
+		background-color: #1f4082 !important;
+	}
+
+	.cru_selectBox {
+		display: flex;
+		margin: 30px 0 10px;
+		flex-wrap: nowrap;
+		width: 100%;
+		white-space: nowrap;
+		overflow: auto;
+		position: relative;
+		height: 47px;
+	}
+
+	.cru_selectBox::-webkit-scrollbar {
+		/*滚动条整体样式*/
+		width: 6px;
+		/*高宽分别对应横竖滚动条的尺寸*/
+		height: 6px;
+	}
+
+	/*定义滚动条轨道 内阴影+圆角*/
+	.cru_selectBox::-webkit-scrollbar-track {
+		border-radius: 10px;
+		background-color: #eee;
+	}
+
+	/*定义滑块 内阴影+圆角*/
+	.cru_selectBox::-webkit-scrollbar-thumb {
+		border-radius: 10px;
+		-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
+		background-color: rgba(0, 0, 0, 0.1);
+	}
+
+	.cru_line {
+		position: absolute;
+		bottom: 0px;
+		transition: all 0.5s;
+		left: 0px;
+		width: 125px;
+		margin-left: -25px;
+	}
+
+	.cru_select {
+		font-size: 21px;
+		margin-right: 37px;
+		margin-left: 5px;
+		cursor: pointer;
+		color: #a6a6a6;
+	}
+
+	.cru_selected {
+		color: #0b7fc2 !important;
+	}
+
+	.chapter_box {
+		max-height: 300px;
+		overflow: auto;
+	}
+
+	.chapter_contentbox {
+		display: flex;
+		align-items: center;
+		margin-top: 15px;
+	}
+
+	.chapter_contentbox div:nth-child(1) {
+		width: 150px;
+		margin: 0px;
+		font-size: 2em;
+		color: black;
+		display: block;
+		white-space: nowrap;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		font-weight: 600;
+	}
+
+	.chapter_contentbox div:nth-child(2) {
+		width: 100%;
+	}
+
+	.chapter_contentbox div:nth-child(3) {
+		background-image: url(../../assets/remove.png);
+		cursor: pointer;
+		opacity: 0.5;
+		width: 40px;
+		height: 50px;
+		background-repeat: no-repeat;
+		background-position: 5px 10px;
+	}
+
+	.binfo_input {
+		font: inherit;
+		color: currentColor;
+		width: 100%;
+		margin: 0;
+		padding: 15px 14px;
+		display: block;
+		min-width: 0;
+		outline: none;
+		box-sizing: content-box;
+		background: none;
+		-webkit-tap-highlight-color: transparent;
+		border: 1px solid rgba(0, 0, 0, 0.23);
+		border-radius: 4px;
+		box-sizing: border-box;
+	}
+
+	.binfo_input:focus-visible {
+		border: 1px solid rgba(61, 103, 188);
+	}
+
+	.time {
+		display: flex;
+		margin-top: 35px;
+	}
+
+	.chapter_btnbox {
+		width: 160px;
+		border-radius: 5px;
+		border: 2px dashed gray;
+		display: flex;
+		padding: 8px 50px;
+		align-items: center;
+		justify-content: center;
+		margin: 30px auto 0;
+		cursor: pointer;
+	}
+
+	.icon_add {
+		position: relative;
+		width: 24px;
+		padding-top: 20px;
+		border-radius: 100%;
+		border-width: 2px;
+		border-style: solid;
+		border-color: gray;
+	}
+
+	.icon_add i:nth-child(1) {
+		position: absolute;
+		left: 50%;
+		top: 50%;
+		height: 60%;
+		transform: translate(-50%, -50%);
+		border-width: 1px;
+		border-style: solid;
+		border-color: inherit;
+	}
+
+	.icon_add i:nth-child(2) {
+		position: absolute;
+		top: 50%;
+		left: 50%;
+		width: 60%;
+		transform: translate(-50%, -50%);
+		border-width: 1px;
+		border-style: solid;
+		border-color: inherit;
+	}
+
+	.chapter_btn_w {
+		font-size: 0.9375rem;
+		font-weight: bold;
+		color: gray;
+		margin-left: 20px;
+	}
+
+	.disUoloadSty >>> .el-upload--picture-card {
+		display: none; /* 上传按钮隐藏 */
+	}
+
+	.imgLeft {
+		margin: 15px 0;
+	}
+
+	.add_info_box {
+		margin: 20px 0;
+	}
+
+	.add_info_box button {
+		margin: 0 10px 10px 0;
+	}
+
+	.add_chapters_box {
+		text-align: left;
+		background-color: rgb(242, 242, 242);
+		width: 100%;
+		height: 240px;
+		padding: 0px 15px;
+		border-radius: 8px;
+		overflow: auto;
+		font-size: 16px;
+		box-sizing: border-box;
+		position: relative;
+		padding: 0 10px 5px;
+	}
+
+	.homework_box {
+		display: flex;
+		align-items: center;
+		flex-wrap: wrap;
+	}
+
+	.course_homework {
+		width: 130px;
+		display: flex;
+		justify-content: center;
+		flex-direction: column;
+		align-items: center;
+		margin: 0 10px 10px 0;
+	}
+
+	.chapter_upload_move {
+		position: relative;
+		background-color: #fff;
+		position: absolute;
+		width: 100%;
+		top: 0px;
+		left: 0px;
+		border: 1px solid #eee;
+		border-radius: 5px;
+		transition: width 2s;
+		-moz-transition: width 2s;
+		-webkit-transition: width 2s;
+		-o-transition: width 2s;
+	}
+
+	.chapter_upload_t {
+		background-color: #e3f3ff;
+		position: absolute;
+		width: 0%;
+		height: 100%;
+		top: 0px;
+		left: 0px;
+	}
+
+	.chapter_upload_o {
+		width: 100%;
+		height: 100%;
+		position: relative;
+		z-index: 1;
+	}
+
+	.chapter_upload_l {
+		width: 50px;
+		height: 50px;
+		border-right: 1px solid #eee;
+		float: left;
+	}
+
+	.chapter_upload_l_i {
+		background-image: url("../../assets/icon.png");
+		background-position: 3px -165px;
+		width: 30px;
+		height: 30px;
+		margin: 10px auto 0 auto;
+	}
+
+	.chapter_upload_ic {
+		height: 30px;
+		float: right;
+	}
+
+	.chapter_upload_ic_l {
+		width: 50px;
+		height: 50px;
+		float: left;
+		border-right: 1px solid #eee;
+	}
+
+	.chapter_upload_ic_l div {
+		width: 30px;
+		height: 35px;
+		background: url("../../assets/icon.png");
+		margin: 10px auto 0 auto;
+	}
+
+	.chapter_upload_ic_r {
+		width: 40px;
+		height: 40px;
+		float: left;
+		margin-left: 5px;
+	}
+	.chapter_upload_ic_r div {
+		width: 30px;
+		height: 30px;
+		background-image: url("../../assets/icon.png");
+		background-position: -39px -163px;
+		margin: 10px auto 0 auto;
+	}
+
+	.chapter_upload_n {
+		height: 50px;
+		line-height: 50px;
+		text-indent: 10px;
+		text-decoration: none;
+		text-overflow: ellipsis;
+		white-space: nowrap;
+		overflow: hidden;
+	}
+
+	.big_box {
+		display: flex;
+	}
+
+	.left_first,
+	.right_first {
+		display: flex;
+		flex-direction: column;
+		width: 50%;
+	}
+
+	.right_first {
+		margin-left: 60px;
+	}
+</style>

+ 279 - 304
src/components/pages/class.vue

@@ -1,313 +1,288 @@
 <template>
-  <div class="pb_content">
-    <div class="pb_head">
-      <span>班级管理</span>
-    </div>
-    <div class="pb_content_body">
-      <div class="student_head">
-        <div class="student_search">
-          <span>
-            <el-input
-              placeholder="请输入班级名称"
-              v-model="sClassName"
-              clearable
-            >
-            </el-input>
-          </span>
-          <el-button type="primary" @click="searchClass">查询</el-button>
-        </div>
-        <div class="student_button">
-          <el-button type="primary" @click="dialogVisible = true"
-            >添加班级</el-button
-          >
-        </div>
-      </div>
-      <div class="student_table">
-        <el-table
-          ref="table"
-          :data="tableData"
-          border
-          :height="tableHeight"
-          :fit="true"
-          v-loading="isLoading"
-          style="width: 100%; height: 60%"
-          :header-cell-style="{ background: '#f1f1f1' }"
-          :row-class-name="tableRowClassName"
-        >
-          <el-table-column
-            prop="name"
-            label="班级名称"
-            min-width="80%"
-            align="center"
-          >
-          </el-table-column>
-          <el-table-column label="操作" min-width="20%">
-            <template slot-scope="scope">
-              <el-button
-                @click="deleteClass(scope.row)"
-                type="text"
-                size="small"
-                >删除</el-button
-              >
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <div class="student_page">
-        <el-pagination
-          background
-          layout="prev, pager, next"
-          :page-size="10"
-          :total="total"
-          @current-change="handleCurrentChange"
-        >
-        </el-pagination>
-      </div>
-    </div>
-    <el-dialog
-      title="添加学生"
-      :visible.sync="dialogVisible"
-      :append-to-body="true"
-      width="25%"
-      :before-close="handleClose"
-      class="dialog_diy"
-    >
-      <el-form>
-        <el-form-item label="班级名称" :label-width="formLabelWidth">
-          <el-input
-            v-model="className"
-            auto-complete="off"
-            placeholder="请输入班级..."
-          ></el-input>
-        </el-form-item>
-      </el-form>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="insertClass">确 定</el-button>
-      </span>
-    </el-dialog>
-  </div>
+	<div class="pb_content">
+		<div class="pb_head">
+			<span>班级管理</span>
+		</div>
+		<div class="pb_content_body">
+			<div class="student_head">
+				<div class="student_search">
+					<span>
+						<el-input
+							placeholder="请输入班级名称"
+							v-model="sClassName"
+							clearable
+						>
+						</el-input>
+					</span>
+					<el-button type="primary" @click="searchClass">查询</el-button>
+				</div>
+				<div class="student_button">
+					<el-button type="primary" @click="dialogVisible = true"
+						>添加班级</el-button
+					>
+				</div>
+			</div>
+			<div class="student_table">
+				<el-table
+					ref="table"
+					:data="tableData"
+					border
+					:height="tableHeight"
+					:fit="true"
+					v-loading="isLoading"
+					style="width: 100%; height: 60%"
+					:header-cell-style="{ background: '#f1f1f1' }"
+					:row-class-name="tableRowClassName"
+				>
+					<el-table-column
+						prop="name"
+						label="班级名称"
+						min-width="80%"
+						align="center"
+					>
+					</el-table-column>
+					<el-table-column label="操作" min-width="20%">
+						<template slot-scope="scope">
+							<el-button
+								type="primary"
+								size="small"
+								@click="deleteClass(scope.row.id)"
+								>删除</el-button
+							>
+						</template>
+					</el-table-column>
+				</el-table>
+			</div>
+			<div class="student_page">
+				<el-pagination
+					background
+					layout="prev, pager, next"
+					:page-size="10"
+					:total="total"
+					@current-change="handleCurrentChange"
+				>
+				</el-pagination>
+			</div>
+		</div>
+		<el-dialog
+			title="添加学生"
+			:visible.sync="dialogVisible"
+			:append-to-body="true"
+			width="25%"
+			:before-close="handleClose"
+			class="dialog_diy"
+		>
+			<el-form>
+				<el-form-item label="班级名称" :label-width="formLabelWidth">
+					<el-input
+						v-model="className"
+						auto-complete="off"
+						placeholder="请输入班级..."
+					></el-input>
+				</el-form-item>
+			</el-form>
+			<span slot="footer" class="dialog-footer">
+				<el-button @click="dialogVisible = false">取 消</el-button>
+				<el-button type="primary" @click="insertClass">确 定</el-button>
+			</span>
+		</el-dialog>
+	</div>
 </template>
 
 <script>
-export default {
-  data() {
-    return {
-      isLoading: false,
-      tableHeight: 50,
-      sClassName: "",
-      className: "",
-      formLabelWidth: "80px",
-      dialogVisible: false,
-      tableData: [],
-      total: null,
-      page: null,
-    };
-  },
-  mounted() {
-    this.$nextTick(function () {
-      this.tableHeight =
-        window.innerHeight - this.$refs.table.$el.offsetTop - 200;
-      if (this.tableHeight <= 530) {
-        this.tableHeight = 530;
-      }
-      // 监听窗口大小变化
-      let self = this;
-      window.onresize = function () {
-        self.tableHeight =
-          window.innerHeight - self.$refs.table.$el.offsetTop - 200;
-        if (self.tableHeight <= 530) {
-          self.tableHeight = 530;
-        }
-      };
-    });
-    //this.$refs.table.$el.offsetTop:表格距离浏览器的高度 //200表示你想要调整的表格距离底部的高度(你可以自己随意调整),因为我们一般都有放分页组件的,所以需要给它留一个高度
-  },
-  created() {
-    this.page = 1;
-    this.getClass();
-  },
-  methods: {
-    tableRowClassName({ row, rowIndex }) {
-      if ((rowIndex + 1) % 2 === 0) {
-        return "even_row";
-      } else {
-        return "";
-      }
-    },
-    handleCurrentChange(val) {
-      // console.log(`当前页: ${val}`);
-      this.page = val;
-      this.getClass();
-    },
-    handleClose(done) {
-      done();
-      // this.$confirm("确认关闭?")
-      //   .then((_) => {
-      //     done();
-      //   })
-      //   .catch((_) => {});
-    },
-    //搜索班级
-    searchClass() {
-      this.page = 1;
-      this.getClass();
-    },
-    //获取班级
-    getClass() {
-      this.isLoading = true;
-      let params = {
-        username: this.$store.state.userInfo.userid,
-        cn: this.sClassName,
-        page: this.page,
-      };
-      this.ajax
-        .get(this.$store.state.api + "getClass", params)
-        .then((res) => {
-          this.isLoading = false;
-          this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
-          this.tableData = res.data[0];
-        })
-        .catch((err) => {
-          this.isLoading = false;
-          console.error(err);
-        });
-    },
-    time() {
-      if (!this.now) {
-        this.now = new Date().getTime();
-        return true;
-      } else {
-        let time = new Date().getTime();
-        if (time - this.now > 3000) {
-          this.now = time;
-          return true;
-        } else {
-          return false;
-        }
-      }
-    },
-    //添加班级
-    insertClass() {
-      if (this.className === "") {
-        this.$message.error("班级名字不能为空");
-        return;
-      }
-      if (this.time()) {
-        let params = [
-          { n: this.className, cuid: this.$store.state.userInfo.userid },
-        ];
-        this.ajax
-          .post(this.$store.state.api + "insertClass", params)
-          .then((res) => {
-            this.$message({
-              message: "添加成功",
-              type: "success",
-            });
-            this.sClassName = "";
-            this.className = "";
-            this.page = 1;
-            this.getClass();
-            this.dialogVisible = false;
-          })
-          .catch((err) => {
-            this.$message.error("添加失败");
-            console.error(err);
-          });
-      }
-    },
-    //删除班级
-    deleteClass(row) {
-      let params = [{ id: row.id }];
-      this.$confirm("确定删除此班级吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.ajax
-            .post(this.$store.state.api + "deleteClass", params)
-            .then((res) => {
-              this.$message({
-                message: "删除成功",
-                type: "success",
-              });
-              this.className = "";
-              if (this.page != 1 && this.tableData.length == 1) {
-                this.page--;
-              }
-              this.getClass();
-              this.dialogVisible = false;
-            })
-            .catch((err) => {
-              this.$message.error("删除失败");
-              console.error(err);
-            });
-        })
-        .catch(() => {});
-    },
-  },
-};
+	export default {
+		data() {
+			return {
+				tableHeight: "500px",
+				isLoading: false,
+				formLabelWidth: "100px",
+				sClassName: "",
+				className: "",
+				dialogVisible: false,
+				tableData: [],
+				page: 1,
+				total: 0,
+			};
+		},
+		created() {
+			this.page = 1;
+			this.getClass();
+		},
+		methods: {
+			tableRowClassName({ row, rowIndex }) {
+				if ((rowIndex + 1) % 2 === 0) {
+					return "even_row";
+				} else {
+					return "";
+				}
+			},
+			handleCurrentChange(val) {
+				this.page = val;
+			},
+			handleClose(done) {
+				done();
+			},
+			time() {
+				if (!this.now) {
+					this.now = new Date().getTime();
+					return true;
+				} else {
+					let time = new Date().getTime();
+					if (time - this.now > 3000) {
+						this.now = time;
+						return true;
+					} else {
+						return false;
+					}
+				}
+			},
+			searchClass() {
+				this.page = 1;
+				this.getClass();
+			},
+			//新增班级
+			insertClass() {
+				let params = {
+					name: this.className,
+				};
+				this.ajax
+					.get(this.$store.state.api + "insertClass", params)
+					.then((res) => {
+						this.$message({
+							message: "新增成功",
+							type: "success",
+						});
+						this.dialogVisible = false;
+						this.sClassName = "";
+						this.getClass();
+						this.className = "";
+					})
+					.catch((err) => {
+						this.$message({
+							message: "新增失败",
+							type: "error",
+						});
+						console.error(err);
+					});
+			},
+			//获取班级列表
+			getClass() {
+				this.isLoading = true;
+				let params = {
+					// username: this.$store.state.userInfo.userid,
+					cu: "",
+					cn: this.sClassName,
+					page: this.page,
+				};
+				this.ajax
+					.get(this.$store.state.api + "selectClass", params)
+					.then((res) => {
+						this.isLoading = false;
+						this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
+						this.tableData = res.data[0];
+					})
+					.catch((err) => {
+						this.isLoading = false;
+						console.error(err);
+					});
+			},
+			//新增班级
+			deleteClass(id) {
+				let params = {
+					id: id,
+				};
+				if (this.time()) {
+					this.$confirm("确定删除此课程吗?", "提示", {
+						confirmButtonText: "确定",
+						cancelButtonText: "取消",
+						type: "warning",
+					})
+						.then(() => {
+							this.ajax
+								.get(this.$store.state.api + "deleteClass", params)
+								.then((res) => {
+									this.$message({
+										message: "删除成功",
+										type: "success",
+									});
+									if (this.page != 1 && this.tableData.length == 1) {
+										this.page - 1;
+									}
+									this.getClass();
+								})
+								.catch((err) => {
+									this.$message.error("删除失败");
+									console.error(err);
+								});
+						})
+						.catch(() => {});
+				}
+			},
+		},
+	};
 </script>
 
 <style scoped>
-.dialog_diy >>> .el-dialog__header {
-  background: #3d67bc !important;
-  padding: 15px 20px;
-}
-.dialog_diy >>> .el-dialog__title {
-  color: #fff;
-}
-.dialog_diy >>> .el-dialog__headerbtn {
-  top: 19px;
-}
-.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
-  color: #fff;
-}
-.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
-  color: #fff;
-}
-.student_head >>> .el-button--primary {
-  background-color: #2268bc;
-}
-.xls_button {
-  font-size: 14px;
-  cursor: pointer;
-  text-decoration: underline;
-  color: rgb(34, 104, 188);
-}
-.student_head {
-  display: flex;
-  justify-content: space-between;
-}
-.student_search {
-  display: flex;
-  width: 300px;
-}
-.student_search span {
-  margin: 0 10px 0 0;
-}
-.student_button {
-  display: flex;
-  overflow: hidden;
-  height: 40px;
-}
-.student_button .el-button--primary {
-  /* margin-right: 10px; */
-}
-.upload-demo {
-  display: flex;
-  flex-direction: column;
-  align-items: end;
-  /* position: relative; */
-  width: 100px;
-  overflow: hidden;
-}
-.student_table {
-  margin: 20px 0;
-}
+	.dialog_diy >>> .el-dialog__header {
+		background: #3d67bc !important;
+		padding: 15px 20px;
+	}
+	.dialog_diy >>> .el-dialog__title {
+		color: #fff;
+	}
+	.student_table >>> .el-table--border td {
+		border-right: 0px !important;
+	}
+	.dialog_diy >>> .el-dialog__headerbtn {
+		top: 19px;
+	}
+	.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
+		color: #fff;
+	}
+	.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
+		color: #fff;
+	}
+	.student_head >>> .el-button--primary {
+		background-color: #2268bc;
+	}
+	.xls_button {
+		font-size: 14px;
+		cursor: pointer;
+		text-decoration: underline;
+		color: rgb(34, 104, 188);
+	}
+	.student_head {
+		display: flex;
+		justify-content: space-between;
+	}
+	.student_search {
+		display: flex;
+		width: 300px;
+	}
+	.student_search span {
+		margin: 0 10px 0 0;
+	}
+	.student_button {
+		display: flex;
+		overflow: hidden;
+		height: 40px;
+	}
+	.student_button .el-button--primary {
+		/* margin-right: 10px; */
+	}
+	.upload-demo {
+		display: flex;
+		flex-direction: column;
+		align-items: end;
+		/* position: relative; */
+		width: 100px;
+		overflow: hidden;
+	}
+	.student_table {
+		margin: 20px 0;
+	}
 
-.el-table >>> .even_row {
-  background-color: #f1f1f1;
-}
+	.el-table >>> .even_row {
+		background-color: #f1f1f1;
+	}
 </style>

+ 421 - 1011
src/components/pages/course.vue

@@ -1,1028 +1,438 @@
 <template>
-  <div class="pb_content">
-    <div class="pb_head">
-      <span>课程管理</span>
-    </div>
-    <div class="pb_content_body" style="height: calc(100% - 150px)">
-      <div class="student_head">
-        <div class="student_search">
-          <span>课程分类</span>
+	<div class="pb_content">
+		<div class="pb_head">
+			<span>课程管理</span>
+		</div>
+		<div class="pb_content_body" style="height: calc(100% - 150px)">
+			<div class="student_head">
+				<div class="student_search">
+					<span>课程分类</span>
 
-          <el-select
-            v-model="groupA"
-            placeholder="请选择要筛选的分类"
-            @change="search"
-          >
-            <el-option value="" label="所有分类"></el-option>
-            <el-option
-              v-for="item in groupList"
-              :key="item.id"
-              :value="item.id"
-              :label="item.name"
-            ></el-option>
-          </el-select>
-        </div>
-        <div class="student_button">
-          <el-button type="primary" @click="insertPop">添加课程</el-button>
-        </div>
-      </div>
-      <div
-        class="student_table"
-        :class="{ student_empty: !tableData.length > 0 }"
-      >
-        <div class="course_box" v-if="tableData.length > 0">
-          <el-card
-            v-for="item in tableData"
-            :key="item.id"
-            class="el_cards"
-            style="margin: 0 20px 20px 0; width: 250px"
-            :body-style="{ padding: '0px' }"
-          >
-            <!-- <img :src="item.imgUrl" class="image" /> -->
-            <el-image class="image" :src="item.imgUrl" fit="cover"></el-image>
-            <div class="courseBtnBox">
-              <div>
-                <span class="course_title">{{ item.title }}</span>
-                <!-- <div class="course_rate">
+					<el-select
+						v-model="groupA"
+						placeholder="请选择要筛选的分类"
+						@change="search"
+					>
+						<el-option value="" label="所有分类"></el-option>
+						<el-option
+							v-for="item in groupList"
+							:key="item.id"
+							:value="item.id"
+							:label="item.name"
+						></el-option>
+					</el-select>
+				</div>
+				<div class="student_button">
+					<el-button type="primary" @click="goTo('/course/addCourse')">添加课程</el-button>
+				</div>
+			</div>
+			<div
+				class="student_table"
+				:class="{ student_empty: !tableData.length > 0 }"
+			>
+				<div class="course_box" v-if="tableData.length > 0">
+					<el-card
+						v-for="item in tableData"
+						:key="item.id"
+						class="el_cards"
+						style="margin: 0 20px 20px 0; width: 250px"
+						:body-style="{ padding: '0px' }"
+					>
+						<!-- <img :src="item.imgUrl" class="image" /> -->
+						<el-image class="image" :src="item.imgUrl" fit="cover"></el-image>
+						<div class="courseBtnBox">
+							<div>
+								<span class="course_title">{{ item.title }}</span>
+								<!-- <div class="course_rate">
                 <el-rate v-model="value1"></el-rate>
               </div> -->
-                <div class="course_view">
-                  <i></i
-                  ><span>{{ item.learning ? item.learning : 0 }}人在学</span>
-                </div>
-              </div>
-              <div class="course_button_box">
-                <el-button
-                  type="primary"
-                  class="course_button"
-                  @click="goTo('/course/courseDetail?id=' + item.courseId)"
-                  >查看</el-button
-                >
-                <el-button
-                  type="primary"
-                  class="course_button"
-                  @click="updatePop(item.courseId)"
-                  >修改</el-button
-                >
-                <el-button
-                  type="primary"
-                  class="course_button"
-                  @click="deleteCourse(item.courseId)"
-                  >删除</el-button
-                >
-              </div>
-            </div>
-          </el-card>
-        </div>
-        <div class="course_empty" v-else>暂无数据</div>
-      </div>
-    </div>
-    <div class="student_page">
-      <el-pagination
-        background
-        layout="prev, pager, next"
-        :page-size="10"
-        :total="total"
-        v-if="!isLoading && page"
-        @current-change="handleCurrentChange"
-      >
-      </el-pagination>
-    </div>
-
-    <el-dialog
-      :title="updateBoolean ? '修改课程' : '创建课程'"
-      :visible.sync="dialogVisible"
-      :append-to-body="true"
-      width="550px"
-      :before-close="handleClose"
-      class="dialog_diy"
-    >
-      <!-- <span
-        slot="title"
-        class="dialog-head"
-        :style="{ background: '#3d67bc', color: 'white', display: 'block' }"
-      >
-        <span style="padding: 15px 20px">编辑框</span>
-      </span> -->
-      <div class="course_create_box">
-        <div class="course_name">
-          <span>课程名称</span>
-          <el-input
-            v-model="courseTitle"
-            placeholder="请输入课程名字"
-          ></el-input>
-        </div>
-        <div class="course_type">
-          <div class="course_type1">
-            <span>分类</span>
-            <el-select
-              v-model="group"
-              placeholder="请选择分类"
-              @change="getGPop"
-            >
-              <el-option
-                v-for="item in groupList"
-                :key="item.id"
-                :value="item.id"
-                :label="item.name"
-              ></el-option>
-            </el-select>
-          </div>
-          <div class="course_type2">
-            <span>年级</span>
-            <el-select v-model="classX" placeholder="请选择分类">
-              <el-option value="" label="所有年级"></el-option>
-              <el-option
-                v-for="item in classListX"
-                :key="item.id"
-                :value="item.id"
-                :label="item.name"
-              ></el-option>
-            </el-select>
-          </div>
-          <div class="course_type2">
-            <span>权限</span>
-
-            <el-select v-model="Juri" placeholder="请选择权限">
-              <el-option label="所有人" value="0"></el-option>
-              <el-option
-                v-for="item in JuriList"
-                :key="item.id"
-                :value="item.id"
-                :label="item.name"
-              ></el-option>
-            </el-select>
-          </div>
-        </div>
-        <div class="course_name">
-          <span>课程海报</span>
-          <!-- :on-success="handle_success" -->
-          <!-- :before-upload="beforeUpload1" -->
-          <el-upload
-            action="#"
-            list-type="picture"
-            v-loading="uploadLoading1"
-            :http-request="beforeUpload1"
-            ref="upload1"
-            :on-preview="handlePictureCardPreview"
-            :on-remove="handle_remove1"
-            :show-file-list="true"
-            :file-list="fileList1"
-            accept="image/*"
-            :limit="1"
-            :on-exceed="onExceed"
-          >
-            <!-- <i class="el-icon-plus"></i> -->
-            <el-button size="small" type="primary">点击上传</el-button>
-          </el-upload>
-        </div>
-        <div class="course_name">
-          <span>视频上传</span>
-          <!-- :disabled="true" -->
-          <el-upload
-            action="#"
-            ref="upload"
-            list-type="text"
-            v-loading="uploadLoading"
-            :on-remove="handle_remove"
-            :show-file-list="true"
-            :http-request="beforeUpload"
-            :file-list="fileList"
-            accept="video/*"
-          >
-            <!-- <i class="el-icon-plus"></i> -->
-            <el-button size="small" type="primary">点击上传</el-button>
-          </el-upload>
-          <!-- <el-input  placeholder="请输入视频名称" v-for="item in fileList" :key="item.file"></el-input> -->
-        </div>
-        <div class="course_name">
-          <span>创建作业</span>
-          <div class="homework_box">
-            <div
-              class="course_homework"
-              v-for="(item, index) in itemCount"
-              :key="index"
-            >
-              <el-image
-                style="width: 35px; height: 50px"
-                :src="require('../../assets/homework.png')"
-                fit="contain"
-              ></el-image>
-              <el-input
-                placeholder="请输入作业名称"
-                v-model="homeworkList[index].name"
-              ></el-input>
-            </div>
-            <div
-              style="
-                display: flex;
-                flex-direction: column;
-                align-items: center;
-                justify-content: center;
-              "
-            >
-              <el-button size="small" type="primary" @click="addHomeworkBox"
-                >点击添加</el-button
-              >
-              <el-button
-                size="small"
-                type="primary"
-                style="margin: 5px 0 0 0"
-                @click="reduceHomeworkBox"
-                v-if="itemCount > 1"
-                >点击删除</el-button
-              >
-            </div>
-          </div>
-        </div>
-        <div class="course_name">
-          <span>课程简介</span>
-          <!-- <el-input
-            type="textarea"
-            placeholder="请输入课程简介..."
-            :rows="6"
-            resize="none"
-            v-model="courseText"
-          ></el-input> -->
-          <editor-bar
-            v-model="courseText"
-            :isClear="isClear"
-            @change="change"
-          ></editor-bar>
-        </div>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="addCourse()" v-if="!updateBoolean"
-          >确 定</el-button
-        >
-        <el-button type="primary" @click="updateA()" v-show="updateBoolean"
-          >修 改</el-button
-        >
-      </span>
-    </el-dialog>
-    <el-dialog :visible.sync="dialogVisible1" size="tiny">
-      <img width="100%" :src="dialogImageUrl" alt="" />
-    </el-dialog>
-  </div>
+								<div class="course_view">
+									<i></i
+									><span>{{ item.learning ? item.learning : 0 }}人在学</span>
+								</div>
+							</div>
+							<div class="course_button_box">
+								<el-button
+									type="primary"
+									class="course_button"
+									@click="goTo('/course/courseDetail?id=' + item.courseId)"
+									>查看</el-button
+								>
+								<el-button
+									type="primary"
+									class="course_button"
+									>修改</el-button
+								>
+								<el-button
+									type="primary"
+									class="course_button"
+									>删除</el-button
+								>
+							</div>
+						</div>
+					</el-card>
+				</div>
+				<div class="course_empty" v-else>暂无数据</div>
+			</div>
+		</div>
+		<div class="student_page">
+			<el-pagination
+				background
+				layout="prev, pager, next"
+				:page-size="10"
+				:total="total"
+				v-if="!isLoading && page"
+				@current-change="handleCurrentChange"
+			>
+			</el-pagination>
+		</div>
+		<el-dialog :visible.sync="dialogVisible1" size="tiny">
+			<img width="100%" :src="dialogImageUrl" alt="" />
+		</el-dialog>
+	</div>
 </template>
 
 <script>
-import "../../common/aws-sdk-2.235.1.min";
-import EditorBar from "../../components/tools/wangEnduit";
-export default {
-  components: { EditorBar },
-  data() {
-    return {
-      isClear: false,
-      detail: "",
-      itemCount: 1,
-      courseTitle: "",
-      courseText: "",
-      isLoading: false,
-      fileList: [],
-      fileList1: [],
-      homeworkList: [{ name: "" }],
-      formLabelWidth: "100px",
-      dialogVisible: false,
-      dialogVisible1: false,
-      dialogImageUrl: "",
-      school: "全部",
-      group: "",
-      Juri: "",
-      groupList: [],
-      JuriList: [],
-      page: 1,
-      total: 0,
-      tableData: [],
-      uploadLoading1: false,
-      uploadLoading: false,
-      now: "",
-      updateBoolean: false,
-      courseDetail: {},
-      updateId: "",
-      groupA: "",
-      classX: "",
-      classListX: [],
-    };
-  },
-  methods: {
-    change(val) {
-      console.log(val);
-    },
-    addHomeworkBox() {
-      this.homeworkList.push({ name: "" });
-      this.itemCount++;
-    },
-    reduceHomeworkBox() {
-      var a = this.homeworkList;
-      a.splice(a.length - 1);
-      this.itemCount--;
-    },
-    goTo(path) {
-      this.$router.push(path);
-    },
-    tableRowClassName({ row, rowIndex }) {
-      if ((rowIndex + 1) % 2 === 0) {
-        return "even_row";
-      } else {
-        return "";
-      }
-    },
-    insertPop() {
-      this.init();
-      this.dialogVisible = true;
-      this.updateBoolean = false;
-    },
-    handle_remove(file, fileList) {
-      var _tmp = this.fileList;
-      for (var i = 0, len = _tmp.length; i < len; i++) {
-        if (_tmp[i].uid == file.uid) {
-          _tmp.splice(i, 1);
-          break;
-        }
-        this.fileList = _tmp;
-      }
-    },
-    handle_remove1(file, fileList) {
-      var _tmp = this.fileList1;
-      for (var i = 0, len = _tmp.length; i < len; i++) {
-        if (_tmp[i].uid == file.uid) {
-          _tmp.splice(i, 1);
-          break;
-        }
-        this.fileList1 = _tmp;
-      }
-    },
-    handleCurrentChange(val) {
-      // console.log(`当前页: ${val}`);
-      this.page = val;
-      this.getCourse();
-    },
-    init() {
-      this.itemCount = 1;
-      this.courseTitle = "";
-      this.courseText = "";
-      this.homeworkList = [{ name: "" }];
-      this.fileList = [];
-      this.fileList1 = [];
-      this.group = "";
-      this.Juri = "";
-      this.classX = "";
-      this.$refs.upload1 ? (this.$refs.upload1.uploadFiles.length = 0) : "";
-      this.$refs.upload ? (this.$refs.upload.uploadFiles.length = 0) : "";
-      this.updateId = "";
-    },
-    handleClose(done) {
-      this.init();
-
-      done();
-    },
-    handleRemove(file, fileList) {
-      console.log(file, fileList);
-    },
-    handlePictureCardPreview(file) {
-      this.dialogImageUrl = file.url;
-      this.dialogVisible1 = true;
-    },
-    beforeUpload(data) {
-      var file = data.file;
-      this.uploadLoading = true;
-      var credentials = {
-        accessKeyId: "AKIATLPEDU37QV5CHLMH",
-        secretAccessKey: "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",
-      }; //秘钥形式的登录上传
-      window.AWS.config.update(credentials);
-      window.AWS.config.region = "cn-northwest-1"; //设置区域
-
-      var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
-      var _this = this;
-
-      if (file) {
-        var params = {
-          Key:
-            file.name.split(".")[0] +
-            new Date().getTime() +
-            "." +
-            file.name.split(".")[1],
-          ContentType: file.type,
-          Body: file,
-          "Access-Control-Allow-Credentials": "*",
-          ACL: "public-read",
-        }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
-        var options = {
-          partSize: 2048 * 1024 * 1024,
-          queueSize: 2,
-          leavePartsOnError: true,
-        };
-        bucket
-          .upload(params, options)
-          .on("httpUploadProgress", function (evt) {
-            //这里可以写进度条
-            // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
-          })
-          .send(function (err, data) {
-            _this.uploadLoading = false;
-            if (err) {
-              var a = _this.$refs.upload.uploadFiles;
-              a.splice(a.length - 1, a.length);
-              _this.$message.error("上传失败");
-            } else {
-              //上传成功处理
-              _this.fileList.push({
-                name: file.name,
-                url: data.Location,
-                uid: file.uid,
-              });
-              console.log(data.Location);
-            }
-          });
-      }
-    },
-    onExceed() {
-      this.$message.error("课程海报仅支持上传一张,请删除后再进行上传");
-    },
-    beforeUpload1(data) {
-      this.$refs.upload1.uploadFiles;
-      this.uploadLoading1 = true;
-      var file = data.file;
-      var credentials = {
-        accessKeyId: "AKIATLPEDU37QV5CHLMH",
-        secretAccessKey: "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",
-      }; //秘钥形式的登录上传
-      window.AWS.config.update(credentials);
-      window.AWS.config.region = "cn-northwest-1"; //设置区域
-
-      var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
-      var _this = this;
-
-      if (file) {
-        var params = {
-          Key:
-            file.name.split(".")[0] +
-            new Date().getTime() +
-            "." +
-            file.name.split(".")[1],
-          ContentType: file.type,
-          Body: file,
-          "Access-Control-Allow-Credentials": "*",
-          ACL: "public-read",
-        }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
-        var options = {
-          partSize: 2048 * 1024 * 1024,
-          queueSize: 2,
-          leavePartsOnError: true,
-        };
-        bucket
-          .upload(params, options)
-          .on("httpUploadProgress", function (evt) {
-            //这里可以写进度条
-            // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
-          })
-          .send(function (err, data) {
-            _this.uploadLoading1 = false;
-            if (err) {
-              var a = _this.$refs.upload1.uploadFiles;
-              a.splice(a.length - 1, a.length);
-              _this.$message.error("上传失败");
-            } else {
-              //上传成功处理
-              _this.fileList1.push({
-                name: file.name,
-                url: data.Location,
-                uid: file.uid,
-              });
-              console.log(data.Location);
-            }
-          });
-      }
-    },
-    //获取分组分类
-    getGroup() {
-      let params = {};
-      this.ajax
-        .get(this.$store.state.api + "getGroup", params)
-        .then((res) => {
-          this.groupList = res.data[0];
-          console.log(this.groupList);
-        })
-        .catch((err) => {
-          console.error(err);
-        });
-    },
-    //获取权限
-    getJuri() {
-      let params = { cid: this.$store.state.userInfo.organizeid };
-      this.ajax
-        .get(this.$store.state.api + "getJuri", params)
-        .then((res) => {
-          this.JuriList = res.data[0];
-          console.log(this.JuriList);
-        })
-        .catch((err) => {
-          console.error(err);
-        });
-    },
-    //uuid生成
-    guid() {
-      return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
-        /[xy]/g,
-        function (c) {
-          var r = (Math.random() * 16) | 0,
-            v = c == "x" ? r : (r & 0x3) | 0x8;
-          return v.toString(16);
-        }
-      );
-    },
-    time() {
-      if (!this.now) {
-        this.now = new Date().getTime();
-        return true;
-      } else {
-        let time = new Date().getTime();
-        if (time - this.now > 3000) {
-          this.now = time;
-          return true;
-        } else {
-          return false;
-        }
-      }
-    },
-    //添加课程
-    addCourse() {
-      if (this.courseTitle === "") {
-        this.$message.error("请输入课程名称");
-        return;
-      } else if (this.group === "") {
-        this.$message.error("请选择课程分类");
-        return;
-      } else if (this.Juri === "") {
-        this.$message.error("请选择课程权限");
-        return;
-      } else if (this.fileList1.length == 0) {
-        this.$message.error("请上传课程海报");
-        return;
-      } else if (this.fileList.length == 0) {
-        this.$message.error("请上传课程视频");
-        return;
-      } else if (this.homeworkList.length == 0) {
-        this.$message.error("请添加课程作业");
-        return;
-      } else if (this.courseText === "") {
-        this.$message.error("请输入课程简介");
-        return;
-      }
-      if (this.time()) {
-        var photo = [];
-        var media = [];
-
-        for (var i = 0; i < this.fileList1.length; i++) {
-          photo.push(this.fileList1[i].url);
-        }
+	import "../../common/aws-sdk-2.235.1.min";
+	import EditorBar from "../../components/tools/wangEnduit";
+	export default {
+		components: { EditorBar },
+		data() {
+			return {
+				itemCount: 1,
+				courseTitle: "",
+				courseText: "",
+				isLoading: false,
+				fileList: [],
+				fileList1: [],
+				homeworkList: [{ name: "" }],
+				formLabelWidth: "100px",
+				dialogVisible: false,
+				dialogVisible1: false,
+				dialogImageUrl: "",
+				group: "",
+				Juri: "",
+				groupList: [],
+				JuriList: [],
+				page: 1,
+				total: 0,
+				tableData: [],
+				now: "",
+				courseDetail: {},
+				addCourse:{},
+				groupA: "",
+				classX: "",
+			};
+		},
+		methods: {
+			change(val) {
+				console.log(val);
+			},
+			addHomeworkBox() {
+				this.homeworkList.push({ name: "" });
+				this.itemCount++;
+			},
+			reduceHomeworkBox() {
+				var a = this.homeworkList;
+				a.splice(a.length - 1);
+				this.itemCount--;
+			},
+			goTo(path) {
+				this.$router.push(path);
+			},
+			tableRowClassName({ row, rowIndex }) {
+				if ((rowIndex + 1) % 2 === 0) {
+					return "even_row";
+				} else {
+					return "";
+				}
+			},
+			handle_remove(file, fileList) {
+				var _tmp = this.fileList;
+				for (var i = 0, len = _tmp.length; i < len; i++) {
+					if (_tmp[i].uid == file.uid) {
+						_tmp.splice(i, 1);
+						break;
+					}
+					this.fileList = _tmp;
+				}
+			},
+			handle_remove1(file, fileList) {
+				var _tmp = this.fileList1;
+				for (var i = 0, len = _tmp.length; i < len; i++) {
+					if (_tmp[i].uid == file.uid) {
+						_tmp.splice(i, 1);
+						break;
+					}
+					this.fileList1 = _tmp;
+				}
+			},
+			handleCurrentChange(val) {
+				// console.log(`当前页: ${val}`);
+				this.page = val;
+				this.getCourse();
+			},
+			init() {
+				this.itemCount = 1;
+				this.courseTitle = "";
+				this.courseText = "";
+				this.homeworkList = [{ name: "" }];
+				this.fileList = [];
+				this.fileList1 = [];
+				this.group = "";
+				this.Juri = "";
+				this.classX = "";
+				this.$refs.upload1 ? (this.$refs.upload1.uploadFiles.length = 0) : "";
+				this.$refs.upload ? (this.$refs.upload.uploadFiles.length = 0) : "";
+			},
+			handleClose(done) {
+				this.init();
 
-        for (var i = 0; i < this.fileList.length; i++) {
-          media.push(this.fileList[i].url);
-        }
-
-        var homeA = [];
-        for (var i = 0; i < this.homeworkList.length; i++) {
-          if (this.homeworkList[i].name === "") {
-          } else {
-            homeA.push({ hid: this.guid(), name: this.homeworkList[i].name });
-          }
-        }
-        var chap = {
-          homework: homeA,
-          midia: media.join(","),
-          poster: photo.join(","),
-        };
-        let params = [
-          {
-            uid: this.$store.state.userInfo.userid,
-            title: this.courseTitle,
-            brief: this.courseText.replace(/%/g, "%25"),
-            chapters: JSON.stringify(chap),
-            gid: this.group,
-            class: this.classX,
-            juri: this.Juri,
-          },
-        ];
-        this.ajax
-          .post(this.$store.state.api + "addCourse", params)
-          .then((res) => {
-            this.$message({
-              message: "添加成功",
-              type: "success",
-            });
-            this.init();
-            this.getCourse();
-            this.dialogVisible = false;
-          })
-          .catch((err) => {
-            this.$message.error("添加失败");
-            console.error(err);
-          });
-      } else {
-        return;
-      }
-    },
-    search() {
-      this.page = 1;
-      this.isLoading = true;
-      this.getCourse();
-    },
-    //获取课程
-    getCourse() {
-      // const loading = this.$loading.service({
-      //   background: "rgba(255, 255, 255, 0.7)",
-      //   target: document.querySelector(".student_table"),
-      // });
-      const loading = this.openLoading(
-        document.querySelector(".student_table")
-      );
-      let params = {
-        // uid: this.$store.state.userInfo.userid,
-        uid: this.$store.state.userInfo.organizeid,
-        gid: this.groupA,
-        page: this.page,
-      };
-      this.ajax
-        .get(this.$store.state.api + "getCourseTeacher", params)
-        .then((res) => {
-          loading.close();
-          this.isLoading = false;
-          this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
-          var resA = [];
-          if (res.data[0].length > 0) {
-            resA = res.data[0].filter((element) => {
-              element.imgUrl = JSON.parse(element.chapters).poster;
-              return element;
-            });
-          }
-          this.tableData = resA;
-        })
-        .catch((err) => {
-          loading.close();
-          this.isLoading = false;
-          console.error(err);
-        });
-    },
-    //修改课程
-    updatePop(id) {
-      this.init();
-      let params = { cid: id };
-      this.updateId = id;
-      this.ajax
-        .get(this.$store.state.api + "getCourseDetail", params)
-        .then((res) => {
-          this.courseDetail = res.data[0][0];
-          this.courseTitle = res.data[0][0].title;
-          this.group = res.data[0][0].groupid;
-          this.getGPop();
-          this.Juri = res.data[0][0].juri;
-          this.classX = res.data[0][0].classx;
-          var chap = JSON.parse(res.data[0][0].chapters);
-          this.fileList1.push({
-            name: chap.poster.split("//")[1].split("/")[1].split(".")[0],
-            url: chap.poster,
-          });
-          for (var i = 0; i < chap.midia.split(",").length; i++) {
-            this.fileList.push({
-              name: chap.midia.split(",")[i].split("//")[1].split("/")[1],
-              url: chap.midia.split(",")[i],
-            });
-          }
-          // this.homeworkList.length = 0;
-          this.itemCount = chap.homework.length;
-          this.homeworkList = [];
-          for (var i = 0; i < chap.homework.length; i++) {
-            this.homeworkList.push({
-              hid: chap.homework[i].hid,
-              name: chap.homework[i].name,
-            });
-            // homeA.push({ hid: this.guid(), name: this.homeworkList[i] });
-          }
-          this.courseText = res.data[0][0].brief;
-          this.dialogVisible = true;
-          this.updateBoolean = true;
-        })
-        .catch((err) => {
-          console.error(err);
-        });
-    },
-    //修改课程
-    updateA() {
-      if (this.courseTitle === "") {
-        this.$message.error("请输入课程名称");
-        return;
-      } else if (this.group === "") {
-        this.$message.error("请选择课程分类");
-        return;
-      } else if (this.Juri === "") {
-        this.$message.error("请选择课程权限");
-        return;
-      } else if (this.fileList1.length == 0) {
-        this.$message.error("请上传课程海报");
-        return;
-      } else if (this.fileList.length == 0) {
-        this.$message.error("请上传课程视频");
-        return;
-      } else if (this.homeworkList.length == 0) {
-        this.$message.error("请添加课程作业");
-        return;
-      } else if (this.courseText === "") {
-        this.$message.error("请输入课程简介");
-        return;
-      }
-      for (var i = 0; i < this.homeworkList.length; i++) {
-        if (this.homeworkList[i].hid && this.homeworkList[i].name == "") {
-          this.$message.error("不能把已有的作业修改成空");
-          return;
-        }
-      }
-      var photo = [];
-      var media = [];
-
-      for (var i = 0; i < this.fileList1.length; i++) {
-        photo.push(this.fileList1[i].url);
-      }
-
-      for (var i = 0; i < this.fileList.length; i++) {
-        media.push(this.fileList[i].url);
-      }
-
-      var homeA = [];
-      for (var i = 0; i < this.homeworkList.length; i++) {
-        if (this.homeworkList[i].name === "") {
-        } else if (this.homeworkList[i].hid) {
-          homeA.push({
-            hid: this.homeworkList[i].hid,
-            name: this.homeworkList[i].name,
-          });
-        } else {
-          homeA.push({ hid: this.guid(), name: this.homeworkList[i].name });
-        }
-      }
-      var chap = {
-        homework: homeA,
-        midia: media.join(","),
-        poster: photo.join(","),
-      };
-      let params = [
-        {
-          cid: this.updateId,
-          t: this.courseTitle,
-          gid: this.group,
-          class: this.classX,
-          j: this.Juri,
-          chap: JSON.stringify(chap),
-          b: this.courseText.replace(/%/g, "%25"),
-        },
-      ];
-      if (this.time()) {
-        this.$confirm("确定修改此课程吗?", "提示", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning",
-        })
-          .then(() => {
-            this.ajax
-              .post(this.$store.state.api + "updateCourse", params)
-              .then((res) => {
-                this.$message({
-                  message: "修改成功",
-                  type: "success",
-                });
-
-                this.getCourse();
-                this.init();
-                this.dialogVisible = false;
-              })
-              .catch((err) => {
-                this.$message.error("修改失败");
-                console.error(err);
-              });
-          })
-          .catch(() => {});
-      }
-    },
-    //删除课程
-    deleteCourse(cid) {
-      let params = [{ cid: cid }];
-      if (this.time()) {
-        this.$confirm("确定删除此课程吗?", "提示", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning",
-        })
-          .then(() => {
-            this.ajax
-              .post(this.$store.state.api + "deleteCourse", params)
-              .then((res) => {
-                this.$message({
-                  message: "删除成功",
-                  type: "success",
-                });
-                if (this.page != 1 && this.tableData.length == 1) {
-                  this.page--;
-                }
-                this.getCourse();
-              })
-              .catch((err) => {
-                this.$message.error("修改失败");
-                console.error(err);
-              });
-          })
-          .catch(() => {});
-      }
-    },
-    getGPop() {
-      this.classX = "";
-      let params = { pid: this.group };
-      this.ajax
-        .get(this.$store.state.api + "getGroupGrade", params)
-        .then((res) => {
-          this.classListX = res.data[0];
-        })
-        .catch((err) => {
-          console.error(err);
-        });
-    },
-  },
-  created() {
-    this.getGroup();
-    this.getJuri();
-    this.page = 1;
-    this.getCourse();
-  },
-};
+				done();
+			},
+			handleRemove(file, fileList) {
+				console.log(file, fileList);
+			},
+			handlePictureCardPreview(file) {
+				this.dialogImageUrl = file.url;
+				this.dialogVisible1 = true;
+			},
+			onExceed() {
+				this.$message.error("课程海报仅支持上传一张,请删除后再进行上传");
+			},
+			//获取分组分类
+			getGroup() {
+				let params = {};
+				this.ajax
+					.get(this.$store.state.api + "getGroup", params)
+					.then((res) => {
+						this.groupList = res.data[0];
+						console.log(this.groupList);
+					})
+					.catch((err) => {
+						console.error(err);
+					});
+			},
+			//获取权限
+			getJuri() {
+				let params = { cid: this.$store.state.userInfo.organizeid };
+				this.ajax
+					.get(this.$store.state.api + "getJuri", params)
+					.then((res) => {
+						this.JuriList = res.data[0];
+						console.log(this.JuriList);
+					})
+					.catch((err) => {
+						console.error(err);
+					});
+			},
+			//uuid生成
+			guid() {
+				return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
+					/[xy]/g,
+					function (c) {
+						var r = (Math.random() * 16) | 0,
+							v = c == "x" ? r : (r & 0x3) | 0x8;
+						return v.toString(16);
+					}
+				);
+			},
+			time() {
+				if (!this.now) {
+					this.now = new Date().getTime();
+					return true;
+				} else {
+					let time = new Date().getTime();
+					if (time - this.now > 3000) {
+						this.now = time;
+						return true;
+					} else {
+						return false;
+					}
+				}
+			},
+			search() {
+				this.page = 1;
+				this.isLoading = true;
+				this.getCourse();
+			},
+		},
+		created() {
+			this.page = 1;
+		},
+	};
 </script>
 
 <style scoped>
-.dialog_diy >>> .el-dialog__header {
-  background: #3d67bc !important;
-  padding: 15px 20px;
-}
-.dialog_diy >>> .el-dialog__title {
-  color: #fff;
-}
-.dialog_diy >>> .el-dialog__headerbtn {
-  top: 19px;
-}
-.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
-  color: #fff;
-}
-.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
-  color: #fff;
-}
-.student_head >>> .el-button--primary {
-  background-color: #2268bc;
-}
+	.dialog_diy >>> .el-dialog__header {
+		background: #3d67bc !important;
+		padding: 15px 20px;
+	}
+	.dialog_diy >>> .el-dialog__title {
+		color: #fff;
+	}
+	.dialog_diy >>> .el-dialog__headerbtn {
+		top: 19px;
+	}
+	.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
+		color: #fff;
+	}
+	.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
+		color: #fff;
+	}
+	.student_head >>> .el-button--primary {
+		background-color: #2268bc;
+	}
+
+	.xls_button {
+		font-size: 14px;
+		cursor: pointer;
+		text-decoration: underline;
+		color: rgb(34, 104, 188);
+	}
+	.student_head {
+		display: flex;
+		justify-content: space-between;
+	}
+	.student_search {
+		display: flex;
+		align-items: center;
+		width: 300px;
+	}
+	.student_search span {
+		margin: 0 10px 0 0;
+	}
+	.student_button {
+		display: flex;
+		overflow: hidden;
+		height: 40px;
+	}
+	.upload-demo {
+		display: flex;
+		flex-direction: column;
+		align-items: end;
+		/* position: relative; */
+		width: 100px;
+		overflow: hidden;
+	}
+	.student_table {
+		margin: 10px 0;
+		min-height: 530px;
+		height: 93%;
+		overflow: auto;
+	}
+
+	.student_empty {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
 
-.xls_button {
-  font-size: 14px;
-  cursor: pointer;
-  text-decoration: underline;
-  color: rgb(34, 104, 188);
-}
-.student_head {
-  display: flex;
-  justify-content: space-between;
-}
-.student_search {
-  display: flex;
-  align-items: center;
-  width: 300px;
-}
-.student_search span {
-  margin: 0 10px 0 0;
-}
-.student_button {
-  display: flex;
-  overflow: hidden;
-  height: 40px;
-}
-.student_button .el-button--primary {
-  /* margin-right: 10px; */
-}
-.upload-demo {
-  display: flex;
-  flex-direction: column;
-  align-items: end;
-  /* position: relative; */
-  width: 100px;
-  overflow: hidden;
-}
-.student_table {
-  margin: 10px 0;
-  min-height: 530px;
-  height: 93%;
-  overflow: auto;
-}
+	.el-table >>> .even_row {
+		background-color: #f1f1f1;
+	}
 
-.student_empty {
-  display: flex;
-  justify-content: center;
-  align-items: center;
-}
+	.time {
+		font-size: 13px;
+		color: #999;
+	}
 
-.el-table >>> .even_row {
-  background-color: #f1f1f1;
-}
+	.course_button {
+		padding: 10px 20px;
+	}
+	.course_button_box {
+		display: flex;
+		margin-top: 5px;
+		justify-content: space-between;
+	}
+	.course_rate {
+		margin-top: 5px;
+	}
+	.course_view {
+		display: flex;
+		align-items: center;
+		margin: 5px 0 0 0;
+	}
+	.course_view i {
+		background-image: url("../../assets/liulan.png");
+		width: 25px;
+		height: 25px;
+		background-size: 100% 100%;
+		/* margin-top: 1px; */
+		line-height: 25px;
+		vertical-align: text-top;
+		background-repeat: no-repeat;
+	}
+	.image {
+		width: 100%;
+		height: 150px;
+		display: block;
+	}
+	.course_box {
+		display: flex;
+		flex-wrap: wrap;
+	}
+	.student_page {
+		width: 95%;
+		margin: 0 auto;
+	}
+	.course_create_box {
+		font-size: 18px;
+	}
+	.course_name {
+		margin-top: 10px;
+	}
+	.course_name span {
+		margin-bottom: 10px;
+		display: block;
+	}
+	.homework_box {
+		display: flex;
+		align-items: center;
+		flex-wrap: wrap;
+	}
+	.course_homework {
+		width: 130px;
+		display: flex;
+		justify-content: center;
+		flex-direction: column;
+		align-items: center;
+		margin: 0 10px 10px 0;
+	}
+	.course_type {
+		margin-top: 10px;
+		display: flex;
+	}
+	.course_type1 span {
+		margin-bottom: 10px;
+		display: block;
+	}
+	.course_type2 {
+		margin-left: 20px;
+	}
+	.course_type2 span {
+		margin-bottom: 10px;
+		display: block;
+	}
+	.course_empty {
+		color: rgb(110, 110, 110);
+	}
+	.el_cards >>> .el-card__body {
+		height: 100%;
+	}
+	.courseBtnBox {
+		display: flex;
+		flex-direction: column;
+		justify-content: space-between;
+		height: calc(100% - 170px);
+		padding: 10px;
+	}
 
-.time {
-  font-size: 13px;
-  color: #999;
-}
+  .wordUpload{
+    display: flex;
+  }
 
-.course_button {
-  padding: 10px 20px;
-}
-.course_button_box {
-  display: flex;
-  margin-top: 5px;
-  justify-content: space-between;
-}
-.course_rate {
-  margin-top: 5px;
-}
-.course_view {
-  display: flex;
-  align-items: center;
-  margin: 5px 0 0 0;
-}
-.course_view i {
-  background-image: url("../../assets/liulan.png");
-  width: 25px;
-  height: 25px;
-  background-size: 100% 100%;
-  /* margin-top: 1px; */
-  line-height: 25px;
-  vertical-align: text-top;
-  background-repeat: no-repeat;
-}
-.image {
-  width: 100%;
-  height: 150px;
-  display: block;
-}
-.course_box {
-  display: flex;
-  flex-wrap: wrap;
-}
-.student_page {
-  width: 95%;
-  margin: 0 auto;
-}
-.course_create_box {
-  font-size: 18px;
-}
-.course_name {
-  margin-top: 10px;
-}
-.course_name span {
-  margin-bottom: 10px;
-  display: block;
-}
-.homework_box {
-  display: flex;
-  align-items: center;
-  flex-wrap: wrap;
-}
-.course_homework {
-  width: 130px;
-  display: flex;
-  justify-content: center;
-  flex-direction: column;
-  align-items: center;
-  margin: 0 10px 10px 0;
-}
-.course_type {
-  margin-top: 10px;
-  display: flex;
-}
-.course_type1 span {
-  margin-bottom: 10px;
-  display: block;
-}
-.course_type2 {
-  margin-left: 20px;
-}
-.course_type2 span {
-  margin-bottom: 10px;
-  display: block;
-}
-.course_empty {
-  color: rgb(110, 110, 110);
-}
-.el_cards >>> .el-card__body {
-  height: 100%;
-}
-.courseBtnBox {
-  display: flex;
-  flex-direction: column;
-  justify-content: space-between;
-  height: calc(100% - 170px);
-  padding: 10px;
-}
+  .wordUpload>.buttonUp{
+    margin-right: 5px;
+  }
 </style>

+ 184 - 186
src/components/pages/data.vue

@@ -1,194 +1,192 @@
 <template>
-  <div class="pb_content">
-    <div class="pb_head">
-      <span>我的资料</span>
-    </div>
-    <div class="pb_content_body">
-      <div style="width: 500px">
-        <el-form
-          :model="ruleForm"
-          :rules="rules"
-          ref="ruleForm"
-          label-width="100px"
-          class="demo-ruleForm"
-        >
-          <el-form-item label="姓名" prop="name">
-            <el-input
-              v-model="ruleForm.name"
-              style="width: 250px"
-              placeholder="请输入名字"
-            ></el-input>
-          </el-form-item>
-          <el-form-item label="性别">
-            <el-radio-group v-model="ruleForm.sex">
-              <el-radio label="男"></el-radio>
-              <el-radio label="女"></el-radio>
-            </el-radio-group>
-          </el-form-item>
-          <el-form-item label="电子邮箱" prop="mail">
-            <el-input
-              v-model="ruleForm.mail"
-              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="请输入手机号码"
-              disabled
-            ></el-input>
-          </el-form-item>
-          <el-form-item label="学校选择" prop="school">
-            <el-input
-              v-model="ruleForm.school"
-              style="width: 300px"
-              disabled
-            ></el-input>
-            <!-- <el-select v-model="ruleForm.school" placeholder="请选择学校">
-              <el-option label="深圳实验学校" value="ssti"></el-option>
-              <el-option label="深圳第二职业学校" value="erzhi"></el-option>
-              <el-option label="深圳职业技术学院" value="jishu"></el-option>
-              <el-option label="深圳信息技术学院" value="xinxi"></el-option>
-            </el-select> -->
-          </el-form-item>
-          <el-form-item label="个人简介" prop="desc">
-            <el-input
-              type="textarea"
-              v-model="ruleForm.desc"
-              :rows="5"
-              resize="none"
-              placeholder="想说点什么..."
-            ></el-input>
-          </el-form-item>
-          <el-form-item>
-            <el-button type="primary" @click="submitForm('ruleForm')"
-              >修改</el-button
-            >
-          </el-form-item>
-        </el-form>
-      </div>
-    </div>
-  </div>
+	<div class="pb_content">
+		<div class="pb_head">
+			<span>我的资料</span>
+		</div>
+		<div class="pb_content_body">
+			<div style="width: 500px">
+				<el-form
+					:model="ruleForm"
+					:rules="rules"
+					ref="ruleForm"
+					label-width="100px"
+					class="demo-ruleForm"
+				>
+					<el-form-item label="姓名" prop="name">
+						<el-input
+							v-model="ruleForm.name"
+							style="width: 250px"
+							placeholder="请输入名字"
+						></el-input>
+					</el-form-item>
+					<el-form-item label="性别">
+						<el-radio-group v-model="ruleForm.sex">
+							<el-radio label="男"></el-radio>
+							<el-radio label="女"></el-radio>
+						</el-radio-group>
+					</el-form-item>
+					<el-form-item label="电子邮箱" prop="mail">
+						<el-input
+							v-model="ruleForm.mail"
+							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="学校选择" prop="school">
+						<el-select v-model="ruleForm.sBySchool" placeholder="请选择学校">
+							<el-option
+								v-for="(item, index) in schoolJuri"
+								:key="index"
+								:label="item.name"
+								:value="item.id"
+							>
+							</el-option>
+						</el-select>
+					</el-form-item>
+					<el-form-item label="个人简介" prop="desc">
+						<el-input
+							v-model="ruleForm.desc"
+							type="textarea"
+							:rows="5"
+							resize="none"
+							placeholder="想说点什么..."
+						></el-input>
+					</el-form-item>
+					<el-form-item>
+						<el-button type="primary" @click="submitForm('ruleForm')"
+							>修改</el-button
+						>
+					</el-form-item>
+				</el-form>
+			</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 {
-      ruleForm: {
-        name: "",
-        type: [],
-        sex: "男",
-        desc: "",
-        mail: "",
-        phone: "",
-        school: "",
-      },
-      rules: {
-        pass: [{ validator: validatePass, trigger: "blur" }],
-        name: [{ required: true, message: "请输入你的名字", trigger: "blur" }],
-        mail: [
-          {
-            validator: validatePass,
-            trigger: "blur",
-          },
-        ],
-        phone: [
-          { required: true, message: "请输入你的手机号码", trigger: "blur" },
+	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 {
+				ruleForm: {
+					name: "",
+					type: [],
+					sex: "男",
+					desc: "",
+					mail: "",
+					phone: "",
+					sBySchool: "",
+				},
+				schoolJuri: [],
+				rules: {
+					pass: [{ validator: validatePass, trigger: "blur" }],
+					name: [{ required: true, message: "请输入你的名字", trigger: "blur" }],
+					mail: [
+						{
+							validator: validatePass,
+							trigger: "blur",
+						},
+					],
+					phone: [
+						{ required: true, message: "请输入你的手机号码", trigger: "blur" },
 
-          {
-            validator: validatePass1,
-            trigger: "blur",
-          },
-        ],
-        // school: [{ required: true, message: "请选择学校", trigger: "change" }],
-      },
-    };
-  },
-  methods: {
-    getUser() {
-      let params = { uid:this.$store.state.userInfo.userid };
-      this.ajax
-        .get(this.$store.state.api + "getUser", params)
-        .then((res) => {
-          this.userinfo = res.data[0][0];
-          // window.sessionStorage.setItem(
-          //   "userInfo",
-          //   JSON.stringify(this.userinfo)
-          // );
-          this.$cookies.set("userInfo",this.userinfo,-1)
-          this.$store.commit("update", ["userInfo", this.userinfo]);
-          this.getClass();
-          console.log(res.data[0][0]);
-        })
-        .catch((err) => {
-          console.error(err);
-        });
-    },
-    submitForm(formName) {
-      this.$refs[formName];
-      let params = [
-        {
-          uid: this.$store.state.userInfo.userid,
-          n: this.ruleForm.name,
-          sex: this.ruleForm.sex == "男" ? "0" : "1",
-          mail: this.ruleForm.mail,
-          intro: this.ruleForm.desc,
-        },
-      ];
-      this.ajax
-        .post(this.$store.state.api + "updateTeacherDetail", params)
-        .then((res) => {
-          this.$message({
-            message: "修改成功",
-            type: "success",
-          });
-          this.getUser();
-        })
-        .catch((err) => {
-          this.$message.error("修改失败");
-          console.error(err);
-        });
-    },
-    getDetail() {
-      let params = { uid: this.$store.state.userInfo.userid };
-      this.ajax
-        .get(this.$store.state.api + "findteacherDeatail", params)
-        .then((res) => {
-          res.data[0][0].sex = res.data[0][0].sex ? "女" : "男";
-          this.ruleForm = res.data[0][0];
-        })
-        .catch((err) => {
-          // this.$message.error("删除失败");
-          console.error(err);
-        });
-    },
-  },
-  created() {
-    this.getDetail();
-  },
-};
+						{
+							validator: validatePass1,
+							trigger: "blur",
+						},
+					],
+				},
+			};
+		},
+		methods: {
+			getSchool() {
+				this.isLoading = true;
+				let params = {
+					page: this.page,
+				};
+				this.ajax
+					.get(this.$store.state.api + "selectOrg", params)
+					.then((res) => {
+						this.isLoading = false;
+						this.schoolJuri = res.data[0];
+					})
+					.catch((err) => {
+						this.isLoading = false;
+						console.error(err);
+					});
+			},
+			submitForm(formName) {
+				this.$refs[formName];
+				let params = [
+					{
+						uid: this.$store.state.userInfo.userid,
+						sname: this.ruleForm.name,
+            ph:this.ruleForm.phone,
+						sex: this.ruleForm.sex == "男" ? "0" : "1",
+						email: this.ruleForm.mail,
+            oid:this.ruleForm.sBySchool,
+						js: this.ruleForm.desc,
+					},
+				];
+				this.ajax
+					.post(this.$store.state.api + "updateUser", params)
+					.then((res) => {
+						this.$message({
+							message: "修改成功",
+							type: "success",
+						});
+            this.getDetail();
+					})
+					.catch((err) => {
+						this.$message.error("修改失败");
+						console.error(err);
+					});
+			},
+			getDetail() {
+				let params = { uid: this.$store.state.userInfo.userid };
+				this.ajax
+					.get(this.$store.state.api + "findTeacherDeail", params)
+					.then((res) => {
+						res.data[0][0].sex = res.data[0][0].sex ? "女" : "男";
+						this.ruleForm = res.data[0][0];
+					})
+					.catch((err) => {
+						// this.$message.error("删除失败");
+						console.error(err);
+					});
+			},
+		},
+		created() {
+			this.getSchool();
+			this.getDetail();
+		},
+	};
 </script>
 
 <style scoped>

+ 239 - 287
src/components/pages/notice.vue

@@ -1,295 +1,247 @@
 <template>
-  <div class="pb_content">
-    <div class="pb_head">
-      <span>通知公告</span>
-    </div>
-    <div class="pb_content_body">
-      <div class="student_table">
-        <el-table
-          ref="table"
-          :data="tableData"
-          border
-          :height="tableHeight"
-          :fit="true"
-          style="width: 100%"
-          :header-cell-style="{ background: '#f1f1f1' }"
-          :row-class-name="tableRowClassName"
-          v-loading="loading"
-        >
-          <el-table-column prop="title" label="通知标题" min-width="15">
-          </el-table-column>
-          <el-table-column prop="newscontent" label="通知内容" min-width="55">
-            <template slot-scope="scope">
-              <div
-                v-html="snippet(scope.row.newscontent)"
-                class="DivOverflow"
-              ></div>
-            </template>
-          </el-table-column>
-          <!-- <el-table-column prop="create" label="创建者" min-width="10">
-          </el-table-column> -->
-          <el-table-column prop="time" label="创建日期" min-width="15">
-          </el-table-column>
-          <el-table-column label="操作" min-width="20">
-            <template slot-scope="scope">
-              <el-button
-                @click="getNotice(scope.row.newsid)"
-                type="text"
-                size="small"
-                >查看通知</el-button
-              >
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <div class="student_page">
-        <el-pagination
-          background
-          layout="prev, pager, next"
-          :page-size="10"
-          :total="total"
-          @current-change="handleCurrentChange"
-        >
-        </el-pagination>
-      </div>
-    </div>
-    <el-dialog
-      title="查看通知"
-      :visible.sync="dialogVisible"
-      :append-to-body="true"
-      width="50%"
-      :before-close="handleClose"
-      class="dialog_diy"
-    >
-      <div>
-        <div class="pb_head">
-          <span style="font-size: 23px">{{ res.title }}</span>
-        </div>
-        <div class="notice_content cont" v-html="res.newscontent"></div>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisible = false" type="primary"
-          >关闭</el-button
-        >
-      </span>
-    </el-dialog>
-  </div>
+	<div class="pb_content">
+		<div class="pb_head">
+			<span>通知公告</span>
+		</div>
+		<div class="pb_content_body">
+			<div class="student_table">
+				<el-table
+					ref="table"
+					:data="tableData"
+					border
+					:height="tableHeight"
+					:fit="true"
+					style="width: 100%"
+					:header-cell-style="{ background: '#f1f1f1' }"
+					:row-class-name="tableRowClassName"
+					v-loading="loading"
+				>
+					<el-table-column
+						prop="content"
+						label="通知内容"
+						min-width="35"
+						align="center"
+						:show-overflow-tooltip="true"
+					>
+					</el-table-column>
+					<el-table-column
+						prop="creater"
+						label="创建者"
+						min-width="15"
+						align="center"
+					>
+						{{ this.tableData[0].creater ? this.tableData[0].creater : "未知" }}
+					</el-table-column>
+					<el-table-column
+						prop="creatTime"
+						label="创建时间"
+						min-width="25"
+						align="center"
+					>
+					</el-table-column>
+					<el-table-column label="操作" min-width="20">
+						<template slot-scope="scope">
+							<el-button
+								type="primary"
+								size="small"
+								@click="getNewDetail(scope.row.newsid)"
+								>查看通知</el-button
+							>
+						</template>
+					</el-table-column>
+				</el-table>
+			</div>
+			<div class="student_page">
+				<el-pagination
+					background
+					layout="prev, pager, next"
+					:page-size="10"
+					:total="total"
+					@current-change="handleCurrentChange"
+				>
+				</el-pagination>
+			</div>
+		</div>
+		<el-dialog
+			title="查看通知"
+			:visible.sync="dialogVisible"
+			:append-to-body="true"
+			width="50%"
+			:before-close="handleClose"
+			class="look_notice"
+		>
+			<div slot="title" class="header-title">
+				<div class="logoImg">
+					<img src="../../assets/logo.png" alt="" />
+				</div>
+				<div class="title_add_student">查看作业</div>
+			</div>
+			<div>
+				<div class="pb_head">
+					<span style="font-size: 20px">{{ res.title }}</span>
+					<span style="font-size: 15px; line-height: 35px">{{
+						this.tableData[0].creater
+					}}</span>
+				</div>
+				<div class="notice_content" v-html="res.newscontent"></div>
+			</div>
+			<span slot="footer" class="dialog-footer">
+				<el-button class="close" @click="dialogVisible = false" type="primary"
+					>关闭</el-button
+				>
+			</span>
+		</el-dialog>
+	</div>
 </template>
 
 <script>
-export default {
-  data() {
-    return {
-      tableHeight: 50,
-      input10: "",
-      fileList: "",
-      studentname: "",
-      studentphone: "",
-      formLabelWidth: "100px",
-      dialogVisible: false,
-      loading: false,
-      tableData: [],
-      page: 1,
-      total: 0,
-      res: [],
-    };
-  },
-  mounted() {
-    this.$nextTick(function () {
-      this.tableHeight =
-        window.innerHeight - this.$refs.table.$el.offsetTop - 200;
-      if (this.tableHeight <= 530) {
-        this.tableHeight = 530;
-      }
-      // 监听窗口大小变化
-      let self = this;
-      window.onresize = function () {
-        self.tableHeight =
-          window.innerHeight - self.$refs.table.$el.offsetTop - 200;
-        if (self.tableHeight <= 530) {
-          self.tableHeight = 530;
-        }
-      };
-    });
-    //this.$refs.table.$el.offsetTop:表格距离浏览器的高度 //200表示你想要调整的表格距离底部的高度(你可以自己随意调整),因为我们一般都有放分页组件的,所以需要给它留一个高度
-  },
-  methods: {
-    //在method里面写方法
-    snippet(value) {
-      return value.replace(/<[^>]*>/g, "");
-    },
-    tableRowClassName({ row, rowIndex }) {
-      if ((rowIndex + 1) % 2 === 0) {
-        return "even_row";
-      } else {
-        return "";
-      }
-    },
-    handleCurrentChange(val) {
-      this.page = val;
-      this.getNews();
-      console.log(`当前页: ${val}`);
-    },
-    handleClose(done) {
-      done();
-    },
-    //通知列表
-    getNews() {
-      this.loading = true;
-      let params = { uid:this.$store.state.userInfo.userid,page: this.page };
-      this.ajax
-        .get(this.$store.state.api + "getNewsTeacher", params)
-        .then((res) => {
-          this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
-          this.loading = false;
-          this.tableData = res.data[0];
-          console.log(res.data);
-        })
-        .catch((err) => {
-          this.loading = false;
-          console.error(err);
-        });
-    },
-    //
-    getNotice(id) {
-      let params = { nid: id };
-      this.ajax
-        .get(this.$store.state.api + "getNewByid", params)
-        .then((res) => {
-          this.dialogVisible = true;
-          this.res = res.data[0][0];
-          console.log(res.data);
-        })
-        .catch((err) => {
-          console.error(err);
-        });
-    },
-  },
-  created() {
-    this.getNews();
-  },
-};
+	export default {
+		data() {
+			return {
+				tableHeight: "500px",
+				page: 1,
+				total: 0,
+				isLoading: false,
+				formLabelWidth: "100px",
+				dialogVisible: false,
+				title: "国学经典之《汉书》",
+				newscontent:
+					"《汉书》,又称《前汉书》,由我国东汉时期的历史学家班固编撰,是中国第一部纪传体断代史,“二十四史之一”。" +
+					"《汉书》是继《史记》之后我国古代又一部重要史书,与《史记》、《后汉书》、《三国志》并称为“前四史”。《汉书》全书主要记述了上起西汉的汉高祖元年(公元前206年),下至新朝的王莽地皇四年,共230年的史事。" +
+					"《汉书》包括纪十二篇,表八篇,志十篇,传七十篇,共一百篇,后人划分一百二十卷,共八十万字。",
+				tableData: [],
+				res: [],
+			};
+		},
+		methods: {
+			snippet(value) {
+				return value.replace(/<[^>]*>/g, "");
+			},
+			tableRowClassName({ row, rowIndex }) {
+				if ((rowIndex + 1) % 2 === 0) {
+					return "even_row";
+				} else {
+					return "";
+				}
+			},
+			handleCurrentChange(val) {
+				this.page = val;
+			},
+			handleClose(done) {
+				done();
+			},
+			getNewDetail(id) {
+				this.dialogVisible = true;
+				let params = { nid: id };
+				this.ajax
+					.get(this.$store.state.api + "selectNewDetail", params)
+					.then((res) => {
+						this.dialogVisible = true;
+						this.res = res.data[0][0];
+					})
+					.catch((err) => {
+						this.loading = false;
+					});
+			},
+
+			getNews() {
+				this.loading = true;
+				let params = { uid: this.$store.state.userInfo.userid, page: this.page };
+				this.ajax
+					.get(this.$store.state.api + "getNewsTeacher", params)
+					.then((res) => {
+						this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
+						this.loading = false;
+						this.tableData = res.data[0];
+					})
+					.catch((err) => {
+						this.loading = false;
+					});
+			},
+		},
+		created() {
+			this.getNews();
+		},
+	};
 </script>
 
 <style scoped>
-.dialog_diy >>> .el-dialog__header {
-  background: #3d67bc !important;
-  padding: 15px 20px;
-}
-.dialog_diy >>> .el-dialog__title {
-  color: #fff;
-}
-.dialog_diy >>> .el-dialog__headerbtn {
-  top: 19px;
-}
-.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
-  color: #fff;
-}
-.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
-  color: #fff;
-}
-.student_head >>> .el-button--primary {
-  background-color: #2268bc;
-}
-.DivOverflow {
-  overflow: hidden;
-  text-overflow: ellipsis;
-}
-.xls_button {
-  font-size: 14px;
-  cursor: pointer;
-  text-decoration: underline;
-  color: rgb(34, 104, 188);
-}
-.student_head {
-  display: flex;
-  justify-content: space-between;
-}
-.student_search {
-  display: flex;
-  width: 300px;
-}
-.student_search span {
-  margin: 0 10px 0 0;
-}
-.student_button {
-  display: flex;
-  overflow: hidden;
-  height: 40px;
-}
-.student_button .el-button--primary {
-  margin-right: 10px;
-}
-.upload-demo {
-  display: flex;
-  flex-direction: column;
-  align-items: end;
-  /* position: relative; */
-  width: 100px;
-  overflow: hidden;
-}
-.student_table {
-  margin: 20px 0;
-}
-
-.el-table >>> .even_row {
-  background-color: #f1f1f1;
-}
-.el-table >>> .cell {
-  white-space: nowrap;
-}
-.notice_content {
-  width: 95%;
-  margin: 0 auto;
-  font-size: 18px;
-  text-indent: 2em;
-}
-.notice_content span {
-}
-/* table 样式 */
-.cont >>> table {
-  border-top: 1px solid #ccc;
-  border-left: 1px solid #ccc;
-}
-.cont >>> table td,
-.cont >>> table th {
-  border-bottom: 1px solid #ccc;
-  border-right: 1px solid #ccc;
-  padding: 3px 5px;
-}
-.cont >>> table th {
-  border-bottom: 2px solid #ccc;
-  text-align: center;
-}
-
-/* blockquote 样式 */
-.cont >>> blockquote {
-  display: block;
-  border-left: 8px solid #d0e5f2;
-  padding: 5px 10px;
-  margin: 10px 0;
-  line-height: 1.4;
-  font-size: 100%;
-  background-color: #f1f1f1;
-}
-
-/* code 样式 */
-.cont >>> code {
-  display: inline-block;
-  *display: inline;
-  *zoom: 1;
-  background-color: #f1f1f1;
-  border-radius: 3px;
-  padding: 3px 5px;
-  margin: 0 3px;
-}
-.cont >>> pre code {
-  display: block;
-}
-
-/* ul ol 样式 */
-.cont >>> ul,
-ol {
-  margin: 10px 0 10px 20px;
-}
+	.pb_head {
+		display: flex;
+		justify-content: space-between;
+	}
+	.student_head {
+		margin-bottom: 20px;
+	}
+	.student_search {
+		display: flex;
+	}
+	.student_search > div:nth-child(1) {
+		line-height: 35px;
+		font-size: 14px;
+	}
+	.student_search >>> .el-input__inner {
+		width: 190px;
+		height: 35px;
+		margin-left: 10px;
+	}
+	.student_table >>> .el-table--border td {
+		border-right: 0px !important;
+	}
+	.header-title {
+		display: flex;
+	}
+	.logoImg {
+		width: 30px;
+	}
+	.logoImg > img {
+		width: 100%;
+		height: 100%;
+	}
+	.title_add_student {
+		margin: 0 auto;
+		color: #fff;
+	}
+	.look_notice >>> .el-dialog__header {
+		padding: 20px 20px 10px;
+		text-align: center;
+		background: #32455b;
+	}
+	.look_notice >>> .el-dialog__title {
+		font-size: 14px !important;
+		color: #fff !important;
+	}
+	.look_notice >>> .el-dialog__headerbtn {
+		font-size: 20px !important;
+	}
+	.look_notice >>> .el-form-item__label {
+		margin-left: 65px;
+	}
+	.look_notice >>> .el-form-item {
+		display: flex;
+	}
+	.look_notice >>> .el-form-item__content {
+		margin: 0 !important;
+	}
+	.look_notice >>> .el-dialog__footer {
+		text-align: center !important;
+	}
+	.notice_content {
+		margin: 20px 0 0 20px;
+		width: 850px;
+		word-wrap: break-word;
+		word-break: break-all;
+		overflow: hidden;
+		font-size: 18px;
+		line-height: 35px;
+		text-indent: 35px;
+	}
+	.close {
+		width: 320px;
+		height: 30px;
+		line-height: 30px;
+		font-size: 14px;
+		background: #0e72e6;
+		padding: 0 !important;
+	}
 </style>

+ 767 - 706
src/components/pages/student.vue

@@ -1,718 +1,779 @@
 <template>
-  <div class="pb_content" style="min-width: 960px">
-    <div class="pb_head">
-      <span>学生列表</span>
-    </div>
-    <div class="pb_content_body">
-      <div class="student_head">
-        <div class="student_search">
-          <div style="color: #ababab; font-size: 15px; min-width: 70px">
-            条件筛选
-          </div>
-          <el-select
-            v-model="classX"
-            placeholder="筛选的班级"
-            no-data-text="此学校暂无班级"
-            style="min-width: 150px"
-            @change="search"
-          >
-            <el-option label="所有班级" value=""></el-option>
-            <el-option
-              v-for="item in classList"
-              :key="item.id"
-              :label="item.name"
-              :value="item.id"
-            ></el-option>
-          </el-select>
-          <span>
-            <el-input
-              placeholder="请输入手机号或用户名"
-              v-model="studentnameA"
-              clearable
-              style="margin-left: 5px; width: 190px"
-            >
-            </el-input>
-          </span>
-          <el-button type="primary" @click="search">查询</el-button>
-        </div>
-        <div class="student_button">
-          <el-button type="primary" @click="dialogVisible = true"
-            >添加学生</el-button
-          >
-          <!-- <el-button type="primary">批量添加</el-button> -->
-          <el-upload
-            class="upload-demo"
-            :http-request="handleChange"
-            :on-remove="handleRemove"
-            action="#"
-            :file-list="fileListUpload"
-            accept=".xlsx"
-          >
-            <el-button size="primary" type="primary">点击上传</el-button>
-            <!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> -->
-          </el-upload>
-          <el-button type="text" class="xls_button" @click="getExcel"
-            >xls上传样例</el-button
-          >
-          <div style="margin-left: 5px">共{{ total }}名学生</div>
-        </div>
-      </div>
-      <div class="student_table">
-        <el-table
-          ref="table"
-          :data="tableData"
-          border
-          :height="tableHeight"
-          :fit="true"
-          style="width: 100%"
-          :header-cell-style="{ background: '#f1f1f1' }"
-          :row-class-name="tableRowClassName"
-          v-loading="isLoading"
-        >
-          <el-table-column prop="name" label="姓名" min-width="15">
-            <template slot-scope="scope">
-              <span>{{
-                scope.row.state ? scope.row.name : scope.row.name + "(已被屏蔽)"
-              }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column prop="phonenumber" label="电话" min-width="15">
-          </el-table-column>
-          <el-table-column prop="parentname" label="家长姓名" min-width="10">
-            <template slot-scope="scope">
-              <span>{{
-                scope.row.parentname ? scope.row.parentname : "暂无填写"
-              }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column prop="school" label="学校" min-width="25">
-          </el-table-column>
-          <el-table-column prop="class" label="班级" min-width="15">
-          </el-table-column>
-          <el-table-column label="操作" min-width="20">
-            <template slot-scope="scope">
-              <el-button
-                @click="handleDelete(scope.row.userid, scope.row.state)"
-                type="text"
-                size="small"
-                >{{ scope.row.state ? "屏蔽" : "恢复" }}</el-button
-              >
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <div class="student_page">
-        <el-pagination
-          background
-          layout="prev, pager, next"
-          :page-size="10"
-          :total="total"
-          v-if="!isListAjax && page"
-          @current-change="handleCurrentChange"
-        >
-        </el-pagination>
-      </div>
-    </div>
-    <el-dialog
-      title="添加学生"
-      :visible.sync="dialogVisible"
-      :append-to-body="true"
-      width="450px"
-      :before-close="handleClose"
-      class="dialog_diy"
-    >
-      <el-form>
-        <el-form-item label="学生名称" :label-width="formLabelWidth">
-          <el-input
-            v-model="studentname"
-            auto-complete="off"
-            placeholder="请输入学生名称..."
-          ></el-input>
-        </el-form-item>
-        <el-form-item label="学生手机号" :label-width="formLabelWidth">
-          <el-input
-            v-model="studentphone"
-            auto-complete="off"
-            placeholder="请输入学生手机号..."
-          ></el-input>
-        </el-form-item>
-        <el-form-item label="所属学校" :label-width="formLabelWidth">
-          <el-input
-            :value="this.$store.state.userInfo.schoolName"
-            auto-complete="off"
-            disabled
-          ></el-input>
-          <!-- <el-select v-model="school">
-            <el-option label="深圳实验学校" value="ssti"></el-option>
-            <el-option label="深圳第二职业学校" value="erzhi"></el-option>
-            <el-option label="深圳职业技术学院" value="jishu"></el-option>
-            <el-option label="深圳南山第二实验学校" value="xinxi"></el-option>
-          </el-select> -->
-        </el-form-item>
-        <el-form-item label="班级" :label-width="formLabelWidth">
-          <el-select
-            v-model="classA"
-            placeholder="请选择学生所属的班级"
-            no-data-text="此学校暂无班级"
-          >
-            <el-option
-              v-for="item in classList"
-              :key="item.id"
-              :label="item.name"
-              :value="item.id"
-            ></el-option>
-          </el-select>
-          <span style="display: block; color: #aaa"
-            >注:添加学生账户密码为123456</span
-          >
-        </el-form-item>
-      </el-form>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="addPopup">确 定</el-button>
-      </span>
-    </el-dialog>
-  </div>
+	<div class="pb_content" style="min-width: 960px">
+		<div class="pb_head">
+			<span>学生列表</span>
+			<span>Student List</span>
+		</div>
+		<div class="pb_content_body">
+			<div class="student_head">
+				<div class="head_left">
+					<el-input
+						v-model="sPhoneUser"
+						class="student_input"
+						placeholder="请输入手机号或用户名"
+					></el-input>
+					<el-button class="student_button" @click="searchStudent"
+						>查询</el-button
+					>
+				</div>
+				<div class="head_right">
+					<el-button @click="addStudent">添加学生</el-button>
+					<el-upload
+						class="upload-demo"
+						:http-request="handleChange"
+						:on-remove="handleRemove"
+						action="#"
+						:file-list="fileListUpload"
+						accept=".xlsx"
+					>
+						<el-button size="primary" type="primary">批量添加</el-button>
+						<!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> -->
+					</el-upload>
+					<div @click="getExcel">xls 上传样例</div>
+				</div>
+			</div>
+			<div class="student_table">
+				<el-table
+					ref="table"
+					:data="tableData"
+					border
+					:height="tableHeight"
+					:fit="true"
+					v-loading="isLoading"
+					style="width: 100%"
+					:header-cell-style="{ background: '#f1f1f1' }"
+					:row-class-name="tableRowClassName"
+					stripe
+				>
+					<el-table-column
+						prop="name"
+						label="姓名"
+						min-width="10"
+						align="center"
+					>
+					</el-table-column>
+					<el-table-column
+						prop="phonenumber"
+						label="电话"
+						min-width="15"
+						align="center"
+					>
+					</el-table-column>
+					<el-table-column
+						prop="sex"
+						label="性别"
+						min-width="10"
+						align="center"
+					>
+						{{ this.tableData.sex ? this.tableData.sex : "男" }}
+					</el-table-column>
+					<el-table-column
+						prop="school"
+						label="学校"
+						min-width="30"
+						align="center"
+					>
+					</el-table-column>
+					<el-table-column
+						prop="class"
+						label="班级"
+						min-width="15"
+						align="center"
+					>
+					</el-table-column>
+					<el-table-column label="操作" min-width="20">
+						<template slot-scope="scope">
+							<el-button
+								class="de_button"
+								type="primary"
+								size="small"
+								@click="deleteStudent(scope.row.id)"
+								>删除</el-button
+							>
+						</template>
+					</el-table-column>
+				</el-table>
+				<el-dialog
+					:visible.sync="dialogVisible"
+					:append-to-body="true"
+					width="700px"
+					:before-close="handleClose"
+					class="add_student"
+				>
+					<div slot="title" class="header-title">
+						<div class="logoImg">
+							<img src="../../assets/logo.png" alt="" />
+						</div>
+						<div class="title_add_student">添加学生</div>
+					</div>
+					<el-form>
+						<el-form-item label="学生名称" :label-width="formLabelWidth">
+							<span>
+								<el-input
+									placeholder="请输入学生昵称"
+									clearable
+									v-model="sName"
+									class="add_input"
+								></el-input>
+							</span>
+						</el-form-item>
+						<el-form-item label="学生手机号" :label-width="formLabelWidth">
+							<span>
+								<el-input
+									placeholder="请输入学生手机号"
+									clearable
+									v-model="sPhone"
+									class="add_input"
+								></el-input>
+							</span>
+						</el-form-item>
+						<el-form-item label="所属学校" :label-width="formLabelWidth">
+							<el-select v-model="sBySchool" placeholder="请选择学校">
+								<el-option
+									v-for="(item, index) in schoolJuri"
+									:key="index"
+									:label="item.name"
+									:value="item.id"
+								>
+								</el-option>
+							</el-select>
+						</el-form-item>
+						<el-form-item label="班级" :label-width="formLabelWidth">
+							<el-select v-model="sByClass" placeholder="请选择班级">
+								<el-option
+									v-for="(item, index) in classJuri"
+									:key="index"
+									:label="item.name"
+									:value="item.id"
+								>
+								</el-option>
+							</el-select>
+						</el-form-item>
+					</el-form>
+					<span slot="footer" class="dialog-footer flex">
+						<el-button class="right" @click="insertStudent">确认</el-button>
+					</span>
+				</el-dialog>
+			</div>
+			<div class="student_page">
+				<el-pagination
+					background
+					layout="prev, pager, next"
+					:page-size="10"
+					:total="total"
+					@current-change="handleCurrentChange"
+				>
+				</el-pagination>
+			</div>
+		</div>
+	</div>
 </template>
 
 <script>
-import $ from "jquery";
-export default {
-  data() {
-    return {
-      isLoading: false,
-      page: 1,
-      total: 0,
-      tableHeight: 50,
-      studentname: "",
-      fileListUpload: [],
-      studentnameA: "",
-      studentphone: "",
-      formLabelWidth: "100px",
-      dialogVisible: false,
-      tableData: [],
-      school: "",
-      classA: "",
-      classList: "",
-      classX: "",
-      isListAjax: false,
-    };
-  },
-  mounted() {
-    this.$nextTick(function () {
-      this.tableHeight =
-        window.innerHeight - this.$refs.table.$el.offsetTop - 200;
-      if (this.tableHeight <= 530) {
-        this.tableHeight = 530;
-      }
-      // 监听窗口大小变化
-      let self = this;
-      window.onresize = function () {
-        self.tableHeight =
-          window.innerHeight - self.$refs.table.$el.offsetTop - 200;
-        if (self.tableHeight <= 530) {
-          self.tableHeight = 530;
-        }
-      };
-    });
-    //this.$refs.table.$el.offsetTop:表格距离浏览器的高度 //200表示你想要调整的表格距离底部的高度(你可以自己随意调整),因为我们一般都有放分页组件的,所以需要给它留一个高度
-  },
-  methods: {
-    tableRowClassName({ row, rowIndex }) {
-      if ((rowIndex + 1) % 2 === 0) {
-        return "even_row";
-      } else {
-        return "";
-      }
-    },
-    handleDelete(id, state) {
-      console.log(id);
-      let params = [{ uid: id, state: state == 1 ? "0" : "1" }];
-      this.$confirm("确定" + (state ? "屏蔽" : "恢复") + "此学生吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.ajax
-            .post(this.$store.state.api + "deleteStudent", params)
-            .then((res) => {
-              this.$message({
-                message: "操作成功",
-                type: "success",
-              });
-              // if (this.page != 1 && this.tableData.length == 1) {
-              //   this.page--;
-              // }
-              this.getStudent();
-            })
-            .catch((err) => {
-              this.$message.error("操作失败");
-              console.error(err);
-            });
-        })
-        .catch(() => {});
-    },
-    handleClose(done) {
-      done();
-    },
-    //导出上传样例
-    getExcel(res) {
-      require.ensure([], () => {
-        const { export_json_to_excel } = require("../../common/Export2Excel");
-        const tHeader = [
-          "学生名称",
-          "学生手机号",
-          "班级",
-          "(注:导入学校为:" +
-            this.$store.state.userInfo.schoolName +
-            ",密码为123456)",
-        ];
-        // const filterVal = ["name", "phone", "school", "grade"];
-        // const list = [
-        //   {
-        //     name: "6",
-        //     phone: "su",
-        //     school: "sue",
-        //     grade: 3423,
-        //   },
-        // ];
-        // this.formatJson(filterVal, list)
-        const data = [];
-        export_json_to_excel(tHeader, data, "上传学生样例");
-      });
-    },
-    formatJson(filterVal, jsonData) {
-      return jsonData.map((v) => filterVal.map((j) => v[j]));
-    },
+	import $ from "jquery";
+	export default {
+		data() {
+			return {
+				tableHeight: "500px",
+				isLoading: false,
+				formLabelWidth: "100px",
+				tableData: [],
+				dialogVisible: false,
+				sName: "",
+				sPhone: "",
+				sBySchool: "",
+				sByClass: "",
+				schoolJuri: [],
+				classJuri: [],
+				fileListUpload: [],
+				page: 1,
+				total: 0,
+				sPhoneUser: "",
+			};
+		},
+		mounted() {
+			this.$nextTick(function () {
+				this.tableHeight =
+					window.innerHeight - this.$refs.table.$el.offsetTop - 200;
+				if (this.tableHeight <= 530) {
+					this.tableHeight = 530;
+				}
+				// 监听窗口大小变化
+				let self = this;
+				window.onresize = function () {
+					self.tableHeight =
+						window.innerHeight - self.$refs.table.$el.offsetTop - 200;
+					if (self.tableHeight <= 530) {
+						self.tableHeight = 530;
+					}
+				};
+			});
+		},
+		methods: {
+			tableRowClassName({ row, rowIndex }) {
+				if ((rowIndex + 1) % 2 === 0) {
+					return "even_row";
+				} else {
+					return "";
+				}
+			},
+			searchStudent() {
+				this.page = 1;
+				this.getStudent();
+			},
+			addStudent() {
+				this.dialogVisible = true;
+				(this.sName = ""),
+					(this.sPhone = ""),
+					(this.sBySchool = ""),
+					(this.sByClass = "");
+				this.getClass();
+				this.getSchool();
+			},
+			handleClose(done) {
+				done();
+			},
+			getExcel(res) {
+				require.ensure([], () => {
+					const { export_json_to_excel } = require("../../common/Export2Excel");
+					const tHeader = [
+						"学生姓名",
+						"学生手机号",
+						"性别",
+						"学校",
+						"班级",
+						"(注:导入学校为:" + this.$store.state.userInfo.schoolName + ")",
+					];
+					const data = [];
+					export_json_to_excel(tHeader, data, "上传学生样例");
+				});
+			},
+			handleCurrentChange(val) {
+				this.page = val;
+			},
+			time() {
+				if (!this.now) {
+					this.now = new Date().getTime();
+					return true;
+				} else {
+					let time = new Date().getTime();
+					if (time - this.now > 3000) {
+						this.now = time;
+						return true;
+					} else {
+						return false;
+					}
+				}
+			},
+			//新增学生
+			insertStudent() {
+				this.dialogVisible = true;
+				if (this.sName === "") {
+					this.$message.error("学生昵称不能为空");
+					return;
+				} else if (this.sPhone === "") {
+					this.$message.error("学生手机号不能为空");
+					return;
+				} else if (this.sByClass === "") {
+					this.$message.error("请为学生选择班级");
+					return;
+				} else if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.sPhone)) {
+					this.$message.error("手机号格式不正确");
+					return;
+				} else if (this.sBySchool === "") {
+					this.$message.error("请为学生选择班级");
+					return;
+				}
+				if (this.time()) {
+					let params = { un: this.sPhone };
+					this.ajax
+						.get(this.$store.state.api + "findPhone", params)
+						.then((res) => {
+							if (res.data[0].length > 0) {
+								this.$message.error("此学生手机号码已被注册");
+							} else {
+								this.add_Student();
+							}
+						})
+						.catch((err) => {
+							console.error(err);
+						});
+				}
+			},
+			add_Student() {
+				let params = {
+					ph: this.sPhone,
+					username: this.sName,
+					type: 2,
+					oid: this.sBySchool,
+					tid: this.$store.state.userInfo.userid,
+					cid: this.sByClass,
+				};
+				this.ajax
+					.get(this.$store.state.api + "insertStudent", params)
+					.then((res) => {
+						this.isLoading = false;
+						this.$message({
+							message: "新增成功",
+							type: "success",
+						});
+						this.dialogVisible = false;
+						this.sPhone = "";
+						this.sName = "";
+						this.sBySchool = [];
+						this.sByClass = [];
+						this.getStudent();
+					})
+					.catch((err) => {
+						this.isLoading = false;
+						this.$message({
+							message: "新增失败",
+							type: "error",
+						});
+						console.error(err);
+					});
+			},
+			//获取班级列表
+			getClass() {
+				this.isLoading = true;
+				let params = {
+					// username: this.$store.state.userInfo.userid,
+					cu: "",
+					cn: "",
+					page: this.page,
+				};
+				this.ajax
+					.get(this.$store.state.api + "selectClass", params)
+					.then((res) => {
+						this.isLoading = false;
+						this.classJuri = res.data[0];
+					})
+					.catch((err) => {
+						this.isLoading = false;
+						console.error(err);
+					});
+			},
+			getSchool() {
+				this.isLoading = true;
+				let params = {
+					page: this.page,
+				};
+				this.ajax
+					.get(this.$store.state.api + "selectOrg", params)
+					.then((res) => {
+						this.isLoading = false;
+						this.schoolJuri = res.data[0];
+					})
+					.catch((err) => {
+						this.isLoading = false;
+						console.error(err);
+					});
+			},
+			getStudent() {
+				this.isLoading = true;
+				let params = {
+					uid: this.$store.state.userInfo.userid,
+					cu: "",
+					cn: this.sPhoneUser,
+					page: this.page,
+				};
+				this.ajax
+					.get(this.$store.state.api + "selectStudent", params)
+					.then((res) => {
+						this.isLoading = false;
+						this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
+						this.tableData = res.data[0];
+					})
+					.catch((err) => {
+						this.isLoading = false;
+						console.error(err);
+					});
+			},
+			handleChange(file) {
+				this.fileTemp = file.file;
+				if (this.fileTemp) {
+					if (
+						this.fileTemp.type ==
+							"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ||
+						this.fileTemp.type == "application/vnd.ms-excel"
+					) {
+						this.importCount = 1;
+						this.importfxx(this.fileTemp);
+					} else {
+						this.$message({
+							type: "warning",
+							message: "附件格式错误,请删除后重新上传!",
+						});
+					}
+				} else {
+					this.$message({
+						type: "warning",
+						message: "请上传附件!",
+					});
+				}
+			},
+			handleRemove(file, fileList) {
+				this.fileTemp = null;
+			},
+			importfxx(obj) {
+				const loading = this.$loading.service({
+					background: "rgba(255, 255, 255, 0.7)",
+					target: document.body,
+				});
+				var _$ = $;
+				this.importCount++;
+				let _this = this;
+				// 通过DOM取文件数据
+				this.file = obj;
+				var rABS = false; //是否将文件读取为二进制字符串
+				var f = this.file;
+				var reader = new FileReader();
+				//if (!FileReader.prototype.readAsBinaryString) {
+				FileReader.prototype.readAsBinaryString = function (f) {
+					var binary = "";
+					var rABS = false; //是否将文件读取为二进制字符串
+					var pt = this;
+					var wb; //读取完成的数据
+					var outdata;
+					var reader = new FileReader();
+					reader.onload = function (e) {
+						var bytes = new Uint8Array(reader.result);
+						var length = bytes.byteLength;
+						for (var i = 0; i < length; i++) {
+							binary += String.fromCharCode(bytes[i]);
+						}
+						var XLSX = require("xlsx");
+						if (rABS) {
+							wb = XLSX.read(btoa(fixdata(binary)), {
+								//手动转化
+								type: "base64",
+							});
+						} else {
+							wb = XLSX.read(binary, {
+								type: "binary",
+							});
+						}
+						outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]); //outdata就是你想要的东西
+						this.da = [...outdata];
+						let arr = [];
+						this.da.map((v) => {
+							let obj = {};
+							obj.name = v["学生姓名"];
+							obj.phone = v["学生手机号"];
+							obj.sex = v["性別"];
+							obj.school = v["学校"];
+							obj.class = v["班级"];
+							arr.push(obj);
+						});
+						console.log(arr);
+						let _b = 1;
+						for (var i = 0; i < arr.length; i++) {
+							let item = arr[i];
+							if (item.class === "") {
+								_b = 1;
+								_this.$message.error("学生班级不能为空,请重新上传");
+								break;
+							} else if (item.name === "") {
+								_b = 1;
+								_this.$message.error("学生姓名不能为空,请重新上传");
+								break;
+							} else if (item.phone === "") {
+								_b = 1;
+								_this.$message.error("学生手机号不能为空,请重新上传");
+								break;
+							} else if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(item.phone)) {
+								_b = 1;
+								_this.$message.error("有学生手机号格式不正确,请重新上传");
+								break;
+							} else if (item.school === "") {
+								_b = 1;
+								_this.$message.error("学生学校不能为空,请重新上传");
+								break;
+							} else if (item.sex === "") {
+								_b = 1;
+								_this.$message.error("学生性别不能为空,请重新上传");
+								break;
+							}
+							if (item.class != "") {
+								let _a;
+								let params = {
+									className: item.class,
+								};
 
-    handleChange(file) {
-      this.fileTemp = file.file;
-      if (this.fileTemp) {
-        if (
-          this.fileTemp.type ==
-            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ||
-          this.fileTemp.type == "application/vnd.ms-excel"
-        ) {
-          this.importCount = 1;
-          this.importfxx(this.fileTemp);
-        } else {
-          this.$message({
-            type: "warning",
-            message: "附件格式错误,请删除后重新上传!",
-          });
-        }
-      } else {
-        this.$message({
-          type: "warning",
-          message: "请上传附件!",
-        });
-      }
-    },
-    handleRemove(file, fileList) {
-      this.fileTemp = null;
-    },
-    //导入
-    importfxx(obj) {
-      const loading = this.$loading.service({
-        background: "rgba(255, 255, 255, 0.7)",
-        target: document.body,
-      });
-      var _$ = $;
-      this.importCount++;
-      let _this = this;
-      // 通过DOM取文件数据
-      this.file = obj;
-      var rABS = false; //是否将文件读取为二进制字符串
-      var f = this.file;
-      var reader = new FileReader();
-      //if (!FileReader.prototype.readAsBinaryString) {
-      FileReader.prototype.readAsBinaryString = function (f) {
-        var binary = "";
-        var rABS = false; //是否将文件读取为二进制字符串
-        var pt = this;
-        var wb; //读取完成的数据
-        var outdata;
-        var reader = new FileReader();
-        reader.onload = function (e) {
-          var bytes = new Uint8Array(reader.result);
-          var length = bytes.byteLength;
-          for (var i = 0; i < length; i++) {
-            binary += String.fromCharCode(bytes[i]);
-          }
-          var XLSX = require("xlsx");
-          if (rABS) {
-            wb = XLSX.read(btoa(fixdata(binary)), {
-              //手动转化
-              type: "base64",
-            });
-          } else {
-            wb = XLSX.read(binary, {
-              type: "binary",
-            });
-          }
-          outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]); //outdata就是你想要的东西
-          this.da = [...outdata];
-          let arr = [];
-          this.da.map((v) => {
-            let obj = {};
-            obj.name = v["学生名称"];
-            obj.phone = v["学生手机号"];
-            // obj.school = v["所属学校"];
-            obj.class = v["班级"];
-            arr.push(obj);
-          });
-          console.log(arr);
-          let _b = 1;
-          for (var i = 0; i < arr.length; i++) {
-            let item = arr[i];
-            if (item.class === "") {
-              _b = 1;
-              _this.$message.error("学生班级不能为空,请重新上传");
-              break;
-            } else if (item.name === "") {
-              _b = 1;
+								_$.ajax({
+									url: _this.$store.state.api + "selectC", //url路径
+									type: "GET", //GET
+									async: false, //或false,是否异步
+									data: params,
+									timeout: 5000, //超时时间
+									dataType: "json", //返回的数据格式:
+									beforeSend: function (xhr) {},
+									success: function (res, textStatus, jqXHR) {
+										if (res[0].length == 0) {
+											_a = 1;
+											_this.$message.error(
+												"有学生班级不存在,请去添加后并重新上传"
+											);
+										} else {
+											item.classid = res[0][0].id;
+										}
+									},
+									error: function (xhr, textStatus) {
+										console.log(textStatus);
+									},
+									complete: function () {},
+								});
+								if (_a == 1) {
+									_b = 1;
+									break;
+								}
+							}
+							if (item.school != "") {
+								let _a;
+								let params = {
+									schoolName: item.school,
+								};
 
-              _this.$message.error("学生班级不能为空,请重新上传");
-              break;
-            } else if (item.phone === "") {
-              _b = 1;
+								_$.ajax({
+									url: _this.$store.state.api + "selectS", //url路径
+									type: "GET", //GET
+									async: false, //或false,是否异步
+									data: params,
+									timeout: 5000, //超时时间
+									dataType: "json", //返回的数据格式:
+									beforeSend: function (xhr) {},
+									success: function (res, textStatus, jqXHR) {
+										if (res[0].length == 0) {
+											_a = 1;
+											_this.$message.error(
+												"有学生学校不存在,请去添加后并重新上传"
+											);
+										} else {
+											item.schoolid = res[0][0].id;
+										}
+									},
+									error: function (xhr, textStatus) {
+										console.log(textStatus);
+									},
+									complete: function () {},
+								});
+								if (_a == 1) {
+									_b = 1;
+									break;
+								}
+							}
+							if (item.phone != "") {
+								let params = { un: item.phone };
+								let _a;
+								_$.ajax({
+									url: _this.$store.state.api + "findPhone", //url路径
+									type: "GET", //GET
+									async: false, //或false,是否异步
+									data: params,
+									timeout: 5000, //超时时间
+									dataType: "json", //返回的数据格式:
+									beforeSend: function (xhr) {},
+									success: function (res, textStatus, jqXHR) {
+										if (res[0].length > 0) {
+											_this.$message.error("此学生手机号码已被注册");
+											_a = 1;
+										}
+									},
+									error: function (xhr, textStatus) {
+										console.log(textStatus);
+									},
+									complete: function () {},
+								});
+								if (_a == 1) {
+									_b = 1;
+									break;
+								}
+							}
+							_b = 2;
+						}
+						if (_b == 2) {
+							for (var i = 0; i < arr.length; i++) {
+								let _i = i;
+								let item = arr[i];
+								let params = [
+									{
+										ph: item.phone,
+										username: item.name,
+										type: 2,
+										oid: item.schoolid,
+										tid: _this.$store.state.userInfo.userid,
+										cid: item.classid,
+									},
+								];
+								_this.ajax
+									.post(_this.$store.state.api + "iStudent", params)
+									.then((res) => {
+										if (_i == arr.length - 1) {
+											loading.close();
+											_this.$message({
+												message: "上传成功",
+												type: "success",
+											});
+											_this.getStudent();
+										}
+									})
+									.catch((err) => {
+										_this.$message.error("添加失败");
+										console.error(err);
+									});
+							}
+						} else {
+							loading.close();
+						}
 
-              _this.$message.error("学生手机号不能为空,请重新上传");
-              break;
-            } else if (!/^1\d{10}$/.test(item.phone)) {
-              _b = 1;
+						_this.fileListUpload = [];
+					};
+					reader.readAsArrayBuffer(f);
+				};
 
-              _this.$message.error("有学生手机号格式不正确,请重新上传");
-              break;
-            }
-            if (item.class != "") {
-              let _a;
-              let params = {
-                uid: _this.$store.state.userInfo.organizeid,
-                name: item.class,
-                bn: _this.$store.state.userInfo.schoolName,
-              };
-
-              _$.ajax({
-                url: _this.$store.state.api + "findClassBoolean", //url路径
-                type: "GET", //GET
-                async: false, //或false,是否异步
-                data: params,
-                timeout: 5000, //超时时间
-                dataType: "json", //返回的数据格式:
-                beforeSend: function (xhr) {},
-                success: function (res, textStatus, jqXHR) {
-                  if (res[0].length == 0) {
-                    _a = 1;
-                    _this.$message.error(
-                      "有学生班级不存在,请联系管理员添加后并重新上传"
-                    );
-                  } else {
-                    item.classid = res[0][0].id;
-                  }
-                },
-                error: function (xhr, textStatus) {
-                  console.log(textStatus);
-                },
-                complete: function () {},
-              });
-              if (_a == 1) {
-                _b = 1;
-                break;
-              }
-            }
-            // if (item.phone != "") {
-            //   let params = { un: item.phone };
-            //   let _a;
-            //   _$.ajax({
-            //     url: _this.$store.state.api + "findPhoneBoolean", //url路径
-            //     type: "GET", //GET
-            //     async: false, //或false,是否异步
-            //     data: params,
-            //     timeout: 5000, //超时时间
-            //     dataType: "json", //返回的数据格式:
-            //     beforeSend: function (xhr) {},
-            //     success: function (res, textStatus, jqXHR) {
-            //       if (res[0].length > 0) {
-            //         _this.$message.error("此学生手机号码已被注册");
-            //         _a = 1;
-            //       }
-            //     },
-            //     error: function (xhr, textStatus) {
-            //       console.log(textStatus);
-            //     },
-            //     complete: function () {},
-            //   });
-            //   if (_a == 1) {
-            //     _b = 1;
-            //     break;
-            //   }
-            // }
-            _b = 2;
-          }
-          if (_b == 2) {
-            console.log("11111111111111111111");
-            for (var i = 0; i < arr.length; i++) {
-              let _i = i;
-              let item = arr[i];
-              let params = {
-                uname: item.phone,
-                upassword: 123456,
-                oid: _this.$store.state.userInfo.organizeid,
-                n: item.name,
-                cid: item.classid,
-                tid: _this.$store.state.userInfo.userid,
-              };
-              // _this.ajax
-              //   .post(_this.$store.state.api + "addStudent", params)
-              //   .then((res) => {
-              //     if (_i == arr.length - 1) {
-              //       loading.close();
-              //       _this.$message({
-              //         message: "上传成功",
-              //         type: "success",
-              //       });
-              //       _this.getStudent();
-              //     }
-              //   })
-              //   .catch((err) => {
-              //     _this.$message.error("添加失败");
-              //     console.error(err);
-              //   });
-              _$.ajax({
-                url: _this.$store.state.api + "addStudent", //url路径
-                type: "GET", //GET
-                async: false, //或false,是否异步
-                data: params,
-                timeout: 5000, //超时时间
-                dataType: "json", //返回的数据格式:
-                beforeSend: function (xhr) {},
-                success: function (res, textStatus, jqXHR) {
-                  if (_i == arr.length - 1) {
-                    loading.close();
-                    _this.$message({
-                      message: "上传成功",
-                      type: "success",
-                    });
-                    _this.getStudent();
-                  }
-                },
-                error: function (xhr, textStatus) {
-                  _this.$message.error("添加失败");
-                  console.log(textStatus);
-                },
-                complete: function () {},
-              });
-            }
-          } else {
-            loading.close();
-          }
-
-          _this.fileListUpload = [];
-        };
-        reader.readAsArrayBuffer(f);
-      };
-
-      if (rABS) {
-        reader.readAsArrayBuffer(f);
-      } else {
-        reader.readAsBinaryString(f);
-      }
-    },
-    //获取学生
-    getStudent() {
-      this.isLoading = true;
-      let params = {
-        cuid: this.$store.state.userInfo.organizeid,
-        cn: this.studentnameA,
-        class: this.classX,
-        page: this.page,
-      };
-      this.ajax
-        .get(this.$store.state.api + "getStudent", params)
-        .then((res) => {
-          this.isLoading = false;
-          this.isListAjax = false;
-          this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
-          this.tableData = res.data[0];
-          console.log(...this.tableData);
-        })
-        .catch((err) => {
-          this.isLoading = false;
-          console.error(err);
-        });
-    },
-    handleCurrentChange(val) {
-      this.page = val;
-      this.getStudent();
-    },
-    //搜索学生
-    search() {
-      this.page = 1;
-      this.isListAjax = true;
-      this.getStudent();
-    },
-    //获取班级
-    getClass() {
-      let params = { cid: this.$store.state.userInfo.organizeid };
-      this.ajax
-        .get(this.$store.state.api + "findClassByTeacher", params)
-        .then((res) => {
-          this.classList = res.data[0];
-          console.log(res.data[0][0]);
-        })
-        .catch((err) => {
-          console.error(err);
-        });
-    },
-    time() {
-      if (!this.now) {
-        this.now = new Date().getTime();
-        return true;
-      } else {
-        let time = new Date().getTime();
-        if (time - this.now > 3000) {
-          this.now = time;
-          return true;
-        } else {
-          return false;
-        }
-      }
-    },
-    addPopup() {
-      if (this.studentname === "") {
-        this.$message.error("学生名字不能为空");
-        return;
-      } else if (this.studentphone === "") {
-        this.$message.error("学生手机号不能为空");
-        return;
-      } else if (this.classA === "") {
-        this.$message.error("请为学生选择班级");
-        return;
-      } else if (!/^1\d{10}$/.test(this.studentphone)) {
-        this.$message.error("手机号格式不正确");
-        return;
-      }
-      if (this.time()) {
-        let params = { un: this.studentphone };
-        this.ajax
-          .get(this.$store.state.api + "findPhoneBoolean", params)
-          .then((res) => {
-            if (res.data[0].length > 0) {
-              this.$message.error("此学生手机号码已被注册");
-            } else {
-              this.addStudent();
-            }
-          })
-          .catch((err) => {
-            // this.$message.error("查询失败");
-            console.error(err);
-          });
-      }
-    },
-    //添加学生
-    addStudent() {
-      let params = [
-        {
-          uname: this.studentphone,
-          upassword: 123456,
-          oid: this.$store.state.userInfo.organizeid,
-          n: this.studentname,
-          cid: this.classA,
-          tid: this.$store.state.userInfo.userid,
-        },
-      ];
-      this.ajax
-        .post(this.$store.state.api + "addStudent", params)
-        .then((res) => {
-          this.$message({
-            message: "添加成功",
-            type: "success",
-          });
-          this.dialogVisible = false;
-          this.studentphone = "";
-          this.studentname = "";
-          this.classA = "";
-          this.getStudent();
-        })
-        .catch((err) => {
-          this.$message.error("添加失败");
-          console.error(err);
-        });
-    },
-  },
-  created() {
-    this.page = 1;
-    this.getStudent();
-    this.getClass();
-  },
-};
+				if (rABS) {
+					reader.readAsArrayBuffer(f);
+				} else {
+					reader.readAsBinaryString(f);
+				}
+			},
+		},
+		created() {
+			this.page = 1;
+			this.getStudent();
+		},
+	};
 </script>
 
 <style scoped>
-.dialog_diy >>> .el-dialog__header {
-  background: #3d67bc !important;
-  padding: 15px 20px;
-}
-.dialog_diy >>> .el-dialog__title {
-  color: #fff;
-}
-.dialog_diy >>> .el-dialog__headerbtn {
-  top: 19px;
-}
-.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
-  color: #fff;
-}
-.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
-  color: #fff;
-}
-.student_head >>> .el-button--primary {
-  background-color: #2268bc;
-}
-.xls_button {
-  font-size: 14px;
-  cursor: pointer;
-  text-decoration: underline;
-  color: rgb(34, 104, 188);
-}
-.student_head {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-}
-.student_search {
-  display: flex;
-  min-width: 315px;
-  width: 30%;
-  align-items: center;
-}
-.student_search span {
-  margin: 0 10px 0 0;
-}
-.student_button {
-  display: flex;
-  overflow: hidden;
-  height: 40px;
-  align-items: center;
-}
-.student_button .el-button--primary {
-  margin-right: 10px;
-}
-.upload-demo {
-  display: flex;
-  flex-direction: column;
-  align-items: end;
-  /* position: relative; */
-  min-width: 100px;
-  width: 100px;
-  overflow: hidden;
-}
-.student_table {
-  margin: 20px 0;
-}
-
-.el-table >>> .even_row {
-  background-color: #f1f1f1;
-}
+	.pb_head > span:nth-child(2) {
+		font-size: 20px;
+		margin-left: 5px;
+		color: #828282;
+	}
+	.student_head {
+		display: flex;
+		justify-content: space-between;
+	}
+	.head_left {
+		display: flex;
+	}
+	.head_right {
+		display: flex;
+	}
+	.student_input >>> .el-input__inner {
+		height: 30px;
+		width: 190px;
+		font-size: 13px;
+		padding: 0 10px;
+	}
+	.student_button {
+		color: #fff;
+		background: #2268bc;
+		width: 60px;
+		height: 30px;
+		padding: 0 !important;
+		font-size: 12px;
+		line-height: 30px;
+	}
+	.head_right > button:nth-child(1) {
+		color: #fff;
+		background: #2268bc;
+		width: 70px;
+		height: 30px;
+		padding: 0 !important;
+		font-size: 12px;
+		line-height: 30px;
+	}
+	.head_right > button:nth-child(2) {
+		color: #fff;
+		background: #2268bc;
+		width: 70px;
+		height: 30px;
+		padding: 0 !important;
+		font-size: 12px;
+		line-height: 30px;
+	}
+	.head_right > div {
+		font-size: 12px;
+		line-height: 40px;
+		margin-left: 10px;
+		color: #2a6dbe;
+		text-decoration: underline;
+		cursor: pointer;
+	}
+	.student_table >>> .el-table--border td {
+		border-right: 0px !important;
+	}
+	.el-table__row--striped .even_row {
+		background-color: #f1f1f1 !important;
+	}
+	.de_button {
+		color: #fff;
+		background: #5190fd;
+		width: 50px;
+		height: 25px;
+		padding: 0 !important;
+		font-size: 12px;
+		line-height: 25px;
+	}
+	.add_student >>> .el-dialog__header {
+		padding: 20px 20px 10px;
+		text-align: center;
+		background: #32455b;
+	}
+	.add_student >>> .el-dialog__title {
+		font-size: 14px !important;
+		color: #fff !important;
+	}
+	.add_student >>> .el-dialog__headerbtn {
+		font-size: 20px !important;
+	}
+	.add_student >>> .el-form-item__label {
+		margin-left: 65px;
+	}
+	.add_student >>> .el-form-item {
+		display: flex;
+	}
+	.add_student >>> .el-form-item__content {
+		margin: 0 !important;
+	}
+	.add_input {
+		width: 365px;
+	}
+	.add_student >>> .el-dialog__footer {
+		text-align: center !important;
+	}
+	.right {
+		width: 250px;
+		color: #fff;
+		background: #0e72e6;
+		margin-bottom: 20px;
+	}
+	.header-title {
+		display: flex;
+	}
+	.logoImg {
+		width: 30px;
+	}
+	.logoImg > img {
+		width: 100%;
+		height: 100%;
+	}
+	.title_add_student {
+		margin: 0 auto;
+		color: #fff;
+	}
+	.upload-demo {
+		line-height: 0px !important;
+	}
+	.upload-demo >>> .el-button {
+		color: #fff;
+		background: #2268bc;
+		width: 70px;
+		height: 30px;
+		padding: 0 !important;
+		font-size: 12px;
+		line-height: 0 !important;
+	}
 </style>

+ 721 - 1246
src/components/pages/works.vue

@@ -1,1254 +1,729 @@
 <template>
-  <div class="pb_content">
-    <div class="pb_head">
-      <span>作业管理</span>
-    </div>
-    <div class="pb_content_body">
-      <div class="student_head">
-        <div class="student_search">
-          <span>课程筛选</span>
-          <el-select
-            v-model="workCourse"
-            @change="searchWork2"
-            style="min-width: 100px; margin-right: 5px"
-          >
-            <el-option label="全部分类" value=""></el-option>
-            <el-option
-              v-for="item in typeList"
-              :key="item.groupid"
-              :label="item.name"
-              :value="item.groupid"
-            ></el-option>
-          </el-select>
-          <el-select
-            v-model="workType"
-            @change="searchWork"
-            style="min-width: 100px"
-          >
-            <el-option label="全部课程" value=""></el-option>
-
-            <el-option
-              v-for="item in workTypeList"
-              :key="item.courseid"
-              :label="item.title"
-              :value="item.courseid"
-            ></el-option>
-          </el-select>
-          <el-select
-            v-model="classX"
-            placeholder="筛选的班级"
-            no-data-text="此学校暂无班级"
-            style="min-width: 100px; margin-left: 5px"
-            @change="searchWork"
-          >
-            <el-option label="所有班级" value=""></el-option>
-            <el-option
-              v-for="item in classList"
-              :key="item.id"
-              :label="item.name"
-              :value="item.id"
-            ></el-option>
-          </el-select>
-          <el-select
-            v-model="Eve"
-            placeholder="筛选的班级"
-            no-data-text="此学校暂无班级"
-            style="width: 180px; margin-left: 5px"
-            @change="searchWork"
-          >
-            <el-option label="所有作业" value=""></el-option>
-            <el-option label="已评分" value="1"></el-option>
-            <el-option label="未评分" value="2"></el-option>
-          </el-select>
-          <span>
-            <el-input
-              placeholder="请输入学生的姓名"
-              v-model="studentnameA"
-              clearable
-            >
-            </el-input>
-          </span>
-          <el-button type="primary" @click="searchWork">查询</el-button>
-        </div>
-      </div>
-      <div class="student_table">
-        <el-table
-          v-loading="isLoading"
-          ref="table"
-          :data="tableData"
-          border
-          :height="tableHeight"
-          :fit="true"
-          style="width: 100%"
-          :header-cell-style="{ background: '#f1f1f1' }"
-          :row-class-name="tableRowClassName"
-        >
-          <el-table-column prop="name" label="姓名" min-width="10">
-          </el-table-column>
-          <el-table-column prop="classname" label="班级" min-width="10">
-            <template slot-scope="scope">
-              <div>
-                {{ scope.row.classname ? scope.row.classname : "暂无班级" }}
-              </div>
-            </template>
-          </el-table-column>
-          <el-table-column prop="title" label="课程" min-width="30">
-          </el-table-column>
-          <el-table-column label="评价" min-width="20">
-            <template slot-scope="scope">
-              <div>
-                {{computedIsE(scope.row.rateJson)}}
-              </div>
-            </template>
-          </el-table-column>
-          <el-table-column prop="time" label="时间" min-width="15">
-          </el-table-column>
-          <el-table-column label="操作" min-width="25">
-            <template slot-scope="scope">
-              <el-button
-                type="text"
-                size="small"
-                style="position: relative"
-                @click="
-                  getWork(
-                    scope.row.userid,
-                    scope.row.courseid,
-                    scope.row.uuserid
-                  )
-                "
-                >查看作业
-                <i
-                  :class="{
-                    notR:
-                      scope.row.isRead == 1 &&
-                      scope.row.uuserid == $store.state.userInfo.userid,
-                  }"
-                  v-if="scope.row.isRead == 1"
-                ></i>
-              </el-button>
-              <el-button
-                @click="handleDelete(scope.row)"
-                type="text"
-                size="small"
-                >删除</el-button
-              >
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <div class="student_page">
-        <el-pagination
-          background
-          layout="prev, pager, next"
-          :page-size="10"
-          :total="total"
-          @current-change="handleCurrentChange"
-          v-if="!isListAjax && page"
-        >
-        </el-pagination>
-      </div>
-    </div>
-    <el-dialog
-      title="查看作业"
-      :visible.sync="dialogVisible"
-      :append-to-body="true"
-      width="750px"
-      :before-close="handleClose"
-      class="dialog_diy"
-    >
-      <div class="work_white">
-        <div class="pb_head" style="width: 100%">
-          <span>{{ workList.title }}</span>
-        </div>
-        <div class="works_score_box">
-          <div
-            class="works_score_work"
-            v-for="(item, index) in workList.homework"
-            :key="item.hid"
-          >
-            <div class="score_head">
-              <span
-                @click="
-                  workDetail(
-                    item.rate,
-                    item.id,
-                    item.name,
-                    item.title,
-                    workList.uid,
-                    workList.cid,
-                    item.teachername
-                  )
-                "
-                >{{ index + 1 }}、{{ item.name }}</span
-              >
-              <div style="min-width: 215px">
-                <el-button
-                  type="primary"
-                  class="store"
-                  @click="
-                    workDetail(
-                      item.rate,
-                      item.id,
-                      item.name,
-                      item.title,
-                      workList.uid,
-                      workList.cid,
-                      item.teachername
-                    )
-                  "
-                  >查看视频</el-button
-                >
-                <el-button
-                  v-if="item.content.content"
-                  type="primary"
-                  class="store"
-                  :class="{ stored: item.rate != '' }"
-                  @click="
-                    rate(
-                      item.rate,
-                      item.id,
-                      item.name,
-                      item.title,
-                      workList.uid,
-                      workList.cid,
-                      item.teachername
-                    )
-                  "
-                  >{{ item.rate == "" ? "立即评分" : "已评分" }}</el-button
-                >
-              </div>
-            </div>
-            <div class="score_work">
-              <el-image
-                v-for="photo in item.photoList"
-                :key="photo"
-                style="width: 100px; height: 100px; margin-right: 10px"
-                :src="photo"
-                @click="handlePictureCardPreview(photo)"
-              ></el-image>
-            </div>
-            <div class="work_content">
-              <span>{{
-                item.content.content ? item.content.content : "暂未上传"
-              }}</span>
-            </div>
-          </div>
-        </div>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <!-- <el-button @click="dialogVisible = false">取 消</el-button> -->
-        <el-button type="primary" @click="dialogVisible = false"
-          >关 闭</el-button
-        >
-      </span>
-    </el-dialog>
-
-    <el-dialog
-      title="查看作业"
-      :visible.sync="dialogVisible1"
-      :append-to-body="true"
-      width="750px"
-      :before-close="handleClose"
-      class="dialog_diy"
-    >
-      <div>
-        <div class="pb_head" style="width: 100%">
-          <span>{{ res.title }}</span>
-        </div>
-        <div>
-          <div class="workd_head">
-            <div class="workd_media">
-              <!-- <el-image
-                style="width: 100%; height: 300px"
-                :src="require('../../assets/tu4.png')"
-              ></el-image> -->
-              <video-player
-                class="video-player vjs-custom-skin"
-                ref="videoPlayer"
-                :playsinline="true"
-                :options="playerO"
-                @play="onPlayerPlay($event)"
-                style="width: 100%; height: 100%"
-              ></video-player>
-            </div>
-            <div class="workd_title">{{ res.stitle }}</div>
-            <div class="workd_content">
-              <div
-                class="mywd_rate_comment"
-                v-for="item in resP"
-                :key="item.id"
-              >
-                <div class="mywd_rate_head">
-                  <div class="mywd_rate_head_img mwd_img_box user_comment">
-                    <img src="../../assets/jiazhang.png" alt="" />
-                  </div>
-                  <div class="mywd_rate_head_title">
-                    <div>{{ item.parentname }}家长</div>
-                  </div>
-                </div>
-                <div class="mywd_rate_comment_body">
-                  <span>{{ item.content }}</span>
-                </div>
-              </div>
-            </div>
-            <div class="comments_title">
-              <span>评论</span><span>({{ resS.length }})</span>
-            </div>
-            <div class="workd_comment">
-              <div
-                class="mywd_rate_comment"
-                v-for="index in resS"
-                :key="index.id"
-              >
-                <div class="mywd_rate_head">
-                  <div class="mywd_rate_head_img mwd_img_box">
-                    <img
-                      :src="
-                        index.smailheadportrait
-                          ? index.smailheadportrait
-                          : require('../../assets/portal.png')
-                      "
-                      alt=""
-                    />
-                  </div>
-                  <div class="mywd_rate_head_title">
-                    <div>
-                      {{ index.name }}<span>{{ index.time }}</span>
-                    </div>
-                  </div>
-                </div>
-                <div class="mywd_rate_comment_body">
-                  <span>{{ index.content }}</span>
-                </div>
-              </div>
-            </div>
-          </div>
-        </div>
-      </div>
-      <span slot="footer" style="display: flex; justify-content: center">
-        <!-- <el-button @click="dialogVisible = false">取 消</el-button> -->
-        <el-button
-          style="width: 90%; margin: 0 auto"
-          type="primary"
-          @click="rate2"
-          v-if="!rateParams[5]"
-          >进行评分</el-button
-        >
-        <el-button
-          style="width: 90%; margin: 0 auto"
-          type="primary"
-          @click="
-            rate(
-              rateParams[5],
-              rateParams[0],
-              rateParams[3],
-              rateParams[4],
-              rateParams[1],
-              rateParams[2]
-            )
-          "
-          v-else
-          >查看评分</el-button
-        >
-      </span>
-    </el-dialog>
-
-    <el-dialog
-      title="评分"
-      :visible.sync="dialogVisible2"
-      :append-to-body="true"
-      width="750px"
-      :before-close="handleClose"
-      class="dialog_diy"
-    >
-      <div class="work_white">
-        <div class="sd_head">
-          <div style="display: flex; align-items: center">
-            <img
-              :src="
-                workList.smailheadportrait
-                  ? workList.smailheadportrait
-                  : require('../../assets/portal.png')
-              "
-              alt=""
-            /><span>{{ workList.name }}</span>
-          </div>
-          <div v-if="tn">{{ tn + "老师批改" }}</div>
-        </div>
-        <div class="sd_title">
-          <span>课程名称</span><span>{{ rateParams[4] }}</span>
-        </div>
-        <div class="sd_title">
-          <span>作业名称</span><span>{{ rateParams[3] }}</span>
-        </div>
-        <div class="sd_score">
-          <div class="score_box">
-            <span>劳动认知</span
-            ><el-rate
-              v-model="rateList.ca"
-              :disabled="
-                rateParams[5] != '' &&
-                rateParams[5] != undefined &&
-                !worksUpdateB
-              "
-            ></el-rate>
-          </div>
-          <div class="score_box">
-            <span>劳动观念</span
-            ><el-rate
-              v-model="rateList.sia"
-              :disabled="
-                rateParams[5] != '' &&
-                rateParams[5] != undefined &&
-                !worksUpdateB
-              "
-            ></el-rate>
-          </div>
-          <div class="score_box">
-            <span>劳动精神</span
-            ><el-rate
-              v-model="rateList.eta"
-              :disabled="
-                rateParams[5] != '' &&
-                rateParams[5] != undefined &&
-                !worksUpdateB
-              "
-            ></el-rate>
-          </div>
-          <div class="score_box">
-            <span>劳动能力</span
-            ><el-rate
-              v-model="rateList.pia"
-              :disabled="
-                rateParams[5] != '' &&
-                rateParams[5] != undefined &&
-                !worksUpdateB
-              "
-            ></el-rate>
-          </div>
-          <div class="score_box">
-            <span>劳动习惯与品质</span
-            ><el-rate
-              v-model="rateList.lra"
-              :disabled="
-                rateParams[5] != '' &&
-                rateParams[5] != undefined &&
-                !worksUpdateB
-              "
-            ></el-rate>
-          </div>
-        </div>
-        <div class="sd_comment">
-          <div class="displayBox">
-            <span>更多评价</span>
-            <div class="easy_comment" v-if="!rateParams[5]">
-              <div
-                v-for="(item, index) in easyCommentAarry"
-                :key="index"
-                @click="easyComment($event)"
-              >
-                {{ item }}
-              </div>
-            </div>
-          </div>
-          <el-input
-            type="textarea"
-            placeholder="还有要说的吗..."
-            :rows="6"
-            resize="none"
-            v-model="rateList.content"
-            :readonly="
-              rateParams[5] != '' && rateParams[5] != undefined && !worksUpdateB
-            "
-            style="background: #fafafa"
-          ></el-input>
-        </div>
-      </div>
-      <span slot="footer" style="display: flex; justify-content: center">
-        <!-- <el-button @click="dialogVisible = false">取 消</el-button> -->
-        <el-button
-          style="width: 90%; margin: 0 auto"
-          type="primary"
-          @click="rateS()"
-          v-if="!rateParams[5]"
-          >进行评分</el-button
-        ><el-button
-          style="width: 90%; margin: 0 auto"
-          type="primary"
-          @click="updateRate()"
-          v-else
-          >{{ worksUpdateB ? "确认修改" : "修改评分" }}</el-button
-        >
-      </span>
-    </el-dialog>
-    <el-dialog :visible.sync="pictureDialog" size="tiny">
-      <img width="100%" :src="dialogImageUrl" alt="" />
-    </el-dialog>
-  </div>
+	<div class="pb_content">
+		<div class="pb_head">
+			<span>评价管理</span>
+			<span>备注:教师可以根据课程、班级条件筛选学生并查看该学生信息</span>
+		</div>
+		<div class="pb_content_body">
+			<div class="student_head">
+				<div class="student_search" v-if="this.choose == 0">
+					<div>项目筛选</div>
+					<el-select
+						v-model="subject"
+						placeholder="请选择课程"
+						@change="searchWork"
+					>
+						<el-option label="全部" value=""></el-option>
+						<el-option
+							v-for="(item, index) in subjectJuri"
+							:key="index"
+							:label="item.name"
+							:value="item.id"
+						></el-option>
+					</el-select>
+				</div>
+				<div class="student_search" v-else>
+					<div>项目筛选</div>
+					<el-select
+						v-model="subject"
+						placeholder="请选择课程"
+						@change="searchWork"
+					>
+						<el-option label="所有课程" value=""></el-option>
+						<el-option
+							v-for="(item, index) in subjectJuri"
+							:key="index"
+							:label="item.name"
+							:value="item.id"
+						></el-option>
+					</el-select>
+					<el-select
+						v-model="sClass"
+						placeholder="请选择班级"
+						@change="searchWork"
+					>
+						<el-option label="所有班级" value=""></el-option>
+						<el-option
+							v-for="(item, index) in grade"
+							:key="index"
+							:label="item.name"
+							:value="item.id"
+						></el-option>
+					</el-select>
+				</div>
+			</div>
+			<div class="student_table">
+				<el-table
+					ref="table"
+					:data="tableData"
+					border
+					:height="tableHeight"
+					:fit="true"
+					v-loading="isLoading"
+					style="width: 100%"
+					:header-cell-style="{ background: '#f1f1f1' }"
+					:row-class-name="tableRowClassName"
+					stripe
+				>
+					<el-table-column
+						prop="sName"
+						label="姓名"
+						min-width="15"
+						align="center"
+					></el-table-column>
+					<el-table-column
+						prop="class"
+						label="班级"
+						min-width="20"
+						align="center"
+					></el-table-column>
+					<el-table-column
+						prop="course"
+						label="课程"
+						min-width="20"
+						align="center"
+					></el-table-column>
+					<el-table-column
+						prop="time"
+						label="时间"
+						min-width="15"
+						align="center"
+					></el-table-column>
+					<el-table-column label="操作" min-width="30">
+						<template slot-scope="scope">
+							<el-button
+								type="primary"
+								size="small"
+								@click="lookWork(scope.row.id)"
+								>查看作业</el-button
+							>
+							<el-button
+								class="de_button"
+								type="primary"
+								size="small"
+								@click="deleteWork(scope.row.id)"
+								>删除</el-button
+							>
+						</template>
+					</el-table-column>
+				</el-table>
+				<el-dialog
+					:visible.sync="dialogVisible"
+					:append-to-body="true"
+					width="700px"
+					:before-close="handleClose"
+					class="add_work"
+				>
+					<div slot="title" class="header-title">
+						<div class="logoImg">
+							<img src="../../assets/logo.png" alt="" />
+						</div>
+						<div class="title_add_student">查看作业</div>
+					</div>
+					<div class="top">
+						<div>{{ this.courseByUser }}</div>
+						<div>{{ this.userName }}</div>
+					</div>
+					<div class="first">
+						<div class="one_top">
+							<div>一、{{ this.courseByUser }} - {{ this.userName }}</div>
+							<el-button>已评分</el-button>
+						</div>
+						<div class="work_Img">
+							<img src="../../assets/workImg.png" alt="" />
+						</div>
+						<div class="work_input">
+							<div>早梅</div>
+						</div>
+						<div class="poetry">
+							一树寒梅白玉条,林村路傍溪桥.唐张谓《早梅》
+						</div>
+					</div>
+					<div class="first">
+						<div class="one_top">
+							<div>一、{{ this.courseByUser }}2 - {{ this.userName }}</div>
+							<el-button class="assess" @click="doingAssess"
+								>进行评分</el-button
+							>
+						</div>
+						<div class="work_Img">
+							<img src="../../assets/workImg.png" alt="" />
+						</div>
+						<div class="work_input">
+							<div>{{ this.answerName }}</div>
+						</div>
+						<div class="poetry">雨荒深院菊,霜倒半池莲.唐杜甫《宿赞公房》</div>
+					</div>
+				</el-dialog>
+				<el-dialog
+					:visible.sync="dialogVisible1"
+					:append-to-body="true"
+					width="700px"
+					:before-close="handleClose"
+					class="add_work"
+				>
+					<div slot="title" class="header-title">
+						<div class="logoImg">
+							<img src="../../assets/logo.png" alt="" />
+						</div>
+						<div class="title_add_student">查看作业</div>
+					</div>
+					<div class="assess_top">
+						<div>{{ this.courseByUser }} - {{ this.userName }}</div>
+					</div>
+					<div class="assess_Img">
+						<img src="../../assets/workImg.png" alt="" />
+					</div>
+					<div class="workName">{{ this.answerName }}</div>
+					<div class="student_Answer">
+						<div class="toux">
+							<img src="../../assets/portal.png" alt="" />
+						</div>
+						<div class="nav">
+							<div class="studentName">{{ this.userName }}</div>
+							<div class="studentAnswer">{{ this.studentAnswer }}</div>
+						</div>
+					</div>
+					<div class="comment">
+						<div class="comment_title">
+							评论<span>({{ this.commentCount }})</span>
+						</div>
+						<div class="other_Answer">
+							<div class="toux">
+								<img src="../../assets/portal.png" alt="" />
+							</div>
+							<div class="nav">
+								<div class="nameAndTime">
+									<div class="otherName">{{ this.commentName }}</div>
+									<div class="time">{{ this.commentTime }}</div>
+								</div>
+								<div class="otherAnswer">{{ this.commentAnswer }}</div>
+							</div>
+						</div>
+						<div class="other_Answer">
+							<div class="toux">
+								<img src="../../assets/portal.png" alt="" />
+							</div>
+							<div class="nav">
+								<div class="nameAndTime">
+									<div class="otherName">{{ this.commentName }}</div>
+									<div class="time">{{ this.commentTime }}</div>
+								</div>
+								<div class="otherAnswer">{{ this.commentAnswer }}</div>
+							</div>
+						</div>
+					</div>
+					<div class="doingAssess" @click="giveScore">进行评分</div>
+				</el-dialog>
+				<el-dialog
+					:visible.sync="dialogVisible2"
+					:append-to-body="true"
+					width="700px"
+					:before-close="handleClose"
+					class="add_work"
+				>
+					<div slot="title" class="header-title">
+						<div class="logoImg">
+							<img src="../../assets/logo.png" alt="" />
+						</div>
+						<div class="title_add_student">评分</div>
+					</div>
+					<div class="score_top">
+						<div class="userTou">
+							<img src="../../assets/portal.png" alt="" />
+						</div>
+						<div class="score_user_name">{{ this.userName }}</div>
+					</div>
+					<div class="course_top">
+						<div>课程名称</div>
+						<div>{{ this.courseByUser }}</div>
+					</div>
+					<div class="sd_score">
+						<div class="score_box">
+							<span>意识能力</span
+							><el-rate
+								v-model="rateList.ca"
+								:disabled="rateParams[5] != '' && rateParams[5] != undefined"
+							></el-rate>
+						</div>
+						<div class="score_box">
+							<span>科学探究能力</span
+							><el-rate
+								v-model="rateList.sia"
+								:disabled="rateParams[5] != '' && rateParams[5] != undefined"
+							></el-rate>
+						</div>
+						<div class="score_box">
+							<span>实践创新能力</span
+							><el-rate
+								v-model="rateList.eta"
+								:disabled="rateParams[5] != '' && rateParams[5] != undefined"
+							></el-rate>
+						</div>
+						<div class="score_box">
+							<span>学习反思能力</span
+							><el-rate
+								v-model="rateList.pia"
+								:disabled="rateParams[5] != '' && rateParams[5] != undefined"
+							></el-rate>
+						</div>
+						<div class="score_box">
+							<span>工程思维能力</span
+							><el-rate
+								v-model="rateList.lra"
+								:disabled="rateParams[5] != '' && rateParams[5] != undefined"
+							></el-rate>
+						</div>
+					</div>
+					<div class="moreSay">更多评价</div>
+					<div class="more_say_input">
+						<el-input
+							type="textarea"
+							placeholder="还有要说的吗..."
+							:rows="6"
+							resize="none"
+							v-model="rateList.content"
+							:readonly="rateParams[5] != '' && rateParams[5] != undefined"
+							style="background: #fafafa"
+						></el-input>
+					</div>
+					<div class="assess_right" @click="right">确认</div>
+				</el-dialog>
+			</div>
+			<div class="student_page">
+				<el-pagination
+					background
+					layout="prev, pager, next"
+					:page-size="10"
+					:total="total"
+					@current-change="handleCurrentChange"
+				>
+				</el-pagination>
+			</div>
+		</div>
+	</div>
 </template>
 
 <script>
-export default {
-  data() {
-    return {
-      total: null,
-      page: 1,
-      tableHeight: 50,
-      formLabelWidth: "100px",
-      workType: "",
-      workTypeList: [],
-      dialogVisible: false,
-      dialogVisible1: false,
-      dialogVisible2: false,
-      pictureDialog: false,
-      dialogImageUrl: "",
-      tableData: [],
-      workList: {},
-      rateList: {
-        ca: 0,
-        sia: 0,
-        eta: 0,
-        pia: 0,
-        lra: 0,
-        content: "",
-      },
-      rateParams: [],
-      playerO: {},
-      playerOptions: {
-        playbackRates: [0.7, 1.0, 1.5, 2.0], //播放速度
-        autoplay: false, //如果true,浏览器准备好时开始回放。
-        muted: false, // 默认情况下将会消除任何音频。
-        loop: false, // 导致视频一结束就重新开始。
-        preload: "auto", // 建议浏览器在<video>加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频(如果浏览器支持)
-        language: "zh-CN",
-        aspectRatio: "16:9", // 将播放器置于流畅模式,并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字(例如"16:9"或"4:3")
-        fluid: true, // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。
-        sources: [
-          {
-            type: "video/mp4", //这里的种类支持很多种:基本视频格式、直播、流媒体等,具体可以参看git网址项目   || "video/ogg"|| "video/webm"
-            src: "", //url地址require("../../assets/media/aaa.mp4")
-          },
-        ],
-        // poster: require("../../assets/tu31.png"), //你的封面地址
-        // poster: dataRes.imgUrl, //你的封面地址
-        notSupportedMessage: "此视频暂无法播放,请稍后再试", //允许覆盖Video.js无法播放媒体源时显示的默认信息。
-        controlBar: {
-          timeDivider: true, //当前时间和持续时间的分隔符
-          durationDisplay: true, //显示持续时间
-          remainingTimeDisplay: false, //是否显示剩余时间功能
-          fullscreenToggle: true, //全屏按钮
-        },
-      },
-      res: [],
-      resS: [],
-      resP: [],
-      easyCommentAarry: [
-        "太棒了,再接再励",
-        "思维敏捷,聪慧好学",
-        "知识丰富,好学好问",
-        "同学很耐心,讲解很清晰",
-        "你是小天才",
-        "同学很细心,做的特别细致",
-      ],
-      uuserid: "",
-      classX: "",
-      classList: [],
-      studentnameA: "",
-      workCourse: "",
-      typeList: [],
-      tn: "",
-      worksUpdateB: false,
-      Eve:"",
-      isListAjax:false,
-    };
-  },
-  mounted() {
-    this.$nextTick(function () {
-      this.tableHeight =
-        window.innerHeight - this.$refs.table.$el.offsetTop - 200;
-      if (this.tableHeight <= 530) {
-        this.tableHeight = 530;
-      }
-      // 监听窗口大小变化
-      let self = this;
-      window.onresize = function () {
-        self.tableHeight =
-          window.innerHeight - self.$refs.table.$el.offsetTop - 200;
-        if (self.tableHeight <= 530) {
-          self.tableHeight = 530;
-        }
-      };
-    });
-    //this.$refs.table.$el.offsetTop:表格距离浏览器的高度 //200表示你想要调整的表格距离底部的高度(你可以自己随意调整),因为我们一般都有放分页组件的,所以需要给它留一个高度
-  },
-  methods: {
-    rate2() {
-      // if (this.$store.state.userInfo.userid != this.uuserid) {
-      //   this.$message.error("您不是此课程的创建老师,不能评分");
-      //   return;
-      // }else{
-      dialogVisible2 = true;
-      // }
-    },
-    tableRowClassName({ row, rowIndex }) {
-      if ((rowIndex + 1) % 2 === 0) {
-        return "even_row";
-      } else {
-        return "";
-      }
-    },
-    easyComment(e) {
-      this.rateList.content += e.target.innerText + "。";
-    },
-    handleDelete(row) {
-      console.log(row);
-      let params = [{ uid: row.userid, cid: row.courseid }];
-      this.$confirm("确定删除此学生的作业吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.ajax
-            .post(this.$store.state.api + "deleteWork", params)
-            .then((res) => {
-              this.$message({
-                message: "删除成功",
-                type: "success",
-              });
-              if (this.page != 1 && this.tableData.length == 1) {
-                this.page - 1;
-              }
-              this.getWorks();
-            })
-            .catch((err) => {
-              this.$message.error("删除失败");
-              console.error(err);
-            });
-        })
-        .catch(() => {});
-    },
-    handleClose(done) {
-      // this.rateParams = [];
-      this.worksUpdateB = false
-      done();
-    },
-    searchWork() {
-      this.page = 1;
-      this.isListAjax = true;
-      this.getWorks();
-    },
-    searchWork2() {
-      this.page = 1;
-      this.isListAjax = true;
-      this.workType = "";
-      this.workTypeList = [];
-      this.getType();
-      this.getWorks();
-    },
-    //获取作业
-    getWorks() {
-      this.isLoading = true;
-      let params = {
-        bid: this.$store.state.userInfo.organizeid,
-        isRate: this.Eve,
-        class: this.classX,
-        name: this.studentnameA,
-        gid: this.workCourse,
-        cid: this.workType,
-        page: this.page,
-      };
-      this.ajax
-        .get(this.$store.state.api + "getWorks", params)
-        .then((res) => {
-          this.isListAjax = false;
-          this.isLoading = false;
-          this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
-          this.tableData = res.data[0];
-          console.log(...this.tableData);
-        })
-        .catch((err) => {
-          this.isLoading = false;
-          console.error(err);
-        });
-    },
-    handleCurrentChange(val) {
-      this.page = val;
-      this.getWorks();
-    },
-    //获取未读数量
-    getnCount() {
-      let params = {
-        bid: this.$store.state.userInfo.userid,
-      };
-      this.ajax
-        .get(this.$store.state.api + "getNcount", params)
-        .then((res) => {
-          console.log(res);
-          if (res.data[0].length > 0) {
-            this.$store.commit("update", ["nCount", res.data[0][0].num]);
-          } else {
-            this.$store.commit("update", ["nCount", 0]);
-          }
-        })
-        .catch((err) => {
-          console.error(err);
-        });
-    },
-    //获取作业详情
-    getWork(uid, cid, userid) {
-      this.uuserid = userid;
-      if (this.$store.state.userInfo.userid == userid) {
-        let readParams = [{ cid: cid }];
-        this.ajax
-          .post(this.$store.state.api + "updateWorkRead", readParams)
-          .then((res) => {
-            this.getWorks();
-            this.getnCount();
-          })
-          .catch((err) => {
-            console.error(err);
-          });
-      }
-      this.dialogVisible = false;
-      this.workList = {};
-      // console.log(row);
-      let params = { aid: uid, cid: cid };
-      this.ajax
-        .get(this.$store.state.api + "getWork", params)
-        .then((res) => {
-          var _this = this;
-          console.log(res.data[0]);
-          _this.workList.title = res.data[0][0].title;
-          _this.workList.uid = uid;
-          _this.workList.cid = cid;
-          _this.workList.name = res.data[0][0].name;
-          _this.workList.smailheadportrait = res.data[0][0].smailheadportrait;
-          var homeworkList = JSON.parse(res.data[0][0].chapters).homework;
-          for (var i = 0; i < homeworkList.length; i++) {
-            for (let j = 0; j < res.data[0].length; j++) {
-              if (homeworkList[i].hid == res.data[0][j].homeworkid) {
-                homeworkList[i].content = JSON.parse(res.data[0][j].content);
-                homeworkList[i].rate = res.data[0][j].rate;
-                homeworkList[i].id = res.data[0][j].id;
-                homeworkList[i].teachername = res.data[0][j].teachername;
-                homeworkList[i].title = res.data[0][j].title;
-                homeworkList[i].photoList = JSON.parse(
-                  res.data[0][j].content
-                ).photo.split(",");
-              }
-            }
-            if (!homeworkList[i].content) {
-              homeworkList[i].content = "";
-              homeworkList[i].id = "";
-              homeworkList[i].title = "";
-            }
-          }
-          _this.workList.homework = homeworkList;
-
-          this.dialogVisible = true;
-        })
-        .catch((err) => {
-          // this.$message.error("删除失败");
-          console.error(err);
-        });
-    },
-    //查看单个作业的详情
-    workDetail(rate, workid, name, title, uid, cid, tn) {
-      let _this = this;
-      if (tn) {
-        _this.tn = tn;
-      } else {
-        _this.tn = tn;
-      }
-      this.rateList = {
-        ca: 0,
-        sia: 0,
-        eta: 0,
-        pia: 0,
-        lra: 0,
-        content: "",
-      };
-      if (!workid) {
-        return;
-      }
-      let params = { aid: workid };
-      this.ajax
-        .get(this.$store.state.api + "getWorkByWidT", params)
-        .then((resA) => {
-          var res = resA.data[0];
-          this.resP = resA.data[1]; //家长评论
-          this.resS = resA.data[2]; //学生评论
-          for (var i = 0; i < res.length; i++) {
-            var chap = JSON.parse(res[i].chapters).homework;
-            var content = res[i].rate ? JSON.parse(res[i].rate).content : "";
-            res[i].comment = content;
-            res[i].imgUrl = JSON.parse(res[i].content).photo.split(",");
-            for (var j = 0; j < chap.length; j++) {
-              if (res[i].homeworkid == chap[j].hid) {
-                res[i].workName = chap[j].name;
-                continue;
-              }
-            }
-          }
-          res.filter((element) => {
-            element.media = JSON.parse(element.content).media;
-            return element;
-          });
-
-          _this.res = res[0];
-          _this.res.stitle = _this.res.workName + "-" + _this.res.name;
-          _this.playerOptions.poster = _this.res.imgUrl[0];
-          _this.playerOptions.sources[0].src = _this.res.media;
-          _this.playerO = _this.playerOptions;
-          console.log(res);
-          _this.dialogVisible1 = true;
-          _this.rateParams = [workid, uid, cid, name, title, rate, false];
-        })
-        .catch((err) => {
-          console.error(err);
-        });
-    },
-    onPlayerPlay() {},
-    //评分数据
-    rate(rate, workid, name, title, uid, cid, tn) {
-      // if (this.$store.state.userInfo == this.uuserid) {
-      if (tn) {
-        this.tn = tn;
-      } else {
-        this.tn = tn;
-      }
-      this.rateList = {
-        ca: 0,
-        sia: 0,
-        eta: 0,
-        pia: 0,
-        lra: 0,
-        content: "",
-      };
-      if (rate) {
-        var rrrrrate = JSON.parse(rate);
-        this.rateList = {
-          ca: rrrrrate.ca,
-          sia: rrrrrate.sia,
-          eta: rrrrrate.eta,
-          pia: rrrrrate.pia,
-          lra: rrrrrate.lra,
-          content: rrrrrate.content,
-        };
-        this.rateParams = [workid, uid, cid, name, title, rate, true];
-        // return;
-      } else {
-        this.rateParams = [workid, uid, cid, name, title];
-      }
-      console.log(this.rateParams);
-      this.dialogVisible2 = true;
-
-      // else if (this.$store.state.userInfo.userid != this.uuserid) {
-      //   this.$message.error("您不是此课程的创建老师,不能评分");
-      //   return;
-      // }
-    },
-    //评分
-    rateS() {
-      let params = [
-        {
-          wid: this.rateParams[0],
-          rate: JSON.stringify(this.rateList),
-          t: '"' + this.rateParams[4] + '"作业评价',
-          nc:
-            // "您的课程<span style='font-weight:600'>" +
-            // this.rateParams[4] +
-            // "</span>下<span style='font-weight:600'>" +
-            // this.rateParams[3] +
-            // "</span>的作业,已经批改完成,可前往我的-我的作业查看"+
-            "好消息,您的“" +
-            this.rateParams[3] +
-            "”作品,已经收到了老师的评价。快去我的-我的作品中,点开查看吧。",
-          s: this.$store.state.userInfo.userid,
-          rid: this.workList.uid,
-        },
-      ];
-      this.ajax
-        .post(this.$store.state.api + "rate", params)
-        .then((res) => {
-          if (this.dialogVisible1) {
-            this.dialogVisible1 = false;
-          }
-          this.getWork(this.rateParams[1], this.rateParams[2], this.uuserid);
-          this.$message.success("评分成功");
-          this.dialogVisible2 = false;
-        })
-        .catch((err) => {
-          this.$message.error("评分失败");
-          console.error(err);
-        });
-    },
-    updateRate() {
-      if (this.worksUpdateB) {
-        let params = [
-          {
-            wid: this.rateParams[0],
-            rate: JSON.stringify(this.rateList),
-            t: '"' + this.rateParams[4] + '"作业评价修改',
-            nc:
-              "好消息,您的“" +
-              this.rateParams[3] +
-              "”作品,被老师再此修改了评分。快去我的-我的作品中,点开查看吧。",
-            s: this.$store.state.userInfo.userid,
-            rid: this.workList.uid,
-          },
-        ];
-        this.ajax
-          .post(this.$store.state.api + "rate", params)
-          .then((res) => {
-            if (this.dialogVisible1) {
-              this.dialogVisible1 = false;
-            }
-            this.getWork(this.rateParams[1], this.rateParams[2], this.uuserid);
-            this.$message.success("评分成功");
-            this.dialogVisible2 = false;
-            this.worksUpdateB = false;
-          })
-          .catch((err) => {
-            this.$message.error("评分失败");
-            console.error(err);
-          });
-      } else {
-        this.worksUpdateB = true;
-      }
-    },
-    //作业图片查看
-    handlePictureCardPreview(url) {
-      this.dialogImageUrl = url;
-      this.pictureDialog = true;
-    },
-    getType() {
-      // let params = { uid: this.$store.state.userInfo.organizeid };
-      let params = { uid: this.workCourse };
-      this.ajax
-        .get(this.$store.state.api + "findWorkType", params)
-        .then((res) => {
-          this.workTypeList = res.data[0];
-        })
-        .catch((err) => {
-          // this.$message.error("删除失败");
-          console.error(err);
-        });
-    },
-    getCourseType() {
-      let params = { uid: this.$store.state.userInfo.organizeid };
-      this.ajax
-        .get(this.$store.state.api + "findWorkType2", params)
-        .then((res) => {
-          this.typeList = res.data[0];
-        })
-        .catch((err) => {
-          // this.$message.error("删除失败");
-          console.error(err);
-        });
-    },
-    //获取班级
-    getClass() {
-      let params = { cid: this.$store.state.userInfo.organizeid };
-      this.ajax
-        .get(this.$store.state.api + "findClassByTeacher", params)
-        .then((res) => {
-          this.classList = res.data[0];
-          console.log(res.data[0][0]);
-        })
-        .catch((err) => {
-          console.error(err);
-        });
-    },
-  },
-  computed: {
-    // 控制显示的内容
-    computedIsE() {
-      return function (value) {
-        var a = value.split("<|,|>")
-        // console.log(a)
-        var total = 0;
-        for(var i = 0;i<a.length;i++){
-          if(a[i] == ""){
-            total++
-          }
-        }
-        var wenzi;
-        if(total == 0){
-          wenzi = "已评分"
-        }else{
-          wenzi = "有"+total+"个作业未评分"
-        }
-        return wenzi;
-      };
-    },
-  },
-  created() {
-    this.page = 1;
-    this.getWorks();
-    // this.getType();
-    this.getCourseType();
-    this.getnCount();
-    this.getClass();
-  },
-};
+	export default {
+		data() {
+			return {
+				choose:0,
+				tableHeight: "500px",
+				isLoading: false,
+				formLabelWidth: "100px",
+				dialogVisible: false,
+				dialogVisible1: false,
+				dialogVisible2: false,
+				courseByUser: "诗词中的植物",
+				userName: "林点",
+				answerName: "宿赞公房",
+				studentAnswer: "雨荒深院菊,霜倒半池莲.唐杜甫《宿赞公房》",
+				commentCount: 2,
+				commentName: "谭子松",
+				commentTime: "2021/2/5",
+				commentAnswer:
+					"作为家长我很高兴看到孩子的进步,希望这个进步只是一个开始,在新学期能够继续延续,这样才能不负老师的期望",
+				tableData: [],
+				subject: "",
+				sClass: "",
+				subjectJuri: [],
+				grade: [],
+				rateList: {
+					ca: 0,
+					sia: 0,
+					eta: 0,
+					pia: 0,
+					lra: 0,
+					content: "",
+				},
+				rateParams: [],
+				page: 1,
+				total: 0,
+			};
+		},
+		methods: {
+			handleClose(done) {
+				done();
+			},
+			tableRowClassName({ row, rowIndex }) {
+				if ((rowIndex + 1) % 2 === 0) {
+					return "even_row";
+				} else {
+					return "";
+				}
+			},
+			handleCurrentChange(val) {
+				this.page = val;
+			},
+			lookWork() {
+				this.dialogVisible = true;
+			},
+			doingAssess() {
+				this.dialogVisible1 = true;
+			},
+			giveScore() {
+				this.dialogVisible2 = true;
+			},
+			//获取班级列表
+			getClass() {
+				this.isLoading = true;
+				let params = {
+					cu: "",
+					cn: this.sClass,
+					page: this.page,
+				};
+				this.ajax
+					.get(this.$store.state.api + "selectClass", params)
+					.then((res) => {
+						this.isLoading = false;
+						this.grade = res.data[0];
+					})
+					.catch((err) => {
+						this.isLoading = false;
+						console.error(err);
+					});
+			},
+			//获取分组分类
+			getGroup() {
+				let params = {};
+				this.ajax
+					.get(this.$store.state.api + "getGroup", params)
+					.then((res) => {
+						this.subjectJuri = res.data[0];
+					})
+					.catch((err) => {
+						console.error(err);
+					});
+			},
+			searchWork() {
+				this.page = 1;
+				this.getWorks();
+			},
+			//获取作业
+			getWorks() {
+				this.isLoading = true;
+				let params = {
+					bid: this.$store.state.userInfo.organizeid,
+					isRate: 1,
+					classx: this.sClass,
+					cid: this.subject,
+					page: this.page,
+				};
+				this.ajax
+					.get(this.$store.state.api + "getWorks", params)
+					.then((res) => {
+						this.isLoading = false;
+						this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
+						this.tableData = res.data[0];
+					})
+					.catch((err) => {
+						this.isLoading = false;
+						console.error(err);
+					});
+			},
+			right() {
+				this.dialogVisible2 = false;
+			},
+		},
+		created() {
+			this.page = 1;
+			this.getClass();
+			this.getGroup();
+			this.getWorks();
+		},
+	};
 </script>
 
 <style scoped>
-.dialog_diy >>> .el-dialog {
-  background: #fafafa;
-}
-.dialog_diy >>> .el-dialog__header {
-  background: #3d67bc !important;
-  padding: 15px 20px;
-}
-.dialog_diy >>> .el-dialog__title {
-  color: #fff;
-}
-.dialog_diy >>> .el-dialog__headerbtn {
-  top: 19px;
-}
-.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
-  color: #fff;
-}
-.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
-  color: #fff;
-}
-.student_head >>> .el-button--primary {
-  background-color: #2268bc;
-}
-.dialog_diy >>> .el-rate__icon {
-  font-size: 26px;
-}
-.dialog_diy >>> .el-rate {
-  height: auto;
-}
-.xls_button {
-  font-size: 14px;
-  cursor: pointer;
-  text-decoration: underline;
-  color: rgb(34, 104, 188);
-}
-.student_head {
-  display: flex;
-  justify-content: space-between;
-}
-.student_search {
-  display: flex;
-  width: 800px;
-  align-items: center;
-}
-.student_search span {
-  margin: 0 5px;
-  min-width: 65px;
-}
-.student_button {
-  display: flex;
-  overflow: hidden;
-  height: 40px;
-}
-.student_button .el-button--primary {
-  margin-right: 10px;
-}
-.upload-demo {
-  display: flex;
-  flex-direction: column;
-  align-items: end;
-  /* position: relative; */
-  width: 100px;
-  overflow: hidden;
-}
-.student_table {
-  margin: 20px 0;
-}
-
-.el-table >>> .even_row {
-  background-color: #f1f1f1;
-}
-
-.works_score_work {
-  margin: 0 0 20px 0;
-  padding: 20px 0;
-  border-bottom: 2px solid #eee;
-}
-.works_score_work:last-child {
-  border: none;
-}
-.score_head span {
-  cursor: pointer;
-}
-.score_head {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  font-size: 20px;
-}
-
-.score_work {
-  margin: 15px 10px;
-}
-
-.work_content {
-}
-.store {
-  padding: 10px 20px;
-}
-.stored {
-  background: #225088;
-  border-color: none;
-}
-.workd_media {
-  width: 100%;
-  height: 400px;
-}
-.workd_title {
-  font-size: 20px;
-  margin-top: 20px;
-}
-.workd_content {
-  margin-bottom: 30px;
-}
-.mywd_rate_comment {
-  padding: 10px 0 5px 0;
-  border-bottom: 2px solid #eee;
-}
-.mywd_rate_head {
-  display: flex;
-}
-.mywd_rate_head_img {
-  width: 50px;
-}
-.mywd_rate_head_img img {
-  width: inherit;
-}
-
-.mwd_img_box {
-  width: 40px;
-  height: 40px;
-  border-radius: 50px;
-  overflow: hidden;
-  margin: 5px;
-}
-.user_comment {
-  width: 30px;
-  height: 30px;
-}
-.mwd_img_box img {
-  height: inherit;
-}
-
-.mywd_rate_head_title {
-  display: flex;
-  align-items: center;
-}
-.mywd_rate_head_title div {
-  margin-bottom: 10px;
-}
-.mywd_rate_head_title span {
-  margin-left: 10px;
-}
-.mywd_rate_comment_body {
-  width: 88%;
-  margin: 0 auto 10px;
-  font-size: 14px;
-}
-.sd_head {
-  margin: 10px auto;
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-}
-.sd_head img {
-  width: 50px;
-  height: 50px;
-}
-.sd_head span {
-  margin-left: 20px;
-  font-size: 20px;
-}
-.sd_title {
-  font-size: 18px;
-  margin: 20px auto;
-}
-.sd_title span:nth-child(2) {
-  margin-left: 10px;
-  color: rgb(156, 156, 156);
-}
-
-.sd_score {
-  font-size: 18px;
-  background: #fff;
-  padding: 18px 18px 1px;
-  width: 310px;
-  margin-bottom: 15px;
-}
-.sd_score .score_box {
-  display: flex;
-  align-items: center;
-  margin-bottom: 18px;
-}
-.sd_score span {
-  width: 130px;
-  text-align: justify;
-  text-align-last: justify;
-  display: block;
-  margin-right: 20px;
-}
-.sd_comment {
-  font-size: 20px;
-}
-.sd_comment .displayBox {
-  margin-bottom: 10px;
-  display: block;
-  border-bottom: 3px solid #eee;
-  /* padding: 0 0 15px 0; */
-  display: flex;
-}
-.displayBox span {
-  width: 80px;
-}
-.easy_comment {
-  width: calc(100% - 90px);
-  margin-left: 10px;
-  display: flex;
-  flex-wrap: wrap;
-}
-
-.easy_comment div {
-  border: 1px solid #4a4a4a;
-  color: #666666;
-  border-radius: 15px;
-  padding: 5px 10px;
-  font-size: 16px;
-  margin-bottom: 10px;
-  margin-right: 5px;
-  cursor: pointer;
-}
-.easy_comment div:hover {
-  border: 1px solid #f7ba2a;
-  color: #c69217;
-}
-.sd_comment >>> .el-textarea__inner {
-  background: #fafafa;
-}
-.work_white {
-  background: #fff;
-  padding: 15px;
-  border-radius: 5px;
-}
-.workd_comment {
-  max-height: 250px;
-  overflow: auto;
-}
-
-.notR {
-  position: absolute;
-  background: red;
-  width: 5px;
-  height: 5px;
-  border-radius: 30px;
-  top: 5px;
-  right: -3px;
-}
+	.pb_head > span:nth-child(2) {
+		font-size: 16px;
+		margin-left: 80px;
+		color: #ab582f;
+	}
+	.student_head {
+		margin-bottom: 20px;
+	}
+	.student_search {
+		display: flex;
+	}
+	.student_search > div:nth-child(1) {
+		line-height: 35px;
+		font-size: 14px;
+	}
+	.student_search >>> .el-input__inner {
+		width: 190px;
+		height: 35px;
+		margin-left: 10px;
+	}
+	.student_table >>> .el-table--border td {
+		border-right: 0px !important;
+	}
+	.add_work >>> .el-dialog__header {
+		padding: 20px 20px 10px;
+		text-align: center;
+		background: #32455b;
+	}
+	.add_work >>> .el-dialog__title {
+		font-size: 14px !important;
+		color: #fff !important;
+	}
+	.add_work >>> .el-dialog__headerbtn {
+		font-size: 20px !important;
+	}
+	.add_work >>> .el-form-item__label {
+		margin-left: 65px;
+	}
+	.add_work >>> .el-form-item {
+		display: flex;
+	}
+	.add_work >>> .el-form-item__content {
+		margin: 0 !important;
+	}
+	.add_work >>> .el-dialog__footer {
+		text-align: center !important;
+	}
+	.header-title {
+		display: flex;
+	}
+	.logoImg {
+		width: 30px;
+	}
+	.logoImg > img {
+		width: 100%;
+		height: 100%;
+	}
+	.title_add_student {
+		margin: 0 auto;
+		color: #fff;
+	}
+	.top {
+		display: flex;
+		justify-content: space-between;
+		padding-bottom: 10px;
+		border-bottom: 2px solid #eee;
+	}
+	.top > div:nth-child(1) {
+		font-size: 18px;
+	}
+	.top > div:nth-child(2) {
+		font-size: 14px;
+		line-height: 28px;
+	}
+	.first {
+		margin-top: 25px;
+		border-bottom: 1px solid #c5c5c5;
+	}
+	.one_top {
+		display: flex;
+		justify-content: space-between;
+	}
+	.one_top > div:nth-child(1) {
+		color: #2490bf;
+		font-size: 16px;
+	}
+	.one_top > button {
+		width: 100px;
+		background: #24a0a4;
+		height: 30px;
+		color: #e0e0e0;
+		font-size: 13px;
+		padding: 0 !important;
+	}
+	.work_Img {
+		width: 150px;
+		margin: 10px 0;
+	}
+	.assess_Img {
+		width: 400px;
+		margin: 0 auto;
+		padding: 15px 0;
+	}
+	.work_Img > img,
+	.assess_Img > img {
+		width: 100%;
+		height: 100%;
+	}
+	.work_input {
+		border: 1px solid;
+		width: 135px;
+		height: 20px;
+		line-height: 20px;
+		font-size: 13px;
+		padding: 5px;
+	}
+	.poetry {
+		margin: 10px 0 15px 0;
+	}
+	.assess {
+		background: #169bd5 !important;
+	}
+	.assess_top {
+		border-bottom: 2px solid #eee;
+		padding-bottom: 10px;
+	}
+	.assess_top > div:nth-child(1) {
+		color: #2490bf;
+		font-size: 16px;
+	}
+	.student_Answer {
+		display: flex;
+		margin: 5px 10px;
+		border-bottom: 1px solid #ccc;
+		padding-bottom: 25px;
+	}
+	.workName {
+		font-size: 18px;
+		font-weight: bold;
+		margin: 5px 10px;
+	}
+	.toux {
+		width: 25px;
+		margin: auto 0;
+		height: 25px;
+	}
+	.toux > img {
+		width: 100%;
+		height: 100%;
+	}
+	.nav {
+		display: flex;
+		flex-wrap: wrap;
+		margin-top: 10px;
+		flex-direction: column;
+	}
+	.studentName {
+		margin-left: 10px;
+		font-size: 13px;
+	}
+	.studentAnswer {
+		font-size: 12px;
+		margin: 5px 0 0 10px;
+	}
+	.comment {
+		margin: 20px 0 0 10px;
+	}
+	.comment > .comment_title {
+		font-size: 18px;
+	}
+	.comment > .comment_title > span {
+		font-size: 14px;
+	}
+	.other_Answer {
+		display: flex;
+		margin: 5px 10px;
+		border-bottom: 1px solid #ccc;
+		padding-bottom: 15px;
+	}
+	.nav {
+		margin-left: 5px;
+	}
+	.nameAndTime {
+		display: flex;
+	}
+	.otherName {
+		font-weight: bold;
+		margin-left: 10px;
+		font-size: 13px;
+	}
+	.time {
+		margin-left: 25px;
+		font-size: 12px;
+		margin-top: 3px;
+	}
+	.otherAnswer {
+		width: 400px;
+		word-wrap: break-word;
+		word-break: break-all;
+		overflow: hidden;
+		font-size: 12px;
+		margin: 5px 0 0 10px;
+	}
+	.doingAssess {
+		margin: 0 auto;
+		width: 300px;
+		background: #169bd5;
+		height: 35px;
+		line-height: 35px;
+		border-radius: 3px;
+		font-size: 13px;
+		text-align: center;
+		color: #fff;
+		margin-top: 30px;
+		cursor: pointer;
+	}
+	.score_top {
+		display: flex;
+		margin-left: 15px;
+	}
+	.userTou {
+		width: 50px;
+	}
+	.userTou > img {
+		width: 100%;
+		height: 100%;
+	}
+	.score_user_name {
+		line-height: 53px;
+		margin-left: 15px;
+	}
+	.course_top {
+		display: flex;
+		margin: 30px 0 0 20px;
+	}
+	.course_top > div:nth-child(1) {
+		line-height: 25px;
+	}
+	.course_top > div:nth-child(2) {
+		border: 1px solid #ccc;
+		width: 250px;
+		text-align: center;
+		height: 25px;
+		line-height: 25px;
+		margin-left: 30px;
+	}
+	.sd_score {
+		font-size: 15px;
+		background: #fff;
+		padding: 18px 25px 1px;
+		width: 310px;
+		margin-bottom: 15px;
+	}
+	.sd_score .score_box {
+		display: flex;
+		align-items: center;
+		margin-bottom: 18px;
+	}
+	.sd_score span {
+		width: 100px;
+		text-align: justify;
+		text-align-last: justify;
+		display: block;
+		margin-right: 20px;
+	}
+	.moreSay {
+		margin: 0px 0 5px 20px;
+	}
+	.more_say_input {
+		margin-left: 20px;
+		width: 90%;
+	}
+	.more_say_input >>> .el-input__inner {
+		height: 75px;
+		font-size: 13px;
+		padding: 0 0 0 10px;
+	}
+	.assess_right {
+		width: 200px;
+		background: #666666;
+		color: #fff;
+		text-align: center;
+		height: 25px;
+		line-height: 25px;
+		border-radius: 5px;
+		margin: 0 auto;
+		margin-top: 20px;
+		font-size: 13px;
+		cursor: pointer;
+	}
 </style>

+ 12 - 12
src/components/tools/leftBar.vue

@@ -25,16 +25,16 @@
         >
           <el-menu-item index="/course">
             <div class="img" v-if="path == '/course'">
-              <img src="../../assets/icon/course-active.png" alt="" />
+              <img src="../../assets/icon/course-active.svg" alt="" />
             </div>
             <div class="img" v-else>
               <img src="../../assets/icon/course.png" alt="" />
             </div>
-            <span>课程管理</span>
+            <span>课程项目管理</span>
           </el-menu-item>
           <el-menu-item index="/student">
             <div class="img" v-if="path == '/student'">
-              <img src="../../assets/icon/user-active.png" alt="" />
+              <img src="../../assets/icon/student-active.svg" alt="" />
             </div>
             <div class="img" v-else>
               <img src="../../assets/icon/user.png" alt="" />
@@ -43,25 +43,25 @@
           </el-menu-item>
           <el-menu-item index="/works">
             <div class="img" v-if="path == '/works'">
-              <img src="../../assets/icon/works-active.png" alt="" />
+              <img src="../../assets/icon/work-active.svg" alt="" />
             </div>
             <div class="img" v-else>
               <img src="../../assets/icon/works.png" alt="" />
             </div>
-            <span slot="title">作业管理</span>
+            <span slot="title">评价管理</span>
           </el-menu-item>
-          <!-- <el-menu-item index="/class">
+          <el-menu-item index="/class">
             <div class="img" v-if="path == '/class'">
-              <img src="../../assets/icon/class-active.png" alt="" />
+              <img src="../../assets/icon/class-active.svg" alt="" />
             </div>
             <div class="img" v-else>
               <img src="../../assets/icon/class.png" alt="" />
             </div>
             <span slot="title">班级管理</span>
-          </el-menu-item> -->
+          </el-menu-item>
           <el-menu-item index="/data">
             <div class="img" v-if="path == '/data'">
-              <img src="../../assets/icon/data-active.png" alt="" />
+              <img src="../../assets/icon/data-active.svg" alt="" />
             </div>
             <div class="img" v-else>
               <img src="../../assets/icon/data.png" alt="" />
@@ -70,14 +70,14 @@
           </el-menu-item>
           <el-menu-item index="/notice">
             <div class="img" v-if="path == '/notice'">
-              <img src="../../assets/icon/notice-active.png" alt="" />
+              <img src="../../assets/icon/new-active.svg" alt="" />
             </div>
             <div class="img" v-else>
               <img src="../../assets/icon/notice.png" alt="" />
             </div>
             <span slot="title">通知公告</span>
           </el-menu-item>
-          <el-menu-item index="/ask">
+          <!-- <el-menu-item index="/ask">
             <div class="img" v-if="path == '/ask'">
               <img
                 src="../../assets/icon/ask-active.png"
@@ -93,7 +93,7 @@
               />
             </div>
             <span slot="title">问卷调查</span>
-          </el-menu-item>
+          </el-menu-item> -->
         </el-menu>
       </el-col>
     </el-row>

+ 2 - 2
src/config/config.js

@@ -9,8 +9,8 @@ const store = new Vuex.Store({
         luyou:1,
         userInfo: {},
         nCount:0,
-        api: 'https://ld.api.cocorobo.cn/edu/',
-        // api: 'http://localhost:7003/edu/',
+        // api: 'https://ld.api.cocorobo.cn/edu/',
+        api: 'http://localhost:7003/pbl/',
     },
 
     mutations: {

+ 16 - 16
src/main.js

@@ -48,7 +48,7 @@ router.beforeEach((to, from, next) => {
   // 判断该路由是否需要登录权限
   if (requireAuth) {
     var isLogin = VueCookies.get('tlogin')
-    if (isLogin == "1") {
+    // if (isLogin == "1") {
       var userinfo = VueCookies.get('teacherInfo')
       store.commit("update", ["isLogin", true]);
 
@@ -57,21 +57,21 @@ router.beforeEach((to, from, next) => {
       store.state.luyou = store.state.luyou + 1
       store.commit("update", ["luyou", store.state.luyou]);
       next()
-    } else {
-      const loading = Loading.service({
-        background: "rgba(255, 255, 255)",
-        target: document.querySelector("body"),
-      });
-      store.commit("update", ["isLogin", false]);
-      Message({
-        message: '未登录,请登录',
-        type: 'warning'
-      });
-      setTimeout(() => {
-        loading.close();
-        next('/login')
-      }, 2000);
-    }
+    // } else {
+    //   const loading = Loading.service({
+    //     background: "rgba(255, 255, 255)",
+    //     target: document.querySelector("body"),
+    //   });
+    //   store.commit("update", ["isLogin", false]);
+    //   Message({
+    //     message: '未登录,请登录',
+    //     type: 'warning'
+    //   });
+    //   setTimeout(() => {
+    //     loading.close();
+    //     next('/login')
+    //   }, 2000);
+    // }
   } else {
     next()  // 确保一定要有next()被调用
   }

+ 8 - 0
src/router/index.js

@@ -11,6 +11,7 @@ import student from '@/components/pages/student'
 import works from '@/components/pages/works'
 import login from '@/components/login'
 import ask from '@/components/pages/ask'
+import addCourse from '@/components/pages/addCourse'
 
 Vue.use(Router).use(ElementUI)
 
@@ -42,6 +43,13 @@ export default new Router({
         requireAuth: true // 是否需要判断是否登录,这里是需要判断
       }
     },
+    {
+      path: '/course/addCourse',
+      component: addCourse,
+      meta: {
+        requireAuth: true // 是否需要判断是否登录,这里是需要判断
+      }
+    },
     {
       path: '/data',
       name: 'data',

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff