提交 17b33acc 编写于 作者: 6 636330faf41fcd5b556fd4b5

应用开发

上级 e63fb81c
import { defuFn } from 'defu'
const inlineConfig = {}
export default defuFn(inlineConfig)
// Generated by components discovery
declare module '@vue/runtime-core' {
export interface GlobalComponents {
'NuxtWelcome': typeof import("../node_modules/@nuxt/ui-templates/dist/templates/welcome.vue")['default']
'NuxtLayout': typeof import("../node_modules/nuxt/dist/app/components/layout")['default']
'NuxtErrorBoundary': typeof import("../node_modules/nuxt/dist/app/components/nuxt-error-boundary")['default']
'ClientOnly': typeof import("../node_modules/nuxt/dist/app/components/client-only")['default']
'ServerPlaceholder': typeof import("../node_modules/nuxt/dist/app/components/server-placeholder")['default']
'NuxtLink': typeof import("../node_modules/nuxt/dist/app/components/nuxt-link")['default']
'NuxtLoadingIndicator': typeof import("../node_modules/nuxt/dist/app/components/nuxt-loading-indicator")['default']
'NuxtPage': typeof import("../node_modules/nuxt/dist/pages/runtime/page")['default']
'Script': typeof import("../node_modules/nuxt/dist/head/runtime/components")['Script']
'NoScript': typeof import("../node_modules/nuxt/dist/head/runtime/components")['NoScript']
'Link': typeof import("../node_modules/nuxt/dist/head/runtime/components")['Link']
'Base': typeof import("../node_modules/nuxt/dist/head/runtime/components")['Base']
'Title': typeof import("../node_modules/nuxt/dist/head/runtime/components")['Title']
'Meta': typeof import("../node_modules/nuxt/dist/head/runtime/components")['Meta']
'Style': typeof import("../node_modules/nuxt/dist/head/runtime/components")['Style']
'Head': typeof import("../node_modules/nuxt/dist/head/runtime/components")['Head']
'Html': typeof import("../node_modules/nuxt/dist/head/runtime/components")['Html']
'Body': typeof import("../node_modules/nuxt/dist/head/runtime/components")['Body']
'LazyNuxtWelcome': typeof import("../node_modules/@nuxt/ui-templates/dist/templates/welcome.vue")['default']
'LazyNuxtLayout': typeof import("../node_modules/nuxt/dist/app/components/layout")['default']
'LazyNuxtErrorBoundary': typeof import("../node_modules/nuxt/dist/app/components/nuxt-error-boundary")['default']
'LazyClientOnly': typeof import("../node_modules/nuxt/dist/app/components/client-only")['default']
'LazyServerPlaceholder': typeof import("../node_modules/nuxt/dist/app/components/server-placeholder")['default']
'LazyNuxtLink': typeof import("../node_modules/nuxt/dist/app/components/nuxt-link")['default']
'LazyNuxtLoadingIndicator': typeof import("../node_modules/nuxt/dist/app/components/nuxt-loading-indicator")['default']
'LazyNuxtPage': typeof import("../node_modules/nuxt/dist/pages/runtime/page")['default']
'LazyScript': typeof import("../node_modules/nuxt/dist/head/runtime/components")['Script']
'LazyNoScript': typeof import("../node_modules/nuxt/dist/head/runtime/components")['NoScript']
'LazyLink': typeof import("../node_modules/nuxt/dist/head/runtime/components")['Link']
'LazyBase': typeof import("../node_modules/nuxt/dist/head/runtime/components")['Base']
'LazyTitle': typeof import("../node_modules/nuxt/dist/head/runtime/components")['Title']
'LazyMeta': typeof import("../node_modules/nuxt/dist/head/runtime/components")['Meta']
'LazyStyle': typeof import("../node_modules/nuxt/dist/head/runtime/components")['Style']
'LazyHead': typeof import("../node_modules/nuxt/dist/head/runtime/components")['Head']
'LazyHtml': typeof import("../node_modules/nuxt/dist/head/runtime/components")['Html']
'LazyBody': typeof import("../node_modules/nuxt/dist/head/runtime/components")['Body']
}
}
export const NuxtWelcome: typeof import("../node_modules/@nuxt/ui-templates/dist/templates/welcome.vue")['default']
export const NuxtLayout: typeof import("../node_modules/nuxt/dist/app/components/layout")['default']
export const NuxtErrorBoundary: typeof import("../node_modules/nuxt/dist/app/components/nuxt-error-boundary")['default']
export const ClientOnly: typeof import("../node_modules/nuxt/dist/app/components/client-only")['default']
export const ServerPlaceholder: typeof import("../node_modules/nuxt/dist/app/components/server-placeholder")['default']
export const NuxtLink: typeof import("../node_modules/nuxt/dist/app/components/nuxt-link")['default']
export const NuxtLoadingIndicator: typeof import("../node_modules/nuxt/dist/app/components/nuxt-loading-indicator")['default']
export const NuxtPage: typeof import("../node_modules/nuxt/dist/pages/runtime/page")['default']
export const Script: typeof import("../node_modules/nuxt/dist/head/runtime/components")['Script']
export const NoScript: typeof import("../node_modules/nuxt/dist/head/runtime/components")['NoScript']
export const Link: typeof import("../node_modules/nuxt/dist/head/runtime/components")['Link']
export const Base: typeof import("../node_modules/nuxt/dist/head/runtime/components")['Base']
export const Title: typeof import("../node_modules/nuxt/dist/head/runtime/components")['Title']
export const Meta: typeof import("../node_modules/nuxt/dist/head/runtime/components")['Meta']
export const Style: typeof import("../node_modules/nuxt/dist/head/runtime/components")['Style']
export const Head: typeof import("../node_modules/nuxt/dist/head/runtime/components")['Head']
export const Html: typeof import("../node_modules/nuxt/dist/head/runtime/components")['Html']
export const Body: typeof import("../node_modules/nuxt/dist/head/runtime/components")['Body']
export const LazyNuxtWelcome: typeof import("../node_modules/@nuxt/ui-templates/dist/templates/welcome.vue")['default']
export const LazyNuxtLayout: typeof import("../node_modules/nuxt/dist/app/components/layout")['default']
export const LazyNuxtErrorBoundary: typeof import("../node_modules/nuxt/dist/app/components/nuxt-error-boundary")['default']
export const LazyClientOnly: typeof import("../node_modules/nuxt/dist/app/components/client-only")['default']
export const LazyServerPlaceholder: typeof import("../node_modules/nuxt/dist/app/components/server-placeholder")['default']
export const LazyNuxtLink: typeof import("../node_modules/nuxt/dist/app/components/nuxt-link")['default']
export const LazyNuxtLoadingIndicator: typeof import("../node_modules/nuxt/dist/app/components/nuxt-loading-indicator")['default']
export const LazyNuxtPage: typeof import("../node_modules/nuxt/dist/pages/runtime/page")['default']
export const LazyScript: typeof import("../node_modules/nuxt/dist/head/runtime/components")['Script']
export const LazyNoScript: typeof import("../node_modules/nuxt/dist/head/runtime/components")['NoScript']
export const LazyLink: typeof import("../node_modules/nuxt/dist/head/runtime/components")['Link']
export const LazyBase: typeof import("../node_modules/nuxt/dist/head/runtime/components")['Base']
export const LazyTitle: typeof import("../node_modules/nuxt/dist/head/runtime/components")['Title']
export const LazyMeta: typeof import("../node_modules/nuxt/dist/head/runtime/components")['Meta']
export const LazyStyle: typeof import("../node_modules/nuxt/dist/head/runtime/components")['Style']
export const LazyHead: typeof import("../node_modules/nuxt/dist/head/runtime/components")['Head']
export const LazyHtml: typeof import("../node_modules/nuxt/dist/head/runtime/components")['Html']
export const LazyBody: typeof import("../node_modules/nuxt/dist/head/runtime/components")['Body']
export const componentNames: string[]
此差异已折叠。
此差异已折叠。
{
"@vite/client": {
"isEntry": true,
"file": "@vite/client",
"css": [],
"module": true,
"resourceType": "script"
},
"/ide/workspace/1024/node_modules/nuxt/dist/app/entry.mjs": {
"resourceType": "script",
"module": true,
"isEntry": true,
"file": "/ide/workspace/1024/node_modules/nuxt/dist/app/entry.mjs"
}
}
\ No newline at end of file
export default {
"@vite/client": {
"isEntry": true,
"file": "@vite/client",
"css": [],
"module": true,
"resourceType": "script"
},
"/ide/workspace/1024/node_modules/nuxt/dist/app/entry.mjs": {
"resourceType": "script",
"module": true,
"isEntry": true,
"file": "/ide/workspace/1024/node_modules/nuxt/dist/app/entry.mjs"
}
}
\ No newline at end of file
export { useHead, useMeta } from '#head';
export { isVue2, isVue3 } from 'vue-demi';
export { useAsyncData, useLazyAsyncData, refreshNuxtData, clearNuxtData, defineNuxtComponent, useNuxtApp, defineNuxtPlugin, useRuntimeConfig, useState, useFetch, useLazyFetch, useCookie, useRequestHeaders, useRequestEvent, setResponseStatus, setPageLayout, useRouter, useRoute, useActiveRoute, defineNuxtRouteMiddleware, navigateTo, abortNavigation, addRouteMiddleware, throwError, showError, clearError, isNuxtError, useError, createError, defineNuxtLink, useAppConfig, updateAppConfig, defineAppConfig, preloadComponents, preloadRouteComponents, prefetchComponents, loadPayload, preloadPayload, isPrerendered } from '#app';
export { withCtx, withDirectives, withKeys, withMemo, withModifiers, withScopeId, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onServerPrefetch, onUnmounted, onUpdated, computed, customRef, isProxy, isReactive, isReadonly, isRef, markRaw, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, toRaw, toRef, toRefs, triggerRef, unref, watch, watchEffect, isShallow, effect, effectScope, getCurrentScope, onScopeDispose, defineComponent, defineAsyncComponent, resolveComponent, getCurrentInstance, h, inject, nextTick, provide, useAttrs, useCssModule, useCssVars, useSlots, useTransitionState } from 'vue';
export { definePageMeta } from '../node_modules/nuxt/dist/pages/runtime/composables';
export { useLink } from 'vue-router';
\ No newline at end of file
// Generated by nuxi
/// <reference types="@nuxt/telemetry" />
/// <reference types="nuxt" />
/// <reference path="types/plugins.d.ts" />
/// <reference path="types/vue-shim.d.ts" />
/// <reference path="types/schema.d.ts" />
/// <reference path="types/app.config.d.ts" />
/// <reference types="vue-router" />
/// <reference path="types/middleware.d.ts" />
/// <reference path="types/layouts.d.ts" />
/// <reference path="components.d.ts" />
/// <reference path="types/imports.d.ts" />
/// <reference path="imports.d.ts" />
/// <reference path="types/nitro.d.ts" />
export {}
{
"_hash": "GOBTrb8FvN",
"project": {
"rootDir": "/ide/workspace/1024"
},
"versions": {
"nuxt": "3.0.0-rc.12"
}
}
\ No newline at end of file
// Generated by nuxi
{
"compilerOptions": {
"jsx": "preserve",
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Node",
"skipLibCheck": true,
"strict": false,
"allowJs": true,
"noEmit": true,
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"types": [
"node"
],
"baseUrl": "..",
"paths": {
"~~": [
"."
],
"~~/*": [
"./*"
],
"@@": [
"."
],
"@@/*": [
"./*"
],
"~": [
"."
],
"~/*": [
"./*"
],
"@": [
"."
],
"@/*": [
"./*"
],
"assets": [
"assets"
],
"public": [
"public"
],
"public/*": [
"public/*"
],
"#app": [
"node_modules/nuxt/dist/app"
],
"#app/*": [
"node_modules/nuxt/dist/app/*"
],
"vue-demi": [
"node_modules/nuxt/dist/app/compat/vue-demi"
],
"#head": [
"node_modules/nuxt/dist/head/runtime"
],
"#head/*": [
"node_modules/nuxt/dist/head/runtime/*"
],
"#imports": [
".nuxt/imports"
],
"#build": [
".nuxt"
],
"#build/*": [
".nuxt/*"
],
"#components": [
".nuxt/components"
]
}
},
"include": [
"./nuxt.d.ts",
"../**/*"
]
}
\ No newline at end of file
import type { Defu } from 'defu'
declare const inlineConfig = {}
type ResolvedAppConfig = Defu<typeof inlineConfig, []>
declare module '@nuxt/schema' {
interface AppConfig extends ResolvedAppConfig { }
}
// Generated by auto imports
export {}
declare global {
const abortNavigation: typeof import('../../node_modules/nuxt/dist/app')['abortNavigation']
const addRouteMiddleware: typeof import('../../node_modules/nuxt/dist/app')['addRouteMiddleware']
const clearError: typeof import('../../node_modules/nuxt/dist/app')['clearError']
const clearNuxtData: typeof import('../../node_modules/nuxt/dist/app')['clearNuxtData']
const computed: typeof import('vue')['computed']
const createError: typeof import('../../node_modules/nuxt/dist/app')['createError']
const customRef: typeof import('vue')['customRef']
const defineAppConfig: typeof import('../../node_modules/nuxt/dist/app')['defineAppConfig']
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
const defineComponent: typeof import('vue')['defineComponent']
const defineNuxtComponent: typeof import('../../node_modules/nuxt/dist/app')['defineNuxtComponent']
const defineNuxtLink: typeof import('../../node_modules/nuxt/dist/app')['defineNuxtLink']
const defineNuxtPlugin: typeof import('../../node_modules/nuxt/dist/app')['defineNuxtPlugin']
const defineNuxtRouteMiddleware: typeof import('../../node_modules/nuxt/dist/app')['defineNuxtRouteMiddleware']
const definePageMeta: typeof import('../../node_modules/nuxt/dist/pages/runtime/composables')['definePageMeta']
const effect: typeof import('vue')['effect']
const effectScope: typeof import('vue')['effectScope']
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
const getCurrentScope: typeof import('vue')['getCurrentScope']
const h: typeof import('vue')['h']
const inject: typeof import('vue')['inject']
const isNuxtError: typeof import('../../node_modules/nuxt/dist/app')['isNuxtError']
const isPrerendered: typeof import('../../node_modules/nuxt/dist/app')['isPrerendered']
const isProxy: typeof import('vue')['isProxy']
const isReactive: typeof import('vue')['isReactive']
const isReadonly: typeof import('vue')['isReadonly']
const isRef: typeof import('vue')['isRef']
const isShallow: typeof import('vue')['isShallow']
const isVue2: typeof import('../../node_modules/nuxt/dist/app/compat/vue-demi')['isVue2']
const isVue3: typeof import('../../node_modules/nuxt/dist/app/compat/vue-demi')['isVue3']
const loadPayload: typeof import('../../node_modules/nuxt/dist/app')['loadPayload']
const markRaw: typeof import('vue')['markRaw']
const navigateTo: typeof import('../../node_modules/nuxt/dist/app')['navigateTo']
const nextTick: typeof import('vue')['nextTick']
const onActivated: typeof import('vue')['onActivated']
const onBeforeMount: typeof import('vue')['onBeforeMount']
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
const onDeactivated: typeof import('vue')['onDeactivated']
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
const onMounted: typeof import('vue')['onMounted']
const onRenderTracked: typeof import('vue')['onRenderTracked']
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
const onScopeDispose: typeof import('vue')['onScopeDispose']
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
const onUnmounted: typeof import('vue')['onUnmounted']
const onUpdated: typeof import('vue')['onUpdated']
const prefetchComponents: typeof import('../../node_modules/nuxt/dist/app')['prefetchComponents']
const preloadComponents: typeof import('../../node_modules/nuxt/dist/app')['preloadComponents']
const preloadPayload: typeof import('../../node_modules/nuxt/dist/app')['preloadPayload']
const preloadRouteComponents: typeof import('../../node_modules/nuxt/dist/app')['preloadRouteComponents']
const provide: typeof import('vue')['provide']
const proxyRefs: typeof import('vue')['proxyRefs']
const reactive: typeof import('vue')['reactive']
const readonly: typeof import('vue')['readonly']
const ref: typeof import('vue')['ref']
const refreshNuxtData: typeof import('../../node_modules/nuxt/dist/app')['refreshNuxtData']
const resolveComponent: typeof import('vue')['resolveComponent']
const setPageLayout: typeof import('../../node_modules/nuxt/dist/app')['setPageLayout']
const setResponseStatus: typeof import('../../node_modules/nuxt/dist/app')['setResponseStatus']
const shallowReactive: typeof import('vue')['shallowReactive']
const shallowReadonly: typeof import('vue')['shallowReadonly']
const shallowRef: typeof import('vue')['shallowRef']
const showError: typeof import('../../node_modules/nuxt/dist/app')['showError']
const throwError: typeof import('../../node_modules/nuxt/dist/app')['throwError']
const toRaw: typeof import('vue')['toRaw']
const toRef: typeof import('vue')['toRef']
const toRefs: typeof import('vue')['toRefs']
const triggerRef: typeof import('vue')['triggerRef']
const unref: typeof import('vue')['unref']
const updateAppConfig: typeof import('../../node_modules/nuxt/dist/app')['updateAppConfig']
const useActiveRoute: typeof import('../../node_modules/nuxt/dist/app')['useActiveRoute']
const useAppConfig: typeof import('../../node_modules/nuxt/dist/app')['useAppConfig']
const useAsyncData: typeof import('../../node_modules/nuxt/dist/app')['useAsyncData']
const useAttrs: typeof import('vue')['useAttrs']
const useCookie: typeof import('../../node_modules/nuxt/dist/app')['useCookie']
const useCssModule: typeof import('vue')['useCssModule']
const useCssVars: typeof import('vue')['useCssVars']
const useError: typeof import('../../node_modules/nuxt/dist/app')['useError']
const useFetch: typeof import('../../node_modules/nuxt/dist/app')['useFetch']
const useHead: typeof import('../../node_modules/nuxt/dist/head/runtime')['useHead']
const useLazyAsyncData: typeof import('../../node_modules/nuxt/dist/app')['useLazyAsyncData']
const useLazyFetch: typeof import('../../node_modules/nuxt/dist/app')['useLazyFetch']
const useLink: typeof import('vue-router')['useLink']
const useMeta: typeof import('../../node_modules/nuxt/dist/head/runtime')['useMeta']
const useNuxtApp: typeof import('../../node_modules/nuxt/dist/app')['useNuxtApp']
const useRequestEvent: typeof import('../../node_modules/nuxt/dist/app')['useRequestEvent']
const useRequestHeaders: typeof import('../../node_modules/nuxt/dist/app')['useRequestHeaders']
const useRoute: typeof import('../../node_modules/nuxt/dist/app')['useRoute']
const useRouter: typeof import('../../node_modules/nuxt/dist/app')['useRouter']
const useRuntimeConfig: typeof import('../../node_modules/nuxt/dist/app')['useRuntimeConfig']
const useSlots: typeof import('vue')['useSlots']
const useState: typeof import('../../node_modules/nuxt/dist/app')['useState']
const useTransitionState: typeof import('vue')['useTransitionState']
const watch: typeof import('vue')['watch']
const watchEffect: typeof import('vue')['watchEffect']
const withCtx: typeof import('vue')['withCtx']
const withDirectives: typeof import('vue')['withDirectives']
const withKeys: typeof import('vue')['withKeys']
const withMemo: typeof import('vue')['withMemo']
const withModifiers: typeof import('vue')['withModifiers']
const withScopeId: typeof import('vue')['withScopeId']
}
// for vue template auto import
import { UnwrapRef } from 'vue'
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
readonly abortNavigation: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['abortNavigation']>
readonly addRouteMiddleware: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['addRouteMiddleware']>
readonly clearError: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['clearError']>
readonly clearNuxtData: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['clearNuxtData']>
readonly computed: UnwrapRef<typeof import('vue')['computed']>
readonly createError: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['createError']>
readonly customRef: UnwrapRef<typeof import('vue')['customRef']>
readonly defineAppConfig: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['defineAppConfig']>
readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']>
readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
readonly defineNuxtComponent: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['defineNuxtComponent']>
readonly defineNuxtLink: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['defineNuxtLink']>
readonly defineNuxtPlugin: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['defineNuxtPlugin']>
readonly defineNuxtRouteMiddleware: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['defineNuxtRouteMiddleware']>
readonly definePageMeta: UnwrapRef<typeof import('../../node_modules/nuxt/dist/pages/runtime/composables')['definePageMeta']>
readonly effect: UnwrapRef<typeof import('vue')['effect']>
readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
readonly h: UnwrapRef<typeof import('vue')['h']>
readonly inject: UnwrapRef<typeof import('vue')['inject']>
readonly isNuxtError: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['isNuxtError']>
readonly isPrerendered: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['isPrerendered']>
readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
readonly isShallow: UnwrapRef<typeof import('vue')['isShallow']>
readonly isVue2: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app/compat/vue-demi')['isVue2']>
readonly isVue3: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app/compat/vue-demi')['isVue3']>
readonly loadPayload: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['loadPayload']>
readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
readonly navigateTo: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['navigateTo']>
readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']>
readonly onBeforeMount: UnwrapRef<typeof import('vue')['onBeforeMount']>
readonly onBeforeUnmount: UnwrapRef<typeof import('vue')['onBeforeUnmount']>
readonly onBeforeUpdate: UnwrapRef<typeof import('vue')['onBeforeUpdate']>
readonly onDeactivated: UnwrapRef<typeof import('vue')['onDeactivated']>
readonly onErrorCaptured: UnwrapRef<typeof import('vue')['onErrorCaptured']>
readonly onMounted: UnwrapRef<typeof import('vue')['onMounted']>
readonly onRenderTracked: UnwrapRef<typeof import('vue')['onRenderTracked']>
readonly onRenderTriggered: UnwrapRef<typeof import('vue')['onRenderTriggered']>
readonly onScopeDispose: UnwrapRef<typeof import('vue')['onScopeDispose']>
readonly onServerPrefetch: UnwrapRef<typeof import('vue')['onServerPrefetch']>
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
readonly prefetchComponents: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['prefetchComponents']>
readonly preloadComponents: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['preloadComponents']>
readonly preloadPayload: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['preloadPayload']>
readonly preloadRouteComponents: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['preloadRouteComponents']>
readonly provide: UnwrapRef<typeof import('vue')['provide']>
readonly proxyRefs: UnwrapRef<typeof import('vue')['proxyRefs']>
readonly reactive: UnwrapRef<typeof import('vue')['reactive']>
readonly readonly: UnwrapRef<typeof import('vue')['readonly']>
readonly ref: UnwrapRef<typeof import('vue')['ref']>
readonly refreshNuxtData: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['refreshNuxtData']>
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
readonly setPageLayout: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['setPageLayout']>
readonly setResponseStatus: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['setResponseStatus']>
readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
readonly shallowReadonly: UnwrapRef<typeof import('vue')['shallowReadonly']>
readonly shallowRef: UnwrapRef<typeof import('vue')['shallowRef']>
readonly showError: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['showError']>
readonly throwError: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['throwError']>
readonly toRaw: UnwrapRef<typeof import('vue')['toRaw']>
readonly toRef: UnwrapRef<typeof import('vue')['toRef']>
readonly toRefs: UnwrapRef<typeof import('vue')['toRefs']>
readonly triggerRef: UnwrapRef<typeof import('vue')['triggerRef']>
readonly unref: UnwrapRef<typeof import('vue')['unref']>
readonly updateAppConfig: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['updateAppConfig']>
readonly useActiveRoute: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['useActiveRoute']>
readonly useAppConfig: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['useAppConfig']>
readonly useAsyncData: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['useAsyncData']>
readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
readonly useCookie: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['useCookie']>
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
readonly useError: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['useError']>
readonly useFetch: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['useFetch']>
readonly useHead: UnwrapRef<typeof import('../../node_modules/nuxt/dist/head/runtime')['useHead']>
readonly useLazyAsyncData: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['useLazyAsyncData']>
readonly useLazyFetch: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['useLazyFetch']>
readonly useLink: UnwrapRef<typeof import('vue-router')['useLink']>
readonly useMeta: UnwrapRef<typeof import('../../node_modules/nuxt/dist/head/runtime')['useMeta']>
readonly useNuxtApp: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['useNuxtApp']>
readonly useRequestEvent: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['useRequestEvent']>
readonly useRequestHeaders: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['useRequestHeaders']>
readonly useRoute: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['useRoute']>
readonly useRouter: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['useRouter']>
readonly useRuntimeConfig: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['useRuntimeConfig']>
readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
readonly useState: UnwrapRef<typeof import('../../node_modules/nuxt/dist/app')['useState']>
readonly useTransitionState: UnwrapRef<typeof import('vue')['useTransitionState']>
readonly watch: UnwrapRef<typeof import('vue')['watch']>
readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>
readonly withCtx: UnwrapRef<typeof import('vue')['withCtx']>
readonly withDirectives: UnwrapRef<typeof import('vue')['withDirectives']>
readonly withKeys: UnwrapRef<typeof import('vue')['withKeys']>
readonly withMemo: UnwrapRef<typeof import('vue')['withMemo']>
readonly withModifiers: UnwrapRef<typeof import('vue')['withModifiers']>
readonly withScopeId: UnwrapRef<typeof import('vue')['withScopeId']>
}
}
import { ComputedRef, Ref } from 'vue'
export type LayoutKey = "default"
declare module "/ide/workspace/1024/node_modules/nuxt/dist/pages/runtime/composables" {
interface PageMeta {
layout?: false | LayoutKey | Ref<LayoutKey> | ComputedRef<LayoutKey>
}
}
\ No newline at end of file
import type { NavigationGuard } from 'vue-router'
export type MiddlewareKey = string
declare module "/ide/workspace/1024/node_modules/nuxt/dist/pages/runtime/composables" {
interface PageMeta {
middleware?: MiddlewareKey | NavigationGuard | Array<MiddlewareKey | NavigationGuard>
}
}
\ No newline at end of file
// Generated by nitro
declare module 'nitropack' {
type Awaited<T> = T extends PromiseLike<infer U> ? Awaited<U> : T
interface InternalApi {
'/__nuxt_error': Awaited<ReturnType<typeof import('../../node_modules/nuxt/dist/core/runtime/nitro/renderer').default>>
}
}
declare global {
const appendHeader: typeof import('h3')['appendHeader']
const appendHeaders: typeof import('h3')['appendHeaders']
const appendResponseHeader: typeof import('h3')['appendResponseHeader']
const appendResponseHeaders: typeof import('h3')['appendResponseHeaders']
const assertMethod: typeof import('h3')['assertMethod']
const cachedEventHandler: typeof import('/ide/workspace/1024/node_modules/nitropack/dist/runtime')['cachedEventHandler']
const cachedFunction: typeof import('/ide/workspace/1024/node_modules/nitropack/dist/runtime')['cachedFunction']
const callNodeListener: typeof import('h3')['callNodeListener']
const createApp: typeof import('h3')['createApp']
const createAppEventHandler: typeof import('h3')['createAppEventHandler']
const createError: typeof import('h3')['createError']
const createEvent: typeof import('h3')['createEvent']
const createRouter: typeof import('h3')['createRouter']
const defaultContentType: typeof import('h3')['defaultContentType']
const defineCachedEventHandler: typeof import('/ide/workspace/1024/node_modules/nitropack/dist/runtime')['defineCachedEventHandler']
const defineCachedFunction: typeof import('/ide/workspace/1024/node_modules/nitropack/dist/runtime')['defineCachedFunction']
const defineEventHandler: typeof import('h3')['defineEventHandler']
const defineLazyEventHandler: typeof import('h3')['defineLazyEventHandler']
const defineNitroPlugin: typeof import('/ide/workspace/1024/node_modules/nitropack/dist/runtime')['defineNitroPlugin']
const defineNodeListener: typeof import('h3')['defineNodeListener']
const defineNodeMiddleware: typeof import('h3')['defineNodeMiddleware']
const defineRenderHandler: typeof import('/ide/workspace/1024/node_modules/nitropack/dist/runtime')['defineRenderHandler']
const deleteCookie: typeof import('h3')['deleteCookie']
const dynamicEventHandler: typeof import('h3')['dynamicEventHandler']
const eventHandler: typeof import('h3')['eventHandler']
const fromNodeMiddleware: typeof import('h3')['fromNodeMiddleware']
const getCookie: typeof import('h3')['getCookie']
const getHeader: typeof import('h3')['getHeader']
const getHeaders: typeof import('h3')['getHeaders']
const getMethod: typeof import('h3')['getMethod']
const getQuery: typeof import('h3')['getQuery']
const getRequestHeader: typeof import('h3')['getRequestHeader']
const getRequestHeaders: typeof import('h3')['getRequestHeaders']
const getResponseHeader: typeof import('h3')['getResponseHeader']
const getResponseHeaders: typeof import('h3')['getResponseHeaders']
const getRouteRules: typeof import('/ide/workspace/1024/node_modules/nitropack/dist/runtime')['getRouteRules']
const getRouterParam: typeof import('h3')['getRouterParam']
const getRouterParams: typeof import('h3')['getRouterParams']
const handleCacheHeaders: typeof import('h3')['handleCacheHeaders']
const isError: typeof import('h3')['isError']
const isEvent: typeof import('h3')['isEvent']
const isEventHandler: typeof import('h3')['isEventHandler']
const isMethod: typeof import('h3')['isMethod']
const isStream: typeof import('h3')['isStream']
const lazyEventHandler: typeof import('h3')['lazyEventHandler']
const nitroPlugin: typeof import('/ide/workspace/1024/node_modules/nitropack/dist/runtime')['nitroPlugin']
const parseCookies: typeof import('h3')['parseCookies']
const promisifyNodeListener: typeof import('h3')['promisifyNodeListener']
const readBody: typeof import('h3')['readBody']
const readRawBody: typeof import('h3')['readRawBody']
const send: typeof import('h3')['send']
const sendError: typeof import('h3')['sendError']
const sendProxy: typeof import('h3')['sendProxy']
const sendRedirect: typeof import('h3')['sendRedirect']
const sendStream: typeof import('h3')['sendStream']
const setCookie: typeof import('h3')['setCookie']
const setHeader: typeof import('h3')['setHeader']
const setHeaders: typeof import('h3')['setHeaders']
const setResponseHeader: typeof import('h3')['setResponseHeader']
const setResponseHeaders: typeof import('h3')['setResponseHeaders']
const toEventHandler: typeof import('h3')['toEventHandler']
const toNodeListener: typeof import('h3')['toNodeListener']
const useBase: typeof import('h3')['useBase']
const useBody: typeof import('h3')['useBody']
const useCookie: typeof import('h3')['useCookie']
const useCookies: typeof import('h3')['useCookies']
const useMethod: typeof import('h3')['useMethod']
const useNitroApp: typeof import('/ide/workspace/1024/node_modules/nitropack/dist/runtime')['useNitroApp']
const useQuery: typeof import('h3')['useQuery']
const useRawBody: typeof import('h3')['useRawBody']
const useRuntimeConfig: typeof import('/ide/workspace/1024/node_modules/nitropack/dist/runtime')['useRuntimeConfig']
const useStorage: typeof import('/ide/workspace/1024/node_modules/nitropack/dist/runtime')['useStorage']
const writeEarlyHints: typeof import('h3')['writeEarlyHints']
}
export {}
\ No newline at end of file
// Generated by Nuxt'
import type { Plugin } from '#app'
type Decorate<T extends Record<string, any>> = { [K in keyof T as K extends string ? `$${K}` : never]: T[K] }
type InjectionType<A extends Plugin> = A extends Plugin<infer T> ? Decorate<T> : unknown
type NuxtAppInjections =
InjectionType<typeof import("../components.plugin").default> &
InjectionType<typeof import("../../node_modules/nuxt/dist/head/runtime/lib/vueuse-head.plugin").default> &
InjectionType<typeof import("../../node_modules/nuxt/dist/head/runtime/mixin-plugin").default> &
InjectionType<typeof import("../../node_modules/nuxt/dist/pages/runtime/router").default>
declare module '#app' {
interface NuxtApp extends NuxtAppInjections { }
}
declare module '@vue/runtime-core' {
interface ComponentCustomProperties extends NuxtAppInjections { }
}
export { }
import { NuxtModule } from '@nuxt/schema'
declare module '@nuxt/schema' {
interface NuxtConfig {
["telemetry"]?: typeof import("@nuxt/telemetry").default extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
}
interface RuntimeConfig {
app: {
baseURL: string,
buildAssetsDir: string,
cdnURL: string,
},
}
interface PublicRuntimeConfig {
}
}
\ No newline at end of file
declare module '*.vue' {
import { DefineComponent } from '@vue/runtime-core'
const component: DefineComponent<{}, {}, any>
export default component
}
\ No newline at end of file
![](https://file.iviewui.com/cloud-ide/1024game-cover.png)
# 基于Three.js实现的3D地图点位分布情况
## 一、大赛介绍
> 应用使用three.js实现点位在3D地图上的立体分布情况。以台北设计公司点位分布为例,实现公司点位分布,根据公司所在楼层高度显示,按照公司类型采用不用颜色渲染展示。可以根据类型过滤显示和鼠标移入查看公司属性信息。
代码开发随着云计算技术的不断发展,云 IDE 能够帮助开发者聚焦业务逻辑,简化应用开发难度,提升软件研发效率。云 IDE 应用挑战赛是由 CSDN 自主策划的轻量级挑战赛事。参赛者可在 CSDN 的云 IDE 上([https://ide.csdn.net](https://ide.csdn.net))自动拉取代码并在线运行、预览、提交代码,赛事所有的事项都可以在云 IDE 内一站式完成。比赛不对作品提交形式作限制,参赛者可以尽情发挥自己的想象力。
## 一、效果展示
![app](public/app.gif)
## 二、参赛对象
## 二、核心实现
大赛面向全社会开放,个人、高等院校、科研单位、企业等人员均可报名参赛。
1、地形图切片加载原理;
说明:如有大赛主办方和技术支持单位(如 CSDN 员工)参赛,则自动放弃获奖资格。
2、经纬度坐标、Web墨卡托、切片顶点坐标之间的转换;
## 三、赛事安排
3、空间数据经纬度和webgl空间坐标之间的转换。
| 赛程 | 时间 |
| ---- | ---- |
| 参赛报名及提交作品 | 2022.10.23 - 2022.11.06 |
| 作品评选 | 2022.11.07 - 2022.11.14 |
| 评选结果公布 | 2022.11.15 |
| 奖励发放 | 2022.11.16 - 2022.11.22 |
## 三、实现步骤
## 四、奖项设置
### 数据准备
| 奖项 | 奖品 | 人数 |
| ---- | ---- | ---- |
| 一等奖 | **奖金 ¥5000 元** + 10核 10G 云实验环境会员 -1年| 1 |
| 二等奖 | **奖金 ¥2000 元** + 10核 10G 云实验环境会员 -1年 | 2 |
| 三等奖 | **奖金 ¥1000 元** + 10核 10G 云实验环境会员 -1年 | 5 |
| 优秀奖 | **奖金 ¥100 元** + 10核 10G 云实验环境会员 -1年 | 80 |
| 参与奖 | 10核 10G 云实验环境会员 -1个月 | 前10000名参赛者可得 |
地形图:地形图栅格切片处理
注:一年10核10G云实验环境会员,非云服务器,是云容器实验环境,详细介绍[戳我查看](https://mydev.csdn.net/product/pod/new)
设计公司位置信息:空间数据geojson文件存储
## 五、参赛要求
### 开发应用
1. 开发者可根据自己情况选择业界知名开源项目进行自行开发,或自研可开源项目结合GitCode和Cloud IDE进行开发与适配,作品要求必须能通过 CSDN 的云 IDE 内置的预览功能,在云 IDE 内预览。(CSDN 的云IDE:[https://ide.csdn.net](https://ide.csdn.net))。作品可以是任何小应用(如外卖H5、个人主页);小游戏(如 2048、五子棋);各类特效(如 three.js、前端动画)等。
1、应用采用nuxt3搭建,为什么呢?没有为什么,就是最近再用它做项目,对此应用影响不大;(由于是小型应用,对应用框架没有过多配置)
2. 未满 18 周岁的报名者,请在报名前征得有法定监护权的监护人的同意。
2、引入three.js、camera-controls核心依赖;
3. 参赛作品不存在抄袭等行为。
3、创建webgl场景;
4. 除参与奖外,获奖人员,领奖时需实名认证,1 个实名认证用户仅可领取1份奖项。
4、使用地形图切片原理请求切片作为纹理加载到场景中,其中需要做一系列坐标转换,经纬度转Web墨卡托、Web墨卡托转像素坐标;
## 六、报名及参赛流程
5、读取设计公司空间点位,将经纬度坐标转换成webgl空间坐标,通过楼层渲染点高度,公司类型设置不同材质颜色,渲染在场景中;
1. **进入 1024 云 IDE 应用挑战赛页面:[https://gitcode.net/cloud-ide/1024](https://gitcode.net/cloud-ide/1024)****Fork 该项目,即参与比赛**
6、增加场景旋转、过滤、鼠标移入点位显示属性操作,至此完成展示
2. **参赛后,将 Fork 的项目在云 IDE 中打开,并在云IDE中完成您自己的作品,提交代码。**
## 四、其他说明
在云IDE提交代码,有2种操作方法,任选其一即可:
**方法一:**
> (1) 访问 [https://ide.csdn.net](https://ide.csdn.net) ,新建工作空间,仓库地址填写 克隆 的 Git 地址(操作方法:点击”克隆“,复制 ”通过SSH Clone项目“ 的链接)
>
> <img src="https://gitcode.net/cloud-ide/1024/-/raw/main/src/gitcode-ssh.png" width="400px" style="border: 6px solid #fff;border-radius: 2px;">
> <img src="https://file.iviewui.com/cloud-ide/cloud-ide-img-1.png" width="400px" style="border: 6px solid #fff;border-radius: 2px;">
>
> (2)填写 SSH 的 Git 地址,并将云 IDE 提供的 SSH Key (操作方法:[https://dev-ide.csdn.net/doc#git_commit](https://dev-ide.csdn.net/doc#git_commit) )绑定到自己的 GitCode SSH 密钥中 [https://gitcode.net/-/profile/keys](https://gitcode.net/-/profile/keys)
**方法二:**
> (1) 直接在 Fork 的 GitCode 域名前加 ide 进入,例如 https://gitcode.net/xxxxx/1024 修改为 https://idegitcode.net/xxxxx/1024
> <br/>
> <img src="https://file.iviewui.com/cloud-ide/cloud-ide-img-2.png" width="400px" style="border: 6px solid #fff;border-radius: 2px;display:block">
>
> (2) 提交代码时,云 IDE 会让用户输入 CSDN 的账号和密码(即手机号+密码)
**3. 提交代码后,即可等待CSDN官方进行评选。** 2022.11.07 - 2022.11.14为作品评选时间,2022.11.15公布评选结果。
<br/>Tips:如果您想要分享下 云IDE 的使用感受,欢迎投稿[ 云IDE测评征文 ](https://activity.csdn.net/creatActivity?id=10239)活动,还能获得额外奖品哦~
## 七、评选规则
由评选委员会根据获得的 Star、作品复杂程度、易用性、新颖性等多角度评选。
1. Star 占比 20%
a. 获得 Star 的数量,1 颗即为 1 分,最高 20 分封顶
2. 作品复杂程度占比 40%
a. 作品完整度
b. 代码简洁,代码可读性强
c. 架构清晰
d. 作品难度,如使用了一些高级 API,比如 WebGL、Canvas
3. 易用性占比 30%
a. 作品配套的说明,如果项目介绍、如果使用等
b. 交互体验,产品具有较好的交互体验,有足够的易用性
c. 可用,代码能在 CSDN 的云 IDE 上完整运行
4. 新颖性占比 10%
a. 新颖性,使用了较为新颖的技术实现
## 八、领奖规则
1. 获奖名单会在该评选结束后在该页面公布。
2. 工作人员将在活动结束后的7个工作日内,通过CSDN私信联系中奖用户,进行发奖,请您注意消息通知。
## 九、赛事交流
1、如果您想要分享下 云IDE 的使用感受,欢迎投稿[ 云IDE测评征文 ](https://activity.csdn.net/creatActivity?id=10239)活动,还能获得额外奖品哦~
2、参赛选手官方交流群(仅作为选手之间讨论和交流)。扫码进入选手沟通群。大赛重要节点通知会在群内第一时间告知,请所有报名选手务必加群
<img src="/uploads/714eb605d01cf5233235dbe6ecb0f0b5/b435ccc7d422528ad8212ca53d687687.jpg" width="200px" style="border: 6px solid #fff;border-radius: 2px;">
## 十、其他说明
若出现以下情况,将视为违规,大赛组委会有权取消用户参赛资格及获得的奖项。
1. 参赛报名信息虚假,或不符合大赛报名要求的参赛者。
2. 参赛作品涉嫌抄袭,侵犯他人知识产权等行为。
3. 参赛期间或参赛作品发现或被举报认定存在的其他违法、违规行为。
法律允许范围内的,最终解释权归 CSDN 所有。
<div style="height:200px"></div>
欢迎交流,欢迎star,有问题提交Issue。
<template>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</template>
<style>
html,body,#__nuxt,.app {
width: 100%;
height: 100%;
margin: 0;
}
</style>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="src/style.css">
</head>
<body>
<div class="app">
<img src="src/logo.svg" width="100px">
<h1>欢迎使用 Cloud IDE</h1>
官网:<a href="https://ide.csdn.net" target="_blank">https://ide.csdn.net</a>
</div>
</body>
</html>
\ No newline at end of file
<template>
<div class="layout">
<div class="header">设计公司点位分布</div>
<slot />
</div>
</template>
<style scoped>
.header {
position: fixed;
z-index: 999;
left: 0;
right: 0;
background: rgba(255, 255, 255, 0.1);
color: #fff;
text-align: center;
/* font-weight: bold; */
font-size: 18px;
padding: 8px;
}
</style>
// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
ssr: false,
devServer: {
port: 3000,
host: '0.0.0.0',
}
})
{
"name": "cloud-ide-1024-game",
"version": "1.0.0",
"description": "",
"main": "index.js",
"private": true,
"scripts": {
"dev": "live-server"
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"devDependencies": {
"nuxt": "3.0.0-rc.12"
},
"author": "Aresn",
"license": "MIT",
"dependencies": {
"live-server": "^1.2.2"
"camera-controls": "^1.37.3",
"three": "^0.146.0"
}
}
<template>
<div class="index">
<div id="map"></div>
<div class="panel">
<div v-if="activeMesh" class="attrs" :style="`color: ${colorMap[activeMesh.props.type] || colorMap['default']}`">
<div>{{ activeMesh.props.name}}</div>
<div>{{ activeMesh.props.address}}</div>
</div>
<div class="legends">
<span class="legend-item" v-for="key in Object.keys(colorMap)" :key="key" :style="`color: ${disabledTypeMap[key] ? '#ffffff' : colorMap[key] }`" @click="handleFilter(key)">
{{ key.toLocaleUpperCase() }}
</span>
</div>
</div>
</div>
</template>
<script setup>
import { onMounted } from 'vue';
import * as THREE from 'three';
import CameraControls from 'camera-controls';
import { LonLat2WebMercator, WebMercator2Tileimage, LonLat2WebGL } from '@/utils/convertCoordinate';
CameraControls.install( { THREE: THREE } );
const clock = new THREE.Clock();
onMounted(async () => {
initApp();
});
let scene, renderer, camera, cameraControls;
const initApp = async () => {
const el = document.getElementById('map');
const width = window.innerWidth;
const height = window.innerHeight;
renderer = new THREE.WebGLRenderer({
antialias: true,
});
renderer.setSize(width, height);
renderer.setClearColor(0x000000, 1);
el.appendChild(renderer.domElement);
scene = new THREE.Scene();
const fov = 45;
const aspect = width / height;
camera = new THREE.PerspectiveCamera(fov, aspect, 1, 1000);
camera.position.set( 0,90, 400 );
cameraControls = new CameraControls( camera, renderer.domElement );
initListener(el);
updateRender();
loadMap();
await loadData();
pickMesh();
renderer.render(scene, camera);
};
const updateRender = () => {
const delta = clock.getDelta();
const updated = cameraControls.update(delta);
requestAnimationFrame(updateRender);
if (updated) {
}
renderer.render(scene, camera);
}
const initListener = (el) => {
el.addEventListener('mousedown', () => {
el.style.cursor = 'pointer';
});
el.addEventListener('mouseup', () => {
el.style.cursor = 'default';
});
}
const mapLevel = 14, tileSize = 50, centerLng = 121.540794, centerLat = 25.045744;
const loadMap = () => {
const webMercator = LonLat2WebMercator(centerLng, centerLat);
const tilePos = WebMercator2Tileimage(webMercator.x, webMercator.y, mapLevel);
const centerX = tilePos.tileinfo.x;
const centerY = tilePos.tileinfo.y;
const radius = 5;
for (let i = centerX - radius; i <= centerX + radius; i++) {
for (let j = centerY - radius; j <= centerY + radius; j++) {
loadImageTile(i, j, addTileToSceneHelper(i - centerX, j - centerY));
}
}
};
// 加载一个切图
const loadImageTile = (xno, yno, callback) => {
const serverURL = 'https://tiles-1259720203.cos.ap-shanghai.myqcloud.com/tp-basemap/';
const url = serverURL + mapLevel + '/' + xno + '/' + yno + '.png';
const loader = new THREE.TextureLoader();
loader.crossOrigin = 'true';
loader.load(url, (texture) => {
const geometry = new THREE.PlaneGeometry(tileSize, tileSize, 1);
const material = new THREE.MeshBasicMaterial({
map: texture,
transparent: true,
side: THREE.DoubleSide
});
const mesh = new THREE.Mesh(geometry, material);
callback(mesh);
});
}
// 将加载的切图放到scene
const addTileToScene = (mesh, x, y) => {
mesh.position.x = x;
mesh.position.z = - y;
mesh.rotation.x = - Math.PI / 2;
scene.add(mesh);
}
// 辅助函数,用于计算tile应该放在何处
const addTileToSceneHelper = (dx, dy) => {
const x = tileSize * dx ;
const y = - tileSize * (dy + 1) ;
return (mesh) => {
addTileToScene(mesh, x, y);
};
}
const colorMap = {
default: '#15dcee',
ad: '#8f19e3',
architect: '#198cff',
graphic: '#ff31eb',
interior: '#ff3b48',
product: '#ffbe19',
};
const loadData = async () => {
const firmsData = await $fetch('/creative-firms.json');
for (const feature of firmsData.features) {
const properties = feature.properties;
const currentWebGLPos = LonLat2WebGL(properties.lng, properties.lat, mapLevel, centerLng, centerLat, tileSize);
const lineMaterial = new THREE.MeshBasicMaterial({
color: colorMap[properties.type] || colorMap['default'],
});
const lineMesh = await loadLine(lineMaterial, currentWebGLPos.x, currentWebGLPos.y, 2 * properties.FL);
lineMesh.props = properties;
const sphereMaterial = new THREE.MeshBasicMaterial({
color: colorMap[properties.type] || colorMap['default'],
});
const sphereMesh = await loadSphere(sphereMaterial, currentWebGLPos.x, currentWebGLPos.y, 2 * properties.FL);
sphereMesh.props = properties;
sphereMesh.isPick = true;
};
}
// 加载线
const loadLine = (material, x, y, z) => {
const geometry = new THREE.CylinderGeometry(0.1, 0.1 , z);
const mesh = new THREE.Mesh(geometry, material);
mesh.position.x = x;
mesh.position.z = y;
mesh.position.y = z / 2;
scene.add(mesh);
return mesh;
}
// 加载球
const loadSphere = (material, x, y, z) => {
const geometry = new THREE.SphereGeometry(0.6);
const mesh = new THREE.Mesh(geometry, material);
mesh.position.x = x;
mesh.position.z = y;
mesh.position.y = z;
scene.add(mesh);
return mesh;
}
// 鼠标拾取
let activeMesh = ref();
const pickMesh = () => {
const raycaster = new THREE.Raycaster();
const mouse = new THREE.Vector2();
renderer.domElement.addEventListener('mousemove', (event) => {
if (activeMesh.value) {
activeMesh.value.material.color.set(colorMap[activeMesh.value.props.type] || colorMap['default']);
activeMesh.value.material.needsUpdate= true;
activeMesh.value = null;
}
mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
mouse.y = -(event.clientY / window.innerHeight) * 2 + 1;
raycaster.setFromCamera(mouse, camera);
const intersects = raycaster.intersectObjects(scene.children, true);
for(let i = 0; i < intersects.length; i++) {
const obj = intersects[i].object;
if(obj.isPick && obj.visible) {
obj.material.color.set('#ffffff');
obj.material.needsUpdate= true;
activeMesh.value = obj;
break;
}
}
})
}
// 类型过滤
const disabledTypeMap = ref({});
const handleFilter = (type) => {
disabledTypeMap.value[type] = !disabledTypeMap.value[type];
scene.children.forEach(item => {
if(item.props && item.props.type === type) {
item.visible = !item.visible;
}
})
}
</script>
<style>
.index {
position: relative;
}
#map {
width: 100%;
height: 100%;
}
.panel {
position: absolute;
bottom: 16px;
width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.attrs {
background: rgba(255, 255, 255, 0.2);
color: #fff;
text-align: center;
font-weight: bold;
padding: 8px;
}
.legends {
display: flex;
justify-content: center;
gap: 8px;
font-weight: bold;
font-size: 20px;
}
.legend-item {
cursor: pointer;
}
</style>
......@@ -2,7 +2,7 @@
autoOpen: true # 打开工作空间时是否自动开启所有应用的预览
apps:
- port: 3000 # 应用的端口
run: npm i && npm run dev # 应用的启动命令
run: yarn && yarn dev # 应用的启动命令
command: # 使用此命令启动服务,且不执行run
root: ./ # 应用的启动目录
name: 1024云IDE挑战赛项目 # 应用名称
......
因为 它太大了无法显示 image diff 。你可以改为 查看blob
此差异已折叠。
<?xml version="1.0" encoding="UTF-8"?>
<svg width="37px" height="28px" viewBox="0 0 37 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>开发云logo备份@40x</title>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="开发云logo备份@40x" transform="translate(2.000000, 2.000000)" stroke="#1890FF">
<path d="M22.8925411,9.29032948 L22.8925411,6.7248501 C22.8925411,3.01081795 19.8817231,-1.77635684e-15 16.167691,-1.77635684e-15 C12.4536588,-1.77635684e-15 9.44284085,3.01081795 9.44284085,6.7248501 L9.44284085,7.87271787 L9.44284085,7.87271787 L7.66157921,7.87271787 C3.43020585,7.87271787 0,11.3029237 0,15.5342971 C0,19.7656704 3.43020585,23.1958763 7.66157921,23.1958763 L23.6762383,23.1958763 L23.6762383,23.1958763" id="路径-28" stroke-width="4" stroke-linecap="round"></path>
<path d="M33.2652638,20.4086185 C33.0827033,20.2352897 32.8345087,20.1392132 32.5943359,20.1433691 C32.3478429,20.1482585 32.1246865,20.2509357 31.9659488,20.4335544 C30.544846,22.0690553 28.0684903,22.2455623 27.0696344,22.2455623 C25.2163178,22.2455623 23.798132,21.7732472 22.8544575,20.8423074 C21.9579423,19.9578168 21.4880498,18.6552834 21.4571774,16.9706441 C21.3852228,13.0654885 23.5839699,9.02587465 27.388082,9.02587465 C29.2051781,9.02587465 30.6155851,10.3220519 31.1374989,10.8794423 C31.3188438,11.0728177 31.5699556,11.1842958 31.8273877,11.1850292 C32.0860352,11.1921188 32.3245063,11.0764847 32.4864041,10.8845762 L32.6344458,10.7085581 C32.938308,10.3486991 33.0754106,9.88371809 33.0199862,9.39991297 C32.9645617,8.91195187 32.7209857,8.46579505 32.3347161,8.14431767 C31.4027098,7.36812705 29.8184937,6.44329897 27.5648083,6.44329897 C25.2231243,6.44329897 22.9103681,7.52654327 21.2191925,9.41555902 C19.4426923,11.4001623 18.4936698,14.1025281 18.5476357,17.0241829 C18.5906626,19.3679119 19.3554231,21.3390694 20.7597528,22.7249669 C22.2681249,24.2132972 24.4785403,25 27.152528,25 C30.2896017,25 32.2338338,24.066371 33.3124232,23.2830908 C33.7300514,22.9799486 33.9801908,22.5020108 33.9989087,21.9720009 C34.0173836,21.4397908 33.8005475,20.9180929 33.404068,20.5408765 L33.2652638,20.4086185 Z" id="Fill-9457" fill="#1890FF" fill-rule="nonzero"></path>
</g>
</g>
</svg>
\ No newline at end of file
.app{
text-align: center;
}
.app img{
margin-top: 32px;
}
\ No newline at end of file
{
// https://v3.nuxtjs.org/concepts/typescript
"extends": "./.nuxt/tsconfig.json"
}
// 经纬度转Web墨卡托
const LonLat2WebMercator = (lng, lat) => {
const resultX = (lng / 180.0) * 20037508.3427892;
let resultY;
if (lat > 85.05112) {
lat = 85.05112;
}
if (lat < -85.05112) {
lat = -85.05112;
}
resultY = (Math.PI / 180.0) * lat;
const tmp = Math.PI / 4.0 + resultY / 2.0;
resultY = 20037508.3427892 * Math.log(Math.tan(tmp)) / Math.PI;
const result = {
x: resultX,
y: resultY,
};
return result;
};
// Web墨卡托转像素坐标
const WebMercator2Tileimage = (x, y, l) => {
const r = 20037508.3427892;
y = r - y;
x = r + x;
const size = Math.pow(2, l) * 256;
const imgx = x * size / (r * 2);
const imgy = y * size / (r * 2);
const col = Math.floor(imgx / 256);
const row = Math.floor(imgy / 256);
const imgdx = imgx % 256;
const imgdy = imgy % 256;
const positionObj = {x: imgx, y: imgy};
const tileinfoObj = {x: col, y: row, level: l};
const offsetObj = {x: imgdx, y: imgdy};
const result = {position: positionObj, tileinfo: tileinfoObj, offset: offsetObj};
return result;
};
// 经纬度转WebGL坐标
const LonLat2WebGL = (lng, lat, level, centerLng, centerLat, tileSize) => {
const webMercator = LonLat2WebMercator(lng, lat);
const tilePos = WebMercator2Tileimage(webMercator.x, webMercator.y, level).position;
const centerWM = LonLat2WebMercator(centerLng, centerLat);
const centerTP = WebMercator2Tileimage(centerWM.x, centerWM.y, level);
const resultX = (tilePos.x - centerTP.position.x + (centerTP.offset.x - 256 / 2)) * tileSize / 256;
const resultY = (tilePos.y - centerTP.position.y + (-centerTP.offset.y + 256 / 2)) * tileSize / 256;
const result = {
x: resultX,
y: resultY,
};
return result;
};
export {
LonLat2WebMercator,
WebMercator2Tileimage,
LonLat2WebGL,
};
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册