提交 ed422b7c 作者: Vben

fix(tree): tree can customize title close #344

上级 a759e44c
...@@ -7,14 +7,14 @@ VITE_USE_MOCK = true ...@@ -7,14 +7,14 @@ VITE_USE_MOCK = true
VITE_PUBLIC_PATH = / VITE_PUBLIC_PATH = /
# Cross-domain proxy, you can configure multiple # Cross-domain proxy, you can configure multiple
VITE_PROXY=[["/api","http://localhost:3000"],["/upload","http://localhost:3001/upload"]] VITE_PROXY=[["/basic-api","http://localhost:3000"],["/upload","http://localhost:3001/upload"]]
# VITE_PROXY=[["/api","https://vvbin.cn/test"]] # VITE_PROXY=[["/api","https://vvbin.cn/test"]]
# Delete console # Delete console
VITE_DROP_CONSOLE = false VITE_DROP_CONSOLE = false
# Basic interface address SPA # Basic interface address SPA
VITE_GLOB_API_URL=/api VITE_GLOB_API_URL=/basic-api
# File upload address, optional # File upload address, optional
VITE_GLOB_UPLOAD_URL=/upload VITE_GLOB_UPLOAD_URL=/upload
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
- 修复页面切换的动画无法关闭 - 修复页面切换的动画无法关闭
- 修复`PageWrapper`title 不显示 - 修复`PageWrapper`title 不显示
- 修复表格已知问题 - 修复表格已知问题
- 修复 BasicTree 组件不能自定义 title 问题
## 2.0.3 (2021-03-07) ## 2.0.3 (2021-03-07)
......
...@@ -44,7 +44,7 @@ const userInfo = { ...@@ -44,7 +44,7 @@ const userInfo = {
export default [ export default [
{ {
url: '/api/account/getAccountInfo', url: '/basic-api/account/getAccountInfo',
timeout: 1000, timeout: 1000,
method: 'get', method: 'get',
response: () => { response: () => {
......
...@@ -14,7 +14,7 @@ const demoList = (() => { ...@@ -14,7 +14,7 @@ const demoList = (() => {
export default [ export default [
{ {
url: '/api/select/getDemoOptions', url: '/basic-api/select/getDemoOptions',
timeout: 4000, timeout: 4000,
method: 'get', method: 'get',
response: ({ query }) => { response: ({ query }) => {
......
...@@ -107,7 +107,7 @@ const menuList = (() => { ...@@ -107,7 +107,7 @@ const menuList = (() => {
export default [ export default [
{ {
url: '/api/system/getAccountList', url: '/basic-api/system/getAccountList',
timeout: 100, timeout: 100,
method: 'get', method: 'get',
response: ({ query }) => { response: ({ query }) => {
...@@ -116,7 +116,7 @@ export default [ ...@@ -116,7 +116,7 @@ export default [
}, },
}, },
{ {
url: '/api/system/getRoleListByPage', url: '/basic-api/system/getRoleListByPage',
timeout: 100, timeout: 100,
method: 'get', method: 'get',
response: ({ query }) => { response: ({ query }) => {
...@@ -125,7 +125,7 @@ export default [ ...@@ -125,7 +125,7 @@ export default [
}, },
}, },
{ {
url: '/api/system/getAllRoleList', url: '/basic-api/system/getAllRoleList',
timeout: 100, timeout: 100,
method: 'get', method: 'get',
response: () => { response: () => {
...@@ -133,7 +133,7 @@ export default [ ...@@ -133,7 +133,7 @@ export default [
}, },
}, },
{ {
url: '/api/system/getDeptList', url: '/basic-api/system/getDeptList',
timeout: 100, timeout: 100,
method: 'get', method: 'get',
response: () => { response: () => {
...@@ -141,7 +141,7 @@ export default [ ...@@ -141,7 +141,7 @@ export default [
}, },
}, },
{ {
url: '/api/system/getMenuList', url: '/basic-api/system/getMenuList',
timeout: 100, timeout: 100,
method: 'get', method: 'get',
response: () => { response: () => {
......
...@@ -27,7 +27,7 @@ const demoList = (() => { ...@@ -27,7 +27,7 @@ const demoList = (() => {
export default [ export default [
{ {
url: '/api/table/getDemoList', url: '/basic-api/table/getDemoList',
timeout: 100, timeout: 100,
method: 'get', method: 'get',
response: ({ query }) => { response: ({ query }) => {
......
...@@ -161,7 +161,7 @@ const levelRoute = { ...@@ -161,7 +161,7 @@ const levelRoute = {
}; };
export default [ export default [
{ {
url: '/api/getMenuListById', url: '/basic-api/getMenuListById',
timeout: 1000, timeout: 1000,
method: 'get', method: 'get',
response: ({ query }) => { response: ({ query }) => {
......
...@@ -42,7 +42,7 @@ const fakeCodeList: any = { ...@@ -42,7 +42,7 @@ const fakeCodeList: any = {
export default [ export default [
// mock user login // mock user login
{ {
url: '/api/login', url: '/basic-api/login',
timeout: 200, timeout: 200,
method: 'post', method: 'post',
response: ({ body }) => { response: ({ body }) => {
...@@ -65,7 +65,7 @@ export default [ ...@@ -65,7 +65,7 @@ export default [
}, },
}, },
{ {
url: '/api/getUserInfoById', url: '/basic-api/getUserInfoById',
method: 'get', method: 'get',
response: ({ query }) => { response: ({ query }) => {
const { userId } = query; const { userId } = query;
...@@ -77,7 +77,7 @@ export default [ ...@@ -77,7 +77,7 @@ export default [
}, },
}, },
{ {
url: '/api/getPermCodeByUserId', url: '/basic-api/getPermCodeByUserId',
timeout: 200, timeout: 200,
method: 'get', method: 'get',
response: ({ query }) => { response: ({ query }) => {
......
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
"vite-plugin-style-import": "^0.8.1", "vite-plugin-style-import": "^0.8.1",
"vite-plugin-svg-icons": "^0.3.4", "vite-plugin-svg-icons": "^0.3.4",
"vite-plugin-theme": "^0.4.8", "vite-plugin-theme": "^0.4.8",
"vite-plugin-windicss": "0.7.1", "vite-plugin-windicss": "0.7.2",
"vue-eslint-parser": "^7.6.0", "vue-eslint-parser": "^7.6.0",
"yargs": "^16.2.0" "yargs": "^16.2.0"
}, },
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
:popoverVisible="getRuleVisible" :popoverVisible="getRuleVisible"
:rule="getRule" :rule="getRule"
:ruleMessage="ruleMessage" :ruleMessage="ruleMessage"
allowClear
size="small" size="small"
ref="elRef" ref="elRef"
@change="handleChange" @change="handleChange"
......
...@@ -16,11 +16,10 @@ ...@@ -16,11 +16,10 @@
import { TreeIcon } from './TreeIcon'; import { TreeIcon } from './TreeIcon';
import TreeHeader from './TreeHeader.vue'; import TreeHeader from './TreeHeader.vue';
import { ScrollContainer } from '/@/components/Container'; import { ScrollContainer } from '/@/components/Container';
// import { DownOutlined } from '@ant-design/icons-vue';
import { omit, get } from 'lodash-es'; import { omit, get } from 'lodash-es';
import { isBoolean, isFunction } from '/@/utils/is'; import { isBoolean, isFunction } from '/@/utils/is';
import { extendSlots } from '/@/utils/helper/tsxHelper'; import { extendSlots, getSlot } from '/@/utils/helper/tsxHelper';
import { filter } from '/@/utils/helper/treeHelper'; import { filter } from '/@/utils/helper/treeHelper';
import { useTree } from './useTree'; import { useTree } from './useTree';
...@@ -71,16 +70,6 @@ ...@@ -71,16 +70,6 @@
} }
); );
// const getContentStyle = computed(
// (): CSSProperties => {
// const { actionList } = props;
// const width = actionList.length * 18;
// return {
// width: `calc(100% - ${width}px)`,
// };
// }
// );
const getBindValues = computed(() => { const getBindValues = computed(() => {
let propsData = { let propsData = {
blockNode: true, blockNode: true,
...@@ -106,11 +95,6 @@ ...@@ -106,11 +95,6 @@
emit('update:value', rawVal); emit('update:value', rawVal);
}, },
onRightClick: handleRightClick, onRightClick: handleRightClick,
// onSelect: (k, e) => {
// setTimeout(() => {
// emit('select', k, e);
// }, 16);
// },
}; };
propsData = omit(propsData, 'treeData', 'class'); propsData = omit(propsData, 'treeData', 'class');
return propsData; return propsData;
...@@ -306,14 +290,17 @@ ...@@ -306,14 +290,17 @@
class={`${prefixCls}-title pl-2`} class={`${prefixCls}-title pl-2`}
onClick={handleClickNode.bind(null, item[keyField], item[childrenField])} onClick={handleClickNode.bind(null, item[keyField], item[childrenField])}
> >
{icon && <TreeIcon icon={icon} />} {slots?.title ? (
<span getSlot(slots, 'title', item)
class={`${prefixCls}__content`} ) : (
// style={unref(getContentStyle)} <>
> {icon && <TreeIcon icon={icon} />}
{get(item, titleField)} <span class={`${prefixCls}__content`}>{get(item, titleField)}</span>
</span> <span class={`${prefixCls}__actions`}>
<span class={`${prefixCls}__actions`}> {renderAction({ ...item, level })}</span> {renderAction({ ...item, level })}
</span>
</>
)}
</span> </span>
), ),
default: () => renderTreeNode({ data: children, level: level + 1 }), default: () => renderTreeNode({ data: children, level: level + 1 }),
......
...@@ -1785,10 +1785,10 @@ ...@@ -1785,10 +1785,10 @@
dependencies: dependencies:
vue-demi latest vue-demi latest
"@windicss/plugin-utils@0.7.1": "@windicss/plugin-utils@0.7.2":
version "0.7.1" version "0.7.2"
resolved "https://registry.npmjs.org/@windicss/plugin-utils/-/plugin-utils-0.7.1.tgz#001ba282b78a9d4e110e531d59309d2b9cb0929e" resolved "https://registry.npmjs.org/@windicss/plugin-utils/-/plugin-utils-0.7.2.tgz#c43c89a2f51110eb6f49da565dc235fb2af30269"
integrity sha512-ZloIRRKCnArFyDNuhZiFRA15XqhlWaeTcOf3soP9VxWJ+i6/IkH6cnaYgBefDATA/zJodOPsXBnbX333zKVk1Q== integrity sha512-4znRERKhhStIOFy1/eB0rJXnXs+NyumBREjh0GZVMoHVmUB9up08tNUpbbq3tlJC96t27VsD4vdfv00T+It/IA==
dependencies: dependencies:
esbuild "^0.8.57" esbuild "^0.8.57"
esbuild-register "^2.2.0" esbuild-register "^2.2.0"
...@@ -9183,12 +9183,12 @@ vite-plugin-theme@^0.4.8: ...@@ -9183,12 +9183,12 @@ vite-plugin-theme@^0.4.8:
es-module-lexer "^0.3.26" es-module-lexer "^0.3.26"
tinycolor2 "^1.4.2" tinycolor2 "^1.4.2"
vite-plugin-windicss@0.7.1: vite-plugin-windicss@0.7.2:
version "0.7.1" version "0.7.2"
resolved "https://registry.npmjs.org/vite-plugin-windicss/-/vite-plugin-windicss-0.7.1.tgz#1e1c41c2f62d18a2777819057c981a1ec26d8901" resolved "https://registry.npmjs.org/vite-plugin-windicss/-/vite-plugin-windicss-0.7.2.tgz#1647ee3765edb0f993b81206f35310a63b25c1f9"
integrity sha512-0NNrTBgjx11KOwqS/4szfVIt3LURFor4cEEVVJjB8p7JDTnC4K8Cu11bcAvY+QMOfflxv4s2ONo2SU4xkq68kA== integrity sha512-U6N8ljy7meqLkq8aENb3VXKr93Vzp1pU5zwhJr7HmGi+42Wv4i8r7+7BW6WRS4Ght4SAMzFuzIGq9RLPzoZ2Jg==
dependencies: dependencies:
"@windicss/plugin-utils" "0.7.1" "@windicss/plugin-utils" "0.7.2"
windicss "^2.3.0" windicss "^2.3.0"
vite@^2.0.5: vite@^2.0.5:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论