【modify】使用ESLint格式化代码

This commit is contained in:
zer0Black
2023-03-01 09:33:58 +08:00
parent 694855ae8b
commit 63369b8b87
400 changed files with 42942 additions and 43132 deletions
+38 -40
View File
@@ -7,79 +7,77 @@ export default class Area {
* 构造器
* @param express
*/
constructor(pcaa) {
if(!pcaa){
pcaa = Vue.prototype.$Jpcaa;
constructor (pcaa) {
if (!pcaa) {
pcaa = Vue.prototype.$Jpcaa
}
let arr = []
const arr = []
const province = pcaa['86']
Object.keys(province).map(key=>{
arr.push({id:key, text:province[key], pid:'86', index:1});
const city = pcaa[key];
Object.keys(city).map(key2=>{
arr.push({id:key2, text:city[key2], pid:key, index:2});
const qu = pcaa[key2];
if(qu){
Object.keys(qu).map(key3=>{
arr.push({id:key3, text:qu[key3], pid:key2, index:3});
Object.keys(province).map(key => {
arr.push({ id: key, text: province[key], pid: '86', index: 1 })
const city = pcaa[key]
Object.keys(city).map(key2 => {
arr.push({ id: key2, text: city[key2], pid: key, index: 2 })
const qu = pcaa[key2]
if (qu) {
Object.keys(qu).map(key3 => {
arr.push({ id: key3, text: qu[key3], pid: key2, index: 3 })
})
}
})
})
this.all = arr;
this.all = arr
}
get pca(){
return this.all;
get pca () {
return this.all
}
getCode(text){
if(!text || text.length==0){
getCode (text) {
if (!text || text.length == 0) {
return ''
}
for(let item of this.all){
if(item.text === text){
return item.id;
for (const item of this.all) {
if (item.text === text) {
return item.id
}
}
}
getText(code){
if(!code || code.length==0){
getText (code) {
if (!code || code.length == 0) {
return ''
}
let arr = []
this.getAreaBycode(code, arr, 3);
const arr = []
this.getAreaBycode(code, arr, 3)
return arr.join('/')
}
getRealCode(code){
let arr = []
getRealCode (code) {
const arr = []
this.getPcode(code, arr, 3)
return arr;
return arr
}
getPcode(id, arr, index){
for(let item of this.all){
if(item.id === id && item.index == index){
getPcode (id, arr, index) {
for (const item of this.all) {
if (item.id === id && item.index == index) {
arr.unshift(id)
if(item.pid != '86'){
if (item.pid != '86') {
this.getPcode(item.pid, arr, --index)
}
}
}
}
getAreaBycode(code, arr, index){
for(let item of this.all){
if(item.id === code && item.index == index){
arr.unshift(item.text);
if(item.pid != '86'){
getAreaBycode (code, arr, index) {
for (const item of this.all) {
if (item.id === code && item.index == index) {
arr.unshift(item.text)
if (item.pid != '86') {
this.getAreaBycode(item.pid, arr, --index)
}
}
}
}
}
}