From 64521e16698f24cbb858a153f402144ce88f97b3 Mon Sep 17 00:00:00 2001 From: flyhuang Date: Thu, 31 Oct 2024 15:58:52 +0800 Subject: [PATCH 1/2] =?UTF-8?q?wedpr-web=E4=BF=AE=E5=A4=8Dbug=E5=92=8C?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wedpr-web/.env.production | 2 +- wedpr-web/package-lock.json | 13 +- wedpr-web/package.json | 1 + wedpr-web/src/apis/jobManage.js | 6 +- wedpr-web/src/apis/projectManage.js | 1 + wedpr-web/src/components/approveChain.vue | 2 +- wedpr-web/src/components/dataCard.vue | 4 +- wedpr-web/src/components/serviceCard.vue | 22 +- wedpr-web/src/utils/constant.js | 28 +- wedpr-web/src/views/adminDataDetail/index.vue | 17 +- wedpr-web/src/views/adminDataManage/index.vue | 2 +- .../src/views/adminProjectDetail/index.vue | 17 +- .../src/views/adminProjectManage/index.vue | 19 +- wedpr-web/src/views/agencyCreate/index.vue | 11 +- wedpr-web/src/views/approveDetail/index.vue | 48 ++- wedpr-web/src/views/dataApply/index.vue | 6 + wedpr-web/src/views/dataApplyModify/index.vue | 8 +- wedpr-web/src/views/dataCreate/index.vue | 9 +- wedpr-web/src/views/dataDetail/index.vue | 24 +- wedpr-web/src/views/dataManage/index.vue | 36 +- wedpr-web/src/views/home/index.vue | 17 +- wedpr-web/src/views/home/modifyUser/index.vue | 2 +- wedpr-web/src/views/jobDetail/index.vue | 371 +++++++++--------- wedpr-web/src/views/layout/menuLeft/index.vue | 2 +- .../src/views/layout/modifyPassword/index.vue | 4 +- .../src/views/leadMode/dataSelect/index.vue | 11 +- wedpr-web/src/views/leadMode/index.vue | 69 +++- .../src/views/leadMode/modelSelect/index.vue | 31 +- .../views/leadMode/serviceSelect/index.vue | 1 + .../src/views/modelServerCreate/index.vue | 17 +- wedpr-web/src/views/projectDetail/index.vue | 108 ++++- wedpr-web/src/views/projectManage/index.vue | 143 +++++-- wedpr-web/src/views/register/index.vue | 20 +- wedpr-web/src/views/resetParams/index.vue | 16 +- wedpr-web/src/views/screen/chartsSetting.js | 33 +- wedpr-web/src/views/serverDetail/index.vue | 20 + wedpr-web/src/views/serverManage/index.vue | 34 +- 37 files changed, 812 insertions(+), 363 deletions(-) diff --git a/wedpr-web/.env.production b/wedpr-web/.env.production index a0bd6007..4ba4d2de 100644 --- a/wedpr-web/.env.production +++ b/wedpr-web/.env.production @@ -1,2 +1,2 @@ VUE_APP_BASE_URL = "/api/wedpr/v3" -VUE_APP_MODE = manage \ No newline at end of file +VUE_APP_MODE = agency \ No newline at end of file diff --git a/wedpr-web/package-lock.json b/wedpr-web/package-lock.json index 1fb20909..441c4838 100644 --- a/wedpr-web/package-lock.json +++ b/wedpr-web/package-lock.json @@ -3234,6 +3234,12 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "highlight.js": { + "version": "10.7.3", + "resolved": "https://registry.npmmirror.com/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", + "dev": true + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", @@ -5662,10 +5668,9 @@ "dev": true }, "highlight.js": { - "version": "10.7.3", - "resolved": "https://registry.npmmirror.com/highlight.js/-/highlight.js-10.7.3.tgz", - "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", - "dev": true + "version": "11.10.0", + "resolved": "https://registry.npmmirror.com/highlight.js/-/highlight.js-11.10.0.tgz", + "integrity": "sha512-SYVnVFswQER+zu1laSya563s+F8VDGt7o35d4utbamowvUNLLMovFqwCLSocpZTz3MgaSRA1IbqRWZv97dtErQ==" }, "hmac-drbg": { "version": "1.0.1", diff --git a/wedpr-web/package.json b/wedpr-web/package.json index 04f10ec3..437c7abd 100644 --- a/wedpr-web/package.json +++ b/wedpr-web/package.json @@ -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", diff --git a/wedpr-web/src/apis/jobManage.js b/wedpr-web/src/apis/jobManage.js index a69af74b..315f8f1b 100644 --- a/wedpr-web/src/apis/jobManage.js +++ b/wedpr-web/src/apis/jobManage.js @@ -6,6 +6,10 @@ 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) // 查询任务进展 @@ -13,4 +17,4 @@ 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 } diff --git a/wedpr-web/src/apis/projectManage.js b/wedpr-web/src/apis/projectManage.js index 75b212cf..cee4de24 100644 --- a/wedpr-web/src/apis/projectManage.js +++ b/wedpr-web/src/apis/projectManage.js @@ -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) diff --git a/wedpr-web/src/components/approveChain.vue b/wedpr-web/src/components/approveChain.vue index 352a45a8..dc83da3b 100644 --- a/wedpr-web/src/components/approveChain.vue +++ b/wedpr-web/src/components/approveChain.vue @@ -11,7 +11,7 @@

添加审批节点

- + diff --git a/wedpr-web/src/components/dataCard.vue b/wedpr-web/src/components/dataCard.vue index 94f563ff..1d7d7deb 100644 --- a/wedpr-web/src/components/dataCard.vue +++ b/wedpr-web/src/components/dataCard.vue @@ -17,7 +17,7 @@ >
  • - 数据属主 {{ dataInfo.ownerUserName }} + 所属用户 {{ dataInfo.ownerUserName }}
  • 所属机构 {{ dataInfo.ownerAgencyName }} @@ -38,7 +38,7 @@
    申请使用
    -
    +
    申请使用
    diff --git a/wedpr-web/src/components/serviceCard.vue b/wedpr-web/src/components/serviceCard.vue index 188c11ad..ed3e6304 100644 --- a/wedpr-web/src/components/serviceCard.vue +++ b/wedpr-web/src/components/serviceCard.vue @@ -2,19 +2,18 @@
    - +
    - - 已授权 - {{ servicePulishStatus[serviceInfo.status] }} + {{ servicePulishStatus[serviceInfo.status] }} + 已授权
    {{ serviceInfo.serviceName }}
    - 发布人:{{ serviceInfo.owner }} + 发布用户:{{ serviceInfo.owner }}
    发布机构:{{ serviceInfo.agency }} @@ -26,7 +25,7 @@ 创建时间:{{ serviceInfo.createTime }}
    -
    +
    @@ -43,6 +42,7 @@ diff --git a/wedpr-web/src/views/adminDataManage/index.vue b/wedpr-web/src/views/adminDataManage/index.vue index 611a700a..4ad3ccd3 100644 --- a/wedpr-web/src/views/adminDataManage/index.vue +++ b/wedpr-web/src/views/adminDataManage/index.vue @@ -10,7 +10,7 @@ - + {{ dataInfo.name }}
    +
    +
    + 项目ID: + {{ dataInfo.id }} +
    +
    项目简介: - {{ dataInfo.desc }} + {{ dataInfo.projectDesc }}
    @@ -121,7 +127,8 @@ export default { }, jobStatusList, jobStatusMap, - pageMode: process.env.VUE_APP_MODE + pageMode: process.env.VUE_APP_MODE, + projectName: '' } }, created() { @@ -179,7 +186,7 @@ export default { // 获取任务列表 async queryJobByCondition() { this.loadingFlag = true - const { name: projectName } = this.dataInfo + const { id } = this.dataInfo const { page_offset, page_size } = this.pageData const { jobType, status, createTime } = this.searchForm const params = handleParamsValid({ jobType, status }) @@ -187,8 +194,8 @@ export default { params.startTime = createTime[0] params.endTime = createTime[1] } - params.ownerAgency = this.dataInfo.ownerAgency - const res = await projectManageServer.adminQuerylistJobInProject({ projectName, ...params, pageNum: page_offset, pageSize: page_size }) + // params.ownerAgency = this.dataInfo.ownerAgency + const res = await projectManageServer.adminQuerylistJobInProject({ projectId: id, ...params, pageNum: page_offset, pageSize: page_size }) this.loadingFlag = false if (res.code === 0 && res.data) { const { jobList = [], total } = res.data diff --git a/wedpr-web/src/views/adminProjectManage/index.vue b/wedpr-web/src/views/adminProjectManage/index.vue index f6e36e82..d19d90cb 100644 --- a/wedpr-web/src/views/adminProjectManage/index.vue +++ b/wedpr-web/src/views/adminProjectManage/index.vue @@ -28,6 +28,9 @@ {{ queryFlag ? '查询中...' : '查询' }} + + 重置 +
    @@ -40,20 +43,6 @@
    {{ item.name }}
    -
    -
    -
    所属机构
    -
    {{ item.ownerAgency }}
    -
    -
    -
    所属用户
    -
    {{ item.owner }}
    -
    -
    -
    创建时间
    -
    {{ item.createTime }}
    -
    -
    • 所属机构 {{ item.ownerAgency }} @@ -181,7 +170,7 @@ export default { this.tableData = projectList.map((v) => { return { ...v, - randomIndex: Math.ceil(v.id % 7) + randomIndex: (v.id % 7) + 1 } }) this.total = total diff --git a/wedpr-web/src/views/agencyCreate/index.vue b/wedpr-web/src/views/agencyCreate/index.vue index c29c33b3..b7d6f295 100644 --- a/wedpr-web/src/views/agencyCreate/index.vue +++ b/wedpr-web/src/views/agencyCreate/index.vue @@ -41,7 +41,7 @@ export default { agencyDesc: [{ required: true, message: '机构简介不能为空', trigger: 'blur' }], agencyContact: [{ required: true, message: '机构联系人不能为空', trigger: 'blur' }], contactPhone: [{ required: true, message: '机构联系方式不能为空', trigger: 'blur' }], - gatewayEndpoint: [{ required: true, message: '机构网关不能为空', trigger: 'blur' }] + gatewayEndpoint: [{ required: true, validator: this.validateGateway, trigger: 'blur' }] }, agencyId: '' } @@ -77,6 +77,15 @@ export default { } } }, + validateGateway(rule, value, callback) { + if (!value) { + return callback(new Error('机构网关地址不能为空')) + } else if (!/^([a-zA-Z0-9.-]+|\d{1,3}(\.\d{1,3}){3}):\d{1,5}$/.test(value)) { + return callback(new Error('机构网关地址格式有误')) + } else { + callback() + } + }, submit() { this.$refs.dataForm.validate((valid) => { if (valid) { diff --git a/wedpr-web/src/views/approveDetail/index.vue b/wedpr-web/src/views/approveDetail/index.vue index 887773c3..612ff1d8 100644 --- a/wedpr-web/src/views/approveDetail/index.vue +++ b/wedpr-web/src/views/approveDetail/index.vue @@ -63,6 +63,7 @@ value-format="yyyy-MM-dd" style="width: 160px" v-model="scope.row[item.key]" + :picker-options="pickerOptions" type="date" placeholder="请选择日期" > @@ -82,13 +83,17 @@
    操作: - - + 重新提交 + + @@ -147,12 +152,14 @@ export default { resultMap: { Agree: '同意', Reject: '驳回', - Submit: '提出申请' + Submit: '提出申请', + Cancel: '废弃' }, resultTypeMap: { Agree: 'success', Reject: 'danger', - Submit: '' + Submit: '', + Cancel: 'info' }, active: 1, applyType: '' @@ -169,6 +176,11 @@ export default { ...mapGetters(['userId', 'agencyId']) }, methods: { + pickerOptions: { + disabledDate(time) { + return time.getTime() > Date.now() + } + }, async queryAuthTemplateDetails(params) { const res = await authManageServer.queryAuthTemplateDetails(params) console.log(res) @@ -218,6 +230,26 @@ export default { this.dataInfo = {} } }, + // 相当于更新审批单内容 + async reSubmit() { + const { applyTitle, applyDesc, followers, applyChain, applyContent, id, applyType } = this.dataInfo + console.log(this.dataInfo, 'this.dataInfo') + const params = { + applyType, + applyContent, + applyTitle, + applyDesc, + applyTemplateName: applyType, + applyChain: JSON.stringify({ chain: applyChain }), + followers, + id + } + const res = await authManageServer.updateAuth({ authList: [params] }) + if (res.code === 0) { + this.$message.success('重新提交成功') + this.getDetail() + } + }, showAgreeConfirm(params) { this.$confirm('确认通过审批?', '提示', { confirmButtonText: '确定', @@ -284,17 +316,13 @@ export default { diff --git a/wedpr-web/src/views/register/index.vue b/wedpr-web/src/views/register/index.vue index bca765e6..b4285bf7 100644 --- a/wedpr-web/src/views/register/index.vue +++ b/wedpr-web/src/views/register/index.vue @@ -95,7 +95,7 @@ export default { password: [{ validator: this.validPassword, trigger: 'blur' }], passwordRepeat: [{ validator: this.validatePasswordReapeat, trigger: 'blur' }], phone: [{ validator: this.validateMobile, trigger: 'blur' }], - email: [{ required: true, message: '邮箱不能为空', trigger: 'blur' }] + email: [{ validator: this.validateEmail, trigger: 'blur' }] }, userNameRule: { lengthStatus: false, @@ -165,7 +165,7 @@ export default { } else { this.passwordRule.lengthStatus = false } - if (/^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[\W])(?=.*[\S])^[0-9A-Za-z\S]+$/.test(password)) { + if (/^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[\W_])(?=.*[\S])^[0-9A-Za-z\S]+$/.test(password)) { this.passwordRule.charStatus = true } else { this.passwordRule.charStatus = false @@ -178,7 +178,7 @@ export default { } else { this.passwordRepeatRule.lengthStatus = false } - if (/^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[\W])(?=.*[\S])^[0-9A-Za-z\S]+$/.test(password)) { + if (/^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[\W_])(?=.*[\S])^[0-9A-Za-z\S]+$/.test(password)) { this.passwordRepeatRule.charStatus = true } else { this.passwordRepeatRule.charStatus = false @@ -187,7 +187,8 @@ export default { validateMobile(rule, value, callback) { if (!value) { return callback(new Error('手机号不能为空')) - } else if (!/^1[3-9]\d{9}$/.test(value)) { + // } else if (!/^1[3-9]\d{9}$/.test(value)) { + } else if (!/^\d{1,}$/.test(value)) { return callback(new Error('手机号格式有误')) } else { callback() @@ -214,11 +215,20 @@ export default { validPassword(rule, str, callback) { if (!str) { return callback(new Error('密码不能为空')) - } else if (!/^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[\W])(?=.*[\S])^[0-9A-Za-z\S]{8,18}$/.test(str)) { + } else if (!/^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[\W_])(?=.*[\S])^[0-9A-Za-z\S]{8,18}$/.test(str)) { return callback(new Error('密码格式有误')) } else { callback() } + }, + validateEmail(rule, str, callback) { + if (!str) { + return callback(new Error('邮箱不能为空')) + } else if (!/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/.test(str)) { + return callback(new Error('邮箱格式有误')) + } else { + callback() + } } } } diff --git a/wedpr-web/src/views/resetParams/index.vue b/wedpr-web/src/views/resetParams/index.vue index 873deb52..0d6b887a 100644 --- a/wedpr-web/src/views/resetParams/index.vue +++ b/wedpr-web/src/views/resetParams/index.vue @@ -40,6 +40,9 @@ true false + + + {{ item.description }} @@ -54,7 +57,6 @@