Skip to content

Commit

Permalink
同步最新代码
Browse files Browse the repository at this point in the history
  • Loading branch information
muyao1987 committed Mar 18, 2022
1 parent 9a51bd9 commit b8e0c4f
Show file tree
Hide file tree
Showing 20 changed files with 360 additions and 335 deletions.
6 changes: 3 additions & 3 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
> 1%
last 2 versions
not dead
> 1%
last 2 versions
not dead
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
# dependencies
/node_modules
public/lib/CesiumUnminified/
public/lib/mars3d/plugins/widget/
src/common/mars3d-sdk/dist/plugins/
mars3d-*src.*
!mars3d-supermap-src.js*
!mars3d-tdt-src.js*


# profiling files
chrome-profiler-events*.json
Expand Down
25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,38 @@
"version": "3.2.0",
"description": "在Vue3技术栈下的Mars3D平台 基础项目",
"scripts": {
"serve": "vite",
"dev": "vite",
"serve": "npm run clean-cache && vite",
"clean-cache": "rimraf node_modules/.cache/ && rimraf node_modules/.vite",
"clean-lib": "rimraf node_modules",
"preview": "vite preview",
"build": "vite build",
"build-tsc": "vue-tsc --noEmit && vite build",
"lint": "eslint ./src/**/*.{js,jsx,vue,ts,tsx} --fix"
"build": "npm run lint && vite build",
"lint": "eslint ./src/**/*.{js,jsx,vue,ts,tsx} --fix && vue-tsc --noEmit"
},
"dependencies": {
"@iconify/vue": "^3.1.3",
"@turf/turf": "^6.5.0",
"ant-design-vue": "3.0.0-beta.9",
"ant-design-vue": "3.0.0-beta.13",
"axios": "^0.25.0",
"core-js": "^3.20.3",
"echarts": "^5.2.2",
"echarts-gl": "^2.0.8",
"kml-geojson": "^1.2.0",
"localforage": "^1.10.0",
"mapv": "^2.0.62",
"mars3d": "^3.2.4",
"mars3d-cesium": "^1.90.2",
"mars3d-echarts": "^3.2.2",
"mars3d-heatmap": "^3.2.2",
"mars3d-mapv": "^3.2.2",
"mars3d": "^3.3.0",
"mars3d-cesium": "^1.91.0",
"mars3d-echarts": "^3.3.0",
"mars3d-heatmap": "^3.3.0",
"mars3d-mapv": "^3.3.0",
"nprogress": "^0.2.0",
"uuid": "^8.3.2",
"vue": "^3.2.30",
"vue": "^3.2.31",
"vue-color-kit": "^1.0.5",
"vuex": "^4.0.2"
},
"devDependencies": {
"@types/node": "^17.0.10",
"@types/node": "^17.0.21",
"@vitejs/plugin-vue": "^2.1.0",
"@vue/eslint-config-typescript": "^10.0.0",
"consola": "^2.15.3",
Expand All @@ -50,7 +49,7 @@
"standard": "^16.0.4",
"typescript": "^4.5.5",
"unplugin-vue-components": "^0.17.13",
"vite": "^2.8.0",
"vite": "^2.8.6",
"vite-plugin-eslint": "^1.3.0",
"vite-plugin-mars3d": "^1.1.1",
"vite-plugin-style-import": "^2.0.0",
Expand Down
38 changes: 19 additions & 19 deletions src/common/store/test.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/**
* store 状态管理
* @copyright 火星科技 mars3d.cn
* @author 火星吴彦祖 2022-02-19
*/
import { Store, createStore } from "vuex"
import { InjectionKey } from "vue"

export interface Test {
count?: number
}

export const key: InjectionKey<Store<Test>> = Symbol("test")

export const store = createStore<Test>({
state: {
count: 0
}
})
/**
* store 状态管理
* @copyright 火星科技 mars3d.cn
* @author 火星吴彦祖 2022-02-19
*/
import { Store, createStore } from "vuex"
import { InjectionKey } from "vue"

export interface Test {
count?: number
}

export const key: InjectionKey<Store<Test>> = Symbol("test")

export const store = createStore<Test>({
state: {
count: 0
}
})
6 changes: 3 additions & 3 deletions src/common/uses/use-lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
* @copyright 火星科技 mars3d.cn
* @author 火星吴彦祖 2022-02-19
*/
import { inject, onMounted, onUnmounted } from "vue"
import { inject, onBeforeMount, onBeforeUnmount } from "vue"

export default function useLifecycle(mapWork: any): void {
const getMapInstance = inject<any>("getMapInstance")
onMounted(() => {
onBeforeMount(() => {
if (mapWork.onMounted) {
const map = getMapInstance()
mapWork.onMounted(map)
}
})
onUnmounted(() => {
onBeforeUnmount(() => {
if (mapWork.onUnmounted) {
mapWork.onUnmounted()
}
Expand Down
9 changes: 8 additions & 1 deletion src/components/mars-ui/base.less
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
@mars-basecolor: #ffffffd9; // 基础字体颜色
@mars-basecolor-reverse: #000; // 基础字体颜色-反色
@primary-color: #4db3ff; // 主要颜色
@mars-ordinary-color: #9fd9fd; // 普通颜色
@mars-ordinary-color: rgba(32, 160, 255, 0.2); // 普通颜色
@mars-background-active: #000000d9; // 全局激活背景色
@font-size-base: 12px; // 主要字体大小
@border-color-ordinary: grey; // 基础边框颜色
@border-color-base: #ececec; // 基础边框颜色
@tree-border-color: #ccc; //树控件复选框边框颜色
@mars-disable-color: #ccc; // 禁用字体颜色
@form-input-background: rgba(63, 72, 84, 0.7); // input 背景色
@input-background-active: rgba(37, 49, 63, 0.788); // input 激活背景色
Expand Down Expand Up @@ -78,6 +79,7 @@
.mars-ant-card {
background: none;
border: 1px solid @mars-basecolor;
color: @mars-basecolor;
.ant-card-head {
border-color: @mars-basecolor;
min-height: auto;
Expand Down Expand Up @@ -164,6 +166,7 @@
.ant-table-container,
.ant-table-cell {
border-color: #cde1de !important;
background: transparent !important;
}
.ant-table-container {
border: 1px solid #cde1de !important;
Expand All @@ -175,6 +178,10 @@
background: rgba(32, 42, 68, 0.3) !important;
}

.ant-table-row:nth-last-child(1) .ant-table-cell {
border-bottom: none;
}

// 分页
.ant-pagination {
* {
Expand Down
82 changes: 42 additions & 40 deletions src/components/mars-ui/mars-input/index.vue
Original file line number Diff line number Diff line change
@@ -1,40 +1,42 @@
<template>
<a-input class="mars-input" v-bind="attrs">
<template v-for="(comp, name) in slots" :key="name" v-slot:[name]>
<component :is="comp" />
</template>
</a-input>
</template>
<script lang="ts">
import { useAttrs, useSlots, defineComponent } from "vue"
export default defineComponent({
name: "mars-input",
inheritAttrs: false,
setup() {
const attrs = useAttrs()
const slots = useSlots()
return {
attrs,
slots
}
}
})
</script>
<style lang="less" scoped>
.mars-input {
color: @mars-basecolor;
background-color: @form-input-background !important;
border-color: @border-color-ordinary;
:deep(.ant-input) {
background-color: @form-input-background !important;
border-color: @border-color-ordinary;
color: @mars-basecolor;
}
:deep(.ant-input-suffix .anticon) {
color: @mars-basecolor;
}
}
.mars-input[disabled] {
color: @mars-disable-color;
}
</style>
<template>
<a-input class="mars-input" v-bind="attrs">
<template v-for="(comp, name) in slots" :key="name" v-slot:[name]>
<component :is="comp" />
</template>
</a-input>
</template>
<script lang="ts">
import { useAttrs, useSlots, defineComponent } from "vue"
export default defineComponent({
name: "mars-input",
inheritAttrs: false,
setup() {
const attrs = useAttrs()
const slots = useSlots()
return {
attrs,
slots
}
}
})
</script>
<style lang="less" scoped>
.mars-input {
color: @mars-basecolor;
background-color: @form-input-background !important;
border-color: @border-color-ordinary;
font-size: 12px !important;
:deep(.ant-input) {
background-color: @form-input-background !important;
border-color: @border-color-ordinary;
color: @mars-basecolor;
}
:deep(.ant-input-suffix .anticon) {
color: @mars-basecolor;
}
}
.mars-input[disabled] {
color: @mars-disable-color;
}
</style>
10 changes: 5 additions & 5 deletions src/components/mars-ui/mars-tree/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ const MarsTree = defineComponent({
name: "mars-tree",
inheritAttrs: false,
setup(props, context) {
const icon = (isLeaf: boolean, expanded: boolean) => {
if (isLeaf) {
const icon = (isLeaf: boolean, expanded: boolean, group: boolean) => {
if (isLeaf && !group) {
return [h(Icon, { icon: "ph:browsers-fill", width: "14", color: "#79C1F8" })]
} else if (expanded) {
return [h(Icon, { icon: "ph:folders-fill", width: "14", color: "#db9829" })]
} else if (!expanded) {
return [h(Icon, { icon: "ph:folder-fill", width: "14", color: "#db9829" })]
} else if (expanded) {
return [h(Icon, { icon: "ph:folders-fill", width: "14", color: "#db9829" })]
}
}
return () =>
Expand All @@ -31,7 +31,7 @@ const MarsTree = defineComponent({
...props
},
{
icon: ({ isLeaf, expanded }: any) => h("span", null, icon(isLeaf, expanded)),
icon: ({ isLeaf, expanded, data }: any) => h("span", null, icon(isLeaf, expanded, data.group)),
...context.slots
}
)
Expand Down
Loading

0 comments on commit b8e0c4f

Please sign in to comment.