fix(tree-select): replaceFields to fieldNames,close #1423

This commit is contained in:
vben 2021-12-01 22:20:58 +08:00
parent cfda62ef9c
commit 170a4bceb1
11 changed files with 1049 additions and 2004 deletions

View File

@ -36,10 +36,8 @@
"@ant-design/colors": "^6.0.0",
"@ant-design/icons-vue": "^6.0.1",
"@iconify/iconify": "^2.1.0",
"@logicflow/core": "^0.7.10",
"@logicflow/extension": "^0.7.10",
"@vue/runtime-core": "^3.2.23",
"@vue/shared": "^3.2.23",
"@logicflow/core": "^0.7.11",
"@logicflow/extension": "^0.7.11",
"@vueuse/core": "^7.1.2",
"@vueuse/shared": "^7.1.2",
"@zxcvbn-ts/core": "^1.0.0",
@ -74,7 +72,7 @@
"devDependencies": {
"@commitlint/cli": "^15.0.0",
"@commitlint/config-conventional": "^15.0.0",
"@iconify/json": "^2.0.3",
"@iconify/json": "^2.0.4",
"@purge-icons/generated": "^0.7.0",
"@types/codemirror": "^5.60.5",
"@types/crypto-js": "^4.0.2",
@ -84,14 +82,14 @@
"@types/jest": "^27.0.3",
"@types/lodash-es": "^4.17.5",
"@types/mockjs": "^1.0.4",
"@types/node": "^16.11.10",
"@types/node": "^16.11.11",
"@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.4.0",
"@typescript-eslint/parser": "^5.4.0",
"@typescript-eslint/eslint-plugin": "^5.5.0",
"@typescript-eslint/parser": "^5.5.0",
"@vitejs/plugin-legacy": "^1.6.3",
"@vitejs/plugin-vue": "^1.10.1",
"@vitejs/plugin-vue-jsx": "^1.3.0",
@ -112,7 +110,7 @@
"fs-extra": "^10.0.0",
"husky": "^7.0.4",
"inquirer": "^8.2.0",
"jest": "^27.4.0",
"jest": "^27.4.2",
"less": "^4.1.2",
"lint-staged": "12.1.2",
"npm-run-all": "^4.1.5",
@ -137,14 +135,14 @@
"vite-plugin-imagemin": "^0.4.6",
"vite-plugin-mock": "^2.9.6",
"vite-plugin-purge-icons": "^0.7.0",
"vite-plugin-pwa": "^0.11.8",
"vite-plugin-pwa": "^0.11.9",
"vite-plugin-style-import": "^1.4.0",
"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.5.3",
"vue-eslint-parser": "^8.0.1",
"vue-tsc": "^0.29.7"
"vue-tsc": "^0.29.8"
},
"resolutions": {
"//": "Used to install imagemin dependencies, because imagemin may not be installed in China. If it is abroad, you can delete it",

File diff suppressed because it is too large Load Diff

View File

@ -115,7 +115,7 @@ export const treeProps = buildProps({
// 自定义数据过滤判断方法(注: 不是整个过滤方法而是内置过滤的判断方法用于增强原本仅能通过title进行过滤的方式)
filterFn: {
type: Function as PropType<
(searchValue: any, node: TreeItem, replaceFields: FieldNames) => boolean
(searchValue: any, node: TreeItem, fieldNames: FieldNames) => boolean
>,
default: undefined,
},

View File

@ -1,6 +1,6 @@
import '/@/design/index.less';
import 'virtual:windi-base.css';
import 'virtual:windi-components.css';
import '/@/design/index.less';
import 'virtual:windi-utilities.css';
// Register icon sprite
import 'virtual:svg-icons-register';

View File

@ -1,12 +1,12 @@
<template>
<div class="bg-white m-4 mr-0 overflow-hidden">
<div class="m-4 mr-0 overflow-hidden bg-white">
<BasicTree
title="部门列表"
toolbar
search
:clickRowToExpand="false"
:treeData="treeData"
:replaceFields="{ key: 'id', title: 'deptName' }"
:fieldNames="{ key: 'id', label: 'deptName' }"
@select="handleSelect"
/>
</div>

View File

@ -96,8 +96,8 @@ export const accountFormSchema: FormSchema[] = [
label: '所属部门',
component: 'TreeSelect',
componentProps: {
replaceFields: {
title: 'deptName',
fieldNames: {
label: 'deptName',
key: 'id',
value: 'id',
},

View File

@ -72,8 +72,8 @@ export const formSchema: FormSchema[] = [
component: 'TreeSelect',
componentProps: {
replaceFields: {
title: 'deptName',
fieldNames: {
label: 'deptName',
key: 'id',
value: 'id',
},

View File

@ -104,8 +104,8 @@ export const formSchema: FormSchema[] = [
label: '上级菜单',
component: 'TreeSelect',
componentProps: {
replaceFields: {
title: 'menuName',
fieldNames: {
label: 'menuName',
key: 'id',
value: 'id',
},

View File

@ -12,7 +12,7 @@
<BasicTree
v-model:value="model[field]"
:treeData="treeData"
:replaceFields="{ title: 'menuName', key: 'id' }"
:fieldNames="{ label: 'menuName', key: 'id' }"
checkable
toolbar
title="菜单分配"

View File

@ -24,7 +24,7 @@
"@types/koa": "^2.13.4",
"@types/koa-bodyparser": "^5.0.2",
"@types/koa-router": "^7.4.4",
"@types/node": "^16.11.10",
"@types/node": "^16.11.11",
"nodemon": "^2.0.15",
"pm2": "^5.1.2",
"rimraf": "^3.0.2",

View File

@ -95,7 +95,6 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
optimizeDeps: {
// @iconify/iconify: The dependency is dynamically and virtually loaded by @purge-icons/generated, so it needs to be specified explicitly
include: [
'@vue/shared',
'@iconify/iconify',
'ant-design-vue/es/locale/zh_CN',
'ant-design-vue/es/locale/en_US',