Browse Source

数据看板

wxz_dy_form_config
tianq 2 years ago
parent
commit
993245bdce
  1. 539
      epmet-oper-web/src/views/modules/customer/customize/CustomerList.vue
  2. 371
      epmet-oper-web/src/views/modules/customer/customize/menuCustomer.vue
  3. 75
      epmet-oper-web/src/views/modules/workPc/menu.vue

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

@ -1,135 +1,68 @@
<template> <template>
<div> <div>
<el-card shadow="never" <el-card shadow="never" class="aui-card--fill">
class="aui-card--fill"> <div v-show="showType === 'list'" class="mod-/oper/customize__homecomponent}">
<div v-show="showType==='list'" <el-form :inline="true">
class="mod-/oper/customize__homecomponent}"> <el-form-item><el-input v-model="ruleForm.name" placeholder="请输入客户名称" :clearable="true"></el-input></el-form-item>
<el-form :inline="true"> <el-form-item><el-button type="primary" @click="submitForm(ruleForm)">查询</el-button></el-form-item>
<el-form-item> </el-form>
<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-form-item>
</el-form>
<el-table :data="customerList" <el-table :data="customerList" ref="ref_customertable" border style="width: 100%;">
ref="ref_customertable" <el-table-column label="序号" header-align="center" align="center" type="index"></el-table-column>
border <el-table-column label="客户名称" header-align="center" align="center" prop="customerName"></el-table-column>
style="width: 100%;"> <el-table-column label="logo" header-align="center" align="center" prop="logo">
<el-table-column label="客户名称" <template slot-scope="scope">
header-align="center" <el-image
align="center" v-if="scope.row.logo"
prop="customerName"></el-table-column> style="width: 50px; height: 50px"
<el-table-column label="logo" :src="scope.row.logo"
header-align="center" @click="addSrcList(scope.row.logo)"
align="center" :preview-src-list="srcList"
prop="logo"> ></el-image>
<template slot-scope="scope"> <span v-else>--</span>
</template>
</el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="700">
<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="showFootbar(scope.row.customerId, scope.row.customerName)">FootBar配置</el-button>
<el-button type="text" size="small" @click="showRoleAuth(scope.row.customerId, scope.row.customerName)">角色权限</el-button>
<el-image v-if="scope.row.logo" <el-button type="text" size="small" @click="showMost(scope.row.customerId, scope.row.customerName)">高级配置</el-button>
style="width: 50px; height: 50px" <el-button type="text" size="small" @click="showCategory(scope.row.customerId, scope.row.customerName)">分类配置</el-button>
:src="scope.row.logo" <el-button type="text" size="small" @click="showStartPage(scope.row.customerId, scope.row.customerName, 0)">启动页配置</el-button>
@click="addSrcList(scope.row.logo)" <el-button type="text" size="small" @click="showElegant(scope.row.customerId, scope.row.customerName)">党员风采分类配置</el-button>
:preview-src-list="srcList"></el-image> <el-button type="text" size="small" @click="showMenu(scope.row.customerId, scope.row.customerName)">管理平台菜单配置</el-button>
<span v-else>--</span> <el-button type="text" size="small" @click="showDataMenu(scope.row.customerId, scope.row.customerName)">数据看板菜单配置</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('handle')" </el-table>
fixed="right" <el-pagination
header-align="center" :current-page="pageNo"
align="center" :page-sizes="[10, 20, 50, 100]"
width="700"> :page-size="pageSize"
<template slot-scope="scope"> layout="total, sizes, prev, pager, next, jumper"
<el-button type="text" :total="total"
size="small" @size-change="pageSizeChangeHandle"
@click="showMiniHome(scope.row.customerId,scope.row.customerName,0)">居民端首页</el-button> @current-change="pageCurrentChangeHandle"
<el-button type="text" ></el-pagination>
size="small" </div>
@click="showMiniHome(scope.row.customerId,scope.row.customerName,1)">工作端首页</el-button> <div v-show="showType === 'miniHome'"><homepage ref="ref_mini_home" @cancleBack="cancleBack"></homepage></div>
<el-button type="text" <div v-show="showType === 'config'"><config-item ref="ref_config_item" @cancleBack="cancleBack"></config-item></div>
size="small" <div v-show="showType === 'footbar'">
@click="showConfigItem(scope.row.customerId,scope.row.customerName)">功能配置</el-button> <footbar-list ref="ref_footbarlist" :showFrom="'customize'" :tableKeywork="'FootBarCustomize'" @cancleBack="cancleBack"></footbar-list>
<el-button type="text" </div>
size="small" <div v-show="showType === 'roleAuth'"><role-auth ref="ref_roleAuth" @cancleBack="cancleBack"></role-auth></div>
@click="showFootbar(scope.row.customerId,scope.row.customerName)">FootBar配置</el-button> <div v-if="showType === 'mostedit'"><most-list ref="ref_mostlist" @cancleBack="cancleBack"></most-list></div>
<el-button type="text" <div v-if="showType === 'category'"><category-list ref="ref_category" @cancleBack="cancleBack"></category-list></div>
size="small"
@click="showRoleAuth(scope.row.customerId,scope.row.customerName)">角色权限</el-button>
<el-button type="text" <div v-if="showType === 'elegant'"><elegant ref="ref_elegant" @cancleBack="cancleBack"></elegant></div>
size="small" <div v-if="showType === 'menuCustomer'"><menu-customer ref="ref_menu_customer" @cancleBack="cancleBack"></menu-customer></div>
@click="showMost(scope.row.customerId,scope.row.customerName)">高级配置</el-button> <div v-if="showType === 'menuDataCustomer'"><menu-data-customer ref="ref_menu_data_customer" @cancleBack="cancleBack"></menu-data-customer></div>
<el-button type="text"
size="small"
@click="showCategory(scope.row.customerId,scope.row.customerName)">分类配置</el-button>
<el-button type="text"
size="small"
@click="showStartPage(scope.row.customerId,scope.row.customerName,0)">启动页配置</el-button>
<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>
<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'">
<homepage ref="ref_mini_home"
@cancleBack="cancleBack"></homepage>
</div>
<div v-show="showType==='config'">
<config-item ref="ref_config_item"
@cancleBack="cancleBack"></config-item>
</div>
<div v-show="showType==='footbar'">
<footbar-list ref="ref_footbarlist"
:showFrom="'customize'"
:tableKeywork="'FootBarCustomize'"
@cancleBack="cancleBack"></footbar-list>
</div>
<div v-show="showType==='roleAuth'">
<role-auth ref="ref_roleAuth"
@cancleBack="cancleBack"></role-auth>
</div>
<div v-if="showType==='mostedit'">
<most-list ref="ref_mostlist"
@cancleBack="cancleBack"></most-list>
</div>
<div v-if="showType==='category'">
<category-list ref="ref_category"
@cancleBack="cancleBack"></category-list>
</div>
<div v-if="showType==='elegant'"> <!-- <el-dialog :visible.sync="funcVisible"
<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="功能列表" title="功能列表"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
@ -139,207 +72,191 @@
:customer-id="customerId" :customer-id="customerId"
:customer-name="customerName" /> :customer-name="customerName" />
</el-dialog> --> </el-dialog> -->
<div v-show="showType==='startPage'"> <div v-show="showType === 'startPage'">
<start-page ref="ref_startPage" <start-page ref="ref_startPage" :customer-id="customerId" :showFrom="'customize'" :tableKeywork="'FootBarCustomize'" @cancleBack="cancleBack"></start-page>
:customer-id="customerId" </div>
:showFrom="'customize'" </el-card>
:tableKeywork="'FootBarCustomize'" </div>
@cancleBack="cancleBack"></start-page>
</div>
</el-card>
</div>
</template> </template>
<script> <script>
import ConfigItem from './ConfigItem' import ConfigItem from './ConfigItem';
import FootbarList from '../../productConfig/footbar/FootbarList' import FootbarList from '../../productConfig/footbar/FootbarList';
// import MiniHome from './MiniHome' // import MiniHome from './MiniHome'
import homepage from '../../productConfig/homeCustom/homepage' import homepage from '../../productConfig/homeCustom/homepage';
import MostList from './MostList' import MostList from './MostList';
// import RoleList from './roleList' // import RoleList from './roleList'
import categoryList from './CategoryList' import categoryList from './CategoryList';
import StartPage from './StartPage' import StartPage from './StartPage';
import RoleAuth from './RoleAuth' import RoleAuth from './RoleAuth';
import elegant from './elegant.vue' import elegant from './elegant.vue';
import MenuCustomer from './menuCustomer.vue' import MenuCustomer from './menuCustomer.vue';
import MenuDataCustomer from './menuDataCustomer.vue' import MenuDataCustomer from './menuDataCustomer.vue';
export default { export default {
data () { data() {
return { return {
funcVisible: false, funcVisible: false,
diaName: '功能配置', diaName: '功能配置',
noImg: '暂无图片', noImg: '暂无图片',
customerList: [], customerList: [],
input: '', input: '',
customerId: '',
customerName: '',
pageNo: 1,
pageSize: 10,
ruleForm: { name: '' },
total: 0,
srcList: [],
showType: 'list' //
}
},
components: {
ConfigItem,
homepage,
// MiniHome,
// RoleList,
FootbarList,
MostList,
categoryList,
StartPage,
RoleAuth,
elegant,
MenuCustomer,
MenuDataCustomer
},
activated () {
if (this.showType === 'list') { customerId: '',
this.$nextTick(() => { customerName: '',
this.$refs['ref_customertable'].doLayout() // pageNo: 1,
}) pageSize: 10,
ruleForm: { name: '' },
} total: 0,
srcList: [],
}, showType: 'list' //
mounted () { };
// const userType = localStorage.getItem('userType') },
// if (userType === 'work') { components: {
// this.showMiniHome(localStorage.getItem('customerId'), localStorage.getItem('customerName'), 0) ConfigItem,
// } else { homepage,
this.queryCustomerList() // MiniHome,
// } // RoleList,
}, FootbarList,
methods: { MostList,
queryCustomerList () { categoryList,
let params = { StartPage,
customerName: '', RoleAuth,
pageNo: this.pageNo, elegant,
pageSize: this.pageSize MenuCustomer,
} MenuDataCustomer
this.$http },
.post('/oper/crm/customer/pagequery', params) activated() {
.then(({ data: res }) => { if (this.showType === 'list') {
if (res.code === 0) { this.$nextTick(() => {
this.customerList = res.data.list this.$refs['ref_customertable'].doLayout(); //
this.total = res.data.total });
} }
}) },
}, mounted() {
submitForm (formName) { // const userType = localStorage.getItem('userType')
let params = { // if (userType === 'work') {
customerName: formName.name, // this.showMiniHome(localStorage.getItem('customerId'), localStorage.getItem('customerName'), 0)
pageNo: this.pageNo, // } else {
pageSize: this.pageSize this.queryCustomerList();
} // }
this.$http },
.post('/oper/crm/customer/pagequery', params) methods: {
.then(({ data: res }) => { queryCustomerList() {
if (res.code === 0) { let params = {
this.customerList = res.data.list customerName: '',
} pageNo: this.pageNo,
}) pageSize: this.pageSize
}, };
showMiniHome (customerId, customerName, type) { this.$http.post('/oper/crm/customer/pagequery', params).then(({ data: res }) => {
this.showType = 'miniHome' if (res.code === 0) {
this.$refs['ref_mini_home'].startSetWxIndex( this.customerList = res.data.list;
customerId, this.total = res.data.total;
customerName, }
type, });
'customize' },
) submitForm(formName) {
}, let params = {
customerName: formName.name,
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;
}
});
},
showMiniHome(customerId, customerName, type) {
this.showType = 'miniHome';
this.$refs['ref_mini_home'].startSetWxIndex(customerId, customerName, type, 'customize');
},
// //
showConfigItem (customerId, customerName) { showConfigItem(customerId, customerName) {
this.showType = 'config' this.showType = 'config';
this.$refs['ref_config_item'].initData(customerId, customerName) this.$refs['ref_config_item'].initData(customerId, customerName);
}, },
// footbar // footbar
showFootbar (customerId, customerName) { showFootbar(customerId, customerName) {
this.showType = 'footbar' this.showType = 'footbar';
this.$refs['ref_footbarlist'].initData(customerId, customerName) this.$refs['ref_footbarlist'].initData(customerId, customerName);
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['ref_footbarlist'].doLayout() // this.$refs['ref_footbarlist'].doLayout(); //
}) });
}, },
// most // most
showMost (customerId, customerName) { showMost(customerId, customerName) {
this.showType = 'mostedit' this.showType = 'mostedit';
console.log('ref_mostlist', this.$refs['ref_mostlist']) console.log('ref_mostlist', this.$refs['ref_mostlist']);
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['ref_mostlist'].initData(customerId, customerName) this.$refs['ref_mostlist'].initData(customerId, customerName);
}) });
}, },
// //
showCategory (customerId, customerName) { showCategory(customerId, customerName) {
this.showType = 'category' this.showType = 'category';
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['ref_category'].initData(customerId, customerName) this.$refs['ref_category'].initData(customerId, customerName);
}) });
}, },
// //
showElegant (customerId, customerName) { showElegant(customerId, customerName) {
this.showType = 'elegant' this.showType = 'elegant';
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['ref_elegant'].initData(customerId, customerName) this.$refs['ref_elegant'].initData(customerId, customerName);
}) });
}, },
// //
showMenu (customerId, customerName) { showMenu(customerId, customerName) {
this.showType = 'menuCustomer' this.showType = 'menuCustomer';
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['ref_menu_customer'].initData(customerId, customerName) this.$refs['ref_menu_customer'].initData(customerId, customerName);
}) });
}, },
// //
showDataMenu (customerId, customerName) { showDataMenu(customerId, customerName) {
this.showType = 'menuDataCustomer' this.showType = 'menuDataCustomer';
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['ref_menu_data_customer'].initData(customerId, customerName) this.$refs['ref_menu_data_customer'].initData(customerId, customerName);
}) });
}, },
// //
showRoleAuth (customerId, customerName) { showRoleAuth(customerId, customerName) {
this.showType = 'roleAuth' this.showType = 'roleAuth';
this.$refs['ref_roleAuth'].initData(customerId, customerName) this.$refs['ref_roleAuth'].initData(customerId, customerName);
}, },
// //
showStartPage (customerId, customerName) { showStartPage(customerId, customerName) {
this.showType = 'startPage' this.showType = 'startPage';
this.$refs['ref_startPage'].initData(customerId, customerName) this.$refs['ref_startPage'].initData(customerId, customerName);
}, },
pageCurrentChangeHandle (val) { pageCurrentChangeHandle(val) {
this.pageNo = val this.pageNo = val;
this.queryCustomerList() this.queryCustomerList();
}, },
pageSizeChangeHandle (val) { pageSizeChangeHandle(val) {
this.pageSize = val this.pageSize = val;
this.queryCustomerList() this.queryCustomerList();
}, },
addSrcList (url) { addSrcList(url) {
this.srcList = [] this.srcList = [];
this.srcList.push(url) this.srcList.push(url);
}, },
// //
cancleBack () { cancleBack() {
this.showType = 'list' this.showType = 'list';
} }
} }
} };
</script> </script>

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

