|
|
@ -1,55 +1,64 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<el-card shadow="never" |
|
|
|
class="aui-card--fill"> |
|
|
|
<div class="div_btn"> |
|
|
|
|
|
|
|
<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="FootBar" |
|
|
|
:operations="operations" |
|
|
|
:orderOperations="orderOperations" |
|
|
|
:tableHeight="tableHeight" |
|
|
|
@editShow="editShow" |
|
|
|
@changeState="changeState" |
|
|
|
@moveUp="moveUp" |
|
|
|
@del="del"> |
|
|
|
</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" |
|
|
|
@del="del"> |
|
|
|
</c-table> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
|
|
|
|
</el-card> |
|
|
|
|
|
|
|
<div v-if="showFrom==='customize'" |
|
|
|
class="div_btn_customize"> |
|
|
|
<span style="margin-right:20px">{{customerName}}</span> |
|
|
|
<el-button type="default" |
|
|
|
size="mini" |
|
|
|
@click="diaCancel">取消返回</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
size="mini" |
|
|
|
@click="initDefault">自定义初始化</el-button> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div v-if="showFrom==='default'" |
|
|
|
class="div_btn_default"> |
|
|
|
|
|
|
|
<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="tableKeywork" |
|
|
|
:operations="operations" |
|
|
|
:orderOperations="orderOperations" |
|
|
|
:tableHeight="tableHeight" |
|
|
|
@editShow="editShow" |
|
|
|
@changeState="changeState" |
|
|
|
@moveUp="moveUp" |
|
|
|
@del="del"> |
|
|
|
</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="tableKeywork" |
|
|
|
:operations="operations" |
|
|
|
:orderOperations="orderOperations" |
|
|
|
:tableHeight="tableHeight" |
|
|
|
@editShow="editShow" |
|
|
|
@changeState="changeState" |
|
|
|
@moveUp="moveUp" |
|
|
|
@del="del"> |
|
|
|
</c-table> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
|
|
|
|
<edit ref="ref_edit" |
|
|
|
@editDiaOK="editDiaOK"> |
|
|
@ -73,28 +82,33 @@ export default { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
activeName: 'resi', |
|
|
|
customerId: '', // 客户id,父组件传 |
|
|
|
customerName: '', // 客户名称,父组件传 |
|
|
|
// 查询相关 |
|
|
|
tableParamsWork: { |
|
|
|
appType: 'gov' |
|
|
|
appType: 'gov', |
|
|
|
customerId: 'default' |
|
|
|
}, |
|
|
|
tableParamsResi: { |
|
|
|
appType: 'resi' |
|
|
|
appType: 'resi', |
|
|
|
customerId: 'default' |
|
|
|
}, |
|
|
|
tableData: [], |
|
|
|
// 列表相关 |
|
|
|
tableUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/customerfootbars', |
|
|
|
// tableUrl: '/oper/customize/customerfootbar/customerfootbars', |
|
|
|
// tableUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/customerfootbars', |
|
|
|
tableUrl: '/oper/customize/customerfootbar/customerfootbars4oper', |
|
|
|
|
|
|
|
operations: [ |
|
|
|
{ |
|
|
|
lable: (display) => { |
|
|
|
if (display === 0) { |
|
|
|
|
|
|
|
if (display === true) { |
|
|
|
return '隐藏' |
|
|
|
} else { |
|
|
|
return '显示' |
|
|
|
} |
|
|
|
}, // 按钮显示名称 |
|
|
|
|
|
|
|
key: 'display', |
|
|
|
size: 'mini', |
|
|
|
style: 'margin: 0 6px;', |
|
|
|
type: 'text', |
|
|
@ -126,7 +140,7 @@ export default { |
|
|
|
plain: false, |
|
|
|
methodName: 'del', // 回调方法名称 |
|
|
|
isShow: (row) => { |
|
|
|
if (env === 'prod') { |
|
|
|
if (this.env === 'prod' || this.showFrom === 'customize') { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
@ -174,8 +188,15 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
mounted () { |
|
|
|
this.renderSelData() |
|
|
|
this.loadResiTableData() |
|
|
|
this.activeName = 'resi' |
|
|
|
if (this.showFrom === 'default') {//默认配置 |
|
|
|
this.tableParamsWork.customerId = 'default' |
|
|
|
this.tableParamsResi.customerId = 'default' |
|
|
|
this.loadResiTableData() |
|
|
|
} else if (this.showFrom === 'customize') {//自定义配置 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
computed: { |
|
|
|
tableHeight () { |
|
|
@ -184,9 +205,27 @@ export default { |
|
|
|
...mapGetters(['clientHeight', 'env']) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
|
|
|
|
doLayout () { |
|
|
|
this.$nextTick(() => { |
|
|
|
if (this.activeName === 'gov') { |
|
|
|
this.$refs['table_work'].doLayout() // 解决表格错位 |
|
|
|
} else if (this.activeName === 'resi') { |
|
|
|
this.$refs['table_resi'].doLayout() // 解决表格错位 |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
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') { |
|
|
@ -215,17 +254,17 @@ export default { |
|
|
|
}, |
|
|
|
// 新增 |
|
|
|
addShow () { |
|
|
|
this.$refs['ref_edit'].init('', 'A', this.activeName) |
|
|
|
this.$refs['ref_edit'].init('', 'A', this.activeName, this.showFrom) |
|
|
|
}, |
|
|
|
// 编辑 |
|
|
|
editShow (row) { |
|
|
|
this.$refs['ref_edit'].init(row.id, 'U') |
|
|
|
this.$refs['ref_edit'].init(row.id, 'U', this.activeName, this.showFrom) |
|
|
|
}, |
|
|
|
// 改变状态 |
|
|
|
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' |
|
|
|
let display = row.display ? 0 : 1 |
|
|
|
// 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 |
|
|
@ -243,7 +282,11 @@ export default { |
|
|
|
moveUp (row, index) { |
|
|
|
|
|
|
|
if (index > 0) { |
|
|
|
this.tableData = this.$refs.table.getTableData() // 获取表格数据 |
|
|
|
if (this.activeName == 'resi') { |
|
|
|
this.tableData = this.$refs['table_resi'].getTableData() // 获取表格数据 |
|
|
|
} else { |
|
|
|
this.tableData = this.$refs['table_work'].getTableData() // 获取表格数据 |
|
|
|
} |
|
|
|
console.log(this.tableData) |
|
|
|
this.startLoading() |
|
|
|
let resultList = [] |
|
|
@ -251,7 +294,7 @@ export default { |
|
|
|
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 |
|
|
@ -267,13 +310,21 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(resultList) |
|
|
|
let params = { |
|
|
|
orderList: 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, |
|
|
|
// const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/saveorder' |
|
|
|
const url = '/oper/customize/customerfootbar/saveorder' |
|
|
|
window.app.ajax.post(url, params, |
|
|
|
(data, rspMsg) => { |
|
|
|
this.endLoading() |
|
|
|
this.loadTableData() |
|
|
|
if (this.activeName == 'resi') { |
|
|
|
this.loadResiTableData() |
|
|
|
} else { |
|
|
|
this.loadWorkTableData() |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
(rspMsg, data) => { |
|
|
|
this.endLoading() |
|
|
@ -287,6 +338,31 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 初始化 |
|
|
|
initDefault (row) { |
|
|
|
this.$confirm('确认初始化客户Footbar', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
// const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/initdefault4customer' |
|
|
|
const url = '/oper/customize/customerfootbar/initdefault4customer' |
|
|
|
const param = { |
|
|
|
customerId: this.customerId, |
|
|
|
appType: this.activeName |
|
|
|
} |
|
|
|
window.app.ajax.post(url, param, |
|
|
|
(data, rspMsg) => { |
|
|
|
this.$message.success('初始化成功' + rspMsg) |
|
|
|
this.refresh() |
|
|
|
}, |
|
|
|
(rspMsg, data) => { |
|
|
|
this.$message.error(rspMsg) |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
// 删除 |
|
|
|
del (row) { |
|
|
|
this.$confirm('确认删除当前导航', '提示', { |
|
|
@ -294,8 +370,8 @@ export default { |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/deletefootbar' |
|
|
|
// const url = '/oper/customize/customerfootbar/deletefootbar' |
|
|
|
// const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/deletefootbar' |
|
|
|
const url = '/oper/customize/customerfootbar/deletefootbar' |
|
|
|
const param = { |
|
|
|
id: row.id |
|
|
|
} |
|
|
@ -311,7 +387,10 @@ export default { |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 取消 |
|
|
|
diaCancel () { |
|
|
|
this.$emit('cancleBack') |
|
|
|
}, |
|
|
|
editDiaOK () { |
|
|
|
this.refresh() |
|
|
|
}, |
|
|
@ -338,11 +417,29 @@ export default { |
|
|
|
loading.close() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
props: { |
|
|
|
showFrom: { |
|
|
|
type: String, |
|
|
|
default: 'default' |
|
|
|
}, |
|
|
|
//table的关键字 |
|
|
|
tableKeywork: { |
|
|
|
type: String, |
|
|
|
default: 'FootBar' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style> |
|
|
|
.div_btn { |
|
|
|
.div_btn_default { |
|
|
|
z-index: 10; |
|
|
|
position: absolute; |
|
|
|
right: 40px; |
|
|
|
top: 35px; |
|
|
|
/* margin: 0 0 20px 0; */ |
|
|
|
} |
|
|
|
.div_btn_customize { |
|
|
|
z-index: 10; |
|
|
|
position: absolute; |
|
|
|
right: 40px; |
|
|
|