8 changed files with 1296 additions and 139 deletions
@ -1,3 +1,20 @@ |
|||
export const mockUrlPrefix = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad'; |
|||
export const mockUrlPrefix = |
|||
'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad' |
|||
|
|||
export const envIsDev = process.env.VUE_APP_NODE_ENV === "dev"; |
|||
export const envIsDev = process.env.VUE_APP_NODE_ENV === 'dev' |
|||
|
|||
export default { |
|||
appid: { |
|||
//开发环境appid
|
|||
devResiAppid: 'wx0301bf7f534d97d1', // 风凌石居民端
|
|||
devWorkAppid: 'wx2679392c4cc2af22', //风凌石工作端
|
|||
|
|||
//体验环境appid
|
|||
testResiAppid: 'wxd0795b37d0f0bf08', // 风凌石居民端测试号
|
|||
testWorkAppid: 'wx6a57bdefa9d9ec93', //风凌石工作端测试号
|
|||
|
|||
//生产环境appid
|
|||
prodResiAppid: 'wxcb1a6bb4706538d3', // 风凌石测试1
|
|||
prodWorkAppid: 'wx0ea975d0b484ae27' //以风凌石
|
|||
} |
|||
} |
|||
|
@ -0,0 +1,432 @@ |
|||
<template> |
|||
<div> |
|||
|
|||
<el-card shadow="never" |
|||
class="aui-card--fill"> |
|||
<el-tabs v-model="activeName" |
|||
@tab-click="tabClick" |
|||
class="el-tabs"> |
|||
<el-tab-pane label="居民端" |
|||
name="mine"> |
|||
|
|||
<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="public"> |
|||
<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> |
|||
</el-card> |
|||
<edit ref="ref_edit" |
|||
@editDiaOK="editDiaOK"> |
|||
|
|||
</edit> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import CDialog from '@c/CDialog' |
|||
import CTable from '@c/CTableNoPage' |
|||
import Edit from './TempEdit' |
|||
|
|||
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> |
@ -0,0 +1,278 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" |
|||
title="订阅消息" |
|||
:close-on-click-modal="false" |
|||
:before-close="handleClose" |
|||
:close-on-press-escape="false" |
|||
:width="diaWidth+'%'" |
|||
:top="diaTop"> |
|||
<div :style="{height:formHeight+'px',overflowY:'auto',overflowX:'hidden'}"> |
|||
|
|||
<el-row :gutter="20"> |
|||
<el-col :span="8"> |
|||
<el-card shadow="never" |
|||
class="box-card"> |
|||
<div :style="{height:rowHeight}">111</div> |
|||
</el-card> |
|||
</el-col> |
|||
<el-col :span="16"> |
|||
<el-card shadow="never" |
|||
class="box-card card_right"> |
|||
|
|||
<el-form :style="{height:rowHeight}" |
|||
:inline="false" |
|||
:model="dataForm" |
|||
ref="dataForm" |
|||
:label-width="'120px'"> |
|||
|
|||
<el-form-item label="App类型" |
|||
prop="appId"> |
|||
<el-select class="item_width_1" |
|||
v-model="dataForm.appId" |
|||
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 label="配置关键字"> |
|||
<div class="item_width_1 div_keywords"> |
|||
<el-checkbox-group v-model="kidSelNameList" |
|||
:min="1" |
|||
:max="5"> |
|||
<div class="item_width_1 div_checkbox" |
|||
v-for="item in kidAllName" |
|||
:key="item"> |
|||
<el-checkbox :label="item">{{item}}</el-checkbox> |
|||
</div> |
|||
</el-checkbox-group> |
|||
</div> |
|||
</el-form-item> |
|||
<el-form-item :label="'已选择('+kidSelNameList.length+'/'+kidAllList.length+')'"> |
|||
<div class="item_width_1 div_keywords_sel"> |
|||
|
|||
<div class="item_width_1 div_checkbox_sel" |
|||
v-for="item in kidSelNameList" |
|||
:key="item">{{item}} |
|||
|
|||
<el-button type="text" |
|||
class="btn_up" |
|||
@click.stop="moveUp(item)" |
|||
icon="el-icon-top"></el-button> |
|||
</div> |
|||
|
|||
</div> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="服务场景描述" |
|||
prop="sceneDesc"> |
|||
|
|||
<el-input class="item_width_1" |
|||
:maxlength="5" |
|||
:minlength="2" |
|||
v-model="dataForm.sceneDesc" |
|||
placeholder="服务场景描述"></el-input> |
|||
|
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
</el-card> |
|||
</el-col> |
|||
</el-row> |
|||
|
|||
</div> |
|||
<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 { requestPost } from "@/js/dai/request"; |
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
|
|||
let loading// 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
workAppid: '', |
|||
resiAppid: '', |
|||
tid: '',// |
|||
|
|||
dataForm: { |
|||
appId: '', |
|||
tid: '', |
|||
sceneDesc: '', |
|||
kidList: [] |
|||
}, |
|||
|
|||
kidAllList: [],//全部的关键字对象 |
|||
kidAllName: [],//全部的关键字name |
|||
kidSelNameList: [], |
|||
kidSelList2: [], |
|||
} |
|||
}, |
|||
created () { |
|||
// this.queryFunctionList() |
|||
}, |
|||
|
|||
methods: { |
|||
init (workAppid, resiAppid, row) { |
|||
this.workAppid = workAppid |
|||
this.resiAppid = resiAppid |
|||
this.dataForm.appId = resiAppid |
|||
this.tid = row.tid |
|||
|
|||
this.visible = true |
|||
|
|||
this.getkeywords() |
|||
|
|||
}, |
|||
async getkeywords () { |
|||
this.startLoading() |
|||
const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/subscribe/getkeywords' |
|||
// const url = '/third/subscribe/getkeywords' |
|||
let _data = { |
|||
appId: this.appId |
|||
} |
|||
const { data, code, msg } = await requestPost(url, _data) |
|||
if (code === 0) { |
|||
this.kidAllList = data |
|||
this.kidAllList.forEach(item => { |
|||
this.kidAllName.push(item.name) |
|||
}) |
|||
|
|||
} |
|||
this.endLoading() |
|||
}, |
|||
moveUp () { |
|||
|
|||
}, |
|||
|
|||
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() |
|||
} |
|||
} |
|||
|
|||
}, |
|||
computed: { |
|||
fromAppList () { |
|||
let fromAppList = [ |
|||
{ |
|||
'dictName': '居民端', |
|||
'dictValue': this.resiAppid |
|||
}, { |
|||
'dictName': '工作端', |
|||
'dictValue': this.workAppid |
|||
} |
|||
] |
|||
return fromAppList |
|||
|
|||
}, |
|||
diaWidth () { |
|||
return this.resolution === 'small' ? 80 : 70 |
|||
}, |
|||
diaTop () { |
|||
return this.resolution === 'small' ? '30px' : '100px' |
|||
}, |
|||
formHeight () { |
|||
return this.clientHeight * 0.6 |
|||
}, |
|||
rowHeight () { |
|||
return (this.formHeight - 70) + 'px' |
|||
}, |
|||
...mapGetters(['clientHeight', 'resolution']), |
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<style scope> |
|||
.el-row { |
|||
margin-bottom: 20px; |
|||
} |
|||
.el-col { |
|||
border-radius: 4px; |
|||
} |
|||
.card_right { |
|||
background: #f8f8f8af; |
|||
} |
|||
.div_keywords { |
|||
background-color: white; |
|||
max-height: 250px; |
|||
overflow-y: auto; |
|||
} |
|||
.div_keywords_sel { |
|||
max-height: 250px; |
|||
|
|||
/* overflow-y: auto; */ |
|||
} |
|||
.div_checkbox { |
|||
margin: 0 0 0 20px; |
|||
} |
|||
.div_checkbox_sel { |
|||
background-color: white; |
|||
margin: 0 0 10px 0; |
|||
padding: 0 0 0 20px; |
|||
} |
|||
.btn_up { |
|||
float: right; |
|||
margin-right: 10px; |
|||
} |
|||
</style> |
|||
|
@ -0,0 +1,242 @@ |
|||
<template> |
|||
<div> |
|||
|
|||
<el-card shadow="never" |
|||
class="aui-card--fill"> |
|||
<el-tabs v-model="activeName" |
|||
@tab-click="tabClick" |
|||
class="el-tabs"> |
|||
<el-tab-pane label="我的模板" |
|||
name="mine"> |
|||
<my-temp ref="ref_mytemp"></my-temp> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="公共模板" |
|||
name="public"> |
|||
<el-table ref="ref_publictable" |
|||
v-loading="dataListLoading" |
|||
:data="dataList" |
|||
border |
|||
style="width: 100%;"> |
|||
<el-table-column prop="title" |
|||
label="标题" |
|||
header-align="left" |
|||
:min-width="100" |
|||
align="left"></el-table-column> |
|||
<el-table-column prop="keyWords" |
|||
label="关键词" |
|||
header-align="left" |
|||
:min-width="500" |
|||
align="left"></el-table-column> |
|||
<el-table-column label="操作" |
|||
fixed="right" |
|||
header-align="center" |
|||
align="center" |
|||
width="150"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="text" |
|||
size="small" |
|||
@click="selTempShow(scope.row)">选择</el-button> |
|||
|
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination :current-page="pageNo" |
|||
:page-sizes="[10, 15, 20]" |
|||
:page-size="pageSize" |
|||
:total="total" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
@size-change="handleSizeChange" |
|||
@current-change="handleCurrentChange"> |
|||
</el-pagination> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
</el-card> |
|||
|
|||
<edit ref="ref_edit" |
|||
@editDiaOK="editDiaOK"> |
|||
|
|||
</edit> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import CDialog from '@c/CDialog' |
|||
import CTable from '@c/CTableNoPage' |
|||
import MyTemp from './MyTemp' |
|||
import Edit from './TempEdit' |
|||
import config from "@/js/dai/config"; |
|||
|
|||
import { mapGetters } from 'vuex' |
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
|
|||
let loading// 加载动画 |
|||
|
|||
export default { |
|||
data () { |
|||
return { |
|||
activeName: 'public', |
|||
workAppid: '', |
|||
resiAppid: '', |
|||
|
|||
//分页 |
|||
pageNo: 1, |
|||
pageSize: 10, |
|||
total: 0, |
|||
|
|||
tableParams: { |
|||
pageNo: this.pageNo, |
|||
pageSize: this.pageSize |
|||
}, |
|||
|
|||
// 列表相关 |
|||
// tableUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/customerfootbars', |
|||
tableUrl: '/oper/customize/customerfootbar/customerfootbars4oper', |
|||
dataListLoading: false, |
|||
dataList: [ |
|||
{ |
|||
title: '新的评论提醒', |
|||
keyWords: ' 文章标题、评论内容、评论时间、取消提醒、评论用户、帖子内容、评论类型、评论人数、备注' |
|||
}, |
|||
{ |
|||
title: '便民信息审核结果通知 ', |
|||
keyWords: ' 审核结果、审核人员、联系电话、审核时间、拒绝理由' |
|||
} |
|||
], |
|||
|
|||
} |
|||
}, |
|||
components: { |
|||
CDialog, CTable, Edit, MyTemp |
|||
}, |
|||
|
|||
mounted () { |
|||
|
|||
this.activeName = 'public' |
|||
|
|||
if (this.env === 'test') {//测试 |
|||
this.workAppid = config.appid.devWorkAppid |
|||
this.resiAppid = config.appid.devResiAppid |
|||
} else if (this.env === 'prod') {//生产 |
|||
this.workAppid = config.appid.testWorkAppid |
|||
this.resiAppid = config.appid.testResiAppid |
|||
} else {//开发 |
|||
this.workAppid = config.appid.devWorkAppid |
|||
this.resiAppid = config.appid.devResiAppid |
|||
} |
|||
|
|||
}, |
|||
computed: { |
|||
tableHeight () { |
|||
return this.clientHeight - 60 - 80 - 80 |
|||
}, |
|||
...mapGetters(['clientHeight', 'env']) |
|||
}, |
|||
activated () { |
|||
this.$nextTick(() => { |
|||
if (this.activeName === 'mine') { |
|||
// this.$refs['table_work'].doLayout() // 解决表格错位 |
|||
} else if (this.activeName === 'public') { |
|||
this.$refs.ref_publictable.doLayout() // 解决表格错位 |
|||
} |
|||
|
|||
}) |
|||
}, |
|||
methods: { |
|||
|
|||
//加载列表数据 |
|||
loadData () { |
|||
|
|||
}, |
|||
|
|||
tabClick (tab) { |
|||
if (tab.name === 'mine') { |
|||
|
|||
} |
|||
if (tab.name === 'public') { |
|||
|
|||
} |
|||
}, |
|||
|
|||
// 显示编辑模板 |
|||
selTempShow (row) { |
|||
console.log(this.workAppid + ';;;;' + this.resiAppid) |
|||
this.$refs['ref_edit'].init(this.workAppid, this.resiAppid, row) |
|||
}, |
|||
// 取消 |
|||
diaCancel () { |
|||
this.$emit('cancleBack') |
|||
}, |
|||
editDiaOK () { |
|||
this.refresh() |
|||
}, |
|||
editDiaCancel () { |
|||
|
|||
}, |
|||
|
|||
handleSizeChange (pageSize) { |
|||
this.tableParams.pageSize = pageSize |
|||
this.tableParams.pageNo = 0 |
|||
this.$nextTick(() => { |
|||
this.loadData() |
|||
}) |
|||
}, |
|||
// 改变当前页 |
|||
handleCurrentChange (pageNo) { |
|||
this.tableParams.pageNo = pageNo - 1 |
|||
this.$nextTick(() => { |
|||
this.loadData() |
|||
}) |
|||
}, |
|||
|
|||
|
|||
|
|||
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