深海科学与工程研究所安全巡检系统
祖安之光
2025-10-15 6390fa18f5c2df1158a0d664786797b0e8b2fbf9
src/views/hazardMng/hazardReport/index.vue
@@ -8,6 +8,7 @@
              plain
              icon="Plus"
              @click="openDialog('add',{})"
              v-if="isAuthority"
          >新增</el-button>
        </el-form-item>
        <el-form-item label="隐患名称:" >
@@ -123,7 +124,8 @@
    hazardSource: null,
    hazardLevel: null,
    reformDeptId: null,
    reformUserId: null
    reformUserId: null,
    hazardsType: 1
  },
  dataList: [],
  deptList: [],
@@ -131,31 +133,19 @@
  sourceList: [
    {
      id: 1,
      name: '日常排查'
      name: '综合检查'
    },
    {
      id: 2,
      name: '综合性排查'
      name: '部门检查'
    },
    {
      id: 3,
      name: '专业性排查'
      name: '实验室自查'
    },
    {
      id: 4,
      name: '季节性排查'
    },
    {
      id: 5,
      name: '重点时段及节假日前排查'
    },
    {
      id: 6,
      name: '外聘专家诊断式排查'
    },
    {
      id: 7,
      name: '其他'
      name: '专项检查'
    }
  ],
  levelList: [
@@ -267,14 +257,21 @@
      return res.code === 200 ? res.data : []
    }
  },
  api: {}
  api: {},
  isAuthority: false
});
const { queryParams, total, dataList, deptList, userList, formConfig, dataLoader, api, sourceList, levelList } = toRefs(state);
const { queryParams, total, dataList, deptList, userList, formConfig, dataLoader, api, sourceList, levelList, isAuthority } = toRefs(state)
const userStore = useUserStore()
onMounted(async ()=>{
  await getList()
  await getDeptList()
  await getUserList()
  if(userStore.roles.includes('admin') || userStore.roles.includes('sys_admin') || userStore.roles.includes('place_safety_officer')){
    state.isAuthority = true
  }else{
    state.isAuthority = false
  }
})
onUnmounted(()=>{
@@ -330,7 +327,8 @@
    hazardSource: null,
    hazardLevel: null,
    reformDeptId: null,
    reformUserId: null
    reformUserId: null,
    hazardsType: 1
  }
  await getList()
}