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.
shop-app/common/dicts/area.js

25 lines
356 KiB

3 years ago
/*
* @Author: ch
* @Date: 2022-04-06 17:41:52
* @LastEditors: ch
* @LastEditTime: 2022-04-06 19:48:13
* @Description: file content
*/
const area = [{"code":"110000000000","level":1,"children":[{"code":"110100000000","level":2,"children":[{"code":"110101000000","level":3,"name":"东城区","pid":2,"id":3,"sort":"D","leaf":true},{"code":"110102000000","level":3,"name":"西城区","pid":2,"id":4,"sort":"X","leaf":true},{"code":"110105000000","level":3,"name":"朝阳区","pid":2,"id":5,"sort":"C","leaf":true},{"code":"110106000000","level":3,"name":"丰台区","pid":2,"id":6,"sort":"F","leaf":true},{"code":"110107000000","level":3,"name":"石景山区","pid":2,"id":7,"sort":"S","leaf":true},{"code":"110108000000","level":3,"name":"海淀区","pid":2,"id":8,"sort":"H","leaf":true},{"code":"110109000000","level":3,"name":"门头沟区","pid":2,"id":9,"sort":"M","leaf":true},{"code":"110111000000","level":3,"name":"房山区","pid":2,"id":10,"sort":"F","leaf":true},{"code":"110112000000","level":3,"name":"通州区","pid":2,"id":11,"sort":"T","leaf":true},{"code":"110113000000","level":3,"name":"顺义区","pid":2,"id":12,"sort":"S","leaf":true},{"code":"110114000000","level":3,"name":"昌平区","pid":2,"id":13,"sort":"C","leaf":true},{"code":"110115000000","level":3,"name":"大兴区","pid":2,"id":14,"sort":"D","leaf":true},{"code":"110116000000","level":3,"name":"怀柔区","pid":2,"id":15,"sort":"H","leaf":true},{"code":"110117000000","level":3,"name":"平谷区","pid":2,"id":16,"sort":"P","leaf":true},{"code":"110118000000","level":3,"name":"密云区","pid":2,"id":17,"sort":"M","leaf":true},{"code":"110119000000","level":3,"name":"延庆区","pid":2,"id":18,"sort":"Y","leaf":true}],"name":"市辖区","pid":1,"id":2,"sort":"S","leaf":false}],"name":"北京市","pid":0,"id":1,"sort":"B","leaf":false},{"code":"120000000000","level":1,"children":[{"code":"120100000000","level":2,"children":[{"code":"120101000000","level":3,"name":"和平区","pid":20,"id":21,"sort":"H","leaf":true},{"code":"120102000000","level":3,"name":"河东区","pid":20,"id":22,"sort":"H","leaf":true},{"code":"120103000000","level":3,"name":"河西区","pid":20,"id":23,"sort":"H","leaf":true},{"code":"120104000000","level":3,"name":"南开区","pid":20,"id":24,"sort":"N","leaf":true},{"code":"120105000000","level":3,"name":"河北区","pid":20,"id":25,"sort":"H","leaf":true},{"code":"120106000000","level":3,"name":"红桥区","pid":20,"id":26,"sort":"H","leaf":true},{"code":"120110000000","level":3,"name":"东丽区","pid":20,"id":27,"sort":"D","leaf":true},{"code":"120111000000","level":3,"name":"西青区","pid":20,"id":28,"sort":"X","leaf":true},{"code":"120112000000","level":3,"name":"津南区","pid":20,"id":29,"sort":"J","leaf":true},{"code":"120113000000","level":3,"name":"北辰区","pid":20,"id":30,"sort":"B","leaf":true},{"code":"120114000000","level":3,"name":"武清区","pid":20,"id":31,"sort":"W","leaf":true},{"code":"120115000000","level":3,"name":"宝坻区","pid":20,"id":32,"sort":"B","leaf":true},{"code":"120116000000","level":3,"name":"滨海新区","pid":20,"id":33,"sort":"B","leaf":true},{"code":"120117000000","level":3,"name":"宁河区","pid":20,"id":34,"sort":"N","leaf":true},{"code":"120118000000","level":3,"name":"静海区","pid":20,"id":35,"sort":"J","leaf":true},{"code":"120119000000","level":3,"name":"蓟州区","pid":20,"id":36,"sort":"J","leaf":true}],"name":"市辖区","pid":19,"id":20,"sort":"S","leaf":false}],"name":"天津市","pid":0,"id":19,"sort":"T","leaf":false},{"code":"130000000000","level":1,"children":[{"code":"130100000000","level":2,"children":[{"code":"130101000000","level":3,"name":"市辖区","pid":38,"id":39,"sort":"S","leaf":true},{"code":"130102000000","level":3,"name":"长安区","pid":38,"id":40,"sort":"C","leaf":true},{"code":"130104000000","level":3,"name":"桥西区","pid":38,"id":41,"sort":"Q","leaf":true},{"code":"130105000000","level":3,"name":"新华区","pid":38,"id":42,"sort":"X","leaf":true},{"code":"130107000000","level":3,"name":"井陉矿区","pid":38,"id":43,"sort":"J","leaf":true},{"code":"130108000000","level":3,"name":"裕华区","pid":38,"id":44,"sort":"Y","leaf":true},{"code":"130109000000","level":3,"name":"<EFBFBD>
// const result = area.map(i => {
// let newChild = [];
// if(i.children[0].name === '市辖区'){
// newChild = [...i.children[0].children];
// let sxq = {...i.children[0]};
// delete sxq.children
// newChild.unshift(sxq);
// i.children = newChild;
// }else{
// newChild = i.children;
// }
// i.children = newChild;
// return i;
// })
export default area;