Browse Source

Merge remote-tracking branch 'origin/master'

master
xueyinfei 1 month ago
parent
commit
90ce963fc3
  1. 11
      vue-fastapi-backend/module_admin/service/metasecurity_service.py
  2. 4
      vue-fastapi-frontend/src/views/metadataConfig/taskBizConfig/index.vue

11
vue-fastapi-backend/module_admin/service/metasecurity_service.py

@ -688,11 +688,11 @@ async def generate_sql(tablesRowCol: dict, table_columns: dict):
# ==================================================== # ====================================================
where_conditions = [] where_conditions = []
allow_all_rows = False
def build_row_condition(row): def build_row_condition(row):
# 固定值 & ALL → 不加限制 # 固定值 & ALL → 不加限制
if row.ctrl_type == '0' and row.ctrl_value == "ALL": if row.ctrl_type == '0' and row.ctrl_value == "ALL":
return None return "__ALLOW_ALL__"
# 固定值 # 固定值
if row.ctrl_type == '0': if row.ctrl_type == '0':
@ -717,8 +717,12 @@ async def generate_sql(tablesRowCol: dict, table_columns: dict):
return None return None
def handle_row_config(row_cfg_list): def handle_row_config(row_cfg_list):
nonlocal allow_all_rows
for row in row_cfg_list: for row in row_cfg_list:
condition = build_row_condition(row) condition = build_row_condition(row)
if condition == "__ALLOW_ALL__":
allow_all_rows = True
continue
if condition: if condition:
where_conditions.append(condition) where_conditions.append(condition)
@ -729,9 +733,10 @@ async def generate_sql(tablesRowCol: dict, table_columns: dict):
# ==================================================== # ====================================================
# 4. WHERE 拼接(无行权限则拒绝访问) # 4. WHERE 拼接(无行权限则拒绝访问)
# ==================================================== # ====================================================
if where_conditions: if where_conditions:
sql += " WHERE " + " AND ".join(where_conditions) sql += " WHERE " + " AND ".join(where_conditions)
elif allow_all_rows:
pass # 不拼 WHERE,等
else: else:
sql += " WHERE 1 = 0" sql += " WHERE 1 = 0"

4
vue-fastapi-frontend/src/views/metadataConfig/taskBizConfig/index.vue

@ -527,6 +527,8 @@ async function loadLeftTable() {
const res = await getMetaDataList(leftQueryForm) const res = await getMetaDataList(leftQueryForm)
leftTableData.value = res.data.rows || [] leftTableData.value = res.data.rows || []
leftTotal.value = res.data.total || 0 leftTotal.value = res.data.total || 0
filterLeftTable()
} catch { } catch {
ElMessage.error('加载左侧表数据失败') ElMessage.error('加载左侧表数据失败')
} }
@ -617,6 +619,7 @@ function openEditDialog(row) {
title.value = '编辑标签任务' title.value = '编辑标签任务'
Object.assign(form, row) Object.assign(form, row)
loadRightTable(row.onum) loadRightTable(row.onum)
loadLeftTable()
open.value = true open.value = true
} }
function handleRowDelete(row) { function handleRowDelete(row) {
@ -807,7 +810,6 @@ function formatDateTime(val) {
onMounted(() => { onMounted(() => {
getList() getList()
getDeptTree() getDeptTree()
loadLeftTable()
}) })
// refs to dialog components // refs to dialog components

Loading…
Cancel
Save