高德地图API-设置考勤范围
<template>
<div class="page-setting-setgps">
<!--head-->
<div class="header" > </div>
<!--tab-->
<div class="tab">
<group gutter="0" ref="search1">
<search :auto-fixed="false" position="fixed" v-model="searchValue" placeholder="搜索地点" @on-focus="onFocus" @on-submit="onSubmit" ref="search"></search>
</group>
<group gutter="0" ref="map">
<div class="amap-wrapper" id="imap">
<!--<el-amap ref="map" id="imap" vid="amapDemo" :zoom="12" resizeEnable="true" :plugin="plugin" :center="mapCenter" class="amap-box" :events="events">-->
<!--<el-amap-marker v-for="(marker,index) in markers" :key="index" :position="marker" icon="resource/img/gps_mark.png" animation="AMAP_ANIMATION_DROP"></el-amap-marker>-->
<!--</el-amap>-->
<div class="panel" style="text-align: center;" v-show="!map">
<div class="panel-box panel-box_attend" style="height: 50vh" @click="createMap">
<div class="panel-box_bd">
<p class="panel-box_desc"><img src="resource/img/attend/gps2.png" class="panel-box_img" style="width: 1rem"/><br/>{{mapdesc}}</p>
</div>
</div>
</div>
</div>
</group> <Loading v-show="isLoading" text="数据加载中"></Loading> <group ref="mapList" gutter="0" v-show="pois.length>0" class="mont-list group-cell-label-cls">
<cell v-for="(i,index) in pois" :key="index" :title="i.name" class="" @click.native="beforeConfirm(i,index)" >
<img v-show="showIndex == index" class="icon-del" src="resource/img/attend/icon_common_select@2x.png"/>
</cell>
</group> <!--<group gutter="0.1rem">-->
<!--<x-button mini type="primary" @click.native="initMap">初始化地图</x-button>-->
<!--<x-button mini type="primary" @click.native="initAmap">加载地图</x-button>-->
<!--</group>--> <!--<div id="imap" style="width: 100vw;height: 300px"></div>--> <slot>
<div class="topTips" v-if="pois.length==0" >
<div class="panel" style="text-align: center">
<div class="panel-box panel-box_attend">
<div class="panel-box_bd">
<p class="panel-box_desc">暂无地址记录</p>
</div>
</div>
</div>
</div>
</slot>
<!--<cell @click.native="showConfirmPlugin2" value="showConfirmPlugin"></cell>-->
<div v-transfer-dom>
<confirm v-model="showConfirm"
class="gpsConfirm"
title="考勤范围名称"
ref="confirm"
@on-cancel="onCancel"
@on-confirm="onConfirm"
@on-show="onShow"
@on-hide="onHide">
<input class="mont-input" type="text" maxlength="150" placeholder="请输入考勤范围名称" v-model="montName" />
</confirm>
</div>
</div>
</div>
</template> <script>
import { registerHandler, notifyAppBackEvent, LocationObserverFunction} from '../../../lib/common/SnJsBridge.js';
import { throttle, initTitleMenu, showToast,isPC } from '../../../lib/extend.js';
import { Group, Cell, Search, Confirm, XButton,TransferDom,Loading } from 'vux';
// import SnLoading from '../../../components/baseComponents/SnLoading.vue';
import Vue from 'vue'
import VueAMap from 'vue-amap';
Vue.use(VueAMap);
window.initAmap = function () {
Vue.data.map = new AMap.Map('imap', {
// center: [114.424170, 30.463359],
zoom: 12
});
Vue.data.map.plugin(['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor','AMap.CitySearch','AMap.Geolocation','AMap.Geocoder']);
}; export default {
components: {
Group,
Cell,
Search,
Confirm,
XButton,
Loading
},
directives: {
TransferDom
},
data() {
return {
markers: [],
city:'',
mapCenter:'',
results: [],
value: '',
pois:[],
searchValue:'',
attenGroupInfo:'',
// gpsChecked:[]
showConfirm:false,
selectPoi:'',
montName:'',
map:null,
mapdesc:'',
nowCity:'', //当前城市名
isLoading:true,
PcGpsData:'', //PC当前定位信息
nowGps:[], //当前定位经纬度
geocoder:'',
showIndex:0, //初始对号显示
marker:'', //初始化marker
markerSearch:'', //搜索时marker
circle:'', //初始化图层(圆)
circleSearch:'', //搜索时图层(圆)
circleRadius:100 //半径 默认100
}
},
created() {
let _this = this;
_this.init();
initTitleMenu(['位置',{name:'刷新',menuId:'but_2_0',type: 2,func:function(){_this.refresh();}}]);
},
computed: {
gpsChecked: {
get() {
return this.$store.state.monetList;
}
},
},
mounted() {
let _this = this;
_this.createMap();
_this.setMapListHeight()
},
methods: {
init(){
let _this = this;
_this.dataInit();
notifyAppBackEvent(); //调用app,通知返回事件
registerHandler('notifyAppBack', function(data){//点击app返回事件
throttle(function(){
//_this.$router.goBack();//回退上一页
_this.$router.isBack = true;
_this.$router.push({ name: 'setting'})
}.bind(this));
})
},
// 数据初始化 , 从APP获取数据
dataInit: function() {
let _this = this;
_this.gpsChecked = _this.$store.state.monetList;
if(!isPC()){
_this.getLocationInfo();
}
},
//获取当前定位信息
getLocationInfo(){
let _this = this;
// 实时监听gps信息
LocationObserverFunction({observerType: 0});
if(isPC()){
let PcGps = _this.PcGpsData
// console.log('PcGps :', PcGps);
let locationInfo={
longitude:PcGps.position.lng,
latitude:PcGps.position.lat,
regionName:PcGps.formattedAddress
}
let cityName = locationInfo.regionName
_this.searchMap(cityName)
_this.setMapCenter([locationInfo.longitude,locationInfo.latitude])
}else{
registerHandler('LocationNotify', function (result) {
// console.log('result :', result);
if (JSON.parse(result).retCode == 0) {
let locationInfo = JSON.parse(result).data;
let cityName = locationInfo.regionName
_this.searchMap(cityName)
_this.nowCity = locationInfo.cityName
_this.setMapCenter([locationInfo.longitude,locationInfo.latitude]);
}
}.bind(this));
}
},
openRouter(name){
let _this = this;
_this.$router.push({ name: name });
//this.$router.push({ name: name, })
},
onSearchResult(pois) {
console.log(pois);
let _this = this
let latSum = 0;
let lngSum = 0;
if (pois.length > 0) {
this.markers = [];//清空
this.map.clearMap();//清空
// pois.forEach(poi,key => {
// let {lng, lat} = poi.location;
// lngSum += lng;
// latSum += lat;
// this.markers.push([poi.location.lng, poi.location.lat]);
// var marker = new AMap.Marker({
// // content:poi.name,
// position: new AMap.LngLat(poi.location.lng, poi.location.lat),
// title: 'marker'
// });
// this.map.add(marker);
// });
this.markers.push([pois[0].location.lng, pois[0].location.lat]);
//--------搜索时,绘制marker-----------
_this.markerSearch = new AMap.Marker({
// content:poi.name,
position: new AMap.LngLat(pois[0].location.lng, pois[0].location.lat),
title: 'marker'
});
this.map.add(_this.markerSearch);
let center = {
// lng: lngSum / pois.length,
// lat: latSum / pois.length,
lng: pois[0].location.lng,
lat: pois[0].location.lat
};
// console.log('this.mapCenter :', this.mapCenter);
this.mapCenter = [center.lng, center.lat];//移动map中心
this.map.setCenter(this.mapCenter);
this.pois = pois;
_this.isLoading = false
//--------搜索时,绘制图层(圆)-----------
let nowGps = _this.mapCenter.length==0? [114.424529, 30.463046]:_this.mapCenter
_this.circleSearch = new AMap.Circle({
center: nowGps,
radius: _this.circleRadius, //半径
borderWeight: 3,
strokeColor: "rgba(0,0,0,0)",
strokeOpacity: 1,
strokeWeight: 6,
strokeOpacity: 0.2,
fillOpacity: 0.4,
strokeStyle: 'solid',
strokeDasharray: [10, 10],
// 线样式还支持 'dashed'
fillColor: '#1791fc',
zIndex: 50,
})
_this.circleSearch.setMap(_this.map) } },
//GPS事件
//search end
searchMap(val){
let _this = this;
let placeSearch= new AMap.PlaceSearch({
city:_this.nowCity
});
let search = this.searchValue == ''?val:this.searchValue
if(search instanceof Array){
// console.log('上 :');
placeSearch.searchNearBy('',search,500,function(status, result) {
// console.log(status,result);
if('OK'==result.info&&result.poiList.pois.length>0){
_this.onSearchResult(result.poiList.pois)
}else{
_this.pois = [];
_this.markers = [];
}
})
}else{
// console.log('下 :');
placeSearch.search(search,function(status, result){
// console.log(status,result);
if('OK'==result.info&&result.poiList.pois.length>0){
_this.onSearchResult(result.poiList.pois)
}else{
_this.pois = [];
_this.markers = [];
}
})
} },
setCircle(){
let _this = this
let nowGps = _this.mapCenter.length==0? [114.424529, 30.463046]:_this.mapCenter
_this.circle = new AMap.Circle({
center: nowGps,
radius: _this.circleRadius, //半径
borderWeight: 3,
strokeColor: "rgba(0,0,0,0)",
strokeOpacity: 1,
strokeWeight: 6,
strokeOpacity: 0.2,
fillOpacity: 0.4,
strokeStyle: 'solid',
strokeDasharray: [10, 10],
// 线样式还支持 'dashed'
fillColor: '#1791fc',
zIndex: 50,
})
_this.circle.setMap(_this.map)
// _this.map.setFitView([ circle ])
},
searchCity(){
let _this = this
var citySearch = new AMap.CitySearch()
citySearch.getLocalCity(function (status, result) {
if (status === 'complete' && result.info === 'OK') {
_this.nowCity = result.city
console.group('1 :', 1);
console.log(status,result);
// 查询成功,result即为当前所在城市信息
}
})
},
beforeConfirm(poi,index){
let _this = this;
_this.showIndex = index
_this.selectPoi = poi;
_this.showConfirm = true;
_this.markerSearch.setPosition(new AMap.LngLat(poi.location.lng,poi.location.lat)) //选择列表时,设置marker位置
_this.map.setCenter([poi.location.lng,poi.location.lat])
_this.mapCenter = [poi.location.lng,poi.location.lat]
_this.circleSearch.setCenter(new AMap.LngLat(poi.location.lng,poi.location.lat)) //选择列表时,设置图层(圆)位置
},
onShow(){
let _this = this;
//_this.$refs.confirm.setInputValue(_this.selectPoi.name);
_this.montName = _this.selectPoi.name;
//this.$refs['confirmFocus'].focus()
},
onHide(){
let _this = this;
console.log('onHide :');
},
onConfirm(value){
let _this = this;
if(!_this.montName){
showToast('请输入考勤范围名称');
return false;
}else{
//判断是否已有该地址经纬度
let gpsAddFlag = true;
//校验wifi mac是否重复
_this.gpsChecked.forEach(i=>{
if(i.longitude == _this.selectPoi.location.lng.toFixed(6)*10e5&&i.dimension == _this.selectPoi.location.lat.toFixed(6)*10e5){
showToast('已设置该考勤地点,请添加其他地点');
gpsAddFlag = false;
}
});
if(!!gpsAddFlag){
_this.addGps(_this.selectPoi, _this.montName);
}
} },
addGps(poi, value){
let _this = this;
let newPoi = {
//id:poi.id,
longitude:poi.location.lng.toFixed(6)*10e5,
dimension:poi.location.lat.toFixed(6)*10e5,
address:poi.address,
regionName:value||poi.name,
radius:500
};
_this.gpsChecked.push(newPoi);
//let monetList = _this.uniqueArray(_this.$store.state.monetList, newPoi);
_this.$store.commit('updateChangeflag');
_this.$store.commit('updateMonetList', _this.gpsChecked);
_this.$router.isBack = true;
_this.$router.push({ name: 'setting' })
},
//搜索框事件
onSubmit () {
let _this = this
_this.$refs.search.setBlur();
_this.showIndex = 0;
_this.searchMap()
console.log('on Submit')
},
onFocus () {
let _this = this
_this.searchCity();
console.log('on focus')
},
onCancel () {
console.log('on cancel')
},
refresh(){
//该方法安卓会重新打开一个页面,暂时不用this.$router.go(0);
let _this = this;
_this.pois = [];
_this.markers = [];
_this.searchValue = '';
_this.$refs.search.setBlur();
_this.dataInit();
},
//判断已选择的是否存在
uniqueArray(arr, poi){
let res = [];
// var json = {}; for(var i = 0; i < arr.length; i++){
if( arr[i].id == poi.id ){
//已存在
console.log('已存在')
}else{
res.push(arr[i]);
}
}
if(arr.length == 0){
res[0] = poi ;
}
return res;
},
//初始化设置地图中心
setMapCenter(data){
this.mapCenter = data;
this.map.setZoomAndCenter(14, data);
LocationObserverFunction({observerType: 1});
},
createMap(){
let _this = this;
// _this.initMap();
_this.clickMap();
// _this.initAmap()
_this.mapdesc = '';
setTimeout(()=>{
_this.mapdesc = '载入地图失败,点击重新载入';
_this.initAmap();
},1500)
},
//初始化地图 //无用
initMap(){
VueAMap.initAMapApiLoader({
key: '6dc72bbbc2824a9295b256b8330ae7ef',
plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor','AMap.CitySearch','AMap.Geolocation','AMap.Geocoder'],
v: '1.4.4'
});
},
//初始化高德地图
initAmap(){
let _this = this;
if(!_this.map){
// console.log('_this.mapCenter :', _this.mapCenter);
_this.map = new AMap.Map('imap', {
// center: _this.mapCenter,
zoom: 12
});
_this.map.plugin(['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor','AMap.CitySearch','AMap.Geolocation','AMap.Geocoder'],function(){
var geolocation = new AMap.Geolocation({
// 是否使用高精度定位,默认:true
enableHighAccuracy: true,
// 设置定位超时时间,默认:无穷大
timeout: 10000,
// 定位按钮的停靠位置的偏移量,默认:Pixel(10, 20)
buttonOffset: new AMap.Pixel(10, 20),
// 定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
zoomToAccuracy: true,
// 定位按钮的排放位置, RB表示右下
buttonPosition: 'RB'
}) geolocation.getCurrentPosition()
AMap.event.addListener(geolocation, 'complete', _this.onComplete)
AMap.event.addListener(geolocation, 'error', _this.onError)
});
_this.map.on('dragstart',function(){
_this.nowGps=[];
let nowCenter = _this.map.getCenter() //获取当前坐标经纬度
let nowLng = Number(nowCenter.lng);
let nowlat = Number(nowCenter.lat);
_this.nowGps.push(nowLng)
_this.nowGps.push(nowlat)
_this.getRadiusGps(_this.nowGps) //设置默认城市,设置中心marker
_this.searchValue =''
// console.log('12121 :', 'circle之前');
_this.setCircle() //设置中心图层(圆)
_this.map.on('dragging',function(){
_this.nowGps=[];
let nowCenter = _this.map.getCenter()
let nowLng = Number(nowCenter.lng);
let nowlat = Number(nowCenter.lat);
_this.nowGps.push(nowLng)
_this.nowGps.push(nowlat)
// console.log('_this.marker.getPosition() :', _this.marker.getPosition());
_this.marker.setPosition(new AMap.LngLat(nowLng,nowlat)) //使marker跟随,推拽移动
_this.circle.setCenter(new AMap.LngLat(nowLng,nowlat)) //使图层(圆)跟随,拖拽移动
// console.log('_this.nowGps :', _this.nowGps);
})
})
_this.map.on('dragend',function () {
_this.showIndex = 0;
_this.searchMap(_this.nowGps) //拖拽结束 搜索当前坐标点信息
})
}
},
//设置默认城市,设置中心marker
getRadiusGps(val){
let _this =this;
_this.geocoder = new AMap.Geocoder({
city: _this.nowCity, //城市设为北京,默认:“全国”
radius: 500 //范围,默认:500
});
_this.markers = [];//清空
_this.map.clearMap();//清空
_this.markers.push(val);
_this.marker = new AMap.Marker({
// content:poi.name,
position: new AMap.LngLat(val[0],val[1]),
title: 'marker'
});
_this.map.add(_this.marker);
},
//PC获取当前坐标经纬度,成功时
onComplete(data){
// console.log('1data :', data);
let _this = this
_this.PcGpsData = data
_this.getLocationInfo()
},
//PC获取当前坐标经纬度,失败时
onError(err){
console.log('1err :', err);
},
//初始化地图
clickMap(){
var url = '//webapi.amap.com/maps?v=1.4.6&key=6dc72bbbc2824a9295b256b8330ae7ef&callback=initAmap';
var jsapi = document.createElement('script');
jsapi.charset = 'utf-8';
jsapi.src = url;
document.head.appendChild(jsapi);
},
//动态设置列表高度
setMapListHeight(){
let _this = this
let searchHeight = _this.$refs.search1.$el.offsetHeight
let mapHeight = _this.$refs.map.$el.offsetHeight
let Height = searchHeight+mapHeight+'px'
_this.$refs.mapList.$el.style.height =` calc(100vh - ${Height})`;
}
},
watch:{
PcGpsData(newValue,oldValue){ }
}
}
</script>
<style scoped lang="less">
@import '~components/style/common.less';
.header{
border-top:0; }
.tab{
//background: @color-white;
overflow: hidden;
.amap-wrapper {
width: 100%;
height: 50vh;
}
.mont-list{
overflow-y: scroll;
height:50vh;
}
.mont-input{
font-size: 1.2rem;
padding: .5rem;
width: 85%;
box-sizing: content-box;
background: transparent;
border: 1px solid #e2e3e4;
border-radius: 5px;
}
.panel{
font-size: 1rem;
.panel-box {
padding: 15px;
position: relative;
}
.panel-box_attend {
display: flex;
align-items: center;
.panel-box_hd {
margin-right: .8em;
width: 60px;
height: 60px;
line-height: 60px;
text-align: center;
}
.panel-box_bd {
flex: 1;
min-width: 0;
}
.panel-box_img {
width: 100%;
max-height: 100%;
vertical-align: top;
border-radius: .4rem;
}
.panel-box_title {
font-weight: 400;
width: auto;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-wrap: normal;
word-wrap: break-word;
word-break: break-all;
}
.panel-box_day{
text-align: right;
margin-right: .32rem;
color:@color-blue;
}
}
.panel-box_desc {
color: #999999;
font-size: 13px;
line-height: 1.2;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.panel-box_time{
flex: 1;
-webkit-flex: 1;
display: -webkit-box;
display: -webkit-flex;
display: flex; }
.box_time {
padding-top: 0.2rem;
}
.box_icon {
/*position: absolute;*/
/*right: 0.2rem;*/
/*top: 0.45rem;*/
/*text-align: right;*/
/*width: 0.4rem;*/
}
.box_icon_img {
width: 0.6rem;
}
.set-tips{
position: relative;
display: flex;
align-items: center;
padding: 15px 0;
color: @color-blue;
label {
/*width: 2rem;*/
height: 2rem;
line-height: 2.5rem;
margin: 0 .5rem 0 1rem;
display: block;
word-wrap: break-word;
word-break: break-all;
img{
width: 1.3rem;
}
}
}
}
.bdtop{
border-top: 1px solid #dddddd;
}
.icon-del{
width: 1rem;
}
.mgbtm{
margin-bottom: .5rem;
}
}
.list{
margin-top: 0.32rem;
padding-bottom: 3.5rem;
}
</style> <style lang="less">
div .weui-dialog__btn_primary {
color: #478aee;
}
.page-setting-setgps {
div .weui-cell {
padding: 14px 15px;
border-bottom: 1px solid #D1D1D1;
&:before {
border-top: 0;
}
}
.weui-search-bar__form {
font-size: 22px;
}
.weui-search-bar__box .weui-icon-search{
line-height: 32px;
}
.weui-search-bar__box .weui-search-bar__input {
padding: 0;
} }
</style>
高德地图API-设置考勤范围的更多相关文章
- 高德地图API应用
高德地图官网:http://api.amap.com/javascript/ 输入关键字,搜索地址功能的网页: 1.引用远程Map Api(js)网址形式(注册后获取) 2.定义个<div> ...
- 【高德地图API】如何解决坐标转换,坐标偏移?
http://bbs.amap.com/thread-18617-1-1.html#rd?sukey=cbbc36a2500a2e6c2b0b19115118ace519002ff3a52731f13 ...
- 【高德地图API】汇润做爱地图技术大揭秘
原文:[高德地图API]汇润做爱地图技术大揭秘 昨日收到了高德地图微信公众号的消息推送,说有[一大波免费情趣用品正在袭来],点进去看了一眼,说一个电商公司(估计是卖情趣用品的)用高德云图制作了一张可以 ...
- 【高德地图API】从零开始学高德JS API(七)——定位方式大揭秘
原文:[高德地图API]从零开始学高德JS API(七)——定位方式大揭秘 摘要:关于定位,分为GPS定位和网络定位2种.GPS定位,精度较高,可达到10米,但室内不可用,且超级费电.网络定位,分为w ...
- 【高德地图API】从零开始学高德JS API(六)——坐标转换
原文:[高德地图API]从零开始学高德JS API(六)——坐标转换 摘要:如何从GPS转到谷歌?如何从百度转到高德?这些都是小case.我们还提供,如何将基站cell_id转换为GPS坐标? --- ...
- 【高德地图API】如何获得行政区域?如何制作行政规划图?
原文:[高德地图API]如何获得行政区域?如何制作行政规划图? 什么是行政规划图?如何获得每个行政区域的边界轮廓图?举例:重庆市 江北区.如图: 官方类参考:http://developer.amap ...
- 【高德地图API】从零开始学高德JS API(四)搜索服务——POI搜索|自动完成|输入提示|行政区域|交叉路口|自有数据检索
原文:[高德地图API]从零开始学高德JS API(四)搜索服务——POI搜索|自动完成|输入提示|行政区域|交叉路口|自有数据检索 摘要:地图服务,大家能想到哪些?POI搜素,输入提示,地址解析,公 ...
- 【高德地图API】从零开始学高德JS API(三)覆盖物——标注|折线|多边形|信息窗口|聚合marker|麻点图|图片覆盖物
原文:[高德地图API]从零开始学高德JS API(三)覆盖物——标注|折线|多边形|信息窗口|聚合marker|麻点图|图片覆盖物 摘要:覆盖物,是一张地图的灵魂.有覆盖物的地图,才是完整的地图.在 ...
- 【高德地图API】从零开始学高德JS API(二)地图控件与插件——测距、圆形编辑器、鼠标工具、地图类型切换、鹰眼鱼骨
原文:[高德地图API]从零开始学高德JS API(二)地图控件与插件——测距.圆形编辑器.鼠标工具.地图类型切换.鹰眼鱼骨 摘要:无论是控件还是插件,都是在一级API接口的基础上,进行二次开发,封装 ...
- 【高德地图API】从零开始学高德JS API(一)地图展现——仙剑地图,麻点图,街景,室内图
原文:[高德地图API]从零开始学高德JS API(一)地图展现——仙剑地图,麻点图,街景,室内图 摘要:关于地图的显示,我想大家最关心的就是麻点图,自定义底图的解决方案了吧.在过去,marker大于 ...
随机推荐
- jeecg根据模板自定义导出
//1.获取模板的路径: String lujing = request.getSession().getServletContext().getRealPath("/")+ &q ...
- js函数节流和防抖的理解与实现
一:函数防抖1.理解:触发高频事件后n秒内函数只会执行一次,如果n秒内高频事件再次被触发,则重新计算时间2.思路:每次触发事件时都取消之前的延时调用方法 3.实现: function debounce ...
- PHP(面向对象)连接数据库,实现基本的增删改查
https://blog.csdn.net/qq_37674858/article/details/78921485 --------------------- 本文来自 周子青 的CSDN 博客 , ...
- redis基础学习---1
5.1.xshell传输文件命令快捷键:alt+p 2.当运行一个程序时,想退出按ctrl+c退出 3.给用户权限:chmod 777 redis.conf 另一种方式:chmod –x 4. 5.查 ...
- aws S3存储概念
S3存储(Simple Storage Service) 存储桶:存储桶是S3中用于存储对象的容器.每个对象都存储在一个存储桶中. 对象:对象是S3中存储的基本实体.对象由对象数据和元数据组成.数据部 ...
- mapreduce案例:获取PI的值
mapreduce案例:获取PI的值 * content:核心思想是向以(0,0),(0,1),(1,0),(1,1)为顶点的正方形中投掷随机点. * 统计(0.5,0.5)为圆心的单位圆中落点占总落 ...
- 爬虫实现51job谁看过我的简历多条记录功能
默认情况下51job只能看到最近一条记录,查看更多记录需要付费. 本文利用爬虫定时抓取记录,并追加写入到文本的方式获取完整的记录信息. import requests from bs4 import ...
- 内存块是一种数据结构,内核对象&句柄
内核对象&句柄 目录 1 内核对象的概念 2 内核对象的使用计数 3 句柄 4 句柄表 项目工程代码中设计句柄的使用,一时不知句柄是何物,通过查阅自学之后,对句柄及其使用有一个初步的了解. ...
- Pairs of Numbers
#include<stdio.h> //we have defined the necessary header files here for this problem. //If add ...
- 零零散散的python笔记 2
python2和python3的兼容性方面 工具 2to3 python3中自带的工具,可以检查python2升级到python3的diff: 2to3 x.py 2to3 -w x.py # ...