<template>
  <!-- 工程管理 新增、编辑 表单组件 -->
  <div>
    <el-form
      label-width="100px"
      size="medium"
      ref="pwdFormRef"
      :model="projectParams"
      :rules="projectParamsRules"
    >
      <el-form-item label="密码" prop="password">
        <el-input type="password" :maxlength="50" v-model="projectParams.password" placeholder="请输入" />
      </el-form-item>
    </el-form>

    <div style="display: flex; justify-content: right">
      <el-button type="success" @click="onSubmit">确认</el-button>
      <el-button
        @click="
          () => {
            this.$emit('closeDialog');
          }
        "
      >取消</el-button
      >
    </div>
  </div>
</template>

<script>
export default {
  name: "pwdForm",
  components: {},
  created() {

  },
  async mounted() {

  },
  data() {
    return {
      projectParams: {
        password: undefined, // 密码
      },
      // 校验规则
      projectParamsRules: {
        password: [
          {
            required: true,
            message: "请输入密码",
            trigger: "blur",
          },
        ],
      },
    };
  },
  methods: {
    /** 确认按钮 */
    onSubmit() {
      this.$refs.pwdFormRef.validate(async (valid) => {
        if (valid) {
          console.log(this.projectParams)
        }
      });
    },
  },
};
</script>

<style scoped>
::v-deep .el-select {
  width: 100%;
}
::v-deep .el-form-item__label {
  font-weight: normal;
}
</style>
