Procházet zdrojové kódy

Merge branch 'master' of http://gogs.weclouds.xyz:3000/crazycat/IDCOL

wzh před 5 roky
rodič
revize
be589749ad
37 změnil soubory, kde provedl 5086966 přidání a 430 odebrání
  1. 1 1
      web/css/chunk-907771ee.f6f4862a.css
  2. 1 0
      web/css/chunk-749ce008.3550b045.css
  3. 1 0
      web/css/chunk-a80ca5cc.6f4f97b9.css
  4. 0 1
      web/css/chunk-a80ca5cc.e6eff659.css
  5. 1 1
      web/index.html
  6. 0 2
      web/js/app.79894715.js
  7. 0 1
      web/js/app.79894715.js.map
  8. 2 0
      web/js/app.abec26d4.js
  9. 1 0
      web/js/app.abec26d4.js.map
  10. 2 0
      web/js/chunk-139cf1a1.ea548e93.js
  11. 1 0
      web/js/chunk-139cf1a1.ea548e93.js.map
  12. 2 0
      web/js/chunk-749ce008.02f8bc30.js
  13. 1 0
      web/js/chunk-749ce008.02f8bc30.js.map
  14. 0 2
      web/js/chunk-7ef40bfa.5e6a8835.js
  15. 0 1
      web/js/chunk-7ef40bfa.5e6a8835.js.map
  16. 2 0
      web/js/chunk-7ef40bfa.8e4d115c.js
  17. 1 0
      web/js/chunk-7ef40bfa.8e4d115c.js.map
  18. 0 2
      web/js/chunk-907771ee.089383f4.js
  19. 0 1
      web/js/chunk-907771ee.089383f4.js.map
  20. 2 0
      web/js/chunk-a80ca5cc.2b3ad3c1.js
  21. 1 0
      web/js/chunk-a80ca5cc.2b3ad3c1.js.map
  22. 0 2
      web/js/chunk-a80ca5cc.973bcfb0.js
  23. 0 1
      web/js/chunk-a80ca5cc.973bcfb0.js.map
  24. 6 0
      webConfig/src/api/allUel.js
  25. 1 0
      webConfig/src/components/header.vue
  26. 31 13
      webConfig/src/components/sideBar_idcol.vue
  27. 8 0
      webConfig/src/router.js
  28. 1 0
      webConfig/src/store/Barisal.json
  29. 5 0
      webConfig/src/store/index.js
  30. 243 0
      webConfig/src/store/node.js
  31. 50 0
      webConfig/src/store/node_1.js
  32. 2895333 0
      webConfig/src/store/person.json
  33. 2132642 0
      webConfig/src/store/test00001_.json
  34. 57202 0
      webConfig/src/store/test0001_.json
  35. 1011 0
      webConfig/src/views/companyManagement.vue
  36. 158 35
      webConfig/src/views/dashboard.vue
  37. 256 367
      webConfig/src/views/projectManagement.vue

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
web/css/chunk-907771ee.f6f4862a.css


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 0
web/css/chunk-749ce008.3550b045.css


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 0
web/css/chunk-a80ca5cc.6f4f97b9.css


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 1
web/css/chunk-a80ca5cc.e6eff659.css


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
web/index.html


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 2
web/js/app.79894715.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 1
web/js/app.79894715.js.map


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 2 - 0
web/js/app.abec26d4.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 0
web/js/app.abec26d4.js.map


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 2 - 0
web/js/chunk-139cf1a1.ea548e93.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 0
web/js/chunk-139cf1a1.ea548e93.js.map


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 2 - 0
web/js/chunk-749ce008.02f8bc30.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 0
web/js/chunk-749ce008.02f8bc30.js.map


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 2
web/js/chunk-7ef40bfa.5e6a8835.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 1
web/js/chunk-7ef40bfa.5e6a8835.js.map


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 2 - 0
web/js/chunk-7ef40bfa.8e4d115c.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 0
web/js/chunk-7ef40bfa.8e4d115c.js.map


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 2
web/js/chunk-907771ee.089383f4.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 1
web/js/chunk-907771ee.089383f4.js.map


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 2 - 0
web/js/chunk-a80ca5cc.2b3ad3c1.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 0
web/js/chunk-a80ca5cc.2b3ad3c1.js.map


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 2
web/js/chunk-a80ca5cc.973bcfb0.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 1
web/js/chunk-a80ca5cc.973bcfb0.js.map


