fix: BUG修改

This commit is contained in:
kun 2023-07-14 18:44:39 +08:00
parent 56c25d598e
commit cf4a924c57
11 changed files with 75 additions and 40 deletions

View File

@ -310,3 +310,14 @@ export function filterEnum(
if (type == "tag") return filterData?.tagType ? filterData.tagType : "";
return filterData ? filterData[label] : "--";
}
// 向外部iframe框架发送信息
export function sendIframeMessage(msg: any, type: any, iframeEle: any | undefined) {
if (type === 1) {
// 父 => 子
iframeEle.contentWindow.postMessage(msg, "*");
} else if (type === 2) {
// 子 => 父
window.parent.postMessage(msg, "*");
}
}

View File

@ -9,7 +9,7 @@ const AMapRef = ref();
const areas = zhongkai();
const map = shallowRef<AMap.Map>();
const props = defineProps<{
projectData: Object;
projectData: Array<any>;
}>();
const setProjectData = async () => {
console.log("setProjectData");
@ -296,10 +296,11 @@ const createArea = () => {
};
//
const addMarker = () => {
if (!props.projectData.longitude) {
if (!props.projectData.length > 0) {
return;
}
const createMarkerImage = (state: string) => new URL(`../../../../../assets/images/hzImg/xm/${state}`, import.meta.url).href;
console.log(props.projectData, "77777777777-------");
const createMarkerImage = (state: string) => new URL(`../../../../../../assets/images/hzImg/xm/${state}`, import.meta.url).href;
// map.value?.clearMap();
// markerList.forEach((item: any) => {
// Icon
@ -311,15 +312,17 @@ const addMarker = () => {
//
imageSize: new AMapRef.value.Size(52, 52)
});
// icon marker
let startMarker = new AMapRef.value.Marker({
position: new AMapRef.value.LngLat(Number(props.projectData.longitude), Number(props.projectData.latitude)),
// position: new AMapRef.value.LngLat(113, 21),
icon: startIcon,
offset: new AMapRef.value.Pixel(-13, -30)
props.projectData.map(item => {
// icon marker
let startMarker = new AMapRef.value.Marker({
position: new AMapRef.value.LngLat(Number(item.longitude), Number(item.latitude)),
// position: new AMapRef.value.LngLat(113, 21),
icon: startIcon,
offset: new AMapRef.value.Pixel(-13, -30)
});
map.value?.add([startMarker]);
});
map.value?.add([startMarker]);
// map.value?.setFitView();
// });
};

View File

@ -9,7 +9,7 @@ const AMapRef = ref();
const areas = zhongkai();
const map = shallowRef<AMap.Map>();
const props = defineProps<{
projectData: Object;
projectData: Array<any>;
}>();
const setProjectData = async () => {
console.log("setProjectData");
@ -350,10 +350,10 @@ const createArea = () => {
};
//
const addMarker = () => {
if (!props.projectData.longitude) {
if (!props.projectData.length > 0) {
return;
}
const createMarkerImage = (state: string) => new URL(`../../../../../assets/images/hzImg/xm/${state}`, import.meta.url).href;
const createMarkerImage = (state: string) => new URL(`../../../../../../assets/images/hzImg/xm/${state}`, import.meta.url).href;
// map.value?.clearMap();
// markerList.forEach((item: any) => {
// Icon
@ -366,14 +366,16 @@ const addMarker = () => {
imageSize: new AMapRef.value.Size(52, 52)
});
// icon marker
let startMarker = new AMapRef.value.Marker({
position: new AMapRef.value.LngLat(Number(props.projectData.longitude), Number(props.projectData.latitude)),
// position: new AMapRef.value.LngLat(113, 21),
icon: startIcon,
offset: new AMapRef.value.Pixel(-13, -30)
props.projectData.map(item => {
// icon marker
let startMarker = new AMapRef.value.Marker({
position: new AMapRef.value.LngLat(Number(item.longitude), Number(item.latitude)),
// position: new AMapRef.value.LngLat(113, 21),
icon: startIcon,
offset: new AMapRef.value.Pixel(-13, -30)
});
map.value?.add([startMarker]);
});
map.value?.add([startMarker]);
// map.value?.setFitView();
// });
};

View File

@ -42,38 +42,34 @@ import maps from "./components/maps.vue";
import maps3D from "./components/maps3D.vue";
import largeScreenTwo from "../largeScreenTwo/index.vue";
import { GlobalStore } from "@/stores";
import { sendIframeMessage } from "@/utils/util";
import { getproNamelist } from "@/api/modules/goverment";
const route = useRoute();
const router = useRouter();
const globalStore = GlobalStore();
//
const projectData = ref({
latitude: "",
longitude: "",
totalDay: ""
});
const projectData = ref([]);
const screenValue = ref(0);
const mapValue = ref(0);
const changeMap = (val: any) => {
mapValue.value = val;
};
const changeScreen = async () => {
const changeScreen = () => {
console.log(route);
console.log({ path: globalStore.path, moduleId: globalStore.moduleId });
await sendMessage({ path: globalStore.path, moduleId: globalStore.moduleId }, 2);
// router.push("/goverment/huizhou/largeScreen/largeScreenTwo/index");
router.push("/goverment/huizhou/largeScreen/largeScreenTwo/index");
// screenValue.value = screenValue.value == 0 ? 1 : 0;
};
const sendMessage = (msg: any, type: any, iframeEle: any | undefined) => {
console.log(666);
if (type === 1) {
// =>
iframeEle.contentWindow.postMessage(msg, "*");
} else if (type === 2) {
// =>
window.parent.postMessage(msg, "*");
const getProjectList = async () => {
const res = await getproNamelist({});
if (res && res.result && res.result.length > 0) {
projectData.value = res.result;
}
console.log(777);
console.log(res, "66-----");
};
onMounted(async () => {
await getProjectList();
await sendIframeMessage({ path: globalStore.path, moduleId: globalStore.moduleId }, 2, undefined);
});
</script>
<style lang="scss" scoped>

View File

@ -19,16 +19,23 @@
</template>
<script setup lang="tsx" name="largeScreenTwo">
import { onMounted } from "vue";
import { useRouter } from "vue-router";
import LeftcentView from "./components/LeftcentView.vue";
import RigthTopView from "./components/RigthTopView.vue";
import RigthBottLeftView from "./components/RigthBottLeftView.vue";
import RigthBottRigthView from "./components/RigthBottRigthView.vue";
import { GlobalStore } from "@/stores";
import { sendIframeMessage } from "@/utils/util";
const globalStore = GlobalStore();
const router = useRouter();
const changeScreen = () => {
const changeScreen = async () => {
router.push("/goverment/huizhou/largeScreen/largeScreenOne/index");
// screenValue.value = screenValue.value == 0 ? 1 : 0;
};
onMounted(async () => {
await sendIframeMessage({ path: globalStore.path, moduleId: globalStore.moduleId }, 2, undefined);
});
</script>
<style scoped lang="scss">
.project {

View File

@ -98,6 +98,7 @@ import DialogForm from "@/components/DialogForm/index.vue";
import { ColumnProps } from "@/components/ProTable/interface";
import { getRealTimePage } from "@/api/modules/project";
import { payGovermentEngList, payGovermentProList, payGovermentList, payGovermentContactAdd } from "@/api/modules/huizhou";
import { sendIframeMessage } from "@/utils/util";
const detailsDialog = ref(false);
const relativeId = ref("");
@ -440,6 +441,7 @@ onMounted(async () => {
onSearch(records.value[0]);
searchSn.value = records.value[0].projectSn;
searchName.value = records.value[0].projectName;
await sendIframeMessage({ path: store.path, moduleId: store.moduleId }, 2, undefined);
});
</script>

View File

@ -31,9 +31,11 @@
display: flex;
justify-content: space-between;
margin-top: 10px;
overflow: hidden;
.middleSize {
font-size: 18px;
color: #c4c4c4;
white-space: nowrap;
}
.video {
display: flex;

View File

@ -99,6 +99,7 @@ import { ColumnProps } from "@/components/ProTable/interface";
import { getRealTimePage } from "@/api/modules/project";
import { parentItemGovermentList, payGovermentAdd } from "@/api/modules/huizhou";
import { useRouter } from "vue-router";
import { sendIframeMessage } from "@/utils/util";
const pages = ref({
pageNo: 1,
pageSize: 7,
@ -409,6 +410,7 @@ onMounted(async () => {
onSearch(records.value[0]);
searchSn.value = (records.value as ResAiProjectPage[])[0].projectSn;
searchName.value = (records.value as ResAiProjectPage[])[0].projectName;
await sendIframeMessage({ path: store.path, moduleId: store.moduleId }, 2, undefined);
});
</script>

View File

@ -93,11 +93,14 @@ import { statisticsInfo, statisticsTable } from "@/api/modules/goverment";
import LeftMenu from "@/components/LeftMenu/LeftMenu.vue";
import type { ResAiProjectPage, ResAiEngineerPage } from "@/api/types/government/AIwaring";
import { getDustprojectPage, getDustengineeringPage, getAIQuestionPage } from "@/api/modules/goverment";
import { sendIframeMessage } from "@/utils/util";
import { GlobalStore } from "@/stores";
const pages = ref({
pageNo: 1,
pageSize: 7,
total: 0
});
const store = GlobalStore();
const records = ref<ResAiProjectPage[] | ResAiEngineerPage[]>([]);
const statisticsOption = ref([
{
@ -315,6 +318,7 @@ onMounted(async () => {
onSearch(records.value[0]);
searchSn.value = (records.value as ResAiProjectPage[])[0].projectSn;
searchName.value = (records.value as ResAiProjectPage[])[0].projectName;
await sendIframeMessage({ path: store.path, moduleId: store.moduleId }, 2, undefined);
});
</script>
<style scoped lang="scss">

View File

@ -94,11 +94,14 @@ import { statisticsInfo, statisticsTable } from "@/api/modules/goverment";
import LeftMenu from "@/components/LeftMenu/LeftMenu.vue";
import type { ResAiProjectPage, ResAiEngineerPage } from "@/api/types/government/AIwaring";
import { getDustprojectPage, getDustengineeringPage, getAIQuestionPage } from "@/api/modules/goverment";
import { sendIframeMessage } from "@/utils/util";
import { GlobalStore } from "@/stores";
const pages = ref({
pageNo: 1,
pageSize: 7,
total: 0
});
const store = GlobalStore();
const records = ref<ResAiProjectPage[] | ResAiEngineerPage[]>([]);
//
const columns: ColumnProps[] = [
@ -283,6 +286,7 @@ onMounted(async () => {
onSearch(records.value[0]);
searchSn.value = (records.value as ResAiProjectPage[])[0].projectSn;
searchName.value = (records.value as ResAiProjectPage[])[0].projectName;
await sendIframeMessage({ path: store.path, moduleId: store.moduleId }, 2, undefined);
});
</script>
<style scoped lang="scss">

View File

@ -68,6 +68,7 @@ import type { ResAiProjectPage, ResAiEngineerPage } from "@/api/types/government
import ProTable from "@/components/ProTable/index.vue";
import { ColumnProps } from "@/components/ProTable/interface";
import { getRealTimePage } from "@/api/modules/project";
import { sendIframeMessage } from "@/utils/util";
const pages = ref({
pageNo: 1,
pageSize: 7,
@ -280,6 +281,7 @@ onMounted(async () => {
onSearch(records.value[0]);
searchSn.value = (records.value as ResAiProjectPage[])[0].projectSn;
searchName.value = (records.value as ResAiProjectPage[])[0].projectName;
await sendIframeMessage({ path: store.path, moduleId: store.moduleId }, 2, undefined);
});
</script>