mirror of
https://github.com/vbenjs/vben-admin-thin-next.git
synced 2025-02-03 02:18:40 +08:00
perf(login): enter to log in
This commit is contained in:
parent
8f76ef4e70
commit
b93f20f0df
2
.github/workflows/deploy.yml
vendored
2
.github/workflows/deploy.yml
vendored
@ -55,7 +55,7 @@ jobs:
|
||||
# ARGS: --delete --verbose --parallel=80
|
||||
|
||||
push-to-gh-pages:
|
||||
if: "contains(github.event.head_commit.message, '[deploy]')"
|
||||
if: "contains(github.event.head_commit.message, '[release]')"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
@ -4,6 +4,11 @@
|
||||
|
||||
- `BasicTree` 新增`clickRowToExpand`,用于单击树节点展开
|
||||
|
||||
### ⚡ Performance Improvements
|
||||
|
||||
- 表格关闭分页时不再携带分页参数
|
||||
- 登录页监听回车事件进行登录
|
||||
|
||||
### 🐛 Bug Fixes
|
||||
|
||||
- 修复`Description`已知问题
|
||||
|
@ -91,6 +91,7 @@
|
||||
"is-ci": "^3.0.0",
|
||||
"less": "^4.1.1",
|
||||
"lint-staged": "^10.5.4",
|
||||
"postcss": "^8.2.7",
|
||||
"prettier": "^2.2.1",
|
||||
"pretty-quick": "^3.1.0",
|
||||
"rimraf": "^3.0.2",
|
||||
@ -116,7 +117,9 @@
|
||||
},
|
||||
"resolutions": {
|
||||
"//": "Used to install imagemin dependencies, because imagemin may not be installed in China.If it is abroad, you can delete it",
|
||||
"bin-wrapper": "npm:bin-wrapper-china"
|
||||
"bin-wrapper": "npm:bin-wrapper-china",
|
||||
"esbuild": "0.8.55",
|
||||
"rollup": "2.40.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -3,6 +3,7 @@ import type { Menu } from '/@/router/types';
|
||||
import { ref, onBeforeMount, unref, Ref, nextTick } from 'vue';
|
||||
|
||||
import { getMenus } from '/@/router/menus';
|
||||
import { KeyCodeEnum } from '/@/enums/keyCodeEnum';
|
||||
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { filter, forEach } from '/@/utils/helper/treeHelper';
|
||||
@ -19,13 +20,6 @@ export interface SearchResult {
|
||||
icon?: string;
|
||||
}
|
||||
|
||||
const enum KeyCodeEnum {
|
||||
UP = 38,
|
||||
DOWN = 40,
|
||||
ENTER = 13,
|
||||
ESC = 27,
|
||||
}
|
||||
|
||||
// Translate special characters
|
||||
function transform(c: string) {
|
||||
const code: string[] = ['$', '(', ')', '*', '+', '.', '[', ']', '?', '\\', '^', '{', '}', '|'];
|
||||
|
@ -5,6 +5,7 @@
|
||||
:prefixCls="prefixCls"
|
||||
:show="show"
|
||||
@expand="handleExpand"
|
||||
:class="show ? 'mb-3' : ''"
|
||||
>
|
||||
<template #title>
|
||||
<slot name="title"></slot>
|
||||
@ -108,7 +109,7 @@
|
||||
&__header {
|
||||
display: flex;
|
||||
height: 32px;
|
||||
margin-bottom: 10px;
|
||||
// margin-bottom: 10px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div :class="`${prefixCls}__header`">
|
||||
<div :class="[`${prefixCls}__header`, $attrs.class]">
|
||||
<BasicTitle :helpMessage="helpMessage">
|
||||
<template v-if="title">
|
||||
{{ title }}
|
||||
|
@ -13,8 +13,6 @@
|
||||
|
||||
import { isFunction } from '/@/utils/is';
|
||||
import { getSlot } from '/@/utils/helper/tsxHelper';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { deepMerge } from '/@/utils';
|
||||
|
||||
import descProps from './props';
|
||||
import { useAttrs } from '/@/hooks/core/useAttrs';
|
||||
|
@ -105,6 +105,7 @@ export default defineComponent({
|
||||
? props.schema.isAdvanced
|
||||
: true
|
||||
: true;
|
||||
|
||||
let isShow = true;
|
||||
let isIfShow = true;
|
||||
|
||||
|
@ -37,8 +37,8 @@
|
||||
import { PageHeader } from 'ant-design-vue';
|
||||
export default defineComponent({
|
||||
name: 'PageWrapper',
|
||||
inheritAttrs: false,
|
||||
components: { PageFooter, PageHeader },
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
dense: propTypes.bool,
|
||||
ghost: propTypes.bool,
|
||||
|
@ -155,9 +155,15 @@ export function useDataSource(
|
||||
}
|
||||
|
||||
async function fetch(opt?: FetchParams) {
|
||||
const { api, searchInfo, fetchSetting, beforeFetch, afterFetch, useSearchForm } = unref(
|
||||
propsRef
|
||||
);
|
||||
const {
|
||||
api,
|
||||
searchInfo,
|
||||
fetchSetting,
|
||||
beforeFetch,
|
||||
afterFetch,
|
||||
useSearchForm,
|
||||
pagination,
|
||||
} = unref(propsRef);
|
||||
if (!api || !isFunction(api)) return;
|
||||
try {
|
||||
setLoading(true);
|
||||
@ -166,7 +172,7 @@ export function useDataSource(
|
||||
|
||||
const { current = 1, pageSize = PAGE_SIZE } = unref(getPaginationInfo) as PaginationProps;
|
||||
|
||||
if (isBoolean(getPaginationInfo)) {
|
||||
if (!pagination || isBoolean(getPaginationInfo)) {
|
||||
pageParams = {};
|
||||
} else {
|
||||
pageParams[pageField] = (opt && opt.page) || current;
|
||||
|
6
src/enums/keyCodeEnum.ts
Normal file
6
src/enums/keyCodeEnum.ts
Normal file
@ -0,0 +1,6 @@
|
||||
export const enum KeyCodeEnum {
|
||||
UP = 38,
|
||||
DOWN = 40,
|
||||
ENTER = 13,
|
||||
ESC = 27,
|
||||
}
|
@ -72,7 +72,7 @@
|
||||
schema: schema,
|
||||
});
|
||||
|
||||
const [register1, { setDescProps }] = useDescription({
|
||||
const [register1] = useDescription({
|
||||
title: '无边框',
|
||||
bordered: false,
|
||||
data: mockData,
|
||||
|
@ -26,7 +26,7 @@
|
||||
},
|
||||
});
|
||||
|
||||
const [registerModal, { setModalProps }] = useModalInner(async (data) => {
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
resetFields();
|
||||
setModalProps({ confirmLoading: false });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
@ -58,6 +58,7 @@
|
||||
setModalProps({ confirmLoading: true });
|
||||
// TODO custom api
|
||||
console.log(values);
|
||||
closeModal();
|
||||
emit('success');
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
|
@ -71,6 +71,7 @@
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
console.log(record);
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
|
@ -88,6 +88,8 @@
|
||||
import { userStore } from '/@/store/modules/user';
|
||||
import { LoginStateEnum, useLoginState, useFormRules, useFormValid } from './useLogin';
|
||||
import { useDesign } from '/@/hooks/web/useDesign';
|
||||
import { useKeyPress } from '/@/hooks/event/useKeyPress';
|
||||
import { KeyCodeEnum } from '/@/enums/keyCodeEnum';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'LoginForm',
|
||||
@ -126,6 +128,13 @@
|
||||
});
|
||||
|
||||
const { validForm } = useFormValid(formRef);
|
||||
useKeyPress(['enter'], (events) => {
|
||||
const keyCode = events.keyCode;
|
||||
|
||||
if (keyCode === KeyCodeEnum.ENTER) {
|
||||
handleLogin();
|
||||
}
|
||||
});
|
||||
|
||||
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN);
|
||||
|
||||
|
54
yarn.lock
54
yarn.lock
@ -2665,6 +2665,11 @@ colorette@^1.2.1:
|
||||
resolved "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz#4d0b921325c14faf92633086a536db6e89564b1b"
|
||||
integrity sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==
|
||||
|
||||
colorette@^1.2.2:
|
||||
version "1.2.2"
|
||||
resolved "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94"
|
||||
integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==
|
||||
|
||||
colors@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78"
|
||||
@ -3625,20 +3630,10 @@ esbuild-register@^2.0.0:
|
||||
source-map-support "^0.5.19"
|
||||
strip-json-comments "^3.1.1"
|
||||
|
||||
esbuild@^0.8.52:
|
||||
version "0.8.52"
|
||||
resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.8.52.tgz#6dabf11c517af449a96d66da20dfc204ee7b5294"
|
||||
integrity sha512-b5KzFweLLXoXQwdC/e2+Z80c8uo2M5MgP7yQEEebkFw6In4T9CvYcNoM2ElvJt8ByO04zAZUV0fZkXmXoi2s9A==
|
||||
|
||||
esbuild@^0.8.53:
|
||||
version "0.8.53"
|
||||
resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.8.53.tgz#b408bb0ca1b29dab13d8bbf7d59f59afe6776e86"
|
||||
integrity sha512-GIaYGdMukH58hu+lf07XWAeESBYFAsz8fXnrylHDCbBXKOSNtFmoYA8PhSeSF+3/qzeJ0VjzV9AkLURo5yfu3g==
|
||||
|
||||
esbuild@^0.8.54:
|
||||
version "0.8.54"
|
||||
resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.8.54.tgz#2f32ff80e95c69a0f25b799d76a27c05e2857cdf"
|
||||
integrity sha512-DJH38OiTgXJxFb/EhHrCrY8eGmtdkTtWymHpN9IYN9AF+4jykT0dQArr7wzFejpVbaB0TMIq2+vfNRWr3LXpvw==
|
||||
esbuild@0.8.55, esbuild@^0.8.52, esbuild@^0.8.53, esbuild@^0.8.54:
|
||||
version "0.8.55"
|
||||
resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.8.55.tgz#4bf949c44db4ffc2a206ac0c002e8e94eecff7d5"
|
||||
integrity sha512-mM/s7hjYe5mQR+zAWOM5JVrCtYCke182E9l1Bbs6rG5EDP3b1gZF9sHZka53PD/iNt6OccymVZRWkTtBfcKW4w==
|
||||
|
||||
escalade@^3.1.1:
|
||||
version "3.1.1"
|
||||
@ -4297,11 +4292,6 @@ fs.realpath@^1.0.0:
|
||||
resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
|
||||
|
||||
fsevents@~2.1.2:
|
||||
version "2.1.3"
|
||||
resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e"
|
||||
integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==
|
||||
|
||||
fsevents@~2.3.1:
|
||||
version "2.3.2"
|
||||
resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
|
||||
@ -7006,6 +6996,15 @@ postcss@^8.1.10, postcss@^8.2.1:
|
||||
nanoid "^3.1.20"
|
||||
source-map "^0.6.1"
|
||||
|
||||
postcss@^8.2.7:
|
||||
version "8.2.7"
|
||||
resolved "https://registry.npmjs.org/postcss/-/postcss-8.2.7.tgz#48ed8d88b4de10afa0dfd1c3f840aa57b55c4d47"
|
||||
integrity sha512-DsVLH3xJzut+VT+rYr0mtvOtpTjSyqDwPf5EZWXcb0uAKfitGpTY9Ec+afi2+TgdN8rWS9Cs88UDYehKo/RvOw==
|
||||
dependencies:
|
||||
colorette "^1.2.2"
|
||||
nanoid "^3.1.20"
|
||||
source-map "^0.6.1"
|
||||
|
||||
prelude-ls@^1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
|
||||
@ -7505,22 +7504,7 @@ rollup-plugin-visualizer@^4.2.0:
|
||||
source-map "^0.7.3"
|
||||
yargs "^16.0.3"
|
||||
|
||||
rollup@^0.63.4:
|
||||
version "0.63.5"
|
||||
resolved "https://registry.npmjs.org/rollup/-/rollup-0.63.5.tgz#5543eecac9a1b83b7e1be598b5be84c9c0a089db"
|
||||
integrity sha512-dFf8LpUNzIj3oE0vCvobX6rqOzHzLBoblyFp+3znPbjiSmSvOoK2kMKx+Fv9jYduG1rvcCfCveSgEaQHjWRF6g==
|
||||
dependencies:
|
||||
"@types/estree" "0.0.39"
|
||||
"@types/node" "*"
|
||||
|
||||
rollup@^2.25.0:
|
||||
version "2.38.0"
|
||||
resolved "https://registry.npmjs.org/rollup/-/rollup-2.38.0.tgz#57942d5a10826cb12ed1f19c261f774efa502d2d"
|
||||
integrity sha512-ay9zDiNitZK/LNE/EM2+v5CZ7drkB2xyDljvb1fQJCGnq43ZWRkhxN145oV8GmoW1YNi4sA/1Jdkr2LfawJoXw==
|
||||
optionalDependencies:
|
||||
fsevents "~2.1.2"
|
||||
|
||||
rollup@^2.38.5, rollup@^2.40.0:
|
||||
rollup@2.40.0, rollup@^0.63.4, rollup@^2.25.0, rollup@^2.38.5, rollup@^2.40.0:
|
||||
version "2.40.0"
|
||||
resolved "https://registry.npmjs.org/rollup/-/rollup-2.40.0.tgz#efc218eaede7ab590954df50f96195188999c304"
|
||||
integrity sha512-WiOGAPbXoHu+TOz6hyYUxIksOwsY/21TRWoO593jgYt8mvYafYqQl+axaA8y1z2HFazNUUrsMSjahV2A6/2R9A==
|
||||
|
Loading…
Reference in New Issue
Block a user