From c9663bb3bae1440303c682ee6cbea2ce74395cce Mon Sep 17 00:00:00 2001 From: zk Date: Mon, 11 Dec 2023 13:25:13 +0800 Subject: [PATCH] update --- .env.development | 2 +- src/assets/less/index.less | 45 +++++++++++++++ src/components/chinaMap/chinaMap.vue | 4 +- src/components/secondaryScreen/commonApi.ts | 7 +++ .../secondaryScreen/secondMap/secondMap.vue | 20 ++++--- .../secondMap/secondMapHooks.ts | 55 +++++++++++++++++++ src/views/indexSon.vue | 49 +++++++++-------- 7 files changed, 149 insertions(+), 33 deletions(-) create mode 100644 src/components/secondaryScreen/commonApi.ts diff --git a/.env.development b/.env.development index b69634e..95ea17c 100644 --- a/.env.development +++ b/.env.development @@ -1,2 +1,2 @@ // 王昊地址 -VITE_GLOB_API_URL=http://192.168.1.16 \ No newline at end of file +VITE_GLOB_API_URL=http://192.168.1.6 \ No newline at end of file diff --git a/src/assets/less/index.less b/src/assets/less/index.less index 43ff20b..62535eb 100644 --- a/src/assets/less/index.less +++ b/src/assets/less/index.less @@ -57,6 +57,51 @@ background-color: rgba(0, 0, 0, 0.3); } +.ant-select-dropdown { + background-color: #00152b !important; + border-right: 1px solid #1b7ef2; + border-left: 1px solid #1b7ef2; + border-bottom: 1px solid #1b7ef2; +} + +.ant-select-item { + color: #1b7ef2 !important; +} + +//框背景色 +.ant-select:not(.ant-select-customize-input) .ant-select-selector { + color: #1b7ef2 !important; + background-color: transparent !important; + border: 1px solid #1b7ef2 !important; +} + +.ant-select-item-option-selected { + color: #ffffff !important; +} + +// 选中字体颜色 +.ant-select-selection-item { + //color: #1b7ef2 !important; + color: #fff; +} + +.ant-select-item-option-active { + background-color: transparent !important; +} + +.ant-select-item-option-active:hover { + background-color: #002e64 !important; +} + +// 箭头颜色 +.ant-select-arrow { + color: #1b7ef2 !important; +} + +.ant-select-item-option-selected:not(.ant-select-item-option-disabled) { + background-color: #002e64 !important; +} + //直升机 .helicopter { width: 60px; diff --git a/src/components/chinaMap/chinaMap.vue b/src/components/chinaMap/chinaMap.vue index 0a02226..4d2c5cf 100644 --- a/src/components/chinaMap/chinaMap.vue +++ b/src/components/chinaMap/chinaMap.vue @@ -396,7 +396,6 @@ flex: 1; height: calc(100% + 22px); margin: 10px 0; - //border: 1px solid red; } .map-legend { @@ -404,7 +403,6 @@ bottom: 15px; left: 10px; width: 200px; - //border: 1px solid red; display: flex; flex-wrap: wrap; @@ -458,4 +456,4 @@ } } } - + \ No newline at end of file diff --git a/src/components/secondaryScreen/commonApi.ts b/src/components/secondaryScreen/commonApi.ts new file mode 100644 index 0000000..5d2100c --- /dev/null +++ b/src/components/secondaryScreen/commonApi.ts @@ -0,0 +1,7 @@ +import { get } from '/@/api/request.ts'; + +export enum Api { + depart = 'sys/sysDepart/allSecondaryDeparts', +} + +export const allSecondaryDeparts = () => get(Api.depart); \ No newline at end of file diff --git a/src/components/secondaryScreen/secondMap/secondMap.vue b/src/components/secondaryScreen/secondMap/secondMap.vue index bb7f8c5..a707ae1 100644 --- a/src/components/secondaryScreen/secondMap/secondMap.vue +++ b/src/components/secondaryScreen/secondMap/secondMap.vue @@ -2,14 +2,11 @@
- - - - - - + +
+
+
-
@@ -45,8 +42,17 @@ position: relative; } + .form-container { + position: absolute; + //right: 9px; + right: 0; + top: 17px; + z-index: 1; + } + .mapContainer { flex: 1; + height: calc(100% + 22px); margin: 10px 0; } } diff --git a/src/components/secondaryScreen/secondMap/secondMapHooks.ts b/src/components/secondaryScreen/secondMap/secondMapHooks.ts index a13656e..e7436e2 100644 --- a/src/components/secondaryScreen/secondMap/secondMapHooks.ts +++ b/src/components/secondaryScreen/secondMap/secondMapHooks.ts @@ -13,3 +13,58 @@ // }, // ]; +import {onMounted, ref} from "vue"; +import {allSecondaryDeparts} from "/@/components/secondaryScreen/commonApi"; + +export function useDepart({selectOption = [],}) { + const orgCode = ref(); + const option = ref([]); + const fieldNames = {label: 'departName', value: 'orgCode',} + onMounted(() => { + if (selectOption && Array.isArray(selectOption) && selectOption.length > 0) { + setOption(selectOption); + } else { + getOptionData(); + } + }); + + function setOption(option) { + option.value = selectOption || option; + } + + async function getOptionData() { + const {result, code} = await allSecondaryDeparts(); + if (code == 200) { + option.value = result; + } + } + + return { + orgCode, + option, + setOption, + fieldNames + }; +} + +export function useTimeType(t) { + const type = ref(t || '') + const timeRangeOption = [ + { + label: '近一周', + value: 'week' + }, + { + label: '近一月', + value: 'month' + }, + { + label: '近一年', + value: 'year' + } + ] + return { + type, + timeRangeOption + } +} \ No newline at end of file diff --git a/src/views/indexSon.vue b/src/views/indexSon.vue index c97a1c7..368fc9b 100644 --- a/src/views/indexSon.vue +++ b/src/views/indexSon.vue @@ -19,7 +19,18 @@
- + + +
@@ -36,12 +47,12 @@ import OneR from '/@/components/secondaryScreen/screen-right/oneR.vue'; import TwoR from '/@/components/secondaryScreen/screen-right/twoR.vue'; import ThreeR from '/@/components/secondaryScreen/screen-right/threeR.vue'; - import SecondMap from '/@/components/secondaryScreen/secondMap/secondMap.vue'; - import * as dayjs from 'dayjs'; + import SecondMap from '/@/components/secondaryScreen/secondMap/secondMap'; import router from '/@/router'; import ItemD from '/@/components/item-d/item-d.vue'; + import { useDepart, useTimeType } from '/@/components/secondaryScreen/secondMap/secondMapHooks.ts'; + import { useTopTime } from '/@/utils/utils.ts'; - const dayTimeO = ref(); const dayTimeT = ref(); const dataList = ref([ { @@ -94,31 +105,19 @@ }, 1000); } - function getTime() { - dayTimeO.value = dayjs().format('YYYY年MM月DD日 HH时mm分ss秒'); - dayTimeT.value = - dayjs().diff(dayjs('2018-10-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')) + - '秒'; - } + init(); - function getZero(num: any) { - if (num < 10) { - return '0' + num; - } - return num; + function getTime() { + const { timeRight } = useTopTime(); + dayTimeT.value = timeRight; } function clickBack() { router.go(-1); } - init(); + const { orgCode, option, fieldNames } = useDepart({}); + const { type, timeRangeOption } = useTimeType('week');