This commit is contained in:
zk
2023-11-24 13:53:11 +08:00
parent 2648d8f694
commit 7299e96d20
2 changed files with 77 additions and 47 deletions
+20
View File
@@ -0,0 +1,20 @@
module.exports = {
printWidth: 150,
tabWidth: 4,
useTabs: false,
semi: true, //语句末尾使用分号
vueIndentScriptAndStyle: true,
singleQuote: true, // 使用单引号
quoteProps: 'as-needed',
bracketSpacing: true,
trailingComma: 'es5',
jsxBracketSameLine: false,
jsxSingleQuote: false,
arrowParens: 'always',
insertPragma: false,
requirePragma: false,
proseWrap: 'never',
htmlWhitespaceSensitivity: 'strict',
endOfLine: 'auto',
rangeStart: 0,
};
+57 -47
View File
@@ -9,13 +9,13 @@
<div v-show="currentIndex==list.length-1" class="route-navigation"> <div v-show="currentIndex==list.length-1" class="route-navigation">
<a-form <a-form
:model="formState" :model="formState"
layout="inline" layout="horizontal"
> >
<a-form-item class="form-item-self" name="user" label="起点"> <a-form-item class="form-item-self" label="起点" name="user">
<a-input v-model:value="formState.user"> <a-input v-model:value="formState.user">
</a-input> </a-input>
</a-form-item> </a-form-item>
<a-form-item class="form-item-self" name="user" label="终点"> <a-form-item class="form-item-self" label="终点" name="user">
<a-input v-model:value="formState.user"> <a-input v-model:value="formState.user">
</a-input> </a-input>
</a-form-item> </a-form-item>
@@ -34,23 +34,23 @@
<div class="line-body"> <div class="line-body">
<div class="line"></div> <div class="line"></div>
<div class="line-desc"> <div class="line-desc">
<!-- <p>向东行驶124米左转</p>--> <p>向东行驶124米左转</p>
<!-- <p>向西北行驶92米左转</p>--> <p>向西北行驶92米左转</p>
<!-- <p>向西南行驶45米右转</p>--> <p>向西南行驶45米右转</p>
<!-- <p>向西北行驶50米右转</p>--> <p>向西北行驶50米右转</p>
<!-- <p>沿燕庆街向东北行驶157米左转</p>--> <p>沿燕庆街向东北行驶157米左转</p>
<!-- <p>向西北行驶47米左转</p>--> <p>向西北行驶47米左转</p>
<!-- <p>向西行驶97米右转进入主路</p>--> <p>向西行驶97米右转进入主路</p>
<!-- <p>沿新华东路向西行驶1.1千米右转进入主路</p>--> <p>沿新华东路向西行驶1.1千米右转进入主路</p>
<!-- <p>沿友爱街向北行驶5.9千米右转</p>--> <p>沿友爱街向北行驶5.9千米右转</p>
<!-- <p>沿417乡道向东北行驶49米右转</p>--> <p>沿417乡道向东北行驶49米右转</p>
<!-- <p>沿417乡道向东行驶1.1千米左转</p>--> <p>沿417乡道向东行驶1.1千米左转</p>
<!-- <p>沿417乡道向北行驶8.3千米左转</p>--> <p>沿417乡道向北行驶8.3千米左转</p>
<!-- <p>向西北行驶47米左转</p>--> <p>向西北行驶47米左转</p>
<!-- <p>向西行驶97米右转进入主路</p>--> <p>向西行驶97米右转进入主路</p>
<!-- <p>沿新华东路向西行驶1.1千米右转进入主路</p>--> <p>沿新华东路向西行驶1.1千米右转进入主路</p>
<!-- <p>沿友爱街向北行驶5.9千米右转</p>--> <p>沿友爱街向北行驶5.9千米右转</p>
<!-- <p>沿417乡道向东北行驶49米右转</p>--> <p>沿417乡道向东北行驶49米右转</p>
<p>沿417乡道向东行驶1.1千米左转</p> <p>沿417乡道向东行驶1.1千米左转</p>
<p>沿417乡道向北行驶8.3千米左转</p> <p>沿417乡道向北行驶8.3千米左转</p>
<p>向西北行驶4.9千米到达目的地</p> <p>向西北行驶4.9千米到达目的地</p>
@@ -79,9 +79,10 @@
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import {ref,onMounted} from 'vue' import {onMounted, ref} from 'vue'
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import mapJson from '/@/components/chinaMap/json/new' import mapJson from '/@/components/chinaMap/json/new'
const formState = ref({ const formState = ref({
user: '', user: '',
password: '', password: '',
@@ -130,11 +131,13 @@ function changeTab(i) {
currentIndex.value = i currentIndex.value = i
list.value[i].isChecked = true list.value[i].isChecked = true
} }
onMounted(()=>{
onMounted(() => {
// initMap(); // initMap();
}) })
function initMap(){
const bgImg='https://img1.baidu.com/it/u=514808758,3636401112&fm=253&fmt=auto&app=120&f=JPEG?w=1139&h=751' function initMap() {
const bgImg = 'https://img1.baidu.com/it/u=514808758,3636401112&fm=253&fmt=auto&app=120&f=JPEG?w=1139&h=751'
let myChart = echarts.init(document.querySelector('.china-map-container')); let myChart = echarts.init(document.querySelector('.china-map-container'));
echarts.registerMap('china', mapJson); echarts.registerMap('china', mapJson);
let option = { let option = {
@@ -150,13 +153,13 @@ function initMap(){
}, },
geo: [ geo: [
{ {
map:'china', map: 'china',
zlevel:3, zlevel: 3,
aspectScale: .8, //长宽比 aspectScale: .8, //长宽比
zoom: 1.1, zoom: 1.1,
roam: false, roam: false,
top:'80', top: '80',
left:'center', left: 'center',
itemStyle: { itemStyle: {
areaColor: "#173a58", areaColor: "#173a58",
shadowColor: "#173a58", shadowColor: "#173a58",
@@ -167,13 +170,13 @@ function initMap(){
} }
}, },
{ {
map:'china', map: 'china',
zlevel:2, zlevel: 2,
aspectScale: .8, //长宽比 aspectScale: .8, //长宽比
zoom: 1.1, zoom: 1.1,
roam: false, roam: false,
top:'80', top: '80',
left:'center', left: 'center',
itemStyle: { itemStyle: {
areaColor: "#1e2c38", areaColor: "#1e2c38",
shadowColor: "#1e2c38", shadowColor: "#1e2c38",
@@ -189,13 +192,13 @@ function initMap(){
map: 'china',// 这个是上面注册时的名字哦,registerMap'这个名字保持一致' map: 'china',// 这个是上面注册时的名字哦,registerMap'这个名字保持一致'
name: '中国地图', name: '中国地图',
type: 'map', type: 'map',
zlevel:9, zlevel: 9,
zoom: 1.1, zoom: 1.1,
aspectScale: .8, //长宽比 aspectScale: .8, //长宽比
hoverAnimation: false, hoverAnimation: false,
silent: false, silent: false,
top:'80', top: '80',
left:'center', left: 'center',
label: { label: {
show: true, show: true,
padding: [0, 10], padding: [0, 10],
@@ -208,7 +211,7 @@ function initMap(){
fontWeight: "bold", fontWeight: "bold",
marginLeft: 5 marginLeft: 5
}, },
emphasis:{ emphasis: {
// areaColor: '#2074ed',//鼠标悬浮色 // areaColor: '#2074ed',//鼠标悬浮色
areaColor: { areaColor: {
type: 'pattern', type: 'pattern',
@@ -231,24 +234,24 @@ function initMap(){
}, },
{ {
type: "scatter", type: "scatter",
zlevel:100, zlevel: 100,
coordinateSystem: "geo", coordinateSystem: "geo",
//自定义图片的 位置(lng, lat) //自定义图片的 位置(lng, lat)
data: [{ name: '西安', value:['108.88','34.40'],id:'xian'}], data: [{name: '西安', value: ['108.88', '34.40'], id: 'xian'}],
//自定义图片的 大小 //自定义图片的 大小
symbolSize:[50, 50], symbolSize: [50, 50],
//自定义图片的 路径 //自定义图片的 路径
// symbol: 'image://http://192.168.1.7:9200/src/assets/img/tree.png', // 图片 URL // symbol: 'image://http://192.168.1.7:9200/src/assets/img/tree.png', // 图片 URL
symbol: 'image://https://img2.baidu.com/it/u=1568770988,2090980470&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=567', // 图片 URL symbol: 'image://https://img2.baidu.com/it/u=1568770988,2090980470&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=567', // 图片 URL
}, },
{ {
type: "scatter", type: "scatter",
zlevel:100, zlevel: 100,
coordinateSystem: "geo", coordinateSystem: "geo",
//自定义图片的 位置(lng, lat) //自定义图片的 位置(lng, lat)
data: [{ name: '太原', value:[112.55,37.98],id:'taiyuan'}], data: [{name: '太原', value: [112.55, 37.98], id: 'taiyuan'}],
//自定义图片的 大小 //自定义图片的 大小
symbolSize:[50, 50], symbolSize: [50, 50],
//自定义图片的 路径 //自定义图片的 路径
// symbol: 'image://http://192.168.1.7:9200/src/assets/img/tree.png', // 图片 URL // symbol: 'image://http://192.168.1.7:9200/src/assets/img/tree.png', // 图片 URL
symbol: 'image://https://img2.baidu.com/it/u=1568770988,2090980470&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=567', // 图片 URL symbol: 'image://https://img2.baidu.com/it/u=1568770988,2090980470&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=567', // 图片 URL
@@ -308,6 +311,7 @@ function initMap(){
border-radius: 6px; border-radius: 6px;
position: relative; position: relative;
transition: all 0.3s; transition: all 0.3s;
:deep(.form-item-self) { :deep(.form-item-self) {
label { label {
color: #29F1FA; color: #29F1FA;
@@ -385,6 +389,7 @@ function initMap(){
.end { .end {
display: flex; display: flex;
align-items: center; align-items: center;
&::before { &::before {
content: '终'; content: '终';
color: #fff; color: #fff;
@@ -419,16 +424,19 @@ function initMap(){
} }
} }
.china-map-container{
.china-map-container {
flex: 1; flex: 1;
//border: 1px solid red; //border: 1px solid red;
} }
.center-footer { .center-footer {
display: flex; display: flex;
justify-content: center; justify-content: center;
margin-bottom: 10px; margin-bottom: 10px;
gap: 20px; gap: 20px;
.count-item{
.count-item {
width: 340px; width: 340px;
height: 80px; height: 80px;
display: flex; display: flex;
@@ -438,12 +446,14 @@ function initMap(){
justify-content: center; justify-content: center;
background: #00071B; background: #00071B;
box-shadow: inset 0 0 40px 0 #1B7EF2; box-shadow: inset 0 0 40px 0 #1B7EF2;
border-radius: 4px ; border-radius: 4px;
.num{
.num {
font-size: 24px; font-size: 24px;
font-weight: 700; font-weight: 700;
} }
.text{
.text {
font-size: 16px; font-size: 16px;
font-weight: 400; font-weight: 400;
} }