@ -1,230 +1,169 @@
<template> <template>
<div> <div>
<div class="mod-sys__menu">
<div class="mod-sys__menu"> <div class="div_btn">
<div class="div_btn"> <span style="margin-right:10px">{{ customerName }}</span>
<span style="margin-right:10px">{{customerName}}</span> <el-button type="default" @click="diaCancel">取消返回</el-button>
<el-button type="default" <!-- <el-button class=""
@click="diaCancel">取消返回</el-button>
<!-- <el-button class=""
type="primary" type="primary"
@click="addShow()">{{"新增" }}</el-button> --> @click="addShow()">{{"新增" }}</el-button> -->
<!-- <el-input v-model="search" <!-- <el-input v-model="search"
placeholder="请输入内容"></el-input> --> placeholder="请输入内容"></el-input> -->
</div> </div>
<div class="div_btn"> <div class="div_btn">
<el-button class="" <el-button class="" type="primary" @click="useMenu()">开启</el-button>
type="primary" <el-button class="" type="primary" @click="closeMenu()">关闭</el-button>
@click="useMenu()">开启</el-button> </div>
<el-button class="" <el-table v-loading="dataListLoading" :data="dataList" row-key="id" border style="width: 100%;" @select-all="selectAll" @selection-change="handelSelection">
type="primary" <el-table-column type="selection" fixed="left" align="center" width="50" />
@click="closeMenu()">关闭</el-button> <el-table-column label="序号" fixed="left" type="index" align="center" width="50" />
</div> <el-table-column prop="name" label="菜单名称" header-align="center" min-width="150"></el-table-column>
<el-table v-loading="dataListLoading" <el-table-column prop="icon" label="图标" header-align="center" align="center">
:data="dataList" <template slot-scope="scope">
row-key="id" <svg class="icon-svg" aria-hidden="true"><use :xlink:href="`#${scope.row.icon}`"></use></svg>
border </template>
style="width: 100%;" </el-table-column>
@select-all="selectAll" <el-table-column prop="showFlag" label="菜单类型" header-align="center" align="center">
@selection-change="handelSelection"> <template slot-scope="scope">
<el-table-column 基础应用
type="selection" </template>
fixed="left" </el-table-column>
align="center" <el-table-column prop="sort" :label="$t('menu.sort')" header-align="center" align="center"></el-table-column>
width="50" <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-table-column prop="name" <el-tag v-else size="small" type="info">{{ $t('menu.status1') }}</el-tag>
:label="$t('menu.name')" </template>
header-align="center" </el-table-column>
min-width="150"></el-table-column> <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<el-table-column prop="icon" <template slot-scope="scope">
:label="$t('menu.icon')" <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
header-align="center" <el-button v-if="scope.row.useFlag === '0'" type="text" size="small" @click="useUpdate(scope.row.id, '1')">开启</el-button>
align="center"> <el-button v-if="scope.row.useFlag === '1'" type="text" size="small" @click="useUpdate(scope.row.id, '0')">关闭</el-button>
<template slot-scope="scope"> </template>
<svg class="icon-svg" </el-table-column>
aria-hidden="true"> </el-table>
<use :xlink:href="`#${scope.row.icon}`"></use> <!-- 弹窗, 新增 / 修改 -->
</svg> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</template> </div>
</el-table-column> </div>
<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 customerId: '', // id
customerName: '', // customerName: '', //
tableParams: { tableParams: {
customerId: '' customerId: ''
}, },
search: '', search: '',
dataList: [], dataList: [],
selection: [], multipleSelection: [],
selAllFlag: false, selAllFlag: false,
dataListLoading: false, dataListLoading: false,
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: '/gov/access/menu/customerMenuList' getDataListURL: '/gov/access/menu/customerMenuList'
} }
};
} },
},
computed: {},
computed: { components: {
}, AddOrUpdate
components: { },
AddOrUpdate created() {},
}, methods: {
created() { useMenu() {
let ids = this.selection.map(item => item.id);
}, this.$http
methods: { .post('/gov/access/govMenuCustomerRelation/useUpdate', {
ids: ids,
useMenu(){ use: '1'
let ids = this.selection.map((item) => item.id); })
this.$http .then(({ data: res }) => {
.post('/gov/access/govMenuCustomerRelation/useUpdate', { return this.$message.success('操作成功');
ids: ids, });
use: '1' this.query();
}) },
.then(({ data: res }) => { closeMenu() {
return this.$message.success("操作成功"); let ids = this.selection.map(item => item.id);
}) this.$http
this.query(); .post('/gov/access/govMenuCustomerRelation/useUpdate', {
}, ids: ids,
closeMenu(){ use: '0'
let ids = this.selection.map((item) => item.id); })
this.$http .then(({ data: res }) => {
.post('/gov/access/govMenuCustomerRelation/useUpdate', { return this.$message.success('操作成功');
ids: ids, });
use: '0' this.query();
}) },
.then(({ data: res }) => { useUpdate(id, use) {
return this.$message.success("操作成功"); this.$http
.post('/gov/access/govMenuCustomerRelation/useUpdate', {
}) ids: [id],
this.query(); use: use
}, })
useUpdate(id,use){ .then(({ data: res }) => {
this.$http return this.$message.success('操作成功');
.post('/gov/access/govMenuCustomerRelation/useUpdate', { });
ids: [id], this.query();
use: use },
}) query() {
.then(({ data: res }) => { this.dataListLoading = true;
return this.$message.success("操作成功"); this.$http
}) .post('/gov/access/menu/customerMenuList', {
this.query(); customerId: this.customerId,
}, tableName: 'gov_menu'
query() { })
.then(({ data: res }) => {
this.dataListLoading = true this.dataListLoading = false;
this.$http if (res.code !== 0) {
.post('/gov/access/menu/customerMenuList', { this.dataList = [];
customerId: this.customerId, this.total = 0;
tableName: 'gov_menu' return this.$message.error(res.msg);
}) }
.then(({ data: res }) => { this.dataList = res.data;
this.dataListLoading = false })
if (res.code !== 0) { .catch(() => {
this.dataList = [] this.dataListLoading = false;
this.total = 0 });
return this.$message.error(res.msg) },
}
this.dataList = res.data initData(customerId, customerName) {
}) this.customerId = customerId;
.catch(() => { this.customerName = customerName;
this.dataListLoading = false // if (this.mixinViewModuleOptions.createdIsNeed) {
}) // console.log(this.customerId+"22222");
}, this.query();
// }
initData (customerId, customerName) { },
this.customerId = customerId
this.customerName = customerName handelSelection(row) {
// if (this.mixinViewModuleOptions.createdIsNeed) { this.multipleSelection = [];
// console.log(this.customerId+"22222"); val.forEach(element => {
this.query() this.multipleSelection.push(element.id);
// } });
console.log(this.multipleSelection);
}, },
//
selectAll(selection) { diaCancel() {
this.selection = selection; this.$emit('cancleBack');
if (selection.length > 0) { }
this.selAllFlag = true; }
} else { };
this.selAllFlag = false;
}
},
handelSelection(row){
this.selection = row
},
//
diaCancel () {
this.$emit('cancleBack')
},
}
}
</script> </script>
<style> <style>
.div_btn { .div_btn {
margin: 0 0 20px 0; margin: 0 0 20px 0;
} }
</style> </style>

