feat: 低代码平台的页面使用低代码平台自身来制作
This commit is contained in:
@@ -32,16 +32,6 @@ const routes: Array<RouteRecordRaw> = [
|
||||
},
|
||||
component: () => import('@/components/renderer-adapter/index.vue'),
|
||||
},
|
||||
{
|
||||
path: 'add',
|
||||
name: `${moduleName}-add`,
|
||||
meta: {
|
||||
title: '添加应用',
|
||||
keepAlive: true,
|
||||
icon: 'ant-design:list',
|
||||
},
|
||||
component: () => import('@/views/application/add.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@@ -32,16 +32,6 @@ const routes: Array<RouteRecordRaw> = [
|
||||
},
|
||||
component: () => import('@/components/renderer-adapter/index.vue'),
|
||||
},
|
||||
{
|
||||
path: 'add',
|
||||
name: `${moduleName}-add`,
|
||||
meta: {
|
||||
title: '添加项目',
|
||||
keepAlive: true,
|
||||
icon: 'ant-design:list',
|
||||
},
|
||||
component: () => import('@/views/project/add.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { useQuery, useMutation } from '@tanstack/vue-query';
|
||||
import { getApplicationList, createApplication, deleteApplication } from '@/io';
|
||||
|
||||
const addData = {
|
||||
name: '低代码平台',
|
||||
alias: 'low-code-platform',
|
||||
active: true,
|
||||
};
|
||||
|
||||
const {
|
||||
data: appList,
|
||||
isError,
|
||||
isLoading,
|
||||
refetch,
|
||||
} = useQuery({
|
||||
queryKey: ['applicationList'],
|
||||
queryFn: getApplicationList,
|
||||
enabled: true,
|
||||
});
|
||||
|
||||
const { mutate: createApp, isLoading: isCreating } = useMutation({
|
||||
mutationFn: createApplication,
|
||||
onSuccess: () => {
|
||||
refetch();
|
||||
},
|
||||
});
|
||||
|
||||
const {
|
||||
mutate: deleteApp,
|
||||
isLoading: isDeleting,
|
||||
error: deleteError,
|
||||
} = useMutation({
|
||||
mutationFn: deleteApplication,
|
||||
onSuccess: () => {
|
||||
refetch();
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div style="display: flex; flex-direction: column; gap: 10px">
|
||||
<div v-if="isLoading">加载中...</div>
|
||||
<div v-else-if="isError">加载失败</div>
|
||||
<div v-else>
|
||||
{{ appList }}
|
||||
</div>
|
||||
<Button type="primary" :loading="isCreating" @click="createApp(addData)"> 添加应用 </Button>
|
||||
<Button type="primary" @click="refetch">重新获取</Button>
|
||||
<Button type="primary" :loading="isDeleting" @click="deleteApp('3')"> 删除应用 </Button>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,54 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { useQuery, useMutation } from '@tanstack/vue-query';
|
||||
import { getProjectList, createProject, deleteProject } from '@/io';
|
||||
|
||||
const addData = {
|
||||
application_id: 1,
|
||||
description: '低代码项目管理平台',
|
||||
name: '低代码项目管理平台',
|
||||
alias: 'low-code-project-management-platform',
|
||||
platform: 'web',
|
||||
};
|
||||
|
||||
const {
|
||||
data: projectList,
|
||||
isError,
|
||||
isLoading,
|
||||
refetch,
|
||||
} = useQuery({
|
||||
queryKey: ['getProjectList'],
|
||||
queryFn: getProjectList,
|
||||
enabled: true,
|
||||
});
|
||||
|
||||
const { mutate: createProjectMutation, isLoading: isCreating } = useMutation({
|
||||
mutationFn: createProject,
|
||||
onSuccess: () => {
|
||||
refetch();
|
||||
},
|
||||
});
|
||||
|
||||
const { mutate: deleteProjectMutation, isLoading: isDeleting } = useMutation({
|
||||
mutationFn: deleteProject,
|
||||
onSuccess: () => {
|
||||
refetch();
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div style="display: flex; flex-direction: column; gap: 10px">
|
||||
<div v-if="isLoading">加载中...</div>
|
||||
<div v-else-if="isError">加载失败</div>
|
||||
<div v-else>
|
||||
{{ projectList }}
|
||||
</div>
|
||||
<Button type="primary" :loading="isCreating" @click="createProjectMutation(addData)">
|
||||
添加项目
|
||||
</Button>
|
||||
<Button type="primary" @click="refetch">重新获取</Button>
|
||||
<Button type="primary" :loading="isDeleting" @click="deleteProjectMutation('3')">
|
||||
删除项目
|
||||
</Button>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user