+ 6 - 0
webConfig/src/api/allUel.js

@@ -70,6 +70,12 @@ const urls={
         del:'https://120.77.179.55/api/user/del',/*删除用户*/
         block_user:'https://120.77.179.55/api/user/block_user',/*停用启用账号*/
         update_avatar:'https://120.77.179.55/api/user/update_avatar',/*编辑用户头像*/
+
+        company_get_list:'https://120.77.179.55/api/company/get_list',/*公司列表*/
+        company_save:'https://120.77.179.55/api/company/save',/*添加编辑公司*/
+        company_del:'https://120.77.179.55/api/company/del',/*删除公司*/
+        company_nav:'https://120.77.179.55/api/company/nav',/*公司下拉列表*/
+
     },
     syslog:{
       getList:'https://120.77.179.55/api/syslog/get_list',/*日志列表*/

+ 1 - 0
webConfig/src/components/header.vue

@@ -26,6 +26,7 @@
                             <div class="nav_li" @click="linkToFun('/userManagement')" :class="{'select':routerStr == '/userManagement'}"><i class="iconfont icon-daohangjiantou"></i><span class="span">User Management</span></div>
                             <!-- <div class="nav_li"><i class="iconfont icon-daohangjiantou"></i><span class="span">User Management</span></div> -->
                             <div class="nav_li" @click="linkToFun('/operationLog')" :class="{'select':routerStr == '/operationLog'}"><i class="iconfont icon-daohangjiantou"></i><span class="span">Operation Log</span></div>
+                            <div class="nav_li" @click="linkToFun('/companyManagement')" :class="{'select':routerStr == '/companyManagement'}"><i class="iconfont icon-daohangjiantou"></i><span class="span">Company management</span></div>
                         </div>
                     </div>
                     <div class="nav_right">

+ 31 - 13
webConfig/src/components/sideBar_idcol.vue

@@ -54,25 +54,24 @@
                 </div>
                 <div class="sideBar_list_box scrollbar_style" v-if="searchType != 0">
                     <div class="sideBar_list" v-for="obj in sideBarList" :key="obj.id">
-                        <p @click="click1(obj)" class="company_name" :class="{'select':projectId==obj.id}">
-                            <span class="text" :title="obj.projectname"><i class="iconfont icon-celan-fenzhi"></i><span class="span1">{{obj.company}}</span><span class="span2">({{obj.number}})</span></span>
+                        <p @click="click1(obj)" class="company_name" :class="{'select':companyId==obj.id}">
+                            <span class="text" :title="obj.company"><i class="iconfont icon-celan-fenzhi"></i><span class="span1">{{obj.company}}</span><span class="span2"></span></span>
                             <i class="el-icon-arrow-up" :style="{'transform':obj.isOpen?'rotate(180deg)':''}"></i>
                         </p>
                         <div v-if="obj.isOpen" class="sideBar_project_box">
                             <div v-for="item in obj.projectList"  :key="item.id" class="sideBar_project">
-                                <div class="sideBar_project_text"  @click="click2(item,obj.projectList)">
-                                    <!-- sideBar_project_select -->
+                                <div class="sideBar_project_text" :class="{'sideBar_project_select':projectId==item.id}" @click="click2(item,obj.projectList)">
                                     <span :title="item.projectname" :id="'sideBar_projectId_'+item.id">
                                         <span class="span1">{{item.projectname}}</span> 
                                         <!-- <span class="span2">({{item.lampcount}})</span> -->
                                     </span>
-                                    <!-- <i class="el-icon-arrow-up" :style="{'transform':item.isOpen?'rotate(180deg)':''}"></i> -->
+                                    <i class="el-icon-arrow-up" :style="{'transform':item.isOpen?'rotate(180deg)':''}"></i>
                                 </div>
-                               <!--  <template v-if="item.isOpen">
-                                    <div v-for="d in item.roadList" :key="d.id" class="sideBar_road_text" :class="{'sideBar_road_select':roadId==d.value&&roadId}" @click.stop="click5(d,item,obj)">
-                                        <span>{{d.name}} ({{d.lampcount}})</span>
+                                <template v-if="item.isOpen">
+                                    <div v-for="d in item.sectionList" :key="d.id" class="sideBar_road_text" :class="{'sideBar_road_select':roadId==d.name}" @click.stop="click5(item,d)">
+                                        <span>{{d.name}}</span>
                                     </div>
-                                </template> -->
+                                </template>
                             </div>
                         </div>
                     </div>
@@ -101,7 +100,7 @@
                 keywords:'',
                 screeningCheckList:[],
                 searchType:'',
-                searchTypeArr:[{id:0,name:'Project'},{id:1,name:'Manufacturer'},{id:2,name:'Supplier'},{id:3,name:'PO'},{id:4,name:'Upazilla'}],
+                searchTypeArr:[{id:0,name:'Project'},{id:2,name:'Manufacturer'},{id:3,name:'Supplier'},{id:4,name:'PO'},{id:5,name:'Upazilla'}],
 
             }
         },
