Skip to content

Commit

Permalink
fix: 修复问题
Browse files Browse the repository at this point in the history
  • Loading branch information
JackySoft committed Nov 1, 2024
1 parent 272d59e commit 8d74c81
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 10 deletions.
6 changes: 3 additions & 3 deletions backend/koa/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
*/
const SERVER_HOST = 'http://localhost';
const SERVER_PORT = 5000;
const DATABASE_HOST = '';
const DATABASE_HOST = '127.0.0.1';
const DATABASE_PORT = 3306;
const DATABASE_USER = '';
const DATABASE_PASSWORD = '';
const DATABASE_NAME = '';
const DATABASE_NAME = 'marsview';

/**
* 飞书应用配置,用来发送飞书消息
Expand All @@ -22,7 +22,7 @@ const FEISHU_APP_SECRET = '';
/**
* JWT签名密钥和过期时间
*/
const JWT_SECRET = '';
const JWT_SECRET = 'marsview';
const JWT_EXPIRES_IN = '7d';

/**
Expand Down
3 changes: 2 additions & 1 deletion packages/docs/src/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const FEISHU_APP_SECRET = '';
/**
* JWT签名密钥和过期时间
*/
const JWT_SECRET = '';// jwt密钥随便填写,用来做token鉴权用
const JWT_SECRET = 'marsview';// jwt密钥随便填写,用来做token鉴权用
const JWT_EXPIRES_IN = '7d';// jwt过期时间
/**
Expand Down Expand Up @@ -166,6 +166,7 @@ proxy: {
```

> 注意:为了解决本地开发环境下报跨域问题,前端`editor``admin`项目在开发模式下通过`vite.config.ts`做接口代理。
> 生产环境需要修改 `.env.production` 文件,将`VITE_API_URL`改为后端地址。
3. 启动编辑器

Expand Down
16 changes: 10 additions & 6 deletions packages/editor/src/components/FlowNode/FlowNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ function FlowNode(_: any, ref: any) {
if (type === 'normal') {
nodeList.splice(node.index + 1, 0, taskNode);
} else {
if(node.selfNode.type === 'start'){
if (node.selfNode.type === 'start') {
message.error('开始节点后第一个不能添加分支节点');
return;
}
if(node.selfNode.type === 'condition'){
if (node.selfNode.type === 'condition') {
message.error('分支节点后第一个不能添加分支节点');
return;
}
Expand All @@ -163,13 +163,13 @@ function FlowNode(_: any, ref: any) {
type: 'success',
children: [],
title: '成功',
content: '成功后执行此流程',
content: '成功时执行此流程',
},
{
id: generateId(),
type: 'fail',
title: '失败',
content: '失败后执行此流程',
content: '失败时执行此流程',
children: [],
},
],
Expand All @@ -193,15 +193,15 @@ function FlowNode(_: any, ref: any) {
id: generateId(),
type: 'success',
title: '成功',
content: '成功后执行此流程',
content: '成功时执行此流程',
children: [],
},
{
...taskNode,
id: generateId(),
type: 'fail',
title: '失败',
content: '失败后执行此流程',
content: '失败时执行此流程',
children: [],
},
],
Expand Down Expand Up @@ -248,6 +248,10 @@ function FlowNode(_: any, ref: any) {

// 修改节点行为
const onEditAction = (node: NodeType) => {
if (node.title === '成功' || node.title === '失败') {
message.info('请在此节点后新增执行节点');
return;
}
actionRef.current?.open(node.config, (values: any) => {
const nodeList = JSON.parse(JSON.stringify(list)) as NodeType[];
const editNode = findNodeIndexAndParent(nodeList, node.id);
Expand Down
4 changes: 4 additions & 0 deletions packages/editor/src/packages/Container/Form/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ const MForm = ({ id, type, config, elements, onFinish, onChange }: ComponentType
},
reset() {
form.resetFields();
setFormData({
name: id,
value: form.getFieldsValue(),
});
},
submit() {
form.submit();
Expand Down
4 changes: 4 additions & 0 deletions packages/editor/src/packages/Scene/SearchForm/SearchForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ const SearchForm = ({ id, type, config, elements, onSearch, onChange, onReset }:
},
reset() {
form.resetFields();
setFormData({
name: id,
value: form.getFieldsValue(),
});
},
submit() {
form.submit();
Expand Down
4 changes: 4 additions & 0 deletions packages/materials/Container/Form/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ const MForm = ({ id, config, elements, onFinish, onChange }: ComponentType, ref:
},
reset() {
form.resetFields();
setFormData({
name: id,
value: form.getFieldsValue(),
});
},
submit() {
form.submit();
Expand Down
4 changes: 4 additions & 0 deletions packages/materials/Scene/SearchForm/SearchForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ const SearchForm = ({ id, type, config, elements, onSearch, onChange, onReset }:
},
reset() {
form.resetFields();
setFormData({
name: id,
value: form.getFieldsValue(),
});
},
submit() {
form.submit();
Expand Down

0 comments on commit 8d74c81

Please sign in to comment.