123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- var app = getApp();
- var that;
- Page({
- data: {
- incidentList: [1, 2, 2, 2, 2, 2, 2, 2, 2],
- isAdministrator: false,//是否管理员角色
- ding_enable: true,
- menuList: [
- {
- code: '积分执行', child: [
- { name: '奖扣B分', imgUrl: '../../../image/point_entry.png', url: '../../workbench/jk_B/jk_B?type=B', code: 'creator admin ' },
- { name: '奖扣A分', imgUrl: '../../../image/a_entry.png', url: '../../workbench/jk_B/jk_B?type=A', code: 'creator admin ' },
- { name: '我奖扣的', imgUrl: '../../../image/entry_list.png', url: '../my_PrizeBuckle/my_PrizeBuckle?index=', code: 'creator admin ' },
- { name: '申请积分', imgUrl: '../../../image/a_apply.png', url: '../../workbench/apply/apply', code: 'admin employee' },
- { name: '我申请的', imgUrl: '../../../image/apply_list.png', url: '../my_apply/my_apply?index=', code: 'admin employee' },
- { name: '发放奖票', imgUrl: '../../../image/add_ticket.png', url: '../grant/grant', code: 'creator admin ' },
- { name: '我的奖票', imgUrl: '../../../image/my_ticket.png', url: '../myGrant/myGrant', code: 'creator admin employee' },
- ]
- },
- {
- code: '任务管理', child: [
- { name: '指派任务', imgUrl: '../../../image/my_publish.png', url: '../assaign/assaign', code: 'creator admin' },
- { name: '发布悬赏', imgUrl: '../../../image/caback6.png', url: '../offerAreward/offerAreward', code: 'creator admin ' },
- { name: '我发布的', imgUrl: '../../../image/my_publish.png', url: '../my_issue/my_issue', code: 'creator admin ' },
- { name: '我的任务', imgUrl: '../../../image/my_task.png', url: '../my_task/my_task', code: 'admin employee' },
- { name: '我审批的', imgUrl: '../../../image/my_examine.png', url: '../my_sp/my_sp', code: 'creator admin' },
- { name: '领任务', imgUrl: '../../../image/task_hall.png', url: '../getTask/getTask', code: 'creator admin employee' },
- { name: '全部任务', imgUrl: '../../../image/apply_list.png', url: '../allTask/allTask', code: 'creator admin' },
- ]
- },
- // {
- // code: '奖票', child: [
- // { name: '发放奖票', imgUrl: '../../../image/my_publish.png', url: '../grantAward/grantAward', code: 'creator admin' },
- // { name: '发放记录', imgUrl: '../../../image/caback6.png', url: '../awardJl/awardJl', code: 'creator admin ' },
- // { name: '我的奖票', imgUrl: '../../../image/task_hall.png', url: '../myGrant/myGrant', code: 'admin employee' },
- // ]
- // },
- {
- code: '统计分析', child: [
- { name: '排行榜', imgUrl: '../../../image/integral_rank.png', url: '../userRamking/userRamking', code: 'creator admin ' },
- { name: '考勤分', imgUrl: '../../../image/att_sign.png', url: '../check_top/check_top', code: 'creator admin employee' },
- { name: '日志分', imgUrl: '../../../image/log1.png', url: '../log_rank/log_rank', code: 'creator admin employee' },
- { name: '任务分', imgUrl: '../../../image/log2.png', url: '../task_rank/task_rank', code: 'creator admin employee' },
- { name: '任务统计', imgUrl: '../../../image/att_statistics.png', url: '../taskStatistical/taskStatistical', code: 'creator admin employee',new:false },
- { name: '积分事件', imgUrl: '../../../image/event_list_a.png', url: '../integralEvent/integralEvent', code: 'creator admin employee' },
- { name: '积分周报', imgUrl: '../../../image/length_point.png', url: '../../reportBox/report/report', code: 'admin' },
- ]
- },
- {
- code: '其他', child: [
- { name: '组织架构', imgUrl: '../../../image/dept.png', url: '../../deploy/organization/organization', code: 'creator admin employee' },
- { name: '积分规则', imgUrl: '../../../image/rule.png', url: '../../deploy/integralRule/integralRule', code: 'creator admin employee' },
- { name: '考勤分规则', imgUrl: '../../../image/log1.png', url: '../../deploy/setCheck/setCheck', code: 'creator admin employee' },
- // { name: '福利兑换', imgUrl: '../../../image/fl.png', url: '../../exchange/exchange/exchange', code: 'creator admin employee' },
- // { name: '工作汇报分规则', imgUrl: '../../../image/e66f.jpg', url: '../my_approve/my_approve', code: 'creator admin employee' },
- ]
- },
- ]
- },
- onLoad() {
- that = this;
- dd.setNavigationBar({ title: "工作台" });
- this.setData({ isAdministrator: app.globalData.isAdministrator })
- if(app.globalData.isCreator){
- that.setMenuList("creator");
- }else if(app.globalData.isAdministrator){
- that.setMenuList("admin");
- }else if(!app.globalData.isCreator&&!app.globalData.isAdministrator){
- that.setMenuList("employee");
- }
- },
- openUrl(e){
- dd.navigateTo({
- url:e.target.dataset.url
- })
- },
- setMenuList(str){
- var arr=[];
- that.data.menuList.forEach(item=>{
- var obj={};
- obj.code=item.code
- obj.child=[];
- item.child.forEach(childItem=>{
- if(childItem.code.indexOf(str)>=0){
- obj.child.push(childItem)
- }
- })
- arr.push(obj);
- })
- that.setData({
- menuList:arr
- })
- },
- //跳转
- openView(e) {
- var index = e.target.dataset.index - 1;
- var urls = [
- { url: '../my_PrizeBuckle/my_PrizeBuckle', query: "index=" },
- { url: '../my_apply/my_apply', query: "index=" },
- { url: '../glz_execute/glz_execute', query: '' },
- { url: '../integralEvent/integralEvent', query: '' },
- { url: '../check_top/check_top', query: '' },
- { url: '../sectionRanking/sectionRanking', query: '' },
- { url: '../B_ranking/B_ranking', query: '' },
- { url: '../customRamking/customRamking', query: '' },
- ];
- dd.navigateTo({
- url: urls[index].url + '?' + urls[index].query
- })
- },
- });
|