Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
basic-uniapp-v3
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-uniapp-v3
Commits
258ed913
提交
258ed913
authored
12月 03, 2025
作者:
宇宙超人
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
样式修改
上级
ab875674
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
89 行增加
和
12 行删除
+89
-12
echarts.module.js
src/components/Echarts/src/echarts.module.js
+27
-1
index.vue
src/components/Echarts/src/index.vue
+6
-0
hook.ts
src/components/Map/Mapbox/hook.ts
+2
-2
index.ts
src/components/Map/Mapbox/index.ts
+3
-1
index.vue
src/components/Map/Mapbox/index.vue
+3
-1
mapbox.module.js
src/components/Map/Mapbox/mapbox.module.js
+34
-2
dailijizhang.vue
src/pages/fuwu/dailijizhang/dailijizhang.vue
+9
-0
yonggongmap.vue
src/pages/linghuoyonggong/components/yonggongmap.vue
+0
-0
myMessage.vue
src/pages/mine/components/myMessage.vue
+2
-3
WeatherForecast.vue
src/pages/nongchang/components/WeatherForecast.vue
+0
-0
index.vue
src/pages/nongchang/detail/index.vue
+1
-1
nongchang.vue
src/pages/nongchang/nongchang.vue
+0
-0
local-map.png
src/static/images/local-map.png
+0
-0
toLocal.png
src/static/images/toLocal.png
+0
-0
weather.ts
src/utils/weather.ts
+2
-1
没有找到文件。
src/components/Echarts/src/echarts.module.js
浏览文件 @
258ed913
...
@@ -31,6 +31,20 @@ export default {
...
@@ -31,6 +31,20 @@ export default {
return
return
}
}
// 处理tooltip formatter函数序列化问题
if
(
option
.
tooltip
&&
option
.
tooltip
.
formatter
)
{
const
formatterStr
=
option
.
tooltip
.
formatter
if
(
typeof
formatterStr
===
'string'
)
{
try
{
// 使用eval在视图层重新构建函数
// 支持箭头函数和普通函数
option
.
tooltip
.
formatter
=
eval
(
'('
+
formatterStr
+
')'
)
}
catch
(
e
)
{
// renderjs视图层不支持console,静默处理错误
}
}
}
this
.
option
=
merge
(
this
.
option
,
option
)
this
.
option
=
merge
(
this
.
option
,
option
)
if
(
typeof
window
.
echarts
===
'object'
&&
typeof
window
.
echarts
.
init
===
'function'
)
{
if
(
typeof
window
.
echarts
===
'object'
&&
typeof
window
.
echarts
.
init
===
'function'
)
{
this
.
init
()
this
.
init
()
...
@@ -40,5 +54,16 @@ export default {
...
@@ -40,5 +54,16 @@ export default {
})
})
}
}
},
},
// 添加update方法,在这里重新定义tooltip的formatter
update
()
{
// 确保图表实例存在
if
(
this
.
chart
)
{
// 重新设置option,确保tooltip formatter正确绑定
if
(
this
.
option
&&
this
.
option
.
tooltip
&&
typeof
this
.
option
.
tooltip
.
formatter
===
'function'
)
{
// 重新绑定formatter函数
this
.
chart
.
setOption
(
this
.
option
,
true
);
}
}
}
},
},
}
}
\ No newline at end of file
src/components/Echarts/src/index.vue
浏览文件 @
258ed913
...
@@ -15,6 +15,12 @@
...
@@ -15,6 +15,12 @@
},
},
methods
:
{
methods
:
{
setOption
(
option
)
{
setOption
(
option
)
{
// 处理tooltip formatter函数序列化
if
(
option
.
tooltip
&&
typeof
option
.
tooltip
.
formatter
===
'function'
)
{
// 将函数转换为字符串,在视图层重新构建
option
.
tooltip
.
formatter
=
option
.
tooltip
.
formatter
.
toString
()
}
this
.
option
=
{
this
.
option
=
{
id
:
this
.
id
,
id
:
this
.
id
,
...
option
,
...
option
,
...
...
src/components/Map/Mapbox/hook.ts
浏览文件 @
258ed913
...
@@ -80,8 +80,8 @@ export function useMapbox<T extends MapboxInstance, P extends MapboxConfig>(
...
@@ -80,8 +80,8 @@ export function useMapbox<T extends MapboxInstance, P extends MapboxConfig>(
getInstance
()?.
setLayoutProperty
(
layerId
,
name
,
value
),
getInstance
()?.
setLayoutProperty
(
layerId
,
name
,
value
),
setFilter
:
(
layerId
:
string
,
filter
:
any
[])
=>
getInstance
()?.
setFilter
(
layerId
,
filter
),
setFilter
:
(
layerId
:
string
,
filter
:
any
[])
=>
getInstance
()?.
setFilter
(
layerId
,
filter
),
flyTo
:
(
options
:
mapboxgl
.
FlyToOptions
)
=>
getInstance
()?.
flyTo
(
options
),
flyTo
:
(
options
:
mapboxgl
.
FlyToOptions
)
=>
getInstance
()?.
flyTo
(
options
),
addMarker
:
(
id
:
string
,
lnglat
:
[
number
,
number
],
popup
?:
string
,
popupDefaultOpen
?:
boolean
)
=>
addMarker
:
(
id
:
string
,
lnglat
:
[
number
,
number
],
popup
?:
string
,
popupDefaultOpen
?:
boolean
,
imageUrl
?:
string
,
iconSize
?:
[
number
,
number
]
)
=>
getInstance
()?.
addMarker
(
id
,
lnglat
,
popup
,
popupDefaultOpen
),
getInstance
()?.
addMarker
(
id
,
lnglat
,
popup
,
popupDefaultOpen
,
imageUrl
,
iconSize
),
removeMarker
:
(
id
:
string
)
=>
getInstance
()?.
removeMarker
(
id
),
removeMarker
:
(
id
:
string
)
=>
getInstance
()?.
removeMarker
(
id
),
removePopup
:
()
=>
getInstance
()?.
removePopup
(),
removePopup
:
()
=>
getInstance
()?.
removePopup
(),
loadImage
:
(
url
:
string
,
callback
:
(
error
:
Error
|
null
,
image
:
HTMLImageElement
)
=>
void
)
=>
loadImage
:
(
url
:
string
,
callback
:
(
error
:
Error
|
null
,
image
:
HTMLImageElement
)
=>
void
)
=>
...
...
src/components/Map/Mapbox/index.ts
浏览文件 @
258ed913
...
@@ -828,9 +828,11 @@ export interface MapboxInstance {
...
@@ -828,9 +828,11 @@ export interface MapboxInstance {
* @param lngLat 经纬度
* @param lngLat 经纬度
* @param popup 弹窗内容
* @param popup 弹窗内容
* @param popupDefaultOpen 是否默认打开弹窗
* @param popupDefaultOpen 是否默认打开弹窗
* @param imageUrl 自定义图标图片URL
* @param iconSize 图标大小 [width, height]
* @link https://docs.mapbox.com/mapbox-gl-js/api/markers/#marker
* @link https://docs.mapbox.com/mapbox-gl-js/api/markers/#marker
*/
*/
addMarker
(
id
:
string
,
lngLat
:
number
[],
popup
?:
string
,
popupDefaultOpen
?:
boolean
):
void
addMarker
(
id
:
string
,
lngLat
:
number
[],
popup
?:
string
,
popupDefaultOpen
?:
boolean
,
imageUrl
?:
string
,
iconSize
?:
[
number
,
number
]
):
void
/**
/**
* 移除 Marker
* 移除 Marker
* @param id Marker ID
* @param id Marker ID
...
...
src/components/Map/Mapbox/index.vue
浏览文件 @
258ed913
...
@@ -372,7 +372,7 @@
...
@@ -372,7 +372,7 @@
this
.
tryTriggerChange
()
this
.
tryTriggerChange
()
},
},
addMarker
(
id
,
lngLat
,
popup
,
popupDefaultOpen
)
{
addMarker
(
id
,
lngLat
,
popup
,
popupDefaultOpen
,
imageUrl
,
iconSize
)
{
// 加入到 change 事件队列中
// 加入到 change 事件队列中
this
.
changeOptionsQueue
.
push
({
this
.
changeOptionsQueue
.
push
({
fn
:
'addMarker'
,
fn
:
'addMarker'
,
...
@@ -380,6 +380,8 @@
...
@@ -380,6 +380,8 @@
lngLat
,
lngLat
,
popup
,
popup
,
popupDefaultOpen
,
popupDefaultOpen
,
imageUrl
,
iconSize
,
})
})
// 尝试触发 change 事件
// 尝试触发 change 事件
...
...
src/components/Map/Mapbox/mapbox.module.js
浏览文件 @
258ed913
...
@@ -73,6 +73,18 @@ window.onPopupContentEventHandle = function (e) {
...
@@ -73,6 +73,18 @@ window.onPopupContentEventHandle = function (e) {
}
}
}
}
// 全局暴露 navigateToDetail 方法,供 popup 中的按钮调用
window.navigateToDetail = function (data) {
if ($vm) {
// 调用逻辑层方法,通过 onEventHandle 传递事件
$vm.$ownerInstance.callMethod('onEventHandle', {
type: 'custom',
name: 'navigateToDetail',
data,
})
}
}
const defaultEmptyGeoJSON = {
const defaultEmptyGeoJSON = {
type: 'FeatureCollection',
type: 'FeatureCollection',
features: [],
features: [],
...
@@ -543,12 +555,32 @@ export default {
...
@@ -543,12 +555,32 @@ export default {
},
},
changeAddMarkerOptions(options) {
changeAddMarkerOptions(options) {
if (this.checkOnChangeValidity(options)) {
if (this.checkOnChangeValidity(options)) {
const { id, lngLat, popup, popupDefaultOpen, ...rest } = options
const { id, lngLat, popup, popupDefaultOpen,
element, imageUrl, iconSize,
...rest } = options
if (this.markers[id]) {
if (this.markers[id]) {
this.markers[id].remove()
this.markers[id].remove()
}
}
const marker = new window.mapboxgl.Marker({ scale: 0.8, ...rest }).setLngLat(lngLat).addTo(this.map)
let markerElement = element
// 如果提供了图片URL,创建自定义元素
if (imageUrl && !element) {
markerElement = document.createElement('div')
markerElement.className = 'custom-marker'
markerElement.style.backgroundImage = `
url
(
$
{
imageUrl
})
`
markerElement.style.width = iconSize ? `
$
{
iconSize
[
0
]}
px
` : '40px'
markerElement.style.height = iconSize ? `
$
{
iconSize
[
1
]}
px
` : '40px'
markerElement.style.backgroundSize = 'cover'
markerElement.style.borderRadius = '50%'
markerElement.style.cursor = 'pointer'
markerElement.style.border = '2px solid white'
markerElement.style.boxShadow = '0 2px 8px rgba(0,0,0,0.3)'
}
// 如果有自定义元素,使用它;否则使用默认配置
const marker = markerElement
? new window.mapboxgl.Marker(markerElement).setLngLat(lngLat).addTo(this.map)
: new window.mapboxgl.Marker({ scale: 0.8, ...rest }).setLngLat(lngLat).addTo(this.map)
if (popup) {
if (popup) {
const popupComponent = new window.mapboxgl.Popup({ options: { closeButton: true } }).setHTML(popup)
const popupComponent = new window.mapboxgl.Popup({ options: { closeButton: true } }).setHTML(popup)
marker.setPopup(popupComponent)
marker.setPopup(popupComponent)
...
...
src/pages/fuwu/dailijizhang/dailijizhang.vue
浏览文件 @
258ed913
...
@@ -3,6 +3,13 @@
...
@@ -3,6 +3,13 @@
function
onApplyClick
()
{
function
onApplyClick
()
{
Message
.
alert
(
'申请功能暂不可用,敬请期待~'
,
'温馨提示'
)
Message
.
alert
(
'申请功能暂不可用,敬请期待~'
,
'温馨提示'
)
}
}
// 查看大图
function
onViewImage
(
imageUrl
)
{
uni
.
previewImage
({
urls
:
[
imageUrl
]
})
}
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -167,11 +174,13 @@
...
@@ -167,11 +174,13 @@
<view
class=
"codefun-mt-18 codefun-flex-row equal-division_2"
>
<view
class=
"codefun-mt-18 codefun-flex-row equal-division_2"
>
<view
<view
class=
"codefun-flex-col codefun-justify-start codefun-items-center image-wrapper equal-division-item_2"
class=
"codefun-flex-col codefun-justify-start codefun-items-center image-wrapper equal-division-item_2"
@
click=
"onViewImage('/static/images/codefun/e10c098c837a0091dfe41ecd14dbaff5.png')"
>
>
<image
class=
"image_7"
src=
"/static/images/codefun/e10c098c837a0091dfe41ecd14dbaff5.png"
/>
<image
class=
"image_7"
src=
"/static/images/codefun/e10c098c837a0091dfe41ecd14dbaff5.png"
/>
</view>
</view>
<view
<view
class=
"codefun-flex-col codefun-justify-start codefun-items-center image-wrapper equal-division-item_2 ml-15"
class=
"codefun-flex-col codefun-justify-start codefun-items-center image-wrapper equal-division-item_2 ml-15"
@
click=
"onViewImage('/static/images/codefun/7ad157344b66cce4731d077aa759c0f9.png')"
>
>
<image
class=
"image_7"
src=
"/static/images/codefun/7ad157344b66cce4731d077aa759c0f9.png"
/>
<image
class=
"image_7"
src=
"/static/images/codefun/7ad157344b66cce4731d077aa759c0f9.png"
/>
</view>
</view>
...
...
src/pages/linghuoyonggong/components/yonggongmap.vue
浏览文件 @
258ed913
差异被折叠。
点击展开。
src/pages/mine/components/myMessage.vue
浏览文件 @
258ed913
...
@@ -92,7 +92,7 @@
...
@@ -92,7 +92,7 @@
{{
model
.
msg
.
phone
}}
{{
model
.
msg
.
phone
}}
</view>
</view>
</view>
</view>
<view
class=
"msgBox flex justify-between items-center text-30"
>
<
!--
<
view
class=
"msgBox flex justify-between items-center text-30"
>
<view
class=
"text-#999999"
>
邮箱
</view>
<view
class=
"text-#999999"
>
邮箱
</view>
<view
class=
"text-#333333"
>
<view
class=
"text-#333333"
>
{{
model
.
msg
.
email
}}
{{
model
.
msg
.
email
}}
...
@@ -106,7 +106,6 @@
...
@@ -106,7 +106,6 @@
align=
"right"
align=
"right"
:text=
"model.msg.orgCodeTxt ? `$
{model.msg.orgCodeTxt}` : '- -'"
:text=
"model.msg.orgCodeTxt ? `$
{model.msg.orgCodeTxt}` : '- -'"
/>
/>
<!--
{{
model
.
msg
.
orgCodeTxt
?
model
.
msg
.
orgCodeTxt
:
'- -'
}}
-->
</view>
</view>
</view>
</view>
<view
class=
"msgBox lastBox flex justify-between items-center text-30"
>
<view
class=
"msgBox lastBox flex justify-between items-center text-30"
>
...
@@ -114,7 +113,7 @@
...
@@ -114,7 +113,7 @@
<view
class=
"text-#333333"
>
<view
class=
"text-#333333"
>
{{
model
.
msg
.
postText
?
model
.
msg
.
postText
:
'- -'
}}
{{
model
.
msg
.
postText
?
model
.
msg
.
postText
:
'- -'
}}
</view>
</view>
</view>
</view>
-->
</view>
</view>
</view>
</view>
</
template
>
</
template
>
...
...
src/pages/nongchang/components/WeatherForecast.vue
浏览文件 @
258ed913
差异被折叠。
点击展开。
src/pages/nongchang/detail/index.vue
浏览文件 @
258ed913
...
@@ -440,7 +440,7 @@
...
@@ -440,7 +440,7 @@
<view
class=
"box-4"
>
<view
class=
"box-4"
>
<view
class=
"box-4-title"
>
<view
class=
"box-4-title"
>
<view
class=
"box-4-title-text1"
><text>
基地设备
</text></view>
<view
class=
"box-4-title-text1"
><text>
基地设备
</text></view>
<
view
class=
"box-4-title-text2"
><text>
+ 添加设备
</text></view
>
<
navigator
url=
"/pages/device/device"
class=
"box-4-title-text2"
><text>
+ 添加设备
</text></navigator
>
</view>
</view>
<view
class=
"box-4-device"
>
<view
class=
"box-4-device"
>
<view
class=
"box-4-device-item"
v-for=
"(device, index) in model.deviceTypeCount"
:key=
"index"
>
<view
class=
"box-4-device-item"
v-for=
"(device, index) in model.deviceTypeCount"
:key=
"index"
>
...
...
src/pages/nongchang/nongchang.vue
浏览文件 @
258ed913
差异被折叠。
点击展开。
src/static/images/local-map.png
0 → 100644
浏览文件 @
258ed913
1.5 KB
src/static/images/toLocal.png
0 → 100644
浏览文件 @
258ed913
1.3 KB
src/utils/weather.ts
浏览文件 @
258ed913
...
@@ -144,7 +144,8 @@ export function getDayLabelValue(index: number) {
...
@@ -144,7 +144,8 @@ export function getDayLabelValue(index: number) {
}
else
if
(
index
===
1
)
{
}
else
if
(
index
===
1
)
{
dayLabel
=
'明天'
dayLabel
=
'明天'
}
else
{
}
else
{
dayLabel
=
dayjs
().
day
(
dayOfWeek
).
format
(
'dddd'
)
const
weekdays
=
[
'周日'
,
'周一'
,
'周二'
,
'周三'
,
'周四'
,
'周五'
,
'周六'
]
dayLabel
=
weekdays
[
dayOfWeek
]
}
}
return
{
return
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论