소스 검색

代码修改

yeshijie 7 년 전
부모
커밋
89a6d80168
15개의 변경된 파일338개의 추가작업 그리고 0개의 파일을 삭제
  1. BIN
      patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/Hr_icon.png
  2. BIN
      patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/color_line.png
  3. BIN
      patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/down_btn.png
  4. BIN
      patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/down_btn_pre.png
  5. BIN
      patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/location01_icon.png
  6. BIN
      patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/radio01_btn.png
  7. BIN
      patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/radio01_btn_pre.png
  8. BIN
      patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/right_arrow01_btn.png
  9. BIN
      patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/right_arrow01_btn_pre.png
  10. BIN
      patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/shrink.png
  11. BIN
      patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/unfold.png
  12. 54 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/timeline.css
  13. 200 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/timeline.js
  14. 17 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timepager/timepager.css
  15. 67 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timepager/timepager.js

BIN
patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/Hr_icon.png


BIN
patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/color_line.png


BIN
patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/down_btn.png


BIN
patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/down_btn_pre.png


BIN
patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/location01_icon.png


BIN
patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/radio01_btn.png


BIN
patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/radio01_btn_pre.png


BIN
patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/right_arrow01_btn.png


BIN
patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/right_arrow01_btn_pre.png


BIN
patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/shrink.png


BIN
patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/images/unfold.png


+ 54 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/timeline.css

