Skip to content

Commit 3fe287c

Browse files
committed
fix: bug fix
1 parent 5449aae commit 3fe287c

File tree

3 files changed

+41
-5
lines changed

3 files changed

+41
-5
lines changed

frontend/src/style.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ body {
164164
.tip {
165165
margin-top: 24px;
166166
}
167+
168+
.ed-message-box__message {
169+
width: 95%;
170+
}
167171
}
168172

169173
.form-content_error {

frontend/src/views/system/permission/auth-tree/FilterFiled.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,22 @@ const emits = defineEmits(['update:item', 'del'])
152152
>
153153
</el-option>
154154
</el-select>
155+
<el-select
156+
v-if="['null', 'empty'].includes(item.term)"
157+
v-model="item.term"
158+
style="max-width: 280px; margin-left: 8px"
159+
:placeholder="t('datasource.Please_select')"
160+
>
161+
<el-option
162+
v-for="ele in operators"
163+
:key="ele.value"
164+
:label="t(ele.label)"
165+
:value="ele.value"
166+
>
167+
</el-option>
168+
</el-select>
155169
<el-input
170+
v-else
156171
v-model="item.value"
157172
style="max-width: 280px; margin-left: 8px"
158173
:placeholder="$t('datasource.please_enter')"

frontend/src/views/system/permission/index.vue

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ const termFormRef = ref()
2525
const columnFormRef = ref()
2626
const drawerTitle = ref('')
2727
const dialogTitle = ref('')
28-
const activeDs = ref({})
29-
const activeTable = ref({})
28+
const activeDs = ref(null)
29+
const activeTable = ref(null)
3030
const ruleList = ref<any[]>([])
3131
3232
const defaultPermission = {
@@ -146,8 +146,8 @@ const saveAuthTree = (val: any) => {
146146
dialogFormVisible.value = false
147147
}
148148
const 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+
214225
const 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

Comments
 (0)