|
|
@ -197,9 +197,9 @@ export default { |
|
|
|
<el-scrollbar> |
|
|
|
<app-list |
|
|
|
v-if="subDrawer" |
|
|
|
:controller="subListQuery.controller" |
|
|
|
:query="subListQuery.query" |
|
|
|
:buttons="subListQuery.buttons" |
|
|
|
:config="subListQuery.config" |
|
|
|
/> |
|
|
|
</el-scrollbar> |
|
|
|
<template #footer> |
|
|
@ -361,7 +361,7 @@ export default { |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
</style>`, |
|
|
|
props: ["modelValue", "config", "querySchema", "controller", "query", "buttons"], |
|
|
|
props: ["modelValue", "config", "querySchema", "query", "buttons"], |
|
|
|
emits: ["command"], |
|
|
|
setup(props, context) { |
|
|
|
/*变量定义*/ |
|
|
@ -395,7 +395,6 @@ export default { |
|
|
|
// const buttons = ref(props.buttons ?? route.meta.children.filter((o) => o.meta.hasPermission));
|
|
|
|
// 添加下行代码暂停权限验证
|
|
|
|
const buttons = ref(props.buttons ?? route.meta.children); |
|
|
|
const baseUrl = props.controller ?? `${route.meta.path}`; |
|
|
|
const queryModel = ref(schemaToModel(config.query.schema)); |
|
|
|
watch(queryModel.value, async (value, oldValue, a) => { |
|
|
|
if (config.query.autoSubmit) { |
|
|
@ -632,7 +631,7 @@ export default { |
|
|
|
editFormTitle.value = t("自定义查询"); |
|
|
|
dialogVisible.value = true; |
|
|
|
} else { |
|
|
|
context.emit("command", item, rows, load); |
|
|
|
context.emit("command", item, rows, showList); |
|
|
|
} |
|
|
|
editFormloading.value = false; |
|
|
|
}; |
|
|
@ -702,25 +701,17 @@ export default { |
|
|
|
dialogVisible.value = false; |
|
|
|
} |
|
|
|
}; |
|
|
|
const showList = (value, nav) => { |
|
|
|
const showList = (value, nav, config) => { |
|
|
|
if (!subDrawer.value) { |
|
|
|
const controller = nav.substr(0, nav.lastIndexOf(".")).toLowerCase(); |
|
|
|
const findRoute = (tree) => { |
|
|
|
for (const item of tree) { |
|
|
|
if (item.meta.controller === controller) { |
|
|
|
return item; |
|
|
|
} |
|
|
|
if (item.children) { |
|
|
|
return findRoute(item.children); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
const targetRoute = router.getRoutes().find((o) => o.meta?.controller === controller); |
|
|
|
subListQuery.value = { |
|
|
|
controller, |
|
|
|
query: { [camelCase(nav.substr(nav.lastIndexOf(".") + 1))]: value }, |
|
|
|
buttons: targetRoute.meta.buttons, |
|
|
|
}; |
|
|
|
const targetRoute = router.getRoutes().find((o) => o.meta?.path === nav); |
|
|
|
// subListQuery.value = {
|
|
|
|
// query: value,
|
|
|
|
// buttons: targetRoute.meta.children,
|
|
|
|
// config,
|
|
|
|
// };
|
|
|
|
subListQuery.value.query = value; |
|
|
|
subListQuery.value.buttons = targetRoute.meta.children; |
|
|
|
subListQuery.value.config = config; |
|
|
|
subDrawer.value = true; |
|
|
|
} |
|
|
|
}; |
|
|
@ -819,6 +810,7 @@ export default { |
|
|
|
queryModel.value.skipCount = (pageModel.pageIndex - 1) * pageModel.pageSize; |
|
|
|
//
|
|
|
|
const postData = JSON.parse(JSON.stringify(queryModel.value)); |
|
|
|
Object.assign(postData, subListQuery.value.query); |
|
|
|
postData.filters = filterList.value.filter((o) => o.column && o.action && (o.value || o.value === false)); |
|
|
|
if (postData.items) { |
|
|
|
delete postData["items"]; |
|
|
@ -861,9 +853,9 @@ export default { |
|
|
|
getSortModel(queryModel.value); |
|
|
|
filterList.value = queryModel.value?.filters ?? []; |
|
|
|
getColumns(config.table.schema); |
|
|
|
if (props.query) { |
|
|
|
Object.assign(queryModel.value.query, props.query); |
|
|
|
} |
|
|
|
// if (props.query) {
|
|
|
|
// Object.assign(queryModel.value.query, props.query);
|
|
|
|
// }
|
|
|
|
if (!config.query.disableQueryOnLoad) { |
|
|
|
await load(); |
|
|
|
} |
|
|
|