Browse Source

订阅消息

master
jiangyy 5 years ago
committed by 13176889840
parent
commit
fecff3aed9
  1. 2
      epmet-oper-web/src/js/dai/config.js
  2. 43
      epmet-oper-web/src/views/modules/customer/customize/ConfigItem.vue
  3. 368
      epmet-oper-web/src/views/modules/productConfig/subscribe/MyTemp.vue
  4. 221
      epmet-oper-web/src/views/modules/productConfig/subscribe/MyTempList.vue
  5. 247
      epmet-oper-web/src/views/modules/productConfig/subscribe/TempDetail.vue
  6. 162
      epmet-oper-web/src/views/modules/productConfig/subscribe/TempEdit.vue
  7. 78
      epmet-oper-web/src/views/modules/productConfig/subscribe/TempList.vue

2
epmet-oper-web/src/js/dai/config.js

@ -4,7 +4,7 @@ export const mockUrlPrefix =
export const envIsDev = process.env.VUE_APP_NODE_ENV === 'dev' export const envIsDev = process.env.VUE_APP_NODE_ENV === 'dev'
export default { export default {
appid: { appId: {
//开发环境appid //开发环境appid
devResiAppid: 'wx0301bf7f534d97d1', // 风凌石居民端 devResiAppid: 'wx0301bf7f534d97d1', // 风凌石居民端
devWorkAppid: 'wx2679392c4cc2af22', //风凌石工作端 devWorkAppid: 'wx2679392c4cc2af22', //风凌石工作端

43
epmet-oper-web/src/views/modules/customer/customize/ConfigItem.vue

@ -361,7 +361,7 @@
:visible="upOrDownDia.visible" :visible="upOrDownDia.visible"
@cancel="upOrDownDiaCancel" @cancel="upOrDownDiaCancel"
@ok="upOrDownDiaOk"> @ok="upOrDownDiaOk">
<div style="margin-top:40px"> <div style="margin-top:20px">
<el-form :inline="false" <el-form :inline="false"
:model="upOrDownForm" :model="upOrDownForm"
:rules="formRule" :rules="formRule"
@ -418,7 +418,7 @@ import { Loading } from 'element-ui' // 引入Loading服务
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request";
let loading // let loading //
const cityOptions = ['上海', '北京', '广州', '深圳'];
export default { export default {
data () { data () {
return { return {
@ -490,7 +490,7 @@ export default {
}, },
dialogWidth () { dialogWidth () {
this.resolution === 'small' ? '40%' : '30%' return this.resolution === 'small' ? 50 : 40
}, },
...mapGetters(['clientHeight', 'resolution']), ...mapGetters(['clientHeight', 'resolution']),
formRule () { formRule () {
@ -608,13 +608,17 @@ export default {
} }
let url = '' let url = ''
// const url = '/oper/customize/customerfunctiondetail/updateshoppingstatus' // const url = '/oper/customize/customerfunctiondetail/updateshoppingstatus'
if (this.optionType === '3') { if (this.optionType === '3') {//
this.savePermission() this.savePermission()
return return
} else if (this.optionType === '1') { } else if (this.optionType === '1') {//
// url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfunctiondetail/updateshoppingstatus' // url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfunctiondetail/updateshoppingstatus'
url = '/oper/customize/customerfunctiondetail/updateshoppingstatus' url = '/oper/customize/customerfunctiondetail/updateshoppingstatus'
} else if (this.optionType === '2') { } else if (this.optionType === '2') {//
if (this.roleCheckedArray.length === 0) {
this.$message.warning('所选角色数量必须大于1')
return false
}
// url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfunctiondetail/customerfunctioncollect' // url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfunctiondetail/customerfunctioncollect'
url = '/oper/customize/customerfunctiondetail/customerfunctioncollect' url = '/oper/customize/customerfunctiondetail/customerfunctioncollect'
} }
@ -676,17 +680,33 @@ export default {
data.forEach(item => { data.forEach(item => {
this.roleCheckedArray.push(item.roleKey) this.roleCheckedArray.push(item.roleKey)
}) })
this.endLoading() if (this.roleCheckedArray.length === 0) {
this.checkAll = false
this.isIndeterminate = false
} else if (this.roleCheckedArray.length === this.roleAllList.length) {
this.checkAll = true
this.isIndeterminate = false
} else {
this.checkAll = false
this.isIndeterminate = true
}
} else {
this.$message.error(m)
} }
this.endLoading()
}, },
// //
async savePermission () { async savePermission () {
this.startLoading()
if (this.roleCheckedArray.length === 0) { if (this.roleCheckedArray.length === 0) {
this.$message.warning('所选角色数量必须大于1') this.$message.warning('所选角色数量必须大于1')
return false return false
} }
this.startLoading()
this.upOrDownForm.roleList = [] this.upOrDownForm.roleList = []
this.roleAllList.forEach(allItem => { this.roleAllList.forEach(allItem => {
this.roleCheckedArray.forEach(selItem => { this.roleCheckedArray.forEach(selItem => {
@ -727,6 +747,7 @@ export default {
this.isIndeterminate = false; this.isIndeterminate = false;
}, },
handleCheckedCitiesChange (value) { handleCheckedCitiesChange (value) {
let checkedCount = value.length; let checkedCount = value.length;
this.checkAll = checkedCount === this.roleAllList.length; this.checkAll = checkedCount === this.roleAllList.length;
this.isIndeterminate = checkedCount > 0 && checkedCount < this.roleAllList.length; this.isIndeterminate = checkedCount > 0 && checkedCount < this.roleAllList.length;
@ -741,6 +762,12 @@ export default {
functionId: row.functionId, functionId: row.functionId,
reason: '' reason: ''
} }
this.roleCheckedArray = []
this.roleAllList.forEach(item => {
this.roleCheckedArray.push(item.roleKey)
})
this.checkAll = true
this.isIndeterminate = false
this.upOrDownDia.visible = true this.upOrDownDia.visible = true
}, },

368
epmet-oper-web/src/views/modules/productConfig/subscribe/MyTemp.vue

@ -4,57 +4,25 @@
<el-card shadow="never" <el-card shadow="never"
class="aui-card--fill"> class="aui-card--fill">
<el-tabs v-model="activeName" <el-tabs v-model="activeName"
@tab-click="tabClick" @tab-click="tabClick()"
class="el-tabs"> class="el-tabs">
<el-tab-pane label="居民端" <el-tab-pane label="居民端"
name="mine"> name="resi">
<my-temp-list ref="ref_resi"></my-temp-list>
<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>
<el-tab-pane label="工作端" <el-tab-pane label="工作端"
name="public"> name="gov">
<c-table column-type="index" <my-temp-list ref="ref_work"></my-temp-list>
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-tab-pane>
</el-tabs> </el-tabs>
</el-card> </el-card>
<edit ref="ref_edit"
@editDiaOK="editDiaOK">
</edit>
</div> </div>
</template> </template>
<script> <script>
import CDialog from '@c/CDialog' import MyTempList from './MyTempList'
import CTable from '@c/CTableNoPage' import { requestPost } from "@/js/dai/request";
import Edit from './TempEdit'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading import { Loading } from 'element-ui' // Loading
@ -65,147 +33,37 @@ export default {
data () { data () {
return { return {
activeName: 'resi', activeName: 'resi',
customerId: '', // id workAppid: '',
customerName: '', // resiAppid: ''
//
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: { components: {
CDialog, CTable, Edit MyTempList
}, },
mounted () { 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: { methods: {
doLayout () { init (workAppid, resiAppid, clientType) {
this.$nextTick(() => { this.workAppid = workAppid
if (this.activeName === 'gov') { this.resiAppid = resiAppid
this.$refs['table_work'].doLayout() //
} else if (this.activeName === 'resi') { if (clientType) {
this.$refs['table_resi'].doLayout() // this.activeName = clientType
} }
this.tabClick()
})
}, },
tabClick () {
initData (customerId, customerName) { if (this.activeName === 'resi') {
this.customerId = customerId this.$refs['ref_resi'].init(this.resiAppid)
this.customerName = customerName } else if (this.activeName === 'gov') {
this.tableParamsWork.customerId = customerId this.$refs['ref_work'].init(this.workAppid)
this.tableParamsResi.customerId = customerId }
this.loadResiTableData()
}, },
// //
refresh () { refresh () {
@ -215,175 +73,17 @@ export default {
this.loadResiTableData() // this.loadResiTableData() //
} }
}, },
tabClick (tab) { doLayout () {
if (tab.name === 'gov') {
this.loadWorkTableData() //
}
if (tab.name === 'resi') {
this.loadResiTableData() //
}
},
//
loadWorkTableData () {
this.$nextTick(() => {
this.$refs['table_work'].loadData() //
})
},
//
loadResiTableData () {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['table_resi'].loadData() // if (this.activeName === 'gov') {
}) this.$refs['ref_work'].doLayout() //
}, } else if (this.activeName === 'resi') {
// this.$refs['ref_resi'].doLayout() //
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 () { startLoading () {
@ -401,6 +101,12 @@ export default {
} }
} }
}, },
computed: {
tableHeight () {
return this.clientHeight - 60 - 80 - 80
},
...mapGetters(['clientHeight', 'env'])
},
props: { props: {
showFrom: { showFrom: {
type: String, type: String,

221
epmet-oper-web/src/views/modules/productConfig/subscribe/MyTempList.vue

@ -0,0 +1,221 @@
<template>
<div>
<el-table ref="ref_table"
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="kidNames"
label="关键词"
header-align="left"
:min-width="400"
align="left"></el-table-column>
<el-table-column prop="priTmplId"
label="模板ID"
header-align="left"
:min-width="400"
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="detailShow(scope.row)">详情</el-button>
<el-button type="text"
size="small"
@click="showDel(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<temp-detail ref="ref_edit"
@editDiaOK="editDiaOK">
</temp-detail>
</div>
</template>
<script>
import CDialog from '@c/CDialog'
import TempDetail from './TempDetail'
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
let loading//
export default {
data () {
return {
activeName: 'resi',
appIdL: '',//
//
dataListLoading: false,
dataList: []
}
},
components: {
CDialog, TempDetail
},
mounted () {
},
computed: {
tableHeight () {
return this.clientHeight - 60 - 80 - 80
},
...mapGetters(['clientHeight', 'env'])
},
methods: {
doLayout () {
this.$nextTick(() => {
this.$refs['ref_table'].doLayout() //
})
},
init (appId) {
this.appId = appId
this.loadData()
},
//
async loadData () {
this.dataListLoading = true
const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/subscribe/gettemplate'
// const url = '/third/subscribe/gettemplate'
const params = {
appId: this.appId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.dataList = data
} else {
this.$message.error(msg)
}
this.dataListLoading = false
},
//
refresh () {
if (this.activeName === 'gov') {
this.loadWorkTableData() //
} else if (this.activeName === 'resi') {
this.loadResiTableData() //
}
},
//
detailShow (row) {
this.$refs['ref_edit'].init(row)
},
//
showDel (row) {
this.$confirm('确认删除当前模板', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.del(row)
}).catch(() => {
})
},
async del (row) {
this.startLoading()
const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/subscribe/deltemplate'
// const url = '/third/subscribe/deltemplate'
const params = {
appId: this.appId,
priTmplId: row.priTmplId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.$message.success('删除成功')
} else {
this.$message.error(msg)
}
this.endLoading()
},
//
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>

247
epmet-oper-web/src/views/modules/productConfig/subscribe/TempDetail.vue

@ -0,0 +1,247 @@
<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="9">
<div class="div_left_total"
:style="{height:rowHeight}">
<div class=" div_left_title">消息示例</div>
<div class=" div_keywords_sel div_left">
<!-- <div class="div_left_item"
v-for="(item,index) in kidSelNameList"
:key="item">
<el-row :gutter="10">
<el-col style=" text-align: right"
:span="9">
<span>{{item}}:</span>
</el-col>
<el-col :span="15">
<span>{{kidSelExampleList[index]}}</span>
</el-col>
</el-row>
</div> -->
</div>
</div>
</el-col>
<el-col :span="15">
<el-row :gutter="10">
<div class="div_left_item_total">
<el-col style=" text-align: left"
:span="6">
<span class="span_left_item_title">模板ID</span>
</el-col>
<el-col :span="18">
<span class="span_left_item_content">{{dataForm.priTmplId}}</span>
</el-col>
</div>
</el-row>
<el-row :gutter="10">
<div class="div_left_item_total">
<el-col style=" text-align: left"
:span="6">
<span class="span_left_item_title">标题</span>
</el-col>
<el-col :span="18">
<span class="span_left_item_content">{{dataForm.title}}</span>
</el-col>
</div>
</el-row>
<el-row :gutter="10">
<div class="div_left_item_total">
<el-col style=" text-align: left"
:span="6">
<span class="span_left_item_title">类目</span>
</el-col>
<el-col :span="18">
<span class="span_left_item_content">{{'社区/论坛'}}</span>
</el-col>
</div>
</el-row>
<el-row :gutter="10">
<div class="div_left_item_total">
<el-col style=" text-align: left"
:span="6">
<span class="span_left_item_title">详细内容</span>
</el-col>
<el-col :span="18">
<span class="span_left_item_content">{{dataForm.content}}</span>
</el-col>
</div>
</el-row>
<el-row :gutter="10">
<div class="div_left_item_total">
<el-col style=" text-align: left"
:span="6">
<span class="span_left_item_title">场景说明</span>
</el-col>
<el-col :span="18">
<span class="span_left_item_content">{{dataForm.sceneDesc}}</span>
</el-col>
</div>
</el-row>
</el-col>
</el-row>
</div>
</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,
tid: '',//
dataForm: {
priTmplId: '',
title: '',
content: '',
contentShow: [],
example: '',
exampleArray: [],
type: '',
kidNames: '',
kidNamesArray: [],
sceneDesc: ''
}
}
},
created () {
// this.queryFunctionList()
},
methods: {
init (row) {
this.dataForm = row
this.visible = true
this.loadData()
},
loadData () {
let array = this.dataForm.example.split('\\n')
array.forEach(element => {
let oneArray = element.split(':')
let obj = Object
obj.title = oneArray[0]
obj.content = oneArray[1s]
})
this.dataForm.exampleArray =
console.log(this.dataForm.exampleArray)
},
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: {
diaWidth () {
return this.resolution === 'small' ? 80 : 70
},
diaTop () {
return this.resolution === 'small' ? '20px' : '100px'
},
formHeight () {
return this.clientHeight * 0.6
},
rowHeight () {
return (this.formHeight - 70) + 'px'
},
...mapGetters(['clientHeight', 'resolution']),
},
}
</script>
<style scope>
.el-row {
margin-bottom: 0 20px 20px 20px;
}
.el-col {
border-radius: 4px;
}
.div_keywords_sel {
max-height: 250px;
/* overflow-y: auto; */
}
.div_left_total {
margin-left: 20px;
border: 1px solid rgb(199, 199, 199);
border-radius: 5px;
}
.div_left_title {
margin: 10px 10px;
font-size: 18px;
}
.div_left {
margin: 20px 20px 20px 20px;
}
.div_left_item {
background-color: white;
margin: 0 0 10px 0;
padding: 0 0 0 10px;
}
.div_left_item_total {
margin: 10px 0 10px 20px;
color: rgb(121, 121, 121);
font-size: 15px;
}
.span_left_item_content {
color: rgb(31, 31, 31);
font-size: 15px;
}
.span_left_item_title {
padding-left: 40px;
}
</style>

162
epmet-oper-web/src/views/modules/productConfig/subscribe/TempEdit.vue

@ -9,13 +9,34 @@
<div :style="{height:formHeight+'px',overflowY:'auto',overflowX:'hidden'}"> <div :style="{height:formHeight+'px',overflowY:'auto',overflowX:'hidden'}">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="9">
<el-card shadow="never" <el-card shadow="never"
class="box-card"> class="box-card">
<div :style="{height:rowHeight}">111</div> <div :style="{height:rowHeight}">
<div class="div_title">消息示例</div>
<div class=" div_keywords_sel div_left">
<div class="div_left_item"
v-for="(item,index) in kidSelNameList"
:key="item">
<el-row :gutter="10">
<el-col style=" text-align: left"
:span="9">
<span>{{item}}:</span>
</el-col>
<el-col :span="15">
<span>{{kidSelExampleList[index]}}</span>
</el-col>
</el-row>
</div>
</div>
</div>
</el-card> </el-card>
</el-col> </el-col>
<el-col :span="16"> <el-col :span="15">
<el-card shadow="never" <el-card shadow="never"
class="box-card card_right"> class="box-card card_right">
@ -45,9 +66,10 @@
:min="1" :min="1"
:max="5"> :max="5">
<div class="item_width_1 div_checkbox" <div class="item_width_1 div_checkbox"
v-for="item in kidAllName" v-for="(item,index) in kidAllName"
:key="item"> :key="item">
<el-checkbox :label="item">{{item}}</el-checkbox> <el-checkbox @change="function (val) { return checkboxChange(val, item,index)}"
:label="item">{{item}}</el-checkbox>
</div> </div>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
@ -56,12 +78,13 @@
<div class="item_width_1 div_keywords_sel"> <div class="item_width_1 div_keywords_sel">
<div class="item_width_1 div_checkbox_sel" <div class="item_width_1 div_checkbox_sel"
v-for="item in kidSelNameList" v-for="(item,index) in kidSelNameList"
:key="item">{{item}} :key="item">{{item}}
<el-button type="text" <el-button v-if="index>0"
type="text"
class="btn_up" class="btn_up"
@click.stop="moveUp(item)" @click.stop="moveUp(index)"
icon="el-icon-top"></el-button> icon="el-icon-top"></el-button>
</div> </div>
@ -105,19 +128,20 @@ export default {
visible: false, visible: false,
workAppid: '', workAppid: '',
resiAppid: '', resiAppid: '',
tid: '',//
dataForm: { dataForm: {
appId: '', appId: '',
tid: '', tid: '',
sceneDesc: '', sceneDesc: '',
kidList: [] kidList: [],
nameList: []
}, },
kidAllList: [],// kidAllList: [],//
kidAllName: [],//name kidAllName: [],//name
kidSelNameList: [], kidSelNameList: [],//name
kidSelList2: [], kidSelIdList: [],//id
kidSelExampleList: [],//example
} }
}, },
created () { created () {
@ -129,7 +153,7 @@ export default {
this.workAppid = workAppid this.workAppid = workAppid
this.resiAppid = resiAppid this.resiAppid = resiAppid
this.dataForm.appId = resiAppid this.dataForm.appId = resiAppid
this.tid = row.tid this.dataForm.tid = row.tid
this.visible = true this.visible = true
@ -150,49 +174,81 @@ export default {
this.kidAllName.push(item.name) this.kidAllName.push(item.name)
}) })
} else {
this.$message.error(msg)
} }
this.endLoading() this.endLoading()
}, },
moveUp () { moveUp (index) {
this.kidSelNameList.splice(index - 1, 1, ...this.kidSelNameList.splice(index, 1, this.kidSelNameList[index - 1]))
this.kidSelIdList.splice(index - 1, 1, ...this.kidSelIdList.splice(index, 1, this.kidSelIdList[index - 1]))
this.kidSelExampleList.splice(index - 1, 1, ...this.kidSelExampleList.splice(index, 1, this.kidSelExampleList[index - 1]))
console.log(this.kidSelNameList)
console.log(this.kidSelIdList)
console.log(this.kidSelExampleList)
},
checkboxChange (val, item, index) {
// debugger
const kid = this.kidAllList[index].kid
const example = this.kidAllList[index].example
if (val) {
this.kidSelIdList.push(kid)
this.kidSelExampleList.push(example)
} else {
this.kidSelIdList = this.kidSelIdList.filter(idItem => idItem !== kid)
this.kidSelExampleList = this.kidSelExampleList.filter(exampleItem => exampleItem !== example)
}
console.log("kidSelIdList")
console.log(this.kidSelIdList)
console.log("kidSelExampleList")
console.log(this.kidSelExampleList)
}, },
saveForm () { async saveForm () {
this.$refs['dataForm'].validate((valid, messageObj) => { if (this.kidSelIdList.length === 0) {
this.$message.warning('请选择至少一个关键词')
if (!valid) { return false
app.util.validateRule(messageObj) }
} else { if (this.dataForm.sceneDesc === '') {
this.$message.warning('请填写场景描述')
let url = '' return false
if (this.type === 'U') { }
url = '/oper/customize/customerfootbar/updatefootbar' const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/subscribe/addtemplate'
// url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/updatefootbar' // const url = '/third/subscribe/addtemplate'
} else { this.dataForm.kidList = this.kidSelIdList
// url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/createfootbar' this.dataForm.nameList = this.kidSelNameList
url = '/oper/customize/customerfootbar/createfootbar'
this.dataForm.id = '' const { data, code, msg } = await requestPost(url, this.dataForm)
this.dataForm.customerId = 'default' if (code === 0) {
} let clientType = this.dataForm.appId === this.resiAppid ? 'resi' : 'gov'
window.app.ajax.post(url, this.dataForm, this.$emit('editDiaOK', clientType)
(data, rspMsg) => { this.handleClose()
this.$message({ } else {
type: 'success', this.$message.error(msg)
message: '保存成功' }
})
this.$emit('editDiaOK')
this.visible = false
},
(rspMsg, data) => {
this.endLoading()
this.$message.error(rspMsg)
})
}
})
}, },
handleClose () { handleClose () {
this.resetData()
this.visible = false this.visible = false
}, },
//
resetData () {
this.dataForm = {
appId: '',
tid: '',
sceneDesc: '',
kidList: [],
nameList: []
}
this.kidAllList = []//
this.kidAllName = []//name
this.kidSelNameList = []//name
this.kidSelIdList = []//id
this.kidSelExampleList = []//example
},
// //
startLoading () { startLoading () {
@ -229,13 +285,14 @@ export default {
return this.resolution === 'small' ? 80 : 70 return this.resolution === 'small' ? 80 : 70
}, },
diaTop () { diaTop () {
return this.resolution === 'small' ? '30px' : '100px' return this.resolution === 'small' ? '20px' : '100px'
}, },
formHeight () { formHeight () {
return this.clientHeight * 0.6 return this.clientHeight * 0.6
}, },
rowHeight () { rowHeight () {
return (this.formHeight - 70) + 'px' return (this.formHeight - 70) + 'px'
}, },
...mapGetters(['clientHeight', 'resolution']), ...mapGetters(['clientHeight', 'resolution']),
}, },
@ -274,5 +331,14 @@ export default {
float: right; float: right;
margin-right: 10px; margin-right: 10px;
} }
.div_left {
margin: 20px 0 0 0;
}
.div_left_item {
background-color: white;
margin: 0 0 10px 0;
padding: 0 0 0 10px;
}
</style> </style>

78
epmet-oper-web/src/views/modules/productConfig/subscribe/TempList.vue

@ -22,11 +22,16 @@
header-align="left" header-align="left"
:min-width="100" :min-width="100"
align="left"></el-table-column> align="left"></el-table-column>
<el-table-column prop="keyWords" <el-table-column prop="keywordsShow"
label="关键词" label="关键词"
header-align="left" header-align="left"
:min-width="500" :min-width="500"
align="left"></el-table-column> align="left"></el-table-column>
<el-table-column prop="typeShow"
label="类型"
header-align="left"
:min-width="100"
align="left"></el-table-column>
<el-table-column label="操作" <el-table-column label="操作"
fixed="right" fixed="right"
header-align="center" header-align="center"
@ -66,6 +71,7 @@ import CTable from '@c/CTableNoPage'
import MyTemp from './MyTemp' import MyTemp from './MyTemp'
import Edit from './TempEdit' import Edit from './TempEdit'
import config from "@/js/dai/config"; import config from "@/js/dai/config";
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading import { Loading } from 'element-ui' // Loading
@ -80,29 +86,20 @@ export default {
resiAppid: '', resiAppid: '',
// //
pageNo: 1, pageNo: 0,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
tableParams: { tableParams: {
pageNo: this.pageNo, pageNo: 0,
pageSize: this.pageSize pageSize: 10
}, },
// //
// tableUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/customerfootbars', // tableUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/customerfootbars',
tableUrl: '/oper/customize/customerfootbar/customerfootbars4oper', tableUrl: '/oper/customize/customerfootbar/customerfootbars4oper',
dataListLoading: false, dataListLoading: false,
dataList: [ dataList: [],
{
title: '新的评论提醒',
keyWords: ' 文章标题、评论内容、评论时间、取消提醒、评论用户、帖子内容、评论类型、评论人数、备注'
},
{
title: '便民信息审核结果通知 ',
keyWords: ' 审核结果、审核人员、联系电话、审核时间、拒绝理由'
}
],
} }
}, },
@ -112,18 +109,20 @@ export default {
mounted () { mounted () {
this.activeName = 'public' this.activeName = 'mine'
if (this.env === 'test') {// if (this.env === 'test') {//
this.workAppid = config.appid.devWorkAppid this.workAppid = config.appId.devWorkAppid
this.resiAppid = config.appid.devResiAppid this.resiAppid = config.appId.devResiAppid
} else if (this.env === 'prod') {// } else if (this.env === 'prod') {//
this.workAppid = config.appid.testWorkAppid this.workAppid = config.appId.testWorkAppid
this.resiAppid = config.appid.testResiAppid this.resiAppid = config.appId.testResiAppid
} else {// } else {//
this.workAppid = config.appid.devWorkAppid this.workAppid = config.appId.devWorkAppid
this.resiAppid = config.appid.devResiAppid this.resiAppid = config.appId.devResiAppid
} }
this.tabClick()
}, },
computed: { computed: {
@ -135,7 +134,7 @@ export default {
activated () { activated () {
this.$nextTick(() => { this.$nextTick(() => {
if (this.activeName === 'mine') { if (this.activeName === 'mine') {
// this.$refs['table_work'].doLayout() // this.$refs.ref_mytemp.doLayout() //
} else if (this.activeName === 'public') { } else if (this.activeName === 'public') {
this.$refs.ref_publictable.doLayout() // this.$refs.ref_publictable.doLayout() //
} }
@ -145,16 +144,35 @@ export default {
methods: { methods: {
// //
loadData () { async loadData () {
this.dataListLoading = true
const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/subscribe/getpubtemplatetitles'
// const url = '/third/subscribe/getpubtemplatetitles'
this.tableParams.appId = this.workAppid
this.tableParams.ids = '794'
const { data, code, msg } = await requestPost(url, this.tableParams)
if (code === 0) {
this.total = data.total
this.dataList = data.list
this.dataList.forEach(element => {
element.typeShow = element.type === 2 ? '一次性订阅' : '长期订阅'
element.keywordsShow = element.keywords.join()
})
} else {
this.$message.error(msg)
}
this.dataListLoading = false
}, },
tabClick (tab) { tabClick () {
if (tab.name === 'mine') {
if (this.activeName === 'mine') {
this.$refs['ref_mytemp'].init(this.workAppid, this.resiAppid)
} }
if (tab.name === 'public') { if (this.activeName === 'public') {
this.loadData()
} }
}, },
@ -167,8 +185,10 @@ export default {
diaCancel () { diaCancel () {
this.$emit('cancleBack') this.$emit('cancleBack')
}, },
editDiaOK () { editDiaOK (clientType) {
this.refresh() this.activeName = 'mine'
this.$refs['ref_mytemp'].init(this.workAppid, this.resiAppid, clientType)
}, },
editDiaCancel () { editDiaCancel () {

Loading…
Cancel
Save