主頁 > 企業開發 > 最全vue的vue-amap使用高德地圖插件畫多邊形范圍

最全vue的vue-amap使用高德地圖插件畫多邊形范圍

2020-09-11 11:22:27 企業開發

一、在vue-cli的框架下的main.js(或者main.ts)中引入高德插件,代碼如下:

import Vue from 'vue'
import VueAMap from 'vue-amap'
import ElementUI from 'element-ui'

import App from './App.vue'
import router from './router'
import store from './store'
import './registerServiceWorker'

Vue.use(VueAMap)
Vue.use(ElementUI)

VueAMap.initAMapApiLoader({
  // 高德的key
  key: '你的高德key',
  // 插件集合
  plugin: [
    'AMap.Autocomplete',
    'AMap.PlaceSearch',
    'AMap.Scale',
    'AMap.OverView',
    'AMap.ToolBar',
    'AMap.MapType',
    'AMap.PolyEditor',
    'AMap.CircleEditor',
    'AMap.Geocoder',
    'AMap.Geolocation'
  ],
  // 高德 sdk 版本,默認為 1.4.4
  v: '1.4.10'
})

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

第三種畫多邊形的效果圖:

    注意:1、這種畫多邊形,開始就需要一個初始的多邊形;

       2、所以,輸入要畫多邊形范圍的地名,點擊搜索,地圖會跳轉到搜索的地方,同時得到經緯度;

       3、點“范圍繪制”時,我再方法里根據第2步的經緯度,初始了一個多邊形;

    ****隱藏彩蛋****

  下圖的 “請輸入經緯度” 可以輸入一大組的經緯度,按回車鍵,也可以畫出多邊形,在按“范圍繪制”也可以更改;(格式如下:)

 

這個格式就是復制的地圖上顯示的經緯度坐標
106.2246 , 29.59258 106.225064 , 29.593287 106.226137 , 29.593558 106.22692 , 29.593083

 

 

二、第一種畫化:使用Geolocation畫多邊形(效果是在地圖點了,才會形成多邊形)

// 新增 編輯 查看 
<template>
  <div class="point">
    <el-header></el-header>
    <div class="action-bar">
      <el-form class="inline-form" :rules="rules" ref="formData" size="small" :model="formData">
        <el-form-item label label-width="220" prop="location">
          <el-input
            :disabled="!ifFalg"
            class="name-input"
            clearable
            v-model="formData.location"
            placeholder="名稱"
            maxlength="30"
          ></el-input>
        </el-form-item>
        <el-form-item label prop="longitude">
          <el-input
            :disabled="!ifFalg"
            class="my-input"
            clearable
            v-model.number="formData.longitude"
            placeholder="經度 "
          ></el-input>
        </el-form-item>
        <el-form-item label  prop="latitude">
          <el-input
            :disabled="!ifFalg"
            class="my-input"
            clearable
            v-model.number="formData.latitude"
            placeholder="緯度"
          ></el-input>
        </el-form-item>
        <el-button class="my-button" v-if="ifFalg" type="primary" @click="save" size="small">保存</el-button>
        <el-button class="my-button" size="small" @click="close">關閉</el-button>
      </el-form>
    </div>
    <div class="map-box">
      <div class="map-tool">
        <div v-if="ifFalg">
          <el-checkbox v-model="enterType">地圖上描點</el-checkbox>
        </div>
        <!-- <el-checkbox @change="checkbox" v-model="enterType">地圖上描點</el-checkbox> -->
        <div class="longlat">
          <ul>
            <li v-for="(item, index) in lnglatpoints" :key="index">
              {{item.longitude}} , {{item.latitude}}
              <i
                v-if="ifFalg"
                class="el-icon-close"
                @click="deletes(item)"
              ></i>
            </li>
          </ul>
          <el-input
            v-if="ifFalg"
            class="my-input"
            size="small"
            clearable
            v-model="lngLat"
            @keyup.enter.native="submitEnter"
            placeholder="請輸入經緯度"
          ></el-input>
          <el-button v-if="ifFalg" size="small" @click="clear" type="primary" class="claer">清除</el-button>
        </div>
      </div>
      <div class="map" id="map">
        <el-amap
          ref="map"
          bubble
          :plugin="plugin"
          :zoom="map.zoom"
          :center="map.center"
          :events="events"
          id="amap"
        >
          <el-amap-polygon
            :events="plugin.events"
            :path="path"
            :draggable="draggable"
            fillColor="#2b83f9"
            fillOpacity="0.5"
            strokeWeight="0"
            strokeColor="#2b83f9"
            strokeOpacity="0.5"
          ></el-amap-polygon>
          <!-- <el-amap-marker  :position="marker.position" :events="plugin.events"></el-amap-marker> -->
          <el-amap-marker v-if="formData.type === 1" :position="map.center" :label="label"></el-amap-marker>
        </el-amap>
      </div>
     
    </div>
  </div>
