| | |
| | | <!-- |
| | | * @Author: husq 931347610@qq.com |
| | | * @Date: 2023-09-13 18:21:08 |
| | | * @LastEditors: husq 931347610@qq.com |
| | | * @LastEditTime: 2023-09-21 16:45:06 |
| | | * @FilePath: \Cloud-API-Demo-Web\src\pages\page-web\projects\project_list\list_page\list.vue |
| | | * @Description: |
| | | * |
| | | * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. |
| | | --> |
| | | <template> |
| | | <div class="project"> |
| | | <div class="side-header"> |
| | |
| | | </div> |
| | | <div class="border-bottom"></div> |
| | | </div> |
| | | <div class="side-filter-warp"> |
| | | <!-- <div class="side-filter-warp"> |
| | | <div class="side-filter flex-display flex-align-center flex-justify-between"> |
| | | <Select :bordered="false" :options="statusOption" v-model="params.projectStatus" @handleChange="handleChange" /> |
| | | <Select :bordered="false" :options="projectOption" v-model="params.project" @handleChange="handleChange" /> |
| | |
| | | </template> |
| | | </a-input> |
| | | </div> |
| | | </div> |
| | | </div> --> |
| | | <div class="wrap_card"> |
| | | <List @refreshList="init" v-model="spinning" :cardList="cardList"></List> |
| | | </div> |
| | |
| | | import { ERouterName } from '/@/types/enums' |
| | | import { statusOption, sortOption, projectOption, map, sortEnum } from './data' |
| | | import { getPage as getProjectPage } from '/@/api/project-page' |
| | | import { getPlatform } from '/@/api/manage' |
| | | import { PlusCircleOutlined, MonitorOutlined } from '@ant-design/icons-vue' |
| | | import { projectCard } from './components/data' |
| | | import { useMyStore } from '/@/store' |
| | | import Select from '/@/components/Search/Select.vue' |
| | | import List from './components/ProjectList.vue' |
| | | import { cesiumOperation } from '/@/hooks/use-cesium-tsa' |
| | | const { appContext } = getCurrentInstance() |
| | | const global = appContext.config.globalProperties |
| | | const router = useRouter() |
| | | const store = useMyStore() |
| | | const sort = ref('createTime') |
| | |
| | | |
| | | const goDetail = () => { |
| | | router.push({ name: ERouterName.WORKSPACE }) |
| | | store.commit('SET_POINT_LIST', []) |
| | | } |
| | | const cesium = cesiumOperation(global.$viewer) |
| | | console.log(global, 'global') |
| | | const goAdd = () => { |
| | | router.push({ name: ERouterName.ADD_PROJECT }) |
| | | store.commit('SET_POINT_LIST', []) |
| | | } |
| | | const cardList = ref<projectCard[]>([]) |
| | | // 全部状态、全部项目筛选方法 |
| | | const handleChange = (e: any) => { |
| | | console.log(e, params.value, '=============') |
| | | init() |
| | | } |
| | | // 排序方法 |
| | |
| | | // 页面初始化 |
| | | const init = async () => { |
| | | spinning.value = true |
| | | const res = await getProjectPage(params.value).catch(e => { |
| | | const res = await getPlatform(params.value, 1, 20).catch(e => { |
| | | spinning.value = false |
| | | }) |
| | | cardList.value = res.data.records |
| | | const longitudeList = res.data.records.map((item: { id:string, longitude: any; latitude: any, projectName:string }) => { |
| | | return { |
| | | longitude: item.longitude, |
| | | latitude: item.latitude, |
| | | label: item.projectName, |
| | | id: item.id |
| | | } |
| | | }) |
| | | console.log(longitudeList, 'longitudeList') |
| | | store.commit('SET_POINT_LIST', longitudeList) |
| | | cardList.value = res.data.list |
| | | cesium.removeAllPoint() |
| | | spinning.value = false |
| | | } |
| | | onMounted(() => { |