Skip to content

Commit

Permalink
Increase the data flow network (#225)
Browse files Browse the repository at this point in the history
* optimize the display of task error messages too long

* Change the length of the pir task keyword

* Optimized psi task field display

* fix: resource page jump error

* fix: resource type filter

* fix: resource detail loading

* fix: project list tab active index

* feat: data connection

* test

* fix: mpc task party check

* fix: Cannot read properties of undefined (reading 'createNode'

* fix: permission

* fix: delete node error

* Optimize model task

* optimize details

* optimize details
  • Loading branch information
Zjj614 authored Dec 1, 2023
1 parent b831ef2 commit 0421b91
Show file tree
Hide file tree
Showing 17 changed files with 391 additions and 84 deletions.
16 changes: 16 additions & 0 deletions primihub-webconsole/src/api/resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ export function getResourceList(params) {
params
})
}
export function getDataSetList(params) {
return request({
url: '/dataShare/list',
method: 'get',
params
})
}
export function getResourceDetail(resourceId) {
return request({
url: '/data/resource/getdataresource',
Expand All @@ -64,6 +71,15 @@ export function getResourceDetail(resourceId) {
}
})
}
// export function getResourceDetail(resourceId) {
// return request({
// url: '/dataShare/info/{resourceFusionId}',
// method: 'get',
// params: {
// resourceId
// }
// })
// }
export function getOriginList(params) {
return Promise.resolve([])
}
Expand Down
7 changes: 7 additions & 0 deletions primihub-webconsole/src/api/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@ export function getHomepage(params) {
params
})
}
export function getSetting(params) {
return request({
url: `/dataShare/config/get`,
method: 'get',
params
})
}
22 changes: 12 additions & 10 deletions primihub-webconsole/src/components/FlowStep/index.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template>
<div class="step-container">
<div class="step-container" @mouseover="handleStepOver" @mouseleave="showError = false">
<el-steps :active="active" simple finish-status="success" process-status="wait">
<el-step v-for="(step) in data" :key="step.step" icon="el-icon-loading" :title="step.title" :status="step.status" @mouseover.native="handleStepOver(step)" @mouseleave.native="showError = false" />
<el-step v-for="(step) in data" :key="step.step" icon="el-icon-loading" :title="step.title" :status="step.status" />
</el-steps>
<div v-if="showError" class="task-error">
<div v-if="showError" class="task-error" @mouseenter="showError = true">
<p>错误信息:</p>
<p v-for="(item,index) in errorText" :key="index">
{{ item }}
Expand Down Expand Up @@ -39,11 +39,6 @@ export default {
taskError: ''
}
},
mounted() {
},
methods: {
handleStepOver() {
if (this.taskState !== 3) {
Expand All @@ -57,16 +52,23 @@ export default {
</script>

<style lang="scss" scoped>
.step-container{
cursor: pointer;
}
.task-error{
width: 300px;
width: 320px;
padding: 10px;
color: #fff;
background-color: rgba($color: #000000, $alpha: .7);
position: absolute;
top: 40px;
left: calc((100% / 2) - 100px);
max-height: 280px;
left: calc((100% / 2) - 125px);
border-radius: 4px;
font-size: 12px;
word-break: break-all;
overflow-y: scroll;
margin-bottom: 20px;
}
.el-steps--simple{
margin: 5px 0;
Expand Down
2 changes: 1 addition & 1 deletion primihub-webconsole/src/components/TagsInput/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<el-input
v-model.trim="tagValue"
class="tag-input"
maxlength="9"
maxlength="30"
:disabled="disabledInput"
:clearable="true"
show-word-limit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ export default {
})
this.processingType.map((item) => {
const current = this.featureItems.find(feature => feature.type === item.key)
item.disabled = !!current
this.$set(item, 'disabled', !!current)
})
this.handleChange('exception')
},
Expand Down Expand Up @@ -991,7 +991,9 @@ export default {
setFeaturesValue() {
if (this.nodeData.componentTypes[this.featureConfigIndex]) {
this.nodeData.componentTypes[this.featureConfigIndex].inputValue = JSON.stringify(this.featureItems)
this.handleChange()
if (this.options.isEditable) {
this.handleChange()
}
}
}
}
Expand Down
26 changes: 15 additions & 11 deletions primihub-webconsole/src/components/TaskCanvas/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ export default {
// 居中显示画布
// this.graph.centerContent({ padding: { left: 200, top: -200 }})
this.projectId = Number(this.$route.params.id) || 0
this.$emit('mounted')
},
registerStartNode() {
this.startNode = this.components.filter(item => item.componentCode === 'start')[0]
Expand Down Expand Up @@ -648,17 +649,20 @@ export default {
checkModelStatisticsValidated(jointStatisticalCom) {
let featureValues = jointStatisticalCom.componentValues.find(item => item.key === MPC_STATISTICS)?.val
featureValues = featureValues && featureValues !== '' ? JSON.parse(featureValues) : []
console.log('featureValues', featureValues)
const emptyType = featureValues.find(item => item.type === '')
const emptyFeature = featureValues.find(item => item.features[0].checked.length === 0)
if (emptyFeature) {
this.$message.error('联合统计所选统计项特征不能为空,请核验')
return false
} else if (emptyType) {
this.$message.error('联合统计所选统计项不能为空,请核验')
return false
} else {
return true
for (let i = 0; i < featureValues.length; i++) {
const feature = featureValues[i]
if (feature.type === '') {
this.$message.error('联合统计所选统计项不能为空,请核验')
return false
} else if (feature.features.find(item => item.checked.length === 0)) {
this.$message.error('联合统计所选统计项特征不能为空,请核验')
return false
} else if (feature.features.length < 3) {
this.$message.error('联合统计需选择三方特征,请核验')
return false
} else {
return true
}
}
},
checkRunValidated() {
Expand Down
18 changes: 12 additions & 6 deletions primihub-webconsole/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,18 +294,24 @@ export const asyncRoutes = [
component: () => import('@/views/resource/list'),
meta: { title: '我的资源' }
},
{
path: 'derivedDataList',
name: 'DerivedDataList',
component: () => import('@/views/resource/derivedDataList'),
meta: { title: '衍生数据资源' }
},
{
path: 'unionList',
name: 'UnionList',
component: () => import('@/views/resource/unionList'),
meta: { title: '协作方资源' }
},
{
path: 'availableResources',
name: 'AvailableResources',
component: () => import('@/views/resource/availableResources'),
meta: { title: '可申请的资源' }
},
{
path: 'derivedDataList',
name: 'DerivedDataList',
component: () => import('@/views/resource/derivedDataList'),
meta: { title: '衍生数据资源' }
},
{
path: 'create',
name: 'ResourceUpload',
Expand Down
1 change: 1 addition & 0 deletions primihub-webconsole/src/styles/description.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
}
.desc-label{
margin-right: 10px;
min-width: 60px;
}
.desc-content{
flex: 1;
Expand Down
8 changes: 5 additions & 3 deletions primihub-webconsole/src/styles/element-ui.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@
.el-pagination__jump{
margin-left: 0;
}
.el-table .cell{
// line-height: 1.5;
}

.el-table th.el-table__cell{
background-color: #EEEEEE;
color: #333333;
}

.el-message-box__status.el-icon-info{
color: #E6A23C;
}
59 changes: 42 additions & 17 deletions primihub-webconsole/src/views/PSI/task.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,23 @@
:value="item.fieldName"
>
<template slot="default">
<div class="flex justify-content-between">
<span class="option-label">{{ item.fieldName }}</span>
<span class="option-desc">
<el-tooltip class="item" effect="dark" :content="item.fieldDesc" placement="top-start">
<span>{{ item.fieldDesc ? item.fieldDesc.length>8 ? item.fieldDesc.slice(0,8)+'...' : item.fieldDesc : '' }}</span>
</el-tooltip>
</span>
<div class="option-item">
<template v-if="item.fieldDesc">
<div class="option-label" :style="{'max-width': item.fieldDesc ? '200px' : '100%'}">
<el-tooltip class="item" effect="dark" :content="item.fieldName" placement="top-start">
<span>{{ item.fieldName }}</span>
</el-tooltip>
</div>
<div class="option-desc">
<el-tooltip class="item" effect="dark" :content="item.fieldDesc" placement="top-start">
<span>{{ item.fieldDesc ? item.fieldDesc.length>8 ? item.fieldDesc.slice(0,8)+'...' : item.fieldDesc : '' }}</span>
</el-tooltip>
</div>
</template>

<div v-else>
<span class="option-label">{{ item.fieldName }}</span>
</div>
</div>
</template>
</el-option>
Expand All @@ -126,13 +136,23 @@
:value="item.fieldName"
>
<template slot="default">
<div class="flex justify-content-between">
<span class="option-label">{{ item.fieldName }}</span>
<span class="option-desc">
<el-tooltip class="item" effect="dark" :content="item.fieldDesc" placement="top-start">
<span>{{ item.fieldDesc ? item.fieldDesc.length>8 ? item.fieldDesc.slice(0,8)+'...' : item.fieldDesc : '' }}</span>
</el-tooltip>
</span>
<div class="option-item">
<template v-if="item.fieldDesc">
<div class="option-label" :style="{'max-width': item.fieldDesc ? '200px' : '100%'}">
<el-tooltip class="item" effect="dark" :content="item.fieldName" placement="top-start">
<span>{{ item.fieldName }}</span>
</el-tooltip>
</div>
<div class="option-desc">
<el-tooltip class="item" effect="dark" :content="item.fieldDesc" placement="top-start">
<span>{{ item.fieldDesc ? item.fieldDesc.length>8 ? item.fieldDesc.slice(0,8)+'...' : item.fieldDesc : '' }}</span>
</el-tooltip>
</div>
</template>

<div v-else>
<span class="option-label">{{ item.fieldName }}</span>
</div>
</div>
</template>
</el-option>
Expand Down Expand Up @@ -849,16 +869,21 @@ export default {
margin: 30px;
text-align: right;
}
.option-item{
display: flex;
justify-content: space-between;
}
.option-label{
max-width: 120px;
flex-shrink: 0;
max-width: 100%;
// flex-shrink: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.option-desc{
width: 30%;
width: 80px;
color: #999;
margin-left: 10px;
}
.search-input{
width: 300px;
Expand Down
11 changes: 5 additions & 6 deletions primihub-webconsole/src/views/model/create/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div id="stencil" />
</div>
<div class="center-container">
<TaskCanvas :model-id="modelId" :options="taskOptions" :components-detail="componentDetail" @selectComponents="handleSelectComponents" @saveParams="getSaveParams" />
<TaskCanvas ref="canvasRef" :model-id="modelId" :options="taskOptions" :components-detail="componentDetail" @mounted="init" @selectComponents="handleSelectComponents" @saveParams="getSaveParams" />
</div>
</div>
<div class="footer-buttons">
Expand Down Expand Up @@ -88,13 +88,12 @@ export default {
async mounted() {
this.isDraft = this.isEdit ? 1 : 0
this.modelId = Number(this.$route.query.modelId) || 0
await this.init()
},
destroyed() {
clearTimeout(this.taskTimer)
this.selectComponentList = []
this.destroyed = true
window.graph.dispose()
this.graph && this.graph.dispose()
console.log('destroyed model')
},
methods: {
Expand Down Expand Up @@ -252,7 +251,7 @@ export default {
})
},
async init() {
this.graph = window.graph
this.graph = this.$refs.canvasRef.graph
// 获取左侧组件列表
await this.getModelComponentsInfo()
Expand All @@ -265,7 +264,7 @@ export default {
const height = document.querySelector('#stencil').offsetHeight
this.stencil = new Addon.Stencil({
title: '',
target: window.graph,
target: this.graph,
stencilGraphHeight: height,
x: 50,
collapsable: true,
Expand Down Expand Up @@ -301,7 +300,7 @@ export default {
},
initShape() {
const imageNodes = this.componentsList?.map((item) =>
window.graph.createNode({
this.graph.createNode({
id: item.frontComponentId,
componentCode: item.componentCode,
shape: 'dag-node',
Expand Down
2 changes: 1 addition & 1 deletion primihub-webconsole/src/views/project/list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export default {
label: '部分可用'
}],
organList: [],
activeIndex: '0',
activeIndex: '',
listLoading: false,
searchForm: {
projectId: '',
Expand Down
21 changes: 15 additions & 6 deletions primihub-webconsole/src/views/project/taskDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,21 @@ export default {
return status === 0 ? 'status-default el-icon-error' : status === 1 ? 'status-end el-icon-success' : status === 2 ? 'status-processing el-icon-loading' : status === 3 ? 'status-error el-icon-error' : 'status-default el-icon-error'
},
toResourceDetailPage(row) {
this.$router.push({
name: 'UnionResourceDetail',
params: {
id: row.resourceId
}
})
if (row.participationIdentity === 2) {
this.$router.push({
name: 'UnionResourceDetail',
params: {
id: row.resourceId
}
})
} else {
this.$router.push({
name: 'ResourceDetail',
params: {
id: row.resourceId
}
})
}
},
async download() {
const timestamp = new Date().getTime()
Expand Down
Loading

0 comments on commit 0421b91

Please sign in to comment.