index.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  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" ref="layoutRef">
  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 v-if="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?back=1')">现场绘图({{ sceneSortPhotos.length }})</div>
  47. <div class="right-btn" @click="router.push('/accidents?back=1')">事故照片({{ 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" @click="goItem(i)">
  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, onMounted, onActivated, nextTick } 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 layoutRef = ref(null);
  85. const accodentSortPhotos = computed(() => {
  86. const photos = [...accidentPhotos.value];
  87. return photos.sort((a, b) => types.indexOf(a.type) - types.indexOf(b.type));
  88. });
  89. const scenetTitle = computed(() => title);
  90. const enum TypeEnum {
  91. Draw,
  92. Table,
  93. }
  94. const currentType = ref(TypeEnum.Draw);
  95. const sceneSortPhotos = computed(() => roadPhotos.value.filter((item) => (currentType.value === TypeEnum.Draw ? !item.table : !!item.table)).reverse());
  96. const loaded = ref(false);
  97. const childPage = ref(false);
  98. const stopReg = watchEffect(() => {
  99. if (loaded.value) {
  100. const sdk = useSDK();
  101. stopReg();
  102. customSetup(sdk);
  103. disabledMap.measure = false;
  104. }
  105. });
  106. const viewStatus = ref(false);
  107. const onScale = () => {
  108. viewStatus.value = !viewStatus.value;
  109. };
  110. const goItem = (item) => {
  111. if (item.id == 8) {
  112. return;
  113. }
  114. router.push(`/demo/${item.id}`);
  115. };
  116. const list = ref([
  117. {
  118. id: 1,
  119. icon: 'prospect',
  120. name: '勘查笔录',
  121. },
  122. {
  123. id: 2,
  124. icon: 'inquiry',
  125. name: '询问笔录',
  126. },
  127. {
  128. id: 3,
  129. icon: 'question',
  130. name: '讯问笔录',
  131. },
  132. {
  133. id: 4,
  134. icon: 'accident',
  135. name: '事故认定',
  136. },
  137. {
  138. id: 5,
  139. icon: 'blood',
  140. name: '血样登记表',
  141. },
  142. {
  143. id: 6,
  144. icon: 'items',
  145. name: '遗留物品清单',
  146. },
  147. {
  148. id: 7,
  149. icon: 'authorization',
  150. name: '授权委托书',
  151. },
  152. {
  153. id: 8,
  154. icon: 'law',
  155. name: '法律法规',
  156. },
  157. ]);
  158. onMounted(() => {
  159. var screenHeight = document.body.clientHeight;
  160. layoutRef.value.style.height = screenHeight + 'px';
  161. document.body.style.height = screenHeight + 'px';
  162. });
  163. onActivated(async () => {
  164. await nextTick();
  165. let full = router.currentRoute.value.query.full;
  166. console.error('active', full);
  167. if (full) {
  168. viewStatus.value = true;
  169. }
  170. });
  171. </script>
  172. <style scoped lang="scss">
  173. .info-layout {
  174. width: 100%;
  175. height: 100%;
  176. // padding-top: 50px;
  177. background: rgba(22, 24, 26, 1);
  178. padding: 70px 20px 20px 20px;
  179. display: flex;
  180. flex-direction: column;
  181. align-items: center;
  182. justify-content: space-between;
  183. // position: fixed;
  184. // top: 0;
  185. // left: 0;
  186. // z-index: 1;
  187. .info-top {
  188. width: 100%;
  189. height: 83%;
  190. display: flex;
  191. align-items: center;
  192. justify-content: space-between;
  193. .info-top-left {
  194. width: 70%;
  195. height: 100%;
  196. position: relative;
  197. overflow: hidden;
  198. transition: all 0.3s;
  199. &.full {
  200. position: fixed;
  201. width: 100%;
  202. height: 100%;
  203. top: 0;
  204. left: 0;
  205. z-index: 1000;
  206. transform-origin: center center;
  207. .scene-mode-tabs {
  208. height: 64px !important;
  209. }
  210. .fun-ctrl {
  211. .iconfont {
  212. font-size: 24px;
  213. }
  214. }
  215. }
  216. .hide {
  217. display: none !important;
  218. }
  219. .scene-mode-tabs {
  220. height: 48px !important;
  221. }
  222. .fun-ctrl {
  223. position: absolute;
  224. left: var(--boundMargin);
  225. top: var(--boundMargin);
  226. padding: 0;
  227. width: 48px;
  228. height: 48px;
  229. display: flex;
  230. align-items: center;
  231. justify-content: center;
  232. .iconfont {
  233. font-size: 18px;
  234. }
  235. }
  236. }
  237. .info-top-right {
  238. width: calc(30% - 20px);
  239. height: 100%;
  240. position: relative;
  241. overflow: hidden;
  242. font-size: 16px;
  243. color: rgba(255, 255, 255, 0.8);
  244. display: flex;
  245. flex-direction: column;
  246. justify-content: space-between;
  247. &.full {
  248. width: 0;
  249. }
  250. p {
  251. margin-bottom: 4px;
  252. }
  253. .input-item {
  254. height: 10%;
  255. input {
  256. width: 100%;
  257. padding: 0 8px;
  258. height: 56%;
  259. background: rgba(255, 255, 255, 0.1);
  260. border-radius: 4px 4px 4px 4px;
  261. border: 1px solid rgba(255, 255, 255, 0.5);
  262. color: rgba(255, 255, 255, 0.8);
  263. }
  264. }
  265. .text-item {
  266. width: 100%;
  267. height: 35%;
  268. .info-textarea {
  269. width: 100%;
  270. padding: 8px;
  271. height: 87%;
  272. background: rgba(255, 255, 255, 0.1);
  273. border-radius: 4px 4px 4px 4px;
  274. border: 1px solid rgba(255, 255, 255, 0.5);
  275. color: rgba(255, 255, 255, 0.8);
  276. outline: none;
  277. resize: none;
  278. }
  279. }
  280. .info-btn {
  281. width: 100%;
  282. height: 19.5%;
  283. display: flex;
  284. flex-direction: column;
  285. justify-content: space-between;
  286. .right-btn {
  287. width: 296px;
  288. height: 42.8%;
  289. background: rgba(255, 255, 255, 0.1);
  290. border-radius: 4px 4px 4px 4px;
  291. display: flex;
  292. align-items: center;
  293. justify-content: center;
  294. }
  295. }
  296. }
  297. }
  298. .info-bottom {
  299. width: 100%;
  300. height: 14.49%;
  301. display: flex;
  302. flex-wrap: nowrap;
  303. &.full {
  304. height: 0;
  305. }
  306. > div {
  307. width: 100%;
  308. height: 100%;
  309. margin-right: 20px;
  310. display: flex;
  311. flex-direction: column;
  312. align-items: center;
  313. justify-content: center;
  314. background: rgba(255, 255, 255, 0.1);
  315. font-size: 16px;
  316. border-radius: 4px;
  317. > span {
  318. margin-top: 8px;
  319. }
  320. .iconfont {
  321. font-size: 24px;
  322. }
  323. &:last-of-type {
  324. margin-right: 0;
  325. }
  326. }
  327. }
  328. }
  329. .photos-header {
  330. width: 100%;
  331. display: flex;
  332. justify-content: space-between;
  333. align-items: center;
  334. position: relative;
  335. .center {
  336. position: absolute;
  337. left: 0;
  338. right: 0;
  339. white-space: nowrap;
  340. // pointer-events: none;
  341. height: 100%;
  342. display: flex;
  343. align-items: center;
  344. justify-content: center;
  345. text-align: center;
  346. }
  347. .left,
  348. .right {
  349. z-index: 1;
  350. }
  351. }
  352. .back-icon {
  353. display: inline-flex;
  354. width: 32px;
  355. height: 32px;
  356. background: rgba(255, 255, 255, 0.1);
  357. border-radius: 24px 24px 24px 24px;
  358. align-items: center;
  359. justify-content: center;
  360. }
  361. </style>