Browse Source

角色权限;订阅消息

dev
jiangyy 5 years ago
parent
commit
09f2e509dd
  1. 21
      epmet-oper-web/src/js/dai/config.js
  2. 133
      epmet-oper-web/src/js/dai/request.js
  3. 269
      epmet-oper-web/src/views/modules/customer/customize/ConfigItem.vue
  4. 6
      epmet-oper-web/src/views/modules/customer/customize/CustomerList.vue
  5. 54
      epmet-oper-web/src/views/modules/partner/index.vue
  6. 432
      epmet-oper-web/src/views/modules/productConfig/subscribe/MyTemp.vue
  7. 278
      epmet-oper-web/src/views/modules/productConfig/subscribe/TempEdit.vue
  8. 242
      epmet-oper-web/src/views/modules/productConfig/subscribe/TempList.vue

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

@ -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' //以风凌石
}
}

133
epmet-oper-web/src/js/dai/request.js

@ -2,77 +2,86 @@
| 请求接口封装 |
---------------------------------------------------------------*/
import axios from 'axios'
import log from 'dai-js/modules/log';
import curry from 'dai-js/tools/curry';
import log from 'dai-js/modules/log'
import curry from 'dai-js/tools/curry'
const request = curry((method, url, data = {}, headers = {}, progress = () => {}) => {
return new Promise(reslove => {
let returnIniData = {
httpCode: '',
data: {},
msg: '',
code: '',
};
const request = curry(
(method, url, data = {}, headers = {}, progress = () => {}) => {
return new Promise((reslove) => {
let returnIniData = {
httpCode: '',
data: {},
msg: '',
code: ''
}
// 添加服务器端URL
function processUrl(url) {
// 添加服务器端URL
function processUrl(url) {
if (url.indexOf('http://') > -1 || url.indexOf('https://') > -1) {
return url
}
return process.env.VUE_APP_API_SERVER + url
}
if (url.indexOf('http://') > -1 || url.indexOf('https://') > -1) {
return url
}
return process.env.VUE_APP_API_SERVER + url
}
url = processUrl(url)
url = processUrl(url);
const succFn = (res) => {
// log(`[request成功] ${url}`, data, res);
let retData = {
...returnIniData,
...res.data,
httpCode: res.statusCode
}
// if(typeof Vue.$afterRequestHook == 'function'){
// retData = Vue.$afterRequestHook(retData);
// }
const succFn = (res) => {
log(`[request成功] ${url}`, data, res);
let retData = {
...returnIniData,
...res.data,
httpCode: res.statusCode
};
// if(typeof Vue.$afterRequestHook == 'function'){
// retData = Vue.$afterRequestHook(retData);
// }
reslove(retData)
}
reslove(retData);
};
const failFn = (err) => {
// log(`[request失败] ${url}`, data, err);
const failFn = (err) => {
log(`[request失败] ${url}`, data, err);
reslove(
Object.assign({}, returnIniData, {
httpCode: '9999', //访问出现意外
msg: '网络错误'
})
)
}
reslove(Object.assign({}, returnIniData, {
httpCode: '9999', //访问出现意外
msg: '网络错误',
}));
};
if (method.toUpperCase() == 'POST') {
axios
.post(url, data, {
headers,
responseType: 'json'
// progress,
// credentials: false,
})
.then(succFn)
.catch(failFn)
} else {
axios
.get(url, {
params: data,
headers,
responseType: 'json'
// credentials: true,
})
.then(succFn)
.catch(failFn)
}
})
}
)
if (method.toUpperCase() == 'POST') {
axios.post(url, data, {
headers,
responseType: 'json',
// progress,
// credentials: false,
}).then(succFn).catch(failFn);
} else {
axios.get(url, {
params: data,
headers,
responseType: 'json',
// credentials: true,
}).then(succFn).catch(failFn);
}
});
});
export const requestGet = request('get')
export const requestGet = request('get');
export const requestPost = request('post');
export const requestPost = request('post')
export default {
install(Vue) {
Vue.prototype.$requestGet = requestGet;
Vue.prototype.$requestPost = requestPost;
}
};
install(Vue) {
Vue.prototype.$requestGet = requestGet
Vue.prototype.$requestPost = requestPost
}
}

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

