Explorar el Código

关联不能选自己,和文档问题

yuanyiming hace 1 año
padre
commit
3b872276cd

+ 7 - 2
src/views/eva/components/radioSelect.vue

@@ -36,6 +36,9 @@ export default {
       type: String,
       default: ''
     },
+    num: {
+      type: Number
+    },
     listCont: {
       type: Array,
       default: () => []
@@ -56,7 +59,7 @@ export default {
     // 判断弹出选项列表
     icoIsShow() {
       this.ico = !this.ico
-      this.$emit('selBtn')
+      this.$emit('selBtn', this.num)
     },
     // 判断学生是否被选中
     cho(e) {
@@ -94,6 +97,8 @@ export default {
   box-sizing: border-box;
   // padding: 0px 15px;
   padding-right: 15px;
+  z-index: 9;
+  // background-color: #eef0f3;
   font-size: 12px;
   .ico {
     width: 10px;
@@ -111,7 +116,7 @@ export default {
     background-color: #fff;
     width: 100%;
     box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.1);
-    z-index: 100;
+    z-index: 10;
     border-radius: 8px;
     .ol {
       height: 40px;

+ 47 - 42
src/views/eva/components/selects.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="selcts" @click.stop="icoIsShow">
+  <div class="selcts" :style="{ zIndex: num + 2 }" @click.stop="icoIsShow">
     <!-- <div class="backPage" v-if="!ico" @click="fuClick1"></div> -->
     <div style="flex: 1;">
       <div style="color: rgba(0, 0, 0, 0.40);" v-if="!choosePer.length">
@@ -16,14 +16,12 @@
     </div>
 
     <div class="ico">
-      <van-icon size="14px" :name="ico ? 'arrow-down' : 'arrow-left'" />
+      <van-icon size="14px" :name="ico ? 'arrow-left' : 'arrow-down'" />
     </div>
 
-    <div class="list" v-if="!ico">
+    <div class="list" v-if="ico">
       <div class="ol" v-for="(i, index) in listContent" :key="index + 'w'" @click.stop="choose(i)">
-        <div :style="{ color: choosePer.includes(i.id) ? 'blue' : '' }">
-          {{ i.name }}
-        </div>
+        <div :style="{ color: choosePer.includes(i.id) ? 'blue' : '' }">{{ i.name }}</div>
         <div>
           <img :style="{ display: choosePer.includes(i.id) ? '' : 'none' }" src="@/assets/images/eva/dui.png" alt="" />
         </div>
@@ -39,6 +37,9 @@ export default {
       type: String,
       default: ''
     },
+    num: {
+      type: Number
+    },
     listContent: {
       type: Array,
       default: () => []
@@ -50,37 +51,38 @@ export default {
   },
   data() {
     return {
-      ico: 1,
+      ico: 0,
       txtColor: 'txtColor'
     }
   },
   methods: {
     // 判断弹出选项列表
     icoIsShow() {
+      console.log(this.listContent)
       this.ico = !this.ico
-      this.$emit('selBtn')
+      this.$emit('selBtn', this.num, this.ico)
     },
     // 判断学生是否被选中
     choose(e) {
-      // console.log(this.listContent)
+      console.log(e)
+      const arr = this.num * 1
+      if (arr !== 1) {
+        if (this.choosePer.includes(e.id)) return
+        this.choosePer.push(e.id)
+      } else {
+        this.choosePer.splice(0, 1, e.id)
+      }
       // console.log('判断学生是否被选中', e)
-      if (this.choosePer.includes(e.id)) return
-      this.choosePer.push(e.id)
-      // console.log(this.choosePer)
     },
     // 删除学生
     delStu(e) {
       // console.log('删除学生', e)
-      // console.log(this.choosePer)
       const iii = this.choosePer.indexOf(e)
       this.choosePer.splice(iii, 1)
-      //   console.log()
     },
     // 此方法在父元素中被调用
     fuClick() {
-      // console.log(111)
-      // this.ico = !this.ico
-      this.ico = 'false'
+      this.ico = 0
     }
   }
 }
@@ -99,13 +101,40 @@ export default {
   height: 100vh;
   // z-index: 200;
 }
+.list {
+  position: absolute;
+  left: 0;
+  top: calc(100% + 10px);
+  max-height: 220px;
+  overflow-y: scroll;
+  background-color: #fff;
+  width: 100%;
+  box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.1);
+  z-index: 1000;
+  border-radius: 8px;
+  .ol {
+    height: 40px;
+    line-height: 40px;
+    width: 100%;
+    background-color: #fff;
+    box-sizing: border-box;
+    padding: 0px 10px;
+    display: flex;
+    justify-content: space-between;
+  }
+  // .ol:hover {
+  //   background-color: #f3f6f9;
+  // }
+}
 .selcts {
   position: relative;
   display: flex;
   box-sizing: border-box;
   // padding: 0px 15px;
   padding-right: 15px;
+  z-index: 2;
   font-size: 12px;
+  // background-color: #eef0f3;
   .ico {
     width: 10px;
     position: absolute;
@@ -113,31 +142,7 @@ export default {
     top: 50%;
     transform: translateY(-50%);
   }
-  .list {
-    position: absolute;
-    left: 0;
-    top: calc(100% + 10px);
-    max-height: 220px;
-    overflow-y: scroll;
-    background-color: #fff;
-    width: 100%;
-    box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.1);
-    z-index: 1000;
-    border-radius: 8px;
-    .ol {
-      height: 40px;
-      line-height: 40px;
-      width: 100%;
-      background-color: #fff;
-      box-sizing: border-box;
-      padding: 0px 10px;
-      display: flex;
-      justify-content: space-between;
-    }
-    // .ol:hover {
-    //   background-color: #f3f6f9;
-    // }
-  }
+
   .choosePerCon {
     height: 100%;
     flex: 1;

+ 16 - 91
src/views/eva/studentDetail.vue

@@ -43,8 +43,7 @@
           </div>
         </div>
         <div class="cla">{{ studentInfo.cname }}</div>
-        <!-- <div class="shade"></div> -->
-        <!-- 遮罩层 -->
+
         <div class="backPage" v-if="isSelectShow" @click="fuClick1"></div>
 
         <!-- <selectStyle
@@ -63,7 +62,7 @@
             <div class="btnBack" v-if="num" @click="upStu">
               <img class="img" src="../../assets/images/eva/zuo01.png" alt="" />
             </div>
-            <div class="btnBack" v-else>
+            <div class="btnBack" v-else @click="promptOne">
               <img class="img" src="../../assets/images/eva/zuo01.png" alt="" />
             </div>
           </div>
@@ -71,7 +70,7 @@
             <div class="btnBack" v-if="num != stuList.length - 1" @click="nextStu">
               <img class="img" src="../../assets/images/eva/you02.png" alt="" />
             </div>
-            <div class="btnBack" v-else>
+            <div class="btnBack" v-else @click="promptEnd">
               <img class="img" src="../../assets/images/eva/you02.png" alt="" />
             </div>
           </div>
@@ -95,22 +94,9 @@
           <van-dropdown-menu>
             <van-dropdown-item @change="handleUpdateSearch" v-model="termId" title="学期" :options="termList" />
           </van-dropdown-menu>
-
-          <!-- <img class="img" src="../../assets/images/eva/Frame (5).png" alt="" /> -->
         </div>
       </div>
-      <!-- <div class="observe_box">
-        <div
-          class="observe_boxCon"
-          v-for="(i, index) in filtrate"
-          @click="addFil(i.id, index)"
-          :class="{ active: activeItem === index }"
-          :key="index"
-        >
-          <div class="txt">{{ i.name }}</div>
-        </div>
-        </div>
-      </div> -->
+
       <!-- 观察内容开始 -->
       <van-swipe-cell :swipeable="true" v-show="TermRecord.length" v-for="(i, index) in TermRecord" :key="index">
         <div class="observe_content" @click.stop="recordContinue(i.rid)">
@@ -187,19 +173,12 @@ export default {
   },
   data() {
     return {
-      // value1: 0,
-      // option1: [
-      //   { text: '全部商品', value: 0 },
-      //   { text: '新款商品', value: 1 },
-      //   { text: '活动商品', value: 2 }
-      // ],
       // 遮罩层
       isSelectShow: false,
 
       // 切换学生list
       cutListShow: false,
 
-      // activeItem: null,
       // 这个是本学期总条数,单独写一个是因为他不因为观察记录的选择而改变
       conList: [],
       // 筛选项
@@ -368,15 +347,7 @@ export default {
           a.text = e.name
           this.termList.push(a)
         })
-        // console.log('this.termData', this.termData)
-        // this.termList = res[0]
-        // res[0].forEach((e, index) => {
-        //   var val = { value: '', text: '' }
-        //   val.value = e.id
-        //   val.value.text = e.name
-        //   this.termList.push(val)
-        // })
-        // console.log('this.termList', this.termList)
+
         this.getData()
         this.getTermRecord()
 
@@ -385,8 +356,6 @@ export default {
         if (this.classId) {
           this.getStuList()
         }
-
-        // console.log('this.termList', this.termList)
       })
     },
     // 上一个
@@ -491,10 +460,16 @@ export default {
     fuClick1() {
       this.isSelectShow = false
       this.cutListShow = false
-
-      // this.selectCordS()
-      // this.$refs.claSel.close()
-      // this.$refs.weiSel.close()
+    },
+    promptOne() {
+      this.$toast({
+        message: '已是第一名同学'
+      })
+    },
+    promptEnd() {
+      this.$toast({
+        message: '已是最后一名同学'
+      })
     },
 
     // 子组件调用父组件方法显示遮罩层
@@ -586,58 +561,8 @@ export default {
       // this.$router.push(`/studentEvaluate?shareShow=${1}&rid=${e}&cid=${this.$route.query.cid}`)
       this.$router.push(`/studentEvaluate?shareShow=${1}&rid=${e}`)
     }
-    // touchStart(e) {
-    //   this.timeOutEvent = setTimeout(() => {
-    //     this.timeOutEvent = 0
-    //     const target = this.$refs.loop[e]
-    //     target.style.display = 'block'
-    //     if (e % 4 !== 0) {
-    //       console.log(0)
-    //       target.style.right = '0'
-    //     }
-    //   }, 500)
-    //   return false
-    // },
-    // // 如果手指有移动,则取消所有事件,此时说明用户只是要移动而不是长按
-    // gtouchmove() {
-    //   clearTimeout(this.timeOutEvent) // 清除定时器
-    //   this.timeOutEvent = 0
-    //   // alert('取消了')
-    // },
-    // touchend(e) {
-    //   // 清除定时器
-
-    //   clearTimeout(this.timeOutEvent)
-    //   console.log(this.timeOutEvent)
-    //   if (this.timeOutEvent !== 0) {
-    //     // 这里写要执行的内容(尤如onclick事件)
-    //     console.log('你这是点击,不是长按')
-    //   } else {
-    //     setTimeout(() => {
-    //       const target = this.$refs.loop[e]
-    //       target.style.display = 'none'
-    //     }, 1000)
-    //   }
-    // },
-
-    //   selectRecord(data4).then(res => {
-    //     console.log('获取所有学生记录', res[0])
-    //     this.conList = res[0]
-    //   })
-    //   // this.getTermRecord()
-    // },
   },
-  // beforeRouteEnter(to, from, next) {
-  //   document.addEventListener(
-  //     'touchmove',
-  //     function(event) {
-  //       console.log('event', event)
-  //       event.preventDefault()
-  //     },
-  //     false
-  //   )
-  //   next(vm => {})
-  // },
+
   mounted() {},
   created() {
     this.stuId = localStorage.getItem('userId')

+ 93 - 97
src/views/eva/studentEvaluate.vue

@@ -16,12 +16,12 @@
     <!-- <div class="bigBlock"> -->
     <div class="bigBlock" style="">
       <!-- 遮罩层 -->
-      <div class="popCSS" ref="popCss" @click="col"></div>
-      <div
+      <div class="popCSS" v-if="popCssNum" ref="popCss" @click="col"></div>
+      <!-- <div
         v-if="placeShow"
         @click="placeShow = false"
         style="position:absolute;top: 0;left: 0;width: 100%;height: 100%;z-index: 10;"
-      ></div>
+      ></div> -->
       <div class="claName">
         <div class="tit">学生</div>
         <div class="studentName">{{ studentInfo.name }}</div>
@@ -40,6 +40,7 @@
           <selects
             ref="StuSel"
             @selBtn="selBtn"
+            :num="2"
             :listContent="studentList"
             :tit="'请选择关联学生'"
             :choosePer="selectSData"
@@ -50,13 +51,22 @@
       <div class="claName">
         <div class="tit">学期</div>
         <div class="studentName" style="position: relative;">
-          <radioSelect
+          <!-- <radioSelect
             @selBtn="selBtn"
             ref="claSel"
+            :num="0"
             :listCont="termList"
             :tit="'请选择学期'"
             :choose="termData"
-          ></radioSelect>
+          ></radioSelect> -->
+          <selects
+            ref="claSel"
+            @selBtn="selBtn"
+            :num="1"
+            :listContent="termList"
+            :tit="'请选择学期'"
+            :choosePer="termData"
+          ></selects>
           <div v-show="term" style="position: absolute;bottom: -100%; color: red;font-size: 10px;">请选择学期</div>
         </div>
       </div>
@@ -68,6 +78,7 @@
           <selects
             @selBtn="selBtn"
             ref="WeiSel"
+            :num="0"
             :listContent="weiList"
             :tit="'请选择评价维度'"
             :choosePer="selectWData"
@@ -114,7 +125,7 @@
 
       <div class="claName" style="position: relative;">
         <div class="tit">地点</div>
-        <div class="inpBlock studentName">
+        <div class="inpBlock studentName" style="z-index: 1;">
           <!-- <radioSelect ref="claSel" :listCont="placeList" :tit="'请选择地点'" :choose="termData"></radioSelect> -->
           <!-- <div > -->
           <!-- :readonly="placeId != 1" -->
@@ -162,14 +173,14 @@
         <image-component @getImage="getImage" :imgList.sync="imgList"></image-component>
       </div>
       <!-- 上传图片结束 -->
-      <div class="submitBtn">
+      <div class="submitBtn" @click="col">
         <!-- <div class="btn" @click="isShowMask = true">删除</div> -->
         <!-- <div class="btn" v-if="shareShow" @click="repPop">重复添加</div>
       <div class="btn" v-if="shareShow" @click="repetitionSave">添加新纪录</div> -->
-        <div class="btn" @click="repPop(0)">新增本条</div>
-        <div class="btn" @click="repetitionSave(1)">新增空白</div>
-        <div class="btn" v-if="!shareShow" @click="save">发布并返回</div>
-        <div class="btn" v-else @click="amend">修改并返回</div>
+        <div class="btn" @click.stop="repPop(0)">新增本条</div>
+        <div class="btn" @click.stop="repetitionSave(1)">新增空白</div>
+        <div class="btn" v-if="!shareShow" @click.stop="save">发布并返回</div>
+        <div class="btn" v-else @click.stop="amend">修改并返回</div>
       </div>
     </div>
     <!-- </div> -->
@@ -221,18 +232,6 @@
         <div class="btn" style="color: rgba(251,67,25,1);" @click="repAddRecord">确认</div>
       </template>
     </pop>
-
-    <!-- <pop v-show="repAddShowMask">
-      <template v-slot:tit>提示</template>
-      <template v-slot:con>确定重复添加吗?</template>
-      <template v-slot:btn1>
-        <div class="btn" style="color: rgba(136,136,136,1);" @click="repAddShowMask = false">取消</div>
-      </template>
-      <template v-slot:btn2>
-        <div class="btn" style="color: rgba(251,67,25,1);" @click="repAddShowMaskRecord">确认</div>
-      </template>
-    </pop> -->
-
     <pop v-show="backShowMask">
       <template v-slot:tit>提示</template>
       <template v-slot:con>是否放弃当前编辑内容?</template>
@@ -252,7 +251,7 @@ import bar from './components/bar.vue'
 // 多选框组件
 import selects from './components/selects.vue'
 // 单选
-import radioSelect from './components/radioSelect.vue'
+// import radioSelect from './components/radioSelect.vue'
 
 // 上传图片组件
 import imageComponent from './components/ImageComponent.vue'
@@ -277,8 +276,8 @@ export default {
     bar,
     selects,
     imageComponent,
-    pop,
-    radioSelect
+    pop
+    // radioSelect
   },
 
   data() {
@@ -286,6 +285,9 @@ export default {
       studentInfo: {},
       classEspNum: false,
       repShowMask: false,
+      popCssNum: 0,
+      // 判断多选框展示(不关闭哪个)
+      tyNum: 0,
       // // 重复添加弹出框判断
       // repMaskNum: 0,
       // 添加新纪录弹框判断
@@ -344,16 +346,36 @@ export default {
   },
 
   methods: {
-    selBtn() {
-      console.log(1111)
-      this.$refs.popCss.style.display = 'block'
-      // this.$refs.claSel.fuClick()
-      // this.$refs.StuSel.fuClick()
-      // this.$refs.WeiSel.fuClick()
+    selBtn(e, i) {
+      this.tyNum = e
+      // this.$refs.popCss.style.display = 'block'
+      this.popCssNum = true
+
+      if (e == 2) {
+        this.$refs.claSel.fuClick()
+        this.$refs.WeiSel.fuClick()
+        this.placeShow = false
+        if (!i) {
+          this.popCssNum = false
+        }
+      } else if (e == 1) {
+        this.$refs.StuSel.fuClick()
+        this.$refs.WeiSel.fuClick()
+        this.placeShow = false
+        if (!i) {
+          this.popCssNum = false
+        }
+      } else {
+        this.$refs.claSel.fuClick()
+        this.$refs.StuSel.fuClick()
+        this.placeShow = false
+        if (!i) {
+          this.popCssNum = false
+        }
+      }
     },
     classEsp() {
       this.classEspNum = !this.classEspNum
-      // console.log('点击了');
     },
     getData() {
       // 获取学生信息
@@ -372,7 +394,9 @@ export default {
         }
         // console.log('获取班学生列表', data2)
         selectManyClassStudent(data2).then(res => {
-          this.studentList = res[0]
+          this.studentList = res[0].filter(i => {
+            return i.id !== localStorage.getItem('userId')
+          })
           console.log('班级同学列表', this.studentList)
         })
       })
@@ -381,29 +405,6 @@ export default {
       this.getWei()
 
       this.getTermData()
-      // selectVeiDoo().then(res => {
-      //   this.weiList = res[0]
-      //   // console.log('this.weiList', this.weiList)
-      // })
-
-      // console.log('获取筛选项22222222', data3)
-
-      // 获取学期筛选框
-
-      // 获取班学生列表
-      // const data2 = {
-      //   cid: this.$route.query.cid
-      // }
-      // selectClassStudent(data2).then(res => {
-      //   res[0].forEach(e => {
-      //     if (e.id === this.$route.query.uid) {
-      //       this.stuName = e
-      //     } else {
-      //       this.studentList.push(e)
-      //     }
-      //   })
-      //   console.log('this.studentList', this.studentList)
-      // })
     },
     // 获取学期筛选框
     getTermData() {
@@ -464,7 +465,9 @@ export default {
     },
     // 调用子元素selects中的方法隐藏选项列表
     col() {
-      this.$refs.popCss.style.display = 'none'
+      // this.$refs.popCss.style.display = 'none'
+      this.popCssNum = false
+      this.placeShow = false
 
       this.$refs.claSel.fuClick()
       this.$refs.StuSel.fuClick()
@@ -485,10 +488,7 @@ export default {
         this.wei = true
         isOk = 1
       }
-      // if (this.visitTime === '') {
-      //   this.tim = true
-      //   isOk = 1
-      // }
+
       if (isOk === 1) return
 
       this.isShowMask = true
@@ -562,8 +562,11 @@ export default {
           console.log(isOk)
         }
         if (isOk) {
-          console.log('111')
-          this.AddNewRecord()
+          this.noSave()
+          this.shareShow = 0
+          this.col()
+
+          // this.AddNewRecord()
           return
         }
         this.addNewShowMask = 1
@@ -599,38 +602,17 @@ export default {
         } else {
           this.placeList = ptype
         }
-
-        // if (fotype.length == 0 && sotype.length == 0) {
-        //   if (fctype.length == 0 && sctype.length == 0) {
-        //     for (var i = 0; i < ftype.length; i++) {
-        //       allfType.push(ftype[i])
-        //     }
-        //     for (var i = 0; i < stype.length; i++) {
-        //       allsType.push(stype[[i]])
-        //     }
-        //   } else {
-        //     for (var i = 0; i < fctype.length; i++) {
-        //       allfType.push(fctype[i])
-        //     }
-        //     for (var i = 0; i < sctype.length; i++) {
-        //       allsType.push(sctype[[i]])
-        //     }
-        //   }
-        // } else {
-        //   for (var i = 0; i < fotype.length; i++) {
-        //     allfType.push(fotype[i])
-        //   }
-        //   for (var i = 0; i < sotype.length; i++) {
-        //     allsType.push(sctysotypepe[[i]])
-        //   }
-        // }
-        // console.log('分类分类分类', res)
-        // this.weiList = allsType
       })
     },
     // 显示地点选择框
     selectPlace() {
-      this.placeShow = true
+      // this.$refs.popCss.style.display = 'block'
+      this.popCssNum = !this.placeShow
+      this.placeShow = !this.placeShow
+
+      this.$refs.claSel.fuClick()
+      this.$refs.StuSel.fuClick()
+      this.$refs.WeiSel.fuClick()
     },
     // 选择地点点击事件
     cho(i) {
@@ -700,6 +682,7 @@ export default {
       insertRecord(data).then(res => {
         // console.log(res)
         if (res === 1) {
+          this.placeShow = false
           this.$toast({
             message: '重复添加成功',
             type: 'success'
@@ -708,6 +691,8 @@ export default {
           this.recordCon = ''
           this.imgList = []
           this.getPresentDate()
+          this.col()
+
           // this.selectSData = []
           // this.selectWData = []
           // this.getPresentDate()
@@ -726,6 +711,8 @@ export default {
     AddNewRecord() {
       this.addNewShowMask = 0
       this.shareShow = 0
+      this.getPresentDate()
+
       const data = [
         {
           // uid: localStorage.getItem('userId'),
@@ -750,6 +737,8 @@ export default {
       insertRecord(data).then(res => {
         // console.log(res)
         if (res === 1) {
+          this.placeShow = false
+
           this.$toast({
             message: '添加新纪录成功',
             type: 'success'
@@ -762,6 +751,7 @@ export default {
           this.recordCon = ''
           this.imgList = []
           this.placeId = 1
+          this.col()
           // setTimeout(() => {
           //   this.$router.replace('/studentDetail')
           // }, 1000)
@@ -803,6 +793,7 @@ export default {
           })
           setTimeout(() => {
             this.$router.replace('/studentDetail')
+            this.col()
 
             // if (this.$route.query.ser || 0) {
             //   this.$router.replace(`/searchstuDetail?cid=${this.$route.query.cid}&cName=${this.$route.query.CName}`)
@@ -841,6 +832,7 @@ export default {
           })
           setTimeout(() => {
             this.$router.replace('/studentDetail')
+            this.col()
 
             // if (this.$route.query.ser || 0) {
             //   this.$router.replace(`/studentDetail?cid=${this.$route.query.cid}&cName=${this.$route.query.CName}`)
@@ -870,6 +862,9 @@ export default {
         if (allData.type !== '') {
           this.selectWData = allData.type.split(',')
         }
+
+        console.log('this.selectSData', this.selectSData)
+
         this.studentInfo.name = allData.name
         this.studentInfo.cname = allData.cname
         this.studentInfo.classid = allData.classid
@@ -891,7 +886,9 @@ export default {
         }
         // console.log('获取班学生列表', data2)
         selectManyClassStudent(data2).then(res => {
-          this.studentList = res[0]
+          this.studentList = res[0].filter(i => {
+            return i.id !== allData.sid
+          })
         })
 
         // console.log('selectWData', this.selectWData)
@@ -1024,9 +1021,8 @@ export default {
     width: 100%;
     padding: 0 20px;
     transform: translate(-20px, 0);
-    height: 130%;
-    display: none;
-    // background-color: #005ccd;
+    height: 100%;
+    background-color: #005ccd;
     z-index: 1;
   }
   .rl {
@@ -1163,7 +1159,7 @@ export default {
         background-color: #fff;
         width: 100%;
         box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.1);
-        z-index: 30;
+        z-index: 40;
         border-radius: 8px;
         .ol {
           height: 40px;