update 设备管理-基础配置-设备分组绑定

This commit is contained in:
lb
2023-10-27 14:24:47 +08:00
parent 66660bfef7
commit 216aa6291d
12 changed files with 733 additions and 111 deletions

View File

@@ -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);
},