Jelajahi Sumber

Merge branch 'master' of http://192.168.0.115:3000/bill/fuse-code

xzw 3 tahun lalu
induk
melakukan
1621e9a4fd

+ 7 - 0
src/api/constant.ts

@@ -74,5 +74,12 @@ export const INSERT_VIEW = `/fusion/caseView/add`
 export const UPDATE_VIEW = `/fusion/caseView/updateNameOrSort`
 export const DELETE_VIEW = `/fusion/caseView/delete`
 
+
+// 卷宗类型
+export const FOLDER_TYPE_LIST = `/fusion/caseFilesType/allList`
+
+// 卷宗
+export const FLODER_LIST = `/fusion/caseFiles/allList`
+
 // 文件上传
 export const UPLOAD_FILE = `/fusion/upload/file`

+ 17 - 0
src/api/floder.ts

@@ -0,0 +1,17 @@
+import { params } from '@/env'
+import { FLODER_LIST } from './constant'
+import axios from './instance'
+
+export interface Floder {
+  filesId:	number,
+  caseId:	string,
+  filesTypeId: number,
+  filesTitle:	string,
+  filesUrl:	string,
+}
+
+export type Floders = Floder[]
+
+
+export const fetchFloders = () => 
+  axios.get<Floders>(FLODER_LIST, { params: { caseId: params.caseId } })

+ 13 - 0
src/api/folder-type.ts

@@ -0,0 +1,13 @@
+import { FOLDER_TYPE_LIST } from './constant'
+import axios from './instance'
+
+export interface FloderType {
+  filesTypeId: number,
+  filesTypeName: string
+}
+
+export type FloderTypes = FloderType[]
+
+
+export const fetchFloderTypes = () => 
+  axios.get<FloderTypes>(FOLDER_TYPE_LIST)

+ 2 - 0
src/api/index.ts

@@ -32,3 +32,5 @@ export * from './mesasure'
 export * from './record'
 export * from './record-fragment'
 export * from './view'
+export * from './folder-type'
+export * from './floder'

+ 2 - 2
src/router/constant.ts

@@ -81,11 +81,11 @@ export const metas = {
     icon: 'list-scene',
     title: '汇总'
   },
