Quellcode durchsuchen

客资任务跟踪题目填写添加表格选项

zhujindu vor 11 Monaten
Ursprung
Commit
61600406c1
3 geänderte Dateien mit 9 neuen und 12 gelöschten Zeilen
  1. 3 0
      src/utils/request.js
  2. 6 6
      src/views/clew/clewent.vue
  3. 0 6
      src/views/clew/index.vue

+ 3 - 0
src/utils/request.js

@@ -5,6 +5,7 @@
 import axios from 'axios';
 import { Toast, Dialog } from 'vant';
 import errorCode from '@/utils/errorCode';
+import { toastLoading } from '@/utils/commonVant';
 
 axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8';
 const service = axios.create({
@@ -15,6 +16,7 @@ const service = axios.create({
 // request拦截器
 service.interceptors.request.use(
   (config) => {
+    toastLoading(0, '加载中...', true);
     config.headers['userId'] = localStorage.getItem('loginName');
     return config;
   },
@@ -26,6 +28,7 @@ service.interceptors.request.use(
 // 响应拦截器
 service.interceptors.response.use(
   (res) => {
+    toastLoading().clear();
     const code = res.data.code || 200;
     const msg = errorCode[code] || res.data.msg || errorCode['default'];
     if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') {

+ 6 - 6
src/views/clew/clewent.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="bgcolor clewent">
+  <div class="bgcolor clewent" v-if="infoData">
     <!--        顶部条-->
     <div class="navBarTOP">
       <van-nav-bar class="navBar" left-arrow :title="title" @click-left="onClickLeft" />
@@ -198,10 +198,10 @@
       </template>
     </template>
     <br />
-    <div v-if="infoData.isClose != 1" class="tc" style="padding: 0 16px">
-      <van-button class="submitBtn" block type="info" color="#0057ba" @click="onSubmit"
-        >提交</van-button
-      >
+    <div v-if="infoData && infoData.isClose != 1" class="tc" style="padding: 0 16px">
+      <van-button class="submitBtn" block type="info" color="#0057ba" @click="onSubmit">
+        提交
+      </van-button>
     </div>
     <br />
     <br />
@@ -551,7 +551,7 @@ export default {
       collectionItemList: [],
       collectionAnswerlisd: [],
       flagclick: true,
-      infoData: {},
+      infoData: null,
       imgList: [],
       info: {},
       showv: false,

+ 0 - 6
src/views/clew/index.vue

@@ -188,13 +188,7 @@ export default {
       this.approveList();
     },
     approveList() {
-      let loading1 = this.$toast.loading({
-        duration: 0,
-        message: '数据加载中...',
-        forbidClick: true,
-      });
       infolist({ type: this.isHandle, cid: this.cid == -1 ? null : this.cid }).then((res) => {
-        loading1.clear();
         this.disabled = false;
         this.loading = false;
         this.list = res.data;