</template>
<script lang="ts">
import * as api from '@/utils/api/index'
import { Component, Vue } from 'vue-property-decorator'
import eHeader from '@/components/header.vue'
import { constants } from 'http2'
import * as util from '@/utils/util.ts'

const testLongitude = (rule: any, value: string, callback: Function) => {
  if (util.regExp.longitudeRegExp.test(value)) {
    return callback()
  } else {
    return callback(new Error('請輸入正確的經度'))
  }
}
const testLatitude = (rule: any, value: string, callback: Function) => {
  if (util.regExp.latitudeRegExp.test(value)) {
    return callback()
  } else {
    return callback(new Error('請輸入正確的緯度'))
  }
}
@Component({
  components: {
    'el-header': eHeader
  }
})
export default class point extends Vue {
  private breadcrumbId = 0
  private id = ''
  private lngLat = ''
  private ifFalg = true
  private map = {
    zoom: 15,
    center: [106.55073, 29.56471]
  }
  private path: any = []
  private draggable = false
  private lnglatpoints: any = []
  private enterType = false // 錄入坐標 | 地圖上描點
  private cities = []
  private formData = {
    location: '',
    longitude: '',
    latitude: ''
  }
  plugin = {
    pName: 'Geolocation',
    events: {}
  }
  events = {}
  private test = 1

  private rules = {
    location: [
      { required: true, message: '請輸入接送點名稱', trigger: 'blur' }
    ],
    longitude: [{ validator: testLongitude, trigger: 'blur' }],
    latitude: [{ validator: testLatitude, trigger: 'blur' }]
  }

  mounted() {
    this.id = this.$route.params.id
    this.breadcrumbId = Number(this.$route.query.breadcrumbId)
    if (this.breadcrumbId === 2) {
      this.ifFalg = false
    }
    if (this.id !== '-1') {
      this.details()
    }

    // this.city()
    let _this: any = this

    // 地圖點擊事件
    _this.events = {
      click: (e: any) => {
        if (this.enterType) {
          this.path = []
          console.log(e.lnglat)
          let lnglat = e.lnglat
          this.lnglatpoints.push({
            latitude: lnglat.lat,
            longitude: lnglat.lng
          })
          console.log(this.lnglatpoints)
          this.lnglatpoints.map((val: any, index: number) => {
            console.log(index)
            if (index === 0) {
              this.map.center = [val.longitude, val.latitude]
            }
            let arr = [val.longitude, val.latitude]
            this.path.push(arr)
          })
          // this.setFitView()
        }
      }
    }

    // 多邊形點擊事件
    _this.plugin.events = {
      click: (e: any) => {
        if (this.enterType) {
          this.path = []
          console.log(e.lnglat)
          let lnglat = e.lnglat
          this.lnglatpoints.push({
            latitude: lnglat.lat,
            longitude: lnglat.lng
          })
          console.log(this.lnglatpoints)
          this.lnglatpoints.map((val: any, index: number) => {
            console.log(index)
            if (index === 0) {
              this.map.center = [val.longitude, val.latitude]
            }
            let arr = [val.longitude, val.latitude]
            this.path.push(arr)
          })
          // this.setFitView()
        }
      }
    }
  }// 獲取接送范圍集合
  details() {
    const loading = this.$loading({
      lock: true,
      text: '加載中...'
    })
    api.main.boss_line_point__get({ params: {param: this.id}}).then((res: any) => {
        if (res.data.success) {
          const response = res.data.data
          this.formData = response
          let points = res.data.data.points
          if (points != null) {
            for (let i = 0; i < points.length; i++) {
              points[i].id = i
            }
            this.lnglatpoints = points
            this.lnglatpoints.map((val: any, index: number) => {
              if (index === 0) {
                this.map.center = [val.longitude, val.latitude]
              }
              let arr = [val.longitude, val.latitude]
              this.path.push(arr)
            })
          } else {
            this.map.center = [
              Number(this.formData.longitude),
              Number(this.formData.latitude)
            ]
            this.label.content = this.formData.location
          }
          setTimeout(this.setFitView, 0)
        } else {
          this.$message.error(res.data.message)
        }
        loading.close()
      })
  }

