Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
device-new-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
device-new-platform
Commits
7f7d0d5a
Commit
7f7d0d5a
authored
Feb 15, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加批量激活设备
parent
64515fa9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
4 deletions
+40
-4
device-manager-ui/admin/src/components/SearchForm.vue
device-manager-ui/admin/src/components/SearchForm.vue
+28
-3
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceApiController.java
...n/java/com/mortals/xhx/busiz/web/DeviceApiController.java
+10
-0
device-manager/src/main/resources/logback-spring.xml
device-manager/src/main/resources/logback-spring.xml
+2
-1
No files found.
device-manager-ui/admin/src/components/SearchForm.vue
View file @
7f7d0d5a
...
...
@@ -275,13 +275,12 @@ export default {
},
onSubmit
()
{
let
{
path
,
query
}
=
this
.
$route
;
let
data
=
this
.
decode
(
this
.
form
);
this
.
$router
.
push
({
path
:
path
,
query
:
Object
.
assign
({},
query
,
data
),
});
this
.
decodetwo
(
this
.
form
)
},
// 解析url字符串,去除query字段
encode
(
data
,
formTemp
)
{
...
...
@@ -290,7 +289,6 @@ export default {
if
(
/^query
\.
/
.
test
(
item
))
{
let
val
=
data
[
item
];
let
key
=
item
.
replace
(
/^query
\.
/
,
""
);
this
.
search
.
forEach
((
obj
)
=>
{
if
(
obj
.
name
===
key
&&
...
...
@@ -340,6 +338,33 @@ export default {
});
return
newData
;
},
decodetwo
(
data
)
{
Object
.
keys
(
data
).
forEach
((
item
)
=>
{
let
val
=
data
[
item
];
this
.
search
.
forEach
((
obj
)
=>
{
if
(
obj
.
name
===
item
&&
obj
.
fuzzy
===
true
&&
val
&&
val
.
length
>
0
)
{
//支持模糊查询,收尾增加百分号
val
=
val
.
trim
();
if
(
val
.
charAt
(
0
)
==
"
%
"
)
{
val
=
val
.
slice
(
1
);
}
if
(
val
.
charAt
(
val
.
length
-
1
)
==
"
%
"
)
{
val
=
val
+
"
%
"
;
}
}
});
newData
[
item
]
=
this
.
decodeVal
(
val
);
});
return
newData
;
},
decodeVal
(
val
)
{
let
valType
=
type
(
val
);
if
([
"
Number
"
,
"
Boolean
"
].
indexOf
(
valType
)
>
-
1
)
{
...
...
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceApiController.java
View file @
7f7d0d5a
...
...
@@ -61,6 +61,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.context.request.RequestAttributes
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
javax.servlet.http.HttpServletRequest
;
import
java.net.URL
;
...
...
@@ -141,6 +144,13 @@ public class DeviceApiController {
@PostMapping
(
"register"
)
public
String
register
(
@RequestBody
DeviceReq
req
)
{
log
.
info
(
"【设备注册】【请求体】--> "
+
JSONObject
.
toJSONString
(
req
));
RequestAttributes
requstAttr
=
RequestContextHolder
.
getRequestAttributes
();
HttpServletRequest
request
=
((
ServletRequestAttributes
)
requstAttr
).
getRequest
();
log
.
info
(
"request uri:{},request url:{}"
,
request
.
getRequestURI
(),
request
.
getRequestURL
());
//ServletUtil.
//ServletUtil.getClientIP()
ApiResp
<
DeviceResp
>
rsp
=
new
ApiResp
<>();
rsp
.
setCode
(
ApiRespCodeEnum
.
SUCCESS
.
getValue
());
DeviceResp
deviceResp
=
new
DeviceResp
();
...
...
device-manager/src/main/resources/logback-spring.xml
View file @
7f7d0d5a
...
...
@@ -23,8 +23,9 @@
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!-- 文件保存策略-->
<fileNamePattern>
${logFilePath}/${springApplicationName:-default}/${springApplicationName:-default}-info.log.%d{yyyyMMdd}
</fileNamePattern>
<cleanHistoryOnStart>
true
</cleanHistoryOnStart>
<!--日志文件保留天数-->
<MaxHistory>
7
</MaxHistory>
<MaxHistory>
15
</MaxHistory>
</rollingPolicy>
</appender>
<!-- 异常文件输出策略-->
...
...
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