|
@@ -336,6 +336,15 @@
|
|
|
fixed="right"
|
|
fixed="right"
|
|
|
>
|
|
>
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ text
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ :icon="Monitor"
|
|
|
|
|
+ size="large"
|
|
|
|
|
+ @click="projectPreview(scope.row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ 预览
|
|
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
<el-button
|
|
|
text
|
|
text
|
|
|
type="primary"
|
|
type="primary"
|
|
@@ -664,6 +673,10 @@
|
|
|
/>
|
|
/>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
+<!-- <el-dialog-->
|
|
|
|
|
+<!-- v-model=""-->
|
|
|
|
|
+<!-- title="状态和类型编辑"-->
|
|
|
|
|
+<!-- width="40%"></el-dialog>-->
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -672,7 +685,7 @@ import { getProjectMessage, editProject } from '@/api/project'
|
|
|
import { onMounted, reactive, ref } from 'vue'
|
|
import { onMounted, reactive, ref } from 'vue'
|
|
|
import { getAllUsers } from '@/api/user'
|
|
import { getAllUsers } from '@/api/user'
|
|
|
import { queryFileList, createProjectFile, downloadProjectFile, deleteProjectFile, deleteProjectFiles } from '@/api/file'
|
|
import { queryFileList, createProjectFile, downloadProjectFile, deleteProjectFile, deleteProjectFiles } from '@/api/file'
|
|
|
-import { Download, Upload, Delete, Search, RefreshLeft, Edit } from '@element-plus/icons-vue'
|
|
|
|
|
|
|
+import { Download, Upload, Delete, Search, RefreshLeft, Edit, Monitor } from '@element-plus/icons-vue'
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
import OptionEdit from './components/optionEdit.vue'
|
|
import OptionEdit from './components/optionEdit.vue'
|
|
|
import { editorData } from '@/pinia/project/project'
|
|
import { editorData } from '@/pinia/project/project'
|
|
@@ -793,6 +806,11 @@ onMounted(() => {
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+const projectPreview = (data) => {
|
|
|
|
|
+ fileDownload(data).then(res => {
|
|
|
|
|
+ console.log('返回的文件', res)
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
// 初始化项目数据
|
|
// 初始化项目数据
|
|
|
const projectMessage = (code) => {
|
|
const projectMessage = (code) => {
|
|
|
getProjectMessage(code).then(res => {
|
|
getProjectMessage(code).then(res => {
|
|
@@ -937,7 +955,7 @@ const downloadTips = () => {
|
|
|
}
|
|
}
|
|
|
downloadProjectFile(data).then(res => {
|
|
downloadProjectFile(data).then(res => {
|
|
|
const link = document.createElement('a')
|
|
const link = document.createElement('a')
|
|
|
- const href = window.URL.createObjectURL(res) // 创建下载的链接
|
|
|
|
|
|
|
+ const href = window.URL.createObjectURL(res.data) // 创建下载的链接
|
|
|
link.href = href
|
|
link.href = href
|
|
|
link.download = route.query.code + '.zip' // 下载后文件名
|
|
link.download = route.query.code + '.zip' // 下载后文件名
|
|
|
document.body.appendChild(link)
|
|
document.body.appendChild(link)
|
|
@@ -953,12 +971,12 @@ const downloadTips = () => {
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
// 单文件下载
|
|
// 单文件下载
|
|
|
const oneDownload = async(val) => {
|
|
const oneDownload = async(val) => {
|
|
|
await fileDownload(val).then(res => {
|
|
await fileDownload(val).then(res => {
|
|
|
|
|
+ console.log('返回结果', res)
|
|
|
const link = document.createElement('a')
|
|
const link = document.createElement('a')
|
|
|
- const href = window.URL.createObjectURL(res) // 创建下载的链接
|
|
|
|
|
|
|
+ const href = window.URL.createObjectURL(res.data) // 创建下载的链接
|
|
|
link.href = href
|
|
link.href = href
|
|
|
link.download = val.name // 下载后文件名
|
|
link.download = val.name // 下载后文件名
|
|
|
document.body.appendChild(link)
|
|
document.body.appendChild(link)
|
|
@@ -1078,3 +1096,4 @@ const openOptionEdit = () => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|
|
|
|
|
+
|