  // 移除經緯度
  deletes(data: any) {
    let e: any = this
    this.path = []
    for (let i = 0; i < e.lnglatpoints.length; i++) {
      if (
        data.latitude === e.lnglatpoints[i].latitude &&
        data.longitude === e.lnglatpoints[i].longitude
      ) {
        e.lnglatpoints.splice(i, 1)
      }
    }
    console.log(e.path)
    this.lnglatpoints.map((val: any, index: number) => {
      let arr = [val.longitude, val.latitude]
      this.path.push(arr)
      if (index === 0) {
        this.map.center = [val.longitude, val.latitude]
      }
      console.log(this.path)
    })
  }

  clear() {
    this.$confirm('確認洗掉繪制的接送區域?', '洗掉', {
      confirmButtonText: '確定',
      cancelButtonText: '取消',
      type: 'warning'
    })
      .then(() => {
        let self: any = this
        this.path = []
        this.lnglatpoints = []
        // this.map.center = [106.5507300000, 29.5647100000]
        this.lngLat = ''
        self.formData.points = []
      })
      .catch(() => {})
  }

  // 輸入經緯度
  submitEnter() {
    // eslint-disable-next-line
    const illegalRegExp = /^(\D|\d*\.?\d*,*\s)|[^\d\s,\.]|^\d*\.?\d*$|(,\.|\.,)+|(\d*\.*\d*,){2,}|(\d*\.){2,}|(\d*\s){2,}|(\s\d*\.?\d*|\D)$/g
    const replaceWhiteSpaceRegExp = /(?<=(,|\.|\s))\s+|\s+(?=(,|\.))|^\s|\s+$/g

    this.lngLat = this.lngLat.replace(replaceWhiteSpaceRegExp, '')
    if (illegalRegExp.test(this.lngLat)) {
      return this.$message.error('經緯度格式錯誤!')
    }
    const lnglatArray = this.lngLat.split(' ')
    lnglatArray.forEach(lnglatString => {
      const lnglatObject = {
        longitude: lnglatString.split(',')[0],
        latitude: lnglatString.split(',')[1]
      }
      this.lnglatpoints.push(lnglatObject)
    })
    this.path = []
    this.lnglatpoints.map((val: any, index: number) => {
      let arr = [val.longitude, val.latitude]
      this.path.push(arr)
      this.lngLat = ''
      if (index === 0) {
        this.map.center = [val.longitude, val.latitude]
      }
    })
  }

  setFitView() {
    const vm: any = this
    let map = vm.$refs.map.$$getInstance()
    map.setFitView()
  }

  close() {
    this.$router.push({
      name: 'pointList'
    })
  }

  save() {
    let e: any = this
    let params: any = {}
    if (this.id !== '-1') {
      // 編輯
      e.formData.id = this.id
      params.id = this.id
    }
    e.formData.points = this.lnglatpoints
    if (e.formData.location === '' || e.formData.location === null) {
      this.$message.warning('名稱不能為空!')
      return
    }
    if (this.lnglatpoints.length < 3 && e.formData.type === 2) {
      this.$message.warning('經緯度不能小于三組!')
      return
    }
    params.points = this.lnglatpoints
    params.location = this.formData.location
    params.longitude = this.formData.longitude
    params.latitude = this.formData.latitude
    if (this.id !== '-1') {
      api.main.boss_line_point_update_post({ data: params }).then((res: any) => {
          if (res.data.success) {
            this.$message.success('保存成功!')
            this.$router.push({
              name: 'pointList'
            })
          } else {
            this.$message.error(res.data.message)
          }
        })
    } else {
      api.main
        .boss_line_point_addAndBindLine_post({ data: params })
        .then((res: any) => {
          if (res.data.success) {
            this.$message.success('保存成功!')
            this.$router.push({
              name: 'pointList'
            })
          } else {
            this.$message.error(res.data.message)
          }
        })
    }
  }
}
</script>
<style lang="scss" scoped>
ul,
li {
  list-style: none;
  margin: 0;
  padding: 0;
}
.inline-form {
  display: flex;
  display: -webkit-flex;
  flex-direction: row;
  flex-wrap: wrap;
  .el-form-item {
    margin-bottom: 10px;
    margin-left: 15px;
    display: flex;
  }
  .el-button {
    margin-left: 15px;
    height: 32px;
  }
}
.action-bar {
  box-sizing: border-box;
  padding: 10px;
  padding-bottom: 0;

  border: {
    top: 1px solid #ddd;
    bottom: 1px solid #ddd;
  }
  .my-input {
    width: 150px;
  }
  .name-input {
    width: 260px;
  }
}
.el-select-dropdown__item {
  background-color: white;
  text-indent: 10px;
}
.claer {
  margin-top: 15px;
  float: right;
}

$map_height: calc(100vh - 55px - 50px - 75px - 15px);
.map-box {
  position: relative;

  height: $map_height;
  .map-tool {
    position: absolute;
    width: 220px;
    z-index: 170;
    top: 0;
    left: 0;
    max-height: 100%;

    box-sizing: border-box;
    padding: 10px;
    overflow-y: auto;

    background-color: #fff;
    box-shadow: 2px 4px 7px 1px #dedede;
  }
  .map {
    transition: all 0.6s;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
  }
}
.swiper-box {
  position: relative;
  z-index: 161;

  display: flex;
  align-items: center;
  flex-direction: row;
  justify-content: center;

  width: 100%;

  transition: transform ease-in 0.6s;
  transform: translateX(0);
  white-space: nowrap;
  .swiper-item {
    width: 100%;
    height: $map_height;
  }
}
.hide-text-area {
  transform: translateX(-100%);
}
.gray-map {
  filter: grayscale(90%);
}
.longlat {
  margin-top: 15px;
  padding-bottom: 15px;

  ul {
    li {
      padding: 6px;
      background-color: #ddd;
      border-radius: 4px;
      margin-bottom: 15px;
      font-size: 14px;
      color: #666;
      position: relative;
    }
  }
}
.el-icon-close {
  display: inline-block;
  position: absolute;
  right: 10px;
  color: #000 !important;
  cursor: pointer;
}
.my-button {
  margin-bottom: 10px;
}
</style>

 三、第二種畫化:使用AMap.MouseTool畫多邊形(效果是:多邊形隨滑鼠左鍵點擊,多邊形直接跟著變化)

// 新增 編輯 查看 
<template>
  <div class="point">
    <el-header></el-header>
    <div class="action-bar">
      <el-form class="inline-form" :rules="rules" ref="formData" size="small" :model="formData">
        <el-form-item label  prop="location">
          <el-input
            :disabled="!ifFalg"
            class="name-input"
            clearable
            v-model="formData.location"
            placeholder="名稱"
            maxlength="30"
          ></el-input>
        </el-form-item>
        <el-form-item label  prop="longitude">
          <el-input
            :disabled="!ifFalg"
            class="my-input"
            clearable
            v-model.number="formData.longitude"
            placeholder="經度 "
          ></el-input>
        </el-form-item>
        <el-form-item label  prop="latitude">
          <el-input
            :disabled="!ifFalg"
            class="my-input"
            clearable
            v-model.number="formData.latitude"
            placeholder="緯度"
          ></el-input>
        </el-form-item>
        <el-button class="my-button" v-if="ifFalg" type="primary" @click="save" size="small">保存</el-button>
        <el-button class="my-button" size="small" @click="close">關閉</el-button>
      </el-form>
    </div>
    <div class="map-box">
      <div class="map-tool">
        <div v-if="ifFalg">
          <el-checkbox >地圖上描點</el-checkbox>
        </div>
        <div class="longlat">
          <ul><li v-for="(item, index) in lnglatpoints" :key="index">
              {{item.longitude}} , {{item.latitude}}
              <i
                v-if="ifFalg"
                
                @click="deletes(item)"
              ></i>
            </li> 
          </ul>
          <br>
          <div>
            <span >輸入范圍經緯度:</span>
           <el-input
               type="textarea"
               autosize
               placeholder="請輸入內容"
               v-model="lnglatpointsString">
            </el-input>
          </div>
          <el-button v-if="ifFalg" size="small" @click="clear1" type="primary" class="claer1">確定</el-button>
          <el-button v-if="ifFalg" size="small" @click="clear" type="primary" class="claer">清除</el-button>
        </div>
      </div>
      <div class="map" id="map">
        <el-amap
          ref="map"
          bubble
          :zoom="map.zoom"
          :center="map.center"
          :events="mapEvents"
          id="amap"
        >
          <el-amap-polygon
            :events="plugin.events"
            :path="path"
            fillColor="#2b83f9"
            fillOpacity="0.5"
            strokeWeight="0"
            strokeColor="#2b83f9"
            strokeOpacity="0.5"
          ></el-amap-polygon>
          <el-amap-marker v-if="formData.type === 1" :position="map.center" :label="label"></el-amap-marker>
        </el-amap>
    
      </div>
      <div class="my-tools">
        <el-row>
          <el-button type="primary" v-if="ifFalg" @click="drawPolygon()">滑鼠繪制</el-button>
          <el-button type="primary" v-if="ifFalg" @click="polygonEditor.close()">結束編輯</el-button>
        </el-row>
    </div>
    </div>
  </div>
