Browse Source

去除废弃代码

pull/54/head
zq 2 months ago
parent
commit
9997f60065
  1. 16
      src/components/GuipTable.vue
  2. 1
      src/components/SliderMenu.vue
  3. 33
      src/router/index.js

16
src/components/GuipTable.vue

@ -1,5 +1,4 @@
<template> <template>
<global-loading>
<el-table ref="guiptable" v-bind="$attrs" :data="tableData" v-on="$listeners" :border="border" @selection-change="handleSelectionChange" <el-table ref="guiptable" v-bind="$attrs" :data="tableData" v-on="$listeners" :border="border" @selection-change="handleSelectionChange"
:style="{ width: width ? width : '100%', height: height ? height : '100%' }" v-loading="loading"> :style="{ width: width ? width : '100%', height: height ? height : '100%' }" v-loading="loading">
<!-- 多选 --> <!-- 多选 -->
@ -9,9 +8,6 @@
</template> </template>
<!-- 自定义header --> <!-- 自定义header -->
<slot></slot> <slot></slot>
<!-- <template v-if="autoColumn">
<slot name="headerTop"></slot>
</template> -->
<!-- 通过json数据遍历渲染 --> <!-- 通过json数据遍历渲染 -->
<template v-if="columns"> <template v-if="columns">
<el-table-column v-for="column in columns" :key="column.prop" :prop="column.prop" :label="column.label" <el-table-column v-for="column in columns" :key="column.prop" :prop="column.prop" :label="column.label"
@ -41,24 +37,13 @@
</el-table-column> </el-table-column>
</template> </template>
<template #empty> <template #empty>
<!-- <div v-if="loading">
<i class="el-icon-loading"></i>
<span>数据加载中...</span>
</div> -->
<!-- <div class="custom-empty">
<img src="@/assets/table_empty.png" alt="无数据" class="empty-image">
<p class="empty-text">暂无数据</p>
</div> -->
<el-empty :image="emptyImg"></el-empty> <el-empty :image="emptyImg"></el-empty>
</template> </template>
</el-table> </el-table>
</global-loading>
</template> </template>
<script> <script>
import GuipButton from '@/components/GuipButton.vue'; import GuipButton from '@/components/GuipButton.vue';
import GlobalLoading from '@/components/GlobalLoading1.vue'
export default { export default {
name: 'GuipTextarea', name: 'GuipTextarea',
@ -71,7 +56,6 @@ export default {
}, },
components: { components: {
GuipButton, GuipButton,
GlobalLoading
}, },
mounted() { mounted() {
}, },

1
src/components/SliderMenu.vue

@ -38,7 +38,6 @@
</el-menu> </el-menu>
<SetLeftMenu v-else :menuList="menuData"/> <SetLeftMenu v-else :menuList="menuData"/>
<!-- <div v-else>---akjshdjka</div> -->
</transition> </transition>
</template> </template>

33
src/router/index.js

@ -11,9 +11,7 @@ const blackSliderList = [
'/register','/franchise' '/register','/franchise'
]; ];
// 一级路由 // 一级路由
const first_child_router = [ let first_child_router = []
'/', '/agent/siteList', '/ui'
]
//头部导航黑名单 不需要添加头部的放置在这里,其余默认显示头部 //头部导航黑名单 不需要添加头部的放置在这里,其余默认显示头部
const blackHeaderList = [ const blackHeaderList = [
'/franchise' '/franchise'
@ -46,9 +44,10 @@ const routes = [{
path: '/', path: '/',
name: '首页', name: '首页',
component: HomeView, component: HomeView,
isFirst:true,//是否属于一级路由
meta: { meta: {
title: '首页', title: '首页',//面包屑名称(此页面确认不需要放置在面包屑可以不添加此属性;如果获取不到title 会自动 获取 name 作为面包屑名称)
hideBreadcrumb: true // 首页不显示面包屑 hideBreadcrumb: true // 是否隐藏面包屑
} }
}, },
{ {
@ -61,6 +60,7 @@ const routes = [{
{ {
path: '/ui', path: '/ui',
name: 'ui组件', name: 'ui组件',
isFirst:true,
component: () => import( /* webpackChunkName: "ui" */ '../views/elementGroups.vue'), component: () => import( /* webpackChunkName: "ui" */ '../views/elementGroups.vue'),
meta: { meta: {
title: '公共组件示例', title: '公共组件示例',
@ -71,6 +71,7 @@ const routes = [{
{ {
path: '/agent/siteList', path: '/agent/siteList',
name: '站点列表', name: '站点列表',
isFirst:true,
component: () => import( /* webpackChunkName: "siteList" */ '../views/agent/siteList.vue'), component: () => import( /* webpackChunkName: "siteList" */ '../views/agent/siteList.vue'),
meta: { meta: {
title: '站点列表', title: '站点列表',
@ -149,6 +150,10 @@ const routes = [{
name: '网页模板', name: '网页模板',
component: () => import( /* webpackChunkName: "pageTemplete" */ '../views/PageTemplete.vue') component: () => import( /* webpackChunkName: "pageTemplete" */ '../views/PageTemplete.vue')
}, },
// -----------------分隔符-----------
// 管理员start
{ {
path: '/super/ranking/yearProfit', path: '/super/ranking/yearProfit',
name: '年排行', name: '年排行',
@ -333,8 +338,10 @@ const routes = [{
hideBreadcrumb: true // 一级页面不显示面包屑 hideBreadcrumb: true // 一级页面不显示面包屑
} }
}, },
] // 管理员end
]
first_child_router = routes.filter(item => item.isFirst);
const router = new VueRouter({ const router = new VueRouter({
mode: 'history', mode: 'history',
base: process.env.BASE_URL, base: process.env.BASE_URL,
@ -343,17 +350,21 @@ const router = new VueRouter({
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
if (blackSliderList.includes(to.path)) { if (blackSliderList.includes(to.path)) {
store.commit('SET_SIDEBAR', false); // 登录页面显示侧边栏 store.commit('SET_SIDEBAR', false); // 黑名单内页面不显示侧边栏
} else { } else {
if (first_child_router.includes(to.path)) { //所有一级路由都为非自定义侧边栏 store.commit('SET_SIDEBAR', true); // 其他页面显示侧边栏
store.commit('SET_CUSTOMIZE', false); if(first_child_router.length > 0){
store.commit('SET_SLIDER_MENU', 'menuData'); first_child_router.forEach(item=>{
if(item.path == to.path){
store.commit('SET_CUSTOMIZE', false);
store.commit('SET_SLIDER_MENU', 'menuData');
}
})
} }
if (to.path.includes('/super/ranking/')) { //匹配包含此路径的 侧边栏数据 if (to.path.includes('/super/ranking/')) { //匹配包含此路径的 侧边栏数据
store.commit('SET_CUSTOMIZE', false); store.commit('SET_CUSTOMIZE', false);
store.commit('SET_SLIDER_MENU', 'rankMenuData'); store.commit('SET_SLIDER_MENU', 'rankMenuData');
} }
store.commit('SET_SIDEBAR', true); // 其他页面不显示侧边栏
} }
if (blackFooterList.includes(to.path)) { if (blackFooterList.includes(to.path)) {
store.commit('SET_FOOTER', false); // 页面不显示底部 store.commit('SET_FOOTER', false); // 页面不显示底部

Loading…
Cancel
Save