Skip to content

Commit

Permalink
fix: 修复单词拼写错误问题
Browse files Browse the repository at this point in the history
  • Loading branch information
JackySoft committed Sep 12, 2024
1 parent 388e3a0 commit ba620b3
Show file tree
Hide file tree
Showing 38 changed files with 138 additions and 141 deletions.
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"singleQuote": true,
"trailingComma": "all",
"printWidth": 150,
"semi": true,
"overrides": [
{
"files": ".prettierrc",
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</script>
</head>
<body>
<div id="rootHAHA"></div>
<div id="root"></div>
<div id="loading" style="display: none">
<svg
t="1682858040467"
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ export const getProjectMenu = (projectId: string | number) => {
};

// 获取项目配置
export const getPorjectDetail = (projectId: string | number) => {
export const getProjectDetail = (projectId: string | number) => {
return request.get('/admin/getProjectConfig?project_id=' + projectId);
};
3 changes: 1 addition & 2 deletions packages/admin/src/config/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
* BaseApi设置
*/
export function getBaseApi() {
// return `http://mars-api.marsview.cc/api`;
return `http://localhost:3000/api`;
return `http://mars-api.marsview.cc/api`;
}
14 changes: 7 additions & 7 deletions packages/admin/src/layout/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Header from '../components/Header/Header';
import Menu from '../components/Menu/Menu';
import { useProjectStore } from '@/stores/projectStore';
import { UserInfoStore, usePageStore } from '@/stores/pageStore';
import { getPorjectDetail, getProjectMenu } from '@/api/index';
import { getProjectDetail, getProjectMenu } from '@/api/index';
import Tab from '../components/Tab';
import Logo from '@/components/Logo/Logo';
import BreadList from '@/components/BreadList/BreadList';
Expand All @@ -25,7 +25,7 @@ const AdminLayout = () => {
});
const saveUserInfo = usePageStore((state) => state.saveUserInfo);
const loaderData = useLoaderData();
const navitate = useNavigate();
const navigate = useNavigate();
const { projectId, env } = useParams();
const { pathname } = useLocation();

Expand All @@ -38,22 +38,22 @@ const AdminLayout = () => {
// 获取项目信息
useEffect(() => {
// 判断项目ID是否合法
if ((projectId && isNaN(+projectId)) || !isEnv(env)) return navitate('/404?type=project');
if ((projectId && isNaN(+projectId)) || !isEnv(env)) return navigate('/404?type=project');

const fetchProjectDetail = async () => {
if (projectId) {
const detail = await getPorjectDetail(projectId);
const detail = await getProjectDetail(projectId);
// 如果项目不存在,跳转到404
if (!detail.id) {
return navitate('/404?type=project');
return navigate('/404?type=project');
}
const menus = await getProjectMenu(projectId).catch(() => {
return navitate('/403?type=project');
return navigate('/403?type=project');
});
if (!menus) return;

// 如果没有页面路径,跳转到欢迎页
if (!/project\/(stg|pre|prd)\/\d+\/\d+/.test(pathname)) navitate(`/project/${env}/${projectId}/welcome`);
if (!/project\/(stg|pre|prd)\/\d+\/\d+/.test(pathname)) navigate(`/project/${env}/${projectId}/welcome`);
const { menuTree, buttons, pageMap, menuMap } = arrayToTree(menus.list);
storage.set('buttons', buttons);
storage.set('pageMap', pageMap);
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let root: ReactDOM.Root | null = null;
// microApp 子应用挂载
window.mount = () => {
// 初始化渲染
root = ReactDOM.createRoot(document.getElementById('rootHAHA')!);
root = ReactDOM.createRoot(document.getElementById('root')!);
root.render(<App />);
// 监听路由变化
window.microApp?.addDataListener((data: any) => {
Expand Down
6 changes: 3 additions & 3 deletions packages/admin/src/pages/page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ export default function () {
const [theme, setTheme] = useState('');
const { id, env } = useParams();
const { savePageInfo } = usePageStore2();
const navitate = useNavigate();
const navigate = useNavigate();
useEffect(() => {
if (id) {
getPageDetail(env as string, Number(id))
.then((res: any) => {
if (!res.id) {
return navitate('/404');
return navigate('/404');
}
let pageData: any = {};
try {
Expand All @@ -40,7 +40,7 @@ export default function () {
setTheme(pageData.config.props.theme || '#1677ff');
})
.catch(() => {
navitate('/500');
navigate('/500');
});
}
}, [id]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ const SettingForm = function () {
<Form.Item label="超时提示" name="timeoutErrorMessage">
<Input placeholder="请输入超时提示" />
</Form.Item>
<Form.Item label="请求适配" name="requestIntercetpor">
<Form.Item label="请求适配" name="requestInterceptor">
<VsEditor />
</Form.Item>
<Form.Item label="返回适配" name="responseIntercetpor">
<Form.Item label="返回适配" name="responseInterceptor">
<VsEditor />
</Form.Item>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const InterceptorModal = ({ update }: SettingModalProp, ref: any) => {
headers: [{ key: '', value: '' }],
timeout: 8,
timeoutErrorMessage: '请求超时,请稍后重试',
requestIntercetpor: `/**
requestInterceptor: `/**
* config: 请求完整配置,请严格按照以下格式使用和返回
* config.url: 请求地址,eg: config.url = 'https://xxx.marsview.cc/api/xxx'
* config.params: Get请求对应参数,eg: config.params = {name:'xxx'}
Expand All @@ -33,7 +33,7 @@ const InterceptorModal = ({ update }: SettingModalProp, ref: any) => {
function request(config){
return config;
}`,
responseIntercetpor: `/**
responseInterceptor: `/**
* response: 返回值完整结构
* response.config: 请求完整配置。
* response.data: 请求返回数据
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ const ActionButtonModal = memo((props: IModalProp) => {
};

// 关闭
const handleCancle = () => {
const handleCancel = () => {
setVisible(false);
};

// 获取所有的antd图标,动态渲染到下拉框中
const iconsList: { [key: string]: any } = icons;
return (
<Modal title="操作按钮设置" open={visible} onOk={handleOk} onCancel={handleCancle} width={600} destroyOnClose>
<Modal title="操作按钮设置" open={visible} onOk={handleOk} onCancel={handleCancel} width={600} destroyOnClose>
<Form form={form} labelCol={{ span: 5 }} wrapperCol={{ span: 18 }}>
<Form.Item label="按钮名称" name="text" rules={[{ required: true, message: '请输入按钮名称' }]}>
<Input />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const ActionModal = (props: any, ref: any) => {
},
{
label: '消息通知',
key: 'notifacation',
key: 'notification',
render: () => {
return <NotificationAction />;
},
Expand Down Expand Up @@ -241,7 +241,7 @@ const ActionModal = (props: any, ref: any) => {
await form.validateFields();
const values = form.getFieldsValue();
// 变量赋值需要进行数据转换
if (values.assigmentType === 'assigment' && values.assigmentWay === 'static') {
if (values.assignmentType === 'assignment' && values.assignmentWay === 'static') {
if (values.variableType === 'array' || values.variableType === 'object') {
try {
values.value = typeof values.value === 'string' ? JSON.parse(values.value || '') : values.value || '';
Expand All @@ -265,7 +265,7 @@ const ActionModal = (props: any, ref: any) => {
const handleClick = (item: any) => {
form.resetFields();
if (item.key === 'variable') {
form.setFieldsValue({ assigmentType: 'assigment', assigmentWay: 'static' });
form.setFieldsValue({ assignmentType: 'assignment', assignmentWay: 'static' });
} else if (item.key === 'showConfirm') {
form.setFieldsValue({
type: 'confirm',
Expand All @@ -280,7 +280,7 @@ const ActionModal = (props: any, ref: any) => {
content: '操作成功',
duration: 3,
});
} else if (item.key === 'notifacation') {
} else if (item.key === 'notification') {
form.setFieldsValue({
type: 'info',
message: '通知',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Form, Select, Divider, Input, Radio, InputNumber, Switch, FormInstance } from 'antd';
import { Form, Select, Divider, Input, Radio, FormInstance } from 'antd';
import { usePageStore } from '@/stores/pageStore';
import styles from './index.module.less';
import { useEffect, useState } from 'react';
import VsEditor from '@/components/VsEditor';
import VariableBind from '@/components/VariableBind/VariableBind';
const VariableAssignment = ({ form }: { form: FormInstance; }) => {
import styles from './index.module.less';
const VariableAssignment = ({ form }: { form: FormInstance }) => {
const variables = usePageStore((state) => state.page.variables);
const [dataType, setDataType] = useState('string');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { Form, Select, Divider, Radio, Button, TreeSelect } from 'antd';
import { Form, Divider, Radio, TreeSelect } from 'antd';
import { usePageStore } from '@/stores/pageStore';
import styles from './index.module.less';
import { useRef, useState } from 'react';
import VariableSelect from '@/components/VariableBind/VariableSelect';
import VariableBind from '@/components/VariableBind/VariableBind';
import styles from './index.module.less';
/**
* 显示确认弹框
* @returns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ const SelectVariableModal = ({ onSelect }: { onSelect: (record: any) => void },
const handleSubmit = () => {
const expression = form.getFieldValue('expression');
onSelect({ value: expression });
handleCancle();
handleCancel();
};

// 关闭
const handleCancle = () => {
const handleCancel = () => {
setVisible(false);
};
const fnList: CollapseProps['items'] = [
Expand Down Expand Up @@ -200,7 +200,7 @@ const SelectVariableModal = ({ onSelect }: { onSelect: (record: any) => void },
},
];
return (
<Modal open={visible} onCancel={handleCancle} title="逻辑编辑器" width={1100} onOk={handleSubmit} okText="确认" cancelText="取消">
<Modal open={visible} onCancel={handleCancel} title="逻辑编辑器" width={1100} onOk={handleSubmit} okText="确认" cancelText="取消">
<div style={{ marginBlock: 10 }}>
<NotificationOutlined style={{ color: '#7D33FF' }} />
<span style={{ marginLeft: 5 }}>下表为页面定义的全局变量,选择时,直接鼠标点击对应的行即可。</span>
Expand Down
6 changes: 3 additions & 3 deletions packages/editor/src/layout/components/Header/CreateLib.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ const CreateLib = (props: IModalProp) => {
if (valid) {
await createLib({ tag, name, description });
props.update?.();
handleCancle();
handleCancel();
}
};

// 关闭
const handleCancle = () => {
const handleCancel = () => {
form.resetFields();
setVisible(false);
};
return (
<Modal title="创建组件库" open={visible} onOk={handleOk} onCancel={handleCancle} width={500} okText="确定" cancelText="取消">
<Modal title="创建组件库" open={visible} onOk={handleOk} onCancel={handleCancel} width={500} okText="确定" cancelText="取消">
<Form form={form} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
<Form.Item
label="组件标识"
Expand Down
7 changes: 3 additions & 4 deletions packages/editor/src/layout/components/Header/CreatePage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Input, Modal, Form, Radio } from 'antd';
import { useImperativeHandle, useState, MutableRefObject } from 'react';
import { createPageData, updatePageData } from '@/api';
import { usePageStore } from '@/stores/pageStore';
import { PageItem } from '@/api/pageMember';
/**
* 创建页面
Expand Down Expand Up @@ -52,7 +51,7 @@ const CreatePage = (props: IModalProp) => {
}
// 编辑器界面 - 左侧菜单修改后刷新
props.update?.();
handleCancle();
handleCancel();
setLoading(false);
} catch (error) {
setLoading(false);
Expand All @@ -61,7 +60,7 @@ const CreatePage = (props: IModalProp) => {
};

// 关闭
const handleCancle = () => {
const handleCancel = () => {
form.resetFields();
setVisible(false);
};
Expand All @@ -71,7 +70,7 @@ const CreatePage = (props: IModalProp) => {
open={visible}
confirmLoading={loading}
onOk={handleOk}
onCancel={handleCancle}
onCancel={handleCancel}
width={500}
okText="确定"
cancelText="取消"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ const MemberSetting = (props: any, ref: any) => {
setConfirmLoading(true);
await api.addPageMember({ type, page_id: type == 1 ? parseInt(projectId) : pageId, role, user_name });
setConfirmLoading(false);
handleCancle();
handleCancel();
props?.update();
} catch (error) {
setConfirmLoading(false);
}
};

// 关闭
const handleCancle = () => {
const handleCancel = () => {
form.resetFields();
setVisible(false);
};
Expand All @@ -55,7 +55,7 @@ const MemberSetting = (props: any, ref: any) => {
open={visible}
confirmLoading={confirmLoading}
onOk={handleOk}
onCancel={handleCancle}
onCancel={handleCancel}
okText="提交"
cancelText="取消"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,18 @@ const VariableSetting = (_: any, ref: any) => {
} else {
editVariable(values);
}
handleCancle();
handleCancel();
});
};

// 关闭
const handleCancle = () => {
const handleCancel = () => {
form.resetFields();
setVisible(false);
setDataType('string');
};
return (
<Modal title="添加变量" open={visible} width={650} onOk={handleOk} onCancel={handleCancle} okText="提交" cancelText="取消">
<Modal title="添加变量" open={visible} width={650} onOk={handleOk} onCancel={handleCancel} okText="提交" cancelText="取消">
<Form form={form} labelCol={{ span: 6 }} wrapperCol={{ span: 16 }} initialValues={{ type: 'string' }}>
<Form.Item
label="变量名称"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default {
allowClear: true,
options: [
{ value: 'today', label: '今天' },
{ value: 'yestoday', label: '昨天' },
{ value: 'yesterday', label: '昨天' },
{ value: 'last7', label: '一周前' },
{ value: 'last30', label: '一个月前' },
{ value: 'last90', label: '三个月前' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default {
{ value: 'curMonth', label: '本月' },
{ value: 'curQuarter', label: '本季度' },
{ value: 'curYear', label: '本年' },
{ value: 'yestoday', label: '昨天' },
{ value: 'yesterday', label: '昨天' },
{ value: 'lastWeek', label: '最近一周' },
{ value: 'lastMonth', label: '最近一月' },
{ value: 'last3Month', label: '最近三月' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ const ColumnSetting = memo((props: IModalProp) => {
};

// 关闭
const handleCancle = () => {
const handleCancel = () => {
setVisible(false);
};
return (
<Modal title="列设置" open={visible} onOk={handleOk} onCancel={handleCancle} width={800}>
<Modal title="列设置" open={visible} onOk={handleOk} onCancel={handleCancel} width={800}>
<Form form={form} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
<Card title="基础配置" size="small">
<Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ const ColumnSetting = memo((props: IModalProp) => {
};

// 关闭
const handleCancle = () => {
const handleCancel = () => {
setVisible(false);
};
return (
<Modal title="描述项设置" open={visible} onOk={handleOk} onCancel={handleCancle} width={800}>
<Modal title="描述项设置" open={visible} onOk={handleOk} onCancel={handleCancel} width={800}>
<Form form={form} labelCol={{ span: 8 }} wrapperCol={{ span: 14 }}>
<Row>
<Col span={12}>
Expand Down
Loading

0 comments on commit ba620b3

Please sign in to comment.