Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
monthReport_smzx
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
邓文彬
monthReport_smzx
Commits
e5e17bde
提交
e5e17bde
authored
11月 21, 2024
作者:
邓文彬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(文件读取): 文件读取
上级
3bb66450
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
59 行增加
和
32 行删除
+59
-32
index.vue
components/searchCom/index.vue
+11
-11
index.vue
pages/monthReport/index.vue
+20
-18
index.js
request/index.js
+28
-3
没有可用的文件名
+0
-0
没有找到文件。
components/searchCom/index.vue
浏览文件 @
e5e17bde
...
...
@@ -4,19 +4,18 @@
<uni-data-select
class=
"uni-search-item"
v-model=
"searchFrom.reportTime"
:localdata=
"
inspectArr
"
:localdata=
"
reportList
"
@
change=
"(e) => change(e, 'reportTime')"
placeholder=
"选择月份"
:clear=
"true"
:key=
"new Date().getTime()"
></uni-data-select>
</view>
</view>
</
template
>
<
script
>
import
{
getReportSearch
}
from
"@/request/index.js"
;
export
default
{
props
:
{
hiddenSearch
:
{
...
...
@@ -30,16 +29,17 @@ export default {
data
()
{
return
{
searchFrom
:
{
reportTime
:
"
202410"
,
reportTime
:
"
"
,
},
inspectArr
:
[
{
value
:
"202410"
,
text
:
"2024年10月"
},
{
value
:
"202411"
,
text
:
"2024年11月"
},
],
reportList
:
[],
};
},
created
()
{
getReportSearch
().
then
((
res
)
=>
{
this
.
searchFrom
.
reportTime
=
res
.
defaultReportTime
;
this
.
reportList
=
res
.
reportList
;
});
},
methods
:
{
change
(
e
,
key
)
{
this
.
searchFrom
[
key
]
=
e
;
...
...
pages/monthReport/index.vue
浏览文件 @
e5e17bde
<
template
>
<view
class=
"padding_all_16 page_box"
>
<SearchCom
@
change=
"searchChange"
/>
<!-- 态势分析研判报告 -->
...
...
@@ -12,7 +11,7 @@
<view
class=
"rightOne"
>
<rightPie
class=
"margin_t_16 rightPie"
:value=
"detailData.report_value
"
:value=
"detailData.report_value"
/>
<rightItem
:detailData=
"detailData"
class=
"rightItem"
/>
</view>
...
...
@@ -285,9 +284,9 @@ import rightBar from "./components/rightBar.vue";
import
rightLine
from
"./components/rightLine.vue"
;
import
{
mergeObjectsWithUnderscoreKey
}
from
"./_monthReportUtil.js"
;
import
{
getReportList
}
from
"@/request/index.js"
;
import
{
getReportList
,
getReportSearch
}
from
"@/request/index.js"
;
import
SearchCom
from
"@/components/searchCom/index.vue"
import
SearchCom
from
"@/components/searchCom/index.vue"
;
import
{
terminal
,
...
...
@@ -312,7 +311,7 @@ export default {
rightItem
,
rightBar
,
rightLine
,
SearchCom
SearchCom
,
},
data
()
{
return
{
...
...
@@ -329,33 +328,36 @@ export default {
allReport
:
[],
// 所有汇报数据
defaultReportTime
:
"202410"
,
// 默认选中时间
};
},
created
()
{
getReportList
().
then
((
res
)
=>
{
this
.
allReport
=
res
.
map
(
item
=>
JSON
.
parse
(
item
))
this
.
getDetailData
(
this
.
defaultReportTime
)
});
this
.
init
();
},
methods
:
{
async
init
()
{
const
allReport
=
await
getReportList
();
this
.
allReport
=
allReport
;
getReportSearch
().
then
((
res
)
=>
{
console
.
log
(
"-getReportSearch-"
,
res
);
this
.
getDetailData
(
res
.
defaultReportTime
);
});
},
getDetailData
(
reportTime
)
{
// const result = this.allReport.filter(item => item.data.reportTime == reportTime)[0]
// console.log("--result-", result)
// this.detailData = mergeObjectsWithUnderscoreKey(result.data);
this
.
detailData
=
mergeObjectsWithUnderscoreKey
(
result
);
this
.
detailData
=
mergeObjectsWithUnderscoreKey
(
result
);
},
// 搜索 change
searchChange
(
val
){
console
.
log
(
"searchItem"
,
val
)
this
.
getDetailData
(
val
.
reportTime
)
}
searchChange
(
val
)
{
console
.
log
(
"searchItem"
,
val
);
this
.
getDetailData
(
val
.
reportTime
);
},
},
};
</
script
>
...
...
request/index.js
浏览文件 @
e5e17bde
...
...
@@ -3,7 +3,9 @@ import {
readLogData
,
readInspectionData
,
readDarfData
,
readReportData
readReportData
,
readReportSEarchData
}
from
"@/utils/IoReadingAndWriting.js"
;
import
lodash
from
"lodash"
;
...
...
@@ -112,8 +114,31 @@ export const getReportList = () => {
readReportData
()
.
then
((
res
)
=>
{
store
.
commit
(
"SET_REPORT_LIST"
,
res
);
resolve
(
res
)
const
temp
=
res
.
map
(
item
=>
JSON
.
parse
(
item
))
store
.
commit
(
"SET_REPORT_LIST"
,
temp
);
resolve
(
temp
)
})
.
catch
((
error
)
=>
{
reject
(
error
)
})
})
}
// 获取 内置搜索内容
export
const
getReportSearch
=
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
store
.
state
.
reportSearch
.
length
){
resolve
(
store
.
state
.
reportSearch
)
return
;
}
readReportSEarchData
()
.
then
((
res
)
=>
{
store
.
commit
(
"SET_REPORT_SEARCH"
,
JSON
.
parse
(
res
[
0
]));
resolve
(
JSON
.
parse
(
res
[
0
]))
})
.
catch
((
error
)
=>
{
reject
(
error
)
...
...
浏览文件 @
e5e17bde
No preview for this file type
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论