feat : 通讯录管理
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm>
|
||||
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick"></fvTable>
|
||||
<fvFormDialog v-if="showAddOrEditUserDialog" ref="formDialogRef" :title="title" :form-schema="formSchema" :form-rules="formRules" @dialogCancel="handleCancel" @dialogSubmit="handleSubmit"></fvFormDialog>
|
||||
<fvFormDialog v-if="showAddOrEditUserDialog" ref="formDialogRef" :title="dialogTitle" :form-schema="formSchema" :form-rules="formRules" @dialogCancel="handleCancel" @dialogSubmit="handleSubmit"></fvFormDialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -12,6 +12,7 @@ import {useCacheStore} from "@/stores/cache.js";
|
||||
const tableIns = ref()
|
||||
const formDialogRef = ref()
|
||||
const showAddOrEditUserDialog = ref(false)
|
||||
const dialogTitle = ref("");
|
||||
const searchConfig = reactive([
|
||||
{
|
||||
label: '用户名称',
|
||||
@@ -181,7 +182,7 @@ const handleAdd = () => {
|
||||
// showAddOrEditUserDialog.value = true
|
||||
// formRules.value.password[0].required = true
|
||||
// restForm();
|
||||
// title.value = "新增用户";
|
||||
// dialogTitle.value = "新增用户";
|
||||
// nextTick(()=>{
|
||||
// // 清空校验
|
||||
// formDialogRef.value.getFormInstance().clearValidate()
|
||||
@@ -190,7 +191,6 @@ const handleAdd = () => {
|
||||
};
|
||||
//取消
|
||||
const handleCancel = () => {
|
||||
// restForm();
|
||||
showAddOrEditUserDialog.value = false;
|
||||
};
|
||||
|
||||
@@ -199,35 +199,16 @@ const handleSubmit = async (formInstance) => {
|
||||
if (!formInstance) return;
|
||||
formInstance.validate(async (valid) => {
|
||||
if (!valid) return;
|
||||
if (title.value === "新增用户") {
|
||||
addUser(userForm.value).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg);
|
||||
isVisited.value = false;
|
||||
} else {
|
||||
ElMessage.error(res.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
// if (title.value === "新增用户") {
|
||||
// addUser(userForm.value).then(res => {
|
||||
// if (res.code === 1000) {
|
||||
// ElMessage.success(res.msg);
|
||||
// isVisited.value = false;
|
||||
// } else {
|
||||
// ElMessage.error(res.msg);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
})
|
||||
}
|
||||
|
||||
const userForm = ref({});
|
||||
const formInstance = ref();
|
||||
const isVisited = ref(false);
|
||||
const title = ref("");
|
||||
// const restForm = () => {
|
||||
// userForm.value = {
|
||||
// userName: null,
|
||||
// nickName: null,
|
||||
// phoneNumber: null,
|
||||
// email: null,
|
||||
// password: null,
|
||||
// sex: null,
|
||||
// state: "1",
|
||||
// };
|
||||
// };
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user