27 lines
		
	
	
		
			548 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			548 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
import http from "dui/lib/js/request";
 | 
						|
import Vue from "vue"
 | 
						|
 | 
						|
export default class PartyOrg {
 | 
						|
  constructor(id) {
 | 
						|
    this.id = id
 | 
						|
    this.loaded = false
 | 
						|
    this.init().finally(() => this.loaded = true)
 | 
						|
  }
 | 
						|
 | 
						|
  init() {
 | 
						|
    return PartyOrg.getInfo(this.id).then(data => {
 | 
						|
      Object.entries(data).map(([k, v]) => Vue.set(this, k, v))
 | 
						|
    })
 | 
						|
  }
 | 
						|
 | 
						|
  static getInfo(id) {
 | 
						|
    return http.post("/app/partyOrganization/queryOrgById", null, {
 | 
						|
      params: {id}
 | 
						|
    }).then(res => {
 | 
						|
      if (res?.data) {
 | 
						|
        return res.data
 | 
						|
      }
 | 
						|
    })
 | 
						|
  }
 | 
						|
}
 |