</template>
<script lang="ts">同上
 /**
   * 繪制多邊形 
   */
  private drawPolygon () {
         let vm: any = this
         let map = vm.$refs.map.$$getInstance()
         map.plugin(['AMap.MouseTool'], function () {
           var mouseTool = new AMap.MouseTool(map)
          var drawPolygon = mouseTool.polygon()
           AMap.event.addListener(mouseTool, 'draw', function (e: any) {
             e.obj.Je.visible = false
             let path = e.obj.getPath()
                vm.drawPolygonsToMap(path)
              
               path.forEach((point:any) => {
                    vm.lnglatpoints.push({
                      latitude: point.lat,
                     longitude: point.lng
                    })
               });
               // vm.mapDates =path  
               // e.obj.hide()
               mouseTool.close()
           })
         })
       
  }
同上
}
</script>
<style lang="scss" scoped>
和上面一樣
</style>

三、第三種畫化:使用AMap.Polygon和AMap.PolyEditor畫多邊形(推薦,效果是:https://lbs.amap.com/api/javascript-api/example/overlayers/polygon-draw-and-edit)

  注意哦:1、以為這種畫多邊形,先需要3個點來確定初始的多邊形,所以添加了一個功能:搜索 (功能:點擊搜索名稱的經緯度;);

      2、然后我再 ‘范圍繪制’ 的方法里根據“搜索”得來的經緯度,手動的弄了3個經緯度陣列,

      3、然后就可以快樂的畫圖了,(這畫圖是真的方便,特別是畫范圍很復雜的)

// 新增 編輯 查看 
<template>
  <div class="point">
    <el-header></el-header>
    <div class="action-bar">
      <el-form class="inline-form" :rules="rules" ref="formData" size="small" :model="formData">
        <el-form-item label  prop="location">
          <el-input
            :disabled="!ifFalg"
            class="name-input"
            clearable
            v-model="formData.location"
            placeholder="名稱"
            maxlength="30"
          ></el-input>
        </el-form-item>
     <el-button   type="info" @click="getLocation" size="small">搜索</el-button>
<el-form-item label prop="longitude"> <el-input :disabled="!ifFalg" class="my-input" clearable v-model.number="formData.longitude" placeholder="經度 " ></el-input> </el-form-item> <el-form-item label prop="latitude"> <el-input :disabled="!ifFalg" class="my-input" clearable v-model.number="formData.latitude" placeholder="緯度" ></el-input> </el-form-item> <el-button class="my-button" v-if="ifFalg" type="primary" @click="save" size="small">保存</el-button> <el-button class="my-button" size="small" @click="close">關閉</el-button> </el-form> </div> <div class="map-box"> <div class="map-tool"> <div v-if="ifFalg"> <el-checkbox >地圖上描點</el-checkbox> </div> <div class="longlat"> <ul> <li v-for="(item, index) in lnglatpoints" :key="index"> {{item.longitude}} , {{item.latitude}} <i v-if="ifFalg" class="el-icon-close" @click="deletes(item)" ></i> </li> </ul> <br> <div> <span >輸入范圍經緯度:</span> <el-input type="textarea" autosize placeholder="請輸入內容" v-model="lnglatpointsString"> </el-input> </div> <el-button v-if="ifFalg" size="small" @click="clear1" type="primary" class="claer1">確定</el-button> <el-button v-if="ifFalg" size="small" @click="clear" type="primary" class="claer">清除</el-button> </div> </div> 同上 <div class="my-tools"> <el-row> <el-button type="primary" v-if="ifFalg" @click="drawPolygon()">滑鼠繪制</el-button> <el-button type="primary" v-if="ifFalg" @click="polygonEditor.close()">結束編輯</el-button> </el-row> </div> </div> </div> </template> <script lang="ts"> 同上
//畫多邊形    private drawPolygon(){     let vm: any = this     if (vm.formData.location === '' || vm.formData.location === null) {       this.$message.warning('請先輸入名稱,才能開始畫范圍!')       return     }     let  map = new AMap.Map("map", {         center:[106.55073, 29.56471],         zoom: 15     });      // 多邊形覆寫物節點坐標陣列     let polygonArr:any = []      let lng = Number(this.formData.longitude)      let lat = Number(this.formData.latitude)      if(vm.path.length > 0){         polygonArr = vm.path     }else{        polygonArr.push([lng, lat])        polygonArr.push([lng, lat - 0.001])        polygonArr.push([lng - 0.001, lat - 0.001])     }        //使用 AMap.Polygon構建多邊形     let polygon = new AMap.Polygon({         path:polygonArr,         strokeColor: "#FF33FF",          strokeWeight: 6,         strokeOpacity: 0.2,         fillOpacity: 0.4,         fillColor: '#1791fc',         zIndex: 50,     })     //將多邊形增加到地圖上     map.add(polygon)     // 縮放地圖到合適的視野級別     map.setFitView([ polygon ])     //構造折線編輯物件,并開啟折線的編輯狀態     map.plugin(["AMap.PolyEditor"],function(){      let polygonEditor = new AMap.PolyEditor(map,polygon);          vm.polygonEditor =polygonEditor         polygonEditor.open();        //關閉多邊形編輯polygonEditor.close()觸發該方法;        polygonEditor.on('end', function(event:any) {         // event.target 即為編輯后的多邊形物件,event.target.getPath()得到編輯完成后的點陣列         let pointArr = event.target.getPath()         vm.lnglatpoints = []         pointArr.forEach((point:any)=>{           vm.lnglatpoints.push({latitude: point.lat,longitude: point.lng})         })      vm.path = []         vm.lnglatpoints.map((val: any, index: number) => {        let arr = [val.longitude, val.latitude]        vm.path.push(arr)        if (index === 0) {         vm.map.center = [val.longitude, val.latitude]        }      })     })     });   }   /**    * 地理編碼(地址 -> 坐標)    */   private getLocation () {    let loc = this.formData.location     AMap.plugin('AMap.Geocoder', () => {       let geocoder = new AMap.Geocoder()       geocoder.getLocation(loc, (status: string, result: any) => {         if (status === 'complete' && result.info === 'OK') {           let { lat, lng } = result.geocodes[0].location           if (lat && lng) {             this.map.center = [lng, lat]             this.formData.longitude=lng             this.formData.latitude=lat           }         }       })     })   }


  同上
}
</script>
<style lang="scss" scoped>
和上面一樣
</style>

 

