追加关于党组织的抽象类

This commit is contained in:
aixianling
2022-10-24 11:58:47 +08:00
parent bda2b10c7f
commit f178667db8
7 changed files with 85 additions and 133 deletions

View File

View File

@@ -0,0 +1,25 @@
import http from "dvcp-ui/lib/js/request";
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]) => this[k] = v)
})
}
static getInfo(id) {
return http.post("/app/partyOrganization/queryOrgById", null, {
params: {id}
}).then(res => {
if (res?.data) {
return res.data
}
})
}
}