解决冲突
This commit is contained in:
+5
-3
@@ -1,6 +1,7 @@
|
||||
// @ts-check
|
||||
const { defineConfig } = require('eslint-define-config');
|
||||
module.exports = defineConfig({
|
||||
import {defineConfig} from 'eslint-define-config'
|
||||
// const {defineConfig} = require('eslint-define-config');
|
||||
export default {
|
||||
root: true,
|
||||
env: {
|
||||
browser: true,
|
||||
@@ -25,6 +26,7 @@ module.exports = defineConfig({
|
||||
'plugin:jest/recommended',
|
||||
],
|
||||
rules: {
|
||||
'prettier/prettier': 'error',
|
||||
'vue/script-setup-uses-vars': 'error',
|
||||
'@typescript-eslint/ban-ts-ignore': 'off',
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
@@ -75,4 +77,4 @@ module.exports = defineConfig({
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
+11
-1
@@ -4,7 +4,17 @@
|
||||
<meta charset="UTF-8"/>
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title>Vite + Vue + TS</title>
|
||||
<title>应急就医服务中心</title>
|
||||
<!-- 全局配置 -->
|
||||
<script>
|
||||
window._CONFIG = {};
|
||||
window._AMapSecurityConfig = {
|
||||
securityJsCode: "1b3b86585c863d22db1e7f7636a9e495",
|
||||
}
|
||||
</script>
|
||||
<!-- <script type="text/javascript"-->
|
||||
<!-- src="https://webapi.amap.com/maps?v=2.0&key=4bbcb216b889f2d612cbed05ae6979c8&plugin=AMap.Driving"></script>-->
|
||||
<script type="text/javascript" src="./public/amap.js"></script>
|
||||
</head>
|
||||
<style>
|
||||
html, body, #app {
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
"path": "^0.12.7",
|
||||
"prettier": "^3.1.0",
|
||||
"vue": "^3.3.4",
|
||||
"@amap/amap-jsapi-loader": "^1.0.1",
|
||||
"vue-seamless-scroll": "^1.1.23",
|
||||
"vue3-seamless-scroll": "^2.0.1"
|
||||
},
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
module.exports = {
|
||||
export default {
|
||||
printWidth: 150,
|
||||
tabWidth: 4,
|
||||
useTabs: false,
|
||||
|
||||
File diff suppressed because one or more lines are too long
+4
-6
@@ -1,11 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import index from './views/index.vue'
|
||||
import index from './views/index.vue';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<index/>
|
||||
<index />
|
||||
</template>
|
||||
<style lang="less" src="./assets/less/index.less">
|
||||
</style>
|
||||
<style lang="less" scoped>
|
||||
</style>
|
||||
<style lang="less" src="./assets/less/index.less"></style>
|
||||
<style lang="less" scoped></style>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
// 点击元素范围外
|
||||
export function clickOutside(app) {
|
||||
app.directive('click-outside', {
|
||||
mounted(el, binding) {
|
||||
el.handler = function (e) {
|
||||
// 点击范围在绑定的元素范围内,不执行指令操作
|
||||
if (el.contains(e.target)) return;
|
||||
if (typeof binding.value === 'function') {
|
||||
// 绑定给指令的如果是一个函数,那么将回调并指定this
|
||||
binding.value.apply(this, arguments);
|
||||
}
|
||||
};
|
||||
// 监听全局的点击事件
|
||||
document.addEventListener('click', el.handler);
|
||||
},
|
||||
// 解除事件绑定
|
||||
beforeUnmount(el) {
|
||||
document.removeEventListener('click', el.handler);
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { clickOutside } from './clickOutside.ts';
|
||||
|
||||
export default function directiveMethods(app) {
|
||||
clickOutside(app);
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
export const tabList = [
|
||||
{
|
||||
name: '所有资源',
|
||||
},
|
||||
{
|
||||
name: '油田医院',
|
||||
},
|
||||
{
|
||||
name: '医疗点',
|
||||
},
|
||||
{
|
||||
name: '救护车',
|
||||
},
|
||||
{
|
||||
name: '合作医院',
|
||||
},
|
||||
{
|
||||
name: '地方医院',
|
||||
},
|
||||
{
|
||||
name: '直升机',
|
||||
},
|
||||
{
|
||||
name: '急救路线',
|
||||
},
|
||||
];
|
||||
export const mapIcon1 = new URL('/@/assets/img/mapIcon1.png', import.meta.url).href;
|
||||
export const mapIcon2 = new URL('/@/assets/img/mapIcon2.png', import.meta.url).href;
|
||||
export const mapIcon3 = new URL('/@/assets/img/mapIcon3.png', import.meta.url).href;
|
||||
export const mapIcon4 = new URL('/@/assets/img/mapIcon4.png', import.meta.url).href;
|
||||
export const mapIcon5 = new URL('/@/assets/img/mapIcon5.png', import.meta.url).href;
|
||||
export const mapIcon6 = new URL('/@/assets/img/mapIcon6.png', import.meta.url).href;
|
||||
|
||||
export const legend1 = new URL('/@/assets/img/legend1.png', import.meta.url).href;
|
||||
export const legend2 = new URL('/@/assets/img/legend2.png', import.meta.url).href;
|
||||
export const legend3 = new URL('/@/assets/img/legend3.png', import.meta.url).href;
|
||||
export const legend4 = new URL('/@/assets/img/legend4.png', import.meta.url).href;
|
||||
export const legend5 = new URL('/@/assets/img/legend5.png', import.meta.url).href;
|
||||
export const legend6 = new URL('/@/assets/img/legend6.png', import.meta.url).href;
|
||||
export const mapIcons = [mapIcon1, mapIcon2, mapIcon3, mapIcon4, mapIcon5, mapIcon6];
|
||||
|
||||
export const legendList = [
|
||||
{ img: legend1, text: '油田医院' },
|
||||
{ img: legend2, text: '医疗点' },
|
||||
{ img: legend3, text: '救护车' },
|
||||
{ img: legend4, text: '合作医院' },
|
||||
{ img: legend5, text: '地方医院' },
|
||||
{ img: legend6, text: '直升机' },
|
||||
];
|
||||
const bgImg = new URL('/@/assets/images/china-textur.jpg', import.meta.url).href;
|
||||
|
||||
export function createChartOption({ icons }) {
|
||||
return {
|
||||
tooltip: {
|
||||
show: false,
|
||||
// formatter: (params) => {
|
||||
// console.log('params', params);
|
||||
// if (!params?.data?.id) {
|
||||
// return '';
|
||||
// }
|
||||
// return `<div style="color:red;width:300px"> ${params.name}</div>
|
||||
// <div>id: ${params?.data?.id}</div>`;
|
||||
// },
|
||||
},
|
||||
geo: [
|
||||
{
|
||||
map: 'china',
|
||||
zlevel: 3,
|
||||
aspectScale: 0.8, //长宽比
|
||||
zoom: 1.1,
|
||||
// roam: true,
|
||||
// draggable: true,
|
||||
top: '60',
|
||||
left: 'center',
|
||||
itemStyle: {
|
||||
areaColor: '#173a58',
|
||||
shadowColor: '#173a58',
|
||||
shadowOffsetX: 0,
|
||||
shadowOffsetY: 5,
|
||||
borderWidth: 6, //外部边框
|
||||
borderColor: '#6ccffe',
|
||||
},
|
||||
},
|
||||
{
|
||||
map: 'china',
|
||||
zlevel: 2,
|
||||
aspectScale: 0.8, //长宽比
|
||||
zoom: 1.1,
|
||||
// roam: true,
|
||||
// draggable: true,
|
||||
top: '60',
|
||||
left: 'center',
|
||||
itemStyle: {
|
||||
areaColor: '#1e2c38',
|
||||
shadowColor: '#1e2c38',
|
||||
shadowOffsetX: 0,
|
||||
shadowOffsetY: 10,
|
||||
borderWidth: 6, //外部边框
|
||||
borderColor: '#384d61',
|
||||
},
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
map: 'china', // 这个是上面注册时的名字哦,registerMap('这个名字保持一致')
|
||||
name: '中国地图',
|
||||
type: 'map',
|
||||
selected: {}, // 默认所有省份都是未选中状态
|
||||
selectedMode: 'single', // 选中模式为单选
|
||||
zlevel: 9,
|
||||
zoom: 1.1,
|
||||
aspectScale: 0.8, //长宽比
|
||||
// roam: true,
|
||||
// draggable: true,
|
||||
hoverAnimation: false,
|
||||
silent: false,
|
||||
top: '60',
|
||||
left: 'center',
|
||||
label: {
|
||||
show: true,
|
||||
padding: [0, 10],
|
||||
height: 31,
|
||||
lineHeight: 31,
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 13,
|
||||
marginLeft: 5,
|
||||
},
|
||||
},
|
||||
itemStyle: {
|
||||
// 给地图添加背景图片
|
||||
areaColor: {
|
||||
type: 'pattern',
|
||||
image: bgImg,
|
||||
repeat: 'no-repeat',
|
||||
},
|
||||
borderColor: '#359de5',
|
||||
borderWidth: 2, //内部边框,
|
||||
},
|
||||
// 鼠标悬浮
|
||||
emphasis: {
|
||||
label: {
|
||||
color: '#fff',
|
||||
},
|
||||
itemStyle: {
|
||||
areaColor: '#008CFF',
|
||||
},
|
||||
},
|
||||
},
|
||||
...icons.value,
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 秒转小时
|
||||
* */
|
||||
export function convertSeconds(seconds) {
|
||||
let hours = Math.floor(seconds / 3600);
|
||||
let minutes = Math.floor((seconds % 3600) / 60);
|
||||
let remainingSeconds = seconds % 60;
|
||||
return {
|
||||
hours: hours,
|
||||
minutes: minutes,
|
||||
seconds: remainingSeconds,
|
||||
};
|
||||
}
|
||||
|
||||
export function convertMetersToKilometers(meters) {
|
||||
let kilometers = meters / 1000;
|
||||
return Math.round(kilometers * 100) / 100;
|
||||
}
|
||||
|
||||
export function getTimeStr(time) {
|
||||
let str = '';
|
||||
const { hours, minutes } = convertSeconds(time);
|
||||
|
||||
if (hours) {
|
||||
str += hours + '小时';
|
||||
}
|
||||
if (minutes) {
|
||||
str += minutes + '分钟';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
export function getKmStr(distance) {
|
||||
if (!distance) return '';
|
||||
let d = convertMetersToKilometers(distance);
|
||||
return d >= 1 ? d + '公里' : d * 100 + '米';
|
||||
}
|
||||
@@ -2,74 +2,46 @@
|
||||
<div class="center-map">
|
||||
<div class="china-map-box">
|
||||
<div class="tab-list">
|
||||
<div v-for="(item,i) in list" :class="[currentIndex==i?'active':'']" class="tab" @click="changeTab(i)">
|
||||
<div v-for="(item, i) in list" :class="[currentIndex == i ? 'active' : '']" class="tab" @click="changeTab(i)">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="currentIndex==list.length-1" class="route-navigation">
|
||||
<a-form
|
||||
:model="formState"
|
||||
layout="inline"
|
||||
>
|
||||
<a-form-item class="form-item-self" label="起点"
|
||||
>
|
||||
<a-input v-model:value="formState.user">
|
||||
</a-input>
|
||||
<div v-show="currentIndex == list.length - 1" class="route-navigation">
|
||||
<a-form :model="formState" layout="inline">
|
||||
<a-form-item class="form-item-self" label="起点">
|
||||
<a-input v-model:value="formState.start"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item class="form-item-self" label="终点">
|
||||
<a-input v-model:value="formState.password">
|
||||
</a-input>
|
||||
<a-input v-model:value="formState.end"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<a-button class="reset-btn">清空</a-button>
|
||||
<a-button class="search-btn">路线规划</a-button>
|
||||
<a-button class="reset-btn" @click="clickSearch">清空</a-button>
|
||||
<a-button class="search-btn" @click="searchRoute">路线规划</a-button>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<div class="line-container">
|
||||
<div class="has-data">
|
||||
<div class="line-title">
|
||||
全程2小时37分钟(172.15公里)
|
||||
</div>
|
||||
<div class="line-container" v-show="showRoutePanel" v-click-outside="outClick">
|
||||
<div v-show="routeList.length" class="has-data">
|
||||
<div class="line-title"> {{ panelTitle }}</div>
|
||||
<div class="line-content">
|
||||
<div class="start">起点</div>
|
||||
<div class="line-body">
|
||||
<div class="line"></div>
|
||||
<div class="line-desc">
|
||||
<p>向东行驶124米左转</p>
|
||||
<p>向西北行驶92米左转</p>
|
||||
<p>向西南行驶45米右转</p>
|
||||
<p>向西北行驶50米右转</p>
|
||||
<p>沿燕庆街向东北行驶157米左转</p>
|
||||
<p>向西北行驶47米左转</p>
|
||||
<p>向西行驶97米右转进入主路</p>
|
||||
<p>沿新华东路向西行驶1.1千米右转进入主路</p>
|
||||
<p>沿友爱街向北行驶5.9千米右转</p>
|
||||
<p>沿417乡道向东北行驶49米右转</p>
|
||||
<p>沿417乡道向东行驶1.1千米左转</p>
|
||||
<p>沿417乡道向北行驶8.3千米左转</p>
|
||||
<p>向西北行驶47米左转</p>
|
||||
<p>向西行驶97米右转进入主路</p>
|
||||
<p>沿新华东路向西行驶1.1千米右转进入主路</p>
|
||||
<p>沿友爱街向北行驶5.9千米右转</p>
|
||||
<p>沿417乡道向东北行驶49米右转</p>
|
||||
<p>沿417乡道向东行驶1.1千米左转</p>
|
||||
<p>沿417乡道向北行驶8.3千米左转</p>
|
||||
<p>向西北行驶4.9千米到达目的地</p>
|
||||
<p v-for="(item, i) in routeList" :key="i">{{ item }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="end">终点</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="false" class="empty-data">
|
||||
暂无数据
|
||||
</div>
|
||||
<div v-show="!routeList.length" class="empty-data"> 暂无数据</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="china-map-container"></div>
|
||||
|
||||
<div v-show="false" id="container"></div>
|
||||
<div v-show="false" id="panel"></div>
|
||||
<div class="map-legend">
|
||||
<div class="legend-item" v-for="(item,i) in legendList" :key="i">
|
||||
<div><img class="legend-img" :src="item.img" alt=""> {{ item.text }}</div>
|
||||
<div v-for="(item, i) in legendList" :key="i" class="legend-item">
|
||||
<div><img :src="item.img" alt="" class="legend-img" /> {{ item.text }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -86,444 +58,445 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import {onMounted, ref} from 'vue'
|
||||
import * as echarts from 'echarts';
|
||||
import mapJson from '/@/components/chinaMap/json/c'
|
||||
import { onMounted, ref } from 'vue';
|
||||
import * as echarts from 'echarts';
|
||||
import mapJson from '/@/components/chinaMap/json/c';
|
||||
import { tabList, mapIcons, legendList, getTimeStr, getKmStr, createChartOption } from './chinaHooks.ts';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
// import bgImg from '/@/assets/images/china-textur.png'
|
||||
const bgImg = new URL('/@/assets/images/china-textur.jpg', import.meta.url).href
|
||||
const mapIcon1 = new URL('/@/assets/img/mapIcon1.png', import.meta.url).href
|
||||
const mapIcon2 = new URL('/@/assets/img/mapIcon2.png', import.meta.url).href
|
||||
const mapIcon3 = new URL('/@/assets/img/mapIcon3.png', import.meta.url).href
|
||||
const mapIcon4 = new URL('/@/assets/img/mapIcon4.png', import.meta.url).href
|
||||
const mapIcon5 = new URL('/@/assets/img/mapIcon5.png', import.meta.url).href
|
||||
const mapIcon6 = new URL('/@/assets/img/mapIcon6.png', import.meta.url).href
|
||||
|
||||
const legend1 = new URL('/@/assets/img/legend1.png', import.meta.url).href
|
||||
const legend2 = new URL('/@/assets/img/legend2.png', import.meta.url).href
|
||||
const legend3 = new URL('/@/assets/img/legend3.png', import.meta.url).href
|
||||
const legend4 = new URL('/@/assets/img/legend4.png', import.meta.url).href
|
||||
const legend5 = new URL('/@/assets/img/legend5.png', import.meta.url).href
|
||||
const legend6 = new URL('/@/assets/img/legend6.png', import.meta.url).href
|
||||
const mapIcons = [mapIcon1, mapIcon2, mapIcon3, mapIcon4, mapIcon5, mapIcon6]
|
||||
const legendList = [{img: legend1, text: '油田医院'}, {img: legend2, text: '医疗点'}, {
|
||||
img: legend3,
|
||||
text: '救护车'
|
||||
}, {img: legend4, text: '合作医院'}, {img: legend5, text: '地方医院'}, {img: legend6, text: '直升机'}]
|
||||
const formState = ref({
|
||||
user: '',
|
||||
password: "",
|
||||
});
|
||||
const list = ref([
|
||||
{
|
||||
name: '所有资源',
|
||||
isChecked: true
|
||||
},
|
||||
{
|
||||
name: '油田医院',
|
||||
isChecked: false
|
||||
},
|
||||
{
|
||||
name: '医疗点',
|
||||
isChecked: false
|
||||
},
|
||||
{
|
||||
name: '救护车',
|
||||
isChecked: false
|
||||
},
|
||||
{
|
||||
name: '合作医院',
|
||||
isChecked: false
|
||||
},
|
||||
{
|
||||
name: '地方医院',
|
||||
isChecked: false
|
||||
},
|
||||
{
|
||||
name: '直升机',
|
||||
isChecked: false
|
||||
},
|
||||
{
|
||||
name: '急救路线',
|
||||
isChecked: false
|
||||
}
|
||||
])
|
||||
const currentIndex = ref(0);
|
||||
const icons = ref([{
|
||||
type: "scatter",
|
||||
zlevel: 100,
|
||||
coordinateSystem: "geo",
|
||||
//自定义图片的 位置(lng, lat)
|
||||
data: [{name: '西安', value: ['108.88', '34.40'], id: 'xian'}],
|
||||
//自定义图片的 大小
|
||||
symbolSize: [25, 63],
|
||||
//自定义图片的 路径
|
||||
// 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://' + mapIcon1, // 图片 URL
|
||||
},
|
||||
{
|
||||
type: "scatter",
|
||||
zlevel: 100,
|
||||
coordinateSystem: "geo",
|
||||
//自定义图片的 位置(lng, lat)
|
||||
data: [{name: '太原', value: [112.55, 37.98], id: 'taiyuan'}],
|
||||
//自定义图片的 大小
|
||||
symbolSize: [25, 63],
|
||||
symbol: 'image://' + mapIcon2, // 图片 URL
|
||||
}])
|
||||
|
||||
function changeTab(i) {
|
||||
let x = Math.random() + 3 - Math.random() - i;
|
||||
let y = Math.random() - 2 + Math.random() + i
|
||||
const o = {
|
||||
type: "scatter",
|
||||
zlevel: 100,
|
||||
coordinateSystem: "geo",
|
||||
//自定义图片的 位置(lng, lat)
|
||||
data: [{name: '太原', value: [112.55 + Math.random() + x, 37.98 + Math.random() + y], id: 'taiyuan'}],
|
||||
//自定义图片的 大小
|
||||
symbolSize: [25, 63],
|
||||
symbol: 'image://' + mapIcons[Math.floor(Math.random() * 6)], // 图片 URL
|
||||
}
|
||||
icons.value = []
|
||||
icons.value.push(o)
|
||||
currentIndex.value = i
|
||||
list.value = list.value.map(item => {
|
||||
item.isChecked = false
|
||||
return item
|
||||
})
|
||||
myChart.value.setOption({});
|
||||
initMap()
|
||||
|
||||
}
|
||||
|
||||
let myChart = ref(null)
|
||||
onMounted(() => {
|
||||
console.log('reload')
|
||||
myChart.value = echarts.init(document.querySelector('.china-map-container'));
|
||||
echarts.registerMap('china', mapJson);
|
||||
initMap();
|
||||
})
|
||||
|
||||
function initMap() {
|
||||
let option = {
|
||||
tooltip: {
|
||||
show: false,
|
||||
formatter: "{b0}: {c0}"
|
||||
const formState = ref({
|
||||
start: '西安北站',
|
||||
end: '',
|
||||
});
|
||||
const list = ref(tabList);
|
||||
const currentIndex = ref(0);
|
||||
const icons = ref([
|
||||
{
|
||||
type: 'scatter',
|
||||
zlevel: 100,
|
||||
coordinateSystem: 'geo',
|
||||
//自定义图片的 位置(lng, lat)
|
||||
data: [{ name: '西安', value: ['108.88', '34.40'], id: 'xian' }],
|
||||
//自定义图片的 大小
|
||||
symbolSize: [25, 63],
|
||||
//自定义图片的 路径
|
||||
// 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://' + mapIcons[0], // 图片 URL
|
||||
label: {
|
||||
borderColor: 'red',
|
||||
borderWidth: 2,
|
||||
borderType: 'solid',
|
||||
shadowBlur: '10px',
|
||||
shadowColor: 'red',
|
||||
shadowOffsetX: '5px',
|
||||
shadowOffsetY: '5px',
|
||||
},
|
||||
},
|
||||
geo: [
|
||||
{
|
||||
map: 'china',
|
||||
zlevel: 3,
|
||||
aspectScale: .8, //长宽比
|
||||
zoom: 1.1,
|
||||
roam: false,
|
||||
top: '60',
|
||||
left: 'center',
|
||||
itemStyle: {
|
||||
areaColor: "#173a58",
|
||||
shadowColor: "#173a58",
|
||||
shadowOffsetX: 0,
|
||||
shadowOffsetY: 5,
|
||||
borderWidth: 6,//外部边框
|
||||
borderColor: "#6ccffe",
|
||||
}
|
||||
]);
|
||||
|
||||
function changeTab(i) {
|
||||
let x = Math.random() + 5 - Math.random() - i;
|
||||
let y = Math.random() - 5 + Math.random() + i;
|
||||
const o = {
|
||||
type: 'scatter',
|
||||
zlevel: 100,
|
||||
coordinateSystem: 'geo',
|
||||
//自定义图片的 位置(lng, lat)
|
||||
data: [{ name: '太原', value: [112.55 + Math.random() + x, 37.98 + Math.random() + y], id: 'taiyuan' }],
|
||||
//自定义图片的 大小
|
||||
symbolSize: [25, 63],
|
||||
symbol: 'image://' + mapIcons[Math.floor(Math.random() * 6)], // 图片 URL
|
||||
};
|
||||
const line = {
|
||||
name: '线路',
|
||||
type: 'lines',
|
||||
coordinateSystem: 'geo',
|
||||
zlevel: 100,
|
||||
large: true,
|
||||
effect: {
|
||||
show: true,
|
||||
constantSpeed: 30,
|
||||
symbol: 'arrow', //ECharts 提供的标记类型包括 'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
|
||||
symbolSize: 0,
|
||||
trailLength: 0,
|
||||
},
|
||||
{
|
||||
map: 'china',
|
||||
zlevel: 2,
|
||||
aspectScale: .8, //长宽比
|
||||
zoom: 1.1,
|
||||
roam: false,
|
||||
top: '60',
|
||||
left: 'center',
|
||||
itemStyle: {
|
||||
areaColor: "#1e2c38",
|
||||
shadowColor: "#1e2c38",
|
||||
shadowOffsetX: 0,
|
||||
shadowOffsetY: 10,
|
||||
borderWidth: 6,//外部边框
|
||||
borderColor: "#384d61",
|
||||
}
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
map: 'china',// 这个是上面注册时的名字哦,registerMap('这个名字保持一致')
|
||||
name: '中国地图',
|
||||
type: 'map',
|
||||
zlevel: 9,
|
||||
zoom: 1.1,
|
||||
aspectScale: .8, //长宽比
|
||||
hoverAnimation: false,
|
||||
silent: false,
|
||||
top: '60',
|
||||
left: 'center',
|
||||
label: {
|
||||
show: true,
|
||||
padding: [0, 10],
|
||||
height: 31,
|
||||
lineHeight: 31,
|
||||
textStyle: {
|
||||
color: "#fff",
|
||||
fontSize: 13,
|
||||
marginLeft: 5
|
||||
},
|
||||
},
|
||||
itemStyle: {
|
||||
// 给地图添加背景图片
|
||||
areaColor: {
|
||||
type: 'pattern',
|
||||
image: bgImg,
|
||||
repeat: 'no-repeat'
|
||||
},
|
||||
borderColor: "#359de5",
|
||||
borderWidth: 2,//内部边框
|
||||
lineStyle: {
|
||||
normal: {
|
||||
color: '#0fff17',
|
||||
width: 2,
|
||||
opacity: 1.0,
|
||||
curveness: 0.15,
|
||||
},
|
||||
},
|
||||
...icons.value
|
||||
],
|
||||
};
|
||||
// myChart.value.clear()
|
||||
myChart.value.setOption(option);
|
||||
myChart.value.on('click', function (res) {
|
||||
data: [
|
||||
{
|
||||
fromName: '六安',
|
||||
toName: '合肥市',
|
||||
coords: [
|
||||
[116.27, 31.786],
|
||||
[117.37, 31.386],
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
icons.value = [];
|
||||
icons.value.push(o);
|
||||
icons.value.push(line);
|
||||
currentIndex.value = i;
|
||||
let myChart = echarts.init(document.querySelector('.china-map-container'));
|
||||
initMap(myChart);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
console.log('reload');
|
||||
let myChart = echarts.init(document.querySelector('.china-map-container'));
|
||||
echarts.registerMap('china', mapJson);
|
||||
initMap(myChart);
|
||||
});
|
||||
|
||||
function initMap(myChart) {
|
||||
let option = createChartOption({ icons });
|
||||
myChart.setOption(option);
|
||||
// 关闭之前的点击事件
|
||||
myChart.off('click');
|
||||
myChart.on('click', function (res) {
|
||||
mapClick(res, myChart);
|
||||
});
|
||||
myChart.getZr().on('click', (params) => {
|
||||
if (params.target) {
|
||||
// alert('画布非空白区');
|
||||
} else {
|
||||
// alert('画布空白区');
|
||||
myChart.dispatchAction({
|
||||
// 如果绑定了 geo 图层(指定了geoIndex),则是 geoUnSelect 事件
|
||||
type: 'unselect',
|
||||
// 指定 series 的索引
|
||||
seriesIndex: 0,
|
||||
// 指定要取消选中数据的索引, 如果要取消全部选中,则把所有数据的下标数组作为 dataIndex 即可
|
||||
dataIndex: new Array(101).fill(null).map((_, i) => i), // 0 代表取消选中 data 中第1项的选中,依此类推
|
||||
});
|
||||
myChart.dispatchAction({
|
||||
// 如果绑定了 geo 图层(指定了geoIndex),则是 geoUnSelect 事件
|
||||
type: 'geoUnSelect',
|
||||
// 指定 series 的索引
|
||||
seriesIndex: 0,
|
||||
// 指定要取消选中数据的索引, 如果要取消全部选中,则把所有数据的下标数组作为 dataIndex 即可
|
||||
dataIndex: new Array(101).fill(null).map((_, i) => i), // 0 代表取消选中 data 中第1项的选中,依此类推
|
||||
});
|
||||
}
|
||||
});
|
||||
window.addEventListener('resize', () => {
|
||||
myChart.resize();
|
||||
});
|
||||
}
|
||||
|
||||
function mapClick(res, myChart) {
|
||||
if (res.componentType !== 'series') {
|
||||
myChart.setOption({
|
||||
series: [{ selected: {} }], // 取消所有省份的选中状态
|
||||
});
|
||||
}
|
||||
|
||||
console.log('res', res);
|
||||
if ('scatter' === res.componentSubType) {
|
||||
alert(`点击了 ${res.name} 图标`);
|
||||
// alert(`点击了 ${res.name} 图标`);
|
||||
}
|
||||
if ('map' === res.componentSubType) {
|
||||
alert(`点击了 ${res.name} 地图`);
|
||||
// alert(`点击了 ${res.name} 地图`);
|
||||
}
|
||||
});
|
||||
window.addEventListener('resize', () => {
|
||||
myChart.value.resize()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const routeList = ref([]);
|
||||
const showRoutePanel = ref(false);
|
||||
const panelTitle = ref();
|
||||
|
||||
function outClick() {
|
||||
showRoutePanel.value = false;
|
||||
}
|
||||
|
||||
function setTitle({ time, distance }) {
|
||||
let str = '全程';
|
||||
str += getTimeStr(time);
|
||||
str += getKmStr(distance);
|
||||
panelTitle.value = str;
|
||||
}
|
||||
|
||||
function searchRoute() {
|
||||
showRoutePanel.value = false;
|
||||
panelTitle.value = '';
|
||||
if (!formState.value.start) {
|
||||
return message.warn('请输入起点');
|
||||
}
|
||||
if (!formState.value.end) {
|
||||
return message.warn('请输入终点');
|
||||
}
|
||||
//基本地图加载
|
||||
let map = new AMap.Map('container', {
|
||||
resizeEnable: true,
|
||||
center: [116.397428, 39.90923], //地图中心点
|
||||
zoom: 13, //地图显示的缩放级别
|
||||
});
|
||||
//构造路线导航类
|
||||
let driving = new AMap.Driving({
|
||||
map: map,
|
||||
panel: 'panel',
|
||||
});
|
||||
// 根据起终点名称规划驾车导航路线
|
||||
driving.search([{ keyword: formState.value.start }, { keyword: formState.value.end }], function (status, result) {
|
||||
// result 即是对应的驾车导航信息,相关数据结构文档请参考 https://lbs.amap.com/api/javascript-api/reference/route-search#m_DrivingResult
|
||||
if (status === 'complete') {
|
||||
console.log('绘制驾车路线完成');
|
||||
} else {
|
||||
console.log('获取驾车数据失败:' + result);
|
||||
}
|
||||
});
|
||||
AMap.Event.addListener(driving, 'complete', (res) => {
|
||||
const data = JSON.parse(JSON.stringify(res));
|
||||
if (data.info == 'OK') {
|
||||
const { routes } = data;
|
||||
setTitle(routes[0]);
|
||||
let arr = [];
|
||||
arr.push(data.originName);
|
||||
routes[0].steps.map((item) => {
|
||||
arr.push(item.instruction);
|
||||
});
|
||||
arr.push(data.destinationName);
|
||||
showRoutePanel.value = true;
|
||||
routeList.value = arr;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function clickSearch() {
|
||||
formState.value.start = '';
|
||||
formState.value.end = '';
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.center-map {
|
||||
flex: 1;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-content: space-between;
|
||||
|
||||
.china-map-box {
|
||||
.center-map {
|
||||
flex: 1;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
}
|
||||
align-content: space-between;
|
||||
|
||||
.tab-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
|
||||
.tab {
|
||||
width: calc(100% / 8);
|
||||
height: 43px;
|
||||
.china-map-box {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #29F1FA;
|
||||
background: url("/@/assets/img/tab-default.png") no-repeat;
|
||||
background-size: 100%;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
//background-position: -5px -10px;
|
||||
&.active {
|
||||
color: #fff;
|
||||
background: url("/@/assets/img/tab-active.png") no-repeat;
|
||||
background-size: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.route-navigation {
|
||||
margin: 12px 0;
|
||||
width: 100%;
|
||||
height: 46px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #002E64;
|
||||
border-radius: 6px;
|
||||
position: absolute;
|
||||
top: 40px;
|
||||
z-index: 999;
|
||||
transition: all 0.3s;
|
||||
|
||||
:deep(.form-item-self) {
|
||||
label {
|
||||
color: #29F1FA;
|
||||
}
|
||||
|
||||
.ant-input {
|
||||
width: 280px;
|
||||
color: #d6d9e0;
|
||||
background: #2A4164;
|
||||
border-radius: 2px 2px 2px 2px;
|
||||
border: 1px solid #1B7EF2;
|
||||
}
|
||||
}
|
||||
|
||||
.reset-btn {
|
||||
width: 64px;
|
||||
height: 32px;
|
||||
border-radius: 5px;
|
||||
color: #45A2FF;
|
||||
background: #002E64;
|
||||
border: 1px solid #45A2FF;
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
margin-left: 10px;
|
||||
width: 88px;
|
||||
height: 32px;
|
||||
color: #EFEFEF;
|
||||
background: #45A2FF;
|
||||
border-radius: 5px;
|
||||
border-color: #45A2FF;
|
||||
}
|
||||
|
||||
.line-container {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 54px;
|
||||
width: 288px;
|
||||
padding: 9px 18px;
|
||||
min-height: 200px;
|
||||
max-height: 473px;
|
||||
overflow: auto;
|
||||
background: #2A4164;
|
||||
border-radius: 2px;
|
||||
border: 1px solid #1B7EF2;
|
||||
|
||||
.line-title {
|
||||
margin-bottom: 9px;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
|
||||
.line-content {
|
||||
font-size: 12px;
|
||||
|
||||
.start {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&::before {
|
||||
content: '起';
|
||||
color: #fff;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-right: 7px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
background: #1478F5;
|
||||
}
|
||||
}
|
||||
|
||||
.end {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&::before {
|
||||
content: '终';
|
||||
color: #fff;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-right: 7px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
background: #1478F5;
|
||||
}
|
||||
}
|
||||
|
||||
.line-body {
|
||||
display: flex;
|
||||
//max-height: 370px;
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 1px;
|
||||
//max-height: 370px;
|
||||
background-color: #1478f5;
|
||||
margin: 5px 19px 5px 8px;
|
||||
}
|
||||
|
||||
.line-sesc {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.china-map-container {
|
||||
flex: 1;
|
||||
margin: 10px;
|
||||
//border: 1px solid red;
|
||||
}
|
||||
|
||||
.map-legend {
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
left: 0;
|
||||
width: 200px;
|
||||
//border: 1px solid red;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.legend-item {
|
||||
width: 50%;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
line-height: 30px;
|
||||
|
||||
.legend-img {
|
||||
width: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.center-footer {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 10px;
|
||||
gap: 20px;
|
||||
|
||||
.count-item {
|
||||
width: 340px;
|
||||
height: 80px;
|
||||
display: flex;
|
||||
color: #FFFFFF;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.tab-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
|
||||
.tab {
|
||||
width: calc(100% / 8);
|
||||
height: 40px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #29f1fa;
|
||||
background: url('/@/assets/img/tab-default.png') no-repeat;
|
||||
background-size: 100%;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
|
||||
&.active {
|
||||
color: #fff;
|
||||
background: url('/@/assets/img/tab-active.png') no-repeat;
|
||||
background-size: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.route-navigation {
|
||||
margin: 12px 0;
|
||||
width: 100%;
|
||||
height: 46px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #00071B;
|
||||
box-shadow: inset 0 0 40px 0 #1B7EF2;
|
||||
border-radius: 4px;
|
||||
background: #002e64;
|
||||
border-radius: 6px;
|
||||
position: absolute;
|
||||
top: 40px;
|
||||
z-index: 999;
|
||||
transition: all 0.3s;
|
||||
|
||||
.num {
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
:deep(.form-item-self) {
|
||||
label {
|
||||
color: #29f1fa;
|
||||
}
|
||||
|
||||
.ant-input {
|
||||
width: 280px;
|
||||
color: #d6d9e0;
|
||||
background: #2a4164;
|
||||
border-radius: 2px 2px 2px 2px;
|
||||
border: 1px solid #1b7ef2;
|
||||
}
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 16px;
|
||||
.reset-btn {
|
||||
width: 64px;
|
||||
height: 32px;
|
||||
border-radius: 5px;
|
||||
color: #45a2ff;
|
||||
background: #002e64;
|
||||
border: 1px solid #45a2ff;
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
margin-left: 10px;
|
||||
width: 88px;
|
||||
height: 32px;
|
||||
color: #efefef;
|
||||
background: #45a2ff;
|
||||
border-radius: 5px;
|
||||
border-color: #45a2ff;
|
||||
}
|
||||
|
||||
.line-container {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 54px;
|
||||
width: 288px;
|
||||
padding: 9px 18px;
|
||||
min-height: 200px;
|
||||
max-height: 473px;
|
||||
overflow: auto;
|
||||
background: #2a4164;
|
||||
border-radius: 2px;
|
||||
border: 1px solid #1b7ef2;
|
||||
|
||||
.line-title {
|
||||
margin-bottom: 9px;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
|
||||
.line-content {
|
||||
font-size: 12px;
|
||||
|
||||
.start {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&::before {
|
||||
content: '起';
|
||||
color: #fff;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-right: 7px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
background: #1478f5;
|
||||
}
|
||||
}
|
||||
|
||||
.end {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&::before {
|
||||
content: '终';
|
||||
color: #fff;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-right: 7px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
background: #1478f5;
|
||||
}
|
||||
}
|
||||
|
||||
.line-body {
|
||||
display: flex;
|
||||
//max-height: 370px;
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 1px;
|
||||
//max-height: 370px;
|
||||
background-color: #1478f5;
|
||||
margin: 5px 19px 5px 8px;
|
||||
}
|
||||
|
||||
.line-sesc {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.empty-data {
|
||||
margin-top: 30%;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.china-map-container {
|
||||
flex: 1;
|
||||
margin: 10px;
|
||||
//border: 1px solid red;
|
||||
}
|
||||
|
||||
.map-legend {
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
left: 0;
|
||||
width: 200px;
|
||||
//border: 1px solid red;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.legend-item {
|
||||
width: 50%;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
line-height: 30px;
|
||||
|
||||
.legend-img {
|
||||
width: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.center-footer {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 10px;
|
||||
gap: 20px;
|
||||
|
||||
.count-item {
|
||||
width: 340px;
|
||||
height: 80px;
|
||||
display: flex;
|
||||
color: #ffffff;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #00071b;
|
||||
box-shadow: inset 0 0 40px 0 #1b7ef2;
|
||||
border-radius: 4px;
|
||||
|
||||
.num {
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
+25607
-98301
File diff suppressed because it is too large
Load Diff
+27207
-102983
File diff suppressed because it is too large
Load Diff
@@ -2,53 +2,58 @@
|
||||
<div class="title-d">
|
||||
<span>{{ props.title }}</span>
|
||||
<div>
|
||||
<span v-if="isShowMore" style="font-size: 14px;font-weight: 100;cursor: pointer;margin-right: 3px" @click="clickMore">更多></span>
|
||||
<img src="../assets/img/point.png" alt="">
|
||||
<span v-if="isShowMore" style="font-size: 14px; font-weight: 100; cursor: pointer; margin-right: 3px" @click="clickMore">更多></span>
|
||||
<img src="../assets/img/point.png" alt="" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
const props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: () => ''
|
||||
},
|
||||
isShowMore: {
|
||||
type: Boolean,
|
||||
default: () => false
|
||||
const props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: () => '',
|
||||
},
|
||||
isShowMore: {
|
||||
type: Boolean,
|
||||
default: () => false,
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['clickMore']);
|
||||
function clickMore() {
|
||||
emit('clickMore');
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['clickMore'])
|
||||
function clickMore() {
|
||||
emit('clickMore')
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.title-d {
|
||||
padding-left: 17px;
|
||||
position: relative;
|
||||
text-align: left;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
background: linear-gradient(90deg, rgba(106, 112, 124, 0.4) 0%, rgba(106, 112, 124, 0) 70%, rgba(106, 112, 124, 0) 100%);
|
||||
opacity: 1;
|
||||
border-top: 1px solid #6A707C;
|
||||
border-bottom: 1px solid #6A707C;
|
||||
border-image: linear-gradient(90deg, rgba(217.0000022649765, 231.00000143051147, 255, 0.5), rgba(217.0000022649765, 231.00000143051147, 255, 0)) 1 1;
|
||||
color: #ffffff;
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.title-d {
|
||||
padding-left: 17px;
|
||||
position: relative;
|
||||
text-align: left;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
background: linear-gradient(90deg, rgba(106, 112, 124, 0.4) 0%, rgba(106, 112, 124, 0) 70%, rgba(106, 112, 124, 0) 100%);
|
||||
opacity: 1;
|
||||
border-top: 1px solid #6a707c;
|
||||
border-bottom: 1px solid #6a707c;
|
||||
border-image: linear-gradient(
|
||||
90deg,
|
||||
rgba(217.0000022649765, 231.00000143051147, 255, 0.5),
|
||||
rgba(217.0000022649765, 231.00000143051147, 255, 0)
|
||||
)
|
||||
1 1;
|
||||
color: #ffffff;
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
content: '';
|
||||
width: 7px;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: #45A2FF;
|
||||
&:before {
|
||||
position: absolute;
|
||||
content: '';
|
||||
width: 7px;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: #45a2ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
+10
-5
@@ -1,9 +1,14 @@
|
||||
import {createApp} from 'vue'
|
||||
import { createApp } from 'vue';
|
||||
import App from './App.vue';
|
||||
import './assets/less/index.less';
|
||||
import('ant-design-vue/dist/antd.less');
|
||||
import registerGlobComp from './assets/ts/antd.ts'
|
||||
|
||||
const app = createApp(App)
|
||||
import('ant-design-vue/dist/antd.less');
|
||||
import registerGlobComp from './assets/ts/antd.ts';
|
||||
import directiveMethods from './assets/ts/directive';
|
||||
|
||||
const app = createApp(App);
|
||||
// 注册自定义事件
|
||||
directiveMethods(app);
|
||||
// 注册组件
|
||||
registerGlobComp(app);
|
||||
app.mount('#app')
|
||||
app.mount('#app');
|
||||
|
||||
+116
-113
@@ -2,147 +2,150 @@
|
||||
<div class="outer">
|
||||
<div class="title-d">
|
||||
<div class="title-d-left">
|
||||
{{dayTimeO}}
|
||||
</div>
|
||||
<div class="title-d-middle">
|
||||
应急就医服务中心
|
||||
</div>
|
||||
<div class="title-d-right">
|
||||
累计运行时间:{{dayTimeT}}
|
||||
{{ dayTimeO }}
|
||||
</div>
|
||||
<div class="title-d-middle"> 应急就医服务中心 </div>
|
||||
<div class="title-d-right"> 累计运行时间:{{ dayTimeT }} </div>
|
||||
</div>
|
||||
<div class="body-d">
|
||||
<div class="body-d-left">
|
||||
<one-l/>
|
||||
<two-l/>
|
||||
<three-l/>
|
||||
<one-l />
|
||||
<two-l />
|
||||
<three-l />
|
||||
</div>
|
||||
<div class="body-d-middle">
|
||||
<china-map />
|
||||
</div>
|
||||
<div class="body-d-right">
|
||||
<one-r/>
|
||||
<two-r/>
|
||||
<three-r/>
|
||||
<one-r />
|
||||
<two-r />
|
||||
<three-r />
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-d"></div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import {ref} from "vue";
|
||||
import OneL from "../components/body-d-left/oneL.vue";
|
||||
import TwoL from "../components/body-d-left/twoL.vue";
|
||||
import ThreeL from "../components/body-d-left/threeL.vue";
|
||||
import OneR from "../components/body-d-right/oneR.vue";
|
||||
import TwoR from "../components/body-d-right/twoR.vue";
|
||||
import ThreeR from "../components/body-d-right/threeR.vue";
|
||||
import ChinaMap from '../components/chinaMap/chinaMap.vue'
|
||||
import * as dayjs from "dayjs";
|
||||
const dayTimeO = ref();
|
||||
const dayTimeT = ref();
|
||||
import { ref } from 'vue';
|
||||
import OneL from '../components/body-d-left/oneL.vue';
|
||||
import TwoL from '../components/body-d-left/twoL.vue';
|
||||
import ThreeL from '../components/body-d-left/threeL.vue';
|
||||
import OneR from '../components/body-d-right/oneR.vue';
|
||||
import TwoR from '../components/body-d-right/twoR.vue';
|
||||
import ThreeR from '../components/body-d-right/threeR.vue';
|
||||
import ChinaMap from '../components/chinaMap/chinaMap.vue';
|
||||
import * as dayjs from 'dayjs';
|
||||
const dayTimeO = ref();
|
||||
const dayTimeT = ref();
|
||||
|
||||
function init() {
|
||||
getTime();
|
||||
setInterval(() => {
|
||||
function init() {
|
||||
getTime();
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
function getTime() {
|
||||
dayTimeO.value = dayjs().format('YYYY年MM月DD日 HH时mm分ss秒')
|
||||
dayTimeT.value = dayjs().diff(dayjs('2020-01-01'), 'day')+'天'
|
||||
+getZero(dayjs().diff(dayjs(dayjs().format('YYYY-MM-DD')+' 00:00:00'), 'hours'))+'时'
|
||||
+getZero(dayjs().diff(dayjs(dayjs().format('YYYY-MM-DD HH')+':00:00'), 'minutes'))+'分'
|
||||
+getZero(dayjs().diff(dayjs(dayjs().format('YYYY-MM-DD HH:mm')+':00'), 'seconds'))+'秒';
|
||||
}
|
||||
|
||||
function getZero(num: any) {
|
||||
if (num < 10) {
|
||||
return '0'+num;
|
||||
setInterval(() => {
|
||||
getTime();
|
||||
}, 1000);
|
||||
}
|
||||
return num
|
||||
}
|
||||
|
||||
init();
|
||||
function getTime() {
|
||||
dayTimeO.value = dayjs().format('YYYY年MM月DD日 HH时mm分ss秒');
|
||||
dayTimeT.value =
|
||||
dayjs().diff(dayjs('2020-01-01'), 'day') +
|
||||
'天' +
|
||||
getZero(dayjs().diff(dayjs(dayjs().format('YYYY-MM-DD') + ' 00:00:00'), 'hours')) +
|
||||
'时' +
|
||||
getZero(dayjs().diff(dayjs(dayjs().format('YYYY-MM-DD HH') + ':00:00'), 'minutes')) +
|
||||
'分' +
|
||||
getZero(dayjs().diff(dayjs(dayjs().format('YYYY-MM-DD HH:mm') + ':00'), 'seconds')) +
|
||||
'秒';
|
||||
}
|
||||
|
||||
function getZero(num: any) {
|
||||
if (num < 10) {
|
||||
return '0' + num;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
init();
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.outer {
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
background: url("../assets/images/bg.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.title-d {
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
display: flex;
|
||||
padding-bottom: 9px;
|
||||
background: url("../assets/images/top-title.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
|
||||
.title-d-left, .title-d-middle, .title-d-right {
|
||||
font-size: 27px;
|
||||
color: #ffffff;
|
||||
line-height: 60px;
|
||||
text-align: center;
|
||||
.outer {
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
background: url('../assets/images/bg.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.title-d {
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
display: flex;
|
||||
padding-bottom: 9px;
|
||||
background: url('../assets/images/top-title.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
|
||||
> :nth-child(1) {
|
||||
width: 29%;
|
||||
}
|
||||
.title-d-left,
|
||||
.title-d-middle,
|
||||
.title-d-right {
|
||||
font-size: 27px;
|
||||
color: #ffffff;
|
||||
line-height: 60px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
> :nth-child(2) {
|
||||
width: 42%;
|
||||
font-size: 40px;
|
||||
font-weight: bold;
|
||||
}
|
||||
> :nth-child(1) {
|
||||
width: 29%;
|
||||
}
|
||||
|
||||
> :nth-child(3) {
|
||||
width: 29%;
|
||||
}
|
||||
}
|
||||
> :nth-child(2) {
|
||||
width: 42%;
|
||||
font-size: 40px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.body-d {
|
||||
display: flex;
|
||||
height: calc(100% - 120px);
|
||||
padding-top: 10px;
|
||||
|
||||
> :nth-child(1) {
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
> :nth-child(2) {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
> :nth-child(3) {
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.body-d-left, .body-d-right {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.body-d-left, .body-d-right {
|
||||
|
||||
> :nth-child(n) {
|
||||
width: 100%;
|
||||
height: calc(100% / 3);
|
||||
padding: 10px;
|
||||
> :nth-child(3) {
|
||||
width: 29%;
|
||||
}
|
||||
}
|
||||
.body-d-middle{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom-d {
|
||||
height: 40px;
|
||||
background: url("../assets/images/bottom-b.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.body-d {
|
||||
display: flex;
|
||||
height: calc(100% - 120px);
|
||||
padding-top: 10px;
|
||||
|
||||
> :nth-child(1) {
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
> :nth-child(2) {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
> :nth-child(3) {
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.body-d-left,
|
||||
.body-d-right {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.body-d-left,
|
||||
.body-d-right {
|
||||
> :nth-child(n) {
|
||||
width: 100%;
|
||||
height: calc(100% / 3);
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
.body-d-middle {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom-d {
|
||||
height: 40px;
|
||||
background: url('../assets/images/bottom-b.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user