@@ -122,9 +121,12 @@
                 return name;
             },
         },
-        props:['sideBarList','projectId','roadId','sideBarListIsOpen','projectSelectFun','roadSelectFun','sideBarIsOn','sideBarType','reportType','sideBarCompanyList','projectAll'],
+        props:['sideBarList','companyId','projectId','roadId','sideBarListIsOpen','projectSelectFun','roadSelectFun','sideBarIsOn','sideBarType','reportType','sideBarCompanyList','projectAll'],
         mounted(){
             this.searchType = 0;
+            this.$store.commit('SIDEBARCOMPANYTYPE',{
+                sideBarCompanyType:0,
+            })
             var storage = window.localStorage;
             let searchType = storage.getItem("searchType");
             if(searchType){
@@ -155,7 +157,7 @@
             },
             /*侧边栏打开关闭*/
             click1(data){
-                this.sideBarListIsOpen(this.searchType,data)
+                this.sideBarListIsOpen(data)
             },
             /*侧边栏里展开收起*/
             click2(data){
@@ -187,7 +189,7 @@
             },
             click5(data,obj){
                 // console.log(data,obj,d,'--------------------')
-                this.roadSelectFun(this.searchType,data,obj)
+                this.roadSelectFun(data,obj)
             },
             getLightListKeyUp(e){
                 if(e.key == 'Enter'){
@@ -202,6 +204,9 @@
             searchType(curVal){
                 var storage = window.localStorage;
                 storage.setItem('searchType',curVal);
+                this.$store.commit('SIDEBARCOMPANYTYPE',{
+                    sideBarCompanyType:curVal,
+                })
             }
         }
     }
@@ -403,6 +408,19 @@
                                         }
                                     }
                                 }
+                                .sideBar_road_text{
+                                    cursor: pointer;
+                                    height:2.33rem;line-height:2.3rem;
+                                    padding-left: 1rem;
+                                    &.sideBar_road_select{
+                                        background:rgba(252,132,64,0.1);
+                                        border-radius:0.33rem;
+                                        font-size:1rem;
+                                        font-family:PingFang-SC-Medium,PingFang-SC;
+                                        font-weight:500;
+                                        color:rgba(252,132,64,1);
+                                    }
+                                }
                             }
                         }
                     }

+ 8 - 0
webConfig/src/router.js

@@ -20,6 +20,9 @@ const historicalData = () => import('./views/historicalData/historicalData.vue')
 
 const operationLog = () => import('./views/operationLog/operationLog.vue');
 
+const companyManagement = () => import('./views/companyManagement.vue');
+
+
 const routes = [
     {
         path: '/',
@@ -83,6 +86,11 @@ const routes = [
         name: 'operationLog',
         component: operationLog
     },
+    {
+        path: '/companyManagement',
+        name: 'companyManagement',
+        component: companyManagement
+    },
 ]
 
 const router = new VueRouter({

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 0
webConfig/src/store/Barisal.json


+ 5 - 0
webConfig/src/store/index.js

@@ -34,9 +34,11 @@ export default new Vuex.Store({
         editHotelLogoShowBg:false,
         longitude:0,
         latitude:0,
+        sideBarCompanyType:0,
     },
     getters: {
 
+        sideBarCompanyType:state=>state.sideBarCompanyType,
         lampEdit:state=>state.lampEdit,
 
         routerStr:state=>state.routerStr,
@@ -139,5 +141,8 @@ export default new Vuex.Store({
         REMRATIOFUN:(state,payload)=>{
             state.remRatio = payload.remRatio;
         },
+        SIDEBARCOMPANYTYPE:(state,payload)=>{
+            state.sideBarCompanyType = payload.sideBarCompanyType;
+        },
     },
 })

+ 243 - 0
webConfig/src/store/node.js

@@ -0,0 +1,243 @@
+
+let fs = require('fs');
+let params = {
+    type: "FeatureCollection",
+    totalFeatures: 544,
+    features: [
+    ]
+}
+function writeJson(params){
+    //现将json文件读出来
+    fs.readFile('./person.json',function(err,data){
+        console.log('读取文件')
+        if(err){
+            return console.error(err);
+        }
+        console.log('读取文件成功')
+        let bangladesh = data.toString();//将二进制的数据转换为字符串
+        bangladesh = JSON.parse(bangladesh);//将字符串转换为json对象
+
+        let arr2 = [];
+        console.log('开始计算')
+        let i = 0;
+        // let cityName = [];
+        let provinceNameArr = ["Barisal", "Chittagong", "Rajshahi", "Rangpur", "Dhaka", "Sylhet", "Mymensingh", "Khulna"];
+        let provinceNameArrJSON = {
+            Barisal:{
+                type: "FeatureCollection",
+                totalFeatures: 544,
+                features: [
+                ],
+            },
+            Chittagong:{
+                type: "FeatureCollection",
+                totalFeatures: 544,
+                features: [
+                ],
+            },
+            Rajshahi:{
+                type: "FeatureCollection",
+                totalFeatures: 544,
+                features: [
+                ],
+            },
+            Rangpur:{
+                type: "FeatureCollection",
+                totalFeatures: 544,
+                features: [
+                ],
+            },
+            Dhaka:{
+                type: "FeatureCollection",
+                totalFeatures: 544,
+                features: [
+                ],
+            },
+            Sylhet:{
+                type: "FeatureCollection",
+                totalFeatures: 544,
+                features: [
+                ],
+            },
+            Mymensingh:{
+                type: "FeatureCollection",
+                totalFeatures: 544,
+                features: [
+                ],
+            },
+            Khulna:{
+                type: "FeatureCollection",
+                totalFeatures: 544,
+                features: [
+                ],
+            },
+        };
+        let cityName = {
+            Barisal:['Barguna','Barisal','Bhola','Jhalokati','Patuakhali','Pirojpur'],
+            Chittagong:['Bandarban','Brahmanbaria','Chandpur','Chittagong','Khagrachhari','Lakshmipur','Noakhali','Rangamati','Comilla','Cox\'s Bazar','Feni'],
+            Rajshahi:['Naogaon','Natore','Chapai Nawabganj','Pabna','Rajshahi','Sirajganj','Bogra','Joypurhat'],
+            Rangpur:['Dinajpur','Gaibandha','Kurigram','Lalmonirhat','Nilphamari','Panchagarh','Rangpur','Thakurgaon'],
+            Dhaka:[ 'Dhaka','Kishoreganj','Madaripur','Manikganj','Munshiganj','Narayanganj','Narsingdi','Rajbari','Shariatpur','Tangail','Faridpur','Gazipur','Gopalganj'],
+            Sylhet:['Habiganj', 'Maulvibazar', 'Sunamganj', 'Sylhet'],
+            Mymensingh:[ 'Mymensingh', 'Netrakona', 'Sherpur', 'Jamalpur'],
+            Khulna:[ 'Bagerhat','Chuadanga','Jessore','Jhenaidah','Khulna','Kushtia','Magura','Meherpur','Narail','Satkhira']
+        };
+        let arr3Length = 0;
+        let index = 0;
+        let number = 0;
+        let fun = function(arr,provinceName,name,item,cfName){
+            let arr3 = [];
+            // console.log('计算第'+i+'轮开始');
+            // console.log(item)
+            for(let d of arr){
+                // d.properties.name = d.properties.Divi_name+'-'+ d.properties.Dist_name+'-'+ d.properties.Upaz_name;
+                // d.properties.name = d.properties.Divi_name;
+                // d.properties.name = d.properties.Dist_name;
+                // d.properties.name = d.properties.Upaz_name;
+                // 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'){
+                            continue
+                        }
+                        if(cfName == d.properties.Upaz_name){
+                            continue
+                        }
+                        item.properties.name = d.properties.Dist_name;
+                        if(item.geometry.coordinates[0][0].length == 0){
+                            number++;
+                            item.geometry.coordinates[0][0] = JSON.parse(JSON.stringify(d.geometry.coordinates[0][0]));
+                            console.log('已筛选 '+number+' '+d.properties.Upaz_name+'-------------1---------');
+                        }else{
+                            let x1 = false;
+                            let x2 = false;
+                            let y1 = false;
+                            let y2 = false;
+                            for(let j in d.geometry.coordinates[0][0]){
+                                for(let key in item.geometry.coordinates[0][0]){
+                                    if(Math.abs(item.geometry.coordinates[0][0][key][0] - d.geometry.coordinates[0][0][j][0])+Math.abs(item.geometry.coordinates[0][0][key][1] - d.geometry.coordinates[0][0][j][1]) < 0.0000001){
+                                        if(!x1){
+                                            x1 = Number(key);
+                                        }
+                                        if(!y1){
+                                            y1 = Number(j);
+                                        }
+                                        x2 = Number(key);
+                                        y2 = Number(j);
+                                        break;
+                                    }
+                                }
+                            }
+                            if(x1||x2||y1||y2){
+                                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)
+                                }
+                                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)
+                                }
+                                number++;
+                                console.log('已筛选 '+number+' '+d.properties.Upaz_name+'-------------2---------');
+                            }else{
+                                arr3.push(d)
+                            }
+                            console.log(provinceName+'-'+name+'-'+d.properties.Upaz_name+' '+arr3.length+'_'+arr3Length+'-'+index);
+                            // d.geometry.coordinates[0][0] = arr1
+                        }
+
+                    }
+                }
+            }
+            // console.log('计算第'+i+'轮结束'+' 未对比数'+arr3.length);
+            if(arr3Length == arr3.length){
+                index++;
+            }else{
+                index = 0;
+                arr3Length = 0;
+            }
+            if(arr3.length>0&&index<3){
+                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>=3){
+                    item = {
+                        type: "Feature",
+                        geometry: {
+                            type: "MultiPolygon",
+                            coordinates: [
+                                [
+                                    arr3[0].geometry.coordinates[0][0]
+                                ]
+                            ]
+                        },
+                        properties: {
+                            name:'',
+                        }
+                    }
+                    index = 0;
+                    number = 1;
+                    arr3Length = 0;
+                    console.log('已筛选 '+number+' '+arr3[0].properties.Upaz_name+'-------------3---------');
+                    fun(bangladesh.features,'Barisal',name,item,arr3[0].properties.Upaz_name)
+                }else{   
+                    console.log(item.geometry.coordinates[0][0].length+'-------------')
+                    provinceNameArrJSON[provinceName].features.push(item)
+                    if(provinceNameArrJSON[provinceName].features.length>0){
+                        console.log(provinceName+' '+name+'已计算');
+                        console.log(provinceNameArrJSON[provinceName].features.length+'-'+cityName[provinceName].length)
+                        if(provinceNameArrJSON[provinceName].features.length == cityName[provinceName].length){
+                            let str = JSON.stringify(provinceNameArrJSON[provinceName]);//因为nodejs的写入文件只认识字符串或者二进制数,所以把json对象转换成字符串重新写入json文件中
+                            // console.log(str)
+                            fs.writeFile('./'+provinceName+'.json',str,function(err){
+                                if(err){
+                                    console.log(err);
+                                }
+                                console.log('----------'+provinceName+'计算完成-------------');
+                            })
+                        }
+                    }
+                }
+                
+            }
+        }
+        // for(let provinceName of provinceNameArr){
+            for(let name of cityName['Barisal']){
+                let item = {
+                    type: "Feature",
+                    geometry: {
+                        type: "MultiPolygon",
+                        coordinates: [[[]]]
+                    },
+                    properties: {
+                        name:'',
+                    }
+                }
+                index = 0;
+                number = 0;
+                fun(bangladesh.features,'Barisal',name,item)
+            }
+            // fun(bangladesh.features,'Barisal','Bhola',item)
+        // }
+        // fun(bangladesh.features,'Khulna')
+        // console.log(cityName)
+
+        // params.features.push(item);//将传来的对象push进数组对象中
+
+        // var str = JSON.stringify(params);//因为nodejs的写入文件只认识字符串或者二进制数,所以把json对象转换成字符串重新写入json文件中
+        // fs.writeFile('./person.json',str,function(err){
+        //     if(err){
+        //         console.error(err);
+        //     }
+        //     console.log('----------计算完成-------------');
+        // })
+    })
+}
+writeJson(params)//执行一下;

