41 lines
876 B
JavaScript
41 lines
876 B
JavaScript
|
import { brigade,stationurl } from "../../../../public/js/url.js";
|
||
|
function getstationcount(){
|
||
|
var data={
|
||
|
"brigade":brigade
|
||
|
}
|
||
|
var url=stationurl+"/firectrl/client/getstationcount";
|
||
|
return axios({
|
||
|
method: 'post',
|
||
|
url:url,
|
||
|
data:data
|
||
|
})
|
||
|
}
|
||
|
|
||
|
function getstationlist(data){
|
||
|
var url=stationurl+"/firectrl/client/getstationlist";
|
||
|
return axios({
|
||
|
method: 'post',
|
||
|
url:url,
|
||
|
data:data
|
||
|
})
|
||
|
}
|
||
|
|
||
|
function stationInfoPageReq(result){
|
||
|
var count=500;
|
||
|
var page=Math.ceil(result/count);
|
||
|
var stationlist=[];
|
||
|
for(let i=0;i<page;i++){
|
||
|
var obj={
|
||
|
"brigade":brigade,
|
||
|
"pagesize":count,
|
||
|
"pageindex":i,
|
||
|
}
|
||
|
stationlist.push(getstationlist(obj));
|
||
|
}
|
||
|
return Promise.all(stationlist);
|
||
|
}
|
||
|
|
||
|
export {
|
||
|
getstationcount,
|
||
|
stationInfoPageReq
|
||
|
}
|