Skip to content

Commit

Permalink
fix: 1.修复日期选择问题。2.修复组件复制粘贴问题。3.修复admin页面高度问题。
Browse files Browse the repository at this point in the history
  • Loading branch information
JackySoft committed Sep 22, 2024
1 parent 8ecb062 commit 22dcdf6
Show file tree
Hide file tree
Showing 6 changed files with 190 additions and 150 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@ant-design/plots": "^1.2.6",
"@types/qs": "^6.9.15",
"ahooks": "^3.7.8",
"antd": "^5.20.3",
"antd": "^5.20.6",
"axios": "^0.27.2",
"copy-to-clipboard": "^3.3.3",
"less": "^4.2.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/admin/src/layout/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import Tab from '../components/Tab';
import Logo from '@/components/Logo/Logo';
import BreadList from '@/components/BreadList/BreadList';
import { arrayToTree, isEnv } from '@/utils/util';
import storage from '@/utils/storage';
import locale from 'antd/locale/zh_CN';
import 'dayjs/locale/zh-cn';
import './layout.less';
import storage from '@/utils/storage';

const AdminLayout = () => {
const { collapsed, setProjectInfo, projectInfo } = useProjectStore((state) => {
Expand Down Expand Up @@ -70,7 +70,7 @@ const AdminLayout = () => {
}, [projectId]);

// 计算渲染区容器实际高度
let height = 61;
let height = 64;
let calcHeight = 'calc(100vh - 60px)';
if (projectInfo.tag) {
height += 50;
Expand Down
4 changes: 4 additions & 0 deletions packages/editor/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ import AntdGlobal from '@/utils/AntdGlobal';
import locale from 'antd/locale/zh_CN';
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
import weekday from 'dayjs/plugin/weekday';
import localeData from 'dayjs/plugin/localeData';
import relativeTime from 'dayjs/plugin/relativeTime';
dayjs.extend(relativeTime);
dayjs.extend(weekday);
dayjs.extend(localeData);
dayjs.locale('zh-cn');
import './App.less';

Expand Down
5 changes: 4 additions & 1 deletion packages/editor/src/pages/editor/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@ const Editor = () => {
if (!id) {
return message.info('暂无复制内容');
}
const parentId = elementsMap[id]?.parentId;
let parentId = elementsMap[id]?.parentId;
if (selectedElement?.id !== id) {
parentId = selectedElement?.id;
}
// 如果没有父组件,在页面最外层先复制一个元素
if (!parentId) {
const current = getElement(elements, id);
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/stores/pageStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export const usePageStore = create<PageState & PageAction>((set) => ({
}
return list;
}
state.page.elements = deepFind(state.page.elements);
deepFind(state.page.elements);
state.isUpdateToolbar = !state.isUpdateToolbar;
}),
);
Expand Down
Loading

0 comments on commit 22dcdf6

Please sign in to comment.