优化细节

This commit is contained in:
icssoa 2021-03-03 18:13:20 +08:00
parent a6a5e210da
commit 5cfb7ee34d
9 changed files with 55 additions and 44 deletions

View File

@ -2,7 +2,13 @@
<div class="cl-menu-file">
<el-row :gutter="10">
<el-col :span="16">
<el-select v-model="newValue" filterable clearable placeholder="请选择">
<el-select
v-model="newValue"
allow-create
filterable
clearable
placeholder="请选择"
>
<el-option
v-for="(item, index) in list"
:key="index"

View File

@ -3,7 +3,7 @@
<h1 class="code">{{ code }}</h1>
<p class="desc">{{ desc }}</p>
<template v-if="token">
<template v-if="token || isLogout">
<div class="router">
<el-select size="medium" filterable prefix-icon="el-icon-search" v-model="url">
<el-option v-for="(item, index) in routes" :key="index" :value="item.path">
@ -18,7 +18,7 @@
<div class="link">
<el-link class="to-home" @click="home">回到首页</el-link>
<el-link class="to-back" @click="back">返回上一页</el-link>
<el-link class="to-login" @click="login">重新登录</el-link>
<el-link class="to-login" @click="reLogin">重新登录</el-link>
</div>
</template>
@ -34,6 +34,7 @@
<script>
import { mapGetters } from "vuex";
import { href } from "cl-admin/utils";
export default {
props: {
@ -43,7 +44,8 @@ export default {
data() {
return {
url: ""
url: "",
isLogout: false
};
},
@ -60,20 +62,20 @@ export default {
this.$router.push("/login");
},
reLogin() {
this.isLogout = true;
this.$store.dispatch("userLogout").done(() => {
href("/login");
});
},
back() {
history.back();
},
home() {
this.$router.push("/");
},
login() {
this.$store.dispatch("userLogout");
setTimeout(() => {
this.$router.push("/login");
}, 30);
}
}
};

View File

@ -164,7 +164,7 @@ export default {
border: 0;
border-bottom: 0.5px solid #999;
border-radius: 0;
padding: 0;
padding: 0 5px;
background-color: transparent;
color: #ccc;
transition: border-color 0.3s;

View File

@ -45,8 +45,7 @@ export default {
.filter((e) => e.type != 2)
.map((e) => {
let r = {
moduleName:
e.moduleName || (e.router || "").substr(1).replace(/\//g, "-"),
moduleName: e.moduleName,
id: e.id,
parentId: e.parentId,
path: revisePath(e.router || e.id),

View File

@ -11,7 +11,7 @@ export default {
// 模块列表
moduleList: (state) => state.list,
// 模块视图
moduleViews: (state) => state.moduleViews
moduleViews: (state) => state.views
},
mutations: {
@ -27,7 +27,7 @@ export default {
},
SET_MODULE_VIEWS(state, list) {
state.moduleViews = list;
state.views = list;
}
}
};

View File

@ -3,6 +3,8 @@
<el-row type="flex" align="middle">
<!-- 刷新按钮 -->
<cl-refresh-btn />
<!-- 提示 -->
<p class="tips">修改完配置如无生效则需要重启 <i class="el-icon-warning"></i></p>
<cl-flex1 />
<!-- 关键字搜索 -->
<cl-search-key />
@ -27,7 +29,7 @@
<el-row type="flex">
<cl-flex1 />
<!-- 分页控件 -->
<cl-pagination layout="total" />
<cl-pagination :props="{ layout: 'total' }" />
</el-row>
</cl-crud>
</template>
@ -73,43 +75,35 @@ export default {
columns: [
{
label: "名称",
prop: "name",
align: "center"
prop: "name"
},
{
label: "作者",
prop: "author",
align: "center"
prop: "author"
},
{
label: "联系方式",
prop: "contact",
align: "center"
prop: "contact"
},
{
label: "功能描述",
prop: "description",
align: "center"
prop: "description"
},
{
label: "版本号",
prop: "version",
align: "center"
prop: "version"
},
{
label: "是否启用",
prop: "enable",
align: "center"
prop: "enable"
},
{
label: "命名空间",
prop: "namespace",
align: "center"
prop: "namespace"
},
{
label: "状态",
prop: "status",
align: "center",
dict: [
{
label: "缺少配置",
@ -136,13 +130,11 @@ export default {
{
label: "创建时间",
prop: "createTime",
align: "center",
width: 150,
sortable: "custom"
},
{
type: "op",
align: "center",
buttons: [
({ scope }) => {
return (
@ -236,3 +228,11 @@ export default {
}
};
</script>
<style lang="scss" scoped>
.tips {
font-size: 13px;
margin-left: 10px;
color: $color-warning;
}
</style>

View File

@ -11,7 +11,7 @@
"dependencies": {
"axios": "^0.21.1",
"cl-admin": "^1.2.0",
"cl-admin-crud": "^1.3.3",
"cl-admin-crud": "^1.3.4",
"cl-admin-export": "^1.0.5",
"core-js": "^3.9.0",
"dayjs": "^1.10.3",

View File

@ -12,18 +12,18 @@ NProgress.configure({
showSpinner: false
});
// 请求队列
let requests = [];
// Token 是否刷新中
let isRefreshing = false;
// 忽略规则
const ignore = {
NProgress: ["/sys/info/record"],
token: ["/login", "/captcha"]
};
// 请求队列
let requests = [];
// Token 是否刷新中
let isRefreshing = false;
// Request
axios.interceptors.request.use(
(config) => {
@ -134,7 +134,11 @@ axios.interceptors.response.use(
break;
case 502:
href("/502");
if (isDev) {
return Promise.reject("服务异常!!");
} else {
href("/502");
}
break;
default:

View File

@ -44,7 +44,7 @@ module.exports = {
target: "https://admin.cn.utools.club",
changeOrigin: true,
pathRewrite: {
"^/dev": ""
"^/test": ""
}
},