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

fix: 公共流程创建周期任务提示没有权限 && 轻应用编辑选择执行方案后不生效问题修复 #7667

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
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 @@ -1812,6 +1812,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 @@ -1846,6 +1846,7 @@ const en = {
'场景名称': 'Scene Name',
'场景标识': 'Scene Identifier',
'场景分类': 'Scene Category',
'场景标签': 'Scene Labels',
'风险级别': 'Risk Level',
'使用说明': 'Instructions',
'高': 'High',
Expand Down
1 change: 1 addition & 0 deletions frontend/desktop/src/pages/appmaker/AppEditDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
:placeholder="$t('请选择')"
:clearable="true"
:is-loading="schemeLoading"
:key="schemeLoading"
@selected="onSelectScheme">
<bk-option
v-for="(option, index) in schemeList"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@
<bk-option
v-for="option in templateList"
:key="option.id"
:disabled="hasNoPermission.view"
:disabled="!hasPermission([flowPermission.view], option.auth_actions)"
:id="option.id"
:name="option.name">
<p
:title="option.name"
v-cursor="{ active: hasNoPermission.view }"
v-cursor="{ active: !hasPermission([flowPermission.view], option.auth_actions) }"
@click="onTempSelect([flowPermission.view], option)">
{{ option.name }}
</p>
Expand Down Expand Up @@ -219,8 +219,8 @@
:loading="saveLoading"
:disabled="isLoading || previewDataLoading"
data-test-id="periodicEdit_form_saveBtn"
:class="{ 'btn-permission-disable': hasNoPermission.create }"
v-cursor="{ active: hasNoPermission.create }"
:class="{ 'btn-permission-disable': hasNoCreatePerm }"
v-cursor="{ active: hasNoCreatePerm }"
@click="onPeriodicConfirm">
{{ isEdit ? $t('保存') : $t('提交') }}
</bk-button>
Expand Down Expand Up @@ -411,17 +411,13 @@
const nodes = Object.values(activities).map(item => item.name)
return nodes.join(',')
},
hasNoPermission () {
hasNoCreatePerm () {
const { id, auth_actions } = this.templateData

if (this.isEdit || !id) {
return { view: false, create: false }
}

return {
view: !auth_actions.includes(this.flowPermission.view),
create: !auth_actions.includes(this.flowPermission.create)
return false
}
return !auth_actions.includes(this.flowPermission.create)
},
schemeSelectPlaceholder () {
return this.formData.template_id && !this.schemeList.length ? i18n.t('此流程无执行方案,无需选择') : i18n.t('请选择')
Expand Down Expand Up @@ -500,7 +496,7 @@
}
},
onTempSelect (applyPerm = [], selectInfo) {
if (this.hasNoPermission.view) {
if (!this.hasPermission(applyPerm, selectInfo.auth_actions)) {
const permissionData = {
project: [{
id: this.project_id,
Expand Down Expand Up @@ -528,12 +524,14 @@
onClearTemplate () {
this.formData.schemeId = []
this.schemeList = []
this.templateData = {}
this.periodicConstants = {}
},
onFlowTypeChange () {
this.templateLoading = true
this.formData.template_id = ''
this.formData.name = ''
this.formData.task_template_name = ''
this.onClearTemplate()
this.handleTplSearch()
},
Expand Down Expand Up @@ -793,7 +791,7 @@
},
// 周期任务保存
onPeriodicConfirm () {
if (this.hasNoPermission.create) {
if (this.hasNoCreatePerm) {
const { id, name, auth_actions } = this.templateData
const resourceData = {
[this.isCommon ? 'common_flow' : 'flow']: [{ id, name }],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
@onSelectSubflow="onSelectSubflow">
</NodePreview>
<component
v-if="!templateLoading"
:is="schemeTemplate"
ref="taskScheme"
:project_id="project_id"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
:form-data="formData">
</SharedCategorySelect>
</bk-form-item>
<bk-form-item :label="$t('标签')" :desc="$t('场景使用者通过标签可以快速找到同一类场景')">
<bk-form-item :label="$t('场景标签')" :desc="$t('场景使用者通过标签可以快速找到同一类场景')">
<SharedTagSelect
v-model="formData.labels"
:loading="marketLoading"
Expand Down Expand Up @@ -271,9 +271,8 @@
},
onSceneNameSelect (val) {
const selectInfo = this.recordList.find(item => item.id === val) || {}
const { risk_level: riskLevel, usage_content: content } = selectInfo
const { usage_content: content } = selectInfo
Object.assign(this.formData, selectInfo, {
risk_level: String(riskLevel),
usage_content: { content }
})
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1723,6 +1723,7 @@
min-width: 88px;
text-align: center;
font-size: 14px;
color: #63656e;
background: #ffffff;
border: 1px solid #c4c6cc;
border-radius: 3px;
Expand Down
Loading