From ee707c99f0b48865795a562ef4ba51810ff45ae9 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 30 十二月 2021 13:51:46 +0800 Subject: [PATCH] 2021-12-30 --- src/tabviews/zshare/mutilform/index.jsx | 2 src/templates/zshare/modalform/index.jsx | 1 src/templates/modalconfig/index.jsx | 7 +++ src/menu/modalconfig/index.jsx | 7 +++ src/mob/modalconfig/index.jsx | 7 +++ src/templates/zshare/formconfig.jsx | 7 +++ src/menu/components/form/tab-form/index.jsx | 7 +++ src/menu/components/table/normal-table/columns/index.jsx | 2 src/menu/components/form/normal-form/index.jsx | 7 +++ src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx | 12 +++--- src/menu/components/table/edit-table/columns/index.jsx | 2 11 files changed, 51 insertions(+), 10 deletions(-) diff --git a/src/menu/components/form/normal-form/index.jsx b/src/menu/components/form/normal-form/index.jsx index 7a970bb..47d8a42 100644 --- a/src/menu/components/form/normal-form/index.jsx +++ b/src/menu/components/form/normal-form/index.jsx @@ -472,6 +472,13 @@ _tabIndex++ } } + + if (item.type === 'switch') { + _linksupFields.push({ + field: item.field, + label: _linkIndex + '銆�' + item.label + }) + } if (!['select', 'link', 'radio', 'checkcard'].includes(item.type)) return if (item.type === 'checkcard' && item.multiple === 'true') return // 閫夐」鍗″閫� diff --git a/src/menu/components/form/tab-form/index.jsx b/src/menu/components/form/tab-form/index.jsx index 27ca911..5939b12 100644 --- a/src/menu/components/form/tab-form/index.jsx +++ b/src/menu/components/form/tab-form/index.jsx @@ -464,6 +464,13 @@ _tabIndex++ } } + + if (item.type === 'switch') { + _linksupFields.push({ + field: item.field, + label: _linkIndex + '銆�' + item.label + }) + } if (!['select', 'link', 'radio', 'checkcard'].includes(item.type)) return if (item.type === 'checkcard' && item.multiple === 'true') return // 閫夐」鍗″閫� diff --git a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx index ff20115..77e5d53 100644 --- a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx @@ -228,17 +228,17 @@ }, { type: 'number', - key: 'max', - label: '鏈�澶у��', - initVal: card.max, + key: 'min', + label: '鏈�灏忓��', + initVal: card.min, unlimit: true, required: false }, { type: 'number', - key: 'min', - label: '鏈�灏忓��', - initVal: card.min, + key: 'max', + label: '鏈�澶у��', + initVal: card.max, unlimit: true, required: false }, diff --git a/src/menu/components/table/edit-table/columns/index.jsx b/src/menu/components/table/edit-table/columns/index.jsx index 863711e..4ed5e10 100644 --- a/src/menu/components/table/edit-table/columns/index.jsx +++ b/src/menu/components/table/edit-table/columns/index.jsx @@ -281,7 +281,7 @@ let column = fromJS(col).toJS() if (column.type === 'custom') { - let newcard = {uuid: Utils.getuuid(), focus: true, eleType: 'text', datatype: 'dynamic', style: {paddingLeft: '4px'}} + let newcard = {uuid: Utils.getuuid(), focus: true, width: 24, eleType: 'text', datatype: 'dynamic', style: {paddingLeft: '4px'}} // 娉ㄥ唽浜嬩欢-娣诲姞鍏冪礌 MKEmitter.emit('cardAddElement', [config.uuid, column.uuid], newcard) diff --git a/src/menu/components/table/normal-table/columns/index.jsx b/src/menu/components/table/normal-table/columns/index.jsx index bd9cd04..6baf48a 100644 --- a/src/menu/components/table/normal-table/columns/index.jsx +++ b/src/menu/components/table/normal-table/columns/index.jsx @@ -317,7 +317,7 @@ }) this.updateCol(column) } else if (column.type === 'custom') { - let newcard = {uuid: Utils.getuuid(), focus: true, eleType: 'text', datatype: 'dynamic', style: {paddingLeft: '4px'}} + let newcard = {uuid: Utils.getuuid(), focus: true, width: 24, eleType: 'text', datatype: 'dynamic', style: {paddingLeft: '4px'}} // 娉ㄥ唽浜嬩欢-娣诲姞鍏冪礌 MKEmitter.emit('cardAddElement', [config.uuid, column.uuid], newcard) diff --git a/src/menu/modalconfig/index.jsx b/src/menu/modalconfig/index.jsx index e6843e3..ad2443b 100644 --- a/src/menu/modalconfig/index.jsx +++ b/src/menu/modalconfig/index.jsx @@ -144,6 +144,13 @@ _tabIndex++ } + if (item.type === 'switch') { + _linksupFields.push({ + field: item.field, + label: _linkIndex + '銆�' + item.label + }) + } + if (!['select', 'link', 'radio', 'checkcard'].includes(item.type)) return if (item.type === 'checkcard' && item.multiple === 'true') return // 閫夐」鍗″閫� if (item.field && !uniq.has(item.field)) { diff --git a/src/mob/modalconfig/index.jsx b/src/mob/modalconfig/index.jsx index f8011a9..1c3a687 100644 --- a/src/mob/modalconfig/index.jsx +++ b/src/mob/modalconfig/index.jsx @@ -147,6 +147,13 @@ _tabIndex++ } + if (item.type === 'switch') { + _linksupFields.push({ + field: item.field, + label: _linkIndex + '銆�' + item.label + }) + } + if (!['select', 'link', 'radio', 'checkcard'].includes(item.type)) return if (item.type === 'checkcard' && item.multiple === 'true') return // 閫夐」鍗″閫� if (item.field && !uniq.has(item.field)) { diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index 6ee4ff0..9c61db0 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -726,7 +726,7 @@ className = 'checkcard' 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})}/>) + content = (<MKSwitch 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') { diff --git a/src/templates/modalconfig/index.jsx b/src/templates/modalconfig/index.jsx index 9f32db8..58bbf79 100644 --- a/src/templates/modalconfig/index.jsx +++ b/src/templates/modalconfig/index.jsx @@ -225,6 +225,13 @@ _tabIndex++ } + if (item.type === 'switch') { + _linksupFields.push({ + field: item.field, + label: _linkIndex + '銆�' + item.label + }) + } + if (!['select', 'link', 'radio', 'checkcard'].includes(item.type)) return if (item.type === 'checkcard' && item.multiple === 'true') return // 閫夐」鍗″閫� if (item.field && !uniq.has(item.field)) { diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index 0498a8c..522f79e 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -2362,6 +2362,11 @@ }) } + let initval = card.initval || '' + if (card.type === 'switch') { + initval = card.initval === true + } + return [ { type: 'text', @@ -2391,7 +2396,7 @@ type: 'text', key: 'initval', label: Formdict['header.form.initval'], - initVal: card.initval || '', + initVal: initval, required: false }, { diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index 7d1f0c2..2e1b2d3 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -491,6 +491,7 @@ rules = [ { required: item.required, message: dict['form.required.select'] + item.label + '!' } ] + initVal = item.initVal content = <Radio.Group onChange={(e) => {this.optionChange(item.key, e.target.value)}}> {item.options.map(option => { -- Gitblit v1.8.0