追加关于党组织的抽象类
This commit is contained in:
0
components/model/Party.js
Normal file
0
components/model/Party.js
Normal file
25
components/model/PartyOrg.js
Normal file
25
components/model/PartyOrg.js
Normal 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
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user