ソースを参照

fix BTTest style

wangJJ 5 年 前
コミット
26c7772c8d
2 ファイル変更69 行追加69 行削除
  1. 7 7
      src/components/task/Task.vue
  2. 62 62
      src/main.js

+ 7 - 7
src/components/task/Task.vue

@@ -4,19 +4,19 @@
     <div class="create-body">
       <div class="title h2" v-if="!isModifyMode">基本信息</div>
       <el-form :model="task" :rules="rules" ref="task" label-width="120px" class="demo-task"
-               style="margin-left: 100px;width: 700px">
-        <el-form-item label="任务名称" prop="title">
+               style="margin:0 100px;">
+        <el-form-item label="任务名称" prop="title" style="width: 700px;">
           <el-input size="small" v-if="isModifyMode" v-model="task.title"></el-input>
           <span v-if="!isModifyMode">{{task.title}}</span>
           <el-tag v-if="!isModifyMode" :type="task.statusVO&&task.statusVO.style">{{task.statusVO ?
             task.statusVO.text:''}}
           </el-tag>
         </el-form-item>
-        <el-form-item label="任务描述" prop="desc">
+        <el-form-item label="任务描述" prop="desc" style="width: 700px;">
           <el-input autosize v-if="isModifyMode" type="textarea" v-model="task.description"></el-input>
           <span v-if="!isModifyMode">{{task.description}}</span>
         </el-form-item>
-        <el-form-item label="任务报价" prop="quotePrice">
+        <el-form-item label="任务报价" prop="quotePrice" style="width: 700px;">
           <el-input size="small" type="number" v-if="isModifyMode" v-model="task.quotePrice">
             <template slot="append">¥</template>
           </el-input>
@@ -37,19 +37,19 @@
           <span class="badge" v-if="!isModifyMode">{{task.serviceType}}</span>
         </el-form-item>
 
-        <el-form-item label="examId" prop="endPointVO.examId" v-if="showBD&&task.endPointVO&&task.serviceType=='北斗众测'" required>
+        <el-form-item label="examId" prop="endPointVO.examId" style="width: 700px;" v-if="showBD&&task.endPointVO&&task.serviceType=='北斗众测'" required>
           <el-input v-if="isModifyMode" v-model="task.endPointVO.examId" label="examId"></el-input>
           <span v-if="!isModifyMode&&showBD">{{task.endPointVO.examId}}</span>
         </el-form-item>
 
 
-        <el-form-item label="caseId" prop="endPointVO.caseId" v-if="showBD&&task.endPointVO&&task.serviceType=='北斗众测'" required>
+        <el-form-item label="caseId" prop="endPointVO.caseId" style="width: 700px;" v-if="showBD&&task.endPointVO&&task.serviceType=='北斗众测'" required>
           <el-input v-if="isModifyMode" v-model.number="task.endPointVO.caseId" label="caseId"></el-input>
           <span v-if="!isModifyMode&&showBD">{{task.endPointVO.caseId}}</span>
         </el-form-item>
 
 
-        <el-form-item label="任务可见性" prop="resource">
+        <el-form-item label="任务可见性" prop="resource" style="width: 700px;">
           <div v-if="!isModifyMode">
             <!--<div v-if="task.resource=='1'">{{updateLocation(task.location)}}</div>-->
             <div v-if="task.resource==0">定向</div>

+ 62 - 62
src/main.js

