This commit is contained in:
lcw
2025-10-09 21:32:38 +08:00
parent 857b1afe46
commit 2d98c8480c
126 changed files with 713 additions and 256 deletions

View File

@ -1,11 +1,6 @@
<template>
<div class="homeBox">
<GdMap></GdMap>
<!-- 头部 -->
<Head></Head>
@ -20,18 +15,18 @@
<div class="asideL-bottom">
<div class="common-title">人员预警</div>
<div class="comom-cnt">
<!-- <Warning></Warning> -->
<PeoWarning />
</div>
</div>
<div class="asideL-bottom">
<div class="common-title">车辆预警</div>
<div class="comom-cnt">
<!-- <Warning></Warning> -->
<CarWarning />
</div>
</div>
</div>
<!-- <Warning></Warning> -->
<!-- 右边 内容-->
<div class="home-aside asideR">
<div class="asideL-top">
@ -105,7 +100,7 @@ onMounted(() => {
const getsxtGetList = () => {
ysSxtGetList().then(res => {
emitter.emit("deletePointArea", "jczMap_Gzy");
emitter.emit("addPointArea", {
emitter.emit("addPoint", {
coords: res,
icon: require("@/assets/point/sp.png"),
flag: "jczMap_Gzy"

View File

@ -37,6 +37,7 @@ import {
onUnmounted,
getCurrentInstance
} from "vue";
import zbbb from "./zbbb.vue";
const { proxy } = getCurrentInstance();
const {
@ -56,7 +57,6 @@ const {
"D_QW_BBZT",
"D_QW_BC_KTS"
);
import zbbb from "./zbbb.vue";
const props = defineProps({
title: {
type: String,

View File

@ -85,6 +85,7 @@
<div class="num">
{{ mjData ? mjData.length : 0 }}
</div>
<!-- <el-button size="small" type="primary" @click="openMfjDialog">添加民警</el-button> -->
<ChooseTable :deptment="deptment" v-if="!isDetail" :dic="props.dic" :configer="{
lx: 'mj',
rowKey: 'ryid',
@ -212,6 +213,7 @@
</div>
</el-form>
</div>
<ChoosePersonnel v-model="showMfDialog" @choose="chooseDataGzy" />
</template>
<script setup>
@ -221,6 +223,7 @@ import { jczqueryById } from "@/api/mosty-jcz";
import { jczsavel, Xfbbupdate } from "@/api/mosty-jcz.js";
import { ElMessage } from "element-plus";
import ChooseTable from "@/components/chooseList/chooseTable.vue";
import ChoosePersonnel from "@/components/chooseList/choosePersonnel.vue";
import { timeValidate } from "@/utils/tools.js";
import { useRoute } from "vue-router";
import emitter from "@/utils/eventBus.js";
@ -290,7 +293,6 @@ const init = (type) => {
pageType.value = type;
dialogForm.value = true;
// 根据type和row初始化表单数据
console.log(props.row, "=====================================");
if (props.row) {
listQuery.value = { ...props.row };
@ -321,8 +323,6 @@ watch(
const routerList = ref({})
onMounted(() => {
init();
console.log(route.query);
routerList.value = route.query
});
// 验证规则
@ -451,6 +451,16 @@ const changeDep = (val) => {
const changeJCZ = (val) => {
console.log(val);
};
// 获取民辅警
const showMfDialog = ref(false)
// 打开民辅警弹窗
const openMfjDialog = () => {
}
const chooseDataGzy = (val) => {
mjData.value = val.filter((item) => item.fl == "01");
fjData.value = val.filter((item) => item.fl == "02");
};
</script>
<style lang="scss" scoped>

View File

@ -3,7 +3,7 @@
<script setup>
import { ref, onMounted } from "vue";
import { useStore } from "vuex";
import { useRouter } from "vue-router";
import { useRouter,useRoute } from "vue-router";
import {
setItem
} from "@/utils/storage";
@ -11,13 +11,17 @@ const loginDialog = ref(false);
const deptList = ref([]);
const store = useStore();
function redirectAuth() {
let token = location.hash.slice(20) || null;
// 从路由参数中获取token
const route = useRoute();
let token = route.query.token || null;
console.log(token,"xxxxxxxx");
if (token != null) {
token = token.replace(/\ +/g, "");
setItem("SSOTOKEN", token)
handleLogin({ token: token});
} else {
window.location.href = `http://155.240.22.102:40992`;
window.location.href = `http://155.240.22.188:9020`;
}
}

View File

@ -0,0 +1,69 @@
<template>
<div class="sso-redirect-container">
<div class="loading-wrapper">
<div class="loading-text">正在跳转...</div>
</div>
</div>
</template>
<script setup>
import { onMounted } from "vue";
import { useRoute,useRouter } from "vue-router";
import { getItem, setItem } from "@/utils/storage";
const route = useRoute();
const router = useRouter();
// 获取路由参数url
const getUrlParam = () => {
return route.query.url || '';
};
// 检查token并进行跳转
const checkTokenAndRedirect = () => {
// 获取路由参数url
const redirectUrl = getUrlParam();
// 检查localStorage中是否存在token
const token = getItem('SSOTOKEN') || getItem('token');
if (token) {
// 如果存在token直接跳转到url参数指定的地址
if (redirectUrl) {
router.push(redirectUrl);
} else {
// 如果没有url参数跳转到首页
router.push("/");
}
} else {
setItem("FounderUrl", redirectUrl);
// 如果不存在token跳转到SSO登录地址
window.location.href = "http://192.168.0.231:8006/mosty-api/mosty-base/fzSsoLogin";
}
};
// 页面挂载时执行检查
onMounted(() => {
checkTokenAndRedirect();
});
</script>
<style scoped>
.sso-redirect-container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f5f5f5;
}
.loading-wrapper {
text-align: center;
}
.loading-text {
font-size: 16px;
color: #666;
margin-top: 20px;
}
</style>

View File

@ -0,0 +1,82 @@
<template></template>
<script setup>
import { ref, onMounted } from "vue";
import { useStore } from "vuex";
import {
getCookie
} from "@/utils/cookie";
import {
setItem
} from "@/utils/storage";
import { getSessionForSfzh, idCardNoLogin } from "@/api/user-manage";
import {useRouter} from 'vue-router'
import {
setTimeStamp
} from "@/utils/auth";
const store = useStore();
function redirectAuth() {
handleLogin();
}
const router = useRouter()
const handleLogin = (e) => {
// 先尝试获取cookie中的clientKey
const token = getCookie("clientKey");
if (token) {
// 使用clientKey获取会话信息
getSessionForSfzh({ cookie: token }).then((res) => {
// 使用获取到的idEntityCard进行免登
idCardNoLogin({
idCardNo: res
}).then((resIdCard) => {
// 登录成功后设置token和用户信息到store
store.commit("user/setToken", resIdCard.jwtToken);
store.commit("user/setDeptList", resIdCard.deptList);
store.commit("user/setUserName", resIdCard.userName);
store.commit("user/setMenuList", resIdCard.menuList);
store.commit("user/setUserInfo", {
token: resIdCard.jwtToken,
permission: {
buttonPermission: ["removeTest", "viewTest"],
menus: resIdCard.menuCodeSet
},
menuList: resIdCard.menuList,
deptList: resIdCard.deptList
});
// 保存用户信息到本地存储
setItem("USERNAME", resIdCard.userName);
setItem("SFRH", resIdCard.sfrh);
setItem("USERID", resIdCard.userId);
setItem("menusPermission", resIdCard.menuCodeSet);
setItem("idEntityCard", resIdCard.idEntityCard);
setItem("deptId", resIdCard.deptList);
// 保存登录时间
setTimeStamp();
// 重定向到首页
setTimeout(() => {
window.location.hash = "/";
router.push("/");
}, 1000);
}).catch((error) => {
console.error("免登失败:", error);
// 免登失败时重定向到登录页面
// window.location.hash = "/login";
});
}).catch((error) => {
console.error("获取会话信息失败:", error);
// 获取会话信息失败时重定向到登录页面
// window.location.hash = "/login";
});
} else {
console.error("没有找到clientKey cookie");
// 没有cookie时重定向到登录页面
window.location.hash = "/login";
}
};
onMounted(() => {
redirectAuth();
});
</script>
<style></style>