From c2cc67d45ac0ef233bd80a32ece9209cf24f25d6 Mon Sep 17 00:00:00 2001
From: wanggang <76527413@qq.com>
Date: Sat, 1 Jul 2023 14:19:59 +0800
Subject: [PATCH] update
---
.../src/WTA/wwwroot/components/list/index.js | 57 +++++++++++++++++--
docs/demo/src/WTA/wwwroot/views/list.js | 17 +-----
2 files changed, 52 insertions(+), 22 deletions(-)
diff --git a/docs/demo/src/WTA/wwwroot/components/list/index.js b/docs/demo/src/WTA/wwwroot/components/list/index.js
index 83a79e12..b5a3f5f7 100644
--- a/docs/demo/src/WTA/wwwroot/components/list/index.js
+++ b/docs/demo/src/WTA/wwwroot/components/list/index.js
@@ -12,6 +12,7 @@ import VueOfficeExcel from "@vue-office/excel";
import { camelCase, capitalize } from "lodash";
export default {
+ name: "AppList",
components: { AppForm, SvgIcon, AppFormInput, VueOfficeExcel },
template: html`
@@ -30,7 +31,7 @@ export default {
-
+
{{getProp(scope.row,item.navigation)}}
+
+
+
+
+
+
+
+
+
@@ -95,7 +105,7 @@ export default {
-
+
-
+
+
+
+
+
+
+
+
{{editFormTitle}}
@@ -185,22 +209,30 @@ export default {
`,
- props: ["modelValue"],
+ styles: html``,
+ props: ["modelValue", "controller", "buttons"],
emits: ["command"],
async setup(props, context) {
const tableRef = ref(null);
const columns = ref([]);
const filterDrawer = ref(false);
+ const subDrawer = ref(false);
+ const subListQuery = ref({});
const tableLoading = ref(false);
const selectedRows = ref([]);
const dialogVisible = ref(false);
const route = useRoute();
const { t } = useI18n();
- const baseUrl = `${route.meta.controller}`;
+ const buttons = ref(props.buttons ?? route.meta.buttons);
+ const baseUrl = props.controller ?? `${route.meta.controller}`;
const indexUrl = `${baseUrl}/index`;
const vm = (await get(indexUrl)).data;
const schema = vm.schema;
const data = reactive(vm.model ?? schemaToModel(schema));
+ //Object.assign(data,prop.)
const sortColumns = ref(new Map());
const getSortModel = (model) => {
const orderBy = model.orderBy
@@ -355,19 +387,30 @@ export default {
dialogVisible.value = false;
}
};
+ const showList = (value, nav) => {
+ if (!subDrawer.value) {
+ subListQuery.value = {
+ controller: nav.substr(0, nav.lastIndexOf(".")),
+ query: { [nav.substr(nav.lastIndexOf(".") + 1)]: value },
+ buttons: [],
+ };
+ subDrawer.value = true;
+ }
+ };
await load(indexUrl);
return {
- route,
tableRef,
tableLoading,
columns,
showColumn,
filterDrawer,
+ subDrawer,
dialogVisible,
selectedRows,
schema,
queryFromSchema,
tableSchema,
+ buttons,
data,
sortModel,
getClass,
@@ -385,6 +428,8 @@ export default {
load,
click,
submit,
+ showList,
+ subListQuery,
};
},
};
diff --git a/docs/demo/src/WTA/wwwroot/views/list.js b/docs/demo/src/WTA/wwwroot/views/list.js
index 257be4b7..dc6b63bf 100644
--- a/docs/demo/src/WTA/wwwroot/views/list.js
+++ b/docs/demo/src/WTA/wwwroot/views/list.js
@@ -5,22 +5,7 @@ import router from "../router/index.js";
export default {
components: { AppList },
template: html`
-
-
-
- {{scope.row.id}}
-
-
- {{scope.row.parent?.id}}
-
-
-
- (console.log(rows))">{{$t('test')}}
-
-
- (console.log(rows))">{{$t('test')}}
-
-
+
`,
setup() {
console.log(router.currentRoute.value.fullPath);