update 设备管理-基础配置-设备分组绑定
This commit is contained in:
@@ -32,9 +32,28 @@ export default {
|
||||
updateUrl: '',
|
||||
addUrl: '',
|
||||
pageUrl: '',
|
||||
infoUrl: '',
|
||||
basePath: '',
|
||||
form: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
addPath() {
|
||||
return this.basePath + '/create'
|
||||
},
|
||||
updatePath() {
|
||||
return this.basePath + '/update'
|
||||
},
|
||||
deletePath() {
|
||||
return this.basePath + '/delete'
|
||||
},
|
||||
infoPath() {
|
||||
return this.basePath + '/get'
|
||||
},
|
||||
pagePath() {
|
||||
return this.basePath + '/page'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// utils
|
||||
http(url, method, payload) {
|
||||
@@ -46,16 +65,16 @@ export default {
|
||||
})
|
||||
},
|
||||
put(payload) {
|
||||
return this.http(this.updateUrl, 'put', payload);
|
||||
return this.http(this.updateUrl == '' ? this.updatePath : this.updateUrl, 'put', payload);
|
||||
},
|
||||
post(payload) {
|
||||
return this.http(this.addUrl, 'post', payload);
|
||||
return this.http(this.addUrl == '' ? this.addPath : this.addUrl, 'post', payload);
|
||||
},
|
||||
recv(payload) {
|
||||
return this.http(this.pageUrl, 'get', payload);
|
||||
return this.http(this.pageUrl == '' ? this.pagePath : this.pageUrl, 'get', payload);
|
||||
},
|
||||
info(payload) {
|
||||
return this.http(this.infoUrl, 'get', payload);
|
||||
return this.http(this.infoUrl == '' ? this.infoPath : this.infoUrl, 'get', payload);
|
||||
},
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user