增加菜单搜索功能,优化table高度

This commit is contained in:
季圣华 2021-09-03 23:06:39 +08:00
parent fe3436665e
commit 317d3bafc2
8 changed files with 44 additions and 35 deletions

View File

@ -1,7 +1,5 @@
<template>
<iframe :id="id" :src="url" frameborder="0" width="100%" height="800px" scrolling="auto"></iframe>
<iframe :id="id" :src="url" frameborder="0" width="100%" :height="height" scrolling="auto"></iframe>
</template>
<script>
@ -16,7 +14,8 @@
data () {
return {
url: "",
id:""
id:"",
height: ""
}
},
created () {
@ -33,8 +32,8 @@
methods: {
goUrl () {
let url = this.$route.meta.url
let id = this.$route.path
this.id = id
this.id = this.$route.path
this.height = document.documentElement.clientHeight-130
console.log("------url------"+url)
console.log("------token------"+Vue.ls.get(ACCESS_TOKEN))
if (url !== null && url !== undefined) {

View File

@ -69,9 +69,9 @@
</a-layout-content>
<!-- layout footer -->
<a-layout-footer style="padding: 0px">
<global-footer/>
</a-layout-footer>
<!-- <a-layout-footer style="padding: 0px">-->
<!-- <global-footer/>-->
<!-- </a-layout-footer>-->
</a-layout>
<!-- update-start---- author:os_chengtgen -- date:20190830 -- for:issues/463 -编译主题颜色已生效但还一直转圈显示主题 正在编译 ---- -->

View File

@ -2,27 +2,27 @@
<div class="user-wrapper" :class="theme">
<!-- update_begin author:zhaoxin date:20191129 for: 做头部菜单栏导航 -->
<!-- update-begin author:sunjianlei date:20191@20 for: 解决全局样式冲突的问题 -->
<!-- <span class="action" @click="showClick">-->
<!-- <a-icon type="search"></a-icon>-->
<!-- </span>-->
<span class="action" @click="showClick">
<a-icon type="search"></a-icon>
</span>
<!-- update-begin author:sunjianlei date:20200219 for: 菜单搜索改为动态组件在手机端呈现出弹出框 -->
<!-- <component :is="searchMenuComp" v-show="searchMenuVisible || isMobile()" class="borders" :visible="searchMenuVisible" title="搜索菜单" :footer="null" @cancel="searchMenuVisible=false">-->
<!-- <a-select-->
<!-- class="search-input"-->
<!-- showSearch-->
<!-- :showArrow="false"-->
<!-- placeholder="搜索菜单"-->
<!-- optionFilterProp="children"-->
<!-- :filterOption="filterOption"-->
<!-- :open="isMobile()?true:null"-->
<!-- :getPopupContainer="(node) => node.parentNode"-->
<!-- :style="isMobile()?{width: '100%',marginBottom:'50px'}:{}"-->
<!-- @change="searchMethods"-->
<!-- @blur="hiddenClick"-->
<!-- >-->
<!-- <a-select-option v-for="(site,index) in searchMenuOptions" :key="index" :value="site.id">{{site.meta.title}}</a-select-option>-->
<!-- </a-select>-->
<!-- </component>-->
<component :is="searchMenuComp" v-show="searchMenuVisible || isMobile()" class="borders" :visible="searchMenuVisible" title="搜索菜单" :footer="null" @cancel="searchMenuVisible=false">
<a-select
class="search-input"
showSearch
:showArrow="false"
placeholder="搜索菜单"
optionFilterProp="children"
:filterOption="filterOption"
:open="isMobile()?true:null"
:getPopupContainer="(node) => node.parentNode"
:style="isMobile()?{width: '100%',marginBottom:'50px'}:{}"
@change="searchMethods"
@blur="hiddenClick"
>
<a-select-option v-for="(site,index) in searchMenuOptions" :key="index" :value="site.id">{{site.text}}</a-select-option>
</a-select>
</component>
<!-- update-end author:sunjianlei date:20200219 for: 菜单搜索改为动态组件在手机端呈现出弹出框 -->
<!-- update-end author:sunjianlei date:20191220 for: 解决全局样式冲突的问题 -->
<!-- update_end author:zhaoxin date:20191129 for: 做头部菜单栏导航 -->
@ -174,8 +174,8 @@
/* update_begin author:zhaoxin date:20191129 for: 做头部菜单栏导航*/
searchMenus(arr,menus){
for(let i of menus){
if(!i.hidden && "layouts/RouteView"!==i.component){
arr.push(i)
if("/layouts/RouteView"!==i.component && "/layouts/TabLayout"!==i.component){
arr.push(i)
}
if(i.children&& i.children.length>0){
this.searchMenus(arr,i.children)
@ -188,10 +188,10 @@
// update_begin author:sunjianlei date:20191230 for: 解决外部链接打开失败的问题
searchMethods(value) {
let route = this.searchMenuOptions.filter(item => item.id === value)[0]
if (route.meta.internalOrExternal === true || route.component.includes('layouts/IframePageView')) {
window.open(route.meta.url, '_blank')
if (route.component.includes('layouts/IframePageView')) {
window.open(route.url, '_blank')
} else {
this.$router.push({ path: route.path })
this.$router.push({ path: route.url })
}
this.searchMenuVisible = false
},

View File

@ -29,6 +29,10 @@ export const JeecgListMixin = {
showSizeChanger: true,
total: 0
},
/* 控制table高度 */
scroll: {
y: document.documentElement.clientHeight-330
},
/* 排序参数 */
isorter:{
column: 'createTime',

View File

@ -128,6 +128,7 @@ function generateChildRouters (data) {
icon: item.icon,
url: item.url,
componentName:componentName,
internalOrExternal:true,
keepAlive: true
// permissionList:""
}

View File

@ -106,6 +106,7 @@
{title: '名称', dataIndex: 'name', width: 100},
{title: '上级编号', dataIndex: 'parentNumber', width: 80},
{title: '链接', dataIndex: 'url', width: 250},
{title: '组件', dataIndex: 'component', width: 250},
{title: '排序', dataIndex: 'sort', width: 80},
{
title: '是否启用', dataIndex: 'enabled', width: 80, align: "center",

View File

@ -65,6 +65,7 @@
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
@change="handleTableChange">
<!-- 字符串超长截取省略号显示-->

View File

@ -28,6 +28,9 @@
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="链接">
<a-input placeholder="请输入链接" v-decorator.trim="[ 'url' ]" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="组件">
<a-input placeholder="请输入组件" v-decorator.trim="[ 'component' ]" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="排序">
<a-input placeholder="请输入排序" v-decorator.trim="[ 'sort' ]" />
</a-form-item>
@ -118,7 +121,7 @@
this.jselectMultiple.value = ''
}
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'number', 'name', 'parentNumber', 'url','sort','pushBtn','icon','enabled'))
this.form.setFieldsValue(pick(this.model,'number', 'name', 'parentNumber', 'url', 'component', 'sort', 'pushBtn', 'icon', 'enabled'))
});
},
close () {