husq
2023-09-27 2c2bc8614c8ea0ce386369eb4924da1e6aa052d1
src/pages/page-web/projects/project_list/list_page/list.vue
@@ -1,3 +1,13 @@
<!--
 * @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">
@@ -7,7 +17,7 @@
      </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" />
@@ -22,7 +32,7 @@
          </template>
        </a-input>
      </div>
    </div>
    </div> -->
    <div class="wrap_card">
      <List @refreshList="init" v-model="spinning" :cardList="cardList"></List>
    </div>
@@ -34,11 +44,15 @@
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')
@@ -62,14 +76,17 @@
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()
}
// 排序方法
@@ -81,20 +98,11 @@
// 页面初始化
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(() => {