Compare commits

...

13 Commits
v2.8.0 ... main

Author SHA1 Message Date
nsk 3b3f6c903a
fix: some mistakes close #1349, close #1250 close#1245 (#1373)
* fix(Loading): add theme prop, The repair background prop does not take effect

* fix(AppLogo): fix title line height

* fix(Table,Upload): fix #1349 #1250 #1245
2021-11-15 18:59:28 +08:00
Coderclc b3c4002b69
fix: Fix setting hideMenu, bread bar jump problem (#1358) 2021-11-15 09:32:14 +08:00
handsomeFu 7e00488635
chore: Update extensions.json (#1359)
Use volar instead of vetur
2021-11-15 09:32:01 +08:00
vben 090d844014 fix: type, #1347 2021-11-11 22:28:39 +08:00
CXM 013cb7f16b
fix: fix base64 blob (#1356)
* fix(type): fix ant-design-vue  ->

* fix: fix base64 blob
2021-11-11 22:18:22 +08:00
vben c2b207dd51 fix: Fix stylelint does not support html files 2021-11-10 23:24:39 +08:00
vben 83921284a6 chore: update deps 2021-11-10 21:49:41 +08:00
HUCHAOQI 59b309aa7e
fix(table): 使用lodash 的merge来递归assign,优化在多对象嵌套情况下的结构 (#1350) 2021-11-10 21:45:33 +08:00
liweijie0812 49c890ebec
fix: Form appendSchemaByField移除hasInList判断 (#1341) 2021-11-09 09:36:10 +08:00
Joyboo c8dd3b6c14
TableAction确认框增加placement属性 (#1335)
* chore: table size放到settings

* chore(TableAction): 操作确认框增加placement属性支持
2021-11-08 09:24:53 +08:00
1sm 9999650a9a
package.json yarn -> pnpm (#1336)
* fix(modal): 取消全屏功能后关闭图标颜色异常

* chore: move to pnpm

Co-authored-by: liushiman <smliu@gk-estor.com>
2021-11-08 09:24:22 +08:00
miofly b5364fe546
chore:add rules (#1340) 2021-11-08 09:24:00 +08:00
vben 74b0dfd54f chore: update pkg 2021-11-03 00:38:24 +08:00
25 changed files with 434 additions and 416 deletions

View File

@ -74,5 +74,6 @@ module.exports = defineConfig({
math: 'always',
},
],
'vue/multi-word-component-names': 'off'
},
});

View File

@ -2,5 +2,5 @@ ports:
- port: 3344
onOpen: open-preview
tasks:
- init: yarn
command: yarn dev
- init: pnpm install
command: pnpm run dev

View File

@ -1,8 +0,0 @@
module.exports = {
'*.{js,jsx,ts,tsx}': ['eslint --fix', 'prettier --write'],
'{!(package)*.json,*.code-snippets,.!(browserslist)*rc}': ['prettier --write--parser json'],
'package.json': ['prettier --write'],
'*.vue': ['eslint --fix', 'prettier --write', 'stylelint --fix'],
'*.{scss,less,styl,html}': ['stylelint --fix', 'prettier --write'],
'*.md': ['prettier --write'],
};

View File

@ -1,6 +1,6 @@
{
"recommendations": [
"octref.vetur",
"johnsoncodehk.volar",
"dbaeumer.vscode-eslint",
"stylelint.vscode-stylelint",
"esbenp.prettier-vscode",

View File

@ -137,6 +137,7 @@
"lintstagedrc",
"brotli",
"tailwindcss",
"sider"
"sider",
"pnpm"
]
}

View File

@ -1,48 +0,0 @@
# test directories
__tests__
test
tests
powered-test
# asset directories
docs
doc
website
images
assets
# examples
example
examples
# code coverage directories
coverage
.nyc_output
# build scripts
Makefile
Gulpfile.js
Gruntfile.js
# configs
appveyor.yml
circle.yml
codeship-services.yml
codeship-steps.yml
wercker.yml
.tern-project
.gitattributes
.editorconfig
.*ignore
.eslintrc
.jshintrc
.flowconfig
.documentup.json
.yarn-metadata.json
.travis.yml
# misc
*.md
!istanbul-reports/lib/html/assets
!istanbul-api/node_modules/istanbul-reports/lib/html/assets

View File

@ -1,4 +1,4 @@
## [2.7.2](https://github.com/anncwb/vue-vben-admin/compare/v2.7.1...v2.7.2) (2021-09-13)
## [2.8.0](https://github.com/anncwb/vue-vben-admin/compare/v2.7.2...v2.8.0) (2021-11-03)
### Bug Fixes

View File

@ -70,20 +70,20 @@ git clone https://github.com/anncwb/vue-vben-admin.git
```bash
cd vue-vben-admin
yarn install
pnpm install
```
- run
```bash
yarn serve
pnpm serve
```
- build
```bash
yarn build
pnpm build
```
## Change Log

View File

@ -70,20 +70,20 @@ git clone https://github.com/anncwb/vue-vben-admin.git
```bash
cd vue-vben-admin
yarn install
pnpm install
```
- 运行
```bash
yarn serve
pnpm serve
```
- 打包
```bash
yarn build
pnpm build
```
## 更新日志

View File

@ -8,7 +8,6 @@
name="viewport"
content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0"
/>
<title><%= title %></title>
<link rel="icon" href="/favicon.ico" />
</head>
@ -30,7 +29,7 @@
}
html[data-theme='dark'] .app-loading .app-loading-title {
color: rgba(255, 255, 255, 0.85);
color: rgb(255 255 255 / 85%);
}
.app-loading {
@ -48,7 +47,6 @@
top: 50%;
left: 50%;
display: flex;
-webkit-transform: translate3d(-50%, -50%, 0);
transform: translate3d(-50%, -50%, 0);
justify-content: center;
align-items: center;
@ -66,7 +64,7 @@
display: flex;
margin-top: 30px;
font-size: 30px;
color: rgba(0, 0, 0, 0.85);
color: rgb(0 0 0 / 85%);
justify-content: center;
align-items: center;
}
@ -97,7 +95,7 @@
height: 20px;
background-color: #0065cc;
border-radius: 100%;
opacity: 0.3;
opacity: 30%;
transform: scale(0.75);
animation: antSpinMove 1s infinite linear alternate;
transform-origin: 50% 50%;
@ -111,43 +109,38 @@
.dot i:nth-child(2) {
top: 0;
right: 0;
-webkit-animation-delay: 0.4s;
animation-delay: 0.4s;
}
.dot i:nth-child(3) {
right: 0;
bottom: 0;
-webkit-animation-delay: 0.8s;
animation-delay: 0.8s;
}
.dot i:nth-child(4) {
bottom: 0;
left: 0;
-webkit-animation-delay: 1.2s;
animation-delay: 1.2s;
}
@keyframes antRotate {
to {
-webkit-transform: rotate(405deg);
transform: rotate(405deg);
}
}
@-webkit-keyframes antRotate {
@keyframes antRotate {
to {
-webkit-transform: rotate(405deg);
transform: rotate(405deg);
}
}
@keyframes antSpinMove {
to {
opacity: 1;
opacity: 100%;
}
}
@-webkit-keyframes antSpinMove {
@keyframes antSpinMove {
to {
opacity: 1;
opacity: 100%;
}
}
</style>

View File

@ -1,18 +1,18 @@
{
"name": "vben-admin",
"version": "2.7.2",
"version": "2.8.0",
"author": {
"name": "vben",
"email": "anncwb@126.com",
"url": "https://github.com/anncwb"
},
"scripts": {
"bootstrap": "yarn install",
"bootstrap": "pnpm install",
"serve": "npm run dev",
"dev": "vite",
"build": "cross-env NODE_ENV=production vite build && esno ./build/script/postBuild.ts",
"build:test": "cross-env vite build --mode test && esno ./build/script/postBuild.ts",
"build:no-cache": "yarn clean:cache && npm run build",
"build:no-cache": "pnpm clean:cache && npm run build",
"report": "cross-env REPORT=true npm run build",
"type:check": "vue-tsc --noEmit --skipLibCheck",
"preview": "npm run build && vite preview",
@ -23,12 +23,12 @@
"lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock}/**/*.{vue,ts,tsx}\" --fix",
"lint:prettier": "prettier --write \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"",
"lint:stylelint": "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",
"lint:lint-staged": "lint-staged -c ./.husky/lintstagedrc.js",
"lint:lint-staged": "lint-staged",
"test:unit": "jest",
"test:unit-coverage": "jest --coverage",
"test:gzip": "npx http-server dist --cors --gzip -c-1",
"test:br": "npx http-server dist --cors --brotli -c-1",
"reinstall": "rimraf yarn.lock && rimraf package.lock.json && rimraf node_modules && npm run bootstrap",
"reinstall": "rimraf pnpm-lock.yaml && rimraf package.lock.json && rimraf node_modules && npm run bootstrap",
"prepare": "husky install",
"gen:icon": "esno ./build/generate/icon/index.ts"
},
@ -36,35 +36,35 @@
"@ant-design/colors": "^6.0.0",
"@ant-design/icons-vue": "^6.0.1",
"@iconify/iconify": "^2.0.4",
"@logicflow/core": "^0.7.2",
"@logicflow/extension": "^0.7.2",
"@vueuse/core": "^6.7.4",
"@vueuse/shared": "^6.7.4",
"@zxcvbn-ts/core": "^1.0.0-beta.0",
"@logicflow/core": "^0.7.5",
"@logicflow/extension": "^0.7.5",
"@vueuse/core": "^6.8.0",
"@vueuse/shared": "^6.8.0",
"@zxcvbn-ts/core": "^1.0.0",
"ant-design-vue": "2.2.8",
"axios": "^0.24.0",
"codemirror": "^5.63.3",
"cropperjs": "^1.5.12",
"crypto-js": "^4.1.1",
"echarts": "^5.2.2",
"intro.js": "^4.2.2",
"intro.js": "^4.3.0",
"lodash-es": "^4.17.21",
"mockjs": "^1.1.0",
"moment": "^2.29.1",
"nprogress": "^0.2.0",
"path-to-regexp": "^6.2.0",
"pinia": "2.0.0",
"pinia": "2.0.2",
"print-js": "^1.6.0",
"qrcode": "^1.4.4",
"qs": "^6.10.1",
"resize-observer-polyfill": "^1.5.1",
"showdown": "^1.9.1",
"sortablejs": "^1.14.0",
"tinymce": "^5.10.0",
"tinymce": "^5.10.1",
"vditor": "^3.8.7",
"vue": "^3.2.21",
"vue-i18n": "^9.1.9",
"vue-json-pretty": "^2.0.4",
"vue-json-pretty": "^2.0.5",
"vue-router": "^4.0.12",
"vue-types": "^4.1.1",
"xlsx": "^0.17.3"
@ -72,7 +72,7 @@
"devDependencies": {
"@commitlint/cli": "^14.1.0",
"@commitlint/config-conventional": "^14.1.0",
"@iconify/json": "^1.1.422",
"@iconify/json": "^1.1.426",
"@purge-icons/generated": "^0.7.0",
"@types/codemirror": "^5.60.5",
"@types/crypto-js": "^4.0.2",
@ -82,14 +82,14 @@
"@types/jest": "^27.0.2",
"@types/lodash-es": "^4.17.5",
"@types/mockjs": "^1.0.4",
"@types/node": "^16.11.6",
"@types/node": "^16.11.7",
"@types/nprogress": "^0.2.0",
"@types/qrcode": "^1.4.1",
"@types/qs": "^6.9.7",
"@types/showdown": "^1.9.4",
"@types/sortablejs": "^1.10.7",
"@typescript-eslint/eslint-plugin": "^5.3.0",
"@typescript-eslint/parser": "^5.3.0",
"@typescript-eslint/eslint-plugin": "^5.3.1",
"@typescript-eslint/parser": "^5.3.1",
"@vitejs/plugin-legacy": "^1.6.2",
"@vitejs/plugin-vue": "^1.9.4",
"@vitejs/plugin-vue-jsx": "^1.2.0",
@ -100,13 +100,13 @@
"conventional-changelog-cli": "^2.1.1",
"cross-env": "^7.0.3",
"dotenv": "^10.0.0",
"eslint": "^8.1.0",
"eslint": "^8.2.0",
"eslint-config-prettier": "^8.3.0",
"eslint-define-config": "^1.1.2",
"eslint-plugin-jest": "^25.2.2",
"eslint-define-config": "^1.1.3",
"eslint-plugin-jest": "^25.2.4",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^8.0.3",
"esno": "^0.10.1",
"esno": "^0.12.0",
"fs-extra": "^10.0.0",
"husky": "^7.0.4",
"inquirer": "^8.2.0",
@ -128,7 +128,7 @@
"ts-jest": "^27.0.7",
"ts-node": "^10.4.0",
"typescript": "^4.4.4",
"vite": "^2.6.13",
"vite": "^2.6.14",
"vite-plugin-compression": "^0.3.5",
"vite-plugin-html": "^2.1.1",
"vite-plugin-imagemin": "^0.4.6",
@ -139,9 +139,9 @@
"vite-plugin-svg-icons": "^1.0.5",
"vite-plugin-theme": "^0.8.1",
"vite-plugin-vue-setup-extend": "^0.1.0",
"vite-plugin-windicss": "^1.4.12",
"vite-plugin-windicss": "^1.5.1",
"vue-eslint-parser": "^8.0.1",
"vue-tsc": "^0.28.10"
"vue-tsc": "^0.29.3"
},
"resolutions": {
"//": "Used to install imagemin dependencies, because imagemin may not be installed in China. If it is abroad, you can delete it",
@ -159,5 +159,29 @@
"homepage": "https://github.com/anncwb/vue-vben-admin",
"engines": {
"node": "^12 || >=14"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --fix",
"prettier --write"
],
"{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": [
"prettier --write--parser json"
],
"package.json": [
"prettier --write"
],
"*.vue": [
"eslint --fix",
"prettier --write",
"stylelint --fix"
],
"*.{scss,less,styl,html}": [
"stylelint --fix",
"prettier --write"
],
"*.md": [
"prettier --write"
]
}
}

File diff suppressed because it is too large Load Diff

View File

@ -125,9 +125,6 @@ export function useFormEvents({
const schemaList: FormSchema[] = cloneDeep(unref(getSchema));
const index = schemaList.findIndex((schema) => schema.field === prefixField);
const hasInList = schemaList.some((item) => item.field === prefixField || schema.field);
if (!hasInList) return;
if (!prefixField || index === -1 || first) {
first ? schemaList.unshift(schema) : schemaList.push(schema);

View File

@ -43,7 +43,7 @@
<CheckboxGroup v-model:value="checkedList" @change="onChange" ref="columnListRef">
<template v-for="item in plainOptions" :key="item.value">
<div :class="`${prefixCls}__check-item`" v-if="!('ifShow' in item && !item.ifShow)">
<DragOutlined class="table-coulmn-drag-icon" />
<DragOutlined class="table-column-drag-icon" />
<Checkbox :value="item.value">
{{ item.label }}
</Checkbox>
@ -120,7 +120,7 @@
import { useSortable } from '/@/hooks/web/useSortable';
import { isFunction, isNullAndUnDef } from '/@/utils/is';
import { getPopupContainer as getParentContainer } from '/@/utils';
import { omit } from 'lodash-es';
import { cloneDeep, omit } from 'lodash-es';
interface State {
checkAll: boolean;
@ -250,16 +250,15 @@
const indeterminate = computed(() => {
const len = plainOptions.value.length;
let checkdedLen = state.checkedList.length;
unref(checkIndex) && checkdedLen--;
return checkdedLen > 0 && checkdedLen < len;
let checkedLen = state.checkedList.length;
unref(checkIndex) && checkedLen--;
return checkedLen > 0 && checkedLen < len;
});
// Trigger when check/uncheck a column
function onChange(checkedList: string[]) {
const len = plainOptions.value.length;
const len = plainSortOptions.value.length;
state.checkAll = checkedList.length === len;
const sortList = unref(plainSortOptions).map((item) => item.value);
checkedList.sort((prev, next) => {
return sortList.indexOf(prev) - sortList.indexOf(next);
@ -286,14 +285,14 @@
if (!el) return;
// Drag and drop sort
const { initSortable } = useSortable(el, {
handle: '.table-coulmn-drag-icon ',
handle: '.table-column-drag-icon',
onEnd: (evt) => {
const { oldIndex, newIndex } = evt;
if (isNullAndUnDef(oldIndex) || isNullAndUnDef(newIndex) || oldIndex === newIndex) {
return;
}
// Sort column
const columns = getColumns();
const columns = cloneDeep(plainSortOptions.value);
if (oldIndex > newIndex) {
columns.splice(newIndex, 0, columns[oldIndex]);
@ -304,7 +303,6 @@
}
plainSortOptions.value = columns;
plainOptions.value = columns;
setColumns(columns);
},
});
@ -347,7 +345,7 @@
function setColumns(columns: BasicColumn[] | string[]) {
table.setColumns(columns);
const data: ColumnChangeParam[] = unref(plainOptions).map((col) => {
const data: ColumnChangeParam[] = unref(plainSortOptions).map((col) => {
const visible =
columns.findIndex(
(c: BasicColumn | string) =>
@ -390,7 +388,7 @@
<style lang="less">
@prefix-cls: ~'@{namespace}-basic-column-setting';
.table-coulmn-drag-icon {
.table-column-drag-icon {
margin: 0 5px;
cursor: move;
}

View File

@ -216,25 +216,17 @@ export function useColumns(
const columnKeys = columns as string[];
const newColumns: BasicColumn[] = [];
cacheColumns.forEach((item) => {
if (columnKeys.includes(item.dataIndex! || (item.key as string))) {
newColumns.push({
...item,
defaultHidden: false,
});
} else {
newColumns.push({
...item,
defaultHidden: true,
});
}
newColumns.push({
...item,
defaultHidden: !columnKeys.includes(item.dataIndex! || (item.key as string)),
});
});
// Sort according to another array
if (!isEqual(cacheKeys, columns)) {
newColumns.sort((prev, next) => {
return (
cacheKeys.indexOf(prev.dataIndex as string) -
cacheKeys.indexOf(next.dataIndex as string)
columnKeys.indexOf(prev.dataIndex as string) -
columnKeys.indexOf(next.dataIndex as string)
);
});
}

View File

@ -14,7 +14,7 @@ import {
import { useTimeoutFn } from '/@/hooks/core/useTimeout';
import { buildUUID } from '/@/utils/uuid';
import { isFunction, isBoolean } from '/@/utils/is';
import { get, cloneDeep } from 'lodash-es';
import { get, cloneDeep, merge } from 'lodash-es';
import { FETCH_SETTING, ROW_KEY, PAGE_SIZE } from '../const';
interface ActionType {
@ -272,17 +272,17 @@ export function useDataSource(
const { sortInfo = {}, filterInfo } = searchState;
let params: Recordable = {
...pageParams,
...(useSearchForm ? getFieldsValue() : {}),
...searchInfo,
...(opt?.searchInfo ?? {}),
...defSort,
...sortInfo,
...filterInfo,
...(opt?.sortInfo ?? {}),
...(opt?.filterInfo ?? {}),
};
let params: Recordable = merge(
pageParams,
useSearchForm ? getFieldsValue() : {},
searchInfo,
opt?.searchInfo ?? {},
defSort,
sortInfo,
filterInfo,
opt?.sortInfo ?? {},
opt?.filterInfo ?? {},
);
if (beforeFetch && isFunction(beforeFetch)) {
params = (await beforeFetch(params)) || params;
}

View File

@ -23,4 +23,17 @@ export interface PopConfirm {
confirm: Fn;
cancel?: Fn;
icon?: string;
placement?:
| 'top'
| 'left'
| 'right'
| 'bottom'
| 'topLeft'
| 'topRight'
| 'leftTop'
| 'leftBottom'
| 'rightTop'
| 'rightBottom'
| 'bottomLeft'
| 'bottomRight';
}

View File

@ -54,7 +54,7 @@
import { basicProps } from './props';
import { createTableColumns, createActionColumn } from './data';
// utils
import { checkFileType, checkImgType, getBase64WithFile } from './helper';
import { checkImgType, getBase64WithFile } from './helper';
import { buildUUID } from '/@/utils/uuid';
import { isFunction } from '/@/utils/is';
import { warn } from '/@/utils/log';
@ -84,7 +84,7 @@
const { t } = useI18n();
const [register, { closeModal }] = useModalInner();
const { getAccept, getStringAccept, getHelpText } = useUploadType({
const { getStringAccept, getHelpText } = useUploadType({
acceptRef: accept,
helpTextRef: helpText,
maxNumberRef: maxNumber,
@ -124,18 +124,12 @@
function beforeUpload(file: File) {
const { size, name } = file;
const { maxSize } = props;
const accept = unref(getAccept);
//
if (maxSize && file.size / 1024 / 1024 >= maxSize) {
createMessage.error(t('component.upload.maxSizeMultiple', [maxSize]));
return false;
}
// ,
if (accept.length > 0 && !checkFileType(file, accept)) {
createMessage.error!(t('component.upload.acceptUpload', [accept.join(',')]));
return false;
}
const commonItem = {
uuid: buildUUID(),
file,

View File

@ -101,8 +101,8 @@
if (!meta) {
return !!name;
}
const { title, hideBreadcrumb } = meta;
if (!title || hideBreadcrumb) {
const { title, hideBreadcrumb, hideMenu } = meta;
if (!title || hideBreadcrumb || hideMenu) {
return false;
}
return true;

View File

@ -4,7 +4,7 @@
import moment from 'moment';
const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss';
const DATE_FORMAT = 'YYYY-MM-DD ';
const DATE_FORMAT = 'YYYY-MM-DD';
export function formatToDateTime(
date: moment.MomentInput = undefined,

View File

@ -5,7 +5,7 @@ export function dataURLtoBlob(base64Buf: string): Blob {
const arr = base64Buf.split(',');
const typeItem = arr[0];
const mime = typeItem.match(/:(.*?);/)![1];
const bstr = atob(arr[1]);
const bstr = window.atob(arr[1]);
let n = bstr.length;
const u8arr = new Uint8Array(n);
while (n--) {

View File

@ -71,9 +71,10 @@ module.exports = {
ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts'],
overrides: [
{
files: ['*.vue', '**/*.vue'],
files: ['*.vue', '**/*.vue', '*.html', '**/*.html'],
extends: ['stylelint-config-recommended', 'stylelint-config-html'],
rules: {
'keyframes-name-pattern': null,
'selector-pseudo-class-no-unknown': [
true,
{

View File

@ -8,8 +8,8 @@ It is used to start the test interface service, which can test the upload, webso
cd ./test/server
yarn
pnpm install
yarn start
pnpm run start
```

View File

@ -24,13 +24,13 @@
"@types/koa": "^2.13.4",
"@types/koa-bodyparser": "^5.0.2",
"@types/koa-router": "^7.4.4",
"@types/node": "^16.11.6",
"nodemon": "^2.0.14",
"@types/node": "^16.11.7",
"nodemon": "^2.0.15",
"pm2": "^5.1.2",
"rimraf": "^3.0.2",
"ts-node": "^10.4.0",
"tsconfig-paths": "^3.11.0",
"tsup": "^5.5.0",
"tsup": "^5.6.0",
"typescript": "^4.4.4"
}
}

View File

@ -27,7 +27,7 @@ export default defineConfig({
* Used for animation when the element is displayed
* @param maxOutput The larger the maxOutput output, the larger the generated css volume
*/
function createEnterPlugin(maxOutput = 7) {
function createEnterPlugin(maxOutput = 6) {
const createCss = (index: number, d = 'x') => {
const upd = d.toUpperCase();
return {