|
|
|
@ -26,7 +26,8 @@ |
|
|
|
:tableHeight="tableHeight" |
|
|
|
@init="init" |
|
|
|
@delete="del" |
|
|
|
@showToken="showToken"> |
|
|
|
@showToken="showToken" |
|
|
|
@showSubscribe="showSubscribe"> |
|
|
|
</c-table> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
@ -45,36 +46,132 @@ |
|
|
|
<el-form-item label="客户名称" |
|
|
|
prop="customerName"> |
|
|
|
<div class="item_width_1"> |
|
|
|
<span>{{tokenForm.customerName}}</span></div> |
|
|
|
<span>{{tokenForm.customerName}}</span> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="开发token" |
|
|
|
prop="componentAccessToken"> |
|
|
|
<div class="item_width_1"> |
|
|
|
<span>{{tokenForm.componentAccessToken}}</span></div> |
|
|
|
<span>{{tokenForm.componentAccessToken}}</span> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="工作端token" |
|
|
|
prop="workAuthorizerToken"> |
|
|
|
<div class="item_width_1"> |
|
|
|
<span>{{tokenForm.workAuthorizerToken}}</span></div> |
|
|
|
<span>{{tokenForm.workAuthorizerToken}}</span> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="居民端token" |
|
|
|
prop="resiAuthorizerToken"> |
|
|
|
<div class="item_width_1"> |
|
|
|
<span>{{tokenForm.resiAuthorizerToken}}</span></div> |
|
|
|
<span>{{tokenForm.resiAuthorizerToken}}</span> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</el-form> |
|
|
|
</c-dialog> |
|
|
|
|
|
|
|
<c-dialog :showFooter='false' |
|
|
|
:title="'订阅消息'" |
|
|
|
:isNest="false" |
|
|
|
:visible="diaSubVisible" |
|
|
|
:dialogHeight="1.1" |
|
|
|
:width="60" |
|
|
|
@cancel="diaSubCancel"> |
|
|
|
<div style=" position: relative;"> |
|
|
|
<div class="div_btn"> |
|
|
|
|
|
|
|
<el-button type="primary" |
|
|
|
size="mini" |
|
|
|
@click="syncSub">同步默认订阅消息</el-button> |
|
|
|
|
|
|
|
</div> |
|
|
|
<el-tabs v-model="activeName" |
|
|
|
class="el-tabs"> |
|
|
|
<el-tab-pane label="居民端" |
|
|
|
name="resi"> |
|
|
|
<el-table ref="ref_publictable_resi" |
|
|
|
v-loading="dataListLoading" |
|
|
|
:data="resiDataList" |
|
|
|
border |
|
|
|
style="width: 100%;"> |
|
|
|
<el-table-column prop="priTmplId" |
|
|
|
label="模板ID" |
|
|
|
header-align="left" |
|
|
|
:min-width="150" |
|
|
|
align="left"></el-table-column> |
|
|
|
<el-table-column prop="title" |
|
|
|
label="标题" |
|
|
|
header-align="left" |
|
|
|
:min-width="120" |
|
|
|
align="left"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="state" |
|
|
|
label="状态" |
|
|
|
header-align="left" |
|
|
|
:min-width="80"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.state==='0'" |
|
|
|
style="color: red">未同步</span> |
|
|
|
<span v-else-if="scope.row.state==='1'">同步</span> |
|
|
|
|
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane label="工作端" |
|
|
|
name="gov"> |
|
|
|
<el-table ref="ref_publictable_gov" |
|
|
|
v-loading="dataListLoading" |
|
|
|
:data="workDataList" |
|
|
|
border |
|
|
|
style="width: 100%;"> |
|
|
|
<el-table-column prop="priTmplId" |
|
|
|
label="模板ID" |
|
|
|
header-align="left" |
|
|
|
:min-width="150" |
|
|
|
align="left"></el-table-column> |
|
|
|
<el-table-column prop="title" |
|
|
|
label="标题" |
|
|
|
header-align="left" |
|
|
|
:min-width="120" |
|
|
|
align="left"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="state" |
|
|
|
label="状态" |
|
|
|
header-align="left" |
|
|
|
:min-width="80"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.state==='0'" |
|
|
|
style="color: red">未同步</span> |
|
|
|
<span v-else-if="scope.row.state==='1'">同步</span> |
|
|
|
|
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column prop="stateShow" |
|
|
|
label="状态" |
|
|
|
header-align="left" |
|
|
|
:min-width="100" |
|
|
|
align="left"></el-table-column> --> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
</div> |
|
|
|
</c-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import CDialog from '@c/CDialog' |
|
|
|
import CTable from '@c/CTable' |
|
|
|
import config from "@/js/dai/config"; |
|
|
|
import { requestPost } from "@/js/dai/request"; |
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
import { Loading } from 'element-ui' // 引入Loading服务 |
|
|
|
|
|
|
|
@ -85,6 +182,8 @@ export default { |
|
|
|
dataForm: { |
|
|
|
name: '' // 组织名称 |
|
|
|
}, |
|
|
|
workAppid: '', |
|
|
|
resiAppid: '', |
|
|
|
// 列表相关 |
|
|
|
tableUrl: |
|
|
|
'https://epmet-cloud.elinkservice.cn/api/third/pacustomer/registerinfo', |
|
|
|
@ -114,6 +213,26 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
lable: '订阅消息', // 按钮显示名称 |
|
|
|
size: 'mini', |
|
|
|
style: 'margin: 0 6px;', |
|
|
|
type: 'text', |
|
|
|
slot: '', |
|
|
|
plain: false, |
|
|
|
methodName: 'showSubscribe', // 回调方法名称 |
|
|
|
isShow: (row) => { |
|
|
|
if ( |
|
|
|
row.initState === 0 && |
|
|
|
row.resiAuth === 1 && |
|
|
|
row.workAuth === 1 |
|
|
|
) { |
|
|
|
return true |
|
|
|
} else { |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
lable: '删除', // 按钮显示名称 |
|
|
|
size: 'mini', |
|
|
|
@ -145,7 +264,8 @@ export default { |
|
|
|
// return false |
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
// 初始化相关 |
|
|
|
@ -159,7 +279,17 @@ export default { |
|
|
|
componentAccessToken: '', |
|
|
|
resiAuthorizerToken: '', |
|
|
|
workAuthorizerToken: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//订阅消息列表相关 |
|
|
|
selCustomerId: '', |
|
|
|
diaSubVisible: false, |
|
|
|
activeName: 'resi', |
|
|
|
dataListLoading: false, |
|
|
|
resiDataList: [], |
|
|
|
workDataList: [], |
|
|
|
resiTempIdList: [],//居民端未同步的模板数组 |
|
|
|
workDataList: [],//工作端未同步的模板数组 |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
|
@ -172,6 +302,18 @@ export default { |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
this.tableParams.source = this.env |
|
|
|
|
|
|
|
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 |
|
|
|
} |
|
|
|
|
|
|
|
// eslint-disable-next-line |
|
|
|
this.loadData() |
|
|
|
}, |
|
|
|
@ -268,6 +410,93 @@ export default { |
|
|
|
this.diaVisible = false |
|
|
|
}, |
|
|
|
|
|
|
|
//订阅消息 |
|
|
|
showSubscribe (row) { |
|
|
|
this.diaSubVisible = true |
|
|
|
this.$nextTick(() => { |
|
|
|
this.loadSubscribeData(row) // 解决表格错位 |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
//加载列表数据 |
|
|
|
async loadSubscribeData (row) { |
|
|
|
this.dataListLoading = true |
|
|
|
this.selCustomerId = row.customerId |
|
|
|
// const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/subscribe/getcustomerlist', |
|
|
|
const url = '/third/subscribe/getcustomerlist' |
|
|
|
let params = { |
|
|
|
customerId: row.customerId, |
|
|
|
workAppId: this.workAppid, |
|
|
|
resiAppId: this.resiAppid, |
|
|
|
} |
|
|
|
|
|
|
|
const { data, code, msg, internalMsg } = await requestPost(url, params) |
|
|
|
if (code === 0) { |
|
|
|
this.resiDataList = data.resiList |
|
|
|
this.workDataList = data.workList |
|
|
|
|
|
|
|
this.resiTempIdList = [] |
|
|
|
this.workTempIdList = [] |
|
|
|
this.resiDataList.forEach(element => { |
|
|
|
if (element.state === '0') { |
|
|
|
this.resiTempIdList.push(element.priTmplId) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
this.workDataList.forEach(element => { |
|
|
|
if (element.state === '0') { |
|
|
|
this.workTempIdList.push(element.priTmplId) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
this.$message.error(msg + ":" + internalMsg) |
|
|
|
} |
|
|
|
this.dataListLoading = false |
|
|
|
}, |
|
|
|
|
|
|
|
//同步客户的订阅消息为默认订阅消息 |
|
|
|
async syncSubSure () { |
|
|
|
this.$confirm('确认同步客户的订阅消息为默认订阅消息', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.syncSub() |
|
|
|
}).catch(() => { |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
async syncSub () { |
|
|
|
|
|
|
|
this.startLoading() |
|
|
|
const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/subscribe/init' |
|
|
|
// const url = '/third/subscribe/init' |
|
|
|
|
|
|
|
let params = { |
|
|
|
customerId: this.selCustomerId, |
|
|
|
workAppId: this.workAppid, |
|
|
|
resiAppId: this.resiAppid, |
|
|
|
resiTempIdList: this.resiTempIdList, |
|
|
|
workTempIdList: this.workTempIdList, |
|
|
|
} |
|
|
|
|
|
|
|
const { data, code, msg, internalMsg } = await requestPost(url, params) |
|
|
|
if (code === 0) { |
|
|
|
this.$message.success('同步成功') |
|
|
|
} else { |
|
|
|
this.$message.error(msg + ":" + internalMsg) |
|
|
|
} |
|
|
|
this.endLoading() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 订阅消息窗口取消 |
|
|
|
diaSubCancel () { |
|
|
|
this.diaSubVisible = false |
|
|
|
}, |
|
|
|
// 开启加载动画 |
|
|
|
startLoading () { |
|
|
|
loading = Loading.service({ |
|
|
|
@ -290,15 +519,11 @@ export default { |
|
|
|
.aaa { |
|
|
|
height: 100px; |
|
|
|
} |
|
|
|
/* .register .el-table .el-table__header-wrapper { |
|
|
|
.div_btn { |
|
|
|
z-index: 10; |
|
|
|
position: absolute; |
|
|
|
top: 0; |
|
|
|
left: 0; |
|
|
|
}*/ |
|
|
|
/* |
|
|
|
.register .el-table .el-table__fixed-body-wrapper { |
|
|
|
height: calc(100% - 44px); |
|
|
|
margin-top: 44px; |
|
|
|
overflow-y: auto !important; |
|
|
|
} */ |
|
|
|
right: 10px; |
|
|
|
top: 5px; |
|
|
|
/* margin: 0 0 20px 0; */ |
|
|
|
} |
|
|
|
</style> |
|
|
|
|