10/15
1. 工作人员账号添加 2. 优化打包 3. 日志 4. 用户头像列表
This commit is contained in:
@@ -15,7 +15,6 @@ VITE_BASE_API='http://192.168.0.212:8082'
|
||||
#VITE_BASE_API='http://192.168.0.212:8082'
|
||||
VITE_WS_URL='ws://192.168.0.212:8082/cs/chat'
|
||||
|
||||
|
||||
# 默认头像
|
||||
VITE_DEFAULT_USER_IMAGE='https://ts3.tc.mm.bing.net/th?id=ORMS.48a27ca8353fa47bf0dc8df38854d0e1&pid=Wdp&w=312&h=172&qlt=90&c=1&rs=1&dpr=1&p=0'
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ VITE_APP_SNAILJOB_ADMIN='/snail-job'
|
||||
|
||||
# SnailAI 控制台地址
|
||||
VITE_APP_SNAILAI_ADMIN='/snail-ai'
|
||||
# 默认头像
|
||||
VITE_DEFAULT_USER_IMAGE='https://ts3.tc.mm.bing.net/th?id=ORMS.48a27ca8353fa47bf0dc8df38854d0e1&pid=Wdp&w=312&h=172&qlt=90&c=1&rs=1&dpr=1&p=0'
|
||||
|
||||
# 生产环境
|
||||
VITE_APP_BASE_API='/prod-api'
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
"vite": "^8.2.2",
|
||||
"vite-plugin-lightningcss": "^0.0.5",
|
||||
"vite-plugin-svg-icons-ng": "^1.9.3",
|
||||
"vite-plugin-zip-pack": "^1.2.4",
|
||||
"vitest": "4.1.11",
|
||||
"vue-tsc": "^3.3.11"
|
||||
},
|
||||
|
||||
95
pnpm-lock.yaml
generated
95
pnpm-lock.yaml
generated
@@ -150,6 +150,9 @@ importers:
|
||||
vite-plugin-svg-icons-ng:
|
||||
specifier: ^1.9.3
|
||||
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))
|
||||
vite-plugin-zip-pack:
|
||||
specifier: ^1.2.4
|
||||
version: 1.2.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))
|
||||
vitest:
|
||||
specifier: 4.1.11
|
||||
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))
|
||||
@@ -1573,6 +1576,9 @@ packages:
|
||||
convert-source-map@2.0.0:
|
||||
resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==}
|
||||
|
||||
core-util-is@1.0.3:
|
||||
resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}
|
||||
|
||||
crossws@0.4.12:
|
||||
resolution: {integrity: sha512-aypfsr6t0uNvkqaZc6zvBfXzC6pLI0/sIulpkV6RwCVtZqG5ebBzv4weImKK0VNCj91Wl9F5j7p5WU4MNrybng==}
|
||||
peerDependencies:
|
||||
@@ -1866,12 +1872,18 @@ packages:
|
||||
image-conversion@2.1.1:
|
||||
resolution: {integrity: sha512-hnMOmP7q2jxA+52FZ+wHNhg3fdFRlgfngsQH2JQHEQkafY7tj/8F15e6Rv/RxDegc872jvyaRHwMbkTZK1Cjbg==}
|
||||
|
||||
immediate@3.0.6:
|
||||
resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==}
|
||||
|
||||
immutable@5.1.9:
|
||||
resolution: {integrity: sha512-m8nVez3rwrgmWxtLMt1ZYXB2Lv7OKYn/disyxAlSDYAlKSlFoPPfIAmAM/M5xqL4m4C/wAPw7S2/CNaUii1Hxg==}
|
||||
|
||||
import-meta-resolve@4.2.0:
|
||||
resolution: {integrity: sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==}
|
||||
|
||||
inherits@2.0.4:
|
||||
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
|
||||
|
||||
is-extglob@2.1.1:
|
||||
resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
@@ -1893,6 +1905,9 @@ packages:
|
||||
is-url@1.2.4:
|
||||
resolution: {integrity: sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==}
|
||||
|
||||
isarray@1.0.0:
|
||||
resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==}
|
||||
|
||||
jiti@2.7.0:
|
||||
resolution: {integrity: sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==}
|
||||
hasBin: true
|
||||
@@ -1903,6 +1918,12 @@ packages:
|
||||
jsencrypt@3.5.4:
|
||||
resolution: {integrity: sha512-kNjfYEMNASxrDGsmcSQh/rUTmcoRfSUkxnAz+MMywM8jtGu+fFEZ3nJjHM58zscVnwR0fYmG9sGkTDjqUdpiwA==}
|
||||
|
||||
jszip@3.10.2:
|
||||
resolution: {integrity: sha512-3l+rb15IOWtUhU0H5MFqES/T6Kh7abYwjosBey/vD6hDt8zoEffkSC5Ws5SGtgVw3gBx2NEbhTeSW1+kWkpyTQ==}
|
||||
|
||||
lie@3.3.0:
|
||||
resolution: {integrity: sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==}
|
||||
|
||||
lightningcss-android-arm64@1.33.0:
|
||||
resolution: {integrity: sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==}
|
||||
engines: {node: '>= 12.0.0'}
|
||||
@@ -2186,6 +2207,9 @@ packages:
|
||||
package-manager-detector@1.8.0:
|
||||
resolution: {integrity: sha512-yQA4H19AmPEoMUeavPMDIe1higySl/gH/yaQrkT/s07Qp+7pp2hYz30N3z2l5BkjVkF9Ow6o0wjJamm2y7Sn0A==}
|
||||
|
||||
pako@1.0.11:
|
||||
resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==}
|
||||
|
||||
path-browserify@1.0.1:
|
||||
resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==}
|
||||
|
||||
@@ -2248,6 +2272,9 @@ packages:
|
||||
resolution: {integrity: sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
process-nextick-args@2.0.1:
|
||||
resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==}
|
||||
|
||||
property-information@7.2.0:
|
||||
resolution: {integrity: sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg==}
|
||||
|
||||
@@ -2261,6 +2288,9 @@ packages:
|
||||
quansync@1.0.0:
|
||||
resolution: {integrity: sha512-5xZacEEufv3HSTPQuchrvV6soaiACMFnq1H8wkVioctoH3TRha9Sz66lOxRwPK/qZj7HPiSveih9yAyh98gvqA==}
|
||||
|
||||
readable-stream@2.3.8:
|
||||
resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==}
|
||||
|
||||
readdirp@5.0.0:
|
||||
resolution: {integrity: sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==}
|
||||
engines: {node: '>= 20.19.0'}
|
||||
@@ -2290,6 +2320,9 @@ packages:
|
||||
rou3@0.9.2:
|
||||
resolution: {integrity: sha512-3SOzvaAg8rkHrXtRjpCvCvbyO5to9oOO27Z/XqHEYXfMRVSw/qMIVdmaOk9W2lcRLtR6dlqTjo9hDeJk70QBYQ==}
|
||||
|
||||
safe-buffer@5.1.2:
|
||||
resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==}
|
||||
|
||||
sass@1.104.0:
|
||||
resolution: {integrity: sha512-btHMApW2bgolvClhRW8AlQJzgI9lUB3pPSofBQQT+E46GWvf9o0TVQ13SYv5riWZVFyPN+JNz3TKW9XhBlc10w==}
|
||||
engines: {node: '>=20.19.0'}
|
||||
@@ -2305,6 +2338,9 @@ packages:
|
||||
scule@1.3.0:
|
||||
resolution: {integrity: sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g==}
|
||||
|
||||
setimmediate@1.0.5:
|
||||
resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==}
|
||||
|
||||
shiki@4.4.3:
|
||||
resolution: {integrity: sha512-Mb/GvXPHBAXdgGIcnfU5L3ldpn1XcxrGkPHwqgRx17/I2XRfqlFKk2vGkHWINn1kdXvzJZeuO3is6I9KLPFm0g==}
|
||||
engines: {node: '>=20'}
|
||||
@@ -2356,6 +2392,9 @@ packages:
|
||||
std-env@4.2.0:
|
||||
resolution: {integrity: sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==}
|
||||
|
||||
string_decoder@1.1.1:
|
||||
resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==}
|
||||
|
||||
stringify-entities@4.0.4:
|
||||
resolution: {integrity: sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==}
|
||||
|
||||
@@ -2547,6 +2586,9 @@ packages:
|
||||
peerDependencies:
|
||||
browserslist: '>= 4.21.0'
|
||||
|
||||
util-deprecate@1.0.2:
|
||||
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
||||
|
||||
vfile-message@4.0.3:
|
||||
resolution: {integrity: sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==}
|
||||
|
||||
@@ -2562,6 +2604,11 @@ packages:
|
||||
peerDependencies:
|
||||
vite: '>=5.0.0'
|
||||
|
||||
vite-plugin-zip-pack@1.2.4:
|
||||
resolution: {integrity: sha512-QgZEeiWayE2ZvMbkvcqWf94p/Z5YeNHZlkwXWIkkoISjePiWVXKRX2xCGmsURe9acGVdkobZ31dFJuCp3j1hMg==}
|
||||
peerDependencies:
|
||||
vite: '>=2.x'
|
||||
|
||||
vite@8.2.2:
|
||||
resolution: {integrity: sha512-cFKLV/PRgAUlIRm5WjMjJ86jrftzpqcgH+Us+DS8mI3CDNiH30Whrz8uHL3+MOLPAgqbMBAqWdAHAphOAM+z/Q==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
@@ -3999,6 +4046,8 @@ snapshots:
|
||||
|
||||
convert-source-map@2.0.0: {}
|
||||
|
||||
core-util-is@1.0.3: {}
|
||||
|
||||
crossws@0.4.12(srvx@1.0.4):
|
||||
optionalDependencies:
|
||||
srvx: 1.0.4
|
||||
@@ -4336,10 +4385,14 @@ snapshots:
|
||||
|
||||
image-conversion@2.1.1: {}
|
||||
|
||||
immediate@3.0.6: {}
|
||||
|
||||
immutable@5.1.9: {}
|
||||
|
||||
import-meta-resolve@4.2.0: {}
|
||||
|
||||
inherits@2.0.4: {}
|
||||
|
||||
is-extglob@2.1.1:
|
||||
optional: true
|
||||
|
||||
@@ -4356,12 +4409,25 @@ snapshots:
|
||||
|
||||
is-url@1.2.4: {}
|
||||
|
||||
isarray@1.0.0: {}
|
||||
|
||||
jiti@2.7.0: {}
|
||||
|
||||
js-tokens@10.0.0: {}
|
||||
|
||||
jsencrypt@3.5.4: {}
|
||||
|
||||
jszip@3.10.2:
|
||||
dependencies:
|
||||
lie: 3.3.0
|
||||
pako: 1.0.11
|
||||
readable-stream: 2.3.8
|
||||
setimmediate: 1.0.5
|
||||
|
||||
lie@3.3.0:
|
||||
dependencies:
|
||||
immediate: 3.0.6
|
||||
|
||||
lightningcss-android-arm64@1.33.0:
|
||||
optional: true
|
||||
|
||||
@@ -4658,6 +4724,8 @@ snapshots:
|
||||
|
||||
package-manager-detector@1.8.0: {}
|
||||
|
||||
pako@1.0.11: {}
|
||||
|
||||
path-browserify@1.0.1: {}
|
||||
|
||||
path-expression-matcher@1.6.2: {}
|
||||
@@ -4710,6 +4778,8 @@ snapshots:
|
||||
|
||||
prismjs@1.30.0: {}
|
||||
|
||||
process-nextick-args@2.0.1: {}
|
||||
|
||||
property-information@7.2.0: {}
|
||||
|
||||
proxy-from-env@2.1.0: {}
|
||||
@@ -4718,6 +4788,16 @@ snapshots:
|
||||
|
||||
quansync@1.0.0: {}
|
||||
|
||||
readable-stream@2.3.8:
|
||||
dependencies:
|
||||
core-util-is: 1.0.3
|
||||
inherits: 2.0.4
|
||||
isarray: 1.0.0
|
||||
process-nextick-args: 2.0.1
|
||||
safe-buffer: 5.1.2
|
||||
string_decoder: 1.1.1
|
||||
util-deprecate: 1.0.2
|
||||
|
||||
readdirp@5.0.0: {}
|
||||
|
||||
regex-recursion@6.0.2:
|
||||
@@ -4757,6 +4837,8 @@ snapshots:
|
||||
|
||||
rou3@0.9.2: {}
|
||||
|
||||
safe-buffer@5.1.2: {}
|
||||
|
||||
sass@1.104.0:
|
||||
dependencies:
|
||||
chokidar: 5.0.0
|
||||
@@ -4773,6 +4855,8 @@ snapshots:
|
||||
|
||||
scule@1.3.0: {}
|
||||
|
||||
setimmediate@1.0.5: {}
|
||||
|
||||
shiki@4.4.3:
|
||||
dependencies:
|
||||
'@shikijs/core': 4.4.3
|
||||
@@ -4815,6 +4899,10 @@ snapshots:
|
||||
|
||||
std-env@4.2.0: {}
|
||||
|
||||
string_decoder@1.1.1:
|
||||
dependencies:
|
||||
safe-buffer: 5.1.2
|
||||
|
||||
stringify-entities@4.0.4:
|
||||
dependencies:
|
||||
character-entities-html4: 2.1.0
|
||||
@@ -5063,6 +5151,8 @@ snapshots:
|
||||
escalade: 3.2.0
|
||||
picocolors: 1.1.1
|
||||
|
||||
util-deprecate@1.0.2: {}
|
||||
|
||||
vfile-message@4.0.3:
|
||||
dependencies:
|
||||
'@types/unist': 3.0.3
|
||||
@@ -5084,6 +5174,11 @@ snapshots:
|
||||
tinyglobby: 0.2.17
|
||||
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-plugin-zip-pack@1.2.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:
|
||||
jszip: 3.10.2
|
||||
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)(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
|
||||
|
||||
@@ -117,6 +117,7 @@ export interface CsSessionForm extends BaseEntity {
|
||||
}
|
||||
|
||||
export interface CsSessionQuery extends PageQuery {
|
||||
phonenumber?: string;
|
||||
/**
|
||||
* 会话编号
|
||||
*/
|
||||
|
||||
@@ -1,283 +1,311 @@
|
||||
export interface DeviceVO {
|
||||
/**
|
||||
* 主键(雪花,仅内部关联)
|
||||
* 空气质量(0优 1良 2差 3污染)
|
||||
*/
|
||||
deviceId: string | number;
|
||||
airLevel?: string;
|
||||
/**
|
||||
* 业务编号,未删除记录内唯一;逻辑删除后可再次使用
|
||||
*/
|
||||
deviceNo: string;
|
||||
/**
|
||||
* 绑定码IMEI,可空;未删除记录内唯一,逻辑删除后可再次使用
|
||||
*/
|
||||
imei: string;
|
||||
/**
|
||||
* 用户侧名称≤20字符
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* 产品模板
|
||||
*/
|
||||
productId: string | number;
|
||||
/**
|
||||
* 型号快照,新增时取自产品模板
|
||||
*/
|
||||
model: string;
|
||||
/**
|
||||
* 出厂序列号
|
||||
*/
|
||||
sn: string;
|
||||
/**
|
||||
* 硬件版本
|
||||
*/
|
||||
hwVersion: string;
|
||||
/**
|
||||
* 软件版本
|
||||
*/
|
||||
swVersion: string;
|
||||
/**
|
||||
* 固件版本
|
||||
*/
|
||||
fwVersion: string;
|
||||
/**
|
||||
* 数据包版本
|
||||
*/
|
||||
pkgVersion: string;
|
||||
/**
|
||||
* 设备IP
|
||||
*/
|
||||
ip: string;
|
||||
/**
|
||||
* MAC,未删除记录内唯一;逻辑删除后可再次添加
|
||||
*/
|
||||
mac: string;
|
||||
/**
|
||||
* WiFi SSID
|
||||
*/
|
||||
wifiSsid: string | number;
|
||||
/**
|
||||
* 蓝牙(0未连接 1已连接)
|
||||
*/
|
||||
bluetoothConnected: string;
|
||||
/**
|
||||
* 状态(0未激活 1在线 2离线)
|
||||
*/
|
||||
status: boolean;
|
||||
/**
|
||||
* 当前绑定APP用户
|
||||
*/
|
||||
bindUserId: string | number;
|
||||
/**
|
||||
* 最近一次绑定时间
|
||||
*/
|
||||
bindTime: string;
|
||||
/**
|
||||
* 当前家庭
|
||||
*/
|
||||
homeId: string | number;
|
||||
/**
|
||||
* 当前房间
|
||||
*/
|
||||
locationId: string | number;
|
||||
/**
|
||||
* 信号等级(0离线 1弱 2一般 3强)
|
||||
*/
|
||||
signalLevel: number;
|
||||
/**
|
||||
* 最新经度
|
||||
*/
|
||||
lng: number;
|
||||
/**
|
||||
* 最新纬度
|
||||
*/
|
||||
lat: number;
|
||||
/**
|
||||
* 地址(设备上报)
|
||||
*/
|
||||
address: string;
|
||||
/**
|
||||
* 充电(0否 1充电中;无电池设备为空)
|
||||
*/
|
||||
charging: string;
|
||||
/**
|
||||
* 设备电量0-100
|
||||
*/
|
||||
deviceBattery: number;
|
||||
/**
|
||||
* 最近一次运行数据上报时间
|
||||
*/
|
||||
lastReportTime: string;
|
||||
/**
|
||||
* 最后在线时间
|
||||
*/
|
||||
lastOnlineTime: string;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
/**
|
||||
* 未删除时的业务编号
|
||||
*/
|
||||
activeDeviceNo: string;
|
||||
/**
|
||||
* 未删除时的IMEI
|
||||
*/
|
||||
activeImei: string;
|
||||
/**
|
||||
* 未删除时的MAC
|
||||
*/
|
||||
activeMac: string;
|
||||
}
|
||||
|
||||
export interface DeviceForm extends BaseEntity {
|
||||
/**
|
||||
* 主键(雪花,仅内部关联)
|
||||
*/
|
||||
deviceId?: string | number;
|
||||
/**
|
||||
* 业务编号,未删除记录内唯一;逻辑删除后可再次使用
|
||||
*/
|
||||
deviceNo?: string;
|
||||
/**
|
||||
* 绑定码IMEI,可空;未删除记录内唯一,逻辑删除后可再次使用
|
||||
*/
|
||||
imei?: string;
|
||||
/**
|
||||
* 用户侧名称≤20字符
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* 产品模板
|
||||
*/
|
||||
productId?: string | number;
|
||||
/**
|
||||
* 型号快照,新增时取自产品模板
|
||||
*/
|
||||
model?: string;
|
||||
/**
|
||||
* 出厂序列号
|
||||
*/
|
||||
sn?: string;
|
||||
/**
|
||||
* 硬件版本
|
||||
*/
|
||||
hwVersion?: string;
|
||||
/**
|
||||
* 软件版本
|
||||
*/
|
||||
swVersion?: string;
|
||||
/**
|
||||
* 固件版本
|
||||
*/
|
||||
fwVersion?: string;
|
||||
/**
|
||||
* 数据包版本
|
||||
*/
|
||||
pkgVersion?: string;
|
||||
/**
|
||||
* 设备IP
|
||||
*/
|
||||
ip?: string;
|
||||
/**
|
||||
* MAC,未删除记录内唯一;逻辑删除后可再次添加
|
||||
*/
|
||||
mac?: string;
|
||||
/**
|
||||
* WiFi SSID
|
||||
*/
|
||||
wifiSsid?: string | number;
|
||||
/**
|
||||
* 蓝牙(0未连接 1已连接)
|
||||
*/
|
||||
bluetoothConnected?: string;
|
||||
/**
|
||||
* 状态(0未激活 1在线 2离线)
|
||||
*/
|
||||
status?: boolean;
|
||||
/**
|
||||
* 当前绑定APP用户
|
||||
*/
|
||||
bindUserId?: string | number;
|
||||
/**
|
||||
* 最近一次绑定时间
|
||||
* 绑定时间
|
||||
*/
|
||||
bindTime?: string;
|
||||
/**
|
||||
* 当前家庭
|
||||
* 绑定用户
|
||||
*/
|
||||
homeId?: string | number;
|
||||
bindUserId?: number;
|
||||
/**
|
||||
* 当前房间
|
||||
* 绑定用户昵称
|
||||
*/
|
||||
locationId?: string | number;
|
||||
bindUserName?: string;
|
||||
/**
|
||||
* 信号等级(0离线 1弱 2一般 3强)
|
||||
* 绑定用户手机号
|
||||
*/
|
||||
signalLevel?: number;
|
||||
bindUserPhone?: string;
|
||||
/**
|
||||
* 最新经度
|
||||
* 蓝牙连接(0未连接 1已连接)
|
||||
*/
|
||||
lng?: number;
|
||||
bluetoothConnected?: string;
|
||||
/**
|
||||
* 最新纬度
|
||||
* 品类
|
||||
*/
|
||||
lat?: number;
|
||||
category?: string;
|
||||
/**
|
||||
* 地址(设备上报)
|
||||
*/
|
||||
address?: string;
|
||||
/**
|
||||
* 充电(0否 1充电中;无电池设备为空)
|
||||
* 充电(0否 1充电中)
|
||||
*/
|
||||
charging?: string;
|
||||
/**
|
||||
* 设备电量0-100
|
||||
*/
|
||||
deviceBattery?: number;
|
||||
/**
|
||||
* 最近一次运行数据上报时间
|
||||
*/
|
||||
lastReportTime?: string;
|
||||
/**
|
||||
* 最后在线时间
|
||||
*/
|
||||
lastOnlineTime?: string;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
/**
|
||||
* 创建部门
|
||||
*/
|
||||
createDept?: number;
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
createBy?: number;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime?: string;
|
||||
/**
|
||||
* 更新者
|
||||
* 设备电量
|
||||
*/
|
||||
updateBy?: number;
|
||||
deviceBattery?: number;
|
||||
/**
|
||||
* 设备主键
|
||||
*/
|
||||
deviceId?: number;
|
||||
/**
|
||||
* 设备编号
|
||||
*/
|
||||
deviceNo?: string;
|
||||
/**
|
||||
* 风速档位(0标准 1强力 2低档)
|
||||
*/
|
||||
fanLevel?: string;
|
||||
/**
|
||||
* 滤芯寿命
|
||||
*/
|
||||
filterLife?: number;
|
||||
/**
|
||||
* 滤芯剩余天数
|
||||
*/
|
||||
filterRemainDays?: number;
|
||||
/**
|
||||
* 最近一次确认更换滤芯时间
|
||||
*/
|
||||
filterReplaceTime?: string;
|
||||
/**
|
||||
* 滤芯总寿命天数
|
||||
*/
|
||||
filterTotalDays?: number;
|
||||
/**
|
||||
* 家庭
|
||||
*/
|
||||
homeId?: number;
|
||||
/**
|
||||
* 家庭名称
|
||||
*/
|
||||
homeName?: string;
|
||||
/**
|
||||
* 最后在线时间
|
||||
*/
|
||||
lastOnlineTime?: string;
|
||||
/**
|
||||
* 最近上报时间
|
||||
*/
|
||||
lastReportTime?: string;
|
||||
/**
|
||||
* 房间
|
||||
*/
|
||||
locationId?: number;
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
locationName?: string;
|
||||
/**
|
||||
* MAC
|
||||
*/
|
||||
mac?: string;
|
||||
/**
|
||||
* 型号
|
||||
*/
|
||||
model?: string;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* 停车关机模式(0关 1开)
|
||||
*/
|
||||
parkingShutdown?: string;
|
||||
/**
|
||||
* 供电模式(0USB 1电池)
|
||||
*/
|
||||
powerMode?: string;
|
||||
/**
|
||||
* 产品模板
|
||||
*/
|
||||
productId?: number;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
productName?: string;
|
||||
/**
|
||||
* 是否有净化器运行态
|
||||
*/
|
||||
purifier?: boolean;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
/**
|
||||
* 运行模式(0自动 1车载 2桌面)
|
||||
*/
|
||||
runMode?: string;
|
||||
/**
|
||||
* 序列号
|
||||
*/
|
||||
sn?: string;
|
||||
/**
|
||||
* 状态(0未激活 1在线 2离线)
|
||||
*/
|
||||
status?: string;
|
||||
/**
|
||||
* 状态名称
|
||||
*/
|
||||
statusName?: string;
|
||||
/**
|
||||
* TVOC 原始值
|
||||
*/
|
||||
tvoc?: number;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
export interface DeviceForm extends BaseEntity {
|
||||
/**
|
||||
* 未删除时的业务编号
|
||||
* 空气质量(0优 1良 2差 3污染)
|
||||
*/
|
||||
activeDeviceNo?: string;
|
||||
airLevel?: string;
|
||||
/**
|
||||
* 未删除时的IMEI
|
||||
* 绑定时间
|
||||
*/
|
||||
activeImei?: string;
|
||||
bindTime?: string;
|
||||
/**
|
||||
* 未删除时的MAC
|
||||
* 绑定用户
|
||||
*/
|
||||
activeMac?: string;
|
||||
bindUserId?: number;
|
||||
/**
|
||||
* 绑定用户昵称
|
||||
*/
|
||||
bindUserName?: string;
|
||||
/**
|
||||
* 绑定用户手机号
|
||||
*/
|
||||
bindUserPhone?: string;
|
||||
/**
|
||||
* 蓝牙连接(0未连接 1已连接)
|
||||
*/
|
||||
bluetoothConnected?: string;
|
||||
/**
|
||||
* 品类
|
||||
*/
|
||||
category?: string;
|
||||
/**
|
||||
* 充电(0否 1充电中)
|
||||
*/
|
||||
charging?: string;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime?: string;
|
||||
/**
|
||||
* 设备电量
|
||||
*/
|
||||
deviceBattery?: number;
|
||||
/**
|
||||
* 设备主键
|
||||
*/
|
||||
deviceId?: number;
|
||||
/**
|
||||
* 设备编号
|
||||
*/
|
||||
deviceNo?: string;
|
||||
/**
|
||||
* 风速档位(0标准 1强力 2低档)
|
||||
*/
|
||||
fanLevel?: string;
|
||||
/**
|
||||
* 滤芯寿命
|
||||
*/
|
||||
filterLife?: number;
|
||||
/**
|
||||
* 滤芯剩余天数
|
||||
*/
|
||||
filterRemainDays?: number;
|
||||
/**
|
||||
* 最近一次确认更换滤芯时间
|
||||
*/
|
||||
filterReplaceTime?: string;
|
||||
/**
|
||||
* 滤芯总寿命天数
|
||||
*/
|
||||
filterTotalDays?: number;
|
||||
/**
|
||||
* 家庭
|
||||
*/
|
||||
homeId?: number;
|
||||
/**
|
||||
* 家庭名称
|
||||
*/
|
||||
homeName?: string;
|
||||
/**
|
||||
* 最后在线时间
|
||||
*/
|
||||
lastOnlineTime?: string;
|
||||
/**
|
||||
* 最近上报时间
|
||||
*/
|
||||
lastReportTime?: string;
|
||||
/**
|
||||
* 房间
|
||||
*/
|
||||
locationId?: number;
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
locationName?: string;
|
||||
/**
|
||||
* MAC
|
||||
*/
|
||||
mac?: string;
|
||||
/**
|
||||
* 型号
|
||||
*/
|
||||
model?: string;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* 停车关机模式(0关 1开)
|
||||
*/
|
||||
parkingShutdown?: string;
|
||||
/**
|
||||
* 供电模式(0USB 1电池)
|
||||
*/
|
||||
powerMode?: string;
|
||||
/**
|
||||
* 产品模板
|
||||
*/
|
||||
productId?: number;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
productName?: string;
|
||||
/**
|
||||
* 是否有净化器运行态
|
||||
*/
|
||||
purifier?: boolean;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
/**
|
||||
* 运行模式(0自动 1车载 2桌面)
|
||||
*/
|
||||
runMode?: string;
|
||||
/**
|
||||
* 序列号
|
||||
*/
|
||||
sn?: string;
|
||||
/**
|
||||
* 状态(0未激活 1在线 2离线)
|
||||
*/
|
||||
status?: string;
|
||||
/**
|
||||
* 状态名称
|
||||
*/
|
||||
statusName?: string;
|
||||
/**
|
||||
* TVOC 原始值
|
||||
*/
|
||||
tvoc?: number;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
export interface DeviceQuery extends PageQuery {
|
||||
@@ -340,7 +368,7 @@ export interface DeviceQuery extends PageQuery {
|
||||
/**
|
||||
* 状态(0未激活 1在线 2离线)
|
||||
*/
|
||||
status?: boolean;
|
||||
status?: string;
|
||||
/**
|
||||
* 当前绑定APP用户
|
||||
*/
|
||||
|
||||
@@ -31,6 +31,7 @@ export interface LoginData {
|
||||
*/
|
||||
export interface LoginResult {
|
||||
access_token: string;
|
||||
client_id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 10px;
|
||||
background: $background;
|
||||
//background: $background;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,8 +63,7 @@
|
||||
.tree-panel-col,
|
||||
.tree-content-col {
|
||||
min-width: 0;
|
||||
transition:
|
||||
max-width 0.24s ease,
|
||||
transition: max-width 0.24s ease,
|
||||
flex-basis 0.24s ease;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,11 +4,14 @@
|
||||
fit="cover"
|
||||
:style="`width:${realWidth};height:${realHeight};`"
|
||||
:preview-src-list="realSrcList"
|
||||
:lazy="lazy"
|
||||
preview-teleported
|
||||
>
|
||||
<template #error>
|
||||
<div class="image-slot">
|
||||
<el-icon><picture-filled /></el-icon>
|
||||
<el-icon>
|
||||
<picture-filled/>
|
||||
</el-icon>
|
||||
</div>
|
||||
</template>
|
||||
</el-image>
|
||||
@@ -23,6 +26,10 @@ const props = defineProps({
|
||||
type: [Number, String],
|
||||
default: ''
|
||||
},
|
||||
lazy: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
height: {
|
||||
type: [Number, String],
|
||||
default: ''
|
||||
|
||||
@@ -22,7 +22,7 @@ const props = defineProps({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-button :plain="props.plain" :type="props.type">
|
||||
<el-button :plain="props.plain" :type="props.type" disabled style="cursor:default;">
|
||||
<i :style="{
|
||||
backgroundColor: props.circleColor,
|
||||
}" class="circle"></i>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import type {App} from 'vue';
|
||||
import copyText from './common/copyText';
|
||||
import { hasPermi, hasRoles } from './permission';
|
||||
import {hasPermi, hasPermiAnd, hasRoles} from './permission';
|
||||
|
||||
export default (app: App) => {
|
||||
app.directive('copyText', copyText);
|
||||
app.directive('hasPermi', hasPermi);
|
||||
app.directive('hasPermiAnd', hasPermiAnd);
|
||||
app.directive('hasRoles', hasRoles);
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type {Directive, DirectiveBinding} from 'vue';
|
||||
import {useUserStore} from '@/store/modules/user';
|
||||
|
||||
/**
|
||||
* 操作权限处理
|
||||
*/
|
||||
@@ -21,6 +22,28 @@ export const hasPermi: Directive = {
|
||||
}
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 操作权限处理
|
||||
* 必须全部拥有指定权限
|
||||
*/
|
||||
export const hasPermiAnd: Directive = {
|
||||
mounted(el: HTMLElement, binding: DirectiveBinding) {
|
||||
const {permissions} = useUserStore();
|
||||
// 「其他角色」按钮权限校验
|
||||
const {value} = binding;
|
||||
if (value && value instanceof Array && value.length > 0) {
|
||||
const hasPermission = permissions.every((permi: string) => {
|
||||
return permi === '*:*:*' || value.includes(permi);
|
||||
});
|
||||
if (!hasPermission) {
|
||||
el.parentNode && el.parentNode.removeChild(el);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
throw new Error("check perms! Like v-has-permi=\"['system:user:add','system:user:edit']\"");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 角色权限处理
|
||||
|
||||
@@ -19,7 +19,7 @@ const isWhiteList = (path: string) => {
|
||||
return whiteList.some(pattern => isPathMatch(pattern, path));
|
||||
};
|
||||
|
||||
router.beforeEach(async (to, from) => {
|
||||
router.beforeEach(async (to,) => {
|
||||
NProgress.start();
|
||||
if (getToken()) {
|
||||
to.meta.title && useSettingsStore().setTitle(to.meta.title as string);
|
||||
@@ -86,7 +86,7 @@ router.beforeEach(async (to, from) => {
|
||||
// 在免登录白名单,直接进入
|
||||
return true;
|
||||
} else {
|
||||
const redirect = encodeURIComponent(to.fullPath || '/');
|
||||
// const redirect = encodeURIComponent(to.fullPath || '/');
|
||||
NProgress.done();
|
||||
return `/login`; // 否则全部重定向到登录页
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ export const useCsSessionStore = defineStore('csSession', () => {
|
||||
userInfo: {} as listUserType,
|
||||
userInfoMain: null as deskSessionType | null,
|
||||
userType: '',
|
||||
sessionTypeError: false,
|
||||
});
|
||||
// 发送消息 状态 true 发送中
|
||||
const sending = ref(false);
|
||||
@@ -90,6 +91,9 @@ export const useCsSessionStore = defineStore('csSession', () => {
|
||||
|
||||
// ⚠️ computed 不能嵌套在 reactive 里,追踪链会断
|
||||
const userInfoMessage = computed(() => allUsersMessages[currentSessionId.value] || []);
|
||||
// ✅ 最新的 seq(最后一条)
|
||||
const latestSeq = computed(() => userInfoMessage.value?.[userInfoMessage.value.length - 1]?.seq || 0);
|
||||
|
||||
|
||||
// 初始化客服负责所有用户的消息
|
||||
function initAllUsersMessages(list: listUserType[], isClear = false) {
|
||||
@@ -105,7 +109,8 @@ export const useCsSessionStore = defineStore('csSession', () => {
|
||||
|
||||
// 上滑加载 更早的历史记录
|
||||
function handleLoadMoreMessages(list: listUserType[]) {
|
||||
if (!currentSessionId.value) return
|
||||
if (!currentSessionId.value) return;
|
||||
|
||||
allUsersMessages[currentSessionId.value] = [
|
||||
...list,
|
||||
...(allUsersMessages[currentSessionId.value] || []),
|
||||
@@ -263,6 +268,7 @@ export const useCsSessionStore = defineStore('csSession', () => {
|
||||
// cs:ERROR 失败
|
||||
ws.registerHandler('cs:error', () => {
|
||||
setSending(false)
|
||||
state.sessionTypeError = true
|
||||
});
|
||||
|
||||
|
||||
@@ -273,12 +279,12 @@ export const useCsSessionStore = defineStore('csSession', () => {
|
||||
|
||||
ws.on('ready', () => {
|
||||
// 重连成功后,如果当前有会话,需要告诉服务端恢复
|
||||
if (currentSessionId.value && ws) {
|
||||
ws.send({
|
||||
type: 'resume_session',
|
||||
data: {sessionId: currentSessionId.value}
|
||||
});
|
||||
}
|
||||
// if (currentSessionId.value && ws) {
|
||||
// ws.send({
|
||||
// type: 'resume_session',
|
||||
// data: {sessionId: currentSessionId.value}
|
||||
// });
|
||||
// }
|
||||
});
|
||||
|
||||
// close 事件统一处理:被踢、鉴权失败、网络断开都走这里
|
||||
@@ -391,7 +397,7 @@ export const useCsSessionStore = defineStore('csSession', () => {
|
||||
setCurrentUser,
|
||||
setCurrentUserInfoMain,
|
||||
handleActiveUserType,
|
||||
wsStatus,
|
||||
wsStatus, latestSeq,
|
||||
getWs,
|
||||
ensureWs,
|
||||
getRightUserList,
|
||||
|
||||
@@ -29,6 +29,7 @@ export const useUserStore = defineStore('user', () => {
|
||||
if (!data?.access_token) {
|
||||
return Promise.reject(err);
|
||||
}
|
||||
sessionStorage.setItem('clientid', data.client_id);
|
||||
setToken(data.access_token);
|
||||
token.value = data.access_token;
|
||||
return Promise.resolve();
|
||||
|
||||
@@ -90,21 +90,12 @@ export async function extractErrorMessage(error: any): Promise<string | undefine
|
||||
export const globalHeaders = () => {
|
||||
return {
|
||||
Authorization: 'Bearer ' + getToken(),
|
||||
clientid: import.meta.env.VITE_APP_CLIENT_ID
|
||||
clientid: sessionStorage.getItem('clientid') || import.meta.env.VITE_APP_CLIENT_ID
|
||||
};
|
||||
};
|
||||
|
||||
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8';
|
||||
axios.defaults.headers['clientid'] = import.meta.env.VITE_APP_CLIENT_ID;
|
||||
|
||||
|
||||
function resolveClientId() {
|
||||
const roles = useUserStore().roles;
|
||||
if (roles.includes('customer_service')) {
|
||||
return import.meta.env.VITE_CS_AGENT_CLIENT_ID;
|
||||
}
|
||||
return import.meta.env.VITE_APP_CLIENT_ID;
|
||||
}
|
||||
axios.defaults.headers['clientid'] = sessionStorage.getItem('clientid') || import.meta.env.VITE_APP_CLIENT_ID;
|
||||
|
||||
|
||||
// 创建 axios 实例
|
||||
@@ -122,7 +113,8 @@ service.interceptors.request.use(
|
||||
(config: any) => {
|
||||
// 对应国际化资源文件后缀
|
||||
config.headers['Content-Language'] = getLanguage();
|
||||
// config.headers['clientid'] = resolveClientId();
|
||||
config.headers['clientid'] = sessionStorage.getItem('clientid') || import.meta.env.VITE_APP_CLIENT_ID;
|
||||
|
||||
|
||||
const isToken = config.headers?.isToken === false;
|
||||
// 是否需要防止数据重复提交
|
||||
@@ -228,18 +220,14 @@ service.interceptors.response.use(
|
||||
},
|
||||
)
|
||||
.then(() => {
|
||||
isRelogin.show = false;
|
||||
useUserStore()
|
||||
.logout()
|
||||
.then(() => {
|
||||
router.replace({
|
||||
path: "/login",
|
||||
query: {
|
||||
redirect: encodeURIComponent(
|
||||
router.currentRoute.value.fullPath || "/",
|
||||
),
|
||||
},
|
||||
});
|
||||
}).finally(() => {
|
||||
isRelogin.show = false;
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* 根据数字 1-7 生成对应星期
|
||||
* @param num 1=周一,2=周二...7=周日
|
||||
* 根据数字 0-6 生成对应星期
|
||||
* @param num 0=周日,1=周一,2=周二,3=周三,4=周四,5=周五,6=周六
|
||||
* @param options 选项对象
|
||||
* @param options.prefix 选项,可自定义前缀,默认 '周'
|
||||
* @returns 周一 / 周二 ... / 周日
|
||||
@@ -8,6 +8,6 @@
|
||||
export function numToWeek(num: number, options = {
|
||||
prefix: '周',
|
||||
}): string {
|
||||
const weekMap = ['一', '二', '三', '四', '五', '六', '日'];
|
||||
return options.prefix + weekMap[num - 1] || '';
|
||||
const weekMap = ['日', '一', '二', '三', '四', '五', '六'];
|
||||
return options.prefix + weekMap[num] || '';
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
}"
|
||||
></div>
|
||||
<div>
|
||||
<span>{{ numToWeek(item.formateDay + 1) }}</span>
|
||||
<span>{{ numToWeek(item.formateDay) }}</span>
|
||||
<span style="font-size: 12px">({{ item.month }}.{{ item.date }})</span>
|
||||
</div>
|
||||
</article>
|
||||
@@ -127,7 +127,7 @@
|
||||
</template>
|
||||
</el-input>
|
||||
<div class="login-code">
|
||||
<img :src="codeUrl" class="login-code-img" @click="getCode"/>
|
||||
<img :src="codeUrl" alt="验证码" class="login-code-img" @click="getCode"/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<div class="form-meta">
|
||||
@@ -289,16 +289,13 @@ const handleGetLoc = async () => {
|
||||
)
|
||||
.then((res) => res.json())
|
||||
.then((res) => {
|
||||
// const weightArr = res.data.forecast.daily.pm10 ?? [];
|
||||
const weightArr = [
|
||||
{avg: 72, day: "2026-10-03"},
|
||||
{avg: 85, day: "2026-10-04"},
|
||||
{avg: 66, day: "2026-10-05"},
|
||||
{avg: 91, day: "2026-10-06"},
|
||||
{avg: 78, day: "2026-10-07"},
|
||||
{avg: 95, day: "2026-10-08"},
|
||||
{avg: 88, day: "2026-10-09"},
|
||||
];
|
||||
const weightArr2 = new Array(7).map(() => {
|
||||
return {
|
||||
avg: Math.random() * 100,
|
||||
day: new Date().toLocaleDateString(),
|
||||
}
|
||||
});
|
||||
const weightArr = res.data.forecast.daily.pm10 ?? weightArr2;
|
||||
quickStats.value = handleMax(weightArr.slice(0, 7));
|
||||
});
|
||||
} catch (e) {
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
|
||||
<template #default="scope">
|
||||
<el-button v-hasPermi="['system:agreement:edit']" link type="primary"
|
||||
<el-button v-hasPermiAnd="['system:agreement:edit','system:agreement:query']" 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"
|
||||
|
||||
@@ -27,8 +27,9 @@
|
||||
<el-button
|
||||
class="btn-img"
|
||||
plain
|
||||
:disabled="disable || uploading"
|
||||
type="info"
|
||||
:disabled="disable"
|
||||
:loading="uploading"
|
||||
@click="handleSelectImage"
|
||||
>
|
||||
上传图片
|
||||
@@ -55,7 +56,11 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
|
||||
/** 是否正在上传图片 */
|
||||
uploading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
/** 是否禁用输入框 */
|
||||
disable: {
|
||||
type: Boolean,
|
||||
|
||||
@@ -67,6 +67,7 @@ const props = defineProps<{
|
||||
messages: ChatMessage[]
|
||||
userAvatar: string
|
||||
loadingHistory?: boolean
|
||||
latestSeq?: number
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -81,6 +82,7 @@ const listRef = ref<HTMLElement>()
|
||||
const isAtBottom = ref(true)
|
||||
let isFirstRender = true
|
||||
let isLoadingMore = false
|
||||
let prevScrollTop = 0
|
||||
|
||||
const BOTTOM_THRESHOLD = 50
|
||||
const TOP_THRESHOLD = 30
|
||||
@@ -105,30 +107,39 @@ const handleScroll = () => {
|
||||
const el = listRef.value
|
||||
if (!el) return
|
||||
isAtBottom.value = checkAtBottom()
|
||||
if (el.scrollTop <= TOP_THRESHOLD && !isLoadingMore) {
|
||||
isLoadingMore = true
|
||||
|
||||
const currentTop = el.scrollTop
|
||||
const scrollingUp = currentTop < prevScrollTop
|
||||
prevScrollTop = currentTop
|
||||
|
||||
if (scrollingUp && currentTop <= TOP_THRESHOLD && !props.loadingHistory && !isLoadingMore) {
|
||||
console.log('向上滚动到顶部了')
|
||||
isLoadingMore = true;
|
||||
setTimeout(() => {
|
||||
isLoadingMore = false
|
||||
}, 500)
|
||||
emit('loadMore')
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.messages.length,
|
||||
async (newLen, oldLen) => {
|
||||
console.log(newLen, oldLen)
|
||||
isLoadingMore = false
|
||||
|
||||
if (newLen === 0) return
|
||||
() => props.latestSeq,
|
||||
async (newSeq, oldSeq) => {
|
||||
console.log(newSeq, oldSeq, isAtBottom.value)
|
||||
|
||||
if (newSeq === 1) return
|
||||
if (isFirstRender) {
|
||||
await scrollToBottom()
|
||||
isFirstRender = false
|
||||
isAtBottom.value = true
|
||||
return
|
||||
}
|
||||
|
||||
if (isAtBottom.value) {
|
||||
await scrollToBottom()
|
||||
}
|
||||
await nextTick()
|
||||
const el = listRef.value
|
||||
if (el) prevScrollTop = el.scrollTop
|
||||
},
|
||||
{immediate: true}
|
||||
)
|
||||
|
||||
@@ -21,6 +21,7 @@ const csSessionStore = useCsSessionStore()
|
||||
const userStore = useUserStore()
|
||||
const {
|
||||
state,
|
||||
latestSeq,
|
||||
userInfoMessage,
|
||||
currentSessionId
|
||||
} = storeToRefs(csSessionStore);
|
||||
@@ -55,6 +56,7 @@ const onSendMsg = async (text: string) => {
|
||||
}
|
||||
}
|
||||
|
||||
let isUploadImaging = ref(false)
|
||||
const onUploadImage = async (file: File) => {
|
||||
const client = csSessionStore.getWs()
|
||||
if (!client) {
|
||||
@@ -63,7 +65,9 @@ const onUploadImage = async (file: File) => {
|
||||
}
|
||||
// 1. 转换成 网络图片
|
||||
// 2. 发送图片消息
|
||||
isUploadImaging.value = true
|
||||
let res = await handleSaveAvatar(file);
|
||||
isUploadImaging.value = false
|
||||
if (!res) return
|
||||
let sendObj = {
|
||||
"type": "message",
|
||||
@@ -121,18 +125,19 @@ const loadingHistory = ref(false)
|
||||
|
||||
function handleLoadMore() {
|
||||
loadingHistory.value = true
|
||||
if (!currentSessionId.value) return
|
||||
console.log('加载更多历史消息')
|
||||
// // 每次只能拉取 100 条消息
|
||||
if (!currentSessionId.value) return loadingHistory.value = false;
|
||||
// // 每次只能拉取 MAX_MESSAGES 条消息
|
||||
// 1. 得到最早的seq
|
||||
let seq = userInfoMessage.value[0].seq;
|
||||
let seq = userInfoMessage.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)
|
||||
console.log(`拉去消息:${seq} -> ${latestSeq}`)
|
||||
getDeskCsAgentHistory(currentSessionId.value, latestSeq, seq).then(res => {
|
||||
csSessionStore.handleLoadMoreMessages(res.data)
|
||||
console.log('加载更多历史消息', res.data.length)
|
||||
}).finally(() => {
|
||||
loadingHistory.value = false
|
||||
})
|
||||
}
|
||||
@@ -227,11 +232,12 @@ function exportCsSessionStore() {
|
||||
|
||||
function handleRouteDeviceMain(deviceInfo: Device) {
|
||||
// 跳转设备详情页
|
||||
window.open(`/device/deviceMain?deviceId=${deviceInfo.deviceId}`)
|
||||
window.open(`/device/deviceMain?id=${deviceInfo.deviceId}`)
|
||||
}
|
||||
|
||||
// 保持活跃
|
||||
let lastPingTime = 0
|
||||
// 保持活跃的冷却时间(单位:毫秒) 10s
|
||||
const PING_COOLDOWN = 10000
|
||||
const floatItems = ref<{ id: number; x: number }[]>([])
|
||||
let floatId = 0
|
||||
@@ -377,13 +383,16 @@ async function handleRefreshList() {
|
||||
</div>
|
||||
</div>
|
||||
<div class="content beautify_scroll">
|
||||
<MessageList ref="messageList" :loading-history="loadingHistory" :messages="userInfoMessage"
|
||||
<MessageList ref="messageList" :latest-seq="latestSeq" :loading-history="loadingHistory"
|
||||
:messages="userInfoMessage"
|
||||
:user-avatar="state.userInfoMain.customer.avatarUrl || ''"
|
||||
@load-more="handleLoadMore"></MessageList>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<!-- 输入框组件 -->
|
||||
<ChatInput :disable="state.userInfoMain.session.status !== '2'" :sending="csSessionStore.sending"
|
||||
<ChatInput v-hasPermi="['cs:session:send']" :disable="state.userInfoMain.session.status !== '2'"
|
||||
:sending="csSessionStore.sending"
|
||||
:uploading="isUploadImaging"
|
||||
@send="onSendMsg" @uploadImage="onUploadImage"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
<el-input v-model="queryParams.sessionNo" clearable placeholder="请输入会话编号" size="large"
|
||||
style="width: 150px" @keyup.enter="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户手机号" prop="ipaddr">
|
||||
<el-input v-model="queryParams.ipaddr" clearable placeholder="请输入用户手机号" size="large"
|
||||
<el-form-item label="用户手机号" prop="phonenumber">
|
||||
<el-input v-model="queryParams.phonenumber" clearable placeholder="请输入用户手机号" size="large"
|
||||
style="width: 150px" @keyup.enter="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="会话状态" prop="status">
|
||||
@@ -26,24 +26,24 @@
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="问题类型" prop="problemType">
|
||||
<el-select
|
||||
v-model="queryParams.problemType"
|
||||
:empty-values="[null, undefined]"
|
||||
:value-on-clear="null"
|
||||
clearable
|
||||
placeholder="请选择问题类型"
|
||||
size="large"
|
||||
style="width: 150px"
|
||||
>
|
||||
<el-option label="在线" value="0"></el-option>
|
||||
<el-option label="离线" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关联设备" prop="deviceId">
|
||||
<el-input v-model="queryParams.deviceId" clearable placeholder="请输入MAC/设备名称" size="large"
|
||||
style="width: 190px" @keyup.enter="handleQuery"/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="问题类型" prop="problemType">-->
|
||||
<!-- <el-select-->
|
||||
<!-- v-model="queryParams.problemType"-->
|
||||
<!-- :empty-values="[null, undefined]"-->
|
||||
<!-- :value-on-clear="null"-->
|
||||
<!-- clearable-->
|
||||
<!-- placeholder="请选择问题类型"-->
|
||||
<!-- size="large"-->
|
||||
<!-- style="width: 150px"-->
|
||||
<!-- >-->
|
||||
<!-- <el-option label="在线" value="0"></el-option>-->
|
||||
<!-- <el-option label="离线" value="1"></el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="关联设备" prop="deviceId">-->
|
||||
<!-- <el-input v-model="queryParams.deviceId" clearable placeholder="请输入MAC/设备名称" size="large"-->
|
||||
<!-- style="width: 190px" @keyup.enter="handleQuery"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="会话创建时间" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.startTime"
|
||||
@@ -63,11 +63,12 @@
|
||||
:empty-values="[null, undefined]"
|
||||
:value-on-clear="null"
|
||||
clearable
|
||||
placeholder="请选择接待客服"
|
||||
size="large"
|
||||
style="width: 150px"
|
||||
>
|
||||
<el-option label="在线" value="0"></el-option>
|
||||
<el-option label="离线" value="1"></el-option>
|
||||
<el-option v-for="(item,index) in queryParamsOptions" :key="index" :label="item.nickName"
|
||||
:value="item.userId"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -83,14 +84,15 @@
|
||||
<div>
|
||||
<el-button type="primary">
|
||||
<span style="margin:0 8px;color: #fff;">全部</span>
|
||||
<span style="color: #fff;font-weight: bold">1286</span>
|
||||
<span style="color: #fff;font-weight: bold">{{ overViewTotal }}</span>
|
||||
</el-button>
|
||||
<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" @click="handleExport">批量导出会话记录</el-button>
|
||||
<el-button v-hasPermi="['cs:session:export']" plain type="info" @click="handleExport">批量导出会话记录
|
||||
</el-button>
|
||||
<el-button plain type="info" @click="getList">刷新</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -99,23 +101,26 @@
|
||||
v-loading="loading"
|
||||
:data="onlineList"
|
||||
border
|
||||
@select="handleSelectionChange"
|
||||
class="data-table"
|
||||
style="width: 100%"
|
||||
>
|
||||
<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="用户信息" min-width="150"
|
||||
prop="userNickName">
|
||||
<template #default="scope">
|
||||
<div class="userInfoBox">
|
||||
<div v-if="scope.row.customer" 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 style="color: #9CA3AF;font-size: 12px;">{{ hiddenPhone(scope.row.customer.phonenumber) }}</div>-->
|
||||
<div style="color: #9CA3AF;font-size: 12px;">{{ 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 :show-overflow-tooltip="true" align="center" label="关联设备" prop="deviceId"/>-->
|
||||
<el-table-column align="center" label="会话状态" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_session_state" :value="scope.row.status"></dict-tag>
|
||||
@@ -126,23 +131,24 @@
|
||||
<div class="name">{{ scope.row.agentName }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="用户问题摘要" prop="summary"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="用户问题摘要" min-width="200"
|
||||
prop="summary"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="排队序号" prop="queueNo" width="100"/>
|
||||
<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" fixed="right" label="操作"
|
||||
min-width="200">
|
||||
min-width="220">
|
||||
<template #default="scope">
|
||||
<div>
|
||||
<el-button
|
||||
v-hasPermi="['monitor:online:forceLogout']"
|
||||
v-hasPermi="['cs:session:query']"
|
||||
type="primary"
|
||||
@click="handleMain(scope.row)"
|
||||
>查看会话
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['monitor:online:forceLogout']"
|
||||
v-hasPermi="['customer:user:query']"
|
||||
plain
|
||||
type="info"
|
||||
@click="handleUserMain(scope.row)"
|
||||
@@ -158,6 +164,7 @@
|
||||
v-model:limit="queryParams.pageSize"
|
||||
v-model:page="queryParams.pageNum"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
@@ -171,6 +178,8 @@ 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";
|
||||
import {listUser} from "@/api/system/user";
|
||||
import {UserVO} from "@/api/system/user/types";
|
||||
|
||||
const {com_session_state} = toRefs<any>(useDict('com_session_state'));
|
||||
|
||||
@@ -182,11 +191,21 @@ const total = ref(0);
|
||||
const {ids, single, multiple, handleSelectionChange} = useTableSelection<CsSessionVO>(item => item.sessionId);
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
|
||||
|
||||
const queryParamsOptions = ref<UserVO[]>([]);
|
||||
|
||||
function getUserOptionsByAgent() {
|
||||
listUser({pageNum: 1, pageSize: undefined, roleId: "2095336076121190401",}).then((res) => {
|
||||
queryParamsOptions.value = res.data?.rows || [];
|
||||
})
|
||||
}
|
||||
|
||||
getUserOptionsByAgent()
|
||||
|
||||
|
||||
const queryParams = ref<CsSessionQuery>({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
ipaddr: '',
|
||||
userName: ''
|
||||
});
|
||||
|
||||
/** 查询登录日志列表 */
|
||||
@@ -231,11 +250,13 @@ const overViewList = ref([
|
||||
"statusName": "已结束"
|
||||
}
|
||||
])
|
||||
const overViewTotal = ref(0)
|
||||
|
||||
// 查看客服会话状态统计
|
||||
function getOverViewSession() {
|
||||
overViewCsSession().then((res) => {
|
||||
overViewList.value = res.data.statuses || [];
|
||||
overViewTotal.value = res.data.total || 0;
|
||||
})
|
||||
}
|
||||
|
||||
@@ -263,6 +284,10 @@ function handleMain(row: Partial<CsSessionVO>) {
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
if (ids.value.length === 0) {
|
||||
ElMessage.warning('请选择会话');
|
||||
return;
|
||||
}
|
||||
requestDownload(
|
||||
'/cs/session/exportSelected',
|
||||
{
|
||||
@@ -290,6 +315,7 @@ onMounted(() => {
|
||||
|
||||
|
||||
.userInfoBox {
|
||||
min-width: 120px;
|
||||
|
||||
.nameBox {
|
||||
display: flex;
|
||||
|
||||
@@ -38,9 +38,10 @@
|
||||
<tableTag :num="overView.stoppedCount" circle-color="#ef4444" num-color="#DC2626" title="禁用"></tableTag>
|
||||
</div>
|
||||
<div class="toolbar-actions">
|
||||
<el-button :disabled="multiple" plain size="large" type="info" @click="handleDelete()">批量删除
|
||||
<el-button v-hasPermi="['cs:kb:remove']" :disabled="multiple" plain size="large" type="info"
|
||||
@click="handleDelete()">批量删除
|
||||
</el-button>
|
||||
<el-button size="large" type="primary" @click="handleAdd">新增问题
|
||||
<el-button v-hasPermi="['cs:kb:add']" size="large" type="primary" @click="handleAdd">新增问题
|
||||
</el-button>
|
||||
<right-toolbar v-model:show-search="showSearch" :search="false" @query-table="getList"></right-toolbar>
|
||||
</div>
|
||||
@@ -85,26 +86,27 @@
|
||||
<span>{{ scope.row.createTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
|
||||
<el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作"
|
||||
min-width="240">
|
||||
<template #default="scope">
|
||||
<el-button v-hasPermi="['system:cskb:edit']" :disabled="scope.$index === 0" link type="info"
|
||||
<el-button :disabled="scope.$index === 0" link type="info"
|
||||
@click="moveSort(scope.row,'up')">上移
|
||||
</el-button>
|
||||
<el-button v-hasPermi="['system:cskb:edit']" :disabled="scope.$index === csKbList.length-1" link
|
||||
<el-button :disabled="scope.$index === csKbList.length-1" link
|
||||
type="info"
|
||||
@click="moveSort(scope.row,'down')">下移
|
||||
</el-button>
|
||||
<el-button v-hasPermi="['system:cskb:edit']" link type="primary"
|
||||
<el-button v-hasPermi="['cs:kb:edit']" link type="primary"
|
||||
@click="handleUpdate(scope.row)">编辑
|
||||
</el-button>
|
||||
|
||||
<el-button v-if="scope.row.status === '0'" v-hasPermi="['system:cskb:edit']" link type="success"
|
||||
<el-button v-if="scope.row.status === '0'" v-hasPermi="['cs:kb:edit']" link type="success"
|
||||
@click="handleEnableOrUnEnable(scope.row,'1')">启用
|
||||
</el-button>
|
||||
<el-button v-else v-hasPermi="['system:cskb:edit']" link type="info"
|
||||
<el-button v-else v-hasPermi="['cs:kb:edit']" link type="info"
|
||||
@click="handleEnableOrUnEnable(scope.row,'0')">禁用
|
||||
</el-button>
|
||||
<el-button v-hasPermi="['system:cskb:remove']" link type="danger"
|
||||
<el-button v-hasPermi="['cs:kb:remove']" link type="danger"
|
||||
@click="handleDelete(scope.row)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
@@ -26,17 +26,17 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所在地区" prop="userName">
|
||||
<el-select
|
||||
v-model="queryParams.ipaddr"
|
||||
:empty-values="[null, undefined]"
|
||||
:value-on-clear="null"
|
||||
clearable
|
||||
<el-cascader
|
||||
v-model="ipaddr"
|
||||
size="large"
|
||||
style="width: 190px;"
|
||||
>
|
||||
<el-option label="在线" value="0"></el-option>
|
||||
<el-option label="离线" value="1"></el-option>
|
||||
</el-select>
|
||||
:clearable="true"
|
||||
:options="Administrative"
|
||||
:props="{
|
||||
label:'name',
|
||||
value:'name'
|
||||
}"
|
||||
@change="handelChangeQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="注册时间段" prop="createTime">
|
||||
@@ -97,9 +97,9 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="手机号" prop="phonenumber">
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="手机号" prop="phonenumber" width="120">
|
||||
<template #default="scope">
|
||||
<span>{{ hiddenPhone(scope.row.phonenumber) }}</span>
|
||||
<span>{{ scope.row.phonenumber }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="性别" prop="gender">
|
||||
@@ -109,35 +109,48 @@
|
||||
<span v-else style="color: #9CA3AF">未填写</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="生日" prop="birthday"></el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="所在地区" prop="deptName"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="绑定设备量" prop="deviceCount"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="注册时间" prop="createTime"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="最后登录时间" prop="loginDate"/>
|
||||
<el-table-column align="center" label="生日" prop="birthday" width="120"></el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="所在地区" min-width="180px"
|
||||
prop="deptName">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.province }}</span>
|
||||
<span v-if="scope.row.province && scope.row.city">/</span>
|
||||
<span>{{ scope.row.city }}</span>
|
||||
<span v-if="scope.row.district && scope.row.city">/</span>
|
||||
<span>{{ scope.row.district }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="绑定设备量" prop="deviceCount"
|
||||
width="100"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="注册时间" min-width="120"
|
||||
prop="createTime"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="最后登录时间" min-width="120"
|
||||
prop="loginDate"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="账号状态" prop="status">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.status === '0'" type="success">正常</el-tag>
|
||||
<el-tag v-else type="danger">异常</el-tag>
|
||||
<el-tag v-else type="danger">停用</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" min-width="250">
|
||||
<el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作"
|
||||
min-width="380">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-hasPermi="['monitor:online:forceLogout']"
|
||||
v-hasPermi="['customer:user:query']"
|
||||
plain
|
||||
type="primary"
|
||||
@click="handleMain(scope.row)"
|
||||
>查看详情
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['monitor:online:forceLogout']"
|
||||
v-hasPermiAnd="['customer:user:edit','customer:user:query']"
|
||||
plain
|
||||
type="info"
|
||||
@click="handleEdit(scope.row)"
|
||||
>编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['monitor:online:forceLogout']"
|
||||
v-hasPermi="['customer:user:resetPwd']"
|
||||
plain
|
||||
type="info"
|
||||
@click="handleReboot(scope.row)"
|
||||
@@ -145,7 +158,7 @@
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.status === '0'"
|
||||
v-hasPermi="['monitor:online:forceLogout']"
|
||||
v-hasPermi="['customer:user:edit']"
|
||||
plain
|
||||
type="warning"
|
||||
@click="changeStatus(scope.row, '1')"
|
||||
@@ -153,7 +166,7 @@
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.status === '1'"
|
||||
v-hasPermi="['monitor:online:forceLogout']"
|
||||
v-hasPermi="['customer:user:edit']"
|
||||
plain
|
||||
type="success"
|
||||
@click="changeStatus(scope.row, '0')"
|
||||
@@ -167,6 +180,7 @@
|
||||
v-model:limit="queryParams.pageSize"
|
||||
v-model:page="queryParams.pageNum"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
@@ -180,8 +194,8 @@ import pageCrumb from "@/components/Pagecrumb/index.vue";
|
||||
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';
|
||||
import Administrative from '@/data/Administrative.json';
|
||||
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@@ -208,10 +222,19 @@ function handleChangeTime(data) {
|
||||
const queryParams = ref<UserQuery>({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
ipaddr: '',
|
||||
userName: ''
|
||||
});
|
||||
|
||||
const ipaddr = ref([])
|
||||
|
||||
function handelChangeQuery(code: string[]) {
|
||||
queryParams.value.province = code[0] || undefined
|
||||
queryParams.value.city = code[1] || undefined
|
||||
queryParams.value.district = code[2] || undefined
|
||||
getList()
|
||||
}
|
||||
|
||||
|
||||
/** 查询登录日志列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
@@ -231,6 +254,10 @@ const resetQuery = () => {
|
||||
createTime.value = []
|
||||
queryParams.value.beginTime = undefined
|
||||
queryParams.value.endTime = undefined
|
||||
ipaddr.value = []
|
||||
queryParams.value.province = undefined
|
||||
queryParams.value.city = undefined
|
||||
queryParams.value.district = undefined
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
@@ -279,6 +306,10 @@ const handleExport = () => {
|
||||
|
||||
|
||||
async function selectDisableUser() {
|
||||
if (ids.value?.length === 0) {
|
||||
modal.msgWarning('请选择要禁用的用户')
|
||||
return
|
||||
}
|
||||
await modal.confirm('禁用账号会立即退出该用户的 APP 登录状态,确定要禁用这些选择的用户吗?')
|
||||
const userIds = ids.value || [];
|
||||
batchDisableUsers(userIds as string[]).then(() => {
|
||||
|
||||
617
src/views/system/device/devicelist/component/AirPurifier.vue
Normal file
617
src/views/system/device/devicelist/component/AirPurifier.vue
Normal file
@@ -0,0 +1,617 @@
|
||||
<script lang="ts" name="airPurifier" setup>
|
||||
import {DeviceForm} from "@/api/system/device/types";
|
||||
import {getDevice} from "@/api/system/device";
|
||||
import {DeviceStatus, fanLevel, parkingShutDown, powerMode, runMode} from "@/views/system/device/devicelist/type";
|
||||
|
||||
const initFormData: DeviceForm = {
|
||||
deviceId: undefined,
|
||||
deviceNo: undefined,
|
||||
name: undefined,
|
||||
productId: undefined,
|
||||
model: undefined,
|
||||
sn: undefined,
|
||||
mac: undefined,
|
||||
bluetoothConnected: undefined,
|
||||
status: undefined,
|
||||
bindUserId: undefined,
|
||||
bindTime: undefined,
|
||||
homeId: undefined,
|
||||
locationId: undefined,
|
||||
charging: undefined,
|
||||
deviceBattery: undefined,
|
||||
lastReportTime: undefined,
|
||||
lastOnlineTime: undefined,
|
||||
remark: undefined,
|
||||
createDept: undefined,
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
}
|
||||
const form = ref<DeviceForm>(initFormData);
|
||||
const route = useRoute();
|
||||
|
||||
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)
|
||||
}).catch(() => {
|
||||
if (timer.value) {
|
||||
clearTimeout(timer.value);
|
||||
timer.value = null;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
if (timer.value) {
|
||||
clearTimeout(timer.value);
|
||||
}
|
||||
timer.value = null;
|
||||
})
|
||||
|
||||
function init() {
|
||||
form.value = {...initFormData};
|
||||
if (route.query.id) {
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
|
||||
init()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="air-purifier">
|
||||
<div class="infoBox">
|
||||
<div class="info-item">
|
||||
<el-image class="info_img"
|
||||
src="https://ts2.tc.mm.bing.net/th/id/OIP-C.2KXRoOZ1EPBDMf6jrp6xeAHaE7?r=0&rs=1&pid=ImgDetMain&o=7&rm=3"></el-image>
|
||||
<div class="info">
|
||||
<div class="nav">
|
||||
<div class="title">{{ form.name }}</div>
|
||||
<div v-if="form.status === DeviceStatus.online" class="tag online">
|
||||
<i class="circle"></i>
|
||||
<span>在线</span>
|
||||
</div>
|
||||
<div v-else-if="form.status === DeviceStatus.offline" class="tag online offline">
|
||||
<i class="circle"></i>
|
||||
<span>离线</span>
|
||||
</div>
|
||||
<div v-else-if="form.status === DeviceStatus.unActive" class="tag online unActive">
|
||||
<i class="circle"></i>
|
||||
<span>未激活</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="info-list">
|
||||
<div class="info-list-item">
|
||||
<div class="title">设备ID</div>
|
||||
<div class="value">{{ form.deviceId }}</div>
|
||||
</div>
|
||||
<div class="info-list-item">
|
||||
<div class="title">MAC地址</div>
|
||||
<div class="value">{{ form.mac }}</div>
|
||||
</div>
|
||||
<div class="info-list-item">
|
||||
<div class="title">所在房间</div>
|
||||
<div class="value">{{ form.locationName }}</div>
|
||||
</div>
|
||||
<div class="info-list-item">
|
||||
<div class="title">产品型号</div>
|
||||
<div class="value">{{ form.model }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="timeBox">
|
||||
<div class="title">最后上报时间</div>
|
||||
<div class="time">{{ form.updateTime }}</div>
|
||||
<div class="tip">
|
||||
<i class="circle"></i>
|
||||
<span>每30s自动刷新</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="baseInfo">
|
||||
<cardNav subTitle="静态档案信息,如需修改请前往「编辑设备」页" title="设备基础档案"></cardNav>
|
||||
<div class=" gridBox">
|
||||
<div class="grid-item">
|
||||
<div class="title">设备ID</div>
|
||||
<div class="value">{{ form.deviceId }}</div>
|
||||
</div>
|
||||
<div class="grid-item">
|
||||
<div class="title">设备名称</div>
|
||||
<div class="value">{{ form.name }}</div>
|
||||
</div>
|
||||
<div class="grid-item">
|
||||
<div class="title">MAC地址</div>
|
||||
<div class="value">{{ form.mac }}</div>
|
||||
</div>
|
||||
<div class="grid-item">
|
||||
<div class="title">产品型号</div>
|
||||
<div class="value">{{ form.model }}</div>
|
||||
</div>
|
||||
<div class="grid-item">
|
||||
<div class="title">所在房间</div>
|
||||
<div class="value">{{ form.homeName }}</div>
|
||||
</div>
|
||||
<div class="grid-item">
|
||||
</div>
|
||||
<div class="grid-item">
|
||||
<div class="title">档案创建时间</div>
|
||||
<div class="value">{{ form.createTime }}</div>
|
||||
</div>
|
||||
<div class="grid-item">
|
||||
<div class="title">档案更新时间</div>
|
||||
<div class="value">{{ form.updateTime }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="form.purifier" class="readTimeBox">
|
||||
<cardNav line-color="#14b8a6" subTitle="设备蓝牙上报 · 只读 · 每 30 秒自动刷新"
|
||||
title="设备实时运行状态"></cardNav>
|
||||
<div class="flexBox">
|
||||
<div class="flex-item">
|
||||
<div class="flex-item-nav">
|
||||
<i class="circle"></i>
|
||||
<span>环境数据</span>
|
||||
</div>
|
||||
<div class="numBox">
|
||||
<div class="num">{{ form.tvoc || '--' }}</div>
|
||||
<div v-if="form.status === DeviceStatus.online" class="tag">
|
||||
<i class="circle"></i>
|
||||
<span>在线</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="subTitle">TVOC 传感器原始读数(未换算为浓度值)</div>
|
||||
<div class="footer">
|
||||
<span>数据更新时间</span>
|
||||
<span style="color: rgba(17, 24, 39, 1);">2026-09-30 12:50:30</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item flex flex-col">
|
||||
<div class="flex-item-nav">
|
||||
<i class="circle" style="background: #2563eb"></i>
|
||||
<span>运行数据</span>
|
||||
</div>
|
||||
<div class="flex-1 flex flex-col justify-evenly">
|
||||
<div class="footer" style="margin-top: 0">
|
||||
<span>运行模式</span>
|
||||
<div>
|
||||
<span v-if="form.runMode == runMode.dask" style="color: rgba(17, 24, 39, 1);">桌面模式</span>
|
||||
<span v-else-if="form.runMode == runMode.car" style="color: rgba(17, 24, 39, 1);">车载模式</span>
|
||||
<span v-else style="color: rgba(17, 24, 39, 1);">自动</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer" style="margin-top: 0">
|
||||
<span>风速挡位</span>
|
||||
<div>
|
||||
<span v-if="form.fanLevel == fanLevel.power" style="color: rgba(17, 24, 39, 1);">强力</span>
|
||||
<span v-else-if="form.fanLevel == fanLevel.lower" style="color: rgba(17, 24, 39, 1);">低档</span>
|
||||
<span v-else style="color: rgba(17, 24, 39, 1);">标准</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer" style="margin-top: 0">
|
||||
<span>供电模式</span>
|
||||
<div>
|
||||
<span v-if="form.powerMode == powerMode.usb" style="color: rgba(17, 24, 39, 1);">USB供电</span>
|
||||
<span v-else style="color: rgba(17, 24, 39, 1);">电池供电</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer" style="margin-top: 0">
|
||||
<span>停车关机模式</span>
|
||||
<el-tag v-if="form.parkingShutdown == parkingShutDown.open" type="success">开启</el-tag>
|
||||
<el-tag v-else type="danger">关闭</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item flex flex-col ">
|
||||
<div class="flex-item-nav">
|
||||
<i class="circle" style="background: #f59e0b"></i>
|
||||
<span>耗材与电量</span>
|
||||
</div>
|
||||
<div class="flex-1 flex justify-evenly">
|
||||
<div v-if="form.filterLife !== null" class="ageBox">
|
||||
<div class="title">滤芯寿命</div>
|
||||
<div class="processInfo">
|
||||
<span class="num">{{ form.filterLife }}</span>
|
||||
<span class="unit">%</span>
|
||||
</div>
|
||||
<el-progress :percentage="form.filterLife" :show-text="false"></el-progress>
|
||||
<div class="tip">
|
||||
<span>预计剩余可用 {{ form.filterRemainDays || '---' }} 天</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="form.deviceBattery!==null && form.filterLife !==null" class="line"></div>
|
||||
<div v-if="form.deviceBattery!==null" class="ageBox BatteryBox">
|
||||
<div class="title">电池电量</div>
|
||||
<div class="processInfo">
|
||||
<span class="num">{{ form.deviceBattery }}</span>
|
||||
<span class="unit">%</span>
|
||||
</div>
|
||||
<el-progress :percentage="form.deviceBattery" :show-text="false" color="#22C55E"></el-progress>
|
||||
<el-tag type="success">充电中</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item flex flex-col ">
|
||||
<div class="flex-item-nav">
|
||||
<i class="circle" style="background: #6366f1"></i>
|
||||
<span>策略说明 · 停车关机模式</span>
|
||||
</div>
|
||||
<ul style="margin-top: 16px;">
|
||||
<li class="modelLi">
|
||||
<el-tag type="success">开启</el-tag>
|
||||
<span class="describe">USB 外部供电断开后,电池供电继续运行 5 分钟消杀再自动关机;低电量 SOC<10% 时关闭等离子消杀;SOC<5% 整机锁机(防止过放)。</span>
|
||||
</li>
|
||||
<li class="modelLi">
|
||||
<el-tag type="info">关闭</el-tag>
|
||||
<span class="describe">不执行该套低电量策略,仅保留基础净化逻辑。</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.air-purifier {
|
||||
|
||||
.infoBox {
|
||||
padding: 24px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
max-height: 177px;
|
||||
min-width: 750px;
|
||||
border-radius: 16px 16px 16px 16px;
|
||||
border: 1px solid rgba(238, 240, 243, 1);
|
||||
margin-top: 8px;
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.info_img {
|
||||
width: 97px;
|
||||
height: 97px;
|
||||
border-radius: 16px 16px 16px 16px;
|
||||
}
|
||||
|
||||
.info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
margin-left: 24px;
|
||||
|
||||
.nav {
|
||||
display: flex;
|
||||
align-items: end;
|
||||
|
||||
.title {
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
color: rgba(17, 24, 39, 1);
|
||||
font-size: 22px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.tag {
|
||||
margin-left: 5px;
|
||||
width: 62px;
|
||||
height: 28px;
|
||||
border-radius: 14px;
|
||||
|
||||
&.online {
|
||||
background-color: rgba(232, 247, 238, 1);
|
||||
color: rgba(22, 163, 74, 1);
|
||||
font-size: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.circle {
|
||||
margin-right: 6px;
|
||||
display: block;
|
||||
width: 7px;
|
||||
height: 6px;
|
||||
border-radius: 3px;
|
||||
background-color: rgba(22, 163, 74, 1);
|
||||
}
|
||||
|
||||
|
||||
&.offline {
|
||||
background-color: rgba(237, 56, 34, 0.2);
|
||||
color: rgb(237 56 34);
|
||||
|
||||
.circle {
|
||||
background-color: rgb(237 56 34);
|
||||
}
|
||||
}
|
||||
|
||||
&.unActive {
|
||||
background-color: #ccc;
|
||||
color: #838383;
|
||||
|
||||
.circle {
|
||||
background-color: #838383;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.info-list {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
margin-top: 28px;
|
||||
|
||||
.info-list-item {
|
||||
.title {
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
color: rgba(156, 163, 175, 1);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.value {
|
||||
height: 40px;
|
||||
line-height: 20px;
|
||||
color: rgba(17, 24, 39, 1);
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.timeBox {
|
||||
.title {
|
||||
text-align: right;
|
||||
line-height: 16px;
|
||||
color: rgba(156, 163, 175, 1);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.time {
|
||||
line-height: 22px;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
color: rgba(17, 24, 39, 1);
|
||||
font-size: 16px;
|
||||
margin-top: 6px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.tip {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: end;
|
||||
|
||||
span {
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
color: rgba(37, 99, 235, 1);
|
||||
font-size: 12px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.circle {
|
||||
margin-right: 6px;
|
||||
display: block;
|
||||
width: 7px;
|
||||
height: 6px;
|
||||
border-radius: 3px;
|
||||
background-color: #2563eb;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.baseInfo {
|
||||
padding: 25px;
|
||||
min-height: 248px;
|
||||
border-radius: 16px 16px 16px 16px;
|
||||
border: 1px solid rgba(238, 240, 243, 1);
|
||||
margin: 16px 0;
|
||||
|
||||
.gridBox {
|
||||
margin-top: 44px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(381px, 1fr));
|
||||
gap: 20px;
|
||||
|
||||
@media (max-width: 1659px) {
|
||||
grid-template-columns: repeat(3, minmax(381px, 1fr));
|
||||
}
|
||||
@media (max-width: 1250px) {
|
||||
grid-template-columns: repeat(2, minmax(381px, 1fr));
|
||||
}
|
||||
@media (max-width: 600px) {
|
||||
grid-template-columns: repeat(1, minmax(381px, 1fr));
|
||||
}
|
||||
|
||||
.grid-item {
|
||||
max-width: 381px;
|
||||
|
||||
.title {
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
color: rgba(156, 163, 175, 1);
|
||||
font-size: 12px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.value {
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
color: rgba(17, 24, 39, 1);
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.readTimeBox {
|
||||
padding: 25px;
|
||||
border-radius: 16px 16px 16px 16px;
|
||||
border: 1px solid rgba(238, 240, 243, 1);
|
||||
|
||||
.flexBox {
|
||||
margin-top: 44px;
|
||||
gap: 20px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(360px, 1fr));
|
||||
@media (max-width: 900px) {
|
||||
grid-template-columns: repeat(1, minmax(381px, 1fr));
|
||||
}
|
||||
|
||||
.flex-item {
|
||||
min-height: 201px;
|
||||
border-radius: 12px 12px 12px 12px;
|
||||
background-color: rgba(247, 249, 252, 1);
|
||||
border: 1px solid rgba(238, 240, 243, 1);
|
||||
padding: 21px;
|
||||
|
||||
.flex-item-nav {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.circle {
|
||||
margin-right: 6px;
|
||||
display: block;
|
||||
width: 7px;
|
||||
height: 6px;
|
||||
border-radius: 3px;
|
||||
background-color: rgba(22, 163, 74, 1);
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
.numBox {
|
||||
display: flex;
|
||||
align-items: end;
|
||||
margin-top: 17px;
|
||||
|
||||
.num {
|
||||
line-height: 43px;
|
||||
color: rgba(17, 24, 39, 1);
|
||||
font-size: 36px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.tag {
|
||||
margin-left: 5px;
|
||||
width: 62px;
|
||||
height: 28px;
|
||||
border-radius: 14px;
|
||||
|
||||
$backColor: rgba(232, 247, 238, 1);
|
||||
$textColor: rgba(22, 163, 74, 1);
|
||||
|
||||
background-color: $backColor;
|
||||
color: $textColor;
|
||||
font-size: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.circle {
|
||||
margin-right: 6px;
|
||||
display: block;
|
||||
width: 7px;
|
||||
height: 6px;
|
||||
border-radius: 3px;
|
||||
background-color: $textColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.subTitle {
|
||||
margin-top: 12px;
|
||||
line-height: 16px;
|
||||
color: rgba(156, 163, 175, 1);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
margin-top: 44px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
line-height: 14px;
|
||||
color: rgba(107, 114, 128, 1);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
|
||||
// 滤芯寿命
|
||||
.ageBox {
|
||||
flex: 1;
|
||||
margin-top: 16px;
|
||||
|
||||
.title {
|
||||
line-height: 18px;
|
||||
color: rgba(107, 114, 128, 1);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.processInfo {
|
||||
margin: 12px 0;
|
||||
|
||||
.num {
|
||||
line-height: 31px;
|
||||
color: rgba(17, 24, 39, 1);
|
||||
font-size: 26px;
|
||||
}
|
||||
|
||||
.unit {
|
||||
line-height: 17px;
|
||||
color: rgba(107, 114, 128, 1);
|
||||
font-size: 14px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.tip {
|
||||
line-height: 16px;
|
||||
color: rgba(156, 163, 175, 1);
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 2px;
|
||||
height: 96px;
|
||||
background-color: rgba(238, 240, 243, 1);
|
||||
margin: 15px 24px;
|
||||
}
|
||||
|
||||
.modelLi {
|
||||
margin-bottom: 12px;
|
||||
|
||||
span.describe {
|
||||
margin-left: 12px;
|
||||
line-height: 16px;
|
||||
color: rgba(75, 85, 99, 1);
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -4,6 +4,7 @@ import FormItemTip from '@/components/FormItemTip/index.vue';
|
||||
import {DeviceForm} from "@/api/system/device/types";
|
||||
import {getDevice, updateDevice} from "@/api/system/device";
|
||||
import modal from "@/plugins/modal";
|
||||
import {airLevel, DeviceStatus} from "@/views/system/device/devicelist/type";
|
||||
|
||||
function submitForm() {
|
||||
if (!form.value.name || form.value.name.trim() === "") {
|
||||
@@ -110,10 +111,18 @@ init()
|
||||
<div class="info">
|
||||
<div class="nav">
|
||||
<div class="title">Z2空气净化器</div>
|
||||
<div class="tag online">
|
||||
<div v-if="form.status === DeviceStatus.online" class="tag online">
|
||||
<i class="circle"></i>
|
||||
<span>在线</span>
|
||||
</div>
|
||||
<div v-else-if="form.status === DeviceStatus.offline" class="tag online offline">
|
||||
<i class="circle"></i>
|
||||
<span>离线</span>
|
||||
</div>
|
||||
<div v-else-if="form.status === DeviceStatus.unActive" class="tag online unActive">
|
||||
<i class="circle"></i>
|
||||
<span>未激活</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="describe">DEV-2026-000138·AA:BB:CC:DD:EE:B·客厅·CZ-Z2023</div>
|
||||
</div>
|
||||
@@ -208,8 +217,11 @@ init()
|
||||
<li class="li-item">
|
||||
<div class="title">TVOC数值</div>
|
||||
<div class="value">
|
||||
<span class="Num">{{ form.tvoc }}</span>
|
||||
<el-tag type="success">优</el-tag>
|
||||
<span class="Num">{{ form.tvoc || '--' }}</span>
|
||||
<el-tag v-if="form.airLevel === airLevel.Excellent" type="primary">优</el-tag>
|
||||
<el-tag v-else-if="form.airLevel === airLevel.good" type="success">良</el-tag>
|
||||
<el-tag v-else-if="form.airLevel === airLevel.poor" type="warning">差</el-tag>
|
||||
<el-tag v-else-if="form.airLevel === airLevel.polluted" type="info">污染</el-tag>
|
||||
</div>
|
||||
</li>
|
||||
<li class="li-item">
|
||||
@@ -235,19 +247,19 @@ init()
|
||||
<span v-else class="Num">电池供电</span>
|
||||
</div>
|
||||
</li>
|
||||
<li class="li-item">
|
||||
<li v-if="form.filterLife !== null" class="li-item">
|
||||
<div class="title">滤芯寿命</div>
|
||||
<div class="value">
|
||||
<span class="Num">{{ form.filterLife }}%</span>
|
||||
</div>
|
||||
<div class="tip">剩余{{ form.filterRemainDays }}天</div>
|
||||
<div class="tip">剩余 {{ form.filterRemainDays || '--' }} 天</div>
|
||||
</li>
|
||||
<li class="li-item">
|
||||
<li v-if="form.deviceBattery !== null" class="li-item">
|
||||
<div class="title">电池电量</div>
|
||||
<div class="value">
|
||||
<span class="Num">85%</span>
|
||||
<span class="Num">{{ form.deviceBattery }}%</span>
|
||||
</div>
|
||||
<div class="tip">剩余128天</div>
|
||||
<div class="tip"></div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -331,6 +343,24 @@ init()
|
||||
border-radius: 3px;
|
||||
background-color: rgba(22, 163, 74, 1);
|
||||
}
|
||||
|
||||
&.offline {
|
||||
background-color: rgba(237, 56, 34, 0.2);
|
||||
color: rgb(237 56 34);
|
||||
|
||||
.circle {
|
||||
background-color: rgb(237 56 34);
|
||||
}
|
||||
}
|
||||
|
||||
&.unActive {
|
||||
background-color: #ccc;
|
||||
color: #838383;
|
||||
|
||||
.circle {
|
||||
background-color: #838383;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,24 +47,25 @@
|
||||
<el-table v-loading="loading" :data="deviceList" border class="data-table"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column align="center" type="selection" width="55"/>
|
||||
<el-table-column align="center" label="设备名称" prop="name"/>
|
||||
<el-table-column align="center" label="产品型号" prop="model"/>
|
||||
<el-table-column align="center" label="所在房间" prop="homeName"/>
|
||||
<el-table-column align="center" label="设备名称" min-width="150" prop="name"/>
|
||||
<el-table-column align="center" label="产品型号" min-width="150" prop="model"/>
|
||||
<el-table-column align="center" label="所在房间" min-width="150" prop="homeName"/>
|
||||
<el-table-column align="center" label="在线状态" prop="status" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.status === '0'" type="success">在线</el-tag>
|
||||
<el-tag v-else type="danger">离线</el-tag>
|
||||
<el-tag v-if="scope.row.status === DeviceStatus.online" type="success">在线</el-tag>
|
||||
<el-tag v-else-if="scope.row.status === DeviceStatus.offline" type="danger">离线</el-tag>
|
||||
<el-tag v-else-if="scope.row.status === DeviceStatus.unActive" type="info">未激活</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="当前TVOC" prop="tvoc">
|
||||
<el-table-column align="center" label="当前TVOC" min-width="100" prop="tvoc">
|
||||
<template #default="scope">
|
||||
<div class="flex flex-items-center justify-center">
|
||||
<div>{{ scope.row.tvoc ?? '--' }}</div>
|
||||
<div>
|
||||
<el-tag v-if="scope.row.airLevel == '0'" type="primary">优</el-tag>
|
||||
<el-tag v-else-if="scope.row.airLevel == '1'" type="success">良</el-tag>
|
||||
<el-tag v-else-if="scope.row.airLevel == '2'" type="warning">差</el-tag>
|
||||
<el-tag v-else-if="scope.row.airLevel == '3'" type="danger">污染</el-tag>
|
||||
<el-tag v-if="scope.row.airLevel === airLevel.Excellent" type="primary">优</el-tag>
|
||||
<el-tag v-else-if="scope.row.airLevel === airLevel.good" type="success">良</el-tag>
|
||||
<el-tag v-else-if="scope.row.airLevel === airLevel.poor" type="warning">差</el-tag>
|
||||
<el-tag v-else-if="scope.row.airLevel === airLevel.polluted" type="danger">污染</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -76,34 +77,36 @@
|
||||
}" class="defaultLife">{{ scope.row.filterLife }}%</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="电池电量" prop="deviceBattery" width="100">
|
||||
<template #default="scope">
|
||||
<span :class="{
|
||||
lowBattery: scope.row.filterLife < 50
|
||||
}" class="defaultLife">{{ scope.row.filterLife }}%</span>
|
||||
<el-table-column align="center" label="电池电量" width="100">
|
||||
<template #default="{ row }">
|
||||
<div v-if="row.deviceBattery" :class="{ lowBattery: row.deviceBattery < 50 }" class="defaultLife">
|
||||
{{ row.deviceBattery }}%
|
||||
</div>
|
||||
<div v-else>---</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="运行模式" prop="runMode" width="100">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.runMode == '2'" style="color: rgba(17, 24, 39, 1);">桌面模式</span>
|
||||
<span v-else-if="scope.row.runMode == '1'" style="color: rgba(17, 24, 39, 1);">车载模式</span>
|
||||
<span v-if="scope.row.runMode == runMode.dask" style="color: rgba(17, 24, 39, 1);">桌面模式</span>
|
||||
<span v-else-if="scope.row.runMode == runMode.car" style="color: rgba(17, 24, 39, 1);">车载模式</span>
|
||||
<span v-else style="color: rgba(17, 24, 39, 1);">自动</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="风速挡位" prop="mac" width="100">
|
||||
<el-table-column align="center" label="风速挡位" prop="fanLevel" width="100">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.fanLevel == '1'" style="color: rgba(17, 24, 39, 1);">强力</span>
|
||||
<span v-else-if="scope.row.fanLevel == '2'" style="color: rgba(17, 24, 39, 1);">低档</span>
|
||||
<span v-if="scope.row.fanLevel == fanLevel.power" style="color: rgba(17, 24, 39, 1);">强力</span>
|
||||
<span v-else-if="scope.row.fanLevel == fanLevel.lower" style="color: rgba(17, 24, 39, 1);">低档</span>
|
||||
<span v-else style="color: rgba(17, 24, 39, 1);">标准</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="创建时间" prop="createTime"/>
|
||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" min-width="100">
|
||||
<el-table-column align="center" label="数据更新时间" min-width="180" prop="updateTime"/>
|
||||
<el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作"
|
||||
min-width="200">
|
||||
<template #default="scope">
|
||||
<el-button v-hasPermi="['device:device:query']" plain type="primary"
|
||||
@click="handleUpdate(scope.row)">查看详情
|
||||
</el-button>
|
||||
<el-button v-hasPermi="['device:device:edit']" plain type="info"
|
||||
<el-button v-hasPermiAnd="['device:device:edit','device:device:query']" plain type="info"
|
||||
@click="handleEdit(scope.row)">编辑
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -129,6 +132,7 @@ import {useSearchToggle} from '@/hooks/form/useSearchToggle';
|
||||
import {useTableSelection} from '@/hooks/table/useTableSelection';
|
||||
import modal from '@/plugins/modal';
|
||||
import {download as requestDownload} from '@/utils/request';
|
||||
import {airLevel, DeviceStatus, fanLevel, runMode} from "@/views/system/device/devicelist/type";
|
||||
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@@ -3,10 +3,12 @@ import cardNav from '@/components/cardNav/index.vue';
|
||||
import {getDevice} from "@/api/system/device";
|
||||
import {DeviceForm} from "@/api/system/device/types";
|
||||
import {useUserStore} from "@/store/modules/user";
|
||||
|
||||
import {DeviceStatus, fanLevel, parkingShutDown, powerMode, runMode} from "@/views/system/device/devicelist/type";
|
||||
// import airPurifier from './component/AirPurifier.vue'
|
||||
|
||||
const userStore = useUserStore();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
function backList() {
|
||||
router.replace({
|
||||
@@ -23,32 +25,20 @@ function editDevice() {
|
||||
})
|
||||
}
|
||||
|
||||
const route = useRoute();
|
||||
const initFormData: DeviceForm = {
|
||||
deviceId: undefined,
|
||||
deviceNo: undefined,
|
||||
imei: undefined,
|
||||
name: undefined,
|
||||
productId: undefined,
|
||||
model: undefined,
|
||||
sn: undefined,
|
||||
hwVersion: undefined,
|
||||
swVersion: undefined,
|
||||
fwVersion: undefined,
|
||||
pkgVersion: undefined,
|
||||
ip: undefined,
|
||||
mac: undefined,
|
||||
wifiSsid: undefined,
|
||||
bluetoothConnected: undefined,
|
||||
status: undefined,
|
||||
bindUserId: undefined,
|
||||
bindTime: undefined,
|
||||
homeId: undefined,
|
||||
locationId: undefined,
|
||||
signalLevel: undefined,
|
||||
lng: undefined,
|
||||
lat: undefined,
|
||||
address: undefined,
|
||||
charging: undefined,
|
||||
deviceBattery: undefined,
|
||||
lastReportTime: undefined,
|
||||
@@ -59,24 +49,8 @@ const initFormData: DeviceForm = {
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
activeDeviceNo: undefined,
|
||||
activeImei: undefined,
|
||||
activeMac: undefined,
|
||||
}
|
||||
|
||||
const form = ref();
|
||||
|
||||
function init() {
|
||||
form.value = {...initFormData};
|
||||
if (route.query.id) {
|
||||
getDevice(route.query.id as string).then(res => {
|
||||
Object.assign(form.value, res.data);
|
||||
refresh()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
init()
|
||||
const form = ref<DeviceForm>(initFormData);
|
||||
|
||||
|
||||
let timer = ref<NodeJS.Timeout | null>(null);
|
||||
@@ -84,10 +58,16 @@ 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)
|
||||
}).catch(() => {
|
||||
if (timer.value) {
|
||||
clearTimeout(timer.value);
|
||||
timer.value = null;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
@@ -96,6 +76,31 @@ onUnmounted(() => {
|
||||
}
|
||||
timer.value = null;
|
||||
})
|
||||
|
||||
function init() {
|
||||
form.value = {...initFormData};
|
||||
if (route.query.id) {
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
|
||||
init()
|
||||
|
||||
// const compDefine = ref<any>(null)
|
||||
// const compMap: Record<string, () => Promise<typeof import("*.vue")>> = {
|
||||
// airPurifier: () => import('./component/AirPurifier.vue'),
|
||||
// }
|
||||
// const currentComp = computed(() => compDefine.value)
|
||||
// const loadDevice = async () => {
|
||||
// const loader = compMap['airPurifier']
|
||||
// // 动态import组件
|
||||
// const mod = await loader()
|
||||
// compDefine.value = mod.default
|
||||
// }
|
||||
//
|
||||
// onMounted(() => {
|
||||
// loadDevice()
|
||||
// })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -116,10 +121,18 @@ onUnmounted(() => {
|
||||
<div class="info">
|
||||
<div class="nav">
|
||||
<div class="title">{{ form.name }}</div>
|
||||
<div class="tag online">
|
||||
<div v-if="form.status === DeviceStatus.online" class="tag online">
|
||||
<i class="circle"></i>
|
||||
<span>在线</span>
|
||||
</div>
|
||||
<div v-else-if="form.status === DeviceStatus.offline" class="tag online offline">
|
||||
<i class="circle"></i>
|
||||
<span>离线</span>
|
||||
</div>
|
||||
<div v-else-if="form.status === DeviceStatus.unActive" class="tag online unActive">
|
||||
<i class="circle"></i>
|
||||
<span>未激活</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="info-list">
|
||||
<div class="info-list-item">
|
||||
@@ -150,8 +163,6 @@ onUnmounted(() => {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="baseInfo">
|
||||
<cardNav subTitle="静态档案信息,如需修改请前往「编辑设备」页" title="设备基础档案"></cardNav>
|
||||
<div class=" gridBox">
|
||||
@@ -197,8 +208,8 @@ onUnmounted(() => {
|
||||
<span>环境数据</span>
|
||||
</div>
|
||||
<div class="numBox">
|
||||
<div class="num">{{ form.tvoc }}</div>
|
||||
<div class="tag">
|
||||
<div class="num">{{ form.tvoc || '--' }}</div>
|
||||
<div v-if="form.status === DeviceStatus.online" class="tag">
|
||||
<i class="circle"></i>
|
||||
<span>在线</span>
|
||||
</div>
|
||||
@@ -218,29 +229,29 @@ onUnmounted(() => {
|
||||
<div class="footer" style="margin-top: 0">
|
||||
<span>运行模式</span>
|
||||
<div>
|
||||
<span v-if="form.runMode == '2'" style="color: rgba(17, 24, 39, 1);">桌面模式</span>
|
||||
<span v-else-if="form.runMode == '1'" style="color: rgba(17, 24, 39, 1);">车载模式</span>
|
||||
<span v-if="form.runMode == runMode.dask" style="color: rgba(17, 24, 39, 1);">桌面模式</span>
|
||||
<span v-else-if="form.runMode == runMode.car" style="color: rgba(17, 24, 39, 1);">车载模式</span>
|
||||
<span v-else style="color: rgba(17, 24, 39, 1);">自动</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer" style="margin-top: 0">
|
||||
<span>风速挡位</span>
|
||||
<div>
|
||||
<span v-if="form.fanLevel == '1'" style="color: rgba(17, 24, 39, 1);">强力</span>
|
||||
<span v-else-if="form.fanLevel == '2'" style="color: rgba(17, 24, 39, 1);">低档</span>
|
||||
<span v-if="form.fanLevel == fanLevel.power" style="color: rgba(17, 24, 39, 1);">强力</span>
|
||||
<span v-else-if="form.fanLevel == fanLevel.lower" style="color: rgba(17, 24, 39, 1);">低档</span>
|
||||
<span v-else style="color: rgba(17, 24, 39, 1);">标准</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer" style="margin-top: 0">
|
||||
<span>供电模式</span>
|
||||
<div>
|
||||
<span v-if="form.powerMode == '0'" style="color: rgba(17, 24, 39, 1);">USB供电</span>
|
||||
<span v-if="form.powerMode == powerMode.usb" style="color: rgba(17, 24, 39, 1);">USB供电</span>
|
||||
<span v-else style="color: rgba(17, 24, 39, 1);">电池供电</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer" style="margin-top: 0">
|
||||
<span>停车关机模式</span>
|
||||
<el-tag v-if="form.parkingShutdown == '1'" type="success">开启</el-tag>
|
||||
<el-tag v-if="form.parkingShutdown == parkingShutDown.open" type="success">开启</el-tag>
|
||||
<el-tag v-else type="danger">关闭</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
@@ -251,7 +262,7 @@ onUnmounted(() => {
|
||||
<span>耗材与电量</span>
|
||||
</div>
|
||||
<div class="flex-1 flex justify-evenly">
|
||||
<div class="ageBox">
|
||||
<div v-if="form.filterLife !== null" class="ageBox">
|
||||
<div class="title">滤芯寿命</div>
|
||||
<div class="processInfo">
|
||||
<span class="num">{{ form.filterLife }}</span>
|
||||
@@ -259,17 +270,17 @@ onUnmounted(() => {
|
||||
</div>
|
||||
<el-progress :percentage="form.filterLife" :show-text="false"></el-progress>
|
||||
<div class="tip">
|
||||
<span>预计剩余可用{{ form.filterRemainDays }}天</span>
|
||||
<span>预计剩余可用 {{ form.filterRemainDays || '---' }} 天</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
<div class="ageBox BatteryBox">
|
||||
<div v-if="form.deviceBattery!==null && form.filterLife !==null" class="line"></div>
|
||||
<div v-if="form.deviceBattery!==null" class="ageBox BatteryBox">
|
||||
<div class="title">电池电量</div>
|
||||
<div class="processInfo">
|
||||
<span class="num">76</span>
|
||||
<span class="num">{{ form.deviceBattery }}</span>
|
||||
<span class="unit">%</span>
|
||||
</div>
|
||||
<el-progress :percentage="30" :show-text="false" color="#22C55E"></el-progress>
|
||||
<el-progress :percentage="form.deviceBattery" :show-text="false" color="#22C55E"></el-progress>
|
||||
<el-tag type="success">充电中</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
@@ -292,6 +303,10 @@ onUnmounted(() => {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <component-->
|
||||
<!-- :is="currentComp"-->
|
||||
<!-- v-if="currentComp"-->
|
||||
<!-- />-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -364,6 +379,25 @@ onUnmounted(() => {
|
||||
border-radius: 3px;
|
||||
background-color: rgba(22, 163, 74, 1);
|
||||
}
|
||||
|
||||
|
||||
&.offline {
|
||||
background-color: rgba(237, 56, 34, 0.2);
|
||||
color: rgb(237 56 34);
|
||||
|
||||
.circle {
|
||||
background-color: rgb(237 56 34);
|
||||
}
|
||||
}
|
||||
|
||||
&.unActive {
|
||||
background-color: #ccc;
|
||||
color: #838383;
|
||||
|
||||
.circle {
|
||||
background-color: #838383;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**设备状态*/
|
||||
enum Status {
|
||||
export enum DeviceStatus {
|
||||
/**未激活*/
|
||||
unActive = '0',
|
||||
/**在线*/
|
||||
@@ -9,57 +9,57 @@ enum Status {
|
||||
}
|
||||
|
||||
/**运行模式*/
|
||||
enum runMode {
|
||||
export enum runMode {
|
||||
/**自动*/
|
||||
auto = 0,
|
||||
auto = '0',
|
||||
/**车载模式*/
|
||||
car = 1,
|
||||
car = '1',
|
||||
/**桌面模式*/
|
||||
dask = 2
|
||||
dask = '2'
|
||||
}
|
||||
|
||||
/**
|
||||
* 风速
|
||||
* */
|
||||
enum fanLevel {
|
||||
export enum fanLevel {
|
||||
/**
|
||||
* 标准
|
||||
*/
|
||||
normal = 0,
|
||||
normal = '0',
|
||||
/**
|
||||
* 强力
|
||||
* */
|
||||
power = 1,
|
||||
power = '1',
|
||||
/**
|
||||
* 低档
|
||||
* */
|
||||
lower = 2
|
||||
lower = '2'
|
||||
}
|
||||
|
||||
/**
|
||||
* 空气质量
|
||||
* */
|
||||
enum airLevel {
|
||||
export enum airLevel {
|
||||
/**优*/
|
||||
Excellent,
|
||||
Excellent = '0',
|
||||
/**良*/
|
||||
good,
|
||||
good = '1',
|
||||
/**差*/
|
||||
poor,
|
||||
poor = '2',
|
||||
/**污染*/
|
||||
polluted
|
||||
polluted = '3'
|
||||
}
|
||||
|
||||
/**供电方式*/
|
||||
enum powerMode {
|
||||
export enum powerMode {
|
||||
/**USB*/
|
||||
USB,
|
||||
usb = '0',
|
||||
/**电池*/
|
||||
Battery
|
||||
battery = '1'
|
||||
}
|
||||
|
||||
/**蓝牙连接情况*/
|
||||
enum bluetoothConnected {
|
||||
export enum bluetoothConnected {
|
||||
/**未连接*/
|
||||
unConnected = 0,
|
||||
/**已连接*/
|
||||
@@ -69,9 +69,9 @@ enum bluetoothConnected {
|
||||
/**
|
||||
* @enum {number}
|
||||
* */
|
||||
enum parkingShutDown {
|
||||
export enum parkingShutDown {
|
||||
/**开*/
|
||||
open,
|
||||
open = '1',
|
||||
/**关*/
|
||||
close
|
||||
close = '0'
|
||||
}
|
||||
|
||||
@@ -120,6 +120,7 @@
|
||||
v-if="previewListResource && checkFileSuffix(scope.row.fileSuffix)"
|
||||
:width="100"
|
||||
:height="100"
|
||||
:lazy="true"
|
||||
:src="scope.row.url"
|
||||
:preview-src-list="[scope.row.url]"
|
||||
/>
|
||||
|
||||
@@ -38,7 +38,8 @@
|
||||
<h3>已授权用户</h3>
|
||||
</div>
|
||||
<div class="toolbar-actions">
|
||||
<el-button v-hasPermi="['system:role:add']" type="primary" plain icon="Plus" @click="openSelectUser">
|
||||
<el-button v-hasPermiAnd="['system:role:add','system:user:list']" icon="Plus" plain type="primary"
|
||||
@click="openSelectUser">
|
||||
添加用户
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -63,11 +64,11 @@
|
||||
:data="userList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="用户名称" prop="userName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="用户昵称" prop="nickName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="手机" prop="phoneNumber" :show-overflow-tooltip="true" />
|
||||
<el-table-column align="center" type="selection" width="55"/>
|
||||
<el-table-column :show-overflow-tooltip="true" label="用户名称" prop="userName"/>
|
||||
<el-table-column :show-overflow-tooltip="true" label="用户昵称" prop="nickName"/>
|
||||
<el-table-column :show-overflow-tooltip="true" label="邮箱" prop="email"/>
|
||||
<el-table-column :show-overflow-tooltip="true" label="手机" prop="phoneNumber"/>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status"/>
|
||||
@@ -147,6 +148,7 @@ const getList = async () => {
|
||||
total.value = res.data?.total;
|
||||
});
|
||||
};
|
||||
const router = useRouter();
|
||||
// 返回按钮
|
||||
const handleClose = () => {
|
||||
const obj: RouteLocationNormalized = {
|
||||
@@ -161,6 +163,7 @@ const handleClose = () => {
|
||||
redirectedFrom: undefined
|
||||
};
|
||||
tab.closeOpenPage(obj as any);
|
||||
router.back()
|
||||
};
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
|
||||
@@ -27,18 +27,6 @@
|
||||
<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">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
@@ -59,26 +47,6 @@
|
||||
<el-button v-hasPermi="['system:role:add']" type="primary" plain icon="Plus" @click="handleAdd()">
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['system:role:edit']"
|
||||
type="success"
|
||||
plain
|
||||
:disabled="single"
|
||||
icon="Edit"
|
||||
@click="handleUpdate()"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['system:role:remove']"
|
||||
type="danger"
|
||||
plain
|
||||
:disabled="ids.length === 0"
|
||||
icon="Delete"
|
||||
@click="handleDelete()"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-hasPermi="['system:role:export']" type="warning" plain icon="Download" @click="handleExport">
|
||||
导出
|
||||
</el-button>
|
||||
@@ -282,40 +250,40 @@
|
||||
</el-tree>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="数据权限" name="data">
|
||||
<el-form-item label="权限范围">
|
||||
<el-select v-model="form.dataScope" @change="dataScopeSelectChange">
|
||||
<el-option
|
||||
v-for="item in dataScopeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.dataScope === '2'" label="数据权限">
|
||||
<el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">
|
||||
展开/折叠
|
||||
</el-checkbox>
|
||||
<el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">
|
||||
全选/全不选
|
||||
</el-checkbox>
|
||||
<el-checkbox v-model="form.deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')">
|
||||
父子联动
|
||||
</el-checkbox>
|
||||
<el-tree
|
||||
ref="deptRef"
|
||||
class="tree-border"
|
||||
:data="deptOptions"
|
||||
show-checkbox
|
||||
default-expand-all
|
||||
node-key="id"
|
||||
:check-strictly="!form.deptCheckStrictly"
|
||||
empty-text="加载中,请稍候"
|
||||
:props="{ label: 'label', children: 'children' }"
|
||||
></el-tree>
|
||||
</el-form-item>
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane label="数据权限" name="data">-->
|
||||
<!-- <el-form-item label="权限范围">-->
|
||||
<!-- <el-select v-model="form.dataScope" @change="dataScopeSelectChange">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in dataScopeOptions"-->
|
||||
<!-- :key="item.value"-->
|
||||
<!-- :label="item.label"-->
|
||||
<!-- :value="item.value"-->
|
||||
<!-- ></el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item v-show="form.dataScope === '2'" label="数据权限">-->
|
||||
<!-- <el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">-->
|
||||
<!-- 展开/折叠-->
|
||||
<!-- </el-checkbox>-->
|
||||
<!-- <el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">-->
|
||||
<!-- 全选/全不选-->
|
||||
<!-- </el-checkbox>-->
|
||||
<!-- <el-checkbox v-model="form.deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')">-->
|
||||
<!-- 父子联动-->
|
||||
<!-- </el-checkbox>-->
|
||||
<!-- <el-tree-->
|
||||
<!-- ref="deptRef"-->
|
||||
<!-- class="tree-border"-->
|
||||
<!-- :data="deptOptions"-->
|
||||
<!-- show-checkbox-->
|
||||
<!-- default-expand-all-->
|
||||
<!-- node-key="id"-->
|
||||
<!-- :check-strictly="!form.deptCheckStrictly"-->
|
||||
<!-- empty-text="加载中,请稍候"-->
|
||||
<!-- :props="{ label: 'label', children: 'children' }"-->
|
||||
<!-- ></el-tree>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-tab-pane>-->
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
|
||||
@@ -58,7 +58,7 @@ const rules = {
|
||||
nickName: [{required: true, message: '用户昵称不能为空', trigger: 'blur'}],
|
||||
password: [
|
||||
{required: true, message: '用户密码不能为空', trigger: 'blur'},
|
||||
{min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur'},
|
||||
{min: 8, max: 20, message: '用户密码长度必须介于 8 和 20 之间', trigger: 'blur'},
|
||||
{pattern: /^[^<>"'|\\]+$/, message: '不能包含非法字符:< > " \' \\ |', trigger: 'blur'}
|
||||
],
|
||||
phoneNumber: [
|
||||
@@ -71,6 +71,7 @@ const rules = {
|
||||
],
|
||||
confirmPassword: [
|
||||
{required: true, message: '确认密码不能为空', trigger: 'blur'},
|
||||
{min: 8, max: 20, message: '确认密码长度必须介于 8 和 20 之间', trigger: 'blur'},
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (value !== form.value.password) {
|
||||
@@ -95,6 +96,7 @@ function getRoleList() {
|
||||
function reset() {
|
||||
form.value = {...initForm};
|
||||
formRef.value?.resetFields();
|
||||
router.back();
|
||||
}
|
||||
|
||||
function addRoleAction() {
|
||||
|
||||
@@ -36,13 +36,13 @@
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色" prop="status">
|
||||
<el-select v-model="queryParams.status" clearable placeholder="用户角色" size="large">
|
||||
<el-form-item label="角色" prop="roleId">
|
||||
<el-select v-model="queryParams.roleId" clearable placeholder="用户角色" size="large">
|
||||
<el-option
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
v-for="dict in rolesOptions"
|
||||
:key="dict.roleId"
|
||||
:label="dict.roleName"
|
||||
:value="dict.roleId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -74,7 +74,6 @@
|
||||
<div class="toolbar-actions">
|
||||
<right-toolbar
|
||||
v-model:show-search="showSearch"
|
||||
:columns="columns"
|
||||
:search="false"
|
||||
storage-key="sys_user_column_visible"
|
||||
@query-table="getList"
|
||||
@@ -141,7 +140,7 @@
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作"
|
||||
width="220">
|
||||
width="250">
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.userId !== '1761100000000000001'">
|
||||
<el-button
|
||||
@@ -402,6 +401,7 @@ import {globalHeaders} from '@/utils/request';
|
||||
import {download as requestDownload} from '@/utils/request';
|
||||
import UserViewDrawer from './view.vue';
|
||||
import {hiddenPhone} from "@/utils/phone";
|
||||
import {listRole} from "@/api/system/role";
|
||||
|
||||
const router = useRouter();
|
||||
const {sys_normal_disable, sys_user_gender} = toRefs<any>(useDict('sys_normal_disable', 'sys_user_gender'));
|
||||
@@ -416,6 +416,18 @@ const enabledDeptOptions = ref<DeptTreeVO[]>([]);
|
||||
const initPassword = ref<string>('');
|
||||
const postOptions = ref<PostVO[]>([]);
|
||||
const roleOptions = ref<RoleVO[]>([]);
|
||||
|
||||
|
||||
const rolesOptions = ref<RoleVO[]>([]);
|
||||
|
||||
function getRolesOptions() {
|
||||
listRole({pageNum: 1, pageSize: undefined}).then(res => {
|
||||
rolesOptions.value = res.data.rows;
|
||||
})
|
||||
}
|
||||
|
||||
getRolesOptions()
|
||||
|
||||
/*** 用户导入参数 */
|
||||
const upload = reactive<ImportOption>({
|
||||
// 是否显示弹出层(用户导入)
|
||||
@@ -433,7 +445,7 @@ const upload = reactive<ImportOption>({
|
||||
});
|
||||
// 列显隐信息
|
||||
const columns = ref<FieldOption[]>([
|
||||
{key: 0, label: `用户编号`, visible: false, children: []},
|
||||
// {key: 0, label: `用户编号`, visible: false, children: []},
|
||||
{key: 1, label: `用户名称`, visible: true, children: []},
|
||||
{key: 2, label: `用户昵称`, visible: true, children: []},
|
||||
{key: 3, label: `部门`, visible: true, children: []},
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import {defineConfig, loadEnv} from 'vite';
|
||||
import createPlugins from './vite/plugins/index.js';
|
||||
import autoprefixer from 'autoprefixer'; // CSS 自动添加浏览器兼容性前缀
|
||||
import autoprefixer from 'autoprefixer';
|
||||
import zipPack from 'vite-plugin-zip-pack';
|
||||
|
||||
/**
|
||||
* Vite 配置入口
|
||||
@@ -36,7 +37,14 @@ export default defineConfig(({mode, command}) => {
|
||||
// 插件列表,统一在 ./vite/plugins/index.ts 中定义
|
||||
// 将 env 和 isBuild 传入,便于插件根据环境做差异化处理
|
||||
// ========================================================
|
||||
plugins: createPlugins(env, command === 'build'),
|
||||
plugins: [
|
||||
...createPlugins(env, command === 'build'),
|
||||
zipPack({
|
||||
inDir: 'dist',
|
||||
outDir: './',
|
||||
outFileName: 'dist.zip'
|
||||
})
|
||||
],
|
||||
|
||||
// ========================================================
|
||||
// Rolldown 高级选项(Vite 8 底层默认使用 Rolldown 打包)
|
||||
|
||||
Reference in New Issue
Block a user