update:HPC列表

This commit is contained in:
2025-12-01 15:12:17 +08:00
parent 0188169bcd
commit b1519a9746
5 changed files with 34 additions and 11 deletions

View File

@@ -1,8 +1,13 @@
import { post } from '@/api/request'; import { post, get } from '@/api/request';
const env = import.meta.env; const env = import.meta.env;
const PREFIX = env.VITE_API_PREFIX_PBS; const PREFIX = env.VITE_API_PREFIX_PBS;
// HPC任务列表
export const queryJobsApi = (params: any) => { export const queryJobsApi = (params: any) => {
return post(`${PREFIX}pbs/queryJobs`, params); return post(`${PREFIX}pbs/queryJobs`, params);
}; };
// 暂停任务
export const stopHpcJobApi = (params: any) => {
return get(`${PREFIX}pbs/stopHpcJob`, params);
};

View File

@@ -61,6 +61,10 @@
.vxe-cell--col-resizable { .vxe-cell--col-resizable {
display: none; display: none;
} }
.vxe-header-cell--wrapper {
display: flex;
align-items: center;
}
} }
} }
.vxe-cell--title { .vxe-cell--title {

View File

@@ -15,21 +15,16 @@
/> />
</div> </div>
</div> </div>
<template #footer>
<div>
<el-button>{{ $t('通用.取消') }}</el-button>
<el-button type="primary">{{ $t('通用.确定') }}</el-button>
</div>
</template>
</Dialog> </Dialog>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch } from 'vue'; import { ref, watch } from 'vue';
import { queryJobsApi } from '@/api/pbs/pbs'; import { queryJobsApi, stopHpcJobApi } from '@/api/pbs/pbs';
import Dialog from '@/components/common/dialog/index.vue'; import Dialog from '@/components/common/dialog/index.vue';
import BaseTable from '@/components/common/table/baseTable.vue'; import BaseTable from '@/components/common/table/baseTable.vue';
import { ElMessage } from 'element-plus';
interface Props { interface Props {
modelValue: boolean; modelValue: boolean;
@@ -52,10 +47,23 @@ const actionList = ref([
type: 'danger', type: 'danger',
needConfirm: true, needConfirm: true,
confirmTip: '确定取消选中计算任务吗?', confirmTip: '确定取消选中计算任务吗?',
click: () => {}, click: (raw: any) => {
stopFun(raw);
},
}, },
]); ]);
const stopFun = (data: any) => {
const params = {
jobId: data.jobId,
};
stopHpcJobApi(params).then((res: any) => {
if (res.code === 200) {
ElMessage.success('操作成功');
}
});
};
const closeFun = () => { const closeFun = () => {
emit('update:modelValue', false); emit('update:modelValue', false);
}; };

View File

@@ -17,6 +17,9 @@
<template #form-updateTime="{ row }"> <template #form-updateTime="{ row }">
{{ row.updateTime || '--' }} {{ row.updateTime || '--' }}
</template> </template>
<template #form-fileType="{ row }">
{{ DATA_SEARCH_FILE_TYPE.O[row.fileType] || '--' }}
</template>
<template #form-fileSize="{ row }"> <template #form-fileSize="{ row }">
{{ formatFileSize(row.fileSize) || '--' }} {{ formatFileSize(row.fileSize) || '--' }}
</template> </template>
@@ -31,7 +34,7 @@ import TableForm from '@/components/common/table/tableForm.vue';
import { formatFileSize } from '@/utils/file'; import { formatFileSize } from '@/utils/file';
import { useDict } from '@/utils/useDict'; import { useDict } from '@/utils/useDict';
const { DATA_TYPE } = useDict('DATA_TYPE'); const { DATA_TYPE, DATA_SEARCH_FILE_TYPE } = useDict('DATA_TYPE', 'DATA_SEARCH_FILE_TYPE');
const tableFormRef = ref(); const tableFormRef = ref();
interface Props { interface Props {

View File

@@ -111,6 +111,9 @@
<template #dataType="{ row }"> <template #dataType="{ row }">
{{ DATA_TYPE.O[row.dataType] }} {{ DATA_TYPE.O[row.dataType] }}
</template> </template>
<template #fileType="{ row }">
{{ DATA_SEARCH_FILE_TYPE.O[row.fileType] || '--' }}
</template>
<template #fileSize="{ row }"> <template #fileSize="{ row }">
{{ formatFileSize(row.fileSize) }} {{ formatFileSize(row.fileSize) }}
</template> </template>
@@ -187,7 +190,7 @@ import { formatFileSize } from '@/utils/file';
import { isCategoryNodeType } from '@/utils/node'; import { isCategoryNodeType } from '@/utils/node';
const env = import.meta.env; const env = import.meta.env;
const { DATA_TYPE } = useDict('DATA_TYPE'); const { DATA_TYPE, DATA_SEARCH_FILE_TYPE } = useDict('DATA_TYPE', 'DATA_SEARCH_FILE_TYPE');
const currentDimension = ref(1); const currentDimension = ref(1);
const templateList = ref<any>([]); const templateList = ref<any>([]);
const configurationShow = ref(false); const configurationShow = ref(false);