Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@
<el-button @click.prevent="dialogVisible = false">
{{ $t('common.cancel') }}
</el-button>
<el-button
type="primary"
@click="submit"
:loading="loading"
v-if="permissionPrecise.paramSetting(modelID)"
>
<el-button type="primary" @click="submit" :loading="loading">
{{ $t('common.confirm') }}
</el-button>
</span>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks clean and does not have any apparent issues that would affect functionality or performance. However, there is a small potential issue with conditional rendering of the "Cancel" button. If permissionPrecise.paramSetting(modelID) evaluates to false, then the cancel button will remain visible even if it doesn't serve any purpose due to lack of permission.

To address this, you might want to add an additional condition to check whether the user has both read and write permissions before making the 'Cancel' button accessible:

<span class="operation-buttons">
  <el-button @click.prevent="dialogVisible = false">{{ $t('common.cancel') }}</el-button>
  <el-button 
               type="primary" 
               @click="submit" 
               :loading="loading"
               v-if="hasEditPermission && !permissionPrecise.paramSetting(modelID)"> <!-- Ensure editing permission -->
      {{ $t('common.confirm') }}
  </el-button>
</span>

Where hasEditPermission is a property that checks whether the current user possesses the necessary rights (both reading and writing) on the specified model (modelID). This approach ensures that only users with appropriate privileges can access the confirmation button during parameter setting operations.

Expand Down
Loading