You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aggregation-platform/plugins/system/ts/systemServices.ts

104 lines
2.3 KiB

/// <reference path="../../includes.ts"/>
/// <reference path="systemPlugin.ts"/>
module System{
export function classifyCity(regionalismInfo: Array<any>){
var result = [];
angular.forEach(regionalismInfo, (item) =>{
if(result.indexOf(item.cityName) == -1)
result.push(item.cityName);
});
return result;
}
export function classifyCountry(regionalismInfo: Array<any>, cityName: string){
var result = [];
angular.forEach(regionalismInfo, (item) =>{
if(item.cityName == cityName)
result.push({
name: item.districtName,
code: item.code
});
});
return result;
}
class systemModelServices{
public systemInfoList: Array<any> = [];
public systemInfo: Array<any> = [];
public regionalismInfo: Array<any> = [];
public sqlInfo: Array<any> = [];
//public checkInfo: Array<any> = [];
public constructor(){
this.updateCodeInfo();
this.updateExcelInfo();
this.updateSqlInfo();
//this.updateCheckInfo();
//console.log(classifyCountry(this.regionalismInfo, '南京市'));
}
public updateExcelInfo(){
var result = [];
$.ajax({
async: false,
type: "POST",
url: "/java/console/api/fileOperation/findAll",
success: (data) =>{
if(data)
result = data.data;
}
});
this.systemInfoList = result;
}
public updateSqlInfo(){
var result = [];
$.ajax({
async: false,
type: "POST",
url: "/java/console/api/filePackage/findAll",
success: (data) =>{
if(data)
result = data.data;
}
});
this.sqlInfo = result;
}
public updateCodeInfo(){
var result = [];
$.ajax({
async: false,
type : "POST",
url : "/java/console/api/code/list",
success : function(data) {
if(data){
result = data;
}
}
});
this.regionalismInfo = result["regionalism"];
this.systemInfo = result["system"];
}
/*public updateCheckInfo(){
var result = null;
$.ajax({
async: false,
type : "POST",
url : "/java/console/api/checkout/findAll",
success : function(data) {
if(data){
result = data.data;
}
}
});
this.checkInfo = result;
}*/
}
_module.factory('SystemModel', ['$rootScope', '$http', ($rootScope, $http) => {
return new systemModelServices();
}]);
}