update:指标归档功能更新
This commit is contained in:
@@ -14,6 +14,12 @@
|
||||
>
|
||||
<template v-if="showLeftOptions" #leftOptions>
|
||||
<div class="operate-box">
|
||||
<el-button
|
||||
v-if="paramType === 'run' && canUpdate"
|
||||
type="primary"
|
||||
@click="ArchiveRunDataFun"
|
||||
>归档</el-button
|
||||
>
|
||||
<el-button v-if="canUpdate" type="primary" @click="openAddPerformanceWindFun"
|
||||
>新增</el-button
|
||||
>
|
||||
@@ -73,17 +79,25 @@
|
||||
:export-api="exportPerformanceByScriptApi"
|
||||
showCheckbox
|
||||
hidePagination
|
||||
:actionList="showLeftOptions ? actionList : []"
|
||||
:actionList="showLeftOptions && canUpdate ? actionList : []"
|
||||
:export-params="excelParams"
|
||||
:full-height="fullHeight"
|
||||
:show-setting="false"
|
||||
>
|
||||
<template v-if="showLeftOptions" #leftOptions>
|
||||
<div class="operate-box">
|
||||
<el-button type="primary" @click="ArchiveRunDataFun">归档</el-button>
|
||||
<el-button type="primary" @click="openAddPerformanceWindFun">新增</el-button>
|
||||
<el-button type="danger" @click="deleteFun">删除</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
v-if="paramType === 'run' && canUpdate"
|
||||
@click="ArchiveRunDataFun"
|
||||
>归档</el-button
|
||||
>
|
||||
<el-button v-if="canUpdate" type="primary" @click="openAddPerformanceWindFun"
|
||||
>新增</el-button
|
||||
>
|
||||
<el-button v-if="canUpdate" type="danger" @click="deleteFun">删除</el-button>
|
||||
<el-button
|
||||
v-if="canUpdate"
|
||||
icon="Upload"
|
||||
title="导入Excel"
|
||||
link
|
||||
@@ -104,9 +118,9 @@
|
||||
{{ PERFORMANCE_UNIT.O[row.unit] }}
|
||||
</template>
|
||||
|
||||
<template #operate="{ row }">
|
||||
<!-- <template #operate="{ row }">
|
||||
<el-button type="danger" link @click="delPerformance(row)">删除</el-button>
|
||||
</template>
|
||||
</template> -->
|
||||
</BaseTable>
|
||||
</div>
|
||||
<!-- <div class="operate-box">
|
||||
@@ -486,18 +500,28 @@ const updatePerformanceFun = async (data: any) => {
|
||||
|
||||
// 归档
|
||||
const ArchiveRunDataFun = async () => {
|
||||
const param = {
|
||||
runId: props.runInfo.uuid,
|
||||
};
|
||||
try {
|
||||
const res: any = await syncKeyResultToTaskApi(param);
|
||||
if (res && res.code === 200) {
|
||||
ElMessage.success('归档成功');
|
||||
} else {
|
||||
ElMessage.warning('归档未成功');
|
||||
const checkData = baseTableRef.value.tableRef.getCheckboxRecords()
|
||||
|
||||
if (checkData?.length) {
|
||||
const ids = checkData.map((item: any) => {
|
||||
return item.id;
|
||||
});
|
||||
const param = {
|
||||
runId: props.runInfo.uuid,
|
||||
performanceIdList: ids,
|
||||
};
|
||||
try {
|
||||
const res: any = await syncKeyResultToTaskApi(param);
|
||||
if (res && res.code === 200) {
|
||||
ElMessage.success('归档成功');
|
||||
} else {
|
||||
ElMessage.warning('归档未成功');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
ElMessage.warning('请勾选算例后进行归档');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user