merge
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
:show-file-list="false"
|
||||
:accept="accept"
|
||||
:multiple="multiple"
|
||||
:before-upload="beforeUploadFun"
|
||||
:before-upload="addFileFun"
|
||||
>
|
||||
<el-button>上传文件</el-button>
|
||||
<slot />
|
||||
</el-upload>
|
||||
<Dialog v-model="diaVisible" diaTitle="上传文件" :width="400" @close="closeFun">
|
||||
<div>
|
||||
@@ -44,6 +44,7 @@ interface Props {
|
||||
accept?: any;
|
||||
multiple?: boolean;
|
||||
tableName: string;
|
||||
callbackFlag?: string;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
@@ -53,6 +54,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
accept: '',
|
||||
multiple: true,
|
||||
tableName: '',
|
||||
callbackFlag: '',
|
||||
});
|
||||
|
||||
const formData = ref<any>({
|
||||
@@ -71,7 +73,7 @@ watch(
|
||||
}
|
||||
);
|
||||
|
||||
const beforeUploadFun = (file: any) => {
|
||||
const addFileFun = (file: any) => {
|
||||
formData.value.files.push(file);
|
||||
formData.value.fileTypeDictValue = props.fileType;
|
||||
diaVisible.value = true;
|
||||
@@ -90,7 +92,7 @@ const submitFun = async () => {
|
||||
uuid: props.data.uuid, // 上传任务交付物,任务的uuid
|
||||
// 非必填参数
|
||||
isApprove: 0, // 0不需要审批 1需要审批 默认0
|
||||
callbackFlag: 'COMMON_FILE_UPLOAD_FINISHED', // 回调标识
|
||||
callbackFlag: props.callbackFlag, // 回调标识
|
||||
type: 0,
|
||||
fileType: props.fileType,
|
||||
fileTypeDictValue: formData.value.fileTypeDictValue || '',
|
||||
@@ -110,9 +112,7 @@ const submitFun = async () => {
|
||||
};
|
||||
|
||||
const uploadFinishedFun = (data: any) => {
|
||||
if (data.callbackFlag === 'COMMON_FILE_UPLOAD_FINISHED') {
|
||||
emit('finished');
|
||||
}
|
||||
emit('finished', data);
|
||||
};
|
||||
|
||||
const resetFun = () => {
|
||||
@@ -124,4 +124,8 @@ const resetFun = () => {
|
||||
const closeFun = () => {
|
||||
diaVisible.value = false;
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
addFileFun,
|
||||
});
|
||||
</script>
|
||||
|
||||
86
src/components/common/dragUploader/index.vue
Normal file
86
src/components/common/dragUploader/index.vue
Normal file
@@ -0,0 +1,86 @@
|
||||
<template>
|
||||
<div class="comp-drag-uploader" @dragover="dragoverFun">
|
||||
<slot />
|
||||
<div v-if="uploading" class="cover">
|
||||
<el-upload
|
||||
class="upload"
|
||||
drag
|
||||
:show-file-list="false"
|
||||
multiple
|
||||
:before-upload="beforeUploadFun"
|
||||
>
|
||||
<div class="tips">将文件拖到此处上传</div>
|
||||
</el-upload>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
|
||||
const emit = defineEmits(['beforeUpload']);
|
||||
const uploading = ref(false);
|
||||
const draging = ref(false);
|
||||
|
||||
let timeOut: any = null;
|
||||
const dragoverFun = (event: any) => {
|
||||
event.preventDefault();
|
||||
if (!uploading.value) {
|
||||
uploading.value = true;
|
||||
}
|
||||
draging.value = true;
|
||||
if (timeOut) {
|
||||
clearTimeout(timeOut);
|
||||
timeOut = null;
|
||||
}
|
||||
// 拖拽区域内嵌套div时会触发dragleave
|
||||
timeOut = setTimeout(() => {
|
||||
draging.value = false;
|
||||
uploading.value = false;
|
||||
}, 200);
|
||||
};
|
||||
|
||||
const beforeUploadFun = (file: any) => {
|
||||
emit('beforeUpload', file);
|
||||
return false;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.comp-drag-uploader {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.cover {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 9;
|
||||
.upload {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.tips {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
color: var(--el-color-primary);
|
||||
font-size: 14px;
|
||||
}
|
||||
.el-upload {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.el-upload-dragger {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -149,7 +149,7 @@ const sliceFileFun = async (fileIndex: number) => {
|
||||
}
|
||||
msgTimeOut = setTimeout(() => {
|
||||
ElMessage.success(`${file.name} 上传成功`);
|
||||
}, 3000);
|
||||
}, 2000);
|
||||
}
|
||||
callBackFun(fileData);
|
||||
}
|
||||
@@ -160,7 +160,7 @@ const sliceFileFun = async (fileIndex: number) => {
|
||||
if (listData.value[index]) {
|
||||
sliceFileFun(index);
|
||||
}
|
||||
}, 2000); // 2s后自动开启下次上传,没有具体作用
|
||||
}, 200); // 200ms后自动开启下次上传,没有具体作用
|
||||
};
|
||||
|
||||
// 后处理回调校验
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
:api="batchAddFileInfoForTaskApi"
|
||||
:fileType="FILE_TYPE.PNG_FILE"
|
||||
tableName="TASK_DETAIL_UPLOAD_FILE"
|
||||
callbackFlag="COMMON_FILE_UPLOAD_FINISHED"
|
||||
multiple
|
||||
:data="{
|
||||
dirId: nodeFIleId,
|
||||
@@ -23,7 +24,9 @@
|
||||
uuid: taskId,
|
||||
}"
|
||||
@finished="uploadFinishedFun"
|
||||
/>
|
||||
>
|
||||
<el-button>上传文件</el-button>
|
||||
</AddFile>
|
||||
<el-button type="primary" class="ml12" @click="downLoadFun">下载文件</el-button>
|
||||
</template>
|
||||
<template #type="{ row }">
|
||||
@@ -173,8 +176,10 @@ watch(
|
||||
}
|
||||
);
|
||||
|
||||
const uploadFinishedFun = () => {
|
||||
baseTableRef.value.resetFun();
|
||||
const uploadFinishedFun = (data: any) => {
|
||||
if (data.callbackFlag === 'COMMON_FILE_UPLOAD_FINISHED') {
|
||||
baseTableRef.value.resetFun();
|
||||
}
|
||||
};
|
||||
|
||||
const downLoadFun = async () => {
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
:api="batchAddFileInfoForTaskApi"
|
||||
:fileType="FILE_TYPE.MODEL_3D_FILE"
|
||||
tableName="TASK_DETAIL_UPLOAD_FILE"
|
||||
callbackFlag="COMMON_FILE_UPLOAD_FINISHED"
|
||||
multiple
|
||||
:data="{
|
||||
dirId: nodeFIleId,
|
||||
@@ -21,7 +22,9 @@
|
||||
uuid: currentId,
|
||||
}"
|
||||
@finished="uploadFinishedFun"
|
||||
/>
|
||||
>
|
||||
<el-button>上传文件</el-button>
|
||||
</AddFile>
|
||||
<el-button class="ml12" type="primary" @click="downLoadFun">下载文件</el-button>
|
||||
</template>
|
||||
<template #type="{ row }">
|
||||
@@ -154,8 +157,10 @@ const deleteFun = async (row: any) => {
|
||||
} catch {}
|
||||
};
|
||||
|
||||
const uploadFinishedFun = () => {
|
||||
baseTableRef.value.resetFun();
|
||||
const uploadFinishedFun = (data: any) => {
|
||||
if (data.callbackFlag === 'COMMON_FILE_UPLOAD_FINISHED') {
|
||||
baseTableRef.value.resetFun();
|
||||
}
|
||||
};
|
||||
|
||||
const downLoadFun = async () => {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
:api="batchAddFileInfoForTaskApi"
|
||||
:fileType="FILE_TYPE.CANVAS_FILE"
|
||||
tableName="TASK_DETAIL_UPLOAD_FILE"
|
||||
callbackFlag="COMMON_FILE_UPLOAD_FINISHED"
|
||||
multiple
|
||||
:data="{
|
||||
dirId: nodeFIleId,
|
||||
@@ -23,7 +24,9 @@
|
||||
uuid: taskId,
|
||||
}"
|
||||
@finished="uploadFinishedFun"
|
||||
/>
|
||||
>
|
||||
<el-button>上传文件</el-button>
|
||||
</AddFile>
|
||||
<el-button class="ml12" type="primary" @click="showTableDataCurveFun">显示曲线</el-button>
|
||||
<el-button type="primary" @click="downLoadFun">下载文件</el-button>
|
||||
</template>
|
||||
@@ -299,8 +302,10 @@ const getCsvFormatDataFun = (data: any, num: any) => {
|
||||
initEcharts(elementId, elementId, 'lineChart', options);
|
||||
};
|
||||
|
||||
const uploadFinishedFun = () => {
|
||||
baseTableRef.value.resetFun();
|
||||
const uploadFinishedFun = (data: any) => {
|
||||
if (data.callbackFlag === 'COMMON_FILE_UPLOAD_FINISHED') {
|
||||
baseTableRef.value.resetFun();
|
||||
}
|
||||
};
|
||||
|
||||
const downLoadFun = async () => {
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
:api="batchAddFileInfoForTaskApi"
|
||||
:fileType="FILE_TYPE.CALCULATION_FILE"
|
||||
tableName="TASK_DETAIL_UPLOAD_FILE"
|
||||
callbackFlag="COMMON_FILE_UPLOAD_FINISHED"
|
||||
multiple
|
||||
:data="{
|
||||
dirId: nodeFIleId,
|
||||
@@ -21,7 +22,9 @@
|
||||
uuid: taskId,
|
||||
}"
|
||||
@finished="uploadFinishedFun"
|
||||
/>
|
||||
>
|
||||
<el-button>上传文件</el-button>
|
||||
</AddFile>
|
||||
<el-button class="ml12" type="primary" @click="downLoadFun">下载文件</el-button>
|
||||
</template>
|
||||
<template #type="{ row }">
|
||||
@@ -144,8 +147,10 @@ const deleteFun = async (row: any) => {
|
||||
} catch {}
|
||||
};
|
||||
|
||||
const uploadFinishedFun = () => {
|
||||
baseTableRef.value.resetFun();
|
||||
const uploadFinishedFun = (data: any) => {
|
||||
if (data.callbackFlag === 'COMMON_FILE_UPLOAD_FINISHED') {
|
||||
baseTableRef.value.resetFun();
|
||||
}
|
||||
};
|
||||
|
||||
const downLoadFun = async () => {
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
:api="batchAddFileInfoForTaskApi"
|
||||
:fileType="FILE_TYPE.REPORT_FILE"
|
||||
tableName="TASK_DETAIL_UPLOAD_FILE"
|
||||
callbackFlag="COMMON_FILE_UPLOAD_FINISHED"
|
||||
multiple
|
||||
:data="{
|
||||
dirId: nodeFIleId,
|
||||
@@ -21,7 +22,9 @@
|
||||
uuid: taskId,
|
||||
}"
|
||||
@finished="uploadFinishedFun"
|
||||
/>
|
||||
>
|
||||
<el-button>上传文件</el-button>
|
||||
</AddFile>
|
||||
<el-button class="ml12" type="primary" @click="downLoadFun">下载文件</el-button>
|
||||
</template>
|
||||
<template #type="{ row }">
|
||||
@@ -147,8 +150,10 @@ const deleteFun = async (row: any) => {
|
||||
} catch {}
|
||||
};
|
||||
|
||||
const uploadFinishedFun = () => {
|
||||
baseTableRef.value.resetFun();
|
||||
const uploadFinishedFun = (data: any) => {
|
||||
if (data.callbackFlag === 'COMMON_FILE_UPLOAD_FINISHED') {
|
||||
baseTableRef.value.resetFun();
|
||||
}
|
||||
};
|
||||
|
||||
const downLoadFun = async () => {
|
||||
|
||||
@@ -382,8 +382,8 @@ const onFolderConfirmFun = async (formData: any) => {
|
||||
}
|
||||
} else if (currentFolderMode.value === 'edit') {
|
||||
const req = {
|
||||
dirId: currentFolder.value.id,
|
||||
oldName: currentFolder.value.originalName,
|
||||
dirId: currentFolder.value?.id,
|
||||
oldName: currentFolder.value?.originalName,
|
||||
newName: formData.name,
|
||||
type: 0,
|
||||
};
|
||||
@@ -420,8 +420,8 @@ const onConfirmFun = async (formData: any) => {
|
||||
fileName: file?.fileName,
|
||||
size: file?.size,
|
||||
projectName: formData.projectName,
|
||||
path: currentFolder.value.objectKey,
|
||||
dirId: currentFolder.value.id,
|
||||
path: currentFolder.value?.objectKey,
|
||||
dirId: currentFolder.value?.id,
|
||||
chunk: 0,
|
||||
remarks: formData.remarks,
|
||||
projectId: formData.projectId,
|
||||
@@ -437,7 +437,7 @@ const onConfirmFun = async (formData: any) => {
|
||||
const req = {
|
||||
sourceFiles: formData.file,
|
||||
uploadTaskId: new Date().getTime(),
|
||||
dirId: currentFolder.value.id,
|
||||
dirId: currentFolder.value?.id,
|
||||
projectId: formData.projectId,
|
||||
analysisDirectionId: formData.analysisDirectionId,
|
||||
templateId: formData.templateId,
|
||||
@@ -501,7 +501,7 @@ const onCellDblclickFun = (e: any) => {
|
||||
};
|
||||
const apiName: any = ref(null);
|
||||
watchEffect(() => {
|
||||
if (currentFolder.value && currentFolder.value.id && !isSearching.value) {
|
||||
if (currentFolder.value && currentFolder.value?.id && !isSearching.value) {
|
||||
searchParams.value.fileId = currentFolder.value?.id || '';
|
||||
apiName.value = dataQueryDirApi;
|
||||
} else if (isSearching.value) {
|
||||
|
||||
@@ -5,17 +5,14 @@
|
||||
width="500"
|
||||
showFooter
|
||||
>
|
||||
<TableForm
|
||||
ref="tableFormRef"
|
||||
v-model:data="formData"
|
||||
:tableName="TABLE_NAME.BATCH_UPDATE_WORKSPACE_TIME"
|
||||
@change="tableFormChangeFun"
|
||||
/>
|
||||
<TableForm v-model:data="formData" :tableName="TABLE_NAME.BATCH_UPDATE_WORKSPACE_TIME" />
|
||||
|
||||
<template #footer>
|
||||
<div>
|
||||
<el-button @click="dialogVisible = false">{{ $t('通用.取消') }}</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="confirmFun">{{ $t('通用.确定') }}</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="confirmFun">
|
||||
{{ $t('通用.确定') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</Dialog>
|
||||
@@ -51,12 +48,9 @@ const dialogVisible = computed({
|
||||
set: (val) => emit('update:visible', val),
|
||||
});
|
||||
|
||||
const tableFormRef = ref();
|
||||
const formData = ref<any>({});
|
||||
const loading = ref(false);
|
||||
|
||||
const tableFormChangeFun = (_data: any) => {};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(val) => {
|
||||
@@ -106,7 +100,7 @@ const confirmFun = async () => {
|
||||
}
|
||||
|
||||
const isDesignPhase = props.currentPhase?.label?.includes('设计') || false;
|
||||
const syncToTask = !isDesignPhase;
|
||||
const syncToTask = isDesignPhase;
|
||||
|
||||
loading.value = true;
|
||||
try {
|
||||
|
||||
@@ -85,7 +85,7 @@ const actionClickFun = (action: any) => {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '@/views/task/projectList/components/projectCard.scss';
|
||||
@use '@/views/task/projectList/components/projectCard.scss';
|
||||
|
||||
.lyric-project-card {
|
||||
@extend .project-card-base;
|
||||
|
||||
@@ -134,7 +134,7 @@ const getPhaseListFun = async () => {
|
||||
};
|
||||
|
||||
const phaseChangeFun = () => {
|
||||
baseTableRef.value?.resetFun();
|
||||
selectedRows.value = [];
|
||||
};
|
||||
|
||||
const tableParams = computed(() => ({
|
||||
@@ -195,14 +195,10 @@ const dataChangeFun = () => {
|
||||
};
|
||||
|
||||
const updateSingleWorkspaceTimeFun = async (row: any, propertyName: string) => {
|
||||
const propertyValue = row[propertyName];
|
||||
|
||||
if (!propertyValue) {
|
||||
return;
|
||||
}
|
||||
const propertyValue = row[propertyName] || '';
|
||||
|
||||
const isDesignPhase = currentPhase.value?.label?.includes('设计') || false;
|
||||
const syncToTask = !isDesignPhase;
|
||||
const syncToTask = isDesignPhase;
|
||||
|
||||
try {
|
||||
const res: any = await batchUpdateWorkspaceExtraApi({
|
||||
|
||||
@@ -422,8 +422,8 @@ const onFolderConfirmFun = async (formData: any) => {
|
||||
}
|
||||
} else if (currentFolderMode.value === 'edit') {
|
||||
const req = {
|
||||
dirId: currentFolder.value.id,
|
||||
oldName: currentFolder.value.originalName,
|
||||
dirId: currentFolder.value?.id,
|
||||
oldName: currentFolder.value?.originalName,
|
||||
newName: formData.name,
|
||||
type: 0,
|
||||
};
|
||||
@@ -460,8 +460,8 @@ const onConfirmFun = async (formData: any) => {
|
||||
fileName: file?.fileName,
|
||||
size: file?.size,
|
||||
projectName: formData.projectName,
|
||||
path: currentFolder.value.objectKey,
|
||||
dirId: currentFolder.value.id,
|
||||
path: currentFolder.value?.objectKey,
|
||||
dirId: currentFolder.value?.id,
|
||||
chunk: 0,
|
||||
remarks: formData.remarks,
|
||||
projectId: formData.projectId,
|
||||
@@ -477,7 +477,7 @@ const onConfirmFun = async (formData: any) => {
|
||||
const req = {
|
||||
sourceFiles: formData.file,
|
||||
uploadTaskId: new Date().getTime(),
|
||||
dirId: currentFolder.value.id,
|
||||
dirId: currentFolder.value?.id,
|
||||
projectId: formData.projectId,
|
||||
analysisDirectionId: formData.analysisDirectionId,
|
||||
templateId: formData.templateId,
|
||||
@@ -540,7 +540,7 @@ const onCellDblclickFun = (e: any) => {
|
||||
};
|
||||
const apiName: any = ref(null);
|
||||
watchEffect(() => {
|
||||
if (currentFolder.value && currentFolder.value.id && !isSearching.value) {
|
||||
if (currentFolder.value && currentFolder.value?.id && !isSearching.value) {
|
||||
searchParams.value.fileId = currentFolder.value?.id || '';
|
||||
apiName.value = dataQueryDirApi;
|
||||
} else if (isSearching.value) {
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
<template>
|
||||
<Dialog v-model="diaVisible" diaTitle="上传文件" :width="400" @close="closeFun">
|
||||
<div>
|
||||
<TableForm
|
||||
ref="tableFormRef"
|
||||
tableName="DATA_OVERVIEW_ADD_FILE"
|
||||
:itemNum="1"
|
||||
v-model:data="formData"
|
||||
/>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div>
|
||||
<el-button @click="closeFun">{{ $t('通用.取消') }}</el-button>
|
||||
<el-button type="primary" @click="submitFun">{{ $t('通用.确定') }}</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue';
|
||||
import Dialog from '@/components/common/dialog/index.vue';
|
||||
import TableForm from '@/components/common/table/tableForm.vue';
|
||||
import { batchAddFileInfoApi } from '@/api/data/data';
|
||||
import { uploadBigFile } from '@/utils/file';
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean;
|
||||
data: any;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
modelValue: false,
|
||||
data: {},
|
||||
});
|
||||
|
||||
const formData = ref<any>({});
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(val: boolean) => {
|
||||
diaVisible.value = val;
|
||||
if (!val) {
|
||||
tableFormRef.value?.resetFun();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const emit = defineEmits(['update:modelValue']);
|
||||
const diaVisible = ref(false);
|
||||
|
||||
const tableFormRef = ref<any>();
|
||||
const submitFun = async () => {
|
||||
const valid = await tableFormRef.value.validateFun();
|
||||
if (valid) {
|
||||
const params = {
|
||||
// 必填参数
|
||||
fileList: formData.value.files, // 文件列表
|
||||
dirId: props.data.id, // 文件目录id
|
||||
projectId: props.data.relatedResourceUuid, // 项目id
|
||||
// 非必填参数
|
||||
isApprove: 0, // 0不需要审批 1需要审批 默认0
|
||||
callbackFlag: '/data/overview', // 回调标识
|
||||
type: 0,
|
||||
// fileType: 1, // 文件类型,不传组件内获取
|
||||
// 其他透传给回调接口的参数
|
||||
// ...
|
||||
};
|
||||
await uploadBigFile(params, batchAddFileInfoApi);
|
||||
closeFun();
|
||||
}
|
||||
};
|
||||
|
||||
const closeFun = () => {
|
||||
emit('update:modelValue', false);
|
||||
};
|
||||
</script>
|
||||
@@ -35,165 +35,179 @@
|
||||
<template #table>
|
||||
<div class="table-content">
|
||||
<div class="table">
|
||||
<BaseTable
|
||||
v-if="tableName"
|
||||
ref="BaseTableRef"
|
||||
:tableName="tableName"
|
||||
:api="dataOverViewListSimulationNodeFilesApi"
|
||||
:params="tableParams"
|
||||
showCheckbox
|
||||
@checkbox-all="checkboxChangeFun"
|
||||
@checkbox-change="checkboxChangeFun"
|
||||
@cell-click="cellClickFun"
|
||||
:actionList="actionList"
|
||||
:hidePagination="isSearching"
|
||||
fullHeight
|
||||
:row-config="{
|
||||
isCurrent: true,
|
||||
}"
|
||||
>
|
||||
<template #leftOptions>
|
||||
<div class="options">
|
||||
<el-select
|
||||
v-if="mergeDataList.length > 1"
|
||||
v-model="mergeDataName"
|
||||
value-key="relatedResourceUuid"
|
||||
class="merge-data-list"
|
||||
clearable
|
||||
@change="changeMergeDataFun"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in mergeDataList"
|
||||
:key="index"
|
||||
:label="item.totalName"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
<template v-if="!hideAddBtn && !hideOptions">
|
||||
<el-dropdown trigger="click">
|
||||
<el-button :icon="CirclePlus" type="primary" class="option-btn">
|
||||
新增<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item @click="addDiaFun(NODE_TYPE.PROJECT)">
|
||||
新增项目
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="currentData?.relatedResourceUuidOwnType === NODE_TYPE.PROJECT"
|
||||
@click="addDiaFun(NODE_TYPE.PHASE)"
|
||||
>
|
||||
新增阶段
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="
|
||||
isCategoryNodeType(currentData?.relatedResourceUuidOwnType) ||
|
||||
NODE_TYPE.PHASE === currentData?.relatedResourceUuidOwnType ||
|
||||
(!currentData?.relatedResourceUuidOwnType && currentData?.id !== 0)
|
||||
"
|
||||
@click="addDiaFun(NODE_TYPE.CATEGORY)"
|
||||
>
|
||||
新增分类
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="isCategoryNodeType(currentData?.relatedResourceUuidOwnType)"
|
||||
@click="addDiaFun(NODE_TYPE.TASK)"
|
||||
>
|
||||
新增任务
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<el-dropdown v-if="currentData && currentData?.id !== 0" trigger="click">
|
||||
<el-button :icon="Upload" type="primary" class="option-btn">
|
||||
上传<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item @click="openAddDirFun">新建文件夹</el-dropdown-item>
|
||||
<el-dropdown-item @click="addFileVisible = true">
|
||||
上传文件
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<el-button
|
||||
v-if="!tableParams.jobMode"
|
||||
:icon="Edit"
|
||||
type="primary"
|
||||
:disabled="chosenData.length !== 1"
|
||||
@click="editFun('')"
|
||||
<DragUploader @beforeUpload="beforeUploadFun">
|
||||
<BaseTable
|
||||
v-if="tableName"
|
||||
ref="BaseTableRef"
|
||||
:tableName="tableName"
|
||||
:api="dataOverViewListSimulationNodeFilesApi"
|
||||
:params="tableParams"
|
||||
showCheckbox
|
||||
@checkbox-all="checkboxChangeFun"
|
||||
@checkbox-change="checkboxChangeFun"
|
||||
@cell-click="cellClickFun"
|
||||
:actionList="actionList"
|
||||
:hidePagination="isSearching"
|
||||
fullHeight
|
||||
:row-config="{
|
||||
isCurrent: true,
|
||||
}"
|
||||
>
|
||||
<template #leftOptions>
|
||||
<div class="options">
|
||||
<el-select
|
||||
v-if="mergeDataList.length > 1"
|
||||
v-model="mergeDataName"
|
||||
value-key="relatedResourceUuid"
|
||||
class="merge-data-list"
|
||||
clearable
|
||||
@change="changeMergeDataFun"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
:icon="Delete"
|
||||
type="danger"
|
||||
:disabled="chosenData.length === 0"
|
||||
@click="batchDelFun"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
<el-button :icon="Refresh" @click="reloadNodeFun">刷新</el-button>
|
||||
<span class="info-switch">
|
||||
<el-switch
|
||||
v-model="infoShow"
|
||||
inline-prompt
|
||||
active-text="详细信息"
|
||||
inactive-text="详细信息"
|
||||
/>
|
||||
</span>
|
||||
<span class="info-switch">
|
||||
<el-switch
|
||||
v-model="emptyShow"
|
||||
inline-prompt
|
||||
active-text="过滤空文件夹"
|
||||
inactive-text="过滤空文件夹"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #originalName="{ row }">
|
||||
<div class="file-name">
|
||||
<template v-if="row.dataType === 1 && !tableParams.jobMode">
|
||||
<el-icon :size="16">
|
||||
<MessageBox v-if="row.relatedResourceUuidOwnType === NODE_TYPE.PROJECT" />
|
||||
<Share v-else-if="row.relatedResourceUuidOwnType === NODE_TYPE.PHASE" />
|
||||
<Document v-else-if="row.relatedResourceUuidOwnType === NODE_TYPE.TASK" />
|
||||
<Folder v-else />
|
||||
</el-icon>
|
||||
<span class="name link" @dblclick="goDetailFun(row)">
|
||||
{{ row.originalName }}
|
||||
<el-option
|
||||
v-for="(item, index) in mergeDataList"
|
||||
:key="index"
|
||||
:label="item.totalName"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
<template v-if="!hideAddBtn && !hideOptions">
|
||||
<el-dropdown trigger="click">
|
||||
<el-button :icon="CirclePlus" type="primary" class="option-btn">
|
||||
新增<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item @click="addDiaFun(NODE_TYPE.PROJECT)">
|
||||
新增项目
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="currentData?.relatedResourceUuidOwnType === NODE_TYPE.PROJECT"
|
||||
@click="addDiaFun(NODE_TYPE.PHASE)"
|
||||
>
|
||||
新增阶段
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="
|
||||
isCategoryNodeType(currentData?.relatedResourceUuidOwnType) ||
|
||||
NODE_TYPE.PHASE === currentData?.relatedResourceUuidOwnType ||
|
||||
(!currentData?.relatedResourceUuidOwnType &&
|
||||
currentData?.id !== 0)
|
||||
"
|
||||
@click="addDiaFun(NODE_TYPE.CATEGORY)"
|
||||
>
|
||||
新增分类
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="isCategoryNodeType(currentData?.relatedResourceUuidOwnType)"
|
||||
@click="addDiaFun(NODE_TYPE.TASK)"
|
||||
>
|
||||
新增任务
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<el-dropdown v-if="currentData && currentData?.id !== 0" trigger="click">
|
||||
<el-button :icon="Upload" type="primary" class="option-btn">
|
||||
上传<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item @click="openAddDirFun">新建文件夹</el-dropdown-item>
|
||||
<AddFile
|
||||
ref="AddFileRef"
|
||||
:api="batchAddFileInfoApi"
|
||||
tableName="TASK_DETAIL_UPLOAD_FILE"
|
||||
callbackFlag="DATA_OVERVIEW_UPLOAD_FINISHED"
|
||||
multiple
|
||||
:data="{
|
||||
dirId: currentData.id,
|
||||
projectId: currentData.relatedResourceUuid,
|
||||
}"
|
||||
@finished="uploadFinishedFun"
|
||||
>
|
||||
<el-dropdown-item>上传文件</el-dropdown-item>
|
||||
</AddFile>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<el-button
|
||||
v-if="!tableParams.jobMode"
|
||||
:icon="Edit"
|
||||
type="primary"
|
||||
:disabled="chosenData.length !== 1"
|
||||
@click="editFun('')"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
:icon="Delete"
|
||||
type="danger"
|
||||
:disabled="chosenData.length === 0"
|
||||
@click="batchDelFun"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
<el-button :icon="Refresh" @click="reloadNodeFun">刷新</el-button>
|
||||
<span class="info-switch">
|
||||
<el-switch
|
||||
v-model="infoShow"
|
||||
inline-prompt
|
||||
active-text="详细信息"
|
||||
inactive-text="详细信息"
|
||||
/>
|
||||
</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-icon :size="16">
|
||||
<Document />
|
||||
</el-icon>
|
||||
<span class="name">{{ row.originalName }}</span>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<template #achieveStatus="{ row }">
|
||||
<StatusDot
|
||||
:status="getTaskAchieveStyleClass(row.achieveStatus)"
|
||||
:title="TASK_CALCULATE_STATUS_OBJ[row.achieveStatus] || '未分析'"
|
||||
/>
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
{{ RUN_STATUS.O[row.status] }}
|
||||
</template>
|
||||
<template #dataType="{ row }">
|
||||
{{ DATA_TYPE.O[row.dataType] }}
|
||||
</template>
|
||||
<template #fileType="{ row }">
|
||||
{{ DATA_SEARCH_FILE_TYPE.O[row.fileType] || '--' }}
|
||||
</template>
|
||||
<template #fileSize="{ row }">
|
||||
{{ formatFileSize(row.fileSize) || '--' }}
|
||||
</template>
|
||||
</BaseTable>
|
||||
<span class="info-switch">
|
||||
<el-switch
|
||||
v-model="emptyShow"
|
||||
inline-prompt
|
||||
active-text="过滤空文件夹"
|
||||
inactive-text="过滤空文件夹"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #originalName="{ row }">
|
||||
<div class="file-name">
|
||||
<template v-if="row.dataType === 1 && !tableParams.jobMode">
|
||||
<el-icon :size="16">
|
||||
<MessageBox v-if="row.relatedResourceUuidOwnType === NODE_TYPE.PROJECT" />
|
||||
<Share v-else-if="row.relatedResourceUuidOwnType === NODE_TYPE.PHASE" />
|
||||
<Document v-else-if="row.relatedResourceUuidOwnType === NODE_TYPE.TASK" />
|
||||
<Folder v-else />
|
||||
</el-icon>
|
||||
<span class="name link" @dblclick="goDetailFun(row)">
|
||||
{{ row.originalName }}
|
||||
</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-icon :size="16">
|
||||
<Document />
|
||||
</el-icon>
|
||||
<span class="name">{{ row.originalName }}</span>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<template #achieveStatus="{ row }">
|
||||
<StatusDot
|
||||
:status="getTaskAchieveStyleClass(row.achieveStatus)"
|
||||
:title="TASK_CALCULATE_STATUS_OBJ[row.achieveStatus] || '未分析'"
|
||||
/>
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
{{ RUN_STATUS.O[row.status] }}
|
||||
</template>
|
||||
<template #dataType="{ row }">
|
||||
{{ DATA_TYPE.O[row.dataType] }}
|
||||
</template>
|
||||
<template #fileType="{ row }">
|
||||
{{ DATA_SEARCH_FILE_TYPE.O[row.fileType] || '--' }}
|
||||
</template>
|
||||
<template #fileSize="{ row }">
|
||||
{{ formatFileSize(row.fileSize) || '--' }}
|
||||
</template>
|
||||
</BaseTable>
|
||||
</DragUploader>
|
||||
</div>
|
||||
<div v-if="infoShow" class="info">
|
||||
<FileInfo :data="fileData" />
|
||||
@@ -244,7 +258,6 @@
|
||||
@confirm="editNodeFun"
|
||||
/>
|
||||
<FilePreview v-model="previewVisible" :fileId="previewFileId" />
|
||||
<AddFile v-model="addFileVisible" :data="currentData" />
|
||||
<RunDetail
|
||||
v-if="runDetailVisible"
|
||||
:run-info="runDetailData"
|
||||
@@ -254,7 +267,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onBeforeUnmount, watch, nextTick } from 'vue';
|
||||
import { ref, onMounted, watch, nextTick } from 'vue';
|
||||
import FileTree from '@/components/common/dataFileTree/index.vue';
|
||||
import { getSimulationNodeTreeApi, getAllTemplateApi } from '@/api/data/dimensionTemplate';
|
||||
import {
|
||||
@@ -264,6 +277,7 @@ import {
|
||||
getNodeDetailForDataApi,
|
||||
deleteNodeApi,
|
||||
} from '@/api/project/node';
|
||||
import { batchAddFileInfoApi } from '@/api/data/data';
|
||||
import { editTaskForDataApi } from '@/api/project/task';
|
||||
import { getTaskDetailApi } from '@/api/project/task';
|
||||
import { runDetailApi } from '@/api/project/run';
|
||||
@@ -300,12 +314,12 @@ import { isCategoryNodeType } from '@/utils/node';
|
||||
import FilePreview from '@/components/common/filePreview/index.vue';
|
||||
import { downloadFileById } from '@/utils/file';
|
||||
import { useRoute } from 'vue-router';
|
||||
import AddFile from './addFile.vue';
|
||||
import AddFile from '@/components/common/addFile/index.vue';
|
||||
import RunDetail from '@/components/task/runDetailPage.vue';
|
||||
import StatusDot from '@/components/common/statusDot/index.vue';
|
||||
import DragUploader from '@/components/common/dragUploader/index.vue';
|
||||
import { TASK_CALCULATE_STATUS_OBJ } from '@/utils/enum/task';
|
||||
import { getTaskAchieveStyleClass } from '@/components/common/statusDot/statusMap';
|
||||
import emitter from '@/utils/eventBus';
|
||||
|
||||
interface Props {
|
||||
hideAddBtn?: boolean;
|
||||
@@ -350,7 +364,6 @@ const isSearching = ref(false);
|
||||
const hideOptions = ref(route.path.indexOf('/yian') > -1); // TODO 兼容宜安不展示操作按钮,后续需要可配
|
||||
const mergeDataList = ref<any>([]);
|
||||
const mergeDataName = ref<any>('');
|
||||
const addFileVisible = ref(false);
|
||||
const runDetailVisible = ref(false);
|
||||
const runDetailData = ref<any>({});
|
||||
const tableName = ref('DATA_OVERVIEW');
|
||||
@@ -443,16 +456,11 @@ const actionList = ref([
|
||||
]);
|
||||
|
||||
onMounted(() => {
|
||||
emitter.on('UPLOAD_FINISHED', uploadFinishedFun);
|
||||
getAllTemplateFun();
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
emitter.off('UPLOAD_FINISHED', uploadFinishedFun);
|
||||
});
|
||||
|
||||
const uploadFinishedFun = (data: any) => {
|
||||
if (data.callbackFlag === '/data/overview') {
|
||||
if (data.callbackFlag === 'DATA_OVERVIEW_UPLOAD_FINISHED') {
|
||||
reloadNodeFun();
|
||||
}
|
||||
};
|
||||
@@ -797,6 +805,11 @@ const reloadNodeFun = () => {
|
||||
FileTreeRef.value?.reloadNodeFun(currentData.value.id);
|
||||
BaseTableRef.value?.resetFun();
|
||||
};
|
||||
|
||||
const AddFileRef = ref<any>();
|
||||
const beforeUploadFun = (file: any) => {
|
||||
AddFileRef.value.addFileFun(file);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -76,7 +76,7 @@ const actionClickFun = (action: any) => {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './projectCard.scss';
|
||||
@use './projectCard.scss';
|
||||
|
||||
.project-card {
|
||||
@extend .project-card-base;
|
||||
|
||||
Reference in New Issue
Block a user