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>
<div>
<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-form-item>
<el-form-item>
<el-button type="primary"
@click="submitForm(ruleForm)">查询</el-button>
</el-form-item>
<el-form-item><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"
ref="ref_customertable"
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" ref="ref_customertable" border style="width: 100%;">
<el-table-column label="序号" header-align="center" align="center" type="index"></el-table-column>
<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 v-if="scope.row.logo"
<el-image
v-if="scope.row.logo"
style="width: 50px; height: 50px"
:src="scope.row.logo"
@click="addSrcList(scope.row.logo)"
:preview-src-list="srcList"></el-image>
:preview-src-list="srcList"
></el-image>
<span v-else>--</span>
</template>
</el-table-column>
<el-table-column :label="$t('handle')"
fixed="right"
header-align="center"
align="center"
width="700">
<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-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-button type="text"
size="small"
@click="showMost(scope.row.customerId,scope.row.customerName)">高级配置</el-button>
<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>
<el-button type="text" size="small" @click="showMost(scope.row.customerId, scope.row.customerName)">高级配置</el-button>
<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"
<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>
@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>
<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'">
<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>
<div v-if="showType === 'elegant'"><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="功能列表"
@ -140,29 +73,25 @@
:customer-name="customerName" />
</el-dialog> -->
<div v-show="showType === 'startPage'">
<start-page ref="ref_startPage"
:customer-id="customerId"
:showFrom="'customize'"
:tableKeywork="'FootBarCustomize'"
@cancleBack="cancleBack"></start-page>
<start-page ref="ref_startPage" :customer-id="customerId" :showFrom="'customize'" :tableKeywork="'FootBarCustomize'" @cancleBack="cancleBack"></start-page>
</div>
</el-card>
</div>
</template>
<script>
import ConfigItem from './ConfigItem'
import FootbarList from '../../productConfig/footbar/FootbarList'
import ConfigItem from './ConfigItem';
import FootbarList from '../../productConfig/footbar/FootbarList';
// import MiniHome from './MiniHome'
import homepage from '../../productConfig/homeCustom/homepage'
import MostList from './MostList'
import homepage from '../../productConfig/homeCustom/homepage';
import MostList from './MostList';
// import RoleList from './roleList'
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'
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 {
@ -182,7 +111,7 @@ export default {
srcList: [],
showType: 'list' //
}
};
},
components: {
ConfigItem,
@ -199,21 +128,18 @@ export default {
MenuDataCustomer
},
activated() {
if (this.showType === 'list') {
this.$nextTick(() => {
this.$refs['ref_customertable'].doLayout() //
})
this.$refs['ref_customertable'].doLayout(); //
});
}
},
mounted() {
// const userType = localStorage.getItem('userType')
// if (userType === 'work') {
// this.showMiniHome(localStorage.getItem('customerId'), localStorage.getItem('customerName'), 0)
// } else {
this.queryCustomerList()
this.queryCustomerList();
// }
},
methods: {
@ -222,124 +148,115 @@ export default {
customerName: '',
pageNo: this.pageNo,
pageSize: this.pageSize
}
this.$http
.post('/oper/crm/customer/pagequery', params)
.then(({ data: res }) => {
};
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.customerList = res.data.list;
this.total = res.data.total;
}
})
});
},
submitForm(formName) {
let params = {
customerName: formName.name,
pageNo: this.pageNo,
pageSize: this.pageSize
}
this.$http
.post('/oper/crm/customer/pagequery', params)
.then(({ data: res }) => {
};
this.$http.post('/oper/crm/customer/pagequery', params).then(({ data: res }) => {
if (res.code === 0) {
this.customerList = res.data.list
this.customerList = res.data.list;
}
})
});
},
showMiniHome(customerId, customerName, type) {
this.showType = 'miniHome'
this.$refs['ref_mini_home'].startSetWxIndex(
customerId,
customerName,
type,
'customize'
)
this.showType = 'miniHome';
this.$refs['ref_mini_home'].startSetWxIndex(customerId, customerName, type, 'customize');
},
//
showConfigItem(customerId, customerName) {
this.showType = 'config'
this.$refs['ref_config_item'].initData(customerId, customerName)
this.showType = 'config';
this.$refs['ref_config_item'].initData(customerId, customerName);
},
// footbar
showFootbar(customerId, customerName) {
this.showType = 'footbar'
this.$refs['ref_footbarlist'].initData(customerId, customerName)
this.showType = 'footbar';
this.$refs['ref_footbarlist'].initData(customerId, customerName);
this.$nextTick(() => {
this.$refs['ref_footbarlist'].doLayout() //
})
this.$refs['ref_footbarlist'].doLayout(); //
});
},
// most
showMost(customerId, customerName) {
this.showType = 'mostedit'
console.log('ref_mostlist', this.$refs['ref_mostlist'])
this.showType = 'mostedit';
console.log('ref_mostlist', this.$refs['ref_mostlist']);
this.$nextTick(() => {
this.$refs['ref_mostlist'].initData(customerId, customerName)
})
this.$refs['ref_mostlist'].initData(customerId, customerName);
});
},
//
showCategory(customerId, customerName) {
this.showType = 'category'
this.showType = 'category';
this.$nextTick(() => {
this.$refs['ref_category'].initData(customerId, customerName)
})
this.$refs['ref_category'].initData(customerId, customerName);
});
},
//
showElegant(customerId, customerName) {
this.showType = 'elegant'
this.showType = 'elegant';
this.$nextTick(() => {
this.$refs['ref_elegant'].initData(customerId, customerName)
})
this.$refs['ref_elegant'].initData(customerId, customerName);
});
},
//
showMenu(customerId, customerName) {
this.showType = 'menuCustomer'
this.showType = 'menuCustomer';
this.$nextTick(() => {
this.$refs['ref_menu_customer'].initData(customerId, customerName)
})
this.$refs['ref_menu_customer'].initData(customerId, customerName);
});
},
//
showDataMenu(customerId, customerName) {
this.showType = 'menuDataCustomer'
this.showType = 'menuDataCustomer';
this.$nextTick(() => {
this.$refs['ref_menu_data_customer'].initData(customerId, customerName)
})
this.$refs['ref_menu_data_customer'].initData(customerId, customerName);
});
},
//
showRoleAuth(customerId, customerName) {
this.showType = 'roleAuth'
this.$refs['ref_roleAuth'].initData(customerId, customerName)
this.showType = 'roleAuth';
this.$refs['ref_roleAuth'].initData(customerId, customerName);
},
//
showStartPage(customerId, customerName) {
this.showType = 'startPage'
this.$refs['ref_startPage'].initData(customerId, customerName)
this.showType = 'startPage';
this.$refs['ref_startPage'].initData(customerId, customerName);
},
pageCurrentChangeHandle(val) {
this.pageNo = val
this.queryCustomerList()
this.pageNo = val;
this.queryCustomerList();
},
pageSizeChangeHandle(val) {
this.pageSize = val
this.queryCustomerList()
this.pageSize = val;
this.queryCustomerList();
},
addSrcList(url) {
this.srcList = []
this.srcList.push(url)
this.srcList = [];
this.srcList.push(url);
},
//
cancleBack() {
this.showType = 'list'
}
this.showType = 'list';
}
}
};
</script>

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

