|
@@ -1,7 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<!-- <div>地图页面</div> -->
|
|
<!-- <div>地图页面</div> -->
|
|
<div class="tabbar">
|
|
<div class="tabbar">
|
|
- <div class="nav">
|
|
|
|
|
|
+ <!-- <div class="nav">
|
|
<el-button-group class="ml-4">
|
|
<el-button-group class="ml-4">
|
|
<el-button
|
|
<el-button
|
|
:type="currentType(0) ? 'primary' : 'default'"
|
|
:type="currentType(0) ? 'primary' : 'default'"
|
|
@@ -14,10 +14,26 @@
|
|
>卡片</el-button
|
|
>卡片</el-button
|
|
>
|
|
>
|
|
</el-button-group>
|
|
</el-button-group>
|
|
|
|
+ </div> -->
|
|
|
|
+ <div class="left">
|
|
|
|
+ <el-form-item label="" class="filter">
|
|
|
|
+ <com-company
|
|
|
|
+ v-model="(state.deptId as any as string)"
|
|
|
|
+ :id="state.caseId"
|
|
|
|
+ hideAll
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="right">
|
|
|
|
+ <el-select style="width: 100px" v-model:modelValue="currentMaptype">
|
|
|
|
+ <el-option key="2d" label="矢量图" :value="0" />
|
|
|
|
+ <el-option key="state" label="卫星图" :value="1" />
|
|
|
|
+ </el-select>
|
|
|
|
+ <el-select style="width: 100px" v-model:modelValue="current">
|
|
|
|
+ <el-option key="map" label="地图" :value="0" />
|
|
|
|
+ <el-option key="card" label="卡片" :value="1" />
|
|
|
|
+ </el-select>
|
|
</div>
|
|
</div>
|
|
- <el-form-item label="所属架构:" class="filter">
|
|
|
|
- <com-company v-model="state.deptId" :id="state.caseId" hideAll />
|
|
|
|
- </el-form-item>
|
|
|
|
</div>
|
|
</div>
|
|
<div ref="mapEl" class="map-container" v-show="currentType(0)"></div>
|
|
<div ref="mapEl" class="map-container" v-show="currentType(0)"></div>
|
|
<div class="card-container" v-show="currentType(1)">
|
|
<div class="card-container" v-show="currentType(1)">
|
|
@@ -56,6 +72,7 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
import { onMounted, ref, computed, onBeforeMount } from "vue";
|
|
import { onMounted, ref, computed, onBeforeMount } from "vue";
|
|
|
|
+import { getSysSetting } from "@/request";
|
|
// import { useRouteQuery } from "@vueuse/router";
|
|
// import { useRouteQuery } from "@vueuse/router";
|
|
import AMapLoader from "@amap/amap-jsapi-loader";
|
|
import AMapLoader from "@amap/amap-jsapi-loader";
|
|
import axios from "axios";
|
|
import axios from "axios";
|
|
@@ -68,15 +85,24 @@ import linkIco from "@/assets/image/fire.ico";
|
|
import { useUrlSearchParams } from "@vueuse/core";
|
|
import { useUrlSearchParams } from "@vueuse/core";
|
|
import emptyBG from "@/assets/image/empty__empty.png";
|
|
import emptyBG from "@/assets/image/empty__empty.png";
|
|
|
|
|
|
|
|
+import { changeThemeColor } from "./theme";
|
|
const params = useUrlSearchParams("history");
|
|
const params = useUrlSearchParams("history");
|
|
console.log("params", params.deptId);
|
|
console.log("params", params.deptId);
|
|
|
|
+// const el = ref(document.documentElement);
|
|
|
|
+
|
|
|
|
+// const primaryColor = useCssVar("--el-color-primary", document.documentElement);
|
|
|
|
+// primaryColor.value = "#00C8AF";
|
|
|
|
+// const primaryColor = useCssVar("--el-color-primary", el, {
|
|
|
|
+// initialValue: "#00C8AF",
|
|
|
|
+// });
|
|
|
|
|
|
const current = ref(0);
|
|
const current = ref(0);
|
|
|
|
+const currentMaptype = ref(0);
|
|
const list = ref<any>([]);
|
|
const list = ref<any>([]);
|
|
|
|
|
|
const state = reactive({
|
|
const state = reactive({
|
|
deptId: params.deptId || "",
|
|
deptId: params.deptId || "",
|
|
- // caseId: params.caseId || "",
|
|
|
|
|
|
+ caseId: "",
|
|
});
|
|
});
|
|
|
|
|
|
const link = document.querySelector<HTMLLinkElement>("#app-icon")!;
|
|
const link = document.querySelector<HTMLLinkElement>("#app-icon")!;
|
|
@@ -111,19 +137,24 @@ const request = axios.create({
|
|
const mapEl = ref<HTMLDivElement>();
|
|
const mapEl = ref<HTMLDivElement>();
|
|
let AMap, map;
|
|
let AMap, map;
|
|
|
|
|
|
-const queryURL = `${import.meta.env.VITE_SEVER_URL}/fusion/web/fireProject/queryProject`
|
|
|
|
|
|
+const queryURL = `${
|
|
|
|
+ import.meta.env.VITE_SEVER_URL
|
|
|
|
+}/fusion/web/fireProject/queryProject`;
|
|
|
|
|
|
|
|
+axios.get(getSysSetting).then((data) => {
|
|
|
|
+ const { themeColour } = data.data;
|
|
|
|
+ const setColor = themeColour ? `#${themeColour}` : "#00C8AF";
|
|
|
|
+ console.log("setColor", setColor);
|
|
|
|
+ changeThemeColor(setColor);
|
|
|
|
+});
|
|
// debugger;
|
|
// debugger;
|
|
const getDataQuest = () => {
|
|
const getDataQuest = () => {
|
|
return new Promise(async (reslove, reject) => {
|
|
return new Promise(async (reslove, reject) => {
|
|
- const res = await request.post(
|
|
|
|
- queryURL,
|
|
|
|
- {
|
|
|
|
- pageNum: 1,
|
|
|
|
- pageSize: 10000,
|
|
|
|
- deptId: state.deptId,
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
|
|
+ const res = await request.post(queryURL, {
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: 10000,
|
|
|
|
+ deptId: state.deptId,
|
|
|
|
+ });
|
|
console.log("res.data", res);
|
|
console.log("res.data", res);
|
|
if (res.status === 200 && res.data.code === 0) {
|
|
if (res.status === 200 && res.data.code === 0) {
|
|
reslove(res.data.data.list);
|
|
reslove(res.data.data.list);
|
|
@@ -212,10 +243,12 @@ const loadMap = async () => {
|
|
version: "2.0",
|
|
version: "2.0",
|
|
});
|
|
});
|
|
|
|
|
|
- map = new AMap.Map(mapEl.value, {
|
|
|
|
|
|
+ (window as any).map = map = new AMap.Map(mapEl.value, {
|
|
WebGLParams: {
|
|
WebGLParams: {
|
|
preserveDrawingBuffer: true,
|
|
preserveDrawingBuffer: true,
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ mapStyle: "amap://styles/normal", // 默认地图样式,
|
|
resizeEnable: true,
|
|
resizeEnable: true,
|
|
});
|
|
});
|
|
|
|
|
|
@@ -226,7 +259,10 @@ const loadMap = async () => {
|
|
//异步同时加载多个插件
|
|
//异步同时加载多个插件
|
|
// map.addControl(new AMap.HawkEye()); //显示缩略图
|
|
// map.addControl(new AMap.HawkEye()); //显示缩略图
|
|
map.addControl(new AMap.Scale()); //显示当前地图中心的比例尺
|
|
map.addControl(new AMap.Scale()); //显示当前地图中心的比例尺
|
|
- map.addControl(new AMap.MapType()); //显示当前地图中心的比例尺
|
|
|
|
|
|
+ const type = new AMap.MapType({
|
|
|
|
+ defaultType: 0,
|
|
|
|
+ });
|
|
|
|
+ map.addControl(type); //显示当前地图中心的比例尺
|
|
}
|
|
}
|
|
);
|
|
);
|
|
console.log("map", map);
|
|
console.log("map", map);
|
|
@@ -234,9 +270,27 @@ const loadMap = async () => {
|
|
initMakers();
|
|
initMakers();
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+watch(currentMaptype, (val) => {
|
|
|
|
+ console.log("currentMaptype", val);
|
|
|
|
+ if (val === 0) {
|
|
|
|
+ const btn = document.querySelector(
|
|
|
|
+ "input[data-id='AMap.TileLayer']"
|
|
|
|
+ ) as any as HTMLInputElement;
|
|
|
|
+ btn && btn.click();
|
|
|
|
+ }
|
|
|
|
+ if (val === 1) {
|
|
|
|
+ const btn = document.querySelector(
|
|
|
|
+ "input[data-id='AMap.TileLayer.Satellite']"
|
|
|
|
+ ) as any as HTMLInputElement;
|
|
|
|
+ btn && btn.click();
|
|
|
|
+ }
|
|
|
|
+});
|
|
|
|
+
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
// console.log("caseId", caseId);
|
|
// console.log("caseId", caseId);
|
|
|
|
+
|
|
loadMap();
|
|
loadMap();
|
|
|
|
+ // primaryColor.value = "#ff9800";
|
|
});
|
|
});
|
|
const handCardClick = (id: number) => {
|
|
const handCardClick = (id: number) => {
|
|
const url = getQuery(id, true);
|
|
const url = getQuery(id, true);
|
|
@@ -257,14 +311,19 @@ body {
|
|
|
|
|
|
.tabbar {
|
|
.tabbar {
|
|
display: flex;
|
|
display: flex;
|
|
- width: 100%;
|
|
|
|
|
|
+ width: calc(100% - 60px);
|
|
position: fixed;
|
|
position: fixed;
|
|
top: 30px;
|
|
top: 30px;
|
|
z-index: 10000;
|
|
z-index: 10000;
|
|
justify-items: center;
|
|
justify-items: center;
|
|
- justify-content: center;
|
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ padding: 0 30px;
|
|
|
|
+}
|
|
|
|
+.tabbar .right {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: row;
|
|
|
|
+ gap: 0 20px;
|
|
}
|
|
}
|
|
-
|
|
|
|
.tabbar .nav {
|
|
.tabbar .nav {
|
|
display: flex;
|
|
display: flex;
|
|
/* background: white; */
|
|
/* background: white; */
|
|
@@ -330,4 +389,7 @@ body {
|
|
.no-data span {
|
|
.no-data span {
|
|
color: #999;
|
|
color: #999;
|
|
}
|
|
}
|
|
|
|
+.amap-maptype {
|
|
|
|
+ display: none;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|