123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- 'use strict';
- /**
- * 待办页js
- *
- * @author EllisRan.
- * @date 2019/3/19
- * @version
- */
- $(document).ready(() => {
- // $('a[href="#view-msg"]').on('click', function () {
- // const id = $(this).attr('msg-id');
- // const msgInfo = _.find(msgList,{ id: parseInt(id) });
- // $('#title').html(msgInfo.title);
- // $('#creator').html(msgInfo.creator);
- // $('#release_time').html(moment(msgInfo.release_time*1000).format('YYYY-MM-DD'));
- // $('#content').html(msgInfo.content);
- // $('#user_permission').html('');
- // if (userMsgPermission && parseInt(uid) === msgInfo.create_uid ) {
- // const permissionHtml = '<a href="/dashboard/msg/add/' + msgInfo.id +'" class="btn btn-sm btn-outline-primary">编辑</a>';
- // $('#user_permission').html(permissionHtml);
- // }
- // });
- $('.list-group-item a').on('click', function () {
- const id = $(this).attr('msg-id');
- const msgInfo = _.find(msgList, {id: parseInt(id)});
- $('#title').html(msgInfo.title);
- $('#release_time').html(moment(msgInfo.release_time * 1000).format('YYYY-MM-DD'));
- $('#content').html(msgInfo.content);
- $('#user_permission').html('');
- if (type && parseInt(type) === 1) {
- $('#creator').html(msgInfo.creator);
- $('#view-msg .modal-title').text('项目通知');
- if (userMsgPermission && parseInt(uid) === msgInfo.create_uid) {
- const permissionHtml = '<a href="/dashboard/msg/add/' + msgInfo.id + '" class="btn btn-sm btn-outline-primary">编辑</a>';
- $('#user_permission').html(permissionHtml);
- }
- } else {
- $('#creator').html('');
- $('#view-msg .modal-title').text('系统通知');
- }
- });
- $('.system-msg').on('click', function () {
- const id = $(this).attr('msg-id');
- const msgInfo = _.find(sysMsgList, {id: parseInt(id)});
- $('#title').html(msgInfo.title);
- $('#creator').html('');
- $('#release_time').html(moment(msgInfo.release_time * 1000).format('YYYY-MM-DD'));
- $('#content').html(msgInfo.content);
- $('#view-msg .modal-title').text('系统通知');
- $('#user_permission').html('');
- })
- // $('#notice').on('click', 'li a', function() {
- // const id = $(this).data('id')
- // postData(window.location.pathname + '/push', {id}, function() {
- // return
- // })
- // })
- });
|