<template>
  <el-dialog
    :title="dialog.title"
    center
    append-to-body
    :visible.sync="dialog.show"
    width="30%">
    <el-form ref="dialog.form" :model="dialog.form" label-width="80px">
      <el-form-item label="用户名" v-if="dialog.dialogType === 0">
        <el-input v-model="dialog.form.username"></el-input>
      </el-form-item>
      <el-form-item label="密码" v-if="dialog.dialogType === 0">
        <el-input v-model="dialog.form.password"></el-input>
      </el-form-item>
      <el-form-item label="角色">
        <el-input v-model="dialog.form.role_id"></el-input>
      </el-form-item>
      <el-form-item label="简述">
        <el-input v-model="dialog.form.desc"></el-input>
      </el-form-item>
      <el-form-item label="状态" v-if="dialog.dialogType === 1">
        <el-select v-model="dialog.form.status" placeholder="请选择">
          <el-option
            v-for="item in dialog.select"
            :key="item.code"
            :label="item.value"
            :value="item.code">
          </el-option>
        </el-select>
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
        <el-button @click="dialog.show = false">取 消</el-button>
        <el-button type="primary" @click="sub">确 定</el-button>
      </span>
  </el-dialog>
</template>

<script>
    export default {
        name: "adminDialog"
    }
</script>

<style scoped>

</style>
