Browse Source

客户配置

dev
jiangyy 4 years ago
parent
commit
35a7a8b16f
  1. 332
      epmet-oper-web/src/views/modules/customer/customize/CategoryList.vue
  2. 27
      epmet-oper-web/src/views/modules/customer/customize/CustomerList.vue
  3. 64
      epmet-oper-web/src/views/modules/workPc/customer-add-or-update.vue

332
epmet-oper-web/src/views/modules/customer/customize/CategoryList.vue

@ -0,0 +1,332 @@
<template>
<div>
<div class="div_btn">
<span style="margin-right:20px">{{customerName}}</span>
<el-button type="default"
size="mini"
@click="diaCancel">取消返回</el-button>
<el-button type="primary"
size="mini"
@click="addShow">自定义初始化</el-button>
</div>
<el-tabs v-model="activeName"
@tab-click="tabClick"
class="el-tabs">
<el-tab-pane label="居民端"
name="resi">
<c-table column-type="index"
ref="table_resi"
:url="tableUrl"
:params="tableParamsResi"
:operationWidth="80"
keyword="FootBarCustomize"
:operations="operations"
:orderOperations="orderOperations"
:tableHeight="tableHeight"
@editShow="editShow"
@changeState="changeState"
@moveUp="moveUp">
</c-table>
</el-tab-pane>
<el-tab-pane label="工作端"
name="gov">
<c-table column-type="index"
ref="table_work"
:url="tableUrl"
:params="tableParamsWork"
:operationWidth="80"
keyword="FootBar"
:operations="operations"
:orderOperations="orderOperations"
:tableHeight="tableHeight"
@editShow="editShow"
@changeState="changeState"
@moveUp="moveUp">
</c-table>
</el-tab-pane>
</el-tabs>
<edit ref="ref_edit"
@editDiaOK="editDiaOK">
</edit>
</div>
</template>
<script>
import CDialog from '@c/CDialog'
import CTable from '@c/CTableNoPage'
import Edit from './FootbarEdit'
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
let loading//
export default {
data () {
return {
activeName: 'resi',
customerId: '', // id
customerName: '', //
//
tableParamsWork: {
appType: 'gov',
},
tableParamsResi: {
appType: 'resi',
},
tableData: [],
//
tableUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/customerfootbars',
// tableUrl: '/oper/customize/customerfootbar/customerfootbars',
operations: [
{
lable: (display) => {
if (display === 0) {
return '隐藏'
} else {
return '显示'
}
}, //
size: 'mini',
style: 'margin: 0 6px;',
type: 'text',
slot: '',
plain: false,
methodName: 'changeState', //
isShow: (row) => {
return true
}
},
{
lable: '修改', //
size: 'mini',
style: 'margin: 0 6px;',
type: 'text',
slot: '',
plain: false,
methodName: 'editShow', //
isShow: (row) => {
return true
}
}
],
orderOperations: [
{
style: 'width=100px;height=100px',
type: 'text',
icon: "el-icon-top",
methodName: 'moveUp', //
isShow: (row) => {
return true
}
},
],
//
form: {
dataUrl: [], // //url
data: { //
fromApp: [
{
value: 'resi',
label: '居民端'
},
{
value: 'gov',
label: '工作端'
}
]
}
}
}
},
components: {
CDialog, CTable, Edit
},
mounted () {
},
computed: {
tableHeight () {
return this.clientHeight - 60 - 80 - 80
},
...mapGetters(['clientHeight', 'env'])
},
activated () {
debugger
this.$nextTick(() => {
if (this.activeName === 'gov') {
this.$refs['table_work'].doLayout() //
} else if (this.activeName === 'resi') {
this.$refs['table_resi'].doLayout() //
}
})
},
methods: {
initData (customerId, customerName) {
this.customerId = customerId
this.customerName = customerName
this.tableParamsWork.customerId = customerId
this.tableParamsResi.customerId = customerId
this.loadResiTableData()
},
//
refresh () {
if (this.activeName === 'gov') {
this.loadWorkTableData() //
} else if (this.activeName === 'resi') {
this.loadResiTableData() //
}
},
tabClick (tab) {
if (tab.name === 'gov') {
this.loadWorkTableData() //
}
if (tab.name === 'resi') {
this.loadResiTableData() //
}
},
//
loadWorkTableData () {
this.$nextTick(() => {
this.$refs['table_work'].loadData() //
})
},
//
loadResiTableData () {
this.$nextTick(() => {
this.$refs['table_resi'].loadData() //
})
},
//
addShow () {
this.$refs['ref_edit'].init('', 'A', this.activeName)
},
//
editShow (row) {
this.$refs['ref_edit'].init(row.id, 'U')
},
//
changeState (row, index) {
let display = row.display === 0 ? 1 : 0
const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/updatedisplaystatus'
// const url = '/oper/customize/customerfootbar/updatedisplaystatus'
const param = {
id: row.id,
display: display
}
window.app.ajax.post(url, param,
(data, rspMsg) => {
this.$message.success('操作成功' + rspMsg)
this.refresh()
},
(rspMsg, data) => {
this.$message.error(rspMsg)
})
},
//
moveUp (row, index) {
if (index > 0) {
this.tableData = this.$refs.table.getTableData() //
//console.log(this.tableData)
this.startLoading()
let resultList = []
let one = {}
for (let i = 0; i < this.tableData.length; i++) {
let obj = {}
// eslint-disable-next-line
// debugger
if (i === index - 1) {
one.id = this.tableData[i].id
one.orderIndex = index
} else if (i === index) {
obj.id = this.tableData[i].id
obj.orderIndex = index - 1
resultList.push(obj)
resultList.push(one)
} else {
obj.id = this.tableData[i].id
obj.orderIndex = i
resultList.push(obj)
}
}
//console.log(resultList)
// const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfunctiondetail/updatedisplayorder'
const url = '/oper/customize/customerfunctiondetail/updatedisplayorder'
window.app.ajax.post(url, resultList,
(data, rspMsg) => {
this.endLoading()
this.loadTableData()
},
(rspMsg, data) => {
this.endLoading()
this.$message.error(rspMsg)
})
} else {
this.$message.warning('无法上移')
return false
}
},
//
diaCancel () {
this.$emit('cancleBack')
},
editDiaOK () {
this.refresh()
},
editDiaCancel () {
},
async renderSelData () { // //
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
}
}
</script>
<style>
.div_btn {
z-index: 10;
position: absolute;
right: 40px;
top: 35px;
/* margin: 0 0 20px 0; */
}
</style>

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

@ -62,6 +62,9 @@
<el-button type="text" <el-button type="text"
size="small" size="small"
@click="showMost(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="showCategory(scope.row.customerId,scope.row.customerName)">分类配置</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -87,10 +90,14 @@
:tableKeywork="'FootBarCustomize'" :tableKeywork="'FootBarCustomize'"
@cancleBack="cancleBack"></footbar-list> @cancleBack="cancleBack"></footbar-list>
</div> </div>
<div v-if="showType==='mostedit'"> <div v-if="showType==='mostedit'">
<most-list ref="ref_mostlist" @cancleBack="cancleBack"></most-list> <most-list ref="ref_mostlist"
</div> @cancleBack="cancleBack"></most-list>
</div>
<div v-if="showType==='category'">
<category-list ref="ref_category"
@cancleBack="cancleBack"></category-list>
</div>
<el-dialog :visible.sync="funcVisible" <el-dialog :visible.sync="funcVisible"
title="功能列表" title="功能列表"
@ -112,6 +119,7 @@ import FootbarList from '../../productConfig/footbar/FootbarList'
import MiniHome from './MiniHome' import MiniHome from './MiniHome'
import MostList from './MostList' import MostList from './MostList'
import RoleList from './roleList' import RoleList from './roleList'
import categoryList from './CategoryList'
export default { export default {
data () { data () {
return { return {
@ -138,7 +146,8 @@ export default {
MiniHome, MiniHome,
RoleList, RoleList,
FootbarList, FootbarList,
MostList MostList,
categoryList
}, },
activated () { activated () {
if (this.showType === 'footbar') { if (this.showType === 'footbar') {
@ -218,6 +227,14 @@ export default {
this.$refs['ref_mostlist'].initData(customerId, customerName) this.$refs['ref_mostlist'].initData(customerId, customerName)
}) })
}, },
//
showCategory (customerId, customerName) {
this.showType = 'category'
console.log('ref_category', this.$refs['ref_category'])
this.$nextTick(() => {
this.$refs['ref_category'].initData(customerId, customerName)
})
},
// //
showLimitConfig (customerId, customerName) { showLimitConfig (customerId, customerName) {
this.customerId = customerId this.customerId = customerId

64
epmet-oper-web/src/views/modules/workPc/customer-add-or-update.vue

@ -5,14 +5,17 @@
:close-on-press-escape="false"> :close-on-press-escape="false">
<div class="customerDiv"> <div class="customerDiv">
<div class="customerItem"
v-for="(item,index) in customerList" <el-checkbox-group v-model="menuList">
:key="index">
<el-checkbox class="item_check" <el-checkbox v-for="(item,index) in customerList"
v-model="item.check"></el-checkbox> :key="index"
<span class="item_span">{{item.customerName}}</span> class="customerItem"
:label="item.customerId"
</div> @change="changeCheck($event,index)">{{item.customerName}}</el-checkbox>
</el-checkbox-group>
</div> </div>
<!-- <el-row> <!-- <el-row>
@ -59,6 +62,11 @@ export default {
computed: { computed: {
}, },
methods: { methods: {
changeCheck (value, index) {
console.log(value, index)
this.$set(this.customerList[index], "check", value)
// this.customerList[index].check = value
},
async init (tableId) { async init (tableId) {
this.visible = true this.visible = true
this.tableId = tableId this.tableId = tableId
@ -95,23 +103,20 @@ export default {
{}, {},
(data, rspMsg) => { (data, rspMsg) => {
this.customerList = data; this.customerList = data;
if (this.menuList.length > 0) { // if (this.menuList.length > 0) {
this.customerList.forEach(item => { // this.customerList.forEach(item => {
for (let i = 0; i < this.menuList.length; i++) { // for (let i = 0; i < this.menuList.length; i++) {
// console.log(this.menuList[i])
// if (item.customerId === this.menuList[i]) {
// item.check = true
// // break
// }
// }
// });
console.log(this.menuList[i]) // }
if (item.customerId === this.menuList[i]) {
item.check = true
// break
}
}
});
}
console.log(this.customerList) console.log(this.customerList)
}, },
(rspMsg, data) => { (rspMsg, data) => {
@ -126,15 +131,15 @@ export default {
const url = "/gov/access/govcustomermenu/addcustomermenu" const url = "/gov/access/govcustomermenu/addcustomermenu"
// this.upOrDownForm.roleList = roleList // this.upOrDownForm.roleList = roleList
this.customerList.forEach(element => { // this.customerList.forEach(element => {
if (element.check) { // if (element.check) {
this.checkCustomerList.push(element.customerId) // this.checkCustomerList.push(element.customerId)
} // }
}); // });
const parmas = { const parmas = {
tableId: this.tableId, tableId: this.tableId,
customerIds: this.checkCustomerList customerIds: this.menuList
} }
const { data, code, msg, internalMsg } = await requestPost(url, parmas) const { data, code, msg, internalMsg } = await requestPost(url, parmas)
@ -173,12 +178,11 @@ export default {
margin-left: 100px; margin-left: 100px;
} }
.customerItem { .customerItem {
display: block;
margin: 20px; margin: 20px;
font-size: 15px; font-size: 15px;
} }
.item_check {
}
.item_span { .item_span {
margin-left: 20px; margin-left: 20px;
} }

Loading…
Cancel
Save