Merge branch 'main' of https://github.com/vbenjs/vue-vben-admin
This commit is contained in:
commit
40bb93afcd
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/web-ele",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://vben.pro",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/web-naive",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://vben.pro",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/docs",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "vitepress build",
|
||||
|
@ -18,7 +18,7 @@
|
||||
- **Permission Validation**: Comprehensive permission validation solutions, including button-level permission control.
|
||||
- **Multi-Theme**: Built-in multiple theme configurations & dark mode to meet personalized needs.
|
||||
- **Dynamic Menu**: Supports dynamic menus that can display based on permissions.
|
||||
- **Mock Data**: High-performance local Mock data solution based on Nitro.
|
||||
- **Mock Data**: High-performance local Mock data solution based on `Nitro`.
|
||||
- **Rich Components**: Provides a wide range of components to meet most business needs.
|
||||
- **Standardization**: Code quality is ensured with tools like `ESLint`, `Prettier`, `Stylelint`, `Publint`, and `CSpell`.
|
||||
- **Engineering**: Development efficiency is improved with tools like `Pnpm Monorepo`, `TurboRepo`, and `Changeset`.
|
||||
@ -26,9 +26,9 @@
|
||||
|
||||
## Browser Support
|
||||
|
||||
**Local development** is recommended using the **latest version of Chrome**. **Versions below Chrome 80 are not supported**.
|
||||
- **Local development** is recommended using the **latest version of Chrome**. **Versions below Chrome 80 are not supported**.
|
||||
|
||||
**Production environment** supports modern browsers, IE is not supported.
|
||||
- **Production environment** supports modern browsers, IE is not supported.
|
||||
|
||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png" alt="IE" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)IE | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)Safari |
|
||||
| :-: | :-: | :-: | :-: | :-: |
|
||||
@ -37,12 +37,10 @@
|
||||
## Contribution
|
||||
|
||||
- [Vben Admin](https://github.com/vbenjs/vue-vben-admin) is still being actively updated. Contributions are welcome to help maintain and improve the project, aiming to create a better mid- to backend solution.
|
||||
- If you wish to join us, you can provide suggestions or submit pull requests. We will invite you to join based on your activity.
|
||||
- If you wish to join us, you can start by contributing in the following ways, and we will invite you to join based on your activity.
|
||||
|
||||
::: info Join Us
|
||||
|
||||
If you wish to join us, you can start by contributing in the following ways, and we will invite you to join based on your activity:
|
||||
|
||||
- Regularly submit `PRs`.
|
||||
- Provide valuable suggestions.
|
||||
- Participate in discussions and help resolve some `issues`.
|
||||
|
@ -18,7 +18,7 @@
|
||||
- **权限验证**:完善的权限验证方案,按钮级别权限控制。
|
||||
- **多主题**:内置多种主题配置和黑暗模式,满足个性化需求。
|
||||
- **动态菜单**:支持动态菜单,可以根据权限配置显示菜单。
|
||||
- **Mock 数据**:基于 Nitro 的本地高性能 Mock 数据方案。
|
||||
- **Mock 数据**:基于 `Nitro` 的本地高性能 Mock 数据方案。
|
||||
- **组件丰富**:提供了丰富的组件,可以满足大部分的业务需求。
|
||||
- **规范**:代码规范,使用 `ESLint`、`Prettier`、`Stylelint`、`Publint`、`CSpell` 等工具保证代码质量。
|
||||
- **工程化**:使用 `Pnpm Monorepo`、`TurboRepo`、`Changeset` 等工具,提高开发效率。
|
||||
@ -26,9 +26,9 @@
|
||||
|
||||
## 浏览器支持
|
||||
|
||||
**本地开发**推荐使用`Chrome 最新版`浏览器,**不支持**`Chrome 80`以下版本。
|
||||
- **本地开发**推荐使用`Chrome 最新版`浏览器,**不支持**`Chrome 80`以下版本。
|
||||
|
||||
**生产环境**支持现代浏览器,不支持 IE。
|
||||
- **生产环境**支持现代浏览器,不支持 IE。
|
||||
|
||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png" alt="IE" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)IE | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)Safari |
|
||||
| :-: | :-: | :-: | :-: | :-: |
|
||||
@ -37,13 +37,13 @@
|
||||
## 贡献
|
||||
|
||||
- [Vben Admin](https://github.com/vbenjs/vue-vben-admin) 还在持续更新中,本项目欢迎您的参与,共同维护,逐步完善,打造更好的中后台解决方案。
|
||||
- 如果你想加入我们,可以提供有价值的建议或者参与讨论,协助解决 issue,- 如果你想加入我们,可以提供有价值的建议或者参与讨论,协助解决 issue,我们会根据你的活跃度邀请你加入。。
|
||||
- 如果你有兴趣加入我们,可以通过以下方式开始,我们会根据你的活跃度邀请你加入。
|
||||
|
||||
::: info 加入我们
|
||||
|
||||
- 长期提交 `PR`。
|
||||
- 提供一些好的建议。
|
||||
- 参与讨论,帮助解决一些 `issue`。
|
||||
- 提供有价值的建议。
|
||||
- 参与讨论,帮助解决 `issue`。
|
||||
- 共同维护文档。
|
||||
|
||||
:::
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/commitlint-config",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"private": true,
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
|
@ -18,6 +18,7 @@ export async function unicorn(): Promise<Linter.Config[]> {
|
||||
'unicorn/better-regex': 'off',
|
||||
'unicorn/consistent-destructuring': 'off',
|
||||
'unicorn/consistent-function-scoping': 'off',
|
||||
'unicorn/expiring-todo-comments': 'off',
|
||||
'unicorn/filename-case': 'off',
|
||||
'unicorn/import-style': 'off',
|
||||
'unicorn/no-array-for-each': 'off',
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/stylelint-config",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"private": true,
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/node-utils",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"private": true,
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/tailwind-config",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"private": true,
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/tsconfig",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"private": true,
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/vite-config",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"private": true,
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vben-admin-monorepo",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"private": true,
|
||||
"keywords": [
|
||||
"monorepo",
|
||||
@ -99,7 +99,7 @@
|
||||
"node": ">=20.10.0",
|
||||
"pnpm": ">=9.12.0"
|
||||
},
|
||||
"packageManager": "pnpm@9.13.0",
|
||||
"packageManager": "pnpm@9.13.2",
|
||||
"pnpm": {
|
||||
"peerDependencyRules": {
|
||||
"allowedVersions": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben-core/design",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben-core/icons",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben-core/shared",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben-core/typings",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben-core/composables",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben-core/preferences",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben-core/form-ui",
|
||||
"version": "5.2.1",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -91,18 +91,9 @@ function handleRangeTimeValue(values: Record<string, any>) {
|
||||
|
||||
fieldMappingTime.forEach(
|
||||
([field, [startTimeKey, endTimeKey], format = 'YYYY-MM-DD']) => {
|
||||
/**
|
||||
* 时间字段为空 但是映射的start/end不为空 说明已经清理了组件的时间(组件右边的x)
|
||||
* 需要删除对应的start/end字段 否则会被保留
|
||||
*/
|
||||
if (
|
||||
values[field] === null &&
|
||||
values[startTimeKey] &&
|
||||
values[endTimeKey]
|
||||
) {
|
||||
if (startTimeKey && endTimeKey && values[field] === null) {
|
||||
delete values[startTimeKey];
|
||||
delete values[endTimeKey];
|
||||
return;
|
||||
}
|
||||
|
||||
if (!values[field]) {
|
||||
|
@ -13,13 +13,13 @@ import { toRaw } from 'vue';
|
||||
import { Store } from '@vben-core/shared/store';
|
||||
import {
|
||||
bindMethods,
|
||||
createMerge,
|
||||
isFunction,
|
||||
isObject,
|
||||
mergeWithArrayOverride,
|
||||
StateHandler,
|
||||
} from '@vben-core/shared/utils';
|
||||
|
||||
import { objectPick } from '@vueuse/core';
|
||||
|
||||
function getDefaultState(): VbenFormProps {
|
||||
return {
|
||||
actionWrapperClass: '',
|
||||
@ -250,8 +250,17 @@ export class FormApi {
|
||||
form.setValues(fields, shouldValidate);
|
||||
return;
|
||||
}
|
||||
const fieldNames = this.state?.schema?.map((item) => item.fieldName) ?? [];
|
||||
const filteredFields = objectPick(fields, fieldNames);
|
||||
|
||||
const fieldMergeFn = createMerge((obj, key, value) => {
|
||||
if (key in obj) {
|
||||
obj[key] =
|
||||
!Array.isArray(obj[key]) && isObject(obj[key])
|
||||
? fieldMergeFn(obj[key], value)
|
||||
: value;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
const filteredFields = fieldMergeFn(fields, form.values);
|
||||
form.setValues(filteredFields, shouldValidate);
|
||||
}
|
||||
|
||||
|
@ -209,8 +209,9 @@ function fieldBindEvent(slotProps: Record<string, any>) {
|
||||
if (modelValue && isObject(modelValue) && bindEventField) {
|
||||
value = isEventObjectLike(modelValue)
|
||||
? modelValue?.target?.[bindEventField]
|
||||
: modelValue;
|
||||
: (modelValue?.[bindEventField] ?? modelValue);
|
||||
}
|
||||
|
||||
if (bindEventField) {
|
||||
return {
|
||||
[`onUpdate:${bindEventField}`]: handler,
|
||||
@ -223,6 +224,7 @@ function fieldBindEvent(slotProps: Record<string, any>) {
|
||||
if (!shouldUnwrap) {
|
||||
return onChange?.(e);
|
||||
}
|
||||
|
||||
return onChange?.(e?.target?.[bindEventField] ?? e);
|
||||
},
|
||||
onInput: () => {},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben-core/layout-ui",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben-core/menu-ui",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben-core/shadcn-ui",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"#main": "./dist/index.mjs",
|
||||
"#module": "./dist/index.mjs",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
|
@ -48,13 +48,16 @@ const delegatedProps = computed(() => {
|
||||
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
||||
|
||||
const contentRef = ref<InstanceType<typeof DialogContent> | null>(null);
|
||||
function onAnimationEnd() {
|
||||
function onAnimationEnd(event: AnimationEvent) {
|
||||
// 只有在 contentRef 的动画结束时才触发 opened/closed 事件
|
||||
if (event.target === contentRef.value?.$el) {
|
||||
if (props.open) {
|
||||
emits('opened');
|
||||
} else {
|
||||
emits('closed');
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({
|
||||
getContentRef: () => contentRef.value,
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben-core/tabs-ui",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/constants",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/access",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/common-ui",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -41,6 +41,7 @@ const emit = defineEmits<{
|
||||
const refTrigger = useTemplateRef<HTMLElement>('refTrigger');
|
||||
const currentSelect = ref('');
|
||||
const currentList = ref(props.icons);
|
||||
const currentPage = ref(1);
|
||||
|
||||
watch(
|
||||
() => props.icons,
|
||||
@ -72,6 +73,7 @@ const handleClick = (icon: string) => {
|
||||
};
|
||||
|
||||
const handlePageChange = (page: number) => {
|
||||
currentPage.value = page;
|
||||
setCurrentPage(page);
|
||||
};
|
||||
|
||||
@ -114,7 +116,6 @@ defineExpose({ changeOpenState });
|
||||
class="flex-center flex justify-end overflow-hidden border-t py-2 pr-3"
|
||||
>
|
||||
<Pagination
|
||||
v-slot="{ page }"
|
||||
:items-per-page="36"
|
||||
:sibling-count="1"
|
||||
:total="total"
|
||||
@ -136,7 +137,7 @@ defineExpose({ changeOpenState });
|
||||
as-child
|
||||
>
|
||||
<Button
|
||||
:variant="item.value === page ? 'default' : 'outline'"
|
||||
:variant="item.value === currentPage ? 'default' : 'outline'"
|
||||
class="size-5 p-0 text-sm"
|
||||
>
|
||||
{{ item.value }}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/hooks",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,8 +1,11 @@
|
||||
import type { Watermark, WatermarkOptions } from 'watermark-js-plus';
|
||||
|
||||
import { nextTick, onUnmounted, ref } from 'vue';
|
||||
import { nextTick, onUnmounted, readonly, ref } from 'vue';
|
||||
|
||||
import { updatePreferences } from '@vben/preferences';
|
||||
|
||||
const watermark = ref<Watermark>();
|
||||
const unmountedHooked = ref<boolean>(false);
|
||||
const cachedOptions = ref<Partial<WatermarkOptions>>({
|
||||
advancedStyle: {
|
||||
colorStops: [
|
||||
@ -45,7 +48,7 @@ export function useWatermark() {
|
||||
...options,
|
||||
};
|
||||
watermark.value = new Watermark(cachedOptions.value);
|
||||
|
||||
updatePreferences({ app: { watermark: true } });
|
||||
await watermark.value?.create();
|
||||
}
|
||||
|
||||
@ -62,16 +65,24 @@ export function useWatermark() {
|
||||
}
|
||||
|
||||
function destroyWatermark() {
|
||||
watermark.value?.destroy();
|
||||
if (watermark.value) {
|
||||
watermark.value.destroy();
|
||||
watermark.value = undefined;
|
||||
}
|
||||
updatePreferences({ app: { watermark: false } });
|
||||
}
|
||||
|
||||
// 只在第一次调用时注册卸载钩子,防止重复注册以致于在路由切换时销毁了水印
|
||||
if (!unmountedHooked.value) {
|
||||
unmountedHooked.value = true;
|
||||
onUnmounted(() => {
|
||||
destroyWatermark();
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
destroyWatermark,
|
||||
updateWatermark,
|
||||
watermark,
|
||||
watermark: readonly(watermark),
|
||||
};
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/layouts",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/plugins",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/request",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/icons",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/locales",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/preferences",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/stores",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/styles",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/types",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/utils",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/playground",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"homepage": "https://vben.pro",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
|
@ -4,7 +4,12 @@ import { useWatermark } from '@vben/hooks';
|
||||
|
||||
import { Button, Card } from 'ant-design-vue';
|
||||
|
||||
const { destroyWatermark, updateWatermark } = useWatermark();
|
||||
const { destroyWatermark, updateWatermark, watermark } = useWatermark();
|
||||
|
||||
async function recreateWaterMark() {
|
||||
destroyWatermark();
|
||||
await updateWatermark({});
|
||||
}
|
||||
|
||||
async function createWaterMark() {
|
||||
await updateWatermark({
|
||||
@ -21,7 +26,7 @@ async function createWaterMark() {
|
||||
],
|
||||
type: 'linear',
|
||||
},
|
||||
content: 'hello my watermark',
|
||||
content: `hello my watermark\n${new Date().toLocaleString()}`,
|
||||
globalAlpha: 0.5,
|
||||
gridLayoutOptions: {
|
||||
cols: 2,
|
||||
@ -57,10 +62,25 @@ async function createWaterMark() {
|
||||
</template>
|
||||
|
||||
<Card title="使用">
|
||||
<Button class="mr-2" type="primary" @click="createWaterMark()">
|
||||
<Button
|
||||
:disabled="!!watermark"
|
||||
class="mr-2"
|
||||
type="primary"
|
||||
@click="recreateWaterMark"
|
||||
>
|
||||
创建水印
|
||||
</Button>
|
||||
<Button danger @click="destroyWatermark">移除水印</Button>
|
||||
<Button
|
||||
:disabled="!watermark"
|
||||
class="mr-2"
|
||||
type="primary"
|
||||
@click="createWaterMark"
|
||||
>
|
||||
更新水印
|
||||
</Button>
|
||||
<Button :disabled="!watermark" danger @click="destroyWatermark">
|
||||
移除水印
|
||||
</Button>
|
||||
</Card>
|
||||
</Page>
|
||||
</template>
|
||||
|
@ -3,42 +3,56 @@ import { ref } from 'vue';
|
||||
|
||||
import { Page, VResize } from '@vben/common-ui';
|
||||
|
||||
const width = ref(200);
|
||||
const height = ref(200);
|
||||
const top = ref(200);
|
||||
const left = ref(200);
|
||||
const colorMap = ['red', 'green', 'yellow', 'gray'];
|
||||
|
||||
const resize = (newRect: {
|
||||
type TSize = {
|
||||
height: number;
|
||||
left: number;
|
||||
top: number;
|
||||
width: number;
|
||||
}) => {
|
||||
width.value = newRect.width;
|
||||
height.value = newRect.height;
|
||||
top.value = newRect.top;
|
||||
left.value = newRect.left;
|
||||
};
|
||||
|
||||
const sizeList = ref<TSize[]>([
|
||||
{ height: 200, left: 200, top: 200, width: 200 },
|
||||
{ height: 300, left: 300, top: 300, width: 300 },
|
||||
{ height: 400, left: 400, top: 400, width: 400 },
|
||||
{ height: 500, left: 500, top: 500, width: 500 },
|
||||
]);
|
||||
|
||||
const resize = (size?: TSize, rect?: TSize) => {
|
||||
if (!size || !rect) return;
|
||||
|
||||
size.height = rect.height;
|
||||
size.left = rect.left;
|
||||
size.top = rect.top;
|
||||
size.width = rect.width;
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page description="Resize组件基础示例" title="Resize组件">
|
||||
<div class="m-4 bg-blue-500 p-48 text-xl">
|
||||
<div v-for="size in sizeList" :key="size.width">
|
||||
{{
|
||||
`width: ${width}px, height: ${height}px, top: ${top}px, left: ${left}px`
|
||||
`width: ${size.width}px, height: ${size.height}px, top: ${size.top}px, left: ${size.left}px`
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template v-for="(_, idx) of 4" :key="idx">
|
||||
<VResize
|
||||
:h="200"
|
||||
:is-active="true"
|
||||
:w="200"
|
||||
:x="200"
|
||||
:y="200"
|
||||
@dragging="resize"
|
||||
@resizing="resize"
|
||||
:h="100 * (idx + 1)"
|
||||
:w="100 * (idx + 1)"
|
||||
:x="100 * (idx + 1)"
|
||||
:y="100 * (idx + 1)"
|
||||
@dragging="(rect) => resize(sizeList[idx], rect)"
|
||||
@resizing="(rect) => resize(sizeList[idx], rect)"
|
||||
>
|
||||
<div class="h-full w-full bg-red-500"></div>
|
||||
<div
|
||||
:style="{ backgroundColor: colorMap[idx] }"
|
||||
class="h-full w-full"
|
||||
></div>
|
||||
</VResize>
|
||||
</template>
|
||||
</Page>
|
||||
</template>
|
||||
|
@ -17,17 +17,17 @@ catalog:
|
||||
'@changesets/changelog-github': ^0.5.0
|
||||
'@changesets/cli': ^2.27.9
|
||||
'@changesets/git': ^3.0.1
|
||||
'@clack/prompts': ^0.7.0
|
||||
'@clack/prompts': ^0.8.1
|
||||
'@commitlint/cli': ^19.5.0
|
||||
'@commitlint/config-conventional': ^19.5.0
|
||||
'@ctrl/tinycolor': ^4.1.0
|
||||
'@eslint/js': ^9.14.0
|
||||
'@eslint/js': ^9.15.0
|
||||
'@faker-js/faker': ^9.2.0
|
||||
'@iconify/json': ^2.2.271
|
||||
'@iconify/json': ^2.2.273
|
||||
'@iconify/tailwind': ^1.1.3
|
||||
'@iconify/vue': ^4.1.2
|
||||
'@intlify/core-base': ^10.0.4
|
||||
'@intlify/unplugin-vue-i18n': ^5.3.1
|
||||
'@intlify/unplugin-vue-i18n': ^6.0.0
|
||||
'@jspm/generator': ^2.4.1
|
||||
'@manypkg/get-packages': ^2.2.2
|
||||
'@nolebase/vitepress-plugin-git-changelog': ^2.9.0
|
||||
@ -36,7 +36,7 @@ catalog:
|
||||
'@stylistic/stylelint-plugin': ^3.1.1
|
||||
'@tailwindcss/nesting': 0.0.0-insiders.565cd3e
|
||||
'@tailwindcss/typography': ^0.5.15
|
||||
'@tanstack/vue-query': ^5.59.20
|
||||
'@tanstack/vue-query': ^5.60.5
|
||||
'@tanstack/vue-store': ^0.5.7
|
||||
'@types/archiver': ^6.0.3
|
||||
'@types/eslint': ^9.6.1
|
||||
@ -55,8 +55,8 @@ catalog:
|
||||
'@vite-pwa/vitepress': ^0.5.3
|
||||
'@vitejs/plugin-vue': ^5.2.0
|
||||
'@vitejs/plugin-vue-jsx': ^4.1.0
|
||||
'@vue/reactivity': ^3.5.12
|
||||
'@vue/shared': ^3.5.12
|
||||
'@vue/reactivity': ^3.5.13
|
||||
'@vue/shared': ^3.5.13
|
||||
'@vue/test-utils': ^2.4.6
|
||||
'@vueuse/core': ^11.2.0
|
||||
'@vueuse/integrations': ^11.2.0
|
||||
@ -83,19 +83,19 @@ catalog:
|
||||
depcheck: ^1.4.7
|
||||
dotenv: ^16.4.5
|
||||
echarts: ^5.5.1
|
||||
element-plus: ^2.8.7
|
||||
eslint: ^9.14.0
|
||||
eslint-config-turbo: ^2.2.3
|
||||
element-plus: ^2.8.8
|
||||
eslint: ^9.15.0
|
||||
eslint-config-turbo: ^2.3.0
|
||||
eslint-plugin-command: ^0.2.6
|
||||
eslint-plugin-eslint-comments: ^3.2.0
|
||||
eslint-plugin-import-x: ^4.4.2
|
||||
eslint-plugin-jsdoc: ^50.5.0
|
||||
eslint-plugin-jsonc: ^2.18.1
|
||||
eslint-plugin-n: ^17.13.1
|
||||
eslint-plugin-n: ^17.13.2
|
||||
eslint-plugin-no-only-tests: ^3.3.0
|
||||
eslint-plugin-perfectionist: ^3.9.1
|
||||
eslint-plugin-prettier: ^5.2.1
|
||||
eslint-plugin-regexp: ^2.6.0
|
||||
eslint-plugin-regexp: ^2.7.0
|
||||
eslint-plugin-unicorn: ^56.0.0
|
||||
eslint-plugin-unused-imports: ^4.1.4
|
||||
eslint-plugin-vitest: ^0.5.4
|
||||
@ -105,7 +105,7 @@ catalog:
|
||||
get-port: ^7.1.0
|
||||
globals: ^15.12.0
|
||||
h3: ^1.13.0
|
||||
happy-dom: ^15.11.4
|
||||
happy-dom: ^15.11.6
|
||||
html-minifier-terser: ^7.2.0
|
||||
husky: ^9.1.6
|
||||
is-ci: ^3.0.1
|
||||
@ -114,7 +114,7 @@ catalog:
|
||||
lint-staged: ^15.2.10
|
||||
lodash.clonedeep: ^4.5.0
|
||||
lodash.get: ^4.4.2
|
||||
lucide-vue-next: ^0.456.0
|
||||
lucide-vue-next: ^0.460.0
|
||||
medium-zoom: ^1.1.0
|
||||
naive-ui: ^2.40.1
|
||||
nitropack: ^2.10.4
|
||||
@ -137,7 +137,7 @@ catalog:
|
||||
radix-vue: ^1.9.9
|
||||
resolve.exports: ^2.0.2
|
||||
rimraf: ^6.0.1
|
||||
rollup: ^4.26.0
|
||||
rollup: ^4.27.2
|
||||
rollup-plugin-visualizer: ^5.12.0
|
||||
sass: 1.80.6
|
||||
sortablejs: ^1.15.3
|
||||
@ -151,10 +151,10 @@ catalog:
|
||||
stylelint-prettier: ^5.0.2
|
||||
stylelint-scss: ^6.9.0
|
||||
tailwind-merge: ^2.5.4
|
||||
tailwindcss: ^3.4.14
|
||||
tailwindcss: ^3.4.15
|
||||
tailwindcss-animate: ^1.0.7
|
||||
theme-colors: ^0.1.0
|
||||
turbo: ^2.2.3
|
||||
turbo: ^2.3.0
|
||||
typescript: ^5.6.3
|
||||
unbuild: ^3.0.0-rc.11
|
||||
unplugin-element-plus: ^0.8.0
|
||||
@ -168,13 +168,13 @@ catalog:
|
||||
vite-plugin-vue-devtools: ^7.6.4
|
||||
vitepress: ^1.5.0
|
||||
vitepress-plugin-group-icons: ^1.3.0
|
||||
vitest: ^2.1.4
|
||||
vue: ^3.5.12
|
||||
vitest: ^2.1.5
|
||||
vue: ^3.5.13
|
||||
vue-eslint-parser: ^9.4.3
|
||||
vue-i18n: ^10.0.4
|
||||
vue-router: ^4.4.5
|
||||
vue-tsc: ^2.1.10
|
||||
vxe-pc-ui: ^4.2.53
|
||||
vxe-pc-ui: ^4.2.55
|
||||
vxe-table: ^4.8.14
|
||||
watermark-js-plus: ^1.5.7
|
||||
zod: ^3.23.8
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/turbo-run",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/vsh",
|
||||
"version": "5.4.6",
|
||||
"version": "5.4.7",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
|
Loading…
Reference in New Issue
Block a user