Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
GaoQuYingJiH5-ASD
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-ASD
Commits
034023ed
Commit
034023ed
authored
Apr 07, 2025
by
lei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add:隐患列表接口
parent
b9776da9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
217 additions
and
194 deletions
+217
-194
axios_http.js
sdk/axios_http.js
+1
-1
_shanghu_detail.js
src/_shanghu_detail.js
+129
-119
_yh-check.html
src/_yh-check.html
+7
-7
_yh-check.js
src/_yh-check.js
+80
-67
No files found.
sdk/axios_http.js
View file @
034023ed
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* 请求拦截、相应拦截、错误统一处理
* 请求拦截、相应拦截、错误统一处理
*/
*/
// 环境的切换
// 环境的切换
axios
.
defaults
.
baseURL
=
'
http://192.168.2.
16
:8080
'
axios
.
defaults
.
baseURL
=
'
http://192.168.2.
37
:8080
'
axios
.
defaults
.
timeout
=
50000
axios
.
defaults
.
timeout
=
50000
// post请求头
// post请求头
// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
...
...
src/_shanghu_detail.js
View file @
034023ed
// 在原有Vue实例中添加
var
VUE
=
null
new
Vue
({
window
.
addEventListener
(
'
load
'
,
function
()
{
// 在原有Vue实例中添加
new
Vue
({
el
:
'
#app
'
,
el
:
'
#app
'
,
data
()
{
data
()
{
return
{
return
{
...
@@ -23,99 +25,107 @@ new Vue({
...
@@ -23,99 +25,107 @@ new Vue({
methods
:
{
methods
:
{
// 新增选择确认方法
// 新增选择确认方法
onConfirmType
(
value
)
{
onConfirmType
(
value
)
{
this
.
formData
.
type
=
value
;
this
.
formData
.
type
=
value
this
.
showTypePicker
=
false
;
this
.
showTypePicker
=
false
},
},
viewDetail
(
id
)
{
viewDetail
(
id
)
{
console
.
log
(
'
查看详情:
'
,
id
);
console
.
log
(
'
查看详情:
'
,
id
)
// 这里添加跳转逻辑
// 这里添加跳转逻辑
},
},
})
})
const
QR_IMAGE_URL
=
'
http://pic.616pic.com/ys_img/00/10/41/bL9gkesSxm.jpg
'
let
canvasReady
=
false
let
loadedImages
=
0
// 将canvas初始化代码包裹在DOMContentLoaded事件中
document
.
addEventListener
(
'
DOMContentLoaded
'
,
function
()
{
const
canvas
=
document
.
getElementById
(
'
mainCanvas
'
)
if
(
!
canvas
)
{
console
.
error
(
'
未找到mainCanvas元素
'
)
return
}
}
const
ctx
=
canvas
.
getContext
(
'
2d
'
)
// 设置canvas尺寸(根据实际需求调整)
canvas
.
width
=
300
// 新增宽度设置
canvas
.
height
=
300
// 新增高度设置
// 加载二维码图片
const
img
=
new
Image
()
img
.
crossOrigin
=
'
Anonymous
'
// 处理跨域问题
img
.
src
=
'
../image/code/erweima.png
'
// QR_IMAGE_URL;
const
img4erweima
=
new
Image
()
img4erweima
.
crossOrigin
=
'
Anonymous
'
// 处理跨域问题
img4erweima
.
src
=
QR_IMAGE_URL
// QR_IMAGE_URL;
img
.
onload
=
function
()
{
loadedImages
++
drawImages
()
}
}
});
<
/script>
<
img4erweima
.
onload
=
function
()
{
script
>
loadedImages
++
const
QR_IMAGE_URL
=
'
http://pic.616pic.com/ys_img/00/10/41/bL9gkesSxm.jpg
'
;
drawImages
()
let
canvasReady
=
false
;
}
// 记录已加载的图片数量
let
loadedImages
=
0
;
function
drawImages
()
{
const
canvas
=
document
.
getElementById
(
'
mainCanvas
'
);
const
ctx
=
canvas
.
getContext
(
'
2d
'
);
// 加载二维码图片
const
img
=
new
Image
();
img
.
crossOrigin
=
"
Anonymous
"
;
// 处理跨域问题
img
.
src
=
'
../image/code/erweima.png
'
;
// QR_IMAGE_URL;
const
img4erweima
=
new
Image
();
img4erweima
.
crossOrigin
=
"
Anonymous
"
;
// 处理跨域问题
img4erweima
.
src
=
QR_IMAGE_URL
;
// QR_IMAGE_URL;
img
.
onload
=
function
()
{
loadedImages
++
;
drawImages
();
};
img4erweima
.
onload
=
function
()
{
loadedImages
++
;
drawImages
();
};
function
drawImages
()
{
if
(
loadedImages
===
2
)
{
if
(
loadedImages
===
2
)
{
// 画布的宽度和高度
// 画布的宽度和高度
const
canvasWidth
=
canvas
.
width
;
const
canvasWidth
=
canvas
.
width
const
canvasHeight
=
canvas
.
height
;
const
canvasHeight
=
canvas
.
height
// 图片的原始宽度和高度
// 图片的原始宽度和高度
const
imgWidth
=
img
.
width
;
const
imgWidth
=
img
.
width
const
imgHeight
=
img
.
height
;
const
imgHeight
=
img
.
height
// 计算宽度和高度的缩放比例
// 计算宽度和高度的缩放比例
const
scaleX
=
canvasWidth
/
imgWidth
;
const
scaleX
=
canvasWidth
/
imgWidth
const
scaleY
=
canvasHeight
/
imgHeight
;
const
scaleY
=
canvasHeight
/
imgHeight
// 取较小的缩放比例作为最终的缩放比例
// 取较小的缩放比例作为最终的缩放比例
const
scale
=
Math
.
min
(
scaleX
,
scaleY
);
const
scale
=
Math
.
min
(
scaleX
,
scaleY
)
// 计算缩放后的图片宽度和高度
// 计算缩放后的图片宽度和高度
const
scaledWidth
=
imgWidth
*
scale
;
const
scaledWidth
=
imgWidth
*
scale
const
scaledHeight
=
imgHeight
*
scale
;
const
scaledHeight
=
imgHeight
*
scale
// 计算图片在画布上的绘制位置,使其居中显示
// 计算图片在画布上的绘制位置,使其居中显示
const
x
=
(
canvasWidth
-
scaledWidth
)
/
2
;
const
x
=
(
canvasWidth
-
scaledWidth
)
/
2
const
y
=
(
canvasHeight
-
scaledHeight
)
/
2
;
const
y
=
(
canvasHeight
-
scaledHeight
)
/
2
// 绘制图片到 canvas 上
// 绘制图片到 canvas 上
ctx
.
drawImage
(
img
,
x
,
y
,
scaledWidth
,
scaledHeight
);
ctx
.
drawImage
(
img
,
x
,
y
,
scaledWidth
,
scaledHeight
)
// 绘制前景图标
// 绘制前景图标
const
fgIconSize
=
150
;
// 假设前景图标显示的尺寸
const
fgIconSize
=
150
// 假设前景图标显示的尺寸
const
fgX
=
(
canvasWidth
-
fgIconSize
)
/
2
;
const
fgX
=
(
canvasWidth
-
fgIconSize
)
/
2
const
fgY
=
(
canvasHeight
-
fgIconSize
)
/
2
;
const
fgY
=
(
canvasHeight
-
fgIconSize
)
/
2
// 绘制二维码
// 绘制二维码
ctx
.
drawImage
(
img4erweima
,
fgX
,
fgY
,
fgIconSize
,
fgIconSize
);
ctx
.
drawImage
(
img4erweima
,
fgX
,
fgY
,
fgIconSize
,
fgIconSize
)
canvasReady
=
true
;
canvasReady
=
true
}
}
}
}
})
function
saveCanvas
()
{
function
saveCanvas
()
{
if
(
!
canvasReady
)
return
;
if
(
!
canvasReady
)
return
const
canvas
=
document
.
getElementById
(
'
mainCanvas
'
);
const
canvas
=
document
.
getElementById
(
'
mainCanvas
'
)
const
dataURL
=
canvas
.
toDataURL
(
'
image/png
'
);
const
dataURL
=
canvas
.
toDataURL
(
'
image/png
'
)
console
.
log
(
dataURL
,
'
图片下载
'
)
console
.
log
(
dataURL
,
'
图片下载
'
)
lightAppJssdk
.
media
.
savePhoto
({
lightAppJssdk
.
media
.
savePhoto
({
arg
:
dataURL
,
arg
:
dataURL
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
alert
(
JSON
.
stringify
(
data
));
alert
(
JSON
.
stringify
(
data
))
},
},
fail
:
function
(
data
)
{
fail
:
function
(
data
)
{
alert
(
data
);
alert
(
data
)
}
},
});
})
}
}
src/_yh-check.html
View file @
034023ed
...
@@ -28,11 +28,11 @@
...
@@ -28,11 +28,11 @@
<!-- Tab栏 -->
<!-- Tab栏 -->
<van-tabs
v-model:active=
"activeTab"
title-active-color=
"#1989fa"
line-height=
"2px"
<van-tabs
v-model:active=
"activeTab"
title-active-color=
"#1989fa"
line-height=
"2px"
style=
"margin-bottom: 15px;"
>
style=
"margin-bottom: 15px;"
>
<van-tab
title=
"全部"
></van-tab>
<van-tab
title=
"全部"
name=
""
></van-tab>
<van-tab
title=
"待审核"
></van-tab>
<van-tab
title=
"待审核"
name=
"2"
></van-tab>
<van-tab
title=
"待整改"
></van-tab>
<van-tab
title=
"待整改"
name=
"0"
></van-tab>
<van-tab
title=
"已整改"
></van-tab>
<van-tab
title=
"已整改"
name=
"1"
></van-tab>
<van-tab
title=
"整改逾期"
></van-tab>
<van-tab
title=
"整改逾期"
name=
"3"
></van-tab>
</van-tabs>
</van-tabs>
<!-- 隐患列表 -->
<!-- 隐患列表 -->
...
@@ -56,13 +56,13 @@
...
@@ -56,13 +56,13 @@
{{ item.status }}
{{ item.status }}
</van-tag>
</van-tag>
<span
<span
style=
"color: #737373; font-size: 0.28rem;margin-left: -1.6rem;"
>
检查时间:{{ item.
d
ate }}
</span>
style=
"color: #737373; font-size: 0.28rem;margin-left: -1.6rem;"
>
检查时间:{{ item.
checkD
ate }}
</span>
<van-icon
name=
"arrow"
class=
"navToBtn"
@
click=
"viewDetail(item.id)"
/>
<van-icon
name=
"arrow"
class=
"navToBtn"
@
click=
"viewDetail(item.id)"
/>
</div>
</div>
<!-- 第三行:商家和箭头 -->
<!-- 第三行:商家和箭头 -->
<div
style=
"display: flex; justify-content: space-between; align-items: center;"
>
<div
style=
"display: flex; justify-content: space-between; align-items: center;"
>
<span
style=
"color: #666; font-size: 0.28rem;"
>
商家名称:威海市宝威酒店有限公司{{ item.shop
}}
</span>
<span
style=
"color: #666; font-size: 0.28rem;"
>
所属任务:{{ item.typeName
}}
</span>
</div>
</div>
</div>
</div>
</van-cell>
</van-cell>
...
...
src/_yh-check.js
View file @
034023ed
var
VUE
=
null
var
VUE
=
null
window
.
addEventListener
(
"
load
"
,
function
()
{
window
.
addEventListener
(
'
load
'
,
function
()
{
VUE
=
new
Vue
({
VUE
=
new
Vue
({
// 在原有Vue实例中添加
// 在原有Vue实例中添加
el
:
'
#app
'
,
el
:
'
#app
'
,
...
@@ -8,13 +8,14 @@ window.addEventListener("load", function() {
...
@@ -8,13 +8,14 @@ window.addEventListener("load", function() {
shanghuName
:
''
,
shanghuName
:
''
,
// 新增子Tab数据
// 新增子Tab数据
subActiveTab
:
0
,
subActiveTab
:
0
,
hazardList
:
[{
hazardList
:
[
{
id
:
1
,
id
:
1
,
description
:
'
消防通道被货物堵塞,存在严重安全隐患
'
,
description
:
'
消防通道被货物堵塞,存在严重安全隐患
'
,
status
:
'
待审核
'
,
status
:
'
待审核
'
,
date
:
'
2024-03-15
'
,
date
:
'
2024-03-15
'
,
shop
:
'
XX餐饮店
'
,
shop
:
'
XX餐饮店
'
,
type
:
2
type
:
2
,
},
},
{
{
id
:
2
,
id
:
2
,
...
@@ -22,47 +23,59 @@ window.addEventListener("load", function() {
...
@@ -22,47 +23,59 @@ window.addEventListener("load", function() {
status
:
'
待整改
'
,
status
:
'
待整改
'
,
date
:
'
2024-03-15
'
,
date
:
'
2024-03-15
'
,
shop
:
'
XX餐饮店
'
,
shop
:
'
XX餐饮店
'
,
type
:
2
type
:
2
,
},
},
// 更多示例数据...
// 更多示例数据...
],
],
activeTab
:
0
,
activeTab
:
''
,
}
}
},
},
computed
:
{
computed
:
{
filteredHazards
()
{
filteredHazards
()
{
const
statusMap
=
[
'
全部
'
,
'
待审核
'
,
'
待整改
'
,
'
已整改
'
];
const
statusMap
=
[
'
全部
'
,
'
待审核
'
,
'
待整改
'
,
'
已整改
'
]
return
this
.
hazardList
.
filter
(
item
=>
return
this
.
hazardList
.
filter
((
item
)
=>
this
.
subActiveTab
===
0
?
true
:
item
.
status
===
statusMap
[
this
.
subActiveTab
]
this
.
subActiveTab
===
0
);
?
true
}
:
item
.
status
===
statusMap
[
this
.
subActiveTab
]
)
},
},
created
()
{
this
.
init
()
},
},
methods
:
{
methods
:
{
init
()
{
this
.
getHazardList
()
},
onSearch
()
{
onSearch
()
{
console
.
log
(
'
xxxx
'
)
console
.
log
(
'
xxxx
'
)
},
},
// 新增选择确认方法
// 新增选择确认方法
onConfirmType
(
value
)
{
onConfirmType
(
value
)
{
this
.
formData
.
type
=
value
;
this
.
formData
.
type
=
value
this
.
showTypePicker
=
false
;
this
.
showTypePicker
=
false
},
onConfirmTime
(
time
)
{
this
.
formData
.
businessHours
=
time
;
this
.
showTimePicker
=
false
;
},
},
statusTagType
(
status
)
{
statusTagType
(
status
)
{
const
types
=
{
const
types
=
{
'
待审核
'
:
'
warning
'
,
待审核
:
'
warning
'
,
'
待整改
'
:
'
primary
'
,
待整改
:
'
primary
'
,
'
已整改
'
:
'
success
'
,
已整改
:
'
success
'
,
'
整改逾期
'
:
'
danger
'
,
整改逾期
:
'
danger
'
,
};
}
return
types
[
status
]
||
''
;
return
types
[
status
]
||
''
},
},
viewDetail
(
id
)
{
viewDetail
(
id
)
{
console
.
log
(
'
查看详情:
'
,
id
);
console
.
log
(
'
查看详情:
'
,
id
)
// 这里添加跳转逻辑
// 这里添加跳转逻辑
}
},
}
//获取隐患列表数据
});
getHazardList
()
{
http
.
get
(
'
/gq/hiddenDanger/list?merId=1&status=
'
+
this
.
activeTab
)
.
then
((
res
)
=>
{
console
.
log
(
res
)
})
},
},
})
})
})
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