增加附件删除功能
This commit is contained in:
parent
8100e75429
commit
52dbd09bd6
|
|
@ -61,3 +61,13 @@ export const regFileView = () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 附件删除
|
||||||
|
export const regFileDelete = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/rescue/reg/file/delete.htm',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,8 @@
|
||||||
|
|
||||||
.aboutUs {
|
.aboutUs {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-image: url(@/assets/bg2.png);
|
background: url(@/assets/bg2.png) center no-repeat;
|
||||||
background-size: 100% 100%;
|
background-size: auto 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<img src="@/assets/icons/区域.png" alt="区域" />
|
<img src="@/assets/icons/区域.png" alt="区域" />
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<div><span>2650</span>m²</div>
|
<div><span>2650</span>nmi²</div>
|
||||||
<div>专项涧查区斌题盖</div>
|
<div>专项调查区域覆盖</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
|
|
|
||||||
|
|
@ -221,7 +221,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20" v-if="rescueId">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="其他附件">
|
<el-form-item label="其他附件">
|
||||||
<el-button type="primary" @click="onFileList">查看附件</el-button>
|
<el-button type="primary" @click="onFileList">查看附件</el-button>
|
||||||
|
|
@ -231,7 +231,7 @@
|
||||||
|
|
||||||
<div class="btn-bar">
|
<div class="btn-bar">
|
||||||
<el-button type="primary" @click="submitForm(ruleFormRef)">保存</el-button>
|
<el-button type="primary" @click="submitForm(ruleFormRef)">保存</el-button>
|
||||||
<el-button @click="resetForm(ruleFormRef)">取消</el-button>
|
<el-button @click="resetForm">取消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
|
|
@ -240,7 +240,7 @@
|
||||||
<el-upload
|
<el-upload
|
||||||
v-model:file-list="fileList"
|
v-model:file-list="fileList"
|
||||||
class="upload-demo"
|
class="upload-demo"
|
||||||
action="http://crm.hzzxq.com/ds/rescue/reg/file/upload.htm"
|
:action="uploadUrl"
|
||||||
:show-file-list="false"
|
:show-file-list="false"
|
||||||
:data="{
|
:data="{
|
||||||
rescue_id: rescueId
|
rescue_id: rescueId
|
||||||
|
|
@ -260,6 +260,18 @@
|
||||||
<el-table-column label="操作" width="150" align="center">
|
<el-table-column label="操作" width="150" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" size="small" @click="handleDownload(scope.row.tsy_id)">下载</el-button>
|
<el-button link type="primary" size="small" @click="handleDownload(scope.row.tsy_id)">下载</el-button>
|
||||||
|
<el-popconfirm
|
||||||
|
confirm-button-text="确定"
|
||||||
|
cancel-button-text="取消"
|
||||||
|
:icon="InfoFilled"
|
||||||
|
icon-color="#626AEF"
|
||||||
|
title="是否确认删除?"
|
||||||
|
@confirm="handleDelete(scope.row.tsy_id)"
|
||||||
|
>
|
||||||
|
<template #reference>
|
||||||
|
<el-button link type="primary" size="small">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-popconfirm>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -268,12 +280,15 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import axios from 'axios'
|
|
||||||
import { reactive, ref, onMounted } from 'vue'
|
import { reactive, ref, onMounted } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import {useRoute, useRouter} from 'vue-router'
|
||||||
import type { ComponentSize, FormInstance } from 'element-plus'
|
import type { ComponentSize, FormInstance } from 'element-plus'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { getParam, voyageReg, regEdit, regFind, regFileList } from '@/api/task.js'
|
import { InfoFilled } from '@element-plus/icons-vue'
|
||||||
|
import { getParam, voyageReg, regEdit, regFind, regFileList, regFileDelete } from '@/api/task.js'
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const uploadUrl = import.meta.env.VITE_APP_BASE_API + '/rescue/reg/file/upload.htm'
|
||||||
|
|
||||||
const dialogTableVisible = ref(false)
|
const dialogTableVisible = ref(false)
|
||||||
const fileList = ref([])
|
const fileList = ref([])
|
||||||
|
|
@ -404,9 +419,8 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const resetForm = (formEl: FormInstance | undefined) => {
|
const resetForm = () => {
|
||||||
if (!formEl) return
|
router.push('/search')
|
||||||
formEl.resetFields()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取任务详情
|
// 获取任务详情
|
||||||
|
|
@ -443,17 +457,27 @@ const onSuccess = () => {
|
||||||
|
|
||||||
// 文件下载
|
// 文件下载
|
||||||
const handleDownload = async (fileId) => {
|
const handleDownload = async (fileId) => {
|
||||||
console.log(`${import.meta.env.VITE_APP_BASE_API}/rescue/reg/file/download.htm?file_id=${fileId}`)
|
|
||||||
window.open(`${import.meta.env.VITE_APP_BASE_API}/rescue/reg/file/download.htm?file_id=${fileId}`)
|
window.open(`${import.meta.env.VITE_APP_BASE_API}/rescue/reg/file/download.htm?file_id=${fileId}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 文件删除
|
||||||
|
const handleDelete = (fileId) => {
|
||||||
|
regFileDelete({
|
||||||
|
file_id: fileId
|
||||||
|
}).then(res => {
|
||||||
|
regFileList({rescue_id: rescueId}).then(res => {
|
||||||
|
fileData.value = res.array
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const VoyageSocketUrl = ref('')
|
const VoyageSocketUrl = ref('')
|
||||||
// 获取系统参数列表
|
// 获取系统参数列表
|
||||||
const getParamsList = () => {
|
const getParamsList = () => {
|
||||||
getParam().then(res => {
|
getParam().then(res => {
|
||||||
const data = res.array.find(item => item.param_name === 'VoyageSocketUrl')
|
const data = res.array.find(item => item.param_name === 'VoyageSocketUrl')
|
||||||
|
|
||||||
if (data.param_value) {
|
if (data?.param_value) {
|
||||||
VoyageSocketUrl.value = data.param_value
|
VoyageSocketUrl.value = data.param_value
|
||||||
} else {
|
} else {
|
||||||
VoyageSocketUrl.value = `${window.location.protocol}//${window.location.hostname}:${window.location.port}/ds/`
|
VoyageSocketUrl.value = `${window.location.protocol}//${window.location.hostname}:${window.location.port}/ds/`
|
||||||
|
|
|
||||||
|
|
@ -35,11 +35,11 @@
|
||||||
<el-option label="否" value="否" />
|
<el-option label="否" value="否" />
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
<el-button size="large" :icon="Search" type="primary" @click="handleSearch">检索</el-button>
|
<el-button size="large" :icon="RefreshLeft" @click="handleReset">重置</el-button>
|
||||||
|
<el-button size="large" :icon="Search" type="primary" @click="handleSearch" style="margin-left: 0;">检索</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<el-button size="large" type="primary">批量导入</el-button>
|
<el-button size="large" type="success" @click="handleInput">任务录入</el-button>
|
||||||
<el-button size="large" type="success" @click="handleInput">航次录入</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -115,7 +115,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref, onMounted } from 'vue'
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { Search } from '@element-plus/icons-vue'
|
import { Search, RefreshLeft } from '@element-plus/icons-vue'
|
||||||
import { regPage } from '@/api/task.js'
|
import { regPage } from '@/api/task.js'
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
@ -136,6 +136,16 @@ const handleSearch = () => {
|
||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleReset = () => {
|
||||||
|
searchQuery.value = ''
|
||||||
|
rescueType.value = ''
|
||||||
|
rescueResponseLevel.value = ''
|
||||||
|
rescueSecrecy.value = ''
|
||||||
|
start.value = 0
|
||||||
|
currentPage.value = 1
|
||||||
|
getDataList()
|
||||||
|
}
|
||||||
|
|
||||||
const handleInput = () => {
|
const handleInput = () => {
|
||||||
router.push('/input')
|
router.push('/input')
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue