Skip to content

Commit

Permalink
feat: 优化功能,修复问题。
Browse files Browse the repository at this point in the history
  • Loading branch information
JackySoft authored and jianbing.chen committed Dec 18, 2024
1 parent ddf0109 commit 28c70eb
Show file tree
Hide file tree
Showing 22 changed files with 196 additions and 39 deletions.
6 changes: 3 additions & 3 deletions packages/admin/src/components/Tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ function Tab() {
const id = getPageId(pageId, pageMap);
const menuItem = pageMap[Number(id)];
if (!menuItem) return;
if (!tabsList.find((item) => item.key == pathname)) {
if (!tabsList.find((item) => item.key.includes(pathname))) {
tabsList.push({
key: pathname,
key: pathname + location.search,
label: menuItem.name,
closable: true,
});
}
setTabsList([...tabsList]);
setActiveKey(pathname);
setActiveKey(pathname + location.search);
};
// 删除页签
const remove = (path: string) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/src/layout/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const AdminLayout = () => {
if (!menus) return;

// 如果没有页面路径,跳转到欢迎页
if (!/project\/\d+\/\d+/.test(pathname)) navigate(`/project/${projectId}/welcome`);
if (!/project\/\d+\/\w+/.test(pathname)) navigate(`/project/${projectId}/welcome`);
const { menuTree, buttons, pageMap, menuMap } = arrayToTree(menus.list);
storage.set('buttons', buttons);
storage.set('pageMap', pageMap);
Expand Down
8 changes: 4 additions & 4 deletions packages/docs/src/deploy-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ const ZHIPU_AI_KEY = '';
```

> 1. 上面的配置,对于必填的,都有备注。
> 2. 邮箱必须是自己的 163 邮箱,并且开启 POP3 服务,否则无法发送验证码
> 3. 第一次开启 POP3 服务,会得到一个授权码,需要把授权码填写在邮箱密码处,此时不能用邮箱密码。
> 2. 邮箱必须是自己的 163 邮箱,并且开启 `POP3` 服务,否则无法发送验证码
> 3. 第一次开启 `POP3` 服务,会得到一个授权码,需要把授权码填写在邮箱密码处,此时不能用邮箱密码。
> 4. 后续邮箱注册会变更为企业邮箱。
3. 安装依赖
Expand All @@ -118,7 +118,7 @@ yarn dev
## 前端编辑器启动

前端是一个`monorepo`仓库,因此必须使用`pnpm`启动。里面包含三个项目,分别是编辑器(editor)、访问端(admin)和文档(docs)。
前端是一个`monorepo`仓库,因此必须使用`pnpm`启动。里面包含三个项目,分别是编辑器(`editor`)、访问端(`admin`)和文档(`docs`)。

1. 安装依赖

Expand Down Expand Up @@ -174,7 +174,7 @@ http://127.0.0.1:8080

1. 修改接口配置

打开 marsview/packages/editor/vite.config.ts,修改 proxy 中的 target 为本地后端接口地址
打开 `marsview/packages/admin/vite.config.ts`,修改 `proxy` 中的 `target` 为本地后端接口地址

```
proxy: {
Expand Down
Binary file removed packages/editor/public/imgs/ai.png
Binary file not shown.
1 change: 0 additions & 1 deletion packages/editor/public/imgs/ai.svg

This file was deleted.

1 change: 0 additions & 1 deletion packages/editor/public/imgs/ailogo2.svg

This file was deleted.

Binary file removed packages/editor/public/imgs/aislogo.png
Binary file not shown.
Binary file removed packages/editor/public/imgs/m1.png
Binary file not shown.
Binary file removed packages/editor/public/imgs/m2.png
Binary file not shown.
Binary file removed packages/editor/public/imgs/m3.png
Binary file not shown.
Binary file removed packages/editor/public/imgs/m4.png
Binary file not shown.
Binary file removed packages/editor/public/imgs/p1.png
Binary file not shown.
Binary file removed packages/editor/public/imgs/p2.png
Binary file not shown.
Binary file removed packages/editor/public/imgs/p3.png
Binary file not shown.
Binary file removed packages/editor/public/imgs/p4.png
Binary file not shown.
Binary file removed packages/editor/public/imgs/p5.png
Binary file not shown.
1 change: 1 addition & 0 deletions packages/editor/src/layout/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const Header = memo(() => {
if (isPage) navigate('/pages');
if (isLib) navigate('/libs');
if (isTmpl) navigate('/templates');
navigate('/projects');
};

// Tab切换项
Expand Down
5 changes: 4 additions & 1 deletion packages/editor/src/packages/utils/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,10 @@ const handleRequest = async ({ action, next }: ActionNode<ApiConfig>, data: any)
const handleJumpLink = async ({ action, next }: ActionNode<JumpLinkAction>, data: any) => {
const params = new URLSearchParams(data);
if (action.jumpType === 'route') {
const url = `${action.url}${action.url.indexOf('?') > -1 ? '&' : '?'}${params}`;
let url = action.url;
if (params) {
url += action.url.indexOf('?') > -1 ? '&' : '?' + params;
}
router.navigate(url);
} else if (action.jumpType === 'micro') {
if (!window.microApp) {
Expand Down
4 changes: 2 additions & 2 deletions packages/editor/src/pages/home/lib/LibEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,9 @@ export default () => {
onChange={handleTabChange}
tabBarExtraContent={
<Space size={20}>
<Button type="primary" onClick={handleAICodeChat} icon={<BulbOutlined />}>
{/* <Button type="primary" onClick={handleAICodeChat} icon={<BulbOutlined />}>
AI助手
</Button>
</Button> */}
<Button type="default" onClick={handleBack}>
返回
</Button>
Expand Down
176 changes: 157 additions & 19 deletions packages/editor/src/pages/welcome/Welcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,51 +82,189 @@ export default function Welcome() {
<h1>模块介绍</h1>
<div className={style.moduleList}>
<div className={style.moduleItem}>
<img src="/imgs/m1.png" />
<span>项目配置</span>
<svg
xmlns="http://www.w3.org/2000/svg"
width="48"
height="48"
viewBox="0 0 24 24"
fill="none"
stroke="var(--mars-primary-color)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
data-id="59"
>
<path d="m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z"></path>
<path d="m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65"></path>
<path d="m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65"></path>
</svg>
<h3>项目管理</h3>
<p>高效管理多个项目,轻松协作</p>
</div>
<div className={style.moduleItem}>
<img src="/imgs/m2.png" />
<span>权限管理</span>
<svg
xmlns="http://www.w3.org/2000/svg"
width="48"
height="48"
viewBox="0 0 24 24"
fill="none"
stroke="var(--mars-primary-color)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<rect width="18" height="18" x="3" y="3" rx="2"></rect>
<path d="M3 9h18"></path>
<path d="M9 21V9"></path>
</svg>
<h3>页面管理</h3>
<p>强大的编辑器,轻松掌控页面设计</p>
</div>
<div className={style.moduleItem}>
<img src="/imgs/m3.png" />
<span>编辑器</span>
<svg viewBox="64 64 896 896" width="48" height="48" fill="var(--mars-primary-color)">
<path d="M864 518H506V160c0-4.4-3.6-8-8-8h-26a398.46 398.46 0 00-282.8 117.1 398.19 398.19 0 00-85.7 127.1A397.61 397.61 0 0072 552a398.46 398.46 0 00117.1 282.8c36.7 36.7 79.5 65.6 127.1 85.7A397.61 397.61 0 00472 952a398.46 398.46 0 00282.8-117.1c36.7-36.7 65.6-79.5 85.7-127.1A397.61 397.61 0 00872 552v-26c0-4.4-3.6-8-8-8zM705.7 787.8A331.59 331.59 0 01470.4 884c-88.1-.4-170.9-34.9-233.2-97.2C174.5 724.1 140 640.7 140 552c0-88.7 34.5-172.1 97.2-234.8 54.6-54.6 124.9-87.9 200.8-95.5V586h364.3c-7.7 76.3-41.3 147-96.6 201.8zM952 462.4l-2.6-28.2c-8.5-92.1-49.4-179-115.2-244.6A399.4 399.4 0 00589 74.6L560.7 72c-4.7-.4-8.7 3.2-8.7 7.9V464c0 4.4 3.6 8 8 8l384-1c4.7 0 8.4-4 8-8.6zm-332.2-58.2V147.6a332.24 332.24 0 01166.4 89.8c45.7 45.6 77 103.6 90 166.1l-256.4.7z"></path>
</svg>
<h3>精选模板</h3>
<p>丰富的预设模板,一健拿捏</p>
</div>
<div className={style.moduleItem}>
<img src="/imgs/m4.png" />
<span>用户访问</span>
<svg
xmlns="http://www.w3.org/2000/svg"
width="48"
height="48"
viewBox="0 0 24 24"
fill="none"
stroke="var(--mars-primary-color)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.501 2.501 0 1 0-3.214 3.214c.446.166.855.497.925.968a.979.979 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.705.707 2.402 2.402 0 0 1-1.704-.706l-1.568-1.568a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.02.968a2.5 2.5 0 1 1-3.237-3.237c.464-.18.894-.527.967-1.02a1.026 1.026 0 0 0-.289-.877l-1.568-1.568A2.402 2.402 0 0 1 1.998 12c0-.617.236-1.234.706-1.704L4.23 8.77c.24-.24.581-.353.917-.303.515.077.877.528 1.073 1.01a2.5 2.5 0 1 0 3.259-3.259c-.482-.196-.933-.558-1.01-1.073-.05-.336.062-.676.303-.917l1.525-1.525A2.402 2.402 0 0 1 12 1.998c.617 0 1.234.236 1.704.706l1.568 1.568c.23.23.556.338.877.29.493-.074.84-.504 1.02-.968a2.5 2.5 0 1 1 3.237 3.237c-.464.18-.894.527-.967 1.02Z"></path>
</svg>
<h3>自定义组件</h3>
<p>灵活创建和使用自定义组件</p>
</div>
</div>
</section>
<section className={style.module} style={{ backgroundColor: '#fafafa' }}>
<h1>项目特色</h1>
<div className={style.moduleList}>
<div className={style.moduleItem}>
<img src="/imgs/p1.png" style={{ width: 90 }} />
<span>逻辑编排</span>
<svg
xmlns="http://www.w3.org/2000/svg"
width="48"
height="48"
viewBox="0 0 24 24"
fill="none"
stroke="var(--mars-primary-color)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
data-id="51"
>
<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"></path>
<circle cx="9" cy="7" r="4"></circle>
<path d="M22 21v-2a4 4 0 0 0-3-3.87"></path>
<path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
</svg>
<h3>权限分配</h3>
<p>支持细粒度的权限控制,确保数据安全</p>
</div>
<div className={style.moduleItem}>
<img src="/imgs/p2.png" style={{ width: 90 }} />
<span>权限分配</span>
<svg
xmlns="http://www.w3.org/2000/svg"
width="48"
height="48"
viewBox="0 0 24 24"
fill="none"
stroke="var(--mars-primary-color)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
data-id="47"
>
<path d="M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"></path>
</svg>
<h3>逻辑编排</h3>
<p>可视化逻辑编排,轻松构建复杂业务流程</p>
</div>

<div className={style.moduleItem}>
<img src="/imgs/p3.png" style={{ width: 90 }} />
<span>源码生成</span>
<svg
xmlns="http://www.w3.org/2000/svg"
width="48"
height="48"
viewBox="0 0 24 24"
fill="none"
stroke="var(--mars-primary-color)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
data-id="55"
>
<polyline points="16 18 22 12 16 6"></polyline>
<polyline points="8 6 2 12 8 18"></polyline>
</svg>
<h3>源码生成</h3>
<p>自动生成高质量源代码,提高开发效率</p>
</div>
<div className={style.moduleItem}>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="48"
height="48"
fill="none"
stroke="var(--mars-primary-color)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<rect x="2" y="2" width="20" height="8" rx="2" ry="2" data-id="2"></rect>
<rect x="2" y="14" width="20" height="8" rx="2" ry="2" data-id="3"></rect>
<line x1="6" y1="6" x2="6" y2="6" data-id="4"></line>
<line x1="10" y1="6" x2="10" y2="6" data-id="5"></line>
<line x1="6" y1="18" x2="6" y2="18" data-id="6"></line>
<line x1="10" y1="18" x2="10" y2="18" data-id="7"></line>
<path d="M14 6h6" data-id="8"></path>
<path d="M14 18h6" data-id="9"></path>
</svg>
<h3>多环境</h3>
<p>轻松管理和切换多个开发环境</p>
</div>
<div className={style.moduleItem}>
<img src="/imgs/p4.png" style={{ width: 90 }} />
<span>接口配置</span>
<svg viewBox="64 64 896 896" width="48" height="48" fill="var(--mars-primary-color)">
<path d="M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"></path>
</svg>
<h3>接口配置</h3>
<p>强大的API管理,加速前后端对接</p>
</div>
<div className={style.moduleItem}>
<img src="/imgs/p5.png" style={{ width: 90 }} />
<span>发布、回滚</span>
<svg
xmlns="http://www.w3.org/2000/svg"
width="48"
height="48"
viewBox="0 0 24 24"
fill="none"
stroke="var(--mars-primary-color)"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
data-id="63"
>
<line x1="6" x2="6" y1="3" y2="15"></line>
<circle cx="18" cy="6" r="3"></circle>
<circle cx="6" cy="18" r="3"></circle>
<path d="M18 9a9 9 0 0 1-9 9"></path>
</svg>
<h3>发布、回滚</h3>
<p>一键发布和回滚,保障系统稳定性</p>
</div>
</div>
</section>
<section className={style.footer}>
<img src="/imgs/mars-logo-dark.png" />
<h1>欢迎使用 Marsview 零代码搭建工具</h1>
<h1>欢迎使用 Marsview 零代码搭建平台</h1>
<Link to="/projects">
<Button type="primary" size="large">
快速开始
Expand Down
26 changes: 20 additions & 6 deletions packages/editor/src/pages/welcome/index.module.less
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,30 @@
.module {
padding-top: 100px;
padding-bottom: 100px;
padding-inline: 40px;
h1 {
color: var(--mars-primary-color);
font-size: 36px;
text-align: center;
margin-bottom: 80px;
}
&:nth-child(2n) {
.moduleList {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
.moduleList {
display: flex;
align-items: center;
justify-content: center;
gap: 120px;
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 2.5rem;
.moduleItem {
display: flex;
flex-direction: column;
align-items: center;
padding: 1rem;
background-color: rgb(250 245 255 / 1);
border-color: rgb(243 232 255 / 1);
border-radius: 0.5rem;
img {
width: 110px;
cursor: pointer;
Expand All @@ -122,11 +132,15 @@
transform: scale(1.2);
}
}
span {
h3 {
font-size: 24px;
color: #000;
color: var(--mars-primary-color);
margin-top: 20px;
}
p {
color: rgb(75 85 99 / 1);
margin-top: 8px;
}
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion packages/materials/utils/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,10 @@ const handleRequest = async ({ action, next }: ActionNode<ApiConfig>, data: any)
const handleJumpLink = async ({ action, next }: ActionNode<JumpLinkAction>, data: any) => {
const params = new URLSearchParams(data);
if (action.jumpType === 'route') {
const url = `${action.url}${action.url.indexOf('?') > -1 ? '&' : '?'}${params}`;
let url = action.url;
if (params.size > 0) {
url += action.url.indexOf('?') > -1 ? '&' : '?' + params;
}
router.navigate(url);
} else if (action.jumpType === 'micro') {
if (!window.microApp) {
Expand Down

0 comments on commit 28c70eb

Please sign in to comment.