diff --git a/epmet-oper-web/src/js/dai/config.js b/epmet-oper-web/src/js/dai/config.js index 7750c34..6df826c 100644 --- a/epmet-oper-web/src/js/dai/config.js +++ b/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"; \ No newline at end of file +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' //以风凌石 + } +} diff --git a/epmet-oper-web/src/js/dai/request.js b/epmet-oper-web/src/js/dai/request.js index bc22042..5701ea4 100644 --- a/epmet-oper-web/src/js/dai/request.js +++ b/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; - } -}; \ No newline at end of file + install(Vue) { + Vue.prototype.$requestGet = requestGet + Vue.prototype.$requestPost = requestPost + } +} diff --git a/epmet-oper-web/src/views/modules/customer/customize/ConfigItem.vue b/epmet-oper-web/src/views/modules/customer/customize/ConfigItem.vue index 248c95b..84190b4 100644 --- a/epmet-oper-web/src/views/modules/customer/customize/ConfigItem.vue +++ b/epmet-oper-web/src/views/modules/customer/customize/ConfigItem.vue @@ -13,6 +13,7 @@ @@ -110,7 +111,7 @@ header-align="center" align="center" class="operate" - width="200"> + width="250"> @@ -275,7 +280,7 @@ header-align="center" align="center" class="operate" - width="200"> + width="250"> @@ -347,20 +356,49 @@ -
- - +
+ + + + 全选 + + + {{item.roleName}} + + + + + + + + + +
@@ -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, diff --git a/epmet-oper-web/src/views/modules/customer/customize/CustomerList.vue b/epmet-oper-web/src/views/modules/customer/customize/CustomerList.vue index 47922f6..c9160f2 100644 --- a/epmet-oper-web/src/views/modules/customer/customize/CustomerList.vue +++ b/epmet-oper-web/src/views/modules/customer/customize/CustomerList.vue @@ -17,6 +17,7 @@ { this.$refs['ref_footbarlist'].doLayout() // 解决表格错位 }) + } else if (this.showType === 'list') { + this.$nextTick(() => { + this.$refs['ref_customertable'].doLayout() // 解决表格错位 + }) + } }, diff --git a/epmet-oper-web/src/views/modules/partner/index.vue b/epmet-oper-web/src/views/modules/partner/index.vue index 6ce808a..d959314 100644 --- a/epmet-oper-web/src/views/modules/partner/index.vue +++ b/epmet-oper-web/src/views/modules/partner/index.vue @@ -1,27 +1,29 @@ @@ -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(); }, }, diff --git a/epmet-oper-web/src/views/modules/productConfig/subscribe/MyTemp.vue b/epmet-oper-web/src/views/modules/productConfig/subscribe/MyTemp.vue new file mode 100644 index 0000000..9fc8e90 --- /dev/null +++ b/epmet-oper-web/src/views/modules/productConfig/subscribe/MyTemp.vue @@ -0,0 +1,432 @@ + + + + diff --git a/epmet-oper-web/src/views/modules/productConfig/subscribe/TempEdit.vue b/epmet-oper-web/src/views/modules/productConfig/subscribe/TempEdit.vue new file mode 100644 index 0000000..0f93e2f --- /dev/null +++ b/epmet-oper-web/src/views/modules/productConfig/subscribe/TempEdit.vue @@ -0,0 +1,278 @@ + + + + + + \ No newline at end of file diff --git a/epmet-oper-web/src/views/modules/productConfig/subscribe/TempList.vue b/epmet-oper-web/src/views/modules/productConfig/subscribe/TempList.vue new file mode 100644 index 0000000..2667cdc --- /dev/null +++ b/epmet-oper-web/src/views/modules/productConfig/subscribe/TempList.vue @@ -0,0 +1,242 @@ + + + +