-  [RoutesName.recordShow]: {
+  [RoutesName.viewShow]: {
     icon: 'list-view',
     title: '视图'
   },
-  [RoutesName.viewShow]: {
+  [RoutesName.recordShow]: {
     icon: 'list-record',
     title: '录屏'
   },

+ 14 - 0
src/store/floder-type.ts

@@ -0,0 +1,14 @@
+import { ref } from 'vue'
+import { fetchFloderTypes } from '@/api'
+
+import type { FloderTypes, FloderType } from '@/api'
+
+export const floderTypes = ref<FloderTypes>([])
+export const getFloderType = (id: FloderType['filesTypeId']) => 
+  floderTypes.value.find(type => type.filesTypeId === id)
+
+export const initialFloderTypes = async () => {
+  floderTypes.value = await fetchFloderTypes()
+}
+
+export type { FloderType, FloderTypes }

+ 15 - 0
src/store/floder.ts

@@ -0,0 +1,15 @@
+import { ref } from 'vue'
+import { fetchFloders } from '@/api'
+
+import type { Floders } from '@/api'
+import type { FloderType } from './floder-type'
+
+export const floders = ref<Floders>([])
+export const getFloderByType = (type: FloderType) => 
+  floders.value.filter(floder => floder.filesTypeId === type.filesTypeId)
+
+export const initialFloders = async () => {
+  floders.value = await fetchFloders()
+}
+
+export type { Floders, Floder } from '@/api'

+ 3 - 1
src/store/index.ts

@@ -9,4 +9,6 @@ export * from './tagging-positions'
 export * from './measure'
 export * from './record'
 export * from './view'
-export * from './record-fragment'
+export * from './record-fragment'
+export * from './floder'
+export * from './floder-type'

+ 7 - 0
src/utils/meta.ts

@@ -0,0 +1,7 @@
+
+const images = ['bmp', 'jpg', 'png', 'tif', 'gif', 'pcx', 'tga', 'exif', 'fpx', 'svg', 'psd', 'cdr', 'pcd', 'dxf', 'ufo', 'eps', 'ai', 'raw', 'WMF', 'webp', 'avif', 'apng']
+const video = ['wmv', 'asf', 'asx', 'rm', 'rmvb', 'mp4', '3gp', 'mov', 'm4v', 'avi', 'dat', 'mkv', 'flv', 'vob']
+
+export const getUrlType = (url: string) => {
+
+}

+ 84 - 0
src/views/folder/index.vue

@@ -0,0 +1,84 @@
+<template>
+  <LeftPano>
+    <div v-for="item in types" :key="item.id" class="types">
+      <h2 @click="item.show.value = !item.show.value">
+        {{item.title}}
+        <ui-icon :type="`pull-${item.show.value ? 'up' : 'down'}`" class="icon" ctrl />
+      </h2>
+
+      <div class="floders"  v-if="item.show.value">
+        <div 
+          v-for="floder in item.floders" 
+          :key="floder.filesId" 
+          class="fun-ctrl" 
+          @click="preview(floder)"
+        >
+          <p>{{ floder.filesTitle }}</p>
+        </div>
+      </div>
+    </div>
+  </LeftPano>
+</template>
+
+<script lang="ts" setup>
+import { LeftPano } from '@/layout'
+import { computed, ref } from 'vue';
+import { 
+  initialFloderTypes, 
+  initialFloders,
+  floderTypes,
+  getFloderByType,
+} from '@/store'
+
+import type { Floder } from '@/store'
+
+initialFloderTypes()
+initialFloders()
+
+const types = computed(() => 
+  floderTypes.value.map(type => ({
+    show: ref(true),
+    id: type.filesTypeId,
+    title: type.filesTypeName,
+    floders: getFloderByType(type)
+  }))
+)
+
+const preview = (floder: Floder) => window.open(floder.filesUrl)
+
+</script>
+
+<style lang="scss" scoped>
+.types {
+  h2 {
+    padding: 20px;
+    font-weight: bold;
+    display: flex;
+    justify-content: space-between;
+    border-bottom: 1px solid rgba(255,255,255,0.16);
+    align-items: center;
+    margin-bottom: 0;
+    cursor: pointer;
+
+    .icon {
+      font-size: 14px;
+    }
+  }
+}
+
+.floders {
+  background: rgba(0,0,0,0.5);
+
+  > div {
+    margin: 0 20px;
+    padding: 20px 10px;
+    border-bottom: 1px solid rgba(255,255,255,0.16);
+    cursor: pointer;
+
+    p {
+      font-size: 12px;
+      color: currentColor;
+    }
+  }
+}
+</style>

+ 26 - 0
src/views/record/show.vue

@@ -1 +1,27 @@
 
+<template>
+  <LeftPano>
+    <ui-group class="pano-group">
+      <Sign 
+        v-for="record in records" 
+        :record="record"
+        :key="record.id" 
+        :edit="false"
+      />
+    </ui-group>
+  </LeftPano>
+</template>
+
+<script setup lang="ts">
+import Sign from './sign.vue'
+import { records, initialRecords } from '@/store'
+import { LeftPano } from '@/layout'
+
+initialRecords()
+</script>
+
+<style lang="scss" scoped>
+.pano-group {
+  padding: 0 20px;
+}
+</style>

+ 2 - 1
src/views/tagging/style.scss

@@ -9,7 +9,8 @@
 
   &.edit{
     cursor: pointer;
-    .active::after {
+
+    &.active::after {
       content: '';
       position: absolute;
       pointer-events: none;

+ 26 - 0
src/views/view/show.vue

@@ -0,0 +1,26 @@
+<template>
+  <LeftPano>
+    <ui-group class="pano-group">
+      <Sign 
+        v-for="view in views" 
+        :view="view" 
+        :key="view.id" 
+        :edit="false"
+      />
+    </ui-group>
+  </LeftPano>
+</template>
+
+<script setup lang="ts">
+import Sign from './sign.vue'
+import { views, initialViews } from '@/store'
+import { LeftPano } from '@/layout'
+
+initialViews()
+</script>
+
+<style lang="scss" scoped>
+.pano-group {
+  padding: 0 20px;
+}
+</style>