|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
<template>
|
|
|
<ContentWrap>
|
|
<ContentWrap>
|
|
|
- <div style="display: flex; justify-content: space-between; align-items: center;">
|
|
|
|
|
|
|
+ <div style="display: flex; justify-content: space-between; align-items: center">
|
|
|
<el-breadcrumb separator=">" class="breadcrumb-container">
|
|
<el-breadcrumb separator=">" class="breadcrumb-container">
|
|
|
<el-breadcrumb-item
|
|
<el-breadcrumb-item
|
|
|
v-for="(item, index) in breadcrumbs"
|
|
v-for="(item, index) in breadcrumbs"
|
|
@@ -12,21 +12,28 @@
|
|
|
{{ item.name }}
|
|
{{ item.name }}
|
|
|
</el-breadcrumb-item>
|
|
</el-breadcrumb-item>
|
|
|
</el-breadcrumb>
|
|
</el-breadcrumb>
|
|
|
- <el-input v-model="queryParams.allName" :placeholder="'在'+breadcrumbs[breadcrumbs.length - 1].name+'下搜索'" style="width: 250px;height: 30px" @input="searchFolderAndFile"/>
|
|
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="queryParams.allName"
|
|
|
|
|
+ :placeholder="'在' + breadcrumbs[breadcrumbs.length - 1].name + '下搜索'"
|
|
|
|
|
+ style="width: 250px; height: 30px"
|
|
|
|
|
+ @input="searchFolderAndFile"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
</ContentWrap>
|
|
</ContentWrap>
|
|
|
<div class="container-tree" ref="container">
|
|
<div class="container-tree" ref="container">
|
|
|
- <el-row >
|
|
|
|
|
- <div class="left-tree" :style="{ width: leftWidth + 'px' }">
|
|
|
|
|
- <ContentWrapNoBottom >
|
|
|
|
|
- <PmsTree @node-click="handleFileNodeClick" @success="successList" :currentId="queryParams.classId" :deviceId="id" />
|
|
|
|
|
- </ContentWrapNoBottom>
|
|
|
|
|
- </div>
|
|
|
|
|
-<!-- </el-col>-->
|
|
|
|
|
- <div
|
|
|
|
|
- class="divider-tree"
|
|
|
|
|
- @mousedown="startDrag"
|
|
|
|
|
- ></div>
|
|
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <div class="left-tree" :style="{ width: leftWidth + 'px' }">
|
|
|
|
|
+ <ContentWrapNoBottom>
|
|
|
|
|
+ <PmsTree
|
|
|
|
|
+ @node-click="handleFileNodeClick"
|
|
|
|
|
+ @success="successList"
|
|
|
|
|
+ :currentId="queryParams.classId"
|
|
|
|
|
+ :deviceId="id"
|
|
|
|
|
+ />
|
|
|
|
|
+ </ContentWrapNoBottom>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- </el-col>-->
|
|
|
|
|
+ <div class="divider-tree" @mousedown="startDrag"></div>
|
|
|
<div class="right-tree" :style="{ width: rightWidth + 'px' }">
|
|
<div class="right-tree" :style="{ width: rightWidth + 'px' }">
|
|
|
<ContentWrap>
|
|
<ContentWrap>
|
|
|
<el-form
|
|
<el-form
|
|
@@ -36,7 +43,7 @@
|
|
|
:inline="true"
|
|
:inline="true"
|
|
|
label-width="68px"
|
|
label-width="68px"
|
|
|
>
|
|
>
|
|
|
- <el-form-item :label="t('file.name') " prop="filename">
|
|
|
|
|
|
|
+ <el-form-item :label="t('file.name')" prop="filename">
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="queryParams.filename"
|
|
v-model="queryParams.filename"
|
|
|
:placeholder="t('file.nameHolder')"
|
|
:placeholder="t('file.nameHolder')"
|
|
@@ -45,7 +52,7 @@
|
|
|
class="!w-240px"
|
|
class="!w-240px"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item v-show="false" :label="t('file.fileType') " prop="fileType">
|
|
|
|
|
|
|
+ <el-form-item v-show="false" :label="t('file.fileType')" prop="fileType">
|
|
|
<el-select
|
|
<el-select
|
|
|
v-model="queryParams.fileType"
|
|
v-model="queryParams.fileType"
|
|
|
:placeholder="t('file.fileTypeHolder')"
|
|
:placeholder="t('file.fileTypeHolder')"
|
|
@@ -61,55 +68,135 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
- <el-button @click="handleQuery"><Icon icon="ep:search" />
|
|
|
|
|
- {{ t('file.search')}}</el-button>
|
|
|
|
|
- <el-button @click="resetQuery"><Icon icon="ep:refresh" />{{ t('file.reset')}}</el-button>
|
|
|
|
|
- <el-button type="primary" :loading="uploadLoading" @click="openForm('create')">
|
|
|
|
|
- <Icon icon="ep:plus" /> {{ t('file.upload')}}
|
|
|
|
|
|
|
+ <el-button @click="handleQuery"
|
|
|
|
|
+ ><Icon icon="ep:search" /> {{ t('file.search') }}</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button @click="resetQuery"
|
|
|
|
|
+ ><Icon icon="ep:refresh" />{{ t('file.reset') }}</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button type="primary" :loading="uploadLoading" @click="openForm('create')">
|
|
|
|
|
+ <Icon icon="ep:plus" /> {{ t('file.upload') }}
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
</ContentWrap>
|
|
</ContentWrap>
|
|
|
<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="300">
|
|
|
|
|
|
|
+ <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="300">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
- <div style="display: flex; align-items: center; gap: 5px;">
|
|
|
|
|
- <Icon v-if="scope.row.fileType==='content'" icon="fa:folder-open" color="orange"/>
|
|
|
|
|
- <Icon v-else-if="scope.row.fileType==='device'" icon="fa:folder-open" color="blue"/>
|
|
|
|
|
- <Icon v-else-if="scope.row.fileType==='pic'||scope.row.fileClassify==='jpg'||scope.row.fileClassify==='png'||scope.row.fileClassify==='JPG'" icon="ep:picture-filled" color="#2183D1"/>
|
|
|
|
|
- <Icon v-else-if="scope.row.fileType==='file'&&(scope.row.fileClassify==='pdf'||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"/>
|
|
|
|
|
- <Icon v-else-if="scope.row.fileType==='file'&&(scope.row.fileClassify==='xls'||scope.row.fileClassify==='xlsx')" icon="fa-solid:file-excel" color="#107C41"/>
|
|
|
|
|
- <Icon v-else-if="scope.row.fileType==='file'&&(scope.row.fileClassify==='txt')" icon="fa:file-text-o" />
|
|
|
|
|
- <Icon v-else-if="scope.row.fileType==='file'&&(scope.row.fileClassify==='ppt'||scope.row.fileClassify==='pptx')" icon="fa-solid:file-powerpoint" color="#C43E1C" />
|
|
|
|
|
- <Icon v-else icon="fa-solid:file-alt" />
|
|
|
|
|
- {{scope.row.filename}}
|
|
|
|
|
|
|
+ <div style="display: flex; align-items: center; gap: 5px">
|
|
|
|
|
+ <Icon
|
|
|
|
|
+ v-if="scope.row.fileType === 'content'"
|
|
|
|
|
+ icon="fa:folder-open"
|
|
|
|
|
+ color="orange"
|
|
|
|
|
+ />
|
|
|
|
|
+ <Icon
|
|
|
|
|
+ v-else-if="scope.row.fileType === 'device'"
|
|
|
|
|
+ icon="fa:folder-open"
|
|
|
|
|
+ color="blue"
|
|
|
|
|
+ />
|
|
|
|
|
+ <Icon
|
|
|
|
|
+ v-else-if="
|
|
|
|
|
+ scope.row.fileType === 'pic' ||
|
|
|
|
|
+ scope.row.fileClassify === 'jpg' ||
|
|
|
|
|
+ scope.row.fileClassify === 'png' ||
|
|
|
|
|
+ scope.row.fileClassify === 'JPG'
|
|
|
|
|
+ "
|
|
|
|
|
+ icon="ep:picture-filled"
|
|
|
|
|
+ color="#2183D1"
|
|
|
|
|
+ />
|
|
|
|
|
+ <Icon
|
|
|
|
|
+ v-else-if="
|
|
|
|
|
+ scope.row.fileType === 'file' &&
|
|
|
|
|
+ (scope.row.fileClassify === 'pdf' || 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"
|
|
|
|
|
+ />
|
|
|
|
|
+ <Icon
|
|
|
|
|
+ v-else-if="
|
|
|
|
|
+ scope.row.fileType === 'file' &&
|
|
|
|
|
+ (scope.row.fileClassify === 'xls' || scope.row.fileClassify === 'xlsx')
|
|
|
|
|
+ "
|
|
|
|
|
+ icon="fa-solid:file-excel"
|
|
|
|
|
+ color="#107C41"
|
|
|
|
|
+ />
|
|
|
|
|
+ <Icon
|
|
|
|
|
+ v-else-if="scope.row.fileType === 'file' && scope.row.fileClassify === 'txt'"
|
|
|
|
|
+ icon="fa:file-text-o"
|
|
|
|
|
+ />
|
|
|
|
|
+ <Icon
|
|
|
|
|
+ v-else-if="scope.row.fileType === 'file' && scope.row.fileClassify === 'mp4'"
|
|
|
|
|
+ icon="fa:play-circle-o"
|
|
|
|
|
+ color="#009fff"
|
|
|
|
|
+ />
|
|
|
|
|
+ <Icon
|
|
|
|
|
+ v-else-if="
|
|
|
|
|
+ scope.row.fileType === 'file' &&
|
|
|
|
|
+ (scope.row.fileClassify === 'ppt' || scope.row.fileClassify === 'pptx')
|
|
|
|
|
+ "
|
|
|
|
|
+ icon="fa-solid:file-powerpoint"
|
|
|
|
|
+ color="#C43E1C"
|
|
|
|
|
+ />
|
|
|
|
|
+ <Icon v-else icon="fa-solid:file-alt" />
|
|
|
|
|
+ {{ scope.row.filename }}
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
-
|
|
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column :label="t('file.fileType') " align="center" prop="fileType" >
|
|
|
|
|
|
|
+ <el-table-column :label="t('file.fileType')" align="center" prop="fileType">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<dict-tag :type="DICT_TYPE.PMS_FILE_TYPE" :value="scope.row.fileType" />
|
|
<dict-tag :type="DICT_TYPE.PMS_FILE_TYPE" :value="scope.row.fileType" />
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</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.dept') " align="center" prop="deptName" />
|
|
|
|
|
- <el-table-column :label="t('file.device') " align="center" prop="deviceCode" min-width="220"/> />
|
|
|
|
|
- <el-table-column :label="t('file.operation') " align="center" width="160">
|
|
|
|
|
|
|
+ <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.dept')" align="center" prop="deptName" />
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ :label="t('file.device')"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="deviceCode"
|
|
|
|
|
+ min-width="220"
|
|
|
|
|
+ />
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-table-column :label="t('file.operation')" align="center" width="160">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<div class="flex items-center justify-center">
|
|
<div class="flex items-center justify-center">
|
|
|
- <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
|
|
|
|
|
+ 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>
|
|
|
- <el-button type="danger" v-if="scope.row.fileType!=='content'" link @click="deleteInfo( scope.row.id)" v-hasPermi="['rq:iot-info:download']">
|
|
|
|
|
- <Icon icon="ep:delete" />{{t('file.delete')}}
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ v-if="scope.row.fileType !== 'content'"
|
|
|
|
|
+ link
|
|
|
|
|
+ @click="deleteInfo(scope.row.id)"
|
|
|
|
|
+ v-hasPermi="['rq:iot-info:download']"
|
|
|
|
|
+ >
|
|
|
|
|
+ <Icon icon="ep:delete" />{{ t('file.delete') }}
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -117,13 +204,13 @@
|
|
|
</el-table>
|
|
</el-table>
|
|
|
</ContentWrap>
|
|
</ContentWrap>
|
|
|
</div>
|
|
</div>
|
|
|
- </el-row>
|
|
|
|
|
|
|
+ </el-row>
|
|
|
</div>
|
|
</div>
|
|
|
<IotInfoFormTree
|
|
<IotInfoFormTree
|
|
|
ref="formRef"
|
|
ref="formRef"
|
|
|
@success="getList"
|
|
@success="getList"
|
|
|
:deviceId="deviceId"
|
|
:deviceId="deviceId"
|
|
|
- :nodeId = "nodeId"
|
|
|
|
|
|
|
+ :nodeId="nodeId"
|
|
|
:classId="clickNodeId"
|
|
:classId="clickNodeId"
|
|
|
/>
|
|
/>
|
|
|
</template>
|
|
</template>
|
|
@@ -136,30 +223,31 @@ import { IotInfoVO } from '@/api/pms/iotinfo'
|
|
|
import { ref, onMounted, onUnmounted } from 'vue'
|
|
import { ref, onMounted, onUnmounted } from 'vue'
|
|
|
|
|
|
|
|
import PmsTree from '@/views/system/tree/PmsTree.vue'
|
|
import PmsTree from '@/views/system/tree/PmsTree.vue'
|
|
|
-import {CACHE_KEY, useCache} from "@/hooks/web/useCache";
|
|
|
|
|
-import {DICT_TYPE, getStrDictOptions} from "@/utils/dict";
|
|
|
|
|
-import {IotInfoClassifyApi} from "@/api/pms/info";
|
|
|
|
|
-import {IotTreeApi} from "@/api/system/tree";
|
|
|
|
|
|
|
+import { CACHE_KEY, 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: 'IotTree' })
|
|
|
|
|
|
|
|
const container = ref(null)
|
|
const container = ref(null)
|
|
|
const leftWidth = ref(350) // 初始左侧宽度
|
|
const leftWidth = ref(350) // 初始左侧宽度
|
|
|
const rightWidth = ref(window.innerWidth * 0.8)
|
|
const rightWidth = ref(window.innerWidth * 0.8)
|
|
|
let isDragging = false
|
|
let isDragging = false
|
|
|
-const uploadLoading = ref(false);
|
|
|
|
|
|
|
+const uploadLoading = ref(false)
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-const searchFolderAndFile = async () =>{
|
|
|
|
|
|
|
+const searchFolderAndFile = async () => {
|
|
|
debugger
|
|
debugger
|
|
|
formLoading.value = true
|
|
formLoading.value = true
|
|
|
const data = await IotInfoApi.IotInfoApi.getAllChildContentFile(queryParams)
|
|
const data = await IotInfoApi.IotInfoApi.getAllChildContentFile(queryParams)
|
|
|
debugger
|
|
debugger
|
|
|
list.value = data
|
|
list.value = data
|
|
|
formLoading.value = false
|
|
formLoading.value = false
|
|
|
- queryParams.filename = "";
|
|
|
|
|
|
|
+ queryParams.filename = ''
|
|
|
}
|
|
}
|
|
|
const openWeb = (url) => {
|
|
const openWeb = (url) => {
|
|
|
- window.open('http://1.94.244.160:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(url)));
|
|
|
|
|
|
|
+ window.open(
|
|
|
|
|
+ 'http://1.94.244.160:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(url))
|
|
|
|
|
+ )
|
|
|
}
|
|
}
|
|
|
const handleView = (row) => {
|
|
const handleView = (row) => {
|
|
|
openForm('detail', row.id)
|
|
openForm('detail', row.id)
|
|
@@ -173,17 +261,15 @@ const topNodeId = ref('')
|
|
|
const successList = async (id) => {
|
|
const successList = async (id) => {
|
|
|
queryParams.classId = id
|
|
queryParams.classId = id
|
|
|
topNodeId.value = id
|
|
topNodeId.value = id
|
|
|
- const rootItem = breadcrumbs.value.find(item => item.type === 'root');
|
|
|
|
|
|
|
+ const rootItem = breadcrumbs.value.find((item) => item.type === 'root')
|
|
|
if (rootItem) {
|
|
if (rootItem) {
|
|
|
- rootItem.id = id;
|
|
|
|
|
|
|
+ rootItem.id = id
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
await getList()
|
|
await getList()
|
|
|
// queryParams.classId = ''
|
|
// queryParams.classId = ''
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
const onDrag = (e) => {
|
|
const onDrag = (e) => {
|
|
|
if (!isDragging) return
|
|
if (!isDragging) return
|
|
|
|
|
|
|
@@ -202,8 +288,6 @@ const stopDrag = () => {
|
|
|
document.removeEventListener('mouseup', stopDrag)
|
|
document.removeEventListener('mouseup', stopDrag)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
const queryFormRef = ref() // 搜索的表单
|
|
const queryFormRef = ref() // 搜索的表单
|
|
|
const { t } = useI18n() // 国际化
|
|
const { t } = useI18n() // 国际化
|
|
|
const message = useMessage() // 消息弹窗
|
|
const message = useMessage() // 消息弹窗
|
|
@@ -222,7 +306,7 @@ const queryParams = reactive({
|
|
|
deviceId: null,
|
|
deviceId: null,
|
|
|
classId: null,
|
|
classId: null,
|
|
|
deptId: undefined,
|
|
deptId: undefined,
|
|
|
- allName: null,
|
|
|
|
|
|
|
+ allName: null
|
|
|
})
|
|
})
|
|
|
// SPU 表单数据
|
|
// SPU 表单数据
|
|
|
const formData = ref({
|
|
const formData = ref({
|
|
@@ -253,12 +337,12 @@ const handleDownload = async (url) => {
|
|
|
console.error('下载失败:', error)
|
|
console.error('下载失败:', error)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-const deleteInfo= async (id) =>{
|
|
|
|
|
|
|
+const deleteInfo = async (id) => {
|
|
|
await message.delConfirm()
|
|
await message.delConfirm()
|
|
|
- await IotInfoApi.IotInfoApi.deleteIotInfo(id).then(res=>{
|
|
|
|
|
|
|
+ await IotInfoApi.IotInfoApi.deleteIotInfo(id).then((res) => {
|
|
|
if (res) {
|
|
if (res) {
|
|
|
message.success('文件删除成功')
|
|
message.success('文件删除成功')
|
|
|
- getList();
|
|
|
|
|
|
|
+ getList()
|
|
|
} else {
|
|
} else {
|
|
|
message.error('文件删除失败')
|
|
message.error('文件删除失败')
|
|
|
}
|
|
}
|
|
@@ -294,9 +378,9 @@ const openForm = async (type: string, id?: number) => {
|
|
|
formRef.value.open(type, id)
|
|
formRef.value.open(type, id)
|
|
|
await new Promise((resolve) => {
|
|
await new Promise((resolve) => {
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
- resolve(); // 操作完成后resolve
|
|
|
|
|
- }, 2000); // 模拟2秒耗时
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ resolve() // 操作完成后resolve
|
|
|
|
|
+ }, 2000) // 模拟2秒耗时
|
|
|
|
|
+ })
|
|
|
uploadLoading.value = false
|
|
uploadLoading.value = false
|
|
|
}
|
|
}
|
|
|
const deviceId = ref('')
|
|
const deviceId = ref('')
|
|
@@ -305,13 +389,13 @@ const nodeId = ref('')
|
|
|
const classType = ref('')
|
|
const classType = ref('')
|
|
|
|
|
|
|
|
const breadcrumbs = ref([
|
|
const breadcrumbs = ref([
|
|
|
- { id: null, name: '科瑞石油技术',type:'root' } // 根节点
|
|
|
|
|
|
|
+ { id: null, name: '科瑞石油技术', type: 'root' } // 根节点
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
// 共享的面包屑更新逻辑
|
|
// 共享的面包屑更新逻辑
|
|
|
const updateBreadcrumbs = async (node) => {
|
|
const updateBreadcrumbs = async (node) => {
|
|
|
// 查找当前节点是否已在面包屑中
|
|
// 查找当前节点是否已在面包屑中
|
|
|
- const currentIndex = breadcrumbs.value.findIndex(item => item.id === node.id)
|
|
|
|
|
|
|
+ const currentIndex = breadcrumbs.value.findIndex((item) => item.id === node.id)
|
|
|
|
|
|
|
|
if (currentIndex > -1) {
|
|
if (currentIndex > -1) {
|
|
|
// 如果已存在则截断后面的节点
|
|
// 如果已存在则截断后面的节点
|
|
@@ -322,15 +406,18 @@ const updateBreadcrumbs = async (node) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 更新表格数据
|
|
// 更新表格数据
|
|
|
- queryParams.classId = node.id;
|
|
|
|
|
|
|
+ queryParams.classId = node.id
|
|
|
const data = await IotInfoApi.IotInfoApi.getChildContentFile(queryParams)
|
|
const data = await IotInfoApi.IotInfoApi.getChildContentFile(queryParams)
|
|
|
list.value = data
|
|
list.value = data
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 表格行点击事件
|
|
// 表格行点击事件
|
|
|
const inContent = async (row) => {
|
|
const inContent = async (row) => {
|
|
|
- if (row.fileType!='content') {
|
|
|
|
|
- window.open('http://doc.deepoil.cc:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(row.filePath)));
|
|
|
|
|
|
|
+ if (row.fileType != 'content') {
|
|
|
|
|
+ window.open(
|
|
|
|
|
+ 'http://doc.deepoil.cc:8012/onlinePreview?url=' +
|
|
|
|
|
+ encodeURIComponent(Base64.encode(row.filePath))
|
|
|
|
|
+ )
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
queryParams.filename = ''
|
|
queryParams.filename = ''
|
|
@@ -338,7 +425,7 @@ const inContent = async (row) => {
|
|
|
// 调用共享方法更新面包屑和表格
|
|
// 调用共享方法更新面包屑和表格
|
|
|
await updateBreadcrumbs(row)
|
|
await updateBreadcrumbs(row)
|
|
|
// 可以添加其他表格行点击需要的逻辑
|
|
// 可以添加其他表格行点击需要的逻辑
|
|
|
- queryParams.classId = row.id;
|
|
|
|
|
|
|
+ queryParams.classId = row.id
|
|
|
nodeId.value = row.id
|
|
nodeId.value = row.id
|
|
|
const data = await IotInfoApi.IotInfoApi.getChildContentFile(queryParams)
|
|
const data = await IotInfoApi.IotInfoApi.getChildContentFile(queryParams)
|
|
|
formLoading.value = false
|
|
formLoading.value = false
|
|
@@ -348,33 +435,33 @@ const inContent = async (row) => {
|
|
|
// 文件树节点点击事件
|
|
// 文件树节点点击事件
|
|
|
const handleFileNodeClick = async (row) => {
|
|
const handleFileNodeClick = async (row) => {
|
|
|
queryParams.filename = ''
|
|
queryParams.filename = ''
|
|
|
- const parentItems = await IotTreeApi.getParentIds(row.id);
|
|
|
|
|
- breadcrumbs.value = [];
|
|
|
|
|
- parentItems.forEach(item => {
|
|
|
|
|
- breadcrumbs.value.push({ id: item.id, name: item.name,type:'root' } );
|
|
|
|
|
|
|
+ const parentItems = await IotTreeApi.getParentIds(row.id)
|
|
|
|
|
+ breadcrumbs.value = []
|
|
|
|
|
+ parentItems.forEach((item) => {
|
|
|
|
|
+ breadcrumbs.value.push({ id: item.id, name: item.name, type: 'root' })
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
queryParams.classId = row.id
|
|
queryParams.classId = row.id
|
|
|
- if (row.type=='device') {
|
|
|
|
|
|
|
+ if (row.type == 'device') {
|
|
|
id.value = row.originId
|
|
id.value = row.originId
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
classType.value = row.type
|
|
classType.value = row.type
|
|
|
- if (row.type==='device') {
|
|
|
|
|
|
|
+ if (row.type === 'device') {
|
|
|
deviceId.value = row.originId
|
|
deviceId.value = row.originId
|
|
|
const queryParam = {
|
|
const queryParam = {
|
|
|
deviceId: row.originId,
|
|
deviceId: row.originId,
|
|
|
pageNo: 1,
|
|
pageNo: 1,
|
|
|
- pagesize: 10,
|
|
|
|
|
|
|
+ pagesize: 10
|
|
|
}
|
|
}
|
|
|
const data = await IotInfoClassifyApi.getIotInfoClassifyPage(queryParam)
|
|
const data = await IotInfoClassifyApi.getIotInfoClassifyPage(queryParam)
|
|
|
- if (data){
|
|
|
|
|
- const target = data.filter((item)=> item.parentId===0)
|
|
|
|
|
|
|
+ if (data) {
|
|
|
|
|
+ const target = data.filter((item) => item.parentId === 0)
|
|
|
clickNodeId.value = target[0].id
|
|
clickNodeId.value = target[0].id
|
|
|
}
|
|
}
|
|
|
- } else if (row.type === 'file'){
|
|
|
|
|
|
|
+ } else if (row.type === 'file') {
|
|
|
clickNodeId.value = row.originId
|
|
clickNodeId.value = row.originId
|
|
|
- } else if (row.type==='dept') {
|
|
|
|
|
|
|
+ } else if (row.type === 'dept') {
|
|
|
// message.error("请选择设备及文件节点")
|
|
// message.error("请选择设备及文件节点")
|
|
|
// return
|
|
// return
|
|
|
}
|
|
}
|
|
@@ -395,7 +482,7 @@ const handleBreadcrumbClick = async (index) => {
|
|
|
|
|
|
|
|
// 获取对应节点的数据
|
|
// 获取对应节点的数据
|
|
|
let targetId = targetBreadcrumbs[index].id
|
|
let targetId = targetBreadcrumbs[index].id
|
|
|
- if (!targetId){
|
|
|
|
|
|
|
+ if (!targetId) {
|
|
|
targetId = topNodeId.value
|
|
targetId = topNodeId.value
|
|
|
}
|
|
}
|
|
|
queryParams.classId = targetId
|
|
queryParams.classId = targetId
|
|
@@ -407,7 +494,6 @@ const handleBreadcrumbClick = async (index) => {
|
|
|
formLoading.value = false
|
|
formLoading.value = false
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// const handleFileNodeClick = async (row) => {
|
|
// const handleFileNodeClick = async (row) => {
|
|
|
// queryParams.classId = row.id
|
|
// queryParams.classId = row.id
|
|
|
// classType.value = row.type
|
|
// classType.value = row.type
|
|
@@ -518,7 +604,6 @@ onMounted(async () => {
|
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
.custom-table {
|
|
.custom-table {
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
--el-table-row-hover-bg-color: #f5f7fa; /* 优化悬停背景色 */
|
|
--el-table-row-hover-bg-color: #f5f7fa; /* 优化悬停背景色 */
|