Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

解决一些报错问题 #26

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ dist-ssr
*.local
node_modules/

src/api/http/config

# Log files
npm-debug.log*
yarn-debug.log*
Expand Down
5 changes: 0 additions & 5 deletions .gitignore copy

This file was deleted.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>demo-web</title>
<title>web</title>
</head>
<body>
<div id="demo-app"></div>
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "demo-web",
"name": "web",
"version": "0.0.1",
"scripts": {
"serve": "vite",
Expand Down
10 changes: 5 additions & 5 deletions src/api/http/config.ts

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

老哥,key泄露了……

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export const CURRENT_CONFIG = {

// license
appId: 'Please enter the app id.', // You need to go to the development website to apply.
appKey: 'Please enter the app key.', // You need to go to the development website to apply.
appLicense: 'Please enter the app license.', // You need to go to the development website to apply.
appId: '146410', // You need to go to the development website to apply.
appKey: 'd422e7fa14c4e98ea2100736bea195e', // You need to go to the development website to apply.
appLicense: 'vNVYmp43PMf/a4Yb4nJ947S70mT8bZUnNILRZSLFLjLKaOUX58BgS3DKwgQQSsbDyOvTOSSAjrnoD5Xg/2eUXro2MxoxW3Yx55pVUDZ58I2FgHH3870I6fWw3BqWcF0W14lglfWFl5aMuvCsv84G3EnvjRfSGjklHrDiCNSf2Bo=', // You need to go to the development website to apply.

// http
baseURL: 'Please enter the backend access address prefix.', // This url must end with "/". Example: 'http://192.168.1.1:6789/'
baseURL: 'http://192.168.2.239:6789/', // This url must end with "/". Example: 'http://192.168.1.1:6789/'
websocketURL: 'Please enter the WebSocket access address.', // Example: 'ws://192.168.1.1:6789/api/v1/ws'

// livestreaming
Expand All @@ -31,6 +31,6 @@ export const CURRENT_CONFIG = {

// map
// You can apply on the AMap website.
amapKey: 'Please enter the amap key.',
amapKey: '6e948d848f069e3fbcae5a7634ae3f8f',

}
851 changes: 482 additions & 369 deletions src/components/GMap.vue

Large diffs are not rendered by default.

58 changes: 23 additions & 35 deletions src/components/LayersTree.vue
Original file line number Diff line number Diff line change
@@ -1,27 +1,13 @@
<template>
<span>
<a-tree
draggable
:defaultExpandAll="true"
class="device-map-layers"
@drop="onDrop"
v-bind="$attrs"
>
<a-tree-node
:title="layer.name"
:id="layer.id"
v-for="layer in getTreeData"
:key="layer.id"
>
<a-tree draggable :defaultExpandAll="true" class="device-map-layers" @drop="onDrop" v-bind="$attrs">
<a-tree-node :title="layer.name" :id="layer.id" v-for="layer in getTreeData" :key="layer.id">
<!-- <template #title>
{{layer.name}}
</template> -->
<template v-if="layer.elements">
<a-tree-node
v-for="resource in layer.elements"
:id="getLayerTreeKey('resource', resource.id)"
:key="getLayerTreeKey('resource', resource.id)"
>
<a-tree-node v-for="resource in layer.elements" :id="getLayerTreeKey('resource', resource.id)"
:key="getLayerTreeKey('resource', resource.id)">
<template #title>
{{ resource.name }}
</template>
Expand Down Expand Up @@ -55,14 +41,14 @@ const shareId = computed(() => {
const defaultId = computed(() => {
return store.state.layerBaseInfo.default
})
async function onDrop ({ node, dragNode, dropPosition, dropToGap }: DropEvent) {
async function onDrop({ node, dragNode, dropPosition, dropToGap }: DropEvent) {
let _treeData = props.layerData || []
let dragKey = dragNode.eventKey
dragKey = dragKey.replaceAll('resource__', '')
const dropPos = node.pos.split('-')
let dropKey =
node.eventKey.includes(shareId.value) ||
node.eventKey.includes(defaultId.value)
node.eventKey.includes(defaultId.value)
? node.eventKey
: node.$parent.eventKey
if (!dragKey || !dropKey) return
Expand Down Expand Up @@ -99,11 +85,11 @@ async function onDrop ({ node, dragNode, dropPosition, dropToGap }: DropEvent) {
</script>
<style lang="scss">
$antPrefix: 'ant';

.device-map-layers.#{$antPrefix}-tree {
color: #fff;

.#{$antPrefix}-tree-checkbox:not(.#{$antPrefix}-tree-checkbox-checked)
.#{$antPrefix}-tree-checkbox-inner {
.#{$antPrefix}-tree-checkbox:not(.#{$antPrefix}-tree-checkbox-checked) .#{$antPrefix}-tree-checkbox-inner {
background-color: unset;
}

Expand All @@ -112,7 +98,7 @@ $antPrefix: 'ant';
}

// 第一个层级的 li,有左边距 16px
> li {
>li {
padding-left: 16px;
padding-right: 16px;
}
Expand All @@ -128,14 +114,15 @@ $antPrefix: 'ant';
padding-top: 4px;
}

&.#{$antPrefix}-tree-treenode-disabled
> .#{$antPrefix}-tree-node-content-wrapper {
&.#{$antPrefix}-tree-treenode-disabled>.#{$antPrefix}-tree-node-content-wrapper {
height: 20px;

span {
color: #fff;
}
}
> ul {

>ul {
width: 100%;
}

Expand All @@ -149,9 +136,9 @@ $antPrefix: 'ant';
.#{$antPrefix}-tree-checkbox {
z-index: 1;
}

.#{$antPrefix}-tree-checkbox:hover::after,
.#{$antPrefix}-tree-checkbox-wrapper:hover
.#{$antPrefix}-tree-checkbox::after {
.#{$antPrefix}-tree-checkbox-wrapper:hover .#{$antPrefix}-tree-checkbox::after {
visibility: collapse;
}

Expand All @@ -177,7 +164,7 @@ $antPrefix: 'ant';
background-color: transparent;
}

> span {
>span {
&::before {
// position: absolute;
// right: 0;
Expand All @@ -188,7 +175,7 @@ $antPrefix: 'ant';
}

// 进度条组件需要相对最外层定位,进度条组件的position不能设置为relative
> *:not(.progress-wrapper) {
>*:not(.progress-wrapper) {
position: relative;
z-index: 1;
}
Expand All @@ -197,20 +184,21 @@ $antPrefix: 'ant';
&.#{$antPrefix}-tree-node-selected {
background-color: transparent;
color: #2d8cf0;
> span {

>span {
&::before {
background-color: #4f4f4f;
}
}
}
}
}
span.#{$antPrefix}-tree-switcher.#{$antPrefix}-tree-switcher_open
.#{$antPrefix}-tree-switcher-icon {

span.#{$antPrefix}-tree-switcher.#{$antPrefix}-tree-switcher_open .#{$antPrefix}-tree-switcher-icon {
transform: rotate(0deg) !important;
}
span.#{$antPrefix}-tree-switcher.#{$antPrefix}-tree-switcher_close
.#{$antPrefix}-tree-switcher-icon {

span.#{$antPrefix}-tree-switcher.#{$antPrefix}-tree-switcher_close .#{$antPrefix}-tree-switcher-icon {
transform: rotate(0deg) !important;
}
}
Expand Down
42 changes: 16 additions & 26 deletions src/components/g-map/DeviceSettingPopover.vue
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
<template>
<a-popover :visible="state.sVisible"
trigger="click"
v-bind="$attrs"
:overlay-class-name="overlayClassName"
placement="bottom"
@visibleChange=";"
v-on="$attrs">
<a-popover :visible="state.sVisible" trigger="click" v-bind="$attrs" :overlay-class-name="overlayClassName"
placement="bottom" @visibleChange=";" v-on="$attrs">
<template #content>
<div class="title-content">
</div>
<slot name="formContent" />
<div class="uranus-popconfirm-btns">
<a-button size="sm"
@click="onCancel">
{{ cancelText || '取消'}}
<a-button size="sm" @click="onCancel">
{{ cancelText || '取消' }}
</a-button>
<a-button size="sm"
:loading="loading"
type="primary"
class="confirm-btn"
@click="onConfirm">
<a-button size="sm" :loading="loading" type="primary" class="confirm-btn" @click="onConfirm">
{{ okText || '确定' }}
</a-button>
</div>
Expand All @@ -34,13 +24,13 @@
import { defineProps, defineEmits, reactive, watch, computed } from 'vue'

const props = defineProps<{
visible?: boolean,
loading?: Boolean,
disabled?: Boolean,
title?: String,
okText?: String,
cancelText?: String,
width?: Number,
visible?: boolean,
loading?: Boolean,
disabled?: Boolean,
title?: String,
okText?: String,
cancelText?: String,
width?: Number,
}>()

const emit = defineEmits(['cancel', 'confirm'])
Expand Down Expand Up @@ -84,21 +74,21 @@ function onCancel (e: Event) {
.device-setting-popconfirm {
min-width: 300px;

.uranus-popconfirm-btns{
.uranus-popconfirm-btns {
display: flex;
padding: 10px 0px;
justify-content: flex-end;

.confirm-btn{
.confirm-btn {
margin-left: 10px;
}
}

.form-content{
.form-content {
display: inline-flex;
align-items: center;

.form-label{
.form-label {
padding-right: 10px;
}
}
Expand Down
Loading