10/15
1. 工作人员账号添加 2. 优化打包 3. 日志 4. 用户头像列表
This commit is contained in:
@@ -9,7 +9,7 @@ VITE_APP_ENV='development'
|
||||
VITE_APP_BASE_API='/dev-api'
|
||||
|
||||
# 本机环境
|
||||
VITE_LOCALHOUSET=true
|
||||
VITE_LOCALHOST=false
|
||||
# 本地开发环境
|
||||
VITE_BASE_API='http://192.168.0.212:8082'
|
||||
#VITE_BASE_API='http://192.168.0.212:8082'
|
||||
|
||||
@@ -56,15 +56,19 @@
|
||||
"@vitejs/plugin-vue": "^6.0.8",
|
||||
"@vue/compiler-sfc": "3.5.42",
|
||||
"autoprefixer": "10.5.5",
|
||||
"esbuild": "0.28.1",
|
||||
"lightningcss": "^1.33.0",
|
||||
"oxfmt": "^0.67.0",
|
||||
"oxlint": "^1.82.0",
|
||||
"sass": "1.104.0",
|
||||
"terser": "^5.51.2",
|
||||
"typescript": "^6.0.3",
|
||||
"unocss": "66.10.1",
|
||||
"unplugin-auto-import": "21.1.0",
|
||||
"unplugin-vue-components": "32.1.0",
|
||||
"unplugin-vue-setup-extend-plus": "1.0.1",
|
||||
"vite": "^8.2.2",
|
||||
"vite-plugin-lightningcss": "^0.0.5",
|
||||
"vite-plugin-svg-icons-ng": "^1.9.3",
|
||||
"vitest": "4.1.11",
|
||||
"vue-tsc": "^3.3.11"
|
||||
|
||||
419
pnpm-lock.yaml
generated
419
pnpm-lock.yaml
generated
@@ -76,7 +76,7 @@ importers:
|
||||
version: 2.6.0(vue@3.5.42(typescript@6.0.3))
|
||||
vue-router:
|
||||
specifier: 5.3.1
|
||||
version: 5.3.1(@vue/compiler-sfc@3.5.42)(pinia@4.0.3(@vue/devtools-api@8.2.1)(typescript@6.0.3)(vue@3.5.42(typescript@6.0.3)))(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))(vue@3.5.42(typescript@6.0.3))
|
||||
version: 5.3.1(@vue/compiler-sfc@3.5.42)(esbuild@0.28.1)(pinia@4.0.3(@vue/devtools-api@8.2.1)(typescript@6.0.3)(vue@3.5.42(typescript@6.0.3)))(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))(vue@3.5.42(typescript@6.0.3))
|
||||
vue-types:
|
||||
specifier: 7.0.0
|
||||
version: 7.0.0(vue@3.5.42(typescript@6.0.3))
|
||||
@@ -101,13 +101,19 @@ importers:
|
||||
version: 66.10.1
|
||||
'@vitejs/plugin-vue':
|
||||
specifier: ^6.0.8
|
||||
version: 6.0.8(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))(vue@3.5.42(typescript@6.0.3))
|
||||
version: 6.0.8(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))(vue@3.5.42(typescript@6.0.3))
|
||||
'@vue/compiler-sfc':
|
||||
specifier: 3.5.42
|
||||
version: 3.5.42
|
||||
autoprefixer:
|
||||
specifier: 10.5.5
|
||||
version: 10.5.5(postcss@8.5.28)
|
||||
esbuild:
|
||||
specifier: 0.28.1
|
||||
version: 0.28.1
|
||||
lightningcss:
|
||||
specifier: ^1.33.0
|
||||
version: 1.33.0
|
||||
oxfmt:
|
||||
specifier: ^0.67.0
|
||||
version: 0.67.0
|
||||
@@ -117,30 +123,36 @@ importers:
|
||||
sass:
|
||||
specifier: 1.104.0
|
||||
version: 1.104.0
|
||||
terser:
|
||||
specifier: ^5.51.2
|
||||
version: 5.51.2
|
||||
typescript:
|
||||
specifier: ^6.0.3
|
||||
version: 6.0.3
|
||||
unocss:
|
||||
specifier: 66.10.1
|
||||
version: 66.10.1(@devframes/hub@0.9.18(crossws@0.4.12(srvx@1.0.4))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4)))(cac@7.0.0)(crossws@0.4.12(srvx@1.0.4))(rolldown@1.2.8)(srvx@1.0.4)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))
|
||||
version: 66.10.1(@devframes/hub@0.9.18(crossws@0.4.12(srvx@1.0.4))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4)))(cac@7.0.0)(crossws@0.4.12(srvx@1.0.4))(rolldown@1.2.8)(srvx@1.0.4)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))
|
||||
unplugin-auto-import:
|
||||
specifier: 21.1.0
|
||||
version: 21.1.0(@vueuse/core@14.4.0(vue@3.5.42(typescript@6.0.3)))(oxc-parser@0.131.0)(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))
|
||||
version: 21.1.0(@vueuse/core@14.4.0(vue@3.5.42(typescript@6.0.3)))(esbuild@0.28.1)(oxc-parser@0.131.0)(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))
|
||||
unplugin-vue-components:
|
||||
specifier: 32.1.0
|
||||
version: 32.1.0(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))(vue@3.5.42(typescript@6.0.3))
|
||||
version: 32.1.0(esbuild@0.28.1)(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))(vue@3.5.42(typescript@6.0.3))
|
||||
unplugin-vue-setup-extend-plus:
|
||||
specifier: 1.0.1
|
||||
version: 1.0.1
|
||||
vite:
|
||||
specifier: ^8.2.2
|
||||
version: 8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0)
|
||||
version: 8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0)
|
||||
vite-plugin-lightningcss:
|
||||
specifier: ^0.0.5
|
||||
version: 0.0.5
|
||||
vite-plugin-svg-icons-ng:
|
||||
specifier: ^1.9.3
|
||||
version: 1.9.3(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))
|
||||
version: 1.9.3(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))
|
||||
vitest:
|
||||
specifier: 4.1.11
|
||||
version: 4.1.11(@types/node@26.1.1)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))
|
||||
version: 4.1.11(@types/node@26.1.1)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))
|
||||
vue-tsc:
|
||||
specifier: ^3.3.11
|
||||
version: 3.3.11(typescript@6.0.3)
|
||||
@@ -223,6 +235,162 @@ packages:
|
||||
'@emnapi/wasi-threads@1.2.1':
|
||||
resolution: {integrity: sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==}
|
||||
|
||||
'@esbuild/aix-ppc64@0.28.1':
|
||||
resolution: {integrity: sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [ppc64]
|
||||
os: [aix]
|
||||
|
||||
'@esbuild/android-arm64@0.28.1':
|
||||
resolution: {integrity: sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [android]
|
||||
|
||||
'@esbuild/android-arm@0.28.1':
|
||||
resolution: {integrity: sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm]
|
||||
os: [android]
|
||||
|
||||
'@esbuild/android-x64@0.28.1':
|
||||
resolution: {integrity: sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [android]
|
||||
|
||||
'@esbuild/darwin-arm64@0.28.1':
|
||||
resolution: {integrity: sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
|
||||
'@esbuild/darwin-x64@0.28.1':
|
||||
resolution: {integrity: sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
|
||||
'@esbuild/freebsd-arm64@0.28.1':
|
||||
resolution: {integrity: sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [freebsd]
|
||||
|
||||
'@esbuild/freebsd-x64@0.28.1':
|
||||
resolution: {integrity: sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [freebsd]
|
||||
|
||||
'@esbuild/linux-arm64@0.28.1':
|
||||
resolution: {integrity: sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-arm@0.28.1':
|
||||
resolution: {integrity: sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-ia32@0.28.1':
|
||||
resolution: {integrity: sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [ia32]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-loong64@0.28.1':
|
||||
resolution: {integrity: sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [loong64]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-mips64el@0.28.1':
|
||||
resolution: {integrity: sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [mips64el]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-ppc64@0.28.1':
|
||||
resolution: {integrity: sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-riscv64@0.28.1':
|
||||
resolution: {integrity: sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-s390x@0.28.1':
|
||||
resolution: {integrity: sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-x64@0.28.1':
|
||||
resolution: {integrity: sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/netbsd-arm64@0.28.1':
|
||||
resolution: {integrity: sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [netbsd]
|
||||
|
||||
'@esbuild/netbsd-x64@0.28.1':
|
||||
resolution: {integrity: sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [netbsd]
|
||||
|
||||
'@esbuild/openbsd-arm64@0.28.1':
|
||||
resolution: {integrity: sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [openbsd]
|
||||
|
||||
'@esbuild/openbsd-x64@0.28.1':
|
||||
resolution: {integrity: sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [openbsd]
|
||||
|
||||
'@esbuild/openharmony-arm64@0.28.1':
|
||||
resolution: {integrity: sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [openharmony]
|
||||
|
||||
'@esbuild/sunos-x64@0.28.1':
|
||||
resolution: {integrity: sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [sunos]
|
||||
|
||||
'@esbuild/win32-arm64@0.28.1':
|
||||
resolution: {integrity: sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
|
||||
'@esbuild/win32-ia32@0.28.1':
|
||||
resolution: {integrity: sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [ia32]
|
||||
os: [win32]
|
||||
|
||||
'@esbuild/win32-x64@0.28.1':
|
||||
resolution: {integrity: sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
|
||||
'@floating-ui/core@1.8.0':
|
||||
resolution: {integrity: sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ==}
|
||||
|
||||
@@ -275,6 +443,9 @@ packages:
|
||||
resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
|
||||
'@jridgewell/source-map@0.3.11':
|
||||
resolution: {integrity: sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==}
|
||||
|
||||
'@jridgewell/sourcemap-codec@1.5.5':
|
||||
resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==}
|
||||
|
||||
@@ -1332,6 +1503,9 @@ packages:
|
||||
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
|
||||
hasBin: true
|
||||
|
||||
buffer-from@1.1.2:
|
||||
resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==}
|
||||
|
||||
cac@7.0.0:
|
||||
resolution: {integrity: sha512-tixWYgm5ZoOD+3g6UTea91eow5z6AAHaho3g0V9CNSNb45gM8SmflpAc+GRd1InC4AqN/07Unrgp56Y94N9hJQ==}
|
||||
engines: {node: '>=20.19.0'}
|
||||
@@ -1377,6 +1551,9 @@ packages:
|
||||
resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==}
|
||||
engines: {node: '>=16'}
|
||||
|
||||
commander@2.20.3:
|
||||
resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==}
|
||||
|
||||
compute-scroll-into-view@3.1.1:
|
||||
resolution: {integrity: sha512-VRhuHOLoKYOy4UbilLbUzbYg93XLjv2PncJC50EuTWPA3gaja1UjBsUP/D/9/juV3vQFr6XBEzn9KCAHdUvOHw==}
|
||||
|
||||
@@ -1547,6 +1724,11 @@ packages:
|
||||
resolution: {integrity: sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==}
|
||||
engines: {node: '>=0.12'}
|
||||
|
||||
esbuild@0.28.1:
|
||||
resolution: {integrity: sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==}
|
||||
engines: {node: '>=18'}
|
||||
hasBin: true
|
||||
|
||||
escalade@3.2.0:
|
||||
resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==}
|
||||
engines: {node: '>=6'}
|
||||
@@ -2146,6 +2328,13 @@ packages:
|
||||
resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
source-map-support@0.5.21:
|
||||
resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==}
|
||||
|
||||
source-map@0.6.1:
|
||||
resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
sourcemap-codec@1.4.8:
|
||||
resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==}
|
||||
deprecated: Please use @jridgewell/sourcemap-codec instead
|
||||
@@ -2185,6 +2374,11 @@ packages:
|
||||
engines: {node: '>=16'}
|
||||
hasBin: true
|
||||
|
||||
terser@5.51.2:
|
||||
resolution: {integrity: sha512-bWnjSNscmuI+GJze6ZupnHP8G/cTcsJF+bXCeQknk2SHQsgbNJnLrqiH9jZ2W4STPVXH2mDKKRX3iwPhc9Cn/Q==}
|
||||
engines: {node: '>=10'}
|
||||
hasBin: true
|
||||
|
||||
tinybench@2.9.0:
|
||||
resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==}
|
||||
|
||||
@@ -2359,6 +2553,9 @@ packages:
|
||||
vfile@6.0.3:
|
||||
resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==}
|
||||
|
||||
vite-plugin-lightningcss@0.0.5:
|
||||
resolution: {integrity: sha512-lhz5GkXeRT/k09A7qEqmoL3CwdJDHgODPeGVlWGU1UxuGPEKfvSpKnDXza8nawKvxvc0eawJEsKjBzQP4AeGHw==}
|
||||
|
||||
vite-plugin-svg-icons-ng@1.9.3:
|
||||
resolution: {integrity: sha512-hrMOB7jx/xjtKgC2oZbz/HCOD0gjFEpowZmzeOn10W3Jt6XQfk3YEHZteuNEWFhvwYF7y1GPjQCQrCuqXC7MnQ==}
|
||||
engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}
|
||||
@@ -2605,13 +2802,13 @@ snapshots:
|
||||
devframe: 0.9.18(cac@7.0.0)(srvx@1.0.4)
|
||||
shiki: 4.4.3
|
||||
|
||||
'@devframes/vite@0.9.18(@devframes/hub@0.9.18(crossws@0.4.12(srvx@1.0.4))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4)))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4))(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))':
|
||||
'@devframes/vite@0.9.18(@devframes/hub@0.9.18(crossws@0.4.12(srvx@1.0.4))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4)))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4))(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))':
|
||||
dependencies:
|
||||
devframe: 0.9.18(cac@7.0.0)(srvx@1.0.4)
|
||||
pathe: 2.0.3
|
||||
optionalDependencies:
|
||||
'@devframes/hub': 0.9.18(crossws@0.4.12(srvx@1.0.4))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4))
|
||||
vite: 8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0)
|
||||
vite: 8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0)
|
||||
|
||||
'@element-plus/icons-vue@2.3.2(vue@3.5.42(typescript@6.0.3))':
|
||||
dependencies:
|
||||
@@ -2633,6 +2830,84 @@ snapshots:
|
||||
tslib: 2.8.1
|
||||
optional: true
|
||||
|
||||
'@esbuild/aix-ppc64@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/android-arm64@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/android-arm@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/android-x64@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/darwin-arm64@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/darwin-x64@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/freebsd-arm64@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/freebsd-x64@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-arm64@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-arm@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-ia32@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-loong64@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-mips64el@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-ppc64@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-riscv64@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-s390x@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-x64@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/netbsd-arm64@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/netbsd-x64@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/openbsd-arm64@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/openbsd-x64@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/openharmony-arm64@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/sunos-x64@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/win32-arm64@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/win32-ia32@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@esbuild/win32-x64@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@floating-ui/core@1.8.0':
|
||||
dependencies:
|
||||
'@floating-ui/utils': 0.2.12
|
||||
@@ -2692,6 +2967,11 @@ snapshots:
|
||||
|
||||
'@jridgewell/resolve-uri@3.1.2': {}
|
||||
|
||||
'@jridgewell/source-map@0.3.11':
|
||||
dependencies:
|
||||
'@jridgewell/gen-mapping': 0.3.13
|
||||
'@jridgewell/trace-mapping': 0.3.31
|
||||
|
||||
'@jridgewell/sourcemap-codec@1.5.5': {}
|
||||
|
||||
'@jridgewell/sourcemap-codec@1.6.0': {}
|
||||
@@ -3136,14 +3416,14 @@ snapshots:
|
||||
dependencies:
|
||||
'@unocss/core': 66.10.1
|
||||
|
||||
'@unocss/inspector@66.10.1(@devframes/hub@0.9.18(crossws@0.4.12(srvx@1.0.4))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4)))(cac@7.0.0)(crossws@0.4.12(srvx@1.0.4))(srvx@1.0.4)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))':
|
||||
'@unocss/inspector@66.10.1(@devframes/hub@0.9.18(crossws@0.4.12(srvx@1.0.4))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4)))(cac@7.0.0)(crossws@0.4.12(srvx@1.0.4))(srvx@1.0.4)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))':
|
||||
dependencies:
|
||||
'@devframes/service-shiki': 0.9.18(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4))
|
||||
'@devframes/vite': 0.9.18(@devframes/hub@0.9.18(crossws@0.4.12(srvx@1.0.4))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4)))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4))(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))
|
||||
'@devframes/vite': 0.9.18(@devframes/hub@0.9.18(crossws@0.4.12(srvx@1.0.4))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4)))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4))(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))
|
||||
'@unocss/config': 66.10.1
|
||||
'@unocss/core': 66.10.1
|
||||
'@unocss/rule-utils': 66.10.1
|
||||
'@vitejs/devtools-kit': 0.7.3(cac@7.0.0)(crossws@0.4.12(srvx@1.0.4))(srvx@1.0.4)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))
|
||||
'@vitejs/devtools-kit': 0.7.3(cac@7.0.0)(crossws@0.4.12(srvx@1.0.4))(srvx@1.0.4)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))
|
||||
colorette: 2.0.20
|
||||
devframe: 0.9.18(cac@7.0.0)(srvx@1.0.4)
|
||||
tinyglobby: 0.2.17
|
||||
@@ -3248,18 +3528,18 @@ snapshots:
|
||||
dependencies:
|
||||
'@unocss/core': 66.10.1
|
||||
|
||||
'@unocss/vite@66.10.1(@devframes/hub@0.9.18(crossws@0.4.12(srvx@1.0.4))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4)))(cac@7.0.0)(crossws@0.4.12(srvx@1.0.4))(srvx@1.0.4)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))':
|
||||
'@unocss/vite@66.10.1(@devframes/hub@0.9.18(crossws@0.4.12(srvx@1.0.4))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4)))(cac@7.0.0)(crossws@0.4.12(srvx@1.0.4))(srvx@1.0.4)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))':
|
||||
dependencies:
|
||||
'@jridgewell/remapping': 2.3.5
|
||||
'@unocss/config': 66.10.1
|
||||
'@unocss/core': 66.10.1
|
||||
'@unocss/inspector': 66.10.1(@devframes/hub@0.9.18(crossws@0.4.12(srvx@1.0.4))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4)))(cac@7.0.0)(crossws@0.4.12(srvx@1.0.4))(srvx@1.0.4)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))
|
||||
'@unocss/inspector': 66.10.1(@devframes/hub@0.9.18(crossws@0.4.12(srvx@1.0.4))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4)))(cac@7.0.0)(crossws@0.4.12(srvx@1.0.4))(srvx@1.0.4)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))
|
||||
chokidar: 5.0.0
|
||||
magic-string: 1.3.1
|
||||
pathe: 2.0.3
|
||||
tinyglobby: 0.2.17
|
||||
unplugin-utils: 0.3.2
|
||||
vite: 8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0)
|
||||
vite: 8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0)
|
||||
transitivePeerDependencies:
|
||||
- '@devframes/hub'
|
||||
- '@devframes/hub-ui'
|
||||
@@ -3308,7 +3588,7 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- preact-render-to-string
|
||||
|
||||
'@vitejs/devtools-kit@0.7.3(cac@7.0.0)(crossws@0.4.12(srvx@1.0.4))(srvx@1.0.4)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))':
|
||||
'@vitejs/devtools-kit@0.7.3(cac@7.0.0)(crossws@0.4.12(srvx@1.0.4))(srvx@1.0.4)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))':
|
||||
dependencies:
|
||||
'@devframes/hub': 0.9.18(crossws@0.4.12(srvx@1.0.4))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4))
|
||||
'@devframes/json-render': 0.9.18(@devframes/hub@0.9.18(crossws@0.4.12(srvx@1.0.4))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4)))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4))
|
||||
@@ -3317,7 +3597,7 @@ snapshots:
|
||||
mlly: 1.8.2
|
||||
nostics: 1.2.0
|
||||
nypm: 0.6.10
|
||||
vite: 8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0)
|
||||
vite: 8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0)
|
||||
transitivePeerDependencies:
|
||||
- '@modelcontextprotocol/client'
|
||||
- cac
|
||||
@@ -3325,10 +3605,10 @@ snapshots:
|
||||
- ocache
|
||||
- srvx
|
||||
|
||||
'@vitejs/plugin-vue@6.0.8(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))(vue@3.5.42(typescript@6.0.3))':
|
||||
'@vitejs/plugin-vue@6.0.8(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))(vue@3.5.42(typescript@6.0.3))':
|
||||
dependencies:
|
||||
'@rolldown/pluginutils': 1.0.1
|
||||
vite: 8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0)
|
||||
vite: 8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0)
|
||||
vue: 3.5.42(typescript@6.0.3)
|
||||
|
||||
'@vitest/expect@4.1.11':
|
||||
@@ -3340,13 +3620,13 @@ snapshots:
|
||||
chai: 6.2.2
|
||||
tinyrainbow: 3.1.1
|
||||
|
||||
'@vitest/mocker@4.1.11(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))':
|
||||
'@vitest/mocker@4.1.11(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))':
|
||||
dependencies:
|
||||
'@vitest/spy': 4.1.11
|
||||
estree-walker: 3.0.3
|
||||
magic-string: 0.30.21
|
||||
optionalDependencies:
|
||||
vite: 8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0)
|
||||
vite: 8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0)
|
||||
|
||||
'@vitest/pretty-format@4.1.11':
|
||||
dependencies:
|
||||
@@ -3670,6 +3950,8 @@ snapshots:
|
||||
node-releases: 2.0.55
|
||||
update-browserslist-db: 1.3.2(browserslist@4.28.9)
|
||||
|
||||
buffer-from@1.1.2: {}
|
||||
|
||||
cac@7.0.0: {}
|
||||
|
||||
call-bind-apply-helpers@1.0.2:
|
||||
@@ -3703,6 +3985,8 @@ snapshots:
|
||||
|
||||
commander@11.1.0: {}
|
||||
|
||||
commander@2.20.3: {}
|
||||
|
||||
compute-scroll-into-view@3.1.1: {}
|
||||
|
||||
confbox@0.1.8: {}
|
||||
@@ -3882,6 +4166,35 @@ snapshots:
|
||||
d: 1.0.2
|
||||
ext: 1.7.0
|
||||
|
||||
esbuild@0.28.1:
|
||||
optionalDependencies:
|
||||
'@esbuild/aix-ppc64': 0.28.1
|
||||
'@esbuild/android-arm': 0.28.1
|
||||
'@esbuild/android-arm64': 0.28.1
|
||||
'@esbuild/android-x64': 0.28.1
|
||||
'@esbuild/darwin-arm64': 0.28.1
|
||||
'@esbuild/darwin-x64': 0.28.1
|
||||
'@esbuild/freebsd-arm64': 0.28.1
|
||||
'@esbuild/freebsd-x64': 0.28.1
|
||||
'@esbuild/linux-arm': 0.28.1
|
||||
'@esbuild/linux-arm64': 0.28.1
|
||||
'@esbuild/linux-ia32': 0.28.1
|
||||
'@esbuild/linux-loong64': 0.28.1
|
||||
'@esbuild/linux-mips64el': 0.28.1
|
||||
'@esbuild/linux-ppc64': 0.28.1
|
||||
'@esbuild/linux-riscv64': 0.28.1
|
||||
'@esbuild/linux-s390x': 0.28.1
|
||||
'@esbuild/linux-x64': 0.28.1
|
||||
'@esbuild/netbsd-arm64': 0.28.1
|
||||
'@esbuild/netbsd-x64': 0.28.1
|
||||
'@esbuild/openbsd-arm64': 0.28.1
|
||||
'@esbuild/openbsd-x64': 0.28.1
|
||||
'@esbuild/openharmony-arm64': 0.28.1
|
||||
'@esbuild/sunos-x64': 0.28.1
|
||||
'@esbuild/win32-arm64': 0.28.1
|
||||
'@esbuild/win32-ia32': 0.28.1
|
||||
'@esbuild/win32-x64': 0.28.1
|
||||
|
||||
escalade@3.2.0: {}
|
||||
|
||||
escape-string-regexp@5.0.0: {}
|
||||
@@ -4483,6 +4796,13 @@ snapshots:
|
||||
|
||||
source-map-js@1.2.1: {}
|
||||
|
||||
source-map-support@0.5.21:
|
||||
dependencies:
|
||||
buffer-from: 1.1.2
|
||||
source-map: 0.6.1
|
||||
|
||||
source-map@0.6.1: {}
|
||||
|
||||
sourcemap-codec@1.4.8: {}
|
||||
|
||||
space-separated-tokens@2.0.2: {}
|
||||
@@ -4525,6 +4845,13 @@ snapshots:
|
||||
picocolors: 1.1.1
|
||||
sax: 1.6.1
|
||||
|
||||
terser@5.51.2:
|
||||
dependencies:
|
||||
'@jridgewell/source-map': 0.3.11
|
||||
acorn: 8.18.0
|
||||
commander: 2.20.3
|
||||
source-map-support: 0.5.21
|
||||
|
||||
tinybench@2.9.0: {}
|
||||
|
||||
tinyexec@1.3.1: {}
|
||||
@@ -4568,7 +4895,7 @@ snapshots:
|
||||
|
||||
undici-types@8.3.0: {}
|
||||
|
||||
unimport@6.5.0(oxc-parser@0.131.0)(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0)):
|
||||
unimport@6.5.0(esbuild@0.28.1)(oxc-parser@0.131.0)(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0)):
|
||||
dependencies:
|
||||
acorn: 8.18.0
|
||||
escape-string-regexp: 5.0.0
|
||||
@@ -4582,7 +4909,7 @@ snapshots:
|
||||
scule: 1.3.0
|
||||
strip-literal: 4.0.0
|
||||
tinyglobby: 0.2.17
|
||||
unplugin: 3.3.0(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))
|
||||
unplugin: 3.3.0(esbuild@0.28.1)(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))
|
||||
unplugin-utils: 0.3.2
|
||||
optionalDependencies:
|
||||
oxc-parser: 0.131.0
|
||||
@@ -4620,7 +4947,7 @@ snapshots:
|
||||
unist-util-is: 6.0.1
|
||||
unist-util-visit-parents: 6.0.2
|
||||
|
||||
unocss@66.10.1(@devframes/hub@0.9.18(crossws@0.4.12(srvx@1.0.4))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4)))(cac@7.0.0)(crossws@0.4.12(srvx@1.0.4))(rolldown@1.2.8)(srvx@1.0.4)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0)):
|
||||
unocss@66.10.1(@devframes/hub@0.9.18(crossws@0.4.12(srvx@1.0.4))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4)))(cac@7.0.0)(crossws@0.4.12(srvx@1.0.4))(rolldown@1.2.8)(srvx@1.0.4)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0)):
|
||||
dependencies:
|
||||
'@unocss/cli': 66.10.1
|
||||
'@unocss/core': 66.10.1
|
||||
@@ -4639,7 +4966,7 @@ snapshots:
|
||||
'@unocss/transformer-compile-class': 66.10.1
|
||||
'@unocss/transformer-directives': 66.10.1
|
||||
'@unocss/transformer-variant-group': 66.10.1
|
||||
'@unocss/vite': 66.10.1(@devframes/hub@0.9.18(crossws@0.4.12(srvx@1.0.4))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4)))(cac@7.0.0)(crossws@0.4.12(srvx@1.0.4))(srvx@1.0.4)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))
|
||||
'@unocss/vite': 66.10.1(@devframes/hub@0.9.18(crossws@0.4.12(srvx@1.0.4))(devframe@0.9.18(cac@7.0.0)(srvx@1.0.4)))(cac@7.0.0)(crossws@0.4.12(srvx@1.0.4))(srvx@1.0.4)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))
|
||||
transitivePeerDependencies:
|
||||
- '@devframes/hub'
|
||||
- '@devframes/hub-ui'
|
||||
@@ -4652,13 +4979,13 @@ snapshots:
|
||||
- srvx
|
||||
- vite
|
||||
|
||||
unplugin-auto-import@21.1.0(@vueuse/core@14.4.0(vue@3.5.42(typescript@6.0.3)))(oxc-parser@0.131.0)(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0)):
|
||||
unplugin-auto-import@21.1.0(@vueuse/core@14.4.0(vue@3.5.42(typescript@6.0.3)))(esbuild@0.28.1)(oxc-parser@0.131.0)(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0)):
|
||||
dependencies:
|
||||
local-pkg: 1.2.1
|
||||
magic-string: 1.3.1
|
||||
picomatch: 4.0.7
|
||||
unimport: 6.5.0(oxc-parser@0.131.0)(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))
|
||||
unplugin: 3.3.0(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))
|
||||
unimport: 6.5.0(esbuild@0.28.1)(oxc-parser@0.131.0)(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))
|
||||
unplugin: 3.3.0(esbuild@0.28.1)(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))
|
||||
unplugin-utils: 0.3.2
|
||||
optionalDependencies:
|
||||
'@vueuse/core': 14.4.0(vue@3.5.42(typescript@6.0.3))
|
||||
@@ -4679,7 +5006,7 @@ snapshots:
|
||||
pathe: 2.0.3
|
||||
picomatch: 4.0.5
|
||||
|
||||
unplugin-vue-components@32.1.0(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))(vue@3.5.42(typescript@6.0.3)):
|
||||
unplugin-vue-components@32.1.0(esbuild@0.28.1)(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))(vue@3.5.42(typescript@6.0.3)):
|
||||
dependencies:
|
||||
chokidar: 5.0.0
|
||||
local-pkg: 1.2.1
|
||||
@@ -4688,7 +5015,7 @@ snapshots:
|
||||
obug: 2.1.4
|
||||
picomatch: 4.0.5
|
||||
tinyglobby: 0.2.17
|
||||
unplugin: 3.3.0(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))
|
||||
unplugin: 3.3.0(esbuild@0.28.1)(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))
|
||||
unplugin-utils: 0.3.2
|
||||
vue: 3.5.42(typescript@6.0.3)
|
||||
transitivePeerDependencies:
|
||||
@@ -4720,14 +5047,15 @@ snapshots:
|
||||
picomatch: 4.0.7
|
||||
webpack-virtual-modules: 0.6.2
|
||||
|
||||
unplugin@3.3.0(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0)):
|
||||
unplugin@3.3.0(esbuild@0.28.1)(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0)):
|
||||
dependencies:
|
||||
'@jridgewell/remapping': 2.3.5
|
||||
picomatch: 4.0.5
|
||||
webpack-virtual-modules: 0.6.2
|
||||
optionalDependencies:
|
||||
esbuild: 0.28.1
|
||||
rolldown: 1.2.8
|
||||
vite: 8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0)
|
||||
vite: 8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0)
|
||||
|
||||
update-browserslist-db@1.3.2(browserslist@4.28.9):
|
||||
dependencies:
|
||||
@@ -4745,13 +5073,18 @@ snapshots:
|
||||
'@types/unist': 3.0.3
|
||||
vfile-message: 4.0.3
|
||||
|
||||
vite-plugin-svg-icons-ng@1.9.3(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0)):
|
||||
vite-plugin-lightningcss@0.0.5:
|
||||
dependencies:
|
||||
browserslist: 4.28.9
|
||||
lightningcss: 1.33.0
|
||||
|
||||
vite-plugin-svg-icons-ng@1.9.3(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0)):
|
||||
dependencies:
|
||||
svg-icon-baker: 2.1.1
|
||||
tinyglobby: 0.2.17
|
||||
vite: 8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0)
|
||||
vite: 8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0)
|
||||
|
||||
vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0):
|
||||
vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0):
|
||||
dependencies:
|
||||
lightningcss: 1.33.0
|
||||
picomatch: 4.0.7
|
||||
@@ -4760,15 +5093,17 @@ snapshots:
|
||||
tinyglobby: 0.2.17
|
||||
optionalDependencies:
|
||||
'@types/node': 26.1.1
|
||||
esbuild: 0.28.1
|
||||
fsevents: 2.3.3
|
||||
jiti: 2.7.0
|
||||
sass: 1.104.0
|
||||
terser: 5.51.2
|
||||
yaml: 2.9.0
|
||||
|
||||
vitest@4.1.11(@types/node@26.1.1)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0)):
|
||||
vitest@4.1.11(@types/node@26.1.1)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0)):
|
||||
dependencies:
|
||||
'@vitest/expect': 4.1.11
|
||||
'@vitest/mocker': 4.1.11(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))
|
||||
'@vitest/mocker': 4.1.11(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))
|
||||
'@vitest/pretty-format': 4.1.11
|
||||
'@vitest/runner': 4.1.11
|
||||
'@vitest/snapshot': 4.1.11
|
||||
@@ -4785,7 +5120,7 @@ snapshots:
|
||||
tinyexec: 1.3.1
|
||||
tinyglobby: 0.2.17
|
||||
tinyrainbow: 3.1.1
|
||||
vite: 8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0)
|
||||
vite: 8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0)
|
||||
why-is-node-running: 2.3.0
|
||||
optionalDependencies:
|
||||
'@types/node': 26.1.1
|
||||
@@ -4810,7 +5145,7 @@ snapshots:
|
||||
dependencies:
|
||||
vue: 3.5.42(typescript@6.0.3)
|
||||
|
||||
vue-router@5.3.1(@vue/compiler-sfc@3.5.42)(pinia@4.0.3(@vue/devtools-api@8.2.1)(typescript@6.0.3)(vue@3.5.42(typescript@6.0.3)))(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))(vue@3.5.42(typescript@6.0.3)):
|
||||
vue-router@5.3.1(@vue/compiler-sfc@3.5.42)(esbuild@0.28.1)(pinia@4.0.3(@vue/devtools-api@8.2.1)(typescript@6.0.3)(vue@3.5.42(typescript@6.0.3)))(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))(vue@3.5.42(typescript@6.0.3)):
|
||||
dependencies:
|
||||
'@vue-macros/common': 3.1.4(vue@3.5.42(typescript@6.0.3))
|
||||
'@vue/devtools-api': 8.2.1
|
||||
@@ -4826,13 +5161,13 @@ snapshots:
|
||||
picomatch: 4.0.7
|
||||
scule: 1.3.0
|
||||
tinyglobby: 0.2.17
|
||||
unplugin: 3.3.0(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0))
|
||||
unplugin: 3.3.0(esbuild@0.28.1)(rolldown@1.2.8)(vite@8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0))
|
||||
unplugin-utils: 0.3.2
|
||||
vue: 3.5.42(typescript@6.0.3)
|
||||
optionalDependencies:
|
||||
'@vue/compiler-sfc': 3.5.42
|
||||
pinia: 4.0.3(@vue/devtools-api@8.2.1)(typescript@6.0.3)(vue@3.5.42(typescript@6.0.3))
|
||||
vite: 8.2.2(@types/node@26.1.1)(jiti@2.7.0)(sass@1.104.0)(yaml@2.9.0)
|
||||
vite: 8.2.2(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(sass@1.104.0)(terser@5.51.2)(yaml@2.9.0)
|
||||
transitivePeerDependencies:
|
||||
- '@farmfe/core'
|
||||
- '@rspack/core'
|
||||
|
||||
@@ -20,7 +20,7 @@ export const listAgreement = (query?: AgreementQuery): AxiosPromise<PageResult<A
|
||||
* 查询协议配置详细
|
||||
* @param agreementId
|
||||
*/
|
||||
export const getAgreement = (agreementId: string | number): AxiosPromise<AgreementVO> => {
|
||||
export const getAgreement = (agreementId: string): AxiosPromise<AgreementVO> => {
|
||||
return request({
|
||||
url: '/system/agreement/' + agreementId,
|
||||
method: 'get'
|
||||
|
||||
@@ -2,7 +2,7 @@ export interface AgreementVO {
|
||||
/**
|
||||
* 主键(雪花)
|
||||
*/
|
||||
agreementId: string | number;
|
||||
agreementId: string;
|
||||
/**
|
||||
* 协议编号
|
||||
*/
|
||||
@@ -26,7 +26,7 @@ export interface AgreementVO {
|
||||
/**
|
||||
* 状态(0草稿 1已生效 2停用)
|
||||
*/
|
||||
status: boolean;
|
||||
status: string;
|
||||
/**
|
||||
* 生效时间
|
||||
*/
|
||||
@@ -41,7 +41,7 @@ export interface AgreementForm extends BaseEntity {
|
||||
/**
|
||||
* 主键(雪花)
|
||||
*/
|
||||
agreementId?: string | number;
|
||||
agreementId?: string;
|
||||
/**
|
||||
* 协议编号
|
||||
*/
|
||||
@@ -65,7 +65,7 @@ export interface AgreementForm extends BaseEntity {
|
||||
/**
|
||||
* 状态(0草稿 1已生效 2停用)
|
||||
*/
|
||||
status?: boolean;
|
||||
status?: string;
|
||||
/**
|
||||
* 生效时间
|
||||
*/
|
||||
|
||||
@@ -72,3 +72,22 @@ export const closeCsSession = (sessionId: string) => {
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
type overView = {
|
||||
"statuses": {
|
||||
"count": number,
|
||||
"status": string,
|
||||
"statusName": string
|
||||
}[],
|
||||
"total": number
|
||||
}
|
||||
/**
|
||||
* 查看客服会话状态统计
|
||||
*/
|
||||
export const overViewCsSession = (): AxiosPromise<overView> => {
|
||||
return request({
|
||||
url: '/cs/session/statusCount',
|
||||
method: 'get',
|
||||
});
|
||||
};
|
||||
|
||||
@@ -2,10 +2,11 @@ import request from '@/utils/request';
|
||||
import {deskSessionType, listUserType} from "@/api/system/csSession/type";
|
||||
import type {AxiosPromise} from '@/utils/api-types';
|
||||
|
||||
export type UserListType = 'all' | 'queue' | 'recentEnded' | 'serving'
|
||||
/**
|
||||
* 查询客服负责用户列表
|
||||
*/
|
||||
export const csAgentDesk = (userType) => {
|
||||
export const csAgentDesk = (userType: UserListType) => {
|
||||
return request({
|
||||
url: '/cs/agent/desk',
|
||||
method: 'get',
|
||||
@@ -41,10 +42,24 @@ export const getDeskCsAgentHistory = (sessionId: string, afterSeq: number = 0, e
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
export type AgentPresenceType = {
|
||||
activeSessionCount: number;
|
||||
agentId: string;
|
||||
loginDate: string;
|
||||
nickName: string;
|
||||
onlineStatus: string;
|
||||
onlineStatusName: string;
|
||||
phone: string;
|
||||
status: string;
|
||||
userName: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询可以转接的客服列表
|
||||
*/
|
||||
export const getAgentPresence = () => {
|
||||
export const getAgentPresence = (): AxiosPromise<AgentPresenceType[]> => {
|
||||
return request({
|
||||
url: `/cs/agent/presence`,
|
||||
method: 'get',
|
||||
|
||||
@@ -24,8 +24,9 @@ export type Device = {
|
||||
}
|
||||
|
||||
export type Session = {
|
||||
agentId: null;
|
||||
agentName: null;
|
||||
agentId: string;
|
||||
latestSeq: number;
|
||||
agentName: string;
|
||||
queueNo: number;
|
||||
sessionId: string;
|
||||
startTime: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { PostVO } from '@/api/system/post/types';
|
||||
import type { RoleVO } from '@/api/system/role/types';
|
||||
import type {PostVO} from '@/api/system/post/types';
|
||||
import type {RoleVO} from '@/api/system/role/types';
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
@@ -69,7 +69,7 @@ export interface UserForm {
|
||||
status: string;
|
||||
remark?: string;
|
||||
avatar?: string | number;
|
||||
postIds: string[];
|
||||
postIds?: string[];
|
||||
roleIds: string[];
|
||||
}
|
||||
|
||||
|
||||
BIN
src/assets/images/noSession.png
Normal file
BIN
src/assets/images/noSession.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 235 KiB |
@@ -1,4 +1,6 @@
|
||||
@use 'element-plus/dist/index.css';
|
||||
// Element Plus 全量 CSS 已移除,改为通过 unplugin-vue-components + ElementPlusResolver
|
||||
// 按需引入组件 SCSS(importStyle: 'sass'),仅打包实际使用到的组件样式
|
||||
// 下方保留项目对 Element Plus 组件的样式覆盖层(_overrides / _dialog 等)
|
||||
@use 'overrides';
|
||||
@use './misc';
|
||||
@use './dialog';
|
||||
|
||||
@@ -260,7 +260,11 @@ watch(
|
||||
([type, val]) => {
|
||||
if (type === 'uploadUserAvatar') {
|
||||
const str = val as string
|
||||
imageUrl.value = str.trim() === '' ? defaultImag : str
|
||||
if (str) {
|
||||
imageUrl.value = str.trim() === '' ? defaultImag : str
|
||||
} else {
|
||||
imageUrl.value = defaultImag
|
||||
}
|
||||
}
|
||||
},
|
||||
{immediate: true}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
/>
|
||||
</div>
|
||||
<router-link v-else-if="showLogo" to="/" class="navtop-logo-shell">
|
||||
<img :src="appLogo" class="navtop-logo-icon" alt="logo" />
|
||||
<img :src="appLogo" alt="logo" class="navtop-logo-icon"/>
|
||||
</router-link>
|
||||
<div class="nav-context">
|
||||
<breadcrumb v-if="navType == NavTypeEnum.LEFT && isDashboard(route)" id="breadcrumb-container"
|
||||
@@ -29,7 +29,7 @@
|
||||
<template #reference>
|
||||
<el-badge :value="noticeStore.unreadCount.value > 0 ? noticeStore.unreadCount.value : ''" :max="99">
|
||||
<div class="right-menu-item hover-effect message-trigger">
|
||||
<svg-icon icon-class="message" />
|
||||
<svg-icon icon-class="message"/>
|
||||
</div>
|
||||
</el-badge>
|
||||
</template>
|
||||
@@ -43,12 +43,14 @@
|
||||
<div class="avatar-container">
|
||||
<el-dropdown class="avatar-dropdown" trigger="click" @command="handleCommand">
|
||||
<div class="avatar-wrapper">
|
||||
<img :src="userStore.avatar" class="user-avatar" />
|
||||
<img :src="userStore.avatar" class="user-avatar"/>
|
||||
<div class="avatar-meta">
|
||||
<span class="avatar-name">{{ displayName }}</span>
|
||||
<span class="avatar-role">Workspace</span>
|
||||
</div>
|
||||
<el-icon class="avatar-arrow"><caret-bottom /></el-icon>
|
||||
<el-icon class="avatar-arrow">
|
||||
<caret-bottom/>
|
||||
</el-icon>
|
||||
</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
@@ -70,24 +72,25 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { ElMessageBoxOptions } from 'element-plus';
|
||||
import { CaretBottom } from '@element-plus/icons-vue';
|
||||
import type {ElMessageBoxOptions} from 'element-plus';
|
||||
import {CaretBottom} from '@element-plus/icons-vue';
|
||||
import appLogo from '@/assets/logo/logo.png';
|
||||
import { NavTypeEnum } from '@/enums/NavTypeEnum';
|
||||
import {NavTypeEnum} from '@/enums/NavTypeEnum';
|
||||
import tab from '@/plugins/tab';
|
||||
import router from '@/router';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { useNoticeStore } from '@/store/modules/notice';
|
||||
import { useSettingsStore } from '@/store/modules/settings';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import {useAppStore} from '@/store/modules/app';
|
||||
import {useNoticeStore} from '@/store/modules/notice';
|
||||
import {useSettingsStore} from '@/store/modules/settings';
|
||||
import {useUserStore} from '@/store/modules/user';
|
||||
import notice from './notice/index.vue';
|
||||
import TopBar from './TopBar/index.vue';
|
||||
import SearchMenu from './TopBar/search.vue';
|
||||
import {RouteLocationMatched, RouteLocationNormalizedLoadedGeneric} from "vue-router";
|
||||
import {RouteLocationNormalizedLoadedGeneric} from "vue-router";
|
||||
import {useCsSessionStore} from "@/store/modules/csSession";
|
||||
|
||||
const route = useRoute();
|
||||
const appStore = useAppStore();
|
||||
const userStore = useUserStore();
|
||||
const csSessionStore = useCsSessionStore();
|
||||
const settingsStore = useSettingsStore();
|
||||
const noticeStore = storeToRefs(useNoticeStore());
|
||||
|
||||
@@ -126,6 +129,7 @@ const logout = async () => {
|
||||
redirect: encodeURIComponent(router.currentRoute.value.fullPath || '/')
|
||||
}
|
||||
});
|
||||
csSessionStore.destroyWs()
|
||||
tab.closeAllPage();
|
||||
});
|
||||
};
|
||||
@@ -165,17 +169,15 @@ const handleCommand = (command: string) => {
|
||||
border: 1px solid var(--app-surface-border);
|
||||
background: var(--app-surface-bg);
|
||||
box-shadow: var(--app-shadow-sm);
|
||||
transition:
|
||||
transform 0.2s ease,
|
||||
border-color 0.2s ease,
|
||||
box-shadow 0.2s ease;
|
||||
transition: transform 0.2s ease,
|
||||
border-color 0.2s ease,
|
||||
box-shadow 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-1px);
|
||||
border-color: rgba(64, 158, 255, 0.22);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.76),
|
||||
0 10px 22px rgba(15, 23, 42, 0.08);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76),
|
||||
0 10px 22px rgba(15, 23, 42, 0.08);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,9 +345,8 @@ const handleCommand = (command: string) => {
|
||||
|
||||
&.hover-effect {
|
||||
cursor: pointer;
|
||||
transition:
|
||||
background 0.3s,
|
||||
color 0.3s;
|
||||
transition: background 0.3s,
|
||||
color 0.3s;
|
||||
|
||||
&:hover {
|
||||
background: var(--app-accent-soft);
|
||||
@@ -383,9 +384,8 @@ const handleCommand = (command: string) => {
|
||||
border: 1px solid var(--app-surface-border);
|
||||
min-width: 0;
|
||||
cursor: pointer;
|
||||
transition:
|
||||
background 0.3s,
|
||||
border-color 0.3s;
|
||||
transition: background 0.3s,
|
||||
border-color 0.3s;
|
||||
|
||||
&:hover {
|
||||
background: var(--app-accent-soft);
|
||||
@@ -437,17 +437,15 @@ html.dark {
|
||||
.navbar.navtop .navtop-logo-shell {
|
||||
background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.82));
|
||||
border-color: rgba(71, 85, 105, 0.42);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.06),
|
||||
0 8px 18px rgba(0, 0, 0, 0.24);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06),
|
||||
0 8px 18px rgba(0, 0, 0, 0.24);
|
||||
}
|
||||
|
||||
.navbar.navtop .topbar-container {
|
||||
background: linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.7));
|
||||
border-color: rgba(71, 85, 105, 0.34);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.05),
|
||||
0 8px 22px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05),
|
||||
0 8px 22px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.navbar .right-menu .right-menu-item,
|
||||
|
||||
@@ -72,8 +72,6 @@ export const useCsSessionStore = defineStore('csSession', () => {
|
||||
userInfoMain: null as deskSessionType | null,
|
||||
userType: '',
|
||||
});
|
||||
// 拉去了多少条消息 用于判断是否需要加载更多
|
||||
const loadedMessages = ref(1); // 已加载的消息数量 * 最大消息数
|
||||
// 发送消息 状态 true 发送中
|
||||
const sending = ref(false);
|
||||
|
||||
@@ -85,7 +83,7 @@ export const useCsSessionStore = defineStore('csSession', () => {
|
||||
const currentSessionId = ref<string>('');
|
||||
// 当前客服负责用户 客户端会话id (唯一标识) 发送消息用
|
||||
const currentClientSessionId = () => {
|
||||
return state.userInfoMain.customer.userNo + '-' + Date.now() + '-' + localStorage.getItem('userInfo')
|
||||
return state.userInfoMain.customer.userNo + '-' + Date.now() + '-' + sessionStorage.getItem('userInfo')
|
||||
};
|
||||
// 客服负责所有用户的消息
|
||||
const allUsersMessages = reactive<Record<string, any[]>>({});
|
||||
@@ -128,7 +126,6 @@ export const useCsSessionStore = defineStore('csSession', () => {
|
||||
// 消息会话 是 当前会话时,才更新最后消息到侧边栏
|
||||
if (item.sessionId === sessionId) {
|
||||
|
||||
|
||||
if (data.msgType === 'image') {
|
||||
item.lastMessage = '[图片]'
|
||||
} else {
|
||||
@@ -251,7 +248,7 @@ export const useCsSessionStore = defineStore('csSession', () => {
|
||||
setCurrentUserInfoMain(obj as deskSessionType)
|
||||
}
|
||||
});
|
||||
ws.registerHandler('cs:session', (pkt) => {
|
||||
ws.registerHandler('cs:session', () => {
|
||||
getRightUserList();
|
||||
});
|
||||
// cs:message 接受消息
|
||||
@@ -260,11 +257,11 @@ export const useCsSessionStore = defineStore('csSession', () => {
|
||||
setAllUsersMessages(pkt.data.sessionId, pkt.data)
|
||||
});
|
||||
// cs:saved 发送消息成功
|
||||
ws.registerHandler('cs:saved', (pkt) => {
|
||||
ws.registerHandler('cs:saved', () => {
|
||||
setSending(false)
|
||||
});
|
||||
// cs:ERROR 失败
|
||||
ws.registerHandler('cs:error', (pkt) => {
|
||||
ws.registerHandler('cs:error', () => {
|
||||
setSending(false)
|
||||
});
|
||||
|
||||
@@ -314,15 +311,18 @@ export const useCsSessionStore = defineStore('csSession', () => {
|
||||
|
||||
|
||||
/* ===================== 用户列表 ===================== */
|
||||
|
||||
function setUserLists(lists: Partial<Record<UserListType, any[]>>) {
|
||||
Object.assign(userLists.value, lists);
|
||||
}
|
||||
|
||||
const getUserLists = computed(() => {
|
||||
return userLists.value[activeUserType.value];
|
||||
})
|
||||
|
||||
function setReadCount(sessionId: string, count: number) {
|
||||
userLists.value[activeUserType.value].forEach(item => {
|
||||
if (item.sessionId === sessionId) {
|
||||
item.unreadCount = count;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/* ===================== 当前会话操作 ===================== */
|
||||
|
||||
/** 点击左侧某个用户 → 发起/恢复会话 */
|
||||
@@ -346,11 +346,32 @@ export const useCsSessionStore = defineStore('csSession', () => {
|
||||
|
||||
/** 关闭当前会话 */
|
||||
function closeSession() {
|
||||
if (ws && currentSessionId.value) {
|
||||
ws.send({type: 'session_end', data: {sessionId: currentSessionId.value}});
|
||||
const client = getWs()
|
||||
if (!client) {
|
||||
console.warn('ws 未连接,无法发送')
|
||||
return
|
||||
}
|
||||
currentSessionId.value = '';
|
||||
currentMessages.value = [];
|
||||
let sendObj = {
|
||||
"type": "end",
|
||||
"sessionId": currentSessionId.value,
|
||||
"clientMsgId": currentClientSessionId()
|
||||
}
|
||||
try {
|
||||
// 客服发送消息
|
||||
setSending(true)
|
||||
client.sendString(JSON.stringify(sendObj))
|
||||
toggleSession()
|
||||
} catch (err) {
|
||||
console.error('消息发送失败:', err)
|
||||
}
|
||||
}
|
||||
|
||||
// 切换会话
|
||||
function toggleSession() {
|
||||
setCurrentUser(null)
|
||||
setCurrentUserInfoMain(null)
|
||||
initAllUsersMessages([], true)
|
||||
setCurrentSessionId('')
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -366,7 +387,6 @@ export const useCsSessionStore = defineStore('csSession', () => {
|
||||
currentStartSessionIdList,
|
||||
handleLoadMoreMessages,
|
||||
initAllUsersMessages,
|
||||
setAllUsersMessages,
|
||||
setCurrentSessionId,
|
||||
setCurrentUser,
|
||||
setCurrentUserInfoMain,
|
||||
@@ -374,10 +394,11 @@ export const useCsSessionStore = defineStore('csSession', () => {
|
||||
wsStatus,
|
||||
getWs,
|
||||
ensureWs,
|
||||
destroyWs,
|
||||
setUserLists,
|
||||
getRightUserList,
|
||||
getUserLists,
|
||||
setReadCount,
|
||||
toggleSession,
|
||||
destroyWs,
|
||||
closeSession,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -54,7 +54,7 @@ export const useUserStore = defineStore('user', () => {
|
||||
} else {
|
||||
roles.value = ['ROLE_DEFAULT'];
|
||||
}
|
||||
localStorage.setItem('userInfo', data.user.userId.toString());
|
||||
sessionStorage.setItem('userInfo', data.user.userId.toString());
|
||||
name.value = user.userName;
|
||||
nickname.value = user.nickName;
|
||||
avatar.value = profile;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</template>
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true" class="query-form">
|
||||
<el-form-item label="登录地址" prop="ipaddr">
|
||||
<el-input v-model="queryParams.ipaddr" placeholder="请输入登录地址" clearable @keyup.enter="handleQuery" />
|
||||
<el-input v-model="queryParams.ipaddr" clearable placeholder="请输入登录地址" @keyup.enter="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户名称" prop="userName">
|
||||
<el-input
|
||||
@@ -24,7 +24,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="登录状态" clearable>
|
||||
<el-option v-for="dict in sys_common_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
<el-option v-for="dict in sys_common_status" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="登录时间" style="width: 308px">
|
||||
@@ -102,8 +102,8 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
@sort-change="handleSortChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="访问编号" align="center" prop="infoId" />
|
||||
<el-table-column align="center" type="selection" width="55"/>
|
||||
<!-- <el-table-column label="访问编号" align="center" prop="infoId" />-->
|
||||
<el-table-column
|
||||
label="用户名称"
|
||||
align="center"
|
||||
@@ -112,22 +112,22 @@
|
||||
sortable="custom"
|
||||
:sort-orders="['descending', 'ascending']"
|
||||
/>
|
||||
<el-table-column label="客户端" align="center" prop="clientKey" :show-overflow-tooltip="true" />
|
||||
<!-- <el-table-column label="客户端" align="center" prop="clientKey" :show-overflow-tooltip="true"/>-->
|
||||
<el-table-column label="设备类型" align="center">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_device_type" :value="scope.row.deviceType" />
|
||||
<dict-tag :options="sys_device_type" :value="scope.row.deviceType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="地址" align="center" prop="ipaddr" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="登录地点" align="center" prop="loginLocation" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作系统" align="center" prop="os" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="浏览器" align="center" prop="browser" :show-overflow-tooltip="true" />
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="地址" prop="ipaddr"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="登录地点" prop="loginLocation"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="操作系统" prop="os"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="浏览器" prop="browser"/>
|
||||
<el-table-column label="登录状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_common_status" :value="scope.row.status" />
|
||||
<dict-tag :options="sys_common_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="描述" align="center" prop="msg" :show-overflow-tooltip="true" />
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="描述" prop="msg"/>
|
||||
<el-table-column
|
||||
label="访问时间"
|
||||
align="center"
|
||||
@@ -154,27 +154,27 @@
|
||||
</template>
|
||||
|
||||
<script setup name="LoginInfo" lang="ts">
|
||||
import { list, delLoginInfo, cleanLoginInfo, unlockLoginInfo } from '@/api/monitor/logininfo';
|
||||
import { LoginInfoQuery, LoginInfoVO } from '@/api/monitor/logininfo/types';
|
||||
import { useLoading } from '@/hooks/async/useLoading';
|
||||
import { useDateRangeQuery } from '@/hooks/form/useDateRangeQuery';
|
||||
import { useSearchReset } from '@/hooks/form/useSearchReset';
|
||||
import { useSearchToggle } from '@/hooks/form/useSearchToggle';
|
||||
import { useTableSelection } from '@/hooks/table/useTableSelection';
|
||||
import { useTableSortQuery } from '@/hooks/table/useTableSortQuery';
|
||||
import {list, delLoginInfo, cleanLoginInfo, unlockLoginInfo} from '@/api/monitor/logininfo';
|
||||
import {LoginInfoQuery, LoginInfoVO} from '@/api/monitor/logininfo/types';
|
||||
import {useLoading} from '@/hooks/async/useLoading';
|
||||
import {useDateRangeQuery} from '@/hooks/form/useDateRangeQuery';
|
||||
import {useSearchReset} from '@/hooks/form/useSearchReset';
|
||||
import {useSearchToggle} from '@/hooks/form/useSearchToggle';
|
||||
import {useTableSelection} from '@/hooks/table/useTableSelection';
|
||||
import {useTableSortQuery} from '@/hooks/table/useTableSortQuery';
|
||||
import modal from '@/plugins/modal';
|
||||
import { useDict } from '@/utils/dict';
|
||||
import { download as requestDownload } from '@/utils/request';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import {useDict} from '@/utils/dict';
|
||||
import {download as requestDownload} from '@/utils/request';
|
||||
import {parseTime} from '@/utils/ruoyi';
|
||||
|
||||
const { sys_device_type } = toRefs<any>(useDict('sys_device_type'));
|
||||
const { sys_common_status } = toRefs<any>(useDict('sys_common_status'));
|
||||
const {sys_device_type} = toRefs<any>(useDict('sys_device_type'));
|
||||
const {sys_common_status} = toRefs<any>(useDict('sys_common_status'));
|
||||
|
||||
const loginInfoList = ref<LoginInfoVO[]>([]);
|
||||
const { loading, withLoading } = useLoading(true);
|
||||
const { showSearch } = useSearchToggle();
|
||||
const {loading, withLoading} = useLoading(true);
|
||||
const {showSearch} = useSearchToggle();
|
||||
const total = ref(0);
|
||||
const { dateRange, applyDateRange, resetDateRange } = useDateRangeQuery();
|
||||
const {dateRange, applyDateRange, resetDateRange} = useDateRangeQuery();
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const loginInfoTableRef = ref<ElTableInstance>();
|
||||
@@ -205,10 +205,10 @@ const getList = async () => {
|
||||
total.value = res.data?.total;
|
||||
});
|
||||
};
|
||||
const { defaultSort, handleSortChange, resetSort } = useTableSortQuery<LoginInfoQuery>({
|
||||
const {defaultSort, handleSortChange, resetSort} = useTableSortQuery<LoginInfoQuery>({
|
||||
queryParams,
|
||||
tableRef: loginInfoTableRef,
|
||||
defaultSort: { prop: 'loginTime', order: 'descending' },
|
||||
defaultSort: {prop: 'loginTime', order: 'descending'},
|
||||
onSortChange: getList
|
||||
});
|
||||
/** 搜索按钮操作 */
|
||||
@@ -216,7 +216,7 @@ const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
const { resetQuery } = useSearchReset({
|
||||
const {resetQuery} = useSearchReset({
|
||||
queryFormRef,
|
||||
queryParams,
|
||||
pageNumKey: 'pageNum',
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
</template>
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true" class="query-form">
|
||||
<el-form-item label="操作地址" prop="operIp">
|
||||
<el-input v-model="queryParams.operIp" placeholder="请输入操作地址" clearable @keyup.enter="handleQuery" />
|
||||
<el-input v-model="queryParams.operIp" clearable placeholder="请输入操作地址" @keyup.enter="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="系统模块" prop="title">
|
||||
<el-input v-model="queryParams.title" placeholder="请输入系统模块" clearable @keyup.enter="handleQuery" />
|
||||
<el-input v-model="queryParams.title" clearable placeholder="请输入系统模块" @keyup.enter="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="操作人员" prop="operName">
|
||||
<el-input
|
||||
@@ -26,27 +26,27 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户端" prop="clientKey">
|
||||
<el-input v-model="queryParams.clientKey" placeholder="请输入客户端" clearable @keyup.enter="handleQuery" />
|
||||
<el-input v-model="queryParams.clientKey" clearable placeholder="请输入客户端" @keyup.enter="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型" prop="deviceType">
|
||||
<el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" clearable>
|
||||
<el-option v-for="dict in sys_device_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
<el-option v-for="dict in sys_device_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="浏览器" prop="browser">
|
||||
<el-input v-model="queryParams.browser" placeholder="请输入浏览器" clearable @keyup.enter="handleQuery" />
|
||||
<el-input v-model="queryParams.browser" clearable placeholder="请输入浏览器" @keyup.enter="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="操作系统" prop="os">
|
||||
<el-input v-model="queryParams.os" placeholder="请输入操作系统" clearable @keyup.enter="handleQuery" />
|
||||
<el-input v-model="queryParams.os" clearable placeholder="请输入操作系统" @keyup.enter="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="businessType">
|
||||
<el-select v-model="queryParams.businessType" placeholder="操作类型" clearable>
|
||||
<el-option v-for="dict in sys_oper_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
<el-option v-for="dict in sys_oper_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="操作状态" clearable>
|
||||
<el-option v-for="dict in sys_common_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
<el-option v-for="dict in sys_common_status" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="操作时间" style="width: 308px">
|
||||
@@ -120,12 +120,12 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
@sort-change="handleSortChange"
|
||||
>
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="日志编号" align="center" prop="operId" />
|
||||
<el-table-column label="系统模块" align="center" prop="title" :show-overflow-tooltip="true" />
|
||||
<el-table-column align="center" type="selection" width="50"/>
|
||||
<!-- <el-table-column label="日志编号" align="center" prop="operId" />-->
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="系统模块" prop="title" width="120"/>
|
||||
<el-table-column label="操作类型" align="center" prop="businessType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_oper_type" :value="scope.row.businessType" />
|
||||
<dict-tag :options="sys_oper_type" :value="scope.row.businessType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@@ -137,19 +137,19 @@
|
||||
sortable="custom"
|
||||
:sort-orders="['descending', 'ascending']"
|
||||
/>
|
||||
<el-table-column label="部门" align="center" prop="deptName" width="130" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="客户端" align="center" prop="clientKey" width="110" :show-overflow-tooltip="true" />
|
||||
<!-- <el-table-column label="部门" align="center" prop="deptName" width="130" :show-overflow-tooltip="true"/>-->
|
||||
<!-- <el-table-column label="客户端" align="center" prop="clientKey" width="110" :show-overflow-tooltip="true"/>-->
|
||||
<el-table-column label="设备类型" align="center" prop="deviceType" width="110" :show-overflow-tooltip="true">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_device_type" :value="scope.row.deviceType" />
|
||||
<dict-tag :options="sys_device_type" :value="scope.row.deviceType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="浏览器" align="center" prop="browser" width="110" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作系统" align="center" prop="os" width="110" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作地址" align="center" prop="operIp" width="130" :show-overflow-tooltip="true" />
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="浏览器" prop="browser" width="110"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="操作系统" prop="os" width="110"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="操作地址" prop="operIp" width="130"/>
|
||||
<el-table-column label="操作状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_common_status" :value="scope.row.status" />
|
||||
<dict-tag :options="sys_common_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@@ -201,34 +201,34 @@
|
||||
/>
|
||||
</el-card>
|
||||
<!-- 操作日志详细 -->
|
||||
<OperInfoDialog ref="operInfoDialogRef" />
|
||||
<OperInfoDialog ref="operInfoDialogRef"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Operlog" lang="ts">
|
||||
import { list, delOperlog, cleanOperlog } from '@/api/monitor/operlog';
|
||||
import { OperLogForm, OperLogQuery, OperLogVO } from '@/api/monitor/operlog/types';
|
||||
import { useLoading } from '@/hooks/async/useLoading';
|
||||
import { useDateRangeQuery } from '@/hooks/form/useDateRangeQuery';
|
||||
import { useSearchReset } from '@/hooks/form/useSearchReset';
|
||||
import { useSearchToggle } from '@/hooks/form/useSearchToggle';
|
||||
import { useTableSelection } from '@/hooks/table/useTableSelection';
|
||||
import { useTableSortQuery } from '@/hooks/table/useTableSortQuery';
|
||||
import {list, delOperlog, cleanOperlog} from '@/api/monitor/operlog';
|
||||
import {OperLogForm, OperLogQuery, OperLogVO} from '@/api/monitor/operlog/types';
|
||||
import {useLoading} from '@/hooks/async/useLoading';
|
||||
import {useDateRangeQuery} from '@/hooks/form/useDateRangeQuery';
|
||||
import {useSearchReset} from '@/hooks/form/useSearchReset';
|
||||
import {useSearchToggle} from '@/hooks/form/useSearchToggle';
|
||||
import {useTableSelection} from '@/hooks/table/useTableSelection';
|
||||
import {useTableSortQuery} from '@/hooks/table/useTableSortQuery';
|
||||
import modal from '@/plugins/modal';
|
||||
import { useDict } from '@/utils/dict';
|
||||
import { download as requestDownload } from '@/utils/request';
|
||||
import { parseTime, selectDictLabel } from '@/utils/ruoyi';
|
||||
import {useDict} from '@/utils/dict';
|
||||
import {download as requestDownload} from '@/utils/request';
|
||||
import {parseTime, selectDictLabel} from '@/utils/ruoyi';
|
||||
import OperInfoDialog from './operInfoDialog.vue';
|
||||
|
||||
const { sys_oper_type, sys_common_status, sys_device_type } = toRefs<any>(
|
||||
const {sys_oper_type, sys_common_status, sys_device_type} = toRefs<any>(
|
||||
useDict('sys_oper_type', 'sys_common_status', 'sys_device_type')
|
||||
);
|
||||
|
||||
const operlogList = ref<OperLogVO[]>([]);
|
||||
const { loading, withLoading } = useLoading(true);
|
||||
const { showSearch } = useSearchToggle();
|
||||
const {loading, withLoading} = useLoading(true);
|
||||
const {showSearch} = useSearchToggle();
|
||||
const total = ref(0);
|
||||
const { dateRange, applyDateRange, resetDateRange } = useDateRangeQuery();
|
||||
const {dateRange, applyDateRange, resetDateRange} = useDateRangeQuery();
|
||||
|
||||
const operLogTableRef = ref<ElTableInstance>();
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
@@ -281,7 +281,7 @@ const data = reactive<PageData<OperLogForm, OperLogQuery>>({
|
||||
rules: {}
|
||||
});
|
||||
|
||||
const { queryParams, form } = toRefs(data);
|
||||
const {queryParams, form} = toRefs(data);
|
||||
const {
|
||||
ids,
|
||||
multiple,
|
||||
@@ -296,10 +296,10 @@ const getList = async () => {
|
||||
total.value = res.data?.total;
|
||||
});
|
||||
};
|
||||
const { defaultSort, handleSortChange, resetSort } = useTableSortQuery<OperLogQuery>({
|
||||
const {defaultSort, handleSortChange, resetSort} = useTableSortQuery<OperLogQuery>({
|
||||
queryParams,
|
||||
tableRef: operLogTableRef,
|
||||
defaultSort: { prop: 'operTime', order: 'descending' },
|
||||
defaultSort: {prop: 'operTime', order: 'descending'},
|
||||
onSortChange: getList
|
||||
});
|
||||
/** 操作日志类型字典翻译 */
|
||||
@@ -311,7 +311,7 @@ const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
const { resetQuery } = useSearchReset({
|
||||
const {resetQuery} = useSearchReset({
|
||||
queryFormRef,
|
||||
queryParams,
|
||||
pageNumKey: 'pageNum',
|
||||
|
||||
167
src/views/system/agreement/add.vue
Normal file
167
src/views/system/agreement/add.vue
Normal file
@@ -0,0 +1,167 @@
|
||||
<script lang="ts" setup>
|
||||
import FormItemTip from '@/components/FormItemTip/index.vue'
|
||||
import {useRouter} from "vue-router";
|
||||
import {addAgreement, getAgreement, updateAgreement} from "@/api/system/agreement";
|
||||
|
||||
import {useDict} from "@/utils/dict";
|
||||
|
||||
const {com_agreement_type} = toRefs<any>(useDict('com_agreement_type'));
|
||||
const router = useRouter()
|
||||
const initForm = {
|
||||
"agreementId": "",
|
||||
"agreementNo": "",
|
||||
"agreementType": "service",
|
||||
"agreementTypeName": "",
|
||||
"content": "",
|
||||
"createTime": "",
|
||||
"name": "",
|
||||
"publishTime": null,
|
||||
"status": "0",
|
||||
"statusName": "草稿",
|
||||
"updateTime": "",
|
||||
"versionName": ""
|
||||
}
|
||||
|
||||
const formRef = ref<ElFormInstance>()
|
||||
const form = ref(initForm);
|
||||
const rules = {
|
||||
name: [
|
||||
{required: true, message: '协议名称不能为空', trigger: 'blur'},
|
||||
{min: 0, max: 20, message: '协议名称长度必须介于 0 和 20 之间', trigger: 'blur'}
|
||||
],
|
||||
agreementType: [{required: true, message: '协议类型不能为空', trigger: 'blur'}],
|
||||
content: [{required: true, message: '协议内容不能为空', trigger: 'blur'}],
|
||||
};
|
||||
|
||||
function reBack() {
|
||||
router.back()
|
||||
}
|
||||
|
||||
function submit(status: string = '1') {
|
||||
form.value.status = status
|
||||
formRef.value?.validate().then((valid) => {
|
||||
if (valid) {
|
||||
if (route.query.id) {
|
||||
updateAgreement(form.value).then((res) => {
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('修改成功')
|
||||
reBack()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
addAgreement(form.value).then((res) => {
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('新增成功')
|
||||
reBack()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
function init() {
|
||||
if (route.query.id) {
|
||||
getAgreement(route.query.id as string).then((res) => {
|
||||
form.value = {
|
||||
...form.value,
|
||||
...res.data,
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
init()
|
||||
})
|
||||
</script>
|
||||
<template>
|
||||
<div class="Add beautify_scroll">
|
||||
<div class="AddNav">
|
||||
<pagecrumb>
|
||||
<template #rightSlot>
|
||||
<el-button plain type="primary" @click="reBack">返回协议列表</el-button>
|
||||
</template>
|
||||
</pagecrumb>
|
||||
</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-position="top">
|
||||
<div class="commonCard">
|
||||
<card-nav line-color="#10b981" style="margin-bottom: 10px" title="基本信息"></card-nav>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<FormItemTip
|
||||
v-model="form.name"
|
||||
:inputAttrs="{placeholder:'请输入协议名称'}"
|
||||
label="协议名称"
|
||||
prop="name"
|
||||
type="input"
|
||||
></FormItemTip>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<FormItemTip
|
||||
v-model="form.agreementType"
|
||||
:inputAttrs="{placeholder:'请选择协议类型'}"
|
||||
:radioOptions="com_agreement_type"
|
||||
label="协议类型"
|
||||
label-key="label"
|
||||
prop="agreementType"
|
||||
type="select"
|
||||
value-key="value"
|
||||
></FormItemTip>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<FormItemTip
|
||||
v-model="form.versionName"
|
||||
:inputAttrs="{placeholder:'请输入版本号'}"
|
||||
label="版本号"
|
||||
prop="versionName"
|
||||
type="input"
|
||||
></FormItemTip>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="commonCard">
|
||||
<card-nav line-color="#10b981" style="margin-bottom: 10px" title="协议内容"></card-nav>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<editor v-model="form.content"></editor>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="actionBox">
|
||||
<el-button class="btn" type="primary" @click="submit('0')">保存为草稿</el-button>
|
||||
<el-button class="btn submit" type="primary" @click="submit('1')">确认发布</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.Add {
|
||||
padding: 24px;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
|
||||
.actionBox {
|
||||
margin-top: 20px;
|
||||
text-align: center;
|
||||
|
||||
.btn {
|
||||
width: 121px;
|
||||
height: 36px;
|
||||
|
||||
&.submit {
|
||||
background: linear-gradient(90deg, rgba(16, 185, 129, 1) 0%, rgba(13, 148, 136, 1) 100%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
@@ -1,86 +1,27 @@
|
||||
<template>
|
||||
<div class="p-2 page-shell system-agreement-page">
|
||||
<pagecrumb style="margin-top: 20px;"></pagecrumb>
|
||||
<div class="search-wrap">
|
||||
<el-card :class="{ 'is-collapsed': !showSearch }" class="search-panel" shadow="hover">
|
||||
<template #header>
|
||||
<div class="panel-heading search-panel-toggle" @click.stop="showSearch = !showSearch">
|
||||
<div><h3>筛选条件</h3></div>
|
||||
</div>
|
||||
</template>
|
||||
<el-form ref="queryFormRef" :inline="true" :model="queryParams" class="query-form">
|
||||
<el-form-item label="协议编号" prop="agreementNo">
|
||||
<el-input v-model="queryParams.agreementNo" clearable placeholder="请输入协议编号"
|
||||
@keyup.enter="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="agreementType">
|
||||
<el-select v-model="queryParams.agreementType" clearable placeholder="请选择类型">
|
||||
<el-option label="请选择字典生成" value=""/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="协议名称" prop="name">
|
||||
<el-input v-model="queryParams.name" clearable placeholder="请输入协议名称" @keyup.enter="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="versionName">
|
||||
<el-input v-model="queryParams.versionName" clearable placeholder="请输入版本号"
|
||||
@keyup.enter="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" clearable placeholder="请选择状态">
|
||||
<el-option :value="true" label="是"/>
|
||||
<el-option :value="false" label="否"/>
|
||||
<el-option label="已生效" value="1"/>
|
||||
<el-option label="草稿" value="0"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="生效时间" style="width: 308px">
|
||||
<el-date-picker
|
||||
v-model="dateRangePublishTime"
|
||||
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"
|
||||
end-placeholder="结束日期"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
type="daterange"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建部门" prop="createDept">
|
||||
<el-input-number v-model="queryParams.createDept" controls-position="right"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建者" prop="createBy">
|
||||
<el-input-number v-model="queryParams.createBy" controls-position="right"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" style="width: 308px">
|
||||
<el-date-picker
|
||||
v-model="dateRangeCreateTime"
|
||||
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"
|
||||
end-placeholder="结束日期"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
type="daterange"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新者" prop="updateBy">
|
||||
<el-input-number v-model="queryParams.updateBy" controls-position="right"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" style="width: 308px">
|
||||
<el-date-picker
|
||||
v-model="dateRangeUpdateTime"
|
||||
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"
|
||||
end-placeholder="结束日期"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
type="daterange"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="已生效类型;同类型仅一条,非生效或已删除为 NULL" prop="activeType">
|
||||
<el-select v-model="queryParams.activeType"
|
||||
clearable placeholder="请选择已生效类型;同类型仅一条,非生效或已删除为 NULL">
|
||||
<el-option label="请选择字典生成" value=""/>
|
||||
<el-form-item label="协议类型" prop="agreementType">
|
||||
<el-select v-model="queryParams.agreementType" clearable placeholder="请选择协议类型">
|
||||
<el-option v-for="(item,index) in com_agreement_type" :key="index" :label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字" prop="name">
|
||||
<el-input v-model="queryParams.name" clearable placeholder="搜索协议名称" @keyup.enter="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="Search" type="primary" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
<el-button size="large" @click="resetQuery">重置</el-button>
|
||||
<el-button class="activeAddBtn " size="large" style="width:70px;" @click="handleQuery">搜索</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
@@ -90,19 +31,12 @@
|
||||
<template #header>
|
||||
<div class="toolbar-shell">
|
||||
<div class="table-heading">
|
||||
<h3>协议配置列表</h3>
|
||||
<h3>协议列表</h3>
|
||||
<el-tag class="totalTag" type="success">共 {{ total }} 条</el-tag>
|
||||
</div>
|
||||
<div class="toolbar-actions">
|
||||
<el-button v-hasPermi="['system:agreement:add']" icon="Plus" plain type="primary" @click="handleAdd">新增
|
||||
</el-button>
|
||||
<el-button v-hasPermi="['system:agreement:edit']" :disabled="single" icon="Edit" plain type="success"
|
||||
@click="handleUpdate()">修改
|
||||
</el-button>
|
||||
<el-button v-hasPermi="['system:agreement:remove']" :disabled="multiple" icon="Delete" plain type="danger"
|
||||
@click="handleDelete()">删除
|
||||
</el-button>
|
||||
<el-button v-hasPermi="['system:agreement:export']" icon="Download" plain type="warning"
|
||||
@click="handleExport">导出
|
||||
<el-button v-hasPermi="['system:agreement:add']" class="activeAddBtn" type="primary"
|
||||
@click="handleAdd">新增协议
|
||||
</el-button>
|
||||
<right-toolbar v-model:show-search="showSearch" :search="false" @query-table="getList"></right-toolbar>
|
||||
</div>
|
||||
@@ -112,38 +46,35 @@
|
||||
<el-table v-loading="loading" :data="agreementList" border class="data-table"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column align="center" type="selection" width="55"/>
|
||||
<el-table-column align="center" label="主键" prop="agreementId"/>
|
||||
<el-table-column align="center" label="协议编号" prop="agreementNo"/>
|
||||
<el-table-column align="center" label="类型" prop="agreementType"/>
|
||||
<el-table-column align="center" label="协议名称" prop="name"/>
|
||||
<el-table-column align="center" label="类型" prop="agreementType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_agreement_type" :value="scope.row.agreementType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="版本号" prop="versionName"/>
|
||||
<el-table-column align="center" label="协议正文" prop="content"/>
|
||||
<el-table-column align="center" label="状态" prop="status" width="120">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
:active-value="true"
|
||||
:inactive-value="false"
|
||||
disabled
|
||||
/>
|
||||
<el-tag v-if="scope.row.status === '1'" type="primary">已生效</el-tag>
|
||||
<el-tag v-else type="warning">草稿</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="生效时间" prop="publishTime" width="180">
|
||||
<el-table-column align="center" label="最后更新时间" prop="updateTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.publishTime, '{y}-{m}-{d}') }}</span>
|
||||
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="已生效类型;同类型仅一条,非生效或已删除为 NULL" prop="activeType"/>
|
||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button v-hasPermi="['system:agreement:edit']" icon="Edit" link type="primary"
|
||||
@click="handleUpdate(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button v-hasPermi="['system:agreement:remove']" icon="Delete" link type="primary"
|
||||
@click="handleDelete(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
<el-button v-hasPermi="['system:agreement:edit']" link type="primary"
|
||||
@click="handleUpdate(scope.row)">编辑
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.status === '0'" v-hasPermi="['system:agreement:edit']" link type="success"
|
||||
@click="handleSubmit(scope.row)">发布
|
||||
</el-button>
|
||||
<el-button v-hasPermi="['system:agreement:remove']" link type="danger"
|
||||
@click="handleDelete(scope.row)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -246,6 +177,9 @@ import {parseTime} from '@/utils/ruoyi';
|
||||
import modal from '@/plugins/modal';
|
||||
import {download as requestDownload} from '@/utils/request';
|
||||
|
||||
import {useDict} from "@/utils/dict";
|
||||
|
||||
const {com_agreement_type} = toRefs<any>(useDict('com_agreement_type'));
|
||||
|
||||
const agreementList = ref<AgreementVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
@@ -337,7 +271,7 @@ const {dialog, resetForm: reset, openDialog, showDialog, closeDialog} = useFormD
|
||||
formRef: agreementFormRef,
|
||||
initialFormData: initFormData
|
||||
});
|
||||
|
||||
const router = useRouter();
|
||||
/** 查询协议配置列表 */
|
||||
const getList = async () => {
|
||||
await withLoading(async () => {
|
||||
@@ -381,18 +315,34 @@ const {resetQuery} = useSearchReset({
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
openDialog('添加协议配置');
|
||||
// openDialog('添加协议配置');
|
||||
router.push({
|
||||
path: '/system/addAgreeMent',
|
||||
})
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: Partial<AgreementVO>) => {
|
||||
reset();
|
||||
const _agreementId = row?.agreementId || ids.value[0];
|
||||
const res = await getAgreement(_agreementId);
|
||||
Object.assign(form.value, res.data);
|
||||
showDialog('修改协议配置');
|
||||
router.push({
|
||||
path: '/system/addAgreeMent',
|
||||
query: {
|
||||
id: row.agreementId
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
const handleSubmit = (row?: Partial<AgreementVO>) => {
|
||||
updateAgreement({
|
||||
...row,
|
||||
status: '1'
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('发布成功')
|
||||
getList()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
agreementFormRef.value?.validate(async (valid: boolean) => {
|
||||
@@ -436,3 +386,37 @@ onMounted(() => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.system-agreement-page {
|
||||
.table-heading {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
gap: 16px;
|
||||
|
||||
|
||||
.totalTag {
|
||||
width: 53px;
|
||||
height: 18px;
|
||||
border-radius: 9px;
|
||||
background-color: rgba(236, 253, 245, 1);
|
||||
|
||||
line-height: 14px;
|
||||
color: rgba(5, 150, 105, 1);
|
||||
font-size: 12px;
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.activeAddBtn {
|
||||
width: 109px;
|
||||
height: 36px;
|
||||
border-radius: 8px 8px 8px 8px;
|
||||
background: linear-gradient(90deg, rgba(16, 185, 129, 1) 0%, rgba(13, 148, 136, 1) 100%);
|
||||
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -83,8 +83,8 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column align="center" type="selection" width="55"/>
|
||||
<el-table-column v-if="false" align="center" label="id" prop="id"/>
|
||||
<el-table-column align="center" label="客户端id" prop="clientId"/>
|
||||
<!-- <el-table-column v-if="false" align="center" label="id" prop="id"/>-->
|
||||
<!-- <el-table-column align="center" label="客户端id" prop="clientId"/>-->
|
||||
<el-table-column align="center" label="客户端key" prop="clientKey"/>
|
||||
<el-table-column align="center" label="客户端秘钥" prop="clientSecret"/>
|
||||
<el-table-column label="授权类型" align="center">
|
||||
@@ -209,7 +209,7 @@
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content="多个路径可按换行、逗号或分号分隔;为空表示允许访问所有接口路径" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
<el-icon><question-filled/></el-icon>
|
||||
</el-tooltip>
|
||||
允许访问路径
|
||||
</span>
|
||||
@@ -223,7 +223,7 @@
|
||||
content="支持精确IP、通配符和CIDR;多个规则可按换行、逗号或分号分隔;为空表示允许所有IP"
|
||||
placement="top"
|
||||
>
|
||||
<el-icon><question-filled /></el-icon>
|
||||
<el-icon><question-filled/></el-icon>
|
||||
</el-tooltip>
|
||||
IP白名单
|
||||
</span>
|
||||
@@ -239,7 +239,7 @@
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content="指定时间无操作则过期(单位:秒),默认30分钟(1800秒)" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
<el-icon><question-filled/></el-icon>
|
||||
</el-tooltip>
|
||||
Token活跃超时时间
|
||||
</span>
|
||||
@@ -250,7 +250,7 @@
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content="指定时间必定过期(单位:秒),默认七天(604800秒)" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
<el-icon><question-filled/></el-icon>
|
||||
</el-tooltip>
|
||||
Token固定超时时间
|
||||
</span>
|
||||
@@ -276,28 +276,28 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Client" lang="ts">
|
||||
import { listClient, getClient, delClient, addClient, updateClient, changeStatus } from '@/api/system/client';
|
||||
import { ClientVO, ClientQuery, ClientForm } from '@/api/system/client/types';
|
||||
import { useLoading } from '@/hooks/async/useLoading';
|
||||
import { useFormDialog } from '@/hooks/dialog/useFormDialog';
|
||||
import { useSearchReset } from '@/hooks/form/useSearchReset';
|
||||
import { useSearchToggle } from '@/hooks/form/useSearchToggle';
|
||||
import { useTableSelection } from '@/hooks/table/useTableSelection';
|
||||
import {listClient, getClient, delClient, addClient, updateClient, changeStatus} from '@/api/system/client';
|
||||
import {ClientVO, ClientQuery, ClientForm} from '@/api/system/client/types';
|
||||
import {useLoading} from '@/hooks/async/useLoading';
|
||||
import {useFormDialog} from '@/hooks/dialog/useFormDialog';
|
||||
import {useSearchReset} from '@/hooks/form/useSearchReset';
|
||||
import {useSearchToggle} from '@/hooks/form/useSearchToggle';
|
||||
import {useTableSelection} from '@/hooks/table/useTableSelection';
|
||||
import modal from '@/plugins/modal';
|
||||
import { useDict } from '@/utils/dict';
|
||||
import { download as requestDownload } from '@/utils/request';
|
||||
import {useDict} from '@/utils/dict';
|
||||
import {download as requestDownload} from '@/utils/request';
|
||||
import Pagecrumb from '@/components/Pagecrumb/index.vue';
|
||||
|
||||
|
||||
const { sys_normal_disable } = toRefs<any>(useDict('sys_normal_disable'));
|
||||
const { sys_grant_type } = toRefs<any>(useDict('sys_grant_type'));
|
||||
const { sys_device_type } = toRefs<any>(useDict('sys_device_type'));
|
||||
const {sys_normal_disable} = toRefs<any>(useDict('sys_normal_disable'));
|
||||
const {sys_grant_type} = toRefs<any>(useDict('sys_grant_type'));
|
||||
const {sys_device_type} = toRefs<any>(useDict('sys_device_type'));
|
||||
|
||||
const clientList = ref<ClientVO[]>([]);
|
||||
const { loading, withLoading } = useLoading(true);
|
||||
const { loading: buttonLoading, withLoading: withButtonLoading } = useLoading();
|
||||
const { showSearch } = useSearchToggle();
|
||||
const { ids, single, multiple, handleSelectionChange } = useTableSelection<ClientVO>(item => item.id);
|
||||
const {loading, withLoading} = useLoading(true);
|
||||
const {loading: buttonLoading, withLoading: withButtonLoading} = useLoading();
|
||||
const {showSearch} = useSearchToggle();
|
||||
const {ids, single, multiple, handleSelectionChange} = useTableSelection<ClientVO>(item => item.id);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
@@ -319,7 +319,7 @@ const initFormData: ClientForm = {
|
||||
status: '0'
|
||||
};
|
||||
const data = reactive<PageData<ClientForm, ClientQuery>>({
|
||||
form: { ...initFormData },
|
||||
form: {...initFormData},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
@@ -335,22 +335,22 @@ const data = reactive<PageData<ClientForm, ClientQuery>>({
|
||||
status: undefined
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: 'id不能为空', trigger: 'blur' }],
|
||||
clientId: [{ required: true, message: '客户端id不能为空', trigger: 'blur' }],
|
||||
clientKey: [{ required: true, message: '客户端key不能为空', trigger: 'blur' }],
|
||||
clientSecret: [{ required: true, message: '客户端秘钥不能为空', trigger: 'blur' }],
|
||||
grantTypeList: [{ required: true, message: '授权类型不能为空', trigger: 'change' }],
|
||||
deviceType: [{ required: true, message: '设备类型不能为空', trigger: 'change' }]
|
||||
id: [{required: true, message: 'id不能为空', trigger: 'blur'}],
|
||||
clientId: [{required: true, message: '客户端id不能为空', trigger: 'blur'}],
|
||||
clientKey: [{required: true, message: '客户端key不能为空', trigger: 'blur'}],
|
||||
clientSecret: [{required: true, message: '客户端秘钥不能为空', trigger: 'blur'}],
|
||||
grantTypeList: [{required: true, message: '授权类型不能为空', trigger: 'change'}],
|
||||
deviceType: [{required: true, message: '设备类型不能为空', trigger: 'change'}]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
const { dialog, resetForm, openDialog, showDialog, closeDialog } = useFormDialog({
|
||||
const {queryParams, form, rules} = toRefs(data);
|
||||
const {dialog, resetForm, openDialog, showDialog, closeDialog} = useFormDialog({
|
||||
form,
|
||||
formRef: clientFormRef,
|
||||
initialFormData: initFormData
|
||||
});
|
||||
const { resetQuery } = useSearchReset({
|
||||
const {resetQuery} = useSearchReset({
|
||||
queryFormRef,
|
||||
queryParams,
|
||||
pageNumKey: 'pageNum',
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
<template>
|
||||
<div class="agent-message">
|
||||
<img :src="avatar" class="avatar"/>
|
||||
<div class="msg-body">
|
||||
<div class="msg-header">
|
||||
<span class="name">客服{{ name }}</span>
|
||||
<span v-if="tag" class="tag agent-tag">{{ tag }}</span>
|
||||
<span class="time">{{ time }}</span>
|
||||
</div>
|
||||
<!-- 文本消息 -->
|
||||
<div v-if="type === 'text'" class="bubble text-bubble" v-html="content"></div>
|
||||
@@ -13,16 +11,20 @@
|
||||
<div v-else-if="type === 'image'" class="bubble img-bubble">
|
||||
<el-image :preview-src-list="[url]" :src="url" class="chat-img" @click="$emit('preview', url)"/>
|
||||
</div>
|
||||
<div>
|
||||
<span class="time">{{ time }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<img :src="avatar" class="avatar"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import avatar from '@/assets/images/avatar.png'
|
||||
import defaultAvatar from '@/assets/images/avatar.png'
|
||||
|
||||
const props = defineProps({
|
||||
defineProps({
|
||||
name: {type: String, default: '客服'},
|
||||
avatar: {type: String, default: avatar},
|
||||
avatar: {type: String, default: defaultAvatar},
|
||||
content: {type: String, default: ''},
|
||||
url: {type: String, default: ''},
|
||||
type: {type: String as () => 'text' | 'image', default: 'text'},
|
||||
@@ -35,6 +37,7 @@ defineEmits(['preview'])
|
||||
<style scoped>
|
||||
.agent-message {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
@@ -43,11 +46,14 @@ defineEmits(['preview'])
|
||||
height: 36px;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.msg-body {
|
||||
margin-left: 8px;
|
||||
max-width: 75%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.msg-header {
|
||||
@@ -78,12 +84,12 @@ defineEmits(['preview'])
|
||||
}
|
||||
|
||||
.bubble {
|
||||
background: #fff;
|
||||
border-radius: 4px 16px 16px 16px;
|
||||
background: rgba(37, 99, 235, 1);
|
||||
border-radius: 16px 4px 16px 16px;
|
||||
padding: 10px 14px;
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
color: rgba(31, 41, 55, 1);
|
||||
color: rgba(255, 255, 255, 1);
|
||||
}
|
||||
|
||||
.text-bubble {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div class="user-message">
|
||||
<el-image :src="avatar" class="avatar"/>
|
||||
<div class="msg-body">
|
||||
<!-- 文本消息 -->
|
||||
<div v-if="type === 'text'" class="bubble" v-html="content"></div>
|
||||
@@ -9,17 +10,16 @@
|
||||
</div>
|
||||
<div class="time">{{ time }}</div>
|
||||
</div>
|
||||
<el-image :src="avatar" class="avatar"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import avatar from '@/assets/images/avatar.png'
|
||||
import defaultAvatar from '@/assets/images/avatar.png'
|
||||
|
||||
defineProps({
|
||||
content: {type: String, required: true},
|
||||
type: {type: String as () => 'text' | 'image', default: 'text'},
|
||||
avatar: {type: String, default: avatar},
|
||||
avatar: {type: String, default: defaultAvatar},
|
||||
time: {type: String, default: ''},
|
||||
url: {type: String, default: ''}
|
||||
})
|
||||
@@ -28,16 +28,16 @@ defineProps({
|
||||
<style scoped>
|
||||
.user-message {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
justify-content: flex-start;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.msg-body {
|
||||
margin-right: 8px;
|
||||
margin-left: 8px;
|
||||
max-width: 363px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
@@ -48,16 +48,14 @@ defineProps({
|
||||
}
|
||||
|
||||
.bubble {
|
||||
background-color: rgba(37, 99, 235, 1);
|
||||
color: #fff;
|
||||
border-radius: 16px 4px 16px 16px;
|
||||
background-color: #fff;
|
||||
color: #333;
|
||||
border: 1px solid rgba(229, 231, 235, 1);
|
||||
border-radius: 4px 16px 16px 16px;
|
||||
padding: 10px 12px;
|
||||
font-size: 14px;
|
||||
word-break: break-all;
|
||||
|
||||
|
||||
line-height: 22px;
|
||||
color: rgba(255, 255, 255, 1);
|
||||
}
|
||||
|
||||
.img-bubble {
|
||||
|
||||
@@ -13,15 +13,15 @@
|
||||
<UserMessage
|
||||
v-else-if="msg.senderType === 'user'"
|
||||
:avatar="userAvatar"
|
||||
:content="msg.content"
|
||||
:content="msg.content || ''"
|
||||
:time="msg.createTime"
|
||||
:type="msg.msgType"
|
||||
:url="msg.url"
|
||||
:url="msg.url || ''"
|
||||
@retry="handleRetry(msg)"
|
||||
/>
|
||||
<RobotMessage
|
||||
v-else-if="msg.senderType === 'bot'"
|
||||
:content="msg.content"
|
||||
:content="msg.content || ''"
|
||||
:msg-type="msg.msgType"
|
||||
:quick-actions="msg.quickActions"
|
||||
:time="msg.createTime"
|
||||
@@ -29,10 +29,10 @@
|
||||
/>
|
||||
<AgentMessage
|
||||
v-else-if="msg.senderType === 'agent'"
|
||||
:content="msg.content"
|
||||
:content="msg.content || ''"
|
||||
:time="msg.createTime"
|
||||
:type="msg.msgType"
|
||||
:url="msg.url"
|
||||
:url="msg.url || ''"
|
||||
@preview="handlePreview"
|
||||
/>
|
||||
</template>
|
||||
@@ -95,11 +95,9 @@ const scrollToBottom = async () => {
|
||||
await nextTick()
|
||||
const el = listRef.value
|
||||
if (!el) return
|
||||
await new Promise<void>(resolve => {
|
||||
requestAnimationFrame(() => {
|
||||
el.scrollTop = el.scrollHeight
|
||||
resolve()
|
||||
})
|
||||
if (el.scrollHeight <= el.clientHeight) return
|
||||
requestAnimationFrame(() => {
|
||||
el.scrollTop = el.scrollHeight
|
||||
})
|
||||
}
|
||||
|
||||
@@ -115,7 +113,8 @@ const handleScroll = () => {
|
||||
|
||||
watch(
|
||||
() => props.messages.length,
|
||||
async (newLen) => {
|
||||
async (newLen, oldLen) => {
|
||||
console.log(newLen, oldLen)
|
||||
isLoadingMore = false
|
||||
|
||||
if (newLen === 0) return
|
||||
|
||||
@@ -3,6 +3,7 @@ import {useCsSessionStore, userTypeList, type UserListType, listUserType, MAX_ME
|
||||
import MessageList from './compontents/MessageList/index.vue'
|
||||
import ChatInput from "@/views/system/conversation/compontents/ChatInput.vue";
|
||||
import {
|
||||
AgentPresenceType,
|
||||
deskCsAgentDeskBySessionId,
|
||||
getAgentPresence,
|
||||
getDeskCsAgentHistory,
|
||||
@@ -10,12 +11,14 @@ import {
|
||||
} from "@/api/system/csSession";
|
||||
import {parseTime} from "@/utils/ruoyi";
|
||||
import {hiddenPhone} from "@/utils/phone";
|
||||
import {uploadOss} from "@/api/system/oss";
|
||||
import {Device} from "@/api/system/csSession/type";
|
||||
import {useFormDialog} from "@/hooks/dialog/useFormDialog";
|
||||
import {useUserStore} from "@/store/modules/user";
|
||||
import {download as requestDownload} from "@/utils/request";
|
||||
import noSession from '@/assets/images/noSession.png'
|
||||
|
||||
const csSessionStore = useCsSessionStore()
|
||||
|
||||
const userStore = useUserStore()
|
||||
const {
|
||||
state,
|
||||
userInfoMessage,
|
||||
@@ -62,7 +65,6 @@ const onUploadImage = async (file: File) => {
|
||||
// 2. 发送图片消息
|
||||
let res = await handleSaveAvatar(file);
|
||||
if (!res) return
|
||||
console.log(res.data)
|
||||
let sendObj = {
|
||||
"type": "message",
|
||||
"msgType": "image",
|
||||
@@ -93,10 +95,8 @@ async function handlePickUser(userInfo: listUserType) {
|
||||
return
|
||||
}
|
||||
if (currentSessionId.value === userInfo.sessionId) {
|
||||
csSessionStore.setCurrentUser(null)
|
||||
csSessionStore.setCurrentUserInfoMain(null)
|
||||
csSessionStore.initAllUsersMessages([], true)
|
||||
csSessionStore.setCurrentSessionId('')
|
||||
csSessionStore.toggleSession()
|
||||
csSessionStore.setReadCount(userInfo.sessionId, 0)
|
||||
return
|
||||
}
|
||||
// 0. 存储当前用户 id
|
||||
@@ -106,13 +106,14 @@ async function handlePickUser(userInfo: listUserType) {
|
||||
// 2. 调取当前用户信息
|
||||
deskCsAgentDeskBySessionId(userInfo.sessionId).then(res => {
|
||||
csSessionStore.setCurrentUserInfoMain(res.data)
|
||||
console.log(state.value.userInfoMain.customer.avatarUrl)
|
||||
})
|
||||
// 3. 拉去过往新消息
|
||||
// 每次只能拉取 MAX_MESSAGES 条消息
|
||||
let latestSeq = Math.max((userInfo.latestSeq || 0) - MAX_MESSAGES, 0)
|
||||
getDeskCsAgentHistory(userInfo.sessionId, latestSeq).then((res) => {
|
||||
csSessionStore.initAllUsersMessages(res.data)
|
||||
// 4. 重置未读消息数量为 0
|
||||
csSessionStore.setReadCount(userInfo.sessionId, 0)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -121,11 +122,11 @@ const loadingHistory = ref(false)
|
||||
function handleLoadMore() {
|
||||
loadingHistory.value = true
|
||||
if (!currentSessionId.value) return
|
||||
console.log('滚动到顶部了,想要加载更多消息')
|
||||
console.log('加载更多历史消息')
|
||||
// // 每次只能拉取 100 条消息
|
||||
// 1. 得到最早的seq
|
||||
let seq = userInfoMessage.value[0].seq;
|
||||
if (seq === 0) return loadingHistory.value = false;
|
||||
if ((seq === 1 || seq === 0)) return loadingHistory.value = false;
|
||||
// 2. 减去 MAX_MESSAGES 条消息
|
||||
let latestSeq = Math.max(seq - MAX_MESSAGES, 0)
|
||||
// 3. 拉取过往新消息
|
||||
@@ -138,23 +139,7 @@ function handleLoadMore() {
|
||||
|
||||
// 关闭会话
|
||||
function closeSession() {
|
||||
const client = csSessionStore.getWs()
|
||||
if (!client) {
|
||||
console.warn('ws 未连接,无法发送')
|
||||
return
|
||||
}
|
||||
let sendObj = {
|
||||
"type": "end",
|
||||
"sessionId": currentSessionId.value,
|
||||
"clientMsgId": csSessionStore.currentClientSessionId()
|
||||
}
|
||||
try {
|
||||
// 客服发送消息
|
||||
csSessionStore.setSending(true)
|
||||
client.sendString(JSON.stringify(sendObj))
|
||||
} catch (err) {
|
||||
console.error('消息发送失败:', err)
|
||||
}
|
||||
csSessionStore.closeSession()
|
||||
}
|
||||
|
||||
|
||||
@@ -166,7 +151,7 @@ function transferAgent() {
|
||||
}
|
||||
|
||||
// 转接客服列表
|
||||
const acceptAgentList = ref([])
|
||||
const acceptAgentList = ref<AgentPresenceType[]>([])
|
||||
|
||||
// 获取转接客服列表
|
||||
function getAgentList() {
|
||||
@@ -221,11 +206,21 @@ const submitForm = () => {
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
if (!userStore.roles.includes('customer_service')) return
|
||||
// 确保 ws 已连接(store 内部是单例,调多次不会重复 new)
|
||||
csSessionStore.ensureWs()
|
||||
csSessionStore.getRightUserList()
|
||||
})
|
||||
|
||||
function exportCsSessionStore() {
|
||||
if (!currentSessionId.value) return
|
||||
requestDownload(
|
||||
`/cs/session/${currentSessionId.value}/export`,
|
||||
{},
|
||||
`${state.value.userInfoMain.customer.nickName} 聊天记录_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
}
|
||||
|
||||
// 注意:组件销毁时不调 destroyWs——ws 是全局资源,整个登出才销毁
|
||||
// 用户登出时调 csSessionStore.destroyWs()
|
||||
|
||||
@@ -234,6 +229,62 @@ function handleRouteDeviceMain(deviceInfo: Device) {
|
||||
// 跳转设备详情页
|
||||
window.open(`/device/deviceMain?deviceId=${deviceInfo.deviceId}`)
|
||||
}
|
||||
|
||||
// 保持活跃
|
||||
let lastPingTime = 0
|
||||
const PING_COOLDOWN = 10000
|
||||
const floatItems = ref<{ id: number; x: number }[]>([])
|
||||
let floatId = 0
|
||||
|
||||
function handleSavePing() {
|
||||
const id = ++floatId
|
||||
const x = Math.random() * 40 - 20
|
||||
floatItems.value.push({id, x})
|
||||
setTimeout(() => {
|
||||
floatItems.value = floatItems.value.filter(f => f.id !== id)
|
||||
}, 1200)
|
||||
|
||||
const now = Date.now()
|
||||
if (now - lastPingTime < PING_COOLDOWN) {
|
||||
return
|
||||
}
|
||||
const client = csSessionStore.getWs()
|
||||
if (!client) {
|
||||
console.warn('ws 未连接,无法发送')
|
||||
return
|
||||
}
|
||||
let sendObj = {
|
||||
"type": "ping",
|
||||
}
|
||||
try {
|
||||
client.sendString(JSON.stringify(sendObj))
|
||||
lastPingTime = now
|
||||
} catch (err) {
|
||||
console.error('消息发送失败:', err)
|
||||
}
|
||||
}
|
||||
|
||||
const MIN_LOADING_MS = 2000
|
||||
const refreshList = ref(false)
|
||||
let refreshTimer: ReturnType<typeof setTimeout> | null = null
|
||||
|
||||
async function handleRefreshList() {
|
||||
if (!userStore.roles.includes('customer_service')) return
|
||||
if (refreshList.value) return
|
||||
refreshList.value = true
|
||||
const startTime = Date.now()
|
||||
try {
|
||||
await csSessionStore.getRightUserList()
|
||||
} finally {
|
||||
const elapsed = Date.now() - startTime
|
||||
const remain = Math.max(0, MIN_LOADING_MS - elapsed)
|
||||
if (refreshTimer) clearTimeout(refreshTimer)
|
||||
refreshTimer = setTimeout(() => {
|
||||
refreshList.value = false
|
||||
refreshTimer = null
|
||||
}, remain)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -295,11 +346,15 @@ function handleRouteDeviceMain(deviceInfo: Device) {
|
||||
<el-tag v-else-if="state.userInfoMain.session.status ==='3'" type="info">已结束</el-tag>
|
||||
</template>
|
||||
<template #rightSlot>
|
||||
<el-button v-if="state.userInfoMain.session.status == '2'" plain type="primary" @click="transferAgent">
|
||||
<el-button v-if="state.userInfoMain.session.status == '2'" v-hasPermi="['cs:agent:query']" plain
|
||||
type="primary" @click="transferAgent">
|
||||
转接客服
|
||||
</el-button>
|
||||
<el-button plain type="default">导出聊天记录</el-button>
|
||||
<el-button v-if="state.userInfoMain.session.status == '2'" plain type="danger" @click="closeSession">
|
||||
<el-button v-hasPermi="['cs:session:export']" plain type="default" @click="exportCsSessionStore">
|
||||
导出聊天记录
|
||||
</el-button>
|
||||
<el-button v-if="state.userInfoMain.session.status == '2'" v-hasPermi="['cs:session:end']" plain
|
||||
type="danger" @click="closeSession">
|
||||
关闭会话
|
||||
</el-button>
|
||||
<!-- <el-button type="primary" v-else @click="openSession">开启会话</el-button>-->
|
||||
@@ -323,7 +378,7 @@ function handleRouteDeviceMain(deviceInfo: Device) {
|
||||
</div>
|
||||
<div class="content beautify_scroll">
|
||||
<MessageList ref="messageList" :loading-history="loadingHistory" :messages="userInfoMessage"
|
||||
:user-avatar="state.userInfoMain.customer.avatarUrl"
|
||||
:user-avatar="state.userInfoMain.customer.avatarUrl || ''"
|
||||
@load-more="handleLoadMore"></MessageList>
|
||||
</div>
|
||||
<div class="footer">
|
||||
@@ -411,7 +466,23 @@ function handleRouteDeviceMain(deviceInfo: Device) {
|
||||
</el-row>
|
||||
</div>
|
||||
<div v-else class="noContentMain">
|
||||
<span>暂无会话</span>
|
||||
<el-image :src="noSession" alt="暂无会话" class="noSessionImage"></el-image>
|
||||
<div class="title">暂无会话</div>
|
||||
<div class="tip">保持在线,有新消息会立即提醒你</div>
|
||||
<div class="actions">
|
||||
<el-button type="primary" @click="handleSavePing">保持活跃</el-button>
|
||||
<el-button :disabled="refreshList" :loading="refreshList" type="success" @click="handleRefreshList">
|
||||
刷新列表
|
||||
</el-button>
|
||||
<div class="floats">
|
||||
<span
|
||||
v-for="f in floatItems"
|
||||
:key="f.id"
|
||||
:style="{ left: f.x + 'px' }"
|
||||
class="float-plus"
|
||||
>活跃+1</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog v-model="dialog.visible" :title="dialog.title" append-to-body width="500px">
|
||||
<el-form ref="demoFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
@@ -729,6 +800,10 @@ function handleRouteDeviceMain(deviceInfo: Device) {
|
||||
color: rgba(156, 163, 175, 1);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.phone {
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.userWindowNavItem-l-status {
|
||||
@@ -769,10 +844,72 @@ function handleRouteDeviceMain(deviceInfo: Device) {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 14px;
|
||||
background-color: rgba(156, 163, 175, 0.16);
|
||||
|
||||
|
||||
.noSessionImage {
|
||||
width: 200px;
|
||||
height: 150px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 20px;
|
||||
font-weight: 500;
|
||||
color: #0c2255;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.tip {
|
||||
color: gray;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.floats {
|
||||
position: absolute;
|
||||
top: -15px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 100%;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.actions {
|
||||
position: relative;
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.float-plus {
|
||||
position: absolute;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color: #2563eb;
|
||||
text-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
|
||||
animation: floatUp 1.2s ease-out forwards;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes floatUp {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(0) scale(0.6);
|
||||
}
|
||||
20% {
|
||||
opacity: 1;
|
||||
transform: translateY(-10px) scale(1);
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
transform: translateY(-40px) scale(0.9);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="关联设备" prop="deviceId">
|
||||
<el-input v-model="queryParams.deviceId" clearable placeholder="请输入MAC/设备名称" size="large"
|
||||
style="width: 150px" @keyup.enter="handleQuery"/>
|
||||
style="width: 190px" @keyup.enter="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="会话创建时间" prop="startTime">
|
||||
<el-date-picker
|
||||
@@ -85,14 +85,13 @@
|
||||
<span style="margin:0 8px;color: #fff;">全部</span>
|
||||
<span style="color: #fff;font-weight: bold">1286</span>
|
||||
</el-button>
|
||||
<tableTag :num="862" circle-color="#7c3aed" title="机器人接待"></tableTag>
|
||||
<tableTag :num="7" circle-color="#ea580c" title="排队等待"></tableTag>
|
||||
<tableTag :num="12" title="人工接待"></tableTag>
|
||||
<tableTag :num="405" circle-color="#94a3b8" title="已结束"></tableTag>
|
||||
<tableTag v-for="(item,index) in overViewList" :key="index" :circle-color="colorList[index]"
|
||||
:num="item.count"
|
||||
:title="item.statusName"></tableTag>
|
||||
</div>
|
||||
<div>
|
||||
<el-button plain type="info">批量导出</el-button>
|
||||
<el-button plain type="info">刷新</el-button>
|
||||
<el-button plain type="info" @click="handleExport">批量导出会话记录</el-button>
|
||||
<el-button plain type="info" @click="getList">刷新</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -105,7 +104,17 @@
|
||||
>
|
||||
<el-table-column align="center" type="selection"></el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="会话ID" prop="sessionNo"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="用户信息" prop="userNickName"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="用户信息" prop="userNickName">
|
||||
<template #default="scope">
|
||||
<div class="userInfoBox">
|
||||
<div class="nameBox">
|
||||
<i class="circle"></i>
|
||||
<span>{{ scope.row.customer.nickName }}</span>
|
||||
</div>
|
||||
<div style="color: #9CA3AF;font-size: 12px;">{{ hiddenPhone(scope.row.customer.phonenumber) }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="关联设备" prop="deviceId"/>
|
||||
<el-table-column align="center" label="会话状态" width="100">
|
||||
<template #default="scope">
|
||||
@@ -115,7 +124,6 @@
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="当前接待人" prop="agentName" width="160">
|
||||
<template #default="scope">
|
||||
<div class="name">{{ scope.row.agentName }}</div>
|
||||
<div class="no"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="用户问题摘要" prop="summary"/>
|
||||
@@ -123,20 +131,13 @@
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="等待时长" prop="os" width="100"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="最后消息时间" prop="lastMessageTime"
|
||||
width="160"/>
|
||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" min-width="200">
|
||||
<el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作"
|
||||
min-width="200">
|
||||
<template #default="scope">
|
||||
<div>
|
||||
<el-button
|
||||
v-if="scope.row.staus !== '3'"
|
||||
v-hasPermi="['cs:session:query']"
|
||||
type="primary"
|
||||
@click="handleOpenConversation(scope.row)"
|
||||
>进入会话
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['monitor:online:forceLogout']"
|
||||
type="primary"
|
||||
v-else
|
||||
@click="handleMain(scope.row)"
|
||||
>查看会话
|
||||
</el-button>
|
||||
@@ -147,14 +148,6 @@
|
||||
@click="handleUserMain(scope.row)"
|
||||
>用户档案
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['monitor:online:forceLogout']"
|
||||
plain
|
||||
type="danger"
|
||||
v-if="scope.row.status === '2'"
|
||||
@click="handleCloseConversation(scope.row)"
|
||||
>关闭会话
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -171,12 +164,13 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="Online" setup>
|
||||
import {to} from 'await-to-js';
|
||||
import {closeCsSession, listCsSession as initData} from '@/api/system/conversation/index';
|
||||
import {listCsSession as initData, overViewCsSession} from '@/api/system/conversation/index';
|
||||
import {CsSessionQuery, CsSessionVO} from '@/api/system/conversation/types';
|
||||
import modal from '@/plugins/modal';
|
||||
import {useDict} from '@/utils/dict';
|
||||
import {parseTime} from '@/utils/ruoyi';
|
||||
import {hiddenPhone} from "@/utils/phone";
|
||||
import {download as requestDownload} from "@/utils/request";
|
||||
import {useTableSelection} from "@/hooks/table/useTableSelection";
|
||||
import {CsAgentVO} from "@/api/system/cssAgent/types";
|
||||
|
||||
const {com_session_state} = toRefs<any>(useDict('com_session_state'));
|
||||
|
||||
@@ -185,7 +179,7 @@ const router = useRouter();
|
||||
const onlineList = ref<CsSessionVO[]>([]);
|
||||
const loading = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const {ids, single, multiple, handleSelectionChange} = useTableSelection<CsSessionVO>(item => item.sessionId);
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
|
||||
const queryParams = ref<CsSessionQuery>({
|
||||
@@ -214,6 +208,38 @@ const resetQuery = () => {
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
const colorList = ['#7c3aed', '#ea580c', '#1db954', '#94a3b8']
|
||||
const overViewList = ref([
|
||||
{
|
||||
"count": 0,
|
||||
"status": "0",
|
||||
"statusName": "机器人"
|
||||
},
|
||||
{
|
||||
"count": 0,
|
||||
"status": "1",
|
||||
"statusName": "排队"
|
||||
},
|
||||
{
|
||||
"count": 0,
|
||||
"status": "2",
|
||||
"statusName": "人工"
|
||||
},
|
||||
{
|
||||
"count": 0,
|
||||
"status": "3",
|
||||
"statusName": "已结束"
|
||||
}
|
||||
])
|
||||
|
||||
// 查看客服会话状态统计
|
||||
function getOverViewSession() {
|
||||
overViewCsSession().then((res) => {
|
||||
overViewList.value = res.data.statuses || [];
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 用户 档案
|
||||
function handleUserMain(row: Partial<CsSessionVO>) {
|
||||
router.push({
|
||||
@@ -224,8 +250,8 @@ function handleUserMain(row: Partial<CsSessionVO>) {
|
||||
})
|
||||
}
|
||||
|
||||
// 进入会话
|
||||
function handleOpenConversation(row: Partial<CsSessionVO>) {
|
||||
|
||||
function handleMain(row: Partial<CsSessionVO>) {
|
||||
router.push({
|
||||
path: '/conversation/conversationMain',
|
||||
query: {
|
||||
@@ -234,23 +260,20 @@ function handleOpenConversation(row: Partial<CsSessionVO>) {
|
||||
})
|
||||
}
|
||||
|
||||
// close conversation
|
||||
function handleCloseConversation(row: Partial<CsSessionVO>) {
|
||||
closeCsSession(row.sessionId).then(() => {
|
||||
getList();
|
||||
modal.msgSuccess('关闭会话成功')
|
||||
})
|
||||
}
|
||||
|
||||
function handleMain(row: Partial<CsSessionVO>) {
|
||||
console.log(row);
|
||||
router.push({
|
||||
path: '/conversation/conversationMain'
|
||||
})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
requestDownload(
|
||||
'/cs/session/exportSelected',
|
||||
{
|
||||
sessionIds: ids.value.join(',')
|
||||
},
|
||||
`批量会话导出${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getOverViewSession()
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -258,12 +281,36 @@ onMounted(() => {
|
||||
@use '@/assets/styles/components/page-shell' as pageShell;
|
||||
|
||||
@include pageShell.table-crud-page;
|
||||
|
||||
|
||||
.circle {
|
||||
width: 7px;
|
||||
height: 6px;
|
||||
border-radius: 3px;
|
||||
background-color: rgba(124, 58, 237, 1)
|
||||
}
|
||||
|
||||
|
||||
.userInfoBox {
|
||||
|
||||
.nameBox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.circle {
|
||||
display: block;
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
border-radius: 4px;
|
||||
background-color: #EF4444;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
span {
|
||||
color: rgba(37, 99, 235, 1);
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,127 +1,113 @@
|
||||
<script lang="ts" setup>
|
||||
import pageCrumb from '@/components/Pagecrumb/index.vue'
|
||||
|
||||
|
||||
import ChatNavBar from "./compontents/ChatNavBar.vue";
|
||||
import {ChatNavBarType} from "./compontents/types";
|
||||
|
||||
import MessageList from './compontents/MessageList/index.vue'
|
||||
import {initMessages, userAvatar} from "./compontents/data";
|
||||
import ChatInput from "@/views/system/conversation/compontents/ChatInput.vue";
|
||||
import {deskCsAgentDeskBySessionId, getDeskCsAgentHistory} from "@/api/system/csSession";
|
||||
import {hiddenPhone} from "@/utils/phone";
|
||||
import {MAX_MESSAGES} from "@/store/modules/csSession";
|
||||
import {download as requestDownload} from "@/utils/request";
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const defaultImage = import.meta.env.VITE_DEFAULT_USER_IMAGE;
|
||||
const userDevicesList = [
|
||||
{
|
||||
label: 'Z2 空气净化器 · 客厅',
|
||||
model: 'CZ-Z2023',
|
||||
mac: "AA:BB:CC:DD:A3:B6",
|
||||
status: 0,
|
||||
},
|
||||
{
|
||||
label: 'Z2 空气净化器 · 主卧',
|
||||
model: 'CZ-Z2023',
|
||||
mac: "AA:BB:CC:DD:A3:B1",
|
||||
status: 1,
|
||||
},
|
||||
{
|
||||
label: 'Z2 空气净化器 · 儿童房',
|
||||
model: 'CZ-Z2023',
|
||||
mac: "AA:BB:CC:DD:A3:B2",
|
||||
status: 1,
|
||||
},
|
||||
{
|
||||
label: 'Z2 空气净化器 · 次卧',
|
||||
model: 'CZ-Z2023',
|
||||
mac: "AA:BB:CC:DD:A3:B3",
|
||||
status: 0,
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
const form = ref({
|
||||
status: ChatNavBarType.await as ChatNavBarType,
|
||||
time: new Date().toLocaleTimeString(),
|
||||
awaitNum: 3,
|
||||
agentInfo: {
|
||||
no: '8823',
|
||||
name: '小雨'
|
||||
"customer": {
|
||||
"avatarUrl": null,
|
||||
"createTime": "",
|
||||
"nickName": "",
|
||||
"phonenumber": "",
|
||||
"status": "0",
|
||||
"statusName": "正常",
|
||||
"userNo": ""
|
||||
},
|
||||
message: []
|
||||
"devices": [],
|
||||
"session": {
|
||||
"agentId": "",
|
||||
"latestSeq": 0,
|
||||
"agentName": "",
|
||||
"queueNo": null,
|
||||
"sessionId": "",
|
||||
"startTime": "",
|
||||
"status": "3",
|
||||
"statusName": "已结束",
|
||||
"summary": null
|
||||
}
|
||||
})
|
||||
|
||||
const msgList = ref([])
|
||||
|
||||
onMounted(() => {
|
||||
form.value.message = [...initMessages]
|
||||
if (route.query.id) {
|
||||
deskCsAgentDeskBySessionId(route.query.id as string).then(res => {
|
||||
form.value = res.data;
|
||||
let latestSeq = Math.max(form.value.session.latestSeq - MAX_MESSAGES, 0)
|
||||
getDeskCsAgentHistory(form.value.session.sessionId, latestSeq, form.value.session.latestSeq).then(res => {
|
||||
msgList.value = res.data || []
|
||||
console.log(msgList.value)
|
||||
loadingHistory.value = false
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const sending = ref(false)
|
||||
// 发送文本消息
|
||||
const onSendMsg = async (text: string) => {
|
||||
sending.value = true
|
||||
// 组装消息,推入messages列表
|
||||
const newMsg = {
|
||||
id: Date.now().toString(),
|
||||
type: 'chat',
|
||||
role: 'user',
|
||||
msgType: 'text',
|
||||
content: text,
|
||||
time: new Date().toLocaleTimeString(),
|
||||
status: 'sending'
|
||||
}
|
||||
console.log(text)
|
||||
form.value.message.push(newMsg)
|
||||
try {
|
||||
// 请求后端接口
|
||||
// await api.sendChat(...)
|
||||
newMsg.status = 'sent'
|
||||
} catch (err) {
|
||||
newMsg.status = 'failed'
|
||||
} finally {
|
||||
sending.value = false
|
||||
}
|
||||
function rollback() {
|
||||
router.push({
|
||||
path: '/conversation/conversationList',
|
||||
})
|
||||
}
|
||||
|
||||
// 图片上传,拿到File,上传oss拿到url,生成图片消息
|
||||
const onUploadImage = async (file: File) => {
|
||||
// 调用oss上传接口,拿到真实图片url
|
||||
// const url = await uploadOss(file)
|
||||
const url = 'https://xxx.oss-cn-beijing.aliyuncs.com/demo.jpg'
|
||||
const imgMsg = {
|
||||
id: Date.now().toString(),
|
||||
type: 'chat',
|
||||
role: 'user',
|
||||
msgType: 'image',
|
||||
content: url,
|
||||
time: new Date().toLocaleTimeString(),
|
||||
status: 'sending'
|
||||
}
|
||||
form.value.message.push(imgMsg)
|
||||
const loadingHistory = ref(false)
|
||||
|
||||
function handleLoadMore() {
|
||||
console.log('loading history')
|
||||
loadingHistory.value = true
|
||||
if (!form.value.session.sessionId) return
|
||||
console.log('滚动到顶部了,想要加载更多消息')
|
||||
// // 每次只能拉取 100 条消息
|
||||
// 1. 得到最早的seq
|
||||
let seq = msgList.value[0].seq || 0;
|
||||
if (seq === 1 || seq === 0) return loadingHistory.value = false;
|
||||
// 2. 减去 MAX_MESSAGES 条消息
|
||||
let latestSeq = Math.max(seq - MAX_MESSAGES, 0)
|
||||
// 3. 拉取过往新消息
|
||||
// console.log('拉取过往新消息从', latestSeq)
|
||||
getDeskCsAgentHistory(form.value.session.sessionId, latestSeq, seq).then(res => {
|
||||
msgList.value = [...res.data || [], ...msgList.value]
|
||||
loadingHistory.value = false
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// 导出聊天记录
|
||||
function exportCsSessionStore() {
|
||||
requestDownload(
|
||||
`/cs/session/${form.value.session.sessionId}/export`,
|
||||
{},
|
||||
`${form.value.customer.nickName} 聊天记录_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="Main beautify_scroll">
|
||||
<pageCrumb>
|
||||
<template #rightSlot>
|
||||
<el-button plain type="info">返回会话列表</el-button>
|
||||
<el-button plain type="info" @click="rollback">返回会话列表</el-button>
|
||||
</template>
|
||||
</pageCrumb>
|
||||
<div class="commonCard">
|
||||
<card-nav
|
||||
:show-line="false"
|
||||
subTitle="开始时间 2026-09-10 12:44:52 · 等待时长 00:38 · 接入方式:机器人接待 → 转人工"
|
||||
title="CS20260918100038"
|
||||
:title="form.session.sessionId"
|
||||
>
|
||||
<template #subTitle>
|
||||
<span>开始时间 {{ form.session.startTime }} · 接入方式:机器人接待 <span
|
||||
v-if="form.session.status ==='2'||form.session.status ==='3'"> → 转人工</span></span>
|
||||
</template>
|
||||
<template #rightTitle>
|
||||
<el-tag type="primary">人工接待</el-tag>
|
||||
<el-tag v-if="form.session.status ==='2'" type="primary">人工接待</el-tag>
|
||||
<el-tag v-else-if="form.session.status ==='3'" type="info">已结束</el-tag>
|
||||
</template>
|
||||
<template #rightSlot>
|
||||
<el-button plain type="default">导出聊天记录</el-button>
|
||||
<el-button plain type="danger">关闭会话</el-button>
|
||||
<el-button plain type="default" @click="exportCsSessionStore">导出聊天记录</el-button>
|
||||
</template>
|
||||
</card-nav>
|
||||
</div>
|
||||
@@ -129,35 +115,24 @@ const onUploadImage = async (file: File) => {
|
||||
<el-col :lg="16" :md="15" :span="24" :xl="18">
|
||||
<div class="commonCard userWindowBox">
|
||||
<div class="userWindowNav userWindowNavItem">
|
||||
<el-image :src="defaultImage" class="userAvatar"></el-image>
|
||||
<el-image :src="form.customer.avatarUrl || defaultImage" class="userAvatar"></el-image>
|
||||
<div class="userWindowNavItem-l">
|
||||
<div class="userWindowNavItem-l-info">
|
||||
<div>
|
||||
<span class="name">林筱曼</span>
|
||||
<span class="phone">138****6688</span>
|
||||
<span class="name">{{ form.customer.nickName }}</span>
|
||||
<span class="phone">{{ hiddenPhone(form.customer.phonenumber) }}</span>
|
||||
</div>
|
||||
<span class="time">会话时长 06:12</span>
|
||||
</div>
|
||||
<div class="userWindowNavItem-l-status">
|
||||
<i class="circle"></i>
|
||||
<span>用户在线</span>
|
||||
<span style="margin:0 0.5rem;">·</span>
|
||||
<span>正在输入</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content beautify_scroll">
|
||||
<ChatNavBar
|
||||
:agent-info="form.agentInfo"
|
||||
:await-num="form.awaitNum"
|
||||
:time="form.time"
|
||||
:type="form.status"
|
||||
></ChatNavBar>
|
||||
<MessageList :messages="form.message" :user-avatar="userAvatar"></MessageList>
|
||||
<MessageList ref="messageList" :loading-history="loadingHistory" :messages="msgList"
|
||||
:user-avatar="form.customer.avatarUrl || ''"
|
||||
@load-more="handleLoadMore"></MessageList>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<!-- 输入框组件 -->
|
||||
<ChatInput :sending="sending" @send="onSendMsg" @uploadImage="onUploadImage"/>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
@@ -171,37 +146,39 @@ const onUploadImage = async (file: File) => {
|
||||
<ul class="cardUserInfo">
|
||||
<li class="cardUserInfo_item">
|
||||
<span class="label">用户ID</span>
|
||||
<span class="value">U20260918001</span>
|
||||
<span class="value">{{ form.customer.userNo }}</span>
|
||||
</li>
|
||||
<li class="cardUserInfo_item">
|
||||
<span class="label">昵称</span>
|
||||
<span class="value">林小满</span>
|
||||
<span class="value">{{ form.customer.nickName }}</span>
|
||||
</li>
|
||||
<li class="cardUserInfo_item">
|
||||
<span class="label">手机号</span>
|
||||
<span class="value">138****6688</span>
|
||||
<span class="value">{{ hiddenPhone(form.customer.phonenumber) }}</span>
|
||||
</li>
|
||||
<li class="cardUserInfo_item">
|
||||
<span class="label">注册时间</span>
|
||||
<span class="value">2026-01-10 14:20</span>
|
||||
<span class="value">{{ form.customer.createTime }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="userDevicesBox">
|
||||
<card-nav :show-line="false">
|
||||
<template #title>
|
||||
<span class="titleName">名下设备(3台)</span>
|
||||
<span class="titleName">名下设备({{ form.devices.length }}台)</span>
|
||||
</template>
|
||||
<template #rightSlot>
|
||||
<span class="tip">点击可跳转设备详情</span>
|
||||
</template>
|
||||
</card-nav>
|
||||
<ul class="userDevicesList beautify_scroll">
|
||||
<li v-for="(item,index) in userDevicesList" :key="index" class="userDevicesItem">
|
||||
<li v-for="(item,index) in form.devices" :key="index" class="userDevicesItem">
|
||||
<div class="userDevicesItem_item">
|
||||
<div class="userDevicesName">
|
||||
<span>{{ item.label }}</span>
|
||||
<span>{{ item.name }}</span>
|
||||
<span>·</span>
|
||||
<span>{{ item.locationName }}</span>
|
||||
</div>
|
||||
<el-tag v-if="item.status === 0">在线</el-tag>
|
||||
<el-tag v-if="item.status === '1'">在线</el-tag>
|
||||
<el-tag v-else>离线</el-tag>
|
||||
</div>
|
||||
<div class="userDevices_describe">
|
||||
@@ -214,20 +191,16 @@ const onUploadImage = async (file: File) => {
|
||||
<ul class="cardUserInfo" style="margin-bottom: 0">
|
||||
<li class="cardUserInfo_item">
|
||||
<span class="label">会话 ID</span>
|
||||
<span class="value">U20260918001</span>
|
||||
<span class="value">{{ form.session.sessionId }}</span>
|
||||
</li>
|
||||
<li class="cardUserInfo_item">
|
||||
<span class="label">会话开始时间</span>
|
||||
<span class="value">2026-09-10 12:44:52</span>
|
||||
<span class="value">{{ form.session.startTime }}</span>
|
||||
</li>
|
||||
<li class="cardUserInfo_item">
|
||||
<span class="label">接入方式</span>
|
||||
<span class="value">机器人接待 → 转人工</span>
|
||||
</li>
|
||||
<li class="cardUserInfo_item">
|
||||
<span class="label">当前等待时长</span>
|
||||
<span class="value" style="color: #EA580C">00:38</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -339,8 +312,7 @@ const onUploadImage = async (file: File) => {
|
||||
.userWindowNav.userWindowNavItem {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 21px;
|
||||
padding-bottom: 19px;
|
||||
padding: 0 21px 19px;
|
||||
|
||||
.userAvatar {
|
||||
width: 41px;
|
||||
@@ -371,6 +343,10 @@ const onUploadImage = async (file: File) => {
|
||||
color: rgba(156, 163, 175, 1);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.phone {
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.userWindowNavItem-l-status {
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
<el-table-column align="center" label="分类" prop="category" width="100"/>
|
||||
<el-table-column align="center" label="回复内容" prop="content">
|
||||
<template #default="scope">
|
||||
<div class="content" @click="privew(scope.row)">
|
||||
<div class="content" @click="preview(scope.row)">
|
||||
<div v-html="getHtmlSummary(scope.row.content,60)"></div>
|
||||
<div v-if="scope.row.content.length > 60" class="more" style="text-align: left">...点击查看全部</div>
|
||||
</div>
|
||||
@@ -115,50 +115,42 @@
|
||||
:total="total" @pagination="getList"/>
|
||||
</el-card>
|
||||
<!-- 添加或修改客服知识库对话框 -->
|
||||
<el-dialog v-model="privewForm.visible" :title="privewForm.title" append-to-body width="800px">
|
||||
<el-dialog v-model="privetForm.visible" :title="privetForm.title" append-to-body width="800px">
|
||||
<div style="min-height: 300px;max-height:800px;overflow-y: auto;overflow-x:hidden"
|
||||
v-html="privewForm.content"></div>
|
||||
v-html="privetForm.content"></div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="CsKb" setup>
|
||||
import {
|
||||
addCsKb,
|
||||
delCsKb,
|
||||
getCsKb,
|
||||
listCsKb, moveSkb, overViewCsKb,
|
||||
updateCsKb
|
||||
} from '@/api/system/cskb';
|
||||
import {CsKbForm, CsKbQuery, CsKbVO} from '@/api/system/cskb/types';
|
||||
import {useLoading} from '@/hooks/async/useLoading';
|
||||
import {useFormDialog} from '@/hooks/dialog/useFormDialog';
|
||||
import {getHtmlSummary} from '@/utils/richtext'
|
||||
import {useDateRangeQuery} from '@/hooks/form/useDateRangeQuery';
|
||||
import {useSearchReset} from '@/hooks/form/useSearchReset';
|
||||
import {useSearchToggle} from '@/hooks/form/useSearchToggle';
|
||||
import {useTableSelection} from '@/hooks/table/useTableSelection';
|
||||
import modal from '@/plugins/modal';
|
||||
import {download as requestDownload} from '@/utils/request';
|
||||
|
||||
|
||||
const csKbList = ref<CsKbVO[]>([]);
|
||||
const {loading, withLoading} = useLoading(true);
|
||||
const {showSearch} = useSearchToggle();
|
||||
const total = ref(0);
|
||||
const {
|
||||
dateRange: dateRangeCreateTime,
|
||||
applyDateRange: applyCreateTimeDateRange,
|
||||
resetDateRange: resetCreateTimeDateRange
|
||||
} = useDateRangeQuery('CreateTime');
|
||||
const {
|
||||
dateRange: dateRangeUpdateTime,
|
||||
applyDateRange: applyUpdateTimeDateRange,
|
||||
resetDateRange: resetUpdateTimeDateRange
|
||||
} = useDateRangeQuery('UpdateTime');
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const csKbFormRef = ref<ElFormInstance>();
|
||||
|
||||
const initFormData: CsKbForm = {
|
||||
kbId: undefined,
|
||||
@@ -216,24 +208,23 @@ const data = reactive<PageData<CsKbForm, CsKbQuery>>({
|
||||
});
|
||||
const router = useRouter();
|
||||
|
||||
const {queryParams, form, rules} = toRefs(data);
|
||||
const {ids, single, multiple, handleSelectionChange} = useTableSelection<CsKbVO>(item => item.kbId);
|
||||
const {queryParams} = toRefs(data);
|
||||
const {ids, multiple, handleSelectionChange} = useTableSelection<CsKbVO>(item => item.kbId);
|
||||
|
||||
|
||||
const privewForm = ref({
|
||||
const privetForm = ref({
|
||||
visible: false,
|
||||
title: undefined,
|
||||
content: undefined,
|
||||
})
|
||||
|
||||
|
||||
function privew(row: Partial<CsKbVO>) {
|
||||
privewForm.value = {
|
||||
function preview(row: Partial<CsKbVO>) {
|
||||
privetForm.value = {
|
||||
visible: true,
|
||||
title: row.title,
|
||||
content: row.content
|
||||
}
|
||||
console.log(privewForm)
|
||||
}
|
||||
|
||||
|
||||
@@ -313,7 +304,6 @@ const overView = ref({"enabledCount": 0, "stoppedCount": 0})
|
||||
// 总览
|
||||
function getOverView() {
|
||||
overViewCsKb().then(res => {
|
||||
console.log(res)
|
||||
overView.value = res.data;
|
||||
})
|
||||
}
|
||||
@@ -321,24 +311,16 @@ function getOverView() {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: Partial<CsKbVO>) => {
|
||||
const _kbIds = row?.kbNo || ids.value;
|
||||
await modal.confirm('是否确认删除客服知识库编号为"' + _kbIds + '"的数据项?');
|
||||
if (row) {
|
||||
await modal.confirm('是否确认删除客服知识库编号为"' + _kbIds + '"的数据项?');
|
||||
} else {
|
||||
await modal.confirm('是否确认删除 选择的客服知识库,删除后将无法恢复?');
|
||||
}
|
||||
await delCsKb(_kbIds);
|
||||
modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
requestDownload(
|
||||
'system/cskb/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`csKb_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
||||
@@ -94,6 +94,7 @@ async function handleSubmit() {
|
||||
form.value.avatarOssId = res.data.ossId
|
||||
}
|
||||
addCsAgent(form.value).then(() => {
|
||||
modal.msgSuccess('新增客服账号成功');
|
||||
router.replace({
|
||||
path: '/conversation/csAgent'
|
||||
})
|
||||
|
||||
@@ -50,12 +50,12 @@
|
||||
<tableTag :num="statForm.offlineCount" circle-color="#94a3b8" title="离线"></tableTag>
|
||||
</div>
|
||||
<div class="toolbar-actions">
|
||||
<el-button v-hasPermi="['system:csAgent:edit']" :disabled="multiple" plain type="info"
|
||||
@click="batchDisableSelection"
|
||||
>批量禁用账号
|
||||
</el-button>
|
||||
<el-button v-hasPermi="['system:csAgent:add']" type="primary" @click="handleAdd">新增客服
|
||||
</el-button>
|
||||
<!-- <el-button v-hasPermi="['system:csAgent:edit']" :disabled="multiple" plain type="info"-->
|
||||
<!-- @click="batchDisableSelection"-->
|
||||
<!-- >批量禁用账号-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <el-button v-hasPermi="['system:csAgent:add']" type="primary" @click="handleAdd">新增客服-->
|
||||
<!-- </el-button>-->
|
||||
<right-toolbar v-model:show-search="showSearch" :search="false" @query-table="getList"></right-toolbar>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -88,6 +88,7 @@ init()
|
||||
|
||||
|
||||
async function handleSave() {
|
||||
console.log(formRef.value);
|
||||
if (!formRef.value) return
|
||||
formRef.value.validate(async (valid) => {
|
||||
console.log('校验结果:', valid)
|
||||
@@ -152,7 +153,7 @@ function resetForm() {
|
||||
<section class="commonCard">
|
||||
<card-nav subTitle="手机号为账号唯一标识不可修改;个人资料与账号状态可维护" title="用户资料"></card-nav>
|
||||
<div class="formbox">
|
||||
<el-form :model="editForm" :rules="rules" label-position="top">
|
||||
<el-form ref="formRef" :model="editForm" :rules="rules" label-position="top">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12">
|
||||
<FormItemTip
|
||||
|
||||
@@ -86,7 +86,17 @@
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column align="center" type="selection"></el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="用户昵称" prop="nickName"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="用户昵称" min-width="150px"
|
||||
prop="nickName">
|
||||
<template #default="scope">
|
||||
<div class="userInfoBox ">
|
||||
<el-image v-if="scope.row.avatarUrl" :preview-src-list="[scope.row.avatarUrl ]" :src="scope.row.avatarUrl"
|
||||
class="userImage"
|
||||
fit="cover" preview-teleported></el-image>
|
||||
<span>{{ scope.row.nickName }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="手机号" prop="phonenumber">
|
||||
<template #default="scope">
|
||||
<span>{{ hiddenPhone(scope.row.phonenumber) }}</span>
|
||||
@@ -171,6 +181,7 @@ import modal from "@/plugins/modal";
|
||||
import {download as requestDownload} from '@/utils/request';
|
||||
import {useTableSelection} from "@/hooks/table/useTableSelection";
|
||||
import {PostVO} from "@/api/system/post/types";
|
||||
import defaultImag from '@/assets/images/avatar.png';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@@ -310,4 +321,18 @@ onMounted(() => {
|
||||
//@use '@/assets/styles/components/page-shell' as pageShell;
|
||||
//
|
||||
//@include pageShell.table-crud-page;
|
||||
|
||||
.userInfoBox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.userImage {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 16px;
|
||||
background-color: rgba(241, 245, 249, 1);
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -91,7 +91,8 @@ init();
|
||||
<!-- 用户信息-->
|
||||
<section class="customerInfoBox commonCard flex justify-between flex-items-center">
|
||||
<div class="flex infoBox">
|
||||
<el-image :src="form.avatarUrl || defaultImag" class="customer-Img"></el-image>
|
||||
<el-image :preview-src-list="[form.avatarUrl || defaultImag]" :src="form.avatarUrl || defaultImag"
|
||||
class="customer-Img"></el-image>
|
||||
<div class="flex flex-col justify-between">
|
||||
<div>
|
||||
<span class="userName">{{ form.nickName }}</span>
|
||||
@@ -163,7 +164,8 @@ init();
|
||||
<cardNav line-color="#14b8a6" title="个人资料"></cardNav>
|
||||
<div class="userInfoInfoBox">
|
||||
<div class="userInfoImageBox">
|
||||
<el-image :src="form.avatarUrl || defaultImag" class="userImage"></el-image>
|
||||
<el-image :preview-src-list="[form.avatarUrl || defaultImag]" :src="form.avatarUrl || defaultImag"
|
||||
class="userImage"></el-image>
|
||||
<div class="description">APP端头像</div>
|
||||
</div>
|
||||
<ul>
|
||||
|
||||
@@ -325,9 +325,9 @@ function handleEdit(row: Partial<DeviceVO>) {
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: Partial<DeviceVO>) => {
|
||||
const _deviceIds = row?.deviceId || ids.value;
|
||||
const deviceIds = row?.deviceId || ids.value;
|
||||
await modal.confirm('是否确认删除该设备?');
|
||||
await delDevice(_deviceIds);
|
||||
await delDevice(deviceIds);
|
||||
modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
@@ -71,12 +71,31 @@ function init() {
|
||||
if (route.query.id) {
|
||||
getDevice(route.query.id as string).then(res => {
|
||||
Object.assign(form.value, res.data);
|
||||
refresh()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
init()
|
||||
|
||||
|
||||
let timer = ref<NodeJS.Timeout | null>(null);
|
||||
|
||||
function refresh() {
|
||||
getDevice(route.query.id as string).then(res => {
|
||||
Object.assign(form.value, res.data);
|
||||
});
|
||||
timer.value = setTimeout(() => {
|
||||
refresh();
|
||||
}, 30000)
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
if (timer.value) {
|
||||
clearTimeout(timer.value);
|
||||
}
|
||||
timer.value = null;
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -13,7 +13,7 @@ enum runMode {
|
||||
/**自动*/
|
||||
auto = 0,
|
||||
/**车载模式*/
|
||||
car = 0,
|
||||
car = 1,
|
||||
/**桌面模式*/
|
||||
dask = 2
|
||||
}
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="权限字符" prop="roleKey">
|
||||
<el-input v-model="queryParams.roleKey" placeholder="请输入权限字符" clearable @keyup.enter="handleQuery" />
|
||||
<el-input v-model="queryParams.roleKey" clearable placeholder="请输入权限字符" @keyup.enter="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="角色状态" clearable>
|
||||
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" style="width: 308px">
|
||||
@@ -94,11 +94,11 @@
|
||||
:data="roleList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column v-if="false" label="角色编号" prop="roleId" width="120" />
|
||||
<el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" />
|
||||
<el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="200" />
|
||||
<el-table-column label="显示顺序" prop="roleSort" width="100" />
|
||||
<el-table-column align="center" type="selection" width="55"/>
|
||||
<el-table-column v-if="false" label="角色编号" prop="roleId" width="120"/>
|
||||
<el-table-column :show-overflow-tooltip="true" label="角色名称" prop="roleName" width="150"/>
|
||||
<el-table-column :show-overflow-tooltip="true" label="权限字符" prop="roleKey" width="200"/>
|
||||
<el-table-column label="显示顺序" prop="roleSort" width="100"/>
|
||||
<el-table-column label="状态" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
@@ -117,7 +117,7 @@
|
||||
|
||||
<el-table-column fixed="right" label="操作" width="180">
|
||||
<template #default="scope">
|
||||
<el-tooltip v-if="scope.row.roleId !== 1761300000000000001" content="修改" placement="top">
|
||||
<el-tooltip v-if="scope.row.roleId !== '1761300000000000001'" content="修改" placement="top">
|
||||
<el-button
|
||||
v-hasPermi="['system:role:edit']"
|
||||
link
|
||||
@@ -126,7 +126,7 @@
|
||||
@click="handleUpdate(scope.row)"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip v-if="scope.row.roleId !== 1761300000000000001" content="删除" placement="top">
|
||||
<el-tooltip v-if="scope.row.roleId !== '1761300000000000001'" content="删除" placement="top">
|
||||
<el-button
|
||||
v-hasPermi="['system:role:remove']"
|
||||
link
|
||||
@@ -135,7 +135,7 @@
|
||||
@click="handleDelete(scope.row)"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip v-if="scope.row.roleId !== 1761300000000000001" content="分配权限" placement="top">
|
||||
<el-tooltip v-if="scope.row.roleId !== '1761300000000000001'" content="分配权限" placement="top">
|
||||
<el-button
|
||||
v-hasPermi="['system:role:edit']"
|
||||
link
|
||||
@@ -144,7 +144,7 @@
|
||||
@click="handleDataScope(scope.row)"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip v-if="scope.row.roleId !== 1761300000000000001" content="分配用户" placement="top">
|
||||
<el-tooltip v-if="scope.row.roleId !== '1761300000000000001'" content="分配用户" placement="top">
|
||||
<el-button
|
||||
v-hasPermi="['system:role:edit']"
|
||||
link
|
||||
@@ -171,7 +171,7 @@
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="角色名称" prop="roleName">
|
||||
<el-input v-model="form.roleName" placeholder="请输入角色名称" />
|
||||
<el-input v-model="form.roleName" placeholder="请输入角色名称"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -179,17 +179,17 @@
|
||||
<template #label>
|
||||
<span>
|
||||
<el-tooltip content="控制器中定义的权限字符,如:@SaCheckRole('admin')" placement="top">
|
||||
<el-icon><question-filled /></el-icon>
|
||||
<el-icon><question-filled/></el-icon>
|
||||
</el-tooltip>
|
||||
权限字符
|
||||
</span>
|
||||
</template>
|
||||
<el-input v-model="form.roleKey" placeholder="请输入权限字符" />
|
||||
<el-input v-model="form.roleKey" placeholder="请输入权限字符"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="角色顺序" prop="roleSort">
|
||||
<el-input-number v-model="form.roleSort" controls-position="right" :min="0" class="w-full" />
|
||||
<el-input-number v-model="form.roleSort" :min="0" class="w-full" controls-position="right"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -254,10 +254,10 @@
|
||||
>
|
||||
<span>{{ data.label }}</span>
|
||||
<el-tooltip v-if="isMenuPermissionHidden(data)" content="隐藏" placement="top">
|
||||
<el-icon class="menu-visibility-icon"><Hide /></el-icon>
|
||||
<el-icon class="menu-visibility-icon"><Hide/></el-icon>
|
||||
</el-tooltip>
|
||||
<el-tooltip v-if="data.disabled" content="停用" placement="top">
|
||||
<el-icon class="menu-disabled-icon"><CircleCloseFilled /></el-icon>
|
||||
<el-icon class="menu-disabled-icon"><CircleCloseFilled/></el-icon>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
<div v-if="data.buttonPermissions?.length" class="menu-tree-node-buttons" @click.stop>
|
||||
@@ -272,7 +272,7 @@
|
||||
<span class="menu-button-label" :class="{ 'is-disabled': button.disabled }">
|
||||
<span>{{ button.menuName }}</span>
|
||||
<el-tooltip v-if="button.disabled" content="停用" placement="top">
|
||||
<el-icon class="menu-button-disabled-icon"><CircleCloseFilled /></el-icon>
|
||||
<el-icon class="menu-button-disabled-icon"><CircleCloseFilled/></el-icon>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
</el-checkbox>
|
||||
@@ -329,9 +329,9 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Role" lang="ts">
|
||||
import { useRouter } from 'vue-router';
|
||||
import { roleMenuTreeselect } from '@/api/system/menu';
|
||||
import { MenuTreeOption, RoleMenuButtonOption, RoleMenuTree } from '@/api/system/menu/types';
|
||||
import {useRouter} from 'vue-router';
|
||||
import {roleMenuTreeselect} from '@/api/system/menu';
|
||||
import {MenuTreeOption, RoleMenuButtonOption, RoleMenuTree} from '@/api/system/menu/types';
|
||||
import {
|
||||
addRole,
|
||||
changeRoleStatus,
|
||||
@@ -342,21 +342,21 @@ import {
|
||||
updateRole,
|
||||
deptTreeSelect
|
||||
} from '@/api/system/role';
|
||||
import { RoleVO, RoleForm, RoleQuery, DeptTreeOption } from '@/api/system/role/types';
|
||||
import { MenuTypeEnum } from '@/enums/MenuTypeEnum';
|
||||
import { useLoading } from '@/hooks/async/useLoading';
|
||||
import { useDialogState } from '@/hooks/dialog/useDialogState';
|
||||
import { useDateRangeQuery } from '@/hooks/form/useDateRangeQuery';
|
||||
import { useSearchReset } from '@/hooks/form/useSearchReset';
|
||||
import { useSearchToggle } from '@/hooks/form/useSearchToggle';
|
||||
import { useTableSelection } from '@/hooks/table/useTableSelection';
|
||||
import {RoleVO, RoleForm, RoleQuery, DeptTreeOption} from '@/api/system/role/types';
|
||||
import {MenuTypeEnum} from '@/enums/MenuTypeEnum';
|
||||
import {useLoading} from '@/hooks/async/useLoading';
|
||||
import {useDialogState} from '@/hooks/dialog/useDialogState';
|
||||
import {useDateRangeQuery} from '@/hooks/form/useDateRangeQuery';
|
||||
import {useSearchReset} from '@/hooks/form/useSearchReset';
|
||||
import {useSearchToggle} from '@/hooks/form/useSearchToggle';
|
||||
import {useTableSelection} from '@/hooks/table/useTableSelection';
|
||||
import modal from '@/plugins/modal';
|
||||
import { useDict } from '@/utils/dict';
|
||||
import { download as requestDownload } from '@/utils/request';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import {useDict} from '@/utils/dict';
|
||||
import {download as requestDownload} from '@/utils/request';
|
||||
import {parseTime} from '@/utils/ruoyi';
|
||||
|
||||
const router = useRouter();
|
||||
const { sys_normal_disable } = toRefs<any>(useDict('sys_normal_disable'));
|
||||
const {sys_normal_disable} = toRefs<any>(useDict('sys_normal_disable'));
|
||||
|
||||
interface RoleMenuPermissionOption extends MenuTreeOption {
|
||||
buttonPermissions: RoleMenuButtonOption[];
|
||||
@@ -374,10 +374,10 @@ interface RoleMenuPermissionMeta {
|
||||
}
|
||||
|
||||
const roleList = ref<RoleVO[]>();
|
||||
const { loading, withLoading } = useLoading(true);
|
||||
const { showSearch } = useSearchToggle();
|
||||
const {loading, withLoading} = useLoading(true);
|
||||
const {showSearch} = useSearchToggle();
|
||||
const total = ref(0);
|
||||
const { dateRange, applyDateRange, resetDateRange } = useDateRangeQuery();
|
||||
const {dateRange, applyDateRange, resetDateRange} = useDateRangeQuery();
|
||||
const menuPermissionMeta = ref<RoleMenuPermissionMeta>({
|
||||
treeOptions: [],
|
||||
buttonIds: new Set<string>(),
|
||||
@@ -400,12 +400,12 @@ const permissionTab = ref<'data' | 'menu'>('menu');
|
||||
|
||||
/** 数据范围选项*/
|
||||
const dataScopeOptions = ref([
|
||||
{ value: '1', label: '全部数据权限' },
|
||||
{ value: '2', label: '自定数据权限' },
|
||||
{ value: '3', label: '本部门数据权限' },
|
||||
{ value: '4', label: '本部门及以下数据权限' },
|
||||
{ value: '5', label: '仅本人数据权限' },
|
||||
{ value: '6', label: '部门及以下或本人数据权限' }
|
||||
{value: '1', label: '全部数据权限'},
|
||||
{value: '2', label: '自定数据权限'},
|
||||
{value: '3', label: '本部门数据权限'},
|
||||
{value: '4', label: '本部门及以下数据权限'},
|
||||
{value: '5', label: '仅本人数据权限'},
|
||||
{value: '6', label: '部门及以下或本人数据权限'}
|
||||
]);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
@@ -499,12 +499,12 @@ const buildRoleMenuPermissionOptions = (
|
||||
}) ?? [];
|
||||
const children = menu.children?.length
|
||||
? buildRoleMenuPermissionOptions(
|
||||
menu.children,
|
||||
disabledButtonIds,
|
||||
buttonIds,
|
||||
buttonParentMap,
|
||||
nextDirectoryDisabled
|
||||
)
|
||||
menu.children,
|
||||
disabledButtonIds,
|
||||
buttonIds,
|
||||
buttonParentMap,
|
||||
nextDirectoryDisabled
|
||||
)
|
||||
: [];
|
||||
options.push({
|
||||
...menu,
|
||||
@@ -681,7 +681,7 @@ const buildCheckedButtonPermissionIds = (
|
||||
selectedButtonIds: Iterable<string | number>,
|
||||
newlyCheckedMenuIds: Array<string | number> = []
|
||||
) => {
|
||||
const { allCheckedKeys } = getCheckedMenuKeys();
|
||||
const {allCheckedKeys} = getCheckedMenuKeys();
|
||||
const activeMenuIds = new Set(allCheckedKeys.map(key => String(key)));
|
||||
const nextButtonIds = new Set<string | number>();
|
||||
|
||||
@@ -787,7 +787,7 @@ const initForm: RoleForm = {
|
||||
};
|
||||
|
||||
const data = reactive<PageData<RoleForm, RoleQuery>>({
|
||||
form: { ...initForm },
|
||||
form: {...initForm},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
@@ -796,14 +796,14 @@ const data = reactive<PageData<RoleForm, RoleQuery>>({
|
||||
status: ''
|
||||
},
|
||||
rules: {
|
||||
roleName: [{ required: true, message: '角色名称不能为空', trigger: 'blur' }],
|
||||
roleKey: [{ required: true, message: '权限字符不能为空', trigger: 'blur' }],
|
||||
roleSort: [{ required: true, message: '角色顺序不能为空', trigger: 'blur' }]
|
||||
roleName: [{required: true, message: '角色名称不能为空', trigger: 'blur'}],
|
||||
roleKey: [{required: true, message: '权限字符不能为空', trigger: 'blur'}],
|
||||
roleSort: [{required: true, message: '角色顺序不能为空', trigger: 'blur'}]
|
||||
}
|
||||
});
|
||||
const { form, queryParams, rules } = toRefs(data);
|
||||
const { ids, single, handleSelectionChange } = useTableSelection<RoleVO>(item => item.roleId);
|
||||
const { dialog, openDialog, closeDialog, setTitle } = useDialogState();
|
||||
const {form, queryParams, rules} = toRefs(data);
|
||||
const {ids, single, handleSelectionChange} = useTableSelection<RoleVO>(item => item.roleId);
|
||||
const {dialog, openDialog, closeDialog, setTitle} = useDialogState();
|
||||
|
||||
/**
|
||||
* 查询角色列表
|
||||
@@ -824,7 +824,7 @@ const handleQuery = () => {
|
||||
getList();
|
||||
};
|
||||
|
||||
const { resetQuery } = useSearchReset({
|
||||
const {resetQuery} = useSearchReset({
|
||||
queryFormRef,
|
||||
queryParams,
|
||||
pageNumKey: 'pageNum',
|
||||
@@ -894,7 +894,7 @@ const reset = () => {
|
||||
menuNodeAll.value = false;
|
||||
deptExpand.value = true;
|
||||
deptNodeAll.value = false;
|
||||
form.value = { ...initForm };
|
||||
form.value = {...initForm};
|
||||
roleFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
@@ -908,11 +908,11 @@ const handleAdd = () => {
|
||||
const handleUpdate = async (row?: Partial<RoleVO>) => {
|
||||
reset();
|
||||
const roleId = row?.roleId || ids.value[0];
|
||||
const { data } = await getRole(roleId);
|
||||
const {data} = await getRole(roleId);
|
||||
Object.assign(form.value, data);
|
||||
form.value.roleSort = Number(form.value.roleSort);
|
||||
// 菜单分配已迁移到“分配权限”弹窗,这里预置已有菜单,避免基础信息保存时误清空菜单权限。
|
||||
const { checkedKeys } = await getRoleMenuTreeselect(roleId);
|
||||
const {checkedKeys} = await getRoleMenuTreeselect(roleId);
|
||||
form.value.menuIds = checkedKeys;
|
||||
setTitle('修改角色');
|
||||
openDialog();
|
||||
@@ -1029,7 +1029,7 @@ const submitDataScope = async () => {
|
||||
/** 取消按钮(数据权限)*/
|
||||
const cancelDataScope = () => {
|
||||
dataScopeRef.value?.resetFields();
|
||||
form.value = { ...initForm };
|
||||
form.value = {...initForm};
|
||||
permissionTab.value = 'menu';
|
||||
menuRef.value?.setCheckedKeys([]);
|
||||
menuPermissionMeta.value = createEmptyMenuPermissionMeta();
|
||||
|
||||
@@ -3,8 +3,11 @@ import {ArrowLeft, InfoFilled} from "@element-plus/icons-vue";
|
||||
import FormItemTip from '@/components/FormItemTip/index.vue'
|
||||
import {listRole, addRole} from "@/api/system/role";
|
||||
import {useRouter} from "vue-router";
|
||||
import {addUser, getUser, updateUser} from "@/api/system/user";
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
|
||||
|
||||
const rolesList = [
|
||||
{
|
||||
@@ -31,6 +34,7 @@ const rolesList = [
|
||||
|
||||
|
||||
const initForm = {
|
||||
id: undefined,
|
||||
userId: undefined,
|
||||
userName: '',
|
||||
nickName: undefined,
|
||||
@@ -94,16 +98,23 @@ function reset() {
|
||||
}
|
||||
|
||||
function addRoleAction() {
|
||||
console.log(form.value);
|
||||
formRef.value?.validate().then((valid) => {
|
||||
if (valid) {
|
||||
addRole(form.value).then((res) => {
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('新增成功')
|
||||
} else {
|
||||
ElMessage.error(res.msg || '新增失败')
|
||||
}
|
||||
})
|
||||
if (route.query.id) {
|
||||
updateUser(form.value).then((res) => {
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('编辑成功')
|
||||
reBack()
|
||||
} else {
|
||||
ElMessage.error(res.msg || '编辑失败')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
addUser(form.value).then(() => {
|
||||
ElMessage.success('创建成功')
|
||||
reBack()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -112,8 +123,17 @@ function reBack() {
|
||||
router.back()
|
||||
}
|
||||
|
||||
function init() {
|
||||
getUser(route.query.id as string).then((res) => {
|
||||
if (res.code === 200) {
|
||||
Object.assign(form.value, res.data.user)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getRoleList()
|
||||
init()
|
||||
})
|
||||
</script>
|
||||
<template>
|
||||
@@ -125,9 +145,9 @@ onMounted(() => {
|
||||
<arrow-left></arrow-left>
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="title">新增账号</div>
|
||||
<div class="title">{{ $route.query.id ? '编辑账号' : '新增账号' }}</div>
|
||||
</div>
|
||||
<div class="describe">创建新的管理后台用户账号并配置角色权限</div>
|
||||
<div class="describe">{{ $route.query.id ? '编辑' : '创建新的' }}管理后台用户账号并配置角色权限</div>
|
||||
</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="17">
|
||||
@@ -192,14 +212,17 @@ onMounted(() => {
|
||||
<el-col :span="12">
|
||||
<FormItemTip
|
||||
v-model="form.roleIds"
|
||||
:disabled-values="['superadmin']"
|
||||
:disabled-predicate="(item)=>item.superAdmin === true"
|
||||
:radioOptions="roleList"
|
||||
labelKey="roleName"
|
||||
prop="roleIds"
|
||||
tip="角色决定用户的功能权限范围"
|
||||
label="角色"
|
||||
valueKey="roleKey"
|
||||
:inputAttrs="{
|
||||
multiple:true,
|
||||
}"
|
||||
type="select"
|
||||
valueKey="roleId"
|
||||
></FormItemTip>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -265,7 +288,9 @@ onMounted(() => {
|
||||
</div>
|
||||
<div class="actionBox">
|
||||
<div style="width:100%;">
|
||||
<el-button size="large" style="width:100%;" type="primary" @click="addRoleAction">确认创建</el-button>
|
||||
<el-button size="large" style="width:100%;" type="primary" @click="addRoleAction">
|
||||
{{ $route.query.id ? '确认编辑' : '确认创建' }}
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="width:100%;margin-top:10px">
|
||||
<el-button size="large" style="width:100%;" @click="reset">取消</el-button>
|
||||
|
||||
@@ -105,8 +105,11 @@
|
||||
label="角色"
|
||||
align="center"
|
||||
prop="roleIds"
|
||||
:show-overflow-tooltip="true"
|
||||
></el-table-column>
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-tag v-for="role in scope.row.roles" :key="role.roleId" type="primary">{{ role.roleName }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
key="phoneNumber"
|
||||
label="手机号码"
|
||||
@@ -211,17 +214,17 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.userId == null || form.userId != useUserStore().userId">
|
||||
<el-form-item label="归属部门" prop="deptId">
|
||||
<el-tree-select
|
||||
v-model="form.deptId"
|
||||
:data="enabledDeptOptions"
|
||||
:props="{ value: 'id', label: 'label', children: 'children' } as any"
|
||||
value-key="id"
|
||||
placeholder="请选择归属部门"
|
||||
check-strictly
|
||||
@change="handleDeptChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="归属部门" prop="deptId">-->
|
||||
<!-- <el-tree-select-->
|
||||
<!-- v-model="form.deptId"-->
|
||||
<!-- :data="enabledDeptOptions"-->
|
||||
<!-- :props="{ value: 'id', label: 'label', children: 'children' } as any"-->
|
||||
<!-- value-key="id"-->
|
||||
<!-- placeholder="请选择归属部门"-->
|
||||
<!-- check-strictly-->
|
||||
<!-- @change="handleDeptChange"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
@@ -278,19 +281,19 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12" v-if="form.userId == null || form.userId != useUserStore().userId">
|
||||
<el-form-item label="岗位">
|
||||
<el-select v-model="form.postIds" multiple placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in postOptions"
|
||||
:key="item.postId"
|
||||
:label="item.postName"
|
||||
:value="item.postId"
|
||||
:disabled="item.status == '1'"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12" v-if="form.userId == null || form.userId != useUserStore().userId">-->
|
||||
<!-- <el-form-item label="岗位">-->
|
||||
<!-- <el-select v-model="form.postIds" multiple placeholder="请选择">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in postOptions"-->
|
||||
<!-- :key="item.postId"-->
|
||||
<!-- :label="item.postName"-->
|
||||
<!-- :value="item.postId"-->
|
||||
<!-- :disabled="item.status == '1'"-->
|
||||
<!-- ></el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="12" v-if="form.userId == null || form.userId != useUserStore().userId">
|
||||
<el-form-item label="角色" prop="roleIds">
|
||||
<el-select v-model="form.roleIds" filterable multiple placeholder="请选择">
|
||||
@@ -715,6 +718,12 @@ const handleAdd = async () => {
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: Partial<UserForm>) => {
|
||||
// router.push({
|
||||
// path: '/system/editUser',
|
||||
// query: {
|
||||
// id: row.userId,
|
||||
// }
|
||||
// })
|
||||
reset();
|
||||
const userId = row?.userId || ids.value[0];
|
||||
const {data} = await api.getUser(userId);
|
||||
|
||||
200
vite.config.ts
200
vite.config.ts
@@ -1,54 +1,222 @@
|
||||
import {defineConfig, loadEnv} from 'vite';
|
||||
import createPlugins from './vite/plugins/index.js';
|
||||
import autoprefixer from 'autoprefixer'; // css自动添加兼容性前缀
|
||||
import autoprefixer from 'autoprefixer'; // CSS 自动添加浏览器兼容性前缀
|
||||
|
||||
/**
|
||||
* Vite 配置入口
|
||||
* @param mode 当前运行模式:development / production
|
||||
* @param command 当前命令:serve(开发) / build(打包)
|
||||
*/
|
||||
export default defineConfig(({mode, command}) => {
|
||||
// 加载 .env.[mode] 文件中的环境变量,第二个参数为根目录
|
||||
const env = loadEnv(mode, process.cwd());
|
||||
console.log(env);
|
||||
// 判断是否为生产打包阶段
|
||||
const isBuild = command === 'build';
|
||||
|
||||
return {
|
||||
// 部署生产环境和开发环境下的URL。
|
||||
// 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上
|
||||
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
||||
// ========================================================
|
||||
// 基础路径
|
||||
// 默认假设应用部署在域名根路径(如 https://example.com/)
|
||||
// 若部署在子路径(如 https://example.com/admin/),需设置为 '/admin/'
|
||||
// 从环境变量 VITE_APP_CONTEXT_PATH 读取,通常在 .env.development / .env.production 中定义
|
||||
// ========================================================
|
||||
base: env.VITE_APP_CONTEXT_PATH,
|
||||
|
||||
// ========================================================
|
||||
// 模块解析配置
|
||||
// ========================================================
|
||||
resolve: {
|
||||
// 自动读取 tsconfig.json 中的 paths 别名,无需手动配置 alias
|
||||
tsconfigPaths: true,
|
||||
// 导入时允许省略的文件扩展名(从左到右依次尝试匹配)
|
||||
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
|
||||
},
|
||||
// https://cn.vitejs.dev/config/#resolve-extensions
|
||||
|
||||
// ========================================================
|
||||
// 插件列表,统一在 ./vite/plugins/index.ts 中定义
|
||||
// 将 env 和 isBuild 传入,便于插件根据环境做差异化处理
|
||||
// ========================================================
|
||||
plugins: createPlugins(env, command === 'build'),
|
||||
build: {
|
||||
chunkSizeWarningLimit: 1500,
|
||||
rolldownOptions: {
|
||||
checks: {
|
||||
invalidAnnotation: false,
|
||||
pluginTimings: false
|
||||
}
|
||||
|
||||
// ========================================================
|
||||
// Rolldown 高级选项(Vite 8 底层默认使用 Rolldown 打包)
|
||||
// ========================================================
|
||||
rolldownOptions: {
|
||||
checks: {
|
||||
// 关闭注解校验警告
|
||||
invalidAnnotation: false,
|
||||
// 关闭 PLUGIN_TIMINGS 插件耗时统计警告(构建完成后不再输出 [PLUGIN_TIMINGS] 噪音)
|
||||
pluginTimings: false
|
||||
}
|
||||
},
|
||||
|
||||
// ========================================================
|
||||
// 开发服务器配置(vite serve)
|
||||
// ========================================================
|
||||
server: {
|
||||
// 监听所有网卡,允许局域网其他设备通过 IP 访问
|
||||
host: '0.0.0.0',
|
||||
// 端口号从环境变量 VITE_APP_PORT 读取
|
||||
port: Number(env.VITE_APP_PORT),
|
||||
// 启动后自动打开浏览器
|
||||
open: true,
|
||||
// 开发环境 API 代理,解决跨域问题
|
||||
// 将前端请求 /dev-api/xxx 转发到后端服务器
|
||||
proxy: {
|
||||
[env.VITE_APP_BASE_API]: {
|
||||
target: env.VITE_LOCALHOUSET === 'false' ? 'http://localhost:5660' : env.VITE_BASE_API,
|
||||
// 目标地址:
|
||||
// - 当 VITE_LOCALHOST === 'true' 时,转发到本地后端 http://localhost:5660
|
||||
// - 否则转发到环境变量 VITE_BASE_API 指定的远程后端地址
|
||||
target: env.VITE_LOCALHOST === 'true' ? 'http://localhost:5660' : env.VITE_BASE_API,
|
||||
// 将请求头中的 Host 改为 target 的域名,避免后端校验 Host 失败
|
||||
changeOrigin: true,
|
||||
// 同时代理 WebSocket 连接(如实时聊天、通知等场景)
|
||||
ws: true,
|
||||
// 重写请求路径,去掉前缀 /dev-api,使后端收到 /xxx 而非 /dev-api/xxx
|
||||
rewrite: path => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
// ========================================================
|
||||
// 生产构建配置(vite build)
|
||||
// ========================================================
|
||||
build: {
|
||||
// 目标浏览器(同时影响 JS 和 CSS 输出语法)
|
||||
// 与 package.json 中的 browserslist 保持一致:
|
||||
// Chrome >= 87, Edge >= 88, Safari >= 14, Firefox >= 78
|
||||
// 明确目标后打包器可以输出更高版本 JS 语法(const/let/箭头函数等),减小产物
|
||||
target: 'chrome87',
|
||||
|
||||
// 单个 chunk 超过 1500KB 时输出警告提示
|
||||
chunkSizeWarningLimit: 1500,
|
||||
|
||||
// 构建产物输出目录
|
||||
outDir: 'dist',
|
||||
// 每次构建前自动清空 outDir
|
||||
cleanOutDir: true,
|
||||
|
||||
// 源码映射(sourcemap):
|
||||
// - 开发模式(非 build)始终开启,方便在浏览器 DevTools 调试 TS 源码
|
||||
// - 打包时仅 development 模式开启,production 模式关闭以减小产物体积并防止源码泄露
|
||||
sourcemap: !isBuild || env.VITE_APP_ENV === 'development',
|
||||
|
||||
// ========================================================
|
||||
// JS 压缩(生产打包时启用)
|
||||
// esbuild 是 Go 写的原生二进制,压缩速度比 JS 写的 terser 快 10-100 倍
|
||||
// 压缩率比 terser 低约 3-8%,但构建速度优势远大于这点体积差距
|
||||
// 如需极致压缩(不在乎构建速度),可改为 minify: 'terser' 并配合 terserOptions
|
||||
// ========================================================
|
||||
minify: isBuild ? 'esbuild' : false,
|
||||
esbuild: {
|
||||
// 删除 debugger 语句(安全考虑,防止生产环境被断点注入)
|
||||
drop: isBuild ? ['debugger'] : [],
|
||||
// 标记为"无副作用"的函数——调用返回值未被使用时会被安全移除
|
||||
// 注意:不能用 drop: ['console'],那会把 console.error/warn 也删掉,生产环境排错直接崩
|
||||
// 只删 debug 日志,保留 error/warn 用于线上问题排查
|
||||
pure: isBuild ? ['console.log', 'console.info', 'console.debug'] : []
|
||||
},
|
||||
|
||||
// ========================================================
|
||||
// CSS 压缩器
|
||||
// lightningcss 基于 Rust,比默认的 esbuild CSS 压缩快 2-5 倍,压缩率略高
|
||||
// 额外支持:CSS 变量智能合并、媒体查询合并、颜色格式压缩(rgb→#hex→#short)
|
||||
// 兼容性已验证 OK,如需回退可改为 cssMinify: 'esbuild'
|
||||
// ========================================================
|
||||
cssMinify: 'lightningcss',
|
||||
|
||||
// 关闭 Rollup 输出压缩后大小的统计(默认开启)
|
||||
// 开启时构建会多一次遍历计算 gzip 大小,耗时增加 10-20%
|
||||
// 一般 CI/CD 或需要观察压缩率时才开启,日常开发关闭即可
|
||||
reportCompressedSize: false,
|
||||
|
||||
// 内联小资源(默认 ≤ 4KB 的静态资源会被 base64 内联到 CSS/JS 中)
|
||||
// 内联好处:减少独立 HTTP 请求;坏处:主文件体积变大
|
||||
// 这里从默认 4KB 提到 8KB,小图标/字体片段全部内联,减少首屏请求数
|
||||
assetsInlineLimit: 8192,
|
||||
},
|
||||
|
||||
// ========================================================
|
||||
// Rollup 输出配置(Vite 底层使用 Rollup/Rolldown 打包)
|
||||
// ========================================================
|
||||
rollupOptions: {
|
||||
output: {
|
||||
// JS 文件名格式:[name] 为 chunk 名,[hash] 为基于文件内容生成的哈希
|
||||
// 哈希值用于浏览器缓存更新——文件内容变了哈希就变,强制拉取新文件
|
||||
chunkFileNames: 'static/js/[name]-[hash].js',
|
||||
entryFileNames: 'static/js/[name]-[hash].js',
|
||||
// 静态资源(图片、字体等)文件名格式
|
||||
assetFileNames: 'static/assets/[name]-[hash].[ext]',
|
||||
|
||||
// 不在 entry chunk 中内联其它 entry chunk 的导出
|
||||
// 启用后更有利于代码分割和缓存复用
|
||||
hoistTransitiveImports: true,
|
||||
|
||||
/**
|
||||
* 手动分包策略(manualChunks)
|
||||
* 将第三方依赖按功能拆分到不同 chunk,实现:
|
||||
* 1. 利用浏览器缓存——修改业务代码不会导致第三方库缓存失效
|
||||
* 2. 并行加载——多个小 chunk 比一个大 chunk 下载更快
|
||||
*
|
||||
* 分包规则(优先级从上到下,先命中先返回):
|
||||
* - vue-vendor:Vue 核心生态(vue / vue-router / pinia)
|
||||
* - element-plus:UI 组件库(element-plus + @element-plus 子包)
|
||||
* - utils:通用工具库(axios / @vueuse 全家桶 / vue-i18n)
|
||||
* - vendor:其余未匹配的所有第三方依赖
|
||||
*
|
||||
* 注意:业务代码(非 node_modules)不走分包,由 Rollup 自动处理
|
||||
* 注意:echarts 等大型图表库未单独拆包——echarts 6.x 内部使用动态导入,
|
||||
* 强制拆分可能破坏其模块依赖关系,因此归入 vendor
|
||||
*
|
||||
* @param id 当前模块的绝对路径
|
||||
* @returns 目标 chunk 名称;返回 undefined 则由 Rollup 自动决定
|
||||
*/
|
||||
manualChunks(id) {
|
||||
// 只处理 node_modules 下的第三方依赖,业务代码不参与手动分包
|
||||
if (!id.includes('node_modules')) return;
|
||||
|
||||
// 判断当前路径是否包含指定的 node_modules 包
|
||||
// 同时兼容 Unix 路径分隔符 (/) 和 Windows 路径分隔符 (\)
|
||||
const hasPkg = (pkg: string) =>
|
||||
id.includes(`/node_modules/${pkg}/`) || id.includes(`\\node_modules\\${pkg}\\`);
|
||||
|
||||
// 分组 1:Vue 核心生态
|
||||
if (['vue', 'vue-router', 'pinia'].some(hasPkg)) {
|
||||
return 'vue-vendor';
|
||||
}
|
||||
// 分组 2:Element Plus 组件库(含 @element-plus 下的图标、组件等子包)
|
||||
if (hasPkg('element-plus') || hasPkg('@element-plus')) {
|
||||
return 'element-plus';
|
||||
}
|
||||
// 分组 3:通用工具库(@vueuse 覆盖 @vueuse/core、@vueuse/shared 等所有子包)
|
||||
if (hasPkg('axios') || hasPkg('@vueuse') || hasPkg('vue-i18n')) {
|
||||
return 'utils';
|
||||
}
|
||||
// 其余所有第三方依赖统一打入 vendor 包
|
||||
return 'vendor';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// ========================================================
|
||||
// CSS 相关配置
|
||||
// ========================================================
|
||||
css: {
|
||||
// CSS 预处理器配置(SCSS)
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
// 全局注入 SCSS 变量文件(如需启用,取消注释即可)
|
||||
// additionalData: '@use "@/assets/styles/variables.module.scss as *";'
|
||||
// javascriptEnabled: true
|
||||
}
|
||||
},
|
||||
// PostCSS 插件链
|
||||
postcss: {
|
||||
plugins: [
|
||||
// 浏览器兼容性
|
||||
// Autoprefixer:自动根据 browserslist 目标添加浏览器前缀
|
||||
// 如将 user-select: none 转为 -webkit-user-select: none
|
||||
autoprefixer(),
|
||||
// 移除 CSS 文件中的 @charset 声明
|
||||
// Vite 打包后会自动处理编码,@charset 是多余的且在某些场景下会产生警告
|
||||
{
|
||||
postcssPlugin: 'internal:charset-removal',
|
||||
AtRule: {
|
||||
|
||||
@@ -7,9 +7,9 @@ export default () => {
|
||||
// 自动导入 Vue 相关函数
|
||||
imports: ['vue', 'vue-router', '@vueuse/core', 'pinia'],
|
||||
resolvers: [
|
||||
// 自动导入 Element Plus 相关函数ElMessage, ElMessageBox... (带样式)
|
||||
// 自动导入 Element Plus 相关函数 ElMessage, ElMessageBox... (按需导入样式)
|
||||
ElementPlusResolver({
|
||||
importStyle: false
|
||||
importStyle: 'sass'
|
||||
})
|
||||
],
|
||||
vueTemplate: true, // 是否在 vue 模板中自动导入
|
||||
|
||||
@@ -5,9 +5,10 @@ import { resolve } from 'path';
|
||||
export default () => {
|
||||
return Components({
|
||||
resolvers: [
|
||||
// 自动导入 Element Plus 组件
|
||||
// 自动导入 Element Plus 组件 + 按需导入组件 CSS
|
||||
// importStyle: 'sass' 会只打包用到的组件的 SCSS,而非全量 CSS
|
||||
ElementPlusResolver({
|
||||
importStyle: false
|
||||
importStyle: 'sass'
|
||||
})
|
||||
],
|
||||
dts: resolve(import.meta.dirname, '../../src/types/components.d.ts')
|
||||
|
||||
Reference in New Issue
Block a user