From 50d288f04ad66a18d3ebe80db3ca7c6e68aa65fe Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 08 一月 2025 15:52:31 +0800
Subject: [PATCH] 2025-01-08
---
src/utils/utils-custom.js | 112 ++++++++++++++++++++++++++++++-------------------------
1 files changed, 61 insertions(+), 51 deletions(-)
diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js
index 188585a..660986e 100644
--- a/src/utils/utils-custom.js
+++ b/src/utils/utils-custom.js
@@ -652,7 +652,7 @@
*/
static resetBtn (btn, commonId) {
if (btn.OpenType === 'pop' || (btn.OpenType === 'funcbutton' && btn.execMode === 'pop')) {
- if (btn.modal && btn.modal.fields.length > 0) {
+ if (btn.modal && btn.modal.fields && btn.modal.fields.length > 0) {
btn.modal.fields = btn.modal.fields.map(m => {
m.uuid = this.getuuid()
return m
@@ -684,6 +684,10 @@
return md5(commonId + m)
})
+ }
+
+ if (btn.OpenType === 'popview' && btn.config && btn.config.components) {
+ btn.config.components = this.resetConfig(btn.config.components, commonId)
}
}
@@ -771,14 +775,7 @@
if (cell.eleType === 'button') {
cell.uuid = md5(commonId + cell.uuid)
- if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
- if (cell.modal && cell.modal.fields.length > 0) {
- cell.modal.fields = cell.modal.fields.map(m => {
- m.uuid = this.getuuid()
- return m
- })
- }
- }
+ this.resetBtn(cell, commonId)
} else {
cell.uuid = this.getuuid()
}
@@ -792,14 +789,8 @@
card.backElements = card.backElements.map(cell => {
if (cell.eleType === 'button') {
cell.uuid = md5(commonId + cell.uuid)
- if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
- if (cell.modal && cell.modal.fields.length > 0) {
- cell.modal.fields = cell.modal.fields.map(m => {
- m.uuid = this.getuuid()
- return m
- })
- }
- }
+
+ this.resetBtn(cell, commonId)
} else {
cell.uuid = this.getuuid()
}
@@ -818,14 +809,8 @@
item.elements = item.elements.map(cell => {
if (cell.eleType === 'button') {
cell.uuid = md5(commonId + cell.uuid)
- if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
- if (cell.modal && cell.modal.fields.length > 0) {
- cell.modal.fields = cell.modal.fields.map(m => {
- m.uuid = this.getuuid()
- return m
- })
- }
- }
+
+ this.resetBtn(cell, commonId)
} else {
cell.uuid = this.getuuid()
}
@@ -850,14 +835,7 @@
col.elements = col.elements.map(cell => {
cell.uuid = md5(commonId + cell.uuid)
if (cell.eleType === 'button') {
- if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
- if (cell.modal && cell.modal.fields.length > 0) {
- cell.modal.fields = cell.modal.fields.map(m => {
- m.uuid = this.getuuid()
- return m
- })
- }
- }
+ this.resetBtn(cell, commonId)
}
return cell
})
@@ -902,14 +880,7 @@
}
item.action = item.action.map(cell => {
cell.uuid = md5(commonId + cell.uuid)
- if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
- if (cell.modal && cell.modal.fields.length > 0) {
- cell.modal.fields = cell.modal.fields.map(m => {
- m.uuid = this.getuuid()
- return m
- })
- }
- }
+ this.resetBtn(cell, commonId)
return cell
})
@@ -1963,6 +1934,10 @@
})
}
let emptys = []
+ if (cell.Ot !== 'notRequired') {
+ forms.push(...columns)
+ }
+
cell.verify.uniques.forEach(m => {
if (m.status === 'false') return
@@ -1974,7 +1949,11 @@
})
if (emptys.length) {
- errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濆敮涓�鎬ч獙璇佸瓧娈�${emptys.join('銆�')}锛屽湪琛ㄥ崟涓笉瀛樺湪锛乣})
+ if (cell.Ot === 'notRequired') {
+ errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濆敮涓�鎬ч獙璇佸瓧娈�${emptys.join('銆�')}锛屽湪琛ㄥ崟涓笉瀛樺湪锛乣})
+ } else {
+ errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濆敮涓�鎬ч獙璇佸瓧娈�${emptys.join('銆�')}锛屽湪琛ㄥ崟涓庡瓧娈甸泦涓笉瀛樺湪锛乣})
+ }
}
}
@@ -3331,7 +3310,7 @@
} else if (form.type === 'popSelect') {
let msg = getPopSelectSql(form)
- sqls.push({uuid: form.uuid, type: 'popSource', ...msg})
+ sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'popSource', ...msg})
}
})
}
@@ -3374,7 +3353,7 @@
} else if (form.type === 'popSelect') {
let msg = getPopSelectSql(form)
- sqls.push({uuid: form.uuid, type: 'popSource', ...msg})
+ sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'popSource', ...msg})
}
})
}
@@ -3414,7 +3393,9 @@
})
}
- filterComponent(cell.config.components, _mainSearch, '-' + cell.label, true)
+ let label = (item.name ? '-' + item.name : '') + '-' + cell.label
+
+ filterComponent(cell.config.components, _mainSearch, label, true)
}
}
}
@@ -3823,24 +3804,26 @@
let _val2 = ''
arr.push(_key)
- if (_key === 'bid') { // 琛ㄥ崟涓病鏈塨id鍒欎娇鐢ㄧ郴缁焍id鍙橀噺
+ if (_key === 'bid') {
_val = BID
} else {
- _val = `'@mk_${_key}_mk@'`
+ // _val = `'@mk_${_key}_mk@'`
+ _val = `@${_field}`
}
_fieldValue.push(`${_key}=${_val}`)
- if (_key === 'bid') { // 琛ㄥ崟涓病鏈塨id鍒欎娇鐢ㄧ郴缁焍id鍙橀噺
+ if (_key === 'bid') {
_val2 = `' + ${BID} + '`
} else {
- _val2 = `@mk_${_key}_mk@`
+ // _val2 = `@mk_${_key}_mk@`
+ _val2 = `' + @${_field} + '`
}
_value.push(`${_labels[index] || ''}锛�${_val2}`)
})
- if (!arr.includes(primaryKey.toLowerCase())) {
+ if (!arr.includes(primaryKey.toLowerCase()) && btn.Ot !== 'notRequired') {
_fieldValue.push(`${primaryKey} !=${primaryId}`)
}
@@ -4707,7 +4690,7 @@
} else if (['mk_address'].includes(s)) {
decSql.push(`@mk_address nvarchar(100)`)
} else if (['mk_deleted'].includes(s)) {
- secSql.push(`@mk_deleted int`)
+ decSql.push(`@mk_deleted int`)
} else {
decSql.push(`@${s} nvarchar(50)`)
}
@@ -6450,5 +6433,32 @@
filterComponent(config.components, _mainSearch)
+ let keys = sqls.map(item => item.uuid)
+ if (keys.length > Array.from(new Set(keys)).length) {
+ if (window.backend) {
+ let m = new Map()
+ let n = new Map()
+ sqls.forEach(item => {
+ if (m.has(item.uuid)) {
+ if (!n.has(item.uuid)) {
+ window.mkInfo(m.get(item.uuid))
+ n.set(item.uuid, true)
+ }
+ window.mkInfo(item)
+ } else {
+ m.set(item.uuid, item)
+ }
+ })
+
+ notification.warning({
+ top: 92,
+ message: '瀛樺湪閲嶅鐨勫悗绔剼鏈琁D锛�',
+ duration: 5
+ })
+ }
+
+ return []
+ }
+
return sqls
}
\ No newline at end of file
--
Gitblit v1.8.0