From 8d7c3eed8bdac1e77c8de90a3227d801708c358e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 15 五月 2023 21:12:56 +0800 Subject: [PATCH] 2023-05-15 --- src/tabviews/zshare/mutilform/index.jsx | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index 4a96938..eec20bd 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -19,6 +19,7 @@ const MKCheckCard = asyncComponent(() => import('./mkCheckCard')) const MKSwitch = asyncComponent(() => import('./mkSwitch')) +const MKCheck = asyncComponent(() => import('./mkCheck')) const MKCheckbox = asyncComponent(() => import('./mkCheckbox')) const MKRadio = asyncComponent(() => import('./mkRadio')) const MKDatePicker = asyncComponent(() => import('./mkDatePicker')) @@ -124,11 +125,13 @@ item.precision = 'second' } - if (!item.field || !['text', 'number', 'switch', 'rate', 'select', 'link', 'cascader', 'linkMain', 'funcvar', 'date', 'datemonth', 'radio', 'checkbox', 'checkcard', 'fileupload', 'textarea', 'multiselect', 'brafteditor', 'color', 'vercode'].includes(item.type)) return false + if (!item.field || !['text', 'number', 'switch', 'check', 'rate', 'select', 'link', 'cascader', 'linkMain', 'funcvar', 'date', 'datemonth', 'radio', 'checkbox', 'checkcard', 'fileupload', 'textarea', 'multiselect', 'brafteditor', 'color', 'vercode'].includes(item.type)) return false if (/^\s+$/.test(item.label)) { item.style = item.style || {} - item.style.color = 'transparent' + item.style.opacity = 0 + item.style.width = 1 + item.style.display = 'inline-block' } // 鏁版嵁鑷姩濉厖 @@ -218,7 +221,7 @@ if (newval === '$empty' && item.initval) { newval = moment().subtract(item.initval, 'month').format('YYYY-MM') } - } else if (item.type === 'switch') { // 寮�鍏冲彧鎺ユ敹鍥哄畾鍊� + } else if (item.type === 'switch' || item.type === 'check') { // 寮�鍏冲嬀閫夋鍙帴鏀跺浐瀹氬�� if (newval !== '$empty' && (newval === item.closeVal || newval === item.openVal)) { } else if (item.initval === true) { @@ -584,6 +587,9 @@ if (debug) { console.info(sql) } + + sql = sql.replace(/%/ig, ' mpercent ') + mainItems.push(`select '${item.field}' as obj_name,'${item.arr_field}' as arr_field,'${window.btoa(window.encodeURIComponent(sql))}' as LText`) } else { let sql = _sql + item.base_sql @@ -595,6 +601,9 @@ if (debug) { console.info(sql) } + + sql = sql.replace(/%/ig, ' mpercent ') + localItems.push(`select '${item.field}' as obj_name,'${item.arr_field}' as arr_field,'${window.btoa(window.encodeURIComponent(sql))}' as LText`) } }) @@ -995,6 +1004,8 @@ content = (<MKCheckCard config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)}/>) } else if (item.type === 'switch') { content = (<MKSwitch config={item} onChange={(val) => this.recordChange({[item.field]: val}, item)}/>) + } else if (item.type === 'check') { + content = (<MKCheck config={item} onChange={(val) => this.recordChange({[item.field]: val}, item)}/>) } else if (item.type === 'checkbox') { content = (<MKCheckbox config={item} onChange={(val) => this.recordChange({[item.field]: val})}/>) } else if (item.type === 'radio') { -- Gitblit v1.8.0