Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ai-yunshou-vue
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
AI云守
ai-yunshou-vue
Commits
6167f4bb
Commit
6167f4bb
authored
Aug 30, 2024
by
胡占生
🇨🇳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 算法解析增加loading框
parent
7ac8f091
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
src/main.js
src/main.js
+2
-1
src/utils/ruoyi.js
src/utils/ruoyi.js
+15
-1
src/views/algorithmList/components/websockt.js
src/views/algorithmList/components/websockt.js
+4
-1
No files found.
src/main.js
View file @
6167f4bb
...
@@ -25,7 +25,7 @@ import elementIcons from '@/components/SvgIcon/svgicon'
...
@@ -25,7 +25,7 @@ import elementIcons from '@/components/SvgIcon/svgicon'
import
'
./permission
'
// permission control
import
'
./permission
'
// permission control
import
{
useDict
}
from
'
@/utils/dict
'
import
{
useDict
}
from
'
@/utils/dict
'
import
{
parseTime
,
resetForm
,
addDateRange
,
handleTree
,
selectDictLabel
,
selectDictLabels
,
isNotEmpty
}
from
'
@/utils/ruoyi
'
import
{
parseTime
,
resetForm
,
addDateRange
,
handleTree
,
selectDictLabel
,
selectDictLabels
,
isNotEmpty
,
getFileType
}
from
'
@/utils/ruoyi
'
// 分页组件
// 分页组件
import
Pagination
from
'
@/components/Pagination
'
import
Pagination
from
'
@/components/Pagination
'
...
@@ -60,6 +60,7 @@ app.config.globalProperties.addDateRange = addDateRange
...
@@ -60,6 +60,7 @@ app.config.globalProperties.addDateRange = addDateRange
app
.
config
.
globalProperties
.
selectDictLabel
=
selectDictLabel
app
.
config
.
globalProperties
.
selectDictLabel
=
selectDictLabel
app
.
config
.
globalProperties
.
selectDictLabels
=
selectDictLabels
app
.
config
.
globalProperties
.
selectDictLabels
=
selectDictLabels
app
.
config
.
globalProperties
.
isNotEmpty
=
isNotEmpty
app
.
config
.
globalProperties
.
isNotEmpty
=
isNotEmpty
app
.
config
.
globalProperties
.
getFileType
=
getFileType
// 全局组件挂载
// 全局组件挂载
app
.
component
(
'
DictTag
'
,
DictTag
)
app
.
component
(
'
DictTag
'
,
DictTag
)
...
...
src/utils/ruoyi.js
View file @
6167f4bb
...
@@ -248,4 +248,18 @@ export function blobValidate(data) {
...
@@ -248,4 +248,18 @@ export function blobValidate(data) {
// 非空校验
// 非空校验
export
function
isNotEmpty
(
value
)
{
export
function
isNotEmpty
(
value
)
{
return
value
!==
null
&&
value
!==
undefined
&&
value
!==
''
;
return
value
!==
null
&&
value
!==
undefined
&&
value
!==
''
;
}
}
\ No newline at end of file
// 图片视频校验
export
function
getFileType
(
fileName
)
{
const
videoType
=
[
'
mp4
'
,
'
avi
'
,
'
mov
'
,
'
wmv
'
,
'
flv
'
,
'
mkv
'
,
'
rmvb
'
,
'
3gp
'
,
'
mpg
'
,
'
mpeg
'
,
'
webm
'
]
const
ImgType
=
[
'
jpg
'
,
'
jpeg
'
,
'
png
'
,
'
gif
'
,
'
bmp
'
,
'
tiff
'
,
'
webp
'
,]
let
fileType
=
fileName
.
split
(
"
.
"
).
pop
();
if
(
videoType
.
includes
(
fileType
))
{
return
"
1
"
;
}
if
(
ImgType
.
includes
(
fileType
))
{
return
"
0
"
;
}
}
src/views/algorithmList/components/websockt.js
View file @
6167f4bb
// mixins.js
// mixins.js
import
{
ref
}
from
'
vue
'
;
import
{
ref
}
from
'
vue
'
;
import
{
WebSocketManager
}
from
'
@/utils/webscoket
'
import
{
WebSocketManager
}
from
'
@/utils/webscoket
'
import
{
getFileType
}
from
'
@/utils/ruoyi
'
export
function
useWebSockets
()
{
export
function
useWebSockets
()
{
//定义初始值为0的变量,要使用ref方法赋值,直接赋值的话变量改变不会更新 UI
//定义初始值为0的变量,要使用ref方法赋值,直接赋值的话变量改变不会更新 UI
...
@@ -23,18 +24,20 @@ export function useWebSockets() {
...
@@ -23,18 +24,20 @@ export function useWebSockets() {
const
result
=
e
&&
JSON
.
parse
(
e
)
const
result
=
e
&&
JSON
.
parse
(
e
)
console
.
log
(
"
🚀 ~ websocketMessage ~ result:
"
,
result
)
console
.
log
(
"
🚀 ~ websocketMessage ~ result:
"
,
result
)
if
(
result
.
type
==
0
)
{
//获取sessionId
if
(
result
.
type
==
0
)
{
//获取sessionId
proxy
.
$modal
.
loading
(
"
正在检测中请稍后
"
);
client
.
value
.
sendMessage
({
client
.
value
.
sendMessage
({
sessionId
:
e
,
sessionId
:
e
,
algorithmType
:
roleId
,
algorithmType
:
roleId
,
algorithmId
:
roleId
,
algorithmId
:
roleId
,
fileType
:
uploadData
.
value
.
fileType
,
fileType
:
uploadData
.
value
.
fileType
,
type
:
0
,
//0 图片 1视频
type
:
getFileType
(
uploadData
.
value
.
fileName
)
,
//0 图片 1视频
filePath
:
uploadData
.
value
.
url
,
filePath
:
uploadData
.
value
.
url
,
fileName
:
uploadData
.
value
.
fileName
fileName
:
uploadData
.
value
.
fileName
})
})
}
else
if
(
result
.
type
==
2
)
{
}
else
if
(
result
.
type
==
2
)
{
const
queue
=
result
.
data
.
queue
.
indexOf
(
'
[
'
)
==
-
1
?
result
.
data
.
queue
:
JSON
.
parse
(
result
.
data
.
queue
);
const
queue
=
result
.
data
.
queue
.
indexOf
(
'
[
'
)
==
-
1
?
result
.
data
.
queue
:
JSON
.
parse
(
result
.
data
.
queue
);
outFilePath
.
value
=
result
.
data
.
outFilePath
;
outFilePath
.
value
=
result
.
data
.
outFilePath
;
proxy
.
$modal
.
closeLoading
();
if
(
!
queue
.
length
)
{
if
(
!
queue
.
length
)
{
proxy
.
$modal
.
msgWarning
(
"
未检测到预警
"
);
proxy
.
$modal
.
msgWarning
(
"
未检测到预警
"
);
resultStr
.
value
=
'
未检测到预警
'
;
resultStr
.
value
=
'
未检测到预警
'
;
...
...
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