Skip to content

Commit f14a049

Browse files
author
lbw
committed
⚡ 优化 close #I5QK82 系统管理-参数管理-编辑页,可以修改键为已经存在的键,导致键相同的2条记录
1 parent 8cbaf22 commit f14a049

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/const/crud/admin/log.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export const tableOption = {
4444
prop: 'title'
4545
}, {
4646
label: 'IP地址',
47-
prop: 'remoteAddr'
47+
prop: 'remoteAddr',
48+
search: true
4849
}, {
4950
label: '请求方式',
5051
prop: 'method'

src/const/crud/admin/sys-public-param.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ import {getObj} from '@/api/admin/sys-public-param'
2222

2323
var validateParam = (rule, value, callback) => {
2424
getObj(value).then(response => {
25-
if (window.boxType === 'edit') callback()
25+
// 编辑时候没有改动直接跳过校验
26+
if (window.boxType === 'edit' && window.tableForm.publicKey === value) callback()
2627
const result = response.data.data
2728
if (result !== null) {
2829
callback(new Error('参数键已经存在'))
@@ -52,6 +53,7 @@ export const tableOption = {
5253
},
5354
{
5455
label: '键',
56+
search: true,
5557
prop: 'publicKey',
5658
rules: [
5759
{ required: true, message: '请输入键', trigger: 'blur' },

src/views/admin/param/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export default {
107107
},
108108
beforeOpen(show, type) {
109109
window.boxType = type
110+
window.tableForm = this.$refs.crud.tableForm
110111
show()
111112
},
112113
/**

0 commit comments

Comments
 (0)