@ -0,0 +1,54 @@
.event.parent>.bubble { padding: 35px 0; }
.event.parent>.bubble .switch{ cursor: pointer; }
.event.parent.tl-open>.bubble .switch{ background:url(./images/unfold.png); }
.event.parent.tl-close>.bubble .switch{ background:url(./images/shrink.png); }
.event.parent.tl-close .children { display: none; }
.event .children .switch { background:url(./images/radio01_btn.png); }
.event .children li.current .switch { background:url(./images/radio01_btn_pre.png); }
.event.parent>.event-title .title-wrap { color: #23AFFF; font-weight: bold; cursor: pointer; }
.event .children .title-wrap { position: absolute;right: 15px;border: 1px solid #23AFFF;padding: 2px 5px;top: -10px; }
.event .children .event-title-diamond { position: absolute;  right: 7px;  top: -4px; border-width: 4px; border-style: solid; border-color: #ffffff #ffffff #ffffff #23AFFF; }
.event .children .event-title-diamond-covered { position: absolute; right: 8px; top: -4px; border-width: 4px; border-style: solid; border-color: transparent transparent transparent white; }
.event .children .detail { position: relative; left: 176px; display: none; border-left: 1px solid #23AFFF;}
.event .children .open .detail { display: block; }
.event .children .detail li { margin-left: 50px; height: 30px; line-height: 30px; }
.event .children .detail li .triangle-icon{ display: inline-block; width: 5px; height: 9px; background:url(./images/right_arrow01_btn.png); }
.event .children .detail li:hover .triangle-icon,
.event .children .current .detail li.current .triangle-icon { background:url(./images/right_arrow01_btn_pre.png); }
.event .children .detail li .detail-content{ display: inline-block; padding-left: 10px; }
.event .children .detail li:hover .detail-content,
.event .children .current .detail li.current .detail-content { color: #23AFFF; cursor: pointer; }
.title-wrap { position: absolute; top: -10px; right: 15px; padding: 2px 5px;  }
.event-title { position: relative; display: inline-block; width:176px; vertical-align: middle; }
.event-content { position: relative; border: 1px solid #E6E6E6; border-radius: 8px; cursor: pointer; }
.event-content:hover,
.children .current .event-content { position: relative; border: 1px solid #23AFFF; border-radius: 8px; }
.bubble { position: relative; display: inline-block; width: 630px; padding: 5px 0 5px 25px; border-left: 1px solid #23AFFF; vertical-align: middle; }
.switch { display: inline-block; width: 16px; height: 16px; position: absolute;top: 50%;margin-top: -8px;left: -8px; }
.boder-diamond { position: absolute;top: 50%; left: -17px; margin-top: -8px; border-width: 8px; border-style: solid;border-color: #ffffff #E6E6E6 #ffffff #ffffff; }
.event-content:hover .boder-diamond,
.children .current .event-content .boder-diamond { border-color: #ffffff #23AFFF #ffffff #ffffff; }
.diamond-covered { position: absolute; top: 50%;left: -15px; margin-top: -8px; border-width: 8px; border-style: solid;  border-color: transparent white transparent transparent; }
.time-line-horizontal .event-title { display: block; height: 35px; text-align: center; }
.time-line-horizontal li.event { position: relative; float: left;}
.time-line-horizontal ul { clear: both; }
.time-line-horizontal>ul>li>.bubble {  margin-top: 35px;  }
.time-line-horizontal>ul>li>.event-title { position: absolute; }
.time-line-horizontal>ul>li>.event-title .title-wrap { top: 0; right: 6px; }
.time-line-horizontal .event.parent>.bubble .switch { height: 24px; width: 18px; top: -10px; background: url(./images/location01_icon.png); }
.time-line-horizontal .bubble { display: inline-block;padding: 25px 10px 0 10px; border-top: 1px solid #23AFFF; border-left: 0; vertical-align: middle; }
.time-line-horizontal .switch { top: -1px; left: 50%; margin-left: -8px; }
.time-line-horizontal .children { display: inline-block; vertical-align: top; }
.time-line-horizontal .event .children .title-wrap { top: 0; left: 5px; right: 0; }
.time-line-horizontal .content { width: 48px; padding: 10px 15px; text-align: center; }
.time-line-horizontal .boder-diamond { left: 50%; top: -9px; margin-left: -8px; border-color: #FFF #FFF #E6E6E6 #FFF; }
.time-line-horizontal .diamond-covered { left: 50%; top: -7px; margin-left: -8px; border-color: transparent transparent white transparent; }
.time-line-horizontal .event-content { height: 370px; }
.time-line-horizontal .event-content:hover .boder-diamond,
.time-line-horizontal .children .current .event-content .boder-diamond { border-color: #ffffff #ffffff #23AFFF #ffffff; }
.time-line-horizontal .event .children .event-title-diamond { right: 22px; top: 21px; border-color: #23AFFF #ffffff #ffffff #ffffff; }
.time-line-horizontal .event .children .event-title-diamond-covered { right: 22px; top: 19px; border-color: white transparent transparent transparent; }

+ 200 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timeline/timeline.js

@ -0,0 +1,200 @@
(function ($, win) {
    var Util = $.Util;
    var pluginName = "timeline";
    var namespace  = pluginName;
    var template =
        '{@each events as event}' +
        '<li class="event {@if event.open==true }open{@/if} " data-index="{{event.title}}" >' +
            '<div class="event-title"> ' +
                '{@if event.title}' +
                '<div class="title-wrap"><span>{{event.title}}</span> </div>' +
                '<div class="event-title-diamond"></div> ' +
                '<div class="event-title-diamond-covered"></div> ' +
                '{@/if}'+
            '</div>' +
            '<div class="bubble" data-cache="{{event.cache}}"> ' +
                '<span class="switch"></span>' +
                '{@if event.content }' +
                '<div class="event-content"> ' +
                    '<div class="boder-diamond"></div>' +
                    '<div class="diamond-covered"></div>' +
                    '<div class="content f-p10">$${event.content}</div> ' +
                '</div>' +
                '{@/if}' +
            '</div>' +
            '{@if event.children }' +
            '<ul class="detail">'+
                '{@each event.children as item}' +
                '<li>' +
                    '<span class="triangle-icon"></span>' +
                    '<span class="detail-content" data-cache="{{item.cache}}">{{item.content}}</span>' +
                '</li>' +
                '{@/each}'+
            '</ul>'+
            '{@/if}' +
        '</li>' +
        '{@/each}' ;
    function createHtml() {
        var o = this.option;
        var data = o.data || [];
        var $target = $(this.element).empty();
        var $ul = $('<ul>').appendTo($target);
        if(o.horizontal) {
            $target.addClass('time-line-horizontal');
        }
        $.each(data,function (i, d) {
            var $li = $(juicer(template, {events:[{title: d.title}]})).addClass('parent');
            var $childrenUl = $('<ul class="children">').append(juicer(template, {events: d.children}));
            if(d.open) {
                $li.addClass('tl-open');
            } else {
                $li.addClass('tl-close');
            }
            $li.append($childrenUl);
            $ul.append($li);
        });
        $('.event-title',$target).css({width: o.titleWidth});
        $('.event>.bubble',$target).css({width: o.contentWidth});
        $('.event .children .detail',$target).css({left: o.titleWidth});
        var minWidth = parseInt(o.titleWidth)+parseInt(o.contentWidth);
        var width = this.element.style.width || $(this.element).width();
        if(!width || width < minWidth) {
            $target.css({ width: minWidth });
        }
    }
    function createSly() {
        var o = this.option;
        if(o.horizontal) {
            $(this.element).sly({  horizontal: 1,
                itemNav: false, smart: 1, mouseDragging: 1, touchDragging: 1, releaseSwing: 1, scrollBy: 100,
                activatePageOn: 'click', speed: 300, elasticBounds: 1, easing: 'easeOutExpo', dragHandle: 1,
                dynamicHandle: 1, clickBar: 1,prevPage: o.prevPage, nextPage: o.nextPage
            });
        } else {
            $(this.element).sly({  mouseDragging: 1, touchDragging: 1, releaseSwing: 1,
                startAt: 0, scrollBy: 100, speed: 300, elasticBounds: 1, easing: 'easeOutExpo', dragHandle: 1,within: false,
                // 从最后一次滚轮事件到外部滚动条劫持时间,设置为0,防止滚动条滚动到顶端及底部时发生卡顿现象
                scrollHijack: 0, itemNav: false,prevPage: o.prevPage, nextPage: o.nextPage
            });
        }
        this.slyScroll = Sly.getInstance(this.element);
    }
    function changeExpendStatus(status) {
        var $li = $(this);
        var isOpen = (status && Util.isStrEqualsIgnorecase('open', status)) || !$li.hasClass('tl-open');
        if(isOpen) {
            $li.removeClass('tl-close').addClass('tl-open');
        } else {
            $li.removeClass('tl-open').addClass('tl-close');
        }
    }
    function resizeWidth() {
        var $wrapUl = $('>ul',this.element);
        var ulWidth = 0;
        // 设置足够的宽度,使得li内的内容不会折行,从而让Sly插件能够正确识别li的宽度
        $wrapUl.width('9999999px' );
        // 当IE8时,Sly会对ul设置position:absolute,导致无法显示出内容
        if(Util.isIE(8)) {
            $wrapUl.css('position','relative');
        }
        $('>li',$wrapUl).each(function () {
            var liWidth = 0;
            $(this).children().each(function(){
                liWidth += $(this).width();
            });
            ulWidth += liWidth;
        });
        $wrapUl.width(ulWidth+'px' );
    }
    function bindEvents() {
        var $el = $(this.element);
        var self = this;
        resizeWidth.call(this);
        $el.sly('reload');
        $el.off('click.event').on('click.event', '.parent>.event-title .title-wrap, .parent>.bubble .switch', function() {
            var $li = $(this).closest('.parent');
            changeExpendStatus.call($li);
            resizeWidth.call(self);
            $el.sly('reload');
        }).off('click.content').on('click.content','.children .event-content', function() {
            var $li = $(this).closest('li.event');
            $('.children li.event',$el).removeClass('current');
            $li.addClass('current');
            changeExpendStatus.call($li);
            $('.children .detail>li', $el).not($li.find('.detail>li')).removeClass('current');
            $el.trigger('contentClick');
            resizeWidth.call(self);
            $el.sly('reload');
        }).off('click.detail').on('click.detail','.children .detail>li', function () {
            $('.children .detail>li', $el).removeClass('current');
            $(this).addClass('current');
            $('.children li.event',$el).removeClass('current');
            $(this).closest('li.event').addClass('current');
            var cacheData = $('.detail-content',this).attr('data-cache');
            $el.trigger('detailClick', [this,cacheData]);
        });
    }
    function TimeLine (element, options) {
        // Extend options
        var o = $.extend({}, TimeLine.defaults, options);
        if(o.horizontal) {
            $.extend(o, {
                titleWidth: 60,
                contentWidth: 70
            })
        }
        this.element = element;
        this.option = o;
        this.init();
    }
    TimeLine.prototype.init = function () {
        if(this.initialized) return;
        createHtml.call(this);
        createSly.call(this);
        bindEvents.call(this);
        TimeLine.storeInstance(this.element, this);
        this.initialized = 1;
    };
    TimeLine.prototype.locate = function (item, isExpend) {
        var $element = $(this.element);
        var timeline = this.slyScroll;
        var itemPos = timeline.getPos(item);
        if(itemPos && isExpend) {
            //changeExpendStatus.call(itemPos.el, 'open');
            changeExpendStatus.call(item, 'open');
        }
        if(itemPos)
            timeline.slideTo(itemPos['start'], undefined, true, true);
    };
    TimeLine.defaults = {
        titleWidth: 70,
        contentWidth: 300
    };
    TimeLine.getInstance = function (element) {
        return $.data(element, namespace);
    };
    TimeLine.storeInstance = function (element, timeline) {
        return $.data(element, namespace, timeline);
    };
    TimeLine.removeInstance = function (element) {
        var sly = Sly.getInstance(element);
        if(sly) {
            sly.destroy();
        }
        return $.removeData(element, namespace);
    };
    $.fn[pluginName] = function (options) {
        var element = this[0];
        var instance = TimeLine.getInstance(element);
        if(!instance) {
            new TimeLine(element, options);
        }
    };
    $.TimeLine = TimeLine;
})(jQuery, window);

+ 17 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timepager/timepager.css

@ -0,0 +1,17 @@
/* Example wrapper */
.m-wrap { width: 360px; padding: 10px 0; }
/* Frame */
.m-base-page { position: absolute; top: 10px; height: 40px; width: 20px;line-height: 40px; }
.m-base-page.pre-page { left: 0; }
.m-base-page.next-page { right: 0; }
.m-base-page.disabled { display: none; }
.m-base-page>span { display: inline-block;width:11px;height:11px; }
.m-base-page.pre-page>span { background: url(../../../images/browser/left_arrow01_btn.png) no-repeat; }
.m-base-page.pre-page>span:hover { background: url(../../../images/browser/left_arrow01_btn_pre.png) no-repeat; }
.m-base-page.next-page>span { background: url(../../../images/browser/right_arrow01_btn.png) no-repeat; }
.m-base-page.next-page>span:hover { background: url(../../../images/browser/right_arrow01_btn_pre.png) no-repeat; }
.m-frame { display: inline-block; width: 300px; height: 40px; line-height: 40px; margin: 0 20px; overflow: hidden;  }
.m-frame ul { list-style: none; margin: 0; padding: 0; height: 100%; font-size: 12px; }
.m-frame ul li { float: left; width: 100px; height: 100%; margin: 0 1px 0 0; padding: 0; font-weight: bold; color: #232323; text-align: center; cursor: pointer;  }
.m-frame ul li.active { color: #23AFFF; }

+ 67 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/browser/lib/timepager/timepager.js

@ -0,0 +1,67 @@
/*!
 * timepager -v1.0.0 (2015/12/14)
 * 
 * @description:
 *
 * @author:      yezehua
 * 
 * @copyright:   2015 www.yihu.com
 */
(function ($,win) {
    var template = '<div class="m-wrap f-pr">' +
                        '<div class="m-base-page pre-page" > <span></span> </div>' +
                        '<div class="m-frame"> ' +
                            '<ul class="j-years clearfix"> ' +
                            '{@each years as year}' +
                                '<li data-index="{{year}}">{{year}}年</li> ' +
                            '{@/each}' +
                            '</ul>' +
                        '</div>' +
                         '<div class="m-base-page next-page" > <span></span> </div>' +
                    '</div>';
    function getYears (n) {
        var date = new Date();
        var curYear = date.getFullYear();
        var n = n || 10;
        var years = [];
        for(var i=0; i<n; i++) {
            years.unshift(curYear-i);
        }
        return years;
    }
    function bindEvents() {
        var self = this;
        $('li', this).click(function () {
            var id = $(this).attr('data-index');
            self.trigger('selected',id);
        });
    }
    $.fn.timepager = function () {
        this.element = this[0];
        var html = juicer(template, {years: getYears()});
        var $wrap = $(html);
        var $frame = $('.m-frame', $wrap);
        this.append($wrap);
        $frame.sly({
            horizontal: 1,
            itemNav: 'basic',
            smart: 1,
            activateOn: 'click',
            mouseDragging: 1,
            touchDragging: 1,
            releaseSwing: 1,
            startAt: 0,
            activatePageOn: 'click',
            speed: 300,
            easing: 'easeOutExpo',
            prevPage: $wrap.find('.pre-page'),
            nextPage: $wrap.find('.next-page')
        });
        bindEvents.call(this);
    };
})(jQuery, window);