Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
basic-uniapp-v3
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-uniapp-v3
Commits
4b730fe6
提交
4b730fe6
authored
11月 12, 2025
作者:
吴佳伟
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 修复打包后地区字典数据无法获取问题
上级
3dcec200
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
26 行增加
和
23 行删除
+26
-23
purchaseXuQiu.vue
src/pages/chanxiao/purchaseXuQiu.vue
+3
-3
supplyXuQiu.vue
src/pages/chanxiao/supplyXuQiu.vue
+3
-3
form.vue
src/pages/linghuoyonggong/form.vue
+3
-3
apply-dialog.vue
src/pages/nongjifuwu/components/apply-dialog.vue
+2
-2
farm-form.vue
src/pages/nongjifuwu/farm-form.vue
+3
-3
machine-form.vue
src/pages/nongjifuwu/machine-form.vue
+3
-3
nongjifuwu.vue
src/pages/nongjifuwu/nongjifuwu.vue
+3
-3
area.ts
src/utils/dict/area.ts
+6
-3
没有找到文件。
src/pages/chanxiao/purchaseXuQiu.vue
浏览文件 @
4b730fe6
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
import
{
useGlobSetting
}
from
'/@/hooks/setting'
import
{
useGlobSetting
}
from
'/@/hooks/setting'
import
*
as
ChanxiaoAPI
from
'@/api/model/chanxiao'
import
*
as
ChanxiaoAPI
from
'@/api/model/chanxiao'
import
*
as
UserInfoAPI
from
'@/api/model/userInfo'
import
*
as
UserInfoAPI
from
'@/api/model/userInfo'
import
{
areaOptions
,
getText
}
from
'@/utils/dict/area'
import
{
getDictData
,
getText
}
from
'@/utils/dict/area'
import
{
useDictStore
}
from
'@/store/modules/dict'
import
{
useDictStore
}
from
'@/store/modules/dict'
const
dictStore
=
useDictStore
()
const
dictStore
=
useDictStore
()
...
@@ -109,14 +109,14 @@
...
@@ -109,14 +109,14 @@
const
{
show
,
options
,
form
}
=
toRefs
(
pageData
)
const
{
show
,
options
,
form
}
=
toRefs
(
pageData
)
function
initDict
()
{
async
function
initDict
()
{
pageData
.
options
.
classify
=
dictStore
.
getDictList
.
classify
.
map
((
item
)
=>
{
pageData
.
options
.
classify
=
dictStore
.
getDictList
.
classify
.
map
((
item
)
=>
{
return
{
return
{
value
:
item
.
value
,
value
:
item
.
value
,
text
:
item
.
text
,
text
:
item
.
text
,
}
}
})
})
pageData
.
options
.
address
=
a
reaOptions
pageData
.
options
.
address
=
a
wait
getDictData
()
}
}
function
getCurrentAddressInfo
()
{
function
getCurrentAddressInfo
()
{
...
...
src/pages/chanxiao/supplyXuQiu.vue
浏览文件 @
4b730fe6
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
import
{
useGlobSetting
}
from
'/@/hooks/setting'
import
{
useGlobSetting
}
from
'/@/hooks/setting'
import
*
as
ChanxiaoAPI
from
'@/api/model/chanxiao'
import
*
as
ChanxiaoAPI
from
'@/api/model/chanxiao'
import
*
as
UserInfoAPI
from
'@/api/model/userInfo'
import
*
as
UserInfoAPI
from
'@/api/model/userInfo'
import
{
areaOptions
,
getText
}
from
'@/utils/dict/area'
import
{
getDictData
,
getText
}
from
'@/utils/dict/area'
import
{
useDictStore
}
from
'@/store/modules/dict'
import
{
useDictStore
}
from
'@/store/modules/dict'
const
dictStore
=
useDictStore
()
const
dictStore
=
useDictStore
()
...
@@ -123,8 +123,8 @@
...
@@ -123,8 +123,8 @@
const
{
show
,
options
,
form
}
=
toRefs
(
pageData
)
const
{
show
,
options
,
form
}
=
toRefs
(
pageData
)
function
initDict
()
{
async
function
initDict
()
{
pageData
.
options
.
address
=
a
reaOptions
pageData
.
options
.
address
=
a
wait
getDictData
()
pageData
.
options
.
status
=
dictStore
.
getDictList
.
purchase_status
.
map
((
item
)
=>
{
pageData
.
options
.
status
=
dictStore
.
getDictList
.
purchase_status
.
map
((
item
)
=>
{
return
{
return
{
...
...
src/pages/linghuoyonggong/form.vue
浏览文件 @
4b730fe6
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
import
*
as
UserInfoAPI
from
'@/api/model/userInfo'
import
*
as
UserInfoAPI
from
'@/api/model/userInfo'
import
{
areaTree
,
getCodeByText
,
getTextByCode
}
from
'@/utils/areaData'
import
{
areaTree
,
getCodeByText
,
getTextByCode
}
from
'@/utils/areaData'
import
{
useDictStore
}
from
'@/store/modules/dict'
import
{
useDictStore
}
from
'@/store/modules/dict'
import
{
areaOptions
}
from
'@/utils/dict/area'
import
{
getDictData
}
from
'@/utils/dict/area'
const
dictStore
=
useDictStore
()
const
dictStore
=
useDictStore
()
const
userStore
=
useUserStore
()
const
userStore
=
useUserStore
()
...
@@ -113,8 +113,8 @@
...
@@ -113,8 +113,8 @@
const
{
show
,
options
,
form
}
=
toRefs
(
pageData
)
const
{
show
,
options
,
form
}
=
toRefs
(
pageData
)
function
initDict
()
{
async
function
initDict
()
{
pageData
.
options
.
area
=
a
reaOptions
pageData
.
options
.
area
=
a
wait
getDictData
()
pageData
.
options
.
urgentdegree
=
dictStore
.
getDictList
.
employment_urgent
.
map
((
item
)
=>
{
pageData
.
options
.
urgentdegree
=
dictStore
.
getDictList
.
employment_urgent
.
map
((
item
)
=>
{
return
{
return
{
value
:
item
.
value
,
value
:
item
.
value
,
...
...
src/pages/nongjifuwu/components/apply-dialog.vue
浏览文件 @
4b730fe6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
{
reactive
}
from
'vue'
import
{
reactive
}
from
'vue'
import
*
as
NongjifuwuAPI
from
'@/api/model/nongjifuwu'
import
*
as
NongjifuwuAPI
from
'@/api/model/nongjifuwu'
import
{
useUserStore
}
from
'@/store/modules/user'
import
{
useUserStore
}
from
'@/store/modules/user'
import
{
areaOptions
,
getText
}
from
'@/utils/dict/area'
import
{
getDictData
,
getText
}
from
'@/utils/dict/area'
const
{
getUserInfo
}
=
useUserStore
()
const
{
getUserInfo
}
=
useUserStore
()
...
@@ -119,7 +119,7 @@
...
@@ -119,7 +119,7 @@
pageData
.
areaShow
.
address
=
false
pageData
.
areaShow
.
address
=
false
}
}
onShow
(()
=>
{
onShow
(()
=>
{
pageData
.
options
=
areaOptions
pageData
.
options
=
getDictData
()
})
})
defineExpose
({
defineExpose
({
open
,
open
,
...
...
src/pages/nongjifuwu/farm-form.vue
浏览文件 @
4b730fe6
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
import
{
useUserStore
}
from
'@/store/modules/user'
import
{
useUserStore
}
from
'@/store/modules/user'
import
{
useGlobSetting
}
from
'/@/hooks/setting'
import
{
useGlobSetting
}
from
'/@/hooks/setting'
import
*
as
nongjifuwu
from
'@/api/model/nongjifuwu'
import
*
as
nongjifuwu
from
'@/api/model/nongjifuwu'
import
{
areaOptions
,
getText
}
from
'@/utils/dict/area'
import
{
getDictData
,
getText
}
from
'@/utils/dict/area'
const
userStore
=
useUserStore
()
const
userStore
=
useUserStore
()
const
globSetting
=
useGlobSetting
()
const
globSetting
=
useGlobSetting
()
...
@@ -92,8 +92,8 @@
...
@@ -92,8 +92,8 @@
const
{
show
,
options
,
form
}
=
toRefs
(
pageData
)
const
{
show
,
options
,
form
}
=
toRefs
(
pageData
)
function
initDict
()
{
async
function
initDict
()
{
pageData
.
options
.
address
=
a
reaOptions
pageData
.
options
.
address
=
a
wait
getDictData
()
}
}
function
getDetails
(
id
)
{
function
getDetails
(
id
)
{
...
...
src/pages/nongjifuwu/machine-form.vue
浏览文件 @
4b730fe6
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
import
{
useUserStore
}
from
'@/store/modules/user'
import
{
useUserStore
}
from
'@/store/modules/user'
import
{
useGlobSetting
}
from
'/@/hooks/setting'
import
{
useGlobSetting
}
from
'/@/hooks/setting'
import
*
as
nongjifuwu
from
'@/api/model/nongjifuwu'
import
*
as
nongjifuwu
from
'@/api/model/nongjifuwu'
import
{
areaOptions
,
getText
}
from
'@/utils/dict/area'
import
{
getDictData
,
getText
}
from
'@/utils/dict/area'
const
userStore
=
useUserStore
()
const
userStore
=
useUserStore
()
const
globSetting
=
useGlobSetting
()
const
globSetting
=
useGlobSetting
()
...
@@ -79,8 +79,8 @@
...
@@ -79,8 +79,8 @@
})
})
const
{
show
,
options
,
form
}
=
toRefs
(
pageData
)
const
{
show
,
options
,
form
}
=
toRefs
(
pageData
)
function
initDict
()
{
async
function
initDict
()
{
pageData
.
options
.
address
=
a
reaOptions
pageData
.
options
.
address
=
a
wait
getDictData
()
}
}
function
getDetails
(
id
)
{
function
getDetails
(
id
)
{
...
...
src/pages/nongjifuwu/nongjifuwu.vue
浏览文件 @
4b730fe6
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
import
*
as
NongjifuwuAPI
from
'@/api/model/nongjifuwu'
import
*
as
NongjifuwuAPI
from
'@/api/model/nongjifuwu'
import
Navigate
from
'@/utils/page/navigate'
import
Navigate
from
'@/utils/page/navigate'
import
{
s
}
from
'vite/dist/node/types.d-aGj9QkWt'
import
{
s
}
from
'vite/dist/node/types.d-aGj9QkWt'
import
{
areaOptions
,
getText
}
from
'@/utils/dict/area'
import
{
getDictData
,
getText
}
from
'@/utils/dict/area'
onLoad
((
option
)
=>
{
onLoad
((
option
)
=>
{
pageData
.
search
.
serviceType
=
Number
(
option
.
type
)
||
1
pageData
.
search
.
serviceType
=
Number
(
option
.
type
)
||
1
...
@@ -68,8 +68,8 @@ import { s } from 'vite/dist/node/types.d-aGj9QkWt'
...
@@ -68,8 +68,8 @@ import { s } from 'vite/dist/node/types.d-aGj9QkWt'
})
})
}
}
function
getCascader
()
{
async
function
getCascader
()
{
pageData
.
options
=
a
reaOptions
pageData
.
options
=
a
wait
getDictData
()
}
}
// 分类标签点击事件
// 分类标签点击事件
...
...
src/utils/dict/area.ts
浏览文件 @
4b730fe6
...
@@ -2,12 +2,15 @@ import { cascaderHn } from '/@/api/model/dict'
...
@@ -2,12 +2,15 @@ import { cascaderHn } from '/@/api/model/dict'
const
storageKey
=
'app_dict_data_area_cascaderHn'
;
const
storageKey
=
'app_dict_data_area_cascaderHn'
;
export
const
getDictData
=
()
=>
{
export
const
getDictData
=
async
()
=>
{
// 先从本地加载数据
// 先从本地加载数据
let
dictData
=
getLocalDict
();
let
dictData
=
getLocalDict
();
if
(
!
dictData
)
{
if
(
!
dictData
)
{
// 如果本地没有数据,则从接口获取
// 如果本地没有数据,则从接口获取
cascaderHn
().
then
(
res
=>
uni
.
setStorageSync
(
storageKey
,
JSON
.
stringify
(
res
[
0
].
children
).
replaceAll
(
'label'
,
'text'
)));
const
res
=
await
cascaderHn
();
const
data
=
JSON
.
stringify
(
res
[
0
].
children
).
replaceAll
(
'label'
,
'text'
);
uni
.
setStorageSync
(
storageKey
,
data
);
dictData
=
JSON
.
parse
(
data
);
}
}
return
dictData
;
return
dictData
;
}
}
...
@@ -33,7 +36,7 @@ export const refreshDictData = () => {
...
@@ -33,7 +36,7 @@ export const refreshDictData = () => {
getDictData
();
getDictData
();
}
}
export
const
areaOptions
=
getDictData
();
const
areaOptions
=
await
getDictData
();
export
const
getText
=
(
scope
:
string
,
spliced
:
string
)
=>
{
export
const
getText
=
(
scope
:
string
,
spliced
:
string
)
=>
{
if
(
!
scope
||
!
areaOptions
||
areaOptions
.
length
===
0
)
{
if
(
!
scope
||
!
areaOptions
||
areaOptions
.
length
===
0
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论