提交代码
This commit is contained in:
parent
11690d21f3
commit
4843acb1b4
|
|
@ -24,4 +24,11 @@ export function remove(versionIds) {
|
|||
})
|
||||
}
|
||||
|
||||
export function annotationsExport(taskId) {
|
||||
return request({
|
||||
url: '/ai/annotations/export/' + taskId,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@ export default {
|
|||
const annotation = LS.annotationStore.addAnnotation({ userGenerate: true });
|
||||
LS.annotationStore.selectAnnotation(annotation.id);
|
||||
}
|
||||
this.changeButtonText(LS);
|
||||
},
|
||||
onSubmitAnnotation: (LS, annotation) => this.handleAnnotationSubmit(LS, annotation, task),
|
||||
onUpdateAnnotation:(LS, annotation) => this.handleAnnotationSubmit(LS, annotation, task),
|
||||
|
|
@ -140,6 +141,40 @@ export default {
|
|||
this.cleanupLabelStudio(); // 清理 LabelStudio 实例
|
||||
}
|
||||
},
|
||||
changeButtonText(LS) {
|
||||
const buttons = {
|
||||
'Undo': '撤销',
|
||||
'Redo': '重做',
|
||||
'Reset': '重置',
|
||||
'Submit': '提交',
|
||||
'Update':'更新'
|
||||
};
|
||||
|
||||
const updateButtonText = (element) => {
|
||||
const buttonElements = element.querySelectorAll('button');
|
||||
buttonElements.forEach((button) => {
|
||||
const text = button.textContent.trim();
|
||||
if (buttons[text]) {
|
||||
button.textContent = buttons[text];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const observer = new MutationObserver((mutations) => {
|
||||
mutations.forEach((mutation) => {
|
||||
if (mutation.type === 'childList') {
|
||||
mutation.addedNodes.forEach((node) => {
|
||||
if (node.nodeType === Node.ELEMENT_NODE) {
|
||||
updateButtonText(node);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.body, { childList: true, subtree: true });
|
||||
updateButtonText(document.body);
|
||||
},
|
||||
// 重置 LabelStudio
|
||||
resetLabelStudio() {
|
||||
this.cleanupLabelStudio();
|
||||
|
|
|
|||
|
|
@ -60,6 +60,13 @@
|
|||
<el-table-column label="已审核数量" align="center" show-overflow-tooltip prop="auditedCount" min-width="100" />
|
||||
<el-table-column label="操作" align="center" min-width="100" class-name="small-padding fixed-width" >
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleExport(scope.row)"
|
||||
v-hasPermi="['dataCenter:version:delete']"
|
||||
>导出</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
|
|
@ -83,7 +90,7 @@
|
|||
<script>
|
||||
|
||||
|
||||
import {list,remove} from '@/api/dataCenter/releaseVersion'
|
||||
import {list,remove,annotationsExport} from '@/api/dataCenter/releaseVersion'
|
||||
|
||||
|
||||
export default {
|
||||
|
|
@ -181,6 +188,10 @@ export default {
|
|||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handleExport(row){
|
||||
|
||||
this.download('/ai/annotations/export/' + row.taskId,{},new Date().getTime()+'.zip',{timeout: 600000})
|
||||
},
|
||||
handleDelete(row){
|
||||
const ids = row.versionId || this.ids;
|
||||
this.$modal.confirm('是否确认删除数据项?').then(function() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue