update:预览地址
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
showIndex
|
||||
ref="tableRef"
|
||||
tableName="SIMULATION_TASK_DEMAND_CREATE"
|
||||
:params="{type:0}"
|
||||
:params="{ type: 0 }"
|
||||
:api="demandListApi"
|
||||
:actionsWidth="tableActionsLength['2-2']"
|
||||
exportFileName="新增待办需求"
|
||||
@@ -15,13 +15,15 @@
|
||||
</template>
|
||||
<template #tableActions="slotProps">
|
||||
<div class="gl-table-actions">
|
||||
<el-link type="primary" @click="visibleDialog(false,(slotProps as any).row)">编辑</el-link>
|
||||
<el-link type="primary" @click="visibleDialog(false, (slotProps as any).row)"
|
||||
>编辑</el-link
|
||||
>
|
||||
<el-popconfirm
|
||||
title="确认删除吗?"
|
||||
@confirm="deleteDemandFun((slotProps as any).row.uuid)"
|
||||
>
|
||||
<template #reference>
|
||||
<el-link type="danger" >删除</el-link>
|
||||
<el-link type="danger">删除</el-link>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</div>
|
||||
@@ -30,8 +32,8 @@
|
||||
<Dialog
|
||||
v-model="formVisible"
|
||||
:loading="loadingInterface"
|
||||
:diaTitle="isCreateDialog?'创建需求':'编辑需求'"
|
||||
:width="800"
|
||||
:diaTitle="isCreateDialog ? '创建需求' : '编辑需求'"
|
||||
:width="1100"
|
||||
:height="500"
|
||||
@close="closeFun"
|
||||
show-footer
|
||||
@@ -39,13 +41,13 @@
|
||||
<TableForm
|
||||
ref="tableFormRef"
|
||||
tableName="SIMULATION_TASK_DEMAND_CREATE"
|
||||
@change="changeFun($event,'form')"
|
||||
@change="changeFun($event, 'form')"
|
||||
@remove="removeFileFun"
|
||||
@load="loadTableForm"
|
||||
:colNum="2"
|
||||
:hidKeys="hidKeys"
|
||||
>
|
||||
<template v-for="(name) in Object.keys($slots)" :key="name" #[name]="scope">
|
||||
<template v-for="name in Object.keys($slots)" :key="name" #[name]="scope">
|
||||
<slot :name="name" v-bind="scope" />
|
||||
</template>
|
||||
</TableForm>
|
||||
@@ -57,7 +59,7 @@
|
||||
</template>
|
||||
</Dialog>
|
||||
</div>
|
||||
<attachments :demandId="demandInfo.uuid" v-model:visible="attachmentsVisible" ></attachments>
|
||||
<attachments :demandId="demandInfo.uuid" v-model:visible="attachmentsVisible"></attachments>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -114,23 +116,23 @@ const demandInfo = reactive({
|
||||
|
||||
const isCreateDialog = ref(true);
|
||||
|
||||
const visibleDialog = async( visible:boolean, row?: any) => {
|
||||
const visibleDialog = async (visible: boolean, row?: any) => {
|
||||
console.log('row', row);
|
||||
formVisible.value = true;
|
||||
isCreateDialog.value = visible;
|
||||
if (!isCreateDialog.value) {
|
||||
const res:any = await dataQueryDirApi({ nodeId: row.id, current: 1, size: 99 });
|
||||
row.attachments = res.data?.data?.map((item: { originalName: any; fileSize: any;id:number }) => {
|
||||
return {
|
||||
name: item.originalName,
|
||||
size: item.fileSize,
|
||||
id: item.id,
|
||||
};
|
||||
}
|
||||
) || [];
|
||||
const res: any = await dataQueryDirApi({ nodeId: row.id, current: 1, size: 99 });
|
||||
row.attachments =
|
||||
res.data?.data?.map((item: { originalName: any; fileSize: any; id: number }) => {
|
||||
return {
|
||||
name: item.originalName,
|
||||
size: item.fileSize,
|
||||
id: item.id,
|
||||
};
|
||||
}) || [];
|
||||
let phaseList = [];
|
||||
if (row.phaseId) {
|
||||
phaseList = await getChildrenNodeList(NODE_TYPE.PHASE, row.projectId );
|
||||
phaseList = await getChildrenNodeList(NODE_TYPE.PHASE, row.projectId);
|
||||
phaseList = phaseList.map((item: any) => {
|
||||
return {
|
||||
label: item.nodeName,
|
||||
@@ -138,7 +140,7 @@ const visibleDialog = async( visible:boolean, row?: any) => {
|
||||
};
|
||||
});
|
||||
}
|
||||
let simList:any ;
|
||||
let simList: any;
|
||||
if (row.simType) {
|
||||
simList = commonStore.getDictData(row.demandType);
|
||||
}
|
||||
@@ -161,17 +163,17 @@ const visibleDialog = async( visible:boolean, row?: any) => {
|
||||
};
|
||||
|
||||
const deleteDemandFun = async (uuid: number) => {
|
||||
const res:any = await deleteDemandApi({ deleteNodeIdList: [uuid] });
|
||||
const res: any = await deleteDemandApi({ deleteNodeIdList: [uuid] });
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('删除成功');
|
||||
tableRef.value.tableRef.resetFun();
|
||||
}
|
||||
};
|
||||
|
||||
const confirmFun = async() => {
|
||||
const confirmFun = async () => {
|
||||
if (await tableFormRef.value.validateFun()) {
|
||||
loadingInterface.value = true;
|
||||
const fromData:any = tableFormRef.value.getFormDataFun();
|
||||
const fromData: any = tableFormRef.value.getFormDataFun();
|
||||
console.log('fromData', fromData);
|
||||
if (fromData.planTime) {
|
||||
fromData.beginTime = fromData.planTime[0];
|
||||
@@ -203,21 +205,21 @@ const confirmFun = async() => {
|
||||
}
|
||||
};
|
||||
|
||||
const createDemandApiFun = async(fromData:any) => {
|
||||
const createDemandApiFun = async (fromData: any) => {
|
||||
const params = {
|
||||
'pid': fromData.nodeId,
|
||||
'demandName': fromData.demandName,
|
||||
'demandCode': fromData.demandCode,
|
||||
'demandStatus': '0',
|
||||
pid: fromData.nodeId,
|
||||
demandName: fromData.demandName,
|
||||
demandCode: fromData.demandCode,
|
||||
demandStatus: '0',
|
||||
demandType: fromData.demandType,
|
||||
simType: fromData.simType,
|
||||
'beginTime': fromData.beginTime,
|
||||
'endTime': fromData.endTime,
|
||||
'pMemberList': fromData.pMemberList,
|
||||
beginTime: fromData.beginTime,
|
||||
endTime: fromData.endTime,
|
||||
pMemberList: fromData.pMemberList,
|
||||
eMemberList: '',
|
||||
'projectId': fromData.projectId,
|
||||
'phaseId': fromData.phaseId,
|
||||
'nodeId': fromData.nodeId,
|
||||
projectId: fromData.projectId,
|
||||
phaseId: fromData.phaseId,
|
||||
nodeId: fromData.nodeId,
|
||||
// extraList: [
|
||||
// {
|
||||
// propertyName: 'robotBrand',
|
||||
@@ -227,7 +229,7 @@ const createDemandApiFun = async(fromData:any) => {
|
||||
// },
|
||||
// ],
|
||||
};
|
||||
const res:any = await addDemandApi(params);
|
||||
const res: any = await addDemandApi(params);
|
||||
if (res.code === 200) {
|
||||
formVisible.value = false;
|
||||
ElMessage.success('创建成功');
|
||||
@@ -237,7 +239,7 @@ const createDemandApiFun = async(fromData:any) => {
|
||||
}
|
||||
};
|
||||
|
||||
const editDemandApiFun = async(fromData: any) => {
|
||||
const editDemandApiFun = async (fromData: any) => {
|
||||
console.log('fromData', fromData);
|
||||
// let addFileList = [];
|
||||
// let deleteFileList = [];
|
||||
@@ -254,7 +256,11 @@ const editDemandApiFun = async(fromData: any) => {
|
||||
// oldAttachments.value.forEach((item: any) => {
|
||||
// formData.attachments.some((item2: any) => item2.name ===)
|
||||
// })
|
||||
const res:any = await editDemandApi({ ...fromData, pMemberList: fromData.pMemberList, eMemberList: '' });
|
||||
const res: any = await editDemandApi({
|
||||
...fromData,
|
||||
pMemberList: fromData.pMemberList,
|
||||
eMemberList: '',
|
||||
});
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('修改成功');
|
||||
formVisible.value = false;
|
||||
@@ -281,9 +287,9 @@ const editDemandApiFun = async(fromData: any) => {
|
||||
|
||||
const deleteFileList = ref<number[]>([]);
|
||||
|
||||
const changeFun = async (val: any, type:string) => {
|
||||
const changeFun = async (val: any, type: string) => {
|
||||
console.log('val', val);
|
||||
let optionRef :any;
|
||||
let optionRef: any;
|
||||
if (type === 'search') {
|
||||
optionRef = tableRef.value;
|
||||
} else {
|
||||
@@ -327,8 +333,8 @@ const removeFileFun = (val: any) => {
|
||||
deleteFileList.value.push(val.val.id);
|
||||
};
|
||||
|
||||
const getPhaseList = async (nodeType:string, projectUuid: string) => {
|
||||
let optionList = await getChildrenNodeList(nodeType, projectUuid );
|
||||
const getPhaseList = async (nodeType: string, projectUuid: string) => {
|
||||
let optionList = await getChildrenNodeList(nodeType, projectUuid);
|
||||
optionList = optionList.map((item: any) => {
|
||||
return {
|
||||
label: item.nodeName,
|
||||
|
||||
Reference in New Issue
Block a user