zengyicheng преди 2 години
родител
ревизия
29a8d61d7d

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/index.html


Файловите разлики са ограничени, защото са твърде много
+ 1 - 1
dist/report.html


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/static/css/chunk-7350369f.32177d8c.css


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/static/css/chunk-a480f7e4.98ba08d7.css


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/static/js/app.6e3113ac.js


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/static/js/app.eb9bdb07.js


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/static/js/chunk-7350369f.0aa04cac.js


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/static/js/chunk-a480f7e4.ab1603dc.js


+ 143 - 143
src/store/modules/user.js

@@ -3,162 +3,162 @@ import { eduGet, getUser } from '@/api/user'
 import { getToken, removeToken, setToken } from '@/utils/auth'
 import { resetRouter } from '@/router'
 const getDefaultState = () => {
-  return {
-    token: getToken(),
-    id: '',
-    roles: [],
-    name: '',
-    username: '',
-    avatar: '',
-    is_init: false,
-    userinfo: ''
-  }
+    return {
+        token: getToken(),
+        id: '',
+        roles: [],
+        name: '',
+        username: '',
+        avatar: '',
+        is_init: false,
+        userinfo: ''
+    }
 }
 
 const state = getDefaultState()
 const mutations = {
-  RESET_STATE: state => {
-    Object.assign(state, getDefaultState())
-  },
-  SET_TOKEN: (state, token) => {
-    state.token = token
-  },
-  SET_ROLES: (state, roles) => {
-    state.roles = roles
-  },
-  SET_ID: (state, id) => {
-    state.id = id
-  },
-  SET_NAME: (state, name) => {
-    state.name = name
-  },
-  SET_USERNAME: (state, name) => {
-    state.username = name
-  },
-  SET_IS_INIT: (state, is_init) => {
-    state.is_init = is_init
-  },
-  SET_AVATAR: (state, avatar) => {
-    state.avatar = avatar
-  },
-  SET_USERINFO: (state, userinfo) => {
-    state.userinfo = userinfo
-  }
+    RESET_STATE: state => {
+        Object.assign(state, getDefaultState())
+    },
+    SET_TOKEN: (state, token) => {
+        state.token = token
+    },
+    SET_ROLES: (state, roles) => {
+        state.roles = roles
+    },
+    SET_ID: (state, id) => {
+        state.id = id
+    },
+    SET_NAME: (state, name) => {
+        state.name = name
+    },
+    SET_USERNAME: (state, name) => {
+        state.username = name
+    },
+    SET_IS_INIT: (state, is_init) => {
+        state.is_init = is_init
+    },
+    SET_AVATAR: (state, avatar) => {
+        state.avatar = avatar
+    },
+    SET_USERINFO: (state, userinfo) => {
+        state.userinfo = userinfo
+    }
 }
 
 const actions = {
-  // user login
-  // login({ commit }, userInfo) {
-  //   const { username, password } = userInfo
-  //   return new Promise((resolve, reject) => {
-  //     login({ username: username.trim(), password: password })
-  //       .then(response => {
-  //         const { data } = response
-  //         const token = 'JWT ' + data.token
-  //         commit('SET_TOKEN', token)
-  //         setToken(token)
-  //         resolve()
-  //       })
-  //       .catch(error => {
-  //         reject(error)
-  //       })
-  //   })
-  // },
-  login({ dispatch }) {
-    return new Promise((resolve, reject) => {
-      eduGet()
-        .then(response => {
-          console.log(response)
-          var _user = response[0][0]
-          setToken(_user.userid)
-          // dispatch('getInfo')
-          resolve(_user.userid)
+    // user login
+    // login({ commit }, userInfo) {
+    //   const { username, password } = userInfo
+    //   return new Promise((resolve, reject) => {
+    //     login({ username: username.trim(), password: password })
+    //       .then(response => {
+    //         const { data } = response
+    //         const token = 'JWT ' + data.token
+    //         commit('SET_TOKEN', token)
+    //         setToken(token)
+    //         resolve()
+    //       })
+    //       .catch(error => {
+    //         reject(error)
+    //       })
+    //   })
+    // },
+    login({ dispatch }) {
+        return new Promise((resolve, reject) => {
+            eduGet()
+                .then(response => {
+                    console.log(response)
+                    var _user = response[0][0]
+                    setToken(_user.userid)
+                        // dispatch('getInfo')
+                    resolve(_user.userid)
+                })
+                .catch(error => {
+                    var _user = { userid: '5943e08c-b7d4-11ed-8d51-005056b86db5' }
+                    setToken(_user.userid)
+                    resolve(_user.userid)
+                    reject(error)
+                })
         })
-        .catch(error => {
-          // var _user = { userid: '5943e08c-b7d4-11ed-8d51-005056b86db5' }
-          // setToken(_user.userid)
-          // resolve(_user.userid)
-          reject(error)
+    },
+    getInfo({ commit, state }) {
+        return new Promise((resolve, reject) => {
+            getUser({ userid: getToken() })
+                .then(response => {
+                    console.log(response)
+                        // const { data } = response
+                    const data = response[0][0]
+                    if (!data) {
+                        reject('验证失败,请重新登录。')
+                    }
+                    // console.log(response)
+                    commit('SET_USERINFO', data)
+                    resolve(data)
+                        // resolve()
+                })
+                .catch(error => {
+                    reject(error)
+                })
         })
-    })
-  },
-  getInfo({ commit, state }) {
-    return new Promise((resolve, reject) => {
-      getUser({ userid: getToken() })
-        .then(response => {
-          console.log(response)
-          // const { data } = response
-          const data = response[0][0]
-          if (!data) {
-            reject('验证失败,请重新登录。')
-          }
-          // console.log(response)
-          commit('SET_USERINFO', data)
-          resolve(data)
-          // resolve()
-        })
-        .catch(error => {
-          reject(error)
-        })
-    })
-  },
-  // get user info
-  // getInfo({ commit, state }) {
-  //   return new Promise((resolve, reject) => {
-  //     getUser()
-  //       .then(response => {
-  //         const { data } = response
+    },
+    // get user info
+    // getInfo({ commit, state }) {
+    //   return new Promise((resolve, reject) => {
+    //     getUser()
+    //       .then(response => {
+    //         const { data } = response
 
-  //         if (!data) {
-  //           reject('验证失败,请重新登录。')
-  //         }
-  //         console.log(response)
+    //         if (!data) {
+    //           reject('验证失败,请重新登录。')
+    //         }
+    //         console.log(response)
 
-  //         const { id, roles, is_init, cn, avatar, username } = response.data
-  //         // roles must be a non-empty array
-  //         if (!roles || roles.length <= 0) {
-  //           reject('getInfo: 角色必须为非空数组!')
-  //         }
-  //         commit('SET_NAME', cn)
-  //         commit('SET_USERNAME', username)
-  //         commit('SET_ROLES', roles)
-  //         commit('SET_ID', id)
-  //         commit('SET_AVATAR', avatar)
-  //         commit('SET_IS_INIT', is_init)
-  //         resolve(data)
-  //       })
-  //       .catch(error => {
-  //         reject(error)
-  //       })
-  //   })
-  // },
+    //         const { id, roles, is_init, cn, avatar, username } = response.data
+    //         // roles must be a non-empty array
+    //         if (!roles || roles.length <= 0) {
+    //           reject('getInfo: 角色必须为非空数组!')
+    //         }
+    //         commit('SET_NAME', cn)
+    //         commit('SET_USERNAME', username)
+    //         commit('SET_ROLES', roles)
+    //         commit('SET_ID', id)
+    //         commit('SET_AVATAR', avatar)
+    //         commit('SET_IS_INIT', is_init)
+    //         resolve(data)
+    //       })
+    //       .catch(error => {
+    //         reject(error)
+    //       })
+    //   })
+    // },
 
-  // user logout
-  logout({ commit, state }) {
-    return new Promise((resolve, reject) => {
-      commit('SET_TOKEN', '')
-      commit('SET_ROLES', [])
-      removeToken()
-      resetRouter()
-      commit('RESET_STATE')
-      resolve()
-    })
-  },
+    // user logout
+    logout({ commit, state }) {
+        return new Promise((resolve, reject) => {
+            commit('SET_TOKEN', '')
+            commit('SET_ROLES', [])
+            removeToken()
+            resetRouter()
+            commit('RESET_STATE')
+            resolve()
+        })
+    },
 
-  // remove token
-  resetToken({ commit }) {
-    return new Promise(resolve => {
-      commit('SET_TOKEN', '')
-      commit('SET_ROLES', [])
-      removeToken()
-      resolve()
-    })
-  }
+    // remove token
+    resetToken({ commit }) {
+        return new Promise(resolve => {
+            commit('SET_TOKEN', '')
+            commit('SET_ROLES', [])
+            removeToken()
+            resolve()
+        })
+    }
 }
 
 export default {
-  namespaced: true,
-  state,
-  mutations,
-  actions
-}
+    namespaced: true,
+    state,
+    mutations,
+    actions
+}

+ 10 - 6
src/views/course/components/ImageComponent.vue

@@ -89,27 +89,31 @@ export default {
 <style lang="scss" scoped>
 .imgBox {
   margin: 10px;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: wrap;
+  align-items: center;
   .imgCss {
-    width: 80px;
-    height: 80px;
+    width: 50px;
+    height: 50px;
+    margin-left: 0 0.3rem;
     > img {
       width: 100%;
       height: 100%;
     }
   }
   .imgList {
-    margin: 10px 0 0 0;
     display: flex;
     flex-direction: row;
     flex-wrap: wrap;
     align-items: center;
     .imgItem {
       position: relative;
-      width: 80px;
+      width: 50px;
       margin: 0 10px 10px 0;
       .itemImg {
-        width: 80px;
-        height: 80px;
+        width: 50px;
+        height: 50px;
         z-index: 1;
         > img {
           width: 100%;

+ 9 - 3
src/views/course/components/commentBox.vue

@@ -33,11 +33,12 @@
       <img src="@/assets/images/course/noPz.png" alt="" />
     </div>
 
-    <div class="commentInput" @click="panelVisible = true">
+    <div class="commentInput" @click="setPanelVisible(true)">
       <div class="input">点击发一条评课内容</div>
     </div>
     <commentPanel
-      :panelVisible.sync="panelVisible"
+      @setPanelVisible="setPanelVisible"
+      :panelVisible="panelVisible"
       :courseid="courseid"
       :courseType="courseType"
       :taskCount="taskCount"
@@ -55,6 +56,9 @@ export default {
       type: String,
       default: ''
     },
+    panelVisible:{
+      type:Boolean
+    },
     courseType: {
       type: Number,
       default: 0
@@ -70,7 +74,6 @@ export default {
   data() {
     return {
       pzList: [],
-      panelVisible: false
     }
   },
   computed: {
@@ -99,6 +102,9 @@ export default {
     }
   },
   methods: {
+    setPanelVisible(bool){
+      this.$emit('update:panelVisible', bool)
+    },
     previewImg(url) {
       this.$hevueImgPreview(url)
     },

+ 2 - 2
src/views/course/components/commentPanel.vue

@@ -67,7 +67,7 @@ export default {
   },
   methods: {
     back() {
-      this.$emit('update:panelVisible', false)
+      this.$emit('setPanelVisible', false)
     },
     setType(type) {
       this.type = type
@@ -106,7 +106,7 @@ export default {
             message: '添加成功',
             type: 'success'
           })
-          this.$emit('update:panelVisible', false)
+          this.$emit('setPanelVisible', false)
         })
         .catch(err => {
           console.error(err)

+ 5 - 3
src/views/course/index.vue

@@ -12,7 +12,7 @@
       </template>
     </head-bar>
     <div class="course-box" ref="cBox">
-      <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
+      <van-pull-refresh v-model="isLoading" @refresh="onRefresh" :disabled="panelVisible">
         <course-title :chapInfo="chapInfo" :courseType="courseType" :taskCount="taskCount"></course-title>
         <course-content-list v-if="false"></course-content-list>
         <div class="course-type-box">
@@ -41,6 +41,7 @@
           ></steps-box>
           <comment-box
             v-show="type == 2"
+            :panelVisible.sync="panelVisible"
             :courseid="courseid"
             :courseType="courseType"
             :taskCount="taskCount"
@@ -111,7 +112,8 @@ export default {
       tcid: '',
       tcid2: this.$route.query.tcid,
       navVisible: false,
-      isLoading: false
+      isLoading: false,
+      panelVisible: false
     }
   },
   methods: {
@@ -156,7 +158,7 @@ export default {
     setType(type, is) {
       this.type = type
       if (is) {
-        this.$refs['comment'].panelVisible = true
+        this.panelVisible = true
       }
     },
     navCheck() {

Някои файлове не бяха показани, защото твърде много файлове са промени