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" /> - + --> {