<template>
  <el-dialog
    :title="title"
    :visible.sync="visible"
    :append-to-body="true"
    :close-on-click-modal="false"
    :before-close="handleClose"
    :width="width"
  >
    <div class="setting-content">
      <el-alert
        :title="settingTip"
        type="info"
        :closable="false"
        show-icon
      />
      <div class="setting-placeholder">
        <p>{{ $t(key('setting_placeholder')) }}</p>
        <el-tag type="warning">{{ type }}</el-tag>
      </div>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button @click="handleClose">{{ $t(key('cancel')) }}</el-button>
      <el-button type="primary" @click="handleSubmit">{{ $t(key('confirm')) }}</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { i18nMixin } from '@/composables/useI18n'

export default {
  name: 'ProcessStepSettingDialog',
  mixins: [i18nMixin('page.production_master_data.process_model.process_step')],
  props: {
    type: {
      type: String,
      default: ''
    },
    code: {
      type: String,
      default: ''
    },
    title: {
      type: String,
      default: ''
    },
    width: {
      type: String,
      default: '50%'
    },
    visible: {
      type: Boolean,
      default: false
    },
    pluginData: {
      default: ''
    }
  },
  computed: {
    settingTip () {
      return this.$t(this.key('setting_tip'))
    }
  },
  methods: {
    handleClose () {
      this.$emit('close')
    },
    handleSubmit () {
      this.$message.success(this.key('operation_success'))
      this.$emit('close')
    }
  }
}
</script>

<style scoped>
.setting-content {
  padding: 10px 0;
}
.setting-placeholder {
  margin-top: 20px;
  text-align: center;
  padding: 40px 0;
  color: #909399;
}
.setting-placeholder p {
  margin-bottom: 15px;
  font-size: 14px;
}
</style>