+ 50 - 0
webConfig/src/store/node_1.js

@@ -0,0 +1,50 @@
+ fs = require('fs');
+let params = {
+    type: "FeatureCollection",
+    totalFeatures: 544,
+    features: [
+    ]
+}
+function writeJson(params){
+    //现将json文件读出来
+    fs.readFile('./map_bf.json',function(err,data){
+        console.log('读取文件')
+        if(err){
+            return console.error(err);
+        }
+        console.log('读取文件成功')
+        let bangladesh = data.toString();//将二进制的数据转换为字符串
+        bangladesh = JSON.parse(bangladesh);//将字符串转换为json对象
+        for(let d of bangladesh.features){
+
+            let item = {
+                type: "Feature",
+                id: "bangladesh_upazila_boundary.1",
+                geometry: {
+                    type: "MultiPolygon",
+                    coordinates: [[[]]]
+                },
+                geometry_name: "the_geom",
+                properties: d.properties
+            }
+            for(let j in d.geometry.coordinates[0][0]){
+                d.geometry.coordinates[0][0][j][0] = d.geometry.coordinates[0][0][j][0].toFixed(4);
+                d.geometry.coordinates[0][0][j][1] = d.geometry.coordinates[0][0][j][1].toFixed(4);
+                if(item.geometry.coordinates[0][0].indexOf(d.geometry.coordinates[0][0][j]) == -1){
+                    item.geometry.coordinates[0][0].push(d.geometry.coordinates[0][0][j])
+                }
+            }
+            params.features.push(item)
+            console.log(d.properties.Dist_name)
+        }
+        let str = JSON.stringify(params);//因为nodejs的写入文件只认识字符串或者二进制数,所以把json对象转换成字符串重新写入json文件中
+        fs.writeFile('./person.json',str,function(err){
+            if(err){
+                console.error(err);
+            }
+            console.log('----------计算完成-------------');
+        })
+    })
+}
+
+writeJson(params)

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 2895333 - 0
webConfig/src/store/person.json


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 2132642 - 0
webConfig/src/store/test00001_.json


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 57202 - 0
webConfig/src/store/test0001_.json


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1011 - 0
webConfig/src/views/companyManagement.vue


