37 changed files with 2155 additions and 217 deletions
@ -0,0 +1,132 @@ |
|||
export default { |
|||
default: [ |
|||
{ |
|||
key: 'barKey', |
|||
title: 'Key', |
|||
display: ['formA', 'formU', 'table', 'model'], |
|||
fixed: false, |
|||
block: true, |
|||
width: 80 |
|||
}, |
|||
{ |
|||
key: 'barName', |
|||
title: '导航栏名称', |
|||
display: ['formA', 'formU', 'table', 'model'], |
|||
fixed: false, |
|||
block: true, |
|||
width: 80 |
|||
}, |
|||
{ |
|||
key: 'pageTitle', |
|||
title: '页面标题', |
|||
display: ['formA', 'formU', 'table', 'model'], |
|||
fixed: false, |
|||
block: true, |
|||
width: 120 |
|||
}, |
|||
{ |
|||
key: 'iconPath', |
|||
title: '图标', |
|||
display: ['formA', 'formU', 'table', 'model'], |
|||
fixed: false, |
|||
block: 100, |
|||
width: 120, |
|||
tableType: 'image', |
|||
imgWidth: '50px', |
|||
imgHeight: '50px' |
|||
}, |
|||
{ |
|||
key: 'selectedIconPath', |
|||
title: '选中图标', |
|||
display: ['formA', 'formU', 'table', 'model'], |
|||
fixed: false, |
|||
block: true, |
|||
width: 100, |
|||
tableType: 'image', |
|||
imgWidth: '50px', |
|||
imgHeight: '50px' |
|||
}, |
|||
{ |
|||
key: 'display', |
|||
title: '状态', |
|||
display: ['formA', 'formU', 'table', 'model'], |
|||
fixed: false, |
|||
block: true, |
|||
width: 80, |
|||
format: (cellValue, index) => { |
|||
if (cellValue === false) { |
|||
return '隐藏' |
|||
} else if (cellValue === true) { |
|||
return '显示' |
|||
} else { |
|||
return '未知' |
|||
} |
|||
} |
|||
} |
|||
], |
|||
customize: [ |
|||
{ |
|||
key: 'defaultBarName', |
|||
title: '默认导航栏名称', |
|||
display: ['formA', 'formU', 'table', 'model'], |
|||
fixed: false, |
|||
block: true, |
|||
width: 100 |
|||
}, |
|||
{ |
|||
key: 'barName', |
|||
title: '导航栏名称', |
|||
display: ['formA', 'formU', 'table', 'model'], |
|||
fixed: false, |
|||
block: true, |
|||
width: 80 |
|||
}, |
|||
{ |
|||
key: 'pageTitle', |
|||
title: '页面标题', |
|||
display: ['formA', 'formU', 'table', 'model'], |
|||
fixed: false, |
|||
block: true, |
|||
width: 120 |
|||
}, |
|||
{ |
|||
key: 'iconPath', |
|||
title: '图标', |
|||
display: ['formA', 'formU', 'table', 'model'], |
|||
fixed: false, |
|||
block: 100, |
|||
width: 120, |
|||
tableType: 'image', |
|||
imgWidth: '50px', |
|||
imgHeight: '50px' |
|||
}, |
|||
{ |
|||
key: 'selectedIconPath', |
|||
title: '选中图标', |
|||
display: ['formA', 'formU', 'table', 'model'], |
|||
fixed: false, |
|||
block: true, |
|||
width: 100, |
|||
tableType: 'image', |
|||
imgWidth: '50px', |
|||
imgHeight: '50px' |
|||
}, |
|||
{ |
|||
key: 'display', |
|||
title: '状态', |
|||
display: ['formA', 'formU', 'table', 'model'], |
|||
fixed: false, |
|||
block: true, |
|||
width: 80, |
|||
format: (cellValue, index) => { |
|||
if (cellValue === false) { |
|||
return '隐藏' |
|||
} else if (cellValue === true) { |
|||
return '显示' |
|||
} else { |
|||
return '未知' |
|||
} |
|||
} |
|||
} |
|||
] |
|||
} |
@ -0,0 +1,14 @@ |
|||
<template> |
|||
<div> |
|||
<customer-info></customer-info> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import CustomerInfo from './customer/manage/CustomerInfo' |
|||
export default { |
|||
components: { |
|||
CustomerInfo |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,312 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" |
|||
:title="'修改Footbar'" |
|||
:close-on-click-modal="false" |
|||
:before-close="handleClose" |
|||
:close-on-press-escape="false" |
|||
:width="60+'%'" |
|||
:top="'30px'"> |
|||
<el-form :inline="true" |
|||
:model="dataForm" |
|||
:rules="dataRule" |
|||
ref="dataForm" |
|||
:label-width="'120px'"> |
|||
<el-form-item label="默认导航栏名称"> |
|||
<div class="item_width_1"> |
|||
<span>{{dataForm.defaultName}}</span> |
|||
</div> |
|||
</el-form-item> |
|||
<el-form-item label="导航栏名称" |
|||
prop="barName"> |
|||
<el-tooltip class="item" |
|||
effect="dark" |
|||
content="请输入2-5个字" |
|||
placement="bottom-start"> |
|||
<el-input class="item_width_1" |
|||
:maxlength="5" |
|||
:minlength="2" |
|||
v-model="dataForm.barName" |
|||
placeholder="导航栏名称"></el-input> |
|||
</el-tooltip> |
|||
</el-form-item> |
|||
<el-form-item label="默认页面标题"> |
|||
<div class="item_width_1"> |
|||
<span>{{dataForm.defaultPageTitle}}</span> |
|||
</div> |
|||
</el-form-item> |
|||
<el-form-item label="页面标题" |
|||
prop="pageTitle"> |
|||
<el-tooltip class="item" |
|||
effect="dark" |
|||
content="请输入2-10个字" |
|||
placement="bottom-start"> |
|||
<el-input class="item_width_1" |
|||
:maxlength="10" |
|||
:minlength="2" |
|||
v-model="dataForm.pageTitle" |
|||
placeholder="页面标题"></el-input> |
|||
</el-tooltip> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="App类型" |
|||
prop="appType"> |
|||
<el-select :disabled="type==='U'" |
|||
class="item_width_1" |
|||
v-model="dataForm.appType" |
|||
placeholder="请选择" |
|||
clearable> |
|||
<el-option v-for="item in fromAppList" |
|||
:key="item.dictValue" |
|||
:label="item.dictName" |
|||
:value="item.dictValue"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item prop="iconPath" |
|||
label="图标"> |
|||
<el-upload class="item_width_1 avatar-uploader" |
|||
:action="uploadUlr" |
|||
:show-file-list="false" |
|||
:on-success="function (res, file) { return handleImgSuccess(res, file, '')}" |
|||
:before-upload="beforeImgUpload"> |
|||
<img v-if="dataForm.iconPath" |
|||
:src="dataForm.iconPath" |
|||
style="width:70px;height:70px" |
|||
class="function-icon"> |
|||
<i v-else |
|||
class="el-icon-plus avatar-uploader-icon"></i> |
|||
</el-upload> |
|||
</el-form-item> |
|||
|
|||
<el-form-item prop="selectedIconPath" |
|||
label="选中图标"> |
|||
<el-upload class="item_width_1 avatar-uploader" |
|||
:action="uploadUlr" |
|||
:show-file-list="false" |
|||
:on-success="function (res, file) { return handleImgSuccess(res, file, 'sel')}" |
|||
:before-upload="beforeImgUpload"> |
|||
<img v-if="dataForm.selectedIconPath" |
|||
:src="dataForm.selectedIconPath" |
|||
style="width:70px;height:70px" |
|||
class="function-icon"> |
|||
<i v-else |
|||
class="el-icon-plus avatar-uploader-icon"></i> |
|||
</el-upload> |
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
<template slot="footer"> |
|||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
|||
<el-button type="primary" |
|||
@click="saveForm()">{{ $t('confirm') }}</el-button> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
|
|||
let loading// 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
type: '', // 操作类型A/U |
|||
id: '', // 父组件传来功能id |
|||
dataForm: { |
|||
customerId: '', |
|||
barName: '', |
|||
barKey: '', |
|||
appType: '', |
|||
pageTitle: '', |
|||
iconPath: '', |
|||
selectedIconPath: '' |
|||
|
|||
}, |
|||
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/function/upload', |
|||
fromAppList: [ |
|||
{ |
|||
'dictName': '工作端', |
|||
'dictValue': 'gov' |
|||
}, { |
|||
'dictName': '居民端', |
|||
'dictValue': 'resi' |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
created () { |
|||
// this.queryFunctionList() |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
barKey: [ |
|||
{ required: true, message: 'Key不能为空', trigger: 'blur' } |
|||
], |
|||
barName: [ |
|||
{ required: true, message: '导航栏标题不能为空', trigger: 'blur' }, |
|||
{ min: 2, max: 5, message: '导航栏标题长度在 2 到 5 个字符', trigger: 'blur' } |
|||
], |
|||
appType: [ |
|||
{ required: true, message: '类型不能为空', trigger: 'blur' } |
|||
], |
|||
pageTitle: [ |
|||
{ required: true, message: '页面标题不能为空', trigger: 'blur' }, |
|||
{ min: 2, max: 10, message: '页面标题长度在 2 到 10 个字符', trigger: 'blur' } |
|||
] |
|||
// iconPath: [ |
|||
// { required: true, message: '图标不能为空', trigger: 'blur' } |
|||
// ], |
|||
// selectedIconPath: [ |
|||
// { required: true, message: '选中图标不能为空', trigger: 'blur' } |
|||
// ] |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
init (id, type, appType) { |
|||
this.type = type |
|||
this.visible = true |
|||
this.id = id |
|||
|
|||
if (type === 'A') { |
|||
this.dataForm = { |
|||
customerId: '', |
|||
barName: '', |
|||
barKey: '', |
|||
appType: appType, |
|||
pageTitle: '', |
|||
iconPath: '', |
|||
selectedIconPath: '' |
|||
} |
|||
|
|||
} else { |
|||
this.loadFormData() |
|||
} |
|||
}, |
|||
|
|||
loadFormData () { |
|||
const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/footbardetail' |
|||
// const url = '/oper/customize/customerfootbar/footbardetail' |
|||
let _data = { |
|||
id: this.id |
|||
} |
|||
this.startLoading() |
|||
window.app.ajax.post(url, _data, |
|||
(data, rspMsg) => { |
|||
this.endLoading() |
|||
this.dataForm = data |
|||
|
|||
}, |
|||
(rspMsg, data) => { |
|||
this.endLoading() |
|||
this.$message.error(rspMsg) |
|||
}) |
|||
}, |
|||
|
|||
// 上传大图标成功 |
|||
handleImgSuccess (res, file, type) { |
|||
if (res.code === 0 && res.msg === 'success') { |
|||
if (type === 'sel') { |
|||
this.dataForm.selectedIconPath = res.data.url |
|||
} else if (type === 'small') { |
|||
this.dataForm.iconPath = res.data.url |
|||
} |
|||
} else { |
|||
this.$message.error(res.msg) |
|||
} |
|||
}, |
|||
|
|||
beforeImgUpload (file) { |
|||
// const isPNG = file.type === 'image/png' |
|||
const isLt1M = file.size / 1024 < 20 |
|||
|
|||
// if (!isPNG) { |
|||
// this.$message.error('上传图片只能是 PNG 格式!') |
|||
// } |
|||
if (!isLt1M) { |
|||
this.$message.error('上传图片大小不能超过 1MB!') |
|||
} |
|||
// return isPNG && isLt1M |
|||
return isLt1M |
|||
}, |
|||
|
|||
saveForm () { |
|||
this.$refs['dataForm'].validate((valid, messageObj) => { |
|||
|
|||
if (!valid) { |
|||
app.util.validateRule(messageObj) |
|||
} else { |
|||
|
|||
let url = '' |
|||
if (this.type === 'U') { |
|||
// url = '/oper/customize/customerfootbar/updatefootbar' |
|||
url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/updatefootbar' |
|||
} else { |
|||
url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/createfootbar' |
|||
// url = '/oper/customize/customerfootbar/createfootbar' |
|||
this.dataForm.id = '' |
|||
this.dataForm.customerId = 'default' |
|||
} |
|||
window.app.ajax.post(url, this.dataForm, |
|||
(data, rspMsg) => { |
|||
this.$message({ |
|||
type: 'success', |
|||
message: '保存成功' |
|||
}) |
|||
this.$emit('editDiaOK') |
|||
this.visible = false |
|||
}, |
|||
(rspMsg, data) => { |
|||
this.endLoading() |
|||
this.$message.error(rspMsg) |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
handleClose () { |
|||
this.visible = false |
|||
}, |
|||
|
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|||
}) |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close() |
|||
} |
|||
} |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.function-icon { |
|||
width: 28px; |
|||
} |
|||
.item_width_1 { |
|||
width: 300px; |
|||
} |
|||
.item_width_2 { |
|||
width: 500px; |
|||
} |
|||
.block { |
|||
display: block; |
|||
} |
|||
.btn_serve { |
|||
float: left; |
|||
margin-top: 4px; |
|||
margin-left: 10px; |
|||
vertical-align: bottom; |
|||
} |
|||
</style> |
@ -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> |
@ -1,15 +1,47 @@ |
|||
<template> |
|||
<el-card shadow="never" class="aui-card--fill"> |
|||
<div class="mod-home"> |
|||
<h3>{{ $t('home.desc.title') }}</h3> |
|||
<ul> |
|||
<li v-for="item in $t('home.desc.list')" :key="item" v-html="item"></li> |
|||
</ul> |
|||
</div> |
|||
</el-card> |
|||
<div> |
|||
<el-card v-if="userType==='oper'" |
|||
shadow="never" |
|||
class="aui-card--fill"> |
|||
<div class="mod-home"> |
|||
<h3>{{ $t('home.desc.title') }}</h3> |
|||
<ul> |
|||
<li v-for="item in $t('home.desc.list')" |
|||
:key="item" |
|||
v-html="item"></li> |
|||
</ul> |
|||
</div> |
|||
</el-card> |
|||
|
|||
<customer-info @changeCustomerName="changeCustomerName" |
|||
v-if="userType==='work'"></customer-info> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import CustomerInfo from './customer/manage/CustomerInfo' |
|||
export default { |
|||
data () { |
|||
return { |
|||
// i18nMessages: messages, |
|||
updatePassowrdVisible: false, |
|||
customerName: localStorage.getItem('customerName'), |
|||
userType: localStorage.getItem('userType') |
|||
|
|||
} |
|||
}, |
|||
components: { |
|||
CustomerInfo |
|||
}, |
|||
mounted () { |
|||
//关闭所有标签页 |
|||
// tabs, 关闭全部 |
|||
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name === 'home') |
|||
}, |
|||
methods: { |
|||
changeCustomerName (customerName) { |
|||
this.$emit('changeCustomerName', customerName) |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
@ -0,0 +1,50 @@ |
|||
<template> |
|||
<div> |
|||
<el-card shadow="never" |
|||
class="aui-card--fill"> |
|||
<footbar-list ref="ref_footbarlist" |
|||
:showFrom="'default'" |
|||
:tableKeywork="'FootBar'"></footbar-list> |
|||
</el-card> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import FootbarList from './FootbarList' |
|||
|
|||
|
|||
|
|||
|
|||
export default { |
|||
data () { |
|||
return { |
|||
|
|||
} |
|||
}, |
|||
activated () { |
|||
|
|||
this.$nextTick(() => { |
|||
|
|||
this.$refs['ref_footbarlist'].doLayout() // 解决表格错位 |
|||
|
|||
}) |
|||
}, |
|||
components: { |
|||
FootbarList |
|||
}, |
|||
|
|||
mounted () { |
|||
|
|||
}, |
|||
computed: { |
|||
|
|||
}, |
|||
methods: { |
|||
|
|||
|
|||
} |
|||
} |
|||
</script> |
|||
<style> |
|||
</style> |
@ -0,0 +1,385 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" |
|||
:title="'修改Footbar'" |
|||
:close-on-click-modal="false" |
|||
:before-close="handleClose" |
|||
:close-on-press-escape="false" |
|||
:width="diaWidth+'%'" |
|||
:top="diaTop"> |
|||
<el-form :inline="showForm==='customize'" |
|||
:model="dataForm" |
|||
:rules="dataRule" |
|||
ref="dataForm" |
|||
:label-width="'120px'"> |
|||
<el-form-item v-if="showForm==='default'" |
|||
label="Key" |
|||
prop="barKey"> |
|||
|
|||
<el-input :disabled="type==='U'" |
|||
class="item_width_1" |
|||
v-model="dataForm.barKey" |
|||
placeholder="Key"></el-input> |
|||
|
|||
</el-form-item> |
|||
<el-form-item v-if="showForm==='customize'" |
|||
label="默认导航栏名称"> |
|||
<div class="item_width_1"> |
|||
<span>{{dataForm.defaultBarName}}</span> |
|||
</div> |
|||
</el-form-item> |
|||
<el-form-item label="导航栏名称" |
|||
prop="barName"> |
|||
<el-tooltip class="item" |
|||
effect="dark" |
|||
content="请输入2-5个字" |
|||
placement="bottom-start"> |
|||
<el-input class="item_width_1" |
|||
:maxlength="5" |
|||
:minlength="2" |
|||
v-model="dataForm.barName" |
|||
placeholder="导航栏名称"></el-input> |
|||
</el-tooltip> |
|||
</el-form-item> |
|||
<el-form-item v-if="showForm==='customize'" |
|||
label="默认页面标题"> |
|||
<div class="item_width_1"> |
|||
<span>{{dataForm.defaultPageTitle}}</span> |
|||
</div> |
|||
</el-form-item> |
|||
<el-form-item label="页面标题" |
|||
prop="pageTitle"> |
|||
<el-tooltip class="item" |
|||
effect="dark" |
|||
content="请输入2-10个字" |
|||
placement="bottom-start"> |
|||
<el-input class="item_width_1" |
|||
:maxlength="10" |
|||
:minlength="2" |
|||
v-model="dataForm.pageTitle" |
|||
placeholder="页面标题"></el-input> |
|||
</el-tooltip> |
|||
</el-form-item> |
|||
|
|||
<el-form-item v-if="showForm==='default'" |
|||
label="App类型" |
|||
prop="appType"> |
|||
<el-select :disabled="type==='U'" |
|||
class="item_width_1" |
|||
v-model="dataForm.appType" |
|||
placeholder="请选择" |
|||
clearable> |
|||
<el-option v-for="item in fromAppList" |
|||
:key="item.dictValue" |
|||
:label="item.dictName" |
|||
:value="item.dictValue"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item v-if="showForm==='customize'" |
|||
label="默认图标"> |
|||
<div class="item_width_1"> |
|||
<img :src="dataForm.defaultIconPath" |
|||
style="width:60px;height:60px" |
|||
class="function-icon"> |
|||
</div> |
|||
</el-form-item> |
|||
<el-form-item label="图标"> |
|||
<el-upload class="item_width_1 avatar-uploader" |
|||
:action="uploadUlr" |
|||
:show-file-list="false" |
|||
:on-success="function (res, file) { return handleImgSuccess(res, file, '')}" |
|||
:before-upload="beforeImgUpload"> |
|||
<img v-if="dataForm.iconPath" |
|||
:src="dataForm.iconPath" |
|||
style="width:60px;height:60px" |
|||
class="function-icon"> |
|||
<i v-else |
|||
class="el-icon-plus avatar-uploader-icon"></i> |
|||
</el-upload> |
|||
<el-button v-if="showForm==='customize'" |
|||
class="btn_reset" |
|||
type="primary" |
|||
size="mini" |
|||
@click="resetIcon">恢复默认</el-button> |
|||
</el-form-item> |
|||
<el-form-item v-if="showForm==='customize'" |
|||
label="默认选中图标"> |
|||
<div class="item_width_1"> |
|||
<img :src="dataForm.defaultSelectedIconPath" |
|||
style="width:60px;height:60px" |
|||
class="function-icon"> |
|||
</div> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="选中图标"> |
|||
<el-upload class="item_width_1 avatar-uploader" |
|||
:action="uploadUlr" |
|||
:show-file-list="false" |
|||
:on-success="function (res, file) { return handleImgSuccess(res, file, 'sel')}" |
|||
:before-upload="beforeImgUpload"> |
|||
<img v-if="dataForm.selectedIconPath" |
|||
:src="dataForm.selectedIconPath" |
|||
style="width:60px;height:60px" |
|||
class="function-icon"> |
|||
<i v-else |
|||
class="el-icon-plus avatar-uploader-icon"></i> |
|||
</el-upload> |
|||
<el-button v-if="showForm==='customize'" |
|||
class="btn_reset" |
|||
type="primary" |
|||
size="mini" |
|||
@click="resetSelectIcon">恢复默认</el-button> |
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
<template slot="footer"> |
|||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
|||
<el-button type="primary" |
|||
@click="saveForm()">{{ $t('confirm') }}</el-button> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
|
|||
let loading// 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
title: '新增Footbar', |
|||
type: '', // 操作类型A/U |
|||
id: '', // 父组件传来功能id |
|||
showForm: 'default',//来自默认配置default、自定义配置customize |
|||
dataForm: { |
|||
customerId: '', |
|||
barName: '', |
|||
defaultBarName: '', |
|||
barKey: '', |
|||
appType: '', |
|||
defaultPageTitle: '', |
|||
pageTitle: '', |
|||
iconPath: '', |
|||
defaultIconPath: '', |
|||
selectedIconPath: '', |
|||
defaultSelectedIconPath: '' |
|||
|
|||
}, |
|||
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/function/upload', |
|||
fromAppList: [ |
|||
{ |
|||
'dictName': '工作端', |
|||
'dictValue': 'gov' |
|||
}, { |
|||
'dictName': '居民端', |
|||
'dictValue': 'resi' |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
created () { |
|||
// this.queryFunctionList() |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
barKey: [ |
|||
{ required: true, message: 'Key不能为空', trigger: 'blur' } |
|||
], |
|||
barName: [ |
|||
{ required: true, message: '导航栏标题不能为空', trigger: 'blur' }, |
|||
{ min: 2, max: 5, message: '导航栏标题长度在 2 到 5 个字符', trigger: 'blur' } |
|||
], |
|||
appType: [ |
|||
{ required: true, message: '类型不能为空', trigger: 'blur' } |
|||
|
|||
], |
|||
pageTitle: [ |
|||
{ required: true, message: '页面标题不能为空', trigger: 'blur' }, |
|||
{ min: 2, max: 10, message: '页面标题长度在 2 到 10 个字符', trigger: 'blur' } |
|||
] |
|||
// iconPath: [ |
|||
// { required: true, message: '图标不能为空', trigger: 'blur' } |
|||
// ], |
|||
// selectedIconPath: [ |
|||
// { required: true, message: '选中图标不能为空', trigger: 'blur' } |
|||
// ] |
|||
} |
|||
}, |
|||
diaWidth () { |
|||
|
|||
return this.resolution === 'small' ? 60 : 50 |
|||
}, |
|||
diaTop () { |
|||
|
|||
return this.resolution === 'small' ? '30px' : '100px' |
|||
}, |
|||
...mapGetters(['clientHeight', 'resolution']), |
|||
}, |
|||
methods: { |
|||
init (id, type, appType, showForm) { |
|||
this.type = type |
|||
|
|||
this.showForm = showForm |
|||
this.visible = true |
|||
this.id = id |
|||
|
|||
if (type === 'A') { |
|||
this.title = '新增Footbar' |
|||
this.dataForm = { |
|||
customerId: '', |
|||
barName: '', |
|||
defaultBarName: '', |
|||
barKey: '', |
|||
appType: appType, |
|||
defaultPageTitle: '', |
|||
pageTitle: '', |
|||
iconPath: '', |
|||
defaultIconPath: '', |
|||
selectedIconPath: '', |
|||
defaultSelectedIconPath: '' |
|||
} |
|||
|
|||
} else { |
|||
this.title = '修改Footbar' |
|||
this.loadFormData() |
|||
} |
|||
}, |
|||
|
|||
loadFormData () { |
|||
// const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/footbardetail' |
|||
const url = '/oper/customize/customerfootbar/footbardetail' |
|||
let _data = { |
|||
id: this.id |
|||
} |
|||
this.startLoading() |
|||
window.app.ajax.post(url, _data, |
|||
(data, rspMsg) => { |
|||
this.endLoading() |
|||
this.dataForm = data |
|||
|
|||
}, |
|||
(rspMsg, data) => { |
|||
this.endLoading() |
|||
this.$message.error(rspMsg) |
|||
}) |
|||
}, |
|||
// 重置图标 |
|||
resetIcon () { |
|||
this.dataForm.iconPath = this.dataForm.defaultIconPath |
|||
}, |
|||
// 重置选中图标 |
|||
resetSelectIcon () { |
|||
this.dataForm.selectedIconPath = this.dataForm.defaultSelectedIconPath |
|||
}, |
|||
// 上传大图标成功 |
|||
handleImgSuccess (res, file, type) { |
|||
if (res.code === 0 && res.msg === 'success') { |
|||
if (type === 'sel') { |
|||
this.dataForm.selectedIconPath = res.data.url |
|||
} else if (type === '') { |
|||
this.dataForm.iconPath = res.data.url |
|||
} |
|||
} else { |
|||
this.$message.error(res.msg) |
|||
} |
|||
}, |
|||
|
|||
beforeImgUpload (file) { |
|||
// const isPNG = file.type === 'image/png' |
|||
const isLt1M = file.size / 1024 < 20 |
|||
|
|||
// if (!isPNG) { |
|||
// this.$message.error('上传图片只能是 PNG 格式!') |
|||
// } |
|||
if (!isLt1M) { |
|||
this.$message.error('上传图片大小不能超过20k!') |
|||
} |
|||
// return isPNG && isLt1M |
|||
return isLt1M |
|||
}, |
|||
|
|||
saveForm () { |
|||
this.$refs['dataForm'].validate((valid, messageObj) => { |
|||
|
|||
if (!valid) { |
|||
app.util.validateRule(messageObj) |
|||
} else { |
|||
|
|||
let url = '' |
|||
if (this.type === 'U') { |
|||
url = '/oper/customize/customerfootbar/updatefootbar' |
|||
// url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/updatefootbar' |
|||
} else { |
|||
// url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/createfootbar' |
|||
url = '/oper/customize/customerfootbar/createfootbar' |
|||
this.dataForm.id = '' |
|||
this.dataForm.customerId = 'default' |
|||
} |
|||
window.app.ajax.post(url, this.dataForm, |
|||
(data, rspMsg) => { |
|||
this.$message({ |
|||
type: 'success', |
|||
message: '保存成功' |
|||
}) |
|||
this.$emit('editDiaOK') |
|||
this.visible = false |
|||
}, |
|||
(rspMsg, data) => { |
|||
this.endLoading() |
|||
this.$message.error(rspMsg) |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
handleClose () { |
|||
this.visible = false |
|||
}, |
|||
|
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|||
}) |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close() |
|||
} |
|||
} |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.function-icon { |
|||
width: 28px; |
|||
} |
|||
.item_width_1 { |
|||
width: 200px; |
|||
} |
|||
.item_width_2 { |
|||
width: 500px; |
|||
} |
|||
.block { |
|||
display: block; |
|||
} |
|||
.btn_serve { |
|||
float: left; |
|||
margin-top: 4px; |
|||
margin-left: 10px; |
|||
vertical-align: bottom; |
|||
} |
|||
.btn_reset { |
|||
vertical-align: bottom; |
|||
margin-left: 10px; |
|||
} |
|||
</style> |
@ -0,0 +1,449 @@ |
|||
<template> |
|||
<div> |
|||
|
|||
<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"> |
|||
|
|||
</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', |
|||
customerId: 'default' |
|||
}, |
|||
tableParamsResi: { |
|||
appType: 'resi', |
|||
customerId: 'default' |
|||
}, |
|||
tableData: [], |
|||
// 列表相关 |
|||
// tableUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/customerfootbars', |
|||
tableUrl: '/oper/customize/customerfootbar/customerfootbars4oper', |
|||
|
|||
operations: [ |
|||
{ |
|||
lable: (display) => { |
|||
|
|||
if (display === true) { |
|||
return '隐藏' |
|||
} else { |
|||
return '显示' |
|||
} |
|||
}, // 按钮显示名称 |
|||
key: 'display', |
|||
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 |
|||
} |
|||
}, |
|||
{ |
|||
lable: '删除', // 按钮显示名称 |
|||
size: 'mini', |
|||
style: 'margin: 0 6px;', |
|||
type: 'text', |
|||
slot: '', |
|||
plain: false, |
|||
methodName: 'del', // 回调方法名称 |
|||
isShow: (row) => { |
|||
if (this.env === 'prod' || this.showFrom === 'customize') { |
|||
return false |
|||
} else { |
|||
return true |
|||
} |
|||
} |
|||
} |
|||
], |
|||
orderOperations: [ |
|||
// <el-button type="text" |
|||
// style="width=100px;height=100px" |
|||
// @click.stop="moveUpResi( scope.$index)" |
|||
// icon="el-icon-top"></el-button> |
|||
{ |
|||
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 () { |
|||
this.activeName = 'resi' |
|||
if (this.showFrom === 'default') {//默认配置 |
|||
this.tableParamsWork.customerId = 'default' |
|||
this.tableParamsResi.customerId = 'default' |
|||
this.loadResiTableData() |
|||
} else if (this.showFrom === 'customize') {//自定义配置 |
|||
|
|||
} |
|||
|
|||
}, |
|||
computed: { |
|||
tableHeight () { |
|||
return this.clientHeight - 60 - 80 - 80 |
|||
}, |
|||
...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') { |
|||
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, this.showFrom) |
|||
}, |
|||
// 编辑 |
|||
editShow (row) { |
|||
this.$refs['ref_edit'].init(row.id, 'U', this.activeName, this.showFrom) |
|||
}, |
|||
// 改变状态 |
|||
changeState (row, index) { |
|||
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 |
|||
} |
|||
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) { |
|||
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 = [] |
|||
let one = {} |
|||
for (let i = 0; i < this.tableData.length; i++) { |
|||
let obj = {} |
|||
// eslint-disable-next-line |
|||
|
|||
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) |
|||
let params = { |
|||
orderList: 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() |
|||
if (this.activeName == 'resi') { |
|||
this.loadResiTableData() |
|||
} else { |
|||
this.loadWorkTableData() |
|||
} |
|||
|
|||
}, |
|||
(rspMsg, data) => { |
|||
this.endLoading() |
|||
this.$message.error(rspMsg) |
|||
}) |
|||
|
|||
} else { |
|||
this.$message.warning('无法上移') |
|||
|
|||
return false |
|||
} |
|||
}, |
|||
|
|||
// 初始化 |
|||
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('确认删除当前导航', '提示', { |
|||
confirmButtonText: '确定', |
|||
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 param = { |
|||
id: row.id |
|||
} |
|||
window.app.ajax.post(url, param, |
|||
(data, rspMsg) => { |
|||
this.$message.success('删除成功' + rspMsg) |
|||
this.refresh() |
|||
}, |
|||
(rspMsg, data) => { |
|||
this.$message.error(rspMsg) |
|||
}) |
|||
}).catch(() => { |
|||
|
|||
}) |
|||
}, |
|||
// 取消 |
|||
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() |
|||
} |
|||
} |
|||
}, |
|||
props: { |
|||
showFrom: { |
|||
type: String, |
|||
default: 'default' |
|||
}, |
|||
//table的关键字 |
|||
tableKeywork: { |
|||
type: String, |
|||
default: 'FootBar' |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style> |
|||
.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; |
|||
top: 35px; |
|||
/* margin: 0 0 20px 0; */ |
|||
} |
|||
</style> |
Loading…
Reference in new issue