+
@@ -11,14 +11,14 @@
-
-
+
+
-
+
-
+
@@ -62,29 +62,19 @@
function handleFullScreen(e: Event) {
e?.stopPropagation();
e?.preventDefault();
- if (props.commentSpan == 0 || props.enableComment == false) {
+ if(props.commentSpan==0 || props.enableComment == false){
emit('fullscreen');
}
}
- //update-begin-author:taoyan date:2022-7-18 for: 关闭按钮的区域宽度 取决于是否有其他图标
- const closeWidth = computed(() => {
- if (props.canFullscreen && props.enableComment) {
- return 140;
- } else {
- return 96;
- }
- });
- //update-end-author:taoyan date:2022-7-18 for: 关闭按钮的区域宽度 取决于是否有其他图标
-
/**
* 开启评论区域
* @param e
*/
- function handleOpenComment(e: Event) {
+ function handleOpenComment(e: Event){
e?.stopPropagation();
e?.preventDefault();
- if (props.fullScreen == false) {
+ if(props.fullScreen==false){
emit('fullscreen');
}
emit('comment', true);
@@ -94,21 +84,32 @@
* 关闭评论区域
* @param e
*/
- function handleCloseComment(e: Event) {
+ function handleCloseComment(e: Event){
e?.stopPropagation();
e?.preventDefault();
emit('comment', false);
}
+ /**
+ * 有评论的时候不需要设置全屏
+ */
+ const fullScreenStatus = computed(()=>{
+ if(props.enableComment===true){
+ return false
+ }else{
+ return props.canFullscreen;
+ }
+ });
+
return {
t,
getClass,
prefixCls,
handleCancel,
handleFullScreen,
- closeWidth,
handleOpenComment,
handleCloseComment,
+ fullScreenStatus
};
},
});
@@ -120,10 +121,6 @@
height: 95%;
align-items: center;
- .ant-modal-close-x {
- width: 140px !important;
- }
-
> span {
margin-left: 48px;
font-size: 16px;
@@ -141,12 +138,6 @@
font-weight: 700;
}
}
- /** 展开/关闭 评论图标样式*/
- > span:nth-child(2) {
- &:hover {
- font-weight: 700;
- }
- }
}
& span:nth-child(1) {
@@ -157,20 +148,12 @@
color: @primary-color;
}
}
- /** 展开/关闭 评论图标样式*/
- & span:nth-child(2) {
- display: inline-block;
- padding: 10px 10px 10px 0;
-
- &:hover {
- color: @primary-color;
- }
- }
& span:last-child {
+ padding: 10px 10px 10px 0;
&:hover {
color: @error-color;
}
}
}
-
+
\ No newline at end of file
diff --git a/src/components/Modal/src/index.less b/src/components/Modal/src/index.less
index 03d5479..58ee1e4 100644
--- a/src/components/Modal/src/index.less
+++ b/src/components/Modal/src/index.less
@@ -7,11 +7,18 @@
bottom: 0 !important;
left: 0 !important;
width: 100% !important;
- height: 100%;
+ height: 100% !important;
+ max-width: 100% !important;
+ max-height: 100% !important;
&-content {
height: 100%;
}
+
+ .ant-modal-header,
+ .@{namespace}-basic-title {
+ cursor: default !important;
+ }
}
}
@@ -70,8 +77,8 @@
&-close-x {
display: inline-block;
- /*width: 96px;*/
- width: auto;
+ width: 96px;
+/* width: auto;*/
height: 56px;
line-height: 56px;
}
diff --git a/src/components/Modal/src/typing.ts b/src/components/Modal/src/typing.ts
index 36a7e7c..7bd9497 100644
--- a/src/components/Modal/src/typing.ts
+++ b/src/components/Modal/src/typing.ts
@@ -194,6 +194,8 @@ export interface ModalProps {
* @type number
*/
zIndex?: number;
+
+ enableComment?: boolean;
}
export interface ModalWrapperProps {
diff --git a/src/components/Page/src/PageWrapper.vue b/src/components/Page/src/PageWrapper.vue
index 6eb5df1..dc9f043 100644
--- a/src/components/Page/src/PageWrapper.vue
+++ b/src/components/Page/src/PageWrapper.vue
@@ -1,6 +1,12 @@
-
+
{{ content }}
@@ -74,7 +80,13 @@
});
const getUpwardSpace = computed(() => props.upwardSpace);
- const { redoHeight, setCompensation, contentHeight } = useContentHeight(getIsContentFullHeight, wrapperRef, [headerRef, footerRef], [contentRef], getUpwardSpace);
+ const { redoHeight, setCompensation, contentHeight } = useContentHeight(
+ getIsContentFullHeight,
+ wrapperRef,
+ [headerRef, footerRef],
+ [contentRef],
+ getUpwardSpace
+ );
setCompensation({ useLayoutFooter: true, elements: [footerRef] });
const getClass = computed(() => {
diff --git a/src/components/Scrollbar/src/bar.ts b/src/components/Scrollbar/src/bar.ts
index 0e944c7..d56b56c 100644
--- a/src/components/Scrollbar/src/bar.ts
+++ b/src/components/Scrollbar/src/bar.ts
@@ -28,7 +28,8 @@ export default defineComponent({
}
window.getSelection()?.removeAllRanges();
startDrag(e);
- barStore.value[bar.value.axis] = e.currentTarget[bar.value.offset] - (e[bar.value.client] - e.currentTarget.getBoundingClientRect()[bar.value.direction]);
+ barStore.value[bar.value.axis] =
+ e.currentTarget[bar.value.offset] - (e[bar.value.client] - e.currentTarget.getBoundingClientRect()[bar.value.direction]);
};
const clickTrackHandler = (e: any) => {
diff --git a/src/components/SimpleMenu/src/SimpleMenu.vue b/src/components/SimpleMenu/src/SimpleMenu.vue
index d366544..b57b4b4 100644
--- a/src/components/SimpleMenu/src/SimpleMenu.vue
+++ b/src/components/SimpleMenu/src/SimpleMenu.vue
@@ -1,5 +1,12 @@
-
-
+
+
+
+
+
diff --git a/src/components/Tree/src/TreeIcon.ts b/src/components/Tree/src/TreeIcon.ts
index 69e7cd0..900d6bf 100644
--- a/src/components/Tree/src/TreeIcon.ts
+++ b/src/components/Tree/src/TreeIcon.ts
@@ -1,14 +1,10 @@
import type { VNode, FunctionalComponent } from 'vue';
import { h } from 'vue';
-import { isString } from '/@/utils/is';
+import { isString } from '@vue/shared';
import { Icon } from '/@/components/Icon';
-export interface ComponentProps {
- icon: VNode | string;
-}
-
-export const TreeIcon: FunctionalComponent = ({ icon }: ComponentProps) => {
+export const TreeIcon: FunctionalComponent = ({ icon }: { icon: VNode | string }) => {
if (!icon) return null;
if (isString(icon)) {
return h(Icon, { icon, class: 'mr-1' });
diff --git a/src/components/Tree/src/components/TreeHeader.vue b/src/components/Tree/src/components/TreeHeader.vue
new file mode 100644
index 0000000..a1792d2
--- /dev/null
+++ b/src/components/Tree/src/components/TreeHeader.vue
@@ -0,0 +1,171 @@
+
+
+
+
+ {{ title }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Tree/src/hooks/useTree.ts b/src/components/Tree/src/hooks/useTree.ts
new file mode 100644
index 0000000..17345a2
--- /dev/null
+++ b/src/components/Tree/src/hooks/useTree.ts
@@ -0,0 +1,207 @@
+import type { InsertNodeParams, KeyType, FieldNames, TreeItem } from '../types/tree';
+import type { Ref, ComputedRef } from 'vue';
+import type { TreeDataItem } from 'ant-design-vue/es/tree/Tree';
+
+import { cloneDeep } from 'lodash-es';
+import { unref } from 'vue';
+import { forEach } from '/@/utils/helper/treeHelper';
+
+export function useTree(treeDataRef: Ref, getFieldNames: ComputedRef) {
+ function getAllKeys(list?: TreeDataItem[]) {
+ const keys: string[] = [];
+ const treeData = list || unref(treeDataRef);
+ const { key: keyField, children: childrenField } = unref(getFieldNames);
+ if (!childrenField || !keyField) return keys;
+
+ for (let index = 0; index < treeData.length; index++) {
+ const node = treeData[index];
+ keys.push(node[keyField]!);
+ const children = node[childrenField];
+ if (children && children.length) {
+ keys.push(...(getAllKeys(children) as string[]));
+ }
+ }
+ return keys as KeyType[];
+ }
+
+ // get keys that can be checked and selected
+ function getEnabledKeys(list?: TreeDataItem[]) {
+ const keys: string[] = [];
+ const treeData = list || unref(treeDataRef);
+ const { key: keyField, children: childrenField } = unref(getFieldNames);
+ if (!childrenField || !keyField) return keys;
+
+ for (let index = 0; index < treeData.length; index++) {
+ const node = treeData[index];
+ node.disabled !== true && node.selectable !== false && keys.push(node[keyField]!);
+ const children = node[childrenField];
+ if (children && children.length) {
+ keys.push(...(getEnabledKeys(children) as string[]));
+ }
+ }
+ return keys as KeyType[];
+ }
+
+ function getChildrenKeys(nodeKey: string | number, list?: TreeDataItem[]) {
+ const keys: KeyType[] = [];
+ const treeData = list || unref(treeDataRef);
+ const { key: keyField, children: childrenField } = unref(getFieldNames);
+ if (!childrenField || !keyField) return keys;
+ for (let index = 0; index < treeData.length; index++) {
+ const node = treeData[index];
+ const children = node[childrenField];
+ if (nodeKey === node[keyField]) {
+ keys.push(node[keyField]!);
+ if (children && children.length) {
+ keys.push(...(getAllKeys(children) as string[]));
+ }
+ } else {
+ if (children && children.length) {
+ keys.push(...getChildrenKeys(nodeKey, children));
+ }
+ }
+ }
+ return keys as KeyType[];
+ }
+
+ // Update node
+ function updateNodeByKey(key: string, node: TreeDataItem, list?: TreeDataItem[]) {
+ if (!key) return;
+ const treeData = list || unref(treeDataRef);
+ const { key: keyField, children: childrenField } = unref(getFieldNames);
+
+ if (!childrenField || !keyField) return;
+
+ for (let index = 0; index < treeData.length; index++) {
+ const element: any = treeData[index];
+ const children = element[childrenField];
+
+ if (element[keyField] === key) {
+ treeData[index] = { ...treeData[index], ...node };
+ break;
+ } else if (children && children.length) {
+ updateNodeByKey(key, node, element[childrenField]);
+ }
+ }
+ }
+
+ // Expand the specified level
+ function filterByLevel(level = 1, list?: TreeDataItem[], currentLevel = 1) {
+ if (!level) {
+ return [];
+ }
+ const res: (string | number)[] = [];
+ const data = list || unref(treeDataRef) || [];
+ for (let index = 0; index < data.length; index++) {
+ const item = data[index];
+
+ const { key: keyField, children: childrenField } = unref(getFieldNames);
+ const key = keyField ? item[keyField] : '';
+ const children = childrenField ? item[childrenField] : [];
+ res.push(key);
+ if (children && children.length && currentLevel < level) {
+ currentLevel += 1;
+ res.push(...filterByLevel(level, children, currentLevel));
+ }
+ }
+ return res as string[] | number[];
+ }
+
+ /**
+ * 添加节点
+ */
+ function insertNodeByKey({ parentKey = null, node, push = 'push' }: InsertNodeParams) {
+ const treeData: any = cloneDeep(unref(treeDataRef));
+ if (!parentKey) {
+ treeData[push](node);
+ treeDataRef.value = treeData;
+ return;
+ }
+ const { key: keyField, children: childrenField } = unref(getFieldNames);
+ if (!childrenField || !keyField) return;
+
+ forEach(treeData, (treeItem) => {
+ if (treeItem[keyField] === parentKey) {
+ treeItem[childrenField] = treeItem[childrenField] || [];
+ treeItem[childrenField][push](node);
+ return true;
+ }
+ });
+ treeDataRef.value = treeData;
+ }
+ /**
+ * 批量添加节点
+ */
+ function insertNodesByKey({ parentKey = null, list, push = 'push' }: InsertNodeParams) {
+ const treeData: any = cloneDeep(unref(treeDataRef));
+ if (!list || list.length < 1) {
+ return;
+ }
+ if (!parentKey) {
+ for (let i = 0; i < list.length; i++) {
+ treeData[push](list[i]);
+ }
+ } else {
+ const { key: keyField, children: childrenField } = unref(getFieldNames);
+ if (!childrenField || !keyField) return;
+
+ forEach(treeData, (treeItem) => {
+ if (treeItem[keyField] === parentKey) {
+ treeItem[childrenField] = treeItem[childrenField] || [];
+ for (let i = 0; i < list.length; i++) {
+ treeItem[childrenField][push](list[i]);
+ }
+ treeDataRef.value = treeData;
+ return true;
+ }
+ });
+ }
+ }
+ // Delete node
+ function deleteNodeByKey(key: string, list?: TreeDataItem[]) {
+ if (!key) return;
+ const treeData = list || unref(treeDataRef);
+ const { key: keyField, children: childrenField } = unref(getFieldNames);
+ if (!childrenField || !keyField) return;
+
+ for (let index = 0; index < treeData.length; index++) {
+ const element: any = treeData[index];
+ const children = element[childrenField];
+
+ if (element[keyField] === key) {
+ treeData.splice(index, 1);
+ break;
+ } else if (children && children.length) {
+ deleteNodeByKey(key, element[childrenField]);
+ }
+ }
+ }
+
+ // Get selected node
+ function getSelectedNode(key: KeyType, list?: TreeItem[], selectedNode?: TreeItem | null) {
+ if (!key && key !== 0) return null;
+ const treeData = list || unref(treeDataRef);
+ treeData.forEach((item) => {
+ if (selectedNode?.key || selectedNode?.key === 0) return selectedNode;
+ if (item.key === key) {
+ selectedNode = item;
+ return;
+ }
+ if (item.children && item.children.length) {
+ selectedNode = getSelectedNode(key, item.children, selectedNode);
+ }
+ });
+ return selectedNode || null;
+ }
+ return {
+ deleteNodeByKey,
+ insertNodeByKey,
+ insertNodesByKey,
+ filterByLevel,
+ updateNodeByKey,
+ getAllKeys,
+ getChildrenKeys,
+ getEnabledKeys,
+ getSelectedNode,
+ };
+}
diff --git a/src/components/Tree/src/types/tree.ts b/src/components/Tree/src/types/tree.ts
new file mode 100644
index 0000000..691daae
--- /dev/null
+++ b/src/components/Tree/src/types/tree.ts
@@ -0,0 +1,195 @@
+import type { ExtractPropTypes } from 'vue';
+import type { TreeDataItem } from 'ant-design-vue/es/tree/Tree';
+
+import { buildProps } from '/@/utils/props';
+
+export enum ToolbarEnum {
+ SELECT_ALL,
+ UN_SELECT_ALL,
+ EXPAND_ALL,
+ UN_EXPAND_ALL,
+ CHECK_STRICTLY,
+ CHECK_UN_STRICTLY,
+}
+
+export const treeEmits = [
+ 'update:expandedKeys',
+ 'update:selectedKeys',
+ 'update:value',
+ 'change',
+ 'check',
+ 'search',
+ 'update:searchValue',
+];
+
+export interface TreeState {
+ expandedKeys: KeyType[];
+ selectedKeys: KeyType[];
+ checkedKeys: CheckKeys;
+ checkStrictly: boolean;
+}
+
+export interface FieldNames {
+ children?: string;
+ title?: string;
+ key?: string;
+}
+
+export type KeyType = string | number;
+
+export type CheckKeys =
+ | KeyType[]
+ | { checked: string[] | number[]; halfChecked: string[] | number[] };
+
+export const treeProps = buildProps({
+ value: {
+ type: [Object, Array] as PropType,
+ },
+
+ renderIcon: {
+ type: Function as PropType<(params: Recordable) => string>,
+ },
+
+ helpMessage: {
+ type: [String, Array] as PropType,
+ default: '',
+ },
+
+ title: {
+ type: String,
+ default: '',
+ },
+ toolbar: Boolean,
+ search: Boolean,
+ searchValue: {
+ type: String,
+ default: '',
+ },
+ checkStrictly: Boolean,
+ clickRowToExpand: {
+ type: Boolean,
+ default: false,
+ },
+ checkable: Boolean,
+ defaultExpandLevel: {
+ type: [String, Number] as PropType,
+ default: '',
+ },
+ defaultExpandAll: Boolean,
+
+ fieldNames: {
+ type: Object as PropType,
+ },
+
+ treeData: {
+ type: Array as PropType,
+ },
+
+ actionList: {
+ type: Array as PropType,
+ default: () => [],
+ },
+
+ expandedKeys: {
+ type: Array as PropType,
+ default: () => [],
+ },
+
+ selectedKeys: {
+ type: Array as PropType,
+ default: () => [],
+ },
+
+ checkedKeys: {
+ type: Array as PropType,
+ default: () => [],
+ },
+
+ beforeRightClick: {
+ type: Function as PropType<(...arg: any) => ContextMenuItem[] | ContextMenuOptions>,
+ default: undefined,
+ },
+
+ rightMenuList: {
+ type: Array as PropType,
+ },
+ // 自定义数据过滤判断方法(注: 不是整个过滤方法,而是内置过滤的判断方法,用于增强原本仅能通过title进行过滤的方式)
+ filterFn: {
+ type: Function as PropType<
+ (searchValue: any, node: TreeItem, fieldNames: FieldNames) => boolean
+ >,
+ default: undefined,
+ },
+ // 高亮搜索值,仅高亮具体匹配值(通过title)值为true时使用默认色值,值为#xxx时使用此值替代且高亮开启
+ highlight: {
+ type: [Boolean, String] as PropType,
+ default: false,
+ },
+ // 搜索完成时自动展开结果
+ expandOnSearch: Boolean,
+ // 搜索完成自动选中所有结果,当且仅当 checkable===true 时生效
+ checkOnSearch: Boolean,
+ // 搜索完成自动select所有结果
+ selectedOnSearch: Boolean,
+ loading: {
+ type: Boolean,
+ default: false,
+ },
+});
+
+export type TreeProps = ExtractPropTypes;
+
+export interface ContextMenuItem {
+ label: string;
+ icon?: string;
+ hidden?: boolean;
+ disabled?: boolean;
+ handler?: Fn;
+ divider?: boolean;
+ children?: ContextMenuItem[];
+}
+
+export interface ContextMenuOptions {
+ icon?: string;
+ styles?: any;
+ items?: ContextMenuItem[];
+}
+
+export interface TreeItem extends TreeDataItem {
+ icon?: any;
+}
+
+export interface TreeActionItem {
+ render: (record: Recordable) => any;
+ show?: boolean | ((record: Recordable) => boolean);
+}
+
+export interface InsertNodeParams {
+ parentKey: string | null;
+ node: TreeDataItem;
+ list?: TreeDataItem[];
+ push?: 'push' | 'unshift';
+}
+
+export interface TreeActionType {
+ checkAll: (checkAll: boolean) => void;
+ expandAll: (expandAll: boolean) => void;
+ setExpandedKeys: (keys: KeyType[]) => void;
+ getExpandedKeys: () => KeyType[];
+ setSelectedKeys: (keys: KeyType[]) => void;
+ getSelectedKeys: () => KeyType[];
+ setCheckedKeys: (keys: CheckKeys) => void;
+ getCheckedKeys: () => CheckKeys;
+ filterByLevel: (level: number) => void;
+ insertNodeByKey: (opt: InsertNodeParams) => void;
+ insertNodesByKey: (opt: InsertNodeParams) => void;
+ deleteNodeByKey: (key: string) => void;
+ updateNodeByKey: (key: string, node: Omit) => void;
+ setSearchValue: (value: string) => void;
+ getSearchValue: () => string;
+ getSelectedNode: (
+ key: KeyType,
+ treeList?: TreeItem[],
+ selectNode?: TreeItem | null,
+ ) => TreeItem | null;
+}
diff --git a/src/components/Tree/style/index.less b/src/components/Tree/style/index.less
new file mode 100644
index 0000000..472d4ca
--- /dev/null
+++ b/src/components/Tree/style/index.less
@@ -0,0 +1,52 @@
+@tree-prefix-cls: ~'@{namespace}-tree';
+
+.@{tree-prefix-cls} {
+ background-color: @component-background;
+
+ .ant-tree-node-content-wrapper {
+ position: relative;
+
+ .ant-tree-title {
+ position: absolute;
+ left: 0;
+ width: 100%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+ }
+
+ &__title {
+ position: relative;
+ display: flex;
+ align-items: center;
+ width: 100%;
+ padding-right: 10px;
+
+ &:hover {
+ .@{tree-prefix-cls}__action {
+ visibility: visible;
+ }
+ }
+ }
+
+ &__content {
+ overflow: hidden;
+ }
+
+ &__actions {
+ position: absolute;
+ //top: 2px;
+ right: 3px;
+ display: flex;
+ }
+
+ &__action {
+ margin-left: 4px;
+ visibility: hidden;
+ }
+
+ &-header {
+ border-bottom: 1px solid @border-color-base;
+ }
+}
diff --git a/src/components/Tree/style/index.ts b/src/components/Tree/style/index.ts
new file mode 100644
index 0000000..d74e52e
--- /dev/null
+++ b/src/components/Tree/style/index.ts
@@ -0,0 +1 @@
+import './index.less';
diff --git a/src/components/Tree_backup/index.ts b/src/components/Tree_backup/index.ts
new file mode 100644
index 0000000..f47820d
--- /dev/null
+++ b/src/components/Tree_backup/index.ts
@@ -0,0 +1,5 @@
+import BasicTree from './src/Tree.vue';
+
+export { BasicTree };
+export type { ContextMenuItem } from '/@/hooks/web/useContextMenu';
+export * from './src/typing';
diff --git a/src/components/Tree/src/Tree.vue b/src/components/Tree_backup/src/Tree.vue
similarity index 99%
rename from src/components/Tree/src/Tree.vue
rename to src/components/Tree_backup/src/Tree.vue
index 149cfd2..e1eb8f3 100644
--- a/src/components/Tree/src/Tree.vue
+++ b/src/components/Tree_backup/src/Tree.vue
@@ -107,7 +107,8 @@
return !getTreeData.value || getTreeData.value.length === 0;
});
- const { deleteNodeByKey, insertNodeByKey, insertNodesByKey, filterByLevel, updateNodeByKey, getAllKeys, getChildrenKeys, getEnabledKeys } = useTree(treeDataRef, getReplaceFields);
+ const { deleteNodeByKey, insertNodeByKey, insertNodesByKey, filterByLevel, updateNodeByKey, getAllKeys, getChildrenKeys, getEnabledKeys } =
+ useTree(treeDataRef, getReplaceFields);
function getIcon(params: Recordable, icon?: string) {
if (!icon) {
diff --git a/src/components/Tree/src/TreeHeader.vue b/src/components/Tree_backup/src/TreeHeader.vue
similarity index 95%
rename from src/components/Tree/src/TreeHeader.vue
rename to src/components/Tree_backup/src/TreeHeader.vue
index e6b1e02..fbe36cf 100644
--- a/src/components/Tree/src/TreeHeader.vue
+++ b/src/components/Tree_backup/src/TreeHeader.vue
@@ -7,7 +7,13 @@
-
+
diff --git a/src/components/Tree_backup/src/TreeIcon.ts b/src/components/Tree_backup/src/TreeIcon.ts
new file mode 100644
index 0000000..69e7cd0
--- /dev/null
+++ b/src/components/Tree_backup/src/TreeIcon.ts
@@ -0,0 +1,17 @@
+import type { VNode, FunctionalComponent } from 'vue';
+
+import { h } from 'vue';
+import { isString } from '/@/utils/is';
+import { Icon } from '/@/components/Icon';
+
+export interface ComponentProps {
+ icon: VNode | string;
+}
+
+export const TreeIcon: FunctionalComponent = ({ icon }: ComponentProps) => {
+ if (!icon) return null;
+ if (isString(icon)) {
+ return h(Icon, { icon, class: 'mr-1' });
+ }
+ return Icon;
+};
diff --git a/src/components/Tree/src/props.ts b/src/components/Tree_backup/src/props.ts
similarity index 100%
rename from src/components/Tree/src/props.ts
rename to src/components/Tree_backup/src/props.ts
diff --git a/src/components/Tree/src/typing.ts b/src/components/Tree_backup/src/typing.ts
similarity index 100%
rename from src/components/Tree/src/typing.ts
rename to src/components/Tree_backup/src/typing.ts
diff --git a/src/components/Tree/src/useTree.ts b/src/components/Tree_backup/src/useTree.ts
similarity index 100%
rename from src/components/Tree/src/useTree.ts
rename to src/components/Tree_backup/src/useTree.ts
diff --git a/src/components/Upload/src/UploadModal.vue b/src/components/Upload/src/UploadModal.vue
index 777932e..66e5982 100644
--- a/src/components/Upload/src/UploadModal.vue
+++ b/src/components/Upload/src/UploadModal.vue
@@ -96,7 +96,11 @@
const getUploadBtnText = computed(() => {
const someError = fileListRef.value.some((item) => item.status === UploadResultStatus.ERROR);
- return isUploadingRef.value ? t('component.upload.uploading') : someError ? t('component.upload.reUploadFailed') : t('component.upload.startUpload');
+ return isUploadingRef.value
+ ? t('component.upload.uploading')
+ : someError
+ ? t('component.upload.reUploadFailed')
+ : t('component.upload.startUpload');
});
// 上传前校验
diff --git a/src/components/Upload/src/UploadPreviewModal.vue b/src/components/Upload/src/UploadPreviewModal.vue
index 4bebe54..0e51cb9 100644
--- a/src/components/Upload/src/UploadPreviewModal.vue
+++ b/src/components/Upload/src/UploadPreviewModal.vue
@@ -1,5 +1,12 @@
-
+
diff --git a/src/components/Upload/src/useUpload.ts b/src/components/Upload/src/useUpload.ts
index 707b510..694cc27 100644
--- a/src/components/Upload/src/useUpload.ts
+++ b/src/components/Upload/src/useUpload.ts
@@ -1,7 +1,17 @@
import { Ref, unref, computed } from 'vue';
import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n();
-export function useUploadType({ acceptRef, helpTextRef, maxNumberRef, maxSizeRef }: { acceptRef: Ref; helpTextRef: Ref; maxNumberRef: Ref; maxSizeRef: Ref }) {
+export function useUploadType({
+ acceptRef,
+ helpTextRef,
+ maxNumberRef,
+ maxSizeRef,
+}: {
+ acceptRef: Ref;
+ helpTextRef: Ref;
+ maxNumberRef: Ref;
+ maxSizeRef: Ref;
+}) {
// 文件类型限制
const getAccept = computed(() => {
const accept = unref(acceptRef);
diff --git a/src/components/Verify/src/DragVerify.vue b/src/components/Verify/src/DragVerify.vue
index 3cba2ef..26ce84a 100644
--- a/src/components/Verify/src/DragVerify.vue
+++ b/src/components/Verify/src/DragVerify.vue
@@ -249,7 +249,8 @@
}
return (
- {getSlot(slots, 'actionIcon', isPassing) || (isPassing ? : )}
+ {getSlot(slots, 'actionIcon', isPassing) ||
+ (isPassing ? : )}
);
};
@@ -303,7 +304,16 @@
top: 0;
font-size: 12px;
-webkit-text-size-adjust: none;
- background-color: -webkit-gradient(linear, left top, right top, color-stop(0, #333), color-stop(0.4, #333), color-stop(0.5, #fff), color-stop(0.6, #333), color-stop(1, #333));
+ background-color: -webkit-gradient(
+ linear,
+ left top,
+ right top,
+ color-stop(0, #333),
+ color-stop(0.4, #333),
+ color-stop(0.5, #fff),
+ color-stop(0.6, #333),
+ color-stop(1, #333)
+ );
animation: slidetounlock 3s infinite;
background-clip: text;
user-select: none;
diff --git a/src/components/Verify/src/ImgRotate.vue b/src/components/Verify/src/ImgRotate.vue
index 28032fe..e900188 100644
--- a/src/components/Verify/src/ImgRotate.vue
+++ b/src/components/Verify/src/ImgRotate.vue
@@ -139,7 +139,9 @@
alt="verify"
/>
{state.showTip && (
- {state.isPassing ? t('component.verify.time', { time: time.toFixed(1) }) : t('component.verify.error')}
+
+ {state.isPassing ? t('component.verify.time', { time: time.toFixed(1) }) : t('component.verify.error')}
+
)}
{!state.showTip && !state.draged && {t('component.verify.redoTip')}}
diff --git a/src/components/jeecg/JPrompt/JPrompt.vue b/src/components/jeecg/JPrompt/JPrompt.vue
index 062f59b..146df0a 100644
--- a/src/components/jeecg/JPrompt/JPrompt.vue
+++ b/src/components/jeecg/JPrompt/JPrompt.vue
@@ -1,16 +1,18 @@
-
-
-
-
-
+
+
+
+
+
+
+
-
-
diff --git a/src/components/jeecg/super/superquery/SuperQueryValComponent.vue b/src/components/jeecg/super/superquery/SuperQueryValComponent.vue
deleted file mode 100644
index 61ee043..0000000
--- a/src/components/jeecg/super/superquery/SuperQueryValComponent.vue
+++ /dev/null
@@ -1,98 +0,0 @@
-
diff --git a/src/components/jeecg/super/superquery/useSuperQuery.ts b/src/components/jeecg/super/superquery/useSuperQuery.ts
deleted file mode 100644
index c0e21b7..0000000
--- a/src/components/jeecg/super/superquery/useSuperQuery.ts
+++ /dev/null
@@ -1,524 +0,0 @@
-import { useModalInner } from '/@/components/Modal';
-import { randomString } from '/@/utils/common/compUtils';
-import { reactive, ref, toRaw, watch } from 'vue';
-import { useMessage } from '/@/hooks/web/useMessage';
-import { Modal } from 'ant-design-vue';
-import { createLocalStorage } from '/@/utils/cache';
-import { useRoute } from 'vue-router';
-
-/**
- * 表单类型转换成查询类型
- * 普通查询和高级查询组件区别 :高级查询不支持联动组件
- */
-const FORM_VIEW_TO_QUERY_VIEW = {
- password: 'text',
- file: 'text',
- image: 'text',
- textarea: 'text',
- umeditor: 'text',
- markdown: 'text',
- checkbox: 'list_multi',
- radio: 'list',
-};
-
-// 查询条件存储编码前缀
-const SAVE_CODE_PRE = 'JSuperQuerySaved_';
-
-/**
- * 查询项
- * */
-interface SuperQueryItem {
- field: string | undefined;
- rule: string | undefined;
- val: string | number;
- key: string;
-}
-/**
- * 查询项-第一个控件树model
- * */
-interface TreeModel {
- title: string;
- value: string;
- isLeaf?: boolean;
- disabled?: boolean;
- children?: TreeModel[];
- order?: number;
-}
-
-/**
- * 查询信息保存结构
- * */
-interface SaveModel {
- title: string;
- content: string;
- type: string;
-}
-
-export function useSuperQuery() {
- const { createMessage: $message } = useMessage();
- /** 表单ref*/
- const formRef = ref();
-
- /** 数据*/
- const dynamicRowValues = reactive<{ values: SuperQueryItem[] }>({
- values: [],
- });
- /** and/or */
- const matchType = ref('and');
-
- // 弹框显示
- const [registerModal, { setModalProps }] = useModalInner(() => {
- setModalProps({ confirmLoading: false });
- });
-
- // 高级查询类型不支持联动组件,需要额外设置联动组件的view为text
- const view2QueryViewMap = Object.assign({}, { link_down: 'text' }, FORM_VIEW_TO_QUERY_VIEW);
-
- /**
- * 确认按钮事件
- */
- function handleSubmit() {
- console.log('handleSubmit', dynamicRowValues.values);
- }
-
- /**
- * 关闭按钮事件
- */
- function handleCancel() {
- //closeModal();
- }
-
- /**
- * val组件赋值
- */
- function setFormModel(key: string, value: any, item: any) {
- console.log('setFormModel', key, value);
- // formModel[key] = value;
- item['val'] = value;
- }
-
- // 字段-Properties
- const fieldProperties = ref({});
- // 字段-左侧查询项-树控件数据
- const fieldTreeData = ref([]);
-
- /**
- * 初始化数据-最开始的方法
- * 1.获取 表名@字段名-->配置 这样的一个map
- * 2.获取树形结构的数据 显示:文本; 存储:表名@字段名
- * 当树改变时,及时获取配置更新表单
- * @param json
- */
- function init(json) {
- let { allFields, treeData } = getAllFields(json);
- fieldProperties.value = allFields;
- fieldTreeData.value = treeData;
- }
-
- /**
- * 左侧查询项 添加一行
- * @param index
- */
- function addOne(index) {
- let item = {
- field: undefined,
- rule: 'eq',
- val: '',
- key: randomString(16),
- };
- if (index === false) {
- // 重置后需要调用
- dynamicRowValues.values = [];
- dynamicRowValues.values.push(item);
- } else if (index === true) {
- // 打开弹框是需要调用
- if (dynamicRowValues.values.length == 0) {
- dynamicRowValues.values.push(item);
- }
- } else {
- // 其余就是 正常的点击加号增加行
- dynamicRowValues.values.splice(++index, 0, item);
- }
- }
-
- /**
- * 左侧查询项 删除一行
- */
- function removeOne(item: SuperQueryItem) {
- let arr = toRaw(dynamicRowValues.values);
- let index = -1;
- for (let i = 0; i < arr.length; i++) {
- if (item.key == arr[i].key) {
- index = i;
- break;
- }
- }
- if (index != -1) {
- dynamicRowValues.values.splice(index, 1);
- }
- }
-
- // 默认的输入框
- const defaultInput = {
- field: 'val',
- label: '测试',
- component: 'Input',
- };
-
- /**
- * 左侧查询项 val组件 schema获取, 替代左侧字段树的change事件
- * @param item
- * @param index
- */
- function getSchema(item, index) {
- let map = fieldProperties.value;
- let prop = map[item.field];
- if (!prop) {
- return defaultInput;
- }
- if (view2QueryViewMap[prop.view]) {
- // 如果出现查询条件联动组件出来的场景,请跟踪此处
- prop.view = view2QueryViewMap[prop.view];
- }
- let temp;
- // temp.setFormRef(formRef)
- temp.noChange();
- // 查询条件中的 下拉框popContainer为parentNode
- temp.asSearchForm();
- temp.updateField(item.field + index);
- const setFieldValue = (values) => {
- item['val'] = values[item.field];
- };
- temp.setFunctionForFieldValue(setFieldValue);
- let schema = temp.getFormItemSchema();
- //schema['valueField'] = 'val'
- return schema;
- }
-
- /*-----------------------右侧保存信息相关-begin---------------------------*/
-
- /**
- * 右侧树 的 数据
- */
- const saveTreeData = ref('');
- // 本地缓存
- const $ls = createLocalStorage();
- //需要保存的信息(一条)
- const saveInfo = reactive({
- visible: false,
- title: '',
- content: '',
- saveCode: '',
- });
- //按钮loading
- const loading = ref(false);
-
- // 当前页面路由
- const route = useRoute();
- // 监听路由信息,路由发生改变,则重新获取保存的查询信息-->currentPageSavedArray
- watch(
- () => route.fullPath,
- (val) => {
- console.log('fullpath', val);
- initSaveQueryInfoCode();
- }
- );
-
- // 当前页面存储的 查询信息
- const currentPageSavedArray = ref([]);
- // 监听当前页面是否有新的数据保存了,然后更新右侧数据->saveTreeData
- watch(
- () => currentPageSavedArray.value,
- (val) => {
- let temp: any[] = [];
- if (val && val.length > 0) {
- val.map((item) => {
- let key = randomString(16);
- temp.push({
- title: item.title,
- slots: { icon: 'custom' },
- value: key,
- });
- });
- }
- saveTreeData.value = temp;
- },
- { immediate: true, deep: true }
- );
-
- // 重新获取保存的查询信息
- function initSaveQueryInfoCode() {
- let code = SAVE_CODE_PRE + route.fullPath;
- saveInfo.saveCode = code;
- let list = $ls.get(code);
- if (list && list instanceof Array) {
- currentPageSavedArray.value = list;
- }
- }
-
- // 执行一次 获取保存的查询信息
- initSaveQueryInfoCode();
-
- /**
- * 保存按钮事件
- */
- function handleSave() {
- // 获取实际数据转成字符串
- let fieldArray = getQueryInfo();
- if (!fieldArray) {
- $message.warning('空条件不能保存');
- return;
- }
- let content = JSON.stringify(fieldArray);
- openSaveInfoModal(content);
- }
-
- // 输入保存标题 弹框显示
- function openSaveInfoModal(content) {
- saveInfo.visible = true;
- saveInfo.title = '';
- saveInfo.content = content;
- }
-
- /**
- * 确认保存查询信息
- */
- function doSaveQueryInfo() {
- let { title, content, saveCode } = saveInfo;
- let index = getTitleIndex(title);
- if (index >= 0) {
- // 已存在是否覆盖
- Modal.confirm({
- title: '提示',
- content: `${title} 已存在,是否覆盖?`,
- okText: '确认',
- cancelText: '取消',
- onOk: () => {
- currentPageSavedArray.value.splice(index, 1, {
- content,
- title,
- type: matchType.value,
- });
- $ls.set(saveCode, currentPageSavedArray.value);
- saveInfo.visible = false;
- },
- });
- } else {
- currentPageSavedArray.value.push({
- content,
- title,
- type: matchType.value,
- });
- $ls.set(saveCode, currentPageSavedArray.value);
- saveInfo.visible = false;
- }
- }
-
- // 根据填入的 title找本地存储的信息,如果有需要询问是否覆盖
- function getTitleIndex(title) {
- let savedArray = currentPageSavedArray.value;
- let index = -1;
- for (let i = 0; i < savedArray.length; i++) {
- if (savedArray[i].title == title) {
- index = i;
- break;
- }
- }
- return index;
- }
-
- /**
- * 获取左侧所有查询条件,如果没有/或者条件无效则返回false
- */
- function getQueryInfo(isEmit = false) {
- let arr = dynamicRowValues.values;
- if (!arr || arr.length == 0) {
- return false;
- }
- let fieldArray: any = [];
- let fieldProps = fieldProperties.value;
- for (let item of arr) {
- if (item.field && (item.val || item.val === 0) && item.rule) {
- let tempVal: any = toRaw(item.val);
- if (tempVal instanceof Array) {
- tempVal = tempVal.join(',');
- }
- let fieldName = getRealFieldName(item);
- let obj = {
- field: fieldName,
- rule: item.rule,
- val: tempVal,
- };
- if (isEmit === true) {
- //如果当前数据用于emit事件,需要设置dbtype和type
- let prop = fieldProps[item.field];
- if (prop) {
- obj['type'] = prop.view;
- obj['dbType'] = prop.type;
- }
- }
- fieldArray.push(obj);
- }
- }
- if (fieldArray.length == 0) {
- return false;
- }
- return fieldArray;
- }
-
- //update-begin-author:taoyan date:2022-5-31 for: VUEN-1148 主子联动下,高级查询查子表数据,无效
- /**
- * 高级查询参数 字段名
- * 获取后台需要的 字段名格式:表名,字段名
- * @param item
- */
- function getRealFieldName(item) {
- let fieldName = item.field;
- if (fieldName.indexOf('@') > 0) {
- fieldName = fieldName.replace('@', ',');
- }
- return fieldName;
- }
- //update-end-author:taoyan date:2022-5-31 for: VUEN-1148 主子联动下,高级查询查子表数据,无效
-
- /**
- * 右侧数据 点击事件,重新将数据显示到左侧
- * @param key
- * @param node
- */
- function handleTreeSelect(key, { node }) {
- console.log(key, node);
- let title = node.dataRef.title;
- let arr = currentPageSavedArray.value.filter((item) => item.title == title);
- if (arr && arr.length > 0) {
- // 拿到数据渲染
- let { content, type } = arr[0];
- let data = JSON.parse(content);
- let rowsValues: SuperQueryItem[] = [];
- for (let item of data) {
- rowsValues.push(Object.assign({}, { key: randomString(16) }, item));
- }
- dynamicRowValues.values = rowsValues;
- matchType.value = type;
- }
- }
-
- /**
- * 右侧数据 删除事件
- */
- function handleRemoveSaveInfo(title) {
- console.log(title);
- let index = getTitleIndex(title);
- if (index >= 0) {
- currentPageSavedArray.value.splice(index, 1);
- $ls.set(saveInfo.saveCode, currentPageSavedArray.value);
- }
- }
-
- /*-----------------------右侧保存信息相关-end---------------------------*/
-
- // 获取所有字段配置信息
- function getAllFields(properties) {
- // 获取所有配置 查询字段 是否联合查询
- // const {properties, table, title } = json;
- let allFields = {};
- let order = 1;
- let treeData: TreeModel[] = [];
- /* let mainNode:TreeModel = {
- title,
- value: table,
- disabled: true,
- children: []
- };*/
- //treeData.push(mainNode)
- Object.keys(properties).map((field) => {
- let item = properties[field];
- if (item.view == 'table') {
- // 子表字段
- // 联合查询开启才需要子表字段作为查询条件
- let subProps = item['properties'] || item['fields'];
- let subTableOrder = order * 100;
- let subNode: TreeModel = {
- title: item.title,
- value: field,
- disabled: true,
- children: [],
- order: subTableOrder,
- };
- Object.keys(subProps).map((subField) => {
- let subItem = subProps[subField];
- // 保证排序统一
- subItem['order'] = subTableOrder + subItem['order'];
- let subFieldKey = field + '@' + subField;
- allFields[subFieldKey] = subItem;
- subNode.children!.push({
- title: subItem.title,
- value: subFieldKey,
- isLeaf: true,
- order: subItem['order'],
- });
- });
- orderField(subNode);
- treeData.push(subNode);
- order++;
- } else {
- // 主表字段
- //let fieldKey = table+'@'+field
- let fieldKey = field;
- allFields[fieldKey] = item;
- treeData.push({
- title: item.title,
- value: fieldKey,
- isLeaf: true,
- order: item.order,
- });
- }
- });
- orderField(treeData);
- return { allFields, treeData };
- }
-
- //根据字段的order重新排序
- function orderField(data) {
- let arr = data.children || data;
- arr.sort(function (a, b) {
- return a.order - b.order;
- });
- }
-
- function initDefaultValues(values) {
- const { params, matchType } = values;
- if (params) {
- let rowsValues: SuperQueryItem[] = [];
- for (let item of params) {
- rowsValues.push(Object.assign({}, { key: randomString(16) }, item));
- }
- dynamicRowValues.values = rowsValues;
- matchType.value = matchType;
- }
- }
-
- return {
- formRef,
- init,
- dynamicRowValues,
- matchType,
- registerModal,
- handleSubmit,
- handleCancel,
- handleSave,
- doSaveQueryInfo,
- saveInfo,
- saveTreeData,
- handleRemoveSaveInfo,
- handleTreeSelect,
- fieldTreeData,
- addOne,
- removeOne,
- setFormModel,
- getSchema,
- loading,
- getQueryInfo,
- initDefaultValues,
- };
-}
diff --git a/src/components/jeecg/thirdApp/JThirdAppButton.vue b/src/components/jeecg/thirdApp/JThirdAppButton.vue
index d3a06b7..c6b7f79 100644
--- a/src/components/jeecg/thirdApp/JThirdAppButton.vue
+++ b/src/components/jeecg/thirdApp/JThirdAppButton.vue
@@ -105,7 +105,12 @@
if (res.success) {
nodes = [...successInfo, h('br'), `无失败信息!`];
} else {
- nodes = [`失败信息如下:`, renderTextarea(h, res.result.failInfo.map((v, i) => `${i + 1}. ${v}`).join('\n')), h('br'), ...successInfo];
+ nodes = [
+ `失败信息如下:`,
+ renderTextarea(h, res.result.failInfo.map((v, i) => `${i + 1}. ${v}`).join('\n')),
+ h('br'),
+ ...successInfo,
+ ];
}
return nodes;
},
diff --git a/src/components/jeecg/thirdApp/JThirdAppDropdown.vue b/src/components/jeecg/thirdApp/JThirdAppDropdown.vue
index 2eaacc9..b94cbfd 100644
--- a/src/components/jeecg/thirdApp/JThirdAppDropdown.vue
+++ b/src/components/jeecg/thirdApp/JThirdAppDropdown.vue
@@ -8,7 +8,9 @@
-
同步{{ name }}
+
同步{{ name }}
同步{{ name }}到本地
diff --git a/src/components/registerGlobComp.ts b/src/components/registerGlobComp.ts
index 0771ad6..c8cfb8c 100644
--- a/src/components/registerGlobComp.ts
+++ b/src/components/registerGlobComp.ts
@@ -9,6 +9,8 @@ import {
Alert,
Checkbox,
DatePicker,
+ TimePicker,
+ Calendar,
Radio,
Switch,
Card,
@@ -66,6 +68,8 @@ export function registerGlobComp(app: App) {
.use(Breadcrumb)
.use(Checkbox)
.use(DatePicker)
+ .use(TimePicker)
+ .use(Calendar)
.use(Radio)
.use(Switch)
.use(Card)
diff --git a/src/hooks/web/useTabs.ts b/src/hooks/web/useTabs.ts
index 926d90b..7474bcd 100644
--- a/src/hooks/web/useTabs.ts
+++ b/src/hooks/web/useTabs.ts
@@ -89,6 +89,20 @@ export function useTabs(_router?: Router) {
}
}
+ /**
+ * 关闭相同的路由
+ * @param path
+ */
+ function closeSameRoute(path) {
+ if(path.indexOf('?')>0){
+ path = path.split('?')[0];
+ }
+ let tab = tabStore.getTabList.find((item) => item.path.indexOf(path)>=0)!;
+ if(tab){
+ tabStore.closeTab(tab, router);
+ }
+ }
+
return {
refreshPage: () => handleTabAction(TableActionEnum.REFRESH),
closeAll: () => handleTabAction(TableActionEnum.CLOSE_ALL),
@@ -99,5 +113,6 @@ export function useTabs(_router?: Router) {
close: (tab?: RouteLocationNormalized) => handleTabAction(TableActionEnum.CLOSE, tab),
setTitle: (title: string, tab?: RouteLocationNormalized) => updateTabTitle(title, tab),
updatePath: (fullPath: string, tab?: RouteLocationNormalized) => updateTabPath(fullPath, tab),
+ closeSameRoute
};
}
diff --git a/src/layouts/default/header/components/user-dropdown/DepartSelect.vue b/src/layouts/default/header/components/user-dropdown/DepartSelect.vue
index 58f86bc..260bca4 100644
--- a/src/layouts/default/header/components/user-dropdown/DepartSelect.vue
+++ b/src/layouts/default/header/components/user-dropdown/DepartSelect.vue
@@ -106,9 +106,11 @@
if (unref(isMultiTenant) && unref(isMultiDepart)) {
currTitle.value = '切换租户和部门';
} else if (unref(isMultiTenant)) {
- currTitle.value = unref(currentTenantName) && unref(currentTenantName).length > 0 ? `租户切换(当前租户 :${unref(currentTenantName)})` : props.title;
+ currTitle.value =
+ unref(currentTenantName) && unref(currentTenantName).length > 0 ? `租户切换(当前租户 :${unref(currentTenantName)})` : props.title;
} else if (unref(isMultiDepart)) {
- currTitle.value = unref(currentDepartName) && unref(currentDepartName).length > 0 ? `部门切换(当前部门 :${unref(currentDepartName)})` : props.title;
+ currTitle.value =
+ unref(currentDepartName) && unref(currentDepartName).length > 0 ? `部门切换(当前部门 :${unref(currentDepartName)})` : props.title;
}
//model显隐
if (unref(isMultiTenant) || unref(isMultiDepart)) {
diff --git a/src/layouts/default/header/index.vue b/src/layouts/default/header/index.vue
index ab051e2..dcbc1e3 100644
--- a/src/layouts/default/header/index.vue
+++ b/src/layouts/default/header/index.vue
@@ -4,7 +4,11 @@
@@ -95,7 +99,17 @@
const { getShowTopMenu, getShowHeaderTrigger, getSplit, getIsMixMode, getMenuWidth, getIsMixSidebar } = useMenuSetting();
const { getUseErrorHandle, getShowSettingButton, getSettingButtonPosition } = useRootSetting();
- const { getHeaderTheme, getShowFullScreen, getShowNotice, getShowContent, getShowBread, getShowHeaderLogo, getShowHeader, getShowSearch, getUseLockPage } = useHeaderSetting();
+ const {
+ getHeaderTheme,
+ getShowFullScreen,
+ getShowNotice,
+ getShowContent,
+ getShowBread,
+ getShowHeaderLogo,
+ getShowHeader,
+ getShowSearch,
+ getUseLockPage,
+ } = useHeaderSetting();
const { getShowLocalePicker } = useLocale();
diff --git a/src/layouts/default/menu/index.vue b/src/layouts/default/menu/index.vue
index 0016935..c9839d5 100644
--- a/src/layouts/default/menu/index.vue
+++ b/src/layouts/default/menu/index.vue
@@ -41,7 +41,17 @@
setup(props) {
const go = useGo();
- const { getMenuMode, getMenuType, getMenuTheme, getCollapsed, getCollapsedShowTitle, getAccordion, getIsHorizontal, getIsSidebarType, getSplit } = useMenuSetting();
+ const {
+ getMenuMode,
+ getMenuType,
+ getMenuTheme,
+ getCollapsed,
+ getCollapsedShowTitle,
+ getAccordion,
+ getIsHorizontal,
+ getIsSidebarType,
+ getSplit,
+ } = useMenuSetting();
const { getShowLogo } = useRootSetting();
const { prefixCls } = useDesign('layout-menu');
@@ -57,7 +67,10 @@
const getIsShowLogo = computed(() => unref(getShowLogo) && unref(getIsSidebarType));
const getUseScroll = computed(() => {
- return !unref(getIsHorizontal) && (unref(getIsSidebarType) || props.splitType === MenuSplitTyeEnum.LEFT || props.splitType === MenuSplitTyeEnum.NONE);
+ return (
+ !unref(getIsHorizontal) &&
+ (unref(getIsSidebarType) || props.splitType === MenuSplitTyeEnum.LEFT || props.splitType === MenuSplitTyeEnum.NONE)
+ );
});
const getWrapperStyle = computed((): CSSProperties => {
@@ -128,7 +141,14 @@
return !props.isHorizontal ? (
) : (
-
+
);
}
diff --git a/src/layouts/default/setting/SettingDrawer.tsx b/src/layouts/default/setting/SettingDrawer.tsx
index 68efce5..17e07b1 100644
--- a/src/layouts/default/setting/SettingDrawer.tsx
+++ b/src/layouts/default/setting/SettingDrawer.tsx
@@ -16,7 +16,16 @@ import { useI18n } from '/@/hooks/web/useI18n';
import { baseHandler } from './handler';
-import { HandlerEnum, contentModeOptions, topMenuAlignOptions, getMenuTriggerOptions, routerTransitionOptions, menuTypeList, mixSidebarTriggerOptions, tabsThemeOptions } from './enum';
+import {
+ HandlerEnum,
+ contentModeOptions,
+ topMenuAlignOptions,
+ getMenuTriggerOptions,
+ routerTransitionOptions,
+ menuTypeList,
+ mixSidebarTriggerOptions,
+ tabsThemeOptions,
+} from './enum';
import { HEADER_PRESET_BG_COLOR_LIST, SIDE_BAR_BG_COLOR_LIST, APP_PRESET_COLOR_LIST } from '/@/settings/designSetting';
@@ -25,8 +34,19 @@ const { t } = useI18n();
export default defineComponent({
name: 'SettingDrawer',
setup(_, { attrs }) {
- const { getContentMode, getShowFooter, getShowBreadCrumb, getShowBreadCrumbIcon, getShowLogo, getFullContent, getColorWeak, getGrayMode, getLockTime, getShowDarkModeToggle, getThemeColor } =
- useRootSetting();
+ const {
+ getContentMode,
+ getShowFooter,
+ getShowBreadCrumb,
+ getShowBreadCrumbIcon,
+ getShowLogo,
+ getFullContent,
+ getColorWeak,
+ getGrayMode,
+ getLockTime,
+ getShowDarkModeToggle,
+ getThemeColor,
+ } = useRootSetting();
const { getOpenPageLoading, getBasicTransition, getEnableTransition, getOpenNProgress } = useTransitionSetting();
@@ -103,7 +123,12 @@ export default defineComponent({
return (
<>
-
+
{/*
-
+
-
+
-
+
{/* (
-
+
{unref(getShowDarkModeToggle) && {() => t('layout.setting.darkMode')}}
{unref(getShowDarkModeToggle) && }
{() => t('layout.setting.navMode')}
diff --git a/src/layouts/default/setting/components/SwitchItem.vue b/src/layouts/default/setting/components/SwitchItem.vue
index 506dda7..ff27477 100644
--- a/src/layouts/default/setting/components/SwitchItem.vue
+++ b/src/layouts/default/setting/components/SwitchItem.vue
@@ -1,7 +1,13 @@
{{ title }}
-
+
-
diff --git a/src/views/demo/jeecg/PrintDemo.vue b/src/views/demo/jeecg/PrintDemo.vue
index 9845364..987da1a 100644
--- a/src/views/demo/jeecg/PrintDemo.vue
+++ b/src/views/demo/jeecg/PrintDemo.vue
@@ -10,7 +10,7 @@