@ -1,11 +1,9 @@
<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 type="default" @click="diaCancel">取消返回</el-button>
<!-- <el-button class=""
type="primary"
@click="addShow()">{{"新增" }}</el-button> -->
@ -13,95 +11,48 @@
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>
<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">
<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 label="序号" fixed="left" type="index" align="center" width="50" />
<el-table-column prop="name" label="菜单名称" header-align="center" min-width="150"></el-table-column>
<el-table-column prop="icon" label="图标" header-align="center" align="center">
<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>
</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">
<el-table-column prop="showFlag" label="菜单类型" 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">
<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-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>
<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>
<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'
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() {
@ -114,7 +65,7 @@ export default {
},
search: '',
dataList: [],
selection: [],
multipleSelection: [],
selAllFlag: false,
dataListLoading: false,
@ -122,43 +73,37 @@ export default {
mixinViewModuleOptions: {
getDataListURL: '/gov/access/menu/customerMenuList'
}
}
};
},
computed: {
},
computed: {},
components: {
AddOrUpdate
},
created() {
},
created() {},
methods: {
useMenu() {
let ids = this.selection.map((item) => item.id);
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("操作成功");
})
return this.$message.success('操作成功');
});
this.query();
},
closeMenu() {
let ids = this.selection.map((item) => item.id);
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("操作成功");
})
return this.$message.success('操作成功');
});
this.query();
},
useUpdate(id, use) {
@ -168,59 +113,53 @@ export default {
use: use
})
.then(({ data: res }) => {
return this.$message.success("操作成功");
})
return this.$message.success('操作成功');
});
this.query();
},
query() {
this.dataListLoading = true
this.dataListLoading = true;
this.$http
.post('/gov/access/menu/customerMenuList', {
customerId: this.customerId,
tableName: 'gov_menu'
})
.then(({ data: res }) => {
this.dataListLoading = false
this.dataListLoading = false;
if (res.code !== 0) {
this.dataList = []
this.total = 0
return this.$message.error(res.msg)
this.dataList = [];
this.total = 0;
return this.$message.error(res.msg);
}
this.dataList = res.data
this.dataList = res.data;
})
.catch(() => {
this.dataListLoading = false
})
this.dataListLoading = false;
});
},
initData(customerId, customerName) {
this.customerId = customerId
this.customerName = customerName
this.customerId = customerId;
this.customerName = customerName;
// if (this.mixinViewModuleOptions.createdIsNeed) {
// 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) {
this.selection = row
this.multipleSelection = [];
val.forEach(element => {
this.multipleSelection.push(element.id);
});
console.log(this.multipleSelection);
},
//
diaCancel() {
this.$emit('cancleBack')
},
this.$emit('cancleBack');
}
}
};
</script>
<style>

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

