Browse Source

菜单修改

wxz_dy_form_config
lichao 2 years ago
parent
commit
35ea3c0dcf
  1. 4
      epmet-oper-web/src/i18n/zh-CN.js
  2. 37
      epmet-oper-web/src/views/modules/customer/customize/CustomerList.vue
  3. 178
      epmet-oper-web/src/views/modules/customer/customize/menu-customer-add-or-update.vue
  4. 230
      epmet-oper-web/src/views/modules/customer/customize/menuCustomer.vue
  5. 230
      epmet-oper-web/src/views/modules/customer/customize/menuDataCustomer.vue

4
epmet-oper-web/src/i18n/zh-CN.js

@ -352,6 +352,10 @@ t.menu.resource = '授权资源'
t.menu.resourceUrl = '资源URL'
t.menu.resourceMethod = '请求方式'
t.menu.resourceAddItem = '添加一项'
t.menu.status = '状态'
t.menu.status0 = '未启用'
t.menu.status1 = '已启用'
t.menu.useFlag = '是否启用'
t.params = {}
t.params.paramCode = '编码'

37
epmet-oper-web/src/views/modules/customer/customize/CustomerList.vue

@ -72,6 +72,12 @@
<el-button type="text"
size="small"
@click="showElegant(scope.row.customerId,scope.row.customerName)">党员风采分类配置</el-button>
<el-button type="text"
size="small"
@click="showMenu(scope.row.customerId,scope.row.customerName)">管理平台菜单配置</el-button>
<el-button type="text"
size="small"
@click="showDataMenu(scope.row.customerId,scope.row.customerName)">数据看板菜单配置</el-button>
</template>
</el-table-column>
</el-table>
@ -114,6 +120,14 @@
<elegant ref="ref_elegant"
@cancleBack="cancleBack"></elegant>
</div>
<div v-if="showType==='menuCustomer'">
<menu-customer ref="ref_menu_customer"
@cancleBack="cancleBack"></menu-customer>
</div>
<div v-if="showType==='menuDataCustomer'">
<menu-data-customer ref="ref_menu_data_customer"
@cancleBack="cancleBack"></menu-data-customer>
</div>
<!-- <el-dialog :visible.sync="funcVisible"
title="功能列表"
@ -147,6 +161,8 @@ import categoryList from './CategoryList'
import StartPage from './StartPage'
import RoleAuth from './RoleAuth'
import elegant from './elegant.vue'
import MenuCustomer from './menuCustomer.vue'
import MenuDataCustomer from './menuDataCustomer.vue'
export default {
data () {
return {
@ -178,7 +194,9 @@ export default {
categoryList,
StartPage,
RoleAuth,
elegant
elegant,
MenuCustomer,
MenuDataCustomer
},
activated () {
@ -276,6 +294,23 @@ export default {
})
},
//
showMenu (customerId, customerName) {
this.showType = 'menuCustomer'
this.$nextTick(() => {
this.$refs['ref_menu_customer'].initData(customerId, customerName)
})
},
//
showDataMenu (customerId, customerName) {
this.showType = 'menuDataCustomer'
this.$nextTick(() => {
this.$refs['ref_menu_data_customer'].initData(customerId, customerName)
})
},
//
showRoleAuth (customerId, customerName) {
this.showType = 'roleAuth'

178
epmet-oper-web/src/views/modules/customer/customize/menu-customer-add-or-update.vue

@ -0,0 +1,178 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="name" :label="$t('menu.name')">
<el-input v-model="dataForm.name" :placeholder="$t('menu.name')"></el-input>
</el-form-item>
<el-form-item prop="useFlag" :label="$t('menu.useFlag')" size="mini">
<el-radio-group v-model="dataForm.useFlag">
<el-radio :label="1">{{ $t('menu.show1') }}</el-radio>
<el-radio :label="0">{{ $t('menu.show2') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="sort" :label="$t('menu.sort')">
<el-input-number v-model="dataForm.sort" controls-position="right" :min="0" :label="$t('menu.sort')"></el-input-number>
</el-form-item>
<el-form-item v-if="dataForm.type === 0" prop="icon" :label="$t('menu.icon')" class="icon-list">
<el-popover v-model="iconListVisible" ref="iconListPopover" placement="bottom-start" trigger="click" popper-class="mod-sys__menu-icon-popover">
<div class="mod-sys__menu-icon-inner">
<div class="mod-sys__menu-icon-list">
<el-button
v-for="(item, index) in iconList"
:key="index"
@click="iconListCurrentChangeHandle(item)"
:class="{ 'is-active': dataForm.icon === item }">
<svg class="icon-svg" aria-hidden="true"><use :xlink:href="`#${item}`"></use></svg>
</el-button>
</div>
</div>
</el-popover>
<el-input v-model="dataForm.icon" v-popover:iconListPopover :readonly="true" :placeholder="$t('menu.icon')"></el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
import { getIconList } from '@/utils'
export default {
data () {
return {
visible: false,
menuList: [],
menuListVisible: false,
iconList: [],
iconListVisible: false,
dataForm: {
id: '',
type: 0,
name: '',
pid: '0',
customerId:'',
parentName: '',
url: '',
useFlag: 1,
resourceList: [],
permissions: '',
sort: 0,
icon: ''
}
}
},
computed: {
dataRule () {
return {
name: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
watch: {
'dataForm.type' (val) {
this.$refs['dataForm'].clearValidate()
}
},
methods: {
init () {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
this.iconList = getIconList()
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
getInfo () {
this.$http.get(`/gov/access/govMenuCustomerRelation/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => {})
},
// ,
iconListCurrentChangeHandle (icon) {
this.dataForm.icon = icon
this.iconListVisible = false
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http['post']('/gov/access/govMenuCustomerRelation/update', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script>
<style lang="scss">
.mod-sys__menu {
.resource-list {
.el-select .el-input__inner {
min-width: 110px;
text-align: center;
}
}
.menu-list,
.icon-list {
.el-input__inner,
.el-input__suffix {
cursor: pointer;
}
}
&-icon-popover {
width: 458px;
overflow: hidden;
}
&-icon-inner {
width: 478px;
max-height: 258px;
overflow-x: hidden;
overflow-y: auto;
}
&-icon-list {
width: 458px;
padding: 0;
margin: -8px 0 0 -8px;
> .el-button {
padding: 8px;
margin: 8px 0 0 8px;
> span {
display: inline-block;
vertical-align: middle;
width: 18px;
height: 18px;
font-size: 18px;
}
}
}
}
</style>

230
epmet-oper-web/src/views/modules/customer/customize/menuCustomer.vue

@ -0,0 +1,230 @@
<template>
<div>
<div class="mod-sys__menu">
<div class="div_btn">
<span style="margin-right:10px">{{customerName}}</span>
<el-button type="default"
@click="diaCancel">取消返回</el-button>
<!-- <el-button class=""
type="primary"
@click="addShow()">{{"新增" }}</el-button> -->
<!-- <el-input v-model="search"
placeholder="请输入内容"></el-input> -->
</div>
<div class="div_btn">
<el-button class=""
type="primary"
@click="useMenu()">开启</el-button>
<el-button class=""
type="primary"
@click="closeMenu()">关闭</el-button>
</div>
<el-table v-loading="dataListLoading"
:data="dataList"
row-key="id"
border
style="width: 100%;"
@select-all="selectAll"
@selection-change="handelSelection">
<el-table-column
type="selection"
fixed="left"
align="center"
width="50"
/>
<el-table-column prop="name"
:label="$t('menu.name')"
header-align="center"
min-width="150"></el-table-column>
<el-table-column prop="icon"
:label="$t('menu.icon')"
header-align="center"
align="center">
<template slot-scope="scope">
<svg class="icon-svg"
aria-hidden="true">
<use :xlink:href="`#${scope.row.icon}`"></use>
</svg>
</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>
<script>
import { requestPost } from '@/js/dai/request'
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './menu-customer-add-or-update'
export default {
mixins: [mixinViewModule],
data () {
return {
customerId: '', // id
customerName: '', //
tableParams: {
customerId: ''
},
search: '',
dataList: [],
selection: [],
selAllFlag: false,
dataListLoading: false,
mixinViewModuleOptions: {
getDataListURL: '/gov/access/menu/customerMenuList'
}
}
},
computed: {
},
components: {
AddOrUpdate
},
created() {
},
methods: {
useMenu(){
let ids = this.selection.map((item) => item.id);
this.$http
.post('/gov/access/govMenuCustomerRelation/useUpdate', {
ids: ids,
use: '1'
})
.then(({ data: res }) => {
return this.$message.success("操作成功");
})
this.query();
},
closeMenu(){
let ids = this.selection.map((item) => item.id);
this.$http
.post('/gov/access/govMenuCustomerRelation/useUpdate', {
ids: ids,
use: '0'
})
.then(({ data: res }) => {
return this.$message.success("操作成功");
})
this.query();
},
useUpdate(id,use){
this.$http
.post('/gov/access/govMenuCustomerRelation/useUpdate', {
ids: [id],
use: use
})
.then(({ data: res }) => {
return this.$message.success("操作成功");
})
this.query();
},
query() {
this.dataListLoading = true
this.$http
.post('/gov/access/menu/customerMenuList', {
customerId: this.customerId,
tableName: 'gov_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()
// }
},
selectAll(selection) {
this.selection = selection;
if (selection.length > 0) {
this.selAllFlag = true;
} else {
this.selAllFlag = false;
}
},
handelSelection(row){
this.selection = row
},
//
diaCancel () {
this.$emit('cancleBack')
},
}
}
</script>
<style>
.div_btn {
margin: 0 0 20px 0;
}
</style>

230
epmet-oper-web/src/views/modules/customer/customize/menuDataCustomer.vue

@ -0,0 +1,230 @@
<template>
<div>
<div class="mod-sys__menu">
<div class="div_btn">
<span style="margin-right:10px">{{customerName}}</span>
<el-button type="default"
@click="diaCancel">取消返回</el-button>
<!-- <el-button class=""
type="primary"
@click="addShow()">{{"新增" }}</el-button> -->
<!-- <el-input v-model="search"
placeholder="请输入内容"></el-input> -->
</div>
<div class="div_btn">
<el-button class=""
type="primary"
@click="useMenu()">开启</el-button>
<el-button class=""
type="primary"
@click="closeMenu()">关闭</el-button>
</div>
<el-table v-loading="dataListLoading"
:data="dataList"
row-key="id"
border
style="width: 100%;"
@select-all="selectAll"
@selection-change="handelSelection">
<el-table-column
type="selection"
fixed="left"
align="center"
width="50"
/>
<el-table-column prop="name"
:label="$t('menu.name')"
header-align="center"
min-width="150"></el-table-column>
<el-table-column prop="icon"
:label="$t('menu.icon')"
header-align="center"
align="center">
<template slot-scope="scope">
<svg class="icon-svg"
aria-hidden="true">
<use :xlink:href="`#${scope.row.icon}`"></use>
</svg>
</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>
<script>
import { requestPost } from '@/js/dai/request'
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './menu-customer-add-or-update'
export default {
mixins: [mixinViewModule],
data () {
return {
customerId: '', // id
customerName: '', //
tableParams: {
customerId: ''
},
search: '',
dataList: [],
selection: [],
selAllFlag: false,
dataListLoading: false,
mixinViewModuleOptions: {
getDataListURL: '/gov/access/menu/customerMenuList'
}
}
},
computed: {
},
components: {
AddOrUpdate
},
created() {
},
methods: {
useMenu(){
let ids = this.selection.map((item) => item.id);
this.$http
.post('/gov/access/govMenuCustomerRelation/useUpdate', {
ids: ids,
use: '1'
})
.then(({ data: res }) => {
return this.$message.success("操作成功");
})
this.query();
},
closeMenu(){
let ids = this.selection.map((item) => item.id);
this.$http
.post('/gov/access/govMenuCustomerRelation/useUpdate', {
ids: ids,
use: '0'
})
.then(({ data: res }) => {
return this.$message.success("操作成功");
})
this.query();
},
useUpdate(id,use){
this.$http
.post('/gov/access/govMenuCustomerRelation/useUpdate', {
ids: [id],
use: use
})
.then(({ data: res }) => {
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()
// }
},
selectAll(selection) {
this.selection = selection;
if (selection.length > 0) {
this.selAllFlag = true;
} else {
this.selAllFlag = false;
}
},
handelSelection(row){
this.selection = row
},
//
diaCancel () {
this.$emit('cancleBack')
},
}
}
</script>
<style>
.div_btn {
margin: 0 0 20px 0;
}
</style>
Loading…
Cancel
Save