Forráskód Böngészése

Merge branch 'xiaoqin' into mergeBranch

codeMan 3 éve
szülő
commit
0823125806

+ 22 - 4
src/SManagement/archives_ad/components/detail.vue

@@ -25,7 +25,8 @@
       <div class="file-item" v-for="(item,index) in currentSelectFile.attinfos" :key="index">
         <file-item :itemStyle="itemStyle" 
                    :fileData="[item]"
-                   :isDownLoad="true">
+                   :isDownLoad="true"
+                   @updateDownLoadRecord="updateDownLoadRecord">
         </file-item>
       </div>
     </div>
@@ -78,9 +79,26 @@ export default {
      } 
   },
   methods: {
-    downLoad() {
-      window.open(this.currentSelectFile.url)
-    },
+    //更新下载记录
+    updateDownLoadRecord(data) {
+      this.$api.requested({
+        "classname": "saletool.sharematerial.sharematerial",
+        "method": "updateDownloadLog",
+        "content": {
+                "sat_sharematerialid":this.currentSelectFile.sat_sharematerialid
+        }
+      }).then( res => {
+        console.log(res);
+        
+        if(res.code != 1) {
+          this.$notify({
+            title:'提示',
+            message:'下载更新记录失败',
+            type:'warning'
+          })
+        }
+      })
+    }
   }
 };
 </script>

+ 19 - 4
src/SManagement/archives_sc/archives_details/detail.vue

@@ -18,7 +18,8 @@
       <div class="file-box">
         <file-item :itemStyle="itemStyle" 
                    :fileData="currentSelectFile.attinfos | fileType"
-                   :isDownLoad="true">
+                   :isDownLoad="true"
+                   @updateDownLoadRecord="updateDownLoadRecord">
         </file-item>
       </div>
     </div>
@@ -69,9 +70,23 @@ export default {
     downLoad () {
       window.open(this.currentSelectFile.url)
     },
-    //预览
-    seeClick () {
-
+    //更新下载记录
+    updateDownLoadRecord(data) {
+      this.$api.requested({
+        "classname": "saletool.courseware.courseware",
+        "method": "updateDownloadLog",
+        "content": {
+                "sat_coursewareid":this.currentSelectFile.sat_coursewareid
+        }
+      }).then( res => {
+        if(res.code != 1) {
+          this.$notify({
+            title:'提示',
+            message:'下载更新记录失败',
+            type:'warning'
+          })
+        }
+      })
     }
   }
 };

+ 1 - 1
src/SManagement/archives_upload/components/upload.vue

@@ -62,7 +62,7 @@ export default {
       default() {
         return ''
       }
-    },
+    }
   },
   computed: {
     calcFileType() {

+ 25 - 3
src/SManagement/notice/notice_detail/NoticeDetail.vue

@@ -16,7 +16,12 @@
       <div class="file-download">
         <p class="title">附件下载</p>
         <div class="file-list" v-if="tool.checkAuth($route.name,'read')">
-          <file-item :isDownLoad="true" :itemStyle="itemStyle" :sat_noticeid="detailData.sat_noticeid" :fileData="detailData.attinfos">
+          <file-item 
+                    :isDownLoad="true" 
+                    :itemStyle="itemStyle" 
+                    :sat_noticeid="detailData.sat_noticeid" 
+                    :fileData="detailData.attinfos"
+                    @updateDownLoadRecord="updateDownLoadRecord">
           </file-item>
         </div>
       </div>
@@ -122,8 +127,7 @@ export default {
       })
     },
     //发表
