track.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851
  1. <!--
  2. 场控
  3. http://localhost:5173/actMgt/#/pages/actManage/track?compId=80
  4. https://oss-mbh5.colormaprun.com/actMgt/#/pages/actManage/track?compId=80
  5. -->
  6. <template>
  7. <view class="body">
  8. <view class="content uni-column">
  9. <view class="uni-column top" :style="getBannerStyle()">
  10. <my-topbar :title="actRs.config.matchInfo.compName" @btnBackClick="btnBack"></my-topbar>
  11. <view class="top-content uni-row">
  12. </view>
  13. </view>
  14. <view class="main uni-column">
  15. <view class="selectBox uni-row uni-jcse">
  16. <view class="select">
  17. <e-select v-model="mapId" maxHeight="300px" :props="selectMapProps" :options="mapList"
  18. :search="false" :inputClick="false" :clearable="false" @getText="getESelectText"
  19. @change="selectMapChange"></e-select>
  20. </view>
  21. <!-- <view class="select">
  22. <e-select v-model="actionId" maxHeight="300px" :props="selectActionProps" :options="actionList"
  23. :search="false" :inputClick="false" :clearable="false" @getText="getESelectText"
  24. @change="selectActionChange"></e-select>
  25. </view> -->
  26. </view>
  27. <view id="map" class="map"></view>
  28. <view v-show="popupShow" class="popup"
  29. :style="{ height: popupHeight + 'px', width: popupWidth + 'px' }">
  30. <uni-section class="section" title="活动路线列表" type="line">
  31. <template v-slot:right>
  32. <uni-icons @click="leafletHelper.elListClick(leafletHelper)" type="closeempty"
  33. size="16"></uni-icons>
  34. </template>
  35. <uni-data-picker ref="actionsTree" class="actionsTree" :style="{ width: popupWidth + 'px' }" placeholder="请选择活动路线"
  36. popup-title="请选择活动路线" :localdata="actionsTree" v-model="sltActRoute" :clear-icon="false"
  37. @change="onActionChange" @popupopened="onActionsTreePopupOpened"
  38. @popupclosed="onActionsTreePopupClosed"></uni-data-picker>
  39. </uni-section>
  40. <uni-section class="section" :title="'玩家列表 (' + playersNum + '人)'" type="line">
  41. <view class="norecord" v-if="playersNum == 0">暂无记录</view>
  42. <scroll-view v-else :scroll-top="0" scroll-y="true" :style="{ height: popupHeight - 122 + 'px'}">
  43. <uni-list v-for="(item, index) in players" :key="index" :border="true" class="list">
  44. <uni-list-item :clickable="true" @click="onPlayerListItemClick(item)" class="list-item"
  45. :class="{
  46. 'list-item-focus': focusPlayerId == item.id
  47. }">
  48. <template v-slot:header>
  49. <!-- <image class="slot-image" src="/static/logo.png" mode="widthFix"></image> -->
  50. <div class="slot-image" :style="'background-color:' + getPlayerColor(item.id)">
  51. </div>
  52. </template>
  53. <template v-slot:body>
  54. <view class="slot-box">
  55. <view class="slot-title">
  56. <!-- <span class="slot-sn" :style="'background-color:' + getPlayerColor(item.id)">{{index+1}}</span> -->
  57. [{{index+1}}]<span class="slot-phone" @click="onPhoneClick(item.phone)">
  58. {{item.name}}
  59. <uni-icons v-if="admin" type="phone" size="14"></uni-icons>
  60. </span>
  61. 打点 {{item.EffectiveNum}}/{{item.TotalControlNum}} &nbsp; 目标点
  62. {{item.nextControlPoint.orderNO}} &nbsp; <!-- 百味豆 {{item.sysPoint}} -->
  63. </view>
  64. <view class="slot-note">
  65. 距离 {{tools.fmtDistanctKm(item.distance)}}km &nbsp; 配速
  66. {{tools.convertSecondsToHMS(item.pace, 2)}}
  67. &nbsp; Cal {{Math.round(item.Calorie/1000)}} &nbsp;
  68. 百味豆 {{item.sysPoint}}
  69. <!-- | &nbsp; 心率 {{item.lastHr}} &nbsp; 平均 {{item.avgHr}} &nbsp; 最大 {{item.maxHr}}-->
  70. <!-- &nbsp; | &nbsp; Ck {{item.Ck}} Ei {{Math.round(item.Ei*100)/100}}-->
  71. </view>
  72. </view>
  73. </template>
  74. <!-- <template v-slot:footer>
  75. <image class="slot-image" src="/static/logo.png" mode="widthFix"></image>
  76. </template> -->
  77. </uni-list-item>
  78. </uni-list>
  79. </scroll-view>
  80. </uni-section>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. </template>
  86. <script>
  87. import {
  88. mapState,
  89. mapGetters
  90. } from 'vuex';
  91. import tools from '/utils/tools.js';
  92. import card from '/utils/card.js';
  93. import 'leaflet/dist/leaflet.css';
  94. import '/utils/map/leafletHelper.css'
  95. import leafletHelper from '/utils/map/leafletHelper';
  96. import mapHelper from '/utils/map/mapHelper';
  97. import {
  98. apiCompInfoDetail,
  99. apiMapList,
  100. apiMapDetail,
  101. apiActionList,
  102. apiActionDetail,
  103. apiUsersInGameDetail,
  104. apiUsersInGameGpsQuery,
  105. checkResCode
  106. } from '/utils/api.js';
  107. export default {
  108. data() {
  109. return {
  110. leafletHelper: leafletHelper,
  111. tools: tools,
  112. queryObj: {},
  113. queryString: "",
  114. interval_loadActionsTree: null,
  115. interval_loadData: null,
  116. actionsTreePopup: false,
  117. refreshTime_loadData: 3000, // 刷新时间 ms
  118. refreshTime_loadActionsTree: 10000, // 刷新时间 ms
  119. admin: true, // 是否场控管理员
  120. compId: 0, // 赛事ID
  121. actRs: card.actRs, // 赛事详情
  122. mapList: [], // 地图列表
  123. mapId: 0, // (当前选中的)地图ID
  124. mapDetail: {}, // (当前选中的)地图详情
  125. mapInfo: {}, // (当前选中的)地图信息 mapDetail.mapInfo
  126. mapUrl: null, // (当前选中的)地图图片URL
  127. mapConfig: "", // (当前选中的)地图图片的地理参考信息
  128. actionList: [], // 活动列表
  129. actionId: 0, // (当前选中的)活动ID
  130. actionDetail: {}, // (当前选中的)活动详情
  131. courseId: 0, // (当前选中的)路线ID
  132. selectMapProps: {
  133. value: 'id',
  134. text: 'name',
  135. // disabled: 'noallowed'
  136. },
  137. selectActionProps: {
  138. value: 'id',
  139. text: 'name',
  140. // disabled: 'noallowed'
  141. },
  142. map: null,
  143. checkPoints: [],
  144. players: [],
  145. players_position: [],
  146. focusPlayerId: 0,
  147. trailTime: 0,
  148. sltActRoute: '',
  149. actionsTree: [],
  150. popupHeight: 360,
  151. popupWidth: 0,
  152. popupType: 'bottom',
  153. popupShow: false,
  154. }
  155. },
  156. computed: {
  157. ...mapState([
  158. 'username', // 映射 this.username 为 store.state.username
  159. 'userlevel',
  160. 'token'
  161. ]),
  162. ...mapGetters([
  163. 'metadata'
  164. ]),
  165. playersNum() {
  166. if (this.players && this.players.length > 0) {
  167. return this.players.length;
  168. } else {
  169. return 0;
  170. }
  171. },
  172. players_position_num() {
  173. if (this.players_position && this.players_position.length > 0) {
  174. return this.players_position.length;
  175. } else {
  176. return 0;
  177. }
  178. },
  179. players_position_num_text() {
  180. if (this.players_position_num > 0) {
  181. return this.players_position_num;
  182. } else {
  183. return "";
  184. }
  185. }
  186. },
  187. async onLoad(query) {
  188. // console.log(query);
  189. this.queryObj = query;
  190. this.queryString = tools.objectToQueryString(this.queryObj);
  191. // console.log(queryString);
  192. this.compId = query["compId"] ?? 0;
  193. this.actRs = await this.compInfoDetail(this.compId);
  194. this.mapList = await this.getMapList(this.compId);
  195. this.mapId = this.mapList[0].id;
  196. await this.loadMap();
  197. // this.actionList = await this.getActionList(this.compId, this.mapId);
  198. // this.actionId = this.actionList[0].id;
  199. // this.actionDetail = await this.getActionDetail(this.actionId);
  200. // console.log("====> mapSltMapId:", this.$store.state.mapSltMapId);
  201. if (this.mapId == this.$store.state.mapSltMapId) { // 页面重载
  202. console.log("[onLoad] 页面重载 mapId:", this.mapId);
  203. this.sltActRoute = this.$store.state.mapSltActRoute;
  204. this.loadData(this.sltActRoute);
  205. }
  206. if (this.interval_loadActionsTree != null) {
  207. clearInterval(this.interval_loadActionsTree)
  208. }
  209. let that = this
  210. this.interval_loadActionsTree = setInterval(async function() {
  211. if (!that.actionsTreePopup) {
  212. await that.loadActionsTree()
  213. }
  214. }, that.refreshTime_loadActionsTree);
  215. // 自动弹出活动路线列表窗口 供用户选择
  216. leafletHelper.elListClick(leafletHelper);
  217. this.$refs.actionsTree.show();
  218. },
  219. mounted() {
  220. // console.log("mounted");
  221. this.$global.getWindowInfo();
  222. uni.$on('windowResize', this.reLoad);
  223. this.popupShow = this.$store.state.mapPopupShow;
  224. this.layoutInit()
  225. },
  226. beforeDestroy() {
  227. console.log("beforeDestroy")
  228. this.clear();
  229. },
  230. methods: {
  231. clear() {
  232. if (this.interval_loadActionsTree != null) {
  233. clearInterval(this.interval_loadActionsTree);
  234. }
  235. if (this.interval_loadData != null) {
  236. clearInterval(this.interval_loadData);
  237. }
  238. leafletHelper.free();
  239. uni.$off('windowResize', this.reLoad);
  240. },
  241. getBannerStyle() {
  242. return card.getBannerStyle(this.actRs);
  243. },
  244. reLoad() {
  245. this.clear();
  246. this.$store.commit('setMapSltMapId', this.mapId)
  247. this.savePlayersData()
  248. var fullPath = this.$route.fullPath
  249. console.log("[windowResize] reLaunch: " + fullPath)
  250. uni.redirectTo({
  251. url: fullPath
  252. });
  253. },
  254. // 布局初始化 设置地图高度
  255. layoutInit() {
  256. this.popupWidth = this.$global.windowWidth
  257. },
  258. popupToggle() {
  259. this.popupShow = !this.popupShow
  260. this.$store.commit('setMapPopupShow', this.popupShow)
  261. // this.layoutInit()
  262. },
  263. async loadMap() {
  264. await this.loadActionsTree();
  265. /* uni.setNavigationBarTitle({
  266. title: this.mapDetail.mapInfo.mapName
  267. }); */
  268. await mapHelper.handleMapInfo(this, this.mapInfo);
  269. this.mapUrl = mapHelper.mapUrl;
  270. this.mapConfig = mapHelper.mapConfig;
  271. await this.initMap();
  272. this.handleMapToggle();
  273. },
  274. async loadActionsTree() {
  275. this.mapDetail = await this.getMapDetail(this.compId, this.mapId);
  276. this.mapInfo = this.mapDetail.mapInfo;
  277. this.makeActionsTree(this.mapDetail.actSelectRs);
  278. },
  279. async initMap() {
  280. const zoomNum = this.mapInfo.DefScale;
  281. const mapOptions = {
  282. zoom: zoomNum
  283. };
  284. if (this.mapUrl != undefined && this.mapUrl.length > 0) {
  285. // console.log("[initMap] mapUrl", this.mapUrl);
  286. await leafletHelper.init(this, 'map', this.mapUrl, this.mapConfig, mapOptions);
  287. }
  288. },
  289. async loadData(sltActRoute) {
  290. // console.log("[loadData] sltActRoute: ", sltActRoute);
  291. if (sltActRoute == null || sltActRoute.length == 0) {
  292. console.log("[loadData] return: sltActRoute is null ");
  293. return;
  294. }
  295. var actRouteArr = sltActRoute[1].value.split('-');
  296. this.actionId = actRouteArr[0];
  297. this.courseId = actRouteArr[1];
  298. this.actionDetail = await this.getActionDetail(this.actionId, this.courseId);
  299. /* uni.setNavigationBarTitle({
  300. title: this.mapDetail.mapinfo.mapname + ' - ' + this.actionDetail.name
  301. }); */
  302. if (this.interval_loadData != null) {
  303. clearInterval(this.interval_loadData);
  304. }
  305. this.players = await this.getUsersInGameDetail();
  306. // console.log('players', this.players)
  307. // leafletHelper.global.setPlayers(this.players)
  308. this.players_position = await this.usersInGameGpsQuery();
  309. // leafletHelper.global.setPlayersPosition(this.players_position)
  310. this.handleMapDrawRoute();
  311. this.handleMapDrawPlayer();
  312. this.handleMapDrawTrail();
  313. let that = this;
  314. this.interval_loadData = setInterval(async function() {
  315. that.players = await that.getUsersInGameDetail();
  316. that.players_position = await that.usersInGameGpsQuery();
  317. //// leaflet.leafletHelper.global.setPlayers(that.players);
  318. // leafletHelper.global.setPlayersPosition(that.players_position);
  319. that.handleMapDrawPlayer();
  320. that.handleMapDrawTrail();
  321. }, that.refreshTime_loadData);
  322. // await mapHelper.handleMapInfo(this, this.mapInfo)
  323. // this.handleMapToggle(); // to del
  324. },
  325. handleWindowResize() {
  326. leafletHelper.onWindowResize()
  327. },
  328. handleMapDrawRoute() {
  329. // console.log("this.actionDetail.routes", this.actionDetail.routes);
  330. // leafletHelper.global.setCheckPoints(this.checkPoints)
  331. leafletHelper.global.setRoutes(this.actionDetail.routes)
  332. // leafletHelper.checkPoint.drawAllCheckPoints()
  333. // leafletHelper.checkPoint.drawPath()
  334. leafletHelper.route.drawAllRoutes()
  335. leafletHelper.route.drawAllPath()
  336. },
  337. handleMapDrawPlayer() {
  338. leafletHelper.global.setPlayers(this.players)
  339. leafletHelper.global.setPlayersPosition(this.players_position)
  340. leafletHelper.player.drawAllPlayers()
  341. leafletHelper.global.dealStaleData()
  342. },
  343. handleMapDrawTrail() {
  344. this.trailTime = leafletHelper.config.trailTime
  345. // leafletHelper.player.drawOneTrail(2, 10000)
  346. // leafletHelper.player.drawOneTrail(2, 0, false)
  347. leafletHelper.player.drawAllTrails(this.trailTime)
  348. },
  349. handleMapToggle() {
  350. leafletHelper.route.toggle(this.$store.state.mapControlRoute)
  351. leafletHelper.player.togglePlayer(this.$store.state.mapControlPlayer)
  352. leafletHelper.player.toggleTooltip(this.$store.state.mapControlTooltip)
  353. leafletHelper.player.toggleTrail(this.$store.state.mapControlTrail)
  354. },
  355. handlePlayerListItemClick(item) {
  356. this.focusPlayerId = item.id
  357. leafletHelper.player.handleFocusPlayer(this.focusPlayerId)
  358. },
  359. getPlayerColor(playerId) {
  360. if (playerId != this.focusPlayerId)
  361. return leafletHelper.player.getPlayerColor(playerId)
  362. else
  363. return leafletHelper.config.gStyle.marker.focus.fillColor
  364. },
  365. // 页面reLoad前调用本方法,将用户数据先保存,页面重载后再进行数据恢复
  366. savePlayersData() {
  367. leafletHelper.global.savePlayersData()
  368. },
  369. // 自助赛事详情查询
  370. async compInfoDetail(compId) {
  371. try {
  372. return new Promise((resolve, reject) => {
  373. uni.request({
  374. url: apiCompInfoDetail,
  375. header: this.metadata,
  376. method: "POST",
  377. data: {
  378. compId: compId
  379. },
  380. success: (res) => {
  381. // console.log("[compInfoDetail] res", res);
  382. if (checkResCode(res)) {
  383. const data = res.data.data;
  384. resolve(data);
  385. }
  386. },
  387. fail: (err) => {
  388. console.log("[compInfoDetail] err", err);
  389. reject(err);
  390. },
  391. });
  392. });
  393. } catch (e) {
  394. console.log('[compInfoDetail] err', e)
  395. reject(e)
  396. }
  397. },
  398. // 自助赛事详情查询
  399. async getMapList(compId) {
  400. try {
  401. return new Promise((resolve, reject) => {
  402. uni.request({
  403. url: apiMapList,
  404. header: this.metadata,
  405. method: "POST",
  406. data: {
  407. compId: compId
  408. },
  409. success: (res) => {
  410. // console.log("[getMapList] res", res);
  411. if (checkResCode(res)) {
  412. const data = res.data.data;
  413. resolve(data.list);
  414. } else {
  415. reject(res);
  416. }
  417. },
  418. fail: (err) => {
  419. console.log("[getMapList] err", err);
  420. reject(err);
  421. },
  422. });
  423. });
  424. } catch (e) {
  425. console.log('[getMapList] err', e)
  426. reject(e)
  427. }
  428. },
  429. // 赛事监控地图详情
  430. async getMapDetail(compId, mapId) {
  431. try {
  432. return new Promise((resolve, reject) => {
  433. uni.request({
  434. url: apiMapDetail,
  435. header: this.metadata,
  436. method: "POST",
  437. data: {
  438. compId: compId,
  439. mapId: mapId
  440. },
  441. success: (res) => {
  442. // console.log("[getMapDetail] res", res);
  443. if (checkResCode(res)) {
  444. const data = res.data.data;
  445. resolve(data);
  446. } else {
  447. reject(res);
  448. }
  449. },
  450. fail: (err) => {
  451. console.log("[getMapDetail] err", err);
  452. reject(err);
  453. },
  454. });
  455. });
  456. } catch (e) {
  457. console.log('[getMapDetail] err', e)
  458. reject(e)
  459. }
  460. },
  461. // 赛事监控地图下的活动列表
  462. async getActionList(compId, mapId) {
  463. try {
  464. return new Promise((resolve, reject) => {
  465. uni.request({
  466. url: apiActionList,
  467. header: this.metadata,
  468. method: "POST",
  469. data: {
  470. compId: compId,
  471. mapId: mapId
  472. },
  473. success: (res) => {
  474. // console.log("[getActionList] res", res);
  475. if (checkResCode(res)) {
  476. const data = res.data.data;
  477. resolve(data.list);
  478. }
  479. },
  480. fail: (err) => {
  481. console.log("[getActionList] err", err);
  482. reject(err);
  483. },
  484. });
  485. });
  486. } catch (e) {
  487. console.log('[getActionList] err', e)
  488. reject(e)
  489. }
  490. },
  491. // 赛事监控地图下的活动详情
  492. async getActionDetail(actionId, courseId) {
  493. try {
  494. return new Promise((resolve, reject) => {
  495. uni.request({
  496. url: apiActionDetail,
  497. header: this.metadata,
  498. method: "POST",
  499. data: {
  500. actId: actionId,
  501. courseId: courseId
  502. },
  503. success: (res) => {
  504. // console.log("[getActionDetail] res", res);
  505. if (checkResCode(res)) {
  506. const data = res.data.data;
  507. resolve(data);
  508. }
  509. },
  510. fail: (err) => {
  511. console.log("[getActionDetail] err", err);
  512. reject(err);
  513. },
  514. });
  515. });
  516. } catch (e) {
  517. console.log('[getActionDetail] err', e)
  518. reject(e)
  519. }
  520. },
  521. //场控端_正在进行中所有用户实时信息
  522. async getUsersInGameDetail() {
  523. try {
  524. return new Promise((resolve, reject) => {
  525. uni.request({
  526. url: apiUsersInGameDetail,
  527. header: this.metadata,
  528. method: "POST",
  529. data: {
  530. actId: this.actionId,
  531. courseId: this.courseId
  532. },
  533. success: (res) => {
  534. // console.log("[getUsersInGameDetail] res", res);
  535. if (checkResCode(res)) {
  536. resolve(res.data.data.users);
  537. } else {
  538. reject(res);
  539. }
  540. },
  541. fail: (err) => {
  542. console.log("[getUsersInGameDetail] err", err);
  543. reject(err);
  544. },
  545. });
  546. });
  547. } catch (e) {
  548. console.log('[getUsersInGameDetail] err', e)
  549. reject(e)
  550. }
  551. },
  552. //场控端_正在进行中所有用户实时gps查询
  553. async usersInGameGpsQuery() {
  554. try {
  555. return new Promise((resolve, reject) => {
  556. uni.request({
  557. url: apiUsersInGameGpsQuery,
  558. header: this.metadata,
  559. method: "POST",
  560. data: {
  561. actId: this.actionId,
  562. courseId: this.courseId
  563. },
  564. success: (res) => {
  565. // console.log("[usersInGameGpsQuery] res", res);
  566. if (checkResCode(res)) {
  567. resolve(res.data.data.gpsInfo);
  568. } else {
  569. reject(res);
  570. }
  571. },
  572. fail: (err) => {
  573. console.log("[usersInGameGpsQuery] err", err);
  574. reject(err);
  575. },
  576. });
  577. });
  578. } catch (e) {
  579. console.log('[usersInGameGpsQuery] err', e)
  580. reject(e)
  581. }
  582. },
  583. makeActionsTree(actSelectRs) {
  584. this.actionsTree.length = 0 // 先清空数组
  585. for (let i = 0; i < actSelectRs.length; i++) {
  586. var act = actSelectRs[i]
  587. var pushData = {
  588. text: act.actName,
  589. value: act.actId,
  590. children: []
  591. }
  592. var actUserNum = 0
  593. for (let j = 0; j < act.courseSelectRs.length; j++) {
  594. var course = act.courseSelectRs[j]
  595. const courseUserNum = course.courseUserNum > 0 ? course.courseUserNum : 0
  596. actUserNum += courseUserNum
  597. pushData.children.push({
  598. text: course.courseName + ' (' + courseUserNum + '人)',
  599. value: act.actId + '-' + course.courseId
  600. })
  601. }
  602. if (actUserNum >= 0) {
  603. pushData.children.unshift({
  604. text: '全部 (' + actUserNum + '人)',
  605. value: act.actId + '-' + 0
  606. })
  607. }
  608. pushData.text += ' (' + actUserNum + '人)'
  609. this.actionsTree.push(pushData)
  610. }
  611. // console.log("[makeActionsTree]" + JSON.stringify(this.actionsTree))
  612. },
  613. onActionChange(e) {
  614. const sltActRoute = e.detail.value
  615. // console.log("onActionChange", sltActRoute)
  616. this.$store.commit('setMapSltActRoute', sltActRoute)
  617. if (sltActRoute == null || sltActRoute.length == 0) {
  618. this.reLoad()
  619. return
  620. }
  621. this.loadData(sltActRoute)
  622. },
  623. onActionsTreePopupOpened() {
  624. // console.log("onActionsTreePopupOpened")
  625. this.actionsTreePopup = true
  626. },
  627. onActionsTreePopupClosed() {
  628. console.log("onActionsTreePopupClosed")
  629. this.actionsTreePopup = false
  630. },
  631. onPlayerListItemClick(item) {
  632. // console.log("onListItemClick", item)
  633. this.handlePlayerListItemClick(item)
  634. },
  635. onPhoneClick(phoneNumber) {
  636. if (!this.admin) {
  637. return;
  638. }
  639. if (phoneNumber.length == 11) {
  640. uni.makePhoneCall({
  641. phoneNumber: phoneNumber
  642. })
  643. } else {
  644. uni.showToast({
  645. title: '手机号码不正确',
  646. icon: 'none'
  647. })
  648. }
  649. },
  650. fullScreenToggle() {
  651. this.$global.fullscreen();
  652. // this.layoutInit();
  653. },
  654. // 获取输入框中值
  655. getESelectText(data) {
  656. // console.log("getESelectText:", data);
  657. },
  658. async selectMapChange(data) {
  659. // console.log("selectMapChange:", data);
  660. this.mapId = data.id;
  661. await loadActionsTree();
  662. this.actionList = await this.getActionList(this.compId, this.mapId);
  663. this.actionId = this.actionList[0].id;
  664. },
  665. /* async selectActionChange(data) {
  666. // console.log("selectActionChange:", data);
  667. this.actionId = data.id;
  668. this.actionDetail = await this.getActionDetail(this.actionId);
  669. }, */
  670. btnBack() {
  671. this.clear();
  672. const url = "/pages/actManage/actDetail?" + this.queryString;
  673. tools.appAction(url, "uni.navigateTo");
  674. },
  675. }
  676. }
  677. </script>
  678. <style scoped>
  679. .content {
  680. height: 100vh;
  681. }
  682. .top {
  683. height: 36px;
  684. padding-top: 16px;
  685. flex-shrink: 0;
  686. background-repeat: no-repeat;
  687. background-size: cover;
  688. }
  689. .selectBox {
  690. width: 100%;
  691. margin-top: 5px;
  692. margin-bottom: 5px;
  693. }
  694. .select {
  695. /* width: 48%; */
  696. width: 96%;
  697. }
  698. .map {
  699. width: 100%;
  700. flex: 1 1 auto;
  701. background-color: white;
  702. z-index: 0;
  703. }
  704. .popup {
  705. display: flex;
  706. height: 30vh;
  707. overflow: scroll;
  708. flex-direction: column;
  709. align-items: center;
  710. background-color: #ffffff;
  711. border-top: #dedede solid 1px;
  712. }
  713. .section {
  714. width: 100%;
  715. }
  716. .actionsTree {
  717. }
  718. /deep/ .input-value-border {
  719. border-top: 1px solid #e5e5e5;
  720. border-bottom: 1px solid #e5e5e5;
  721. border-left: 0;
  722. border-right: 0;
  723. border-radius: 0px;
  724. }
  725. .section-title {
  726. font-size: 14px;
  727. color: #424242;
  728. line-height: 20px;
  729. padding: 10px 0 10px 10px;
  730. }
  731. .section-content {
  732. width: 100%;
  733. height: 100%;
  734. }
  735. .list {
  736. margin-left: -6px;
  737. }
  738. .list-item {
  739. display: flex;
  740. flex-direction: row;
  741. align-items: center;
  742. height: 46px;
  743. }
  744. .slot-box {
  745. display: flex;
  746. flex-direction: column;
  747. align-items: flex-start;
  748. width: 330px;
  749. max-width: 350px;
  750. }
  751. .slot-image {
  752. display: block;
  753. margin-right: 6px;
  754. width: 3px;
  755. height: 33px;
  756. align-self: center;
  757. }
  758. .slot-title {
  759. flex: 1;
  760. font-size: 13px;
  761. color: #424242;
  762. line-height: 18px;
  763. /* white-space: nowrap; */
  764. }
  765. .slot-sn {
  766. display: inline-flex;
  767. width: 15px;
  768. height: 15px;
  769. border-radius: 50%;
  770. }
  771. .slot-note {
  772. flex: 1;
  773. margin-left: 25px;
  774. font-size: 12px;
  775. color: #7d8da7;
  776. line-height: 18px;
  777. white-space: nowrap;
  778. }
  779. .slot-phone {
  780. padding: 0 5px;
  781. color: #000;
  782. font-weight: bold;
  783. }
  784. .norecord {
  785. font-weight: 500;
  786. color: #818181;
  787. font-size: 14px;
  788. text-align: center;
  789. line-height: 50px;
  790. }
  791. </style>