<template>
  <div>
    <!-- 工地設定functionbar -->
    <div class="shadow" v-show="$route.name === 'SiteSettingEdit'">
      <!-- <b-button
        class="btn1"
        @click="issueSave"
        :disabled="isCreate"
        v-show="currentUser.projectTitle != '一般成員'"
      >
        <b-icon-cursor></b-icon-cursor>儲存
      </b-button>
      <b-button
        class="btn1"
        @click="issueEdit"
        :disabled="isSave"
        v-show="currentUser.projectTitle != '一般成員'"
      >
        <b-icon-cursor></b-icon-cursor>編輯
      </b-button> -->
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  data () {
    return {
      isSave: false,
      isCreate: true
    }
  },
  computed: {
    ...mapState({
      currentUser: state => state.user.current
    })
  },
  methods: {
    async issueSave () {
      var yes = confirm('確定儲存?')
      if (yes) {
        this.isSave = false
        this.isCreate = true
        alert('儲存成功')
        this.$emit('issueSave')
      } else {
        alert('取消儲存')
      }
    },
    async issueEdit () {
      this.isSave = true
      this.isCreate = false
      this.$emit('isEdited')
    }
  }
}
</script>

<style scoped>
.shadow {
  background-color: #ffff;
  height: 65px;
  width: 100%;
  box-shadow: 2px 2px 20px rgba(0, 0, 0, 5);
  position: fixed;
  top: 55px;
  z-index: 500;
}
.btn {
  background-color: white;
  font-size: 16px;
  margin-top: 15px;
  margin-left: 15px;
  padding-left: 7px;
  padding-right: 7px;
  padding-top: 5px;
  padding-bottom: 5px;
  color: #383838;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
  border: none;
}

.btn:hover {
  color: black;
  background-color: rgb(228, 228, 228);
  transform: translateY(0);
}

.btn1 {
  background-color: rgb(75, 102, 255);
  font-size: 16px;
  margin-top: 15px;
  margin-left: 15px;
  padding-left: 7px;
  padding-right: 7px;
  padding-top: 5px;
  padding-bottom: 5px;
  color: #ffffff;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
  border: none;
}
.btn1:hover {
  color: rgb(255, 255, 255);
  background-color: rgb(49, 68, 175);
  transform: translateY(0);
}
.btn.btn-secondary[disabled] {
  background-color: rgb(224, 224, 224);
  color: rgb(150, 150, 150);
}
</style>
