提交代码
parent
1f4b91d8d8
commit
dac0fcc10b
|
@ -11,6 +11,7 @@ import '@logicflow/core/dist/style/index.css';
|
||||||
import { Menu } from "@logicflow/extension";
|
import { Menu } from "@logicflow/extension";
|
||||||
import AiNodeExtension from '@/components/flow/index'
|
import AiNodeExtension from '@/components/flow/index'
|
||||||
import RegisteMenu from '@/components/flow/menu.js'
|
import RegisteMenu from '@/components/flow/menu.js'
|
||||||
|
import OperatorApi from '@/api/operator'
|
||||||
const emit = defineEmits(["initLf", "updateNode", "nodeClick"])
|
const emit = defineEmits(["initLf", "updateNode", "nodeClick"])
|
||||||
const themeApprove = {
|
const themeApprove = {
|
||||||
rect: { // 矩形样式
|
rect: { // 矩形样式
|
||||||
|
@ -66,10 +67,13 @@ const initEvent = (lf) => {
|
||||||
emit("nodeClick", node)
|
emit("nodeClick", node)
|
||||||
});
|
});
|
||||||
lf.on("node:dnd-add", data => {
|
lf.on("node:dnd-add", data => {
|
||||||
nodeData = data.data;
|
//OperatorApi.findOne(data.data.properties.data.id).then(res => {
|
||||||
showProp.value = true
|
// data.data.properties.data.parameters = res.data.data.parameters;
|
||||||
nodePropKey.value++
|
nodeData = data.data;
|
||||||
doUpdateState()
|
showProp.value = true
|
||||||
|
nodePropKey.value++
|
||||||
|
doUpdateState()
|
||||||
|
// });
|
||||||
});
|
});
|
||||||
lf.on("anchor:dragend", (a, b, c) => {
|
lf.on("anchor:dragend", (a, b, c) => {
|
||||||
updateEdges(a, b, c);
|
updateEdges(a, b, c);
|
||||||
|
|
|
@ -58,7 +58,9 @@ const dragNode = (it, t) => {
|
||||||
if (t == 5) {
|
if (t == 5) {
|
||||||
color = '#4C8DD1';
|
color = '#4C8DD1';
|
||||||
}
|
}
|
||||||
props.lf.dnd.startDrag({
|
OperApi.findOne(it.operator_id).then(res => {
|
||||||
|
it.parameters = res.data.data.parameters;
|
||||||
|
props.lf.dnd.startDrag({
|
||||||
type: 'ai-node',
|
type: 'ai-node',
|
||||||
text: it.text,
|
text: it.text,
|
||||||
properties: {
|
properties: {
|
||||||
|
@ -67,6 +69,7 @@ const dragNode = (it, t) => {
|
||||||
data: it
|
data: it
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
});
|
||||||
}
|
}
|
||||||
const info = reactive({
|
const info = reactive({
|
||||||
list1: [],
|
list1: [],
|
||||||
|
@ -150,7 +153,7 @@ const initData = () => {
|
||||||
info.list2 = tmps.filter(d => d.oper_main_type == "post_process");
|
info.list2 = tmps.filter(d => d.oper_main_type == "post_process");
|
||||||
info.list3 = tmps.filter(d => d.oper_main_type == "inference");
|
info.list3 = tmps.filter(d => d.oper_main_type == "inference");
|
||||||
info.list4 = tmps.filter(d => d.oper_main_type == "data_source");
|
info.list4 = tmps.filter(d => d.oper_main_type == "data_source");
|
||||||
info.list5 = tmps.filter(d => d.oper_main_type == "data_report");
|
info.list5 = tmps.filter(d => d.oper_main_type == "data_reporter");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
|
@ -111,7 +111,7 @@
|
||||||
<el-button type="primary" @click="handleSubmit"><i-ep-check />确 定</el-button>
|
<el-button type="primary" @click="handleSubmit"><i-ep-check />确 定</el-button>
|
||||||
<el-button @click="closeBack"><i-ep-close />取 消</el-button>
|
<el-button @click="closeBack"><i-ep-close />取 消</el-button>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-dialog v-model="dialogVisible" title="上传标注图片" width="880" append-to-body style="max-height:600px;">
|
<el-dialog v-model="dialogVisible" title="上传标注图片" width="880" append-to-body style="max-height:650px;">
|
||||||
<el-card v-loading.fullscreen.lock="uploadLoading">
|
<el-card v-loading.fullscreen.lock="uploadLoading">
|
||||||
<el-upload v-model:file-list="uploadImgFileList" class="upload-demo upload-demo-3"
|
<el-upload v-model:file-list="uploadImgFileList" class="upload-demo upload-demo-3"
|
||||||
:before-remove="handleRemoveFiles" :auto-upload="autoUpload" :on-change="handleChangeFiles"
|
:before-remove="handleRemoveFiles" :auto-upload="autoUpload" :on-change="handleChangeFiles"
|
||||||
|
@ -130,7 +130,7 @@
|
||||||
<!-- 弹窗底部操作按钮 -->
|
<!-- 弹窗底部操作按钮 -->
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<el-button type="primary" :disabled="uploadImgFileList.length == 0" @click="startUploadFiles">开始上传</el-button>
|
<el-button type="primary" :disabled="uploadImgFileList.length == 0" @click="checkUploadFiles">开始上传</el-button>
|
||||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -279,15 +279,29 @@ function handleRemoveFiles(uploadFile, uploadFiles) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 开始上传文件 */
|
/** 开始上传文件 */
|
||||||
function startUploadFiles() {
|
function checkUploadFiles() {
|
||||||
var element = document.getElementsByClassName("upload-demo-3")[0];
|
var element = document.getElementsByClassName("upload-demo-3")[0];
|
||||||
var errors = element.querySelectorAll(".mylabel--error");
|
var errors = element.querySelectorAll(".mylabel--error");
|
||||||
if (errors.length > 0) {
|
if (errors.length > 0) {
|
||||||
ElMessage.error(errors.length + " 个图片未上传标注文件!请上传或删除图片。");
|
ElMessageBox.confirm(errors.length + " 个图片未上传标注文件!是否继续上传已标注数据集信息?", "警告", {
|
||||||
return false;
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
}).then(function () {
|
||||||
|
startUploadFiles();
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
startUploadFiles();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 开始上传文件 */
|
||||||
|
function startUploadFiles() {
|
||||||
uploadImgFileList.value.forEach((item) => {
|
uploadImgFileList.value.forEach((item) => {
|
||||||
let json = uploadJsonList.value.filter((it) => disName(item.name, it.name));
|
let json = uploadJsonList.value.filter((it) => disName(item.name, it.name));
|
||||||
|
if(form.value.dats_label_type != "no_label" && json.length==0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append("image_file_name", item.name);
|
formData.append("image_file_name", item.name);
|
||||||
formData.append("image_file", item.raw);
|
formData.append("image_file", item.raw);
|
||||||
|
@ -564,6 +578,10 @@ onMounted(() => {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-dialog__body{
|
||||||
|
max-height: 520px;
|
||||||
|
}
|
||||||
|
|
||||||
.dialog-footer {
|
.dialog-footer {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue