This commit is contained in:
parent
54ca0a37e3
commit
114a21038a
|
|
@ -92,6 +92,13 @@ export function updateRectificationApi(data) {
|
|||
data:data,
|
||||
})
|
||||
}
|
||||
export function deleteRectificationApi(data) {
|
||||
return request({
|
||||
url: '/blade-system/fileManage/delRectification',
|
||||
method: 'post',
|
||||
data:data,
|
||||
})
|
||||
}
|
||||
|
||||
// 删除档案目录
|
||||
export function delFileManageApi(data) {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,16 @@
|
|||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<!-- 移除按钮 -->
|
||||
<el-button
|
||||
:size="size"
|
||||
type="danger"
|
||||
link
|
||||
:icon="Delete"
|
||||
@click="handleRemove(row)"
|
||||
>
|
||||
移除
|
||||
</el-button>
|
||||
</template>
|
||||
</avue-crud>
|
||||
</el-card>
|
||||
|
|
@ -64,11 +74,12 @@
|
|||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { Edit } from '@element-plus/icons-vue';
|
||||
import { ElMessage,ElMessageBox} from 'element-plus';
|
||||
import { Edit,Delete } from '@element-plus/icons-vue';
|
||||
import {
|
||||
selectRectificationListApi,
|
||||
updateRectificationApi
|
||||
updateRectificationApi,
|
||||
deleteRectificationApi
|
||||
} from '@/api/archivesManagement/fileManager/fileManager.js';
|
||||
|
||||
const route = useRoute();
|
||||
|
|
@ -218,6 +229,44 @@ const submitEdit = async () => {
|
|||
submitLoading.value = false;
|
||||
}
|
||||
};
|
||||
// 移除整改项
|
||||
const handleRemove = async (row) => {
|
||||
// 安全检查
|
||||
if (!row.id || !row.fileId) {
|
||||
ElMessage.warning('缺少必要参数,无法移除')
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
'确定要移除该整改项吗?',
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}
|
||||
)
|
||||
|
||||
const res = await deleteRectificationApi({
|
||||
id: row.id,
|
||||
fileId: row.fileId
|
||||
})
|
||||
|
||||
if (res.data?.code === 200) {
|
||||
ElMessage.success('移除成功')
|
||||
onLoad()
|
||||
} else {
|
||||
ElMessage.error(res.data?.msg || '移除失败')
|
||||
}
|
||||
} catch (error) {
|
||||
if (error === 'cancel') {
|
||||
return // 用户取消,不处理
|
||||
}
|
||||
ElMessage.error('移除失败:' + (error.message || '请检查网络或参数'))
|
||||
console.error('删除请求异常:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 初始加载
|
||||
onMounted(() => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue