From a91c4397a469b7df3346bc2396ae75001c5dadc1 Mon Sep 17 00:00:00 2001 From: ko1234 Date: Thu, 6 Feb 2025 11:41:20 +0800 Subject: [PATCH] =?UTF-8?q?=20=E8=A8=AD=E5=82=99=E7=AE=A1=E7=90=86:?= =?UTF-8?q?=E7=B5=84=E5=90=88=E9=BB=9E=E4=BD=8D-=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=B5=84=E5=90=88=E9=BB=9E=E4=BD=8D=E7=9A=84=E5=8F=83=E6=95=B8?= =?UTF-8?q?=E9=A1=AF=E7=A4=BA=E5=90=8D=E7=A8=B1=E3=80=81=E5=A4=A7=E9=A1=9E?= =?UTF-8?q?=E7=82=BAElectricity=20System=E6=99=82=EF=BC=8C=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=94=A8=E9=9B=BB=E9=A1=9E=E5=88=A5(option)=E3=80=81?= =?UTF-8?q?=E9=9A=B1=E8=97=8F=E7=B3=BB=E7=B5=B1=E9=A1=9E=E5=88=A5=E7=9A=84?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=88=87=E4=BF=AE=E6=94=B9=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=20|=20=E5=B8=B3=E8=99=9F=E7=AE=A1=E7=90=86:=20=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E7=AE=A1=E7=90=86=E7=9A=84=E6=AC=8A=E9=99=90bug=20|?= =?UTF-8?q?=20=E6=AD=B7=E5=8F=B2=E8=B3=87=E6=96=99:=20=E6=9F=A5=E8=A9=A2?= =?UTF-8?q?=E6=99=82=EF=BC=8C=E6=96=B0=E5=A2=9ELoading=E7=9A=84=E5=9C=96?= =?UTF-8?q?=E7=A4=BA=20|=20=E5=8D=B3=E6=99=82=E5=91=8A=E8=AD=A6:=20?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=E8=A8=AD=E5=AE=9A=E8=A6=81"=E5=88=AA?= =?UTF-8?q?=E9=99=A4"=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/alert/api.js | 1 + src/apis/alert/index.js | 12 ++++++++++ src/views/AssetManagement/AssetManagement.vue | 9 +++++++- .../components/AssetMainList.vue | 4 ++-- .../components/AssetMainListAddModal.vue | 4 ++-- .../components/AssetTableModalLeftInfo.vue | 18 +++++++++++++-- .../components/AssetTableModalLeftInfoIoT.vue | 2 +- .../AlertSetting/AlertOutliersTable.vue | 23 ++++++++++++++++++- src/views/history/components/HistoryTable.vue | 2 +- 9 files changed, 65 insertions(+), 10 deletions(-) diff --git a/src/apis/alert/api.js b/src/apis/alert/api.js index 6794093..3a5f802 100644 --- a/src/apis/alert/api.js +++ b/src/apis/alert/api.js @@ -14,6 +14,7 @@ export const GET_OUTLIERS_LIST_API = `api/Alarm/GetAlarmSetting`; export const GET_OUTLIERS_DEVLIST_API = `api/Alarm/GetDevList`; // 取得設備 export const GET_OUTLIERS_POINTS_API = `api/Alarm/GetAlarmPoints`; // 取得點位 export const POST_OUTLIERS_SETTING_API = `api/Alarm/SaveAlarmSetting`; // 新增與修改 +export const DELETE_OUTLIERS_SETTING_API = `api/Alarm/DeleteAlarmSetting`; // 刪除 export const GET_ALERT_SCHEDULE_LIST_API = `api/Alarm/GetAlarmSchedule`; export const POST_ALERT_SCHEDULE = `api/Alarm/SaveAlarmSchedule`; diff --git a/src/apis/alert/index.js b/src/apis/alert/index.js index 2c96364..edce98d 100644 --- a/src/apis/alert/index.js +++ b/src/apis/alert/index.js @@ -7,6 +7,7 @@ import { GET_OUTLIERS_DEVLIST_API, GET_OUTLIERS_POINTS_API, POST_OUTLIERS_SETTING_API, + DELETE_OUTLIERS_SETTING_API, GET_ALERT_MEMBER_LIST_API, GET_ALERT_MEMBER, POST_ALERT_MEMBER, @@ -160,6 +161,17 @@ export const postOutliersSetting = async (data) => { }); }; +export const delOutliersSetting = async (Id) => { + const res = await instance.post(DELETE_OUTLIERS_SETTING_API, { + Id, + }); + + return apihandler(res.code, res.data, { + msg: res.msg, + code: res.code, + }); +}; + export const getAlarmScheduleList = async () => { const res = await instance.post(GET_ALERT_SCHEDULE_LIST_API, {}); diff --git a/src/views/AssetManagement/AssetManagement.vue b/src/views/AssetManagement/AssetManagement.vue index bea656f..3ed310d 100644 --- a/src/views/AssetManagement/AssetManagement.vue +++ b/src/views/AssetManagement/AssetManagement.vue @@ -4,11 +4,12 @@ import AssetMainList from "./components/AssetMainList.vue"; import AssetSubList from "./components/AssetSubList.vue"; import AssetTable from "./components/AssetTable.vue"; import { getOperationCompanyList } from "@/apis/operation"; -import { getIOTSchema } from "@/apis/asset"; +import { getIOTSchema, getElecTypeList } from "@/apis/asset"; import useSearchParam from "@/hooks/useSearchParam"; const { searchParams, changeParams } = useSearchParam(); const companyOptions = ref([]); const iotSchemaOptions = ref([]); +const elecTypeOptions = ref([]); const getCompany = async () => { const res = await getOperationCompanyList(); companyOptions.value = res.data.map((d) => ({ ...d, key: d.id })); @@ -17,9 +18,14 @@ const getIOTSchemaOptions = async (id) => { const res = await getIOTSchema(Number(id)); iotSchemaOptions.value = res.data.map((d) => ({ ...d, key: d.id })); }; +const getElecType = async () => { + const res = await getElecTypeList(); + elecTypeOptions.value = res.data.map((d) => ({ ...d, key: d.id })); +}; onMounted(() => { getCompany(); + getElecType(); }); watch( @@ -37,6 +43,7 @@ watch( provide("asset_modal_options", { companyOptions, iotSchemaOptions, + elecTypeOptions, }); diff --git a/src/views/AssetManagement/components/AssetMainList.vue b/src/views/AssetManagement/components/AssetMainList.vue index 4e13115..85e96cf 100644 --- a/src/views/AssetManagement/components/AssetMainList.vue +++ b/src/views/AssetManagement/components/AssetMainList.vue @@ -83,12 +83,12 @@ watch(selectedBtn, (newValue) => { :getData="getMainSystems" :formState="formState" /> - + --> {