Compare commits

...

2 Commits

Author SHA1 Message Date
weibl
de3e434d3f 修复重复策划 2026-01-23 11:31:06 +08:00
weibl
d5fbf29ace 修复编辑项目文件问题 2026-01-23 11:25:43 +08:00
2 changed files with 25 additions and 6 deletions

View File

@@ -137,10 +137,9 @@ const openDialog = (type: string, row?: any) => {
// nextTick(() => {
if (type === 'edit' && row) {
row.fileType = String(row.fileType);
row.files = [{ name: row.originalName }];
row.files = [{ name: row.originalName, id: row.id }];
oldFile.value = {
id: row.id,
uid: row.files[0].uid,
};
// tableFormRef.value.setFormDataFun(row);
editRowInfo.value = { ...row };
@@ -231,7 +230,7 @@ const confirmUploadFun = async () => {
}
});
}
const oldFileInfo = fromData.files.find((item: any) => item.uid === oldFile.value.uid);
const oldFileInfo = fromData.files.find((item: any) => item?.id === oldFile.value.id);
if (!oldFileInfo) {
dataDelFileApi({ delFileId: oldFile.value.id });
}

View File

@@ -419,7 +419,8 @@ const expandTree = (treeRef: any) => {
const selectMethod = ref('template'); // template 模板库 project 历史项目
const transferTask = async () => {
if (getLeftVxeRef().getCheckboxRecords().length === 0) {
const leftSelection = getLeftVxeRef().getCheckboxRecords();
if (leftSelection.length === 0) {
ElMessage.warning('请先选择左侧任务节点!');
return;
}
@@ -432,12 +433,27 @@ const transferTask = async () => {
const rightSelection = getRightVxeRef().getCheckboxRecords();
if (rightSelection.length === 0) {
// console.log('getRightVxeRef().getTableData()', getRightVxeRef().getTableData());
const { fullData } = getRightVxeRef().getTableData();
for (let index = 0; index < leftSelection.length; index++) {
if (
fullData.find((item: { nodeName: any }) => {
return item.nodeName === leftSelection[index].nodeName;
})
) {
ElMessage.warning('右侧已存在同名节点,如想覆盖,则需勾选右侧相同节点!');
return;
}
}
}
if (rightSelection.length > 1) {
ElMessage.warning('右侧只能选择一个节点进行导入!');
return;
}
const leftMultipleSelection = clearLeftSelectRepeat(getLeftVxeRef().getCheckboxRecords());
const leftMultipleSelection = clearLeftSelectRepeat(leftSelection);
const leftInsertArr: any[][] = [];
for (let index = 0; index < leftMultipleSelection.length; index++) {
@@ -595,7 +611,11 @@ const mergeArrays = async (
key !== 'pid' &&
key !== '_X_ROW_CHILD'
) {
updateRow[key] = leftList[index][key];
// console.log('leftList', key, leftList[index], leftList[index][key]);
// if (updateRow.hasOwnProperty(key)) {
if (updateRow.hasOwnProperty(key)) {
updateRow[key] = leftList[index][key];
}
}
});
await getRightVxeRef().setRow(rightList[foundIndex], newObj);