updated 兄弟姐妹默认扩展

This commit is contained in:
PASSER-BY
2023-01-29 22:45:27 +08:00
parent 5add4ae44e
commit 2dee5ff69f
5 changed files with 20 additions and 27 deletions

View File

@@ -131,8 +131,8 @@ export default {
'm,{G1},d':['姨母','姨姨','姨妈','姨'],
'm,{G1},d,h':['姨父','姨爸','姨丈'],
// 同辈及以下
'{G1},[s&o|s&l]':['兄弟'],
'{G1},[s&o|s&l],w':['兄弟妇'],
'{G1},s':['兄弟'],
'{G1},s,w':['兄弟妇'],
'{G1},s&o':['哥','兄'],
'{G1},s&o,w':['嫂','嫂子','兄妇'],
'{G1},s&l':['弟'],
@@ -157,8 +157,8 @@ export default {
'{G1},s,d,s,w':['侄外孙妇'],
'{G1},s,d,d':['侄外孙女','外孙女'],
'{G1},s,d,d,h':['侄外孙婿'],
'{G1},[d&o|d&l]':['姐妹'],
'{G1},[d&o|d&l],h':['姐妹壻'],
'{G1},d':['姐妹'],
'{G1},d,h':['姐妹壻'],
'{G1},d&o':['姐'],
'{G1},d&o,h':['姐夫'],
'{G1},d&l':['妹'],

View File

@@ -86,28 +86,19 @@ export function getGenById(id){
export function getItemsById(id){
let items = [];
let getData = function(key){
let res = [];
let ids = [];
if(_data[key]){
res.push(_data[key][0]);
}else{
let ids = [];
let k = key.replace(/[ol](b|s)/,'x$1');
if(_data[k]){
ids.push(k);
let k1 = key.replace(/(,[sd])(,[wh])?$/,'$1&o$2');
let k2 = key.replace(/(,[sd])(,[wh])?$/,'$1&l$2');
if(_data[k1]&&_data[k2]){
ids = [k1,k2];
}else{
ids = [key];
}
k = key.replace(/(.+)(,[hw])$/,'$1&o$2').replace(/(,[^hw])$/,'$1&o');
if(_data[k]){
ids.push(k);
}
k = key.replace(/(.+)(,[hw])$/,'$1&l$2').replace(/(,[^hw])$/,'$1&l');
if(_data[k]){
ids.push(k);
}
res = filterId(ids).map(function(id){
return _data[id][0];
});
}
return res;
return filterId(ids).map(function(id){
return _data[id][0];
});
};
// 对排序进行处理
if(id.match(/&([\d]+)(,[hw])?$/)){