Commit ed422b7c56bf9d44be001b8a54358d69c100ff35
1 parent
a759e44c
fix(tree): tree can customize title close #344
Showing
12 changed files
with
38 additions
and
49 deletions
.env.development
... | ... | @@ -7,14 +7,14 @@ VITE_USE_MOCK = true |
7 | 7 | VITE_PUBLIC_PATH = / |
8 | 8 | |
9 | 9 | # Cross-domain proxy, you can configure multiple |
10 | -VITE_PROXY=[["/api","http://localhost:3000"],["/upload","http://localhost:3001/upload"]] | |
10 | +VITE_PROXY=[["/basic-api","http://localhost:3000"],["/upload","http://localhost:3001/upload"]] | |
11 | 11 | # VITE_PROXY=[["/api","https://vvbin.cn/test"]] |
12 | 12 | |
13 | 13 | # Delete console |
14 | 14 | VITE_DROP_CONSOLE = false |
15 | 15 | |
16 | 16 | # Basic interface address SPA |
17 | -VITE_GLOB_API_URL=/api | |
17 | +VITE_GLOB_API_URL=/basic-api | |
18 | 18 | |
19 | 19 | # File upload address, optional |
20 | 20 | VITE_GLOB_UPLOAD_URL=/upload | ... | ... |
CHANGELOG.zh_CN.md
mock/demo/account.ts
mock/demo/select-demo.ts
mock/demo/system.ts
... | ... | @@ -107,7 +107,7 @@ const menuList = (() => { |
107 | 107 | |
108 | 108 | export default [ |
109 | 109 | { |
110 | - url: '/api/system/getAccountList', | |
110 | + url: '/basic-api/system/getAccountList', | |
111 | 111 | timeout: 100, |
112 | 112 | method: 'get', |
113 | 113 | response: ({ query }) => { |
... | ... | @@ -116,7 +116,7 @@ export default [ |
116 | 116 | }, |
117 | 117 | }, |
118 | 118 | { |
119 | - url: '/api/system/getRoleListByPage', | |
119 | + url: '/basic-api/system/getRoleListByPage', | |
120 | 120 | timeout: 100, |
121 | 121 | method: 'get', |
122 | 122 | response: ({ query }) => { |
... | ... | @@ -125,7 +125,7 @@ export default [ |
125 | 125 | }, |
126 | 126 | }, |
127 | 127 | { |
128 | - url: '/api/system/getAllRoleList', | |
128 | + url: '/basic-api/system/getAllRoleList', | |
129 | 129 | timeout: 100, |
130 | 130 | method: 'get', |
131 | 131 | response: () => { |
... | ... | @@ -133,7 +133,7 @@ export default [ |
133 | 133 | }, |
134 | 134 | }, |
135 | 135 | { |
136 | - url: '/api/system/getDeptList', | |
136 | + url: '/basic-api/system/getDeptList', | |
137 | 137 | timeout: 100, |
138 | 138 | method: 'get', |
139 | 139 | response: () => { |
... | ... | @@ -141,7 +141,7 @@ export default [ |
141 | 141 | }, |
142 | 142 | }, |
143 | 143 | { |
144 | - url: '/api/system/getMenuList', | |
144 | + url: '/basic-api/system/getMenuList', | |
145 | 145 | timeout: 100, |
146 | 146 | method: 'get', |
147 | 147 | response: () => { | ... | ... |
mock/demo/table-demo.ts
mock/sys/menu.ts
mock/sys/user.ts
... | ... | @@ -42,7 +42,7 @@ const fakeCodeList: any = { |
42 | 42 | export default [ |
43 | 43 | // mock user login |
44 | 44 | { |
45 | - url: '/api/login', | |
45 | + url: '/basic-api/login', | |
46 | 46 | timeout: 200, |
47 | 47 | method: 'post', |
48 | 48 | response: ({ body }) => { |
... | ... | @@ -65,7 +65,7 @@ export default [ |
65 | 65 | }, |
66 | 66 | }, |
67 | 67 | { |
68 | - url: '/api/getUserInfoById', | |
68 | + url: '/basic-api/getUserInfoById', | |
69 | 69 | method: 'get', |
70 | 70 | response: ({ query }) => { |
71 | 71 | const { userId } = query; |
... | ... | @@ -77,7 +77,7 @@ export default [ |
77 | 77 | }, |
78 | 78 | }, |
79 | 79 | { |
80 | - url: '/api/getPermCodeByUserId', | |
80 | + url: '/basic-api/getPermCodeByUserId', | |
81 | 81 | timeout: 200, |
82 | 82 | method: 'get', |
83 | 83 | response: ({ query }) => { | ... | ... |
package.json
... | ... | @@ -112,7 +112,7 @@ |
112 | 112 | "vite-plugin-style-import": "^0.8.1", |
113 | 113 | "vite-plugin-svg-icons": "^0.3.4", |
114 | 114 | "vite-plugin-theme": "^0.4.8", |
115 | - "vite-plugin-windicss": "0.7.1", | |
115 | + "vite-plugin-windicss": "0.7.2", | |
116 | 116 | "vue-eslint-parser": "^7.6.0", |
117 | 117 | "yargs": "^16.2.0" |
118 | 118 | }, | ... | ... |
src/components/Table/src/components/editable/EditableCell.vue
src/components/Tree/src/index.vue
... | ... | @@ -16,11 +16,10 @@ |
16 | 16 | import { TreeIcon } from './TreeIcon'; |
17 | 17 | import TreeHeader from './TreeHeader.vue'; |
18 | 18 | import { ScrollContainer } from '/@/components/Container'; |
19 | - // import { DownOutlined } from '@ant-design/icons-vue'; | |
20 | 19 | |
21 | 20 | import { omit, get } from 'lodash-es'; |
22 | 21 | import { isBoolean, isFunction } from '/@/utils/is'; |
23 | - import { extendSlots } from '/@/utils/helper/tsxHelper'; | |
22 | + import { extendSlots, getSlot } from '/@/utils/helper/tsxHelper'; | |
24 | 23 | import { filter } from '/@/utils/helper/treeHelper'; |
25 | 24 | |
26 | 25 | import { useTree } from './useTree'; |
... | ... | @@ -71,16 +70,6 @@ |
71 | 70 | } |
72 | 71 | ); |
73 | 72 | |
74 | - // const getContentStyle = computed( | |
75 | - // (): CSSProperties => { | |
76 | - // const { actionList } = props; | |
77 | - // const width = actionList.length * 18; | |
78 | - // return { | |
79 | - // width: `calc(100% - ${width}px)`, | |
80 | - // }; | |
81 | - // } | |
82 | - // ); | |
83 | - | |
84 | 73 | const getBindValues = computed(() => { |
85 | 74 | let propsData = { |
86 | 75 | blockNode: true, |
... | ... | @@ -106,11 +95,6 @@ |
106 | 95 | emit('update:value', rawVal); |
107 | 96 | }, |
108 | 97 | onRightClick: handleRightClick, |
109 | - // onSelect: (k, e) => { | |
110 | - // setTimeout(() => { | |
111 | - // emit('select', k, e); | |
112 | - // }, 16); | |
113 | - // }, | |
114 | 98 | }; |
115 | 99 | propsData = omit(propsData, 'treeData', 'class'); |
116 | 100 | return propsData; |
... | ... | @@ -306,14 +290,17 @@ |
306 | 290 | class={`${prefixCls}-title pl-2`} |
307 | 291 | onClick={handleClickNode.bind(null, item[keyField], item[childrenField])} |
308 | 292 | > |
309 | - {icon && <TreeIcon icon={icon} />} | |
310 | - <span | |
311 | - class={`${prefixCls}__content`} | |
312 | - // style={unref(getContentStyle)} | |
313 | - > | |
314 | - {get(item, titleField)} | |
315 | - </span> | |
316 | - <span class={`${prefixCls}__actions`}> {renderAction({ ...item, level })}</span> | |
293 | + {slots?.title ? ( | |
294 | + getSlot(slots, 'title', item) | |
295 | + ) : ( | |
296 | + <> | |
297 | + {icon && <TreeIcon icon={icon} />} | |
298 | + <span class={`${prefixCls}__content`}>{get(item, titleField)}</span> | |
299 | + <span class={`${prefixCls}__actions`}> | |
300 | + {renderAction({ ...item, level })} | |
301 | + </span> | |
302 | + </> | |
303 | + )} | |
317 | 304 | </span> |
318 | 305 | ), |
319 | 306 | default: () => renderTreeNode({ data: children, level: level + 1 }), | ... | ... |
yarn.lock
... | ... | @@ -1785,10 +1785,10 @@ |
1785 | 1785 | dependencies: |
1786 | 1786 | vue-demi latest |
1787 | 1787 | |
1788 | -"@windicss/plugin-utils@0.7.1": | |
1789 | - version "0.7.1" | |
1790 | - resolved "https://registry.npmjs.org/@windicss/plugin-utils/-/plugin-utils-0.7.1.tgz#001ba282b78a9d4e110e531d59309d2b9cb0929e" | |
1791 | - integrity sha512-ZloIRRKCnArFyDNuhZiFRA15XqhlWaeTcOf3soP9VxWJ+i6/IkH6cnaYgBefDATA/zJodOPsXBnbX333zKVk1Q== | |
1788 | +"@windicss/plugin-utils@0.7.2": | |
1789 | + version "0.7.2" | |
1790 | + resolved "https://registry.npmjs.org/@windicss/plugin-utils/-/plugin-utils-0.7.2.tgz#c43c89a2f51110eb6f49da565dc235fb2af30269" | |
1791 | + integrity sha512-4znRERKhhStIOFy1/eB0rJXnXs+NyumBREjh0GZVMoHVmUB9up08tNUpbbq3tlJC96t27VsD4vdfv00T+It/IA== | |
1792 | 1792 | dependencies: |
1793 | 1793 | esbuild "^0.8.57" |
1794 | 1794 | esbuild-register "^2.2.0" |
... | ... | @@ -9183,12 +9183,12 @@ vite-plugin-theme@^0.4.8: |
9183 | 9183 | es-module-lexer "^0.3.26" |
9184 | 9184 | tinycolor2 "^1.4.2" |
9185 | 9185 | |
9186 | -vite-plugin-windicss@0.7.1: | |
9187 | - version "0.7.1" | |
9188 | - resolved "https://registry.npmjs.org/vite-plugin-windicss/-/vite-plugin-windicss-0.7.1.tgz#1e1c41c2f62d18a2777819057c981a1ec26d8901" | |
9189 | - integrity sha512-0NNrTBgjx11KOwqS/4szfVIt3LURFor4cEEVVJjB8p7JDTnC4K8Cu11bcAvY+QMOfflxv4s2ONo2SU4xkq68kA== | |
9186 | +vite-plugin-windicss@0.7.2: | |
9187 | + version "0.7.2" | |
9188 | + resolved "https://registry.npmjs.org/vite-plugin-windicss/-/vite-plugin-windicss-0.7.2.tgz#1647ee3765edb0f993b81206f35310a63b25c1f9" | |
9189 | + integrity sha512-U6N8ljy7meqLkq8aENb3VXKr93Vzp1pU5zwhJr7HmGi+42Wv4i8r7+7BW6WRS4Ght4SAMzFuzIGq9RLPzoZ2Jg== | |
9190 | 9190 | dependencies: |
9191 | - "@windicss/plugin-utils" "0.7.1" | |
9191 | + "@windicss/plugin-utils" "0.7.2" | |
9192 | 9192 | windicss "^2.3.0" |
9193 | 9193 | |
9194 | 9194 | vite@^2.0.5: | ... | ... |