[Leveldb] Cache (18): BlockCache

2022-12-24   ES  

Demand: Get the districts and villages below the area according to the AREAID in the login information. Each request data is avid every time

<EL-Cascader 
             v-model = "form.areaid" 
             : props = "props" 
             @Change = "handlechange" 
             Placeholder = "Please select the area" 
             : Clearable = "TRUE" 
             : show-all-levels = "false" 
           Forecast 
           </El-Cascader>

Data Add


      props: {
        expandTrigger: "hover",
        emitPath: false,
        lazy: true,
        lazyLoad: this.lazyLoad,
      },

Method Methods: {}

lazyload (Node, Resolve) { 
       this.getdata (node, resolve); 
     }, 
     getdata (node, resolve) { 
       let that = this; 
       Let level = node.level; 

       const doit = function () { 
         let arealevel = that.info.arealevel; 
         // 4 is because there are only 4 layers at all regional levels, so it will dynamically display the number of lower levels 
         let j = 4 -realevel; 
         var ID; 
         if (level == 0) { 
           id = that.info.id; 
         } else { 
           id = node.value; 
         } 
         getChildDictarebyid (ID) .then ((res) => {{ 
           var result; 
           if (level == 0) { 
             result = res.data; 
             result.Foreach (item) => {{ 
               item.value = item.id; 
               item.label = item.areaname; 
             }); 
           } 
           if (0 <level <j) { 
          // There is a problem with the data to show the data in the box only display the last last one 
             result = res.data; 
             result.Foreach (item) => {{ 
               item.value = item.id; 
               item.label = item.areaname; 
               item.Leaf = level> j -2; 
             }); 
           } 
           Resolve (result); 
         }); 
       }; 

       if (! That.info) { 
         that.getUserInfo (() => { 
           doit (); 
         }); 
       } else { 
         doit (); 
       } 
     }, 
     getUserInfo (callback) { 
       getinfo ({}). Then ((res) => { 
         this.info = res.data.dictarea; 
       }); 
     },
  mounted() {
    this.getUserInfo();
  },

This is the code that I need to change my project after finding a method online, but there is a problem that only the last data is displayed after choosing the region, but there is no too much request for the project. If you know how to change, welcome to leave a message ———————————————

source

Related Posts

Convert WAV, APE, FLAC Music is MP3, M4A (MP4) format Novice

Oracle10.2.0.1 for CentOS6.0 Installation document (1)

Video: blockchain + cloud computing + youth entrepreneurial, ABT Seattle Weekend continuously | ArcBlock activities

Engineering practice LFFD model test bug solution summary

[Leveldb] Cache (18): BlockCache

Random Posts

[Turn] Union (all)/INTERSECT/Minus The purpose of the

Pseudo -static rules of common php source codes (Nginx/Apache)

Student table student, curriculum table Course, student selection table StudentCourse

docker deploy redis and set a password (not specifying the configuration file method)

How to unify your mind in the real estate industry and take a key step in digital transformation