@ -1,10 +1,10 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__menu">
<!-- <el-form :inline="true">
<el-form-item><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-form :inline="true" @keyup.enter.native="search()">
<el-form-item><el-input v-model="menuName" placeholder="请输入菜单名称" :clearable="true"></el-input></el-form-item>
<el-form-item><el-button type="primary" @click="search()">查询</el-button></el-form-item>
</el-form>
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-button type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
@ -12,17 +12,24 @@
<el-button type="primary" @click="close('')">关闭</el-button>
</el-form-item>
</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="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="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="showFlag" label="菜单类型" header-align="center" align="center">
<template slot-scope="scope">
基础应用
@ -40,15 +47,15 @@
></el-table-column>
<el-table-column prop="type" :label="$t('状态')" header-align="center" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.showFlag === 1" size="small">已启用</el-tag>
<el-tag type="danger" v-if="scope.row.showFlag === 0" size="small">已关闭</el-tag>
<el-tag v-if="scope.row.showFlag === 0" size="small" type="info">{{ $t('menu.status0') }}</el-tag>
<el-tag v-else size="small">{{ $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 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 == 1" @click="close(scope.row.id)">{{ '关闭' }}</el-button>
</template>
@ -71,20 +78,22 @@ export default {
mixins: [mixinViewModule],
data() {
return {
menuName: '',
multipleSelection: [],
mixinViewModuleOptions: {
getDataListURL: '/gov/access/menu/list',
deleteURL: '/gov/access/menu'
},
customerFormVisible: false,
dataForm: { tableName: 'gov_menu' },
selMenuName: '',
multipleSelection: []
selMenuName: ''
};
},
components: {
AddOrUpdate,
CustomerAddOrUpdate
},
computed: {
tableHeight() {
// return this.resolution === 'small' ? this.clientHeight - 210 : this.clientHeight - 220
@ -92,7 +101,47 @@ export default {
},
...mapGetters(['clientHeight', 'resolution'])
},
methods: {
search() {
if (this.menuName != '') {
let saveList = [];
this.onFuzzyTreeList('name', this.menuName, this.dataList, saveList);
this.$refs.form.data = saveList;
} else {
this.$refs.form.data = this.dataList;
}
},
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) {
this.multipleSelection = [];
val.forEach(element => {
@ -125,6 +174,7 @@ export default {
this.$http.post('/gov/access/menu/updateShow/', params).then(({ data: res }) => {
console.log(res);
if (res.code === 0) {
this.getDataList();
}
});
},
@ -147,6 +197,7 @@ export default {
this.$http.post('/gov/access/menu/updateShow/', params).then(({ data: res }) => {
console.log(res);
if (res.code === 0) {
this.getDataList();
}
});
}

Loading…
Cancel
Save