From aaa863d0f888a22af5d8e7eecad9c634b451b6c9 Mon Sep 17 00:00:00 2001 From: zjj614 <107016099+Zjj614@users.noreply.github.com> Date: Thu, 28 Sep 2023 12:50:45 +0800 Subject: [PATCH] fix: model tips (#190) * fix: error tips * fix: model tips * fix: model run error tip * fix: model run error * fix: model detail error * fix: model type filter --- .../TaskCanvas/RightDrawer/index.vue | 18 +++++++- .../src/components/TaskCanvas/index.vue | 43 ++++++++++++------- .../src/components/TaskModel/index.vue | 10 ++--- primihub-webconsole/src/filters/index.js | 10 +++-- primihub-webconsole/src/router/index.js | 25 +++++++++++ 5 files changed, 79 insertions(+), 27 deletions(-) diff --git a/primihub-webconsole/src/components/TaskCanvas/RightDrawer/index.vue b/primihub-webconsole/src/components/TaskCanvas/RightDrawer/index.vue index e4c69ef05..dbe108f16 100644 --- a/primihub-webconsole/src/components/TaskCanvas/RightDrawer/index.vue +++ b/primihub-webconsole/src/components/TaskCanvas/RightDrawer/index.vue @@ -143,7 +143,7 @@ -

横向联邦需可信第三方(arbiter方)参与

+

{{ flText }}需可信第三方(arbiter方)参与

{{ arbiterOrganName }} 请选择
@@ -353,7 +353,8 @@ export default { { required: true, trigger: 'change' } ] }, - selectedProviderOrgans: [] + selectedProviderOrgans: [], + flText: '' } }, computed: { @@ -416,6 +417,8 @@ export default { } else if (newVal.componentCode === MODEL) { this.getDataSetComValue() this.getModelParams(newVal) + this.flText = this.filterModelValue() + console.log(this.flText) } else if (newVal.componentCode === DATA_ALIGN) { this.getDataSetComValue() this.getFeaturesOptions() @@ -467,6 +470,13 @@ export default { } } }, + filterModelValue() { + if (this.modelTypeValue === '2' || this.modelTypeValue === '5' || this.modelTypeValue === '9') { + return '纵向联邦' + } else { + return '横向联邦' + } + }, getModelParams(data) { const modelType = data.componentTypes.find(item => item.typeCode === MODEL_TYPE) const currentData = modelType && modelType.inputValues.find(item => item.key === modelType.inputValue) @@ -491,11 +501,15 @@ export default { this.modelTypeValue = val // reset before params this.resetModelParams() + this.flText = this.filterModelValue() + console.log(this.flText) this.handleChange() }, handleParamChange(val) { this.modelEncryptionType = val this.getModelParams(this.nodeData) + this.flText = this.filterModelValue() + console.log(this.flText) this.handleChange() }, getFeaturesItem() { diff --git a/primihub-webconsole/src/components/TaskCanvas/index.vue b/primihub-webconsole/src/components/TaskCanvas/index.vue index 1007dade7..b4dbc919d 100644 --- a/primihub-webconsole/src/components/TaskCanvas/index.vue +++ b/primihub-webconsole/src/components/TaskCanvas/index.vue @@ -684,17 +684,35 @@ export default { const initiateCalculationField = initiateResource?.calculationField || [] const providerCalculationField = providerResource?.calculationField || [] + const notSelectResource = value.find(item => item.resourceId === undefined) + const jointStatisticalCom = modelComponents.find(item => item.componentCode === MPC_STATISTICS) if (jointStatisticalCom) { - if (value.find(item => item.resourceId === undefined)) { - this.$message.error('请选择数据集') - this.modelRunValidated = false - return - } this.modelRunValidated = this.checkModelStatisticsValidated(jointStatisticalCom) } - // LR features must select - if (initiateCalculationField && initiateCalculationField.length === 1 && initiateCalculationField.includes('y')) { // has Y + if (!initiateResource) { + this.$message({ + message: '请选择发起方数据集', + type: 'error' + }) + this.modelRunValidated = false + return + } else if (!providerResource) { + this.$message({ + message: '请选择协作方数据集', + type: 'error' + }) + this.modelRunValidated = false + return + } else if (notSelectResource && notSelectResource.participationIdentity === 1) { + this.$message.error('请选择发起方数据集') + this.modelRunValidated = false + return + } else if (notSelectResource && notSelectResource.participationIdentity === 2) { + this.$message.error('请选择协作方数据集') + this.modelRunValidated = false + return + } else if (initiateCalculationField && initiateCalculationField.length === 1 && initiateCalculationField.includes('y')) { // has Y this.$message.error('请选择发起方数据特征') this.modelRunValidated = false return @@ -709,7 +727,7 @@ export default { } // check start node target component is't dataSet const line = modelPointComponents.find(item => item.input.cell === startCom.frontComponentId) - if (line.output.cell !== dataSetCom.frontComponentId) { + if (line && line.output.cell !== dataSetCom.frontComponentId) { this.$message({ message: '流程错误:请先选择数据集组件', type: 'error' @@ -726,7 +744,7 @@ export default { this.modelRunValidated = false return } - if (initiateResource.organId === arbiterOrganId || providerResource.organId === arbiterOrganId) { + if (initiateResource && initiateResource.organId === arbiterOrganId || providerResource && providerResource.organId === arbiterOrganId) { this.$message({ message: '请选择正确的可信第三方(arbiter方)', type: 'error' @@ -772,13 +790,6 @@ export default { type: 'error' }) this.modelRunValidated = false - } else if (!(initiateResource && providerResource)) { - const msg = !initiateResource ? '请选择发起方数据集' : !providerResource ? '请选择协作方数据集' : '请选择数据集' - this.$message({ - message: msg, - type: 'error' - }) - this.modelRunValidated = false } }, async run() { diff --git a/primihub-webconsole/src/components/TaskModel/index.vue b/primihub-webconsole/src/components/TaskModel/index.vue index c033fcae7..e24a661a9 100644 --- a/primihub-webconsole/src/components/TaskModel/index.vue +++ b/primihub-webconsole/src/components/TaskModel/index.vue @@ -78,10 +78,10 @@ -
+
@@ -89,12 +89,12 @@