Skip to content

Commit

Permalink
Merge pull request #48 from huangfei1994/feature-milestone2
Browse files Browse the repository at this point in the history
wedpr-web 优化管理端功能,优化创建任务流程
  • Loading branch information
huangfei1994 authored Sep 10, 2024
2 parents 27b2ac2 + 75476af commit 9826dc3
Show file tree
Hide file tree
Showing 26 changed files with 371 additions and 291 deletions.
1 change: 1 addition & 0 deletions wedpr-web/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DS_Store
node_modules
/dist
/manage


# local env files
Expand Down
3 changes: 2 additions & 1 deletion wedpr-web/src/apis/settingManage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import http from '../utils/http'
// 获取配置
const querySettings = (params) => http.post('/setting/querySettings', params)
const getConfig = (params) => http.get('/config/getConfig', params)
const adminGetConfig = (params) => http.get('/admin/getConfig', params)
const queryAgencyMetas = (params) => http.post('/meta/agency/queryAgencyMetas', params)
// 保存配置 自定义类型
const insertSettings = (params) => http.post('/setting/insertSettings', params)
// 获取公钥
const getPub = (params) => http.get('/pub', params)
const getImageCode = (params) => http.get('/image-code', params)
export default { insertSettings, getPub, getImageCode, querySettings, getConfig, queryAgencyMetas }
export default { adminGetConfig, insertSettings, getPub, getImageCode, querySettings, getConfig, queryAgencyMetas }
3 changes: 3 additions & 0 deletions wedpr-web/src/assets/images/hide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions wedpr-web/src/assets/images/show.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions wedpr-web/src/assets/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,36 @@ div.upload-loading {
color: #787b84;
}
}

.scopeSwitch .el-switch__label {
position: absolute;
display: none;
color: #fff;
}

