diff --git a/vue-fastapi-backend/module_admin/service/metasecurity_service.py b/vue-fastapi-backend/module_admin/service/metasecurity_service.py index f4eaf75..280e8fc 100644 --- a/vue-fastapi-backend/module_admin/service/metasecurity_service.py +++ b/vue-fastapi-backend/module_admin/service/metasecurity_service.py @@ -688,11 +688,11 @@ async def generate_sql(tablesRowCol: dict, table_columns: dict): # ==================================================== where_conditions = [] - + allow_all_rows = False def build_row_condition(row): # 固定值 & ALL → 不加限制 if row.ctrl_type == '0' and row.ctrl_value == "ALL": - return None + return "__ALLOW_ALL__" # 固定值 if row.ctrl_type == '0': @@ -717,8 +717,12 @@ async def generate_sql(tablesRowCol: dict, table_columns: dict): return None def handle_row_config(row_cfg_list): + nonlocal allow_all_rows for row in row_cfg_list: condition = build_row_condition(row) + if condition == "__ALLOW_ALL__": + allow_all_rows = True + continue if condition: where_conditions.append(condition) @@ -729,9 +733,10 @@ async def generate_sql(tablesRowCol: dict, table_columns: dict): # ==================================================== # 4. WHERE 拼接(无行权限则拒绝访问) # ==================================================== - if where_conditions: sql += " WHERE " + " AND ".join(where_conditions) + elif allow_all_rows: + pass # 不拼 WHERE,等 else: sql += " WHERE 1 = 0" diff --git a/vue-fastapi-frontend/src/views/metadataConfig/taskBizConfig/index.vue b/vue-fastapi-frontend/src/views/metadataConfig/taskBizConfig/index.vue index e173b60..8854d49 100644 --- a/vue-fastapi-frontend/src/views/metadataConfig/taskBizConfig/index.vue +++ b/vue-fastapi-frontend/src/views/metadataConfig/taskBizConfig/index.vue @@ -527,6 +527,8 @@ async function loadLeftTable() { const res = await getMetaDataList(leftQueryForm) leftTableData.value = res.data.rows || [] leftTotal.value = res.data.total || 0 + filterLeftTable() + } catch { ElMessage.error('加载左侧表数据失败') } @@ -617,6 +619,7 @@ function openEditDialog(row) { title.value = '编辑标签任务' Object.assign(form, row) loadRightTable(row.onum) + loadLeftTable() open.value = true } function handleRowDelete(row) { @@ -807,7 +810,6 @@ function formatDateTime(val) { onMounted(() => { getList() getDeptTree() - loadLeftTable() }) // refs to dialog components