|
|
@@ -19,25 +19,31 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
:search="false" :inputClick="false" :clearable="false" @getText="getESelectText"
|
|
|
@change="selectMapChange"></e-select>
|
|
|
</view>
|
|
|
- <view class="select">
|
|
|
+ <!-- <view class="select">
|
|
|
<e-select v-model="actionId" maxHeight="300px" :props="selectActionProps" :options="actionList"
|
|
|
:search="false" :inputClick="false" :clearable="false" @getText="getESelectText"
|
|
|
@change="selectActionChange"></e-select>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
</view>
|
|
|
|
|
|
<view id="map" class="map"></view>
|
|
|
|
|
|
<view v-show="popupShow" class="popup"
|
|
|
:style="{ height: popupHeight + 'px', width: popupWidth + 'px' }">
|
|
|
- <!-- <uni-section class="section" title="活动路线列表" type="line">
|
|
|
- <uni-data-picker class="actionsTree" :style="{ width: popupWidth + 'px' }" placeholder="请选择活动" popup-title="请选择活动路线" :localdata="actionsTree"
|
|
|
- v-model="sltActRoute" @change="onActionChange" @popupopened="onActionsTreePopupOpened" @popupclosed="onActionsTreePopupClosed"></uni-data-picker>
|
|
|
- </uni-section> -->
|
|
|
-
|
|
|
- <uni-section class="section" title="玩家列表" type="line">
|
|
|
- <view class="norecord" v-if="players == null || players.length == 0">暂无记录</view>
|
|
|
- <scroll-view :scroll-top="0" scroll-y="true" :style="{ height: popupHeight - 43 + 'px'}">
|
|
|
+ <uni-section class="section" title="活动路线列表" type="line">
|
|
|
+ <template v-slot:right>
|
|
|
+ <uni-icons @click="leafletHelper.elListClick(leafletHelper)" type="closeempty"
|
|
|
+ size="16"></uni-icons>
|
|
|
+ </template>
|
|
|
+ <uni-data-picker ref="actionsTree" class="actionsTree" :style="{ width: popupWidth + 'px' }" placeholder="请选择活动路线"
|
|
|
+ popup-title="请选择活动路线" :localdata="actionsTree" v-model="sltActRoute" :clear-icon="false"
|
|
|
+ @change="onActionChange" @popupopened="onActionsTreePopupOpened"
|
|
|
+ @popupclosed="onActionsTreePopupClosed"></uni-data-picker>
|
|
|
+ </uni-section>
|
|
|
+
|
|
|
+ <uni-section class="section" :title="'玩家列表 (' + playersNum + '人)'" type="line">
|
|
|
+ <view class="norecord" v-if="playersNum == 0">暂无记录</view>
|
|
|
+ <scroll-view v-else :scroll-top="0" scroll-y="true" :style="{ height: popupHeight - 122 + 'px'}">
|
|
|
<uni-list v-for="(item, index) in players" :key="index" :border="true" class="list">
|
|
|
<uni-list-item :clickable="true" @click="onPlayerListItemClick(item)" class="list-item"
|
|
|
:class="{
|
|
|
@@ -57,13 +63,14 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
<uni-icons v-if="admin" type="phone" size="14"></uni-icons>
|
|
|
</span>
|
|
|
打点 {{item.EffectiveNum}}/{{item.TotalControlNum}} 目标点
|
|
|
- {{item.nextControlPoint.orderNO}} 百味豆 {{item.sysPoint}}
|
|
|
+ {{item.nextControlPoint.orderNO}} <!-- 百味豆 {{item.sysPoint}} -->
|
|
|
</view>
|
|
|
<view class="slot-note">
|
|
|
距离 {{tools.fmtDistanctKm(item.distance)}}km 配速
|
|
|
{{tools.convertSecondsToHMS(item.pace, 2)}}
|
|
|
- Cal {{Math.round(item.Calorie/1000)}} | 心率
|
|
|
- {{item.lastHr}} 平均 {{item.avgHr}} 最大 {{item.maxHr}}
|
|
|
+ Cal {{Math.round(item.Calorie/1000)}}
|
|
|
+ 百味豆 {{item.sysPoint}}
|
|
|
+ <!-- | 心率 {{item.lastHr}} 平均 {{item.avgHr}} 最大 {{item.maxHr}}-->
|
|
|
<!-- | Ck {{item.Ck}} Ei {{Math.round(item.Ei*100)/100}}-->
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -76,7 +83,6 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
</scroll-view>
|
|
|
</uni-section>
|
|
|
</view>
|
|
|
-
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -107,11 +113,15 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ leafletHelper: leafletHelper,
|
|
|
tools: tools,
|
|
|
queryObj: {},
|
|
|
queryString: "",
|
|
|
- interval: null,
|
|
|
- refreshTime: 300000, // 刷新时间 ms
|
|
|
+ interval_loadActionsTree: null,
|
|
|
+ interval_loadData: null,
|
|
|
+ actionsTreePopup: false,
|
|
|
+ refreshTime_loadData: 3000, // 刷新时间 ms
|
|
|
+ refreshTime_loadActionsTree: 10000, // 刷新时间 ms
|
|
|
admin: true, // 是否场控管理员
|
|
|
|
|
|
compId: 0, // 赛事ID
|
|
|
@@ -127,6 +137,7 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
actionList: [], // 活动列表
|
|
|
actionId: 0, // (当前选中的)活动ID
|
|
|
actionDetail: {}, // (当前选中的)活动详情
|
|
|
+ courseId: 0, // (当前选中的)路线ID
|
|
|
|
|
|
selectMapProps: {
|
|
|
value: 'id',
|
|
|
@@ -146,6 +157,9 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
focusPlayerId: 0,
|
|
|
trailTime: 0,
|
|
|
|
|
|
+ sltActRoute: '',
|
|
|
+ actionsTree: [],
|
|
|
+
|
|
|
popupHeight: 360,
|
|
|
popupWidth: 0,
|
|
|
popupType: 'bottom',
|
|
|
@@ -161,19 +175,71 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
...mapGetters([
|
|
|
'metadata'
|
|
|
]),
|
|
|
+ playersNum() {
|
|
|
+ if (this.players && this.players.length > 0) {
|
|
|
+ return this.players.length;
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ players_position_num() {
|
|
|
+ if (this.players_position && this.players_position.length > 0) {
|
|
|
+ return this.players_position.length;
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ players_position_num_text() {
|
|
|
+ if (this.players_position_num > 0) {
|
|
|
+ return this.players_position_num;
|
|
|
+ } else {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
- onLoad(query) {
|
|
|
+ async onLoad(query) {
|
|
|
// console.log(query);
|
|
|
this.queryObj = query;
|
|
|
this.queryString = tools.objectToQueryString(this.queryObj);
|
|
|
// console.log(queryString);
|
|
|
this.compId = query["compId"] ?? 0;
|
|
|
|
|
|
- this.compInfoDetail();
|
|
|
- this.getMapList();
|
|
|
+ this.actRs = await this.compInfoDetail(this.compId);
|
|
|
+
|
|
|
+ this.mapList = await this.getMapList(this.compId);
|
|
|
+ this.mapId = this.mapList[0].id;
|
|
|
+
|
|
|
+ await this.loadMap();
|
|
|
+
|
|
|
+ // this.actionList = await this.getActionList(this.compId, this.mapId);
|
|
|
+ // this.actionId = this.actionList[0].id;
|
|
|
+
|
|
|
+ // this.actionDetail = await this.getActionDetail(this.actionId);
|
|
|
+
|
|
|
+ // console.log("====> mapSltMapId:", this.$store.state.mapSltMapId);
|
|
|
+ if (this.mapId == this.$store.state.mapSltMapId) { // 页面重载
|
|
|
+ console.log("[onLoad] 页面重载 mapId:", this.mapId);
|
|
|
+ this.sltActRoute = this.$store.state.mapSltActRoute;
|
|
|
+ this.loadData(this.sltActRoute);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.interval_loadActionsTree != null) {
|
|
|
+ clearInterval(this.interval_loadActionsTree)
|
|
|
+ }
|
|
|
+
|
|
|
+ let that = this
|
|
|
+ this.interval_loadActionsTree = setInterval(async function() {
|
|
|
+ if (!that.actionsTreePopup) {
|
|
|
+ await that.loadActionsTree()
|
|
|
+ }
|
|
|
+ }, that.refreshTime_loadActionsTree);
|
|
|
+
|
|
|
+ // 自动弹出活动路线列表窗口 供用户选择
|
|
|
+ leafletHelper.elListClick(leafletHelper);
|
|
|
+ this.$refs.actionsTree.show();
|
|
|
},
|
|
|
mounted() {
|
|
|
- console.log("mounted");
|
|
|
+ // console.log("mounted");
|
|
|
this.$global.getWindowInfo();
|
|
|
uni.$on('windowResize', this.reLoad);
|
|
|
this.popupShow = this.$store.state.mapPopupShow;
|
|
|
@@ -181,14 +247,26 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
console.log("beforeDestroy")
|
|
|
- clearInterval(this.interval)
|
|
|
- leafletHelper.free()
|
|
|
+ this.clear();
|
|
|
},
|
|
|
methods: {
|
|
|
+ clear() {
|
|
|
+ if (this.interval_loadActionsTree != null) {
|
|
|
+ clearInterval(this.interval_loadActionsTree);
|
|
|
+ }
|
|
|
+ if (this.interval_loadData != null) {
|
|
|
+ clearInterval(this.interval_loadData);
|
|
|
+ }
|
|
|
+
|
|
|
+ leafletHelper.free();
|
|
|
+ uni.$off('windowResize', this.reLoad);
|
|
|
+ },
|
|
|
getBannerStyle() {
|
|
|
return card.getBannerStyle(this.actRs);
|
|
|
},
|
|
|
reLoad() {
|
|
|
+ this.clear();
|
|
|
+ this.$store.commit('setMapSltMapId', this.mapId)
|
|
|
this.savePlayersData()
|
|
|
|
|
|
var fullPath = this.$route.fullPath
|
|
|
@@ -200,24 +278,6 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
// 布局初始化 设置地图高度
|
|
|
layoutInit() {
|
|
|
this.popupWidth = this.$global.windowWidth
|
|
|
- /* this.windowHeight = this.$global.windowHeight
|
|
|
- this.windowWidth = this.$global.windowWidth
|
|
|
- if (this.$global.deviceOrientation == 'portrait') { // 竖屏
|
|
|
- this.flexDirection = 'column'
|
|
|
- this.mapWidth = this.$global.windowWidth
|
|
|
- this.mapHeight = this.$global.windowHeight
|
|
|
-
|
|
|
- this.popupHeight = this.popupHeightPortrait
|
|
|
- this.popupWidth = this.$global.windowWidth
|
|
|
- } else { // 横屏
|
|
|
- this.flexDirection = 'row'
|
|
|
- this.mapHeight = this.$global.windowHeight
|
|
|
- this.mapWidth = this.$global.windowWidth
|
|
|
-
|
|
|
- this.popupHeight = this.$global.windowHeight
|
|
|
- this.popupWidth = this.popupWidthlandscape
|
|
|
- // console.log("横屏 popupHeight", this.popupHeight)
|
|
|
- } */
|
|
|
},
|
|
|
popupToggle() {
|
|
|
this.popupShow = !this.popupShow
|
|
|
@@ -225,9 +285,21 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
// this.layoutInit()
|
|
|
},
|
|
|
async loadMap() {
|
|
|
+ await this.loadActionsTree();
|
|
|
+ /* uni.setNavigationBarTitle({
|
|
|
+ title: this.mapDetail.mapInfo.mapName
|
|
|
+ }); */
|
|
|
await mapHelper.handleMapInfo(this, this.mapInfo);
|
|
|
this.mapUrl = mapHelper.mapUrl;
|
|
|
this.mapConfig = mapHelper.mapConfig;
|
|
|
+
|
|
|
+ await this.initMap();
|
|
|
+ this.handleMapToggle();
|
|
|
+ },
|
|
|
+ async loadActionsTree() {
|
|
|
+ this.mapDetail = await this.getMapDetail(this.compId, this.mapId);
|
|
|
+ this.mapInfo = this.mapDetail.mapInfo;
|
|
|
+ this.makeActionsTree(this.mapDetail.actSelectRs);
|
|
|
},
|
|
|
async initMap() {
|
|
|
const zoomNum = this.mapInfo.DefScale;
|
|
|
@@ -239,37 +311,49 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
await leafletHelper.init(this, 'map', this.mapUrl, this.mapConfig, mapOptions);
|
|
|
}
|
|
|
},
|
|
|
- async loadData() {
|
|
|
- await this.loadMap();
|
|
|
-
|
|
|
- await this.initMap();
|
|
|
- this.handleMapDrawRoute();
|
|
|
- if (this.interval != null) {
|
|
|
- clearInterval(this.interval);
|
|
|
+ async loadData(sltActRoute) {
|
|
|
+ // console.log("[loadData] sltActRoute: ", sltActRoute);
|
|
|
+ if (sltActRoute == null || sltActRoute.length == 0) {
|
|
|
+ console.log("[loadData] return: sltActRoute is null ");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ var actRouteArr = sltActRoute[1].value.split('-');
|
|
|
+ this.actionId = actRouteArr[0];
|
|
|
+ this.courseId = actRouteArr[1];
|
|
|
+
|
|
|
+ this.actionDetail = await this.getActionDetail(this.actionId, this.courseId);
|
|
|
+ /* uni.setNavigationBarTitle({
|
|
|
+ title: this.mapDetail.mapinfo.mapname + ' - ' + this.actionDetail.name
|
|
|
+ }); */
|
|
|
+
|
|
|
+ if (this.interval_loadData != null) {
|
|
|
+ clearInterval(this.interval_loadData);
|
|
|
}
|
|
|
|
|
|
- let that = this;
|
|
|
- that.players = await that.getUsersInGameDetail();
|
|
|
- console.log('players', that.players)
|
|
|
+ this.players = await this.getUsersInGameDetail();
|
|
|
+ // console.log('players', this.players)
|
|
|
// leafletHelper.global.setPlayers(this.players)
|
|
|
|
|
|
- that.players_position = await that.usersInGameGpsQuery();
|
|
|
+ this.players_position = await this.usersInGameGpsQuery();
|
|
|
// leafletHelper.global.setPlayersPosition(this.players_position)
|
|
|
-
|
|
|
- that.handleMapDrawPlayer();
|
|
|
- that.handleMapDrawTrail();
|
|
|
-
|
|
|
- this.interval = setInterval(async function() {
|
|
|
+
|
|
|
+ this.handleMapDrawRoute();
|
|
|
+ this.handleMapDrawPlayer();
|
|
|
+ this.handleMapDrawTrail();
|
|
|
+
|
|
|
+ let that = this;
|
|
|
+ this.interval_loadData = setInterval(async function() {
|
|
|
that.players = await that.getUsersInGameDetail();
|
|
|
that.players_position = await that.usersInGameGpsQuery();
|
|
|
//// leaflet.leafletHelper.global.setPlayers(that.players);
|
|
|
// leafletHelper.global.setPlayersPosition(that.players_position);
|
|
|
that.handleMapDrawPlayer();
|
|
|
that.handleMapDrawTrail();
|
|
|
- }, that.refreshTime);
|
|
|
+ }, that.refreshTime_loadData);
|
|
|
|
|
|
// await mapHelper.handleMapInfo(this, this.mapInfo)
|
|
|
- this.handleMapToggle();
|
|
|
+ // this.handleMapToggle(); // to del
|
|
|
},
|
|
|
handleWindowResize() {
|
|
|
leafletHelper.onWindowResize()
|
|
|
@@ -294,17 +378,10 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
handleMapDrawTrail() {
|
|
|
this.trailTime = leafletHelper.config.trailTime
|
|
|
// leafletHelper.player.drawOneTrail(2, 10000)
|
|
|
- // leafletHelper.player.drawOneTrail(3, 10000)
|
|
|
// leafletHelper.player.drawOneTrail(2, 0, false)
|
|
|
leafletHelper.player.drawAllTrails(this.trailTime)
|
|
|
},
|
|
|
handleMapToggle() {
|
|
|
- // leafletHelper.checkPoint.toggle(true)
|
|
|
- // leafletHelper.route.toggle(true)
|
|
|
- // leafletHelper.player.togglePlayer(true)
|
|
|
- // leafletHelper.player.toggleTooltip(true)
|
|
|
- // leafletHelper.player.toggleTrail(true)
|
|
|
-
|
|
|
leafletHelper.route.toggle(this.$store.state.mapControlRoute)
|
|
|
leafletHelper.player.togglePlayer(this.$store.state.mapControlPlayer)
|
|
|
leafletHelper.player.toggleTooltip(this.$store.state.mapControlTooltip)
|
|
|
@@ -325,123 +402,129 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
leafletHelper.global.savePlayersData()
|
|
|
},
|
|
|
// 自助赛事详情查询
|
|
|
- compInfoDetail() {
|
|
|
- uni.request({
|
|
|
- url: apiCompInfoDetail,
|
|
|
- header: this.metadata,
|
|
|
- method: "POST",
|
|
|
- data: {
|
|
|
- compId: this.compId
|
|
|
- },
|
|
|
- success: (res) => {
|
|
|
- // console.log("[compInfoDetail] res", res);
|
|
|
- if (checkResCode(res)) {
|
|
|
- const data = res.data.data;
|
|
|
- this.actRs = data;
|
|
|
- }
|
|
|
- },
|
|
|
- fail: (err) => {
|
|
|
- console.log("[compInfoDetail] err", err);
|
|
|
- },
|
|
|
- });
|
|
|
+ async compInfoDetail(compId) {
|
|
|
+ try {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ uni.request({
|
|
|
+ url: apiCompInfoDetail,
|
|
|
+ header: this.metadata,
|
|
|
+ method: "POST",
|
|
|
+ data: {
|
|
|
+ compId: compId
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ // console.log("[compInfoDetail] res", res);
|
|
|
+ if (checkResCode(res)) {
|
|
|
+ const data = res.data.data;
|
|
|
+ resolve(data);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: (err) => {
|
|
|
+ console.log("[compInfoDetail] err", err);
|
|
|
+ reject(err);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } catch (e) {
|
|
|
+ console.log('[compInfoDetail] err', e)
|
|
|
+ reject(e)
|
|
|
+ }
|
|
|
},
|
|
|
// 自助赛事详情查询
|
|
|
- getMapList() {
|
|
|
- uni.request({
|
|
|
- url: apiMapList,
|
|
|
- header: this.metadata,
|
|
|
- method: "POST",
|
|
|
- data: {
|
|
|
- compId: this.compId
|
|
|
- },
|
|
|
- success: (res) => {
|
|
|
- console.log("[getMapList] res", res);
|
|
|
- if (checkResCode(res)) {
|
|
|
- const data = res.data.data;
|
|
|
- this.mapList = data.list;
|
|
|
- this.mapId = data.list[0].id;
|
|
|
- this.selectMapChange();
|
|
|
- }
|
|
|
- },
|
|
|
- fail: (err) => {
|
|
|
- console.log("[getMapList] err", err);
|
|
|
- },
|
|
|
- });
|
|
|
+ async getMapList(compId) {
|
|
|
+ try {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ uni.request({
|
|
|
+ url: apiMapList,
|
|
|
+ header: this.metadata,
|
|
|
+ method: "POST",
|
|
|
+ data: {
|
|
|
+ compId: compId
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ // console.log("[getMapList] res", res);
|
|
|
+ if (checkResCode(res)) {
|
|
|
+ const data = res.data.data;
|
|
|
+ resolve(data.list);
|
|
|
+ } else {
|
|
|
+ reject(res);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: (err) => {
|
|
|
+ console.log("[getMapList] err", err);
|
|
|
+ reject(err);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } catch (e) {
|
|
|
+ console.log('[getMapList] err', e)
|
|
|
+ reject(e)
|
|
|
+ }
|
|
|
},
|
|
|
// 赛事监控地图详情
|
|
|
- getMapDetail() {
|
|
|
- uni.request({
|
|
|
- url: apiMapDetail,
|
|
|
- header: this.metadata,
|
|
|
- method: "POST",
|
|
|
- data: {
|
|
|
- compId: this.compId,
|
|
|
- mapId: this.mapId
|
|
|
- },
|
|
|
- success: (res) => {
|
|
|
- console.log("[getMapDetail] res", res);
|
|
|
- if (checkResCode(res)) {
|
|
|
- const data = res.data.data;
|
|
|
- this.mapDetail = data;
|
|
|
- this.mapInfo = data.mapInfo;
|
|
|
- // this.mapUrl = data.mapInfo.mapUrl;
|
|
|
- // console.log("[getMapDetail] mapInfo", this.mapInfo);
|
|
|
- }
|
|
|
- },
|
|
|
- fail: (err) => {
|
|
|
- console.log("[getMapDetail] err", err);
|
|
|
- },
|
|
|
- });
|
|
|
+ async getMapDetail(compId, mapId) {
|
|
|
+ try {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ uni.request({
|
|
|
+ url: apiMapDetail,
|
|
|
+ header: this.metadata,
|
|
|
+ method: "POST",
|
|
|
+ data: {
|
|
|
+ compId: compId,
|
|
|
+ mapId: mapId
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ // console.log("[getMapDetail] res", res);
|
|
|
+ if (checkResCode(res)) {
|
|
|
+ const data = res.data.data;
|
|
|
+ resolve(data);
|
|
|
+ } else {
|
|
|
+ reject(res);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: (err) => {
|
|
|
+ console.log("[getMapDetail] err", err);
|
|
|
+ reject(err);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } catch (e) {
|
|
|
+ console.log('[getMapDetail] err', e)
|
|
|
+ reject(e)
|
|
|
+ }
|
|
|
},
|
|
|
// 赛事监控地图下的活动列表
|
|
|
- getActionList() {
|
|
|
- uni.request({
|
|
|
- url: apiActionList,
|
|
|
- header: this.metadata,
|
|
|
- method: "POST",
|
|
|
- data: {
|
|
|
- compId: this.compId,
|
|
|
- mapId: this.mapId
|
|
|
- },
|
|
|
- success: (res) => {
|
|
|
- console.log("[getActionList] res", res);
|
|
|
- if (checkResCode(res)) {
|
|
|
- const data = res.data.data;
|
|
|
- this.actionList = data.list;
|
|
|
- this.actionId = data.list[0].id;
|
|
|
- this.selectActionChange();
|
|
|
- }
|
|
|
- },
|
|
|
- fail: (err) => {
|
|
|
- console.log("[getActionList] err", err);
|
|
|
- },
|
|
|
- });
|
|
|
+ async getActionList(compId, mapId) {
|
|
|
+ try {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ uni.request({
|
|
|
+ url: apiActionList,
|
|
|
+ header: this.metadata,
|
|
|
+ method: "POST",
|
|
|
+ data: {
|
|
|
+ compId: compId,
|
|
|
+ mapId: mapId
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ // console.log("[getActionList] res", res);
|
|
|
+ if (checkResCode(res)) {
|
|
|
+ const data = res.data.data;
|
|
|
+ resolve(data.list);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: (err) => {
|
|
|
+ console.log("[getActionList] err", err);
|
|
|
+ reject(err);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } catch (e) {
|
|
|
+ console.log('[getActionList] err', e)
|
|
|
+ reject(e)
|
|
|
+ }
|
|
|
},
|
|
|
// 赛事监控地图下的活动详情
|
|
|
- getActionDetail() {
|
|
|
- uni.request({
|
|
|
- url: apiActionDetail,
|
|
|
- header: this.metadata,
|
|
|
- method: "POST",
|
|
|
- data: {
|
|
|
- actId: this.actionId
|
|
|
- },
|
|
|
- success: (res) => {
|
|
|
- console.log("[getActionDetail] res", res);
|
|
|
- if (checkResCode(res)) {
|
|
|
- const data = res.data.data;
|
|
|
- this.actionDetail = data;
|
|
|
-
|
|
|
- this.loadData();
|
|
|
- }
|
|
|
- },
|
|
|
- fail: (err) => {
|
|
|
- console.log("[getActionDetail] err", err);
|
|
|
- },
|
|
|
- });
|
|
|
- },
|
|
|
- //场控端_活动详情
|
|
|
- /* async getActionDetail() {
|
|
|
+ async getActionDetail(actionId, courseId) {
|
|
|
try {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
uni.request({
|
|
|
@@ -449,18 +532,18 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
header: this.metadata,
|
|
|
method: "POST",
|
|
|
data: {
|
|
|
- actId: this.actionId
|
|
|
+ actId: actionId,
|
|
|
+ courseId: courseId
|
|
|
},
|
|
|
success: (res) => {
|
|
|
- console.log("getActionDetail", res);
|
|
|
+ // console.log("[getActionDetail] res", res);
|
|
|
if (checkResCode(res)) {
|
|
|
- resolve(res);
|
|
|
- } else {
|
|
|
- reject(res);
|
|
|
+ const data = res.data.data;
|
|
|
+ resolve(data);
|
|
|
}
|
|
|
},
|
|
|
fail: (err) => {
|
|
|
- console.log("getActionDetail err", err);
|
|
|
+ console.log("[getActionDetail] err", err);
|
|
|
reject(err);
|
|
|
},
|
|
|
});
|
|
|
@@ -469,7 +552,7 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
console.log('[getActionDetail] err', e)
|
|
|
reject(e)
|
|
|
}
|
|
|
- }, */
|
|
|
+ },
|
|
|
//场控端_正在进行中所有用户实时信息
|
|
|
async getUsersInGameDetail() {
|
|
|
try {
|
|
|
@@ -479,10 +562,11 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
header: this.metadata,
|
|
|
method: "POST",
|
|
|
data: {
|
|
|
- actId: this.actionId
|
|
|
+ actId: this.actionId,
|
|
|
+ courseId: this.courseId
|
|
|
},
|
|
|
success: (res) => {
|
|
|
- console.log("getUsersInGameDetail", res);
|
|
|
+ // console.log("[getUsersInGameDetail] res", res);
|
|
|
if (checkResCode(res)) {
|
|
|
resolve(res.data.data.users);
|
|
|
} else {
|
|
|
@@ -490,7 +574,7 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
}
|
|
|
},
|
|
|
fail: (err) => {
|
|
|
- console.log("getUsersInGameDetail err", err);
|
|
|
+ console.log("[getUsersInGameDetail] err", err);
|
|
|
reject(err);
|
|
|
},
|
|
|
});
|
|
|
@@ -509,10 +593,11 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
header: this.metadata,
|
|
|
method: "POST",
|
|
|
data: {
|
|
|
- actId: this.actionId
|
|
|
+ actId: this.actionId,
|
|
|
+ courseId: this.courseId
|
|
|
},
|
|
|
success: (res) => {
|
|
|
- console.log("usersInGameGpsQuery", res);
|
|
|
+ // console.log("[usersInGameGpsQuery] res", res);
|
|
|
if (checkResCode(res)) {
|
|
|
resolve(res.data.data.gpsInfo);
|
|
|
} else {
|
|
|
@@ -520,7 +605,7 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
}
|
|
|
},
|
|
|
fail: (err) => {
|
|
|
- console.log("usersInGameGpsQuery err", err);
|
|
|
+ console.log("[usersInGameGpsQuery] err", err);
|
|
|
reject(err);
|
|
|
},
|
|
|
});
|
|
|
@@ -530,9 +615,56 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
reject(e)
|
|
|
}
|
|
|
},
|
|
|
+ makeActionsTree(actSelectRs) {
|
|
|
+ this.actionsTree.length = 0 // 先清空数组
|
|
|
+ for (let i = 0; i < actSelectRs.length; i++) {
|
|
|
+ var act = actSelectRs[i]
|
|
|
+ var pushData = {
|
|
|
+ text: act.actName,
|
|
|
+ value: act.actId,
|
|
|
+ children: []
|
|
|
+ }
|
|
|
+
|
|
|
+ var actUserNum = 0
|
|
|
+ for (let j = 0; j < act.courseSelectRs.length; j++) {
|
|
|
+ var course = act.courseSelectRs[j]
|
|
|
+ const courseUserNum = course.courseUserNum > 0 ? course.courseUserNum : 0
|
|
|
+ actUserNum += courseUserNum
|
|
|
+ pushData.children.push({
|
|
|
+ text: course.courseName + ' (' + courseUserNum + '人)',
|
|
|
+ value: act.actId + '-' + course.courseId
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (actUserNum >= 0) {
|
|
|
+ pushData.children.unshift({
|
|
|
+ text: '全部 (' + actUserNum + '人)',
|
|
|
+ value: act.actId + '-' + 0
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ pushData.text += ' (' + actUserNum + '人)'
|
|
|
+ this.actionsTree.push(pushData)
|
|
|
+ }
|
|
|
+ // console.log("[makeActionsTree]" + JSON.stringify(this.actionsTree))
|
|
|
+ },
|
|
|
onActionChange(e) {
|
|
|
- const value = e.detail.value
|
|
|
- console.log("onActionChange", value)
|
|
|
+ const sltActRoute = e.detail.value
|
|
|
+ // console.log("onActionChange", sltActRoute)
|
|
|
+ this.$store.commit('setMapSltActRoute', sltActRoute)
|
|
|
+
|
|
|
+ if (sltActRoute == null || sltActRoute.length == 0) {
|
|
|
+ this.reLoad()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.loadData(sltActRoute)
|
|
|
+ },
|
|
|
+ onActionsTreePopupOpened() {
|
|
|
+ // console.log("onActionsTreePopupOpened")
|
|
|
+ this.actionsTreePopup = true
|
|
|
+ },
|
|
|
+ onActionsTreePopupClosed() {
|
|
|
+ console.log("onActionsTreePopupClosed")
|
|
|
+ this.actionsTreePopup = false
|
|
|
},
|
|
|
onPlayerListItemClick(item) {
|
|
|
// console.log("onListItemClick", item)
|
|
|
@@ -561,16 +693,21 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
getESelectText(data) {
|
|
|
// console.log("getESelectText:", data);
|
|
|
},
|
|
|
- selectMapChange(data) {
|
|
|
+ async selectMapChange(data) {
|
|
|
// console.log("selectMapChange:", data);
|
|
|
- this.getMapDetail();
|
|
|
- this.getActionList();
|
|
|
+ this.mapId = data.id;
|
|
|
+ await loadActionsTree();
|
|
|
+
|
|
|
+ this.actionList = await this.getActionList(this.compId, this.mapId);
|
|
|
+ this.actionId = this.actionList[0].id;
|
|
|
},
|
|
|
- selectActionChange(data) {
|
|
|
+ /* async selectActionChange(data) {
|
|
|
// console.log("selectActionChange:", data);
|
|
|
- this.getActionDetail();
|
|
|
- },
|
|
|
+ this.actionId = data.id;
|
|
|
+ this.actionDetail = await this.getActionDetail(this.actionId);
|
|
|
+ }, */
|
|
|
btnBack() {
|
|
|
+ this.clear();
|
|
|
const url = "/pages/actManage/actDetail?" + this.queryString;
|
|
|
tools.appAction(url, "uni.navigateTo");
|
|
|
},
|
|
|
@@ -598,7 +735,8 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
}
|
|
|
|
|
|
.select {
|
|
|
- width: 48%;
|
|
|
+ /* width: 48%; */
|
|
|
+ width: 96%;
|
|
|
}
|
|
|
|
|
|
.map {
|
|
|
@@ -610,10 +748,11 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
|
|
|
.popup {
|
|
|
display: flex;
|
|
|
+ height: 30vh;
|
|
|
+ overflow: scroll;
|
|
|
flex-direction: column;
|
|
|
align-items: center;
|
|
|
- background-color: #f5f5f5;
|
|
|
- /* border-left: #dedede solid 1px; */
|
|
|
+ background-color: #ffffff;
|
|
|
border-top: #dedede solid 1px;
|
|
|
}
|
|
|
|
|
|
@@ -621,8 +760,23 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
width: 100%;
|
|
|
}
|
|
|
|
|
|
- .scroll {
|
|
|
- overflow: scroll;
|
|
|
+ .actionsTree {
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .input-value-border {
|
|
|
+ border-top: 1px solid #e5e5e5;
|
|
|
+ border-bottom: 1px solid #e5e5e5;
|
|
|
+ border-left: 0;
|
|
|
+ border-right: 0;
|
|
|
+ border-radius: 0px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .uni-scroll-view {
|
|
|
+ overflow: unset !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .uni-section-header {
|
|
|
+ padding-right: 7px !important;
|
|
|
}
|
|
|
|
|
|
.section-title {
|
|
|
@@ -637,25 +791,6 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
height: 100%;
|
|
|
}
|
|
|
|
|
|
- /* .section-content-item {
|
|
|
- display: flex;
|
|
|
- flex-direction: row;
|
|
|
- align-items: center;
|
|
|
- height: 46px;
|
|
|
- } */
|
|
|
-
|
|
|
- /* .actionsTree {
|
|
|
- /deep/ .input-value-border {
|
|
|
- border-top: 1px solid #e5e5e5;
|
|
|
- border-bottom: 1px solid #e5e5e5;
|
|
|
- border-radius: 0px;
|
|
|
- }
|
|
|
-
|
|
|
- /deep/ .uni-scroll-view {
|
|
|
- overflow: unset !important;
|
|
|
- }
|
|
|
- } */
|
|
|
-
|
|
|
.list {
|
|
|
margin-left: -6px;
|
|
|
}
|
|
|
@@ -688,7 +823,7 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
font-size: 13px;
|
|
|
color: #424242;
|
|
|
line-height: 18px;
|
|
|
- white-space: nowrap;
|
|
|
+ /* white-space: nowrap; */
|
|
|
}
|
|
|
|
|
|
.slot-sn {
|
|
|
@@ -700,7 +835,7 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
|
|
|
.slot-note {
|
|
|
flex: 1;
|
|
|
- margin-left: 20px;
|
|
|
+ margin-left: 25px;
|
|
|
font-size: 12px;
|
|
|
color: #7d8da7;
|
|
|
line-height: 18px;
|
|
|
@@ -721,7 +856,4 @@ https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
|
|
|
line-height: 50px;
|
|
|
}
|
|
|
|
|
|
- /* /deep/ .uni-data-tree-dialog {
|
|
|
- top: 39px;
|
|
|
- } */
|
|
|
</style>
|