diff --git a/src/apis/asset/api.js b/src/apis/asset/api.js index 51b9bb0..6c0a0f0 100644 --- a/src/apis/asset/api.js +++ b/src/apis/asset/api.js @@ -11,6 +11,7 @@ export const DELETE_ASSET_ITEM_API = `/AssetManage/DeleteAsset`; export const GET_ASSET_FLOOR_LIST_API = `/AssetManage/GetFloorList`; export const POST_ASSET_FLOOR_API = `/AssetManage/SaveFloor`; +export const DELETE_ASSET_FLOOR_API = `/AssetManage/DeleteFloor`; export const GET_ASSET_IOT_LIST_API = `/AssetManage/GetIOTList`; export const GET_ASSET_SUB_POINT_API = `/AssetManage/GetSubPoint`; diff --git a/src/apis/asset/index.js b/src/apis/asset/index.js index 61bc0f2..b45fbc3 100644 --- a/src/apis/asset/index.js +++ b/src/apis/asset/index.js @@ -7,6 +7,7 @@ import { GET_ASSET_SINGLE_API, GET_ASSET_FLOOR_LIST_API, POST_ASSET_FLOOR_API, + DELETE_ASSET_FLOOR_API, GET_ASSET_IOT_LIST_API, DELETE_ASSET_ITEM_API, POST_ASSET_SINGLE_API, @@ -143,6 +144,15 @@ export const postAssetFloor = async (formData) => { }); }; +export const deleteAssetFloor = async (formData) => { + const res = await instance.post(DELETE_ASSET_FLOOR_API, formData); + + return apihandler(res.code, res.data, { + msg: res.msg, + code: res.code, + }); +}; + export const getAssetIOTList = async (sub_system_tag, points) => { const res = await instance.post(GET_ASSET_IOT_LIST_API, { sub_system_tag, diff --git a/src/components/chart/EffectScatter.vue b/src/components/chart/EffectScatter.vue index 3893e4e..2ac30af 100644 --- a/src/components/chart/EffectScatter.vue +++ b/src/components/chart/EffectScatter.vue @@ -10,7 +10,7 @@ const props = defineProps({ svg: Object, getCoordinate: { type: Function, - default: null + default: null, }, }); @@ -22,7 +22,7 @@ async function updateSvg(svg, option) { if (!chart.value && dom.value && svg) { init(); } else { - clear() + clear(); } axios.get(svg.path).then(({ data }) => { echarts.registerMap(svg.full_name, { svg: data }); @@ -30,24 +30,33 @@ async function updateSvg(svg, option) { if (props.getCoordinate) { chart.value.getZr().on("click", function (params) { var pixelPoint = [params.offsetX, params.offsetY]; - var dataPoint = chart.value.convertFromPixel({ geoIndex: 0 }, pixelPoint); + var dataPoint = chart.value.convertFromPixel( + { geoIndex: 0 }, + pixelPoint + ); currentClickPosition.value = dataPoint; props.getCoordinate(dataPoint); + const updatedData = option.series.data + .filter( + (point) => !(point.itemStyle && point.itemStyle.color === "#0000FF") + ) + .concat({ + value: dataPoint, // 當前座標值 + itemStyle: { color: "#0000FF" }, // 設為藍色 + }); chart.value.setOption({ series: { - data: [dataPoint], + data: updatedData, }, }); - }); } - }); console.log("updateSvg", svg.path); } function clear() { - chart.value.clear() + chart.value.clear(); } function init() { diff --git a/src/components/customUI/Menu.vue b/src/components/customUI/Menu.vue new file mode 100644 index 0000000..054a6a3 --- /dev/null +++ b/src/components/customUI/Menu.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/src/components/customUI/Table.vue b/src/components/customUI/Table.vue index eb97e06..6d27bec 100644 --- a/src/components/customUI/Table.vue +++ b/src/components/customUI/Table.vue @@ -161,12 +161,12 @@ watch(
-
+ diff --git a/src/components/navbar/NavbarBuilding.vue b/src/components/navbar/NavbarBuilding.vue index 3552cd8..3152b1b 100644 --- a/src/components/navbar/NavbarBuilding.vue +++ b/src/components/navbar/NavbarBuilding.vue @@ -3,9 +3,6 @@ import { getBuildings } from "@/apis/building"; import { onMounted, ref } from "vue"; import useBuildingStore from "@/stores/useBuildingStore"; -// const buildings = ref(null); -// const selectedBuilding = ref(null); - const store = useBuildingStore(); const getBui = async () => { @@ -15,6 +12,10 @@ const getBui = async () => { store.selectedBuilding = res?.data[0]; }; +const selectBuilding = (bui) => { + store.selectedBuilding = bui; +}; + onMounted(() => { getBui(); }); @@ -25,10 +26,10 @@ onMounted(() => {
{{ store.selectedBuilding?.full_name }} - +
    { class="text-white my-1 text-base" v-for="bui in store.buildings" :key="bui.building_tag" + @click="selectBuilding(bui)" > {{ bui.full_name }} diff --git a/src/hooks/forge/useForgeSprite.js b/src/hooks/forge/useForgeSprite.js index 8e1b4a7..996632c 100644 --- a/src/hooks/forge/useForgeSprite.js +++ b/src/hooks/forge/useForgeSprite.js @@ -41,6 +41,7 @@ export default function useForgeSprite() { console.log("onSpriteClicked", event.target); console.log("onSpriteClicked", data); // modalContent.value = data; + // debugger; if (data) { getCurrentInfoModalData( event, diff --git a/src/util/request.js b/src/util/request.js index 8ee0279..d907b1c 100644 --- a/src/util/request.js +++ b/src/util/request.js @@ -38,6 +38,9 @@ instance.interceptors.response.use( function (error) { // Any status codes that falls outside the range of 2xx cause this function to trigger // Do something with response error + if (response && response.status === 401) { + window.location.href = "/logout"; + } return Promise.reject(error); } ); diff --git a/src/views/AssetManagement/components/AssetTable.vue b/src/views/AssetManagement/components/AssetTable.vue index 7709b6e..4944c82 100644 --- a/src/views/AssetManagement/components/AssetTable.vue +++ b/src/views/AssetManagement/components/AssetTable.vue @@ -1,6 +1,6 @@ diff --git a/src/views/AssetManagement/components/AssetTableModalLeftInfoGraph.vue b/src/views/AssetManagement/components/AssetTableModalLeftInfoGraph.vue new file mode 100644 index 0000000..90cacd2 --- /dev/null +++ b/src/views/AssetManagement/components/AssetTableModalLeftInfoGraph.vue @@ -0,0 +1,173 @@ + + + + + diff --git a/src/views/AssetManagement/components/AssetTableModalRightInfo.vue b/src/views/AssetManagement/components/AssetTableModalRightInfo.vue index caa94ad..e706090 100644 --- a/src/views/AssetManagement/components/AssetTableModalRightInfo.vue +++ b/src/views/AssetManagement/components/AssetTableModalRightInfo.vue @@ -1,18 +1,24 @@