Browse Source

Merge branch 'preview' into dev

dev
wxz 11 months ago
parent
commit
d267f93771
  1. 16
      epmet-oper-web/src/js/columns/miniPro/partnerApp.js
  2. 46
      epmet-oper-web/src/views/modules/customer/customize/menu-customer-add-or-update.vue
  3. 36
      epmet-oper-web/src/views/modules/customer/customize/menuCustomer.vue
  4. 156
      epmet-oper-web/src/views/modules/partner/app/index.vue

16
epmet-oper-web/src/js/columns/miniPro/partnerApp.js

@ -38,12 +38,12 @@ export default [{
block: true, block: true,
width: 40 width: 40
}, },
{ // {
key: 'secret', // key: 'secret',
title: '秘钥', // title: '秘钥',
display: ['formA', 'formU', 'table', 'model'], // display: ['formA', 'formU', 'table', 'model'],
fixed: false, // fixed: false,
block: true, // block: true,
width: 200 // width: 200
}, // },
] ]

46
epmet-oper-web/src/views/modules/customer/customize/menu-customer-add-or-update.vue

@ -49,10 +49,10 @@ export default {
iconList: [], iconList: [],
iconListVisible: false, iconListVisible: false,
dataForm: { dataForm: {
id: '', id: '', // id
type: 0, type: 0,
name: '', name: '',
pid: '0', pid: '0', // pid
customerId:'', customerId:'',
parentName: '', parentName: '',
url: '', url: '',
@ -91,16 +91,38 @@ export default {
}, },
// //
getInfo () { async getInfo () {
this.$http.get(`/gov/access/govMenuCustomerRelation/${this.dataForm.id}`).then(({ data: res }) => { let {data: epmetRelationResult} = await this.$http.get(`/gov/access/govMenuCustomerRelation/getCustomizedMenuInfo?menuId=${this.dataForm.id}&customerId=${this.dataForm.customerId}`)
if (res.code !== 0) {
return this.$message.error(res.msg) if (epmetRelationResult.code !== 0) {
} this.$message.error("网络错误")
this.dataForm = { return
...this.dataForm, }
...res.data
} if (epmetRelationResult.data !== null) {
}).catch(() => {}) //
this.dataForm.type = epmetRelationResult.data.type
this.dataForm.name = epmetRelationResult.data.name
this.dataForm.pid = epmetRelationResult.data.pid
this.dataForm.parentName = epmetRelationResult.data.parentName
this.dataForm.url = epmetRelationResult.data.url
this.dataForm.useFlag = epmetRelationResult.data.useFlag
this.dataForm.sort = epmetRelationResult.data.sort
this.dataForm.icon = epmetRelationResult.data.icon
} else {
//
let { data: epmeMenuResult } = await this.$http.get(`/gov/access/menu/${this.dataForm.id}`)
this.dataForm.type = epmeMenuResult.data.type
this.dataForm.name = epmeMenuResult.data.name
this.dataForm.pid = epmeMenuResult.data.pid
this.dataForm.parentName = epmeMenuResult.data.parentName
this.dataForm.url = epmeMenuResult.data.url
this.dataForm.useFlag = 1
this.dataForm.sort = epmeMenuResult.data.sort
this.dataForm.icon = epmeMenuResult.data.icon
}
}, },
// , // ,
iconListCurrentChangeHandle (icon) { iconListCurrentChangeHandle (icon) {

36
epmet-oper-web/src/views/modules/customer/customize/menuCustomer.vue

@ -33,6 +33,7 @@
<el-table-column label="序号" fixed="left" type="index" align="center" width="50" /> <el-table-column label="序号" fixed="left" type="index" align="center" width="50" />
<el-table-column prop="name" :label="$t('menu.name')" header-align="center" min-width="150"></el-table-column> <el-table-column prop="name" :label="$t('menu.name')" header-align="center" min-width="150"></el-table-column>
<el-table-column prop="originName" label="原名" header-align="center" min-width="150"></el-table-column>
<el-table-column prop="icon" :label="$t('menu.icon')" header-align="center" align="center"> <el-table-column prop="icon" :label="$t('menu.icon')" header-align="center" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<svg class="icon-svg" aria-hidden="true"><use :xlink:href="`#${scope.row.icon}`"></use></svg> <svg class="icon-svg" aria-hidden="true"><use :xlink:href="`#${scope.row.icon}`"></use></svg>
@ -49,7 +50,7 @@
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> <el-button type="text" size="small" @click="onAddOrUpdateClick(scope.row.id)">{{ $t('update') }}</el-button>
<el-button type="text" size="small" v-if="scope.row.useFlag == '0'" @click="open(scope.row.id)">{{ '开启' }}</el-button> <el-button type="text" size="small" v-if="scope.row.useFlag == '0'" @click="open(scope.row.id)">{{ '开启' }}</el-button>
<el-button type="text" size="small" v-if="scope.row.useFlag == '1'" @click="close(scope.row.id)">{{ '关闭' }}</el-button> <el-button type="text" size="small" v-if="scope.row.useFlag == '1'" @click="close(scope.row.id)">{{ '关闭' }}</el-button>
</template> </template>
@ -298,13 +299,13 @@ export default {
}); });
}, },
open(id) { open(menuId) {
let menuIds = []; let menuIds = [];
this.multipleSelection = []; this.multipleSelection = [];
this.getData(this.dataList); this.getData(this.dataList);
if (id != '') { if (menuId != '') {
menuIds = [id]; menuIds = [menuId];
} else { } else {
if (this.multipleSelection.length > 0) { if (this.multipleSelection.length > 0) {
menuIds = this.multipleSelection; menuIds = this.multipleSelection;
@ -314,8 +315,9 @@ export default {
} }
let params = { let params = {
ids: menuIds, menuIds: menuIds,
use: '1' use: '1',
customerId: this.customerId
}; };
this.$http.post('/gov/access/govMenuCustomerRelation/useUpdate/', params).then(({ data: res }) => { this.$http.post('/gov/access/govMenuCustomerRelation/useUpdate/', params).then(({ data: res }) => {
console.log(res); console.log(res);
@ -325,13 +327,13 @@ export default {
} }
}); });
}, },
close(id) { close(menuId) {
let menuIds = []; let menuIds = [];
this.multipleSelection = []; this.multipleSelection = [];
this.getData(this.dataList); this.getData(this.dataList);
if (id != '') { if (menuId != '') {
menuIds = [id]; menuIds = [menuId];
} else { } else {
if (this.multipleSelection.length > 0) { if (this.multipleSelection.length > 0) {
menuIds = this.multipleSelection; menuIds = this.multipleSelection;
@ -340,8 +342,9 @@ export default {
} }
} }
let params = { let params = {
ids: menuIds, menuIds: menuIds,
use: '0' use: '0',
customerId: this.customerId
}; };
this.$http.post('/gov/access/govMenuCustomerRelation/useUpdate/', params).then(({ data: res }) => { this.$http.post('/gov/access/govMenuCustomerRelation/useUpdate/', params).then(({ data: res }) => {
console.log(res); console.log(res);
@ -407,7 +410,16 @@ export default {
// //
diaCancel() { diaCancel() {
this.$emit('cancleBack'); this.$emit('cancleBack');
} },
onAddOrUpdateClick(menuId) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.dataForm.customerId = this.customerId
this.$refs.addOrUpdate.dataForm.id = menuId
this.$refs.addOrUpdate.init()
})
}
} }
}; };
</script> </script>

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

@ -51,14 +51,41 @@
:operationWidth="80" :operationWidth="80"
:operations="operations" :operations="operations"
@editShow="editShow" @editShow="editShow"
@copySecret="copySecret" @showSecrets="showSecrets"
@resetSecret="resetSecret"
@del="del"> @del="del">
</c-table> </c-table>
</el-card> </el-card>
<edit ref="edit" <edit ref="edit"
@editDiaOK="editDiaOK"></edit> @editDiaOK="editDiaOK"></edit>
<!--密钥查看-->
<el-dialog
title="密钥查看"
:visible.sync="isShowSecretsDlgShow"
width="30%">
<el-form :model="dataForm"
@keyup.enter.native="loadData()">
<el-form-item label="对称加密密钥">
<el-input
type="textarea"
:rows="2"
placeholder="请输入内容"
v-model="secrets.symSecret" readonly>
</el-input>
<el-button @click="resetSymSecret">重置</el-button>
</el-form-item>
<el-form-item label="非对称加密密钥">
<el-input
type="textarea"
:rows="5"
placeholder="请输入内容"
v-model="secrets.asymSecretPublic" readonly>
</el-input>
<el-button @click="resetAsymSecret">重置</el-button>
</el-form-item>
</el-form>
</el-dialog>
</div> </div>
</template> </template>
@ -78,6 +105,7 @@ import { requestPost } from "@/js/dai/request";
import { envIsDev, mockUrlPrefix } from "@/js/dai/config"; import { envIsDev, mockUrlPrefix } from "@/js/dai/config";
import { Loading } from "element-ui"; import { Loading } from "element-ui";
import nextTick from "dai-js/tools/nextTick"; import nextTick from "dai-js/tools/nextTick";
import params from "@/views/modules/sys/params.vue";
// //
const isMockEnv = envIsDev && false; const isMockEnv = envIsDev && false;
@ -89,11 +117,19 @@ export default {
data () { data () {
return { return {
// appId
currAppId: null,
//
isShowSecretsDlgShow: false,
secrets: {
symSecret: null,
asymSecretPublic: null
},
tableUrl: requestUrlPrefix + "/commonservice/externalapp/list", tableUrl: requestUrlPrefix + "/commonservice/externalapp/list",
// //
tableParams: { tableParams: {
customerId: "", customerId: "",
customerType: "internal", customerType: "external",
}, },
operations: [ operations: [
@ -110,30 +146,42 @@ export default {
}, },
}, },
{ {
lable: "复制秘钥", // lable: "查看秘钥", //
size: "mini",
style: "margin: 0 6px;",
type: "text",
slot: "",
plain: false,
methodName: "copySecret", //
isShow: (row) => {
return true;
},
},
{
lable: "重置秘钥", //
size: "mini", size: "mini",
style: "margin: 0 6px;", style: "margin: 0 6px;",
type: "text", type: "text",
slot: "", slot: "",
plain: false, plain: false,
methodName: "resetSecret", // methodName: "showSecrets", //
isShow: (row) => { isShow: (row) => {
return true; return true;
}, },
}, },
// { // {
// lable: "", //
// size: "mini",
// style: "margin: 0 6px;",
// type: "text",
// slot: "",
// plain: false,
// methodName: "copySecret", //
// isShow: (row) => {
// return true;
// },
// },
// {
// lable: "", //
// size: "mini",
// style: "margin: 0 6px;",
// type: "text",
// slot: "",
// plain: false,
// methodName: "resetSecret", //
// isShow: (row) => {
// return true;
// },
// },
// {
// lable: "", // // lable: "", //
// size: "mini", // size: "mini",
// style: "margin: 0 6px;", // style: "margin: 0 6px;",
@ -280,6 +328,80 @@ export default {
editDiaOK () { editDiaOK () {
this.refresh(); this.refresh();
}, },
/**
* 显示密钥
*/
showSecrets(row) {
//
this.currAppId = row.appId
let url = `/commonservice/externalapp/getSecrets`;
let params = {
appId: row.appId
}
window.app.ajax.get(
url,
params,
(data, msg) => {
this.secrets.symSecret = data.symSecret
this.secrets.asymSecretPublic = data.asymSecretPublic
},
(data, msg) => {
})
this.isShowSecretsDlgShow = true
},
/**
* 重置对称加密密钥
*/
resetSymSecret() {
this.$confirm('确认重置?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let url = "/commonservice/externalapp/resetSymSecret";
let params = {
appId: this.currAppId
}
window.app.ajax.post(url, params,
(data, msg) => {
this.$message.success('重置成功')
this.secrets.symSecret = data;
},
(msg, data) => {
this.$message.info('重置失败')
})
})
},
/**
* 重置非对称加密密钥
*/
resetAsymSecret() {
this.$confirm('确认重置?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let url = "/commonservice/externalapp/resetAsymSecrets";
let params = {
appId: this.currAppId
}
window.app.ajax.post(url, params,
(data, msg) => {
this.$message.success('重置成功')
this.secrets.asymSecretPublic = data.publicKey;
},
(msg, data) => {
this.$message.info('重置失败')
})
})
}
}, },
}; };
</script> </script>

Loading…
Cancel
Save