/*打开时文字位置设置*/
.scopeSwitch .el-switch__label--right {
z-index: 1;
right: -8px; /*不同场景下可能不同,自行调整*/
font-size: 12px;
color: #fff;
}
/*关闭时文字位置设置*/
.scopeSwitch .el-switch__label--left {
z-index: 1;
left: 20px; /*不同场景下可能不同,自行调整*/
font-size: 12px;
color: #fff;
}
.scopeSwitch .el-switch__label.is-active {
font-size: 12px;
color: #fff;
}
/*显示文字*/
.scopeSwitch .el-switch__label.is-active {
display: block;
}
.scopeSwitch.el-switch .el-switch__core,
.el-switch .el-switch__label {
width: 56px !important; /*开关按钮的宽度大小*/
}
27 changes: 21 additions & 6 deletions wedpr-web/src/components/approveChain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<span class="current" v-if="isCurrent(item)">审批中</span>
<span v-if="item.deleteAble" @click="deleteUser(i)" class="close">x</span>
</div>
<div class="connect">
<div class="connect" v-if="showAdd && !item.addNextUserDisbaled">
<span class="point"></span> <span class="line"></span>
<el-popover v-if="showAdd" v-model="item.visible" placement="top-start" width="363" trigger="click">
<el-popover v-model="item.visible" placement="top-start" width="363" trigger="click">
<p style="margin-bottom: 20px">添加审批节点</p>
<el-form :inline="false" :rules="userInfoRules" :model="addUserInfo" ref="addUserInfo" size="small">
<el-form-item label-width="116px" label="本机构用户ID:" prop="user">
Expand All @@ -17,14 +17,15 @@
</el-select>
</el-form-item>
<div style="text-align: right">
<el-button>取消</el-button>
<el-button type="primary" @click="addUserToChain(i)">确定</el-button>
<el-button @click="cancelAdd(item)">取消</el-button>
<el-button type="primary" @click="addUserToChain(i, item)">确定</el-button>
</div>
</el-form>
<img slot="reference" src="~Assets/images/add.png" alt="" />
</el-popover>
<span class="line"></span> <span class="point right"></span>
</div>
<div class="connect" v-else><span class="point"></span> <span class="line"></span> <span class="line"></span> <span class="point right"></span></div>
</div>
</div>
</template>
Expand Down Expand Up @@ -57,7 +58,7 @@ export default {
},
userInfoRules: {
agency: [{ required: true, message: '机构不能为空', trigger: 'blur' }],
user: [{ required: true, message: '审批人不能为空', trigger: 'blur' }]
user: [{ required: true, trigger: 'blur', validator: this.userValidate }]
},
statusMap: {
Agree: '已审批',
Expand All @@ -82,7 +83,17 @@ export default {
console.log(this.currentApply)

Check warning on line 83 in wedpr-web/src/components/approveChain.vue

View workflow job for this annotation

GitHub Actions / build-web (ubuntu-20.04)

Unexpected console statement

Check warning on line 83 in wedpr-web/src/components/approveChain.vue

View workflow job for this annotation

GitHub Actions / build-web (macos-12)

Unexpected console statement
return item.agency + '_' + item.name === this.currentApply
},
addUserToChain(index) {
userValidate(rule, value, callback) {
if (value) {
if (this.approveChainList.some((v) => v.name === value && v.agency === this.agencyId)) {
return callback(new Error('审批人已存在当前审批链'))
}
callback()
} else {
return callback(new Error('请选择审批人'))
}
},
addUserToChain(index, item) {
console.log(this.$refs.addUserInfo)

Check warning on line 97 in wedpr-web/src/components/approveChain.vue

View workflow job for this annotation

GitHub Actions / build-web (ubuntu-20.04)

Unexpected console statement

Check warning on line 97 in wedpr-web/src/components/approveChain.vue

View workflow job for this annotation

GitHub Actions / build-web (macos-12)

Unexpected console statement
this.$refs.addUserInfo[0].validate((valid) => {
if (valid) {
Expand All @@ -91,13 +102,17 @@ export default {
data.splice(index + 1, 0, { agency: this.agencyId, name: user, deleteAble: true, visible: false })
this.$emit('addUserToChain', data)
this.user = ''
item.visible = false
}
})
},
deleteUser(index) {
const data = [...this.approveChainList]
data.splice(index, 1)
this.$emit('deleteUser', data)
},
cancelAdd(item) {
item.visible = false
}
}
}
Expand Down
12 changes: 8 additions & 4 deletions wedpr-web/src/utils/constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,25 +112,29 @@ export const algListFull = [
label: '隐私求交',
value: 'PSI',
src: require('../assets/images/psi_job.png'),
jobSrc: require('../assets/images/PSI.png')
jobSrc: require('../assets/images/PSI.png'),
participateNumber: 2
},
{
label: 'SecureLGBM训练',
value: 'XGB_TRAINING',
src: require('../assets/images/xgbtrain_job.png'),
jobSrc: require('../assets/images/XGB.png')
jobSrc: require('../assets/images/XGB.png'),
participateNumber: 1
},
{
label: 'SecureLGBM预测',
value: 'XGB_PREDICTING',
src: require('../assets/images/xgbpredict_job.png'),
jobSrc: require('../assets/images/XGB_2.png')
jobSrc: require('../assets/images/XGB_2.png'),
participateNumber: 1
},
{
label: '连表SQL分析',
value: 'SQL',
src: require('../assets/images/SQL.png'),
jobSrc: require('../assets/images/SQL.png')
jobSrc: require('../assets/images/SQL.png'),
participateNumber: 3
},
// {
// label: '多方XGB建模',
Expand Down
8 changes: 8 additions & 0 deletions wedpr-web/src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,11 @@ export function handleParamsValid(params) {
})
return validParams
}

