105105 @closed =" closeTable"
106106 >
107107 <div >{{ t('ds.edit.table_comment_label') }}</div >
108- <el-input v-model =" currentTable.custom_comment " />
108+ <el-input v-model =" tableComment " />
109109 <div style =" display : flex ; justify-content : flex-end ; margin-top : 20px " >
110110 <el-button @click =" closeTable" >{{ t('common.cancel') }}</el-button >
111111 <el-button type =" primary" @click =" saveTable" >{{ t('common.confirm') }}</el-button >
121121 @closed =" closeField"
122122 >
123123 <div >{{ t('ds.edit.field_comment_label') }}</div >
124- <el-input v-model =" currentField.custom_comment " />
124+ <el-input v-model =" fieldComment " />
125125 <div style =" display : flex ; justify-content : flex-end ; margin-top : 20px " >
126126 <el-button @click =" closeField" >{{ t('common.cancel') }}</el-button >
127127 <el-button type =" primary" @click =" saveField" >{{ t('common.confirm') }}</el-button >
@@ -163,6 +163,8 @@ const tableDialog = ref<boolean>(false)
163163const fieldDialog = ref <boolean >(false )
164164const dsForm = ref ()
165165const ds = ref <any >({})
166+ const tableComment = ref (' ' )
167+ const fieldComment = ref (' ' )
166168
167169const buildData = () => {
168170 return { table: currentTable .value , fields: fieldList .value }
@@ -183,6 +185,7 @@ const back = () => {
183185// };
184186
185187const editTable = () => {
188+ tableComment .value = currentTable .value .custom_comment
186189 tableDialog .value = true
187190}
188191
@@ -191,10 +194,11 @@ const closeTable = () => {
191194}
192195
193196const saveTable = () => {
197+ currentTable .value .custom_comment = tableComment .value
194198 datasourceApi .saveTable (currentTable .value ).then (() => {
195199 closeTable ()
196200 ElMessage ({
197- message: ' Edit Success ' ,
201+ message: t ( ' common.save_success ' ) ,
198202 type: ' success' ,
199203 showClose: true ,
200204 })
@@ -203,6 +207,7 @@ const saveTable = () => {
203207
204208const editField = (row : any ) => {
205209 currentField .value = row
210+ fieldComment .value = currentField .value .custom_comment
206211 fieldDialog .value = true
207212}
208213
@@ -216,10 +221,11 @@ const closeField = () => {
216221}
217222
218223const saveField = () => {
224+ currentField .value .custom_comment = fieldComment .value
219225 datasourceApi .saveField (currentField .value ).then (() => {
220226 closeField ()
221227 ElMessage ({
222- message: ' Edit Success ' ,
228+ message: t ( ' common.save_success ' ) ,
223229 type: ' success' ,
224230 showClose: true ,
225231 })
0 commit comments