|
@@ -1,26 +1,66 @@
|
|
|
<template>
|
|
|
<div class="tag-view">
|
|
|
- <div class="tag-view-content" :style="{ height: height + 'px' }">
|
|
|
+ <!-- <div class="tag-view-content" :style="{ height: height + 'px' }"> -->
|
|
|
+ <div class="tag-view-content">
|
|
|
<header>
|
|
|
- <span>场景标注名称</span>
|
|
|
- <i class="iconfont icon-close" @click="emits('action', null)"></i>
|
|
|
+ <span>{{ notify.title }}</span>
|
|
|
+ <!-- <i class="iconfont icon-close" @click="emits('action', null)"></i> -->
|
|
|
+ <i class="iconfont icon-close" @click="onClose"></i>
|
|
|
</header>
|
|
|
<article>
|
|
|
- <div>
|
|
|
- <div>
|
|
|
-
|
|
|
+ <div class="aside-item left-item">
|
|
|
+ <div class="content-item">
|
|
|
+ <div class="item-title">创建时间</div>
|
|
|
+ <span class="content-desc">2021-04-25</span>
|
|
|
+ </div>
|
|
|
+ <div class="content-item">
|
|
|
+ <div class="item-title">创建人</div>
|
|
|
+ <span class="content-desc">陈工</span>
|
|
|
+ </div>
|
|
|
+ <div class="content-item">
|
|
|
+ <div class="item-title">状态</div>
|
|
|
+ <span class="content-desc" v-for="i in data.status">
|
|
|
+ <span v-if="i.value == form.status">{{ i.text }}</span></span
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div class="content-item">
|
|
|
+ <div class="item-title">涉及的成员</div>
|
|
|
+ <span class="content-desc" v-for="(i, index) in form.members"
|
|
|
+ ><span>{{ i.text }}</span>
|
|
|
+ <span v-if="index < form.members.length - 1">、</span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div class="content-item">
|
|
|
+ <div class="item-title">描述</div>
|
|
|
+ <span class="content-desc">{{ form.describe }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="media-box" :class="notify.type == 'image' ? 'zoom-in' : ''">
|
|
|
+ <component :is="component" :viewer="viewer"></component>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="aside-item right-item">
|
|
|
+ <div class="comment-content">
|
|
|
+ <div class="comment-header"><span>评论</span></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div></div>
|
|
|
</article>
|
|
|
- <footer></footer>
|
|
|
+ <!-- <footer></footer> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
-import { ref, onMounted, onBeforeUnmount } from 'vue'
|
|
|
-
|
|
|
-const props = defineProps(['notify'])
|
|
|
+import { ref, onMounted, onBeforeUnmount, computed, inject } from 'vue'
|
|
|
+import { http } from '@/utils/request'
|
|
|
+import browser from '@/utils/browser'
|
|
|
+import Image from '@/components/form/medias/Image.vue'
|
|
|
+import Video from '@/components/form/medias/Video.vue'
|
|
|
+import Audio from '@/components/form/medias/Audio.vue'
|
|
|
+import Link from '@/components/form/medias/Link.vue'
|
|
|
+const projectId = browser.valueFromUrl('projectId') || 1
|
|
|
+const notify = inject('notify')
|
|
|
+console.log(notify.value)
|
|
|
+const viewer = ref(true)
|
|
|
+// const props = defineProps(['notify'])
|
|
|
const emits = defineEmits(['action'])
|
|
|
const height = ref(0)
|
|
|
const form = ref({
|
|
@@ -29,13 +69,82 @@ const form = ref({
|
|
|
status: '',
|
|
|
members: [],
|
|
|
})
|
|
|
+const data = ref({
|
|
|
+ status: [
|
|
|
+ { text: '待处理', value: 1 },
|
|
|
+ { text: '进行中', value: 2 },
|
|
|
+ { text: '未解决', value: 3 },
|
|
|
+ { text: '已解决', value: 4 },
|
|
|
+ ],
|
|
|
+ members: [],
|
|
|
+})
|
|
|
+const media = ref('video')
|
|
|
+const component = computed(() => {
|
|
|
+ switch (media.value) {
|
|
|
+ case 'image':
|
|
|
+ return Image
|
|
|
+ case 'video':
|
|
|
+ return Video
|
|
|
+ case 'audio':
|
|
|
+ return Audio
|
|
|
+ case 'link':
|
|
|
+ return Link
|
|
|
+ }
|
|
|
+})
|
|
|
const onResize = () => {
|
|
|
height.value = window.innerHeight - 90
|
|
|
}
|
|
|
+const onClose = () => {
|
|
|
+ if (window.kankan) {
|
|
|
+ if (notify.value.__temp) {
|
|
|
+ kankan.TagManager.remove(notify.value.sid)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ notify.value = null
|
|
|
+}
|
|
|
onMounted(() => {
|
|
|
- window.kankan.TagManager.focusTag(props.notify.sid, {
|
|
|
- direction: 'left',
|
|
|
+ http.post(`smart-site/projectTeam/select`, { projectId }).then(response => {
|
|
|
+ data.value.members = response.data.map(item => {
|
|
|
+ return {
|
|
|
+ text: item.nickName,
|
|
|
+ value: item.userId,
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ if (notify.value) {
|
|
|
+ form.value.status = String(notify.value.status || '')
|
|
|
+ form.value.title = notify.value.title || ''
|
|
|
+ form.value.describe = notify.value.content || ''
|
|
|
+ form.value.members = []
|
|
|
+ if (notify.value.members && notify.value.members.length) {
|
|
|
+ notify.value.members.forEach(item => {
|
|
|
+ let find = data.value.members.find(c => c.value == item)
|
|
|
+ if (find) {
|
|
|
+ form.value.members.push(find)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ console.log(form.value)
|
|
|
+ //初始化markingId
|
|
|
+ console.log(notify.value)
|
|
|
+ }
|
|
|
})
|
|
|
+
|
|
|
+ if (window.kankan) {
|
|
|
+ window.kankan.TagManager.focusTag(notify.value.sid, {
|
|
|
+ direction: 'left',
|
|
|
+ attrs: {
|
|
|
+ width: 0,
|
|
|
+ // height: 400,
|
|
|
+ },
|
|
|
+ })
|
|
|
+ } else if (window.laser) {
|
|
|
+ window.laser.then(sdk => {
|
|
|
+ let pos = notify.value.tag.position
|
|
|
+ sdk.scene.comeToTag(new THREE.Vector3(pos.x, pos.y, pos.z))
|
|
|
+ })
|
|
|
+ }
|
|
|
onResize()
|
|
|
window.addEventListener('resize', onResize)
|
|
|
})
|
|
@@ -45,6 +154,51 @@ onBeforeUnmount(() => {
|
|
|
})
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
+.aside-item {
|
|
|
+ padding: 30px 20px 0;
|
|
|
+ box-sizing: border-box;
|
|
|
+ line-height: 28px;
|
|
|
+ .content-item {
|
|
|
+ margin-bottom: 20px;
|
|
|
+ // &:last-of-type {
|
|
|
+ // margin-bottom: 0;
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ &.left-item {
|
|
|
+ width: 400px;
|
|
|
+ .item-title {
|
|
|
+ font-size: 14px;
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+ .content-desc {
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 28px;
|
|
|
+ }
|
|
|
+ .media-box {
|
|
|
+ width: 360px;
|
|
|
+ height: 225px;
|
|
|
+ border-radius: 4px 4px 4px 4px;
|
|
|
+ opacity: 1;
|
|
|
+ border: 1px solid rgba(255, 255, 255, 0.2);
|
|
|
+ position: relative;
|
|
|
+ margin-bottom: 30px;
|
|
|
+ // &.zoom-in {
|
|
|
+ // cursor: zoom-in;
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &.right-item {
|
|
|
+ .comment-content {
|
|
|
+ .comment-header {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
.tag-view {
|
|
|
pointer-events: all;
|
|
|
position: absolute;
|
|
@@ -61,8 +215,11 @@ onBeforeUnmount(() => {
|
|
|
.tag-view-content {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
- width: 740px;
|
|
|
- height: 400px;
|
|
|
+ // width: 740px;
|
|
|
+ // height: 400px;
|
|
|
+ width: 741px;
|
|
|
+ // height: 776px;
|
|
|
+ min-height: 70px;
|
|
|
background: rgba(27, 27, 28, 0.8);
|
|
|
box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
|
|
|
border-radius: 4px 4px 4px 4px;
|