| | |
| | | <!-- |
| | | * @Author: 胡思旗 931347610@qq.com |
| | | * @Date: 2023-08-28 15:23:47 |
| | | * @LastEditors: husq 931347610@qq.com |
| | | * @LastEditTime: 2023-09-08 09:14:02 |
| | | * @FilePath: \Cloud-API-Demo-Web\src\pages\page-web\projects\project_list\list_page\components\ProjectList.vue |
| | | * @Description:项目列表组件 |
| | | * |
| | | * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. |
| | | --> |
| | | <template> |
| | | <div class="project-box flex-common"> |
| | | <a-spin :spinning="model" style="width: 100%;"> |
| | | <div class="project-card" v-for="item in cardList" :key="item.id"> |
| | | <div class="project-left"> |
| | | <div class="project-card" :class="{active: index == selectIndex}" v-for="(item, index) in cardList" :key="item.id"> |
| | | <div class="project-left" @click="goCenter(item, index)"> |
| | | <div class="head mb10 flex-display flex-align-center flex-justify-between"> |
| | | <div class="head-left flex-display flex-align-center"> |
| | | <a-tag color="#87d068">{{ status[item.projectStatus] }}</a-tag> |
| | |
| | | import { status, projectCard } from './data' |
| | | import { del, edit } from '/@/api/project-page' |
| | | import { Modal, message } from 'ant-design-vue' |
| | | import { useMyStore} from "/@/store"; |
| | | import { useMyStore } from '/@/store' |
| | | import { flyTo, isEntityExist } from '/@/hooks/use-center-point' |
| | | const { appContext } = getCurrentInstance() |
| | | const global = appContext.config.globalProperties |
| | | const store = useMyStore() |
| | | const router = useRouter() |
| | | const emit = defineEmits(['refreshList', 'update:modelValue']) |
| | |
| | | } |
| | | }) |
| | | const spinning = ref<boolean>(true) |
| | | const selectIndex = ref(-1) |
| | | // 删除方法 |
| | | const deleteItem = (item: projectCard) => { |
| | | Modal.confirm({ |
| | |
| | | name: ERouterName.EDIT_PROJECT, |
| | | query: { id: item.id } |
| | | }) |
| | | store.commit('SET_POINT_LIST', []) |
| | | } |
| | | |
| | | const goDetail = (item: any) => { |
| | | console.log(11) |
| | | console.log(item, 'item') |
| | | store.commit('SET_PROJECT_ID', item.id) |
| | | store.commit('SET_POINT_LIST', []) |
| | | router.push({ |
| | | name: ERouterName.WORKSPACE, |
| | | query: { id: item.id } |
| | | query: { id: item.id }, |
| | | }) |
| | | } |
| | | |
| | | const goCenter = (item:any, index:number) => { |
| | | selectIndex.value === index ? selectIndex.value = -1 : selectIndex.value = index |
| | | flyTo(global.$viewer, item.longitude, item.latitude) |
| | | const flag = isEntityExist(global.$viewer, item.longitude, item.latitude) |
| | | console.log(flag, 'fffff') |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | |
| | | border-bottom: 1px solid #4f4f4f; |
| | | display: flex; |
| | | } |
| | | |
| | | .active { |
| | | cursor: pointer; |
| | | background-color: #101010; |
| | | } |
| | | .project-left { |
| | | padding: 16px; |
| | | flex: 1; |