-    sendComment () {
-      
+    sendComment () { 
       if (!this.send.content.leavemessage == true || this.send.content.score == 0) {
         this.$notify({
           title:'提示',
@@ -159,6 +163,24 @@ export default {
         this.send.content.score = res.data[0].score
         this.send.content.leavemessage = res.data[0].leavemessage
       })
+    },
+    //更新下载记录
+    updateDownLoadRecord(data) {
+      this.$api.requested({
+        "classname": "saletool.notice.notice",
+        "method": "updateDownloadRecord",
+        "content": {
+                "sat_noticeid":this.$route.query.sat_noticeid
+        }
+      }).then( res => {
+        if(res.code != 1) {
+          this.$notify({
+            title:'提示',
+            message:'下载更新记录失败',
+            type:'warning'
+          })
+        }
+      })
     }
   }
 };

+ 39 - 16
src/SManagement/user/role-edit/components/RolePowerSelect.vue

@@ -26,9 +26,9 @@
                   </el-checkbox>
                 </template>
               </el-checkbox-group>
-              <!-- <div class="footer padd">
-                <el-checkbox label="" :checked="allCheck"  v-if="bbb">{{checkAll}}</el-checkbox>
-              </div> -->
+              <div class="footer padd">
+                <el-checkbox label="" :checked="allCheck"  v-if="bbb" @change="allCheckClick">{{checkAll}}</el-checkbox>
+              </div>
             </div>
           </el-col>
           <el-col :span="8">
@@ -93,8 +93,7 @@ export default {
     //是否选中
     isCheck () {
       return (data) => {
-        let result
-        if (result = this.currentItem.optionids.find(item => item == data.optionid)) {
+        if (this.currentItem.optionids.find(item => item == data.optionid) != undefined) {
           return true
         } else {
           return false
@@ -149,6 +148,8 @@ export default {
         this.handleHavePower()
         this.calcHavePower(this.powerList)
         this.currentItem = this.powerList[0]
+        this.allCheck = this.currentItem.optionids.length == this.currentItem.options.length
+        this.refreshItem(this)
         this.total = res.total
       })
     },
@@ -185,16 +186,40 @@ export default {
     rowClick (data) {
       this.checkList = []
       this.currentItem = data
+      this.allCheck = this.currentItem.optionids.length == this.currentItem.options.length
       //解决数据刷新 视图不刷新
       this.aaa = false
+      this.bbb = false
       setTimeout(() => {
         this.aaa = true
-        this.allCheck = this.currentItem.options.length == this.currentItem.optionids.length       
+        this.bbb = true
       }, 100)
     },
     //group值发生改变时
     groupChange () {
       this.currentItem.optionids = this.checkList
+      this.allCheck = this.currentItem.optionids.length == this.currentItem.options.length
+      this.bbb = false
+      setTimeout(() => {
+        this.bbb = true
+      })
+    },
+    allCheckClick() {
+      this.allCheck = !this.allCheck
+      if(this.allCheck) {
+        this.currentItem.options.forEach(item => {
+          if(this.currentItem.optionids.find(item2 => item2 == item.optionid) == undefined) {
+            this.currentItem.optionids.push(item.optionid)
+          }
+        })
+      } else {
+        this.currentItem.optionids = []
+        this.checkList = []
+      }
+      this.aaa = false;
+      setTimeout(() => {
+        this.aaa = true
+      })
     },
     clearData () {
       this.power.content.where.condition = ''
@@ -210,16 +235,13 @@ export default {
       this.power.content.pageNumber = n
       this.getPowerList()
     },
-    // allCheckClick() {
-    //   this.allCheck = !this.allCheck
-    //   this.allCheck ? this.currentItem.optionids = [] : this.currentItem.optionids = this.currentItem.options
-    //   this.aaa = false
-    //   setTimeout(() => {
-    //     this.aaa = true
-    //   }, 100)
-    //   console.log(this.currentItem.optionids);
-      
-    // },
+    //重新渲染checkbox
+    refreshItem(target) {
+      target.bbb = false
+      setTimeout(() => {
+        target.bbb = true
+      })
+    }
   },
 };
 </script>
@@ -253,6 +275,7 @@ export default {
   bottom: 24px;
   border-top: 1px solid #cccccc;
   width: 100%;
+  height: 22.7px;
 }
 .role-power-select .power-block .el-checkbox-group {
   display: flex;

+ 1 - 1
src/SManagement/user/user-info/UserInfo.vue

@@ -3,7 +3,7 @@
       <div class="top">
         <div class="avatar">
           <img :src="getAvatar || require('@/assets/normal_avatar.png')" alt="">
-            <up-load target="avatar" @onSuccess="onSuccess" v-if="tool.checkAuth($route.name,'update')"></up-load>
+            <up-load target="avatar" @onSuccess="onSuccess" classType="1" v-if="tool.checkAuth($route.name,'update')"></up-load>
         </div>
       </div>
       <base-info :userInfo="userInfo" ref="userInfo">

+ 61 - 6
src/SManagement/user/user-info/components/PassEdit.vue

@@ -2,15 +2,15 @@
   <div class="password">
     <span @click="dialogVisible=true">编辑</span>
     <el-dialog title="修改密码" :visible.sync="dialogVisible" :before-close="handleClose">
-      <el-form ref="form" :model="form" label-width="80px">
-        <el-form-item label="原密码">
+      <el-form ref="form" :rules="rules" :model="form" label-width="80px">
+        <el-form-item label="原密码" prop="pass">
           <el-input v-model="form.pass" placeholder="请输入原密码"></el-input>
         </el-form-item>
-        <el-form-item label="新密码">
-          <el-input v-model="form.newpass" placeholder="请输入新密码"></el-input>
+        <el-form-item label="新密码" prop="newpass">
+          <el-input placeholder="请输入新密码" v-model="form.newpass" show-password></el-input>
         </el-form-item>
-        <el-form-item label="确认密码">
-          <el-input v-model="form.checkpass" placeholder="请再次输入密码"></el-input>
+        <el-form-item label="确认密码" prop="checkpass">
+          <el-input v-model="form.checkpass" placeholder="请再次输入密码" show-password></el-input>
         </el-form-item>
       </el-form>
       <div class="footer">
@@ -23,15 +23,35 @@
 </template>
 
 <script>
+import md5 from 'js-md5'
 export default {
   name: 'PassEdit',
   data () {
+    let checkPass = (rule,value,callback) => {
+      if(this.form.newpass != this.form.checkpass) {
+        callback(new Error('两次输入密码不一致'))
+      } else {
+        callback()
+      }
+    }
     return {
       dialogVisible: false,
       form: {
         pass:'',
         newpass:'',
         checkpass:''
+      },
+      rules:{
+        pass:[
+          { required: true, message: '请输入密码', trigger: 'blur' },
+        ],
+        newpass:[
+          { required: true, message: '请输入密码', trigger: 'blur' },
+        ],
+        checkpass:[
+          { required: true, message: '请输入密码', trigger: 'blur' },
+          { validator: checkPass, trigger: 'blur' },
+        ]
       }
     };
   },
@@ -45,6 +65,41 @@ export default {
       this.dialogVisible = false
     },
     passEdit() {
+      this.$refs.form.validate(val => {
+        if(val) {
+          this.$api.requested({
+            "accesstoken": "299697db3f25396622f7f4a7f1673405",
+            "classname": "common.usercenter.usercenter",
+            "method": "changePassWord",
+            "content": {
+                "password":md5(this.form.pass),
+                "newpassword":md5(this.form.checkpass)
+            }
+          }).then( res => {
+            if(res.code == 1) {
+              this.$notify({
+                title:'提示',
+                message:'密码修改成功',
+                type:'success'
+              })
+              this.$refs.form.resetFields()
+            } else {
+              this.$notify({
+                title:'提示',
+                message:'密码修改失败',
+                type:'warning'
+              })
+              this.$refs.form.resetFields()
+            }
+          })
+        } else {
+          this.$notify({
+            title:'提示',
+            message:'请按照要求修改密码',
+            type:'warning'
+          })
+        }
+      })
     },
   },
 };

+ 16 - 3
src/SManagement/user/user-info/components/PhoneEdit.vue

@@ -5,8 +5,8 @@
     title="修改手机号"
     :visible.sync="dialogVisible"
     :before-close="handleClose">
-    <el-form ref="form" :model="form" label-width="80px">
-      <el-form-item label="手机号">
+    <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+      <el-form-item label="手机号" prop="phonenumber">
         <el-input v-model="form.phonenumber" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="验证码">
@@ -28,13 +28,26 @@ import md5 from 'js-md5'
 export default {
   name: 'PhoneEdit',
   data() {
+    let checkPhone = (rule,value,callback) => {
+      if(!this.tool.checkPhoneFun(value)) {
+        return callback(new Error('请填写正确的手机号'))
+      } else {
+        callback()
+      }
+    }
     return {
       dialogVisible: false,
       form: {
         phonenumber: ''
       },
       count:0,
-      logCode:''
+      logCode:'',
+      rules: {
+        phonenumber:[
+          { required: true, message: '请输入手机号', trigger: 'blur' },
+          { validator: checkPhone , trigger: 'blur' }
+        ]
+      }
     };
   },
   props:['userInfo'],

+ 1 - 10
src/components/file-block/index.vue

@@ -86,16 +86,7 @@ export default {
       }
     },
     downLoad(item) {
-      if(this.sat_noticeid) {
-        this.$api.requested({
-          "classname": "saletool.notice.notice",
-          "method": "updateDownloadRecord",
-          "content": {
-            "sat_noticeid":this.sat_noticeid
-          }
-        }).then(res => {
-        })
-      }
+      this.$emit('updateDownLoadRecord',item)
       window.open(item.url,'_self')
     }
   },