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 @@
+
+
+
+ {{ item.name }}
+
+
+