@@ -78,68 +78,68 @@ function getCurrentUserSuccess(res){
 //   var s = document.getElementsByTagName("script")[0];
 //   s.parentNode.insertBefore(hm, s);
 // })();
-router.beforeEach((to, from, next) => {
-  // if (_hmt) {
-  //   if (to.path) {
-  //     _hmt.push(['_trackPageview', '/#' + to.fullPath]);
-  //   }
-  // }
-  const urls = getAuthUrls()
-  if (storageGet('user') == null) {
-    getCurrentUser().then((res) => {
-      storageSave('user', res)
-      storageSave('rolesPermissions', getRolesPermissions(res.roleList))
-      if (to.matched.some(record => record.meta.requireAuth)) { // 判断该路由是否需要登录权限
-        if (sessionStorage.userName === '2' && urls.includes(to.matched[0].path)) { // 判断缓存里面是否有 userName  //在登录的时候设置它的值
-          next()
-        } else {
-          next({
-            path: '/',
-            query: {
-              redirect: to.fullPath
-            } // 将跳转的路由path作为参数,登录成功后跳转到该路由
-          })
-        }
-      } else {
-        next()
-      }
-    }).catch((error) => {
-      // notify('warning', '请登录')
-      if (to.matched.some(record => record.meta.requireAuth)) { // 判断该路由是否需要登录权限
-        if (sessionStorage.userName === '2' && urls.includes(to.matched[0].path)) { // 判断缓存里面是否有 userName  //在登录的时候设置它的值
-          next()
-        } else {
-          next({
-            path: '/',
-            query: {
-              redirect: to.fullPath
-            } // 将跳转的路由path作为参数,登录成功后跳转到该路由
-          })
-        }
-      } else {
-        next()
-      }
-    })
-  } else {
-    if (to.matched.some(record => record.meta.requireAuth)) { // 判断该路由是否需要登录权限
-      if (sessionStorage.userName === '2' && urls.includes(to.matched[0].path)) { // 判断缓存里面是否有 userName  //在登录的时候设置它的值
-        next()
-      } else {
-        next({
-          path: '/',
-          query: {
-            redirect: to.fullPath
-          } // 将跳转的路由path作为参数,登录成功后跳转到该路由
-        })
-      }
-    } else {
-      next()
-    }
-  }
-  //console.log(to.matched[0].path)
-  //console.log(urls.includes(to.matched[0].path))
-
-})
+// router.beforeEach((to, from, next) => {
+//   // if (_hmt) {
+//   //   if (to.path) {
+//   //     _hmt.push(['_trackPageview', '/#' + to.fullPath]);
+//   //   }
+//   // }
+//   const urls = getAuthUrls()
+//   if (storageGet('user') == null) {
+//     getCurrentUser().then((res) => {
+//       storageSave('user', res)
+//       storageSave('rolesPermissions', getRolesPermissions(res.roleList))
+//       if (to.matched.some(record => record.meta.requireAuth)) { // 判断该路由是否需要登录权限
+//         if (sessionStorage.userName === '2' && urls.includes(to.matched[0].path)) { // 判断缓存里面是否有 userName  //在登录的时候设置它的值
+//           next()
+//         } else {
+//           next({
+//             path: '/',
+//             query: {
+//               redirect: to.fullPath
+//             } // 将跳转的路由path作为参数,登录成功后跳转到该路由
+//           })
+//         }
+//       } else {
+//         next()
+//       }
+//     }).catch((error) => {
+//       // notify('warning', '请登录')
+//       if (to.matched.some(record => record.meta.requireAuth)) { // 判断该路由是否需要登录权限
+//         if (sessionStorage.userName === '2' && urls.includes(to.matched[0].path)) { // 判断缓存里面是否有 userName  //在登录的时候设置它的值
+//           next()
+//         } else {
+//           next({
+//             path: '/',
+//             query: {
+//               redirect: to.fullPath
+//             } // 将跳转的路由path作为参数,登录成功后跳转到该路由
+//           })
+//         }
+//       } else {
+//         next()
+//       }
+//     })
+//   } else {
+//     if (to.matched.some(record => record.meta.requireAuth)) { // 判断该路由是否需要登录权限
+//       if (sessionStorage.userName === '2' && urls.includes(to.matched[0].path)) { // 判断缓存里面是否有 userName  //在登录的时候设置它的值
+//         next()
+//       } else {
+//         next({
+//           path: '/',
+//           query: {
+//             redirect: to.fullPath
+//           } // 将跳转的路由path作为参数,登录成功后跳转到该路由
+//         })
+//       }
+//     } else {
+//       next()
+//     }
+//   }
+//   //console.log(to.matched[0].path)
+//   //console.log(urls.includes(to.matched[0].path))
+//
+// })
 
 // require('./mock.js')
 Vue.use(Carousel)