123

轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/5419.html

標籤:Html/Css

上一篇:小米官網輪播圖

下一篇:HTML基礎-01

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • IEEE1588PTP在數字化變電站時鐘同步方面的應用

    IEEE1588ptp在數字化變電站時鐘同步方面的應用 京準電子科技官微——ahjzsz 一、電力系統時間同步基本概況 隨著對IEC 61850標準研究的不斷深入,國內外學者提出基于IEC61850通信標準體系建設數字化變電站的發展思路。數字化變電站與常規變電站的顯著區別在于程序層傳統的電流/電壓互 ......

    uj5u.com 2020-09-10 03:51:52 more
  • HTTP request smuggling CL.TE

    CL.TE 簡介 前端通過Content-Length處理請求,通過反向代理或者負載均衡將請求轉發到后端,后端Transfer-Encoding優先級較高,以TE處理請求造成安全問題。 檢測 發送如下資料包 POST / HTTP/1.1 Host: ac391f7e1e9af821806e890 ......

    uj5u.com 2020-09-10 03:52:11 more
  • 網路滲透資料大全單——漏洞庫篇

    網路滲透資料大全單——漏洞庫篇漏洞庫 NVD ——美國國家漏洞庫 →http://nvd.nist.gov/。 CERT ——美國國家應急回應中心 →https://www.us-cert.gov/ OSVDB ——開源漏洞庫 →http://osvdb.org Bugtraq ——賽門鐵克 →ht ......

    uj5u.com 2020-09-10 03:52:15 more
  • 京準講述NTP時鐘服務器應用及原理

    京準講述NTP時鐘服務器應用及原理京準講述NTP時鐘服務器應用及原理 安徽京準電子科技官微——ahjzsz 北斗授時原理 授時是指接識訓通過某種方式獲得本地時間與北斗標準時間的鐘差,然后調整本地時鐘使時差控制在一定的精度范圍內。 衛星導航系統通常由三部分組成:導航授時衛星、地面檢測校正維護系統和用戶 ......

    uj5u.com 2020-09-10 03:52:25 more
  • 利用北斗衛星系統設計NTP網路時間服務器

    利用北斗衛星系統設計NTP網路時間服務器 利用北斗衛星系統設計NTP網路時間服務器 安徽京準電子科技官微——ahjzsz 概述 NTP網路時間服務器是一款支持NTP和SNTP網路時間同步協議,高精度、大容量、高品質的高科技時鐘產品。 NTP網路時間服務器設備采用冗余架構設計,高精度時鐘直接來源于北斗 ......

    uj5u.com 2020-09-10 03:52:35 more
  • 詳細解讀電力系統各種對時方式

    詳細解讀電力系統各種對時方式 詳細解讀電力系統各種對時方式 安徽京準電子科技官微——ahjzsz,更多資料請添加VX 衛星同步時鐘是我京準公司開發研制的應用衛星授時時技術的標準時間顯示和發送的裝置,該裝置以M國全球定位系統(GLOBAL POSITIONING SYSTEM,縮寫為GPS)或者我國北 ......

    uj5u.com 2020-09-10 03:52:45 more
  • 如何保證外包團隊接入企業內網安全

    不管企業規模的大小,只要企業想省錢,那么企業的某些服務就一定會采用外包的形式,然而看似美好又經濟的策略,其實也有不好的一面。下面我通過安全的角度來聊聊使用外包團的安全隱患問題。 先看看什么服務會使用外包的,最常見的就是話務/客服這種需要大量重復性、無技術性的服務,或者是一些銷售外包、特殊的職能外包等 ......

    uj5u.com 2020-09-10 03:52:57 more
  • PHP漏洞之【整型數字型SQL注入】

    0x01 什么是SQL注入 SQL是一種注入攻擊,通過前端帶入后端資料庫進行惡意的SQL陳述句查詢。 0x02 SQL整型注入原理 SQL注入一般發生在動態網站URL地址里,當然也會發生在其它地發,如登錄框等等也會存在注入,只要是和資料庫打交道的地方都有可能存在。 如這里http://192.168. ......

    uj5u.com 2020-09-10 03:55:40 more
  • [GXYCTF2019]禁止套娃

    git泄露獲取原始碼 使用GET傳參,引數為exp 經過三層過濾執行 第一層過濾偽協議,第二層過濾帶引數的函式,第三層過濾一些函式 preg_replace('/[a-z,_]+\((?R)?\)/', NULL, $_GET['exp'] (?R)參考當前正則運算式,相當于匹配函式里的引數 因此傳遞 ......

    uj5u.com 2020-09-10 03:56:07 more
  • 等保2.0實施流程

    流程 結論 ......

    uj5u.com 2020-09-10 03:56:16 more
最新发布
  • 使用Django Rest framework搭建Blog

    在前面的Blog例子中我們使用的是GraphQL, 雖然GraphQL的使用處于上升趨勢,但是Rest API還是使用的更廣泛一些. 所以還是決定回到傳統的rest api framework上來, Django rest framework的官網上給了一個很好用的QuickStart, 我參考Qu ......

    uj5u.com 2023-04-20 08:17:54 more
  • 記錄-new Date() 我忍你很久了!

    這里給大家分享我在網上總結出來的一些知識,希望對大家有所幫助 大家平時在開發的時候有沒被new Date()折磨過?就是它的諸多怪異的設定讓你每每用的時候,都可能不小心踩坑。造成程式意外出錯,卻一下子找不到問題出處,那叫一個煩透了…… 下面,我就列舉它的“四宗罪”及應用思考 可惡的四宗罪 1. Sa ......

    uj5u.com 2023-04-20 08:17:47 more
  • 使用Vue.js實作文字跑馬燈效果

    實作文字跑馬燈效果,首先用到 substring()截取 和 setInterval計時器 clearInterval()清除計時器 效果如下: 實作代碼如下: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta ......

    uj5u.com 2023-04-20 08:12:31 more
  • JavaScript 運算子

    JavaScript 運算子/運算子 在 JavaScript 中,有一些運算子可以使代碼更簡潔、易讀和高效。以下是一些常見的運算子: 1、可選鏈運算子(optional chaining operator) ?.是可選鏈運算子(optional chaining operator)。?. 可選鏈操 ......

    uj5u.com 2023-04-20 08:02:25 more
  • CSS—相對單位rem

    一、概述 rem是一個相對長度單位,它的單位長度取決于根標簽html的字體尺寸。rem即root em的意思,中文翻譯為根em。瀏覽器的文本尺寸一般默認為16px,即默認情況下: 1rem = 16px rem布局原理:根據CSS媒體查詢功能,更改根標簽的字體尺寸,實作rem單位隨螢屏尺寸的變化,如 ......

    uj5u.com 2023-04-20 08:02:21 more
  • 我的第一個NPM包:panghu-planebattle-esm(胖虎飛機大戰)使用說明

    好家伙,我的包終于開發完啦 歡迎使用胖虎的飛機大戰包!! 為你的主頁添加色彩 這是一個有趣的網頁小游戲包,使用canvas和js開發 使用ES6模塊化開發 效果圖如下: (覺得圖片太sb的可以自己改) 代碼已開源!! Git: https://gitee.com/tang-and-han-dynas ......

    uj5u.com 2023-04-20 08:01:50 more
  • 如何在 vue3 中使用 jsx/tsx?

    我們都知道,通常情況下我們使用 vue 大多都是用的 SFC(Signle File Component)單檔案組件模式,即一個組件就是一個檔案,但其實 Vue 也是支持使用 JSX 來撰寫組件的。這里不討論 SFC 和 JSX 的好壞,這個仁者見仁智者見智。本篇文章旨在帶領大家快速了解和使用 Vu ......

    uj5u.com 2023-04-20 08:01:37 more
  • 【Vue2.x原始碼系列06】計算屬性computed原理

    本章目標:計算屬性是如何實作的?計算屬性快取原理以及洋蔥模型的應用?在初始化Vue實體時,我們會給每個計算屬性都創建一個對應watcher,我們稱之為計算屬性watcher ......

    uj5u.com 2023-04-20 08:01:31 more
  • http1.1與http2.0

    一、http是什么 通俗來講,http就是計算機通過網路進行通信的規則,是一個基于請求與回應,無狀態的,應用層協議。常用于TCP/IP協議傳輸資料。目前任何終端之間任何一種通信方式都必須按Http協議進行,否則無法連接。tcp(三次握手,四次揮手)。 請求與回應:客戶端請求、服務端回應資料。 無狀態 ......

    uj5u.com 2023-04-20 08:01:10 more
  • http1.1與http2.0

    一、http是什么 通俗來講,http就是計算機通過網路進行通信的規則,是一個基于請求與回應,無狀態的,應用層協議。常用于TCP/IP協議傳輸資料。目前任何終端之間任何一種通信方式都必須按Http協議進行,否則無法連接。tcp(三次握手,四次揮手)。 請求與回應:客戶端請求、服務端回應資料。 無狀態 ......

    uj5u.com 2023-04-20 08:00:32 more