@@ -25,8 +25,8 @@ const termFormRef = ref()
2525const columnFormRef = ref ()
2626const drawerTitle = ref (' ' )
2727const dialogTitle = ref (' ' )
28- const activeDs = ref ({} )
29- const activeTable = ref ({} )
28+ const activeDs = ref (null )
29+ const activeTable = ref (null )
3030const ruleList = ref <any []>([])
3131
3232const defaultPermission = {
@@ -146,8 +146,8 @@ const saveAuthTree = (val: any) => {
146146 dialogFormVisible .value = false
147147}
148148const getDsList = (row : any ) => {
149- activeDs .value = {}
150- activeTable .value = {}
149+ activeDs .value = null
150+ activeTable .value = null
151151 datasourceApi
152152 .list ()
153153 .then ((res : any ) => {
@@ -211,6 +211,17 @@ const handleColumnPermission = (row: any) => {
211211 : t (' permission.add_column_permission' )
212212}
213213
214+ const handleInitDsIdChange = (val : any ) => {
215+ columnForm .ds_id = val .id
216+ columnForm .ds_name = val .name
217+ datasourceApi .tableList (val .id ).then ((res : any ) => {
218+ tableListOptions .value = res || []
219+ activeTable .value = null
220+ fieldListOptions .value = []
221+ columnForm .permissions = []
222+ })
223+ }
224+
214225const handleDsIdChange = (val : any ) => {
215226 columnForm .ds_id = val .id
216227 columnForm .ds_name = val .name
@@ -598,6 +609,8 @@ const columnRules = {
598609 >
599610 <el-form-item prop =" name" :label =" t('permission.rule_group_name')" >
600611 <el-input
612+ maxlength =" 50"
613+ clearable
601614 v-model =" currentPermission.name"
602615 :placeholder ="
603616 $t('datasource.please_enter') +
@@ -741,6 +754,8 @@ const columnRules = {
741754 <el-form-item prop =" name" :label =" t('permission.rule_name')" >
742755 <el-input
743756 v-model =" columnForm.name"
757+ maxlength =" 50"
758+ clearable
744759 :placeholder ="
745760 $t('datasource.please_enter') + $t('common.empty') + $t('permission.rule_name')
746761 "
@@ -750,12 +765,13 @@ const columnRules = {
750765 <el-form-item prop =" table_id" :label =" t('permission.data_table')" >
751766 <el-select
752767 v-model =" activeDs"
768+ filterable
753769 style =" width : 416px "
754770 value-key =" id"
755771 :placeholder ="
756772 $t('datasource.Please_select') + $t('common.empty') + $t('permission.data_source')
757773 "
758- @change =" handleDsIdChange "
774+ @change =" handleInitDsIdChange "
759775 >
760776 <el-option
761777 v-for =" item in dsListOptions"
@@ -766,6 +782,7 @@ const columnRules = {
766782 </el-select >
767783 <el-select
768784 v-model =" activeTable"
785+ filterable
769786 style =" width : 416px ; margin-left : auto "
770787 :disabled =" !columnForm.ds_id"
771788 value-key =" id"
0 commit comments