lipenghui 3 semanas atrás
pai
commit
96790abb19
1 arquivos alterados com 16 adições e 20 exclusões
  1. 16 20
      src/views/system/tree/index.vue

+ 16 - 20
src/views/system/tree/index.vue

@@ -57,10 +57,10 @@
         </ContentWrap>
         <ContentWrap>
           <el-table v-loading="formLoading" :data="list" :stripe="true" :show-overflow-tooltip="true" @row-dblclick="inContent" class="custom-table">
-            <el-table-column :label="t('file.name') " align="left" prop="filename" min-width="200">
+            <el-table-column :label="t('file.name') " align="left" prop="filename" min-width="300">
               <template #default="scope">
                 <div style="display: flex; align-items: center; gap: 5px;">
-                <Icon v-if="scope.row.fileType==='content'" icon="fa:folder-open"  color="#FFD96E"/>
+                <Icon v-if="scope.row.fileType==='content'" icon="fa:folder-open"  color="orange"/>
                 <Icon v-else-if="scope.row.fileType==='pic'||scope.row.fileClassify==='jpg'||scope.row.fileClassify==='png'" icon="ep:picture-filled"  color="#2183D1"/>
                 <Icon v-else-if="scope.row.fileType==='file'&&scope.row.fileClassify==='pdf'" icon="fa-solid:file-pdf"  color="#E20012"/>
                 <Icon v-else-if="scope.row.fileType==='file'&&(scope.row.fileClassify==='doc'||scope.row.fileClassify==='docx')" icon="fa:file-word-o"  color="blue"/>
@@ -77,22 +77,22 @@
               </template>
             </el-table-column>
             <el-table-column :label="t('file.fileSize') " align="center" prop="fileSize" />
-            <el-table-column :label="t('file.preview') " align="center" prop="filePath" >
-              <template #default="scope">
-                <el-button v-if="scope.row.fileType!=='content'" link type="primary" @click="openWeb(scope.row.filePath)"> <Icon size="19" icon="ep:view"  /> </el-button>
-              </template>
-            </el-table-column>
+<!--            <el-table-column :label="t('file.preview') " align="center" prop="filePath" >-->
+<!--              <template #default="scope">-->
+<!--                <el-button v-if="scope.row.fileType!=='content'" link type="primary" @click="openWeb(scope.row.filePath)"> <Icon size="19" icon="ep:view"  /> </el-button>-->
+<!--              </template>-->
+<!--            </el-table-column>-->
             <el-table-column :label="t('file.dept') " align="center" prop="deptName" />
             <el-table-column :label="t('file.device') " align="center" prop="deviceName" min-width="220"/> />
             <el-table-column :label="t('file.operation') " align="center" width="160">
               <template #default="scope">
                 <div class="flex items-center justify-center">
-                  <el-button type="primary" link @click="handleDownload( scope.row.filePath)" v-hasPermi="['rq:iot-info:download']">
+                  <el-button type="primary" v-if="scope.row.fileType!=='content'" link @click="handleDownload( scope.row.filePath)" v-hasPermi="['rq:iot-info:download']">
                     <Icon icon="ep:download" />{{t('file.dow')}}
                   </el-button>
-                  <el-button type="primary" link @click="handleView( scope.row)">
-                    <Icon icon="ep:view" />{{t('file.preview')}}
-                  </el-button>
+<!--                  <el-button type="primary" link @click="handleView( scope.row)">-->
+<!--                    <Icon icon="ep:view" />{{t('file.preview')}}-->
+<!--                  </el-button>-->
                 </div>
               </template>
             </el-table-column>
@@ -129,13 +129,6 @@ const leftWidth = ref(350) // 初始左侧宽度
 const rightWidth = ref(window.innerWidth * 0.8)
 let isDragging = false
 
-// const inContent = async (row) =>{
-//   debugger
-//   queryParams.classId = row.id;
-//   const data = await IotInfoApi.IotInfoApi.getChildContentFile(queryParams)
-//   list.value = data
-// }
-
 const openWeb = (url) => {
   window.open('http://1.94.244.160:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(url)));
 }
@@ -285,6 +278,11 @@ const updateBreadcrumbs = async (node) => {
 
 // 表格行点击事件
 const inContent = async (row) => {
+  debugger
+  if (row.fileType!='content') {
+    window.open('http://1.94.244.160:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(row.filePath)));
+    return
+  }
   queryParams.filename = ''
   formLoading.value = true
   // 调用共享方法更新面包屑和表格
@@ -301,7 +299,6 @@ const handleFileNodeClick = async (row) => {
   queryParams.filename = ''
   const parentItems = await IotTreeApi.getParentIds(row.id);
   breadcrumbs.value = [];
-  debugger
   parentItems.forEach(item => {
     breadcrumbs.value.push({ id: item.id, name: item.name,type:'root' } );
   })
@@ -394,7 +391,6 @@ const getList = async () => {
   formLoading.value = true
   try {
     const data = await IotInfoApi.IotInfoApi.getChildContentFile(queryParams)
-    debugger
     list.value = data
   } finally {
     formLoading.value = false