From cd138edfe4d479e7689f4a7e466a81471b540d2e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 01 三月 2025 22:34:59 +0800 Subject: [PATCH] 2025-03-01 --- src/tabviews/zshare/mutilform/index.jsx | 25 +++++++++--- src/templates/zshare/modalform/index.jsx | 89 +++++++++++++++++++++++--------------------- src/tabviews/custom/components/table/edit-table/index.jsx | 1 public/manifest.json | 2 4 files changed, 67 insertions(+), 50 deletions(-) diff --git a/public/manifest.json b/public/manifest.json index 9376b3c..18d9315 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -6,5 +6,5 @@ "display": "standalone", "theme_color": "#000000", "background_color": "#ffffff", - "mk_version": "20250205" + "mk_version": "20250301" } diff --git a/src/tabviews/custom/components/table/edit-table/index.jsx b/src/tabviews/custom/components/table/edit-table/index.jsx index 2d4019f..1ce2b6a 100644 --- a/src/tabviews/custom/components/table/edit-table/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/index.jsx @@ -437,6 +437,7 @@ total: 0 }) reset && MKEmitter.emit('resetTable', config.uuid, 'true') // 鍒楄〃閲嶇疆 + MKEmitter.emit('transferData' + setting.tableId, []) this.requestId = '' return diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index 84cb8f6..751907a 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -182,12 +182,21 @@ if (['select', 'link', 'radio', 'checkbox', 'checkcard', 'multiselect', 'cascader'].includes(item.type)) { item.options = item.options || [] - item.options = item.options.filter(cell => { - cell.value = cell.Value - cell.label = cell.Text - - return !cell.Hide - }) + item.$select = true + if (item.type === 'checkcard') { + item.options = item.options.filter(cell => { + cell.$value = cell.$value + '' + return !cell.Hide + }) + } else { + item.options = item.options.filter(cell => { + cell.value = cell.Value + '' + cell.label = cell.Text + + return !cell.Hide + }) + } + if (item.setAll === 'true' && ['select', 'link', 'radio'].includes(item.type)) { // 娣诲姞绌哄�� item.options.unshift({ key: Utils.getuuid(), @@ -298,6 +307,8 @@ newval = '' } } + } else if (item.$select && item.resourceType === '0') { + newval = newval + '' } if (newval !== '$empty') { @@ -310,7 +321,7 @@ if (isNaN(item.initval) || item.initval === '') { item.initval = 0 } - } else if (['select', 'link', 'radio', 'checkbox', 'checkcard', 'multiselect', 'cascader'].includes(item.type) && item.resourceType === '1') { + } else if (item.$select && item.resourceType === '1') { deForms.push(item) } else if (item.type === 'rate') { item.rateCount = item.rateCount || 5 diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index de7bc87..63636ae 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -896,51 +896,51 @@ return fields } - transfer = (options) => { - if (options.length === 0) return options + // transfer = (options) => { + // if (options.length === 0) return options - let isNumber = true - options.forEach(item => { - if (!item.Value || isNaN(item.Value)) { - isNumber = false - } - }) + // let isNumber = true + // options.forEach(item => { + // if (!item.Value || isNaN(item.Value)) { + // isNumber = false + // } + // }) - if (isNumber) { - return options.map(item => { - item.Value = +item.Value - return item - }) - } else { - return options.map(item => { - item.Value = item.Value + '' - return item - }) - } - } + // if (isNumber) { + // return options.map(item => { + // item.Value = +item.Value + // return item + // }) + // } else { + // return options.map(item => { + // item.Value = item.Value + '' + // return item + // }) + // } + // } - transferCard = (options) => { - if (options.length === 0) return options + // transferCard = (options) => { + // if (options.length === 0) return options - let isNumber = true - options.forEach(item => { - if (!/^([0-9]|[1-9]\d{0,2})$/.test(item.$value)) { - isNumber = false - } - }) + // let isNumber = true + // options.forEach(item => { + // if (!/^([0-9]|[1-9]\d{0,2})$/.test(item.$value)) { + // isNumber = false + // } + // }) - if (isNumber) { - return options.map(item => { - item.$value = +item.$value - return item - }) - } else { - return options.map(item => { - item.$value = item.$value + '' - return item - }) - } - } + // if (isNumber) { + // return options.map(item => { + // item.$value = +item.$value + // return item + // }) + // } else { + // return options.map(item => { + // item.$value = item.$value + '' + // return item + // }) + // } + // } handleConfirm = () => { const { card, fields } = this.props @@ -976,13 +976,17 @@ if (['multiselect', 'select', 'link', 'radio', 'checkbox'].includes(values.type)) { if (values.resourceType === '0') { values.options = values.options || [] + values.options = values.options.map(item => { + item.Value = item.Value + '' + return item + }) values.dataSource = '' let type = values.type if (values.type === 'radio' && values.linkField) { type = 'link' } - values.options = this.transfer(values.options) + // values.options = this.transfer(values.options) if (values.options.filter(op => op.Text === '').length > 0) { notification.warning({ @@ -1030,6 +1034,7 @@ let linkSubFields = values.linkSubField || [] values.options = values.options.map(m => { m.ParentID = m.ParentID || '' + m.$value = m.$value + '' linkSubFields.forEach(n => { m[n] = m[n] || '' @@ -1037,7 +1042,7 @@ return m }) - values.options = this.transferCard(values.options) + // values.options = this.transferCard(values.options) let type = values.type if (values.linkField) { -- Gitblit v1.8.0