fix : 替换文件下载方式
This commit is contained in:
@@ -61,7 +61,7 @@
|
|||||||
<script setup lang="jsx">
|
<script setup lang="jsx">
|
||||||
import {useAuthStore} from '@/stores/userstore.js'
|
import {useAuthStore} from '@/stores/userstore.js'
|
||||||
import {useProcessStore} from '@/stores/processStore.js';
|
import {useProcessStore} from '@/stores/processStore.js';
|
||||||
import {getWorkflowInfo, addRequirement, getFormInfo, resubmit, deleteFile} from "@/api/project-demand/index.js";
|
import {getWorkflowInfo, addRequirement, getFormInfo, resubmit, deleteFile,downloadFile} from "@/api/project-demand/index.js";
|
||||||
import FileUpload from "@/components/FileUpload.vue";
|
import FileUpload from "@/components/FileUpload.vue";
|
||||||
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
|
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
|
||||||
import {ElMessage, ElMessageBox} from "element-plus";
|
import {ElMessage, ElMessageBox} from "element-plus";
|
||||||
@@ -138,7 +138,7 @@ const tableConfig = reactive({
|
|||||||
currentRender: ({row, index}) => {
|
currentRender: ({row, index}) => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<a style="cursor: pointer;font-size: 14px;color: #2a99ff;" href={row.url}>下载</a>
|
<el-button type="primary" link onClick={() => handleDownload(row)}>下载</el-button>
|
||||||
<el-button type="primary" size="large" link onClick={() => handleDelete(row)}>删除</el-button>
|
<el-button type="primary" size="large" link onClick={() => handleDelete(row)}>删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@@ -146,6 +146,16 @@ const tableConfig = reactive({
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const handleDownload = (row) => {
|
||||||
|
downloadFile(row.fileId).then(res => {
|
||||||
|
const blob = new Blob([res])
|
||||||
|
let a = document.createElement('a')
|
||||||
|
a.href=URL.createObjectURL(blob)
|
||||||
|
a.download = row.originalFileName
|
||||||
|
a.click()
|
||||||
|
})
|
||||||
|
}
|
||||||
const compositeParam = (item) => {
|
const compositeParam = (item) => {
|
||||||
let tag=''
|
let tag=''
|
||||||
if(!formData.value.collectType&&router.currentRoute.value.name==='Collection/add'){
|
if(!formData.value.collectType&&router.currentRoute.value.name==='Collection/add'){
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="jsx">
|
<script setup lang="jsx">
|
||||||
|
import {downloadFile} from "@/api/project-demand";
|
||||||
|
|
||||||
const searchConfig = reactive([
|
const searchConfig = reactive([
|
||||||
{
|
{
|
||||||
label: '关键词',
|
label: '关键词',
|
||||||
@@ -53,7 +55,7 @@ const tableConfig = reactive({
|
|||||||
currentRender: ({row, index}) => {
|
currentRender: ({row, index}) => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<a style="cursor: pointer;font-size: 14px;color: #2a99ff;" href={row.url}>下载</a>
|
<el-button type="primary" link onClick={() => handleDownload(row)}>下载</el-button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -64,6 +66,15 @@ const showTable=ref(true)
|
|||||||
const otherFileList = ref([])
|
const otherFileList = ref([])
|
||||||
const getOtherFile = () => {
|
const getOtherFile = () => {
|
||||||
|
|
||||||
|
}
|
||||||
|
const handleDownload = (row) => {
|
||||||
|
downloadFile(row.fileId).then(res => {
|
||||||
|
const blob = new Blob([res])
|
||||||
|
let a = document.createElement('a')
|
||||||
|
a.href=URL.createObjectURL(blob)
|
||||||
|
a.download = row.originalFileName
|
||||||
|
a.click()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
<script setup lang="jsx">
|
<script setup lang="jsx">
|
||||||
import FileUpload from "@/components/FileUpload.vue";
|
import FileUpload from "@/components/FileUpload.vue";
|
||||||
|
import {downloadFile} from "@/api/project-demand";
|
||||||
|
|
||||||
const formData = ref({})
|
const formData = ref({})
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
@@ -72,7 +73,7 @@ const tableConfig = reactive({
|
|||||||
currentRender: ({row, index}) => {
|
currentRender: ({row, index}) => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<a style="cursor: pointer;font-size: 14px;color: #2a99ff;" href={row.url}>下载</a>
|
<el-button type="primary" link onClick={() => handleDownload(row)}>下载</el-button>
|
||||||
<el-button type="primary" size="large" link onClick={() => beforeRemove(row)}>删除</el-button>
|
<el-button type="primary" size="large" link onClick={() => beforeRemove(row)}>删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@@ -80,7 +81,15 @@ const tableConfig = reactive({
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
const handleDownload = (row) => {
|
||||||
|
downloadFile(row.fileId).then(res => {
|
||||||
|
const blob = new Blob([res])
|
||||||
|
let a = document.createElement('a')
|
||||||
|
a.href=URL.createObjectURL(blob)
|
||||||
|
a.download = row.originalFileName
|
||||||
|
a.click()
|
||||||
|
})
|
||||||
|
}
|
||||||
const compositeParam = (item) => {
|
const compositeParam = (item) => {
|
||||||
return {
|
return {
|
||||||
fileId: item.id,
|
fileId: item.id,
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<script setup lang="jsx">
|
<script setup lang="jsx">
|
||||||
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
||||||
import {shallowRef} from "vue";
|
import {shallowRef} from "vue";
|
||||||
|
import {downloadFile} from "@/api/project-demand";
|
||||||
|
|
||||||
const searchConfig = reactive([
|
const searchConfig = reactive([
|
||||||
{
|
{
|
||||||
@@ -59,7 +60,7 @@ const tableConfig = reactive({
|
|||||||
currentRender: ({row, index}) => {
|
currentRender: ({row, index}) => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<a style="cursor: pointer;font-size: 14px;color: #2a99ff;" href={row.url}>下载</a>
|
<el-button type="primary" link onClick={() => handleDownload(row)}>下载</el-button>
|
||||||
<el-button type="primary" size="large" link onClick={() => beforeRemove(row)}>删除</el-button>
|
<el-button type="primary" size="large" link onClick={() => beforeRemove(row)}>删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@@ -71,6 +72,15 @@ const showTable=ref(true)
|
|||||||
const otherFileList = ref([])
|
const otherFileList = ref([])
|
||||||
const getOtherFile = () => {
|
const getOtherFile = () => {
|
||||||
|
|
||||||
|
}
|
||||||
|
const handleDownload = (row) => {
|
||||||
|
downloadFile(row.fileId).then(res => {
|
||||||
|
const blob = new Blob([res])
|
||||||
|
let a = document.createElement('a')
|
||||||
|
a.href=URL.createObjectURL(blob)
|
||||||
|
a.download = row.originalFileName
|
||||||
|
a.click()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
<script setup lang="jsx">
|
<script setup lang="jsx">
|
||||||
import {useAuthStore} from '@/stores/userstore.js'
|
import {useAuthStore} from '@/stores/userstore.js'
|
||||||
import {useProcessStore} from '@/stores/processStore.js';
|
import {useProcessStore} from '@/stores/processStore.js';
|
||||||
import {getWorkflowInfo, addRequirement, getFormInfo, resubmit, deleteFile} from "@/api/project-demand/index.js";
|
import {getWorkflowInfo, addRequirement, getFormInfo, resubmit, deleteFile,downloadFile} from "@/api/project-demand/index.js";
|
||||||
import FileUpload from "@/components/FileUpload.vue";
|
import FileUpload from "@/components/FileUpload.vue";
|
||||||
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
|
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
|
||||||
import {ElMessage, ElMessageBox} from "element-plus";
|
import {ElMessage, ElMessageBox} from "element-plus";
|
||||||
@@ -135,7 +135,7 @@ const tableConfig = reactive({
|
|||||||
currentRender: ({row, index}) => {
|
currentRender: ({row, index}) => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<a style="cursor: pointer;font-size: 14px;color: #2a99ff;" href={row.url}>下载</a>
|
<el-button type="primary" link onClick={() => handleDownload(row)}>下载</el-button>
|
||||||
<el-button type="primary" size="large" link onClick={() => beforeRemove(row)}>删除</el-button>
|
<el-button type="primary" size="large" link onClick={() => beforeRemove(row)}>删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@@ -143,6 +143,15 @@ const tableConfig = reactive({
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
const handleDownload = (row) => {
|
||||||
|
downloadFile(row.fileId).then(res => {
|
||||||
|
const blob = new Blob([res])
|
||||||
|
let a = document.createElement('a')
|
||||||
|
a.href=URL.createObjectURL(blob)
|
||||||
|
a.download = row.originalFileName
|
||||||
|
a.click()
|
||||||
|
})
|
||||||
|
}
|
||||||
const compositeParam=(item)=>{
|
const compositeParam=(item)=>{
|
||||||
return {
|
return {
|
||||||
fileId: item.id,
|
fileId: item.id,
|
||||||
|
|||||||
@@ -79,12 +79,11 @@
|
|||||||
import OperationRender from '@/views/workflow/common/OperationRender.vue'
|
import OperationRender from '@/views/workflow/common/OperationRender.vue'
|
||||||
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue'
|
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue'
|
||||||
import {useProcessStore} from '@/stores/processStore.js';
|
import {useProcessStore} from '@/stores/processStore.js';
|
||||||
import {getInfo, agreeTask, rejectTask} from "@/api/project-demand/index.js";
|
import {getInfo, agreeTask, rejectTask,downloadFile} from "@/api/project-demand/index.js";
|
||||||
import {getSubCompOpt} from '@/api/user/user.js'
|
import {getSubCompOpt} from '@/api/user/user.js'
|
||||||
import {ElMessage} from "element-plus";
|
import {ElMessage} from "element-plus";
|
||||||
import {useRouter} from "vue-router";
|
import {useRouter} from "vue-router";
|
||||||
import {useTagsView} from '@/stores/tagsview.js'
|
import {useTagsView} from '@/stores/tagsview.js'
|
||||||
|
|
||||||
const tagsViewStore = useTagsView()
|
const tagsViewStore = useTagsView()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
@@ -131,11 +130,20 @@ const tableConfig = reactive({
|
|||||||
label: '操作',
|
label: '操作',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
currentRender: ({row, index}) => {
|
currentRender: ({row, index}) => {
|
||||||
return (<a style="cursor: pointer;font-size: 14px;color: #2a99ff;" href={row.url}>下载</a>)
|
return ( <el-button type="primary" link onClick={() => handleDownload(row)}>下载</el-button>)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
const handleDownload = (row) => {
|
||||||
|
downloadFile(row.fileId).then(res => {
|
||||||
|
const blob = new Blob([res])
|
||||||
|
let a = document.createElement('a')
|
||||||
|
a.href=URL.createObjectURL(blob)
|
||||||
|
a.download = row.originalFileName
|
||||||
|
a.click()
|
||||||
|
})
|
||||||
|
}
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
let approve = {
|
let approve = {
|
||||||
taskId: processInstanceData.value.taskId,
|
taskId: processInstanceData.value.taskId,
|
||||||
|
|||||||
Reference in New Issue
Block a user