+ 158 - 35
webConfig/src/views/dashboard.vue

@@ -21,9 +21,9 @@
                         <el-dropdown-item v-for="item in districtNav" :class="{'select':item.id==district}" :command="{'key':'district','id':item.id}" :key="item.id">{{item.name}}</el-dropdown-item>
                     </el-dropdown-menu>
                 </el-dropdown>
-                <el-input placeholder="search..." v-model="keywords" @keyup.native="getLightListKeyUp($event)" class="input-with-select">
+                <!-- <el-input placeholder="search..." v-model="keywords" @keyup.native="getLightListKeyUp($event)" class="input-with-select">
                     <i slot="suffix" class="el-input__icon el-icon-search" @click="getLightList()"></i>
-                </el-input>
+                </el-input> -->
             </div>
         </div>
         <div class="dashboard_main">
@@ -39,7 +39,7 @@
                                 <p class="p2">2020-05-20</p>
                             </div>
                         </div>
-                        <p class="p3">Today is the 320th day you log in to the system. We will work with you to maintain all street lights. :)</p>
+                        <p class="p3">Today is the {{infoData.logCount}}th day you log in to the system. We will work with you to maintain all street lights. :)</p>
                     </div>
                     <div class="bottom_box">
                         <div class="btn">
@@ -266,21 +266,25 @@
     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/person.json'
     // import world from '../store/world.json'
 
     export default {
         name:'dashboard',
         data(){
             return{
-                infoData:{},
+                infoData:{
+                    logCount:0,
+                },
                 statisticInfo:{},
                 roleArr:['','Admin','Manufacturer','Supplier','PO','Upazilla','Monitoring','Controlling'],
                 keywords:'',
                 division:'',
-                divisionNav:[{id:'0',name:'division'}],
+                divisionNav:[{id:'0',name:'Division'}],
                 district:'',
-                districtNav:[{id:'0',name:'district'}],
+                districtNav:[{id:'0',name:'District'}],
                 rightDate:'',
                 rightDateNav:[{id:'0',name:'Today'}],
                 myChart1:'',
@@ -372,33 +376,152 @@
             // let barisalArr = [];
             // let j = 0;
             // /*00000001*/
-            // for(let d of bangladesh.features){
-            //     d.properties.name = d.properties.Divi_name;
-            //     if(d.properties.Divi_name == 'Barisal'){
-            //         if(barisalArr.length ==0){
-            //             barisalArr = d.geometry.coordinates[0][0];
-            //             // console.log(barisalArr)
-            //         }else{
-            //             for(let dd of d.geometry.coordinates[0][0]){
-            //                 let isTrue = false,i = 0;
-            //                 for(let key in  barisalArr){
-            //                     if(Math.abs(dd[0] - barisalArr[key][0])+Math.abs(dd[1] - barisalArr[key][1]) < 0.0001){
-            //                         isTrue = true;
-            //                         i = key;
-            //                         break;
-            //                     }
-            //                 }
-            //                 if(isTrue){
-            //                     barisalArr.splice(i,1)
-            //                 }else{
-            //                     barisalArr.push(dd)
-            //                 }
-            //             }
-            //         }
+            // let arr1 = [],arr2 = [];
+            let fun = function(arr){
+            //     let arr3 = [];
+                for(let d of arr){
+                    console.log(d)
+                    // d.properties.name = d.properties.Divi_name+'-'+ d.properties.Dist_name+'-'+ d.properties.Upaz_name;
+                    // d.properties.name = d.properties.Divi_name;
+                    // d.properties.name = d.properties.Dist_name;
+                    // d.properties.name = d.properties.Upaz_name;
+                    // if(d.properties.Dist_name == 'Panchagarh'){
+                    //     if(arr1.length == 0){
+                    //         arr1 = d.geometry.coordinates[0][0];
+                    //     }else{
+                    //         let x1 = false;
+                    //         let x2 = false;
+                    //         let y1 = false;
+                    //         let y2 = false;
+                    //         for(let j in d.geometry.coordinates[0][0]){
+                    //             for(let key in arr1){
+                    //                 if(Math.abs(arr1[key][0] - d.geometry.coordinates[0][0][j][0])+Math.abs(arr1[key][1] - d.geometry.coordinates[0][0][j][1]) < 0.00000001){
+                    //                     if(!x1){
+                    //                         x1 = Number(key);
+                    //                     }
+                    //                     if(!y1){
+                    //                         y1 = Number(j);
+                    //                     }
+                    //                     x2 = Number(key);
+                    //                     y2 = Number(j);
+                    //                     // console.log(key)
+                    //                     break;
+                    //                 }
+                    //             }
+                    //         }
+                    //         if(x1||x2||y1||y2){
+                    //             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(y1,d.geometry.coordinates[0][0].length-1)
+                    //                 arr2.push(...(d.geometry.coordinates[0][0].slice(0,y2)))
+                    //             }
+                    //             if(x2>x1){
+                    //                 arr1.splice(x1,x2-x1,...arr2)
+                    //             }else{
+                    //                 arr1.splice(x2,x1-x2,...arr2)
+                    //             }
+                    //         }else{
+                    //             arr3.push(d)
+                    //         }
+                    //         console.log(arr3.length)
+                    //         d.geometry.coordinates[0][0] = arr1
+                    //         if(arr3.length>10){
+                    //             return
+                    //         }
+                    //     }
+                    // }
+                    // if(d.properties.Upaz_name == 'Panchagarh Sadar Upazila'){
+                    //     arr1 = d.geometry.coordinates[0][0];
+                    //     // d.geometry.coordinates[0][0] = [];
+                    // }
+                    // if(d.properties.Upaz_name == 'Tentulia Upazila'){
+                    //     // arr2 = d.geometry.coordinates[0][0];
+                    //     let x1 = false;
+                    //     let x2 = false;
+                    //     let y1 = false;
+                    //     let y2 = false;
+                    //     for(let j in d.geometry.coordinates[0][0]){
+                    //         for(let key in arr1){
+                    //             if(Math.abs(arr1[key][0] - d.geometry.coordinates[0][0][j][0])+Math.abs(arr1[key][1] - d.geometry.coordinates[0][0][j][1]) < 0.00000001){
+                    //                 if(!x1){
+                    //                     x1 = Number(key);
+                    //                 }
+                    //                 if(!y1){
+                    //                     y1 = Number(j);
+                    //                 }
+                    //                 x2 = Number(key);
+                    //                 y2 = Number(j);
+                    //                 // console.log(key)
+                    //                 break;
+                    //             }
+                    //         }
+                    //     }
+                    //     console.log(x1,x2,y1,y2)
+
+                    //     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(y1,d.geometry.coordinates[0][0].length-1)
+                    //         arr2.push(...(d.geometry.coordinates[0][0].slice(0,y2)))
+                    //     }
+                    //     if(x2>x1){
+                    //         arr1.splice(x1,x2-x1,...arr2)
+                    //     }else{
+                    //         arr1.splice(x2,x1-x2,...arr2)
+                    //     }
+                    //     // d.geometry.coordinates[0][0] = arr1
+                    // }
             //     }
-            //     j++;
-            //     console.log(j)
+            //     if(arr3.length>0){
+            //         fun(arr3)
+            //     }
+                }
+            }
+            fun(bangladesh.features)
+            // console.log(arr1,arr2)
+
+                // if(d.properties.Divi_name == 'Barisal'){
+                //     if(barisalArr.length ==0){
+                //         barisalArr = d.geometry.coordinates[0][0];
+                //         // console.log(barisalArr)
+                //     }else{
+                //         for(let dd of d.geometry.coordinates[0][0]){
+                //             let isTrue = false,i = 0;
+                //             for(let key in  barisalArr){
+                //                 if(Math.abs(dd[0] - barisalArr[key][0])+Math.abs(dd[1] - barisalArr[key][1]) < 0.0001){
+                //                     isTrue = true;
+                //                     i = key;
+                //                     break;
+                //                 }
+                //             }
+                //             if(isTrue){
+                //                 barisalArr.splice(i,1)
+                //             }else{
+                //                 barisalArr.push(dd)
+                //             }
+                //         }
+                //     }
+                // }
+
+            // let maxVal = 0;
+            // for(let d of bangladesh.features){
+                // if(d.properties.Divi_name == 'Chittagong'){
+                    // for(let dd of d.geometry.coordinates[0][0]){
+                    //     // console.log(dd[1])
+                    //     if(maxVal<dd[0]){
+                    //         maxVal = dd[0]
+                    //     }
+                    // }
+                // }
+                // d.geometry.coordinates[0][0].sort(function(x, y){
+                //     return (x[0] + x[1]) - (y[0] + y[1]);
+                // });
             // }
+            // console.log(maxVal)
+            // 92.33450937
             // console.log(barisalArr);
             // let tj1 = false;
             // let tj2 = false;
@@ -460,8 +583,8 @@
                         this.infoData = data.data;
                         this.infoData.light_up_count_percent =  this.infoData.total_light_count==0?0:this.infoData.light_up_count/this.infoData.total_light_count
                         this.infoData.online_count_percent =  this.infoData.total_light_count==0?0:this.infoData.online_count/this.infoData.total_light_count
-                        this.infoData.faulty_count_percent =  this.infoData.total_light_count==0?0:this.infoData.faulty_count_count/this.infoData.total_light_count
-                        this.infoData.day_new_count_percent =  this.infoData.total_light_count==0?0:this.infoData.day_new_count_count/this.infoData.total_light_count
+                        this.infoData.faulty_count_percent =  this.infoData.total_light_count==0?0:this.infoData.faulty_count/this.infoData.total_light_count
+                        this.infoData.day_new_count_percent =  this.infoData.total_light_count==0?0:this.infoData.day_new_count/this.infoData.total_light_count
                     },
                     this
                 )
@@ -542,7 +665,7 @@
                         this.myChart1.setOption({
                             tooltip: {
                                 trigger: 'item',
-                                formatter: '{b}<br/>{c} ()'
+                                formatter: '{b}<br/>{c}'
                                 // formatter: function (params) {
                                     // console.log(params)
                                    //  var tls = `<div class="history_echarts_tooltip"><p class="p1"><i style="background-color:${params[0].color}"></i><span class="span1">${params[0].value}</span><span class="span1">℃</span></p><p class="p2">${params[0].name}</p></div>`;
@@ -566,7 +689,7 @@
                                     name: 'bangladesh',
                                     map: 'bangladesh',
                                     zoom:1.2,
-                                    // roam: true,
+                                    roam: true,
                                     data: [
                                         {name: 'Barisal Division', value: 2157},
                                         {name: 'Chittagong Division', value: 0},

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 256 - 367
webConfig/src/views/projectManagement.vue