yanghao 1 Minggu lalu
induk
melakukan
2a9f9d4562

+ 16 - 0
src/api/pms/qhse/index.ts

@@ -663,3 +663,19 @@ export const EmergencyDrillCertApi = {
     return await request.download({ url: `/rq/qhse-emergency-cert/export-excel`, params })
   }
 }
+
+// 资料库
+export const DataLibraryApi = {
+  // 获得资料库分页
+  getDataLibraryList: async (params) => {
+    return await request.get({ url: `/rq/qhse-info/page`, params })
+  },
+  // 删除资料库
+  deleteDataLibrary: async (id) => {
+    return await request.delete({ url: `/rq/qhse-info/delete?id=` + id })
+  },
+
+  getFileTree: async () => {
+    return await request.get({ url: '/rq/qhse-file-tree/page' })
+  }
+}

+ 6 - 6
src/views/pms/qhse/data/PmsTree.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="head-container">
-    <el-input v-model="deptName" class="mb-15px" clearable placeholder="请输入名称">
+    <el-input v-model="deptName" class="mb-15px" clearable placeholder="请输入名称66">
       <template #prefix>
         <Icon icon="ep:search" />
       </template>
@@ -88,7 +88,7 @@
 import { ElTree } from 'element-plus'
 import { defaultProps, handleTree } from '@/utils/tree'
 import { CommonStatusEnum } from '@/utils/constants'
-import { IotTreeApi } from '@/api/system/tree'
+import { DataLibraryApi } from '@/api/pms/qhse/index'
 import { nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
 import { useI18n } from 'vue-i18n'
 import { useRouter } from 'vue-router'
@@ -272,7 +272,7 @@ const handleMenuClick = async (action) => {
       // 删除的二次确认
       await message.delConfirm()
       // 假设存在删除接口
-      await IotTreeApi.deleteIotTree(nodeInfo.value.id)
+      await DataLibraryApi.deleteIotTree(nodeInfo.value.id)
       message.success(t('common.delSuccess'))
       // 刷新列表
       await getTreeInfo()
@@ -284,7 +284,7 @@ const handleMenuClick = async (action) => {
 
 /** 获得部门树 */
 const getTreeInfo = async () => {
-  const res = await IotTreeApi.getSimpleTreeList()
+  const res = await DataLibraryApi.getFileTree()
   treeList.value = []
   treeList.value.push(...handleTree(res))
 
@@ -325,9 +325,9 @@ const submitForm = async () => {
     formData.value.type = 'file'
     if (formType.value === 'create') {
       debugger
-      await IotTreeApi.createIotTree(formData.value)
+      await DataLibraryApi.createIotTree(formData.value)
     } else {
-      await IotTreeApi.updateIotTree(formData.value)
+      await DataLibraryApi.updateIotTree(formData.value)
     }
     message.success(t(formType.value === 'create' ? 'common.addSuccess' : 'common.updateSuccess'))
     dialogVisible.value = false

+ 4 - 58
src/views/pms/qhse/data/index.vue

@@ -188,14 +188,14 @@
 import { IotDeviceVO } from '@/api/pms/device'
 import IotInfoFormTree from '@/views/pms/iotinfo/IotInfoFormTree.vue'
 import * as IotInfoApi from '@/api/pms/iotinfo'
-import { ref, onMounted, onUnmounted } from 'vue'
+import { ref, onMounted } from 'vue'
 
-import PmsTree from '@/views/system/tree/PmsTree.vue'
+import PmsTree from './PmsTree.vue'
 import { useCache } from '@/hooks/web/useCache'
 import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
 import { IotInfoClassifyApi } from '@/api/pms/info'
 import { IotTreeApi } from '@/api/system/tree'
-defineOptions({ name: 'IotTree' })
+defineOptions({ name: 'QHSEFile' })
 
 const container = ref(null)
 const leftWidth = ref(350) // 初始左侧宽度
@@ -217,9 +217,6 @@ const openWeb = (url) => {
     'http://1.94.244.160:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(url))
   )
 }
-const handleView = (row) => {
-  openForm('detail', row.id)
-}
 const startDrag = (e) => {
   isDragging = true
   document.addEventListener('mousemove', onDrag)
@@ -316,22 +313,7 @@ const deleteInfo = async (id) => {
     }
   })
 }
-// const handleFileView = (url: string) => {
-//   window.open(
-//     'http://1.94.244.160:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(url))
-//   )
-// }
-const handleDelete = async (id: number) => {
-  try {
-    // 删除的二次确认
-    await message.delConfirm()
-    // 发起删除
-    await IotInfoApi.IotInfoApi.deleteIotInfo(id)
-    message.success(t('common.delSuccess'))
-    // 刷新列表
-    await getList()
-  } catch {}
-}
+
 const formRef = ref()
 const openForm = async (type: string, id?: number) => {
   // if (classType.value==='dept'){
@@ -462,42 +444,6 @@ const handleBreadcrumbClick = async (index) => {
   formLoading.value = false
 }
 
-// const handleFileNodeClick = async (row) => {
-//   queryParams.classId = row.id
-//   classType.value = row.type
-//   if (row.type==='device') {
-//     deviceId.value = row.originId
-//     const queryParam = {
-//       deviceId: row.originId,
-//       pageNo: 1,
-//       pagesize: 10,
-//     }
-//     const data = await IotInfoClassifyApi.getIotInfoClassifyPage(queryParam)
-//     debugger
-//     if (data){
-//       const target = data.filter((item)=> item.parentId===0)
-//       clickNodeId.value = target[0].id
-//     }
-//   } else if (row.type === 'file'){
-//     clickNodeId.value = row.originId
-//   } else if (row.type==='dept') {
-//     // message.error("请选择设备及文件节点")
-//     // return
-//   }
-//   nodeId.value = row.id
-//   await getList()
-// }
-/** 获得详情 */
-// const getDetail = async () => {
-//   if (id) {
-//     formLoading.value = true
-//     try {
-//       formData.value = (await IotDeviceApi.getIotDevice(id)) as IotDeviceVO
-//     } finally {
-//       formLoading.value = false
-//     }
-//   }
-// }
 /** 查询列表 */
 const getList = async () => {
   formLoading.value = true

+ 1 - 1
src/views/pms/qhse/kanban/index.vue

@@ -301,7 +301,7 @@ const bottomCards = ref([
     lines: ['职业健康体检率', '98.7%(达标)']
   },
   {
-    title: '环境危废',
+    title: '危废管控',
     icon: Flag,
     accent: '#28c98b',
     glow: 'rgba(40, 201, 139, 0.2)',