gemercheung пре 3 година
родитељ
комит
30a15936c9
3 измењених фајлова са 23 додато и 1 уклоњено
  1. 1 0
      src/enums/httpEnum.ts
  2. 5 0
      src/utils/http/axios/index.ts
  3. 17 1
      src/views/scenes/bindModal.vue

+ 1 - 0
src/enums/httpEnum.ts

@@ -5,6 +5,7 @@ export enum ResultEnum {
   SUCCESS = 0,
   NORMAL = 200,
   ERROR = 1,
+  JAVA_ERROR = -1,
   TIMEOUT = 401,
   TYPE = 'success',
 }

+ 5 - 0
src/utils/http/axios/index.ts

@@ -78,6 +78,11 @@ const transform: AxiosTransform = {
         userStore.setToken(undefined);
         userStore.logout(true);
         break;
+      case ResultEnum.JAVA_ERROR:
+        if (error) {
+          timeoutMsg = error;
+        }
+        break;
       default:
         if (message) {
           timeoutMsg = message;

+ 17 - 1
src/views/scenes/bindModal.vue

@@ -118,9 +118,13 @@
         const data = getSelectRowKeys();
         return data;
       });
+      const mapCheckedValue = computed(() => (key) => {
+        return key === 1 ? true : false;
+      });
       const checked = ref<boolean>(false);
       const headerInfo = reactive<Recordable>({});
       const searchInfo = reactive<Recordable>({});
+
       const [
         registerTable,
         {
@@ -142,11 +146,16 @@
         showIndexColumn: false,
         immediate: false,
         rowKey: 'id',
-        pagination: { pageSize: 1000 },
+        pagination: false,
         clickToRowSelect: false,
         bordered: true,
         afterFetch: (data) => {
           console.log('data', data);
+          const res = data.map((i) => {
+            i.canShow = i.canShow === 1 ? true : false;
+            return i;
+          });
+          console.log('res', res);
 
           const bindIds = data
             .filter((i) => i.isBind === 1)
@@ -154,6 +163,10 @@
               return pre.concat(current['id']);
             }, []);
           console.log('bindIds', bindIds);
+          data.map((i) => {
+            i.canShow === 1 ? true : false;
+            return i;
+          });
           setSelectedRowKeys(bindIds);
         },
       });
@@ -163,6 +176,8 @@
         searchInfo.brandId = data.id;
         headerInfo.name = data.name;
         headerInfo.sceneName = data.sceneName;
+        searchInfo.limit = 1000;
+        searchInfo.page = 1;
         reload();
         // const rawData = getRawDataSource();
 
@@ -222,6 +237,7 @@
         t,
         checked,
         SelectRowsList,
+        mapCheckedValue,
       };
     },
   });