Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature milestone2 #121

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion wedpr-web/.env.production
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VUE_APP_BASE_URL = "/api/wedpr/v3"
VUE_APP_MODE = manage
VUE_APP_MODE = agency
13 changes: 9 additions & 4 deletions wedpr-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions wedpr-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"element-china-area-data": "^6.1.0",
"element-ui": "^2.15.8",
"file-saver": "^2.0.5",
"highlight.js": "^11.10.0",
"js-file-download": "^0.4.12",
"jsonwebtoken": "^9.0.2",
"jwt-decode": "^4.0.0",
Expand Down
6 changes: 5 additions & 1 deletion wedpr-web/src/apis/jobManage.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ const queryJobByCondition = (params) => http.post('/project/queryJobByCondition'
const queryProject = (params) => http.post('/project/queryProjectByCondition', params)
// 删除项目
const deleteProject = (params) => http.post('/project/deleteProject', params)
// 终止任务
const killJobs = (params) => http.post('/project/killJobs', params)
// 重试任务
const retryJobs = (params) => http.post('/project/retryJobs', params)
// 查询关注任务
const queryFollowerJobByCondition = (params) => http.post('/project/queryFollowerJobByCondition', params)
// 查询任务进展
const queryJobDetail = (params) => http.get('/scheduler/queryJobDetail', params)
// 管理员查询列表
const adminQueryJobByCondition = (params) => http.post('/project/admin/queryJobByCondition', params)

export default { adminQueryJobByCondition, queryJobByCondition, queryProject, deleteProject, queryFollowerJobByCondition, queryJobDetail }
export default { retryJobs, killJobs, adminQueryJobByCondition, queryJobByCondition, queryProject, deleteProject, queryFollowerJobByCondition, queryJobDetail }
1 change: 1 addition & 0 deletions wedpr-web/src/apis/projectManage.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const adminQueryJobsByDatasetId = (params) => http.get('/admin/queryJobsByDatase
const deleteProject = (params) => http.post('/project/deleteProject', params)
// 提交任务
const submitJob = (params) => http.post('/project/submitJob', params)

const queryJobOverview = (params) => http.post('/project/queryJobOverview', params)
// 审计列表
const queryRecordSyncStatus = (params) => http.post('/sync/queryRecordSyncStatus', params)
Expand Down
3 changes: 3 additions & 0 deletions wedpr-web/src/assets/images/alg/FEATURE_ENGINEERING.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/alg/PREPROCESSING.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions wedpr-web/src/assets/style/index.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import './common.less';
@font-face {
font-display: swap;
font-family: 'PingFangSC-Regular';
src: url('../font/pingfangsc-regular.otf') format('truetype');
}
Expand Down
2 changes: 1 addition & 1 deletion wedpr-web/src/components/approveChain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<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">
<el-form-item label-width="116px" label="本机构用户名:" prop="user">
<el-select loading-text="搜索中" filterable style="width: 209px" v-model="addUserInfo.user" remote :remote-method="getUserNameSelect" placeholder="请选择">
<el-option v-for="item in userNameSelectList" :label="item.label" :value="item.value" :key="item.value"></el-option>
</el-select>
Expand Down Expand Up @@ -80,7 +80,7 @@
},
methods: {
isCurrent(item) {
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 / upload-web (macos-12)

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
},
userValidate(rule, value, callback) {
Expand All @@ -94,7 +94,7 @@
}
},
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 / upload-web (macos-12)

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) {
const { user } = this.addUserInfo
Expand Down
23 changes: 17 additions & 6 deletions wedpr-web/src/components/dataCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
>
</li>
<li v-if="showOwner">
数据属主 <span :title="dataInfo.ownerUserName">{{ dataInfo.ownerUserName }}</span>
所属用户 <span :title="dataInfo.ownerUserName">{{ dataInfo.ownerUserName }}</span>
</li>
<li>
所属机构 <span :title="dataInfo.ownerAgencyName">{{ dataInfo.ownerAgencyName }}</span>
Expand All @@ -38,7 +38,7 @@
<div class="apply" @click.stop="applyData" v-if="!dataInfo.permissions.usable">
<span><img src="~Assets/images/apply.png" alt="" />申请使用</span>
</div>
<div class="apply authed" @click.stop="applyData" v-if="!dataInfo.isOwner && dataInfo.permissions.usable">
<div class="apply authed" v-if="!dataInfo.isOwner && dataInfo.permissions.usable">
<span><img src="~Assets/images/apply_disabled.png" alt="" />申请使用</span>
</div>
</div>
Expand Down Expand Up @@ -95,7 +95,7 @@
style="height: 190px"
class="upload-loading"
v-loading="true"
element-loading-text="数据处理中"
element-loading-text="服务端数据处理中"
element-loading-spinner="el-icon-loading"
element-loading-background="transparent"
></div>
Expand Down Expand Up @@ -138,7 +138,8 @@ export default {
},
data() {
return {
loading: true
loading: true,
uploadType: ['CSV', 'EXCEL']
// checked: false
}
},
Expand All @@ -159,14 +160,24 @@ export default {
showInfo() {
return this.dataInfo.status === dataStatusEnum.Success
},
// 上传失败 需要重试
showReupload() {
return this.dataInfo.status === dataStatusEnum.Failure || this.dataInfo.status === dataStatusEnum.Fatal
},
// 上传中
showUploading() {
return this.dataInfo.status === dataStatusEnum.Created && this.fileUploadTask && this.fileUploadTask.datasetId
if (this.uploadType.includes(this.dataInfo.dataSourceType)) {
return this.dataInfo.status === dataStatusEnum.Created && this.fileUploadTask && this.fileUploadTask.datasetId && this.fileUploadTask.datasetId === this.dataInfo.datasetId
} else {
return false
}
},
// 处理中 只要是created状态 且未在上传分片中 就展示后端处理中
showServerDataHandle() {
return ![dataStatusEnum.Success, dataStatusEnum.Failure, dataStatusEnum.Fatal, dataStatusEnum.Created].includes(this.dataInfo.status)
return (
![dataStatusEnum.Success, dataStatusEnum.Failure, dataStatusEnum.Fatal].includes(this.dataInfo.status) &&
!(this.fileUploadTask && this.fileUploadTask.datasetId && this.fileUploadTask.datasetId === this.dataInfo.datasetId)
)
}
},
methods: {
Expand Down
22 changes: 15 additions & 7 deletions wedpr-web/src/components/serviceCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
<div class="server-con" :key="serviceInfo">
<div class="img-con">
<img class="type" v-if="serviceInfo.serviceType === serviceTypeEnum.PIR" src="~Assets/images/icon_service1.png" alt="" />
<img class="type" v-if="serviceInfo.serviceType === serviceTypeEnum.XGB" src="~Assets/images/icon_service2.png" alt="" />
<img class="type" v-else src="~Assets/images/icon_service2.png" alt="" />

<el-checkbox v-if="serviceInfo.showSelect" @change="handleSelect" :value="selected"></el-checkbox>
</div>

<span class="auth" v-if="serviceInfo.serviceAuthStatus === serviceAuthStatus.Authorized">已授权</span>
<span v-else class="auth" :style="{ backgroundColor: colorMap[serviceInfo.status] }">{{ servicePulishStatus[serviceInfo.status] }}</span>
<span v-if="serviceInfo.isOnwer" class="auth" :style="{ backgroundColor: colorMap[serviceInfo.status] }">{{ servicePulishStatus[serviceInfo.status] }}</span>
<span class="auth" v-if="!serviceInfo.isOnwer && serviceInfo.serviceAuthStatus === serviceAuthStatus.Authorized">已授权</span>
<dl @click="getDetail(serviceInfo)">
<dt>
{{ serviceInfo.serviceName }}
</dt>
<dd>
发布人:<span class="count">{{ serviceInfo.owner }}</span>
发布用户:<span class="count">{{ serviceInfo.owner }}</span>
</dd>
<dd>
发布机构:<span class="count">{{ serviceInfo.agency }}</span>
Expand All @@ -26,7 +25,7 @@
创建时间:<span>{{ serviceInfo.createTime }}</span>
</dd>
</dl>
<div class="edit">
<div class="edit" v-if="showEdit">
<div class="op-con" v-if="serviceInfo.isOnwer">
<img src="~Assets/images/icon_edit.png" alt="" @click.stop="modifyData(serviceInfo)" />
<img @click.stop="deleteService(serviceInfo)" src="~Assets/images/icon_delete.png" alt="" />
Expand All @@ -43,6 +42,7 @@

<script>
import { serviceTypeEnum, serviceAuthStatus, servicePulishStatus } from 'Utils/constant.js'
import { mapGetters } from 'vuex'
export default {
name: 'serviceCard',
props: {
Expand All @@ -53,6 +53,10 @@ export default {
selected: {
type: Boolean,
default: false
},
showEdit: {
type: Boolean,
default: true
}
},
data() {
Expand All @@ -67,7 +71,9 @@ export default {
}
}
},
computed: {},
computed: {
...mapGetters(['userId', 'agencyId'])
},
methods: {
handleSelect(checked) {
this.$emit('selected', checked)
Expand Down Expand Up @@ -101,6 +107,8 @@ div.server-con {
background-color: #f6f8fc;
margin: 20px 16px;
min-width: 240px;
// max-height: 306px;
// overflow: hidden;
position: relative;
::v-deep .el-tag {
padding: 0 12px;
Expand Down
7 changes: 6 additions & 1 deletion wedpr-web/src/mixin/uploadFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
fileReader.readAsArrayBuffer(chunkBlob)
} else {
const identifier = spark.end()
console.info('finished computed hash', identifier, chunkList)

Check warning on line 35 in wedpr-web/src/mixin/uploadFile.js

View workflow job for this annotation

GitHub Actions / build-web (ubuntu-20.04)

Unexpected console statement

Check warning on line 35 in wedpr-web/src/mixin/uploadFile.js

View workflow job for this annotation

GitHub Actions / upload-web (macos-12)

Unexpected console statement

Check warning on line 35 in wedpr-web/src/mixin/uploadFile.js

View workflow job for this annotation

GitHub Actions / build-web (macos-12)

Unexpected console statement
const totalCount = chunkList.length
const reqList = chunkList.map((filesChunk, index) => {
return {
Expand Down Expand Up @@ -119,7 +119,7 @@

function awaitRequest() {
const percentage = parseInt((index / requests.length) * 100)
that.SET_FILEUPLOADTASK({ ...that.fileUploadTask, percentage })
that.SET_FILEUPLOADTASK({ ...that.fileUploadTask, percentage, status: 'pending' })
console.log(percentage, 'percentage')
if (index === requests.length) {
console.log('所有请求已进入promise.all')
Expand All @@ -129,6 +129,7 @@
}

function cancelRequest() {
that.SET_FILEUPLOADTASK({ ...that.fileUploadTask, status: 'fail' })
return Promise.reject(new Error('upload chunk Failed'))
}

Expand All @@ -147,19 +148,23 @@
.then((response) => {
if (response.code === 0) {
// Message.success('上传文件成功')
that.SET_FILEUPLOADTASK({ ...that.fileUploadTask, status: 'success' })
onSuccess && onSuccess()
} else {
that.SET_FILEUPLOADTASK({ ...that.fileUploadTask, status: 'fail' })
// Message.error('上传文件失败!')
onFail && onFail()
}
})
.catch((error) => {
// Message.error('上传文件失败!')
that.SET_FILEUPLOADTASK({ ...that.fileUploadTask, status: 'fail' })
console.log(error)
onFail && onFail()
})
})
.catch((err) => {
that.SET_FILEUPLOADTASK({ ...that.fileUploadTask, status: 'fail' })
onFail && onFail()
Message.error('上传文件失败!')
console.log(err)
Expand Down
28 changes: 23 additions & 5 deletions wedpr-web/src/utils/constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const approveStatusMap = {
Approving: '审批中',
ApproveFailed: '失败',
ApproveRejected: '驳回',
ApproveCanceled: '作废',
ApproveCanceled: '废弃',
ApproveSuccess: '审批完成',
ProgressFailed: '失败',
Progressing: '生效中',
Expand All @@ -18,9 +18,11 @@ export const jobStatusMap = {
RunFailed: '运行失败',
RunSuccess: '运行成功',
WaitToRetry: '等待重试',
WaitToKill: '等待被kill',
Killing: 'kill中',
Killed: '已经被kill'
WaitToKill: '等待被终止',
Killing: '正在终止',
Killed: '已终止',
KillFailed: '终止失败',
ChainInProgress: '上链中'
}
export const opType = {
Authorization: '审批',
Expand Down Expand Up @@ -89,10 +91,26 @@ export const jobEnum = {
MPC: 'MPC'
}

export const settingMap = {
XGB_TRAINING: 'XGB_SETTING',
LR_TRAINING: 'LR_SETTING'
}

// 任务生成的模型
export const modelSettingMap = {
LR_TRAINING: 'LR_MODEL_SETTING',
XGB_TRAINING: 'XGB_MODEL_SETTING'
}
// 创建任务所需模型
export const jobModelSettingMap = {
LR_PREDICTING: 'LR_MODEL_SETTING',
XGB_PREDICTING: 'XGB_MODEL_SETTING'
}

export const serviceTypeEnum = {
PIR: 'pir',
XGB: 'xgb',
lr: 'lr'
LR: 'lr'
}
export const serviceAuthStatus = {
Owner: 'Owner',
Expand Down
6 changes: 3 additions & 3 deletions wedpr-web/src/utils/sessionstore.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const setStore = (name, content) => {
if (typeof content !== 'string') {
content = JSON.stringify(content)
}
window.sessionStorage.setItem(name, content)
window.localStorage.setItem(name, content)
}

/**
Expand All @@ -20,7 +20,7 @@ export const setStore = (name, content) => {
*/
export const getStore = name => {
if (!name) return
const content = window.sessionStorage.getItem(name)
const content = window.localStorage.getItem(name)
if (content !== null) {
try {
return JSON.parse(content)
Expand All @@ -34,5 +34,5 @@ export const getStore = name => {

export const removeStore = name => {
if (!name) return
window.sessionStorage.removeItem(name)
window.localStorage.removeItem(name)
}
17 changes: 12 additions & 5 deletions wedpr-web/src/views/adminDataDetail/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
</div>
<div class="whole">
<div class="half">
<span class="title right">上传时间:</span>
<span class="title">创建时间:</span>
<span class="info" :title="dataInfo.createTcreateAtime"> {{ dataInfo.createAt }} </span>
</div>
<div class="half">
<span class="title">字段:</span>
<span class="title right">字段:</span>
<span class="info" :title="dataInfo.datasetFields"> {{ dataInfo.datasetFields }} </span>
</div>
</div>
Expand All @@ -56,8 +56,8 @@
<div class="title-radius">使用记录</div>
<div class="tableContent autoTableWrap" v-if="total">
<el-table :max-height="tableHeight" size="small" v-loading="loadingFlag" :data="tableData" :border="true" class="table-wrap">
<el-table-column label="任务ID" prop="id" />
<el-table-column label="所属项目" prop="projectName" />
<el-table-column label="任务ID" prop="id" show-overflow-tooltip />
<el-table-column label="所属项目" prop="projectName" show-overflow-tooltip />
<el-table-column label="发起机构" prop="ownerAgency" />
<el-table-column label="参与机构" prop="participate" />
<el-table-column label="发起用户" prop="owner" />
Expand All @@ -83,9 +83,13 @@ import { dataManageServer, projectManageServer } from 'Api'
import { tableHeightHandle } from 'Mixin/tableHeightHandle.js'
import { mapGetters } from 'vuex'
import { jobStatusMap } from 'Utils/constant.js'
import wePagination from '@/components/wePagination.vue'
export default {
name: 'dataDetail',
mixins: [tableHeightHandle],
components: {
wePagination
},
data() {
return {
dataInfo: {
Expand Down Expand Up @@ -157,7 +161,10 @@ export default {
})
}
},
paginationHandle() {}
paginationHandle(pageData) {
this.pageData = { ...pageData }
this.adminQueryJobsByDatasetId()
}
}
}
</script>
Expand Down
Loading
Loading