Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
AI推理平台
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lichunliang
AI推理平台
Commits
1f872198
Commit
1f872198
authored
Apr 14, 2025
by
lei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除log
parent
f787c894
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
609 additions
and
524 deletions
+609
-524
.env
.env
+7
-3
.env.prod
.env.prod
+5
-5
index.ts
src/api/index.ts
+170
-184
service.ts
src/utils/service.ts
+18
-17
index.vue
src/views/AlarmCenter/AlarmLog/index.vue
+2
-2
index.vue
src/views/AlarmCenter/AlarmReminder/index.vue
+275
-164
index.vue
src/views/home/index.vue
+6
-10
line-chart.vue
src/views/home/modules/line-chart.vue
+85
-98
pie-chart-pro.vue
src/views/home/modules/pie-chart-pro.vue
+4
-4
ring-chart.vue
src/views/home/modules/ring-chart.vue
+2
-2
vite.config.ts
vite.config.ts
+35
-35
No files found.
.env
View file @
1f872198
...
@@ -74,10 +74,14 @@ VITE_STORAGE_PREFIX=SOY_
...
@@ -74,10 +74,14 @@ VITE_STORAGE_PREFIX=SOY_
# ============================================ old
# ============================================ old
# 开发环境 - 视频流地址
# 开发环境 - 视频流地址
VITE_VIDEO_URL=ws://1
0.0.20.81
:9999
VITE_VIDEO_URL=ws://1
92.168.3.248
:9999
# 开发环境 - 所有服务接口地址
# 开发环境 - 所有服务接口地址
VITE_SERVICE_URL=http://1
0.0.20.81
:9996
VITE_SERVICE_URL=http://1
92.168.3.248
:9996
# 开发环境 - WebSocket 全局地址
# 开发环境 - WebSocket 全局地址
VITE_WEBSOCKET_URL=ws://10.0.20.81:9996
VITE_WEBSOCKET_URL=ws://192.168.3.248:9999
VITE_OTHER_SERVICE_BASE_URL= `{
"demo": "http://192.168.3.248:9999"
}`
\ No newline at end of file
.env.prod
View file @
1f872198
# backend service base url, prod environment
# backend service base url, prod environment
# VITE_SERVICE_BASE_URL=http
s://192.168.5.223:
# VITE_SERVICE_BASE_URL=http
://192.168.5.223:9999
VITE_VIDEO_URL=ws://192.168.5.223:9999
VITE_VIDEO_URL=ws://192.168.5.223:9999
VITE_SERVICE_URL=http
s
://192.168.5.223:9996
VITE_SERVICE_URL=http://192.168.5.223:9996
VITE_WEBSOCKET_URL=ws://192.168.5.223:9999
VITE_WEBSOCKET_URL=ws://192.168.5.223:9999
# other backend service base url, prod environment
# other backend service base url, prod environment
VITE_OTHER_SERVICE_BASE_URL= `{
#
VITE_OTHER_SERVICE_BASE_URL= `{
"demo": "http://192.168.5.223:9999"
#
"demo": "http://192.168.5.223:9999"
}`
#
}`
src/api/index.ts
View file @
1f872198
import
{
extend
}
from
'
dayjs
'
;
import
{
extend
}
from
"
dayjs
"
;
import
axios
from
'
axios
'
;
import
axios
from
"
axios
"
;
import
type
{
IArea
,
ItablePagination
}
from
'
../views/AlgorithmConfiguration/index
'
;
import
type
{
import
{
localStg
}
from
'
@/utils/storage
'
;
IArea
,
import
{
useRouter
}
from
'
vue-router
'
;
ItablePagination
,
import
{
useMessage
}
from
'
naive-ui
'
;
}
from
"
../views/AlgorithmConfiguration/index
"
;
import
{
Windows
}
from
'
@vicons/fa
'
;
import
{
localStg
}
from
"
@/utils/storage
"
;
import
{
useRouter
}
from
"
vue-router
"
;
import
{
useMessage
}
from
"
naive-ui
"
;
axios
.
defaults
.
baseURL
=
'
/v1
'
;
import
{
Windows
}
from
"
@vicons/fa
"
;
axios
.
defaults
.
baseURL
=
"
/v1
"
;
const
router
=
useRouter
();
const
router
=
useRouter
();
const
message
=
useMessage
();
const
message
=
useMessage
();
...
@@ -16,94 +18,100 @@ const message = useMessage();
...
@@ -16,94 +18,100 @@ const message = useMessage();
// return window.href = '/login';
// return window.href = '/login';
// };
// };
const
gloabalReqErrorMsg
=
(
e
)
=>
{
const
gloabalReqErrorMsg
=
(
e
)
=>
{
switch
(
e
.
code
)
{
switch
(
e
.
code
)
{
case
"
ERR_BAD_REQUEST
"
:
case
"
ERR_BAD_REQUEST
"
:
return
window
.
$message
.
error
(
"
权限过期!
"
)
return
window
.
$message
.
error
(
"
权限过期!
"
)
;
}
}
};
axios
.
interceptors
.
request
.
use
(
(
req
)
=>
{
let
token
=
localStg
.
get
(
"
token
"
);
}
if
(
token
)
req
.
headers
[
"
token
"
]
=
`
${
token
}
`
;
axios
.
interceptors
.
request
.
use
((
req
)
=>
{
let
token
=
localStg
.
get
(
'
token
'
);
if
(
token
)
req
.
headers
[
'
token
'
]
=
`
${
token
}
`
;
// let whiteRouteList = ['login']
// for(let r of whiteRouteList) {
// }
return
req
;
},
(
e
)
=>
Promise
.
reject
(
e
));
// let whiteRouteList = ['login']
axios
.
interceptors
.
response
.
use
((
res
)
=>
{
// for(let r of whiteRouteList) {
console
.
log
(
'
------------------------- res
'
,
res
)
if
(
res
.
status
===
401
)
{
window
.
location
.
href
=
'
/login
'
};
return
res
;
},
(
e
)
=>
{
// }
window
.
location
.
href
=
'
/login
'
});
return
req
;
},
(
e
)
=>
Promise
.
reject
(
e
),
);
axios
.
interceptors
.
response
.
use
(
(
res
)
=>
{
if
(
res
.
status
===
401
)
{
window
.
location
.
href
=
"
/login
"
;
}
return
res
;
},
(
e
)
=>
{
window
.
location
.
href
=
"
/login
"
;
},
);
// 区域 - 查
// 区域 - 查
export
const
api_getAreaNode
=
async
():
Promise
<
any
>
=>
await
axios
.
get
(
'
/menus/tree
'
);
export
const
api_getAreaNode
=
async
():
Promise
<
any
>
=>
await
axios
.
get
(
"
/menus/tree
"
);
// 区域 - 增
// 区域 - 增
export
const
api_addAreaNode
=
async
(
data
:
IArea
):
Promise
<
any
>
=>
await
axios
.
post
(
'
/menus
'
,
data
);
export
const
api_addAreaNode
=
async
(
data
:
IArea
):
Promise
<
any
>
=>
await
axios
.
post
(
"
/menus
"
,
data
);
// 区域 - 改
// 区域 - 改
export
const
api_modifyAreaNode
=
async
(
data
:
IArea
):
Promise
<
any
>
=>
await
axios
.
put
(
'
/menus
'
,
data
);
export
const
api_modifyAreaNode
=
async
(
data
:
IArea
):
Promise
<
any
>
=>
await
axios
.
put
(
"
/menus
"
,
data
);
// 区域 - 删
// 区域 - 删
export
const
api_deleteAreaNode
=
async
(
id
:
number
|
string
):
Promise
<
any
>
=>
await
axios
.
delete
(
`/menus/
${
id
}
`
);
export
const
api_deleteAreaNode
=
async
(
id
:
number
|
string
):
Promise
<
any
>
=>
await
axios
.
delete
(
`/menus/
${
id
}
`
);
// 区域 = 查
// 区域 = 查
export
const
api_getCameras
=
async
():
Promise
<
any
>
=>
await
axios
.
get
(
`/menus`
);
export
const
api_getCameras
=
async
():
Promise
<
any
>
=>
await
axios
.
get
(
`/menus`
);
// 摄像头 - 查
// 摄像头 - 查
export
const
api_getCameraList
=
async
(
params
:
ItablePagination
):
Promise
<
any
>
=>
export
const
api_getCameraList
=
async
(
await
axios
.
get
(
`/cameras/page`
,
{
params
});
params
:
ItablePagination
,
):
Promise
<
any
>
=>
await
axios
.
get
(
`/cameras/page`
,
{
params
});
// 摄像头 - 增
// 摄像头 - 增
export
const
api_addCameras
=
async
(
data
:
any
):
Promise
<
any
>
=>
await
axios
.
post
(
`/cameras`
,
data
);
export
const
api_addCameras
=
async
(
data
:
any
):
Promise
<
any
>
=>
await
axios
.
post
(
`/cameras`
,
data
);
// 摄像头 - 改
// 摄像头 - 改
export
const
api_modifyCameras
=
async
(
data
:
any
):
Promise
<
any
>
=>
await
axios
.
put
(
`/cameras`
,
data
);
export
const
api_modifyCameras
=
async
(
data
:
any
):
Promise
<
any
>
=>
await
axios
.
put
(
`/cameras`
,
data
);
// 摄像头 - 删
// 摄像头 - 删
export
const
api_delCameras
=
async
(
id
:
any
):
Promise
<
any
>
=>
await
axios
.
delete
(
`/cameras/
${
id
}
`
);
export
const
api_delCameras
=
async
(
id
:
any
):
Promise
<
any
>
=>
await
axios
.
delete
(
`/cameras/
${
id
}
`
);
// 模板下载
// 模板下载
export
const
api_downWebCam
=
async
(
id
:
string
):
Promise
<
any
>
=>
await
axios
.
get
(
`/export/
${
id
}
`
);
export
const
api_downWebCam
=
async
(
id
:
string
):
Promise
<
any
>
=>
await
axios
.
get
(
`/export/
${
id
}
`
);
// 导出 - blob
// 导出 - blob
export
const
api_exportBlobFile
=
async
(
ids
:
string
):
Promise
<
any
>
=>
export
const
api_exportBlobFile
=
async
(
ids
:
string
):
Promise
<
any
>
=>
await
axios
.
get
(
`/export/
${
ids
}
`
,
{
responseType
:
'
blob
'
});
await
axios
.
get
(
`/export/
${
ids
}
`
,
{
responseType
:
"
blob
"
});
// 文件上传 - base64 -> ip
// 文件上传 - base64 -> ip
export
const
api_base64ToWebURl
=
async
(
image
:
string
):
Promise
<
any
>
=>
await
axios
.
post
(
`/common/image`
,
{
image
});
export
const
api_base64ToWebURl
=
async
(
image
:
string
):
Promise
<
any
>
=>
await
axios
.
post
(
`/common/image`
,
{
image
});
// 算法 - 查
// 算法 - 查
export
const
api_algorithms
=
async
(
params
:
ItablePagination
):
Promise
<
any
>
=>
export
const
api_algorithms
=
async
(
params
:
ItablePagination
):
Promise
<
any
>
=>
axios
.
get
(
`/algorithms/page`
,
{
params
});
axios
.
get
(
`/algorithms/page`
,
{
params
});
// 算法 - 改
// 算法 - 改
export
const
api_modifyAlgorithms
=
async
(
id
:
string
,
grade
:
string
):
Promise
<
any
>
=>
export
const
api_modifyAlgorithms
=
async
(
axios
.
put
(
`/algorithms/
${
id
}
/
${
grade
}
`
);
id
:
string
,
grade
:
string
,
):
Promise
<
any
>
=>
axios
.
put
(
`/algorithms/
${
id
}
/
${
grade
}
`
);
// ============================================================================================ 新增分析任务
// ============================================================================================ 新增分析任务
// ================ 临时 | S
// ================ 临时 | S
...
@@ -125,32 +133,38 @@ interface IModifyTaskParam {
...
@@ -125,32 +133,38 @@ interface IModifyTaskParam {
videoVo
:
IAnalyItemParam
[];
videoVo
:
IAnalyItemParam
[];
}
}
// ================ 临时 | E
// ================ 临时 | E
// 新增类
// 新增类
type
IAddTaskParam
=
IModifyTaskParam
;
type
IAddTaskParam
=
IModifyTaskParam
;
// 视频分析任务-新增任务
// 视频分析任务-新增任务
export
const
api_addTask
=
async
(
data
:
IAddTaskParam
):
Promise
<
any
>
=>
axios
.
post
(
`/videos`
,
data
);
export
const
api_addTask
=
async
(
data
:
IAddTaskParam
):
Promise
<
any
>
=>
axios
.
post
(
`/videos`
,
data
);
// 视频分析任务-编辑任务
// 视频分析任务-编辑任务
export
const
api_modifyTask
=
async
(
data
:
IModifyTaskParam
):
Promise
<
any
>
=>
axios
.
put
(
`/videos`
,
data
);
export
const
api_modifyTask
=
async
(
data
:
IModifyTaskParam
):
Promise
<
any
>
=>
axios
.
put
(
`/videos`
,
data
);
// 视频分析任务分页查询
// 视频分析任务分页查询
export
const
api_getTask
=
async
(
data
:
ItablePagination
):
Promise
<
any
>
=>
export
const
api_getTask
=
async
(
data
:
ItablePagination
):
Promise
<
any
>
=>
axios
.
get
(
`/videos/page?pageNum=
${
data
.
pageNum
}
&pageSize=
${
data
.
pageSize
}
&taskName=
${
data
.
taskName
}
`
);
axios
.
get
(
`/videos/page?pageNum=
${
data
.
pageNum
}
&pageSize=
${
data
.
pageSize
}
&taskName=
${
data
.
taskName
}
`
,
);
// 视频分析任务-单删
// 视频分析任务-单删
export
const
api_delTask
=
async
(
id
:
string
):
Promise
<
any
>
=>
axios
.
delete
(
`/videos/
${
id
}
`
);
export
const
api_delTask
=
async
(
id
:
string
):
Promise
<
any
>
=>
axios
.
delete
(
`/videos/
${
id
}
`
);
// 视频分析任务-变更任务状态
// 视频分析任务-变更任务状态
export
const
api_modifyTaskStatus
=
async
(
id
:
string
,
status
:
string
):
Promise
<
any
>
=>
export
const
api_modifyTaskStatus
=
async
(
axios
.
put
(
`/videos/
${
id
}
/
${
status
}
`
);
id
:
string
,
status
:
string
,
):
Promise
<
any
>
=>
axios
.
put
(
`/videos/
${
id
}
/
${
status
}
`
);
// 视频分析任务 - 单条数据
// 视频分析任务 - 单条数据
export
const
api_findModifyTaskInfo
=
async
(
id
:
string
):
Promise
<
any
>
=>
axios
.
get
(
`/videos/
${
id
}
`
);
export
const
api_findModifyTaskInfo
=
async
(
id
:
string
):
Promise
<
any
>
=>
axios
.
get
(
`/videos/
${
id
}
`
);
// ================================================================================= 报警分页日志查询 | S
// ================================================================================= 报警分页日志查询 | S
interface
IAlarmLogParam
{
interface
IAlarmLogParam
{
...
@@ -162,17 +176,19 @@ interface IAlarmLogParam {
...
@@ -162,17 +176,19 @@ interface IAlarmLogParam {
status
?:
string
;
status
?:
string
;
}
}
// 获取报警日志
// 获取报警日志
export
const
api_getAlarmLog
=
async
(
params
:
IAlarmLogParam
):
Promise
<
any
>
=>
axios
.
get
(
`/alarm/logs/page`
,
{
params
});
export
const
api_getAlarmLog
=
async
(
params
:
IAlarmLogParam
):
Promise
<
any
>
=>
axios
.
get
(
`/alarm/logs/page`
,
{
params
});
// 删除日志记录
// 删除日志记录
export
const
api_delAlarmLog
=
async
(
id
:
string
):
Promise
<
any
>
=>
axios
.
delete
(
`/alarm/logs/
${
id
}
`
);
export
const
api_delAlarmLog
=
async
(
id
:
string
):
Promise
<
any
>
=>
axios
.
delete
(
`/alarm/logs/
${
id
}
`
);
// 修改报警日志状态
// 修改报警日志状态
export
const
api_modifyAlarmLog
=
async
(
id
:
string
,
status
:
string
):
Promise
<
any
>
=>
axios
.
put
(
`/alarm/logs/
${
id
}
/
${
status
}
`
);
export
const
api_modifyAlarmLog
=
async
(
id
:
string
,
status
:
string
,
):
Promise
<
any
>
=>
axios
.
put
(
`/alarm/logs/
${
id
}
/
${
status
}
`
);
// ================================================================================= 报警分页日志查询 | E
// ================================================================================= 报警分页日志查询 | E
...
@@ -182,9 +198,6 @@ interface IPushParamTask {
...
@@ -182,9 +198,6 @@ interface IPushParamTask {
videoTaskName
?:
string
;
videoTaskName
?:
string
;
}
}
interface
IPushParamResult
{
interface
IPushParamResult
{
contentName
?:
string
;
contentName
?:
string
;
contentRemark
?:
string
;
contentRemark
?:
string
;
...
@@ -192,9 +205,6 @@ interface IPushParamResult {
...
@@ -192,9 +205,6 @@ interface IPushParamResult {
pushId
?:
string
;
pushId
?:
string
;
}
}
interface
IPushParamCamera
{
interface
IPushParamCamera
{
contentName
:
string
;
contentName
:
string
;
contentRemark
:
string
;
contentRemark
:
string
;
...
@@ -202,9 +212,6 @@ interface IPushParamCamera {
...
@@ -202,9 +212,6 @@ interface IPushParamCamera {
pushId
:
string
;
pushId
:
string
;
}
}
interface
IPushParamAlgorithm
{
interface
IPushParamAlgorithm
{
contentName
:
string
;
contentName
:
string
;
contentRemark
:
string
;
contentRemark
:
string
;
...
@@ -212,82 +219,75 @@ interface IPushParamAlgorithm {
...
@@ -212,82 +219,75 @@ interface IPushParamAlgorithm {
pushId
:
string
;
pushId
:
string
;
}
}
interface
IPushParam
{
interface
IPushParam
{
algorithmList
?:
IPushParamAlgorithm
[]
,
algorithmList
?:
IPushParamAlgorithm
[]
;
cameraList
?:
IPushParamCamera
[]
,
cameraList
?:
IPushParamCamera
[]
;
id
?:
string
;
id
?:
string
;
pushAddress
?:
string
;
pushAddress
?:
string
;
pushName
?:
string
;
pushName
?:
string
;
resultList
?:
IPushParamResult
[]
,
resultList
?:
IPushParamResult
[]
;
status
?:
string
;
status
?:
string
;
videoTaskVoList
?:
IPushParamTask
[]
videoTaskVoList
?:
IPushParamTask
[]
;
}
}
// 新增报警推送
// 新增报警推送
export
const
api_addAlarmPush
=
async
(
data
:
IPushParam
)
=>
{
export
const
api_addAlarmPush
=
async
(
data
:
IPushParam
)
=>
{
return
await
axios
.
post
(
`/pushs`
,
data
)
return
await
axios
.
post
(
`/pushs`
,
data
)
;
};
};
// 修改报警推送
// 修改报警推送
export
const
api_modifyAlarmPush
=
async
(
data
:
IPushParam
)
=>
{
export
const
api_modifyAlarmPush
=
async
(
data
:
IPushParam
)
=>
{
return
await
axios
.
put
(
`/pushs`
,
data
)
return
await
axios
.
put
(
`/pushs`
,
data
)
;
};
};
// 报警推送查单全部
// 报警推送查单全部
export
const
api_findPushItem
=
async
(
id
)
=>
{
export
const
api_findPushItem
=
async
(
id
)
=>
{
return
await
axios
.
get
(
`/pushs/
${
id
}
`
)
return
await
axios
.
get
(
`/pushs/
${
id
}
`
)
;
}
}
;
// 推送删除
// 推送删除
export
const
api_delPushItem
=
async
(
id
)
=>
{
export
const
api_delPushItem
=
async
(
id
)
=>
{
return
await
axios
.
delete
(
`/pushs/
${
id
}
`
)
return
await
axios
.
delete
(
`/pushs/
${
id
}
`
)
;
}
}
;
// 算法信息
// 算法信息
export
const
api_getKeyOfAnaly
=
async
()
=>
{
export
const
api_getKeyOfAnaly
=
async
()
=>
{
return
await
axios
.
get
(
`/pushs/algorithm`
)
return
await
axios
.
get
(
`/pushs/algorithm`
)
;
};
};
// 视频源信息
// 视频源信息
export
const
api_getKeyOfVideoSource
=
async
()
=>
{
export
const
api_getKeyOfVideoSource
=
async
()
=>
{
return
await
axios
.
get
(
`/pushs/camera`
)
return
await
axios
.
get
(
`/pushs/camera`
)
;
};
};
// 视频任务信息
// 视频任务信息
export
const
api_getKeyTaskInfo
=
async
()
=>
{
export
const
api_getKeyTaskInfo
=
async
()
=>
{
return
await
axios
.
get
(
`/pushs/video_task`
)
return
await
axios
.
get
(
`/pushs/video_task`
)
;
};
};
// 推送 - 测试
// 推送 - 测试
export
const
api_test
=
async
()
=>
{
export
const
api_test
=
async
()
=>
{
return
await
axios
.
get
(
'
/pushs/test
'
)
return
await
axios
.
get
(
"
/pushs/test
"
);
}
};
// 视频推送 - 视频任务列表
// 视频推送 - 视频任务列表
export
const
api_videoTaskKey
=
async
()
=>
{
export
const
api_videoTaskKey
=
async
()
=>
{
return
await
axios
.
get
(
`/videos/list`
)
return
await
axios
.
get
(
`/videos/list`
);
}
};
// 视频推送 - 分页查询
// 视频推送 - 分页查询
export
const
api_pushList
=
async
(
data
)
=>
{
export
const
api_pushList
=
async
(
data
)
=>
{
return
await
axios
.
get
(
`/pushs/page?pageNum=
${
data
.
pageNum
}
&pageSize=
${
data
.
pageSize
}
`
)
return
await
axios
.
get
(
}
`/pushs/page?pageNum=
${
data
.
pageNum
}
&pageSize=
${
data
.
pageSize
}
`
,
);
};
// ===================================================== 报警提醒 | E
// ===================================================== 报警提醒 | E
// 报警提醒 - 算法列表
// 报警提醒 - 算法列表
export
const
api_algorithmsList
=
async
()
=>
{
export
const
api_algorithmsList
=
async
()
=>
{
return
await
axios
.
get
(
`/algorithms/list`
)
return
await
axios
.
get
(
`/algorithms/list`
);
}
};
interface
popUpsConfigParam
{
interface
popUpsConfigParam
{
ids
:
string
;
ids
:
string
;
...
@@ -298,71 +298,67 @@ interface popUpsConfigParam {
...
@@ -298,71 +298,67 @@ interface popUpsConfigParam {
// 报警提醒 - 修改弹窗相关配置
// 报警提醒 - 修改弹窗相关配置
export
const
api_algorithmsPopUpsConfig
=
async
(
data
:
popUpsConfigParam
)
=>
{
export
const
api_algorithmsPopUpsConfig
=
async
(
data
:
popUpsConfigParam
)
=>
{
await
axios
.
put
(
`/algorithms/popUps`
,
data
)
await
axios
.
put
(
`/algorithms/popUps`
,
data
);
}
};
// 算法提醒 - 分页查询
// 算法提醒 - 分页查询
export
const
api_algorithmsPopUpsPage
=
async
(
data
:
any
)
=>
{
export
const
api_algorithmsPopUpsPage
=
async
(
data
:
any
)
=>
{
return
await
axios
.
get
(
`/algorithms/page?pageNum=
${
data
.
pageNum
}
&pageSize=
${
data
.
pageSize
}
`
)
return
await
axios
.
get
(
}
`/algorithms/page?pageNum=
${
data
.
pageNum
}
&pageSize=
${
data
.
pageSize
}
`
,
);
};
// 算法提醒 - 修改弹窗配置回显
// 算法提醒 - 修改弹窗配置回显
export
const
api_algorithmsPopUpsFind
=
async
()
=>
{
export
const
api_algorithmsPopUpsFind
=
async
()
=>
{
// /algorithms/list
// /algorithms/list
return
await
axios
.
get
(
`/algorithms/list`
)
return
await
axios
.
get
(
`/algorithms/list`
);
}
};
// 算法提醒 - 删除语音
// 算法提醒 - 删除语音
export
const
api_algorithmsPopUpsDel
=
async
(
id
:
string
)
=>
{
export
const
api_algorithmsPopUpsDel
=
async
(
id
:
string
)
=>
{
return
await
axios
.
put
(
`/algorithms/audio/
${
id
}
`
)
return
await
axios
.
put
(
`/algorithms/audio/
${
id
}
`
)
;
}
}
;
// 视频回放 - 临时测试
// 视频回放 - 临时测试
// /videos/test
// /videos/test
export
const
api_videoTest
=
async
()
=>
{
export
const
api_videoTest
=
async
()
=>
{
return
await
axios
.
get
(
`/videos/test`
)
return
await
axios
.
get
(
`/videos/test`
);
}
};
// ========================================================= 用户角色管理 | S
// ========================================================= 用户角色管理 | S
// 用户分页查询
// 用户分页查询
export
const
api_userList
=
async
(
data
:
any
)
=>
{
export
const
api_userList
=
async
(
data
:
any
)
=>
{
return
await
axios
.
get
(
`/users/page?pageNum=
${
data
.
pageNum
}
&pageSize=
${
data
.
pageSize
}
&userName=
${
data
.
userName
}
`
)
return
await
axios
.
get
(
}
`/users/page?pageNum=
${
data
.
pageNum
}
&pageSize=
${
data
.
pageSize
}
&userName=
${
data
.
userName
}
`
,
);
};
// 新增用户
// 新增用户
export
const
api_addUserInfo
=
async
(
data
:
any
)
=>
{
export
const
api_addUserInfo
=
async
(
data
:
any
)
=>
{
return
await
axios
.
post
(
`/users`
,
data
)
return
await
axios
.
post
(
`/users`
,
data
);
}
};
// 修改用户信息
// 修改用户信息
export
const
api_modifyUserInfo
=
async
(
data
:
any
)
=>
{
export
const
api_modifyUserInfo
=
async
(
data
:
any
)
=>
{
return
await
axios
.
put
(
`/users`
,
data
)
return
await
axios
.
put
(
`/users`
,
data
);
}
};
// 删除用户信息
// 删除用户信息
export
const
api_delUserInfo
=
async
(
id
:
string
)
=>
{
export
const
api_delUserInfo
=
async
(
id
:
string
)
=>
{
return
await
axios
.
delete
(
`/users/
${
id
}
`
)
return
await
axios
.
delete
(
`/users/
${
id
}
`
);
}
};
// 修改密码
// 修改密码
export
const
api_modifyUserPass
=
async
(
id
:
string
,
password
:
string
)
=>
{
export
const
api_modifyUserPass
=
async
(
id
:
string
,
password
:
string
)
=>
{
return
await
axios
.
put
(
`/users/
${
id
}
/
${
password
}
`
)
return
await
axios
.
put
(
`/users/
${
id
}
/
${
password
}
`
);
}
};
// 查询角色管理
// 查询角色管理
export
const
api_roleList
=
async
()
=>
{
export
const
api_roleList
=
async
()
=>
{
return
await
axios
.
get
(
'
/roles/list
'
)
return
await
axios
.
get
(
"
/roles/list
"
);
}
}
;
// ======================================================== 角色管理 | E
// ======================================================== 角色管理 | E
...
@@ -374,98 +370,88 @@ interface IRoleParam {
...
@@ -374,98 +370,88 @@ interface IRoleParam {
// 新增角色
// 新增角色
export
const
api_addRole
=
async
(
data
:
IRoleParam
)
=>
{
export
const
api_addRole
=
async
(
data
:
IRoleParam
)
=>
{
return
await
axios
.
post
(
'
/roles
'
,
data
)
return
await
axios
.
post
(
"
/roles
"
,
data
);
}
}
;
// 查询角色详情
// 查询角色详情
export
const
api_findfRoleInfo
=
async
(
id
:
string
)
=>
{
export
const
api_findfRoleInfo
=
async
(
id
:
string
)
=>
{
return
await
axios
.
post
(
`/roles/
${
id
}
`
)
return
await
axios
.
post
(
`/roles/
${
id
}
`
)
;
}
}
;
// ============================== 音视频相关 | S
// ============================== 音视频相关 | S
// 音频文件
// 音频文件
export
const
getAudioFile
=
async
(
audioId
:
string
)
=>
{
export
const
getAudioFile
=
async
(
audioId
:
string
)
=>
{
return
await
axios
.
get
(
`/play/
${
audioId
}
`
)
return
await
axios
.
get
(
`/play/
${
audioId
}
`
)
;
// return await axios.get(`/play/${audioId}?audioId=${audioId}`)
// return await axios.get(`/play/${audioId}?audioId=${audioId}`)
}
};
// 视频文件
// 视频文件
export
const
getVideoFile
=
async
(
fileName
:
string
)
=>
{
export
const
getVideoFile
=
async
(
fileName
:
string
)
=>
{
return
await
axios
.
get
(
`/playVideo/
${
fileName
}
`
)
return
await
axios
.
get
(
`/playVideo/
${
fileName
}
`
);
}
};
// 修改角色信息
// 修改角色信息
export
const
api_modifyRoleInfo
=
async
(
data
:
any
)
=>
{
export
const
api_modifyRoleInfo
=
async
(
data
:
any
)
=>
{
return
await
axios
.
put
(
`/roles`
,
data
)
return
await
axios
.
put
(
`/roles`
,
data
);
}
};
// 删除角色
// 删除角色
export
const
api_delRoleInfo
=
async
(
id
:
string
)
=>
{
export
const
api_delRoleInfo
=
async
(
id
:
string
)
=>
{
return
await
axios
.
delete
(
`/roles/
${
id
}
`
)
return
await
axios
.
delete
(
`/roles/
${
id
}
`
);
}
};
// 权限 - 权限树列表
// 权限 - 权限树列表
export
const
api_permissionTreeList
=
async
()
=>
{
export
const
api_permissionTreeList
=
async
()
=>
{
return
await
axios
.
get
(
`/permission/tree`
)
return
await
axios
.
get
(
`/permission/tree`
)
;
}
}
;
// ======================================== 首页 - /datas/points-count
// ======================================== 首页 - /datas/points-count
export
const
api_pointsCount
=
async
()
=>
{
export
const
api_pointsCount
=
async
()
=>
{
return
await
axios
.
get
(
`/datas/points-count`
)
return
await
axios
.
get
(
`/datas/points-count`
);
}
};
export
const
api_taskCount
=
async
()
=>
{
export
const
api_taskCount
=
async
()
=>
{
return
await
axios
.
get
(
`/datas/task-count`
)
return
await
axios
.
get
(
`/datas/task-count`
);
}
};
export
const
api_logCount
=
async
(
date
)
=>
{
export
const
api_logCount
=
async
(
date
)
=>
{
return
await
axios
.
get
(
`/datas/log-count/
${
date
[
0
]}
/
${
date
[
1
]}
`
)
return
await
axios
.
get
(
`/datas/log-count/
${
date
[
0
]}
/
${
date
[
1
]}
`
);
}
};
// ================================= 登录注册
// ================================= 登录注册
// 登录
// 登录
export
const
api_login
=
async
(
data
:
any
)
=>
{
export
const
api_login
=
async
(
data
:
any
)
=>
{
return
await
axios
.
post
(
'
/logins/login
'
,
data
)
return
await
axios
.
post
(
"
/logins/login
"
,
data
);
}
}
;
// 权限查询
// 权限查询
export
const
api_permission
=
async
()
=>
{
export
const
api_permission
=
async
()
=>
{
return
await
axios
.
get
(
'
/logins/list
'
)
return
await
axios
.
get
(
"
/logins/list
"
);
}
};
// 查询详情
// 查询详情
// /v1/roles/{id}
// /v1/roles/{id}
export
const
api_roleInfo
=
async
(
id
:
string
)
=>
{
export
const
api_roleInfo
=
async
(
id
:
string
)
=>
{
return
axios
.
get
(
`/roles/
${
id
}
`
)
return
axios
.
get
(
`/roles/
${
id
}
`
)
;
}
}
;
// 视频任务分析 - 接口
// 视频任务分析 - 接口
export
const
api_videosPage
=
async
(
data
)
=>
{
export
const
api_videosPage
=
async
(
data
)
=>
{
return
axios
.
get
(
`/videos/page?pageNum=
${
data
.
pageNum
}
&pageSize=
${
data
.
pageSize
}
`
)
return
axios
.
get
(
}
`/videos/page?pageNum=
${
data
.
pageNum
}
&pageSize=
${
data
.
pageSize
}
`
,
);
};
// 报警累计
// 报警累计
export
const
api_getAlarmResultData
=
async
()
=>
{
export
const
api_getAlarmResultData
=
async
()
=>
{
return
axios
.
get
(
`/datas/day`
)
return
axios
.
get
(
`/datas/day`
);
}
};
// 根据ID查询信息
// 根据ID查询信息
export
const
api_getUserInfo
=
async
(
id
:
string
)
=>
{
export
const
api_getUserInfo
=
async
(
id
:
string
)
=>
{
return
axios
.
get
(
`/users/
${
id
}
`
)
return
axios
.
get
(
`/users/
${
id
}
`
)
;
}
}
;
src/utils/service.ts
View file @
1f872198
...
@@ -4,8 +4,6 @@
...
@@ -4,8 +4,6 @@
* @param env The current env
* @param env The current env
*/
*/
export
function
createServiceConfig
(
env
:
Env
.
ImportMeta
)
{
export
function
createServiceConfig
(
env
:
Env
.
ImportMeta
)
{
const
{
VITE_SERVICE_BASE_URL
,
VITE_OTHER_SERVICE_BASE_URL
}
=
env
;
const
{
VITE_SERVICE_BASE_URL
,
VITE_OTHER_SERVICE_BASE_URL
}
=
env
;
...
@@ -14,28 +12,31 @@ export function createServiceConfig(env: Env.ImportMeta) {
...
@@ -14,28 +12,31 @@ export function createServiceConfig(env: Env.ImportMeta) {
other
=
JSON
.
parse
(
VITE_OTHER_SERVICE_BASE_URL
);
other
=
JSON
.
parse
(
VITE_OTHER_SERVICE_BASE_URL
);
}
catch
(
error
)
{
}
catch
(
error
)
{
// eslint-disable-next-line no-console
// eslint-disable-next-line no-console
}
console
.
error
(
'
VITE_OTHER_SERVICE_BASE_URL is not a valid JSON string
'
);
}
const
httpConfig
:
App
.
Service
.
SimpleServiceConfig
=
{
const
httpConfig
:
App
.
Service
.
SimpleServiceConfig
=
{
baseURL
:
VITE_SERVICE_BASE_URL
,
baseURL
:
VITE_SERVICE_BASE_URL
,
other
other
,
};
};
const
otherHttpKeys
=
Object
.
keys
(
httpConfig
.
other
)
as
App
.
Service
.
OtherBaseURLKey
[];
const
otherHttpKeys
=
Object
.
keys
(
httpConfig
.
other
,
)
as
App
.
Service
.
OtherBaseURLKey
[];
const
otherConfig
:
App
.
Service
.
OtherServiceConfigItem
[]
=
otherHttpKeys
.
map
(
key
=>
{
const
otherConfig
:
App
.
Service
.
OtherServiceConfigItem
[]
=
otherHttpKeys
.
map
(
return
{
(
key
)
=>
{
key
,
return
{
baseURL
:
httpConfig
.
other
[
key
],
key
,
proxyPattern
:
createProxyPattern
(
key
)
baseURL
:
httpConfig
.
other
[
key
],
};
proxyPattern
:
createProxyPattern
(
key
),
});
};
},
);
const
config
:
App
.
Service
.
ServiceConfig
=
{
const
config
:
App
.
Service
.
ServiceConfig
=
{
baseURL
:
httpConfig
.
baseURL
,
baseURL
:
httpConfig
.
baseURL
,
proxyPattern
:
createProxyPattern
(),
proxyPattern
:
createProxyPattern
(),
other
:
otherConfig
other
:
otherConfig
,
};
};
return
config
;
return
config
;
...
@@ -52,13 +53,13 @@ export function getServiceBaseURL(env: Env.ImportMeta, isProxy: boolean) {
...
@@ -52,13 +53,13 @@ export function getServiceBaseURL(env: Env.ImportMeta, isProxy: boolean) {
const
otherBaseURL
=
{}
as
Record
<
App
.
Service
.
OtherBaseURLKey
,
string
>
;
const
otherBaseURL
=
{}
as
Record
<
App
.
Service
.
OtherBaseURLKey
,
string
>
;
other
.
forEach
(
item
=>
{
other
.
forEach
(
(
item
)
=>
{
otherBaseURL
[
item
.
key
]
=
isProxy
?
item
.
proxyPattern
:
item
.
baseURL
;
otherBaseURL
[
item
.
key
]
=
isProxy
?
item
.
proxyPattern
:
item
.
baseURL
;
});
});
return
{
return
{
baseURL
:
isProxy
?
createProxyPattern
()
:
baseURL
,
baseURL
:
isProxy
?
createProxyPattern
()
:
baseURL
,
otherBaseURL
otherBaseURL
,
};
};
}
}
...
@@ -69,7 +70,7 @@ export function getServiceBaseURL(env: Env.ImportMeta, isProxy: boolean) {
...
@@ -69,7 +70,7 @@ export function getServiceBaseURL(env: Env.ImportMeta, isProxy: boolean) {
*/
*/
function
createProxyPattern
(
key
?:
App
.
Service
.
OtherBaseURLKey
)
{
function
createProxyPattern
(
key
?:
App
.
Service
.
OtherBaseURLKey
)
{
if
(
!
key
)
{
if
(
!
key
)
{
return
'
/proxy-default
'
;
return
"
/proxy-default
"
;
}
}
return
`/proxy-
${
key
}
`
;
return
`/proxy-
${
key
}
`
;
...
...
src/views/AlarmCenter/AlarmLog/index.vue
View file @
1f872198
...
@@ -494,9 +494,9 @@ onMounted(() => {
...
@@ -494,9 +494,9 @@ onMounted(() => {
<!-- ======================= 状态 | E -->
<!-- ======================= 状态 | E -->
</NFlex>
</NFlex>
<NButton
@
click.stop=
"() =>
{
<
!--
<
NButton
@
click.stop=
"() =>
{
isDefaultPreview = false;
isDefaultPreview = false;
}" strong secondary type="info" size="small">回放
</NButton>
}" strong secondary type="info" size="small">回放
</NButton>
-->
</NFlex>
</NFlex>
</
template
>
</
template
>
<!-- 图片区域 -->
<!-- 图片区域 -->
...
...
src/views/AlarmCenter/AlarmReminder/index.vue
View file @
1f872198
<
template
>
<
template
>
<div
id=
"alarmreminder"
>
<div
id=
"alarmreminder"
>
<!-- 音频文件 | S -->
<!-- 音频文件 | S -->
<!--
<audio
ref=
"audioE"
id=
"aWrap"
controls
>
<!--
<audio
ref=
"audioE"
id=
"aWrap"
controls
>
...
@@ -7,31 +6,50 @@
...
@@ -7,31 +6,50 @@
</source>
</source>
</audio>
-->
</audio>
-->
<div
style=
"border: 1px solid red; position: fixed; top: -1000px"
v-html=
"htmlStr"
></div>
<div
style=
"border: 1px solid red; position: fixed; top: -1000px"
v-html=
"htmlStr"
></div>
<!-- 音频文件 | E -->
<!-- 音频文件 | E -->
<!-- 替换文件上传 -->
<!-- 替换文件上传 -->
<NModal
v-model:show=
"updateFileModal"
>
<NModal
v-model:show=
"updateFileModal"
>
<NCard
title=
"替换/上传文件"
style=
"width: 600px"
closable
@
close=
"() =>
{
<NCard
updateFileModal = false
title=
"替换/上传文件"
}">
style=
"width: 600px"
closable
@
close=
"
() =>
{
updateFileModal = false;
}
"
>
<NForm
label-align=
"left"
>
<NForm
label-align=
"left"
>
<NForm-item
label=
"选择音频"
path=
"file"
required
>
<NForm-item
label=
"选择音频"
path=
"file"
required
>
<NUpload
:headers=
"
{
<NUpload
:headers=
"
{
'token': localStg.get('token') as string
'token': localStg.get('token') as string
}" :data="{
}"
'id': audioId,
:data="{
}" :max="1" :action="'/v1/upload/' + audioId" @before-upload="beforeUpload" name="audioFile"
id: audioId,
@finish="handleFinish">
}"
:max="1"
:action="'/v1/upload/' + audioId"
@before-upload="beforeUpload"
name="audioFile"
@finish="handleFinish"
>
<NButton>
上传
</NButton>
<NButton>
上传
</NButton>
</NUpload>
</NUpload>
</NForm-item>
</NForm-item>
</NForm>
</NForm>
<template
#footer
>
<template
#footer
>
<div
style=
"display: flex; justify-content: end
;
"
>
<div
style=
"display: flex; justify-content: end"
>
<NSpace>
<NSpace>
<NButton
@
click=
"updateFileModal = false"
>
取消
</NButton>
<NButton
@
click=
"updateFileModal = false"
>
取消
</NButton>
<NButton
type=
"primary"
@
click=
"updateFileModal = false"
>
确定
</NButton>
<NButton
type=
"primary"
@
click=
"updateFileModal = false"
>
确定
</NButton
>
</NSpace>
</NSpace>
</div>
</div>
</
template
>
</
template
>
...
@@ -47,34 +65,62 @@
...
@@ -47,34 +65,62 @@
<!-- 标题 -->
<!-- 标题 -->
<NSpace
justify=
"space-between"
class=
"sum-title"
>
<NSpace
justify=
"space-between"
class=
"sum-title"
>
<span>
选择开启提醒的算法
</span>
<span>
选择开启提醒的算法
</span>
<span>
共
<i
class=
"sum-style"
>
{{
modifyForm
.
ids
.
length
||
0
}}
</i>
个算法开启提醒
</span>
<span
>
共
<i
class=
"sum-style"
>
{{
modifyForm
.
ids
.
length
||
0
}}
</i>
个算法开启提醒
</span
>
</NSpace>
</NSpace>
<!-- ========================================== 算法下拉 | S -->
<!-- ========================================== 算法下拉 | S -->
<n-select
style=
"margin-bottom: 10px;"
v-model:value=
"modifyForm.ids"
label-field=
"algorithmName"
<n-select
value-field=
"id"
placeholder=
"算法"
@
update-value=
"(val) =>
{
style=
"margin-bottom: 10px"
modifyForm.ids = val
v-model:value=
"modifyForm.ids"
onSubmit();
label-field=
"algorithmName"
}" filterable multiple tag :options="algorithmsList" />
value-field=
"id"
placeholder=
"算法"
@
update-value=
"
(val) =>
{
modifyForm.ids = val;
onSubmit();
}
"
filterable
multiple
tag
:options="algorithmsList"
/>
<!-- ========================================== 算法下拉 | E -->
<!-- ========================================== 算法下拉 | E -->
<div
class=
"_t"
style=
"padding-top: 10px
;
"
>
提醒方式
</div>
<div
class=
"_t"
style=
"padding-top: 10px"
>
提醒方式
</div>
<NSpace
justify=
"space-between"
style=
"margin: 5px 0
;
"
>
<NSpace
justify=
"space-between"
style=
"margin: 5px 0"
>
<span>
系统报警语音
</span>
<span>
系统报警语音
</span>
<NSwitch
@
update:value=
"val =>
{
<NSwitch
modifyForm.isVoice = val;
@
update:value=
"
onSubmit();
(val) =>
{
}" v-model:value="modifyForm.isVoice" :round="modifyForm.isVoice">
modifyForm.isVoice = val;
onSubmit();
}
"
v-model:value="modifyForm.isVoice"
:round="modifyForm.isVoice"
>
</NSwitch>
</NSwitch>
</NSpace>
</NSpace>
<NSpace
justify=
"space-between"
style=
"margin: 5px 0
;
"
>
<NSpace
justify=
"space-between"
style=
"margin: 5px 0"
>
<span>
系统报警弹窗
</span>
<span>
系统报警弹窗
</span>
<NSwitch
@
update:value=
"val =>
{
<NSwitch
modifyForm.isRemind = val;
@
update:value=
"
onSubmit();
(val) =>
{
}" v-model:value="modifyForm.isRemind" :round="modifyForm.isRemind">
modifyForm.isRemind = val;
onSubmit();
}
"
v-model:value="modifyForm.isRemind"
:round="modifyForm.isRemind"
>
</NSwitch>
</NSwitch>
</NSpace>
</NSpace>
...
@@ -82,8 +128,19 @@
...
@@ -82,8 +128,19 @@
<div
v-if=
"modifyForm.isRemind"
class=
"flex-wrap"
>
<div
v-if=
"modifyForm.isRemind"
class=
"flex-wrap"
>
<div>
<div>
<!-- 最外层区分左右 -->
<!-- 最外层区分左右 -->
<div
@
click=
"() =>
{ modifyForm.reminderType = 1; onSubmit(); }"
<div
:class="[modifyForm.reminderType !== 1 ? 'left-warp' : 'left-warp sel-left-warp']">
@
click=
"
() =>
{
modifyForm.reminderType = 1;
onSubmit();
}
"
:class="[
modifyForm.reminderType !== 1
? 'left-warp'
: 'left-warp sel-left-warp',
]"
>
<!-- 外层盒子 -->
<!-- 外层盒子 -->
<div>
<div>
<!-- 弹窗盒子 -->
<!-- 弹窗盒子 -->
...
@@ -100,8 +157,19 @@
...
@@ -100,8 +157,19 @@
</div>
</div>
<!-- 右侧盒子 -->
<!-- 右侧盒子 -->
<div>
<div>
<div
@
click=
"() =>
{ modifyForm.reminderType = 2; onSubmit(); }"
<div
:class="[modifyForm.reminderType !== 2 ? 'right-warp' : 'right-warp sel-right-warp']">
@
click=
"
() =>
{
modifyForm.reminderType = 2;
onSubmit();
}
"
:class="[
modifyForm.reminderType !== 2
? 'right-warp'
: 'right-warp sel-right-warp',
]"
>
<div></div>
<div></div>
</div>
</div>
<br
/>
<br
/>
...
@@ -115,8 +183,15 @@
...
@@ -115,8 +183,15 @@
<NCol
span=
"16"
>
<NCol
span=
"16"
>
<NCard
title=
"提醒语音管理"
>
<NCard
title=
"提醒语音管理"
>
<
template
#action
>
<
template
#action
>
<NDataTable
:ellipsis=
"true"
striped
bottom-bordered
:row-key=
"row => row.id"
:columns=
"tableColumn"
<NDataTable
:data=
"tableData"
:bordered=
"true"
/>
:ellipsis=
"true"
striped
bottom-bordered
:row-key=
"(row) => row.id"
:columns=
"tableColumn"
:data=
"tableData"
:bordered=
"true"
/>
<div
style=
"display: flex; justify-content: end"
>
<div
style=
"display: flex; justify-content: end"
>
<!--
<NPagination
key=
"alarmReminder________iiuiiiiiiiiiiiiiiiiiiiii"
v-model:page=
"page"
<!--
<NPagination
key=
"alarmReminder________iiuiiiiiiiiiiiiiiiiiiiii"
v-model:page=
"page"
...
@@ -129,10 +204,16 @@
...
@@ -129,10 +204,16 @@
:page-sizes=
"pageSizes"
/>
-->
:page-sizes=
"pageSizes"
/>
-->
<NPagination
<NPagination
:item-count=
"total"
:item-count=
"total"
v-model:page=
"page"
v-model:page-size=
"pageSize"
style=
"margin-top: 20px"
v-model:page=
"page"
:display-order=
"['quick-jumper', 'pages', 'size-picker']"
:page-count=
"100"
show-quick-jumper
v-model:page-size=
"pageSize"
show-size-picker
:page-sizes=
"pageSizes"
/>
style=
"margin-top: 20px"
:display-order=
"['quick-jumper', 'pages', 'size-picker']"
:page-count=
"100"
show-quick-jumper
show-size-picker
:page-sizes=
"pageSizes"
/>
</div>
</div>
</
template
>
</
template
>
</NCard>
</NCard>
...
@@ -140,18 +221,31 @@
...
@@ -140,18 +221,31 @@
<!-- <NButton @click="onSubmit">提交</NButton> -->
<!-- <NButton @click="onSubmit">提交</NButton> -->
</NRow>
</NRow>
</div>
</div>
</template>
</template>
<
script
lang=
"tsx"
setup
>
<
script
lang=
"tsx"
setup
>
import
{
h
,
nextTick
,
onMounted
,
onUpdated
,
reactive
,
ref
,
watch
}
from
'
vue
'
;
import
{
h
,
nextTick
,
onMounted
,
onUpdated
,
reactive
,
ref
,
watch
}
from
"
vue
"
;
import
type
{
TreeOverrideNodeClickBehavior
,
UploadFileInfo
}
from
'
naive-ui
'
;
import
type
{
TreeOverrideNodeClickBehavior
,
UploadFileInfo
}
from
"
naive-ui
"
;
import
{
NButton
,
NImage
,
NSpace
,
NTag
,
useMessage
,
useNotification
,
NDropdown
,
NRow
,
NCol
,
NEllipsis
}
from
'
naive-ui
'
;
import
{
import
JSMpeg
from
'
@cycjimmy/jsmpeg-player
'
;
NButton
,
import
html2canvas
from
'
html2canvas
'
;
NImage
,
import
{
Add28Filled
as
AddIcon
,
Delete16Regular
as
DelICon
,
CalendarEdit24Regular
as
EditIcon
}
from
'
@vicons/fluent
'
;
NSpace
,
import
{
localStg
}
from
'
@/utils/storage
'
;
NTag
,
useMessage
,
useNotification
,
NDropdown
,
NRow
,
NCol
,
NEllipsis
,
}
from
"
naive-ui
"
;
import
JSMpeg
from
"
@cycjimmy/jsmpeg-player
"
;
import
html2canvas
from
"
html2canvas
"
;
import
{
Add28Filled
as
AddIcon
,
Delete16Regular
as
DelICon
,
CalendarEdit24Regular
as
EditIcon
,
}
from
"
@vicons/fluent
"
;
import
{
localStg
}
from
"
@/utils/storage
"
;
// api_algorithmsPopUpsConfig 弹窗配置
// api_algorithmsPopUpsConfig 弹窗配置
// api_algorithmsList 算法列
// api_algorithmsList 算法列
// api_getKeyOfAnaly
// api_getKeyOfAnaly
...
@@ -159,43 +253,50 @@ import { localStg } from '@/utils/storage';
...
@@ -159,43 +253,50 @@ import { localStg } from '@/utils/storage';
// api_getKeyTaskInfo
// api_getKeyTaskInfo
// api_algorithmsPopUpsDel api_algorithmsPopUpsFind
// api_algorithmsPopUpsDel api_algorithmsPopUpsFind
import
{
api_permissionTreeList
,
api_delRoleInfo
,
api_modifyRoleInfo
,
getAudioFile
,
api_algorithmsPopUpsConfig
,
api_videoTest
,
api_algorithmsList
,
api_algorithmsPopUpsPage
,
api_algorithmsPopUpsFind
,
api_algorithmsPopUpsDel
}
from
'
@/api/index.ts
'
import
{
api_permissionTreeList
,
api_delRoleInfo
,
api_modifyRoleInfo
,
getAudioFile
,
api_algorithmsPopUpsConfig
,
api_videoTest
,
api_algorithmsList
,
api_algorithmsPopUpsPage
,
api_algorithmsPopUpsFind
,
api_algorithmsPopUpsDel
,
}
from
"
@/api/index.ts
"
;
const
updateFileModal
=
ref
(
false
);
const
updateFileModal
=
ref
(
false
);
const
message
=
useMessage
();
const
message
=
useMessage
();
const
tableData
=
ref
([]);
const
tableData
=
ref
([]);
const
selTipType
=
ref
(
'
0
'
);
const
selTipType
=
ref
(
"
0
"
);
const
notification
=
useNotification
();
const
notification
=
useNotification
();
let
algorithmsList
=
reactive
([]);
let
algorithmsList
=
reactive
([]);
const
apiUrl
=
import
.
meta
.
env
.
VITE_SERVICE_URL
;
const
apiUrl
=
import
.
meta
.
env
.
VITE_SERVICE_URL
;
// const page = ref(1);
// const page = ref(1);
// const pageSize = ref(10);
// const pageSize = ref(10);
// ========================================== 分页 | S
// ========================================== 分页 | S
const
pageSizes
=
[
const
pageSizes
=
[
{
{
label
:
'
10 每页
'
,
label
:
"
10 每页
"
,
value
:
10
value
:
10
,
},
},
{
{
label
:
'
20 每页
'
,
label
:
"
20 每页
"
,
value
:
20
value
:
20
,
},
},
{
{
label
:
'
30 每页
'
,
label
:
"
30 每页
"
,
value
:
30
value
:
30
,
},
},
{
{
label
:
'
40 每页
'
,
label
:
"
40 每页
"
,
value
:
40
value
:
40
,
}
}
,
];
];
const
page
=
ref
(
1
);
const
page
=
ref
(
1
);
const
pageSize
=
ref
(
10
);
const
pageSize
=
ref
(
10
);
...
@@ -204,12 +305,11 @@ const pageSize = ref(10);
...
@@ -204,12 +305,11 @@ const pageSize = ref(10);
const
next
=
(
val
:
number
)
=>
{
const
next
=
(
val
:
number
)
=>
{
page
.
value
=
val
;
page
.
value
=
val
;
}
}
;
const
prev
=
(
val
:
number
)
=>
{
const
prev
=
(
val
:
number
)
=>
{
pageSize
.
value
=
val
;
pageSize
.
value
=
val
;
}
};
// ========================================== 分页 | E
// ========================================== 分页 | E
...
@@ -217,7 +317,7 @@ const prev = (val: number) => {
...
@@ -217,7 +317,7 @@ const prev = (val: number) => {
const
sourceE
=
ref
(
null
);
const
sourceE
=
ref
(
null
);
const
audioE
=
ref
(
null
);
const
audioE
=
ref
(
null
);
const
htmlStr
=
ref
(
''
)
const
htmlStr
=
ref
(
""
);
const
playAudio
=
async
()
=>
{
const
playAudio
=
async
()
=>
{
/**
/**
...
@@ -226,20 +326,19 @@ const playAudio = async () => {
...
@@ -226,20 +326,19 @@ const playAudio = async () => {
* 3. 动态js网络链接不上
* 3. 动态js网络链接不上
*/
*/
htmlStr
.
value
=
`<audio ref="audioE" id="aWrap" controls>
htmlStr
.
value
=
`<audio ref="audioE" id="aWrap" controls>
<source id="audio" src="
${
apiUrl
}
/v1/play/
${
audioId
.
value
}
" type="audio/mpeg"></source>
<source id="audio" src="
${
apiUrl
}
/v1/play/
${
audioId
.
value
}
" type="audio/mpeg"></source>
</audio>`
;
</audio>`
;
nextTick
(()
=>
{
nextTick
(()
=>
{
let
a
=
document
.
getElementById
(
'
aWrap
'
);
let
a
=
document
.
getElementById
(
"
aWrap
"
);
a
?.
play
();
a
?.
play
();
});
});
};
};
// 临时测试播放
// 临时测试播放
const
videoTest
=
async
()
=>
{
const
videoTest
=
async
()
=>
{
return
await
api_videoTest
().
then
(
res
=>
{
return
await
api_videoTest
().
then
(
(
res
)
=>
{
// console.log("================== videoTest", res);
// console.log("================== videoTest", res);
// ============================= 二进制转化程 video-mp4
// ============================= 二进制转化程 video-mp4
...
@@ -247,17 +346,17 @@ const videoTest = async () => {
...
@@ -247,17 +346,17 @@ const videoTest = async () => {
nextTick
(()
=>
{
nextTick
(()
=>
{
console
.
log
(
"
================== videoTest ||||
"
,
res
);
console
.
log
(
"
================== videoTest ||||
"
,
res
);
// 创建Blob对象
// 创建Blob对象
var
blob
=
new
Blob
([
res
.
data
.
data
],
{
type
:
'
video/mp4
'
});
var
blob
=
new
Blob
([
res
.
data
.
data
],
{
type
:
"
video/mp4
"
});
console
.
log
(
"
============== blob
"
,
blob
)
console
.
log
(
"
============== blob
"
,
blob
)
;
// 创建Blob URL
// 创建Blob URL
var
blobUrl
=
URL
.
createObjectURL
(
blob
);
var
blobUrl
=
URL
.
createObjectURL
(
blob
);
console
.
log
(
"
============== blobUrl
"
,
blobUrl
)
console
.
log
(
"
============== blobUrl
"
,
blobUrl
)
;
// 设置video标签的src属性
// 设置video标签的src属性
var
source
=
document
.
getElementById
(
'
videoSource
'
);
var
source
=
document
.
getElementById
(
"
videoSource
"
);
source
.
src
=
blobUrl
;
source
.
src
=
blobUrl
;
})
})
;
});
});
};
};
...
@@ -265,24 +364,27 @@ const videoTest = async () => {
...
@@ -265,24 +364,27 @@ const videoTest = async () => {
const
permissionTree
=
ref
([]);
const
permissionTree
=
ref
([]);
const
getPermissionTreeList
=
async
()
=>
{
const
getPermissionTreeList
=
async
()
=>
{
return
await
api_permissionTreeList
().
then
(
res
=>
{
return
await
api_permissionTreeList
().
then
(
(
res
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
if
(
res
.
data
.
code
===
200
)
{
return
permissionTree
.
value
=
res
.
data
.
data
;
return
(
permissionTree
.
value
=
res
.
data
.
data
)
;
// return message.success()
// return message.success()
}
}
return
message
.
error
(
res
.
data
.
msg
);
return
message
.
error
(
res
.
data
.
msg
);
})
})
;
}
}
;
// 算法信息
// 算法信息
const
getAlgorithmsList
=
async
()
=>
{
const
getAlgorithmsList
=
async
()
=>
{
await
api_algorithmsList
().
then
(
res
=>
{
await
api_algorithmsList
().
then
(
(
res
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
if
(
res
.
data
.
code
===
200
)
{
console
.
log
(
"
================ |||||||||||||||||||||| ================ api_algorithmsList
"
,
res
.
data
.
data
);
console
.
log
(
"
================ |||||||||||||||||||||| ================ api_algorithmsList
"
,
res
.
data
.
data
,
);
let
ids
=
[];
let
ids
=
[];
let
type
=
true
;
let
type
=
true
;
algorithmsList
=
res
.
data
.
data
.
map
(
item
=>
{
algorithmsList
=
res
.
data
.
data
.
map
(
(
item
)
=>
{
// 那些选中
// 那些选中
// if (item.isRemind && item.isVoice) {
// if (item.isRemind && item.isVoice) {
// ids.push(item?.id);
// ids.push(item?.id);
...
@@ -294,17 +396,18 @@ const getAlgorithmsList = async () => {
...
@@ -294,17 +396,18 @@ const getAlgorithmsList = async () => {
if
(
item
.
isChecked
)
{
if
(
item
.
isChecked
)
{
ids
.
push
(
item
?.
id
);
ids
.
push
(
item
?.
id
);
type
&&
[
'
isRemind
'
,
'
isVoice
'
,
'
reminderType
'
].
forEach
(
key
=>
{
type
&&
type
=
false
;
[
"
isRemind
"
,
"
isVoice
"
,
"
reminderType
"
].
forEach
((
key
)
=>
{
modifyForm
[
key
]
=
item
[
key
];
type
=
false
;
});
modifyForm
[
key
]
=
item
[
key
];
});
}
}
// 选项列表
// 选项列表
return
{
return
{
algorithmName
:
item
.
algorithmName
,
algorithmName
:
item
.
algorithmName
,
id
:
item
.
id
id
:
item
.
id
,
}
}
;
});
});
// 修改表单
// 修改表单
modifyForm
.
ids
=
ids
;
modifyForm
.
ids
=
ids
;
...
@@ -316,28 +419,28 @@ const getAlgorithmsList = async () => {
...
@@ -316,28 +419,28 @@ const getAlgorithmsList = async () => {
// 删除视频
// 删除视频
const
delAudio
=
async
(
id
:
string
)
=>
{
const
delAudio
=
async
(
id
:
string
)
=>
{
return
await
api_algorithmsPopUpsDel
(
id
).
then
(
res
=>
{
return
await
api_algorithmsPopUpsDel
(
id
).
then
(
(
res
)
=>
{
console
.
log
(
"
================== delAudio
"
,
res
);
console
.
log
(
"
================== delAudio
"
,
res
);
if
(
res
?.
data
.
code
===
200
)
{
if
(
res
?.
data
.
code
===
200
)
{
getAlgorithmsPopUpsPage
()
getAlgorithmsPopUpsPage
()
;
// return message.success(res?.data.msg);
// return message.success(res?.data.msg);
}
}
return
message
.
warning
(
res
?.
data
.
msg
);
return
message
.
warning
(
res
?.
data
.
msg
);
})
})
;
};
};
// 语音提醒
// 语音提醒
const
total
=
ref
(
0
);
const
total
=
ref
(
0
);
const
getAlgorithmsPopUpsPage
=
async
()
=>
{
const
getAlgorithmsPopUpsPage
=
async
()
=>
{
let
param
=
{
pageNum
:
page
.
value
,
pageSize
:
pageSize
.
value
};
let
param
=
{
pageNum
:
page
.
value
,
pageSize
:
pageSize
.
value
};
return
api_algorithmsPopUpsPage
(
param
).
then
(
res
=>
{
return
api_algorithmsPopUpsPage
(
param
).
then
(
(
res
)
=>
{
console
.
log
(
"
================== tableData
"
,
res
);
console
.
log
(
"
================== tableData
"
,
res
);
if
(
res
?.
data
.
code
===
200
)
{
if
(
res
?.
data
.
code
===
200
)
{
tableData
.
value
=
res
?.
data
.
data
.
records
;
tableData
.
value
=
res
?.
data
.
data
.
records
;
total
.
value
=
res
?.
data
.
data
.
total
;
total
.
value
=
res
?.
data
.
data
.
total
;
}
}
})
})
;
}
}
;
watch
(
page
,
()
=>
{
watch
(
page
,
()
=>
{
getAlgorithmsPopUpsPage
();
getAlgorithmsPopUpsPage
();
...
@@ -350,8 +453,7 @@ watch(pageSize, () => {
...
@@ -350,8 +453,7 @@ watch(pageSize, () => {
// 修改弹窗配置
// 修改弹窗配置
const
onSubmit
=
()
=>
{
const
onSubmit
=
()
=>
{
return
modifyPopUpList
();
return
modifyPopUpList
();
}
};
let
modifyForm
=
reactive
({
let
modifyForm
=
reactive
({
// 开启弹窗
// 开启弹窗
...
@@ -361,41 +463,41 @@ let modifyForm = reactive({
...
@@ -361,41 +463,41 @@ let modifyForm = reactive({
// 弹窗类型 报警弹窗类型(1,右侧,2,居中)
// 弹窗类型 报警弹窗类型(1,右侧,2,居中)
reminderType
:
1
,
reminderType
:
1
,
// 算法ID
// 算法ID
ids
:
[]
ids
:
[]
,
});
});
// 弹窗配置回显数据
// 弹窗配置回显数据
const
getAlgorithmsPopUpsFind
=
async
()
=>
{
const
getAlgorithmsPopUpsFind
=
async
()
=>
{
return
await
api_algorithmsPopUpsFind
().
then
(
res
=>
{
return
await
api_algorithmsPopUpsFind
().
then
((
res
)
=>
{
console
.
log
(
"
================== api_algorithmsPopUpsFind
"
,
res
);
if
(
res
?.
data
.
code
===
200
)
{
if
(
res
?.
data
.
code
===
200
)
{
return
res
?.
data
.
data
;
return
res
?.
data
.
data
;
}
}
})
});
}
};
const
modifyPopUpList
=
async
()
=>
{
const
modifyPopUpList
=
async
()
=>
{
console
.
log
(
'
============ modifyForm
'
,
modifyForm
)
return
await
api_algorithmsPopUpsConfig
(
modifyForm
).
then
((
res
)
=>
{
return
await
api_algorithmsPopUpsConfig
(
modifyForm
).
then
(
res
=>
{
if
(
res
?.
data
.
code
===
200
)
{
if
(
res
.
data
.
code
===
200
)
{
return
message
.
success
(
res
.
data
.
msg
);
return
message
.
success
(
res
.
data
.
msg
);
}
}
return
message
.
warning
(
res
.
data
.
msg
);
return
message
.
warning
(
res
.
data
.
msg
);
})
})
;
}
}
;
// ======================= IMG 上传 | S
// ======================= IMG 上传 | S
const
beforeUpload
=
(
data
:
{
file
:
UploadFileInfo
;
fileList
:
UploadFileInfo
[]
}):
boolean
=>
{
const
beforeUpload
=
(
data
:
{
console
.
log
(
"
=============== 上传文件
"
,
data
.
file
.
file
.
size
)
file
:
UploadFileInfo
;
fileList
:
UploadFileInfo
[];
}):
boolean
=>
{
console
.
log
(
"
=============== 上传文件
"
,
data
.
file
.
file
.
size
);
if
((
data
.
file
.
file
.
size
/
1024
/
1024
).
toFixed
(
0
)
>
5
)
{
if
((
data
.
file
.
file
.
size
/
1024
/
1024
).
toFixed
(
0
)
>
5
)
{
message
.
error
(
'
音频大小不能超过5M!
'
);
message
.
error
(
"
音频大小不能超过5M!
"
);
return
false
;
return
false
;
}
}
if
(
data
.
file
.
file
?.
type
!==
'
audio/mpeg
'
)
{
if
(
data
.
file
.
file
?.
type
!==
"
audio/mpeg
"
)
{
message
.
error
(
'
只能上传MP3格式的文件!
'
);
message
.
error
(
"
只能上传MP3格式的文件!
"
);
return
false
;
return
false
;
}
}
return
true
;
return
true
;
...
@@ -403,58 +505,75 @@ const beforeUpload = (data: { file: UploadFileInfo; fileList: UploadFileInfo[] }
...
@@ -403,58 +505,75 @@ const beforeUpload = (data: { file: UploadFileInfo; fileList: UploadFileInfo[] }
const
fileList
=
ref
<
UploadFileInfo
[]
>
([]);
const
fileList
=
ref
<
UploadFileInfo
[]
>
([]);
const
handleFinish
=
({
file
,
event
}:
{
file
:
UploadFileInfo
;
event
?:
ProgressEvent
})
=>
{
const
handleFinish
=
({
const
res
=
event
?.
target
&&
event
?.
target
?.
response
&&
JSON
.
parse
(
event
?.
target
?.
response
);
file
,
event
,
}:
{
file
:
UploadFileInfo
;
event
?:
ProgressEvent
;
})
=>
{
const
res
=
event
?.
target
&&
event
?.
target
?.
response
&&
JSON
.
parse
(
event
?.
target
?.
response
);
if
(
res
.
code
===
200
)
{
if
(
res
.
code
===
200
)
{
getAlgorithmsPopUpsPage
();
getAlgorithmsPopUpsPage
();
message
.
success
(
'
音频上传成功!
'
);
message
.
success
(
"
音频上传成功!
"
);
}
}
return
file
;
return
file
;
};
};
// ======================= IMG 上传 | E
// ======================= IMG 上传 | E
const
audioId
=
ref
(
''
);
const
audioId
=
ref
(
""
);
const
tableColumn
=
[
const
tableColumn
=
[
{
{
title
:
'
算法ID
'
,
title
:
"
算法ID
"
,
align
:
'
center
'
,
align
:
"
center
"
,
key
:
'
id
'
,
key
:
"
id
"
,
},
},
{
{
title
:
'
算法名称
'
,
title
:
"
算法名称
"
,
align
:
'
center
'
,
align
:
"
center
"
,
key
:
'
algorithmName
'
,
key
:
"
algorithmName
"
,
},
},
{
{
title
:
'
算法等级
'
,
title
:
"
算法等级
"
,
key
:
'
grade
'
,
key
:
"
grade
"
,
align
:
'
center
'
,
align
:
"
center
"
,
render
:
(
row
:
any
)
=>
{
render
:
(
row
:
any
)
=>
{
return
row
.
grade
===
0
?
(
return
row
.
grade
===
0
?
(
<
NTag
bordered
=
{
false
}
type
=
"
error
"
>
一级
<
/NTag
>
<
NTag
bordered
=
{
false
}
type
=
"
error
"
>
一级
<
/NTag
>
)
:
row
.
grade
===
1
?
(
)
:
row
.
grade
===
1
?
(
<
NTag
bordered
=
{
false
}
type
=
"
warning
"
>
二级
<
/NTag
>
<
NTag
bordered
=
{
false
}
type
=
"
warning
"
>
二级
<
/NTag
>
)
:
row
.
grade
===
2
?
(
)
:
row
.
grade
===
2
?
(
<
NTag
bordered
=
{
false
}
type
=
"
info
"
>
三级
<
/NTag
>
<
NTag
bordered
=
{
false
}
type
=
"
info
"
>
三级
<
/NTag
>
)
:
row
.
grade
===
3
?
(
)
:
row
.
grade
===
3
?
(
<
NTag
bordered
=
{
false
}
type
=
"
success
"
>
四级
<
/NTag
>
<
NTag
bordered
=
{
false
}
type
=
"
success
"
>
四级
<
/NTag
>
)
:
(
)
:
(
<
NTag
bordered
=
{
false
}
>
五级
<
/NTag
>
<
NTag
bordered
=
{
false
}
>
五级
<
/NTag
>
);
);
}
}
,
},
},
{
{
title
:
'
报警语音
'
,
title
:
"
报警语音
"
,
align
:
'
center
'
,
align
:
"
center
"
,
key
:
'
audioName
'
,
key
:
"
audioName
"
,
render
:
(
row
:
any
)
=>
{
render
:
(
row
:
any
)
=>
{
return
row
.
audioName
||
'
无
'
return
row
.
audioName
||
"
无
"
;
}
}
,
},
},
{
{
title
:
'
操作
'
,
title
:
"
操作
"
,
key
:
'
actions
'
,
key
:
"
actions
"
,
align
:
'
center
'
,
align
:
"
center
"
,
render
(
row
:
any
)
{
render
(
row
:
any
)
{
return
(
return
(
<
div
>
<
div
>
...
@@ -472,7 +591,7 @@ const tableColumn = [
...
@@ -472,7 +591,7 @@ const tableColumn = [
<
n
-
button
<
n
-
button
onClick
=
{()
=>
{
onClick
=
{()
=>
{
audioId
.
value
=
row
.
id
;
audioId
.
value
=
row
.
id
;
updateFileModal
.
value
=
true
updateFileModal
.
value
=
true
;
}}
}}
quaternary
quaternary
type
=
"
info
"
type
=
"
info
"
...
@@ -482,7 +601,7 @@ const tableColumn = [
...
@@ -482,7 +601,7 @@ const tableColumn = [
<
n
-
button
<
n
-
button
onClick
=
{()
=>
{
onClick
=
{()
=>
{
delAudio
(
row
.
id
)
delAudio
(
row
.
id
)
;
}}
}}
quaternary
quaternary
type
=
"
error
"
type
=
"
error
"
...
@@ -491,24 +610,23 @@ const tableColumn = [
...
@@ -491,24 +610,23 @@ const tableColumn = [
<
/n-button
>
<
/n-button
>
<
/div
>
<
/div
>
);
);
}
}
,
}
}
,
];
];
const
handleSelect
=
()
=>
{
};
const
handleSelect
=
()
=>
{};
const
options
=
[
const
options
=
[
{
{
label
:
'
暂停提醒
'
,
label
:
"
暂停提醒
"
,
value
:
'
1
'
value
:
"
1
"
,
},
},
{
{
label
:
'
继续提醒
'
,
label
:
"
继续提醒
"
,
value
:
'
2
'
value
:
"
2
"
,
}
}
,
];
];
onMounted
(()
=>
{
onMounted
(()
=>
{
// 配置回显
// 配置回显
getAlgorithmsList
();
getAlgorithmsList
();
...
@@ -519,7 +637,6 @@ onMounted(() => {
...
@@ -519,7 +637,6 @@ onMounted(() => {
// 权限树
// 权限树
getPermissionTreeList
();
getPermissionTreeList
();
});
});
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
@@ -545,18 +662,17 @@ onMounted(() => {
...
@@ -545,18 +662,17 @@ onMounted(() => {
}
}
#alarmreminder
{
#alarmreminder
{
.flex-wrap
{
.flex-wrap
{
display
:
flex
;
display
:
flex
;
&
>
div
{
&
>
div
{
flex
:
1
;
flex
:
1
;
height
:
200px
;
height
:
200px
;
text-align
:
center
;
text-align
:
center
;
&
>
div
{
&
>
div
{
margin-top
:
10px
;
margin-top
:
10px
;
box-shadow
:
0
0
10px
rgba
(
0
,
0
,
0
,
.1
);
box-shadow
:
0
0
10px
rgba
(
0
,
0
,
0
,
0
.1
);
height
:
120px
;
height
:
120px
;
width
:
210px
;
width
:
210px
;
background
:
#fff
;
background
:
#fff
;
...
@@ -567,13 +683,12 @@ onMounted(() => {
...
@@ -567,13 +683,12 @@ onMounted(() => {
}
}
}
}
// 默认样式
// 默认样式
.right-warp
{
.right-warp
{
display
:
inline-block
;
display
:
inline-block
;
text-align
:
center
;
text-align
:
center
;
>
div
{
>
div
{
display
:
inline-block
;
display
:
inline-block
;
margin-top
:
30px
;
margin-top
:
30px
;
border-radius
:
5px
;
border-radius
:
5px
;
...
@@ -589,18 +704,15 @@ onMounted(() => {
...
@@ -589,18 +704,15 @@ onMounted(() => {
}
}
}
}
// 右侧选中
// 右侧选中
.sel-right-warp
{
.sel-right-warp
{
border
:
3px
solid
rgb
(
24
,
114
,
240
);
border
:
3px
solid
rgb
(
24
,
114
,
240
);
border-left
:
none
;
border-left
:
none
;
border-right
:
none
;
border-right
:
none
;
>
div
{
>
div
{
background
:
rgb
(
24
,
114
,
240
);
background
:
rgb
(
24
,
114
,
240
);
}
}
}
}
// 左侧选中
// 左侧选中
...
@@ -621,7 +733,7 @@ onMounted(() => {
...
@@ -621,7 +733,7 @@ onMounted(() => {
right
:
0
;
right
:
0
;
margin
:
5px
5px
0
0
;
margin
:
5px
5px
0
0
;
&
>
div
{
&
>
div
{
height
:
11px
;
height
:
11px
;
width
:
30px
;
width
:
30px
;
background-color
:
rgb
(
24
,
114
,
240
);
background-color
:
rgb
(
24
,
114
,
240
);
...
@@ -636,7 +748,7 @@ onMounted(() => {
...
@@ -636,7 +748,7 @@ onMounted(() => {
right
:
0
;
right
:
0
;
margin
:
5px
5px
0
0
;
margin
:
5px
5px
0
0
;
&
>
div
{
&
>
div
{
height
:
13px
;
height
:
13px
;
width
:
30px
;
width
:
30px
;
background-color
:
rgb
(
24
,
114
,
240
);
background-color
:
rgb
(
24
,
114
,
240
);
...
@@ -645,6 +757,5 @@ onMounted(() => {
...
@@ -645,6 +757,5 @@ onMounted(() => {
border-radius
:
2px
;
border-radius
:
2px
;
}
}
}
}
}
}
</
style
>
</
style
>
src/views/home/index.vue
View file @
1f872198
...
@@ -21,6 +21,7 @@ import fullScreen from '@/utils/full'
...
@@ -21,6 +21,7 @@ import fullScreen from '@/utils/full'
const
serviceUrl
=
import
.
meta
.
env
.
VITE_VIDEO_URL
;
const
serviceUrl
=
import
.
meta
.
env
.
VITE_VIDEO_URL
;
const
apiUrl
=
import
.
meta
.
env
.
VITE_SERVICE_URL
;
const
apiUrl
=
import
.
meta
.
env
.
VITE_SERVICE_URL
;
const
webSocketUrl
=
import
.
meta
.
env
.
VITE_WEBSOCKET_URL
;
const
webSocketUrl
=
import
.
meta
.
env
.
VITE_WEBSOCKET_URL
;
...
@@ -86,6 +87,7 @@ const audioId = ref('');
...
@@ -86,6 +87,7 @@ const audioId = ref('');
const
playAudio
=
async
(
id
:
string
)
=>
{
const
playAudio
=
async
(
id
:
string
)
=>
{
// 创建新的音频元素并播放
// 创建新的音频元素并播放
const
audio
=
new
Audio
(
`
${
apiUrl
}
/v1/play/
${
id
}
`
);
const
audio
=
new
Audio
(
`
${
apiUrl
}
/v1/play/
${
id
}
`
);
audio
.
play
();
audio
.
play
();
// 保留原始逻辑备用
// 保留原始逻辑备用
...
@@ -101,7 +103,6 @@ const switchVideoPalyer = (id: string) => {
...
@@ -101,7 +103,6 @@ const switchVideoPalyer = (id: string) => {
cId
.
value
=
id
;
cId
.
value
=
id
;
let
camera
=
cameraList
.
value
.
filter
(
item
=>
item
?.
id
===
id
)[
0
];
let
camera
=
cameraList
.
value
.
filter
(
item
=>
item
?.
id
===
id
)[
0
];
console
.
log
(
"
======================================= id
"
,
id
,
camera
?.
cameraAddress
);
// if (!camera?.cameraAddress?.includes('rtsp://')) {
// if (!camera?.cameraAddress?.includes('rtsp://')) {
// return message.error('摄像头流地址格式有误!');
// return message.error('摄像头流地址格式有误!');
...
@@ -125,7 +126,6 @@ const switchVideoPalyer = (id: string) => {
...
@@ -125,7 +126,6 @@ const switchVideoPalyer = (id: string) => {
}
}
);
);
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
"
======================================= error
"
,
e
);
}
}
});
});
};
};
...
@@ -163,7 +163,6 @@ const options = [
...
@@ -163,7 +163,6 @@ const options = [
}
}
];
];
const
handleSelect
=
(
key
:
string
)
=>
{
const
handleSelect
=
(
key
:
string
)
=>
{
console
.
log
(
key
);
};
};
// 变更状态
// 变更状态
...
@@ -205,7 +204,6 @@ let cLogInfo = reactive({});
...
@@ -205,7 +204,6 @@ let cLogInfo = reactive({});
// 切换视频播放源头
// 切换视频播放源头
const
switchVideoPlayer
=
()
=>
{
const
switchVideoPlayer
=
()
=>
{
console
.
log
(
"
switchVideoPlayer ==============
"
,
"
rtsp://admin:gemho10-7@192.168.0.56:554/h264/ch1/main/av_stream`
"
)
// nextTick(() => {
// nextTick(() => {
// try {
// try {
// // 临时测试
// // 临时测试
...
@@ -284,14 +282,13 @@ onMounted(() => {
...
@@ -284,14 +282,13 @@ onMounted(() => {
try
{
try
{
let
ws
=
new
WebSocket
(
`
${
webSocketUrl
}
/ws/
${
localStg
.
get
(
'
id
'
)}
`
);
let
ws
=
new
WebSocket
(
`
${
webSocketUrl
}
/ws/
${
localStg
.
get
(
'
id
'
)}
`
);
// 应改为(测试用临时方案):
// let ws = new WebSocket(`ws://localhost:9999/ws/${localStg.get('id')}`);
ws
.
onopen
=
function
()
{
ws
.
onopen
=
function
()
{
console
.
log
(
'
WebSocket connected --------------------------------------------------------------------------
'
);
ws
.
send
(
'
Hello, Server! -------------------------
'
);
ws
.
send
(
'
Hello, Server! -------------------------
'
);
};
};
ws
.
onmessage
=
function
(
event
)
{
ws
.
onmessage
=
function
(
event
)
{
console
.
log
(
'
---------------------- WebSocket received message:
'
,
JSON
.
parse
(
event
.
data
));
let
data
=
JSON
.
parse
(
event
.
data
);
let
data
=
JSON
.
parse
(
event
.
data
);
data
.
algorithmId
&&
playAudio
(
data
.
algorithmId
);
data
.
algorithmId
&&
playAudio
(
data
.
algorithmId
);
...
@@ -359,15 +356,14 @@ onMounted(() => {
...
@@ -359,15 +356,14 @@ onMounted(() => {
};
};
ws
.
onclose
=
function
()
{
ws
.
onclose
=
function
()
{
console
.
log
(
'
WebSocket closed
'
);
};
};
ws
.
onerror
=
function
(
error
)
{
ws
.
onerror
=
function
(
error
)
{
console
.
error
(
'
WebSocket error:
'
,
error
);
console
.
error
(
'
WebSocket error:
'
,
error
);
// 检查控制台是否有连接错误
};
};
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
"
error
"
,
e
)
console
.
log
(
e
,
'
error
'
)
}
}
...
...
src/views/home/modules/line-chart.vue
View file @
1f872198
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
watch
,
onMounted
,
defineProps
}
from
'
vue
'
;
import
{
watch
,
onMounted
,
defineProps
}
from
"
vue
"
;
import
{
$t
}
from
'
@/locales
'
;
import
{
$t
}
from
"
@/locales
"
;
import
{
useAppStore
}
from
'
@/store/modules/app
'
;
import
{
useAppStore
}
from
"
@/store/modules/app
"
;
import
{
useEcharts
}
from
'
@/hooks/common/echarts
'
;
import
{
useEcharts
}
from
"
@/hooks/common/echarts
"
;
import
{
api_logCount
}
from
"
@/api/index.ts
"
;
import
{
api_logCount
}
from
"
@/api/index.ts
"
;
defineOptions
({
defineOptions
({
name
:
'
LineChart
'
name
:
"
LineChart
"
,
});
});
const
props
=
defineProps
({
const
props
=
defineProps
({
date
:
{
date
:
{
type
:
Array
,
type
:
Array
,
default
:
()
=>
[]
default
:
()
=>
[]
,
}
}
,
});
});
watch
(
props
,
()
=>
{
watch
(
props
,
()
=>
{
getLogCount
();
getLogCount
();
})
})
;
// 获取日志报警的数据
// 获取日志报警的数据
const
getLogCount
=
async
()
=>
{
const
getLogCount
=
async
()
=>
{
await
api_logCount
(
props
.
date
).
then
((
res
)
=>
{
await
api_logCount
(
props
.
date
).
then
(
res
=>
{
if
(
res
.
data
.
code
===
200
)
{
if
(
res
.
data
.
code
===
200
)
{
console
.
log
(
"
================= res
"
,
res
.
data
.
data
);
let
data
=
res
.
data
.
data
;
let
data
=
res
.
data
.
data
;
console
.
log
(
"
=================== data
"
,
data
);
updateOptions
((
opts
)
=>
{
updateOptions
(
opts
=>
{
console
.
log
(
"
========================= opts
"
,
opts
)
// opts.series[1].data = [2208, 2016, 2916, 4512, 8281, 2008, 1963, 2367, 2956, 678];
// opts.series[1].data = [2208, 2016, 2916, 4512, 8281, 2008, 1963, 2367, 2956, 678];
opts
.
xAxis
.
data
=
data
.
dateLabel
;
opts
.
xAxis
.
data
=
data
.
dateLabel
;
opts
.
legend
.
data
=
data
.
result
;
opts
.
legend
.
data
=
data
.
result
;
opts
.
series
.
forEach
((
item
,
index
)
=>
{
opts
.
series
.
forEach
((
item
,
index
)
=>
{
opts
.
series
[
index
].
data
=
[];
opts
.
series
[
index
].
data
=
[];
})
});
const
service
=
(
name
=
(
Math
.
random
()
*
100
).
toFixed
(
0
))
=>
{
const
service
=
(
name
=
(
Math
.
random
()
*
100
).
toFixed
(
0
))
=>
{
return
{
return
{
color
:
'
#1872F0
'
,
color
:
"
#1872F0
"
,
name
,
name
,
type
:
'
line
'
,
type
:
"
line
"
,
smooth
:
true
,
smooth
:
true
,
stack
:
'
Total
'
,
stack
:
"
Total
"
,
areaStyle
:
{
areaStyle
:
{
color
:
{
color
:
{
type
:
'
linear
'
,
type
:
"
linear
"
,
x
:
0
,
x
:
0
,
y
:
0
,
y
:
0
,
x2
:
0
,
x2
:
0
,
...
@@ -58,33 +51,32 @@ const getLogCount = async () => {
...
@@ -58,33 +51,32 @@ const getLogCount = async () => {
colorStops
:
[
colorStops
:
[
{
{
offset
:
0.25
,
offset
:
0.25
,
color
:
'
#1872F0
'
color
:
"
#1872F0
"
,
},
},
{
{
offset
:
1
,
offset
:
1
,
color
:
'
#fff
'
color
:
"
#fff
"
,
}
}
,
]
]
,
}
}
,
},
},
emphasis
:
{
emphasis
:
{
focus
:
'
series
'
focus
:
"
series
"
,
},
},
data
:
new
Array
(
data
[
0
].
countList
.
length
).
fill
(
100
)
data
:
new
Array
(
data
[
0
].
countList
.
length
).
fill
(
100
)
,
};
};
}
};
data
.
countLabel
.
forEach
((
item
,
index
)
=>
{
data
.
countLabel
.
forEach
((
item
,
index
)
=>
{
opts
.
series
.
push
({
opts
.
series
.
push
({
color
:
'
#1872F0
'
,
color
:
"
#1872F0
"
,
name
:
data
.
result
[
index
],
name
:
data
.
result
[
index
],
type
:
'
line
'
,
type
:
"
line
"
,
smooth
:
true
,
smooth
:
true
,
stack
:
'
Total
'
,
stack
:
"
Total
"
,
areaStyle
:
{
areaStyle
:
{
color
:
{
color
:
{
type
:
'
linear
'
,
type
:
"
linear
"
,
x
:
0
,
x
:
0
,
y
:
0
,
y
:
0
,
x2
:
0
,
x2
:
0
,
...
@@ -92,21 +84,21 @@ const getLogCount = async () => {
...
@@ -92,21 +84,21 @@ const getLogCount = async () => {
colorStops
:
[
colorStops
:
[
{
{
offset
:
0.25
,
offset
:
0.25
,
color
:
'
#1872F0
'
color
:
"
#1872F0
"
,
},
},
{
{
offset
:
1
,
offset
:
1
,
color
:
'
#fff
'
color
:
"
#fff
"
,
}
}
,
]
]
,
}
}
,
},
},
emphasis
:
{
emphasis
:
{
focus
:
'
series
'
focus
:
"
series
"
,
},
},
data
:
item
data
:
item
,
})
})
;
})
})
;
// opts.series = new Array(data[0].countList.length).fill(
// opts.series = new Array(data[0].countList.length).fill(
// series
// series
...
@@ -115,69 +107,64 @@ const getLogCount = async () => {
...
@@ -115,69 +107,64 @@ const getLogCount = async () => {
// countList 17
// countList 17
// opts.series[0].data = [0xxx]
// opts.series[0].data = [0xxx]
// data.forEach(wrapItem => {
// data.forEach(wrapItem => {
// wrapItem.countList.forEach((item, index) => {
// wrapItem.countList.forEach((item, index) => {
// opts.series[index].name = item.algorithmName;
// opts.series[index].name = item.algorithmName;
// })
// })
// });
// });
// data[0].countList((item, index) => {
// data[0].countList((item, index) => {
// series.data[index] = item.count;
// series.data[index] = item.count;
// })
// })
console
.
log
(
"
========================= opts
"
,
opts
.
xAxis
.
data
,
opts
.
legend
.
data
)
return
opts
;
return
opts
;
})
})
;
}
}
})
});
}
};
onMounted
(()
=>
{
onMounted
(()
=>
{
getLogCount
()
getLogCount
()
;
})
})
;
const
appStore
=
useAppStore
();
const
appStore
=
useAppStore
();
const
{
domRef
,
updateOptions
}
=
useEcharts
(()
=>
({
const
{
domRef
,
updateOptions
}
=
useEcharts
(()
=>
({
tooltip
:
{
tooltip
:
{
trigger
:
'
axis
'
,
trigger
:
"
axis
"
,
axisPointer
:
{
axisPointer
:
{
type
:
'
cross
'
,
type
:
"
cross
"
,
label
:
{
label
:
{
backgroundColor
:
'
#6a7985
'
backgroundColor
:
"
#6a7985
"
,
}
}
,
}
}
,
},
},
legend
:
{
legend
:
{
data
:
[
$t
(
'
page.home.downloadCount
'
),
$t
(
'
page.home.registerCount
'
)]
data
:
[
$t
(
"
page.home.downloadCount
"
),
$t
(
"
page.home.registerCount
"
)],
},
},
grid
:
{
grid
:
{
left
:
'
3%
'
,
left
:
"
3%
"
,
right
:
'
4%
'
,
right
:
"
4%
"
,
bottom
:
'
3%
'
,
bottom
:
"
3%
"
,
containLabel
:
true
containLabel
:
true
,
},
},
xAxis
:
{
xAxis
:
{
type
:
'
category
'
,
type
:
"
category
"
,
boundaryGap
:
false
,
boundaryGap
:
false
,
data
:
[]
as
string
[]
data
:
[]
as
string
[]
,
},
},
yAxis
:
{
yAxis
:
{
type
:
'
value
'
type
:
"
value
"
,
},
},
series
:
[
series
:
[
{
{
color
:
'
#1872F0
'
,
color
:
"
#1872F0
"
,
name
:
$t
(
'
page.home.downloadCount
'
),
name
:
$t
(
"
page.home.downloadCount
"
),
type
:
'
line
'
,
type
:
"
line
"
,
smooth
:
true
,
smooth
:
true
,
stack
:
'
Total
'
,
stack
:
"
Total
"
,
areaStyle
:
{
areaStyle
:
{
color
:
{
color
:
{
type
:
'
linear
'
,
type
:
"
linear
"
,
x
:
0
,
x
:
0
,
y
:
0
,
y
:
0
,
x2
:
0
,
x2
:
0
,
...
@@ -185,29 +172,29 @@ const { domRef, updateOptions } = useEcharts(() => ({
...
@@ -185,29 +172,29 @@ const { domRef, updateOptions } = useEcharts(() => ({
colorStops
:
[
colorStops
:
[
{
{
offset
:
0.25
,
offset
:
0.25
,
color
:
'
#1872F0
'
color
:
"
#1872F0
"
,
},
},
{
{
offset
:
1
,
offset
:
1
,
color
:
'
#fff
'
color
:
"
#fff
"
,
}
}
,
]
]
,
}
}
,
},
},
emphasis
:
{
emphasis
:
{
focus
:
'
series
'
focus
:
"
series
"
,
},
},
data
:
[]
as
number
[]
data
:
[]
as
number
[]
,
},
},
{
{
color
:
'
#26deca
'
,
color
:
"
#26deca
"
,
name
:
$t
(
'
page.home.registerCount
'
),
name
:
$t
(
"
page.home.registerCount
"
),
type
:
'
line
'
,
type
:
"
line
"
,
smooth
:
true
,
smooth
:
true
,
stack
:
'
Total
'
,
stack
:
"
Total
"
,
areaStyle
:
{
areaStyle
:
{
color
:
{
color
:
{
type
:
'
linear
'
,
type
:
"
linear
"
,
x
:
0
,
x
:
0
,
y
:
0
,
y
:
0
,
x2
:
0
,
x2
:
0
,
...
@@ -215,36 +202,36 @@ const { domRef, updateOptions } = useEcharts(() => ({
...
@@ -215,36 +202,36 @@ const { domRef, updateOptions } = useEcharts(() => ({
colorStops
:
[
colorStops
:
[
{
{
offset
:
0.25
,
offset
:
0.25
,
color
:
'
#26deca
'
color
:
"
#26deca
"
,
},
},
{
{
offset
:
1
,
offset
:
1
,
color
:
'
#fff
'
color
:
"
#fff
"
,
}
}
,
]
]
,
}
}
,
},
},
emphasis
:
{
emphasis
:
{
focus
:
'
series
'
focus
:
"
series
"
,
},
},
data
:
[]
data
:
[]
,
}
}
,
]
]
,
}));
}));
async
function
mockData
()
{
async
function
mockData
()
{
await
new
Promise
(
resolve
=>
{
await
new
Promise
(
(
resolve
)
=>
{
setTimeout
(
resolve
,
1000
);
setTimeout
(
resolve
,
1000
);
});
});
updateOptions
(
opts
=>
{
updateOptions
(
(
opts
)
=>
{
[
[
{
{
label
:
"
10/15
"
,
label
:
"
10/15
"
,
num
:
502
num
:
502
,
},
},
// ?cvxccxvxcv
// ?cvxccxvxcv
]
]
;
// opts.xAxis.data = ['06:00', '08:00', '10:00', '12:00', '14:00', '16:00', '18:00', '20:00', '22:00', '24:00'];
// opts.xAxis.data = ['06:00', '08:00', '10:00', '12:00', '14:00', '16:00', '18:00', '20:00', '22:00', '24:00'];
// opts.series[0].data = [4623, 6145, 6268, 6411, 1890, 4251, 2978, 3880, 3606, 4311];
// opts.series[0].data = [4623, 6145, 6268, 6411, 1890, 4251, 2978, 3880, 3606, 4311];
// opts.series[1].data = [2208, 2016, 2916, 4512, 8281, 2008, 1963, 2367, 2956, 678];
// opts.series[1].data = [2208, 2016, 2916, 4512, 8281, 2008, 1963, 2367, 2956, 678];
...
...
src/views/home/modules/pie-chart-pro.vue
View file @
1f872198
...
@@ -15,12 +15,12 @@ const getCardData = async () => {
...
@@ -15,12 +15,12 @@ const getCardData = async () => {
updateOptions
((
opts
)
=>
{
updateOptions
((
opts
)
=>
{
opts
.
series
[
0
].
data
=
[
opts
.
series
[
0
].
data
=
[
{
{
name
:
`已启动
${
res
.
data
.
data
[
1
].
count
}
个`
,
name
:
`已启动
${
res
.
data
.
data
[
0
].
count
}
个`
,
value
:
res
.
data
.
data
[
1
].
count
,
value
:
res
.
data
.
data
[
0
].
count
,
},
},
{
{
name
:
`已停用
${
res
.
data
.
data
[
0
].
count
}
个`
,
name
:
`已停用
${
res
.
data
.
data
[
1
].
count
}
个`
,
value
:
res
.
data
.
data
[
0
].
count
,
value
:
res
.
data
.
data
[
1
].
count
,
},
},
];
];
return
opts
;
return
opts
;
...
...
src/views/home/modules/ring-chart.vue
View file @
1f872198
...
@@ -113,8 +113,8 @@ const getCardData = async () => {
...
@@ -113,8 +113,8 @@ const getCardData = async () => {
if
(
res
.
data
.
code
===
200
)
{
if
(
res
.
data
.
code
===
200
)
{
updateOptions
((
opts
)
=>
{
updateOptions
((
opts
)
=>
{
opts
.
series
[
0
].
data
=
[
opts
.
series
[
0
].
data
=
[
{
name
:
`已启动`
,
value
:
res
.
data
.
data
[
1
].
count
},
{
name
:
`已启动`
,
value
:
res
.
data
.
data
[
0
].
count
},
{
name
:
`已停用`
,
value
:
res
.
data
.
data
[
0
].
count
},
{
name
:
`已停用`
,
value
:
res
.
data
.
data
[
1
].
count
},
];
];
return
opts
;
return
opts
;
});
});
...
...
vite.config.ts
View file @
1f872198
import
process
from
'
node:process
'
;
import
process
from
"
node:process
"
;
import
{
URL
,
fileURLToPath
}
from
'
node:url
'
;
import
{
URL
,
fileURLToPath
}
from
"
node:url
"
;
import
{
defineConfig
,
loadEnv
}
from
'
vite
'
;
import
{
defineConfig
,
loadEnv
}
from
"
vite
"
;
import
{
setupVitePlugins
}
from
'
./build/plugins
'
;
import
{
setupVitePlugins
}
from
"
./build/plugins
"
;
import
{
createViteProxy
,
getBuildTime
}
from
'
./build/config
'
;
import
{
createViteProxy
,
getBuildTime
}
from
"
./build/config
"
;
// export const proxyTarget = 'http://192.168.3.248:9996'
;
export
const
proxyTarget
=
"
http://192.168.3.248:9996
"
;
export
const
proxyTarget
=
'
http://10.0.20.81:9996
'
;
// export const proxyTarget = "http://192.168.3.248:9996"
;
// export const proxyTarget = 'http://192.168.1.119:9996';
// export const proxyTarget = 'http://192.168.1.119:9996';
// export const proxyTarget = 'http://192.168.1.119:9996';
// export const proxyTarget = "http://192.168.2.188:9527";
// 视频地址
// 视频地址
export
const
videdUrl
=
'
ws://10.0.20.81:9999
'
;
export
const
videdUrl
=
"
ws://192.168.3.248:9999
"
;
// 固定接口地址
// 固定接口地址
export
const
apiUrl
=
'
http://10.0.20.81:9996
'
;
export
const
apiUrl
=
"
http://192.168.3.248:9996
"
;
// WS 地址
// WS 地址
export
const
wsUrl
=
'
ws://10.0.20.81:9999
'
;
export
const
wsUrl
=
"
ws://192.168.3.248:9996
"
;
export
default
defineConfig
(
configEnv
=>
{
export
default
defineConfig
((
configEnv
)
=>
{
const
viteEnv
=
loadEnv
(
const
viteEnv
=
loadEnv
(
configEnv
.
mode
,
process
.
cwd
())
as
unknown
as
Env
.
ImportMeta
;
configEnv
.
mode
,
process
.
cwd
(),
)
as
unknown
as
Env
.
ImportMeta
;
const
buildTime
=
getBuildTime
();
const
buildTime
=
getBuildTime
();
...
@@ -30,49 +30,49 @@ export default defineConfig(configEnv => {
...
@@ -30,49 +30,49 @@ export default defineConfig(configEnv => {
base
:
viteEnv
.
VITE_BASE_URL
,
base
:
viteEnv
.
VITE_BASE_URL
,
resolve
:
{
resolve
:
{
alias
:
{
alias
:
{
'
~
'
:
fileURLToPath
(
new
URL
(
'
./
'
,
import
.
meta
.
url
)),
"
~
"
:
fileURLToPath
(
new
URL
(
"
./
"
,
import
.
meta
.
url
)),
'
@
'
:
fileURLToPath
(
new
URL
(
'
./src
'
,
import
.
meta
.
url
))
"
@
"
:
fileURLToPath
(
new
URL
(
"
./src
"
,
import
.
meta
.
url
)),
}
}
,
},
},
css
:
{
css
:
{
preprocessorOptions
:
{
preprocessorOptions
:
{
scss
:
{
scss
:
{
additionalData
:
`@use "./src/styles/scss/global.scss" as *;`
additionalData
:
`@use "./src/styles/scss/global.scss" as *;`
,
}
}
,
}
}
,
},
},
plugins
:
setupVitePlugins
(
viteEnv
,
buildTime
),
plugins
:
setupVitePlugins
(
viteEnv
,
buildTime
),
define
:
{
define
:
{
BUILD_TIME
:
JSON
.
stringify
(
buildTime
)
BUILD_TIME
:
JSON
.
stringify
(
buildTime
)
,
},
},
server
:
{
server
:
{
host
:
'
0.0.0.0
'
,
host
:
"
0.0.0.0
"
,
port
:
9527
,
port
:
9527
,
open
:
true
,
open
:
true
,
// 集成别人封装的代理项 & 晶合项目的代理项
// 集成别人封装的代理项 & 晶合项目的代理项
proxy
:
{
proxy
:
{
...
createViteProxy
(
viteEnv
,
configEnv
.
command
===
'
serve
'
),
...
createViteProxy
(
viteEnv
,
configEnv
.
command
===
"
serve
"
),
// '/menus': 'http://192.168.1.102:9995/menus',
// '/menus': 'http://192.168.1.102:9995/menus',
// '/menus': 'http://192.168.1.173:10000/menus'
// '/menus': 'http://192.168.1.173:10000/menus'
'
/v1
'
:
{
"
/v1
"
:
{
target
:
proxyTarget
,
target
:
proxyTarget
,
changeOrigin
:
true
changeOrigin
:
true
,
}
}
,
},
},
fs
:
{
fs
:
{
cachedChecks
:
false
cachedChecks
:
false
,
}
}
,
},
},
preview
:
{
preview
:
{
port
:
9725
port
:
9725
,
},
},
build
:
{
build
:
{
reportCompressedSize
:
false
,
reportCompressedSize
:
false
,
sourcemap
:
viteEnv
.
VITE_SOURCE_MAP
===
'
Y
'
,
sourcemap
:
viteEnv
.
VITE_SOURCE_MAP
===
"
Y
"
,
commonjsOptions
:
{
commonjsOptions
:
{
ignoreTryCatch
:
false
ignoreTryCatch
:
false
,
}
}
,
}
}
,
};
};
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment