Skip to content

Commit 2d9677f

Browse files
committed
display metadata
1 parent 4de52ba commit 2d9677f

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

src/pages/Index.vue

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="q-pa-md home">
33
<div class="q-pt-md">
4-
<q-banner inline-actions class="text-black bg-listcolor">
4+
<q-banner v-show="displayMetadata" inline-actions class="text-black bg-listcolor">
55
<span class="title">元数据</span>
66
<template v-slot:action>
77
<q-btn
@@ -15,7 +15,7 @@
1515
/>
1616
</template>
1717
</q-banner>
18-
<div v-show="metadataExpand" class="q-py-md q-pl-md row items-start q-gutter-md">
18+
<div v-show="displayMetadata && metadataExpand" class="q-py-md q-pl-md row items-start q-gutter-md">
1919
<q-card clickable v-ripple flat bordered class="my-card click-card col"
2020
@click="onMetadataSeqClick()" >
2121
<q-card-section class="bg-primary text-white">
@@ -127,6 +127,8 @@
127127

128128
<script>
129129
import { tableService } from "../service";
130+
import { userService } from "../service";
131+
import { permissionService } from "../service";
130132
131133
export default {
132134
name: "PageHome",
@@ -136,7 +138,8 @@ export default {
136138
businessExpand: true,
137139
modules:[],
138140
active: true,
139-
dataSource: "primary"
141+
dataSource: "primary",
142+
displayMetadata: false
140143
}
141144
},
142145
@@ -186,9 +189,29 @@ export default {
186189
}
187190
188191
this.modules = modules;
192+
189193
} catch (error) {
190194
console.error(error);
191195
}
196+
197+
await this.loadMenu();
198+
},
199+
200+
async loadMenu() {
201+
const menu = {};
202+
try {
203+
const menus = await userService.menu(dataSourceName);
204+
menus.forEach((t) => {
205+
menu[t.code] = t.name;
206+
});
207+
208+
} catch (error) {
209+
console.warn("Please upgrade the back-end version, otherwise it may not be compatible!");
210+
}
211+
212+
const isSuperAdmin = permissionService.isSuperAdmin();
213+
214+
this.displayMetadata = (isSuperAdmin || menu["metadata"]);
192215
},
193216
onConfigClick(module) {
194217
this.$router.push("/dataSource/" + this.dataSource + "/business/module/" + module.id);

0 commit comments

Comments
 (0)