|
|
|
@ -56,7 +56,7 @@ watch(
|
|
|
|
|
console.log(newValue, "newValue");
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
const ruleFormRef = ref<FormInstance>();
|
|
|
|
|
const ruleAccountFormRef = ref<FormInstance>();
|
|
|
|
|
const accountForm = reactive({
|
|
|
|
|
id: "",
|
|
|
|
|
headPicId: "",
|
|
|
|
@ -154,9 +154,23 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
|
|
|
|
};
|
|
|
|
|
const resetForm = (formEl: FormInstance | undefined) => {
|
|
|
|
|
if (!formEl) return;
|
|
|
|
|
formEl.resetFields();
|
|
|
|
|
// formEl.resetFields();
|
|
|
|
|
accountForm.id = "";
|
|
|
|
|
accountForm.headPicId = "";
|
|
|
|
|
accountForm.account = "";
|
|
|
|
|
accountForm.username = "";
|
|
|
|
|
accountForm.deptId = "";
|
|
|
|
|
accountForm.roleIds = [];
|
|
|
|
|
accountForm.remark = "";
|
|
|
|
|
};
|
|
|
|
|
const handleDrawerClosed = () => {
|
|
|
|
|
accountForm.id = "";
|
|
|
|
|
accountForm.headPicId = "";
|
|
|
|
|
accountForm.account = "";
|
|
|
|
|
accountForm.username = "";
|
|
|
|
|
accountForm.deptId = "";
|
|
|
|
|
accountForm.roleIds = [];
|
|
|
|
|
accountForm.remark = "";
|
|
|
|
|
props.closeDrawer();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -238,7 +252,7 @@ onMounted(() => {
|
|
|
|
|
<el-form
|
|
|
|
|
:model="accountForm"
|
|
|
|
|
:rules="rules"
|
|
|
|
|
ref="ruleFormRef"
|
|
|
|
|
ref="ruleAccountFormRef"
|
|
|
|
|
label-width="auto"
|
|
|
|
|
>
|
|
|
|
|
<el-form-item label="头像" prop="headPicId">
|
|
|
|
@ -323,10 +337,12 @@ onMounted(() => {
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div class="drawer_footer">
|
|
|
|
|
<el-button plain @click="resetForm(ruleFormRef)">重置</el-button>
|
|
|
|
|
<el-button plain @click="resetForm(ruleAccountFormRef)"
|
|
|
|
|
>重置</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="submitForm(ruleFormRef)"
|
|
|
|
|
@click="submitForm(ruleAccountFormRef)"
|
|
|
|
|
v-if="props.accountFromType !== 'view'"
|
|
|
|
|
>确定</el-button
|
|
|
|
|
>
|
|
|
|
|