first commit

This commit is contained in:
jefferyzhao
2025-07-31 17:44:12 +08:00
commit b9bdc8598b
42390 changed files with 4467935 additions and 0 deletions

21
node_modules/vue-giant-tree/LICENSE generated vendored Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 refined-x
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

148
node_modules/vue-giant-tree/README.md generated vendored Normal file
View File

@ -0,0 +1,148 @@
# vue-giant-tree
[![npm](https://img.shields.io/npm/v/vue-giant-tree.svg)](https://www.npmjs.com/package/vue-giant-tree/) [![license](https://img.shields.io/github/license/tower1229/vue-giant-tree.svg)]()
> :deciduous_tree: 巨树:基于[ztree](https://github.com/zTree/zTree_v3)封装的 Vue 树形组件,轻松实现海量数据的高性能渲染。
![logo](https://refined-x.com/asset/vgt-preview.png)
Vue3.x 版本[在这](https://github.com/tower1229/Vue-Giant-Tree/tree/vue3)
## 为什么需要 vue-giant-tree
Vue 的数据监听机制决定了在大数据量场景下的渲染性能非常低下,基于 Vue 实现的常规树组件几乎无法胜任上万条数据的高性能渲染,在 IE 浏览器(即便是 IE11中很容易导致页面卡死甚至浏览器崩溃。
> 不服气可以试试这份数据 [big-tree.json](http://refined-x.com/Vue-Giant-Tree/mock/big-tree.json)
为了摆脱数据监听,只能放弃通过 Vue 渲染,采用常规 DOM 操作的方式。在这个领域[ztree](https://github.com/zTree/zTree_v3)是当之无愧最成熟的方案,因此 vue-giant-tree 直接基于 ztree 做上层封装,以组件的形式将 ztree 的配置和事件暴露出来,使其可以方便的在 Vue 项目中安装使用。
vue-giant-tree 仅仅是给 ztree 套了一层 Vue 组件的壳,顺便提供了一套更现代化的皮肤,因为主打大数据量场景,所以取名**巨树**。
ztree 在性能优化方面已经做到了近乎极致,感谢 ztree 作者的工作,向您致敬!
## 安装
```bash
npm i vue-giant-tree --save
```
**注意:组件依赖 jQuery务必在页面中提前加载 jQuery**
```
<script src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
```
## 使用
in script:
```javascript
import tree from "vue-giant-tree";
export default {
components: {
tree
},
data() {
return {
nodes: [
{ id:1, pid:0, name:"随意勾选 1", open:true},
{ id:11, pid:1, name:"随意勾选 1-1", open:true},
{ id:111, pid:11, name:"随意勾选 1-1-1"},
{ id:112, pid:11, name:"随意勾选 1-1-2"},
{ id:12, pid:1, name:"随意勾选 1-2", open:true},
{ id:121, pid:12, name:"随意勾选 1-2-1"},
{ id:122, pid:12, name:"随意勾选 1-2-2"},
{ id:2, pid:0, name:"随意勾选 2", checked:true, open:true},
{ id:21, pid:2, name:"随意勾选 2-1"},
{ id:22, pid:2, name:"随意勾选 2-2", open:true},
{ id:221, pid:22, name:"随意勾选 2-2-1", checked:true},
{ id:222, pid:22, name:"随意勾选 2-2-2"},
{ id:23, pid:2, name:"随意勾选 2-3"}
]
}
},
methods: {
onClick(evt, treeId, treeNode) {
},
onCheck(evt, treeId, treeNode) {
},
handleCreated(ztreeObj) {
}
}
...
```
in template:
```html
<tree
:nodes="nodes"
@onClick="onClick"
@onCheck="onCheck"
@onCreated="handleCreated"
/>
```
## 属性
| 参数 | 说明 | 类型 | 默认值 |
| ------- | ---------- | ------ | --------------------------- |
| setting | ztree 配置 | Object | `{view: {showIcon: false}}` |
| nodes | ztree 数据 | Array | `[]` |
## 事件
完全移植[zTree API](http://www.treejs.cn/v3/api.php)中`callback`支持的事件,除了:
- 不支持所有 `before` 开头的事件。这类事件的主要作用是根据返回值决定是否阻止后续的`on`事件,这种判断可以在`on`事件中实现;当然,你也可以通过`setting.callback.beforeXXX`自行配置
- 不支持 `onNodeCreated` 事件。因为在大数据量下很耗性能,如果需要可以通过 `setting.callback.onNodeCreated` 自行传入
- 增加 `onCreated` 事件。每次实例初始化完成时触发,回调参数接收 ztree 实例,通过 ztree 实例可以使用所有实例方法
| 事件名称 | 说明 |
| -------------- | ------------------------------------------------- |
| onAsyncError | 参考 [zTree API](http://www.treejs.cn/v3/api.php) |
| onAsyncSuccess | 参考 [zTree API](http://www.treejs.cn/v3/api.php) |
| onCheck | 参考 [zTree API](http://www.treejs.cn/v3/api.php) |
| onClick | 参考 [zTree API](http://www.treejs.cn/v3/api.php) |
| onCollapse | 参考 [zTree API](http://www.treejs.cn/v3/api.php) |
| onDblClick | 参考 [zTree API](http://www.treejs.cn/v3/api.php) |
| onDrag | 参考 [zTree API](http://www.treejs.cn/v3/api.php) |
| onDragMove | 参考 [zTree API](http://www.treejs.cn/v3/api.php) |
| onDrop | 参考 [zTree API](http://www.treejs.cn/v3/api.php) |
| onExpand | 参考 [zTree API](http://www.treejs.cn/v3/api.php) |
| onMouseDown | 参考 [zTree API](http://www.treejs.cn/v3/api.php) |
| onMouseUp | 参考 [zTree API](http://www.treejs.cn/v3/api.php) |
| onRemove | 参考 [zTree API](http://www.treejs.cn/v3/api.php) |
| onRename | 参考 [zTree API](http://www.treejs.cn/v3/api.php) |
| onRightClick | 参考 [zTree API](http://www.treejs.cn/v3/api.php) |
| onCreated | 初始化渲染完成后触发,回调参数接收 ztree 实例 |
## 扩展
zTree 没有提供给整个实例更新数据的方法vue-giant-tree 基于 Vue 的组件通信机制扩展实现了*响应式数据*特性,只要`nodes`的值发生变化ztree 实例就会随之更新。
[项目 DEMO](https://github.com/tower1229/Vue-Giant-Tree/blob/master/src/App.vue)里演示了 vue-giant-tree 的响应式数据特性。
## 演示
- 线上演示:
> http://refined-x.com/Vue-Giant-Tree/
- 本地演示:
```
npm i
npm run serve
```
## License
MIT
Copyright (c) 2019-present, [前端路上](http://refined-x.com)

19
node_modules/vue-giant-tree/dist/demo.html generated vendored Normal file
View File

@ -0,0 +1,19 @@
<meta charset="utf-8">
<title>vue-giant-tree demo</title>
<script src="//unpkg.com/vue@2"></script>
<script src="./vue-giant-tree.umd.js"></script>
<div id="app">
<demo></demo>
</div>
<script>
new Vue({
components: {
demo: vue-giant-tree
}
}).$mount('#app')
</script>

6648
node_modules/vue-giant-tree/dist/vue-giant-tree.common.js generated vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

6658
node_modules/vue-giant-tree/dist/vue-giant-tree.umd.js generated vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

40
node_modules/vue-giant-tree/package.json generated vendored Normal file
View File

@ -0,0 +1,40 @@
{
"name": "vue-giant-tree",
"version": "1.0.0",
"author": "refined-x [tower1229@foxmail.com]",
"main": "./dist/vue-giant-tree.common.js",
"repository": {
"type": "git",
"url": "git+https://github.com/tower1229/Vue-Giant-Tree.git"
},
"files": [
"dist"
],
"keywords": [
"vue",
"tree",
"ztree"
],
"license": "MIT",
"homepage": "https://github.com/tower1229/Vue-Giant-Tree/blob/master/README.md",
"private": false,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"build-bundle": "vue-cli-service build --target lib --dest dist --name vue-giant-tree ./src/components/ztree.vue",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@ztree/ztree_v3": "^3.5.44"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.4.6",
"@vue/cli-plugin-eslint": "^4.4.6",
"@vue/cli-service": "^4.4.6",
"babel-eslint": "^10.1.0",
"eslint": "^6.4.0",
"eslint-plugin-vue": "^6.2.2",
"vue": "^2.6.11",
"vue-template-compiler": "^2.6.11"
}
}