更新部分nicad检测ui及方法

This commit is contained in:
unknown 2022-07-18 17:32:47 +08:00
parent 0b5bec4686
commit 0cbfd750b7
7 changed files with 326 additions and 174 deletions

View File

@ -1,8 +1,8 @@
.header{
background-color: #242f42;
background-color: #0037af;
}
.login-wrap{
background: #324157;
background: #d5d5d5;
}
.plugins-tips{
background: #eef1f6;
@ -24,5 +24,8 @@
color: #20a0ff;
}
.collapse-btn:hover{
background: rgb(40,52,70);
background: #124dcb;
}

View File

@ -5,7 +5,7 @@
<i v-if="!collapse" class="el-icon-s-fold"></i>
<i v-else class="el-icon-s-unfold"></i>
</div>
<div class="logo">后台管理系统</div>
<div class="logo">红山开源代码质量检测实验平台</div>
<div class="header-right">
<div class="header-user-con">
<!-- 消息中心 -->
@ -17,26 +17,7 @@
</el-tooltip>
<span class="btn-bell-badge" v-if="message"></span>
</div>
<!-- 用户头像 -->
<div class="user-avator">
<img src="../assets/img/img.jpg" />
</div>
<!-- 用户名下拉菜单 -->
<el-dropdown class="user-name" trigger="click" @command="handleCommand">
<span class="el-dropdown-link">
{{username}}
<i class="el-icon-caret-bottom"></i>
</span>
<template #dropdown>
<el-dropdown-menu>
<a href="https://github.com/lin-xin/vue-manage-system" target="_blank">
<el-dropdown-item>项目仓库</el-dropdown-item>
</a>
<el-dropdown-item command="user">个人中心</el-dropdown-item>
<el-dropdown-item divided command="loginout">退出登录</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</div>
</div>
@ -101,7 +82,7 @@ export default {
}
.header .logo {
float: left;
width: 250px;
width: auto;
line-height: 70px;
}
.header-right {
@ -134,7 +115,7 @@ export default {
width: 8px;
height: 8px;
border-radius: 4px;
background: #f56c6c;
background : #f56c6c;
color: #fff;
}
.btn-bell .el-icon-bell {

View File

@ -1,154 +1,164 @@
<template>
<div class="sidebar">
<el-menu class="sidebar-el-menu" :default-active="onRoutes" :collapse="collapse" background-color="#324157"
text-color="#bfcbd9" active-text-color="#20a0ff" unique-opened router>
<template v-for="item in items">
<template v-if="item.subs">
<el-submenu :index="item.index" :key="item.index">
<template #title>
<i :class="item.icon"></i>
<span>{{ item.title }}</span>
</template>
<template v-for="subItem in item.subs">
<el-submenu v-if="subItem.subs" :index="subItem.index" :key="subItem.index">
<template #title>{{ subItem.title }}</template>
<el-menu-item v-for="(threeItem, i) in subItem.subs" :key="i" :index="threeItem.index">
{{ threeItem.title }}</el-menu-item>
</el-submenu>
<el-menu-item v-else :index="subItem.index" :key="subItem.index">{{ subItem.title }}
</el-menu-item>
</template>
</el-submenu>
</template>
<template v-else>
<el-menu-item :index="item.index" :key="item.index">
<i :class="item.icon"></i>
<template #title>{{ item.title }}</template>
</el-menu-item>
</template>
<div class="sidebar">
<el-menu class="sidebar-el-menu" :default-active="onRoutes" :collapse="collapse" background-color="#FFFFFF"
text-color="#000000" active-text-color="#124dcb" unique-opened router>
<template v-for="item in items">
<template v-if="item.subs">
<el-submenu :index="item.index" :key="item.index">
<template #title>
<i :class="item.icon"></i>
<span>{{ item.title }}</span>
</template>
</el-menu>
</div>
<template v-for="subItem in item.subs">
<el-submenu v-if="subItem.subs" :index="subItem.index" :key="subItem.index">
<template #title>{{ subItem.title }}</template>
<el-menu-item v-for="(threeItem, i) in subItem.subs" :key="i" :index="threeItem.index">
{{ threeItem.title }}
</el-menu-item>
</el-submenu>
<el-menu-item v-else :index="subItem.index" :key="subItem.index">{{ subItem.title }}
</el-menu-item>
</template>
</el-submenu>
</template>
<template v-else>
<el-menu-item :index="item.index" :key="item.index">
<i :class="item.icon"></i>
<template #title>{{ item.title }}</template>
</el-menu-item>
</template>
</template>
</el-menu>
</div>
</template>
<script>
import { computed, watch } from "vue";
import { useStore } from "vuex";
import { useRoute } from "vue-router";
import {computed, watch} from "vue";
import {useStore} from "vuex";
import {useRoute} from "vue-router";
export default {
setup() {
const items = [
{
icon: "el-icon-lx-home",
index: "/dashboard",
title: "系统首页",
},
{
icon: "el-icon-lx-cascades",
index: "/table",
title: "基础表格",
},
{
icon: "el-icon-lx-copy",
index: "/tabs",
title: "tab选项卡",
},
{
icon: "el-icon-lx-calendar",
index: "3",
title: "表单相关",
subs: [
{
index: "/form",
title: "基本表单",
},
{
index: "/upload",
title: "文件上传",
},
{
index: "4",
title: "三级菜单",
subs: [
{
index: "/editor",
title: "富文本编辑器",
},
],
},
],
},
{
icon: "el-icon-lx-emoji",
index: "/icon",
title: "自定义图标",
},
{
icon: "el-icon-pie-chart",
index: "/charts",
title: "schart图表",
},
{
icon: "el-icon-lx-global",
index: "/i18n",
title: "国际化功能",
},
{
icon: "el-icon-lx-warn",
index: "7",
title: "错误处理",
subs: [
{
index: "/permission",
title: "权限测试",
},
{
index: "/404",
title: "404页面",
},
],
},
{
icon: "el-icon-lx-redpacket_fill",
index: "/donate",
title: "支持作者",
},
];
setup() {
const items = [
{
icon: "el-icon-files",
index: "/nicad",
title: "Nicad代码重复度检测工具",
},
{
icon: "el-icon-lx-home",
index: "/dashboard",
title: "系统首页",
},
{
icon: "el-icon-lx-cascades",
index: "/table",
title: "基础表格",
},
{
icon: "el-icon-lx-copy",
index: "/tabs",
title: "tab选项卡",
},
{
icon: "el-icon-lx-calendar",
index: "3",
title: "表单相关",
subs: [
{
index: "/form",
title: "基本表单",
},
{
index: "/upload",
title: "文件上传",
},
{
index: "4",
title: "三级菜单",
subs: [
{
index: "/editor",
title: "富文本编辑器",
},
],
},
],
},
{
icon: "el-icon-lx-emoji",
index: "/icon",
title: "自定义图标",
},
{
icon: "el-icon-pie-chart",
index: "/charts",
title: "schart图表",
},
{
icon: "el-icon-lx-global",
index: "/i18n",
title: "国际化功能",
},
{
icon: "el-icon-lx-warn",
index: "7",
title: "错误处理",
subs: [
{
index: "/permission",
title: "权限测试",
},
{
index: "/404",
title: "404页面",
},
],
},
{
icon: "el-icon-lx-redpacket_fill",
index: "/donate",
title: "支持作者",
},
];
const route = useRoute();
const route = useRoute();
const onRoutes = computed(() => {
return route.path;
});
const onRoutes = computed(() => {
return route.path;
});
const store = useStore();
const collapse = computed(() => store.state.collapse);
const store = useStore();
const collapse = computed(() => store.state.collapse);
return {
items,
onRoutes,
collapse,
};
},
return {
items,
onRoutes,
collapse,
};
},
};
</script>
<style scoped>
.sidebar {
display: block;
position: absolute;
left: 0;
top: 70px;
bottom: 0;
overflow-y: scroll;
display: block;
position: absolute;
left: 0;
top: 70px;
bottom: 0;
overflow-y: scroll;
}
.sidebar::-webkit-scrollbar {
width: 0;
width: 0;
}
.sidebar-el-menu:not(.el-menu--collapse) {
width: 250px;
width: 250px;
}
.sidebar > ul {
height: 100%;
height: 100%;
}
</style>

155
src/page/nicad.vue Normal file
View File

@ -0,0 +1,155 @@
<template>
<div>
<div class="crumbs">
<el-breadcrumb separator="/">
<el-breadcrumb-item>
<i class="el-icon-files"></i> Nicad代码重复度检测工具
</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="container">
<div class="content-title">Nicad代码重复度检测工具</div>
<div class="plugins-tips">
请您上传您的代码并选择语言类型进行检测
</div>
<el-select v-model="value" placeholder="请选择项目语言" style="margin-bottom: 15px">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
:disabled="item.disabled"
/>
</el-select>
<el-upload class="upload-demo" drag action="http://jsonplaceholder.typicode.com/api/posts/" multiple>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处
<em>点击上传</em>
</div>
</el-upload>
<div style="text-align: right; margin-top: 15px">
<el-button type="primary" @click="nicadCheck">开始检测</el-button>
</div>
</div>
</div>
</template>
<script>
import {ref} from "vue";
import VueCropper from "vue-cropperjs";
import "cropperjs/dist/cropper.css";
import { ElMessage } from 'element-plus'
import defaultSrc from "../assets/img/img.jpg";
export default {
name: "upload",
components: {
VueCropper,
},
setup() {
const value = ref('')
const options = [
{
value: 'C',
label: 'C',
},
{
value: 'Java',
label: 'Java',
},
{
value: 'C#',
label: 'C#',
},
{
value: 'Ruby',
label: 'Ruby',
},
{
value: 'JavaScript',
label: 'JavaScript',
},
]
function nicadCheck(){
//
if (value.value != '') {
//
}else {
//
ElMessage.warning("请选择语言类型")
}
}
return {
//
value,
//
options,
//
nicadCheck
};
},
};
</script>
<style scoped>
:deep .el-upload-dragger {
width: 100%;
}
:deep .el-upload--text {
width: 100%;
}
.content-title {
font-weight: 400;
line-height: 50px;
margin: 10px 0;
font-size: 22px;
color: #1f2f3d;
}
.pre-img {
width: 100px;
height: 100px;
background: #f8f8f8;
border: 1px solid #eee;
border-radius: 5px;
}
.crop-demo {
display: flex;
align-items: flex-end;
}
.crop-demo-btn {
position: relative;
width: 100px;
height: 40px;
line-height: 40px;
padding: 0 20px;
margin-left: 30px;
background-color: #409eff;
color: #fff;
font-size: 14px;
border-radius: 4px;
box-sizing: border-box;
}
.crop-input {
position: absolute;
width: 100px;
height: 40px;
left: 0;
top: 0;
opacity: 0;
cursor: pointer;
}
</style>

View File

@ -10,6 +10,14 @@ const routes = [
name: "Home",
component: Home,
children: [
{
path: "/nicad",
name: "nicad",
meta: {
title: 'Nicad检测'
},
component: () => import ( /* webpackChunkName: "dashboard" */ "../page/nicad.vue")
},
{
path: "/dashboard",
name: "dashboard",

View File

@ -2,23 +2,7 @@
<div>
<el-row :gutter="20">
<el-col :span="8">
<el-card shadow="hover" class="mgb20" style="height:252px;">
<div class="user-info">
<img src="../assets/img/img.jpg" class="user-avator" alt />
<div class="user-info-cont">
<div class="user-info-name">{{ name }}</div>
<div>{{ role }}</div>
</div>
</div>
<div class="user-info-list">
上次登录时间
<span>2019-11-01</span>
</div>
<div class="user-info-list">
上次登录地点
<span>东莞</span>
</div>
</el-card>
<el-card shadow="hover" style="height:252px;">
<template #header>
<div class="clearfix">

View File

@ -5,5 +5,16 @@ export default {
plugins: [vue()],
optimizeDeps: {
include: ['schart.js']
},
server:{
proxy: {
'/api': {
target: 'http://localhost:8011',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
// rewrite: (path) => path.replace(/^/api, '')
},
}
}
}