feat: 低代码平台的页面使用低代码平台自身来制作
This commit is contained in:
parent
2d202cd6d7
commit
1d7b28160a
@ -13,17 +13,17 @@
|
|||||||
"clean": "rimraf node_modules"
|
"clean": "rimraf node_modules"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vtj/core": "^0.10.7",
|
"@vtj/core": "^0.10.9",
|
||||||
"@vtj/designer": "0.10.7",
|
"@vtj/designer": "0.10.9",
|
||||||
"@vtj/icons": "0.10.7",
|
"@vtj/icons": "0.10.9",
|
||||||
"@vtj/local": "^0.10.7",
|
"@vtj/local": "^0.10.9",
|
||||||
"@vtj/materials": "^0.10.7",
|
"@vtj/materials": "^0.10.9",
|
||||||
"@vtj/node": "0.10.2",
|
"@vtj/node": "0.10.2",
|
||||||
"@vtj/pro": "^0.10.7",
|
"@vtj/pro": "^0.10.9",
|
||||||
"@vtj/renderer": "^0.10.7",
|
"@vtj/renderer": "^0.10.9",
|
||||||
"@vtj/ui": "^0.10.7",
|
"@vtj/ui": "^0.10.9",
|
||||||
"@vtj/utils": "0.10.7",
|
"@vtj/utils": "0.10.9",
|
||||||
"@vtj/web": "^0.10.7",
|
"@vtj/web": "^0.10.9",
|
||||||
"axios": "^1.8.1",
|
"axios": "^1.8.1",
|
||||||
"element-plus": "^2.9.4",
|
"element-plus": "^2.9.4",
|
||||||
"licia-es": "^1.46.0",
|
"licia-es": "^1.46.0",
|
||||||
|
@ -32,16 +32,6 @@ const routes: Array<RouteRecordRaw> = [
|
|||||||
},
|
},
|
||||||
component: () => import('@/components/renderer-adapter/index.vue'),
|
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'),
|
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>
|
|
8
apps/renderer/env.d.ts
vendored
Normal file
8
apps/renderer/env.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
|
interface ImportMeta {
|
||||||
|
readonly env: {
|
||||||
|
NODE_ENV: "development" | "production";
|
||||||
|
VITE_API_BASE?: string;
|
||||||
|
};
|
||||||
|
}
|
@ -17,13 +17,13 @@
|
|||||||
"@sy/low-code-shared": "workspace:*",
|
"@sy/low-code-shared": "workspace:*",
|
||||||
"@sy/web-vitals": "workspace:*",
|
"@sy/web-vitals": "workspace:*",
|
||||||
"@tanstack/vue-query": "^5.66.9",
|
"@tanstack/vue-query": "^5.66.9",
|
||||||
"@vtj/core": "^0.10.7",
|
"@vtj/core": "^0.10.9",
|
||||||
"@vtj/pro": "^0.10.7",
|
"@vtj/icons": "0.10.9",
|
||||||
"@vtj/ui": "^0.10.7",
|
"@vtj/materials": "^0.10.9",
|
||||||
"@vtj/web": "^0.10.7",
|
"@vtj/pro": "^0.10.9",
|
||||||
"@vtj/renderer": "^0.10.7",
|
"@vtj/renderer": "^0.10.9",
|
||||||
"@vtj/icons": "0.10.7",
|
"@vtj/ui": "^0.10.9",
|
||||||
"@vtj/materials": "^0.10.7",
|
"@vtj/web": "^0.10.9",
|
||||||
"axios": "^1.8.1",
|
"axios": "^1.8.1",
|
||||||
"core-js": "^3.40.0",
|
"core-js": "^3.40.0",
|
||||||
"element-plus": "^2.9.4",
|
"element-plus": "^2.9.4",
|
||||||
@ -34,6 +34,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@farmfe/cli": "^1.0.4",
|
"@farmfe/cli": "^1.0.4",
|
||||||
|
"@vtj/cli": "^0.10.2",
|
||||||
"@farmfe/core": "^1.6.6",
|
"@farmfe/core": "^1.6.6",
|
||||||
"@sy/vite-plugin-http2-proxy": "workspace:*",
|
"@sy/vite-plugin-http2-proxy": "workspace:*",
|
||||||
"@vitejs/plugin-vue": "^5.2.1",
|
"@vitejs/plugin-vue": "^5.2.1",
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// @ts-nocheck
|
|
||||||
import { computed, watch, ref, getCurrentInstance } from 'vue'
|
import { computed, watch, ref, getCurrentInstance } from 'vue'
|
||||||
import { ElLoading } from 'element-plus'
|
import { ElLoading } from 'element-plus'
|
||||||
import Postmate from 'postmate'
|
import Postmate from 'postmate'
|
||||||
@ -7,8 +6,7 @@ import { createProvider } from '@vtj/web'
|
|||||||
import { useQuery } from '@tanstack/vue-query'
|
import { useQuery } from '@tanstack/vue-query'
|
||||||
import { LowCodeService } from './service'
|
import { LowCodeService } from './service'
|
||||||
import { getFile } from './io'
|
import { getFile } from './io'
|
||||||
import * as VtjUI from '@vtj/ui'
|
// import * as VtjUI from '@vtj/ui'
|
||||||
console.log('VtjUI',VtjUI)
|
|
||||||
|
|
||||||
// 响应式状态
|
// 响应式状态
|
||||||
const renderer = ref()
|
const renderer = ref()
|
||||||
@ -42,9 +40,9 @@ const { data: file, isFetching } = useQuery({
|
|||||||
nodeEnv: import.meta.env.NODE_ENV,
|
nodeEnv: import.meta.env.NODE_ENV,
|
||||||
service: lowCodeService,
|
service: lowCodeService,
|
||||||
project: { id: model.projectId },
|
project: { id: model.projectId },
|
||||||
components: {
|
// components: {
|
||||||
...VtjUI,
|
// ...VtjUI,
|
||||||
}
|
// }
|
||||||
})
|
})
|
||||||
onReady(async () => {
|
onReady(async () => {
|
||||||
const instance = getCurrentInstance()
|
const instance = getCurrentInstance()
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
// @ts-nocheck
|
|
||||||
import { type ProjectSchema, type BlockSchema, ProjectModel } from "@vtj/core";
|
import { type ProjectSchema, type BlockSchema, ProjectModel } from "@vtj/core";
|
||||||
import { BaseService } from "@vtj/renderer";
|
import { BaseService } from "@vtj/renderer";
|
||||||
import { getProject, getFile as getLowCodeFile } from "@/io";
|
import { getProject, getFile as getLowCodeFile } from "@/io";
|
||||||
|
@ -1,16 +1,15 @@
|
|||||||
{
|
{
|
||||||
|
"extends": "./node_modules/@vtj/cli/config/tsconfig.web.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"module": "nodenext",
|
||||||
|
"lib": ["ESNext", "DOM"],
|
||||||
|
"moduleResolution": "nodenext",
|
||||||
"noUnusedLocals": false,
|
"noUnusedLocals": false,
|
||||||
"noUnusedParameters": false,
|
"noUnusedParameters": false,
|
||||||
"baseUrl": "./",
|
"baseUrl": "./",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["src/*"],
|
"@/*": ["src/*"]
|
||||||
"$vtj/*": [".vtj/*"]
|
}
|
||||||
},
|
|
||||||
"lib": ["ES2022", "DOM"],
|
|
||||||
"module": "NodeNext",
|
|
||||||
"target": "ES2022",
|
|
||||||
"moduleResolution": "NodeNext"
|
|
||||||
},
|
},
|
||||||
"include": ["src"],
|
"include": ["src"],
|
||||||
"exclude": [".vtj"],
|
"exclude": [".vtj"],
|
||||||
|
1011
pnpm-lock.yaml
generated
1011
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user