lipenghui 6 روز پیش
والد
کامیت
a19b3b29f6
3فایلهای تغییر یافته به همراه37 افزوده شده و 30 حذف شده
  1. 1 1
      src/api/pms/alarm/index.ts
  2. 1 1
      src/views/pms/device/monitor/IotAlarmSettingForm.vue
  3. 35 28
      src/views/pms/device/monitor/RangeSet.vue

+ 1 - 1
src/api/pms/alarm/index.ts

@@ -21,7 +21,7 @@ export const IotAlarmSettingApi = {
   batchUpdateAlarmSettings: async (alarms: any) => {
     debugger
     console.log(JSON.stringify(alarms))
-    return await request.post({ url: `/rq/iot-alarm-setting/batch/update`, alarms })
+    return await request.post({ url: `/rq/iot-alarm-setting/batch/update`, data:alarms })
   },
   // 查询告警设置详情
   getIotAlarmSetting: async (id: number) => {

+ 1 - 1
src/views/pms/device/monitor/IotAlarmSettingForm.vue

@@ -108,7 +108,7 @@ const submitForm = async () => {
     }
     dialogVisible.value = false
     // 发送操作成功的事件
-    emit('success',ifDevice.value)
+    emit('success',ifDevice.value?'2':'1')
   } finally {
     formLoading.value = false
   }

+ 35 - 28
src/views/pms/device/monitor/RangeSet.vue

@@ -51,6 +51,17 @@
             </div>
 
             <div class="action-buttons">
+              <el-button
+                type="warning"
+                @click="handleQuery"
+                class="add-property-btn"
+                size="default"
+              >
+                <template #icon>
+                  <Icon icon="ep:search" />
+                </template>
+                查询
+              </el-button>
               <el-button
                 type="primary"
                 @click="openForm('create')"
@@ -90,7 +101,7 @@
         <ContentWrap>
           <el-row v-if="selectedNode&&list.length>0" :gutter="16">
             <el-col v-for="item in list" :key="item.id" :lg="6" :md="12" :sm="12" :xs="24" class="mb-4">
-              <el-card :body-style="{ padding: '0' }" class="h-full transition-colors">
+              <el-card v-loading="loading" :body-style="{ padding: '0' }" class="h-full transition-colors">
                 <!-- 内容区域 -->
                 <div class="p-4">
                   <!-- 标题区域 -->
@@ -142,7 +153,6 @@
                   <!-- 按钮组 -->
                   <div class="flex items-center px-0">
                     <el-button
-                      v-hasPermi="['iot:product:update']"
                       class="flex-1 !px-2 !h-[32px] text-[13px]"
                       plain
                       type="primary"
@@ -151,34 +161,31 @@
                       <Icon class="mr-1" icon="ep:edit-pen" />
                       编辑
                     </el-button>
+<!--                    <el-button-->
+<!--                      class="flex-1 !px-2 !h-[32px] !ml-[10px] text-[13px]"-->
+<!--                      plain-->
+<!--                      type="warning"-->
+<!--                      @click="openDetail(item.id)"-->
+<!--                    >-->
+<!--                      <Icon class="mr-1" icon="ep:view" />-->
+<!--                      详情-->
+<!--                    </el-button>-->
+<!--                    <el-button-->
+<!--                      class="flex-1 !px-2 !h-[32px] !ml-[10px] text-[13px]"-->
+<!--                      plain-->
+<!--                      type="success"-->
+<!--                      @click="openObjectModel(item)"-->
+<!--                    >-->
+<!--                      <Icon class="mr-1" icon="ep:scale-to-original" />-->
+<!--                      物模型-->
+<!--                    </el-button>-->
                     <el-button
                       class="flex-1 !px-2 !h-[32px] !ml-[10px] text-[13px]"
                       plain
-                      type="warning"
-                      @click="openDetail(item.id)"
-                    >
-                      <Icon class="mr-1" icon="ep:view" />
-                      详情
-                    </el-button>
-                    <el-button
-                      class="flex-1 !px-2 !h-[32px] !ml-[10px] text-[13px]"
-                      plain
-                      type="success"
-                      @click="openObjectModel(item)"
-                    >
-                      <Icon class="mr-1" icon="ep:scale-to-original" />
-                      物模型
-                    </el-button>
-                    <div class="mx-[10px] h-[20px] w-[1px] bg-[#dcdfe6]"></div>
-                    <el-button
-                      v-hasPermi="['iot:product:delete']"
-                      :disabled="item.status === 1"
-                      class="!px-2 !h-[32px] text-[13px]"
-                      plain
                       type="danger"
                       @click="handleDelete(item.id)"
                     >
-                      <Icon icon="ep:delete" />
+                      <Icon icon="ep:delete" />删除
                     </el-button>
                   </div>
                 </div>
@@ -303,6 +310,7 @@ const handleClassifyRadio = async () =>{
 const getList = async (ifdevice:string) => {
   loading.value = true
   try {
+    debugger
     const data = await IotAlarmSettingApi.getIotAlarmSettingPage(queryParams, ifdevice)
     list.value = data.list
     total.value = data.total
@@ -314,7 +322,7 @@ const getList = async (ifdevice:string) => {
 /** 搜索按钮操作 */
 const handleQuery = () => {
   queryParams.pageNo = 1
-  getList()
+  getList(ifDevice.value)
 }
 
 /** 搜索按钮操作 */
@@ -404,10 +412,10 @@ const handleDelete = async (id: number) => {
     // 删除的二次确认
     await message.delConfirm()
     // 发起删除
-    await DeviceTemplateApi.deleteDeviceTemplate(id)
+    await IotAlarmSettingApi.deleteIotAlarmSetting(id)
     message.success(t('common.delSuccess'))
     // 刷新列表
-    await getList()
+    await getList(ifDevice.value)
   } catch {}
 }
 
@@ -431,7 +439,6 @@ const saveAllProperties = async () => {
   saveLoading.value = true
   try {
     debugger
-
     // 调用保存接口
     await IotAlarmSettingApi.batchUpdateAlarmSettings(modifiedItems)
     message.success('保存成功')