jiangyy 5 years ago
parent
commit
49de9e52b3
  1. 3
      epmet-oper-web/src/i18n/en-US.js
  2. 3
      epmet-oper-web/src/i18n/zh-CN.js
  3. 3
      epmet-oper-web/src/i18n/zh-TW.js
  4. 44
      epmet-oper-web/src/views/main-sidebar-sub-menu.vue
  5. 163
      epmet-oper-web/src/views/modules/customer/customize/CustomerList.vue
  6. 241
      epmet-oper-web/src/views/modules/customer/customize/roleList.vue
  7. 7
      epmet-oper-web/src/views/modules/sys/menu-add-or-update.vue

3
epmet-oper-web/src/i18n/en-US.js

@ -338,6 +338,9 @@ t.menu.type0 = 'Menu'
t.menu.type1 = 'Button'
t.menu.sort = 'Sort'
t.menu.url = 'Route'
t.menu.showFlag = 'ShowFlag'
t.menu.show1 = 'True'
t.menu.show2 = 'False'
t.menu.permissions = 'Auth ID'
t.menu.permissionsTips = 'eg: sys:menu:save'
t.menu.parentName = 'Superior'

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

@ -340,6 +340,9 @@ t.menu.type0 = '菜单'
t.menu.type1 = '按钮'
t.menu.sort = '排序'
t.menu.url = '路由'
t.menu.showFlag = '是否显示'
t.menu.show1 = '是'
t.menu.show2 = '否'
t.menu.permissions = '授权标识'
t.menu.permissionsTips = '如: sys:menu:save'
t.menu.parentName = '上级菜单'

3
epmet-oper-web/src/i18n/zh-TW.js

@ -338,6 +338,9 @@ t.menu.type0 = '菜單'
t.menu.type1 = '按鈕'
t.menu.sort = '排序'
t.menu.url = '路由'
t.menu.showFlag = '是否显示'
t.menu.show1 = '是'
t.menu.show2 = '否'
t.menu.permissions = '授權標識'
t.menu.permissionsTips = '如: sys:menu:save'
t.menu.parentName = '上級菜單'

44
epmet-oper-web/src/views/main-sidebar-sub-menu.vue

