index.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  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">
  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 } 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 list = ref([
  111. {
  112. id: 1,
  113. icon: 'prospect',
  114. name: '勘查笔录',
  115. },
  116. {
  117. id: 2,
  118. icon: 'inquiry',
  119. name: '询问笔录',
  120. },
  121. {
  122. id: 3,
  123. icon: 'question',
  124. name: '讯问笔录',
  125. },
  126. {
  127. id: 4,
  128. icon: 'accident',
  129. name: '事故认定',
  130. },
  131. {
  132. id: 5,
  133. icon: 'blood',
  134. name: '血样登记表',
  135. },
  136. {
  137. id: 6,
  138. icon: 'items',
  139. name: '遗留物品清单',
  140. },
  141. {
  142. id: 7,
  143. icon: 'authorization',
  144. name: '授权委托书',
  145. },
  146. {
  147. id: 8,
  148. icon: 'law',
  149. name: '法律法规',
  150. },
  151. ]);
  152. onMounted(() => {
  153. var screenHeight = document.body.clientHeight;
  154. layoutRef.value.style.height = screenHeight + 'px';
  155. document.body.style.height = screenHeight + 'px';
  156. });
  157. </script>
  158. <style scoped lang="scss">
  159. .info-layout {
  160. width: 100%;
  161. height: 100%;
  162. // padding-top: 50px;
  163. background: rgba(22, 24, 26, 1);
  164. padding: 70px 20px 20px 20px;
  165. display: flex;
  166. flex-direction: column;
  167. align-items: center;
  168. justify-content: space-between;
  169. // position: fixed;
  170. // top: 0;
  171. // left: 0;
  172. // z-index: 1;
  173. .info-top {
  174. width: 100%;
  175. height: 83%;
  176. display: flex;
  177. align-items: center;
  178. justify-content: space-between;
  179. .info-top-left {
  180. width: 70%;
  181. height: 100%;
  182. position: relative;
  183. overflow: hidden;
  184. transition: all 0.3s;
  185. &.full {
  186. position: fixed;
  187. width: 100%;
  188. height: 100%;
  189. top: 0;
  190. left: 0;
  191. z-index: 1000;
  192. transform-origin: center center;
  193. .scene-mode-tabs {
  194. height: 64px !important;
  195. }
  196. .fun-ctrl {
  197. .iconfont {
  198. font-size: 24px;
  199. }
  200. }
  201. }
  202. .hide {
  203. display: none !important;
  204. }
  205. .scene-mode-tabs {
  206. height: 48px !important;
  207. }
  208. .fun-ctrl {
  209. position: absolute;
  210. left: var(--boundMargin);
  211. top: var(--boundMargin);
  212. padding: 0;
  213. width: 48px;
  214. height: 48px;
  215. display: flex;
  216. align-items: center;
  217. justify-content: center;
  218. .iconfont {
  219. font-size: 18px;
  220. }
  221. }
  222. }
  223. .info-top-right {
  224. width: calc(30% - 20px);
  225. height: 100%;
  226. position: relative;
  227. overflow: hidden;
  228. font-size: 16px;
  229. color: rgba(255, 255, 255, 0.8);
  230. display: flex;
  231. flex-direction: column;
  232. justify-content: space-between;
  233. &.full {
  234. width: 0;
  235. }
  236. p {
  237. margin-bottom: 4px;
  238. }
  239. .input-item {
  240. height: 10%;
  241. input {
  242. width: 100%;
  243. padding: 0 8px;
  244. height: 56%;
  245. background: rgba(255, 255, 255, 0.1);
  246. border-radius: 4px 4px 4px 4px;
  247. border: 1px solid rgba(255, 255, 255, 0.5);
  248. color: rgba(255, 255, 255, 0.8);
  249. }
  250. }
  251. .text-item {
  252. width: 100%;
  253. height: 35%;
  254. .info-textarea {
  255. width: 100%;
  256. padding: 8px;
  257. height: 87%;
  258. background: rgba(255, 255, 255, 0.1);
  259. border-radius: 4px 4px 4px 4px;
  260. border: 1px solid rgba(255, 255, 255, 0.5);
  261. color: rgba(255, 255, 255, 0.8);
  262. outline: none;
  263. resize: none;
  264. }
  265. }
  266. .info-btn {
  267. width: 100%;
  268. height: 19.5%;
  269. display: flex;
  270. flex-direction: column;
  271. justify-content: space-between;
  272. .right-btn {
  273. width: 296px;
  274. height: 42.8%;
  275. background: rgba(255, 255, 255, 0.1);
  276. border-radius: 4px 4px 4px 4px;
  277. display: flex;
  278. align-items: center;
  279. justify-content: center;
  280. }
  281. }
  282. }
  283. }
  284. .info-bottom {
  285. width: 100%;
  286. height: 14.49%;
  287. display: flex;
  288. flex-wrap: nowrap;
  289. &.full {
  290. height: 0;
  291. }
  292. > div {
  293. width: 100%;
  294. height: 100%;
  295. margin-right: 20px;
  296. display: flex;
  297. flex-direction: column;
  298. align-items: center;
  299. justify-content: center;
  300. background: rgba(255, 255, 255, 0.1);
  301. font-size: 16px;
  302. border-radius: 4px;
  303. > span {
  304. margin-top: 8px;
  305. }
  306. .iconfont {
  307. font-size: 24px;
  308. }
  309. &:last-of-type {
  310. margin-right: 0;
  311. }
  312. }
  313. }
  314. }
  315. .photos-header {
  316. width: 100%;
  317. display: flex;
  318. justify-content: space-between;
  319. align-items: center;
  320. position: relative;
  321. .center {
  322. position: absolute;
  323. left: 0;
  324. right: 0;
  325. white-space: nowrap;
  326. // pointer-events: none;
  327. height: 100%;
  328. display: flex;
  329. align-items: center;
  330. justify-content: center;
  331. text-align: center;
  332. }
  333. .left,
  334. .right {
  335. z-index: 1;
  336. }
  337. }
  338. .back-icon {
  339. display: inline-flex;
  340. width: 32px;
  341. height: 32px;
  342. background: rgba(255, 255, 255, 0.1);
  343. border-radius: 24px 24px 24px 24px;
  344. align-items: center;
  345. justify-content: center;
  346. }
  347. </style>