File tree Expand file tree Collapse file tree 1 file changed +26
-3
lines changed Expand file tree Collapse file tree 1 file changed +26
-3
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" q-pa-md home" >
3
3
<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" >
5
5
<span class =" title" >元数据</span >
6
6
<template v-slot :action >
7
7
<q-btn
15
15
/>
16
16
</template >
17
17
</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" >
19
19
<q-card clickable v-ripple flat bordered class =" my-card click-card col"
20
20
@click =" onMetadataSeqClick()" >
21
21
<q-card-section class =" bg-primary text-white" >
127
127
128
128
<script >
129
129
import { tableService } from " ../service" ;
130
+ import { userService } from " ../service" ;
131
+ import { permissionService } from " ../service" ;
130
132
131
133
export default {
132
134
name: " PageHome" ,
@@ -136,7 +138,8 @@ export default {
136
138
businessExpand: true ,
137
139
modules: [],
138
140
active: true ,
139
- dataSource: " primary"
141
+ dataSource: " primary" ,
142
+ displayMetadata: false
140
143
}
141
144
},
142
145
@@ -186,9 +189,29 @@ export default {
186
189
}
187
190
188
191
this .modules = modules;
192
+
189
193
} catch (error) {
190
194
console .error (error);
191
195
}
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" ]);
192
215
},
193
216
onConfigClick (module ) {
194
217
this .$router .push (" /dataSource/" + this .dataSource + " /business/module/" + module .id );
You can’t perform that action at this time.
0 commit comments