update
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<slot name="rightForm"></slot>
|
||||
</div>
|
||||
<div style="flex: 1; overflow: hidden; margin: 0 0 10px; height: 100%">
|
||||
<div id="mapContainer" class="mapContainer"></div>
|
||||
<div id="mapSecondMap" class="mapSecondMap"></div>
|
||||
</div>
|
||||
<div v-show="false" id="container"></div>
|
||||
<div v-show="false" id="panel"></div>
|
||||
@@ -53,8 +53,8 @@
|
||||
const { isShow, className, setIsShow } = useMoveClass();
|
||||
|
||||
function init() {
|
||||
let mapContainer = document.querySelector('.mapContainer');
|
||||
mapContainer && Map.initMap({ el: 'mapContainer' });
|
||||
let mapContainer = document.querySelector('.mapSecondMap');
|
||||
mapContainer && Map.initMap({ el: 'mapSecondMap' });
|
||||
getMapList();
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.mapContainer {
|
||||
.mapSecondMap {
|
||||
height: calc(100% + 20px);
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ export function useDepart() {
|
||||
};
|
||||
}
|
||||
|
||||
export function useTimeType(t) {
|
||||
export function useTimeType(t: string) {
|
||||
const type = ref(t || '');
|
||||
const timeRangeOption = [
|
||||
{
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
import { onMounted, onUnmounted, ref } from 'vue';
|
||||
import { isFunction } from '/@/utils/is.ts';
|
||||
|
||||
export function useRefresh(time = 3000, callback) {
|
||||
/**
|
||||
* @desc 定时刷新
|
||||
* @param time
|
||||
* @param callback
|
||||
*/
|
||||
|
||||
export function useRefresh(time = 3000, callback?: Function) {
|
||||
const refreshState = ref(false);
|
||||
const timer = ref(null);
|
||||
|
||||
function setRefreshState() {
|
||||
timer.value = setInterval(() => {
|
||||
refreshState.value = !refreshState.value;
|
||||
callback();
|
||||
}, time);
|
||||
startRefresh();
|
||||
}
|
||||
|
||||
function stopRefresh() {
|
||||
@@ -16,6 +20,15 @@ export function useRefresh(time = 3000, callback) {
|
||||
timer.value = null;
|
||||
}
|
||||
|
||||
function startRefresh() {
|
||||
timer.value = setInterval(() => {
|
||||
refreshState.value = !refreshState.value;
|
||||
if (callback && isFunction(callback)) {
|
||||
callback();
|
||||
}
|
||||
}, time);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (timer.value != null) {
|
||||
timer.value = null;
|
||||
@@ -29,5 +42,6 @@ export function useRefresh(time = 3000, callback) {
|
||||
return {
|
||||
refreshState,
|
||||
stopRefresh,
|
||||
startRefresh,
|
||||
};
|
||||
}
|
||||
@@ -1,3 +1,7 @@
|
||||
export default {
|
||||
//预警
|
||||
};
|
||||
// 更新频率
|
||||
const BASIC_MIN = 60 * 1000; //1min
|
||||
const BASIC_SECOND = 1000; //1s
|
||||
//副屏 心率、血氧、压力、睡眠、步数
|
||||
export const DEFAULT_TIME = BASIC_MIN * 10;
|
||||
//预警分页切换
|
||||
export const PAGE_SWITCH = BASIC_SECOND * 3;
|
||||
|
||||
+3
-2
@@ -1,4 +1,4 @@
|
||||
import { createApp } from 'vue';
|
||||
import {createApp} from 'vue';
|
||||
import App from './App.vue';
|
||||
import './assets/less/index.less';
|
||||
import router from './router';
|
||||
@@ -6,7 +6,8 @@ import router from './router';
|
||||
import('ant-design-vue/dist/antd.less');
|
||||
import registerGlobComp from './assets/ts/antd.ts';
|
||||
import directiveMethods from './assets/ts/directive';
|
||||
import { setupStore } from './store/index.ts';
|
||||
import {setupStore} from './store/index.ts';
|
||||
|
||||
|
||||
const app = createApp(App);
|
||||
// 注册自定义事件
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import * as dayjs from 'dayjs';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
export function getZero(num: any) {
|
||||
if (num < 10) {
|
||||
|
||||
+20
-34
@@ -25,16 +25,14 @@
|
||||
class="type-select"
|
||||
:options="option"
|
||||
:field-names="fieldNames"
|
||||
@change="orgChange"
|
||||
></a-select>
|
||||
<!-- <a-cascader v-model:value="treeValue" :options="treeOption" placeholder="选择单位" :open="true" :changeOnSelect="true" />-->
|
||||
<a-select placeholder="选择时间范围" v-model:value="type" class="type-select" :options="timeRangeOption"></a-select>
|
||||
</template>
|
||||
</SecondMap>
|
||||
</div>
|
||||
<div class="body-d-right">
|
||||
<one-r :orgCode="orgCode" :type="type" :key="refreshState" />
|
||||
<two-r :orgCode="orgCode" :type="type" />
|
||||
<two-r :orgCode="orgCode" :type="type" :key="refreshState" />
|
||||
<three-r :orgCode="orgCode" :type="type" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -43,22 +41,33 @@
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { RollbackOutlined } from '@ant-design/icons-vue';
|
||||
import { nextTick, onMounted, ref, watch } from 'vue';
|
||||
import { nextTick, onMounted, ref } from 'vue';
|
||||
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';
|
||||
import SecondMap from '/@/components/secondaryScreen/secondMap/secondMap.vue';
|
||||
import screenLeft from '/@/components/secondaryScreen/screen-left/screenLeft.vue';
|
||||
import router from '/@/router';
|
||||
import { useDepart, useTimeType, useTree } from '/@/components/secondaryScreen/secondMap/secondMapHooks.ts';
|
||||
import { useDepart, useTimeType } from '/@/components/secondaryScreen/secondMap/secondMapHooks.ts';
|
||||
import { useTopTime } from '/@/utils/utils.ts';
|
||||
import { useUserStore } from '/@/store/modules/user.ts';
|
||||
import { useRefresh } from '/@/hooks/autoRefresh';
|
||||
import { DEFAULT_TIME } from '/@/hooks/autoRefresh/pageRefreshTime.ts';
|
||||
|
||||
const { refreshState } = useRefresh(3000);
|
||||
|
||||
const { refreshState } = useRefresh(DEFAULT_TIME);
|
||||
const useStore = useUserStore();
|
||||
const dayTimeT = ref();
|
||||
const { orgCode, option, fieldNames, setOrgCode } = useDepart();
|
||||
onMounted(() => {
|
||||
const userInfo = useStore.getUserInfo;
|
||||
let orgCode = userInfo?.secondDepart?.orgCode;
|
||||
if (orgCode) {
|
||||
nextTick(() => {
|
||||
setOrgCode(orgCode);
|
||||
});
|
||||
}
|
||||
init();
|
||||
});
|
||||
const { type, timeRangeOption } = useTimeType('week');
|
||||
|
||||
function init() {
|
||||
getTime();
|
||||
@@ -67,6 +76,8 @@
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
const dayTimeT = ref();
|
||||
|
||||
function getTime() {
|
||||
const { timeRight } = useTopTime();
|
||||
dayTimeT.value = timeRight;
|
||||
@@ -75,31 +86,6 @@
|
||||
function clickBack() {
|
||||
router.go(-1);
|
||||
}
|
||||
|
||||
const { orgCode, option, fieldNames, setOrgCode } = useDepart({});
|
||||
// const reloadPage = ref(true);
|
||||
onMounted(() => {
|
||||
const userInfo = useStore.getUserInfo;
|
||||
console.log('465', userInfo);
|
||||
let orgCode = userInfo?.secondDepart?.orgCode;
|
||||
console.log('9999', orgCode);
|
||||
if (orgCode) {
|
||||
nextTick(() => {
|
||||
setOrgCode(orgCode);
|
||||
init();
|
||||
});
|
||||
}
|
||||
// setInterval(() => {
|
||||
// reloadPage.value = !reloadPage.value;
|
||||
// }, 3000);
|
||||
});
|
||||
|
||||
function orgChange(val, option) {
|
||||
console.log('val', val);
|
||||
console.log('option', option);
|
||||
}
|
||||
|
||||
const { type, timeRangeOption } = useTimeType('week');
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.outer {
|
||||
|
||||
Reference in New Issue
Block a user