<!--
 * @Description: 机构对话框导航按钮面板
 * @Author: laoliu
 * @Date: 2021-06-03 12:56:28
 * @LastEditTime: 2022-06-22 16:07:20
-->
<template>
  <div class="panel-body">
    <el-button v-if="mode != 'details'" @click="handleBtn('cancel')">取 消</el-button>
    <el-button type="primary" :disabled="!status.prev" @click="handleBtn('prev')">上一步</el-button>
    <el-button type="primary" :disabled="!status.next" @click="handleBtn('next')">下一步</el-button>
    <el-button v-if="mode == 'details'" type="primary" @click="handleBtn('ok')">确 定</el-button>
    <template v-else>
      <el-button type="primary" v-if="status.submit" @click="handleSubmit()">{{submitText}}</el-button>
    </template>
  </div>
</template>

<script>
let WizardButtons = {
  name: 'WizardButtons',
  props: ["mode", "status", "reviewBtn"],
  
  data() {
    return {
    }
  },

  computed: {
    submitText() {
      return this.reviewBtn ? '提交审核' : '保 存';
    },
  },

  methods: {
    handleBtn(opr) {
      this.$emit("btnpressed", opr);
    },
    
    handleSubmit() {
      this.$emit("btnpressed", this.mode);
    },
  },
}
export default WizardButtons
</script>

<style scoped>
.panel-body {
  margin-top: 30px;
  text-align: right;
}
.el-button {
  margin-left: 15px;
}
</style>