From b8e1395f02c929eaa96b949cf6027ee2a43856a6 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 06 九月 2022 19:03:37 +0800 Subject: [PATCH] 2022-09-06 --- src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx | 34 src/templates/zshare/modalform/index.jsx | 2 src/menu/components/share/markcomponent/index.jsx | 3 src/tabviews/zshare/normalTable/index.jsx | 61 + src/tabviews/custom/components/card/cardItem/index.jsx | 5 src/menu/components/card/cardcellcomponent/dragaction/index.jsx | 2 src/menu/components/card/cardcellcomponent/elementform/index.jsx | 8 src/menu/components/table/base-table/columns/editColumn/formconfig.jsx | 32 public/options.json | 10 src/menu/components/share/actioncomponent/dragaction/index.jsx | 2 src/tabviews/zshare/actionList/exceloutbutton/index.jsx | 59 + src/menu/components/card/cardcellcomponent/dragaction/card.jsx | 2 src/menu/components/table/normal-table/columns/editColumn/index.jsx | 4 src/templates/sharecomponent/columncomponent/index.jsx | 6 src/tabviews/custom/components/share/normalTable/index.jsx | 15 src/tabviews/zshare/mutilform/mkInput/index.jsx | 8 src/tabviews/subtable/index.jsx | 9 src/tabviews/subtabtable/index.jsx | 9 src/tabviews/commontable/index.jsx | 9 src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx | 2 src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx | 39 src/tabviews/custom/components/card/table-card/index.jsx | 5 src/menu/components/search/main-search/dategroup/index.scss | 1 src/tabviews/custom/components/card/cardcellList/index.jsx | 1217 +++++++++++++++++++------------------- src/tabviews/zshare/actionList/tabbutton/index.jsx | 5 src/menu/components/table/base-table/columns/editColumn/index.jsx | 4 src/templates/sharecomponent/searchcomponent/dategroup/index.scss | 1 src/menu/components/card/cardcellcomponent/index.jsx | 1 src/templates/zshare/formconfig.jsx | 79 + src/menu/components/share/actioncomponent/formconfig.jsx | 4 src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx | 5 src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 20 src/tabviews/zshare/mutilform/index.jsx | 2 src/menu/components/card/cardcellcomponent/formconfig.jsx | 22 src/tabviews/custom/index.jsx | 83 ++ src/templates/modalconfig/source.jsx | 10 src/menu/components/table/base-table/columns/index.jsx | 4 src/templates/sharecomponent/actioncomponent/dragaction/index.jsx | 4 src/tabviews/zshare/topSearch/dategroup/index.scss | 3 src/menu/components/table/normal-table/columns/index.jsx | 4 src/menu/components/share/markcomponent/markform/index.jsx | 10 src/tabviews/zshare/normalTable/index.scss | 15 src/menu/components/table/edit-table/columns/index.jsx | 2 src/templates/sharecomponent/columncomponent/columnform/index.jsx | 2 44 files changed, 987 insertions(+), 837 deletions(-) diff --git a/public/options.json b/public/options.json index 523da64..fbdb8bf 100644 --- a/public/options.json +++ b/public/options.json @@ -1,12 +1,12 @@ { - "appId": "201912040924165801464FF1788654BC5AC73", - "appkey": "20191106103859640976D6E924E464D029CF0", + "appId": "202108312122504607B107A83F55B40C98CCF", + "appkey": "20210831212235413F287EC3BF489424496C8", "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", "systemType": "", "externalDatabase": "false", "lineColor": "", "filter": "false", - "defaultApp": "mk", + "defaultApp": "mkindustry", "defaultLang": "zh-CN", "WXAppID": "", "WXminiAppID": "", @@ -15,6 +15,6 @@ "probation": "", "keepPassword": "true", "platforms": ["H5", "wechat", "android", "ios", "wxMiniProgram"], - "host": "http://qingqiumarket.cn", - "service": "MKWMS/" + "host": "http://demo.mk9h.cn", + "service": "erp_new/" } \ No newline at end of file diff --git a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx index 2f702d5..b5f393b 100644 --- a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx +++ b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx @@ -203,7 +203,7 @@ <CopyOutlined className="copy" title="澶嶅埗" onClick={() => copyCard(id)} /> <CloseOutlined className="close" title="鍒犻櫎" onClick={() => delCard(id)} /> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={() => changeStyle(id)}/> - {['text', 'number', 'slider', 'sequence', 'formula'].includes(card.eleType) ? <MarkColumn columns={fields} type={card.eleType} marks={card.marks} onSubmit={(vals) => updateMarks({...card, marks: vals})} /> : null } + {['text', 'number', 'slider', 'sequence', 'formula'].includes(card.eleType) ? <MarkColumn field={card.field || ''} columns={fields} type={card.eleType} marks={card.marks} onSubmit={(vals) => updateMarks({...card, marks: vals})} /> : null } </div> } trigger="hover"> <div ref={node => drag(drop(node))} className={'ant-col card-cell ant-col-' + card.width}> diff --git a/src/menu/components/card/cardcellcomponent/dragaction/index.jsx b/src/menu/components/card/cardcellcomponent/dragaction/index.jsx index bba223b..f6cdeac 100644 --- a/src/menu/components/card/cardcellcomponent/dragaction/index.jsx +++ b/src/menu/components/card/cardcellcomponent/dragaction/index.jsx @@ -48,8 +48,6 @@ let _val = fromJS(copycard).toJS() if (_val.control) { - _val.control = '' - delete _val.controlField delete _val.controlVal } diff --git a/src/menu/components/card/cardcellcomponent/elementform/index.jsx b/src/menu/components/card/cardcellcomponent/elementform/index.jsx index 3492ada..8964a75 100644 --- a/src/menu/components/card/cardcellcomponent/elementform/index.jsx +++ b/src/menu/components/card/cardcellcomponent/elementform/index.jsx @@ -16,7 +16,7 @@ const cardTypeOptions = { sequence: ['eleType', 'width'], text: ['eleType', 'datatype', 'format', 'width', 'height', 'prefix', 'postfix', 'link', 'anchors', 'noValue', 'bgImage', 'fixStyle', 'copyable'], - number: ['eleType', 'datatype', 'format', 'width', 'height', 'prefix', 'postfix', 'noValue', 'fixStyle'], + number: ['eleType', 'datatype', 'width', 'height', 'prefix', 'postfix', 'noValue', 'fixStyle'], picture: ['eleType', 'datatype', 'width', 'lenWidRadio', 'maxWidth', 'link', 'noValue'], video: ['eleType', 'datatype', 'width', 'aspectRatio', 'autoPlay', 'loop', 'startTime', 'noValue', 'posterType'], icon: ['eleType', 'icon', 'datatype', 'width'], @@ -66,7 +66,7 @@ item.options = [] config.columns.forEach(col => { let label = col.label - if (label !== col.field) { + if (label.toLowerCase() !== col.field.toLowerCase()) { label = col.field + ' ' + col.label } if (/^(Int|Decimal)/ig.test(col.datatype) && (card.eleType === 'number' || card.eleType === 'slider')) { @@ -112,7 +112,7 @@ if (datatype === 'dynamic') { _options.push('field') if (eleType === 'number') { - _options.push('decimal') + _options.push('decimal', 'format') } } else if (eleType === 'picture' || eleType === 'video') { _options.push('url') @@ -175,7 +175,7 @@ item.options = [] config.columns.forEach(col => { let label = col.label - if (label !== col.field) { + if (label.toLowerCase() !== col.field.toLowerCase()) { label = col.field + ' ' + col.label } diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx index 5ea5621..1529d90 100644 --- a/src/menu/components/card/cardcellcomponent/formconfig.jsx +++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx @@ -161,6 +161,16 @@ required: true }, { + type: 'number', + key: 'decimal', + min: 0, + max: 18, + decimal: 0, + label: '灏忔暟浣�', + initVal: card.decimal === undefined ? '' : card.decimal, + required: false + }, + { type: 'select', key: 'format', label: '鏍煎紡鍖�', @@ -198,16 +208,6 @@ { value: 'YYYY-MM-DD HH:mm', text: 'YYYY-MM-DD HH:mm' }, { value: 'YYYY-MM-DD HH:mm:ss', text: 'YYYY-MM-DD HH:mm:ss' }, ] - }, - { - type: 'number', - key: 'decimal', - min: 0, - max: 18, - decimal: 0, - label: '灏忔暟浣�', - initVal: card.decimal === undefined ? '' : card.decimal, - required: false }, { type: 'text', @@ -347,7 +347,7 @@ max: 10, label: '楂樺害(琛�)', initVal: card.height !== undefined ? card.height : 1, - tooltip: '鍐呭鏄剧ず琛屾暟锛屽�间负绌烘椂楂樺害鑷�傚簲锛屾敞锛氳嚜閫傚簲楂樺害浠呭湪璁剧疆鍗$墖楂樺害鍚庢湁鏁堛��', + tooltip: '鍐呭鏄剧ず琛屾暟锛屽�间负绌烘椂楂樺害鑷�傚簲銆�', required: false }, { diff --git a/src/menu/components/card/cardcellcomponent/index.jsx b/src/menu/components/card/cardcellcomponent/index.jsx index efcc4af..146bf94 100644 --- a/src/menu/components/card/cardcellcomponent/index.jsx +++ b/src/menu/components/card/cardcellcomponent/index.jsx @@ -423,6 +423,7 @@ res.eleType = cell.eleType || null res.style = cell.style || null res.modal = cell.modal || null + res.wrapStyle = cell.wrapStyle || null // res = {...cell, ...res} // if (!res.control) { diff --git a/src/menu/components/search/main-search/dategroup/index.scss b/src/menu/components/search/main-search/dategroup/index.scss index 3e0369e..57adcd0 100644 --- a/src/menu/components/search/main-search/dategroup/index.scss +++ b/src/menu/components/search/main-search/dategroup/index.scss @@ -13,6 +13,7 @@ } .ant-tag-checkable-checked { border-color: #1890ff; + background: #1890ff; } } diff --git a/src/menu/components/share/actioncomponent/dragaction/index.jsx b/src/menu/components/share/actioncomponent/dragaction/index.jsx index 13bbd48..77e72fe 100644 --- a/src/menu/components/share/actioncomponent/dragaction/index.jsx +++ b/src/menu/components/share/actioncomponent/dragaction/index.jsx @@ -64,8 +64,6 @@ let _val = fromJS(copycard).toJS() if (_val.control) { - _val.control = '' - delete _val.controlField delete _val.controlVal } diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index abacec9..789803c 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -285,7 +285,7 @@ type: 'radio', key: 'procMode', label: '鍙傛暟澶勭悊', - initVal: card.procMode || 'system', + initVal: card.procMode || (card.innerFunc ? 'inner' : 'system'), required: true, options: [{ value: 'system', @@ -433,7 +433,7 @@ type: 'radio', key: 'callbackType', label: '鍥炶皟鏂瑰紡', - initVal: card.callbackType || 'script', + initVal: card.callbackType || (card.callbackFunc ? 'func' : 'none'), tooltip: '浣跨敤鍚庡彴鑴氭湰鎵ц鏃讹紝闇�瑕侀厤鍚堣鍒掍换鍔°��', required: true, options: [{ diff --git a/src/menu/components/share/markcomponent/index.jsx b/src/menu/components/share/markcomponent/index.jsx index 1da2ecd..7945663 100644 --- a/src/menu/components/share/markcomponent/index.jsx +++ b/src/menu/components/share/markcomponent/index.jsx @@ -19,6 +19,7 @@ class MarkColumn extends Component { static propTpyes = { + field: PropTypes.any, columns: PropTypes.array, // 鏄剧ず鍒� marks: PropTypes.object, onSubmit: PropTypes.func @@ -341,7 +342,7 @@ onCancel={() => { this.setState({ visible: false }) }} destroyOnClose > - <MarkForm dict={dict} signs={signs} columns={options} markChange={this.markChange}/> + <MarkForm field={this.props.field} dict={dict} signs={signs} columns={options} markChange={this.markChange}/> <Col style={{fontSize: '12px', color: '#757575', paddingLeft: '10px'}} span={24}>娉細浠庝笂鍒颁笅锛屽尮閰嶇涓�涓鍚堟潯浠剁殑鏍囪銆�</Col> <EditTable actions={['edit', 'move', 'del']} data={marks} columns={markColumns} onChange={(marks) => this.setState({marks})}/> </Modal> diff --git a/src/menu/components/share/markcomponent/markform/index.jsx b/src/menu/components/share/markcomponent/markform/index.jsx index 560f22d..2809114 100644 --- a/src/menu/components/share/markcomponent/markform/index.jsx +++ b/src/menu/components/share/markcomponent/markform/index.jsx @@ -9,6 +9,7 @@ class UniqueForm extends Component { static propTpyes = { dict: PropTypes.object, // 瀛楀吀椤� + field: PropTypes.any, columns: PropTypes.array, // 鍒楀悕闆嗗悎 signs: PropTypes.array, // 鏍囪绫诲瀷 markChange: PropTypes.func // 淇敼鍑芥暟 @@ -24,7 +25,7 @@ } render() { - const { columns, signs } = this.props + const { columns, signs, field } = this.props const { getFieldDecorator } = this.props.form const formItemLayout = { labelCol: { @@ -37,13 +38,18 @@ } } + let initVal = [] + if (field) { + initVal = [field, 'static'] + } + return ( <Form {...formItemLayout} className="normal-table-mark-form"> <Row gutter={24}> <Col span={6}> <Form.Item label={'瀵规瘮瀛楁'}> {getFieldDecorator('field', { - initialValue: [], + initialValue: initVal, rules: [ { required: true, diff --git a/src/menu/components/table/base-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/base-table/columns/editColumn/formconfig.jsx index 8ff4f0d..547c1c6 100644 --- a/src/menu/components/table/base-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/base-table/columns/editColumn/formconfig.jsx @@ -276,6 +276,17 @@ readonly: false }, { + type: 'number', + key: 'span', + min: 1, + max: 24, + precision: 0, + label: '鍥剧墖瀹藉害', + initVal: card.span || 24, + tooltip: '鏍呮牸甯冨眬锛岀瓑鍒嗕负24浠姐��', + required: true + }, + { type: 'select', key: 'lenWidRadio', label: '闀垮姣�', @@ -299,27 +310,6 @@ { value: '2:3', text: '2:3' }, { value: '9:16', text: '9:16' }, ] - }, - { - type: 'radio', - key: 'picSort', - label: '鍥剧墖鎺掑垪', - initVal: card.picSort || '1', - tooltip: '鍚屼竴鍗曞厓鏍煎唴锛屽惈鏈夊寮犲浘鐗囨椂鐨勫垪鏁般��', - required: false, - options: [{ - value: '1', - text: '1' - }, { - value: '2', - text: '2' - }, { - value: '3', - text: '3' - }, { - value: '4', - text: '4' - }] }, { type: 'radio', diff --git a/src/menu/components/table/base-table/columns/editColumn/index.jsx b/src/menu/components/table/base-table/columns/editColumn/index.jsx index 5a41606..907ebb2 100644 --- a/src/menu/components/table/base-table/columns/editColumn/index.jsx +++ b/src/menu/components/table/base-table/columns/editColumn/index.jsx @@ -14,7 +14,7 @@ number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'blacklist', 'perspective', 'sum', 'rowspan'], link: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'joint', 'Width', 'blacklist', 'nameField'], textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'blacklist'], - picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'blacklist', 'scale', 'lenWidRadio', 'picSort'], + picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'blacklist', 'scale', 'lenWidRadio', 'span'], colspan: ['label', 'type', 'Align', 'Hide', 'blacklist'], custom: ['label', 'type', 'Align', 'Hide', 'Width', 'blacklist'], action: ['label', 'type', 'Align', 'Width'], @@ -380,7 +380,7 @@ <Modal title="鏄剧ず鍒楃紪杈�" visible={visible} - width={800} + width={850} maskClosable={false} onOk={this.handleSubmit} onCancel={this.editModalCancel} diff --git a/src/menu/components/table/base-table/columns/index.jsx b/src/menu/components/table/base-table/columns/index.jsx index f22548c..44be56a 100644 --- a/src/menu/components/table/base-table/columns/index.jsx +++ b/src/menu/components/table/base-table/columns/index.jsx @@ -66,7 +66,7 @@ {column && column.type === 'custom' ? <PasteComponent options={['customCardElement']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} {column && column.type === 'custom' ? <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={() => this.props.changeStyle(column)}/> : null} <DeleteOutlined className="close" title="鍒犻櫎" onClick={this.deleteCol} /> - {column && ['text', 'number', 'formula'].includes(column.type) ? <MarkColumn columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } + {column && ['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } </div> } trigger="hover"> {children} @@ -84,7 +84,7 @@ <EditOutlined className="edit" title="缂栬緫" onClick={() => this.props.editColumn(column)} /> {column.type === 'custom' ? <PasteComponent options={['customCardElement']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} <DeleteOutlined className="close" title="鍒犻櫎" onClick={this.deleteCol} /> - {column && ['text', 'number', 'formula'].includes(column.type) ? <MarkColumn columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } + {column && ['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } </div> } trigger="hover"> {children} 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 5e32454..06fefad 100644 --- a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx @@ -384,7 +384,7 @@ precision: 0, label: Formdict['header.form.decimal'], initVal: card.decimal || 0, - required: true + required: false }, { type: 'number', diff --git a/src/menu/components/table/edit-table/columns/index.jsx b/src/menu/components/table/edit-table/columns/index.jsx index 3645ae2..870e23a 100644 --- a/src/menu/components/table/edit-table/columns/index.jsx +++ b/src/menu/components/table/edit-table/columns/index.jsx @@ -72,7 +72,7 @@ {column.type === 'action' ? <PasteComponent options={['action']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} {column.type === 'custom' ? <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={() => this.props.changeStyle(column)}/> : null} <DeleteOutlined className="close" title="鍒犻櫎" onClick={this.deleteCol} /> - {['text', 'number', 'formula'].includes(column.type) ? <MarkColumn columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } + {['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } </div> } trigger="hover"> {children} diff --git a/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx index 8ff4f0d..937165d 100644 --- a/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx @@ -217,7 +217,7 @@ decimal: 0, label: Formdict['header.form.decimal'], initVal: card.decimal || 0, - required: true + required: false }, { type: 'select', @@ -276,6 +276,17 @@ readonly: false }, { + type: 'number', + key: 'span', + min: 1, + max: 24, + precision: 0, + label: '鍥剧墖瀹藉害', + initVal: card.span || 24, + tooltip: '鏍呮牸甯冨眬锛岀瓑鍒嗕负24浠姐��', + required: true + }, + { type: 'select', key: 'lenWidRadio', label: '闀垮姣�', @@ -299,27 +310,6 @@ { value: '2:3', text: '2:3' }, { value: '9:16', text: '9:16' }, ] - }, - { - type: 'radio', - key: 'picSort', - label: '鍥剧墖鎺掑垪', - initVal: card.picSort || '1', - tooltip: '鍚屼竴鍗曞厓鏍煎唴锛屽惈鏈夊寮犲浘鐗囨椂鐨勫垪鏁般��', - required: false, - options: [{ - value: '1', - text: '1' - }, { - value: '2', - text: '2' - }, { - value: '3', - text: '3' - }, { - value: '4', - text: '4' - }] }, { type: 'radio', diff --git a/src/menu/components/table/normal-table/columns/editColumn/index.jsx b/src/menu/components/table/normal-table/columns/editColumn/index.jsx index 5a41606..907ebb2 100644 --- a/src/menu/components/table/normal-table/columns/editColumn/index.jsx +++ b/src/menu/components/table/normal-table/columns/editColumn/index.jsx @@ -14,7 +14,7 @@ number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'blacklist', 'perspective', 'sum', 'rowspan'], link: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'joint', 'Width', 'blacklist', 'nameField'], textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'blacklist'], - picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'blacklist', 'scale', 'lenWidRadio', 'picSort'], + picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'blacklist', 'scale', 'lenWidRadio', 'span'], colspan: ['label', 'type', 'Align', 'Hide', 'blacklist'], custom: ['label', 'type', 'Align', 'Hide', 'Width', 'blacklist'], action: ['label', 'type', 'Align', 'Width'], @@ -380,7 +380,7 @@ <Modal title="鏄剧ず鍒楃紪杈�" visible={visible} - width={800} + width={850} maskClosable={false} onOk={this.handleSubmit} onCancel={this.editModalCancel} diff --git a/src/menu/components/table/normal-table/columns/index.jsx b/src/menu/components/table/normal-table/columns/index.jsx index 608f8e7..e4c9a64 100644 --- a/src/menu/components/table/normal-table/columns/index.jsx +++ b/src/menu/components/table/normal-table/columns/index.jsx @@ -67,7 +67,7 @@ {column && column.type === 'action' ? <PasteComponent options={['action']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} {column && column.type === 'custom' ? <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={() => this.props.changeStyle(column)}/> : null} <DeleteOutlined className="close" title="鍒犻櫎" onClick={this.deleteCol} /> - {column && ['text', 'number', 'formula'].includes(column.type) ? <MarkColumn columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } + {column && ['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } </div> } trigger="hover"> {children} @@ -85,7 +85,7 @@ <EditOutlined className="edit" title="缂栬緫" onClick={() => this.props.editColumn(column)} /> {column.type === 'custom' ? <PasteComponent options={['customCardElement']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} <DeleteOutlined className="close" title="鍒犻櫎" onClick={this.deleteCol} /> - {column && ['text', 'number', 'formula'].includes(column.type) ? <MarkColumn columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } + {column && ['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } </div> } trigger="hover"> {children} diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index 14f6e16..b861521 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -341,6 +341,15 @@ col.linkThdMenu = '' } + if (col.type === 'number') { + col.decimal = col.decimal || 0 + col.round = Math.pow(10, col.decimal) + + if (col.format === 'percent') { + col.decimal = col.decimal > 2 ? col.decimal - 2 : 0 + } + } + col.nameField && _arrField.push(col.nameField) // 閾炬帴鍚嶅瓧娈� if (col.Hide !== 'true' && col.type === 'number' && col.sum === 'true') { statFields.push(col) diff --git a/src/tabviews/custom/components/card/cardItem/index.jsx b/src/tabviews/custom/components/card/cardItem/index.jsx index 6ba7e42..cc3c5e1 100644 --- a/src/tabviews/custom/components/card/cardItem/index.jsx +++ b/src/tabviews/custom/components/card/cardItem/index.jsx @@ -85,11 +85,12 @@ let menu = null if (card.setting.MenuID) { + let _menu = this.props.permMenus.filter(m => m.MenuID === card.setting.MenuID)[0] || '' menu = { MenuID: card.setting.MenuID, - MenuName: card.setting.MenuName, + MenuName: _menu ? _menu.MenuName : card.setting.MenuName, MenuNo: card.setting.MenuNo, - type: card.setting.tabType + type: _menu ? _menu.type : card.setting.tabType } } else if (card.setting.menu && card.setting.menu.length > 0) { let menu_id = card.setting.menu.slice(-1)[0] diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index ac0e2cc..9c9e2c4 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -44,21 +44,7 @@ elements: PropTypes.array, // 鍏冪礌闆� } - state = { - card: null, // 缂栬緫涓厓绱� - elements: null, // 鎸夐挳缁� - } - - /** - * @description 鎼滅储鏉′欢鍒濆鍖� - */ - UNSAFE_componentWillMount () { - const { elements } = this.props - - this.setState({ - elements: fromJS(elements).toJS() - }) - } + state = {} shouldComponentUpdate (nextProps, nextState) { return !is(fromJS(this.state), fromJS(nextState)) || !is(fromJS(this.props), fromJS(nextProps)) @@ -237,628 +223,562 @@ return color } - getContent = (card) => { - const { data, cards } = this.props + getContent = () => { + const { data, cards, elements } = this.props - if (card.eleType === 'sequence') { - let _style = {} - if (card.marks) { - _style.width = card.innerHeight - _style.height = card.innerHeight - _style.lineHeight = card.innerHeight + 'px' + let contents = [] - let mark = getMark(card.marks, data, _style) - - _style = mark.style - } - return ( - <Col key={card.uuid} span={card.width}> - <div style={card.style}> - <div className="ant-mk-text"><span className="sequence-wrap" style={_style}>{data.$Index || ''}</span></div> - </div> - </Col> - ) - } else if (card.eleType === 'text') { - let val = '' - let _style = card.style ? {...card.style} : {} - - if (card.datatype === 'static') { - val = card.value || '' - if (/@username@|@fullName@|@mk_city@|@bid@/ig.test(val)) { - let userName = sessionStorage.getItem('User_Name') || '' - let fullName = sessionStorage.getItem('Full_Name') || '' - let city = sessionStorage.getItem('city') || '' - let bid = data.$$BID || '' - val = val.replace(/@username@/ig, userName).replace(/@fullName@/ig, fullName).replace(/@mk_city@/ig, city).replace(/@bid@/ig, bid) + elements.forEach(card => { + if (card.eleType === 'sequence') { + let _style = {} + if (card.marks) { + _style.width = card.innerHeight + _style.height = card.innerHeight + _style.lineHeight = card.innerHeight + 'px' + + let mark = getMark(card.marks, data, _style) + + _style = mark.style } - } else if (data.hasOwnProperty(card.field)) { - val = data[card.field] - } - - if (val === '' && card.noValue === 'hide') { // 绌哄�奸殣钘� - return null - } - - if (val !== '' && card.format) { - let _val = null - - if (card.format === 'calendar1') { - _val = moment(val).calendar(null, { - sameDay: '[浠婂ぉ] ahh:mm', - nextDay: '[鏄庡ぉ] ahh:mm', - nextWeek: 'MM鏈圖D鏃� ahh:mm', - lastDay: '[鏄ㄥぉ] ahh:mm', - lastWeek: 'dddd ahh:mm', - sameElse: 'MM鏈圖D鏃� ahh:mm' - }) - } else if (card.format === 'calendar2') { - let time = new Date(val).getTime() - if (!isNaN(time)) { - time = parseInt(time / 60000) // 鏃堕棿鍊� - let now = parseInt(new Date().getTime() / 60000) // 褰撳墠鏃堕棿鍊� - let start = new Date(new Date().toDateString()).getTime() / 60000 // 浠婂ぉ闆剁偣鏃堕棿鍊� - let split = now - time - - if (split < 0) { // 鏃堕棿鍊煎湪褰撳墠鏃堕棿涔嬪悗 - _val = moment(val).format('MM鏈圖D鏃� HH:mm') - } else if (split < 3) { - _val = '鍒氬垰' - } else if (split < 5) { - _val = '3鍒嗛挓鍓�' - } else if (split < 10) { - _val = '5鍒嗛挓鍓�' - } else if (split < 20) { - _val = '10鍒嗛挓鍓�' - } else if (split < 30) { - _val = '20鍒嗛挓鍓�' - } else if (split < 60) { - _val = '30鍒嗛挓鍓�' - } else if (split < 420 || time > start) { // 7灏忔椂鍐呮垨鏃堕棿鍊煎湪浠婂ぉ闆剁偣鍚� - _val = parseInt(split / 60) + '灏忔椂鍓�' - } else { // 鏃堕棿鍊煎湪浠婂ぉ闆剁偣涔嬪墠 - let _day = parseInt((start - time) / (24 * 60)) + 1 - if (_day === 1) { - _val = '鏄ㄥぉ' - } else if (_day <= 30) { - _val = _day + '澶╁墠' - } else { + contents.push( + <Col key={card.uuid} span={card.width}> + <div style={card.style}> + <div className="ant-mk-text"><span className="sequence-wrap" style={_style}>{data.$Index || ''}</span></div> + </div> + </Col> + ) + } else if (card.eleType === 'text') { + let val = '' + let _style = card.style ? {...card.style} : {} + + if (card.datatype === 'static') { + val = card.value || '' + if (/@username@|@fullName@|@mk_city@|@bid@/ig.test(val)) { + let userName = sessionStorage.getItem('User_Name') || '' + let fullName = sessionStorage.getItem('Full_Name') || '' + let city = sessionStorage.getItem('city') || '' + let bid = data.$$BID || '' + val = val.replace(/@username@/ig, userName).replace(/@fullName@/ig, fullName).replace(/@mk_city@/ig, city).replace(/@bid@/ig, bid) + } + } else if (data.hasOwnProperty(card.field)) { + val = data[card.field] + } + + if (val === '' && card.noValue === 'hide') { // 绌哄�奸殣钘� + return null + } + + if (val !== '' && card.format) { + let _val = null + + if (card.format === 'calendar1') { + _val = moment(val).calendar(null, { + sameDay: '[浠婂ぉ] ahh:mm', + nextDay: '[鏄庡ぉ] ahh:mm', + nextWeek: 'MM鏈圖D鏃� ahh:mm', + lastDay: '[鏄ㄥぉ] ahh:mm', + lastWeek: 'dddd ahh:mm', + sameElse: 'MM鏈圖D鏃� ahh:mm' + }) + } else if (card.format === 'calendar2') { + let time = new Date(val).getTime() + if (!isNaN(time)) { + time = parseInt(time / 60000) // 鏃堕棿鍊� + let now = parseInt(new Date().getTime() / 60000) // 褰撳墠鏃堕棿鍊� + let start = new Date(new Date().toDateString()).getTime() / 60000 // 浠婂ぉ闆剁偣鏃堕棿鍊� + let split = now - time + + if (split < 0) { // 鏃堕棿鍊煎湪褰撳墠鏃堕棿涔嬪悗 _val = moment(val).format('MM鏈圖D鏃� HH:mm') + } else if (split < 3) { + _val = '鍒氬垰' + } else if (split < 5) { + _val = '3鍒嗛挓鍓�' + } else if (split < 10) { + _val = '5鍒嗛挓鍓�' + } else if (split < 20) { + _val = '10鍒嗛挓鍓�' + } else if (split < 30) { + _val = '20鍒嗛挓鍓�' + } else if (split < 60) { + _val = '30鍒嗛挓鍓�' + } else if (split < 420 || time > start) { // 7灏忔椂鍐呮垨鏃堕棿鍊煎湪浠婂ぉ闆剁偣鍚� + _val = parseInt(split / 60) + '灏忔椂鍓�' + } else { // 鏃堕棿鍊煎湪浠婂ぉ闆剁偣涔嬪墠 + let _day = parseInt((start - time) / (24 * 60)) + 1 + if (_day === 1) { + _val = '鏄ㄥぉ' + } else if (_day <= 30) { + _val = _day + '澶╁墠' + } else { + _val = moment(val).format('MM鏈圖D鏃� HH:mm') + } } } - } - } else { - _val = moment(val).format(card.format) - } - - // if (card.format === 'YYYY-MM-DD' && /^[1-9]\d{3}(-|\/)(0[1-9]|1[0-2])(-|\/)(0[1-9]|[1-2][0-9]|3[0-1])/.test(val)) { - // val = `${val.substr(0, 4)}-${val.substr(5, 2)}-${val.substr(8, 2)}` - // } - if (_val && _val !== 'Invalid date') { - val = _val - } - } - - if (val !== '') { - let orival = val - if (card.format === 'encryption') { - val = <Encrypts value={val} /> - } - if (card.fixStyle === 'alone') { - let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight} - val = <><span style={_s}>{card.prefix || ''}</span>{val}<span style={_s}>{card.postfix || ''}</span></> - } else { - val = <span>{card.prefix || ''}{val}{card.postfix || ''}</span> - } - if (card.copyable === 'true') { - val = <Paragraph copyable={{ text: orival }}>{val}</Paragraph> - } - } - - if (card.marks) { - let mark = getMark(card.marks, data, _style) - - _style = mark.style - - if (mark.icon) { - if (mark.position === 'front') { - val = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {val}</span> } else { - val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> - } - } - } - - if (card.link || (card.anchors && card.anchors.length > 0)) { - _style.cursor = 'pointer' - } - - if (card.bgImage && data[card.bgImage]) { - _style.backgroundImage = `url('${data[card.bgImage]}')` - } - - return ( - <Col key={card.uuid} span={card.width}> - <div style={_style} onClick={(e) => {this.openNewView(e, card)}}> - <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> - </div> - </Col> - ) - } else if (card.eleType === 'number') { - let val = '' - let _style = card.style ? {...card.style} : {} - - if (card.datatype === 'static') { - val = card.value - } else if (data.hasOwnProperty(card.field)) { - val = data[card.field] - } - - if (!val && card.noValue === 'hide') { // 绌哄�奸殣钘� - return null - } - - if (typeof(val) === 'number') { - if (card.format === 'percent') { - val = val * 100 - } else if (card.format === 'abs') { - val = Math.abs(val) - } - - if (typeof(card.decimal) === 'number') { - let decimal = card.decimal - - if (card.format === 'percent') { - decimal = decimal - 2 - } - if (decimal < 0) { - decimal = 0 + _val = moment(val).format(card.format) } - val = val.toFixed(decimal) - } else { - val = '' + val + // if (card.format === 'YYYY-MM-DD' && /^[1-9]\d{3}(-|\/)(0[1-9]|1[0-2])(-|\/)(0[1-9]|[1-2][0-9]|3[0-1])/.test(val)) { + // val = `${val.substr(0, 4)}-${val.substr(5, 2)}-${val.substr(8, 2)}` + // } + if (_val && _val !== 'Invalid date') { + val = _val + } + } + + if (val !== '') { + let orival = val + if (card.format === 'encryption') { + val = <Encrypts value={val} /> + } + if (card.fixStyle === 'alone') { + let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight} + val = <><span style={_s}>{card.prefix || ''}</span>{val}<span style={_s}>{card.postfix || ''}</span></> + } else { + val = <span>{card.prefix || ''}{val}{card.postfix || ''}</span> + } + if (card.copyable === 'true') { + val = <Paragraph copyable={{ text: orival }}>{val}</Paragraph> + } + } + + if (card.marks) { + let mark = getMark(card.marks, data, _style) + + _style = mark.style + + if (mark.icon) { + if (mark.position === 'front') { + val = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {val}</span> + } else { + val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> + } + } + } + + if (card.link || (card.anchors && card.anchors.length > 0)) { + _style.cursor = 'pointer' + } + + if (card.bgImage && data[card.bgImage]) { + _style.backgroundImage = `url('${data[card.bgImage]}')` + } + + contents.push( + <Col key={card.uuid} span={card.width}> + <div style={_style} onClick={(e) => {this.openNewView(e, card)}}> + <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> + </div> + </Col> + ) + } else if (card.eleType === 'number') { + let val = '' + let _style = card.style ? {...card.style} : {} + + if (card.datatype === 'static') { + val = card.value + } else if (data.hasOwnProperty(card.field)) { + val = data[card.field] + } + + if (!val && card.noValue === 'hide') { // 绌哄�奸殣钘� + return null + } + + if (typeof(val) === 'number') { + if (card.round) { + val = Math.round(val * card.round) / card.round + } + if (card.format === 'percent') { + val = val * 100 + } else if (card.format === 'abs') { + val = Math.abs(val) + } + + if (card.round) { + val = val.toFixed(card.decimal) + } else { + val = '' + val + } + + if (card.format === 'percent' && (!card.postfix || card.postfix.indexOf('%') === -1)) { + val = val + '%' + } else if (card.format === 'thdSeparator') { + val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') + } + } + + if (val !== '') { + if (card.fixStyle === 'alone') { + let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight} + val = <><span style={_s}>{card.prefix || ''}</span>{val}<span style={_s}>{card.postfix || ''}</span></> + } else { + val = `${card.prefix || ''}${val}${card.postfix || ''}` + } } - if (card.format === 'percent' && (!card.postfix || card.postfix.indexOf('%') === -1)) { - val = val + '%' - } else if (card.format === 'thdSeparator') { - val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') + if (card.marks) { + let mark = getMark(card.marks, data, _style) + + _style = mark.style + + if (mark.icon) { + if (mark.position === 'front') { + val = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {val}</span> + } else { + val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> + } + } } - } + + contents.push( + <Col key={card.uuid} span={card.width}> + <div style={_style}> + <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> + </div> + </Col> + ) + } else if (card.eleType === 'icon') { + let val = '' + + if (card.datatype === 'static') { + val = card.tooltip + } else if (data.hasOwnProperty(card.field)) { + val = data[card.field] + } + + contents.push( + <Col key={card.uuid} span={card.width}> + <div style={card.style}> + {val ? <Tooltip title={val}> + <MkIcon className="ant-mk-icon" style={{height: card.innerHeight || 'auto'}} type={card.icon}/> + </Tooltip> : <MkIcon className="ant-mk-icon" style={{height: card.innerHeight || 'auto'}} type={card.icon}/>} + </div> + </Col> + ) + } else if (card.eleType === 'slider') { + let val = 0 + let color = card.color + + if (card.datatype === 'static') { + val = card.value + } else if (data.hasOwnProperty(card.field)) { + val = parseFloat(data[card.field]) + if (isNaN(val)) { + val = 0 + } + } + + val = val / card.maxValue * 100 + val = parseInt(val * 100) / 100 + + if (card.marks) { + let _color = this.getColor(card.marks) + color = _color ? _color : color + } + + contents.push( + <Col key={card.uuid} span={card.width}> + <div style={card.style}> + <MkProgress value={val} config={card} color={color}/> + </div> + </Col> + ) + } else if (card.eleType === 'picture') { + let _imagestyle = {} + let _style = card.style ? {margin: '0 auto', ...card.style} : {} + let url = '' + if (card.maxWidth) { + _style.maxWidth = card.maxWidth + if (_style.marginLeft === '0px') { + delete _style.marginLeft + } + if (_style.marginRight === '0px') { + delete _style.marginRight + } + } + + if (card.datatype === 'static') { + url = card.url || '' + if (url === '@icon@') { + url = sessionStorage.getItem('avatar') || '' + } + } else { + url = data[card.field] || '' + } + + if (url === '' && card.noValue === 'hide') { // 绌哄�奸殣钘� + return null + } - if (val !== '') { + if (_style.borderRadius) { + _imagestyle.borderRadius = _style.borderRadius + } + + if (PicRadio[card.lenWidRadio]) { + _imagestyle.paddingTop = PicRadio[card.lenWidRadio] + } else { + _imagestyle.paddingTop = '100%' + } + + if (card.link) { + _style.cursor = 'pointer' + } + + let scale = url && card.scale === 'true' + let urls = url ? url.split(',').filter(Boolean) : [LostPng] + + if (!url) { + _imagestyle = {backgroundSize: 'contain'} + } + + urls.forEach((u, i) => { + contents.push(<Col key={card.uuid + i} span={card.width}> + <div style={_style} onClick={(e) => {this.openNewView(e, card)}}> + <div + className={'ant-mk-picture' + (scale ? ' scale' : '')} + onClick={(e) => { + if (!scale) return + + e.stopPropagation() + + MKEmitter.emit('mkImageScale', url, urls) + }} + style={{..._imagestyle, backgroundImage: `url('${u}')`}} + ></div> + </div> + </Col>) + }) + } else if (card.eleType === 'splitline') { + let _borderWidth = card.borderWidth === undefined ? 1 : card.borderWidth + contents.push( + <Col key={card.uuid} span={card.width} style={{minHeight: _borderWidth}}> + <div style={card.style}> + <div className="ant-mk-splitline" style={{borderColor: card.color, borderWidth: _borderWidth}}></div> + </div> + </Col> + ) + } else if (card.eleType === 'barcode') { + let val = '' + + if (card.datatype === 'static') { + val = card.value + } else if (data.hasOwnProperty(card.field)) { + val = data[card.field] || '' + } + + if (val === '' && card.noValue === 'hide') { // 绌哄�奸殣钘� + return null + } + + contents.push( + <Col key={card.uuid} span={card.width}> + <div style={card.style}> + <div style={{height: card.innerHeight || 25}}> + {val ? <BarCode card={card} value={val}/> : null} + </div> + </div> + </Col> + ) + } else if (card.eleType === 'video') { + let url = '' + + if (card.datatype === 'static') { + url = card.url + } else { + url = data[card.field] || '' + } + + if (url === '' && card.noValue === 'hide') { // 绌哄�奸殣钘� + return null + } + + let poster = '' + + if (card.posterType === 'dynamic') { + poster = data[card.posterField] || '' + } else { + poster = card.posterUrl || '' + } + + let urls = url.split(',').filter(Boolean) + + urls.forEach((u, i) => { + contents.push( + <Col key={card.uuid + i} span={card.width}> + <div className="video-wrap" style={card.style}> + <Video card={card} poster={poster} value={u}/> + </div> + </Col> + ) + }) + } else if (card.eleType === 'qrcode') { + let val = '' + + if (card.datatype === 'static') { + val = card.value + } else if (data.hasOwnProperty(card.field)) { + val = data[card.field] || '' + } + + if (val === '' && card.noValue === 'hide') { // 绌哄�奸殣钘� + return null + } + + contents.push( + <Col key={card.uuid} span={card.width}> + <div style={card.style}> + <div style={{minHeight: card.qrWidth || 50}}> + {val ? <QrCode card={card} value={val}/> : null} + </div> + </div> + </Col> + ) + } else if (card.eleType === 'currentDate') { + let val = moment().format(card.dateFormat || 'YYYY-MM-DD') + if (card.fixStyle === 'alone') { let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight} val = <><span style={_s}>{card.prefix || ''}</span>{val}<span style={_s}>{card.postfix || ''}</span></> } else { val = `${card.prefix || ''}${val}${card.postfix || ''}` } - } - - if (card.marks) { - let mark = getMark(card.marks, data, _style) - - _style = mark.style - - if (mark.icon) { - if (mark.position === 'front') { - val = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {val}</span> - } else { - val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> + + contents.push( + <Col key={card.uuid} span={card.width}> + <div className="ant-mk-date" style={card.style}> + {val} + </div> + </Col> + ) + } else if (card.eleType === 'formula') { + let val = 0 + let _style = card.style ? {...card.style} : {} + + if (card.$sync) { + if (card.eval === 'false') { + val = '' } - } - } - - return ( - <Col key={card.uuid} span={card.width}> - <div style={_style}> - <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> - </div> - </Col> - ) - } else if (card.eleType === 'icon') { - let val = '' - - if (card.datatype === 'static') { - val = card.tooltip - } else if (data.hasOwnProperty(card.field)) { - val = data[card.field] - } - - return ( - <Col key={card.uuid} span={card.width}> - <div style={card.style}> - {val ? <Tooltip title={val}> - <MkIcon className="ant-mk-icon" style={{height: card.innerHeight || 'auto'}} type={card.icon}/> - </Tooltip> : <MkIcon className="ant-mk-icon" style={{height: card.innerHeight || 'auto'}} type={card.icon}/>} - </div> - </Col> - ) - } else if (card.eleType === 'slider') { - let val = 0 - let color = card.color - - if (card.datatype === 'static') { - val = card.value - } else if (data.hasOwnProperty(card.field)) { - val = parseFloat(data[card.field]) - if (isNaN(val)) { - val = 0 - } - } - - val = val / card.maxValue * 100 - val = parseInt(val * 100) / 100 - - if (card.marks) { - let _color = this.getColor(card.marks) - color = _color ? _color : color - } - - return ( - <Col key={card.uuid} span={card.width}> - <div style={card.style}> - <MkProgress value={val} config={card} color={color}/> - </div> - </Col> - ) - } else if (card.eleType === 'picture') { - let _imagestyle = {} - let _style = card.style ? {margin: '0 auto', ...card.style} : {} - let url = '' - if (card.maxWidth) { - _style.maxWidth = card.maxWidth - if (_style.marginLeft === '0px') { - delete _style.marginLeft - } - if (_style.marginRight === '0px') { - delete _style.marginRight - } - } - - if (card.datatype === 'static') { - url = card.url || '' - if (url === '@icon@') { - url = sessionStorage.getItem('avatar') || '' - } - } else { - url = data[card.field] || '' - } - - if (url === '' && card.noValue === 'hide') { // 绌哄�奸殣钘� - return null - } - - if (url) { - _imagestyle = {backgroundImage: `url('${url}')`} - } else { - _imagestyle = {backgroundImage: `url(${LostPng})`, backgroundSize: 'contain'} - } - - if (_style.borderRadius) { - _imagestyle.borderRadius = _style.borderRadius - } - - if (PicRadio[card.lenWidRadio]) { - _imagestyle.paddingTop = PicRadio[card.lenWidRadio] - } else { - _imagestyle.paddingTop = '100%' - } - - if (card.link) { - _style.cursor = 'pointer' - } - - let scale = url && card.scale === 'true' - - return ( - <Col key={card.uuid} span={card.width}> - <div style={_style} onClick={(e) => {this.openNewView(e, card)}}> - <div - className={'ant-mk-picture' + (scale ? ' scale' : '')} - onClick={(e) => { - if (scale) { - e.stopPropagation() - } else { - return - } - - MKEmitter.emit('mkImageScale', url) - }} - style={_imagestyle} - ></div> - </div> - </Col> - ) - } else if (card.eleType === 'splitline') { - let _borderWidth = card.borderWidth === undefined ? 1 : card.borderWidth - return ( - <Col key={card.uuid} span={card.width} style={{minHeight: _borderWidth}}> - <div style={card.style}> - <div className="ant-mk-splitline" style={{borderColor: card.color, borderWidth: _borderWidth}}></div> - </div> - </Col> - ) - } else if (card.eleType === 'barcode') { - let val = '' - - if (card.datatype === 'static') { - val = card.value - } else if (data.hasOwnProperty(card.field)) { - val = data[card.field] || '' - } - - if (val === '' && card.noValue === 'hide') { // 绌哄�奸殣钘� - return null - } - - return ( - <Col key={card.uuid} span={card.width}> - <div style={card.style}> - <div style={{height: card.innerHeight || 25}}> - {val ? <BarCode card={card} value={val}/> : null} - </div> - </div> - </Col> - ) - } else if (card.eleType === 'video') { - let url = '' - - if (card.datatype === 'static') { - url = card.url - } else { - url = data[card.field] || '' - } - - if (url === '' && card.noValue === 'hide') { // 绌哄�奸殣钘� - return null - } - - let poster = '' - - if (card.posterType === 'dynamic') { - poster = data[card.posterField] || '' - } else { - poster = card.posterUrl || '' - } - - return ( - <Col key={card.uuid} span={card.width}> - <div className="video-wrap" style={card.style}> - <Video card={card} poster={poster} value={url}/> - </div> - </Col> - ) - } else if (card.eleType === 'qrcode') { - let val = '' - - if (card.datatype === 'static') { - val = card.value - } else if (data.hasOwnProperty(card.field)) { - val = data[card.field] || '' - } - - if (val === '' && card.noValue === 'hide') { // 绌哄�奸殣钘� - return null - } - - return ( - <Col key={card.uuid} span={card.width}> - <div style={card.style}> - <div style={{minHeight: card.qrWidth || 50}}> - {val ? <QrCode card={card} value={val}/> : null} - </div> - </div> - </Col> - ) - } else if (card.eleType === 'currentDate') { - let val = moment().format(card.dateFormat || 'YYYY-MM-DD') - - if (card.fixStyle === 'alone') { - let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight} - val = <><span style={_s}>{card.prefix || ''}</span>{val}<span style={_s}>{card.postfix || ''}</span></> - } else { - val = `${card.prefix || ''}${val}${card.postfix || ''}` - } - - return ( - <Col key={card.uuid} span={card.width}> - <div className="ant-mk-date" style={card.style}> - {val} - </div> - </Col> - ) - } else if (card.eleType === 'formula') { - let val = 0 - let _style = card.style ? {...card.style} : {} - - if (card.$sync) { - if (card.eval === 'false') { - val = '' - } - this.props.syncData.forEach(item => { - let _val = card.formula - Object.keys(item).forEach(key => { - let reg = new RegExp('@' + key + '@', 'ig') - _val = _val.replace(reg, item[key]) + this.props.syncData.forEach(item => { + let _val = card.formula + Object.keys(item).forEach(key => { + let reg = new RegExp('@' + key + '@', 'ig') + _val = _val.replace(reg, item[key]) + }) + if (card.eval !== 'false') { + try { + // eslint-disable-next-line + _val = eval(_val) + } catch (e) { + _val = 0 + } + } + + // if (!val) return + + val += _val }) + } else if (data) { + let _val = card.formula + Object.keys(data).forEach(key => { + let reg = new RegExp('@' + key + '@', 'ig') + _val = _val.replace(reg, data[key]) + }) + if (card.eval !== 'false') { try { // eslint-disable-next-line _val = eval(_val) } catch (e) { - _val = 0 + _val = '' } } - - // if (!val) return - - val += _val - }) - } else if (data) { - let _val = card.formula - Object.keys(data).forEach(key => { - let reg = new RegExp('@' + key + '@', 'ig') - _val = _val.replace(reg, data[key]) - }) - - if (card.eval !== 'false') { - try { - // eslint-disable-next-line - _val = eval(_val) - } catch (e) { - _val = '' - } + + val = _val === undefined ? '' : _val } - - val = _val === undefined ? '' : _val - } - - if (val === '' && card.noValue === 'hide') { // 绌哄�奸殣钘� - return null - } - - if (val !== '') { - if (val && typeof(val) === 'string') { - val = val.replace(/\n/ig, '<br/>').replace(/\s/ig, ' ') - val = <span dangerouslySetInnerHTML={{__html: val}}></span> - } - - if (card.fixStyle === 'alone') { - let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight} - val = <><span style={_s}>{card.prefix || ''}</span>{val}<span style={_s}>{card.postfix || ''}</span></> - } else { - val = `${card.prefix || ''}${val}${card.postfix || ''}` - } - } - - if (card.marks) { - let mark = getMark(card.marks, data, _style) - - _style = mark.style - - if (mark.icon) { - if (mark.position === 'front') { - val = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {val}</span> - } else { - val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> - } - } - } - - return ( - <Col key={card.uuid} span={card.width}> - <div style={_style}> - <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> - </div> - </Col> - ) - } else if (card.eleType === 'button') { - let _disabled = data.$disabled - if (card.control === 'hidden') { - let s = data[card.controlField] !== undefined ? data[card.controlField] + '' : '' - if (s === card.controlVal || (card.controlVal && card.controlVal.split(',').includes(s))) { + + if (val === '' && card.noValue === 'hide') { // 绌哄�奸殣钘� return null } - } else if (card.control === 'disabled') { - let s = data[card.controlField] !== undefined ? data[card.controlField] + '' : '' - if (s === card.controlVal || (card.controlVal && card.controlVal.split(',').includes(s))) { - _disabled = true + + if (val !== '') { + if (val && typeof(val) === 'string') { + val = val.replace(/\n/ig, '<br/>').replace(/\s/ig, ' ') + val = <span dangerouslySetInnerHTML={{__html: val}}></span> + } + + if (card.fixStyle === 'alone') { + let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight} + val = <><span style={_s}>{card.prefix || ''}</span>{val}<span style={_s}>{card.postfix || ''}</span></> + } else { + val = `${card.prefix || ''}${val}${card.postfix || ''}` + } } - } - - let _data = [data] - - if (data.$$type === 'extendCard') { - _data = data.$$selectedData || [] - } else if (card.$sync) { - _data = this.props.syncData - } else if (data.$$empty) { - _data = [] - } - - if (['exec', 'prompt', 'pop', 'form'].includes(card.OpenType)) { - return ( - <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> - <NormalButton - btn={card} - BID={data.$$BID} - BData={data.$$BData || ''} - disabled={_disabled} - setting={cards.setting} - columns={cards.columns} - selectedData={_data} - /> + + if (card.marks) { + let mark = getMark(card.marks, data, _style) + + _style = mark.style + + if (mark.icon) { + if (mark.position === 'front') { + val = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {val}</span> + } else { + val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> + } + } + } + + contents.push( + <Col key={card.uuid} span={card.width}> + <div style={_style}> + <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> + </div> </Col> ) - } else if (card.OpenType === 'excelIn') { - return ( - <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> - <ExcelInButton - btn={card} - BID={data.$$BID} - BData={data.$$BData || ''} - disabled={_disabled} - setting={cards.setting} - selectedData={_data} - /> - </Col> - ) - } else if (card.OpenType === 'excelOut') { - return ( - <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> - <ExcelOutButton - btn={card} - BID={data.$$BID} - BData={data.$$BData || ''} - disabled={_disabled} - setting={cards.setting} - selectedData={_data} - /> - </Col> - ) - } else if (card.OpenType === 'popview') { - return ( - <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> - <PopupButton - btn={card} - BID={data.$$BID} - BData={data.$$BData || ''} - disabled={_disabled} - setting={cards.setting} - selectedData={_data} - /> - </Col> - ) - } else if (card.OpenType === 'tab') { - return ( - <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> - <TabButton - btn={card} - BData={data.$$BData || ''} - disabled={_disabled} - setting={cards.setting} - selectedData={_data} - /> - </Col> - ) - } else if (card.OpenType === 'innerpage') { - return ( - <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> - <NewPageButton - btn={card} - BData={data.$$BData || ''} - disabled={_disabled} - setting={cards.setting} - selectedData={_data} - /> - </Col> - ) - } else if (card.OpenType === 'funcbutton') { - if (card.funcType === 'changeuser' || card.funcType === 'closetab') { - return ( + } else if (card.eleType === 'button') { + let _disabled = data.$disabled + if (card.control === 'hidden') { + let s = data[card.controlField] !== undefined ? data[card.controlField] + '' : '' + if (s === card.controlVal || (card.controlVal && card.controlVal.split(',').includes(s))) { + return null + } + } else if (card.control === 'disabled') { + let s = data[card.controlField] !== undefined ? data[card.controlField] + '' : '' + if (s === card.controlVal || (card.controlVal && card.controlVal.split(',').includes(s))) { + _disabled = true + } + } + + let _data = [data] + + if (data.$$type === 'extendCard') { + _data = data.$$selectedData || [] + } else if (card.$sync) { + _data = this.props.syncData + } else if (data.$$empty) { + _data = [] + } + + if (['exec', 'prompt', 'pop', 'form'].includes(card.OpenType)) { + contents.push( <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> - <ChangeUserButton + <NormalButton + btn={card} + BID={data.$$BID} + BData={data.$$BData || ''} + disabled={_disabled} + setting={cards.setting} + columns={cards.columns} + selectedData={_data} + /> + </Col> + ) + } else if (card.OpenType === 'excelIn') { + contents.push( + <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> + <ExcelInButton btn={card} BID={data.$$BID} BData={data.$$BData || ''} @@ -868,10 +788,10 @@ /> </Col> ) - } else if (card.funcType === 'print') { - return ( + } else if (card.OpenType === 'excelOut') { + contents.push( <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> - <PrintButton + <ExcelOutButton btn={card} BID={data.$$BID} BData={data.$$BData || ''} @@ -881,43 +801,106 @@ /> </Col> ) - } else if (card.funcType === 'megvii') { - return ( + } else if (card.OpenType === 'popview') { + contents.push( <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> - <FuncMegvii + <PopupButton btn={card} BID={data.$$BID} + BData={data.$$BData || ''} disabled={_disabled} setting={cards.setting} selectedData={_data} /> </Col> ) - } else if (card.funcType === 'filezip') { - return ( + } else if (card.OpenType === 'tab') { + contents.push( <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> - <FuncZip + <TabButton btn={card} - BID={data.$$BID} + BData={data.$$BData || ''} disabled={_disabled} setting={cards.setting} selectedData={_data} /> </Col> ) + } else if (card.OpenType === 'innerpage') { + contents.push( + <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> + <NewPageButton + btn={card} + BData={data.$$BData || ''} + disabled={_disabled} + setting={cards.setting} + selectedData={_data} + /> + </Col> + ) + } else if (card.OpenType === 'funcbutton') { + if (card.funcType === 'changeuser' || card.funcType === 'closetab') { + contents.push( + <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> + <ChangeUserButton + btn={card} + BID={data.$$BID} + BData={data.$$BData || ''} + disabled={_disabled} + setting={cards.setting} + selectedData={_data} + /> + </Col> + ) + } else if (card.funcType === 'print') { + contents.push( + <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> + <PrintButton + btn={card} + BID={data.$$BID} + BData={data.$$BData || ''} + disabled={_disabled} + setting={cards.setting} + selectedData={_data} + /> + </Col> + ) + } else if (card.funcType === 'megvii') { + contents.push( + <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> + <FuncMegvii + btn={card} + BID={data.$$BID} + disabled={_disabled} + setting={cards.setting} + selectedData={_data} + /> + </Col> + ) + } else if (card.funcType === 'filezip') { + contents.push( + <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> + <FuncZip + btn={card} + BID={data.$$BID} + disabled={_disabled} + setting={cards.setting} + selectedData={_data} + /> + </Col> + ) + } } } - } + }) - return null + return contents } render() { - const { elements } = this.state - return ( <div className="card-cell-list"> - {elements.map(item => this.getContent(item))} + {this.getContent()} </div> ) } diff --git a/src/tabviews/custom/components/card/table-card/index.jsx b/src/tabviews/custom/components/card/table-card/index.jsx index c36d82a..c0e6424 100644 --- a/src/tabviews/custom/components/card/table-card/index.jsx +++ b/src/tabviews/custom/components/card/table-card/index.jsx @@ -333,11 +333,12 @@ let menu = null if (card.setting.MenuID) { + let _menu = this.props.permMenus.filter(m => m.MenuID === card.setting.MenuID)[0] || '' menu = { MenuID: card.setting.MenuID, - MenuName: card.setting.MenuName, + MenuName: _menu ? _menu.MenuName : card.setting.MenuName, MenuNo: card.setting.MenuNo, - type: card.setting.tabType + type: _menu ? _menu.type : card.setting.tabType } } else if (card.setting.menu && card.setting.menu.length > 0) { let menu_id = card.setting.menu.slice(-1)[0] diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx index 4c99a8d..317b96d 100644 --- a/src/tabviews/custom/components/share/normalTable/index.jsx +++ b/src/tabviews/custom/components/share/normalTable/index.jsx @@ -177,15 +177,17 @@ } if (content !== '') { - let decimal = col.decimal || 0 + if (col.round) { + content = Math.round(content * col.round) / col.round + } if (col.format === 'percent') { content = content * 100 - decimal = decimal > 2 ? decimal - 2 : 0 } else if (col.format === 'abs') { content = Math.abs(content) } - - content = content.toFixed(decimal) + if (col.round) { + content = content.toFixed(col.decimal) + } if (col.format === 'thdSeparator') { content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') @@ -240,7 +242,6 @@ photos = photos.split(',').filter(Boolean) } - let cols = 24 / (col.picSort || 1) let paddingTop = '100%' let scale = col.scale === 'true' @@ -250,8 +251,8 @@ resProps.children = ( <div> - {photos && photos.map((url, i) => ( - <Col key={i} span={cols}> + {photos.map((url, i) => ( + <Col key={i} span={col.span || 24}> <div className={'ant-mk-picture' + (scale ? ' scale' : '')} onClick={() => { if (!scale) return MKEmitter.emit('mkImageScale', url, photos) diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx index 048b71d..8651b50 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -388,15 +388,17 @@ } if (content !== '') { - let decimal = col.decimal || 0 + if (col.round) { + content = Math.round(content * col.round) / col.round + } if (col.format === 'percent') { content = content * 100 - decimal = decimal > 2 ? decimal - 2 : 0 } else if (col.format === 'abs') { content = Math.abs(content) } - - content = content.toFixed(decimal) + if (col.round) { + content = content.toFixed(col.decimal) + } if (col.format === 'thdSeparator') { content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') @@ -772,15 +774,17 @@ } if (content !== '') { - let decimal = col.decimal || 0 + if (col.round) { + content = Math.round(content * col.round) / col.round + } if (col.format === 'percent') { content = content * 100 - decimal = decimal > 2 ? decimal - 2 : 0 } else if (col.format === 'abs') { content = Math.abs(content) } - - content = content.toFixed(decimal) + if (col.round) { + content = content.toFixed(col.decimal) + } if (col.format === 'thdSeparator') { content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index c468159..abe3ac2 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -581,8 +581,16 @@ } else if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) { col.Hide = 'true' } - if (col.type === 'number' && col.sum === 'true' && !statFields.includes(col.field)) { - statFields.push(col) + if (col.type === 'number') { + if (col.sum === 'true' && !statFields.includes(col.field)) { + statFields.push(col) + } + if (typeof(col.decimal) === 'number') { + col.round = Math.pow(10, col.decimal) + if (col.format === 'percent') { + col.decimal = col.decimal > 2 ? col.decimal - 2 : 0 + } + } } else if (col.type === 'colspan') { col.subcols = getCols(col.subcols || []) if (col.subcols.length === 0) { @@ -590,8 +598,16 @@ } } else if (col.type === 'custom') { col.elements = col.elements.map(cell => { - if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height) { - cell.innerHeight = 'auto' + if (['text', 'number', 'formula'].includes(cell.eleType)) { + if (!cell.height) { + cell.innerHeight = 'auto' + } + if (cell.eleType === 'number' && typeof(cell.decimal) === 'number') { + cell.round = Math.pow(10, cell.decimal) + if (cell.format === 'percent') { + cell.decimal = cell.decimal > 2 ? cell.decimal - 2 : 0 + } + } } else if (cell.eleType === 'icon') { let fontSize = 14 let lineHeight = 1.5 @@ -671,8 +687,6 @@ if (item.type === 'card') { item.subcards && item.subcards.forEach(card => { - let _hasheight = card.style.height && card.style.height !== 'auto' - if (card.style.boxShadow) { delete card.style.hShadow delete card.style.vShadow @@ -704,8 +718,16 @@ card.style = card.style || {} card.style = {...card.style, ...card.btnstyle} } - } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { - cell.innerHeight = 'auto' + } else if (['text', 'number', 'formula'].includes(cell.eleType)) { + if (!cell.height) { + cell.innerHeight = 'auto' + } + if (cell.eleType === 'number' && typeof(cell.decimal) === 'number') { + cell.round = Math.pow(10, cell.decimal) + if (cell.format === 'percent') { + cell.decimal = cell.decimal > 2 ? cell.decimal - 2 : 0 + } + } } else if (cell.eleType === 'icon') { let fontSize = 14 let lineHeight = 1.5 @@ -746,8 +768,16 @@ card.style = card.style || {} card.style = {...card.style, ...card.btnstyle} } - } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { - cell.innerHeight = 'auto' + } else if (['text', 'number', 'formula'].includes(cell.eleType)) { + if (!cell.height) { + cell.innerHeight = 'auto' + } + if (cell.eleType === 'number' && typeof(cell.decimal) === 'number') { + cell.round = Math.pow(10, cell.decimal) + if (cell.format === 'percent') { + cell.decimal = cell.decimal > 2 ? cell.decimal - 2 : 0 + } + } } else if (cell.eleType === 'icon') { let fontSize = 14 let lineHeight = 1.5 @@ -792,8 +822,16 @@ if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 鎵撳嵃鏈鸿缃� cell = this.getPrinter(cell, item.uuid) } - } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height) { - cell.innerHeight = 'auto' + } else if (['text', 'number', 'formula'].includes(cell.eleType)) { + if (!cell.height) { + cell.innerHeight = 'auto' + } + if (cell.eleType === 'number' && typeof(cell.decimal) === 'number') { + cell.round = Math.pow(10, cell.decimal) + if (cell.format === 'percent') { + cell.decimal = cell.decimal > 2 ? cell.decimal - 2 : 0 + } + } } else if (cell.eleType === 'icon') { let fontSize = 14 let lineHeight = 1.5 @@ -812,7 +850,6 @@ }) } else if ((item.type === 'table' && item.subtype === 'tablecard') || item.type === 'carousel' || item.type === 'timeline') { item.subcards && item.subcards.forEach(card => { - let _hasheight = card.style.height && card.style.height !== 'auto' card.elements = card.elements.filter(cell => { if (cell.eleType === 'button') { if (cell.hidden === 'true') return false @@ -837,8 +874,16 @@ card.style = card.style || {} card.style = {...card.style, ...card.btnstyle} } - } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { - cell.innerHeight = 'auto' + } else if (['text', 'number', 'formula'].includes(cell.eleType)) { + if (!cell.height) { + cell.innerHeight = 'auto' + } + if (cell.eleType === 'number' && typeof(cell.decimal) === 'number') { + cell.round = Math.pow(10, cell.decimal) + if (cell.format === 'percent') { + cell.decimal = cell.decimal > 2 ? cell.decimal - 2 : 0 + } + } } else if (cell.eleType === 'icon') { let fontSize = 14 let lineHeight = 1.5 @@ -1051,13 +1096,13 @@ } if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺 - component.setting.dataresource = component.setting.dataresource.replace(/\$@/ig, '/*') + component.setting.dataresource = component.setting.dataresource.replace(/\$@/ig, '/*').replace(/@datam@/ig, 'Y') component.setting.dataresource = component.setting.dataresource.replace(/@\$/ig, '*/') - _customScript = _customScript.replace(/\$@/ig, '/*') + _customScript = _customScript.replace(/\$@/ig, '/*').replace(/@datam@/ig, 'Y') _customScript = _customScript.replace(/@\$/ig, '*/') } else { - component.setting.dataresource = component.setting.dataresource.replace(/@\$|\$@/ig, '') - _customScript = _customScript.replace(/@\$|\$@/ig, '') + component.setting.dataresource = component.setting.dataresource.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '') + _customScript = _customScript.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '') } regs.forEach(cell => { diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index 392fcce..bc460d3 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -188,6 +188,15 @@ col.linkThdMenu = '' } + if (col.type === 'number') { + col.decimal = col.decimal || 0 + col.round = Math.pow(10, col.decimal) + + if (col.format === 'percent') { + col.decimal = col.decimal > 2 ? col.decimal - 2 : 0 + } + } + col.nameField && _arrField.push(col.nameField) // 閾炬帴鍚嶅瓧娈� if (col.Hide !== 'true' && col.type === 'number' && col.sum === 'true') { statFields.push(col) diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx index 21101fe..9b576d2 100644 --- a/src/tabviews/subtabtable/index.jsx +++ b/src/tabviews/subtabtable/index.jsx @@ -160,6 +160,15 @@ if (col.field) { _arrField.push(col.field) + if (col.type === 'number') { + col.decimal = col.decimal || 0 + col.round = Math.pow(10, col.decimal) + + if (col.format === 'percent') { + col.decimal = col.decimal > 2 ? col.decimal - 2 : 0 + } + } + col.nameField && _arrField.push(col.nameField) // 閾炬帴鍚嶅瓧娈� if (col.Hide !== 'true' && col.type === 'number' && col.sum === 'true') { statFields.push(col) diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx index 31c7d41..ed16f15 100644 --- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx +++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx @@ -487,11 +487,22 @@ exportExcel = (data) => { const { btn } = this.props - let columns = btn.verify.columns.filter(col => col.output !== 'false') + let imgCol = false + let columns = btn.verify.columns.filter(col => { + if (col.output === 'false') return false + + if (col.type === 'image') { + imgCol = true + } + + if (col.type === 'number' && (col.decimal || col.decimal === 0) ) { + col.round = Math.pow(10, col.decimal) + } + + return col + }) try { - let imgCol = columns.filter(col => col.type === 'image')[0] - if (imgCol) { const column = columns.map(item => { let col = { @@ -515,11 +526,18 @@ item.$Index = index + 1 + '' columns.forEach((col, i) => { - if (item[col.Column] && col.abs === 'true') { - _row[col.Column] = Math.abs(item[col.Column]) - } else { - _row[col.Column] = item[col.Column] + let val = item[col.Column] + if (typeof(val) === 'number') { + if (col.abs === 'true') { + val = Math.abs(val) + } + if (col.round) { + val = Math.round(val * col.round) / col.round + val = val.toFixed(col.decimal) + } } + + _row[col.Column] = val }) table.push(_row) @@ -532,23 +550,14 @@ } else { this.execSuccess({ErrCode: 'S', ErrMesg: '瀵煎嚭鎴愬姛锛�'}) } - } else { let _header = [] let _topRow = {} let colwidth = [] - let abses = [] columns.forEach(col => { - if (_topRow[col.Column]) return - _header.push(col.Column) _topRow[col.Column] = col.Text - - if (col.abs === 'true') { - abses.push(col.Column) - } - colwidth.push({width: col.Width || 20}) }) @@ -561,12 +570,20 @@ item.$Index = index + 1 + '' - _header.forEach(field => { - if (item[field] && abses.includes(field)) { - _row[field] = Math.abs(item[field]) - } else { - _row[field] = item[field] + columns.forEach((col, i) => { + let val = item[col.Column] + + if (typeof(val) === 'number') { + if (col.abs === 'true') { + val = Math.abs(val) + } + if (col.round) { + val = Math.round(val * col.round) / col.round + val = val.toFixed(col.decimal) + } } + + _row[col.Column] = val }) table.push(_row) diff --git a/src/tabviews/zshare/actionList/tabbutton/index.jsx b/src/tabviews/zshare/actionList/tabbutton/index.jsx index f3cd9cf..8a350a5 100644 --- a/src/tabviews/zshare/actionList/tabbutton/index.jsx +++ b/src/tabviews/zshare/actionList/tabbutton/index.jsx @@ -157,11 +157,12 @@ let menu = null if (btn.MenuID) { + let _menu = this.props.permMenus.filter(m => m.MenuID === btn.MenuID)[0] || '' menu = { MenuID: btn.MenuID, - MenuName: btn.MenuName, + MenuName: _menu ? _menu.MenuName : btn.MenuName, MenuNo: btn.MenuNo, - type: btn.tabType + type: _menu ? _menu.type : btn.tabType } } else if (btn.linkmenu && btn.linkmenu.length > 0) { let menu_id = btn.linkmenu.slice(-1)[0] diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index 181d25f..710d82e 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -913,7 +913,7 @@ } else if (item.type === 'textarea') { content = (<MKTextArea config={item} onChange={(val, defer) => !defer && this.recordChange({[item.field]: val})}/>) } else if (item.type === 'rate') { - content = (<Rate count={item.rateCount} disabled={item.readonly} onChange={(val) => this.recordChange({[item.field]: val})} character={item.character ? <MkIcon type={item.character}/> : <StarFilled />} allowHalf={item.allowHalf}/>) + content = (<Rate count={item.rateCount} disabled={item.readonly} style={{color: item.color || '#fadb14'}} onChange={(val) => this.recordChange({[item.field]: val})} character={item.character ? <MkIcon type={item.character}/> : <StarFilled />} allowHalf={item.allowHalf}/>) } else if (item.type === 'brafteditor') { content = (<MKEditor config={item} onChange={(val) => this.recordChange({[item.field]: val})}/>) label = item.hidelabel !== 'true' ? label : '' diff --git a/src/tabviews/zshare/mutilform/mkInput/index.jsx b/src/tabviews/zshare/mutilform/mkInput/index.jsx index f147110..7bd5605 100644 --- a/src/tabviews/zshare/mutilform/mkInput/index.jsx +++ b/src/tabviews/zshare/mutilform/mkInput/index.jsx @@ -83,9 +83,13 @@ handleChange = (e) => { let val = e.target.value - let submit = /\n/ig.test(val) + let submit = /\n/g.test(val) - val = val.replace(/\n/ig, '') + val = val.replace(/\n/g, '') + + if (submit && /^\s+$/.test(val)) { + submit = false + } let _val = val diff --git a/src/tabviews/zshare/normalTable/index.jsx b/src/tabviews/zshare/normalTable/index.jsx index 4f7ee58..b355463 100644 --- a/src/tabviews/zshare/normalTable/index.jsx +++ b/src/tabviews/zshare/normalTable/index.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types' import md5 from 'md5' import { is, fromJS } from 'immutable' -import { Table, Affix, Typography } from 'antd' +import { Table, Affix, Typography, Col } from 'antd' import asyncComponent from '@/utils/asyncComponent' import MKEmitter from '@/utils/events.js' @@ -18,6 +18,12 @@ const TabButton = asyncComponent(() => import('@/tabviews/zshare/actionList/tabbutton')) const NewPageButton = asyncComponent(() => import('@/tabviews/zshare/actionList/newpagebutton')) const Video = asyncComponent(() => import('@/components/video')) + +const PicRadio = { + '4:3': '75%', '3:2': '66.67%', '16:9': '56.25%', '2:1': '50%', '3:1': '33.33%', '4:1': '25%', + '5:1': '20%', '6:1': '16.67%', '7:1': '14.29%', '8:1': '12.5%', '9:1': '11.11%', + '10:1': '10%', '3:4': '133.33%', '2:3': '150%', '9:16': '177.78%' +} class BodyRow extends React.Component { shouldComponentUpdate (nextProps) { @@ -548,13 +554,13 @@ } if (content !== '') { - let decimal = item.decimal || 0 + content = Math.round(content * item.round) / item.round + if (item.format === 'percent') { content = content * 100 - decimal = decimal > 2 ? decimal - 2 : 0 } - - content = content.toFixed(decimal) + + content = content.toFixed(item.decimal) if (item.format === 'thdSeparator') { content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') @@ -633,6 +639,7 @@ } } else if (item.type === 'picture') { let photos = '' + let style = {borderRadius: '2px'} if (item.field && record.hasOwnProperty(item.field)) { photos = record[item.field] + '' } @@ -642,19 +649,29 @@ photos = photos.split(',').filter(Boolean) } - let maxHeight = item.maxHeight || 128 + if (PicRadio[item.lenWidRadio]) { + style.paddingTop = PicRadio[item.lenWidRadio] + } else { + style.paddingTop = '100%' + } + + let scale = item.scale === 'true' + return ( <div className="picture-col"> - {photos && photos.map((url, i) => { - if (item.scale === 'true') { - return <img style={{maxHeight: maxHeight}} className="image-scale" onClick={(e) => { + {photos.map((url, i) => (<Col key={i} span={item.span || 24}> + <div + className={'mk-picture' + (scale ? ' image-scale' : '')} + onClick={(e) => { + if (!scale) return + e.stopPropagation() + MKEmitter.emit('mkImageScale', url, photos) - }} key={`${i}`} src={url} alt=""/> - } else { - return <img style={{maxHeight: maxHeight}} key={`${i}`} src={url} alt=""/> - } - })} + }} + style={{...style, backgroundImage: `url('${url}')`}} + ></div> + </Col>))} </div> ) } else if (item.type === 'video') { @@ -814,13 +831,13 @@ } if (content !== '') { - let decimal = col.decimal || 0 + content = Math.round(content * col.round) / col.round + if (col.format === 'percent') { content = content * 100 - decimal = decimal > 2 ? decimal - 2 : 0 } - content = content.toFixed(decimal) + content = content.toFixed(col.decimal) if (col.format === 'thdSeparator') { content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') @@ -863,7 +880,7 @@ } photos.forEach(photo => { - images.push({url: photo, align: col.Align, scale: col.scale === 'true', maxHeight: col.maxHeight || 128}) + images.push({url: photo, align: col.Align, scale: col.scale === 'true'}) }) } else if (col.type === 'text') { let content = record[col.field] @@ -1002,12 +1019,12 @@ <div className="content-fence-top" style={images[0] ? {textAlign: images[0].align} : null}> {images.map((_img, index) => { if (_img.scale) { - return <img style={{maxHeight: _img.maxHeight}} className="image-scale" onClick={(e) => { + return <img className="image-scale" onClick={(e) => { e.stopPropagation() MKEmitter.emit('mkImageScale', _img.url, images.map(g => g.url)) }} key={`${index}`} src={_img.url} alt=""/> } else { - return (<img style={{maxHeight: _img.maxHeight}} key={`${index}`} src={_img.url} alt=""/>) + return (<img key={`${index}`} src={_img.url} alt=""/>) } })} </div> @@ -1024,11 +1041,11 @@ <div className="content-fence-left" style={images[0] ? {textAlign: images[0].align} : null}> {images.map((_img, index) => { if (_img.scale) { - return <img style={{maxHeight: _img.maxHeight}} className="image-scale" onClick={() => { + return <img className="image-scale" onClick={() => { MKEmitter.emit('mkImageScale', _img.url, images.map(g => g.url)) }} key={`${index}`} src={_img.url} alt=""/> } else { - return (<img style={{maxHeight: _img.maxHeight}} key={`${index}`} src={_img.url} alt=""/>) + return (<img key={`${index}`} src={_img.url} alt=""/>) } })} </div> diff --git a/src/tabviews/zshare/normalTable/index.scss b/src/tabviews/zshare/normalTable/index.scss index f3d4838..31344f4 100644 --- a/src/tabviews/zshare/normalTable/index.scss +++ b/src/tabviews/zshare/normalTable/index.scss @@ -121,6 +121,7 @@ img { max-width: 100%; + max-height: 128px; display: block; } img + img { @@ -142,6 +143,7 @@ img { max-width: 100%; + max-height: 128px; display: block; float: right; } @@ -167,12 +169,15 @@ } } .picture-col { - img { - max-width: 100%; - display: inline-block; + margin-left: -5px; + margin-right: -5px; + >.ant-col { + padding: 5px; } - img + img { - margin-top: 10px; + .mk-picture { + background-color: #d9d9d9; + background-position: center center; + background-size: cover; } .image-scale { cursor: zoom-in; diff --git a/src/tabviews/zshare/topSearch/dategroup/index.scss b/src/tabviews/zshare/topSearch/dategroup/index.scss index 59410f2..57d4a16 100644 --- a/src/tabviews/zshare/topSearch/dategroup/index.scss +++ b/src/tabviews/zshare/topSearch/dategroup/index.scss @@ -49,7 +49,8 @@ background-color: #ffffff; } .ant-tag-checkable-checked { - border-color: #1890ff; + border-color: var(--mk-sys-color); + background: var(--mk-sys-color); } .table-search-date-group-value { position: absolute; diff --git a/src/templates/modalconfig/source.jsx b/src/templates/modalconfig/source.jsx index d3818c5..c437d38 100644 --- a/src/templates/modalconfig/source.jsx +++ b/src/templates/modalconfig/source.jsx @@ -91,6 +91,11 @@ }, { type: 'form', + label: '澶氳鏂囨湰', + subType: 'textarea', + }, + { + type: 'form', label: CommonDict['model.form.multiselect'], subType: 'multiselect', }, @@ -133,11 +138,6 @@ type: 'form', label: CommonDict['model.form.datemonth'], subType: 'datemonth', - }, - { - type: 'form', - label: CommonDict['model.form.textarea'], - subType: 'textarea', }, { type: 'form', diff --git a/src/templates/sharecomponent/actioncomponent/dragaction/index.jsx b/src/templates/sharecomponent/actioncomponent/dragaction/index.jsx index 5369beb..5de06eb 100644 --- a/src/templates/sharecomponent/actioncomponent/dragaction/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/dragaction/index.jsx @@ -64,6 +64,10 @@ let _val = fromJS(copycard).toJS() try { + if (_val.control) { + delete _val.controlField + delete _val.controlVal + } delete _val.$srcId let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx index bb1de82..1cae7b2 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx @@ -79,19 +79,20 @@ })(<InputNumber min={5} max={200} precision={0} />)} </Form.Item> </Col> - <Col span={5}> + <Col span={6}> <Form.Item label="绫诲瀷"> {getFieldDecorator('type', { initialValue: 'text' })( <Radio.Group style={{whiteSpace: 'nowrap'}}> <Radio value="text">鏂囨湰</Radio> + <Radio value="number">鏁板��</Radio> <Radio value="image">鍥剧墖</Radio> </Radio.Group> )} </Form.Item> </Col> - <Col span={4} className="add"> + <Col span={3} className="add"> <Button onClick={this.handleConfirm} type="primary" className="mk-green"> 娣诲姞 </Button> diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx index b66add0..a1587be 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx @@ -39,14 +39,15 @@ inputType: 'input', editable: true, unique: true, - width: '20%' + width: '17%' }, { title: this.props.dict['model.name'], dataIndex: 'Text', inputType: 'input', editable: true, - width: '20%' + unique: true, + width: '17%' }, { title: this.props.dict['model.form.columnWidth'], @@ -55,25 +56,28 @@ min: 5, max: 200, editable: true, - width: '14%', + width: '12%', render: (text) => text || 20 }, { title: '绫诲瀷', dataIndex: 'type', - inputType: 'radio', + inputType: 'select', editable: true, required: false, - width: '18%', + width: '14%', render: (text) => { if (text === 'image') { return '鍥剧墖' + } else if (text === 'number') { + return '鏁板��' } else { return '鏂囨湰' } }, options: [ {value: 'text', text: '鏂囨湰'}, + {value: 'number', text: '鏁板��'}, {value: 'image', text: '鍥剧墖'} ] }, @@ -95,6 +99,16 @@ {value: 'true', text: '鏄�'}, {value: 'false', text: '鍚�'} ] + }, + { + title: '灏忔暟浣�', + dataIndex: 'decimal', + inputType: 'number', + min: 0, + max: 18, + editable: true, + required: false, + width: '12%' }, { title: '瀵煎嚭', @@ -703,7 +717,7 @@ if (fields.includes(item.field) || !item.field) return fields.push(item.field) - columns.push({ + let cell = { Column: item.field, Text: item.label, Width: 20, @@ -711,7 +725,14 @@ output: 'true', type: 'text', uuid: Utils.getuuid() - }) + } + + if (item.type === 'number') { + cell.type = 'number' + cell.decimal = item.decimal + } + + columns.push(cell) }) this.setState({ @@ -740,7 +761,7 @@ changeColumns = (columns) => { const { verify } = this.state - if (columns[0] && (columns[0].type !== 'image' && columns[0].type !== 'text')) { + if (columns[0] && (columns[0].type !== 'image' && columns[0].type !== 'text' && columns[0].type !== 'number')) { columns = columns.map(col => { let _cell = { uuid: Utils.getuuid(), @@ -939,7 +960,7 @@ <Button className="excel-col-add mk-red" title="娓呯┖Excel鍒�" onClick={this.clearField}> 娓呯┖Excel鍒� </Button> - <div style={{color: '#959595', fontSize: '13px', paddingLeft: '10px'}}>濡傞渶瀵煎嚭搴忓彿锛岃浣跨敤瀛楁 $Index銆�</div> + <div style={{color: '#959595', fontSize: '13px', paddingLeft: '10px'}}>濡傞渶瀵煎嚭搴忓彿锛岃浣跨敤瀛楁 $Index锛涙暟鍊肩被鍨嬪鍑烘椂鍙繘琛屾暟鎹鐞嗭紙鍙栫粷瀵瑰�笺�佷繚鐣欏皬鏁颁綅锛夈��</div> <EditTable actions={['edit', 'move', 'copy', 'del']} type="excelcolumn" wrappedComponentRef={(inst) => this.columnRef = inst} data={verify.columns} columns={excelColumns} onChange={this.changeColumns}/> </TabPane> {card.intertype === 'system' ? <TabPane tab={ diff --git a/src/templates/sharecomponent/columncomponent/columnform/index.jsx b/src/templates/sharecomponent/columncomponent/columnform/index.jsx index 4b635e7..ec356a5 100644 --- a/src/templates/sharecomponent/columncomponent/columnform/index.jsx +++ b/src/templates/sharecomponent/columncomponent/columnform/index.jsx @@ -12,7 +12,7 @@ number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'blacklist', 'perspective', 'sum', 'rowspan'], link: ['label', 'field', 'type', 'nameField', 'Align', 'Hide', 'IsSort', 'joint', 'Width', 'fieldlength', 'blacklist'], textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'fieldlength', 'blacklist'], - picture: ['label', 'field', 'type', 'Align', 'Hide', 'Width', 'fieldlength', 'blacklist', 'scale', 'maxHeight'], + picture: ['label', 'field', 'type', 'Align', 'Hide', 'Width', 'fieldlength', 'blacklist', 'scale', 'lenWidRadio', 'span'], video: ['label', 'field', 'type', 'Align', 'Hide', 'startTime', 'Width', 'fieldlength', 'blacklist', 'aspectRatio'], index: ['label', 'type', 'Align', 'Width'] } diff --git a/src/templates/sharecomponent/columncomponent/index.jsx b/src/templates/sharecomponent/columncomponent/index.jsx index 78e60bf..52a345f 100644 --- a/src/templates/sharecomponent/columncomponent/index.jsx +++ b/src/templates/sharecomponent/columncomponent/index.jsx @@ -523,7 +523,7 @@ <Modal title="鏄剧ず鍒�-缂栬緫" visible={modaltype === 'columns'} - width={800} + width={850} maskClosable={false} onOk={this.handleSubmit} onCancel={this.editModalCancel} @@ -542,7 +542,7 @@ <Modal title={dict['model.form.colspan'] + '-' + dict['model.edit']} visible={modaltype === 'colspan'} - width={800} + width={850} maskClosable={false} onOk={this.handleSubmit} onCancel={this.editModalCancel} @@ -560,7 +560,7 @@ <Modal title="鎿嶄綔鍒�-缂栬緫" visible={modaltype === 'gridbtn'} - width={800} + width={850} maskClosable={false} onOk={this.handleSubmit} onCancel={this.editModalCancel} diff --git a/src/templates/sharecomponent/searchcomponent/dategroup/index.scss b/src/templates/sharecomponent/searchcomponent/dategroup/index.scss index 3e0369e..57adcd0 100644 --- a/src/templates/sharecomponent/searchcomponent/dategroup/index.scss +++ b/src/templates/sharecomponent/searchcomponent/dategroup/index.scss @@ -13,6 +13,7 @@ } .ant-tag-checkable-checked { border-color: #1890ff; + background: #1890ff; } } diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index fae183f..ef844cd 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -1206,7 +1206,7 @@ type: 'radio', key: 'callbackType', label: '鍥炶皟鏂瑰紡', - initVal: card.callbackType || (card.callbackFunc ? 'func' : 'script'), + initVal: card.callbackType || (card.callbackFunc ? 'func' : 'none'), tooltip: '浣跨敤鍚庡彴鑴氭湰鎵ц鏃讹紝闇�瑕侀厤鍚堣鍒掍换鍔°��', required: true, options: [{ @@ -1843,15 +1843,39 @@ }, { type: 'number', - key: 'maxHeight', + key: 'span', min: 1, - max: 1000, - decimal: 0, - label: '鏈�澶ч珮搴�', - tooltip: '鍥剧墖鍦ㄨ〃鏍间腑鏄剧ず鐨勬渶澶ч珮搴�', - tooltipClass: 'middle', - initVal: card.maxHeight || 128, + max: 24, + precision: 0, + label: '鍥剧墖瀹藉害', + initVal: card.span || 24, + tooltip: '鏍呮牸甯冨眬锛岀瓑鍒嗕负24浠姐��', required: true + }, + { + type: 'select', + key: 'lenWidRadio', + label: '闀垮姣�', + initVal: card.lenWidRadio || '1:1', + required: true, + options: [ + { value: '1:1', text: '1:1' }, + { value: '4:3', text: '4:3' }, + { value: '3:2', text: '3:2' }, + { value: '16:9', text: '16:9' }, + { value: '2:1', text: '2:1' }, + { value: '3:1', text: '3:1' }, + { value: '4:1', text: '4:1' }, + { value: '5:1', text: '5:1' }, + { value: '6:1', text: '6:1' }, + { value: '7:1', text: '7:1' }, + { value: '8:1', text: '8:1' }, + { value: '9:1', text: '9:1' }, + { value: '10:1', text: '10:1' }, + { value: '3:4', text: '3:4' }, + { value: '2:3', text: '2:3' }, + { value: '9:16', text: '9:16' }, + ] }, { type: 'radio', @@ -2407,6 +2431,9 @@ value: 'select', text: Formdict['model.form.select'] }, { + value: 'textarea', + text: '澶氳鏂囨湰' + }, { value: 'multiselect', text: Formdict['model.form.multiselect'] }, { @@ -2436,9 +2463,6 @@ // }, { // value: 'datetime', // text: '鏃ユ湡锛堝垎/绉掞級' - }, { - value: 'textarea', - text: Formdict['model.form.textarea'] }, { value: 'cascader', text: '绾ц仈鑿滃崟' @@ -3087,19 +3111,6 @@ }, { type: 'radio', - key: 'allowHalf', - label: '鍗婇��', - initVal: card.allowHalf || 'false', - options: [{ - value: 'true', - text: '鏀寔' - }, { - value: 'false', - text: '涓嶆敮鎸�' - }] - }, - { - type: 'radio', key: 'hidden', label: "闅愯棌", initVal: card.hidden || 'false', @@ -3213,6 +3224,26 @@ }] }, { + type: 'radio', + key: 'allowHalf', + label: '鍗婇��', + initVal: card.allowHalf || 'false', + options: [{ + value: 'true', + text: '鏀寔' + }, { + value: 'false', + text: '涓嶆敮鎸�' + }] + }, + { + type: 'color', + key: 'color', + label: '棰滆壊', + initVal: card.color || '#fadb14', + required: true + }, + { type: 'number', min: 1, max: 100, diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index c033f37..2b1a8e2 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -35,7 +35,7 @@ textarea: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'span', 'labelwidth', 'maxRows', 'encryption', 'interception', 'tooltip', 'extra', 'count', 'placeholder', 'marginTop', 'marginBottom'], cascader: ['readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom', 'separator'], color: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'marginTop', 'marginBottom'], - rate: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'splitline', 'tooltip', 'extra', 'marginTop', 'marginBottom', 'allowHalf', 'rateCount', 'character', 'place'], + rate: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'splitline', 'tooltip', 'extra', 'marginTop', 'marginBottom', 'allowHalf', 'color', 'rateCount', 'character', 'place'], hint: ['label', 'field', 'type', 'blacklist', 'message', 'span', 'labelwidth', 'splitline', 'marginTop', 'marginBottom'], split: ['label', 'type', 'marginTop', 'marginBottom', 'splitline'], formula: ['label', 'type', 'marginTop', 'marginBottom', 'splitline', 'span', 'labelwidth', 'formula', 'eval', 'postfix'], -- Gitblit v1.8.0