@@ -673,21 +673,11 @@ const deleteHandler = (row: any) => {
673673 })
674674}
675675
676- /* const openDialog = () => {
677- dialogFormVisible.value = true
678- } */
679- const resetForm = () => {
680- if (! termFormRef .value ) return
681- Object .keys (state .form ).forEach ((key ) => {
682- state .form [key as keyof typeof state .form ] = ' '
683- })
684- }
685-
686676const closeForm = () => {
687677 dialogFormVisible .value = false
688678}
689679const onFormClose = () => {
690- resetForm ()
680+ state . form = { ... defaultForm }
691681 dialogFormVisible .value = false
692682}
693683
@@ -727,19 +717,14 @@ const search = () => {
727717}
728718const addTerm = () => {
729719 const { account, email, name, oid, status } = state .form
730- userApi
731- .add ({ account , email , name , oid , status })
732- .then (() => {
733- dialogFormVisible .value = false
734- search ()
735- ElMessage ({
736- type: ' success' ,
737- message: t (' common.save_success' ),
738- })
739- })
740- .finally (() => {
741- state .form = { ... defaultForm }
720+ userApi .add ({ account , email , name , oid , status }).then (() => {
721+ dialogFormVisible .value = false
722+ search ()
723+ ElMessage ({
724+ type: ' success' ,
725+ message: t (' common.save_success' ),
742726 })
727+ })
743728}
744729const editTerm = () => {
745730 const { account, id, create_time, email, language, name, oid, oid_list, origin, status } =
0 commit comments