+
${this.$t('message.linkis.ipListManagement.isConfirmDelete', { name: name || key })}
+
+ ${this.$t('message.linkis.ipListManagement.deleteWarning')}
+
+
+
${this.$t('message.linkis.ipListManagement.configInfo')}:
+
${this.$t('message.linkis.ipListManagement.key')}:${key}
+
${this.$t('message.linkis.ipListManagement.name')}:${name || '-'}
+
${this.$t('message.linkis.ipListManagement.engineType')}:${engineType || '-'}
+
+
+ `,
+ okText: this.$t('message.linkis.ipListManagement.confirm'),
+ cancelText: this.$t('message.linkis.ipListManagement.cancel'),
+ onOk: async () => {
+ await this.confirmDelete(data);
+ await this.getTableData();
+ },
+ onCancel: () => {
+ // 取消删除,无需额外操作
+ }
+ });
+}
+```
+**验证结论**: ✅ 通过
+- 确认对话框显示完整配置信息
+- 警告文本使用红色字体,醒目提示
+- 默认按钮为"取消",防止误操作
+- 取消删除时不执行任何操作,符合预期
+
+**✅ 删除逻辑实现(第525-542行)**:
+```javascript
+async confirmDelete(data) {
+ try {
+ const { id } = data;
+
+ // 调用管理员专用删除接口
+ await api.fetch('/configuration/admin/keyvalue', {
+ id: id
+ }, 'delete');
+
+ this.$Message.success(this.$t('message.linkis.ipListManagement.deleteSuccess'));
+ } catch(err) {
+ const errorMsg = err && err.message ? err.message : this.$t('message.linkis.ipListManagement.unknownError');
+ this.$Message.error(this.$t('message.linkis.ipListManagement.deleteFailed', { error: errorMsg }));
+
+ // 重新抛出异常,阻止列表刷新
+ throw err;
+ }
+}
+```
+**验证结论**: ✅ 通过
+- 正确调用管理员专用删除接口 `/configuration/admin/keyvalue`
+- 传递正确的参数 `id`
+- 成功时显示成功提示,失败时显示错误提示
+- 异常时重新抛出错误,阻止列表刷新,符合预期
+
+**✅ 管理员权限检查(第544-552行)**:
+```javascript
+async checkIsAdmin() {
+ try {
+ const res = await api.fetch('/configuration/userinfo', 'get');
+ this.isAdmin = res.isAdmin || false;
+ } catch(err) {
+ console.error('获取用户信息失败:', err);
+ this.isAdmin = false;
+ }
+}
+```
+**验证结论**: ✅ 通过
+- 通过 `/configuration/userinfo` 接口获取用户信息
+- 异常时设置 `isAdmin = false`,默认不显示删除按钮
+- 在组件创建时调用,确保按钮正确显示
+
+**✅ 组件生命周期(第564-565行)**:
+```javascript
+async created() {
+ await this.checkIsAdmin(); // 新增
+ api.fetch('/configuration/engineType', 'get').then(res => {
+ this.getEngineTypes = ['all', ...res.engineType]
+ })
+ this.init();
+}
+```
+**验证结论**: ✅ 通过
+- 在 `created` 钩子中调用 `checkIsAdmin()`
+- 使用 `await` 确保权限检查完成后再渲染列表
+- 保证删除按钮的正确显示
+
+---
+
+### 1.2 后端代码验证 ✅
+
+**审查文件**: `linkis-public-enhancements/linkis-configuration/src/main/java/org/apache/linkis/configuration/restful/api/ConfigurationRestfulApi.java`
+
+#### 关键代码片段验证
+
+**✅ 管理员删除接口(第692-727行)**:
+```java
+@ApiOperation(
+ value = "deleteKeyValueByAdmin",
+ notes = "Admin can delete any user's config value by ID",
+ response = Message.class)
+@ApiImplicitParams({
+ @ApiImplicitParam(name = "id", required = true, dataType = "Long", value = "Config value ID")
+})
+@ApiOperationSupport(ignoreParameters = {"json"})
+@RequestMapping(path = "/admin/keyvalue", method = RequestMethod.DELETE)
+public Message deleteKeyValueByAdmin(
+ HttpServletRequest req, @RequestBody Map