@ -13,6 +13,7 @@
</div>
<el-tabs v-model="activeName"
@tab-click="tabChange"
class="el-tabs">
<el-tab-pane label="居民端"
name="resi">
@ -110,7 +111,7 @@
header-align="center"
align="center"
class="operate"
width="200">
width="250">
<template slot-scope="scope">
<el-button v-if="scope.row.shoppingStatus==0"
@ -126,6 +127,10 @@
<el-button size="mini"
type="primary"
@click.stop="editResiShow( scope.$index)">修改</el-button>
<el-button v-if="userType==='oper'"
size="mini"
type="primary"
@click.stop="showPermission( scope.row.functionId)">角色权限</el-button>
</template>
</el-table-column>
@ -275,7 +280,7 @@
header-align="center"
align="center"
class="operate"
width="200">
width="250">
<template slot-scope="scope">
<el-button v-if="scope.row.shoppingStatus==0"
@ -291,6 +296,10 @@
<el-button size="mini"
type="primary"
@click.stop="editWorkShow( scope.$index)">修改</el-button>
<el-button v-if="userType==='oper'"
size="mini"
type="primary"
@click.stop="showPermission( scope.row.functionId)">角色权限</el-button>
</template>
</el-table-column>
@ -347,20 +356,49 @@
</el-tabs>
<c-dialog :title="upOrDownDia.title"
:width="40"
:dialogHeight="0.5"
:width="dialogWidth"
:dialogHeight="dialogHeight"
:visible="upOrDownDia.visible"
@cancel="upOrDownDiaCancel"
@ok="upOrDownDiaOk">
<div style="text-align:center;margin-top:40px">
<el-input type="textarea"
:autosize="{ minRows: 4, maxRows: 7}"
:rows="5"
resize="none"
style="width:500px"
placeholder='请输入理由'
v-model="upOrDownForm.reason">
</el-input>
<div style="margin-top:40px">
<el-form :inline="false"
:model="upOrDownForm"
:rules="formRule"
ref="upOrDownForm"
:label-width="'100px'">
<el-form-item v-if="optionType!=='1'"
label="角色">
<el-checkbox style="width:550px"
:indeterminate="isIndeterminate"
v-model="checkAll"
@change="handleCheckAllChange">全选</el-checkbox>
<el-checkbox-group style="width:550px"
v-model="roleCheckedArray"
@change="handleCheckedCitiesChange">
<el-checkbox v-for="item in roleAllList"
:label="item.roleKey"
:key="item.roleKey">{{item.roleName}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item v-if="optionType!=='3'"
label="理由"
prop="reason">
<el-input type="textarea"
:autosize="{ minRows: 4, maxRows: 7}"
:rows="5"
resize="none"
style="width:400px"
placeholder='请输入理由'
v-model="upOrDownForm.reason">
</el-input>
</el-form-item>
</el-form>
</div>
</c-dialog>
@ -377,8 +415,10 @@ import CDialog from '@c/CDialog'
import ConfigEdit from './ConfigEdit'
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from "@/js/dai/request";
let loading //
const cityOptions = ['上海', '北京', '广州', '深圳'];
export default {
data () {
return {
@ -408,9 +448,18 @@ export default {
customerId: '',
functionId: '',
shoppingStatus: '',
reason: ''
reason: '',
roleList: [],
},
optionType: '' // 1 / 2
// resiRoleList:[],//
// govRoleList:[],//
roleList: {},//
roleAllList: [],//
roleCheckedArray: [],//
checkAll: true,//
isIndeterminate: true,
optionType: '' // 1 / 2 3
}
},
@ -418,6 +467,7 @@ export default {
CDialog, ConfigEdit
},
mounted () {
this.renderSelData()
this.initData(localStorage.getItem('customerId'), localStorage.getItem('customerName'))
},
computed: {
@ -435,28 +485,48 @@ export default {
tableHeight2 () {
return (this.clientHeight - 220) / 2 - 60
},
dialogHeight () {
return 0.8
},
dialogWidth () {
this.resolution === 'small' ? '40%' : '30%'
},
...mapGetters(['clientHeight', 'resolution']),
dataRule () {
formRule () {
return {
customizedName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
functionIcon: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
functionGroup: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
shoppingStatus: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
functionExplain: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
reason: [
{ required: true, message: "请填写理由", trigger: 'blur' }
]
}
}
},
methods: {
async renderSelData () {
this.startLoading()
const url = "/epmetuser/govstaffrole/resigovrolelist"
// const url = "https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/epmetuser/govstaffrole/resigovrolelist"
const params = {}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.roleList = data
this.roleAllList = this.activeName === 'resi' ? data.resiRoleList : data.govRoleList
this.roleAllList.forEach(item => {
this.roleCheckedArray.push(item.roleKey)
})
}
this.endLoading()
},
tabChange (val) {
if (val.name === 'resi') {
this.roleAllList = this.roleList.resiRoleList
} else {
this.roleAllList = this.roleList.govRoleList
}
},
initData (customerId, customerName) {
this.customerId = customerId
this.customerName = customerName
@ -531,27 +601,41 @@ export default {
this.upOrDownDia.visible = false
},
upOrDownDiaOk () {
let url = ''
// const url = '/oper/customize/customerfunctiondetail/updateshoppingstatus'
if (this.optionType === '1') {
// url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfunctiondetail/updateshoppingstatus'
url = '/oper/customize/customerfunctiondetail/updateshoppingstatus'
} else {
// url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfunctiondetail/customerfunctioncollect'
url = '/oper/customize/customerfunctiondetail/customerfunctioncollect'
}
this.startLoading()
this.$refs['upOrDownForm'].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj)
return false
}
let url = ''
// const url = '/oper/customize/customerfunctiondetail/updateshoppingstatus'
if (this.optionType === '3') {
this.savePermission()
return
} else if (this.optionType === '1') {
// url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfunctiondetail/updateshoppingstatus'
url = '/oper/customize/customerfunctiondetail/updateshoppingstatus'
} else if (this.optionType === '2') {
// url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfunctiondetail/customerfunctioncollect'
url = '/oper/customize/customerfunctiondetail/customerfunctioncollect'
}
this.startLoading()
window.app.ajax.post(url, this.upOrDownForm,
(data, rspMsg) => {
this.$message.success('操作成功')
this.upOrDownDia.visible = false
this.loadTableData()
},
(rspMsg, data) => {
this.$message.error(rspMsg)
})
this.endLoading()
window.app.ajax.post(url, this.upOrDownForm,
(data, rspMsg) => {
if (this.optionType === '2') {
this.savePermission()
} else {
this.$message.success('操作成功')
}
this.upOrDownDia.visible = false
this.loadTableData()
this.endLoading()
},
(rspMsg, data) => {
this.$message.error(rspMsg)
})
})
},
//
editResiShow (index) {
@ -565,10 +649,93 @@ export default {
this.loadTableData()
},
//
showPermission (functionId) {
this.optionType = '3'
this.upOrDownDia.title = "角色权限"
this.upOrDownForm = {
customerId: this.customerId,
functionId: functionId,
}
this.getPermission()
this.upOrDownDia.visible = true
},
//
async getPermission () {
this.startLoading()
// const url = "https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfunctionrole/customerfunctionrolelist"
const url = "/oper/customize/customerfunctionrole/customerfunctionrolelist"
// this.upOrDownForm.roleList = roleList
const { data, code, msg } = await requestPost(url, this.upOrDownForm)
if (code === 0) {
this.roleCheckedArray = []
data.forEach(item => {
this.roleCheckedArray.push(item.roleKey)
})
this.endLoading()
}
},
//
async savePermission () {
this.startLoading()
if (this.roleCheckedArray.length === 0) {
this.$message.warning('所选角色数量必须大于1')
return false
}
this.upOrDownForm.roleList = []
this.roleAllList.forEach(allItem => {
this.roleCheckedArray.forEach(selItem => {
let obj = {}
if (selItem === allItem.roleKey) {
obj.roleKey = allItem.roleKey
obj.roleName = allItem.roleName
this.upOrDownForm.roleList.push(obj)
}
})
})
this.upOrDownForm.fromApp = this.activeName
console.log(this.upOrDownForm)
const url = "/oper/customize/customerfunctionrole/savecustomerfunctionrole"
// const url = "https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfunctionrole/savecustomerfunctionrole"
// this.upOrDownForm.roleList = roleList
const { data, code, msg } = await requestPost(url, this.upOrDownForm)
if (code === 0) {
this.$message.success('操作成功')
this.upOrDownDia.visible = false
} else {
this.$message.error(msg)
}
this.endLoading()
},
handleCheckAllChange (val) {
if (val) {
this.roleAllList.forEach(item => {
this.roleCheckedArray.push(item.roleKey)
})
} else {
this.roleCheckedArray = []
}
this.isIndeterminate = false;
},
handleCheckedCitiesChange (value) {
let checkedCount = value.length;
this.checkAll = checkedCount === this.roleAllList.length;
this.isIndeterminate = checkedCount > 0 && checkedCount < this.roleAllList.length;
},
//
addFunction (row) {
this.optionType = '2'
this.upOrDownDia.title = '采集原因'
this.upOrDownDia.title = '采集'
this.upOrDownForm = {
customerId: row.customerId,
functionId: row.functionId,

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

@ -17,6 +17,7 @@
</el-form>
<el-table :data="customerList"
ref="ref_customertable"
border
style="width: 100%;">
<el-table-column label="客户名称"
@ -135,6 +136,11 @@ export default {
this.$nextTick(() => {
this.$refs['ref_footbarlist'].doLayout() //
})
} else if (this.showType === 'list') {
this.$nextTick(() => {
this.$refs['ref_customertable'].doLayout() //
})
}
},

54
epmet-oper-web/src/views/modules/partner/index.vue

@ -1,27 +1,29 @@
<template>
<div>
<el-card shadow="never" class="aui-card--fill">
<el-form :inline="true" :model="tableParams">
<el-card shadow="never"
class="aui-card--fill">
<el-form :inline="true"
:model="tableParams">
<el-form-item>
<el-button type="primary" @click="addShow">新增</el-button>
<el-button type="primary"
@click="addShow">新增</el-button>
</el-form-item>
</el-form>
<c-table
column-type=""
ref="table"
keyword="partner"
:url="tableUrl"
:params="tableParams"
:operationWidth="80"
:operations="operations"
@editShow="editShow"
@del="del"
>
<c-table column-type=""
ref="table"
keyword="partner"
:url="tableUrl"
:params="tableParams"
:operationWidth="80"
:operations="operations"
@editShow="editShow"
@del="del">
</c-table>
</el-card>
<edit ref="edit" @editDiaOK="editDiaOK"></edit>
<edit ref="edit"
@editDiaOK="editDiaOK"></edit>
</div>
</template>
@ -44,7 +46,7 @@ export default {
mixins: [],
components: { CTable, edit },
data() {
data () {
return {
tableUrl: requestUrlPrefix + "/commonservice/externalcustomer/list",
//
@ -78,26 +80,30 @@ export default {
],
};
},
activated () {
this.$nextTick(() => {
this.$refs.table.doLayout() //
})
},
computed: {
tableHeight() {
tableHeight () {
return this.clientHeight - 60 - 80 - 80 - 90;
},
...mapGetters(["clientHeight", "env"]),
},
created() {
created () {
this.refresh();
},
methods: {
//
async refresh() {
async refresh () {
await nextTick();
this.$refs.table.loadData(); //
},
//
addShow() {
addShow () {
const row = {
customerId: "",
customerName: "",
@ -105,16 +111,16 @@ export default {
this.$refs["edit"].init(row, "A");
},
//
editShow(row) {
editShow (row) {
this.$refs["edit"].init(row, "U");
},
del(row) {
del (row) {
this.$message({
type: "error",
message: "无法删除,因为没有提供接口",
});
},
editDiaOK() {
editDiaOK () {
this.refresh();
},
},

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

@ -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>

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

@ -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>

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

@ -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…
Cancel
Save