feat:新增拖拽改变层级功能

This commit is contained in:
奔跑的面条 2022-04-03 15:06:32 +08:00
parent 5861e38056
commit 19c62d7b78
4 changed files with 242 additions and 231 deletions

View File

@ -22,7 +22,8 @@
"vue-i18n": "^9.2.0-beta.23",
"vue-router": "4.0.12",
"vue3-lazyload": "^0.2.5-beta",
"vue3-sketch-ruler": "^1.3.3"
"vue3-sketch-ruler": "^1.3.3",
"vuedraggable": "^4.1.0"
},
"devDependencies": {
"@types/node": "^16.11.1",

View File

@ -46,6 +46,7 @@ specifiers:
vue-tsc: ^0.28.7
vue3-lazyload: ^0.2.5-beta
vue3-sketch-ruler: ^1.3.3
vuedraggable: ^4.1.0
dependencies:
'@types/color': registry.npmjs.org/@types/color/3.0.3
@ -63,6 +64,7 @@ dependencies:
vue-router: rg.cnpmjs.org/vue-router/4.0.12_vue@3.2.24
vue3-lazyload: registry.npmjs.org/vue3-lazyload/0.2.5-beta_e9ad48123e44f1efa3c90c8e8375ea6d
vue3-sketch-ruler: registry.npmjs.org/vue3-sketch-ruler/1.3.3_vue@3.2.24
vuedraggable: 4.1.0_vue@3.2.24
devDependencies:
'@types/node': rg.cnpmjs.org/@types/node/16.11.12
@ -98,6 +100,150 @@ devDependencies:
packages:
/esbuild-android-arm64/0.13.15:
resolution: {integrity: sha512-m602nft/XXeO8YQPUDVoHfjyRVPdPgjyyXOxZ44MK/agewFFkPa8tUo6lAzSWh5Ui5PB4KR9UIFTSBKh/RrCmg==}
cpu: [arm64]
os: [android]
requiresBuild: true
dev: true
optional: true
/esbuild-darwin-64/0.13.15:
resolution: {integrity: sha512-ihOQRGs2yyp7t5bArCwnvn2Atr6X4axqPpEdCFPVp7iUj4cVSdisgvEKdNR7yH3JDjW6aQDw40iQFoTqejqxvQ==}
cpu: [x64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
/esbuild-darwin-arm64/0.13.15:
resolution: {integrity: sha512-i1FZssTVxUqNlJ6cBTj5YQj4imWy3m49RZRnHhLpefFIh0To05ow9DTrXROTE1urGTQCloFUXTX8QfGJy1P8dQ==}
cpu: [arm64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
/esbuild-freebsd-64/0.13.15:
resolution: {integrity: sha512-G3dLBXUI6lC6Z09/x+WtXBXbOYQZ0E8TDBqvn7aMaOCzryJs8LyVXKY4CPnHFXZAbSwkCbqiPuSQ1+HhrNk7EA==}
cpu: [x64]
os: [freebsd]
requiresBuild: true
dev: true
optional: true
/esbuild-freebsd-arm64/0.13.15:
resolution: {integrity: sha512-KJx0fzEDf1uhNOZQStV4ujg30WlnwqUASaGSFPhznLM/bbheu9HhqZ6mJJZM32lkyfGJikw0jg7v3S0oAvtvQQ==}
cpu: [arm64]
os: [freebsd]
requiresBuild: true
dev: true
optional: true
/esbuild-linux-32/0.13.15:
resolution: {integrity: sha512-ZvTBPk0YWCLMCXiFmD5EUtB30zIPvC5Itxz0mdTu/xZBbbHJftQgLWY49wEPSn2T/TxahYCRDWun5smRa0Tu+g==}
cpu: [ia32]
os: [linux]
requiresBuild: true
dev: true
optional: true
/esbuild-linux-64/0.13.15:
resolution: {integrity: sha512-eCKzkNSLywNeQTRBxJRQ0jxRCl2YWdMB3+PkWFo2BBQYC5mISLIVIjThNtn6HUNqua1pnvgP5xX0nHbZbPj5oA==}
cpu: [x64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/esbuild-linux-arm/0.13.15:
resolution: {integrity: sha512-wUHttDi/ol0tD8ZgUMDH8Ef7IbDX+/UsWJOXaAyTdkT7Yy9ZBqPg8bgB/Dn3CZ9SBpNieozrPRHm0BGww7W/jA==}
cpu: [arm]
os: [linux]
requiresBuild: true
dev: true
optional: true
/esbuild-linux-arm64/0.13.15:
resolution: {integrity: sha512-bYpuUlN6qYU9slzr/ltyLTR9YTBS7qUDymO8SV7kjeNext61OdmqFAzuVZom+OLW1HPHseBfJ/JfdSlx8oTUoA==}
cpu: [arm64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/esbuild-linux-mips64le/0.13.15:
resolution: {integrity: sha512-KlVjIG828uFPyJkO/8gKwy9RbXhCEUeFsCGOJBepUlpa7G8/SeZgncUEz/tOOUJTcWMTmFMtdd3GElGyAtbSWg==}
cpu: [mips64el]
os: [linux]
requiresBuild: true
dev: true
optional: true
/esbuild-linux-ppc64le/0.13.15:
resolution: {integrity: sha512-h6gYF+OsaqEuBjeesTBtUPw0bmiDu7eAeuc2OEH9S6mV9/jPhPdhOWzdeshb0BskRZxPhxPOjqZ+/OqLcxQwEQ==}
cpu: [ppc64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/esbuild-netbsd-64/0.13.15:
resolution: {integrity: sha512-3+yE9emwoevLMyvu+iR3rsa+Xwhie7ZEHMGDQ6dkqP/ndFzRHkobHUKTe+NCApSqG5ce2z4rFu+NX/UHnxlh3w==}
cpu: [x64]
os: [netbsd]
requiresBuild: true
dev: true
optional: true
/esbuild-openbsd-64/0.13.15:
resolution: {integrity: sha512-wTfvtwYJYAFL1fSs8yHIdf5GEE4NkbtbXtjLWjM3Cw8mmQKqsg8kTiqJ9NJQe5NX/5Qlo7Xd9r1yKMMkHllp5g==}
cpu: [x64]
os: [openbsd]
requiresBuild: true
dev: true
optional: true
/esbuild-sunos-64/0.13.15:
resolution: {integrity: sha512-lbivT9Bx3t1iWWrSnGyBP9ODriEvWDRiweAs69vI+miJoeKwHWOComSRukttbuzjZ8r1q0mQJ8Z7yUsDJ3hKdw==}
cpu: [x64]
os: [sunos]
requiresBuild: true
dev: true
optional: true
/esbuild-windows-32/0.13.15:
resolution: {integrity: sha512-fDMEf2g3SsJ599MBr50cY5ve5lP1wyVwTe6aLJsM01KtxyKkB4UT+fc5MXQFn3RLrAIAZOG+tHC+yXObpSn7Nw==}
cpu: [ia32]
os: [win32]
requiresBuild: true
dev: true
optional: true
/esbuild-windows-64/0.13.15:
resolution: {integrity: sha512-9aMsPRGDWCd3bGjUIKG/ZOJPKsiztlxl/Q3C1XDswO6eNX/Jtwu4M+jb6YDH9hRSUflQWX0XKAfWzgy5Wk54JQ==}
cpu: [x64]
os: [win32]
requiresBuild: true
dev: true
optional: true
/esbuild-windows-arm64/0.13.15:
resolution: {integrity: sha512-zzvyCVVpbwQQATaf3IG8mu1IwGEiDxKkYUdA4FpoCHi1KtPa13jeScYDjlW0Qh+ebWzpKfR2ZwvqAQkSWNcKjA==}
cpu: [arm64]
os: [win32]
requiresBuild: true
dev: true
optional: true
/fsevents/2.3.2:
resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin]
requiresBuild: true
dev: true
optional: true
/globby/12.2.0:
resolution: {integrity: sha512-wiSuFQLZ+urS9x2gGPl1H5drc5twabmm4m2gTR27XDFyjUHJUNsS8o/2aKyIF6IoBaR630atdher0XJ5g6OMmA==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
@ -110,6 +256,11 @@ packages:
slash: r2.cnpmjs.org/slash/4.0.0
dev: true
/graceful-fs/4.2.8:
resolution: {integrity: sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==}
requiresBuild: true
dev: true
/jest-diff/27.4.6:
resolution: {integrity: sha512-zjaB0sh0Lb13VyPsd92V7HkqF6yKRH9vm33rwBt7rPYrpQvS1nCvlIy2pICbKta+ZjWngYLNn4cCK4nyZkjS/w==}
engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}
@ -135,6 +286,10 @@ packages:
tslib: registry.npmjs.org/tslib/2.3.1
dev: true
/sortablejs/1.14.0:
resolution: {integrity: sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w==}
dev: false
/uglify-js/3.15.1:
resolution: {integrity: sha512-FAGKF12fWdkpvNJZENacOH0e/83eG6JyVQyanIJaBXCN1J11TUQv1T1/z8S+Z0CG0ZPk1nPcreF/c7lrTd0TEQ==}
engines: {node: '>=0.8.0'}
@ -164,6 +319,15 @@ packages:
vue-demi: r2.cnpmjs.org/vue-demi/0.12.1_vue@3.2.24
dev: true
/vuedraggable/4.1.0_vue@3.2.24:
resolution: {integrity: sha512-FU5HCWBmsf20GpP3eudURW3WdWTKIbEIQxh9/8GE806hydR9qZqRRxRE3RjqX7PkuLuMQG/A7n3cfj9rCEchww==}
peerDependencies:
vue: ^3.0.1
dependencies:
sortablejs: 1.14.0
vue: rg.cnpmjs.org/vue/3.2.24
dev: false
r2.cnpmjs.org/@css-render/plugin-bem/0.15.8_css-render@0.15.8:
resolution: {integrity: sha512-rJMFBaqZGrezs1d0vPB7hZTSkfFEgcdWxPMtLUmm9PAOioWtw+Knb9A0xU0bYazPKDo0SoNVVcd1Qd1LXD9x4Q==, registry: http://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/@css-render/plugin-bem/-/plugin-bem-0.15.8.tgz}
id: r2.cnpmjs.org/@css-render/plugin-bem/0.15.8
@ -536,7 +700,7 @@ packages:
engines: {node: '>=10'}
dependencies:
globby: r2.cnpmjs.org/globby/11.0.4
graceful-fs: registry.npmjs.org/graceful-fs/4.2.8
graceful-fs: 4.2.8
is-glob: r2.cnpmjs.org/is-glob/4.0.3
is-path-cwd: r2.cnpmjs.org/is-path-cwd/2.2.0
is-path-inside: r2.cnpmjs.org/is-path-inside/3.0.3
@ -594,176 +758,6 @@ packages:
version: 8.0.0
dev: true
r2.cnpmjs.org/esbuild-android-arm64/0.13.15:
resolution: {integrity: sha512-m602nft/XXeO8YQPUDVoHfjyRVPdPgjyyXOxZ44MK/agewFFkPa8tUo6lAzSWh5Ui5PB4KR9UIFTSBKh/RrCmg==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.13.15.tgz}
name: esbuild-android-arm64
version: 0.13.15
cpu: [arm64]
os: [android]
requiresBuild: true
dev: true
optional: true
r2.cnpmjs.org/esbuild-darwin-64/0.13.15:
resolution: {integrity: sha512-ihOQRGs2yyp7t5bArCwnvn2Atr6X4axqPpEdCFPVp7iUj4cVSdisgvEKdNR7yH3JDjW6aQDw40iQFoTqejqxvQ==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.13.15.tgz}
name: esbuild-darwin-64
version: 0.13.15
cpu: [x64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
r2.cnpmjs.org/esbuild-darwin-arm64/0.13.15:
resolution: {integrity: sha512-i1FZssTVxUqNlJ6cBTj5YQj4imWy3m49RZRnHhLpefFIh0To05ow9DTrXROTE1urGTQCloFUXTX8QfGJy1P8dQ==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.13.15.tgz}
name: esbuild-darwin-arm64
version: 0.13.15
cpu: [arm64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
r2.cnpmjs.org/esbuild-freebsd-64/0.13.15:
resolution: {integrity: sha512-G3dLBXUI6lC6Z09/x+WtXBXbOYQZ0E8TDBqvn7aMaOCzryJs8LyVXKY4CPnHFXZAbSwkCbqiPuSQ1+HhrNk7EA==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.13.15.tgz}
name: esbuild-freebsd-64
version: 0.13.15
cpu: [x64]
os: [freebsd]
requiresBuild: true
dev: true
optional: true
r2.cnpmjs.org/esbuild-freebsd-arm64/0.13.15:
resolution: {integrity: sha512-KJx0fzEDf1uhNOZQStV4ujg30WlnwqUASaGSFPhznLM/bbheu9HhqZ6mJJZM32lkyfGJikw0jg7v3S0oAvtvQQ==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.13.15.tgz}
name: esbuild-freebsd-arm64
version: 0.13.15
cpu: [arm64]
os: [freebsd]
requiresBuild: true
dev: true
optional: true
r2.cnpmjs.org/esbuild-linux-32/0.13.15:
resolution: {integrity: sha512-ZvTBPk0YWCLMCXiFmD5EUtB30zIPvC5Itxz0mdTu/xZBbbHJftQgLWY49wEPSn2T/TxahYCRDWun5smRa0Tu+g==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.13.15.tgz}
name: esbuild-linux-32
version: 0.13.15
cpu: [ia32]
os: [linux]
requiresBuild: true
dev: true
optional: true
r2.cnpmjs.org/esbuild-linux-64/0.13.15:
resolution: {integrity: sha512-eCKzkNSLywNeQTRBxJRQ0jxRCl2YWdMB3+PkWFo2BBQYC5mISLIVIjThNtn6HUNqua1pnvgP5xX0nHbZbPj5oA==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.13.15.tgz}
name: esbuild-linux-64
version: 0.13.15
cpu: [x64]
os: [linux]
requiresBuild: true
dev: true
optional: true
r2.cnpmjs.org/esbuild-linux-arm/0.13.15:
resolution: {integrity: sha512-wUHttDi/ol0tD8ZgUMDH8Ef7IbDX+/UsWJOXaAyTdkT7Yy9ZBqPg8bgB/Dn3CZ9SBpNieozrPRHm0BGww7W/jA==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.13.15.tgz}
name: esbuild-linux-arm
version: 0.13.15
cpu: [arm]
os: [linux]
requiresBuild: true
dev: true
optional: true
r2.cnpmjs.org/esbuild-linux-arm64/0.13.15:
resolution: {integrity: sha512-bYpuUlN6qYU9slzr/ltyLTR9YTBS7qUDymO8SV7kjeNext61OdmqFAzuVZom+OLW1HPHseBfJ/JfdSlx8oTUoA==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.13.15.tgz}
name: esbuild-linux-arm64
version: 0.13.15
cpu: [arm64]
os: [linux]
requiresBuild: true
dev: true
optional: true
r2.cnpmjs.org/esbuild-linux-mips64le/0.13.15:
resolution: {integrity: sha512-KlVjIG828uFPyJkO/8gKwy9RbXhCEUeFsCGOJBepUlpa7G8/SeZgncUEz/tOOUJTcWMTmFMtdd3GElGyAtbSWg==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.13.15.tgz}
name: esbuild-linux-mips64le
version: 0.13.15
cpu: [mips64el]
os: [linux]
requiresBuild: true
dev: true
optional: true
r2.cnpmjs.org/esbuild-linux-ppc64le/0.13.15:
resolution: {integrity: sha512-h6gYF+OsaqEuBjeesTBtUPw0bmiDu7eAeuc2OEH9S6mV9/jPhPdhOWzdeshb0BskRZxPhxPOjqZ+/OqLcxQwEQ==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.13.15.tgz}
name: esbuild-linux-ppc64le
version: 0.13.15
cpu: [ppc64]
os: [linux]
requiresBuild: true
dev: true
optional: true
r2.cnpmjs.org/esbuild-netbsd-64/0.13.15:
resolution: {integrity: sha512-3+yE9emwoevLMyvu+iR3rsa+Xwhie7ZEHMGDQ6dkqP/ndFzRHkobHUKTe+NCApSqG5ce2z4rFu+NX/UHnxlh3w==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.13.15.tgz}
name: esbuild-netbsd-64
version: 0.13.15
cpu: [x64]
os: [netbsd]
requiresBuild: true
dev: true
optional: true
r2.cnpmjs.org/esbuild-openbsd-64/0.13.15:
resolution: {integrity: sha512-wTfvtwYJYAFL1fSs8yHIdf5GEE4NkbtbXtjLWjM3Cw8mmQKqsg8kTiqJ9NJQe5NX/5Qlo7Xd9r1yKMMkHllp5g==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.13.15.tgz}
name: esbuild-openbsd-64
version: 0.13.15
cpu: [x64]
os: [openbsd]
requiresBuild: true
dev: true
optional: true
r2.cnpmjs.org/esbuild-sunos-64/0.13.15:
resolution: {integrity: sha512-lbivT9Bx3t1iWWrSnGyBP9ODriEvWDRiweAs69vI+miJoeKwHWOComSRukttbuzjZ8r1q0mQJ8Z7yUsDJ3hKdw==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.13.15.tgz}
name: esbuild-sunos-64
version: 0.13.15
cpu: [x64]
os: [sunos]
requiresBuild: true
dev: true
optional: true
r2.cnpmjs.org/esbuild-windows-32/0.13.15:
resolution: {integrity: sha512-fDMEf2g3SsJ599MBr50cY5ve5lP1wyVwTe6aLJsM01KtxyKkB4UT+fc5MXQFn3RLrAIAZOG+tHC+yXObpSn7Nw==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.13.15.tgz}
name: esbuild-windows-32
version: 0.13.15
cpu: [ia32]
os: [win32]
requiresBuild: true
dev: true
optional: true
r2.cnpmjs.org/esbuild-windows-64/0.13.15:
resolution: {integrity: sha512-9aMsPRGDWCd3bGjUIKG/ZOJPKsiztlxl/Q3C1XDswO6eNX/Jtwu4M+jb6YDH9hRSUflQWX0XKAfWzgy5Wk54JQ==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.13.15.tgz}
name: esbuild-windows-64
version: 0.13.15
cpu: [x64]
os: [win32]
requiresBuild: true
dev: true
optional: true
r2.cnpmjs.org/esbuild-windows-arm64/0.13.15:
resolution: {integrity: sha512-zzvyCVVpbwQQATaf3IG8mu1IwGEiDxKkYUdA4FpoCHi1KtPa13jeScYDjlW0Qh+ebWzpKfR2ZwvqAQkSWNcKjA==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.15.tgz}
name: esbuild-windows-arm64
version: 0.13.15
cpu: [arm64]
os: [win32]
requiresBuild: true
dev: true
optional: true
r2.cnpmjs.org/escape-string-regexp/1.0.5:
resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==, registry: http://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz}
name: escape-string-regexp
@ -896,16 +890,6 @@ packages:
version: 1.0.0
dev: true
r2.cnpmjs.org/fsevents/2.3.2:
resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/fsevents/-/fsevents-2.3.2.tgz}
name: fsevents
version: 2.3.2
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin]
requiresBuild: true
dev: true
optional: true
r2.cnpmjs.org/function-bind/1.1.1:
resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==, registry: http://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/function-bind/-/function-bind-1.1.1.tgz}
name: function-bind
@ -972,14 +956,6 @@ packages:
slash: r2.cnpmjs.org/slash/3.0.0
dev: true
r2.cnpmjs.org/graceful-fs/4.2.8:
resolution: {integrity: sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==, registry: https://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz}
name: graceful-fs
version: 4.2.8
requiresBuild: true
dev: true
optional: true
r2.cnpmjs.org/handlebars/4.7.7:
resolution: {integrity: sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==, registry: http://r.cnpmjs.org/, tarball: https://r2.cnpmjs.org/handlebars/-/handlebars-4.7.7.tgz}
name: handlebars
@ -2269,7 +2245,7 @@ packages:
dependencies:
universalify: registry.npmjs.org/universalify/2.0.0
optionalDependencies:
graceful-fs: r2.cnpmjs.org/graceful-fs/4.2.8
graceful-fs: 4.2.8
dev: true
registry.npmjs.org/mockjs/1.1.0:
@ -3780,7 +3756,7 @@ packages:
normalize-path: rg.cnpmjs.org/normalize-path/3.0.0
readdirp: rg.cnpmjs.org/readdirp/3.6.0
optionalDependencies:
fsevents: r2.cnpmjs.org/fsevents/2.3.2
fsevents: 2.3.2
dev: true
rg.cnpmjs.org/concat-map/0.0.1:
@ -4100,23 +4076,23 @@ packages:
hasBin: true
requiresBuild: true
optionalDependencies:
esbuild-android-arm64: r2.cnpmjs.org/esbuild-android-arm64/0.13.15
esbuild-darwin-64: r2.cnpmjs.org/esbuild-darwin-64/0.13.15
esbuild-darwin-arm64: r2.cnpmjs.org/esbuild-darwin-arm64/0.13.15
esbuild-freebsd-64: r2.cnpmjs.org/esbuild-freebsd-64/0.13.15
esbuild-freebsd-arm64: r2.cnpmjs.org/esbuild-freebsd-arm64/0.13.15
esbuild-linux-32: r2.cnpmjs.org/esbuild-linux-32/0.13.15
esbuild-linux-64: r2.cnpmjs.org/esbuild-linux-64/0.13.15
esbuild-linux-arm: r2.cnpmjs.org/esbuild-linux-arm/0.13.15
esbuild-linux-arm64: r2.cnpmjs.org/esbuild-linux-arm64/0.13.15
esbuild-linux-mips64le: r2.cnpmjs.org/esbuild-linux-mips64le/0.13.15
esbuild-linux-ppc64le: r2.cnpmjs.org/esbuild-linux-ppc64le/0.13.15
esbuild-netbsd-64: r2.cnpmjs.org/esbuild-netbsd-64/0.13.15
esbuild-openbsd-64: r2.cnpmjs.org/esbuild-openbsd-64/0.13.15
esbuild-sunos-64: r2.cnpmjs.org/esbuild-sunos-64/0.13.15
esbuild-windows-32: r2.cnpmjs.org/esbuild-windows-32/0.13.15
esbuild-windows-64: r2.cnpmjs.org/esbuild-windows-64/0.13.15
esbuild-windows-arm64: r2.cnpmjs.org/esbuild-windows-arm64/0.13.15
esbuild-android-arm64: 0.13.15
esbuild-darwin-64: 0.13.15
esbuild-darwin-arm64: 0.13.15
esbuild-freebsd-64: 0.13.15
esbuild-freebsd-arm64: 0.13.15
esbuild-linux-32: 0.13.15
esbuild-linux-64: 0.13.15
esbuild-linux-arm: 0.13.15
esbuild-linux-arm64: 0.13.15
esbuild-linux-mips64le: 0.13.15
esbuild-linux-ppc64le: 0.13.15
esbuild-netbsd-64: 0.13.15
esbuild-openbsd-64: 0.13.15
esbuild-sunos-64: 0.13.15
esbuild-windows-32: 0.13.15
esbuild-windows-64: 0.13.15
esbuild-windows-arm64: 0.13.15
dev: true
rg.cnpmjs.org/escalade/3.1.1:
@ -5633,7 +5609,7 @@ packages:
engines: {node: '>=10.0.0'}
hasBin: true
optionalDependencies:
fsevents: r2.cnpmjs.org/fsevents/2.3.2
fsevents: 2.3.2
dev: true
rg.cnpmjs.org/run-parallel/1.2.0:
@ -6073,7 +6049,7 @@ packages:
rollup: rg.cnpmjs.org/rollup/2.60.2
sass: rg.cnpmjs.org/sass/1.44.0
optionalDependencies:
fsevents: r2.cnpmjs.org/fsevents/2.3.2
fsevents: 2.3.2
dev: true
rg.cnpmjs.org/void-elements/3.1.0:

View File

@ -164,12 +164,13 @@ export const useChartEditStore = defineStore({
if (y) this.mousePosition.y = y
},
// * 找到目标 id 数据下标位置(无则返回-1
fetchTargetIndex(): number {
if(!this.getTargetChart.selectId) {
fetchTargetIndex(id?: string): number {
const targetId = id || this.getTargetChart.selectId
if(!targetId) {
loadingFinish()
return -1
}
const index = this.componentList.findIndex(e => e.id === this.getTargetChart.selectId)
const index = this.componentList.findIndex(e => e.id === targetId)
if (index === -1) {
loadingError()
}
@ -178,15 +179,15 @@ export const useChartEditStore = defineStore({
/**
* *
* @param chartConfig
* @param isEnd
* @param isHead
* @param isHistory
* @returns
*/
addComponentList(chartConfig: CreateComponentType, isEnd = false, isHistory = false): void {
addComponentList(chartConfig: CreateComponentType, isHead = false, isHistory = false): void {
if (isHistory) {
chartHistoryStore.createAddHistory(chartConfig)
}
if (isEnd) {
if (isHead) {
this.componentList.unshift(chartConfig)
return
}
@ -274,7 +275,7 @@ export const useChartEditStore = defineStore({
setBottom(isHistory = true): void {
this.setBothEnds(true, isHistory)
},
// * 互换图表位置
// * 上移/下移互换图表位置
wrap(isDown = false, isHistory = true) {
try {
loadingStart()

View File

@ -11,28 +11,38 @@
<component :is="LayersIcon"></component>
</n-icon>
</template>
<!-- 图层内容 -->
<layers-list-item
v-for="item in reverseList"
:key="item.id"
:componentData="item"
@mousedown="mousedownHandle(item)"
@mouseenter="mouseenterHandle(item)"
@mouseleave="mouseleaveHandle(item)"
@contextmenu="handleContextMenu($event, item)"
></layers-list-item>
<!-- https://github.com/SortableJS/vue.draggable.next -->
<draggable
item-key="id"
tag="transition-group"
v-model="reverseList"
ghostClass="ghost"
@change="onMoveCallback"
>
<template #item="{ element }">
<layers-list-item
:componentData="element"
@mousedown="mousedownHandle(element)"
@mouseenter="mouseenterHandle(element)"
@mouseleave="mouseleaveHandle(element)"
@contextmenu="handleContextMenu($event, element)"
></layers-list-item>
</template>
</draggable>
</content-box>
</template>
<script setup lang="ts">
import { computed } from 'vue'
import { computed, toRaw, ref, watch } from 'vue'
import Draggable from 'vuedraggable'
import cloneDeep from 'lodash/cloneDeep'
import { ContentBox } from '../contentBox/index'
import { useChartLayoutStore } from '@/store/modules/chartLayoutStore/chartLayoutStore'
import { ChartLayoutStoreEnum } from '@/store/modules/chartLayoutStore/chartLayoutStore.d'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
import { CreateComponentType } from '@/packages/index.d'
import cloneDeep from 'lodash/cloneDeep'
import { useContextMenu } from '@/views/chart/hooks/useContextMenu.hook'
import { MenuEnum } from '@/enums/editPageEnum'
@ -45,16 +55,36 @@ const chartEditStore = useChartEditStore()
const { handleContextMenu } = useContextMenu()
//
//
const reverseList = computed(() => {
const list: CreateComponentType[] = cloneDeep(chartEditStore.getComponentList)
return list.reverse()
})
//
const backHandle = () => {
chartLayoutStore.setItem(ChartLayoutStoreEnum.LAYERS, false)
}
//
const onMoveCallback = (val: any) => {
const { oldIndex, newIndex } = val.moved
const moveTarget = toRaw(val.moved.element)
if (newIndex - oldIndex > 0) {
//
chartEditStore.getComponentList.splice(-(oldIndex + 1), 1)
chartEditStore.getComponentList.splice(-newIndex, 0, moveTarget)
} else {
//
chartEditStore.getComponentList.splice(-(oldIndex + 1), 1)
if (newIndex === 0) {
chartEditStore.getComponentList.push(moveTarget)
} else {
chartEditStore.getComponentList.splice(-newIndex, 0, moveTarget)
}
}
}
//
const mousedownHandle = (item: CreateComponentType) => {
chartEditStore.setTargetSelectChart(item.id)
@ -81,5 +111,8 @@ $wight: 170px;
&.scoped {
width: 0;
}
.ghost {
opacity: 0;
}
}
</style>