75
epmet-oper-web/src/views/modules/workPc/menu.vue

@ -1,10 +1,10 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__menu"> <div class="mod-sys__menu">
<!-- <el-form :inline="true"> <el-form :inline="true" @keyup.enter.native="search()">
<el-form-item><el-input v-model="ruleForm.name" placeholder="请输入客户名称" :clearable="true"></el-input></el-form-item> <el-form-item><el-input v-model="menuName" placeholder="请输入菜单名称" :clearable="true"></el-input></el-form-item>
<el-form-item><el-button type="primary" @click="submitForm(ruleForm)">查询</el-button></el-form-item> <el-form-item><el-button type="primary" @click="search()">查询</el-button></el-form-item>
</el-form> --> </el-form>
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-button type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> <el-button type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
@ -12,17 +12,24 @@
<el-button type="primary" @click="close('')">关闭</el-button> <el-button type="primary" @click="close('')">关闭</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table @selection-change="handleSelectionChange" v-loading="dataListLoading" :data="dataList" row-key="id" border :height="tableHeight" style="width: 100%;"> <el-table
@selection-change="handleSelectionChange"
v-loading="dataListLoading"
ref="form"
:data="dataList"
row-key="id"
border
:height="tableHeight"
style="width: 100%;"
>
<el-table-column label="" fixed="left" type="selection" align="center" width="50" /> <el-table-column label="" fixed="left" type="selection" align="center" width="50" />
<el-table-column label="序号" fixed="left" type="index" align="center" width="50" /> <el-table-column label="序号" fixed="left" type="index" 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="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"> <el-table-column prop="icon" :label="$t('menu.icon')" header-align="center" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<svg class="icon-svg" aria-hidden="true"><use :xlink:href="`#${scope.row.icon}`"></use></svg> <svg class="icon-svg" aria-hidden="true"><use :xlink:href="`#${scope.row.icon}`"></use></svg>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="showFlag" label="菜单类型" header-align="center" align="center"> <el-table-column prop="showFlag" label="菜单类型" header-align="center" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
基础应用 基础应用
@ -40,15 +47,15 @@
></el-table-column> ></el-table-column>
<el-table-column prop="type" :label="$t('状态')" header-align="center" align="center"> <el-table-column prop="type" :label="$t('状态')" header-align="center" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.showFlag === 1" size="small">已启用</el-tag> <el-tag v-if="scope.row.showFlag === 0" size="small" type="info">{{ $t('menu.status0') }}</el-tag>
<el-tag type="danger" v-if="scope.row.showFlag === 0" size="small">已关闭</el-tag> <el-tag v-else size="small">{{ $t('menu.status1') }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
<el-button type="text" size="small" @click="showCustomerMenu(scope.row)">{{ '客户配置' }}</el-button> <!-- <el-button type="text" size="small" @click="showCustomerMenu(scope.row)">{{ '客户配置' }}</el-button> -->
<el-button type="text" size="small" v-if="scope.row.showFlag == 0" @click="open(scope.row.id)">{{ '开启' }}</el-button> <el-button type="text" size="small" v-if="scope.row.showFlag == 0" @click="open(scope.row.id)">{{ '开启' }}</el-button>
<el-button type="text" size="small" v-if="scope.row.showFlag == 1" @click="close(scope.row.id)">{{ '关闭' }}</el-button> <el-button type="text" size="small" v-if="scope.row.showFlag == 1" @click="close(scope.row.id)">{{ '关闭' }}</el-button>
</template> </template>
@ -71,20 +78,22 @@ export default {
mixins: [mixinViewModule], mixins: [mixinViewModule],
data() { data() {
return { return {
menuName: '',
multipleSelection: [],
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: '/gov/access/menu/list', getDataListURL: '/gov/access/menu/list',
deleteURL: '/gov/access/menu' deleteURL: '/gov/access/menu'
}, },
customerFormVisible: false, customerFormVisible: false,
dataForm: { tableName: 'gov_menu' }, dataForm: { tableName: 'gov_menu' },
selMenuName: '', selMenuName: ''
multipleSelection: []
}; };
}, },
components: { components: {
AddOrUpdate, AddOrUpdate,
CustomerAddOrUpdate CustomerAddOrUpdate
}, },
computed: { computed: {
tableHeight() { tableHeight() {
// return this.resolution === 'small' ? this.clientHeight - 210 : this.clientHeight - 220 // return this.resolution === 'small' ? this.clientHeight - 210 : this.clientHeight - 220
@ -92,7 +101,47 @@ export default {
}, },
...mapGetters(['clientHeight', 'resolution']) ...mapGetters(['clientHeight', 'resolution'])
}, },
methods: { 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;
}
},
onFuzzyTreeList(key, value, treeList, saveList = []) {
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) { handleSelectionChange(val) {
this.multipleSelection = []; this.multipleSelection = [];
val.forEach(element => { val.forEach(element => {
@ -125,6 +174,7 @@ export default {
this.$http.post('/gov/access/menu/updateShow/', params).then(({ data: res }) => { this.$http.post('/gov/access/menu/updateShow/', params).then(({ data: res }) => {
console.log(res); console.log(res);
if (res.code === 0) { if (res.code === 0) {
this.getDataList();
} }
}); });
}, },
@ -147,6 +197,7 @@ export default {
this.$http.post('/gov/access/menu/updateShow/', params).then(({ data: res }) => { this.$http.post('/gov/access/menu/updateShow/', params).then(({ data: res }) => {
console.log(res); console.log(res);
if (res.code === 0) { if (res.code === 0) {
this.getDataList();
} }
}); });
} }

Loading…
Cancel
Save