fix : 修复功能
This commit is contained in:
@@ -13,33 +13,11 @@
|
||||
>
|
||||
<el-button color="#DED0B2" :loading="loading">上传文件</el-button>
|
||||
</el-upload>
|
||||
<!-- <div v-if="showTable||fileList.length!==0">-->
|
||||
<!-- <el-table :data="fileList" style="width: 100%">-->
|
||||
<!-- <el-table-column label="序号" type="index" align="center" width="80"/>-->
|
||||
<!-- <el-table-column prop="originalFilename" label="文件名" align="center"/>-->
|
||||
<!-- <el-table-column prop="size" label="文件大小" align="center">-->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- {{ parseInt(scope.row.size / 1024) }}KB-->
|
||||
<!-- <!– {{ parseInt(scope.row.size / 1024) > 1024 ? 'MB' : 'KB' }}–>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column align="center" label="操作">-->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- <el-button link type="primary" size="small" @click="beforeRemove(scope.row)">-->
|
||||
<!-- 删除-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- </el-table>-->
|
||||
<!-- </div>-->
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {defineProps, computed, ref} from "vue";
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import {ElMessage} from "element-plus";
|
||||
import {getToken} from '@/utils/auth'
|
||||
import {deleteFile} from "@/api/project-demand";
|
||||
|
||||
const baseURL = import.meta.env.VITE_BASE_URL
|
||||
const uploadFileUrl = ref(baseURL + "/workflow/process/file/upload")
|
||||
const headers = reactive({
|
||||
@@ -99,26 +77,6 @@ const handleUploadSuccess = (res, file) => {
|
||||
fileList.value.push(data)
|
||||
emit("getFile", fileList.value)
|
||||
}
|
||||
const beforeRemove = (row) => {
|
||||
ElMessageBox.confirm(`确认删除名称为${row.originalFilename}的表格吗?`, '系统提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
handleRemove(row)
|
||||
}).catch(() => {
|
||||
ElMessage.warning("用户取消删除! ");
|
||||
})
|
||||
}
|
||||
|
||||
const handleRemove = (row) => {
|
||||
deleteFile(row.id).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success("删除成功");
|
||||
fileList.value.splice(fileList.value.findIndex((item) => item.id === row.id), 1);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user