refactor: eslint代码检查优化

Former-commit-id: 4c11b5d0cdd10f28148cf3d9b593f85e082cdc51
This commit is contained in:
郝先瑞
2022-04-15 00:45:06 +08:00
parent 15022f51b9
commit dd93144788
69 changed files with 820 additions and 1774 deletions

View File

@@ -179,7 +179,6 @@ const state = reactive({
ids: [] as number[],
// 非单个禁用
single: true,
disabled: false,
loading: true,
// 表格树数据
deptList: [] as DeptItem[],
@@ -205,9 +204,7 @@ const state = reactive({
});
const {
ids,
single,
disabled,
loading,
deptList,
deptOptions,
@@ -257,14 +254,6 @@ async function loadDeptOptions() {
});
}
/**
* 表单重置
**/
function resetForm() {
state.formData.id = undefined;
dataFormRef.value.resetFields();
}
/**
* 添加部门
*/
@@ -300,15 +289,15 @@ function submitForm() {
dataForm.validate((valid: any) => {
if (valid) {
if (state.formData.id) {
updateDept(state.formData.id, state.formData).then((res: any) => {
updateDept(state.formData.id, state.formData).then(() => {
ElMessage.success("修改成功");
state.dialog.visible = false;
cancel();
handleQuery();
});
} else {
addDept(state.formData).then(() => {
ElMessage.success("新增成功");
state.dialog.visible = false;
cancel();
handleQuery();
});
}
@@ -345,7 +334,8 @@ function handleDelete(row: any) {
* 取消/关闭弹窗
**/
function cancel() {
resetForm();
state.formData.id = undefined;
dataFormRef.value.resetFields();
state.dialog.visible = false;
}