daofu-applet/pages/index/index.js

208 lines
4.3 KiB
JavaScript
Raw Normal View History

2024-01-29 17:42:38 +08:00
const app = getApp()
Page({
data: {
baseImgUrl: app.FILE_SERVER_URL,
nineType: 0,
ec: {
lazyLoad: true
},
filterIndex: 0,
itemList: [{
icon: "icon_tab1",
name: "履职清单",
href: "/pages/duty/index/index"
},
// {
// icon: "icon_tab2",
// name: "专项任务",
// href: "/pages/task/index/index"
// },
{
icon: "icon_tab3",
name: "一企一档",
href: "/pages/ent-obj/index/index"
},
{
icon: "icon_tab4",
name: "隐患核查",
href: "/pages/danger/list/index"
},
// {
// icon: "icon_tab5",
// name: "群防群治",
// href: "/pages/people/index/index",
// },
// {
// icon: "icon-emergency",
// name: "应急管理",
// href: "/pages/emergency/index/index",
// },
// {
// icon: "icon_tab6",
// name: "发布通知",
// href: "/pages/msg/push-index/index",
// },
],
filter: [{
lab: '今日数据',
val: 0
}, {
lab: '本月数据',
val: 1
}],
dLegend: [{
name: '已整改',
num: 0,
color: '#2678FF'
}, {
name: '整改中',
num: 0,
color: '#FF9C00'
}, {
name: '未整改',
num: 0,
color: '#FF4E00'
}],
// 数据统计
tab1: [{
icon: "icon_tab1",
name: "工作日志",
2024-01-30 17:39:39 +08:00
href: "/pages/statistic/g-z-r-z/index/index"
2024-01-29 17:42:38 +08:00
}, {
icon: "icon_tab2",
2024-01-29 17:42:38 +08:00
name: "工作统计",
2024-01-30 17:39:39 +08:00
href: "/pages/statistic/g-z-t-j/index/index"
2024-01-29 17:42:38 +08:00
}, {
icon: "icon_tab3",
2024-01-29 17:42:38 +08:00
name: "应急统计",
2024-01-30 17:39:39 +08:00
href: "/pages/statistic/y-j/index/index"
2024-01-29 17:42:38 +08:00
}, {
icon: "icon_tab4",
2024-01-29 17:42:38 +08:00
name: "基本信息",
2024-01-30 17:39:39 +08:00
href: "/pages/statistic/j-b-x-x/index/index"
2024-01-29 17:42:38 +08:00
}],
// 工作台
tab2: [{
icon: "icon_w_1",
2024-01-29 17:42:38 +08:00
name: "上报动态",
2024-01-30 17:39:39 +08:00
href: "/pages/work/s-b/index/index",
2024-01-29 17:42:38 +08:00
},
{
icon: "icon_w_2",
2024-01-29 17:42:38 +08:00
name: "待办事项",
2024-01-30 17:39:39 +08:00
href: "/pages/work/d-b-s-x/index/index?id=0"
2024-01-29 17:42:38 +08:00
},
{
icon: "icon_w_3",
2024-01-29 17:42:38 +08:00
name: "已办事项",
2024-01-30 17:39:39 +08:00
href: "/pages/work/d-b-s-x/index/index?id=1"
2024-01-29 17:42:38 +08:00
},
2024-06-04 14:45:44 +08:00
{
icon: "icon_w_4",
name: "有事找党员",
href: "/pages/party-member/index/index"
},
2024-06-06 17:12:17 +08:00
{
icon: "icon_w_5",
2024-06-06 17:11:58 +08:00
name: "风险池",
href: "/pages/risk-pool/index"
},
2024-06-06 17:15:47 +08:00
{
icon: "icon_w_6",
2024-06-06 17:12:17 +08:00
name: "发布工作",
href: "/pages/work/f-b-g-z/index/index"
},
2024-01-29 17:42:38 +08:00
],
// 应急指挥
tab3: [{
icon: "icon_yj_1",
2024-01-29 17:42:38 +08:00
name: "应急预案",
2024-01-30 17:39:39 +08:00
href: "/pages/emergency/y-a/index/index",
2024-01-29 17:42:38 +08:00
},
{
icon: "icon_yj_2",
2024-06-04 14:45:44 +08:00
name: "应急上报",
2024-01-30 17:39:39 +08:00
href: "/pages/emergency/s-b/index/index"
2024-01-29 17:42:38 +08:00
},
{
2024-06-06 17:12:17 +08:00
icon: "icon_yj_4",
2024-01-29 17:42:38 +08:00
name: "应急通讯录",
2024-01-30 17:39:39 +08:00
href: "/pages/emergency/t-x/index/index"
2024-01-29 17:42:38 +08:00
},
2024-06-04 14:45:44 +08:00
{
icon: "icon_yj_3",
name: "指挥体系",
href: "/pages/emergency/t-x-l/index/index"
},
2024-06-19 15:42:55 +08:00
{
icon: "icon_yj_5",
name: "应急值守",
href: "/pages/emergency/z-s/index/index"
},
2024-01-29 17:42:38 +08:00
],
// 公告
2024-02-29 17:31:11 +08:00
notice: [],
2024-01-29 17:42:38 +08:00
showPop: false,
msgData: null,
checkInfo: {},
userInfo: {}
},
/**
* 跳转
*/
toSkip: function (params) {
const item = params.currentTarget.dataset.item;
const url = params.currentTarget.dataset.url;
if (url || item?.href) {
wx.navigateTo({
url: url || item.href,
})
}
},
/**
2024-01-30 16:35:55 +08:00
* 获取banner
2024-01-29 17:42:38 +08:00
*/
2024-01-30 16:35:55 +08:00
getBanner: function () {
2024-02-29 17:31:11 +08:00
app.axios("GET", "app", "/notice/lastFourNotice", {
2024-01-29 17:42:38 +08:00
page: 1,
2024-01-30 16:35:55 +08:00
limit: 4,
userId: app.globalData.userInfo.userId
}, false).then(res => {
2024-02-29 17:31:11 +08:00
wx.stopPullDownRefresh();
2024-01-29 17:42:38 +08:00
if (res.code == 1) {
2024-02-29 17:31:11 +08:00
this.data.notice = res.data;
this.setData(this.data)
2024-01-29 17:42:38 +08:00
}
})
},
2024-03-20 17:09:58 +08:00
/**
* 通知详情
*/
toMsgDetail: function (params) {
const item = params.currentTarget.dataset.item;
wx.navigateTo({
url: `/pages/web/index?id=${item.govNoticeId}`,
})
},
2024-01-29 17:42:38 +08:00
onLoad(option) {
this.data.userInfo = app.globalData.userInfo;
2024-01-30 16:35:55 +08:00
this.getBanner();
2024-01-29 17:42:38 +08:00
},
onReady() {
2024-02-29 17:31:11 +08:00
2024-01-29 17:42:38 +08:00
},
2024-02-29 17:31:11 +08:00
onPullDownRefresh() {
this.getBanner();
}
2024-01-29 17:42:38 +08:00
})