Browse Source

footbar

preview
jiangyy 4 years ago
parent
commit
0c8f467871
  1. 19
      epmet-oper-web/src/js/columns/productConfig/footBar.js
  2. 36
      epmet-oper-web/src/views/components/CTableNoPage.vue
  3. 10
      epmet-oper-web/src/views/modules/customer/customize/CustomerList.vue
  4. 313
      epmet-oper-web/src/views/modules/customer/customize/FootbarEdit.vue
  5. 332
      epmet-oper-web/src/views/modules/customer/customize/FootbarList.vue
  6. 290
      epmet-oper-web/src/views/modules/customer/customize/StartPage copy.vue
  7. 0
      epmet-oper-web/src/views/modules/productConfig/footbar/FootbarDefault111.vue
  8. 5
      epmet-oper-web/src/views/modules/productConfig/footbar/FootbarEdit.vue
  9. 66
      epmet-oper-web/src/views/modules/productConfig/footbar/FootbarList.vue
  10. 47
      epmet-oper-web/src/views/modules/productConfig/footbar/FootbarMode.vue
  11. 204
      epmet-oper-web/src/views/modules/productConfig/footbar/FootbarSync.vue

19
epmet-oper-web/src/js/columns/productConfig/footBar.js

@ -53,9 +53,10 @@ export default {
fixed: false,
block: true,
width: 100,
tableType: 'image',
imgWidth: '40px',
imgHeight: '40px'
tableType: 'bcImage',
bcColor:'#e3271c',
imgWidth: '20px',
imgHeight: '25px'
},
{
key: 'display',
@ -122,6 +123,18 @@ export default {
imgWidth: '40px',
imgHeight: '40px'
},
{
key: 'floatIconPath',
title: '浮起图标',
display: ['formA', 'formU', 'table', 'model'],
fixed: false,
block: true,
width: 100,
tableType: 'bcImage',
bcColor:'#e3271c',
imgWidth: '20px',
imgHeight: '25px'
},
{
key: 'display',
title: '状态',

36
epmet-oper-web/src/views/components/CTableNoPage.vue

@ -68,6 +68,29 @@
</template>
</el-table-column>
<!--有背景的图片列-->
<el-table-column v-if="col.tableType==='bcImage'"
:key="col.key"
:label="col.title"
:min-width="col.width"
:fixed="col.isFrozen"
show-overflow-tooltip
:align="'center'"
:header-align="headerAlign"
:formatter="col.formatter">
<template slot-scope="scope">
<div v-if="scope.row[col.key]"
class="img_bc"
:style="{background: col.bcColor?col.bcColor:'#e3271c'}">
<img :src="scope.row[col.key]"
:style="{width: col.imgWidth?col.imgWidth:'50px',height:col.imgHeight?col.imgHeight:'50px'}"
class="function-icon"
:fit=" col.fill?col.fill:'fill'">
</div>
</template>
</el-table-column>
<!--普通列-->
<el-table-column v-if="!col.tableType||col.tableType===''"
@ -382,7 +405,7 @@ export default {
}
}
</script>
<style>
<style >
.el-table td {
padding: 6px 0 !important;
}
@ -395,4 +418,15 @@ export default {
.operate {
text-align: center;
}
.img_bc {
width: 50px;
height: 50px;
margin: 5px auto;
text-align: center;
background: #e3271c;
box-shadow: 0px 2px 12px 0px rgba(209, 34, 24, 0.57);
border-radius: 50%;
padding: 12px;
}
</style>

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

@ -171,11 +171,8 @@ export default {
RoleAuth
},
activated () {
if (this.showType === 'footbar') {
this.$nextTick(() => {
this.$refs['ref_footbarlist'].doLayout() //
})
} else if (this.showType === 'list') {
if (this.showType === 'list') {
this.$nextTick(() => {
this.$refs['ref_customertable'].doLayout() //
})
@ -240,6 +237,9 @@ export default {
showFootbar (customerId, customerName) {
this.showType = 'footbar'
this.$refs['ref_footbarlist'].initData(customerId, customerName)
this.$nextTick(() => {
this.$refs['ref_footbarlist'].doLayout() //
})
},
// most
showMost (customerId, customerName) {

313
epmet-oper-web/src/views/modules/customer/customize/FootbarEdit.vue

@ -1,313 +0,0 @@
<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/uploadqrcodeV2',
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>

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

@ -1,332 +0,0 @@
<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 () {
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>

290
epmet-oper-web/src/views/modules/customer/customize/StartPage copy.vue

@ -1,290 +0,0 @@
<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>
</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 () {
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>

0
epmet-oper-web/src/views/modules/productConfig/footbar/FootbarDefault.vue → epmet-oper-web/src/views/modules/productConfig/footbar/FootbarDefault111.vue

5
epmet-oper-web/src/views/modules/productConfig/footbar/FootbarEdit.vue

@ -296,9 +296,6 @@ export default {
this.endLoading()
this.dataForm = data
this.dataForm.floatIconPath = ""
console.log(this.dataForm)
},
(rspMsg, data) => {
this.endLoading()
@ -370,7 +367,7 @@ export default {
type: 'success',
message: '保存成功'
})
this.$emit('editDiaOK')
this.$emit('dialogOk')
this.visible = false
},
(rspMsg, data) => {

66
epmet-oper-web/src/views/modules/productConfig/footbar/FootbarList.vue

@ -9,7 +9,7 @@
@click="diaCancel">取消返回</el-button>
<el-button type="primary"
size="mini"
@click="initDefault">自定义初始化</el-button>
@click="syncShow">同步默认配置</el-button>
</div>
<div v-if="showFrom==='default'"
@ -42,7 +42,10 @@
</c-table>
<Mode ref="mode_resi"
@refresh="refresh"
:showFootbarList="showFootbarList"
:appType="activeName"
:customerId="customerId"
:showMode="showMode"></Mode>
</el-tab-pane>
<el-tab-pane label="工作端"
@ -62,16 +65,24 @@
@del="del">
</c-table>
<Mode ref="mode_work"
@refresh="refresh"
:showFootbarList="showFootbarList"
:appType="activeName"
:customerId="customerId"
:showMode="showMode"></Mode>
</el-tab-pane>
</el-tabs>
<edit ref="ref_edit"
@editDiaOK="editDiaOK">
@dialogOk="dialogOk">
</edit>
<Sync ref="ref_sync"
@dialogOk="dialogOk">
</Sync>
</div>
</template>
@ -80,6 +91,7 @@ import CDialog from '@c/CDialog'
import CTable from '@c/CTableNoPage'
import Edit from './FootbarEdit'
import Mode from './FootbarMode'
import Sync from './FootbarSync'
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
@ -198,7 +210,7 @@ export default {
}
},
components: {
CDialog, CTable, Edit, Mode
CDialog, CTable, Edit, Mode, Sync
},
async mounted () {
@ -210,10 +222,8 @@ export default {
await this.loadResiTableData()
} else if (this.showFrom === 'customize') {//
}
},
computed: {
tableHeight () {
@ -221,6 +231,7 @@ export default {
},
...mapGetters(['clientHeight', 'env'])
},
methods: {
doLayout () {
@ -257,6 +268,7 @@ export default {
if (tab.name === 'resi') {
this.loadResiTableData() //
}
this.doLayout() //
},
//
async loadWorkTableData () {
@ -264,8 +276,6 @@ export default {
this.footbarList = this.$refs['table_work'].getTableData()
this.loadFootbarList(this.footbarList)
await this.loadMode()
console.log("footbarList", this.footbarList)
},
//
async loadResiTableData () {
@ -274,7 +284,7 @@ export default {
this.footbarList = this.$refs['table_resi'].getTableData()
this.loadFootbarList(this.footbarList)
await this.loadMode()
console.log("footbarList", this.footbarList)
},
@ -300,7 +310,7 @@ export default {
async loadMode () {
this.startLoading()
// const url = "http://yapi.elinkservice.cn/mock/102/data/aggregator/app/footbarpattern"
const url = "/data/aggregator/app/footbarpattern"
const url = "/oper/crm/customer/footbarpattern"
const params = {
customerId: this.customerId,
@ -311,12 +321,27 @@ export default {
if (data) {
this.showMode = data.pattern
}
} else {
this.$message.error(msg)
}
this.endLoading()
},
//
saveMode () {
if (this.activeName === 'gov') {
this.$refs['mode_work'].saveToMode1()
} else if (this.activeName === 'resi') {
this.$refs['mode_resi'].saveToMode1()
}
},
//
syncShow () {
this.$refs['ref_sync'].init(this.customerId, this.activeName, this.footbarList)
},
//
addShow () {
this.$refs['ref_edit'].init('', 'A', this.activeName, this.showFrom)
@ -330,6 +355,7 @@ export default {
changeState (row, index) {
const h = this.$createElement
let message = ''
if (this.showMode == "float" && this.showFootbarList.length % 2 !== 0) {//
message = h('div', [
h('p', this.text1), h('p', this.text2), h('p', '确认隐藏?')
@ -355,7 +381,11 @@ export default {
}
window.app.ajax.post(url, param,
(data, rspMsg) => {
this.$message.success('操作成功' + rspMsg)
this.$message.success('隐藏成功')
if (this.showMode == "float") {
this.saveMode()
}
this.refresh()
},
(rspMsg, data) => {
@ -440,7 +470,7 @@ export default {
}
window.app.ajax.post(url, param,
(data, rspMsg) => {
this.$message.success('初始化成功' + rspMsg)
this.$message.success('初始化成功')
this.refresh()
},
(rspMsg, data) => {
@ -477,7 +507,10 @@ export default {
}
window.app.ajax.post(url, param,
(data, rspMsg) => {
this.$message.success('删除成功' + rspMsg)
this.$message.success('删除成功')
if (this.showMode == "float") {
this.saveMode()
}
this.refresh()
},
(rspMsg, data) => {
@ -492,16 +525,9 @@ export default {
diaCancel () {
this.$emit('cancleBack')
},
editDiaOK () {
dialogOk () {
this.refresh()
},
editDiaCancel () {
},
async renderSelData () { // //
},
//
startLoading () {

47
epmet-oper-web/src/views/modules/productConfig/footbar/FootbarMode.vue

@ -72,6 +72,18 @@ export default {
type: String,
default: "flat"
},
customerId: {
type: String,
default: "default"
},
customerId: {
type: String,
default: "default"
},
appType: {
type: String,
default: "resi"
},
},
data () {
@ -84,31 +96,27 @@ export default {
created () {
// this.queryFunctionList()
},
computed: {
diaTop () {
return this.resolution === 'small' ? '30px' : '100px'
},
...mapGetters(['clientHeight', 'resolution']),
},
watch: {
// footbarList: {//
// handler (val, oldVal) {
// this.loadFootbarList(val)
// // console.log("b.c: ", val, oldVal);
// },
// deep: true //true
// }
showMode (val, oldval) {
console.log(val, oldval)
this.mode = val
}
},
methods: {
//2
changeToMode2 () {
if (this.showFootbarList.length % 2 === 0) {//
this.$message.error("当前Footbar数量为偶数,无法切换到模式2")
this.mode = "flat"
}
},
//1
saveToMode1 () {
this.mode = "flat"
this.saveMode()
},
loadFormData () {
// const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/footbardetail'
const url = '/oper/customize/customerfootbar/footbardetail'
@ -136,14 +144,13 @@ export default {
const params = {
customerId: this.customerId,
appType: this.activeName
appType: this.appType,
pattern: this.mode
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
if (data) {
this.showMode = data.pattern
}
this.$message.success("模式保存成功")
this.$emit('refresh')
} else {
this.$message.error(msg)
}

204
epmet-oper-web/src/views/modules/productConfig/footbar/FootbarSync.vue

@ -0,0 +1,204 @@
<template>
<el-dialog :visible.sync="visible"
:title="title"
:close-on-click-modal="false"
:before-close="handleClose"
:close-on-press-escape="false"
:width="diaWidth+'%'"
:top="diaTop">
<el-row class="wrap"
:gutter="24">
<el-col :span="12">
<el-card class="box-card">
<div slot="header"
class="clearfix">
<span>同步列表客户已有的Footbar同部为默认配置</span>
</div>
<el-table id="have_table"
ref="table"
:height="tableHeight"
:data="allHaveList"
border
@select="handleSelect"
@select-all="handleSelectAll">
<el-table-column type="selection"></el-table-column>
<el-table-column label="名称"
align="center"
header-align="center">
</el-table-column>
</el-table>
</el-card>
</el-col>
<el-col :span="12">
<el-card class="box-card">
<div slot="header"
class="clearfix">
<span>采集列表客户的Footbar同部为默认配置</span>
</div>
<!-- <div class="div_list"></div> -->
<el-table id="have_table"
ref="table"
:height="tableHeight"
:data="allNoList"
border
v-loading="tableLoading"
@select="handleSelect"
@select-all="handleSelectAll">
<el-table-column type="selection"></el-table-column>
<el-table-column label="名称"
align="center"
header-align="center">
</el-table-column>
</el-table>
</el-card>
</el-col>
</el-row>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary"
@click="saveBar()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from "@/js/dai/request";
let loading//
export default {
data () {
return {
visible: false,
tableLoading: false,
customerId: "",
appType: "",
allHaveList: [],//bar
allNoList: [],//bar
syncBarKeyList: [],//bar
addBarKeyList: []//bar
}
},
created () {
// this.queryFunctionList()
},
computed: {
cardHeight () {
return this.clientHeight - 60 - 80 - 80 - 280
},
tableHeight () {
return this.clientHeight - 60 - 80 - 80 - 280 - 100
},
...mapGetters(['clientHeight', 'env'])
},
methods: {
init (customerId, appType, allHaveList) {
this.customerId = customerId
this.appType = appType
this.allHaveList = allHaveList
this.visible = true
this.loadNoBarList()
},
//
handleSelect (selection, row) {
debugger
},
//
handleSelectAll (selection) {
debugger
},
async loadNoBarList () {
const url = '/oper/customize/customerfootbar/getNotOnlineFootBars'
let params = {
appType: this.appType,
customerId: this.customerId,
}
this.startLoading()
this.tableLoading = true
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
if (data) {
this.allNoList = data
}
} else {
this.$message.error(msg)
}
this.endLoading()
this.tableLoading = false
},
async saveBar () {
const url = '/oper/customize/customerfootbar/syncfootbar4customer'
let params = {
appType: this.appType,
customerId: this.customerId,
syncBarKeyList: this.syncBarKeyList,
addBarKeyList: this.addBarKeyList,
}
this.startLoading()
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.$message({
type: 'success',
message: '保存成功'
})
this.$emit('dialogOk')
this.visible = false
} else {
this.$message.error(msg)
}
},
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>
.wrap {
height: 400px;
}
.div_list {
height: 300px;
}
</style>
Loading…
Cancel
Save