@@ -31,6 +31,6 @@ declare namespace FormProps { | |||||
treeAllData?: Array<any>; | treeAllData?: Array<any>; | ||||
records?: Array<any>; | records?: Array<any>; | ||||
/** 表单布局 */ | /** 表单布局 */ | ||||
successful?: () => void; | |||||
successful?: (init?: any) => void; | |||||
} | } | ||||
} | } |
@@ -98,7 +98,7 @@ async function handleSubmit() { | |||||
.add(sysUserProps.record) | .add(sysUserProps.record) | ||||
.then(() => { | .then(() => { | ||||
ElMessage.success("新增成功"); | ElMessage.success("新增成功"); | ||||
sysUserProps.successful!(); //调用父组件的successful方法 | |||||
sysUserProps.successful!(true); //调用父组件的successful方法 | |||||
}) | }) | ||||
.finally(() => { | .finally(() => { | ||||
onClose(); | onClose(); | ||||
@@ -96,7 +96,7 @@ async function handleSubmit() { | |||||
await userManageTeacherApi | await userManageTeacherApi | ||||
.add(sysUserProps.record) | .add(sysUserProps.record) | ||||
.then(() => { | .then(() => { | ||||
sysUserProps.successful!(); //调用父组件的successful方法 | |||||
sysUserProps.successful!(true); //调用父组件的successful方法 | |||||
}) | }) | ||||
.finally(() => { | .finally(() => { | ||||
onClose(); | onClose(); | ||||
@@ -144,7 +144,8 @@ const formRefC = ref<InstanceType<typeof FormClass> | null>(null); | |||||
} | } | ||||
// 刷新表格 | // 刷新表格 | ||||
const RefreshTable = () => { | |||||
const RefreshTable = (init: boolean = false) => { | |||||
if(init)proTable.value!.pageable.pageNum = 1 | |||||
proTable.value?.refresh(); | proTable.value?.refresh(); | ||||
} | } | ||||
@@ -36,7 +36,7 @@ | |||||
</template> | </template> | ||||
</TreeFilter> | </TreeFilter> | ||||
<div class="table-box"> | <div class="table-box"> | ||||
<ProTable ref="proTable" title="服装库管理" :columns="columns" rowKey="clothId" :data="tableData.clothes"> | |||||
<ProTable ref="proTable" :pagination="false" title="服装库管理" :columns="columns" rowKey="clothId" :data="tableData.clothes"> | |||||
<!-- 表格 header 按钮 --> | <!-- 表格 header 按钮 --> | ||||
<template #tableHeader="scope"> | <template #tableHeader="scope"> | ||||
<s-button suffix="服装" @click="onOpen(FormOptEnum.ADD, { clothSetId: clothSetId }, treeData)" /> | <s-button suffix="服装" @click="onOpen(FormOptEnum.ADD, { clothSetId: clothSetId }, treeData)" /> | ||||
@@ -32,7 +32,7 @@ | |||||
<script setup lang="ts"> | <script setup lang="ts"> | ||||
import { SysDepartment, userManageDepartmentApi } from "@/api"; | import { SysDepartment, userManageDepartmentApi } from "@/api"; | ||||
import { FormOptEnum, SysDictEnum } from "@/enums"; | |||||
import { FormOptEnum } from "@/enums"; | |||||
import { required } from "@/utils/formRules"; | import { required } from "@/utils/formRules"; | ||||
import { FormInstance } from "element-plus"; | import { FormInstance } from "element-plus"; | ||||
import { useDictStore } from "@/stores/modules"; | import { useDictStore } from "@/stores/modules"; | ||||
@@ -86,16 +86,16 @@ async function handleSubmit() { | |||||
//提交表单 | //提交表单 | ||||
if (departmentProps.opt == FormOptEnum.ADD) { | if (departmentProps.opt == FormOptEnum.ADD) { | ||||
await userManageDepartmentApi | await userManageDepartmentApi | ||||
.add(departmentProps.record, departmentProps.record.id != undefined) | |||||
.add(departmentProps.record) | |||||
.then(() => { | .then(() => { | ||||
departmentProps.successful!(); //调用父组件的successful方法 | |||||
departmentProps.successful!(true); //调用父组件的successful方法 | |||||
}) | }) | ||||
.finally(() => { | .finally(() => { | ||||
onClose(); | onClose(); | ||||
}); | }); | ||||
} else { | } else { | ||||
await userManageDepartmentApi | await userManageDepartmentApi | ||||
.update(departmentProps.record, departmentProps.record.id != undefined) | |||||
.update(departmentProps.record) | |||||
.then(() => { | .then(() => { | ||||
departmentProps.successful!(); //调用父组件的successful方法 | departmentProps.successful!(); //调用父组件的successful方法 | ||||
}) | }) | ||||
@@ -94,7 +94,8 @@ function onOpen(opt: FormOptEnum, record: {} | SysDepartment.DepartmentInfo = {} | |||||
} | } | ||||
// 刷新表格 | // 刷新表格 | ||||
const RefreshTable = () => { | |||||
const RefreshTable = (init: boolean = false) => { | |||||
if(init)proTable.value!.pageable.pageNum = 1 | |||||
proTable.value?.refresh(); | proTable.value?.refresh(); | ||||
} | } | ||||
@@ -98,7 +98,7 @@ async function handleSubmit() { | |||||
await userManageDormitoryApi | await userManageDormitoryApi | ||||
.add(SysDormitoryProps.record) | .add(SysDormitoryProps.record) | ||||
.then(() => { | .then(() => { | ||||
SysDormitoryProps.successful!(); //调用父组件的successful方法 | |||||
SysDormitoryProps.successful!(true); //调用父组件的successful方法 | |||||
}) | }) | ||||
.finally(() => { | .finally(() => { | ||||
onClose(); | onClose(); | ||||
@@ -125,7 +125,7 @@ async function handleSubmit() { | |||||
await userManageDormitoryApi | await userManageDormitoryApi | ||||
.addDormitory(sysDormitoryProps.record) | .addDormitory(sysDormitoryProps.record) | ||||
.then(() => { | .then(() => { | ||||
sysDormitoryProps.successful!(); //调用父组件的successful方法 | |||||
sysDormitoryProps.successful!(true); //调用父组件的successful方法 | |||||
}) | }) | ||||
.finally(() => { | .finally(() => { | ||||
onClose(); | onClose(); | ||||
@@ -156,12 +156,12 @@ const getCreamaList = () => { | |||||
console.log(sysDormitoryProps.record, 89); | console.log(sysDormitoryProps.record, 89); | ||||
creamaData.value = res.data; | creamaData.value = res.data; | ||||
let dormitoryData = sysDormitoryProps.record; | |||||
let insObj = reactive({ | |||||
let dormitoryData: any = sysDormitoryProps.record; | |||||
let insObj: any = reactive({ | |||||
sensorId: "", | sensorId: "", | ||||
sensorName: "" | sensorName: "" | ||||
}); | }); | ||||
let outObj = reactive({ | |||||
let outObj: any = reactive({ | |||||
sensorId: "", | sensorId: "", | ||||
sensorName: "" | sensorName: "" | ||||
}); | }); | ||||
@@ -293,7 +293,8 @@ function onOpen(opt: FormOptEnum, record: {} | SysDormitory.ChamberInfo = {}) { | |||||
} | } | ||||
// 刷新表格 | // 刷新表格 | ||||
const RefreshTable = () => { | |||||
const RefreshTable = (init: boolean = false) => { | |||||
if(init)proTable.value!.pageable.pageNum = 1 | |||||
proTable.value?.refresh(); | proTable.value?.refresh(); | ||||
} | } | ||||
// 同时刷新列表和树并恢复初始状态 | // 同时刷新列表和树并恢复初始状态 | ||||
@@ -105,7 +105,7 @@ async function handleSubmit() { | |||||
await userManageKeyPersonApi | await userManageKeyPersonApi | ||||
.add(sysUserProps.record) | .add(sysUserProps.record) | ||||
.then(() => { | .then(() => { | ||||
sysUserProps.successful!(); //调用父组件的successful方法 | |||||
sysUserProps.successful!(true); //调用父组件的successful方法 | |||||
}) | }) | ||||
.finally(() => { | .finally(() => { | ||||
onClose(); | onClose(); | ||||
@@ -131,7 +131,8 @@ function onOpen(opt: FormOptEnum, record: {} | SysUserPersonnel.SysUserPerInfo = | |||||
} | } | ||||
// 刷新表格 | // 刷新表格 | ||||
const RefreshTable = () => { | |||||
const RefreshTable = (init: boolean = false) => { | |||||
if(init)proTable.value!.pageable.pageNum = 1 | |||||
proTable.value?.refresh(); | proTable.value?.refresh(); | ||||
} | } | ||||
</script> | </script> | ||||
@@ -103,16 +103,16 @@ async function handleSubmit() { | |||||
//提交表单 | //提交表单 | ||||
if (majorProps.opt == FormOptEnum.ADD) { | if (majorProps.opt == FormOptEnum.ADD) { | ||||
await userManageMajorApi | await userManageMajorApi | ||||
.add(majorProps.record, majorProps.record.id != undefined) | |||||
.add(majorProps.record) | |||||
.then(() => { | .then(() => { | ||||
majorProps.successful!(); //调用父组件的successful方法 | |||||
majorProps.successful!(true); //调用父组件的successful方法 | |||||
}) | }) | ||||
.finally(() => { | .finally(() => { | ||||
onClose(); | onClose(); | ||||
}); | }); | ||||
} else { | } else { | ||||
await userManageMajorApi | await userManageMajorApi | ||||
.update(majorProps.record, majorProps.record.id != undefined) | |||||
.update(majorProps.record) | |||||
.then(() => { | .then(() => { | ||||
majorProps.successful!(); //调用父组件的successful方法 | majorProps.successful!(); //调用父组件的successful方法 | ||||
}) | }) | ||||
@@ -118,7 +118,8 @@ function onOpen(opt: FormOptEnum, record: {} | SysMajor.MajorInfo = {}) { | |||||
} | } | ||||
// 刷新表格 | // 刷新表格 | ||||
const RefreshTable = () => { | |||||
const RefreshTable = (init: boolean = false) => { | |||||
if(init)proTable.value!.pageable.pageNum = 1 | |||||
proTable.value?.refresh(); | proTable.value?.refresh(); | ||||
} | } | ||||
@@ -105,7 +105,7 @@ async function handleSubmit() { | |||||
await userManagePersonnelApi | await userManagePersonnelApi | ||||
.add(sysUserProps.record) | .add(sysUserProps.record) | ||||
.then(() => { | .then(() => { | ||||
sysUserProps.successful!(); //调用父组件的successful方法 | |||||
sysUserProps.successful!(true); //调用父组件的successful方法 | |||||
}) | }) | ||||
.finally(() => { | .finally(() => { | ||||
onClose(); | onClose(); | ||||
@@ -160,8 +160,8 @@ function onOpen(opt: FormOptEnum, record: {} | SysUserPersonnel.SysUserPerInfo = | |||||
} | } | ||||
// 刷新表格 | // 刷新表格 | ||||
const RefreshTable = () => { | |||||
proTable.value!.pageable.pageNum = 1; | |||||
const RefreshTable = (init: boolean = false) => { | |||||
if(init)proTable.value!.pageable.pageNum = 1 | |||||
proTable.value?.refresh(); | proTable.value?.refresh(); | ||||
// treeFilter.value?.refresh(); //刷新树形筛选器 | // treeFilter.value?.refresh(); //刷新树形筛选器 | ||||
} | } | ||||