Commit 50274f62 authored by “yiyousong”'s avatar “yiyousong”

perf: 优化

parent af74f95e
import request from "@/utils/request";
// 登录
export const login = (data) => {
return request({
url: `/bill/login/login`,
method: "post",
data,
});
};
// 登出
export const logout = (data) => {
return request({
url: `/bill/login/logout`,
method: "post",
data,
});
};
// 修改密码
export const changePassword = (data) => {
return request({
url: `/bill/user/change/password`,
method: "post",
data,
});
};
......@@ -379,6 +379,7 @@ export default {
return (
<span
class="primary cursor-pointer"
v-hasPermi={["market:evaluatereport:details"]}
onClick={() => {
this.checkDetails(row);
}}
......
......@@ -359,6 +359,7 @@ export default {
return (
<span
class="primary cursor-pointer"
v-hasPermi={["market:queueupreport:details"]}
onClick={() => {
this.checkDetails(row);
}}
......
......@@ -66,6 +66,8 @@ export default {
if (routes.length) {
let path = routes[0].path;
this.$router.push(path);
} else {
this.$message.warning("暂无权限,请联系管理员!");
}
}
},
......
......@@ -2,14 +2,22 @@
<div class="h-full w-full">
<TableHeader>
<div slot="left">
<el-button size="small" type="primary" @click="handleAdd"
<el-button
size="small"
type="primary"
v-hasPermi="['system:access:add']"
@click="handleAdd"
>新增</el-button
>
<el-button size="small" type="danger" @click="handleDelAll"
<el-button
size="small"
type="danger"
v-hasPermi="['system:access:remove']"
@click="handleDelAll"
>批量删除</el-button
>
</div>
<div slot="right">
<div slot="right" v-hasPermi="['system:access:query']">
<el-form ref="searchForm" :model="searchForm" inline>
<el-form-item prop="areaName">
<el-input
......@@ -193,18 +201,21 @@ export default {
return (
<div class="flex justify-center gap-4">
<span
v-hasPermi={["system:access:accessSystem"]}
class="primary cursor-pointer"
onClick={() => this.accessSystem(row)}
>
接入系统
</span>
<span
v-hasPermi={["system:access:edit"]}
class="primary cursor-pointer"
onClick={() => this.handleEdit(row)}
>
编辑
</span>
<span
v-hasPermi={["system:access:remove"]}
class="delete cursor-pointer"
onClick={() => this.handleDel(row.id)}
>
......
......@@ -2,7 +2,11 @@
<div class="h-full w-full">
<TableHeader>
<div slot="left">
<el-button size="small" type="primary" @click="handleAdd"
<el-button
size="small"
type="primary"
v-hasPermi="['system:menu:add']"
@click="handleAdd"
>新增</el-button
>
<!-- <el-button size="small" type="danger" @click="handleDelAll"
......@@ -176,20 +180,24 @@ export default {
return (
<div class="flex items-center justify-center gap-4">
<i
v-hasPermi={["system:menu:up"]}
class="el-icon-top primary cursor-pointer"
onClick={() => this.changeMenuSort(row.id, 0)}
></i>
<i
v-hasPermi={["system:menu:down"]}
class="el-icon-bottom primary cursor-pointer"
onClick={() => this.changeMenuSort(row.id, 1)}
></i>
<span
v-hasPermi={["system:menu:edit"]}
class="primary cursor-pointer"
onClick={() => this.handleEdit(row)}
>
编辑
</span>
<span
v-hasPermi={["system:menu:remove"]}
class="delete cursor-pointer"
onClick={() => this.handleDel(row.id)}
>
......
......@@ -82,7 +82,7 @@
<el-form-item prop="component" v-if="form.menuType != 2">
<span slot="label">
<el-tooltip
content="访问的组件路径,如:`system/menu/Menu`,默认在`pages`目录下"
content="访问的组件路径,如:`pages/system/menu/Menu`,默认在`src`目录下"
placement="top"
>
<i class="el-icon-question"></i>
......@@ -353,10 +353,10 @@ export default {
</script>
<style lang="less" scoped>
:deep(.el-dialog__body) {
max-height: 600px;
overflow: auto;
}
// :deep(.el-dialog__body) {
// max-height: 600px;
// overflow: auto;
// }
:deep(.el-select) {
width: 100%;
}
......
......@@ -2,14 +2,22 @@
<div class="parameter h-full w-full">
<TableHeader>
<div slot="left">
<el-button size="small" type="primary" @click="handleAdd"
<el-button
size="small"
type="primary"
v-hasPermi="['system:parameter:add']"
@click="handleAdd"
>新增参数</el-button
>
<el-button size="small" type="danger" @click="handleDelAll"
<el-button
size="small"
type="danger"
v-hasPermi="['system:parameter:remove']"
@click="handleDelAll"
>批量删除</el-button
>
</div>
<div slot="right">
<div slot="right" v-hasPermi="['system:parameter:query']">
<el-form ref="searchForm" :model="searchForm" inline>
<el-form-item prop="type">
<el-select
......@@ -154,12 +162,14 @@ export default {
return (
<div class="flex justify-center gap-4">
<span
v-hasPermi={["system:parameter:edit"]}
class="primary cursor-pointer"
onClick={() => this.handleEdit(row)}
>
编辑
</span>
<span
v-hasPermi={["system:parameter:remove"]}
class="delete cursor-pointer"
onClick={() => this.handleDel(row.id)}
>
......
......@@ -2,14 +2,22 @@
<div class="h-full w-full">
<TableHeader>
<div slot="left">
<el-button size="small" type="primary" @click="handleAdd"
<el-button
size="small"
type="primary"
v-hasPermi="['system:resourcemanage:add']"
@click="handleAdd"
>新增资源</el-button
>
<el-button size="small" type="danger" @click="handleDelAll"
<el-button
size="small"
type="danger"
v-hasPermi="['system:resourcemanage:remove']"
@click="handleDelAll"
>批量删除</el-button
>
</div>
<div slot="right">
<div slot="right" v-hasPermi="['system:resourcemanage:query']">
<el-form ref="searchForm" :model="searchForm" inline>
<el-form-item prop="authType">
<el-select
......@@ -109,6 +117,12 @@ export default {
},
},
{
label: "所属分组",
prop: "groupName",
align: "center",
},
{
label: "名称",
prop: "name",
......@@ -146,12 +160,14 @@ export default {
return (
<div class="flex justify-center gap-4">
<span
v-hasPermi={["system:resourcemanage:edit"]}
class="primary cursor-pointer"
onClick={() => this.handleEdit(row)}
>
编辑
</span>
<span
v-hasPermi={["system:resourcemanage:remove"]}
class="delete cursor-pointer"
onClick={() => this.handleDel(row.id)}
>
......
......@@ -2,14 +2,22 @@
<div class="h-full w-full">
<TableHeader>
<div slot="left">
<el-button size="small" type="primary" @click="handleAdd"
<el-button
size="small"
type="primary"
v-hasPermi="['system:role:add']"
@click="handleAdd"
>新增</el-button
>
<el-button size="small" type="danger" @click="handleDelAll"
<el-button
size="small"
type="danger"
v-hasPermi="['system:role:remove']"
@click="handleDelAll"
>批量删除</el-button
>
</div>
<div slot="right">
<div slot="right" v-hasPermi="['system:role:query']">
<el-form ref="searchForm" :model="searchForm" inline>
<el-form-item prop="name">
<el-input
......@@ -133,24 +141,28 @@ export default {
return (
<div class="flex justify-center gap-4">
<span
v-hasPermi={["system:role:roleRes"]}
class="primary cursor-pointer"
onClick={() => this.apportion(row)}
>
分配资源
</span>
<span
v-hasPermi={["system:role:roleMenu"]}
class="primary cursor-pointer"
onClick={() => this.apportionMenu(row)}
>
分配菜单
</span>
<span
v-hasPermi={["system:role:edit"]}
class="primary cursor-pointer"
onClick={() => this.handleEdit(row)}
>
编辑
</span>
<span
v-hasPermi={["system:role:remove"]}
class="delete cursor-pointer"
onClick={() => this.handleDel(row.id)}
>
......
......@@ -151,10 +151,10 @@ export default {
this.loading = false;
},
// 新增
onAdd(roleId) {
async onAdd(roleId) {
Object.assign(this.form, this.$options.data().form);
this.form.roleId = roleId;
this.getResourceGroup();
await this.getResourceGroup();
this.getRoleResourceList(roleId);
},
......
<template>
<div class="system-logs h-full w-full">
<TableHeader>
<div slot="right" class="flex">
<div slot="right" class="flex" v-hasPermi="['system:systemlogs:query']">
<el-input
size="small"
v-model="searchVal"
......
......@@ -2,14 +2,22 @@
<div class="task-set h-ull w-full">
<TableHeader>
<div slot="left">
<el-button size="small" type="primary" @click="handleAdd"
<el-button
size="small"
type="primary"
v-hasPermi="['system:task:add']"
@click="handleAdd"
>新增任务</el-button
>
<el-button size="small" type="danger" @click="handleDelAll"
<el-button
size="small"
type="danger"
v-hasPermi="['system:task:remove']"
@click="handleDelAll"
>批量删除</el-button
>
</div>
<div slot="right" class="flex">
<div slot="right" class="flex" v-hasPermi="['system:task:query']">
<el-input
size="small"
v-model="searchVal"
......@@ -142,12 +150,14 @@ export default {
return (
<div class="flex justify-center gap-4">
<span
v-hasPermi={["system:task:edit"]}
class="primary cursor-pointer"
onClick={() => this.handleEdit(row)}
>
编辑
</span>
<span
v-hasPermi={["system:task:remove"]}
class="delete cursor-pointer"
onClick={() => this.handleDel(row.id)}
>
......
<template>
<div class="h-full w-full">
<TableHeader>
<div slot="right">
<div slot="right" v-hasPermi="['system:user:query']">
<el-form ref="searchForm" :model="searchForm" inline size="small">
<el-form-item prop="type">
<el-select
......@@ -59,8 +59,8 @@
<!-- 分配角色 -->
<AddUserRole
ref="AddUserRole"
:addVisible.sync="show"
@addSuccess="getUserList"
:show.sync="show"
@success="getUserList"
></AddUserRole>
</div>
</template>
......@@ -153,6 +153,7 @@ export default {
return (
<div class="flex justify-center gap-4">
<span
v-hasPermi={["system:user:userRole"]}
class="primary cursor-pointer"
onClick={() => this.apportion(row)}
>
......
......@@ -212,23 +212,17 @@ export const generateRoutes = (menuList) => {
let routers = menuList.map((item) => {
// 构造符合要求的结构
let path = item.url.charAt(0) === "/" ? item.url : "/" + item.url;
let name = item.url.charAt(0) === "/" ? item.url.slice(1) : item.url;
let name = item.url.replace(/^\//, "");
let activeMenu = item.activeDir
? item.activeDir.charAt(0) === "/"
? item.activeDir
: "/" + item.activeDir
? "/" + item.activeDir.replace(/^\//, "")
: "";
let component = item.component
? item.component.charAt(0) === "/"
? item.component
: "/" + item.component
: null;
let component = item.component ? item.component.replace(/^\//, "") : null;
const newItem = {
path,
name,
hidden: !!item.visible,
hideChildrenInMenu: !!item.hideChildrenInMenu,
component: () => import(`@/pages${component}`),
component: () => import(`@/${component}`),
meta: {
title: item.name,
icon: item.imgPath,
......@@ -236,14 +230,12 @@ export const generateRoutes = (menuList) => {
activeMenu,
},
};
// 递归处理子节点
if (item.children && item.children.length > 0) {
newItem.children = generateRoutes(item.children);
}
return newItem;
});
routers.forEach((v) => {
if (v.children && v.children.length) {
v.redirect = v.children[0].path;
......
const { defineConfig } = require("@vue/cli-service");
const path = require("path");
module.exports = defineConfig({
transpileDependencies: true,
configureWebpack: {
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
},
},
},
devServer: {
proxy: {
"/file": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment