update:应用中心路由暂时隐藏,修改应用管理功能

This commit is contained in:
2025-11-25 09:36:37 +08:00
parent 7aa7bed593
commit 0319364b5f
2 changed files with 104 additions and 12 deletions

View File

@@ -183,12 +183,12 @@ export default [
// // component: () => import('@/views/simulation/tool/index.vue'),
// component: () => import('@/views/error/developing.vue'),
// },
{
title: '应用中心',
path: '/simulation/appCenter',
name: 'SimulationAppCenter',
component: () => import('@/views/task/appCenter/index.vue'),
},
// {
// title: '应用中心',
// path: '/simulation/appCenter',
// name: 'SimulationAppCenter',
// component: () => import('@/views/task/appCenter/index.vue'),
// },
],
},
{

View File

@@ -2,7 +2,7 @@
<appConfigPage v-if="isAppInfo" :app-info="currentAppInfo" @back-up="backUpFn"></appConfigPage>
<div class="gl-page-content" v-else>
<BaseTable tableName="APP_CENTER" ref="baseTableRef" hidePagination>
<BaseTable tableName="APP_CENTER" ref="baseTableRef" hidePagination :actionList="actionList">
<template #leftOptions>
<div>
<el-form inline class="search-form">
@@ -28,9 +28,10 @@
</template>
<template #appType="{ row }">
<div class="app-center-cell-content flex-center">
<el-tag v-if="row.appType === '3'" type="primary">HPC</el-tag>
<el-tag v-if="row.appType === '2'" type="success">云应用</el-tag>
<el-tag v-if="row.appType === '1'" type="warning">本地应用</el-tag>
<el-tag v-if="row.appType === '3'" type="primary">{{ getTypeNameFn(row.appType) }}</el-tag>
<el-tag v-else-if="row.appType === '2'" type="success">{{ getTypeNameFn(row.appType) }}</el-tag>
<el-tag v-else-if="row.appType === '1'" type="warning">{{ getTypeNameFn(row.appType) }}</el-tag>
<el-tag v-else type="primary">{{ getTypeNameFn(row.appType) }}</el-tag>
</div>
</template>
<template #appStatus="{ row }">
@@ -70,10 +71,11 @@ import { nextTick, onBeforeUnmount, onMounted, ref } from 'vue';
import BaseTable from '@/components/common/table/baseTable.vue';
import { ElMessage, ElMessageBox } from 'element-plus';
import addOrEditApp from '../application/components/addOrEditApp.vue';
import { getdeviceuuidApi, startupPlugin } from '@/api/application/application';
import { execApi, getdeviceuuidApi, startupPlugin } from '@/api/application/application';
import appConfigPage from './components/appConfigPage.vue';
import { addApplicationApi, queryAllApplicationApi, updateApplicationApi, deleteApplicationApi } from '@/api/system/application';
import appNameBg from '@/views/task/appCenter/components/appNameBg.vue';
import { getDictionaryDataApi } from '@/api/system/systemData';
const env = import.meta.env;
const baseTableRef = ref();
@@ -84,6 +86,52 @@ const tableData = ref<any>([
const appSearchName = ref('');
const actionList = ref([
{
title: '启动',
type: 'primary',
click: (row:any) => {
startAppFn(row);
},
},
{
title: '编辑',
type: 'primary',
click: (row:any) => {
editAppInfoFn(row);
},
},
{
title: '启用',
type: 'primary',
hide: (row:any) => {
return row.appStatus === '1';
},
click: (row:any) => {
disabledAppFn(row);
},
},
{
title: '禁用',
type: 'danger',
hide: (row:any) => {
return row.appStatus != '1';
},
click: (row:any) => {
disabledAppFn(row);
},
},
{
title: '删除',
type: 'danger',
needConfirm: true,
confirmTip: '确认删除吗?',
click: (row:any) => {
deleteAppFn(row);
},
},
]);
const setTableDataFn = async () => {
const res: any = await queryAllApplicationApi();
@@ -302,7 +350,51 @@ const searchAppFn = async () => {
};
onMounted(() => {
const startAppFn = async (data: any) => {
await getdeviceuuidFn();
const uuid = localStorage.getItem('USER_UUID');
if (uuid) {
const res = await execApi({
path: data.appPath,
param: '',
});
if (res) {
ElMessage.success('应用正在启动中,请等待');
} else {
}
} else {
return;
}
};
const appTypeList = ref<any>([]);
const getDictionaryDataFn = async () => {
const res:any = await getDictionaryDataApi({
dictClass: 'APP_TYPE',
});
if (res && res.code === 200) {
appTypeList.value = res.data;
}
};
const getTypeNameFn = (type:any) => {
const str = appTypeList.value.find((item:any) => {
return item.dictValue === type;
})?.dictName || '';
return str;
};
onMounted(async () => {
await getDictionaryDataFn();
setTableDataFn();
});