diff --git a/package-lock.json b/package-lock.json index 2c6d1ac..cb231ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", "@jiaminghi/data-view": "^2.10.0", + "@vuepic/vue-datepicker": "^7.4.0", "axios": "^1.6.2", "echarts": "^5.4.3", "echarts-gl": "^2.0.9", @@ -827,6 +828,21 @@ "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.3.8.tgz", "integrity": "sha512-8PGwybFwM4x8pcfgqEQFy70NaQxASvOC5DJwLQfpArw1UDfUXrJkdxD3BhVTMS+0Lef/TU7YO0Jvr0jJY8T+mw==" }, + "node_modules/@vuepic/vue-datepicker": { + "version": "7.4.0", + "resolved": "https://registry.npmmirror.com/@vuepic/vue-datepicker/-/vue-datepicker-7.4.0.tgz", + "integrity": "sha512-dXYzbcnRet9b+Dkh+f8rhMnjj5QXgejJTQp+ZRALgwP2oeli2c8e4VvJ0NVxoc7QTU8D5x5Et8NP51C450Pkvg==", + "dependencies": { + "date-fns": "^2.30.0", + "date-fns-tz": "^1.3.7" + }, + "engines": { + "node": ">=18.12.0" + }, + "peerDependencies": { + "vue": ">=3.2.0" + } + }, "node_modules/@xmldom/xmldom": { "version": "0.8.10", "resolved": "https://registry.npmmirror.com/@xmldom/xmldom/-/xmldom-0.8.10.tgz", @@ -951,6 +967,25 @@ "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.2.tgz", "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, + "node_modules/date-fns": { + "version": "2.30.0", + "resolved": "https://registry.npmmirror.com/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "dependencies": { + "@babel/runtime": "^7.21.0" + }, + "engines": { + "node": ">=0.11" + } + }, + "node_modules/date-fns-tz": { + "version": "1.3.8", + "resolved": "https://registry.npmmirror.com/date-fns-tz/-/date-fns-tz-1.3.8.tgz", + "integrity": "sha512-qwNXUFtMHTTU6CFSFjoJ80W8Fzzp24LntbjFFBgL/faqds4e5mo9mftoRLgr3Vi1trISsg4awSpYVsOQCRnapQ==", + "peerDependencies": { + "date-fns": ">=2.0.0" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz", diff --git a/package.json b/package.json index d57a8a9..e92bf71 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", "@jiaminghi/data-view": "^2.10.0", + "@vuepic/vue-datepicker": "^7.4.0", "axios": "^1.6.2", "echarts": "^5.4.3", "echarts-gl": "^2.0.9", diff --git a/src/assets/img/header.png b/src/assets/img/header.png index df561ed..f568624 100644 Binary files a/src/assets/img/header.png and b/src/assets/img/header.png differ diff --git a/src/components/datePicker.vue b/src/components/datePicker.vue new file mode 100644 index 0000000..f70495f --- /dev/null +++ b/src/components/datePicker.vue @@ -0,0 +1,230 @@ + + + + \ No newline at end of file diff --git a/src/components/headView.vue b/src/components/headView.vue index 610942d..fe16dfd 100644 --- a/src/components/headView.vue +++ b/src/components/headView.vue @@ -3,6 +3,8 @@ import { reactive, ref, provide, nextTick, onMounted } from "vue"; import areaList from "./areaList.vue"; import { useRoute, useRouter } from "vue-router"; import mitt from "@/utils/mitt"; +import datePicker from "./datePicker.vue"; +import axios from "axios"; const info = reactive({ address: '泸县', @@ -58,13 +60,29 @@ const logout = () => { router.push('/login') } +const weather = ref("暂无天气信息") +const initWeather = (city = 510500) => { + axios.get(`https://restapi.amap.com/v3/weather/weatherInfo?city=${city}&key=5731d3b4c3f34e09226e084ce556e259`).then((res) => { + if (res.data.status == 1) { + weather.value = res.data.lives[0].weather; + } + }).catch((e) => { + console.log(e); + }) +} + +// 选择时间 +const changeTime = (e) => { + console.log(e); +} onMounted(() => { - mitt.emit('map_info', info); // 每秒钟更新一次时间 setInterval(updateClock, 1000); + + initWeather(); }) @@ -76,8 +94,9 @@ onMounted(() => { src="/src/assets/head_img/logo.png" @click="navToDelivery" /> -
{{ nowTime[0] }}
- + + +
{{ nowTime[1] }}
吟龙养殖溯源系统可视化大屏
@@ -95,7 +114,7 @@ onMounted(() => {
- 多云 + {{ weather }}
@@ -116,6 +135,7 @@ onMounted(() => { height: 60px; align-items: center; position: relative; + font-size: 1rem; .img { position: absolute; bottom: -10%; @@ -137,6 +157,7 @@ onMounted(() => { line-height: 50rpx; } .left { + align-self: flex-end; display: flex; justify-content: left; align-items: center; @@ -151,6 +172,7 @@ onMounted(() => { } } .right { + align-self: flex-end; display: flex; flex: 1; justify-content: right; diff --git a/src/view/delivery/components/left.vue b/src/view/delivery/components/left.vue index b7903c6..a3bc196 100644 --- a/src/view/delivery/components/left.vue +++ b/src/view/delivery/components/left.vue @@ -8,14 +8,28 @@ const initCircle = () => { let color = ['#00A8FF', '#4B5FDB', '#00FFCB', '#5BDBF6']; let data = [ - { value: 400, name: '种类: 本地鸡' }, - { value: 435, name: '种类: 鸭' }, - { value: 580, name: '种类: 鹅' }, - { value: 884, name: '种类: 猪' }, + { value: 400, name: '本地鸡' }, + { value: 435, name: '鸭' }, + { value: 580, name: '鹅' }, + { value: 884, name: '猪' }, ] let option = { tooltip: { - trigger: 'item', + trigger: "item", + backgroundColor: 'rgba(0, 156, 255, 0.6)', //设置背景颜色 + textStyle: { + color: '#fff' + }, + borderColor: "rgba(0, 156, 255, 1)", + axisPointer: { + type: 'shadow', + shadowStyle: { + color: 'rgba(255,255,255, .2)', + } + }, + formatter: function (params) { + return params.data.name + ': ' + params.data.value; + } }, color: color, legend: { @@ -27,6 +41,9 @@ const initCircle = () => { textStyle: { color: "#fff" }, + formatter: function (params) { + return '种类: ' + params; + } }, series: [ {