XAWDJ0277HWXPT2\Administrator 5 年 前
コミット
b72450b7ef

web/css/chunk-7ef40bfa.49e11227.css → web/css/chunk-da93a5c6.49e11227.css


ファイルの差分が大きいため隠しています
+ 1 - 1
web/index.html


ファイルの差分が大きいため隠しています
+ 2 - 2
web/js/app.7ad0b806.js


ファイルの差分が大きいため隠しています
+ 1 - 1
web/js/app.7ad0b806.js.map


ファイルの差分が大きいため隠しています
+ 0 - 2
web/js/chunk-7ef40bfa.cf369780.js


ファイルの差分が大きいため隠しています
+ 0 - 1
web/js/chunk-7ef40bfa.cf369780.js.map


ファイルの差分が大きいため隠しています
+ 2 - 0
web/js/chunk-da93a5c6.6cbe47d9.js


ファイルの差分が大きいため隠しています
+ 1 - 0
web/js/chunk-da93a5c6.6cbe47d9.js.map


ファイルの差分が大きいため隠しています
+ 1 - 1
webConfig/src/store/Barisal.json


ファイルの差分が大きいため隠しています
+ 572 - 572
webConfig/src/store/map_bf.json


+ 33 - 61
webConfig/src/store/node.js

@@ -8,7 +8,7 @@ let params = {
 }
 function writeJson(params){
     //现将json文件读出来
-    fs.readFile('./person.json',function(err,data){
+    fs.readFile('./map_bf.json',function(err,data){
         console.log('读取文件')
         if(err){
             return console.error(err);
@@ -98,16 +98,16 @@ function writeJson(params){
                 // console.log(d.properties.Dist_name+' '+name,'----8888888888888888-----')
                 if(d.properties.Divi_name == provinceName){
                     if(d.properties.Dist_name == name){
-                        if(d.properties.Upaz_name == 'Manpura Upazila'||d.properties.Upaz_name=='Kala Para Upazila'||d.properties.Upaz_name=='Galachipa Upazila'){
+                        if(d.properties.Upaz_name=='Kutubdia Upazila'||d.properties.Upaz_name=='Maheshkhali Upazila'||d.properties.Upaz_name=='Phulbari Sadar Upazila'||d.properties.Upaz_name=='Bhurungamari Upazila'){
                             continue
                         }
                         if(cfName == d.properties.Upaz_name){
                             continue
                         }
                         item.properties.name = d.properties.Dist_name+' Division';
-                        if(item.geometry.coordinates[0][0].length == 0){
+                        if(item.geometry.coordinates.length == 0){
                             number++;
-                            item.geometry.coordinates[0][0] = JSON.parse(JSON.stringify(d.geometry.coordinates[0][0]));
+                            item.geometry.coordinates = JSON.parse(JSON.stringify(d.geometry.coordinates));
                             console.log('已筛选 '+number+' '+d.properties.Upaz_name+'-------------1---------');
                         }else{
                             let xArr = [],xIndex = 0;
@@ -127,9 +127,7 @@ function writeJson(params){
                                             x1 = Number(key);
                                             xArr[xIndex] = Number(key);
                                         }else{
-                                            if(Math.abs(x2-Number(key)) > 3){
-                                                xIndex++;
-                                                xArr[xIndex] = Number(key)-x2>0?'+':'-';
+                                            if(Math.abs(x2-Number(key)) > 20){
                                                 xIndex++;
                                                 xArr[xIndex] = x2;
                                                 xIndex++;
@@ -140,9 +138,7 @@ function writeJson(params){
                                             y1 = Number(j);
                                             yArr[yIndex] = Number(j);
                                         }else{
-                                            if(Math.abs(y2-Number(j)) > 3){
-                                                yIndex++;
-                                                yArr[yIndex] = Number(j) - y2>0?'+':'-';
+                                            if(Math.abs(y2-Number(j)) > 20){
                                                 yIndex++;
                                                 yArr[yIndex] = y2;
                                                 yIndex++;
@@ -159,55 +155,39 @@ function writeJson(params){
                                             yk = y2-y1>0?'+':'-';
                                             ykk = y2;
                                         }
-                                        // console.log(x1,xk,x2,xkk,y1,yk,y2,ykk)
                                         break;
                                     }
                                 }
                             }
                             xIndex++;
-                            yIndex++;
                             xArr[xIndex] = Number(x2);
+                            yIndex++;
                             yArr[yIndex] = Number(y2);
                             if(x1||x2||y1||y2){
-                                console.log(xArr,yArr,'-------')
-                                if(yk == '-'){
-                                    if(y2>y1){
-                                        arr2 = d.geometry.coordinates[0][0].slice(y1,y2)
-                                    }else{
-                                        arr2 = d.geometry.coordinates[0][0].slice(y1,d.geometry.coordinates[0][0].length-1)
-                                        arr2.push(...(d.geometry.coordinates[0][0].slice(0,y2)))
-                                    }
+                                console.log(xArr,item.geometry.coordinates[0][0].length,yArr,d.geometry.coordinates[0][0].length,'-------')
+                                if(yArr.length == 4){
+                                    y1 = yArr[2]
+                                    y2 = yArr[1]
+                                }
+                                if(y2>y1){
+                                    arr2 = d.geometry.coordinates[0][0].slice(y2,d.geometry.coordinates[0][0].length)
+                                    arr2.push(...(d.geometry.coordinates[0][0].slice(0,y1)))
                                 }else{
-                                    if(yArr.length == 3){
-                                        y1 = yArr[2]
-                                        y2 = yArr[1]
-                                    }
-                                    if(y2>y1){
-                                        arr2 = d.geometry.coordinates[0][0].slice(y2,d.geometry.coordinates[0][0].length-1)
-                                        arr2.push(...(d.geometry.coordinates[0][0].slice(0,y1)))
-                                    }else{
-                                        arr2 = d.geometry.coordinates[0][0].slice(y2,y1)
-                                    }
-
+                                    arr2 = d.geometry.coordinates[0][0].slice(y2,y1)
                                 }
-                                if(xk == '-'){
-                                    // if(xk != yk){
-                                        // arr2 = arr2.reverse();
-                                    // }
-                                    if(x2>x1){
-                                        item.geometry.coordinates[0][0].splice(x2,item.geometry.coordinates[0][0]-1-x2)
-                                        item.geometry.coordinates[0][0].splice(0,x1,...arr2)
-                                    }else{
-                                        item.geometry.coordinates[0][0].splice(x2,x1-x2,...arr2)
-                                    }
+                                if(x2>x1){
+                                    item.geometry.coordinates[0][0].splice(x2,item.geometry.coordinates[0][0].length-1-x2)
+                                    item.geometry.coordinates[0][0].splice(0,x1,...arr2)
+                                }else if(x2 == x1){
+                                    x1 = Math.max(...xArr)
+                                    x2 = Math.min(...xArr)
+                                    console.log(x1,x2)
+                                    item.geometry.coordinates[0][0].splice(x2,x1-x2,...arr2)
                                 }else{
-                                    if(x2>x1){
-                                        item.geometry.coordinates[0][0].splice(x1,x2-x1,...arr2)
-                                    }else{
-                                        item.geometry.coordinates[0][0].splice(x1,item.geometry.coordinates[0][0]-1-x1)
-                                        item.geometry.coordinates[0][0].splice(0,x2,...arr2)
-                                    }
-
+                                    item.geometry.coordinates[0][0].splice(x2,x1-x2,...arr2)
+                                }
+                                if(d.geometry.coordinates.length>1){
+                                    item.geometry.coordinates.push(...d.geometry.coordinates.slice(1,d.geometry.coordinates.length))
                                 }
                                 number++;
                                 console.log('已筛选 '+number+' '+d.properties.Upaz_name+'-------------2---------');
@@ -221,7 +201,6 @@ function writeJson(params){
                     }
                 }
             }
-            // console.log('计算第'+i+'轮结束'+' 未对比数'+arr3.length);
             if(arr3Length == arr3.length){
                 index++;
             }else{
@@ -232,19 +211,12 @@ function writeJson(params){
                 arr3Length = arr3.length;
                 fun(arr3,provinceName,name,item)
             }else{
-                // console.log(provinceName+' 1')
-                // console.log(provinceNameArrJSON[provinceName]+' 2')
-                // console.log(provinceNameArrJSON[provinceName].features.length+'已计算个数')
                 if(index>=2){
                     item = {
                         type: "Feature",
                         geometry: {
                             type: "MultiPolygon",
-                            coordinates: [
-                                [
-                                    arr3[0].geometry.coordinates[0][0]
-                                ]
-                            ]
+                            coordinates: arr3[0].geometry.coordinates
                         },
                         properties: {
                             name:'',
@@ -277,7 +249,7 @@ function writeJson(params){
             }
         }
         // for(let provinceName of provinceNameArr){
-            // for(let name of cityName['Barisal']){
+            for(let name of cityName['Barisal']){
                 let item = {
                     type: "Feature",
                     geometry: {
@@ -291,9 +263,9 @@ function writeJson(params){
                 index = 0;
                 number = 0;
                 arr3Length = 0;
-            //     fun(bangladesh.features,'Barisal',name,item)
-            // }
-            fun(bangladesh.features,'Barisal','Barisal',item)
+                fun(bangladesh.features,'Barisal',name,item)
+            }
+            // fun(bangladesh.features,'Barisal','Bhola',item)
         // }
         // fun(bangladesh.features,'Khulna')
         // console.log(cityName)

+ 12 - 10
webConfig/src/views/dashboard.vue

@@ -265,9 +265,10 @@
     import allUel from '../api/allUel.js'
     import base from '../api/base.js'
     import { mapGetters } from 'vuex'
-    import bangladesh from '../store/Bangladesh.json'
-    // import bangladesh from '../store/Barisal.json'
-    // import bangladesh from '../store/map.json'
+    // import bangladesh from '../store/Bangladesh.json'
+    import bangladesh from '../store/Barisal.json'
+    // import bangladesh from '../store/Chittagong.json'
+    // import bangladesh from '../store/map_bf.json'
     // import bangladesh from '../store/person.json'
     // import world from '../store/world.json'
 
@@ -805,13 +806,14 @@
                                     zoom:1.2,
                                     roam: true,
                                     data: [
-                                        {name: 'Barisal Division', value: 2157},
-                                        {name: 'Chittagong Division', value: 0},
-                                        {name: 'Dhaka Division', value: 36},
-                                        {name: 'Khulna Division', value: 62},
-                                        {name: 'Rajshahi Division', value: 445},
-                                        {name: 'Rangpur Division', value: 606},
-                                        {name: 'Sylhet Division', value: 398},
+                                        {name: 'Barisal Division', value: Math.round(Math.random()*100)},
+                                        {name: 'Chittagong Division', value: Math.round(Math.random()*100)},
+                                        {name: 'Rajshahi Division', value: Math.round(Math.random()*1000)},
+                                        {name: 'Rangpur Division', value: Math.round(Math.random()*10000)},
+                                        {name: 'Dhaka Division', value: Math.round(Math.random()*10)},
+                                        {name: 'Sylhet Division', value: Math.round(Math.random()*1000)},
+                                        {name: 'Mymensingh Division', value: Math.round(Math.random()*100)},
+                                        {name: 'Khulna Division', value: Math.round(Math.random()*100)},
                                     ],
                                 }
                             ]