页面调整
This commit is contained in:
@@ -9,3 +9,6 @@ VITE_OPEN=true
|
||||
|
||||
# 打包后是否生成包分析文件
|
||||
VITE_REPORT=false
|
||||
|
||||
# 浏览器是否显示vue的告警信息
|
||||
VUE_APP_SILENCE_WARNINGS=true
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
import { computed } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useAuthStore } from "@/stores/modules/auth";
|
||||
import { computed } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useAuthStore } from '@/stores/modules/auth'
|
||||
|
||||
/**
|
||||
* @description 页面按钮权限
|
||||
* */
|
||||
export const useAuthButtons = () => {
|
||||
const route = useRoute();
|
||||
const authStore = useAuthStore();
|
||||
const authButtons = authStore.authButtonListGet[route.name as string] || [];
|
||||
|
||||
const route = useRoute()
|
||||
const authStore = useAuthStore()
|
||||
const authButtons = authStore.authButtonListGet[route.name as string] || []
|
||||
const BUTTONS = computed(() => {
|
||||
let currentPageAuthButton: { [key: string]: boolean } = {};
|
||||
authButtons.forEach(item => (currentPageAuthButton[item] = true));
|
||||
return currentPageAuthButton;
|
||||
});
|
||||
let currentPageAuthButton: { [key: string]: boolean } = {}
|
||||
authButtons.forEach(item => (currentPageAuthButton[item] = true))
|
||||
// currentPageAuthButton.status = true
|
||||
return currentPageAuthButton
|
||||
})
|
||||
|
||||
return {
|
||||
BUTTONS
|
||||
};
|
||||
};
|
||||
BUTTONS,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<el-dropdown trigger="click">
|
||||
<div class="userInfo">
|
||||
<div class="icon">
|
||||
<Icon><Avatar /></Icon>
|
||||
<Avatar />
|
||||
</div>
|
||||
<div class="username">
|
||||
{{ username }}
|
||||
|
||||
@@ -35,8 +35,14 @@ import errorHandler from "@/utils/errorHandler";
|
||||
|
||||
import registerGlobComp from '@/components'
|
||||
|
||||
|
||||
const app = createApp(App);
|
||||
|
||||
// 自定义警告处理程序,忽略所有警告
|
||||
if (import.meta.env.VUE_APP_SILENCE_WARNINGS === true) {
|
||||
app.config.warnHandler = () => {};
|
||||
}
|
||||
|
||||
app.config.errorHandler = errorHandler;
|
||||
|
||||
// register the element Icons component
|
||||
|
||||
1
frontend/src/types/env.d.ts
vendored
1
frontend/src/types/env.d.ts
vendored
@@ -16,6 +16,7 @@ declare type Recordable<T = any> = Record<string, T>;
|
||||
declare interface ViteEnv {
|
||||
VITE_USER_NODE_ENV: 'development' | 'production' | 'test';
|
||||
VITE_GLOB_APP_TITLE: string;
|
||||
VUE_APP_SILENCE_WARNINGS: boolean;
|
||||
VITE_PORT: number;
|
||||
VITE_OPEN: boolean;
|
||||
VITE_REPORT: boolean;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</template>
|
||||
<!-- 表格操作 -->
|
||||
<template #operation='scope'>
|
||||
<el-button v-if='scope.row.status === 1' type='primary' link :icon='View'
|
||||
<el-button type='primary' link :icon='View'
|
||||
@click="openDrawer('查看', scope.row)">查看
|
||||
</el-button>
|
||||
<el-button type='primary' link :icon='EditPen' @click="openDrawer('编辑', scope.row)">编辑</el-button>
|
||||
@@ -89,8 +89,9 @@ const columns = reactive<ColumnProps<User.ResUserList>[]>([
|
||||
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
|
||||
{
|
||||
prop: 'username',
|
||||
label: '用户姓名',
|
||||
search: { el: 'input', tooltip: '我是搜索提示' },
|
||||
label: '姓名',
|
||||
width: 120,
|
||||
search: { el: 'input'},
|
||||
},
|
||||
{
|
||||
prop: 'gender',
|
||||
@@ -118,10 +119,10 @@ const columns = reactive<ColumnProps<User.ResUserList>[]>([
|
||||
},
|
||||
{ prop: 'idCard', label: '身份证号', search: { el: 'input' } },
|
||||
{ prop: 'email', label: '邮箱' },
|
||||
{ prop: 'address', label: '居住地址' },
|
||||
{ prop: 'address', label: '居住地址', width: 120 },
|
||||
{
|
||||
prop: 'status',
|
||||
label: '用户状态',
|
||||
label: '状态',
|
||||
enum: dictStore.getDictData('status'),
|
||||
search: { el: 'tree-select', props: { filterable: true } },
|
||||
fieldNames: { label: 'userLabel', value: 'userStatus' },
|
||||
|
||||
Reference in New Issue
Block a user