老系统对接

This commit is contained in:
2018-07-12 14:08:55 +08:00
commit 5f41fe5df1
420 changed files with 50883 additions and 0 deletions

55
webapp/js/Map.js Normal file
View File

@ -0,0 +1,55 @@
/**
*
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>jsʵ<73>ֵ<EFBFBD>map<61><70><EFBFBD><EFBFBD>
* @returns {Map}
*/
function Map(){
var struct = function(key, value) {
this.key = key;
this.value = value;
};
// <20><><EFBFBD><EFBFBD>map<61><70>ֵ<EFBFBD><D6B5>
var put = function(key, value){
for (var i = 0; i < this.arr.length; i++) {
if ( this.arr[i].key === key ) {
this.arr[i].value = value;
return;
}
};
this.arr[this.arr.length] = new struct(key, value);
};
// <20><><EFBFBD><EFBFBD>key<65><79>ȡvalue
var get = function(key) {
for (var i = 0; i < this.arr.length; i++) {
if ( this.arr[i].key === key ) {
return this.arr[i].value;
}
}
return null;
};
// <20><><EFBFBD><EFBFBD>keyɾ<79><C9BE>
var remove = function(key) {
var v;
for (var i = 0; i < this.arr.length; i++) {
v = this.arr.pop();
if ( v.key === key ) {
continue;
}
this.arr.unshift(v);
}
};
// <20><>ȡmap<61><70>ֵ<EFBFBD>Ը<EFBFBD><D4B8><EFBFBD>
var size = function() {
return this.arr.length;
};
// <20>ж<EFBFBD>map<61>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA>
var isEmpty = function() {
return this.arr.length <= 0;
};
this.arr = new Array();
this.get = get;
this.put = put;
this.remove = remove;
this.size = size;
this.isEmpty = isEmpty;
}