fix : 修改命名规范

This commit is contained in:
2024-09-16 14:34:24 +08:00
parent 3882fa4ed5
commit 4192064e3f
2 changed files with 11 additions and 13 deletions

View File

@@ -28,7 +28,7 @@
<script setup> <script setup>
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { getCodeImg } from '../../api/login'; import { getCodeImg } from '@/api/login';
import { useAuthStore } from '@/stores/userstore' import { useAuthStore } from '@/stores/userstore'
import { ElLoading } from 'element-plus' import { ElLoading } from 'element-plus'
import { User,Lock, Key } from '@element-plus/icons-vue' import { User,Lock, Key } from '@element-plus/icons-vue'
@@ -85,6 +85,7 @@ const handleLogin = (instance) => {
getCode() getCode()
onBeforeUnmount(() => { onBeforeUnmount(() => {
getCode()
ElLoading.service({ ElLoading.service({
lock: true, lock: true,
text: '登录中...', text: '登录中...',

View File

@@ -1,12 +1,11 @@
<template> <template>
<div class="address-book"> <div class="address-book">
<fvSearchForm :searchConfig="searchConfig" @search="searchAddressBook"></fvSearchForm>
<fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm> <fvTable ref="tableIns" :tableConfig="addressBookTableConfig" @headBtnClick="headBtnClick"
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick"
@selectionChange="selectionChange"></fvTable> @selectionChange="selectionChange"></fvTable>
<fvFormDialog ref="formDialogRef" :title="dialogTitle" :dialogType="dialogType" <fvFormDialog ref="formDialogRef" :title="dialogTitle" :dialogType="dialogType"
:form-schema="formSchema" :form-rules="formRules" @dialogCancel="handleCancel" :form-schema="formSchema" :form-rules="formRules"
@dialogSubmit="handleSubmit"></fvFormDialog> @dialogSubmit="handleSubmitAddressBook"></fvFormDialog>
</div> </div>
</template> </template>
@@ -18,7 +17,6 @@ import {ElMessage, ElMessageBox} from "element-plus";
const router = useRouter() const router = useRouter()
const tableIns = ref() const tableIns = ref()
const formDialogRef = ref() const formDialogRef = ref()
const delBtnDisabled = ref(true)
const contactIds = ref(""); const contactIds = ref("");
const dialogTitle = ref(""); const dialogTitle = ref("");
const dialogType = ref(""); const dialogType = ref("");
@@ -154,7 +152,7 @@ const searchConfig = reactive([
component: 'el-input', component: 'el-input',
} }
]) ])
const tableConfig = reactive({ const addressBookTableConfig = reactive({
columns: [ columns: [
{ {
type: 'selection', type: 'selection',
@@ -237,14 +235,14 @@ const tableConfig = reactive({
{name: '删除', key: 'delete', type: 'danger'}, {name: '删除', key: 'delete', type: 'danger'},
] ]
}) })
const search = (val) => { const searchAddressBook = (val) => {
let obj = {...val} let obj = {...val}
if (obj.dateValue) { if (obj.dateValue) {
obj.startTime = obj.dateValue[0] obj.startTime = obj.dateValue[0]
obj.endTime = obj.dateValue[1] obj.endTime = obj.dateValue[1]
delete obj.dateValue delete obj.dateValue
} }
tableConfig.params = obj addressBookTableConfig.params = obj
tableIns.value.refresh() tableIns.value.refresh()
} }
@@ -264,6 +262,7 @@ const handleAdd = () => {
dialogTitle.value = "新增通讯录"; dialogTitle.value = "新增通讯录";
dialogType.value = "add"; dialogType.value = "add";
nextTick(() => { nextTick(() => {
formDialogRef.value.getFormInstance().setValues({})
// 清空校验 // 清空校验
formDialogRef.value.getFormInstance().clearValidate() formDialogRef.value.getFormInstance().clearValidate()
formDialogRef.value.getFormInstance().resetFields() formDialogRef.value.getFormInstance().resetFields()
@@ -291,11 +290,9 @@ const getDetail = (row) => {
const selectionChange = (selection) => { const selectionChange = (selection) => {
if (selection.length !== 0) { if (selection.length !== 0) {
delBtnDisabled.value = false
contactIds.value = selection.map(item => item.contactsId).join() contactIds.value = selection.map(item => item.contactsId).join()
} else { } else {
contactIds.value='' contactIds.value=''
delBtnDisabled.value = true
} }
} }
const deleteContactMethod = (contactsId) => { const deleteContactMethod = (contactsId) => {
@@ -332,7 +329,7 @@ const handleSingleDelete = (row) => {
} }
//提交 //提交
const handleSubmit = async (formInstance) => { const handleSubmitAddressBook = async (formInstance) => {
if (!formInstance) return; if (!formInstance) return;
let validate = await formInstance.validate() let validate = await formInstance.validate()
if (!validate.isValidate) return; if (!validate.isValidate) return;