Browse Source

编辑字段回显问题处理

master
si@aidatagov.com 1 month ago
parent
commit
fda11fb000
  1. 73
      vue-fastapi-frontend/src/views/meta/metasercurity/MetaSecurityCol.vue
  2. 70
      vue-fastapi-frontend/src/views/meta/metasercurity/MetaSecurityRow.vue

73
vue-fastapi-frontend/src/views/meta/metasercurity/MetaSecurityCol.vue

@ -520,33 +520,68 @@ const getDeptTree = async () => {
} }
}; };
const loadSchemaList = async (dbRID) => {
const res = await getMetaMdlNameList(dbRID)
schemaList.value = res.data || []
}
const loadTableList = async (mdlName) => {
const res = await getMetaDataList({
ssysId: form.value.dbRID,
mdlName,
pageNum: 1,
pageSize: 10000
})
tableList.value = res.data.rows.map(item => item.tabEngName)
}
const loadColumnList = async (tabName) => {
const res = await getColumnList({
ssysId: form.value.dbRID,
mdlName: form.value.dbSName,
tabName
})
columnList.value = ["ALL", ...res.data.map(item => item.fldEngName)]
}
// //
const handleEdit = (row) => { const handleEdit = async (row) => {
reset(); reset()
const colId = row.colId || ids.value; dialogTitle.value = "编辑列配置"
const colId = row.colId || ids.value
const res = await getMetaSecurityCol(colId)
const data = res.data
//
data.dbCName = data.dbCName ? data.dbCName.split(',') : []
//
form.value = data
getMetaSecurityCol(colId).then(response => { //
const data = response.data; await loadSchemaList(form.value.dbRID)
// //
if (data.dbCName && typeof data.dbCName === 'string') { if (form.value.dbSName) {
data.dbCName = data.dbCName.split(','); await loadTableList(form.value.dbSName)
} else if (!data.dbCName) {
data.dbCName = [];
} }
form.value = data; //
if (form.value.dbTName) {
await loadColumnList(form.value.dbTName)
}
//
if (data.objType === '0') { if (data.objType === '0') {
userOrRoleList.value = userList.value; // userOrRoleList.value = userList.value
} else if (data.objType === '1') { } else if (data.objType === '1') {
userOrRoleList.value = roleList.value; // userOrRoleList.value = roleList.value
} else {
userOrRoleList.value = [];
} }
dialogVisible.value = true;
dialogTitle.value = "编辑列配置"; dialogVisible.value = true
}); }
};
// //

70
vue-fastapi-frontend/src/views/meta/metasercurity/MetaSecurityRow.vue

@ -472,33 +472,67 @@ const handlePagination = (pageNum, pageSize) => {
// //
const handleEdit = (row) => {
reset(); const handleEdit = async (row) => {
reset()
dialogTitle.value = "编辑行配置"
const rowId = row.rowId || ids.value; const rowId = row.rowId || ids.value;
const res = await getMetaSecurityRow(rowId)
const data = res.data
//
data.dbCName = data.dbCName ? data.dbCName.split(',') : []
getMetaSecurityRow(rowId).then(response => { //
const data = response.data; form.value = data
//
await loadSchemaList(form.value.dbRID)
//
if (form.value.dbSName) {
await loadTableList(form.value.dbSName)
}
// //
if (data.dbCName && typeof data.dbCName === 'string') { if (form.value.dbTName) {
data.dbCName = data.dbCName.split(','); await loadColumnList(form.value.dbTName)
} else if (!data.dbCName) {
data.dbCName = [];
} }
//
if (data.objType === '0') { if (data.objType === '0') {
userOrRoleList.value = userList.value; // userOrRoleList.value = userList.value
} else if (data.objType === '1') { } else if (data.objType === '1') {
userOrRoleList.value = roleList.value; // userOrRoleList.value = roleList.value
} else {
userOrRoleList.value = [];
} }
form.value = data;
dialogVisible.value = true; dialogVisible.value = true
dialogTitle.value = "编辑行配置"; }
});
}; const loadSchemaList = async (dbRID) => {
const res = await getMetaMdlNameList(dbRID)
schemaList.value = res.data || []
}
const loadTableList = async (mdlName) => {
const res = await getMetaDataList({
ssysId: form.value.dbRID,
mdlName,
pageNum: 1,
pageSize: 10000
})
tableList.value = res.data.rows.map(item => item.tabEngName)
}
const loadColumnList = async (tabName) => {
const res = await getColumnList({
ssysId: form.value.dbRID,
mdlName: form.value.dbSName,
tabName
})
columnList.value = ["ALL", ...res.data.map(item => item.fldEngName)]
}
// //
function handleSave() { function handleSave() {
proxy.$refs["formRef"].validate(valid => { proxy.$refs["formRef"].validate(valid => {

Loading…
Cancel
Save