   messages: ['没有舰队信息']
   countdown: [0, 0, 0, 0, 0, 0]
   maxCountdown: 0
+  missionCountdown: 0
+  completeTime: 0
   timeDelta: 0
   cond: [0, 0, 0, 0, 0, 0]
   isMount: false
   inBattle: false
+  inMission: false
   handleResponse: (e) ->
     {method, path, body, postBody} = e.detail
     refreshFlag = false
     switch path
       when '/kcsapi/api_port/port'
+        if @props.deckIndex != 0
+          deck = body.api_deck_port[@props.deckIndex]
+          @missionCountdown = -1
+          switch deck.api_mission[0]
+            # In port
+            when 0
+              @missionCountdown = -1
+              @completeTime = -1
+            # In mission
+            when 1
+              @completeTime = deck.api_mission[2]
+              @missionCountdown = Math.floor((deck.api_mission[2] - new Date()) / 1000)
+            # Just come back
+            when 2
+              @completeTime = 0
+              @missionCountdown = 0
         @inBattle = false
         refreshFlag = true
+      when '/kcsapi/api_req_mission/start'
+        if postBody.api_deck_id == @props.deckIndex
+          @completeTime = body.api_complatetime
+          @missionCountdown = Math.floor((body.api_complatetime - new Date()) / 1000)
+          @inBattle = false
+          refreshFlag = true
+      when '/kcsapi/api_req_mission/return_instruction'
+        if postBody.api_deck_id == @props.deckIndex
+          @completeTime = body.api_mission[2]
+          @missionCountdown = Math.floor((body.api_mission[2] - new Date()) / 1000)
+          @inBattle = false
+          refreshFlag = true
       when '/kcsapi/api_req_map/start'
         @inBattle = true
       when '/kcsapi/api_get_member/deck', '/kcsapi/api_get_member/ship_deck', '/kcsapi/api_get_member/ship2', '/kcsapi/api_get_member/ship3'

        refreshFlag = true
    if refreshFlag
      @setAlert()
  setAlert: ->
    decks = window._decks
    @messages = getDeckMessage decks[@props.deckIndex]
    tmp = getCondCountdown decks[@props.deckIndex]
    @maxCountdown = tmp.countdown.reduce (a, b) -> Math.max a, b    # new countdown
    @countdown = tmp.countdown
    minCond = tmp.cond.reduce (a, b) -> Math.min a, b               # new cond
    thisMinCond = @cond.reduce (a, b) -> Math.min a, b              # current cond
    if thisMinCond isnt minCond
      @timeDelta = 0
    @cond = tmp.cond
    if @maxCountdown > 0
      @interval = setInterval @updateCountdown, 1000 if !@interval?
    else

            <span>索敌:&nbsp;{@messages[3]}</span>
          </OverlayTrigger>
        </span>
        <span style={flex: 1.5}>{@getState()}:&nbsp;<span id={"deck-condition-countdown-#{@props.deckIndex}-#{@componentId}"}>{resolveTime @maxCountdown}</span></span>
      </div>
    </Alert>

