diff --git a/.env.development b/.env.development
index 0891a69..ec76dea 100644
--- a/.env.development
+++ b/.env.development
@@ -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'
diff --git a/.env.production b/.env.production
index 847354e..e27eaa4 100644
--- a/.env.production
+++ b/.env.production
@@ -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'
diff --git a/package.json b/package.json
index 17c8bad..962650c 100644
--- a/package.json
+++ b/package.json
@@ -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"
},
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 218e06a..7ffb4c2 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -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
diff --git a/src/api/system/conversation/types.ts b/src/api/system/conversation/types.ts
index 8342c56..90b5cc9 100644
--- a/src/api/system/conversation/types.ts
+++ b/src/api/system/conversation/types.ts
@@ -117,6 +117,7 @@ export interface CsSessionForm extends BaseEntity {
}
export interface CsSessionQuery extends PageQuery {
+ phonenumber?: string;
/**
* 会话编号
*/
diff --git a/src/api/system/device/types.ts b/src/api/system/device/types.ts
index ae6abf5..1eb2211 100644
--- a/src/api/system/device/types.ts
+++ b/src/api/system/device/types.ts
@@ -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用户
*/
diff --git a/src/api/types.ts b/src/api/types.ts
index b578f5c..a8d1214 100644
--- a/src/api/types.ts
+++ b/src/api/types.ts
@@ -31,6 +31,7 @@ export interface LoginData {
*/
export interface LoginResult {
access_token: string;
+ client_id: string;
}
/**
diff --git a/src/assets/styles/components/_page-shell.scss b/src/assets/styles/components/_page-shell.scss
index e9b1dc3..b2b7aaa 100644
--- a/src/assets/styles/components/_page-shell.scss
+++ b/src/assets/styles/components/_page-shell.scss
@@ -27,7 +27,7 @@
width: 32px;
height: 32px;
border-radius: 10px;
- background: $background;
+ //background: $background;
}
}
}
@@ -63,9 +63,8 @@
.tree-panel-col,
.tree-content-col {
min-width: 0;
- transition:
- max-width 0.24s ease,
- flex-basis 0.24s ease;
+ transition: max-width 0.24s ease,
+ flex-basis 0.24s ease;
}
.tree-panel-col.is-collapsed {
diff --git a/src/components/ImagePreview/index.vue b/src/components/ImagePreview/index.vue
index 9beada2..29c92ad 100644
--- a/src/components/ImagePreview/index.vue
+++ b/src/components/ImagePreview/index.vue
@@ -4,18 +4,21 @@
fit="cover"
:style="`width:${realWidth};height:${realHeight};`"
:preview-src-list="realSrcList"
+ :lazy="lazy"
preview-teleported
>
-
+
diff --git a/src/directive/index.ts b/src/directive/index.ts
index c0bed9a..0122d40 100644
--- a/src/directive/index.ts
+++ b/src/directive/index.ts
@@ -1,9 +1,10 @@
-import type { App } from 'vue';
+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);
};
diff --git a/src/directive/permission/index.ts b/src/directive/permission/index.ts
index c06568c..604f09c 100644
--- a/src/directive/permission/index.ts
+++ b/src/directive/permission/index.ts
@@ -1,13 +1,14 @@
-import type { Directive, DirectiveBinding } from 'vue';
-import { useUserStore } from '@/store/modules/user';
+import type {Directive, DirectiveBinding} from 'vue';
+import {useUserStore} from '@/store/modules/user';
+
/**
* 操作权限处理
*/
export const hasPermi: Directive = {
mounted(el: HTMLElement, binding: DirectiveBinding) {
- const { permissions } = useUserStore();
+ const {permissions} = useUserStore();
// 「其他角色」按钮权限校验
- const { value } = binding;
+ const {value} = binding;
if (value && value instanceof Array && value.length > 0) {
const hasPermission = permissions.some((permi: string) => {
return permi === '*:*:*' || value.includes(permi);
@@ -21,14 +22,36 @@ 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']\"");
+ }
+ }
+};
/**
* 角色权限处理
*/
export const hasRoles: Directive = {
mounted(el: HTMLElement, binding: DirectiveBinding) {
- const { value } = binding;
- const { roles } = useUserStore();
+ const {value} = binding;
+ const {roles} = useUserStore();
if (value && value instanceof Array && value.length > 0) {
const hasRole = roles.some((role: string) => {
return role === 'superadmin' || role === 'admin' || value.includes(role);
diff --git a/src/permission.ts b/src/permission.ts
index 53fbdd4..db50c6f 100644
--- a/src/permission.ts
+++ b/src/permission.ts
@@ -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`; // 否则全部重定向到登录页
}
diff --git a/src/store/modules/csSession.ts b/src/store/modules/csSession.ts
index f62cf79..0d8c84e 100644
--- a/src/store/modules/csSession.ts
+++ b/src/store/modules/csSession.ts
@@ -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,
diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts
index 839c9c9..a3cd8b8 100644
--- a/src/store/modules/user.ts
+++ b/src/store/modules/user.ts
@@ -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();
diff --git a/src/utils/request.ts b/src/utils/request.ts
index 595560a..a0597c6 100644
--- a/src/utils/request.ts
+++ b/src/utils/request.ts
@@ -90,21 +90,12 @@ export async function extractErrorMessage(error: any): Promise {
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,19 +220,15 @@ 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(() => {
isRelogin.show = false;
diff --git a/src/utils/time.ts b/src/utils/time.ts
index 4f36261..d7a04c0 100644
--- a/src/utils/time.ts
+++ b/src/utils/time.ts
@@ -1,13 +1,13 @@
/**
- * 根据数字 1-7 生成对应星期
- * @param num 1=周一,2=周二...7=周日
+ * 根据数字 0-6 生成对应星期
+ * @param num 0=周日,1=周一,2=周二,3=周三,4=周四,5=周五,6=周六
* @param options 选项对象
* @param options.prefix 选项,可自定义前缀,默认 '周'
* @returns 周一 / 周二 ... / 周日
*/
-export function numToWeek(num: number,options = {
+export function numToWeek(num: number, options = {
prefix: '周',
}): string {
- const weekMap = ['一', '二', '三', '四', '五', '六', '日'];
- return options.prefix + weekMap[num - 1] || '';
+ const weekMap = ['日', '一', '二', '三', '四', '五', '六'];
+ return options.prefix + weekMap[num] || '';
}
diff --git a/src/views/login.vue b/src/views/login.vue
index fe83305..a69399b 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -51,7 +51,7 @@
}"
>
- {{ numToWeek(item.formateDay + 1) }}
+ {{ numToWeek(item.formateDay) }}
({{ item.month }}.{{ item.date }})
@@ -127,7 +127,7 @@
-
![]()
+
@@ -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) {
diff --git a/src/views/system/agreement/index.vue b/src/views/system/agreement/index.vue
index b77f29b..9e12a60 100644
--- a/src/views/system/agreement/index.vue
+++ b/src/views/system/agreement/index.vue
@@ -66,7 +66,7 @@
- 编辑
上传图片
@@ -55,7 +56,11 @@ const props = defineProps({
type: Boolean,
default: false
},
-
+ /** 是否正在上传图片 */
+ uploading: {
+ type: Boolean,
+ default: false
+ },
/** 是否禁用输入框 */
disable: {
type: Boolean,
diff --git a/src/views/system/conversation/compontents/MessageList/index.vue b/src/views/system/conversation/compontents/MessageList/index.vue
index dca3bde..9547fe7 100644
--- a/src/views/system/conversation/compontents/MessageList/index.vue
+++ b/src/views/system/conversation/compontents/MessageList/index.vue
@@ -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()
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}
)
diff --git a/src/views/system/conversation/conversationMain.vue b/src/views/system/conversation/conversationMain.vue
index 57c0517..95bee55 100644
--- a/src/views/system/conversation/conversationMain.vue
+++ b/src/views/system/conversation/conversationMain.vue
@@ -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() {
-
diff --git a/src/views/system/conversation/index.vue b/src/views/system/conversation/index.vue
index 3f29aff..9943dbd 100644
--- a/src/views/system/conversation/index.vue
+++ b/src/views/system/conversation/index.vue
@@ -8,8 +8,8 @@
-
-
+
@@ -26,24 +26,24 @@
:value="item.value">
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
@@ -83,14 +84,15 @@
全部
- 1286
+ {{ overViewTotal }}
- 批量导出会话记录
+ 批量导出会话记录
+
刷新
@@ -99,23 +101,26 @@
v-loading="loading"
:data="onlineList"
border
+ @select="handleSelectionChange"
class="data-table"
style="width: 100%"
>
-
+
-
+
{{ scope.row.customer.nickName }}
-
{{ hiddenPhone(scope.row.customer.phonenumber) }}
+
+
{{ scope.row.customer.phonenumber }}
-
+
@@ -126,23 +131,24 @@
{{ scope.row.agentName }}
-
+
+ min-width="220">
查看会话
@@ -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(useDict('com_session_state'));
@@ -182,11 +191,21 @@ const total = ref(0);
const {ids, single, multiple, handleSelectionChange} = useTableSelection(item => item.sessionId);
const queryFormRef = ref();
+
+const queryParamsOptions = ref([]);
+
+function getUserOptionsByAgent() {
+ listUser({pageNum: 1, pageSize: undefined, roleId: "2095336076121190401",}).then((res) => {
+ queryParamsOptions.value = res.data?.rows || [];
+ })
+}
+
+getUserOptionsByAgent()
+
+
const queryParams = ref({
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) {
/** 导出按钮操作 */
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;
diff --git a/src/views/system/cskb/index.vue b/src/views/system/cskb/index.vue
index f08591e..8d1ce33 100644
--- a/src/views/system/cskb/index.vue
+++ b/src/views/system/cskb/index.vue
@@ -38,9 +38,10 @@
- 批量删除
+ 批量删除
- 新增问题
+ 新增问题
@@ -85,26 +86,27 @@
{{ scope.row.createTime }}
-
+
- 上移
- 下移
- 编辑
- 启用
- 禁用
- 删除
diff --git a/src/views/system/customer/index.vue b/src/views/system/customer/index.vue
index 240dfe0..17853cb 100644
--- a/src/views/system/customer/index.vue
+++ b/src/views/system/customer/index.vue
@@ -26,17 +26,17 @@
-
-
-
-
+ :clearable="true"
+ :options="Administrative"
+ :props="{
+ label:'name',
+ value:'name'
+ }"
+ @change="handelChangeQuery"
+ />
@@ -97,9 +97,9 @@
-
+
- {{ hiddenPhone(scope.row.phonenumber) }}
+ {{ scope.row.phonenumber }}
@@ -109,35 +109,48 @@
未填写
-
-
-
-
-
+
+
+
+ {{ scope.row.province }}
+ /
+ {{ scope.row.city }}
+ /
+ {{ scope.row.district }}
+
+
+
+
+
正常
- 异常
+ 停用
-
+
查看详情
编辑
@@ -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({
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(() => {
diff --git a/src/views/system/device/devicelist/component/AirPurifier.vue b/src/views/system/device/devicelist/component/AirPurifier.vue
new file mode 100644
index 0000000..f9cd2ed
--- /dev/null
+++ b/src/views/system/device/devicelist/component/AirPurifier.vue
@@ -0,0 +1,617 @@
+
+
+
+
+
+
+
+
+
+
{{ form.name }}
+
+
+ 在线
+
+
+
+ 离线
+
+
+
+ 未激活
+
+
+
+
+
设备ID
+
{{ form.deviceId }}
+
+
+
MAC地址
+
{{ form.mac }}
+
+
+
所在房间
+
{{ form.locationName }}
+
+
+
产品型号
+
{{ form.model }}
+
+
+
+
+
+
最后上报时间
+
{{ form.updateTime }}
+
+
+ 每30s自动刷新
+
+
+
+
+
+
+
+
设备ID
+
{{ form.deviceId }}
+
+
+
设备名称
+
{{ form.name }}
+
+
+
MAC地址
+
{{ form.mac }}
+
+
+
产品型号
+
{{ form.model }}
+
+
+
所在房间
+
{{ form.homeName }}
+
+
+
+
+
档案创建时间
+
{{ form.createTime }}
+
+
+
档案更新时间
+
{{ form.updateTime }}
+
+
+
+
+
+
+
+
+
+ 环境数据
+
+
+
{{ form.tvoc || '--' }}
+
+
+ 在线
+
+
+
TVOC 传感器原始读数(未换算为浓度值)
+
+
+
+
+
+ 运行数据
+
+
+
+
+
+
+
+
+
+
+
+ 耗材与电量
+
+
+
+
滤芯寿命
+
+ {{ form.filterLife }}
+ %
+
+
+
+ 预计剩余可用 {{ form.filterRemainDays || '---' }} 天
+
+
+
+
+
电池电量
+
+ {{ form.deviceBattery }}
+ %
+
+
+
充电中
+
+
+
+
+
+
+ 策略说明 · 停车关机模式
+
+
+ -
+ 开启
+ USB 外部供电断开后,电池供电继续运行 5 分钟消杀再自动关机;低电量 SOC<10% 时关闭等离子消杀;SOC<5% 整机锁机(防止过放)。
+
+ -
+ 关闭
+ 不执行该套低电量策略,仅保留基础净化逻辑。
+
+
+
+
+
+
+
+
+
diff --git a/src/views/system/device/devicelist/edit.vue b/src/views/system/device/devicelist/edit.vue
index 8fc8ec5..25c85fc 100644
--- a/src/views/system/device/devicelist/edit.vue
+++ b/src/views/system/device/devicelist/edit.vue
@@ -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()
Z2空气净化器
-
+
在线
+
+
+ 离线
+
+
+
+ 未激活
+
DEV-2026-000138·AA:BB:CC:DD:EE:B·客厅·CZ-Z2023
@@ -208,8 +217,11 @@ init()
TVOC数值
- {{ form.tvoc }}
- 优
+ {{ form.tvoc || '--' }}
+ 优
+ 良
+ 差
+ 污染
@@ -235,19 +247,19 @@ init()
电池供电
-
+
滤芯寿命
{{ form.filterLife }}%
- 剩余{{ form.filterRemainDays }}天
+ 剩余 {{ form.filterRemainDays || '--' }} 天
-
+
电池电量
- 85%
+ {{ form.deviceBattery }}%
- 剩余128天
+
@@ -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;
+ }
+ }
}
}
}
diff --git a/src/views/system/device/devicelist/index.vue b/src/views/system/device/devicelist/index.vue
index 22e7f41..8e74859 100644
--- a/src/views/system/device/devicelist/index.vue
+++ b/src/views/system/device/devicelist/index.vue
@@ -47,24 +47,25 @@
-
-
-
+
+
+
- 在线
- 离线
+ 在线
+ 离线
+ 未激活
-
+
{{ scope.row.tvoc ?? '--' }}
- 优
- 良
- 差
- 污染
+ 优
+ 良
+ 差
+ 污染
@@ -76,34 +77,36 @@
}" class="defaultLife">{{ scope.row.filterLife }}%
-
-
- {{ scope.row.filterLife }}%
+
+
+
+ {{ row.deviceBattery }}%
+
+ ---
- 桌面模式
- 车载模式
+ 桌面模式
+ 车载模式
自动
-
+
- 强力
- 低档
+ 强力
+ 低档
标准
-
-
+
+
查看详情
- 编辑
@@ -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();
diff --git a/src/views/system/device/devicelist/main.vue b/src/views/system/device/devicelist/main.vue
index 302f682..4a8fdbf 100644
--- a/src/views/system/device/devicelist/main.vue
+++ b/src/views/system/device/devicelist/main.vue
@@ -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(initFormData);
let timer = ref(null);
@@ -84,10 +58,16 @@ let timer = ref(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;
+ }
});
- timer.value = setTimeout(() => {
- refresh();
- }, 30000)
+
}
onUnmounted(() => {
@@ -96,6 +76,31 @@ onUnmounted(() => {
}
timer.value = null;
})
+
+function init() {
+ form.value = {...initFormData};
+ if (route.query.id) {
+ refresh()
+ }
+}
+
+init()
+
+// const compDefine = ref(null)
+// const compMap: Record Promise> = {
+// 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()
+// })
@@ -116,10 +121,18 @@ onUnmounted(() => {
{{ form.name }}
-
+
在线
+
+
+ 离线
+
+
+
+ 未激活
+
@@ -150,8 +163,6 @@ onUnmounted(() => {
-
-
@@ -197,8 +208,8 @@ onUnmounted(() => {
环境数据
-
{{ form.tvoc }}
-
+
{{ form.tvoc || '--' }}
+
在线
@@ -218,29 +229,29 @@ onUnmounted(() => {
@@ -251,7 +262,7 @@ onUnmounted(() => {
耗材与电量
-
+
滤芯寿命
{{ form.filterLife }}
@@ -259,17 +270,17 @@ onUnmounted(() => {
- 预计剩余可用{{ form.filterRemainDays }}天
+ 预计剩余可用 {{ form.filterRemainDays || '---' }} 天
-
-
+
+
电池电量
- 76
+ {{ form.deviceBattery }}
%
-
+
充电中
@@ -292,6 +303,10 @@ onUnmounted(() => {
+
+
+
+
@@ -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;
+ }
+ }
}
}
}
diff --git a/src/views/system/device/devicelist/type.ts b/src/views/system/device/devicelist/type.ts
index 05c7282..61f7ef9 100644
--- a/src/views/system/device/devicelist/type.ts
+++ b/src/views/system/device/devicelist/type.ts
@@ -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'
}
diff --git a/src/views/system/oss/index.vue b/src/views/system/oss/index.vue
index 1e8680e..3307d5b 100644
--- a/src/views/system/oss/index.vue
+++ b/src/views/system/oss/index.vue
@@ -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]"
/>
diff --git a/src/views/system/role/authUser.vue b/src/views/system/role/authUser.vue
index efd667e..1a79bd7 100644
--- a/src/views/system/role/authUser.vue
+++ b/src/views/system/role/authUser.vue
@@ -38,7 +38,8 @@
已授权用户
-
+
添加用户
-
-
-
-
-
+
+
+
+
+
-
+
@@ -100,31 +101,31 @@
:total="total"
@pagination="getList"
/>
-
+