<template>
<div class="panel-fieldset" style="padding-top:0; padding-bottom:0;position: relative;" :class="{isBottomBtn: isShowBottomBtn}">
      <ne-corner-button v-if="!isShowBottomBtn"></ne-corner-button>
      <el-toolbar :align="align" :class="{'prominent': align == 'space-around' ? true : false}">
        <workflow-buttons :content-id="contentId" ref="workflowButtons" :catalog-id="catalogId" :content-type="content.contentTypeID" @callback="workflowButtonsCallback"></workflow-buttons>
        <content-save-button :content="content" ref="saveButton" :catalog-id="catalogId" :content-form-rules="contentFormRules" @refresh-content="reflushList" v-show="showSaveButton" ></content-save-button>
        <el-button :type="buttonType" :disabled="(content.isLock=='Y'&&content.lockUser!=userName) || (content.contentTypeID !== 'Article' && content.ID === 0) || content.catalogAlias === 'Root'"  v-show="showPublishButton" @click="publish(content.ID,'pub')" :priv="'com.zving.cms.Catalog.Content.Publish.'+catalogId">
          <i class="fa fa-send-o"></i>发布
        </el-button>
        <content-view-button :content-id="content.ID" :status="content.status" :link="content.link" @refresh-content="reflushList"></content-view-button>
        <!-- <el-dropdown v-show="catalogId!=0 && !isShowBottomBtn">
          <el-button>
            <i class="fa fa-ellipsis-h" aria-hidden="true"></i>
          </el-button>
          <el-dropdown-menu slot="dropdown" class="button-dropdown">
            <el-dropdown-item v-show="showPublishButton">
              <content-lock-button :type="buttonType" :content.sync="content" @refresh-content="reflushList" :catalog-id="catalogId"></content-lock-button>
            </el-dropdown-item>
            <el-dropdown-item v-show="showPublishButton">
              <el-button :type="buttonType" :disabled="(content.isLock=='Y'&&content.lockUser!=userName) || (content.contentTypeID !== 'Article' && content.ID === 0)" @click="publish(content.ID,'topub')" :priv="'com.zving.cms.Catalog.Content.Publish.'+catalogId">
                <i class="fa fa-circle-o-notch"></i>待发布
              </el-button>
            </el-dropdown-item>
            <el-dropdown-item>
              <el-button :type="buttonType" @click="publish(content.ID,'offline')" :priv="'com.zving.cms.Catalog.Content.Publish.'+catalogId" :disabled="!content.ID">
                <i class="fa fa-refresh"></i>下线
              </el-button>
            </el-dropdown-item>
            <el-dropdown-item command="settop">
              <content-set-top-button :catalog-id="catalogId" :content.sync="content" @refresh-content="reflushList" :button-type="buttonType"></content-set-top-button>
            </el-dropdown-item>
            <el-dropdown-item command="similar">
              <content-similar-button :catalog-id="catalogId" :content-id="content.ID" @refresh-content="reflushList" :button-type="buttonType"></content-similar-button>
            </el-dropdown-item>
            <el-dropdown-item command="log" >
              <content-operatlog-button :content-id="content.ID" @refresh-content="reflushList" :button-type="buttonType"></content-operatlog-button>
            </el-dropdown-item>
            <el-dropdown-item command="v" v-if="content.contentTypeID!='Image'">
              <content-version-button :content-id="content.ID" :content-type="content.contentTypeID" :catalog-id="catalogId" @refresh-content="reflushList" :button-type="buttonType"></content-version-button>
            </el-dropdown-item>
            <el-dropdown-item command="rec" >
              <content-rec-block-button :content="content" @refresh-content="reflushList" :button-type="buttonType"></content-rec-block-button>
            </el-dropdown-item>
            <el-dropdown-item>
              <socialmedia-push-button :content-ids="content.ID" :catalog-id="catalogId" @refresh-content="reflushList" :button-type='buttonType'></socialmedia-push-button>
            </el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown> -->
        <template v-if="catalogId!=0 && !isShowBottomBtn">
          <content-lock-button v-show="showPublishButton" :type="buttonType" :content.sync="content" @refresh-content="reflushList" :catalog-id="catalogId"></content-lock-button>
          <content-operatlog-button :content-id="content.ID" @refresh-content="reflushList" :button-type="buttonType"></content-operatlog-button>
          <content-version-button v-if="content.contentTypeID!='Image'" :content-id="content.ID" :content-type="content.contentTypeID" :catalog-id="catalogId" @refresh-content="reflushList" :button-type="buttonType"></content-version-button>
          <content-rec-block-button :content="content" @refresh-content="reflushList" :button-type="buttonType"></content-rec-block-button>
          <socialmedia-push-button :content-ids="content.ID" :catalog-id="catalogId" @refresh-content="reflushList" :button-type='buttonType'></socialmedia-push-button>
          <component v-for="button in buttons" :is="button.name" :key="button.key" :detail-content.sync="detailContent" :catalog-id="catalogId" :isShowBottomBtn="isShowBottomBtn"></component>
          <template v-if="true">
            <el-dropdown v-show="catalogId!=0 && !isShowBottomBtn">
              <el-button>
                <i class="fa fa-ellipsis-h" aria-hidden="true"></i>
              </el-button>
              <el-dropdown-menu slot="dropdown" class="button-dropdown">
              <el-dropdown-item v-show="showPublishButton">
                <el-button :type="buttonType" :disabled="(content.isLock=='Y'&&content.lockUser!=userName) || (content.contentTypeID !== 'Article' && content.ID === 0)" @click="publish(content.ID,'topub')" :priv="'com.zving.cms.Catalog.Content.Publish.'+catalogId">
                  <i class="fa fa-circle-o-notch"></i>待发布
                </el-button>
              </el-dropdown-item>
              <el-dropdown-item>
                <el-button :type="buttonType" @click="publish(content.ID,'offline')" :priv="'com.zving.cms.Catalog.Content.Publish.'+catalogId" :disabled="!content.ID">
                  <i class="fa fa-refresh"></i>下线
                </el-button>
              </el-dropdown-item>
              <el-dropdown-item command="settop">
                <content-set-top-button :catalog-id="catalogId" :content.sync="content" @refresh-content="reflushList" :button-type="buttonType"></content-set-top-button>
              </el-dropdown-item>
              <el-dropdown-item command="similar">
                <content-similar-button :catalog-id="catalogId" :content-id="content.ID" @refresh-content="reflushList" :button-type="buttonType"></content-similar-button>
              </el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
          </template>
        </template>
      </el-toolbar>
</div>
</template>
<script src="./ContentDetailToolbar.js"></script>
<style scoped>
  .isBottomBtn {
    padding-left: 10px;
    padding-right: 10px;
  }
</style>
