patrolDetails.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <template>
  2. <div class="patrolDetails">
  3. <div class="search">
  4. <span>巡更详情</span>
  5. <div class="search-icon">
  6. <el-tooltip effect="light" placement="bottom" content="返回">
  7. <i class="zoniot_font zoniot-icon-fanhui" @click="goback()"></i>
  8. </el-tooltip>
  9. </div>
  10. </div>
  11. <div class="contentText">
  12. <div class="leftMap">
  13. <map-value :point="thisItem" :line="targetData" ref="mapVal" :isStart="true" :height="400"></map-value>
  14. <div class="formLabel">
  15. <div class="formLabelList">
  16. <div class="label">所属社区</div>
  17. <div class="text">{{ thisObj.communityName }}</div>
  18. </div>
  19. <div class="formLabelList">
  20. <div class="label">巡更路线</div>
  21. <div class="text">{{ thisObj.routeName }}</div>
  22. </div>
  23. <div class="formLabelList">
  24. <div class="label">巡更人员</div>
  25. <div class="text">{{ thisObj.partolName }}</div>
  26. </div>
  27. <div class="formLabelList">
  28. <div class="label">巡更日期</div>
  29. <div class="text">{{ !!thisObj.patrolDate ? $moment(thisObj.patrolDate).format('YYYY-MM-DD') : '' }}</div>
  30. </div>
  31. <div class="formLabelList">
  32. <div class="label">巡更时间</div>
  33. <div class="text">{{ thisObj.patrolTime }}</div>
  34. </div>
  35. </div>
  36. </div>
  37. <div class="rightList">
  38. <template v-for="(item, index) in thisItem">
  39. <div class="steps" :key="index">
  40. <div class="steps-left">
  41. <img v-if="!!item.id" src="@assets/img/point_yiwancheng@2x.png" alt />
  42. <img v-else src="@assets/img/point_weiwancheng@2x.png" alt />
  43. <div class="steps-left-line" v-if="index !== thisItem.length - 1"></div>
  44. </div>
  45. <div class="steps-right">
  46. <div class="steps-right-title">
  47. <span v-if="index == 0">{{ !!item.id ? '开始任务 ' : '待执行' }}</span>
  48. <span v-else>{{ item.pointName }}</span>
  49. <span class="status" v-if="index !== 0" :class="!!item.id ? '' : 'grad'">{{
  50. !!item.id ? '已完成' : '未完成'
  51. }}</span>
  52. </div>
  53. <div class="steps-right-content">{{ item.checkTime }}</div>
  54. <div class="steps-right-content">
  55. <span>巡更结果:</span>
  56. <span>{{ item.result || '-' }}</span>
  57. </div>
  58. <div class="steps-right-content">
  59. <span>图片/视频:</span>
  60. <template v-if="!!item.picturePath">
  61. <div class="imgVdio" v-for="items in item.picturePath.split(',')" :key="items">
  62. <video v-if="typeVideo(items)" :src="items" @click="lookVideos(items)"></video>
  63. <el-image class="imgs" v-else :src="items" :preview-src-list="[items]">
  64. <div slot="error" class="image-slot">--</div>
  65. </el-image>
  66. </div>
  67. </template>
  68. </div>
  69. </div>
  70. </div>
  71. </template>
  72. </div>
  73. </div>
  74. </div>
  75. </template>
  76. <script>
  77. import mapValue from './mapValue.vue';
  78. export default {
  79. props: ['thisObj'],
  80. components: { mapValue },
  81. data() {
  82. return {
  83. thisItem: [],
  84. targetData: []
  85. };
  86. },
  87. filters: {
  88. statusType(val) {
  89. let name = '-';
  90. switch (val) {
  91. case 1:
  92. name = '待执行';
  93. break;
  94. case 2:
  95. name = '执行中';
  96. break;
  97. case 3:
  98. name = '已完成';
  99. break;
  100. case 4:
  101. name = '已完成(超时)';
  102. break;
  103. case 5:
  104. name = '已逾期';
  105. break;
  106. }
  107. return name;
  108. }
  109. },
  110. methods: {
  111. goback() {
  112. this.$emit('initPage');
  113. },
  114. getDetail(id) {
  115. this.$http.get('/sc-community/patrolRecord/findRecordDtail', { id: id }).then(({ data, status, msg }) => {
  116. this.thisItem = data;
  117. });
  118. },
  119. getTrack(id) {
  120. this.$http.get('/sc-community/patrolRecord/getUserPatrolTrack', { recordId: id }).then(({ data, status, msg }) => {
  121. if (!!data) {
  122. this.targetData = data;
  123. }
  124. });
  125. },
  126. typeVideo(str) {
  127. let type = str.slice(str.lastIndexOf('.') + 1, str.length);
  128. let videoType = ['mp4'];
  129. return videoType.includes(type);
  130. },
  131. lookVideos(src) {
  132. new Promise((resolve) => {
  133. this.$store.dispatch('addPopup', {
  134. url: '/lookVideo.vue',
  135. width: '600px',
  136. height: '500px',
  137. props: {
  138. src: src,
  139. callback: resolve
  140. },
  141. showConfirmButton: true,
  142. showCancelButton: true,
  143. hideStar: true,
  144. title: '查看视频'
  145. });
  146. }).then(() => {
  147. this.mixins_search();
  148. });
  149. }
  150. },
  151. created() {
  152. this.getDetail(this.thisObj.id);
  153. this.getTrack(this.thisObj.id);
  154. }
  155. };
  156. </script>>
  157. <style lang="scss" scoped>
  158. @import '@assets/css/public-style.scss';
  159. .border20 {
  160. padding: 20px;
  161. box-sizing: border-box;
  162. }
  163. .patrolDetails {
  164. // @extend .height100;
  165. .search > span {
  166. font-size: 16px;
  167. line-height: 30px;
  168. }
  169. .contentText {
  170. height: calc(100% - 100px);
  171. display: flex;
  172. justify-content: space-between;
  173. .leftMap {
  174. width: calc(100% - 420px);
  175. background: white;
  176. @extend .border20;
  177. .formLabel {
  178. box-shadow: 0px 2px 4px 0px rgba(236, 236, 236, 0.5);
  179. border-radius: 4px;
  180. border: 1px solid #eeeeee;
  181. padding: 20px;
  182. margin-top: 20px;
  183. .formLabelList {
  184. display: flex;
  185. line-height: 30px;
  186. .label {
  187. width: 70px;
  188. }
  189. .text {
  190. color: #424656;
  191. }
  192. }
  193. }
  194. }
  195. .rightList {
  196. width: 400px;
  197. background: white;
  198. @extend .border20;
  199. .steps {
  200. display: flex;
  201. img {
  202. width: 20px;
  203. vertical-align: -webkit-baseline-middle;
  204. &.grad {
  205. -webkit-filter: grayscale(100%);
  206. -moz-filter: grayscale(100%);
  207. -ms-filter: grayscale(100%);
  208. -o-filter: grayscale(100%);
  209. filter: grayscale(100%);
  210. filter: gray;
  211. }
  212. }
  213. .steps-left {
  214. margin-right: 10px;
  215. .steps-left-line {
  216. width: 2px;
  217. height: calc(100% - 40px);
  218. margin: 10px auto;
  219. background-color: $mainBgColor;
  220. }
  221. }
  222. .steps-right {
  223. width: calc(100% - 15px);
  224. line-height: 30px;
  225. margin-bottom: 10px;
  226. .steps-right-title {
  227. font-weight: 600;
  228. display: flex;
  229. justify-content: space-between;
  230. .status {
  231. color: $mainBgColor;
  232. font-weight: 400;
  233. &.grad {
  234. color: gray;
  235. }
  236. }
  237. }
  238. .steps-right-content {
  239. font-size: 12px;
  240. color: #303133;
  241. display: flex;
  242. span:first-child {
  243. margin-right: 10px;
  244. }
  245. }
  246. }
  247. }
  248. }
  249. }
  250. }
  251. .imgVdio {
  252. display: inline-block;
  253. margin-right: 10px;
  254. .imgs,
  255. video {
  256. width: 64px;
  257. cursor: pointer;
  258. }
  259. }
  260. </style>