|
|
@@ -3,199 +3,211 @@
|
|
|
<div id="containerMap" style="width: 100%; height: 87vh;position: relative" v-loading="loading"
|
|
|
element-loading-text="数据量较大,正在为您加载......" element-loading-spinner="el-icon-loading"
|
|
|
element-loading-background="rgba(0, 0, 0, 0.8)"></div>
|
|
|
- <div class="province-window">
|
|
|
- <el-select size="small" v-model="provinceName" clearable placeholder="请选择省" @change="provinceChange"
|
|
|
- @clear="provinceClear">
|
|
|
- <el-option v-for="(option, index) in provinceOption" :key="index" :label="option.name"
|
|
|
- :value="option.code"></el-option>
|
|
|
- </el-select>
|
|
|
- <el-select size="small" v-model="cityName" clearable placeholder="请选择市" @change="cityChange" @clear="cityClear">
|
|
|
- <el-option v-for="(option, index) in cityOption" :key="index" :label="option.name"
|
|
|
- :value="option.code"></el-option>
|
|
|
- </el-select>
|
|
|
- <el-select size="small" v-model="districtName" clearable placeholder="请选择区" @change="districtChange"
|
|
|
- @clear="districtClear">
|
|
|
- <el-option v-for="(option, index) in districtOption" :key="index" :label="option.name"
|
|
|
- :value="option.code"></el-option>
|
|
|
- </el-select>
|
|
|
- <el-button size="small" type="primary" @click="onSearch">搜索</el-button>
|
|
|
- <!-- <el-button size="small" type="primary" @click="onCircular">圆形定位</el-button> -->
|
|
|
- <!-- <el-button size="small" type="primary" @click="map.remove(circle)">删除定位</el-button> -->
|
|
|
- </div>
|
|
|
- <div class="source-window">
|
|
|
- <div>
|
|
|
- <span>全部</span>
|
|
|
- <el-switch v-model="sourceqb" @change="sourceqbChange">
|
|
|
- </el-switch>
|
|
|
+ <div class="dragContainerEl">
|
|
|
+ <div class="province-window">
|
|
|
+ <el-select size="small" v-model="provinceName" clearable placeholder="请选择省" @change="provinceChange"
|
|
|
+ @clear="provinceClear">
|
|
|
+ <el-option v-for="(option, index) in provinceOption" :key="index" :label="option.name"
|
|
|
+ :value="option.code"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-select size="small" v-model="cityName" clearable placeholder="请选择市" @change="cityChange" @clear="cityClear">
|
|
|
+ <el-option v-for="(option, index) in cityOption" :key="index" :label="option.name"
|
|
|
+ :value="option.code"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-select size="small" v-model="districtName" clearable placeholder="请选择区" @change="districtChange"
|
|
|
+ @clear="districtClear">
|
|
|
+ <el-option v-for="(option, index) in districtOption" :key="index" :label="option.name"
|
|
|
+ :value="option.code"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-button size="small" type="primary" @click="onSearch">搜索</el-button>
|
|
|
+ <!-- <el-button size="small" type="primary" @click="onCircular">圆形定位</el-button> -->
|
|
|
+ <!-- <el-button size="small" type="primary" @click="map.remove(circle)">删除定位</el-button> -->
|
|
|
</div>
|
|
|
- <div>
|
|
|
- <span>代理</span>
|
|
|
- <el-switch v-model="sourcedl" @change="sourcedlChange">
|
|
|
- </el-switch>
|
|
|
- <!-- <span style="margin-left: 15px;">在线</span>
|
|
|
+ <div class="source-window">
|
|
|
+ <div>
|
|
|
+ <span>全部</span>
|
|
|
+ <el-switch v-model="sourceqb" @change="sourceqbChange">
|
|
|
+ </el-switch>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <span>代理</span>
|
|
|
+ <el-switch v-model="sourcedl" @change="sourcedlChange">
|
|
|
+ </el-switch>
|
|
|
+ <!-- <span style="margin-left: 15px;">在线</span>
|
|
|
<el-switch v-model="lineZx" @change="onLineChange">
|
|
|
</el-switch> -->
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <span>渠道</span>
|
|
|
- <el-switch v-model="sourceqd" @change="sourceqdChange">
|
|
|
- </el-switch>
|
|
|
- <!-- <span style="margin-left: 15px;">离线</span>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <span>渠道</span>
|
|
|
+ <el-switch v-model="sourceqd" @change="sourceqdChange">
|
|
|
+ </el-switch>
|
|
|
+ <!-- <span style="margin-left: 15px;">离线</span>
|
|
|
<el-switch v-model="lineLx" @change="offlineChange">
|
|
|
</el-switch> -->
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div v-if="infoWindowVisible" class="infohis-window">
|
|
|
- <p class="close flex j-s">
|
|
|
- <span>历史记录</span>
|
|
|
- <span style="color: #c3c3c3;font-size:18px" @click="infoWindowVisible = false"> ×</span>
|
|
|
- </p>
|
|
|
- <el-table :data="tableData" border style="width: 98%; max-height: 45vh;
|
|
|
- overflow-y: auto; "
|
|
|
- :cell-style="{padding: '3px 8px'}"
|
|
|
- :header-cell-style="{
|
|
|
- background: '#F2F7FC',
|
|
|
- fontWeight: '700',
|
|
|
- color: '#606266',
|
|
|
-
|
|
|
- }">
|
|
|
- <el-table-column prop="userId" label="工号" width="150">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="userName" label="姓名" width="80">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="address" label="地址">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="operationTime" label="登录时间">
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <div class="bottomFixed">
|
|
|
- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNum"
|
|
|
- :page-sizes="[5, 10, 20, 30, 50, 100]" :page-size="pageSize" layout="total, sizes, prev, pager, next"
|
|
|
- :total="totalSum">
|
|
|
- </el-pagination>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="personnel-window ">
|
|
|
- <p class="close flex j-s ">
|
|
|
- <!-- <span>人员分布</span> -->
|
|
|
- <el-tabs style="position: relative;width: 100%;" v-model="activeName" @tab-click="handHistory">
|
|
|
- <el-tab-pane label="人员分布" name="1"></el-tab-pane>
|
|
|
- <el-tab-pane label="历史在线人数" name="2"></el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
- <span style="color: #3865E9 ; cursor: pointer; font-size: 14px;position: absolute;line-height: 40px;
|
|
|
- right: 30px;" @click="isCollapse = !isCollapse;if(isCollapse)infoWindowVisible=false">{{
|
|
|
- isCollapse ? '收起' : '展开' }} </span>
|
|
|
- </p>
|
|
|
- <div v-show="activeName == 1">
|
|
|
- <div class="flex j-s">
|
|
|
- <div class="info-title"><i></i>人员数量概览</div>
|
|
|
- <div class="info-online"><i></i>在线人数:{{ onlineData }}</div>
|
|
|
- </div>
|
|
|
- <div style="padding: 10px 0;" class="flex j-s">
|
|
|
- <div v-for="(item, index) in overviewOption" :key="index"
|
|
|
- :class="currentIndex === index ? 'overview after-img' : 'overview '" @click="checkPrice(index)">
|
|
|
- <span>{{ item.active }}</span>
|
|
|
- <span>{{ item.name }}</span>
|
|
|
- </div>
|
|
|
</div>
|
|
|
- <div v-show="isCollapse" class="info-title"><i></i>区域人员概览</div>
|
|
|
- <el-table v-show="isCollapse" :data="overviewData" border
|
|
|
- style="width: 100%; max-height: 50vh; overflow: auto;margin:15px 0" :header-cell-style="{
|
|
|
- background: '#F7F7F9',
|
|
|
- fontWeight: '700',
|
|
|
- color: '#000',
|
|
|
- }">
|
|
|
- <el-table-column type="index" align="center" width="50" label="序号">
|
|
|
- <template slot-scope="scope">
|
|
|
- <img v-if="scope.$index == 0" src="../../assets/序号1.png" />
|
|
|
- <img v-else-if="scope.$index == 1" src="../../assets/序号2.png" />
|
|
|
- <img v-else-if="scope.$index == 2" src="../../assets/序号3.png" />
|
|
|
- <span v-else style="text-decoration-line: underline;">{{ scope.$index + 1 }}</span>
|
|
|
- </template>
|
|
|
+ </div>
|
|
|
+ <MobileZoomDivTR>
|
|
|
+ <div v-if="infoWindowVisible" class="infohis-window">
|
|
|
+ <p class="close flex j-s">
|
|
|
+ <span>历史记录</span>
|
|
|
+ <span style="color: #c3c3c3;font-size:18px" @click="infoWindowVisible = false"> ×</span>
|
|
|
+ </p>
|
|
|
+ <el-table :data="tableData" border style="width: 98%; max-height: 45vh;
|
|
|
+ overflow-y: auto; " :cell-style="{ padding: '3px 8px' }" :header-cell-style="{
|
|
|
+ background: '#F2F7FC',
|
|
|
+ fontWeight: '700',
|
|
|
+ color: '#606266',
|
|
|
+
|
|
|
+ }">
|
|
|
+ <el-table-column prop="userId" label="工号" width="150">
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="districtName" align="center" label="区域">
|
|
|
+ <el-table-column prop="userName" label="姓名" width="80">
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="number" align="center" label="人数">
|
|
|
+ <el-table-column prop="address" label="地址">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="operationTime" label="登录时间">
|
|
|
</el-table-column>
|
|
|
- <div slot="empty" class="empty">
|
|
|
- <img src="../../assets/暂无数据.png" />
|
|
|
- <div class="txt">暂无数据哦</div>
|
|
|
- </div>
|
|
|
</el-table>
|
|
|
+ <div class="bottomFixed">
|
|
|
+ <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNum"
|
|
|
+ :page-sizes="[5, 10, 20, 30, 50, 100]" :page-size="pageSize" layout="total, sizes, prev, pager, next"
|
|
|
+ :total="totalSum">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div v-show="activeName == 2">
|
|
|
- <div style="margin-bottom: 10px;">
|
|
|
- <span style="color: #262626;font-weight: 700;font-size: 14px;">时间筛选 </span>
|
|
|
- <el-date-picker v-model="historyDate" type="daterange" size="small" @change="historyDateFun"
|
|
|
- value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
|
|
|
- </el-date-picker>
|
|
|
- <!-- <el-date-picker size="small" @change="historyDateFun" v-model="historyDate" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日"
|
|
|
+ </MobileZoomDivTR>
|
|
|
+ <MobileZoomDivR>
|
|
|
+ <div class="personnel-window ">
|
|
|
+ <p class="close flex j-s ">
|
|
|
+ <!-- <span>人员分布</span> -->
|
|
|
+ <el-tabs style="position: relative;width: 100%;" v-model="activeName" @tab-click="handHistory">
|
|
|
+ <el-tab-pane label="人员分布" name="1"></el-tab-pane>
|
|
|
+ <el-tab-pane label="历史在线人数" name="2"></el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ <span style="color: #3865E9 ; cursor: pointer; font-size: 14px;position: absolute;line-height: 40px;
|
|
|
+ right: 30px;" @click="isCollapse = !isCollapse; if (isCollapse) infoWindowVisible = false">{{
|
|
|
+ isCollapse ? '收起' : '展开' }} </span>
|
|
|
+ </p>
|
|
|
+ <div v-show="activeName == 1">
|
|
|
+ <div class="flex j-s">
|
|
|
+ <div class="info-title"><i></i>人员数量概览</div>
|
|
|
+ <div class="info-online"><i></i>在线人数:{{ onlineData }}</div>
|
|
|
+ </div>
|
|
|
+ <div style="padding: 10px 0;" class="flex j-s">
|
|
|
+ <div v-for="(item, index) in overviewOption" :key="index"
|
|
|
+ :class="currentIndex === index ? 'overview after-img' : 'overview '" @click="checkPrice(index)">
|
|
|
+ <span>{{ item.active }}</span>
|
|
|
+ <span>{{ item.name }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-show="isCollapse" class="info-title"><i></i>区域人员概览</div>
|
|
|
+ <el-table v-show="isCollapse" :data="overviewData" border
|
|
|
+ style="width: 100%; max-height: 50vh; overflow: auto;margin:15px 0" :header-cell-style="{
|
|
|
+ background: '#F7F7F9',
|
|
|
+ fontWeight: '700',
|
|
|
+ color: '#000',
|
|
|
+ }">
|
|
|
+ <el-table-column type="index" align="center" width="50" label="序号">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <img v-if="scope.$index == 0" src="../../assets/序号1.png" />
|
|
|
+ <img v-else-if="scope.$index == 1" src="../../assets/序号2.png" />
|
|
|
+ <img v-else-if="scope.$index == 2" src="../../assets/序号3.png" />
|
|
|
+ <span v-else style="text-decoration-line: underline;">{{ scope.$index + 1 }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="districtName" align="center" label="区域">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="number" align="center" label="人数">
|
|
|
+ </el-table-column>
|
|
|
+ <div slot="empty" class="empty">
|
|
|
+ <img src="../../assets/暂无数据.png" />
|
|
|
+ <div class="txt">暂无数据哦</div>
|
|
|
+ </div>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div v-show="activeName == 2">
|
|
|
+ <div style="margin-bottom: 10px;">
|
|
|
+ <span style="color: #262626;font-weight: 700;font-size: 14px;">时间筛选 </span>
|
|
|
+ <el-date-picker v-model="historyDate" type="daterange" size="small" @change="historyDateFun"
|
|
|
+ value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
|
|
|
+ </el-date-picker>
|
|
|
+ <!-- <el-date-picker size="small" @change="historyDateFun" v-model="historyDate" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日"
|
|
|
value-format="yyyy-MM-dd">
|
|
|
</el-date-picker>-->
|
|
|
- </div>
|
|
|
- <div class="flex j-s">
|
|
|
- <div class="info-title"><i></i>历史在线人数统计</div>
|
|
|
- <div class="info-online"><i></i>使用人数:{{ onlineHisData }}</div>
|
|
|
- </div>
|
|
|
- <div id="echarts_box" v-show="isCollapse" style="width: 460px;height:300px;"></div>
|
|
|
+ </div>
|
|
|
+ <div class="flex j-s">
|
|
|
+ <div class="info-title"><i></i>历史在线人数统计</div>
|
|
|
+ <div class="info-online"><i></i>使用人数:{{ onlineHisData }}</div>
|
|
|
+ </div>
|
|
|
+ <div id="echarts_box" v-show="isCollapse" style="width: 460px;height:300px;"></div>
|
|
|
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
+ </MobileZoomDivR>
|
|
|
|
|
|
- </div>
|
|
|
- <div v-if="personnelVisible" class="info-window">
|
|
|
- <p class="close flex j-s">
|
|
|
- <span>人员详情</span>
|
|
|
- <span style="color: #c3c3c3;font-size:18px;cursor: pointer" @click="personnelVisible = false"> ×</span>
|
|
|
- </p>
|
|
|
- <el-table :data="personnelData" border style="width: 100%; " :header-cell-style="{
|
|
|
- background: '#F7F7F9',
|
|
|
- fontWeight: '700',
|
|
|
- color: '#606266',
|
|
|
- }">
|
|
|
- <el-table-column type="index" align="center" width="50" label="序号">
|
|
|
- <template slot-scope="scope">
|
|
|
- <img v-if="scope.$index == 0" src="../../assets/序号1.png" />
|
|
|
- <img v-else-if="scope.$index == 1" src="../../assets/序号2.png" />
|
|
|
- <img v-else-if="scope.$index == 2" src="../../assets/序号3.png" />
|
|
|
- <span v-else style="text-decoration-line: underline;">{{ scope.$index + 1 }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="userName" label="姓名" width="100">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="userId" label="工号">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="address" label="地址">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="operationTime" label="登录时间">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="source" label="分类">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ scope.row.source == '1' ? '渠道' : '代理' }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button style="color:#3865E9 " @click.native.prevent="historicRecords(scope.row)" type="text" size="small">
|
|
|
- 历史记录
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <div slot="empty" class="empty">
|
|
|
- <img src="../../assets/暂无数据.png" />
|
|
|
- <div class="txt">暂无数据哦</div>
|
|
|
+ <MobileZoomDiv>
|
|
|
+ <div v-if="personnelVisible" class="info-window">
|
|
|
+ <p class="close flex j-s">
|
|
|
+ <span>人员详情</span>
|
|
|
+ <span style="color: #c3c3c3;font-size:18px;cursor: pointer" @click="personnelVisible = false"> ×</span>
|
|
|
+ </p>
|
|
|
+ <el-table :data="personnelData" border style="width: 100%; " :header-cell-style="{
|
|
|
+ background: '#F7F7F9',
|
|
|
+ fontWeight: '700',
|
|
|
+ color: '#606266',
|
|
|
+ }">
|
|
|
+ <el-table-column type="index" align="center" width="50" label="序号">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <img v-if="scope.$index == 0" src="../../assets/序号1.png" />
|
|
|
+ <img v-else-if="scope.$index == 1" src="../../assets/序号2.png" />
|
|
|
+ <img v-else-if="scope.$index == 2" src="../../assets/序号3.png" />
|
|
|
+ <span v-else style="text-decoration-line: underline;">{{ scope.$index + 1 }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="userName" label="姓名" width="100">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="userId" label="工号">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="address" label="地址">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="operationTime" label="登录时间">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="source" label="分类">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.source == '1' ? '渠道' : '代理' }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button style="color:#3865E9 " @click.native.prevent="historicRecords(scope.row)" type="text"
|
|
|
+ size="small">
|
|
|
+ 历史记录
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <div slot="empty" class="empty">
|
|
|
+ <img src="../../assets/暂无数据.png" />
|
|
|
+ <div class="txt">暂无数据哦</div>
|
|
|
+ </div>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <div class="bottomFixed">
|
|
|
+ <el-pagination @current-change="handlePersonnelChange" :current-page="personnelPageNum" :page-size="5"
|
|
|
+ layout="total, prev, pager, next" :total="personnelTotalSize">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </el-table>
|
|
|
- <div class="bottomFixed">
|
|
|
- <el-pagination @current-change="handlePersonnelChange" :current-page="personnelPageNum" :page-size="5"
|
|
|
- layout="total, prev, pager, next" :total="personnelTotalSize">
|
|
|
- </el-pagination>
|
|
|
+ </MobileZoomDiv>
|
|
|
+
|
|
|
+ <div class="info-window input-card" v-if="circle">
|
|
|
+ <el-button size="small" round @click="circleEditor.open()" style="margin-bottom: 5px">开始编辑</el-button>
|
|
|
+ <el-button size="small" round @click="circleEditor.close()" style="margin-left:0">结束编辑</el-button>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="info-window input-card" v-if="circle">
|
|
|
- <el-button size="small" round @click="circleEditor.open()" style="margin-bottom: 5px">开始编辑</el-button>
|
|
|
- <el-button size="small" round @click="circleEditor.close()" style="margin-left:0">结束编辑</el-button>
|
|
|
|
|
|
+ <!-- <div class="dragContainerEl">
|
|
|
+ <div id="Drag" @mousedown="mousedown($event)" :style="{ transform: `translate(${x}px, ${y}px) scale(${scale})` }" @wheel="zoom" class="drag">可移动和放大缩小的区域</div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -203,11 +215,15 @@
|
|
|
<script>
|
|
|
import echarts from 'echarts';
|
|
|
import yongchengData from '../../assets/js/yongchengData';
|
|
|
+import MobileZoomDiv from './MobileZoomDiv.vue'
|
|
|
+import MobileZoomDivR from './MobileZoomDivR.vue'
|
|
|
+import MobileZoomDivTR from './MobileZoomDivTR.vue'
|
|
|
import AMapLoader from "@amap/amap-jsapi-loader";
|
|
|
window._AMapSecurityConfig = {
|
|
|
securityJsCode: 'd62687dd438cfadd859bbab66d8e41a2', //安全密钥
|
|
|
}
|
|
|
var myChart;
|
|
|
+
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -266,9 +282,21 @@ export default {
|
|
|
lineLx: null,
|
|
|
status: null,
|
|
|
positionType: null,
|
|
|
- historyData: []
|
|
|
+ historyData: [],
|
|
|
+ scale: 1,
|
|
|
+ DragEl: null,//拖动元素
|
|
|
+ dragContainerEl: null,//容器元素
|
|
|
+ // 位置差
|
|
|
+ // disX: 0,
|
|
|
+ // disY: 0,
|
|
|
+ // x: 0,
|
|
|
+ // y: 0,
|
|
|
+ top: 60,
|
|
|
+ left: 20,
|
|
|
+ isMoving: false,
|
|
|
};
|
|
|
},
|
|
|
+ components: { MobileZoomDiv, MobileZoomDivR,MobileZoomDivTR },
|
|
|
mounted() {
|
|
|
myChart = echarts.init(document.getElementById('echarts_box'))
|
|
|
this.initMap();
|
|
|
@@ -287,18 +315,88 @@ export default {
|
|
|
this.map.destroy();
|
|
|
},
|
|
|
methods: {
|
|
|
+ startMove(event) {
|
|
|
+ this.isMoving = true;
|
|
|
+ this.initialX = event.clientX;
|
|
|
+ this.initialY = event.clientY;
|
|
|
+ },
|
|
|
+ doMove(event) {
|
|
|
+ if (this.isMoving) {
|
|
|
+ this.left += event.clientX - this.initialX;
|
|
|
+ this.top += event.clientY - this.initialY;
|
|
|
+ this.initialX = event.clientX;
|
|
|
+ this.initialY = event.clientY;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ stopMove() {
|
|
|
+ this.isMoving = false;
|
|
|
+ },
|
|
|
+ mousedown(event) {
|
|
|
+ // 1,计算位置差
|
|
|
+ // 因为clientX和offsetLeft的属性返回的位置不一样 要相减得到鼠标在拖动元素内实际点击的位置
|
|
|
+ // 后面每一次拖动时都要减去这个差值 否则就会造成你拖动的位置一直都是元素的左上角 而不是你之前点击的位置
|
|
|
+
|
|
|
+ console.log(event.clientX, this.DragEl.offsetLeft, 222222222);
|
|
|
+
|
|
|
+ this.disX = event.clientX - this.DragEl.offsetLeft;
|
|
|
+ this.disY = event.clientY - this.DragEl.offsetTop;
|
|
|
+
|
|
|
+ //2, 获取拖动元素的高度和容器的高度 为了下面进行限制元素拖动的范围
|
|
|
+ let dragHeight = this.DragEl.offsetHeight;
|
|
|
+ let dragWidth = this.DragEl.offsetWidth;
|
|
|
+ let dragContainerWidth = this.dragContainerEl.offsetWidth; //获取容器的高度和宽度
|
|
|
+ let dragContainerHeight = this.dragContainerEl.offsetHeight;
|
|
|
+
|
|
|
+ // 添加鼠标移动事件
|
|
|
+ document.onmousemove = (el) => {
|
|
|
+ // 3,获取鼠标移动位置
|
|
|
+ let moveX = el.clientX - this.disX;
|
|
|
+ let moveY = el.clientY - this.disY;
|
|
|
+
|
|
|
+
|
|
|
+ // 左边界
|
|
|
+ if (moveX <= 0) {
|
|
|
+ moveX = 0;
|
|
|
+ }
|
|
|
+ // 上边界
|
|
|
+ if (moveY <= 0) {
|
|
|
+ moveY = 0;
|
|
|
+ }
|
|
|
+ //下边界 容器高度 - 拖动元素高度
|
|
|
+ if (moveY >= dragContainerHeight - dragHeight) {
|
|
|
+ moveY = dragContainerHeight - dragHeight;
|
|
|
+ }
|
|
|
+ //右边界 容器宽度 - 拖动元素宽度
|
|
|
+ if (moveX >= dragContainerWidth - dragWidth) {
|
|
|
+ moveX = dragContainerWidth - dragWidth;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 5, 开始移动
|
|
|
+ this.DragEl.style.left = moveX + "px";
|
|
|
+ this.DragEl.style.top = moveY + "px";
|
|
|
+ };
|
|
|
+ /* 6,鼠标抬起解除事件 */
|
|
|
+ document.onmouseup = () => {
|
|
|
+ document.onmousemove = null;
|
|
|
+ };
|
|
|
+ },
|
|
|
+ zoom(event) {
|
|
|
+ event.preventDefault();
|
|
|
+ const delta = event.deltaY > 0 ? 1.1 : 0.9;
|
|
|
+ this.scale *= delta;
|
|
|
+ },
|
|
|
historicRecords(row) {
|
|
|
this.rowId = row.userId
|
|
|
- this.isCollapse=false
|
|
|
- this.infoWindowVisible=true
|
|
|
+ this.isCollapse = false
|
|
|
+ this.infoWindowVisible = true
|
|
|
this.detail()
|
|
|
},
|
|
|
handHistory(tab, event) {
|
|
|
if (tab.name == '2') {
|
|
|
this.queryAnalysis();
|
|
|
}
|
|
|
- else{
|
|
|
- this.positionType=1
|
|
|
+ else {
|
|
|
+ this.positionType = 1
|
|
|
this.initMap();
|
|
|
}
|
|
|
},
|
|
|
@@ -307,7 +405,7 @@ export default {
|
|
|
this.queryAnalysis({ startTime: val[0], endTime: val[1] });
|
|
|
},
|
|
|
queryAnalysis(param) {
|
|
|
- this.$api.user.ipAddrGetPcAddress({source:this.source ,...param}).then((res) => {
|
|
|
+ this.$api.user.ipAddrGetPcAddress({ source: this.source, ...param }).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
this.onlineHisData = res.data.onlineNum
|
|
|
this.formatAnalysisDate(res.data.list)
|
|
|
@@ -324,25 +422,25 @@ export default {
|
|
|
_this.map.on("complete", () => {
|
|
|
//处理后台返回要用到的数据
|
|
|
// _this.positionData = res.data.data
|
|
|
- if (res.data.pcAddressList.length > 0){
|
|
|
+ if (res.data.pcAddressList.length > 0) {
|
|
|
|
|
|
_this.positionType = res.data.pcAddressList[0].type
|
|
|
- _this.positionData = res.data.pcAddressList.map(item => ({
|
|
|
- userName: item.userName,
|
|
|
- id: item.id,
|
|
|
- userId: item.userId,
|
|
|
- address: item.address,
|
|
|
- leaderName: item.leaderName ? item.leaderName : '无',
|
|
|
- // onlineImg: item.status ? "Frame-1(2).png" : "Frame(2).png",
|
|
|
- onlineImg: "Frame-1(2).png",
|
|
|
- operationTime: item.operationTime,
|
|
|
- source: item.source,
|
|
|
- status: item.status ? "#1CE247" : "#B2B2B2",
|
|
|
- // status: item.status ? "在线" : "离线",
|
|
|
- positionArr: [item.longitude, item.latitude]
|
|
|
- }));
|
|
|
- _this.mapPoint();
|
|
|
- }
|
|
|
+ _this.positionData = res.data.pcAddressList.map(item => ({
|
|
|
+ userName: item.userName,
|
|
|
+ id: item.id,
|
|
|
+ userId: item.userId,
|
|
|
+ address: item.address,
|
|
|
+ leaderName: item.leaderName ? item.leaderName : '无',
|
|
|
+ // onlineImg: item.status ? "Frame-1(2).png" : "Frame(2).png",
|
|
|
+ onlineImg: "Frame-1(2).png",
|
|
|
+ operationTime: item.operationTime,
|
|
|
+ source: item.source,
|
|
|
+ status: item.status ? "#1CE247" : "#B2B2B2",
|
|
|
+ // status: item.status ? "在线" : "离线",
|
|
|
+ positionArr: [item.longitude, item.latitude]
|
|
|
+ }));
|
|
|
+ _this.mapPoint();
|
|
|
+ }
|
|
|
});
|
|
|
// if (location.href.indexOf("&guide=1") !== -1) {
|
|
|
// _this.map.setStatus({ scrollWheel: fal0e });
|
|
|
@@ -629,11 +727,11 @@ export default {
|
|
|
this.sourceqd = null
|
|
|
}
|
|
|
this.source = null
|
|
|
- if(this.positionType==1){
|
|
|
+ if (this.positionType == 1) {
|
|
|
this.initMap();
|
|
|
}
|
|
|
- else{
|
|
|
- this.queryAnalysis({ startTime: this.historyData[0], endTime: this.historyData[1] });
|
|
|
+ else {
|
|
|
+ this.queryAnalysis({ startTime: this.historyData[0], endTime: this.historyData[1] });
|
|
|
}
|
|
|
},
|
|
|
sourcedlChange(val) {
|
|
|
@@ -642,11 +740,11 @@ export default {
|
|
|
this.sourceqd = null
|
|
|
}
|
|
|
this.source = 2
|
|
|
- if(this.positionType==1){
|
|
|
+ if (this.positionType == 1) {
|
|
|
this.initMap();
|
|
|
}
|
|
|
- else{
|
|
|
- this.queryAnalysis({ startTime: this.historyData[0], endTime: this.historyData[1] });
|
|
|
+ else {
|
|
|
+ this.queryAnalysis({ startTime: this.historyData[0], endTime: this.historyData[1] });
|
|
|
}
|
|
|
},
|
|
|
sourceqdChange(val) {
|
|
|
@@ -655,11 +753,11 @@ export default {
|
|
|
this.sourcedl = null
|
|
|
}
|
|
|
this.source = 1
|
|
|
- if(this.positionType==1){
|
|
|
+ if (this.positionType == 1) {
|
|
|
this.initMap();
|
|
|
}
|
|
|
- else{
|
|
|
- this.queryAnalysis({ startTime: this.historyData[0], endTime: this.historyData[1] });
|
|
|
+ else {
|
|
|
+ this.queryAnalysis({ startTime: this.historyData[0], endTime: this.historyData[1] });
|
|
|
}
|
|
|
},
|
|
|
onLineChange(val) {
|
|
|
@@ -958,15 +1056,17 @@ export default {
|
|
|
}
|
|
|
|
|
|
.personnel-window {
|
|
|
- position: fixed;
|
|
|
- bottom: 10px;
|
|
|
- right: 5px;
|
|
|
+ position: absolute;
|
|
|
+ // bottom: 10px;
|
|
|
+ // right: 5px;
|
|
|
+ bottom: 0;
|
|
|
+ right: 0;
|
|
|
z-index: 100;
|
|
|
background-color: white;
|
|
|
padding: 10px;
|
|
|
box-shadow: 0px 5px 10px #ddd;
|
|
|
box-sizing: border-box;
|
|
|
- width: 500px;
|
|
|
+ width: 500px;
|
|
|
}
|
|
|
|
|
|
.bottomFixed {
|
|
|
@@ -1098,5 +1198,21 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ .dragContainerEl {
|
|
|
+ // position: absolute;
|
|
|
+ // top: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .drag {
|
|
|
+ position: absolute;
|
|
|
+ width: 50px;
|
|
|
+ height: 50px;
|
|
|
+ border: 5px solid yellowgreen;
|
|
|
+ background-color: red;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
</style>
|