4 changed files with 542 additions and 387 deletions
@ -1,230 +1,228 @@ |
|||||
<template> |
<template> |
||||
<div> |
<div> |
||||
|
<div class="mod-sys__menu"> |
||||
<div class="mod-sys__menu"> |
<div class="little-head"> |
||||
<div class="div_btn"> |
<div style="float:right"> |
||||
<span style="margin-right:10px">{{customerName}}</span> |
<span style="margin-right:10px">{{ customerName }}</span> |
||||
<el-button type="default" |
<el-button type="default" @click="diaCancel">取消返回</el-button> |
||||
@click="diaCancel">取消返回</el-button> |
</div> |
||||
<!-- <el-button class="" |
<div>工作端</div> |
||||
type="primary" |
</div> |
||||
@click="addShow()">{{"新增" }}</el-button> --> |
<el-form :inline="true" @keyup.enter.native="search()"> |
||||
<!-- <el-input v-model="search" |
<el-form-item><el-input v-model="menuName" placeholder="请输入菜单名称" :clearable="true"></el-input></el-form-item> |
||||
placeholder="请输入内容"></el-input> --> |
<el-form-item><el-button type="primary" @click="search()">查询</el-button></el-form-item> |
||||
</div> |
</el-form> |
||||
<div class="div_btn"> |
|
||||
<el-button class="" |
<div class="div_btn"> |
||||
type="primary" |
<el-button type="primary" @click="open('')">开启</el-button> |
||||
@click="useMenu()">开启</el-button> |
<el-button type="primary" @click="close('')">关闭</el-button> |
||||
<el-button class="" |
</div> |
||||
type="primary" |
<el-table v-loading="dataListLoading" :data="dataList" row-key="id" border style="width: 100%;" ref="form" @selection-change="handleSelectionChange"> |
||||
@click="closeMenu()">关闭</el-button> |
<el-table-column type="selection" fixed="left" align="center" width="50" /> |
||||
</div> |
<el-table-column label="序号" fixed="left" type="index" align="center" width="50" /> |
||||
<el-table v-loading="dataListLoading" |
<el-table-column prop="name" :label="$t('menu.name')" header-align="center" min-width="150"></el-table-column> |
||||
:data="dataList" |
<el-table-column prop="icon" :label="$t('menu.icon')" header-align="center" align="center"> |
||||
row-key="id" |
<template slot-scope="scope"> |
||||
border |
<svg class="icon-svg" aria-hidden="true"><use :xlink:href="`#${scope.row.icon}`"></use></svg> |
||||
style="width: 100%;" |
</template> |
||||
@select-all="selectAll" |
</el-table-column> |
||||
@selection-change="handelSelection"> |
|
||||
<el-table-column |
<el-table-column prop="sort" :label="$t('menu.sort')" header-align="center" align="center"></el-table-column> |
||||
type="selection" |
<el-table-column prop="useFlag" :label="$t('menu.status')" header-align="center" align="center"> |
||||
fixed="left" |
<template slot-scope="scope"> |
||||
align="center" |
<el-tag v-if="scope.row.useFlag === '0'" size="small">{{ $t('menu.status0') }}</el-tag> |
||||
width="50" |
<el-tag v-else size="small" type="info">{{ $t('menu.status1') }}</el-tag> |
||||
/> |
</template> |
||||
|
</el-table-column> |
||||
<el-table-column prop="name" |
|
||||
:label="$t('menu.name')" |
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> |
||||
header-align="center" |
<template slot-scope="scope"> |
||||
min-width="150"></el-table-column> |
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> |
||||
<el-table-column prop="icon" |
<el-button type="text" size="small" v-if="scope.row.useFlag == '0'" @click="open(scope.row.id)">{{ '开启' }}</el-button> |
||||
:label="$t('menu.icon')" |
<el-button type="text" size="small" v-if="scope.row.useFlag == '1'" @click="close(scope.row.id)">{{ '关闭' }}</el-button> |
||||
header-align="center" |
</template> |
||||
align="center"> |
</el-table-column> |
||||
<template slot-scope="scope"> |
</el-table> |
||||
<svg class="icon-svg" |
<!-- 弹窗, 新增 / 修改 --> |
||||
aria-hidden="true"> |
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> |
||||
<use :xlink:href="`#${scope.row.icon}`"></use> |
</div> |
||||
</svg> |
</div> |
||||
</template> |
|
||||
</el-table-column> |
|
||||
|
|
||||
<el-table-column prop="sort" |
|
||||
:label="$t('menu.sort')" |
|
||||
header-align="center" |
|
||||
align="center"></el-table-column> |
|
||||
<el-table-column prop="useFlag" |
|
||||
:label="$t('menu.status')" |
|
||||
header-align="center" |
|
||||
align="center"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-tag v-if="scope.row.useFlag === '0'" |
|
||||
size="small">{{ $t('menu.status0') }}</el-tag> |
|
||||
<el-tag v-else |
|
||||
size="small" |
|
||||
type="info">{{ $t('menu.status1') }}</el-tag> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
|
|
||||
<el-table-column :label="$t('handle')" |
|
||||
fixed="right" |
|
||||
header-align="center" |
|
||||
align="center" |
|
||||
width="150"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-button type="text" |
|
||||
size="small" |
|
||||
@click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> |
|
||||
<el-button v-if="scope.row.useFlag === '0'" |
|
||||
type="text" |
|
||||
size="small" |
|
||||
@click="useUpdate(scope.row.id,'1')">开启</el-button> |
|
||||
<el-button v-if="scope.row.useFlag === '1'" |
|
||||
type="text" |
|
||||
size="small" |
|
||||
@click="useUpdate(scope.row.id,'0')">关闭</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<!-- 弹窗, 新增 / 修改 --> |
|
||||
<add-or-update v-if="addOrUpdateVisible" |
|
||||
ref="addOrUpdate" |
|
||||
@refreshDataList="getDataList"></add-or-update> |
|
||||
</div> |
|
||||
|
|
||||
|
|
||||
</div> |
|
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
|
import { requestPost } from '@/js/dai/request'; |
||||
import { requestPost } from '@/js/dai/request' |
import mixinViewModule from '@/mixins/view-module'; |
||||
import mixinViewModule from '@/mixins/view-module' |
import AddOrUpdate from './menu-customer-add-or-update'; |
||||
import AddOrUpdate from './menu-customer-add-or-update' |
|
||||
export default { |
export default { |
||||
mixins: [mixinViewModule], |
mixins: [mixinViewModule], |
||||
data () { |
data() { |
||||
return { |
return { |
||||
customerId: '', // 客户id,父组件传 |
menuName: '', |
||||
customerName: '', // 客户名称,父组件传 |
multipleSelection: [], |
||||
|
customerId: '', // 客户id,父组件传 |
||||
tableParams: { |
customerName: '', // 客户名称,父组件传 |
||||
customerId: '' |
|
||||
}, |
tableParams: { |
||||
search: '', |
customerId: '' |
||||
dataList: [], |
}, |
||||
selection: [], |
|
||||
selAllFlag: false, |
dataList: [], |
||||
|
selection: [], |
||||
dataListLoading: false, |
selAllFlag: false, |
||||
|
|
||||
mixinViewModuleOptions: { |
dataListLoading: false, |
||||
getDataListURL: '/gov/access/menu/customerMenuList' |
|
||||
} |
mixinViewModuleOptions: { |
||||
|
getDataListURL: '/gov/access/menu/customerMenuList' |
||||
} |
} |
||||
}, |
}; |
||||
|
}, |
||||
computed: { |
|
||||
}, |
computed: {}, |
||||
components: { |
components: { |
||||
AddOrUpdate |
AddOrUpdate |
||||
}, |
}, |
||||
created() { |
created() {}, |
||||
|
methods: { |
||||
}, |
search() { |
||||
methods: { |
if (this.menuName != '') { |
||||
|
let saveList = []; |
||||
useMenu(){ |
this.onFuzzyTreeList('name', this.menuName, this.dataList, saveList); |
||||
let ids = this.selection.map((item) => item.id); |
this.$refs.form.data = saveList; |
||||
this.$http |
} else { |
||||
.post('/gov/access/govMenuCustomerRelation/useUpdate', { |
this.$refs.form.data = this.dataList; |
||||
ids: ids, |
} |
||||
use: '1' |
}, |
||||
}) |
|
||||
.then(({ data: res }) => { |
onFuzzyTreeList(key, value, treeList, saveList = []) { |
||||
return this.$message.success("操作成功"); |
return new Promise((resolve, reject) => { |
||||
}) |
treeList.forEach(item => { |
||||
this.query(); |
if (item[key].indexOf(value) > -1) { |
||||
}, |
saveList.push(item); |
||||
closeMenu(){ |
} else { |
||||
let ids = this.selection.map((item) => item.id); |
if (item.children && item.children.length > 0) { |
||||
this.$http |
const _reData = this.onFuzzyTreeList(key, value, item.children, saveList); |
||||
.post('/gov/access/govMenuCustomerRelation/useUpdate', { |
if (_reData && _reData.length > 0) { |
||||
ids: ids, |
saveList.push({ |
||||
use: '0' |
...item, |
||||
}) |
children: _reData |
||||
.then(({ data: res }) => { |
}); |
||||
return this.$message.success("操作成功"); |
} |
||||
|
} |
||||
}) |
} |
||||
this.query(); |
}); |
||||
}, |
resolve(saveList); |
||||
useUpdate(id,use){ |
}); |
||||
this.$http |
}, |
||||
.post('/gov/access/govMenuCustomerRelation/useUpdate', { |
|
||||
ids: [id], |
open(id) { |
||||
use: use |
let menuIds = []; |
||||
}) |
if (id != '') { |
||||
.then(({ data: res }) => { |
menuIds = [id]; |
||||
return this.$message.success("操作成功"); |
} else { |
||||
}) |
if (this.multipleSelection.length > 0) { |
||||
this.query(); |
menuIds = this.multipleSelection; |
||||
}, |
} else { |
||||
query() { |
return this.$message.error('请选择菜单'); |
||||
|
} |
||||
this.dataListLoading = true |
} |
||||
this.$http |
|
||||
.post('/gov/access/menu/customerMenuList', { |
let params = { |
||||
customerId: this.customerId, |
ids: menuIds, |
||||
tableName: 'data_menu' |
use: '1' |
||||
}) |
}; |
||||
.then(({ data: res }) => { |
this.$http.post('/gov/access/govMenuCustomerRelation/useUpdate/', params).then(({ data: res }) => { |
||||
this.dataListLoading = false |
console.log(res); |
||||
if (res.code !== 0) { |
if (res.code === 0) { |
||||
this.dataList = [] |
this.query(); |
||||
this.total = 0 |
} |
||||
return this.$message.error(res.msg) |
}); |
||||
} |
}, |
||||
this.dataList = res.data |
close(id) { |
||||
}) |
let menuIds = []; |
||||
.catch(() => { |
|
||||
this.dataListLoading = false |
if (id != '') { |
||||
}) |
menuIds = [id]; |
||||
}, |
} else { |
||||
|
if (this.multipleSelection.length > 0) { |
||||
initData (customerId, customerName) { |
menuIds = this.multipleSelection; |
||||
this.customerId = customerId |
} else { |
||||
this.customerName = customerName |
return this.$message.error('请选择菜单'); |
||||
// if (this.mixinViewModuleOptions.createdIsNeed) { |
} |
||||
// console.log(this.customerId+"22222"); |
} |
||||
this.query() |
let params = { |
||||
// } |
ids: menuIds, |
||||
|
use: '0' |
||||
}, |
}; |
||||
|
this.$http.post('/gov/access/govMenuCustomerRelation/useUpdate/', params).then(({ data: res }) => { |
||||
selectAll(selection) { |
console.log(res); |
||||
this.selection = selection; |
if (res.code === 0) { |
||||
if (selection.length > 0) { |
this.query(); |
||||
this.selAllFlag = true; |
} |
||||
} else { |
}); |
||||
this.selAllFlag = false; |
}, |
||||
} |
useUpdate(id, use) { |
||||
}, |
this.$http |
||||
handelSelection(row){ |
.post('', { |
||||
this.selection = row |
ids: [id], |
||||
}, |
use: use |
||||
// 取消 |
}) |
||||
diaCancel () { |
.then(({ data: res }) => { |
||||
this.$emit('cancleBack') |
return this.$message.success('操作成功'); |
||||
}, |
}); |
||||
} |
this.query(); |
||||
} |
}, |
||||
|
query() { |
||||
|
this.dataListLoading = true; |
||||
|
this.$http |
||||
|
.post('/gov/access/menu/customerMenuList', { |
||||
|
customerId: this.customerId, |
||||
|
tableName: 'data_menu' |
||||
|
}) |
||||
|
.then(({ data: res }) => { |
||||
|
this.dataListLoading = false; |
||||
|
if (res.code !== 0) { |
||||
|
this.dataList = []; |
||||
|
this.total = 0; |
||||
|
return this.$message.error(res.msg); |
||||
|
} |
||||
|
this.dataList = res.data; |
||||
|
}) |
||||
|
.catch(() => { |
||||
|
this.dataListLoading = false; |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
initData(customerId, customerName) { |
||||
|
this.customerId = customerId; |
||||
|
this.customerName = customerName; |
||||
|
// if (this.mixinViewModuleOptions.createdIsNeed) { |
||||
|
// console.log(this.customerId+"22222"); |
||||
|
this.query(); |
||||
|
// } |
||||
|
}, |
||||
|
|
||||
|
handleSelectionChange(val) { |
||||
|
this.multipleSelection = []; |
||||
|
val.forEach(element => { |
||||
|
this.multipleSelection.push(element.id); |
||||
|
}); |
||||
|
console.log(this.multipleSelection); |
||||
|
}, |
||||
|
// 取消 |
||||
|
diaCancel() { |
||||
|
this.$emit('cancleBack'); |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
</script> |
</script> |
||||
|
|
||||
<style> |
<style> |
||||
.div_btn { |
.div_btn { |
||||
margin: 0 0 20px 0; |
margin: 0 0 20px 0; |
||||
|
} |
||||
|
.little-head{ |
||||
|
border-bottom: dashed 1px #ccc; line-height: 50px; |
||||
|
margin-bottom: 20px; |
||||
} |
} |
||||
</style> |
</style> |
||||
|
@ -1,129 +1,216 @@ |
|||||
<template> |
<template> |
||||
<el-card shadow="never" |
<el-card shadow="never" class="aui-card--fill"> |
||||
class="aui-card--fill"> |
<div class="mod-sys__menu"> |
||||
<div class="mod-sys__menu"> |
<el-form :inline="true" @keyup.enter.native="search()"> |
||||
<el-form :inline="true" |
<el-form-item><el-input v-model="menuName" placeholder="请输入菜单名称" :clearable="true"></el-input></el-form-item> |
||||
:model="dataForm" |
<el-form-item><el-button type="primary" @click="search()">查询</el-button></el-form-item> |
||||
@keyup.enter.native="getDataList()"> |
</el-form> |
||||
<el-form-item> |
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> |
||||
<el-button type="primary" |
<el-form-item> |
||||
@click="addOrUpdateHandle()">{{ $t('add') }}</el-button> |
<el-button type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> |
||||
</el-form-item> |
<el-button type="primary" @click="open('')">开启</el-button> |
||||
</el-form> |
<el-button type="primary" @click="close('')">关闭</el-button> |
||||
<el-table v-loading="dataListLoading" |
</el-form-item> |
||||
:data="dataList" |
</el-form> |
||||
row-key="id" |
<el-table |
||||
border |
@selection-change="handleSelectionChange" |
||||
:height="tableHeight" |
v-loading="dataListLoading" |
||||
style="width: 100%;"> |
ref="form" |
||||
<el-table-column prop="name" |
:data="dataList" |
||||
:label="$t('menu.name')" |
row-key="id" |
||||
header-align="center" |
border |
||||
min-width="150"></el-table-column> |
:height="tableHeight" |
||||
<el-table-column prop="icon" |
style="width: 100%;" |
||||
:label="$t('menu.icon')" |
> |
||||
header-align="center" |
<el-table-column label="" fixed="left" type="selection" align="center" width="50" /> |
||||
align="center"> |
<el-table-column label="序号" fixed="left" type="index" align="center" width="50" /> |
||||
<template slot-scope="scope"> |
<el-table-column prop="name" :label="$t('menu.name')" header-align="center" min-width="150"></el-table-column> |
||||
<svg class="icon-svg" |
<el-table-column prop="icon" :label="$t('menu.icon')" header-align="center" align="center"> |
||||
aria-hidden="true"> |
<template slot-scope="scope"> |
||||
<use :xlink:href="`#${scope.row.icon}`"></use> |
<svg class="icon-svg" aria-hidden="true"><use :xlink:href="`#${scope.row.icon}`"></use></svg> |
||||
</svg> |
</template> |
||||
</template> |
</el-table-column> |
||||
</el-table-column> |
<el-table-column prop="type" :label="$t('menu.type')" header-align="center" align="center"> |
||||
<el-table-column prop="type" |
<template slot-scope="scope"> |
||||
:label="$t('menu.type')" |
<el-tag v-if="scope.row.type === 0" size="small">{{ $t('menu.type0') }}</el-tag> |
||||
header-align="center" |
<el-tag v-else size="small" type="info">{{ $t('menu.type1') }}</el-tag> |
||||
align="center"> |
</template> |
||||
<template slot-scope="scope"> |
</el-table-column> |
||||
<el-tag v-if="scope.row.type === 0" |
<el-table-column prop="sort" :label="$t('menu.sort')" header-align="center" align="center"></el-table-column> |
||||
size="small">{{ $t('menu.type0') }}</el-tag> |
<el-table-column prop="url" :label="$t('menu.url')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column> |
||||
<el-tag v-else |
<el-table-column |
||||
size="small" |
prop="permissions" |
||||
type="info">{{ $t('menu.type1') }}</el-tag> |
:label="$t('menu.permissions')" |
||||
</template> |
header-align="center" |
||||
</el-table-column> |
align="center" |
||||
<el-table-column prop="sort" |
width="150" |
||||
:label="$t('menu.sort')" |
:show-overflow-tooltip="true" |
||||
header-align="center" |
></el-table-column> |
||||
align="center"></el-table-column> |
<el-table-column prop="showFlag" label="菜单类型" header-align="center" align="center"> |
||||
<el-table-column prop="url" |
<template slot-scope="scope"> |
||||
:label="$t('menu.url')" |
基础应用 |
||||
header-align="center" |
</template> |
||||
align="center" |
</el-table-column> |
||||
width="150" |
<el-table-column prop="type" :label="$t('状态')" header-align="center" align="center"> |
||||
:show-overflow-tooltip="true"></el-table-column> |
<template slot-scope="scope"> |
||||
<el-table-column prop="permissions" |
<el-tag v-if="scope.row.showFlag === 0" size="small" type="info">{{ $t('menu.status0') }}</el-tag> |
||||
:label="$t('menu.permissions')" |
<el-tag v-else size="small">{{ $t('menu.status1') }}</el-tag> |
||||
header-align="center" |
</template> |
||||
align="center" |
</el-table-column> |
||||
width="150" |
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> |
||||
:show-overflow-tooltip="true"></el-table-column> |
<template slot-scope="scope"> |
||||
<el-table-column :label="$t('handle')" |
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> |
||||
fixed="right" |
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> |
||||
header-align="center" |
<!-- <el-button type="text" size="small" @click="showCustomerMenu(scope.row)">{{ '客户配置' }}</el-button> --> |
||||
align="center" |
<el-button type="text" size="small" v-if="scope.row.showFlag == 0" @click="open(scope.row.id)">{{ '开启' }}</el-button> |
||||
width="150"> |
<el-button type="text" size="small" v-if="scope.row.showFlag == 1" @click="close(scope.row.id)">{{ '关闭' }}</el-button> |
||||
<template slot-scope="scope"> |
</template> |
||||
<el-button type="text" |
</el-table-column> |
||||
size="small" |
</el-table> |
||||
@click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> |
<!-- 弹窗, 新增 / 修改 --> |
||||
<el-button type="text" |
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :tableName="'data_menu'" @refreshDataList="getDataList"></add-or-update> |
||||
size="small" |
<!-- 客户菜单配置 --> |
||||
@click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> |
<customer-add-or-update ref="customerForm" :menuName="selMenuName" @refreshDataList="getDataList"></customer-add-or-update> |
||||
<el-button type="text" |
</div> |
||||
size="small" |
</el-card> |
||||
@click="showCustomerMenu(scope.row)">{{ '客户配置' }}</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<!-- 弹窗, 新增 / 修改 --> |
|
||||
<add-or-update v-if="addOrUpdateVisible" |
|
||||
ref="addOrUpdate" |
|
||||
:tableName="'data_menu'" |
|
||||
@refreshDataList="getDataList"></add-or-update> |
|
||||
<!-- 客户菜单配置 --> |
|
||||
<customer-add-or-update ref="customerForm" |
|
||||
:menuName="selMenuName" |
|
||||
@refreshDataList="getDataList"></customer-add-or-update> |
|
||||
</div> |
|
||||
</el-card> |
|
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import mixinViewModule from '@/mixins/view-module' |
import mixinViewModule from '@/mixins/view-module'; |
||||
import AddOrUpdate from './menu-add-or-update' |
import AddOrUpdate from './menu-add-or-update'; |
||||
import { mapGetters } from 'vuex' |
import { mapGetters } from 'vuex'; |
||||
import CustomerAddOrUpdate from './customer-add-or-update' |
import CustomerAddOrUpdate from './customer-add-or-update'; |
||||
export default { |
export default { |
||||
mixins: [mixinViewModule], |
mixins: [mixinViewModule], |
||||
data () { |
data() { |
||||
return { |
return { |
||||
mixinViewModuleOptions: { |
menuName: '', |
||||
getDataListURL: '/gov/access/menu/list', |
multipleSelection: [], |
||||
deleteURL: '/gov/access/menu' |
mixinViewModuleOptions: { |
||||
}, |
getDataListURL: '/gov/access/menu/list', |
||||
customerFormVisible: false, |
deleteURL: '/gov/access/menu' |
||||
dataForm: { "tableName": 'data_menu' }, |
}, |
||||
selMenuName: '' |
customerFormVisible: false, |
||||
} |
dataForm: { tableName: 'data_menu' }, |
||||
}, |
selMenuName: '' |
||||
components: { |
}; |
||||
AddOrUpdate, CustomerAddOrUpdate |
}, |
||||
}, |
components: { |
||||
computed: { |
AddOrUpdate, |
||||
tableHeight () { |
CustomerAddOrUpdate |
||||
// return this.resolution === 'small' ? this.clientHeight - 210 : this.clientHeight - 220 |
}, |
||||
return this.clientHeight - 210 |
computed: { |
||||
}, |
tableHeight() { |
||||
...mapGetters(['clientHeight', 'resolution']), |
// return this.resolution === 'small' ? this.clientHeight - 210 : this.clientHeight - 220 |
||||
}, |
return this.clientHeight - 210; |
||||
methods: { |
}, |
||||
showCustomerMenu (row) { |
...mapGetters(['clientHeight', 'resolution']) |
||||
|
}, |
||||
|
methods: { |
||||
|
search() { |
||||
|
if (this.menuName != '') { |
||||
|
let saveList = []; |
||||
|
this.onFuzzyTreeList('name', this.menuName, this.dataList, saveList); |
||||
|
this.$refs.form.data = saveList; |
||||
|
} else { |
||||
|
this.$refs.form.data = this.dataList; |
||||
|
} |
||||
|
}, |
||||
|
|
||||
this.selMenuName = row.name |
onFuzzyTreeList(key, value, treeList, saveList = []) { |
||||
this.$refs['customerForm'].init(row.id) |
return new Promise((resolve, reject) => { |
||||
} |
treeList.forEach(item => { |
||||
} |
if (item[key].indexOf(value) > -1) { |
||||
} |
saveList.push(item); |
||||
|
} else { |
||||
|
if (item.children && item.children.length > 0) { |
||||
|
const _reData = this.onFuzzyTreeList(key, value, item.children, saveList); |
||||
|
if (_reData && _reData.length > 0) { |
||||
|
saveList.push({ |
||||
|
...item, |
||||
|
children: _reData |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
resolve(saveList); |
||||
|
}); |
||||
|
}, |
||||
|
// search() { |
||||
|
// if (this.menuName == '') { |
||||
|
// this.getDataList(); |
||||
|
// } else { |
||||
|
// this.dataList = this.dataList.filter(item => { |
||||
|
// if (item.name.indexOf(this.menuName) !== -1) return item; |
||||
|
// }); |
||||
|
// } |
||||
|
// }, |
||||
|
handleSelectionChange(val) { |
||||
|
this.multipleSelection = []; |
||||
|
val.forEach(element => { |
||||
|
this.multipleSelection.push(element.id); |
||||
|
}); |
||||
|
console.log(this.multipleSelection); |
||||
|
}, |
||||
|
showCustomerMenu(row) { |
||||
|
this.selMenuName = row.name; |
||||
|
this.$refs['customerForm'].init(row.id); |
||||
|
}, |
||||
|
open(id) { |
||||
|
console.log('Aa'); |
||||
|
let menuIds = []; |
||||
|
if (id != '') { |
||||
|
menuIds = [id]; |
||||
|
} else { |
||||
|
if (this.multipleSelection.length > 0) { |
||||
|
menuIds = this.multipleSelection; |
||||
|
} else { |
||||
|
return this.$message.error('请选择菜单'); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
let params = { |
||||
|
menuIds: menuIds, |
||||
|
flagShow: 1 |
||||
|
}; |
||||
|
this.$http.post('/gov/access/menu/updateShow/', params).then(({ data: res }) => { |
||||
|
console.log(res); |
||||
|
if (res.code === 0) { |
||||
|
this.getDataList(); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
close(id) { |
||||
|
let menuIds = []; |
||||
|
|
||||
|
if (id != '') { |
||||
|
menuIds = [id]; |
||||
|
} else { |
||||
|
if (this.multipleSelection.length > 0) { |
||||
|
menuIds = this.multipleSelection; |
||||
|
} else { |
||||
|
return this.$message.error('请选择菜单'); |
||||
|
} |
||||
|
} |
||||
|
let params = { |
||||
|
menuIds: menuIds, |
||||
|
flagShow: 0 |
||||
|
}; |
||||
|
this.$http.post('/gov/access/menu/updateShow/', params).then(({ data: res }) => { |
||||
|
console.log(res); |
||||
|
if (res.code === 0) { |
||||
|
this.getDataList(); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
</script> |
</script> |
||||
|
<style> |
||||
|
.little-head { |
||||
|
border-bottom: dashed 1px #ccc; |
||||
|
line-height: 50px; |
||||
|
margin-bottom: 20px; |
||||
|
} |
||||
|
</style> |
||||
|
Loading…
Reference in new issue