Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
GaoQuYingJiH5-SDT
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
xinzhedeai
GaoQuYingJiH5-SDT
Commits
2f0a7883
Commit
2f0a7883
authored
Mar 18, 2024
by
xinzhedeai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
隐患列表删除
parent
eb1ba113
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
4 deletions
+47
-4
common.js
js/common.js
+1
-2
http.js
js/http.js
+21
-0
yh-list.html
views/yh-list.html
+2
-2
yh-list.js
views/yh-list.js
+23
-0
No files found.
js/common.js
View file @
2f0a7883
...
...
@@ -47,8 +47,7 @@ var userInfo = {
}
}
var
token
=
"
Bearer eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiI5OGI1OGIwYjRlYmY0Nzg4YjQyM2VmMjVmYzkwYWE4NCIsInVzZXIiOiJhZG1pbiIsInN1YiI6ImFkbWluIn0.c-gsRfSGfkQuaLr2BTVfJuAhE-i8imzawovC56O3UEUVYsZW8XJ9RYgIE65M8n77z6YNmrXGysqdP8vCgRVyag
"
;
var
token
=
"
Bearer eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiJjNTliYWZjYTdiOWQ0MzA2ODYzNDE4N2MwMGRlZGU1NCIsInVzZXIiOiJhZG1pbiIsInN1YiI6ImFkbWluIn0.U8gezo_te7BGJMUfLsa9dKxshyPAdDSkkYAkLHJ2xYQMxwMUlvMgpCkX6xRXJfzwJSscHaMqPgQinL445sq2lQ
"
;
localStorage
.
setItem
(
'
Authorization
'
,
token
)
localStorage
.
setItem
(
'
appCounty
'
,
userInfo
.
user
.
county
)
...
...
js/http.js
View file @
2f0a7883
...
...
@@ -68,6 +68,27 @@ var http = {
})
})
},
delete
:
function
(
url
,
params
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
axios
.
delete
(
url
,
{
// params: params
...
params
})
.
then
(
res
=>
{
let
response
=
res
.
data
console
.
log
(
'
res.statusCode
'
,
response
)
if
(
response
.
statusCode
>=
300
){
// alert('系统发生错误')
return
}
resolve
(
res
.
data
)
})
.
catch
(
err
=>
{
reject
(
err
.
data
)
})
})
},
postFile
:
function
(
url
,
params
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
axios
({
...
...
views/yh-list.html
View file @
2f0a7883
...
...
@@ -22,7 +22,7 @@
</div>
<div
class=
"content"
v-cloak
>
<van-list
v-model:loading=
"loading"
:offset=
"10"
:finished=
"finished"
finished-text=
"没有更多了"
@
load=
"getList"
>
<van-cell
v-for=
"
item
in list"
:key=
"item"
>
<van-cell
v-for=
"
(item, index)
in list"
:key=
"item"
>
<div
class=
"list-item-wrapper"
>
<p
class=
""
>
<span
id=
""
>
...
...
@@ -44,7 +44,7 @@
<div
class=
"list-function-btn-wrapper pd-01rem"
>
<van-button
type=
"info"
size=
"mini"
@
click=
"detail(item)"
>
查看
</van-button>
<van-button
type=
"info"
size=
"mini"
@
click=
"edit(item)"
>
编辑
</van-button>
<van-button
type=
"info"
size=
"mini"
>
删除
</van-button>
<van-button
type=
"info"
size=
"mini"
@
click=
"del(item, index)"
>
删除
</van-button>
<van-button
type=
"info"
size=
"mini"
>
导出
</van-button>
</div>
</div>
...
...
views/yh-list.js
View file @
2f0a7883
...
...
@@ -20,6 +20,29 @@ window.addEventListener("load", function() {
this
.
getList
()
},
methods
:
{
del
(
item
,
index
){
console
.
log
(
item
)
vant
.
Dialog
.
confirm
({
title
:
'
信息提示
'
,
message
:
'
此操作将删除所选项,确认删除?
'
,
})
.
then
(()
=>
{
// on confirm
http
.
post
(
'
/api/thHiddenDanger/delete
'
,{
id
:
[
item
.
hdId
]
}).
then
((
res
)
=>
{
vant
.
Toast
({
message
:
'
操作成功
'
,
})
this
.
list
.
splice
(
index
,
1
);
this
.
loading
=
false
;
// 加载状态结束
})
})
.
catch
(()
=>
{
// on cancel
});
},
nav
(
item
){
// location.href='./yh-list.html'
},
...
...
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