wuhongbo 1 gadu atpakaļ
vecāks
revīzija
4b8ffc0f57

+ 1 - 0
BJYSYBZ_C/src/views/BjWlydManageView/components/Td.vue

@@ -316,6 +316,7 @@ export default {
               this.$vm.$emit('refreshLayer', 'bj-lsyd') &&
               this.$parent.detailClose();
             success || this.$message.error('操作繁忙');
+            this.$emit('yjsqClose');
           });
         })
         .catch(() => {});

+ 18 - 5
BJYSYBZ_C/src/views/components/xcryDetail.vue

@@ -8,7 +8,7 @@
       <div class="form-content">
         <div class="btn">
           <div></div>
-          <div class="add" @click="addClick">
+          <div class="add" @click="addClick" v-if="dkbhDisShow">
             <img src="@/assets/images/bj/adds.png" alt="" />
             <p>新增人员</p>
           </div>
@@ -56,7 +56,7 @@
                 </div>
               </td>
               <td>
-                <div class="btns">
+                <div class="btns" v-if="dkbhDisShow">
                   <p
                     style="margin-right: 10px;"
                     v-if="!item.inpShow"
@@ -102,13 +102,27 @@ export default {
   props: {},
   data() {
     return {
+      dkbhDisShow: true,
+      userInfo: {},
       updataShow: false,
       gddwModel: '',
       tableData: [],
       pasShow: false,
     };
   },
-  mounted() {},
+  mounted() {
+    let users = JSON.parse(localStorage.getItem('userInfo'));
+    if (users) {
+      let roles = users.roles.join(',');
+      this.userInfo = users;
+      this.userInfo.roles = roles;
+      if (roles.indexOf('admin') > -1) {
+        this.dkbhDisShow = false;
+      } else {
+        this.disabledShow = true;
+      }
+    }
+  },
   methods: {
     initTableList(gddw) {
       let url = '/api/xcry/listByGddw?gddw=' + gddw;
@@ -132,8 +146,7 @@ export default {
       };
       this.tableData.unshift(obj);
     },
-    inpChange(key, item, index, i) {
-    },
+    inpChange(key, item, index, i) {},
     saveClick(item, index) {
       if (this.updataShow) {
         let url = '/api/xcry/update';

+ 69 - 11
YSGZYBZ_WXAPP/pages/received/index.vue

@@ -5,7 +5,7 @@
         class="mapBox"
         :latitude="latitude"
         :longitude="longitude"
-        :markers="covers"
+        :polygons="covers"
         :scale="scale"
         id="map"
         ref="map"
@@ -74,7 +74,6 @@ import SlideCard from '../../components/SlideCard/SlideCard.vue';
 import CustomMixins from '@/mixins/CustomMixins.js';
 import httpAjax from '@/utils/https.js';
 import config from '@/utils/config.js';
-
 export default {
   mixins: [CustomMixins],
   components: {
@@ -105,18 +104,77 @@ export default {
   },
   methods: {
     cardBoxClick(item, index) {
-      let url = config.bjdkgl + '/0/query';
+      // let s = dksyhArr.map((item) => `'${item}'`).join(",");
+      // let url = config.bjdkgl + '/0/query?dksyh=' + item.dksyh;
       let params = {
-        where: item.dksyh,
+        where: 'dksyh=' + item.dksyh,
       };
-      //https://zlzd.zrzyt.zj.gov.cn/arcMapServer216/arcgis/rest/services/YSYBZ/BJ_DKGL/MapServer/0/query
-      httpAjax({
-        url: url,
-        method: 'POST',
-        data: params,
-      }).then((result) => {
-        console.log(result);
+      let where =
+        '?where=dksyh%3D%27' +
+        item.dksyh +
+        '%27&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&f=pjson';
+      let url = config.bjdkgl + '/0/query';
+      // let whereStr = `1=1 and dksyh in (${s})`;
+      uni
+        .request({
+          url: url + where,
+          method: 'GET',
+        })
+        .then((result) => {
+          let arr = result[1].data.features[0].geometry.rings[0];
+          let newArr = [];
+          arr.forEach((item, index) => {
+            let obj = {
+              latitude: item[1],
+              longitude: item[0],
+            };
+            newArr.push(obj);
+          });
+          let center = this.calculateCenter(newArr);
+
+          // this.latitude = newArr[0].latitude - (Math.random() / 100000 + 0.008);
+          // this.longitude = newArr[0].longitude;
+          this.latitude = center.lat - 0.007;
+          this.longitude = center.lng;
+          this.scale = 15.3 + (Math.random() + 1) / 1000;
+          this.covers = [
+            {
+              // dashArray: Math.random(),
+              points: newArr,
+              strokeColor: '#ff0000',
+              fillColor: '#ff0000',
+              zIndex: 100,
+              strokeWidth: 2,
+            },
+          ];
+        });
+    },
+    // 取面对象 中心点
+    calculateCenter(lnglatarr) {
+      var total = lnglatarr.length;
+      var X = 0,
+        Y = 0,
+        Z = 0;
+      lnglatarr.forEach(function (lnglat) {
+        var lng = (lnglat.longitude * Math.PI) / 180;
+        var lat = (lnglat.latitude * Math.PI) / 180;
+        var x, y, z;
+        x = Math.cos(lat) * Math.cos(lng);
+        y = Math.cos(lat) * Math.sin(lng);
+        z = Math.sin(lat);
+        X += x;
+        Y += y;
+        Z += z;
       });
+      X = X / total;
+      Y = Y / total;
+      Z = Z / total;
+
+      var Lng = Math.atan2(Y, X);
+      var Hyp = Math.sqrt(X * X + Y * Y);
+      var Lat = Math.atan2(Z, Hyp);
+      console.log(Lng, Lat, Hyp);
+      return { lng: (Lng * 180) / Math.PI, lat: (Lat * 180) / Math.PI };
     },
     queryClick() {
       this.queryWarningPage();

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
YSGZYBZ_WXAPP/unpackage/dist/dev/.sourcemap/mp-weixin/pages/received/index.js.map


+ 77 - 19
YSGZYBZ_WXAPP/unpackage/dist/dev/mp-weixin/pages/received/index.js

@@ -213,7 +213,6 @@ __webpack_require__.r(__webpack_exports__);
 var _CustomMixins = _interopRequireDefault(__webpack_require__(/*! @/mixins/CustomMixins.js */ 35));
 var _https = _interopRequireDefault(__webpack_require__(/*! @/utils/https.js */ 18));
 var _config = _interopRequireDefault(__webpack_require__(/*! @/utils/config.js */ 133));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var SlideCard = function SlideCard() {__webpack_require__.e(/*! require.ensure | components/SlideCard/SlideCard */ "components/SlideCard/SlideCard").then((function () {return resolve(__webpack_require__(/*! ../../components/SlideCard/SlideCard.vue */ 90));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var _default =
-
 {
   mixins: [_CustomMixins.default],
   components: {
@@ -243,24 +242,83 @@ var _config = _interopRequireDefault(__webpack_require__(/*! @/utils/config.js *
     this.mapObj = uni.createMapContext('map');
   },
   methods: {
-    cardBoxClick: function cardBoxClick(item, index) {
-      var url = _config.default.bjdkgl + '/0/query';
+    cardBoxClick: function cardBoxClick(item, index) {var _this = this;
+      // let s = dksyhArr.map((item) => `'${item}'`).join(",");
+      // let url = config.bjdkgl + '/0/query?dksyh=' + item.dksyh;
       var params = {
-        where: item.dksyh };
+        where: 'dksyh=' + item.dksyh };
+
+      var where =
+      '?where=dksyh%3D%27' +
+      item.dksyh +
+      '%27&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&f=pjson';
+      var url = _config.default.bjdkgl + '/0/query';
+      // let whereStr = `1=1 and dksyh in (${s})`;
+      uni.
+      request({
+        url: url + where,
+        method: 'GET' }).
 
-      //https://zlzd.zrzyt.zj.gov.cn/arcMapServer216/arcgis/rest/services/YSYBZ/BJ_DKGL/MapServer/0/query
-      (0, _https.default)({
-        url: url,
-        method: 'POST',
-        data: params }).
       then(function (result) {
-        console.log(result);
+        var arr = result[1].data.features[0].geometry.rings[0];
+        var newArr = [];
+        arr.forEach(function (item, index) {
+          var obj = {
+            latitude: item[1],
+            longitude: item[0] };
+
+          newArr.push(obj);
+        });
+        var center = _this.calculateCenter(newArr);
+
+        // this.latitude = newArr[0].latitude - (Math.random() / 100000 + 0.008);
+        // this.longitude = newArr[0].longitude;
+        _this.latitude = center.lat - 0.007;
+        _this.longitude = center.lng;
+        _this.scale = 15.3 + (Math.random() + 1) / 1000;
+        _this.covers = [
+        {
+          // dashArray: Math.random(),
+          points: newArr,
+          strokeColor: '#ff0000',
+          fillColor: '#ff0000',
+          zIndex: 100,
+          strokeWidth: 2 }];
+
+
       });
     },
+    // 取面对象 中心点
+    calculateCenter: function calculateCenter(lnglatarr) {
+      var total = lnglatarr.length;
+      var X = 0,
+      Y = 0,
+      Z = 0;
+      lnglatarr.forEach(function (lnglat) {
+        var lng = lnglat.longitude * Math.PI / 180;
+        var lat = lnglat.latitude * Math.PI / 180;
+        var x, y, z;
+        x = Math.cos(lat) * Math.cos(lng);
+        y = Math.cos(lat) * Math.sin(lng);
+        z = Math.sin(lat);
+        X += x;
+        Y += y;
+        Z += z;
+      });
+      X = X / total;
+      Y = Y / total;
+      Z = Z / total;
+
+      var Lng = Math.atan2(Y, X);
+      var Hyp = Math.sqrt(X * X + Y * Y);
+      var Lat = Math.atan2(Z, Hyp);
+      console.log(Lng, Lat, Hyp);
+      return { lng: Lng * 180 / Math.PI, lat: Lat * 180 / Math.PI };
+    },
     queryClick: function queryClick() {
       this.queryWarningPage();
     },
-    location: function location(val) {var _this = this;
+    location: function location(val) {var _this2 = this;
       var sendData = {
         id: val.id };
 
@@ -271,10 +329,10 @@ var _config = _interopRequireDefault(__webpack_require__(/*! @/utils/config.js *
 
       then(function (result) {
         var data = result['data'];
-        _this.latitude = data.lat - (Math.random() / 100000 + 0.004);
-        _this.longitude = data.lng;
-        _this.scale = 15.3 + (Math.random() + 1) / 1000;
-        _this.covers = [
+        _this2.latitude = data.lat - (Math.random() / 100000 + 0.004);
+        _this2.longitude = data.lng;
+        _this2.scale = 15.3 + (Math.random() + 1) / 1000;
+        _this2.covers = [
         {
           id: Math.random(),
           latitude: data.lat,
@@ -305,7 +363,7 @@ var _config = _interopRequireDefault(__webpack_require__(/*! @/utils/config.js *
         this.queryWarningPage();
       }
     },
-    queryWarningPage: function queryWarningPage() {var _this2 = this;
+    queryWarningPage: function queryWarningPage() {var _this3 = this;
       if (!this.isRequest) return;
       var sendData = {
         dkbh: this.dkbhModel,
@@ -319,8 +377,8 @@ var _config = _interopRequireDefault(__webpack_require__(/*! @/utils/config.js *
 
       then(function (result) {
         if (result.data) {
-          _this2.listData = result.data;
-          _this2.listData.forEach(function (item) {
+          _this3.listData = result.data;
+          _this3.listData.forEach(function (item) {
             if (item.lxdh.indexOf('\n') > -1) {
               item.lxdh = item.lxdh.replace('\n', '');
             }
@@ -330,7 +388,7 @@ var _config = _interopRequireDefault(__webpack_require__(/*! @/utils/config.js *
               }
             }
           });
-          console.log(_this2.listData);
+          console.log(_this3.listData);
         }
       }).
       catch(function (err) {

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
YSGZYBZ_WXAPP/unpackage/dist/dev/mp-weixin/pages/received/index.wxml


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels