Browse Source

数据看板

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

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

@ -1,133 +1,66 @@
<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'"
class="mod-/oper/customize__homecomponent}">
<el-form :inline="true"> <el-form :inline="true">
<el-form-item> <el-form-item><el-input v-model="ruleForm.name" placeholder="请输入客户名称" :clearable="true"></el-input></el-form-item>
<el-input v-model="ruleForm.name" <el-form-item><el-button type="primary" @click="submitForm(ruleForm)">查询</el-button></el-form-item>
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-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="客户名称"
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"> <template slot-scope="scope">
<el-image
<el-image v-if="scope.row.logo" v-if="scope.row.logo"
style="width: 50px; height: 50px" style="width: 50px; height: 50px"
:src="scope.row.logo" :src="scope.row.logo"
@click="addSrcList(scope.row.logo)" @click="addSrcList(scope.row.logo)"
:preview-src-list="srcList"></el-image> :preview-src-list="srcList"
></el-image>
<span v-else>--</span> <span v-else>--</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('handle')" <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="700">
fixed="right"
header-align="center"
align="center"
width="700">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" <el-button type="text" size="small" @click="showMiniHome(scope.row.customerId, scope.row.customerName, 0)">居民端首页</el-button>
size="small" <el-button type="text" size="small" @click="showMiniHome(scope.row.customerId, scope.row.customerName, 1)">工作端首页</el-button>
@click="showMiniHome(scope.row.customerId,scope.row.customerName,0)">居民端首页</el-button> <el-button type="text" size="small" @click="showConfigItem(scope.row.customerId, scope.row.customerName)">功能配置</el-button>
<el-button type="text" <el-button type="text" size="small" @click="showFootbar(scope.row.customerId, scope.row.customerName)">FootBar配置</el-button>
size="small" <el-button type="text" size="small" @click="showRoleAuth(scope.row.customerId, scope.row.customerName)">角色权限</el-button>
@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-button type="text" <el-button type="text" size="small" @click="showMost(scope.row.customerId, scope.row.customerName)">高级配置</el-button>
size="small" <el-button type="text" size="small" @click="showCategory(scope.row.customerId, scope.row.customerName)">分类配置</el-button>
@click="showMost(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" <el-button type="text" size="small" @click="showElegant(scope.row.customerId, scope.row.customerName)">党员风采分类配置</el-button>
size="small" <el-button type="text" size="small" @click="showMenu(scope.row.customerId, scope.row.customerName)">管理平台菜单配置</el-button>
@click="showCategory(scope.row.customerId,scope.row.customerName)">分类配置</el-button> <el-button type="text" size="small" @click="showDataMenu(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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination :current-page="pageNo" <el-pagination
:current-page="pageNo"
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:page-size="pageSize" :page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="total" :total="total"
@size-change="pageSizeChangeHandle" @size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle"></el-pagination> @current-change="pageCurrentChangeHandle"
</div> ></el-pagination>
<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>
<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'"> <div v-show="showType === 'footbar'">
<footbar-list ref="ref_footbarlist" <footbar-list ref="ref_footbarlist" :showFrom="'customize'" :tableKeywork="'FootBarCustomize'" @cancleBack="cancleBack"></footbar-list>
: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>
<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'"> <div v-if="showType === 'elegant'"><elegant ref="ref_elegant" @cancleBack="cancleBack"></elegant></div>
<elegant ref="ref_elegant" <div v-if="showType === 'menuCustomer'"><menu-customer ref="ref_menu_customer" @cancleBack="cancleBack"></menu-customer></div>
@cancleBack="cancleBack"></elegant> <div v-if="showType === 'menuDataCustomer'"><menu-data-customer ref="ref_menu_data_customer" @cancleBack="cancleBack"></menu-data-customer></div>
</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" <!-- <el-dialog :visible.sync="funcVisible"
title="功能列表" title="功能列表"
@ -140,29 +73,25 @@
: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"
:showFrom="'customize'"
:tableKeywork="'FootBarCustomize'"
@cancleBack="cancleBack"></start-page>
</div> </div>
</el-card> </el-card>
</div> </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 {
@ -182,7 +111,7 @@ export default {
srcList: [], srcList: [],
showType: 'list' // showType: 'list' //
} };
}, },
components: { components: {
ConfigItem, ConfigItem,
@ -199,21 +128,18 @@ export default {
MenuDataCustomer MenuDataCustomer
}, },
activated() { activated() {
if (this.showType === 'list') { if (this.showType === 'list') {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['ref_customertable'].doLayout() // this.$refs['ref_customertable'].doLayout(); //
}) });
} }
}, },
mounted() { mounted() {
// const userType = localStorage.getItem('userType') // const userType = localStorage.getItem('userType')
// if (userType === 'work') { // if (userType === 'work') {
// this.showMiniHome(localStorage.getItem('customerId'), localStorage.getItem('customerName'), 0) // this.showMiniHome(localStorage.getItem('customerId'), localStorage.getItem('customerName'), 0)
// } else { // } else {
this.queryCustomerList() this.queryCustomerList();
// } // }
}, },
methods: { methods: {
@ -222,124 +148,115 @@ export default {
customerName: '', customerName: '',
pageNo: this.pageNo, pageNo: this.pageNo,
pageSize: this.pageSize pageSize: this.pageSize
} };
this.$http this.$http.post('/oper/crm/customer/pagequery', params).then(({ data: res }) => {
.post('/oper/crm/customer/pagequery', params)
.then(({ data: res }) => {
if (res.code === 0) { if (res.code === 0) {
this.customerList = res.data.list this.customerList = res.data.list;
this.total = res.data.total this.total = res.data.total;
} }
}) });
}, },
submitForm(formName) { submitForm(formName) {
let params = { let params = {
customerName: formName.name, customerName: formName.name,
pageNo: this.pageNo, pageNo: this.pageNo,
pageSize: this.pageSize pageSize: this.pageSize
} };
this.$http this.$http.post('/oper/crm/customer/pagequery', params).then(({ data: res }) => {
.post('/oper/crm/customer/pagequery', params)
.then(({ data: res }) => {
if (res.code === 0) { if (res.code === 0) {
this.customerList = res.data.list this.customerList = res.data.list;
} }
}) });
}, },
showMiniHome(customerId, customerName, type) { showMiniHome(customerId, customerName, type) {
this.showType = 'miniHome' this.showType = 'miniHome';
this.$refs['ref_mini_home'].startSetWxIndex( this.$refs['ref_mini_home'].startSetWxIndex(customerId, customerName, type, 'customize');
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>

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

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