@ -1,27 +1,25 @@
<template>
<el-submenu v-if="menu.children && menu.children.length >= 1"
:index="menu.id"
:popper-append-to-body="false">
<template slot="title">
<svg class="icon-svg aui-sidebar__menu-icon"
aria-hidden="true">
<use :xlink:href="`#${menu.icon}`"></use>
<div v-if="menu.showFlag">
<el-submenu
v-if="menu.children && menu.children.length >= 1"
:index="menu.id"
:popper-append-to-body="false"
>
<template slot="title">
<svg class="icon-svg aui-sidebar__menu-icon" aria-hidden="true">
<use :xlink:href="`#${menu.icon}`" />
</svg>
<span>{{ menu.name }}</span>
</template>
<sub-menu v-for="item in menu.children" :key="item.id" :menu="item"></sub-menu>
</el-submenu>
<el-menu-item v-else :index="menu.id" @click="gotoRouteHandle(menu.id)">
<svg class="icon-svg aui-sidebar__menu-icon" aria-hidden="true">
<use :xlink:href="`#${menu.icon}`" />
</svg>
<span>{{ menu.name }}</span>
</template>
<sub-menu v-for="item in menu.children"
:key="item.id"
:menu="item"></sub-menu>
</el-submenu>
<el-menu-item v-else
:index="menu.id"
@click="gotoRouteHandle(menu.id)">
<svg class="icon-svg aui-sidebar__menu-icon"
aria-hidden="true">
<use :xlink:href="`#${menu.icon}`"></use>
</svg>
<span>{{ menu.name }}</span>
</el-menu-item>
</el-menu-item>
</div>
</template>
<script>
@ -40,7 +38,9 @@ export default {
methods: {
// menuId()
gotoRouteHandle (menuId) {
var route = window.SITE_CONFIG['dynamicMenuRoutes'].filter(item => item.meta.menuId === menuId)[0]
var route = window.SITE_CONFIG['dynamicMenuRoutes'].filter(
(item) => item.meta.menuId === menuId
)[0]
if (route) {
this.$router.push({ name: route.name })
}

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

@ -1,93 +1,103 @@
<template>
<el-card shadow="never"
class="aui-card--fill">
<div v-show="showType==='list'"
class="mod-/oper/customize__homecomponent}">
<el-card shadow="never" class="aui-card--fill">
<div v-show="showType==='list'" class="mod-/oper/customize__homecomponent}">
<el-form :inline="true">
<el-form-item>
<el-input v-model="ruleForm.name"
placeholder="请输入客户名称"
:clearable="true"></el-input>
<el-input v-model="ruleForm.name" placeholder="请输入客户名称" :clearable="true"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary"
@click="submitForm(ruleForm)">查询</el-button>
<el-button type="primary" @click="submitForm(ruleForm)">查询</el-button>
</el-form-item>
</el-form>
<el-table :data="customerList"
border
style="width: 100%;">
<el-table-column label="客户名称"
header-align="center"
align="center"
prop="customerName"></el-table-column>
<el-table-column label="logo"
header-align="center"
align="center"
prop="logo">
<el-table :data="customerList" border style="width: 100%;">
<el-table-column label="客户名称" header-align="center" align="center" prop="customerName"></el-table-column>
<el-table-column label="logo" header-align="center" align="center" prop="logo">
<template slot-scope="scope">
<el-image style="width: 50px; height: 50px"
:src="scope.row.logo"
@click="addSrcList(scope.row.logo)"
:preview-src-list="srcList"></el-image>
<el-image
style="width: 50px; height: 50px"
:src="scope.row.logo"
@click="addSrcList(scope.row.logo)"
:preview-src-list="srcList"
></el-image>
</template>
</el-table-column>
<el-table-column :label="$t('handle')"
fixed="right"
header-align="center"
align="center"
width="350">
<el-table-column
:label="$t('handle')"
fixed="right"
header-align="center"
align="center"
width="350"
>
<template slot-scope="scope">
<el-button type="text"
size="small"
@click="showMiniHome(scope.row.customerId,scope.row.customerName,0)">居民端首页</el-button>
<el-button type="text"
size="small"
@click="showMiniHome(scope.row.customerId,scope.row.customerName,1)">工作端首页</el-button>
<el-button type="text"
size="small"
@click="showConfigItem(scope.row.customerId,scope.row.customerName)">功能配置</el-button>
<el-button type="text"
size="small"
@click="showLimitConfig(scope.row.customerId,scope.row.customerName)">角色权限</el-button>
<el-button
type="text"
size="small"
@click="showMiniHome(scope.row.customerId,scope.row.customerName,0)"
>居民端首页</el-button>
<el-button
type="text"
size="small"
@click="showMiniHome(scope.row.customerId,scope.row.customerName,1)"
>工作端首页</el-button>
<el-button
type="text"
size="small"
@click="showConfigItem(scope.row.customerId,scope.row.customerName)"
>功能配置</el-button>
<el-button
type="text"
size="small"
@click="showLimitConfig(scope.row.customerId,scope.row.customerName)"
>角色权限</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination :current-page="pageNo"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<el-pagination
:current-page="pageNo"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle"
></el-pagination>
</div>
<div v-show="showType==='miniHome'">
<mini-home ref="ref_mini_home"
@cancleBack='cancleBack'></mini-home>
<mini-home ref="ref_mini_home" @cancleBack="cancleBack"></mini-home>
</div>
<div v-show="showType==='config'">
<config-item ref="ref_config_item"
@cancleBack='cancleBack'></config-item>
<config-item ref="ref_config_item" @cancleBack="cancleBack"></config-item>
</div>
<el-dialog
:visible.sync="funcVisible"
title="功能列表"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="90%"
top="30px"
>
<role-list v-if="funcVisible" :customer-id="customerId" :customer-name="customerName" />
</el-dialog>
</el-card>
</template>
<script>
import ConfigItem from './ConfigItem'
import MiniHome from './MiniHome'
import RoleList from './roleList'
export default {
data () {
return {
funcVisible: false,
diaName: '功能配置',
noImg: '暂无图片',
customerList: [],
input: '',
customerId: '',
customerName: '',
pageNo: 1,
pageSize: 10,
ruleForm: { name: '' },
@ -95,11 +105,13 @@ export default {
total: 0,
srcList: [],
showType: 'list'//
showType: 'list' //
}
},
components: {
ConfigItem, MiniHome
ConfigItem,
MiniHome,
RoleList
},
created () {
this.queryCustomerList()
@ -111,12 +123,14 @@ export default {
pageNo: this.pageNo,
pageSize: this.pageSize
}
this.$http.post('/oper/crm/customer/pagequery', params).then(({ data: res }) => {
if (res.code === 0) {
this.customerList = res.data.list
this.total = res.data.total
}
})
this.$http
.post('/oper/crm/customer/pagequery', params)
.then(({ data: res }) => {
if (res.code === 0) {
this.customerList = res.data.list
this.total = res.data.total
}
})
},
submitForm (formName) {
let params = {
@ -124,15 +138,21 @@ export default {
pageNo: this.pageNo,
pageSize: this.pageSize
}
this.$http.post('/oper/crm/customer/pagequery', params).then(({ data: res }) => {
if (res.code === 0) {
this.customerList = res.data.list
}
})
this.$http
.post('/oper/crm/customer/pagequery', params)
.then(({ data: res }) => {
if (res.code === 0) {
this.customerList = res.data.list
}
})
},
showMiniHome (customerId, customerName, type) {
this.showType = 'miniHome'
this.$refs['ref_mini_home'].startSetWxIndex(customerId, customerName, type)
this.$refs['ref_mini_home'].startSetWxIndex(
customerId,
customerName,
type
)
},
//
@ -143,7 +163,10 @@ export default {
//
showLimitConfig (customerId, customerName) {
this.$message.warning('当前功能还未开发')
this.customerId = customerId
this.customerName = customerName
this.funcVisible = !this.funcVisible
// this.$message.warning("");
},
pageCurrentChangeHandle (val) {

241
epmet-oper-web/src/views/modules/customer/customize/roleList.vue

@ -0,0 +1,241 @@
<template>
<div class="role-container">
<el-card class="flex1">
<div class="now-name">当前客户: {{customerName}}</div>
<el-table v-loading="loading1" :data="roleList" border style="width: 100%">
<el-table-column type="index" width="50"></el-table-column>
<!-- <el-table-column prop="roleId" label="角色ID"></el-table-column> -->
<el-table-column prop="roleName" label="角色名称"></el-table-column>
<el-table-column prop="roleKey" label="角色Key"></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="toOperationConfig(scope.row.roleId, scope.row.roleName)">功能权限</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card v-show="funcShow" class="flex1" style="margin: 0 10px;">
<div class="now-name">当前角色: {{roleName}}</div>
<el-table
v-loading="loading2"
max-height="580"
ref="opeTable"
:data="opeList"
border
style="width: 100%"
@select="handleSelectionChange"
>
<el-table-column type="selection" width="55"></el-table-column>
<!-- <el-table-column prop="operationKey" label="操作Key"></el-table-column> -->
<el-table-column prop="operationName" label="操作名称"></el-table-column>
<!-- <el-table-column prop="brief" label="简介"></el-table-column> -->
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="toScopeConfig(scope.row.operationKey, scope.row.operationName)">权限配置</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card v-show="roleShow" class="flex1">
<div class="now-name">当前功能: {{funcName}}</div>
<div>
<el-row :gutter="12">
<el-col :span="12" v-loading="loading3">
<el-card shadow="hover">
<el-checkbox-group class="t" v-model="checkedScopes" @change="roleChange">
<el-checkbox
v-for="scope in scopeOptions"
:label="scope.scopeKey"
:key="scope.scopeKey"
:checked="scope.assigned"
>{{scope.scopeName}}</el-checkbox>
</el-checkbox-group>
</el-card>
</el-col>
<!-- <el-col :span="8">
<el-card shadow="hover">
<el-checkbox-group class="t" v-model="checkedSettings">
<el-checkbox
v-for="setting in settingOptions"
:label="setting.settingKey"
:key="setting.settingKey"
:checked="setting.assigned"
>{{setting.settingName}}</el-checkbox>
</el-checkbox-group>
</el-card>
</el-col> -->
</el-row>
</div>
</el-card>
</div>
</template>
<script>
export default {
name: 'RoleList',
props: {
customerId: {
type: String,
default: ''
},
customerName: {
type: String,
default: ''
}
},
data () {
return {
loading1: false,
loading2: false,
loading3: false,
funcShow: false,
roleShow: false,
roleName: '',
funcName: '',
roleList: [],
opeList: [],
roleKey: '',
operationKey: '',
scopeOptions: [],
settingOptions: [],
checkedScopes: [],
checkedSettings: [],
roleId: ''
}
},
created () {
this.listRolesByCustomerId(this.customerId)
},
beforeDestroy () {
let _data = this.$data
for (let n in _data) {
if (typeof _data[n] === 'boolean') _data[n] = false
if (typeof _data[n] === 'string') _data[n] = ''
if (typeof _data[n] === 'object') _data[n] = []
console.log(n, _data[n])
}
},
methods: {
listRolesByCustomerId (customerId) {
this.loading1 = true
this.$http
.post('/epmetuser/govstaffrole/rolesbycustomer/' + customerId)
.then(({ data: res }) => {
console.log('ressss', res)
if (res.code === 0) {
this.roleList = res.data
}
setTimeout(() => {
this.loading1 = false
}, 500)
})
},
listOperations4AccessConfig (roleId) {
this.roleId = roleId
this.loading2 = true
this.$http.post('/gov/access/config/roleopes/' + roleId).then((resp) => {
this.opeList = resp.data.data
this.$nextTick(function () {
this.defaultCheck() //
})
setTimeout(() => {
this.loading2 = false
}, 500)
})
},
listSettingOptions (operationKey) {
let params = {
roleId: this.roleId,
operationKey: operationKey
}
this.loading3 = true
this.$http
.post('/gov/access/config/configoptions', params)
.then(resp => {
console.log('scopeOptions', resp.data)
this.scopeOptions = resp.data.data.scopeOptions
this.settingOptions = resp.data.data.settingOptions
setTimeout(() => {
this.loading3 = false
}, 500)
})
},
defaultCheck () {
for (var index in this.opeList) {
let role = this.opeList[index]
if (role.assigned) {
this.$refs.opeTable.toggleRowSelection(role, true)
}
}
},
toOperationConfig (roleId, roleName) {
this.roleName = roleName
this.funcShow = true
this.opeList = []
this.listOperations4AccessConfig(roleId)
},
toScopeConfig (operationKey, operationName) {
this.roleShow = true
this.operationKey = operationKey
this.funcName = operationName
this.checkedScopes = []
this.listSettingOptions(operationKey)
},
saveOperations4Role (val) {
let param = {
roleId: this.roleId,
opes: val
}
this.$http.post('/gov/access/config/saveroleopes', param).then(
resp => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listOperations4AccessConfig(this.roleId)
}
)
},
saveSettings (val) {
let param = {
roleId: this.roleId,
operationKey: this.operationKey,
scopeKeys: val,
settingKeys: this.checkedSettings
}
this.$http.post('/gov/access/config/saveconfig', param).then(
resp => {
this.$message({
type: 'success',
message: '保存成功'
})
this.listSettingOptions(this.operationKey)
}
)
},
roleChange (val) {
console.log('valooo', val)
this.saveSettings(val)
},
handleSelectionChange (val) {
this.saveOperations4Role(val)
}
}
}
</script>
<style>
.role-container {
display: flex;
}
.flex1 {
flex: 1;
}
.now-name {
margin-bottom: 10px;
}
.aui-wrapper .el-card + .el-card {
margin-top: 0;
}
</style>

7
epmet-oper-web/src/views/modules/sys/menu-add-or-update.vue

@ -30,6 +30,12 @@
<el-form-item v-if="dataForm.type === 0" prop="url" :label="$t('menu.url')">
<el-input v-model="dataForm.url" :placeholder="$t('menu.url')"></el-input>
</el-form-item>
<el-form-item prop="showFlag" :label="$t('menu.showFlag')" size="mini">
<el-radio-group v-model="dataForm.showFlag">
<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>
@ -104,6 +110,7 @@ export default {
pid: '0',
parentName: '',
url: '',
showFlag: 1,
resourceList: [],
permissions: '',
sort: 0,

Loading…
Cancel
Save