|
@@ -104,12 +104,12 @@
|
|
<el-table-column :label="t('file.operation') " align="center" width="160">
|
|
<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']">
|
|
|
|
|
|
+ <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')}}
|
|
<Icon icon="ep:download" />{{t('file.dow')}}
|
|
</el-button>
|
|
</el-button>
|
|
-<!-- <el-button type="primary" link @click="handleView( scope.row)">-->
|
|
|
|
-<!-- <Icon icon="ep:view" />{{t('file.preview')}}-->
|
|
|
|
-<!-- </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>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -250,6 +250,17 @@ const handleDownload = async (url) => {
|
|
console.error('下载失败:', error)
|
|
console.error('下载失败:', error)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+const deleteInfo= async (id) =>{
|
|
|
|
+ await message.delConfirm()
|
|
|
|
+ await IotInfoApi.IotInfoApi.deleteIotInfo(id).then(res=>{
|
|
|
|
+ if (res) {
|
|
|
|
+ message.success('文件删除成功')
|
|
|
|
+ getList();
|
|
|
|
+ } else {
|
|
|
|
+ message.error('文件删除失败')
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+}
|
|
const handleFileView = (url: string) => {
|
|
const handleFileView = (url: string) => {
|
|
window.open(
|
|
window.open(
|
|
'http://1.94.244.160:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(url))
|
|
'http://1.94.244.160:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(url))
|