index.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. <template>
  2. <MainPanel>
  3. <template v-slot:header>
  4. <div class="photos-header">
  5. <div class="left">
  6. <ui-icon class="back-icon" type="return" ctrl style="margin-right: 10px" @click="back" />
  7. <span> 案件 </span>
  8. </div>
  9. </div>
  10. </template>
  11. <div class="info-layout">
  12. <div class="info-top">
  13. <div class="info-top-left" :class="{ full: viewStatus }">
  14. <Container @loaded="loaded = true" />
  15. <template v-if="loaded && !trackMode">
  16. <Menus :viewStatus="viewStatus" @enter-child="childPage = true" @leave-child="childPage = false" />
  17. <BasePoints v-if="currentView" />
  18. <FixPoints />
  19. <Measures />
  20. <Photo />
  21. <!-- <ButtonPane class="back fun-ctrl" size="48" @click="router.push('/scene')" v-if="!childPage"> -->
  22. <ButtonPane class="back fun-ctrl" :size="viewStatus ? 64 : 48" @click="onScale" v-if="!childPage">
  23. <ui-icon :type="viewStatus ? 'screen_c' : 'screen_f'" class="icon" />
  24. </ButtonPane>
  25. <Mode />
  26. </template>
  27. </div>
  28. <div class="info-top-right" :class="{ full: viewStatus }">
  29. <div class="input-item">
  30. <p>事故时间:</p>
  31. <input type="text" />
  32. </div>
  33. <div class="input-item">
  34. <p>天气:</p>
  35. <input type="text" />
  36. </div>
  37. <div class="input-item">
  38. <p>地点:</p>
  39. <input type="text" />
  40. </div>
  41. <div class="text-item">
  42. <p>事故描述:</p>
  43. <textarea class="info-textarea"></textarea>
  44. </div>
  45. <div class="info-btn">
  46. <div class="right-btn" @click="router.push('roads')">现场绘图({{ sceneSortPhotos.length }})</div>
  47. <div class="right-btn" @click="router.push('accidents')">事故照片({{ accodentSortPhotos.length }})</div>
  48. </div>
  49. </div>
  50. </div>
  51. <div class="info-bottom" :class="{ full: viewStatus }">
  52. <div v-for="(i, index) in list">
  53. <ui-icon :type="i.icon"></ui-icon>
  54. <span> {{ i.name }}</span>
  55. </div>
  56. </div>
  57. </div>
  58. </MainPanel>
  59. </template>
  60. <script lang="ts" setup>
  61. import MainPanel from '@/components/main-panel/index.vue';
  62. import Header from '@/components/photos/header.vue';
  63. import Container from './container.vue';
  64. import Mode from './mode.vue';
  65. import Menus from './menus/pane.vue';
  66. import BasePoints from '@/views/scene/covers/basePoints.vue';
  67. import FixPoints from '@/views/scene/covers/fixPoints.vue';
  68. import Measures from '@/views/scene/covers/measures.vue';
  69. import Photo from './photo.vue';
  70. import ButtonPane from '@/components/button-pane/index.vue';
  71. import { customMap, disabledMap, useSDK } from '@/hook';
  72. import customSetup from '../../hook/custom';
  73. import UiIcon from '@/components/base/components/icon/index.vue';
  74. import { ref, watchEffect, computed } from 'vue';
  75. import { back } from '@/store/sync';
  76. import { trackMode } from '@/views/scene/trackMeasureWidth';
  77. import { currentView } from './currentScene';
  78. import { api } from '@/store/sync';
  79. import { router, writeRouteName } from '@/router';
  80. import { roadPhotos, RoadPhoto } from '@/store/roadPhotos';
  81. import { types, accidentPhotos, AccidentPhoto } from '@/store/accidentPhotos';
  82. import { photos } from '@/store/photos';
  83. import { title } from '@/store/setup';
  84. const accodentSortPhotos = computed(() => {
  85. const photos = [...accidentPhotos.value];
  86. return photos.sort((a, b) => types.indexOf(a.type) - types.indexOf(b.type));
  87. });
  88. const scenetTitle = computed(() => title);
  89. const enum TypeEnum {
  90. Draw,
  91. Table,
  92. }
  93. const currentType = ref(TypeEnum.Draw);
  94. const sceneSortPhotos = computed(() => roadPhotos.value.filter((item) => (currentType.value === TypeEnum.Draw ? !item.table : !!item.table)).reverse());
  95. const loaded = ref(false);
  96. const childPage = ref(false);
  97. const stopReg = watchEffect(() => {
  98. if (loaded.value) {
  99. const sdk = useSDK();
  100. stopReg();
  101. customSetup(sdk);
  102. disabledMap.measure = false;
  103. }
  104. });
  105. const viewStatus = ref(false);
  106. const onScale = () => {
  107. viewStatus.value = !viewStatus.value;
  108. };
  109. const list = ref([
  110. {
  111. id: 1,
  112. icon: 'prospect',
  113. name: '勘查笔录',
  114. },
  115. {
  116. id: 2,
  117. icon: 'inquiry',
  118. name: '询问笔录',
  119. },
  120. {
  121. id: 3,
  122. icon: 'question',
  123. name: '讯问笔录',
  124. },
  125. {
  126. id: 4,
  127. icon: 'accident',
  128. name: '事故认定',
  129. },
  130. {
  131. id: 5,
  132. icon: 'blood',
  133. name: '血样登记表',
  134. },
  135. {
  136. id: 6,
  137. icon: 'items',
  138. name: '遗留物品清单',
  139. },
  140. {
  141. id: 7,
  142. icon: 'authorization',
  143. name: '授权委托书',
  144. },
  145. {
  146. id: 8,
  147. icon: 'law',
  148. name: '法律法规',
  149. },
  150. ]);
  151. </script>
  152. <style scoped lang="scss">
  153. .info-layout {
  154. width: 100%;
  155. height: 100%;
  156. // padding-top: 50px;
  157. background: rgba(22, 24, 26, 1);
  158. padding: 70px 20px 20px 20px;
  159. display: flex;
  160. flex-direction: column;
  161. align-items: center;
  162. justify-content: space-between;
  163. .info-top {
  164. width: 100%;
  165. height: 83%;
  166. display: flex;
  167. align-items: center;
  168. justify-content: space-between;
  169. .info-top-left {
  170. width: 70%;
  171. height: 100%;
  172. position: relative;
  173. overflow: hidden;
  174. transition: all 0.3s;
  175. &.full {
  176. position: fixed;
  177. width: 100%;
  178. height: 100%;
  179. top: 0;
  180. left: 0;
  181. z-index: 1000;
  182. transform-origin: center center;
  183. .scene-mode-tabs {
  184. height: 64px !important;
  185. }
  186. .fun-ctrl {
  187. .iconfont {
  188. font-size: 24px;
  189. }
  190. }
  191. }
  192. .hide {
  193. display: none !important;
  194. }
  195. .scene-mode-tabs {
  196. height: 48px !important;
  197. }
  198. .fun-ctrl {
  199. position: absolute;
  200. left: var(--boundMargin);
  201. top: var(--boundMargin);
  202. padding: 0;
  203. width: 48px;
  204. height: 48px;
  205. display: flex;
  206. align-items: center;
  207. justify-content: center;
  208. .iconfont {
  209. font-size: 18px;
  210. }
  211. }
  212. }
  213. .info-top-right {
  214. width: calc(30% - 20px);
  215. height: 100%;
  216. position: relative;
  217. overflow: hidden;
  218. font-size: 16px;
  219. color: rgba(255, 255, 255, 0.8);
  220. display: flex;
  221. flex-direction: column;
  222. justify-content: space-between;
  223. &.full {
  224. width: 0;
  225. }
  226. p {
  227. margin-bottom: 4px;
  228. }
  229. .input-item {
  230. height: 10%;
  231. input {
  232. width: 100%;
  233. padding: 0 8px;
  234. height: 56%;
  235. background: rgba(255, 255, 255, 0.1);
  236. border-radius: 4px 4px 4px 4px;
  237. border: 1px solid rgba(255, 255, 255, 0.5);
  238. color: rgba(255, 255, 255, 0.8);
  239. }
  240. }
  241. .text-item {
  242. width: 100%;
  243. height: 35%;
  244. .info-textarea {
  245. width: 100%;
  246. padding: 8px;
  247. height: 87%;
  248. background: rgba(255, 255, 255, 0.1);
  249. border-radius: 4px 4px 4px 4px;
  250. border: 1px solid rgba(255, 255, 255, 0.5);
  251. color: rgba(255, 255, 255, 0.8);
  252. outline: none;
  253. resize: none;
  254. }
  255. }
  256. .info-btn {
  257. width: 100%;
  258. height: 19.5%;
  259. display: flex;
  260. flex-direction: column;
  261. justify-content: space-between;
  262. .right-btn {
  263. width: 296px;
  264. height: 42.8%;
  265. background: rgba(255, 255, 255, 0.1);
  266. border-radius: 4px 4px 4px 4px;
  267. display: flex;
  268. align-items: center;
  269. justify-content: center;
  270. }
  271. }
  272. }
  273. }
  274. .info-bottom {
  275. width: 100%;
  276. height: 14.49%;
  277. display: flex;
  278. flex-wrap: nowrap;
  279. &.full {
  280. height: 0;
  281. }
  282. > div {
  283. width: 100%;
  284. height: 100%;
  285. margin-right: 20px;
  286. display: flex;
  287. flex-direction: column;
  288. align-items: center;
  289. justify-content: center;
  290. background: rgba(255, 255, 255, 0.1);
  291. font-size: 16px;
  292. border-radius: 4px;
  293. > span {
  294. margin-top: 8px;
  295. }
  296. .iconfont {
  297. font-size: 24px;
  298. }
  299. &:last-of-type {
  300. margin-right: 0;
  301. }
  302. }
  303. }
  304. }
  305. .photos-header {
  306. width: 100%;
  307. display: flex;
  308. justify-content: space-between;
  309. align-items: center;
  310. position: relative;
  311. .center {
  312. position: absolute;
  313. left: 0;
  314. right: 0;
  315. white-space: nowrap;
  316. // pointer-events: none;
  317. height: 100%;
  318. display: flex;
  319. align-items: center;
  320. justify-content: center;
  321. text-align: center;
  322. }
  323. .left,
  324. .right {
  325. z-index: 1;
  326. }
  327. }
  328. .back-icon {
  329. display: inline-flex;
  330. width: 32px;
  331. height: 32px;
  332. background: rgba(255, 255, 255, 0.1);
  333. border-radius: 24px 24px 24px 24px;
  334. align-items: center;
  335. justify-content: center;
  336. }
  337. </style>