export function maskString(str) {
if (str.length <= 8) return str.replace(/./g, '*')
const start = str.slice(0, 4)
const end = str.slice(-4)
const masked = str.slice(4, -4)
return start + masked.replace(/./g, '*') + end
}
25 changes: 22 additions & 3 deletions wedpr-web/src/views/accessKeyManage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@
</ul>
<ul>
<li>Access Secret:</li>
<li>{{ accessInfo.accessKeySecret }}</li>
<li>
{{ showSercret ? accessInfo.accessKeySecret : maskString(accessInfo.accessKeySecret) }}
<img v-if="showSercret" @click="hideSecretStr" src="~Assets/images/hide.png" alt="" />
<img @click="openSecretStr" v-else src="~Assets/images/show.png" alt="" />
</li>
</ul>
</div>
</div>
Expand All @@ -95,7 +99,7 @@
import { accessKeyManageServer } from 'Api'
import wePagination from '@/components/wePagination.vue'
import { tableHeightHandle } from 'Mixin/tableHeightHandle.js'
import { handleParamsValid } from 'Utils/index.js'
import { handleParamsValid, maskString } from 'Utils/index.js'
export default {
name: 'accessKeyManage',
mixins: [tableHeightHandle],
Expand Down Expand Up @@ -132,7 +136,9 @@ export default {
accessInfo: {
accessKeyID: '',
accessKeySecret: ''
}
},
showSercret: false,
maskString
}
},
created() {
Expand All @@ -142,6 +148,12 @@ export default {
showAddKey() {
this.showAddModal = true
},
hideSecretStr() {
this.showSercret = false
},
openSecretStr() {
this.showSercret = true
},
openCopyModal(accessData) {
this.showCopyModal = true
const { accessKeyID, accessKeySecret } = accessData
Expand Down Expand Up @@ -292,6 +304,13 @@ div.access-manage {
}
li:last-child {
flex: 1;
img {
vertical-align: middle;
width: 20px;
height: auto;
margin-left: 10px;
cursor: pointer;
}
}
}
ul:first-child {
Expand Down
2 changes: 1 addition & 1 deletion wedpr-web/src/views/adminDataDetail/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</div>
<div class="half">
<span class="title right">特征量:</span>
<span class="info" :title="dataInfo.columCount"> {{ dataInfo.columCount }} </span>
<span class="info" :title="dataInfo.columnCount"> {{ dataInfo.columnCount }} </span>
</div>
</div>
<div class="whole">
Expand Down
14 changes: 12 additions & 2 deletions wedpr-web/src/views/adminLogManage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="group-manage" style="position: relative; height: 100%">
<div class="form-search">
<el-form :inline="true" @submit="queryHandle" :model="searchForm" ref="searchForm" size="small">
<el-form-item prop="resourceType" label="发起机构:">
<el-form-item prop="ownerAgencyName" label="发起机构:">
<el-select clearable size="small" style="width: 160px" v-model="searchForm.ownerAgencyName" placeholder="请选择">
<el-option :key="item" v-for="item in agencyList" multiple :label="item.label" :value="item.value"></el-option>
</el-select>
Expand All @@ -23,7 +23,15 @@
</el-select>
</el-form-item>
<el-form-item prop="createTime" label="生成时间:">
<el-date-picker value-format="yyyy-MM-dd" v-model="searchForm.createTime" type="daterange" range-separator="" start-placeholder="开始日期" end-placeholder="结束日期" />
<el-date-picker
style="width: 344px"
value-format="yyyy-MM-dd hh:mm:ss"
v-model="searchForm.createTime"
type="datetimerange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" :loading="queryFlag" @click="queryHandle">
Expand All @@ -48,6 +56,8 @@
{{ actionMap[scope.row.resourceAction] || '--' }}
</template>
</el-table-column>
<el-table-column show-overflow-tooltip label="操作机构" prop="agency" />
<el-table-column show-overflow-tooltip label="操作人" prop="trigger" />
<el-table-column show-overflow-tooltip label="操作时间" prop="createTime" />
<el-table-column label="操作状态" prop="status">
<template v-slot="scope">
Expand Down
4 changes: 2 additions & 2 deletions wedpr-web/src/views/adminLogin/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ export default {
})
this.SET_AGENCYLIST(agencyListSelect)
this.$router.push({ path: '/agencyManage' })
// this.getConfigAlgList()
this.getConfigAlgList()
}
},
async getConfigAlgList() {
const res = await settingManageServer.getConfig({ key: 'wedpr_algorithm_templates' })
const res = await settingManageServer.adminGetConfig({ key: 'wedpr_algorithm_templates' })
if (res.code === 0 && res.data) {
const realData = JSON.parse(res.data)
const supportAlg = realData.templates.map((v) => v.name)
Expand Down
Loading

0 comments on commit 9826dc3

Please sign in to comment.