上传文件优化
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
showIndex
|
||||
tableName="NODE_DETAIL_FILE"
|
||||
ref="tableRef"
|
||||
:params="{nodeId:projectId,queryTarget:2}"
|
||||
:params="{uuid:projectUuid,queryTarget:2}"
|
||||
:api="dataQueryDirApi"
|
||||
:actionsWidth="200"
|
||||
>
|
||||
@@ -63,7 +63,7 @@ import { formatFileSize, openTabReviewFile } from '@/utils/file';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
const env = import.meta.env;
|
||||
const PREFIX = env.VITE_API_PREFIX_DATA;
|
||||
const PREFIX = env.VITE_API_PREFIX_PROJECT;
|
||||
|
||||
const { PROJECT_FILE_TYPE } = useDict('PROJECT_FILE_TYPE');
|
||||
|
||||
@@ -136,7 +136,7 @@ const confirmUploadFun = async() => {
|
||||
form.append('projectName ', props.projectName);
|
||||
// form.append('fileName ', fromData.files[0].name);
|
||||
// form.append('file ', fromData.files[0].raw);
|
||||
await upload(`${PREFIX}data/uploadFiles`, form);
|
||||
await upload(`${PREFIX}node/uploadProjectFiles`, form);
|
||||
}
|
||||
tableRef.value.resetFun();
|
||||
dialogVisible.value = false;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
ref="tableRef"
|
||||
showIndex
|
||||
tableName="DEMAND_ATTACHMENT"
|
||||
:params="{nodeId:demandId}"
|
||||
:params="{uuid:demandId}"
|
||||
:api="dataQueryDirApi"
|
||||
:searchLimitNum="3"
|
||||
:actionsWidth="tableActionsLength['2-2-2']"
|
||||
@@ -54,7 +54,7 @@ import { tableActionsLength } from '@/utils/common';
|
||||
|
||||
const props = defineProps<{
|
||||
visible: boolean;
|
||||
demandId: number;
|
||||
demandId: string;
|
||||
}>();
|
||||
|
||||
const emits = defineEmits(['update:visible']);
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
{{ row.approvalStatus || '未审批' }}
|
||||
</template>
|
||||
<template #attachments="{ row }">
|
||||
<el-link type="primary" @click="seeAttachments(row.id)">查看附件</el-link>
|
||||
<el-link type="primary" @click="seeAttachments(row.uuid)">查看附件</el-link>
|
||||
</template>
|
||||
<template #demandType="{row}">
|
||||
{{ DEMAND_TYPE.O[row.demandType] }}
|
||||
@@ -80,7 +80,7 @@
|
||||
{{ disposeMemberList(row,'pMemberList') }}
|
||||
</template>
|
||||
</BaseTable>
|
||||
<attachments :demandId="demandInfo.id" v-model:visible="attachmentsVisible" ></attachments>
|
||||
<attachments :demandId="demandInfo.uuid" v-model:visible="attachmentsVisible" ></attachments>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -183,10 +183,10 @@ const getPhaseList = async (nodeType:string, projectUuid: string) => {
|
||||
return optionList;
|
||||
};
|
||||
|
||||
const seeAttachments = (demandId:number) => {
|
||||
const seeAttachments = (demandUId:string) => {
|
||||
attachmentsVisible.value = true;
|
||||
console.log('demandId', demandId);
|
||||
demandInfo.id = demandId;
|
||||
console.log('demandId', demandUId);
|
||||
demandInfo.uuid = demandUId;
|
||||
};
|
||||
|
||||
const tableOnLoadFun = () => {
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
</template>
|
||||
</Dialog>
|
||||
</div>
|
||||
<attachments :demandId="demandInfo.id" v-model:visible="attachmentsVisible" ></attachments>
|
||||
<attachments :demandId="demandInfo.uuid" v-model:visible="attachmentsVisible" ></attachments>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -128,7 +128,7 @@ import { tableActionsLength } from '@/utils/common';
|
||||
import { getMemberListStr } from '@/utils/task';
|
||||
|
||||
const env = import.meta.env;
|
||||
const PREFIX = env.VITE_API_PREFIX_DATA;
|
||||
const PREFIX = env.VITE_API_PREFIX_PROJECT;
|
||||
|
||||
const emits = defineEmits(['visibleDialog', 'loadTableForm']);
|
||||
|
||||
@@ -202,6 +202,7 @@ const visibleDialog = async( visible:boolean, row?: any) => {
|
||||
simList = commonStore.getDictData(row.demandType);
|
||||
}
|
||||
nextTick(() => {
|
||||
console.log('tableFormRef.value', tableFormRef.value);
|
||||
tableFormRef.value.setOptionsFun('phaseId', phaseList);
|
||||
tableFormRef.value.setOptionsFun('simType', simList.A);
|
||||
let pMemberList = '';
|
||||
@@ -230,6 +231,7 @@ const confirmFun = async() => {
|
||||
if (await tableFormRef.value.validateFun()) {
|
||||
loadingInterface.value = true;
|
||||
const fromData:any = tableFormRef.value.getFormDataFun();
|
||||
console.log('fromData', fromData);
|
||||
if (fromData.planTime) {
|
||||
fromData.beginTime = fromData.planTime[0];
|
||||
fromData.endTime = fromData.planTime[1];
|
||||
@@ -248,7 +250,7 @@ const confirmFun = async() => {
|
||||
form.append('fileName ', fromData.attachments[index].name);
|
||||
form.append('file ', fromData.attachments[index].raw);
|
||||
form.append('projectId ', String(fromData.projectId));
|
||||
upload(`${PREFIX}data/uploadFiles`, form);
|
||||
upload(`${PREFIX}demand/uploadDemandFiles`, form);
|
||||
}
|
||||
formVisible.value = false;
|
||||
}
|
||||
@@ -324,7 +326,7 @@ const editDemandApiFun = async(fromData: any) => {
|
||||
form.append('fileName ', item.name);
|
||||
form.append('file ', item.raw);
|
||||
form.append('projectId ', String(fromData.projectId));
|
||||
upload(`${PREFIX}data/uploadFiles`, form);
|
||||
upload(`${PREFIX}demand/uploadDemandFiles`, form);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user