Skip to content

Commit

Permalink
Merge pull request #2495 from fannluo/V3.6.X_fe_hotfix
Browse files Browse the repository at this point in the history
bugfix:申请创建轻应用权限跳转链接请求参数修改,新建公共流程并创建任务权限校验逻辑修改(V3.6.X)
  • Loading branch information
homholueng authored Aug 18, 2020
2 parents 2c35565 + 5a88c22 commit b0ca2b7
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 28 deletions.
3 changes: 3 additions & 0 deletions dev_log/dev/fannluo_202008181015.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bugfix:
- "申请创建轻应用权限跳转链接时请求参数格式修改"
- "新建公共流程并创建任务权限校验逻辑修改"
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@
this.$emit('onChange', project)
},
handleConfirm () {
if (this.confirmLoading) {
return
}
if (typeof this.id === 'number') {
const project = this.projectList.find(item => item.id === this.id)
this.$emit('onConfirm', project)
Expand Down
1 change: 1 addition & 0 deletions frontend/desktop/src/config/i18n/cn.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ const cn = {
'修改轻应用': '修改轻应用',
'使用权限': '使用权限',
'新建轻应用': '新建轻应用',
'编辑轻应用': '编辑轻应用',
'应用名称': '应用名称',
'执行方案': '执行方案',
'当流程模板包含可选节点时,用户可以在新建任务时添加执行方案。这里选择执行方案后,创建的轻应用只能按照固定执行方案新建任务。': '当流程模板包含可选节点时,用户可以在新建任务时添加执行方案。这里选择执行方案后,创建的轻应用只能按照固定执行方案新建任务。',
Expand Down
1 change: 1 addition & 0 deletions frontend/desktop/src/config/i18n/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ const en = {
'修改轻应用': 'Update Mini-APP',
'使用权限': 'Permissions',
'新建轻应用': 'New Mini-APP',
'编辑轻应用': 'Edit Mini-APP',
'应用名称': 'App Name',
'执行方案': 'Execution Scheme',
'当流程模板包含可选节点时,用户可以在新建任务时添加执行方案。这里选择执行方案后,创建的轻应用只能按照固定执行方案新建任务。': 'You can add schemes when creating a task if the flow contains optional nodes.After selecting a scheme, you can only create tasks according to the fixed execution scheme with this Mini-APP.',
Expand Down
22 changes: 9 additions & 13 deletions frontend/desktop/src/pages/appmaker/AppEditDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -360,27 +360,23 @@
return
}
if (!this.hasConfirmPerm) {
let resourceData = {
const resourceData = {
project: [{
id: this.projectId,
name: this.projectName
}]
}
if (this.isCreateNewApp) {
const templateName = this.templateList.find(item => item.id === this.appData.appTemplate).name
resourceData = {
flow: [{
id: this.appData.appTemplate,
name: templateName
}]
}
resourceData.flow = [{
id: this.appData.appTemplate,
name: templateName
}]
} else {
resourceData = {
mini_app: [{
id: this.currentAppData.id,
name: this.currentAppData.name
}]
}
resourceData.mini_app = [{
id: this.currentAppData.id,
name: this.currentAppData.name
}]
}
this.applyForPermission(this.btnPermission, this.appData.appActions, resourceData)
return
Expand Down
9 changes: 7 additions & 2 deletions frontend/desktop/src/pages/task/TaskStep.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,12 @@
'templateEdit': {
name: 'templatePanel',
params: { type: 'edit', project_id: this.project_id },
query: { template_id: this.template_id || this.asyncTemplateId }
query: { template_id: this.template_id }
},
'commonTplEdit': {
name: 'commonTemplatePanel',
params: { type: 'edit' },
query: { template_id: this.template_id }
},
'function': { name: 'functionHome' },
'audit': { name: 'auditHome' },
Expand All @@ -155,7 +160,7 @@
* 3、templateEdit - 模版编辑
*/
if (entrance === 'periodicTask' || entrance === 'taskflow' || entrance === 'templateEdit') {
url = backObj[entrance]
url = (this.common && entrance === 'templateEdit') ? backObj['commonTplEdit'] : backObj[entrance]
break
}
if (this.common) {
Expand Down
43 changes: 30 additions & 13 deletions frontend/desktop/src/pages/template/TemplateEdit/TemplateHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
<SelectProjectModal
:title="$t('创建任务')"
:show="isSelectProjectShow"
:confirm-loading="commonTplCreateTaskPermLoading"
:confirm-cursor="!hasCommonTplCreateTaskPerm"
:confirm-loading="commonTplCreateTaskPermLoading || templateSaving"
:confirm-cursor="['new', 'clone'].includes(type) ? false : !hasCommonTplCreateTaskPerm"
@onChange="handleProjectChange"
@onConfirm="handleCreateTaskConfirm"
@onCancel="handleCreateTaskCancel">
Expand Down Expand Up @@ -180,6 +180,15 @@
watch: {
name (val) {
this.tName = val
},
type (val, oldVal) {
if (['new', 'clone'].includes(oldVal) && val === 'edit') {
this.queryCommonTplCreateTaskPerm().then(() => {
if (this.hasCommonTplCreateTaskPerm) {
this.saveTemplate(true)
}
})
}
}
},
async mounted () {
Expand Down Expand Up @@ -218,7 +227,7 @@
this.saveTemplate(saveAndCreate)
} else {
if (this.common) {
this.applyCreateCommonTplPerm(this.saveAndCreateRequiredPerm)
this.applyCreateCommonTplPerm()
} else {
this.applyTplPerm(this.saveAndCreateRequiredPerm)
}
Expand All @@ -228,7 +237,7 @@
this.saveTemplate(saveAndCreate)
} else {
if (this.common) {
this.applyCreateCommonTplPerm(this.saveRequiredPerm)
this.applyCreateCommonTplPerm()
} else {
this.applyTplPerm(this.saveRequiredPerm)
}
Expand Down Expand Up @@ -307,10 +316,20 @@
},
handleProjectChange (project) {
this.selectedProject = project
this.queryCommonTplCreateTaskPerm()
// 公共流程已经被创建,则需要查询是否有公共流程创建任务权限
if (this.type !== 'new' && this.type !== 'clone') {
this.queryCommonTplCreateTaskPerm()
}
},
/**
* 公共流程选择业务创建任务
* 若公共流程还没有被创建,则先创建任务,再查询是否有公共流程创建任务权限
*/
handleCreateTaskConfirm () {
if (this.hasCommonTplCreateTaskPerm) {
if (this.type === 'new' || this.type === 'clone') {
const pid = this.common ? this.selectedProject.id : this.project_id // 公共流程创建任务需要跳转到所选业务
this.$emit('onSaveTemplate', false, pid)
} else if (this.hasCommonTplCreateTaskPerm) {
this.saveTemplate(true)
} else {
this.applyCommonTplCreateTaskPerm()
Expand Down Expand Up @@ -402,20 +421,18 @@
},
applyTplPerm (requiredPerm) {
let curPermission = [...this.authActions]
let resourceData = {
const resourceData = {
project: [{
id: this.project_id,
name: this.projectName
}]
}
if (this.type === 'edit') {
curPermission = [...this.tplActions]
resourceData = {
flow: [{
id: this.template_id,
name: this.name
}]
}
resourceData.flow = [{
id: this.template_id,
name: this.name
}]
}
this.applyForPermission(requiredPerm, curPermission, resourceData)
}
Expand Down

0 comments on commit b0ca2b7

Please sign in to comment.