diff --git a/src/apis/system/api.js b/src/apis/system/api.js new file mode 100644 index 0000000..f2e5715 --- /dev/null +++ b/src/apis/system/api.js @@ -0,0 +1,2 @@ +export const GET_SYSTEM_FLOOR_LIST_API = `/api/Device/GetFloor`; +export const GET_SYSTEM_DEVICE_LIST_API = `/api/Device/GetDeviceList`; \ No newline at end of file diff --git a/src/apis/system/index.js b/src/apis/system/index.js new file mode 100644 index 0000000..4054f3f --- /dev/null +++ b/src/apis/system/index.js @@ -0,0 +1,32 @@ +import { GET_SYSTEM_FLOOR_LIST_API, GET_SYSTEM_DEVICE_LIST_API } from "./api"; +import instance from "@/util/request"; +import apihandler from "@/util/apihandler"; + +export const getSystemFloors = async (building_tag, sub_system_tag) => { + const res = await instance.post(GET_SYSTEM_FLOOR_LIST_API, { + building_tag, + sub_system_tag, + }); + + return apihandler(res.code, res.data, { + msg: res.msg, + code: res.code, + }); +}; + +export const getSystemDevices = async ({ + sub_system_tag, + building_tag, + floor_tag, +}) => { + const res = await instance.post(GET_SYSTEM_DEVICE_LIST_API, { + sub_system_tag, + building_tag, + floor_tag, + }); + + return apihandler(res.code, res.data, { + msg: res.msg, + code: res.code, + }); +}; diff --git a/src/assets/img/equipment/replay01.svg b/src/assets/img/equipment/replay01.svg new file mode 100644 index 0000000..639e6eb --- /dev/null +++ b/src/assets/img/equipment/replay01.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/img/equipment/replay02.svg b/src/assets/img/equipment/replay02.svg new file mode 100644 index 0000000..62e067b --- /dev/null +++ b/src/assets/img/equipment/replay02.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/img/equipment/state-background.svg b/src/assets/img/equipment/state-background.svg new file mode 100644 index 0000000..8334698 --- /dev/null +++ b/src/assets/img/equipment/state-background.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/img/equipment/state-title.svg b/src/assets/img/equipment/state-title.svg new file mode 100644 index 0000000..6202385 --- /dev/null +++ b/src/assets/img/equipment/state-title.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/img/equipment/table-item-w.svg b/src/assets/img/equipment/table-item-w.svg new file mode 100644 index 0000000..74bbc0c --- /dev/null +++ b/src/assets/img/equipment/table-item-w.svg @@ -0,0 +1,7 @@ + + + + + + diff --git a/src/components/chart/EffectScatter.vue b/src/components/chart/EffectScatter.vue index 0be1380..3ff8e1c 100644 --- a/src/components/chart/EffectScatter.vue +++ b/src/components/chart/EffectScatter.vue @@ -8,7 +8,10 @@ const props = defineProps({ className: String, id: String, svg: Object, - getCoordinate: Function, + getCoordinate: { + type: Function, + default: null + }, }); let chart = ref(null); @@ -22,33 +25,23 @@ async function updateSvg(svg, option) { axios.get(svg.path).then(({ data }) => { echarts.registerMap(svg.full_name, { svg: data }); chart.value.setOption(option); - chart.value.getZr().on("click", function (params) { - var pixelPoint = [params.offsetX, params.offsetY]; - var dataPoint = chart.value.convertFromPixel({ geoIndex: 0 }, pixelPoint); - currentClickPosition.value = dataPoint; - props.getCoordinate(dataPoint); - chart.value.setOption({ - series: { - data: [dataPoint], - }, + if (props.getCoordinate) { + chart.value.getZr().on("click", function (params) { + var pixelPoint = [params.offsetX, params.offsetY]; + var dataPoint = chart.value.convertFromPixel({ geoIndex: 0 }, pixelPoint); + currentClickPosition.value = dataPoint; + props.getCoordinate(dataPoint); + chart.value.setOption({ + series: { + data: [dataPoint], + }, + }); + }); - console.log(chart.value.getOption()); - }); + } + }); console.log("updateSvg", svg.path); - // fetch(svg.path) - // .then((res) => console.log(res)) - // .then(function (svg) { - // console.log(svg); - // // echarts.registerMap(svg.full_name, { svg }); - // // chart.setOption(option); - // // chart.getZr().on("click", function (params) { - // // var pixelPoint = [params.offsetX, params.offsetY]; - // // var dataPoint = curChart.convertFromPixel({ geoIndex: 0 }, pixelPoint); - // // console.log(dataPoint); - // // currentClickPosition.value = dataPoint; - // // }); - // }); } function init() { @@ -69,7 +62,7 @@ defineExpose({ }); diff --git a/src/components/customUI/ButtonGroup.vue b/src/components/customUI/ButtonGroup.vue index 3c4621d..4a90fd6 100644 --- a/src/components/customUI/ButtonGroup.vue +++ b/src/components/customUI/ButtonGroup.vue @@ -7,28 +7,22 @@ const props = defineProps({ withLine: Boolean, // this is for change active button onclick: Function, + className: String });