update
This commit is contained in:
+3
-1
@@ -6,6 +6,7 @@ import { TOKEN_KEY } from '/@/enum/cacheEnum.ts';
|
||||
import { useMessage } from '/@/hooks/web/useMessage.ts';
|
||||
import { checkStatus } from '/@/api/checkStatus.ts';
|
||||
import router from '/@/router';
|
||||
import { getBaseLogin } from '/@/enum/pageEnum.ts';
|
||||
|
||||
const { createMessage, createErrorModal } = useMessage();
|
||||
const { VITE_GLOB_API_URL } = getAppEnvConfig();
|
||||
@@ -32,8 +33,9 @@ service.interceptors.response.use(
|
||||
if (error.response) {
|
||||
switch (error.response.data.code) {
|
||||
case 401:
|
||||
let path = getBaseLogin();
|
||||
router.replace({
|
||||
path: '/login',
|
||||
path: path,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ export const Map = {
|
||||
}).then((res) => {
|
||||
AMap = res;
|
||||
const { zoom, center, mapStyle } = { ...defaultOption, ...option };
|
||||
console.log('option', option, center);
|
||||
//基本地图加载
|
||||
this.map = new AMap.Map(el, {
|
||||
resizeEnable: true,
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// 地图默认配置
|
||||
// 西安地图默认配置
|
||||
export const defaultOption = {
|
||||
center: [108.660704, 36.386058], //地图中心点
|
||||
// center: [108.660704, 36.386058], //地图中心点
|
||||
zoom: 6.5, //地图显示的缩放级别
|
||||
mapStyle: 'darkblue', //地图样式
|
||||
};
|
||||
// 地图key
|
||||
export const mapKey = '4bbcb216b889f2d612cbed05ae6979c8'
|
||||
export const mapKey = '4bbcb216b889f2d612cbed05ae6979c8';
|
||||
export const mapPlugin = ['AMap.ToolBar', 'AMap.Driving', 'AMap.GeoJSON', 'AMap.MarkerCluster', 'AMap.PlaceSearch'];
|
||||
|
||||
//根据数据量设置地图层级
|
||||
export function getZoom(list = []) {
|
||||
let len = list.length
|
||||
let len = list.length;
|
||||
// console.log('len', len)
|
||||
if (len <= 5) {
|
||||
return 7.5;
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
setTimeout(() => {
|
||||
setSpin(false);
|
||||
}, 1000);
|
||||
getList();
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
@@ -54,7 +55,7 @@
|
||||
async function getList() {
|
||||
setSpin(true);
|
||||
try {
|
||||
const { code, result } = (await getDetail({ dataType: props.setting.dataType })) || {};
|
||||
const { code, result } = (await getDetail({ dataType: props.setting.dataType, condition: selectIndex.value })) || {};
|
||||
setSpin(!spinning.value);
|
||||
if (code != 200) {
|
||||
return;
|
||||
|
||||
@@ -51,20 +51,8 @@
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
document.addEventListener('visibilitychange', checkTabState);
|
||||
init();
|
||||
});
|
||||
onUnmounted(() => {
|
||||
document.removeEventListener('visibilitychange', checkTabState);
|
||||
});
|
||||
const tabState = ref('');
|
||||
|
||||
function checkTabState() {
|
||||
console.log('checkTabState', document.hidden);
|
||||
tabState.value = document.hidden ? 'inactive' : 'active';
|
||||
if (!document.hidden) {
|
||||
}
|
||||
}
|
||||
|
||||
function init() {
|
||||
getDepartOption();
|
||||
|
||||
@@ -137,7 +137,6 @@
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
console.log('reload');
|
||||
Map.initMap({ el: 'mapContainer' }).then(() => {
|
||||
getMapData(tabList[0].type);
|
||||
Map.map && Map.map.on('zoomend', setLevel);
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</a-table>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { nextTick, onMounted, ref, watch } from 'vue';
|
||||
import { nextTick, ref, watch } from 'vue';
|
||||
import { isFunction } from '/@/utils/is.ts';
|
||||
|
||||
const props = defineProps({
|
||||
@@ -81,6 +81,7 @@
|
||||
dataSource.value = result?.records;
|
||||
}
|
||||
paginationProp.value = { ...paginationProp.value, ...result };
|
||||
paginationProp.value.pageSize = result.size;
|
||||
}
|
||||
} finally {
|
||||
tableLoading.value = false;
|
||||
|
||||
+12
-1
@@ -1,4 +1,15 @@
|
||||
export enum PageEnum {
|
||||
// basic login path
|
||||
BASE_LOGIN = '/login',
|
||||
BASE_LOGIN = '/login', //西安登录页
|
||||
BASE_HOME = '/home', //西安首页
|
||||
BASE_LOGIN_YINCHUAN = '/screenLogin', //银川登录页
|
||||
YINCHUAN_HOME = '/yinChuanHome', //银川
|
||||
}
|
||||
|
||||
export function setBaseLogin(baseLogin) {
|
||||
sessionStorage.setItem('baseLogin', baseLogin);
|
||||
}
|
||||
|
||||
export function getBaseLogin() {
|
||||
return sessionStorage.getItem('baseLogin');
|
||||
}
|
||||
|
||||
@@ -14,6 +14,14 @@ const routes: Array<RouteRecordRaw> = [
|
||||
},
|
||||
component: () => import('/@/views/sys/login.vue'),
|
||||
},
|
||||
{
|
||||
path: '/screenLogin',
|
||||
name: 'screenLogin',
|
||||
meta: {
|
||||
title: '登录',
|
||||
},
|
||||
component: () => import('/@/views/sys/login.vue'),
|
||||
},
|
||||
{
|
||||
path: '/home',
|
||||
name: 'index',
|
||||
@@ -38,6 +46,14 @@ const routes: Array<RouteRecordRaw> = [
|
||||
},
|
||||
component: () => import('/@/views/indexSon.vue'),
|
||||
},
|
||||
{
|
||||
path: '/transfer',
|
||||
name: 'transfer',
|
||||
meta: {
|
||||
title: '应急大屏',
|
||||
},
|
||||
component: () => import('/@/views/transfer.vue'),
|
||||
},
|
||||
];
|
||||
|
||||
const router: Router = createRouter({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { loginApi, getUserInfo, doLogout } from '/@/api/user.ts';
|
||||
import { TOKEN_KEY, USER_INFO_KEY } from '/@/enum/cacheEnum.ts';
|
||||
import { PageEnum } from '/@/enum/pageEnum.ts';
|
||||
import { getBaseLogin, PageEnum } from '/@/enum/pageEnum.ts';
|
||||
import { getAuthCache, setAuthCache } from '/@/utils/auth.ts';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
@@ -94,7 +94,8 @@ export const useUserStore = defineStore({
|
||||
this.setUserInfo(null);
|
||||
this.setLoginInfo(null);
|
||||
console.log('goLogin', goLogin);
|
||||
goLogin && router.replace({ path: PageEnum.BASE_LOGIN });
|
||||
let path = getBaseLogin();
|
||||
goLogin && router.replace({ path: path });
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { computed, nextTick, ref, watch } from 'vue';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import Dialog from '/@/components/dialog/Dialog.vue';
|
||||
import { useDialog } from '/@/views/components/dialogHooks.ts';
|
||||
import BasicTable from '/@/components/secondaryScreen/secondMap/components/basicTable/BasicTable.vue';
|
||||
@@ -91,15 +91,9 @@
|
||||
}));
|
||||
const { visible, title, closeDialog, openDialog } = useDialog({ title: props.title });
|
||||
const registerTable = ref();
|
||||
watch(
|
||||
props,
|
||||
() => {
|
||||
registerTable.value?.getRecords();
|
||||
}
|
||||
// {
|
||||
// immediate: true,
|
||||
// }
|
||||
);
|
||||
watch(props, () => {
|
||||
registerTable.value?.getRecords();
|
||||
});
|
||||
defineExpose({
|
||||
openDialog,
|
||||
});
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@
|
||||
|
||||
const tabState = ref('');
|
||||
|
||||
//判断窗口是否处于激活状态,切换浏览器tab会导致部门echarts显示不正常
|
||||
//判断窗口是否处于激活状态,切换浏览器tab会导致部分echarts显示不正常
|
||||
function checkTabState() {
|
||||
tabState.value = document.hidden ? 'inactive' : 'active';
|
||||
}
|
||||
|
||||
+15
-3
@@ -14,7 +14,7 @@
|
||||
</div>
|
||||
<div class="body-d">
|
||||
<div class="body-d-left">
|
||||
<screen-left :orgCode="orgCode" :type="type" :refreshState="refreshState" />
|
||||
<screen-left :key="tabState" :orgCode="orgCode" :type="type" :refreshState="refreshState" />
|
||||
</div>
|
||||
<div class="body-d-middle">
|
||||
<SecondMap :orgCode="orgCode" :type="type">
|
||||
@@ -31,8 +31,8 @@
|
||||
</SecondMap>
|
||||
</div>
|
||||
<div class="body-d-right">
|
||||
<one-r :orgCode="orgCode" :type="type" :refreshState="refreshState" />
|
||||
<two-r :orgCode="orgCode" :type="type" :refreshState="refreshState" />
|
||||
<one-r :key="tabState" :orgCode="orgCode" :type="type" :refreshState="refreshState" />
|
||||
<two-r :key="tabState" :orgCode="orgCode" :type="type" :refreshState="refreshState" />
|
||||
<three-r :orgCode="orgCode" :type="type" :refreshState="refreshState" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -53,6 +53,7 @@
|
||||
import { useUserStore } from '/@/store/modules/user.ts';
|
||||
import { useRefresh } from '/@/hooks/autoRefresh';
|
||||
import { DEFAULT_TIME } from '/@/hooks/autoRefresh/pageRefreshTime.ts';
|
||||
import { onUnmounted } from 'vue';
|
||||
|
||||
const { refreshState } = useRefresh(DEFAULT_TIME);
|
||||
const useStore = useUserStore();
|
||||
@@ -66,7 +67,18 @@
|
||||
});
|
||||
}
|
||||
init();
|
||||
document.addEventListener('visibilitychange', checkTabState);
|
||||
});
|
||||
onUnmounted(() => {
|
||||
document.removeEventListener('visibilitychange', checkTabState);
|
||||
});
|
||||
const tabState = ref('');
|
||||
|
||||
//判断窗口是否处于激活状态,切换浏览器tab会导致部分echarts显示不正常
|
||||
function checkTabState() {
|
||||
tabState.value = document.hidden ? 'inactive' : 'active';
|
||||
}
|
||||
|
||||
const { type, timeRangeOption } = useTimeType('week');
|
||||
|
||||
function init() {
|
||||
|
||||
@@ -98,12 +98,14 @@
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { t } from '/@/hooks/locales/useLocales.ts';
|
||||
import { encipher } from '/@/utils/jsencrypt';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { getAuthCache } from '/@/utils/auth.ts';
|
||||
import { TOKEN_KEY } from '/@/enum/cacheEnum.ts';
|
||||
import { PageEnum, setBaseLogin } from '/@/enum/pageEnum.ts';
|
||||
|
||||
const router = useRouter();
|
||||
// console.log(t('login'));
|
||||
const route = useRoute();
|
||||
console.log('route', route);
|
||||
const prefixCls = 'mini-login';
|
||||
const { notification, createMessage } = useMessage();
|
||||
const userStore = useUserStore();
|
||||
@@ -188,7 +190,10 @@
|
||||
description: `${t('login.loginSuccessDesc')}: ${userInfo.realname}`,
|
||||
duration: 3,
|
||||
});
|
||||
router.replace({ path: '/home' });
|
||||
|
||||
let path = route.path == PageEnum.BASE_LOGIN_YINCHUAN ? PageEnum.YINCHUAN_HOME : PageEnum.BASE_HOME;
|
||||
setBaseLogin(route.path);
|
||||
router.replace({ path: path });
|
||||
}
|
||||
} catch (error) {
|
||||
notification.error({
|
||||
@@ -312,4 +317,4 @@
|
||||
.ant-btn-primary:not(.ant-btn-background-ghost):not([disabled]) {
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<template></template>
|
||||
<script setup lang="ts">
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { setBaseLogin } from '/@/enum/pageEnum.ts';
|
||||
import { getUserInfo } from '/@/api/user.ts';
|
||||
import { useUserStore } from '/@/store/modules/user.ts';
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const userStore = useUserStore();
|
||||
const { baseLogin, baseHome, msg } = JSON.parse(route.query.data);
|
||||
setBaseLogin(baseLogin);
|
||||
getUserInfo().then((res) => {
|
||||
const { code, result } = res;
|
||||
if (code == 200) {
|
||||
userStore.setToken(msg);
|
||||
userStore.setUserInfo(result.userInfo);
|
||||
router.push(baseHome);
|
||||
}
|
||||
});
|
||||
console.log('route', route);
|
||||
</script>
|
||||
<style scoped lang="less"></style>
|
||||
@@ -1,17 +1,16 @@
|
||||
<template>
|
||||
<Dialog :openVis="visible" width="50%" title="健康终端报警列表" @close="closeDialog" :maskClosable="false">
|
||||
<template #container>
|
||||
<BasicTable class="table-container" :columns="columns" :api="getPhoneList" :apiParams="formState"></BasicTable>
|
||||
<BasicTable ref="registerTable" class="table-container" :columns="columns" :api="getMonitorList" :apiParams="formState"></BasicTable>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import Dialog from '/@/components/dialog/Dialog.vue';
|
||||
import { useDialog } from '/@/views/components/dialogHooks.ts';
|
||||
import BasicTable from '/@/components/secondaryScreen/secondMap/components/basicTable/BasicTable.vue';
|
||||
import { SexType, sexTypeList } from '/@/utils/settings.ts';
|
||||
import { getPhoneList } from '/@/views/yinChuan/yinChuan.api.ts';
|
||||
import { getMonitorList } from '/@/components/body-d-right/right.api.ts';
|
||||
|
||||
const props = defineProps({
|
||||
record: Object,
|
||||
@@ -26,47 +25,52 @@
|
||||
const columns = [
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
dataIndex: 'realName',
|
||||
key: 'realName',
|
||||
},
|
||||
{
|
||||
title: '二级单位',
|
||||
dataIndex: 'department',
|
||||
key: 'department',
|
||||
dataIndex: 'orgName1',
|
||||
key: 'orgName1',
|
||||
},
|
||||
{
|
||||
title: '联系电话',
|
||||
dataIndex: 'sex',
|
||||
key: 'sex',
|
||||
dataIndex: 'phone',
|
||||
key: 'phone',
|
||||
},
|
||||
{
|
||||
title: '异常事件',
|
||||
dataIndex: 'time',
|
||||
key: 'time',
|
||||
dataIndex: 'eventType_dictText',
|
||||
key: 'eventType_dictText',
|
||||
},
|
||||
{
|
||||
title: '异常值',
|
||||
dataIndex: 'time',
|
||||
key: 'time',
|
||||
dataIndex: 'dataValue',
|
||||
key: 'dataValue',
|
||||
},
|
||||
{
|
||||
title: '发生时间',
|
||||
dataIndex: 'time',
|
||||
key: 'time',
|
||||
dataIndex: 'warnTime',
|
||||
key: 'warnTime',
|
||||
},
|
||||
{
|
||||
title: '发生地点',
|
||||
dataIndex: 'time',
|
||||
key: 'time',
|
||||
dataIndex: 'address',
|
||||
key: 'address',
|
||||
customRender: ({ record }) => {
|
||||
return record?.address || record?.gpsErrorMsg;
|
||||
},
|
||||
},
|
||||
];
|
||||
const formState = ref({
|
||||
sex: SexType.all,
|
||||
const formState = computed(() => ({
|
||||
dataType: props.setting.dataType,
|
||||
phoneType: props.phoneType,
|
||||
orgCode: props.setting?.orgCode,
|
||||
}));
|
||||
const { visible, closeDialog, openDialog } = useDialog({ title: props.title });
|
||||
const registerTable = ref();
|
||||
watch(props, () => {
|
||||
registerTable.value?.getRecords();
|
||||
});
|
||||
const { visible, title, closeDialog, openDialog } = useDialog({ title: props.title });
|
||||
|
||||
defineExpose({
|
||||
openDialog,
|
||||
});
|
||||
|
||||
@@ -3,7 +3,7 @@ import { get } from '/@/api/request';
|
||||
export enum Api {
|
||||
phoneList = '/health-emergency/emergency/tblUserHelp/phoneList',
|
||||
getWorkDaily = '/health-emergency/emergency/ycLargeScreen/medicalCenter',
|
||||
getTeamHealth = '/health-archives/archives/groupUserA/getGroupUserAInfo',
|
||||
getTeamHealth = '/health-emergency/emergency/ycLargeScreen/userHealthCenter',
|
||||
}
|
||||
|
||||
// 呼入电话、受理电话
|
||||
|
||||
@@ -49,7 +49,6 @@
|
||||
import { basicPath, emergencyPath, useSocket } from '/@/utils/socket.ts';
|
||||
import { useRefresh } from '/@/hooks/autoRefresh';
|
||||
import { DEFAULT_TIME } from '/@/hooks/autoRefresh/pageRefreshTime.ts';
|
||||
// import { useUserStore } from '/@/store/modules/user.ts';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { DataType, getSettings } from '/@/utils/settings.ts';
|
||||
import { ServerDetailType } from '/@/components/body-d-left/bodyLeftHooks.ts';
|
||||
@@ -57,14 +56,6 @@
|
||||
const route = useRoute();
|
||||
const setting = getSettings(DataType.yinChuan);
|
||||
onMounted(() => {
|
||||
// const userStore = useUserStore();
|
||||
// let data = JSON.parse(route.query.data as string);
|
||||
// if (data.token) {
|
||||
// localStorage.setItem('token', data.token);
|
||||
// userStore.setToken(data.token);
|
||||
// userStore.setUserInfo(data.userInfo);
|
||||
// console.log(useUserStore);
|
||||
// }
|
||||
init();
|
||||
document.addEventListener('visibilitychange', checkTabState);
|
||||
});
|
||||
@@ -74,7 +65,7 @@
|
||||
});
|
||||
const tabState = ref('');
|
||||
|
||||
//判断窗口是否处于激活状态,切换浏览器tab会导致部门echarts显示不正常
|
||||
//判断窗口是否处于激活状态,切换浏览器tab会导致部分echarts显示不正常
|
||||
function checkTabState() {
|
||||
tabState.value = document.hidden ? 'inactive' : 'active';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user