From c78e2e555201789537bf176a349bbb34f8c0ca8f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 27 十二月 2022 13:58:00 +0800 Subject: [PATCH] 2022-12-27 --- src/menu/components/table/normal-table/options.jsx | 13 + src/tabviews/custom/components/module/account/index.jsx | 86 +++++++++ src/templates/comtableconfig/updatetable/index.jsx | 6 src/tabviews/custom/components/share/normalTable/index.scss | 2 public/options.json | 8 src/menu/components/table/edit-table/options.jsx | 13 + src/tabviews/custom/components/share/normalTable/index.jsx | 7 src/menu/menushell/card.jsx | 3 src/menu/components/search/main-search/index.scss | 3 src/tabviews/custom/components/table/normal-table/index.scss | 1 src/menu/modulesource/option.jsx | 5 src/assets/css/main.scss | 11 + src/tabviews/custom/components/table/edit-table/index.scss | 1 src/menu/components/module/voucher/options.jsx | 22 -- src/tabviews/custom/components/table/base-table/index.scss | 1 src/tabviews/custom/components/module/voucher/index.jsx | 5 src/menu/components/table/base-table/options.jsx | 13 + src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 7 src/tabviews/custom/components/module/account/index.scss | 14 + src/tabviews/custom/index.jsx | 7 src/menu/components/module/account/index.jsx | 129 ++++++++++++++ src/menu/components/module/account/options.jsx | 28 +++ src/menu/components/table/base-table/columns/index.jsx | 8 src/menu/components/module/voucher/index.scss | 7 src/menu/components/table/base-table/index.jsx | 33 +++ src/menu/components/module/account/index.scss | 52 +++++ src/menu/components/table/normal-table/columns/index.jsx | 8 src/menu/menushell/index.jsx | 1 src/templates/sharecomponent/searchcomponent/index.scss | 3 src/menu/components/table/edit-table/columns/index.jsx | 8 30 files changed, 454 insertions(+), 51 deletions(-) diff --git a/public/options.json b/public/options.json index bedcbee..caeae13 100644 --- a/public/options.json +++ b/public/options.json @@ -1,12 +1,12 @@ { - "appId": "202108312122504607B107A83F55B40C98CCF", - "appkey": "20210831212235413F287EC3BF489424496C8", + "appId": "202111141127408033E3114885F864B619CF5", + "appkey": "20211114112719750F93B1E64FD79486C8E92", "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", "systemType": "", "externalDatabase": "", "lineColor": "", "filter": "false", - "defaultApp": "mkindustry", + "defaultApp": "", "defaultLang": "zh-CN", "WXAppID": "", "WXminiAppID": "", @@ -18,5 +18,5 @@ "keepPassword": "true", "platforms": ["H5", "wechat", "android", "ios", "wxMiniProgram"], "host": "http://demo.mk9h.cn", - "service": "erp_new/" + "service": "cr_mes/" } \ No newline at end of file diff --git a/src/assets/css/main.scss b/src/assets/css/main.scss index 035f750..bc5c43d 100644 --- a/src/assets/css/main.scss +++ b/src/assets/css/main.scss @@ -472,4 +472,15 @@ .video-react .video-react-poster { background-size: cover; } +} + +.table-vertical-top { + table td { + vertical-align: top; + } +} +.table-vertical-bottom { + table td { + vertical-align: bottom; + } } \ No newline at end of file diff --git a/src/menu/components/module/account/index.jsx b/src/menu/components/module/account/index.jsx new file mode 100644 index 0000000..e1d2f18 --- /dev/null +++ b/src/menu/components/module/account/index.jsx @@ -0,0 +1,129 @@ +import React, {Component} from 'react' +import PropTypes from 'prop-types' +import { is, fromJS } from 'immutable' +import { Popover } from 'antd' +import { EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined, CaretDownOutlined } from '@ant-design/icons' +import moment from 'moment' + +import asyncIconComponent from '@/utils/asyncIconComponent' +import MKEmitter from '@/utils/events.js' +import getWrapForm from './options' + +import './index.scss' + +const NormalForm = asyncIconComponent(() => import('@/components/normalform')) + +class Account extends Component { + static propTpyes = { + card: PropTypes.object, + deletecomponent: PropTypes.func, + updateConfig: PropTypes.func, + } + + state = { + card: null, + date: moment().format('YYYY骞碝M鏈�') + } + + UNSAFE_componentWillMount () { + const { card } = this.props + + if (card.isNew) { + let _card = { + uuid: card.uuid, + type: card.type, + format: 'array', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 + pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� + switchable: true, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� + width: card.width || 24, + name: '璐﹀', + subtype: card.subtype, + wrap: { name: '璐﹀', width: card.width || 24 }, + style: { paddingLeft: '20px', paddingRight: '20px', paddingTop: '10px', paddingBottom: '10px' }, + } + + this.updateComponent(_card) + } else { + this.setState({ + card: fromJS(card).toJS() + }) + } + } + + shouldComponentUpdate (nextProps, nextState) { + return !is(fromJS(this.state), fromJS(nextState)) + } + + /** + * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊锛屾竻闄ゅ揩鎹烽敭璁剧疆 + */ + componentWillUnmount () { + this.setState = () => { + return + } + } + + /** + * @description 鍗$墖琛屽灞備俊鎭洿鏂帮紙鏁版嵁婧愶紝鏍峰紡绛夛級 + */ + updateComponent = (card) => { + card.width = card.wrap.width + card.name = card.wrap.name + + this.setState({ + card: card + }) + + this.props.updateConfig(card) + } + + changeStyle = () => { + const { card } = this.state + + MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow', 'clear'], card.style, this.getStyle) + } + + getStyle = (style) => { + let _card = {...this.state.card, style} + + this.updateComponent(_card) + } + + getWrapForms = () => { + const { card } = this.state + + return getWrapForm(card.wrap) + } + + updateWrap = (res) => { + let _card = {...this.state.card, wrap: res} + + this.updateComponent(_card) + } + + render() { + const { card, date } = this.state + + return ( + <div className="menu-account-box" style={card.style} id={card.uuid}> + <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ + <div className="mk-popover-control"> + <NormalForm title="鍩烘湰璁剧疆" width={800} update={this.updateWrap} getForms={this.getWrapForms}> + <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> + </NormalForm> + <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/> + <DeleteOutlined className="close" title="鍒犻櫎缁勪欢" onClick={() => this.props.deletecomponent(card.uuid)} /> + </div> + } trigger="hover"> + <ToolOutlined /> + </Popover> + <div className="account-box"> + <div className="company">鍖椾含鏄庣鏅崕淇℃伅鎶�鏈湁闄愬叕鍙� <CaretDownOutlined /></div> + <div className="date">{date}</div> + </div> + </div> + ) + } +} + +export default Account \ No newline at end of file diff --git a/src/menu/components/module/account/index.scss b/src/menu/components/module/account/index.scss new file mode 100644 index 0000000..e69767f --- /dev/null +++ b/src/menu/components/module/account/index.scss @@ -0,0 +1,52 @@ +.menu-account-box { + position: relative; + box-sizing: border-box; + background: #ffffff; + background-position: center center; + background-repeat: no-repeat; + background-size: cover; + color: #000000; + + .anticon-tool { + position: absolute; + z-index: 2; + font-size: 16px; + right: 1px; + top: 1px; + cursor: pointer; + padding: 5px; + background: rgba(255, 255, 255, 0.55); + } + + .account-box { + display: flex; + .company { + border: 1px solid #d9d9d9; + padding: 3px 10px 3px 5px; + border-radius: 4px; + margin-right: 15px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + + .anticon-caret-down { + margin-left: 20px; + } + } + .date { + padding-top: 3px; + flex: 1; + } + } +} +.menu-account-box::after { + display: block; + content: ' '; + clear: both; +} +.menu-account-box:hover { + z-index: 1; + box-shadow: 0px 0px 4px #1890ff; +} + + diff --git a/src/menu/components/module/account/options.jsx b/src/menu/components/module/account/options.jsx new file mode 100644 index 0000000..93bebd4 --- /dev/null +++ b/src/menu/components/module/account/options.jsx @@ -0,0 +1,28 @@ +/** + * @description Wrap琛ㄥ崟閰嶇疆淇℃伅 + */ +export default function (wrap) { + const wrapForm = [ + { + type: 'text', + field: 'name', + label: '缁勪欢鍚嶇О', + initval: wrap.name || '', + tooltip: '鐢ㄤ簬缁勪欢闂寸殑鍖哄垎銆�', + required: true + }, + { + type: 'number', + field: 'width', + label: '瀹藉害', + initval: wrap.width || 24, + tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��', + min: 1, + max: 24, + precision: 0, + required: true + } + ] + + return wrapForm +} \ No newline at end of file diff --git a/src/menu/components/module/voucher/index.scss b/src/menu/components/module/voucher/index.scss index c5f6e98..ad1eb88 100644 --- a/src/menu/components/module/voucher/index.scss +++ b/src/menu/components/module/voucher/index.scss @@ -18,13 +18,6 @@ padding: 5px; background: rgba(255, 255, 255, 0.55); } - .empty-content { - text-align: center; - font-size: 30px; - margin: 0; - line-height: 90px; - color: #bcbcbc; - } } .menu-voucher-box::after { display: block; diff --git a/src/menu/components/module/voucher/options.jsx b/src/menu/components/module/voucher/options.jsx index a837e93..3f63f8f 100644 --- a/src/menu/components/module/voucher/options.jsx +++ b/src/menu/components/module/voucher/options.jsx @@ -4,21 +4,8 @@ * @description Wrap琛ㄥ崟閰嶇疆淇℃伅 */ export default function (wrap, id) { - let roleList = sessionStorage.getItem('sysRoles') - let appType = sessionStorage.getItem('appType') - let menu = window.GLOB.customMenu let modules = MenuUtils.getSupModules(menu.components, id, menu.interfaces) - - if (roleList) { - try { - roleList = JSON.parse(roleList) - } catch (e) { - roleList = [] - } - } else { - roleList = [] - } const wrapForm = [ // { @@ -66,15 +53,6 @@ required: false, options: modules, allowClear: true, - }, - { - type: 'multiselect', - field: 'blacklist', - label: '榛戝悕鍗�', - initval: wrap.blacklist || [], - required: false, - options: roleList, - forbid: !!appType }, ] diff --git a/src/menu/components/search/main-search/index.scss b/src/menu/components/search/main-search/index.scss index d68899b..be92a36 100644 --- a/src/menu/components/search/main-search/index.scss +++ b/src/menu/components/search/main-search/index.scss @@ -102,6 +102,9 @@ } } .mk-search-item-wrap.action { + .ant-form-item { + white-space: nowrap; + } .ant-form-item-label, .ant-form-item-control-wrapper { display: inline-block; } diff --git a/src/menu/components/table/base-table/columns/index.jsx b/src/menu/components/table/base-table/columns/index.jsx index 07ec61f..b7cd7e3 100644 --- a/src/menu/components/table/base-table/columns/index.jsx +++ b/src/menu/components/table/base-table/columns/index.jsx @@ -68,7 +68,7 @@ } <EditOutlined className="edit" title="缂栬緫" onClick={() => this.props.editColumn(column)} /> {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} + {column && (column.type === 'custom' || column.type === 'action') ? <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 field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } </div> @@ -195,7 +195,7 @@ ) } else if (column && column.type === 'action') { return ( - <td style={{padding: '0 5px', textAlign: column.Align}} className={'action-column ' + className}> + <td style={{padding: 0, textAlign: column.Align, ...(column.style || {})}} className={'action-column ' + className}> <CardCellComponent cards={config} cardCell={column} elements={column.elements} updateElement={this.updateCard}/> </td> ) @@ -424,8 +424,10 @@ if (col.type === 'colspan') { col.subcols = card.subcols || [] } else if (col.type === 'custom') { + col.style = card.style || {} col.elements = card.type === 'custom' ? (card.elements || []) : [] } else if (col.type === 'action') { + col.style = card.style || {} col.elements = card.type === 'action' ? (card.elements || []) : [] } @@ -648,7 +650,7 @@ } return ( - <div className={`normal-table-columns ${config.setting.laypage} ${config.wrap.tableType} ${config.wrap.mode || ''}`} id={tableId}> + <div className={`normal-table-columns ${config.setting.laypage} ${config.wrap.tableType} ${config.wrap.mode || ''} table-vertical-${config.wrap.vertical || ''}`} id={tableId}> <div className="col-control"> <FieldsComponent config={config} type="columns" /> <CopyOutlined title="澶嶅埗鏄剧ず鍒�" onClick={this.copycolumn} /> diff --git a/src/menu/components/table/base-table/index.jsx b/src/menu/components/table/base-table/index.jsx index 5b982cd..a1d88d9 100644 --- a/src/menu/components/table/base-table/index.jsx +++ b/src/menu/components/table/base-table/index.jsx @@ -99,6 +99,39 @@ MKEmitter.removeListener('completeSave', this.completeSave) } + // updateFix = (card) => { + // let fixs = {} + + // card.cols.forEach(col => { + // if (!col.field) return + // if (col.postfix || col.prefix) { + // fixs[col.field] = col + // } + // }) + + // card.cols.forEach(col => { + // if (col.type === 'custom') { + // col.elements.forEach(cell => { + // if (cell.datatype === 'dynamic') { + // cell.height = '' + // cell.innerHeight = 'auto' + + // if (fixs[cell.field]) { + // if (!cell.prefix && fixs[cell.field].prefix) { + // cell.prefix = fixs[cell.field].prefix + // } + // if (!cell.postfix && fixs[cell.field].postfix) { + // cell.postfix = fixs[cell.field].postfix + // } + // } + // } + // }) + // } + // }) + + // return card + // } + completeSave = () => { const { card } = this.state diff --git a/src/menu/components/table/base-table/options.jsx b/src/menu/components/table/base-table/options.jsx index fb8b61e..80fd9bd 100644 --- a/src/menu/components/table/base-table/options.jsx +++ b/src/menu/components/table/base-table/options.jsx @@ -100,6 +100,19 @@ required: false }, { + type: 'radio', + field: 'vertical', + label: '鍨傜洿瀵归綈', + initval: wrap.vertical || 'middle', + tooltip: '鍗曞厓鏍肩殑鍨傜洿瀵归綈鏂瑰紡銆�', + required: false, + options: [ + {value: 'top', label: '鍚戜笂'}, + {value: 'middle', label: '灞呬腑'}, + {value: 'bottom', label: '鍚戜笅'}, + ] + }, + { type: 'number', field: 'btnlimit', label: '鎸夐挳闄愬埗', diff --git a/src/menu/components/table/edit-table/columns/index.jsx b/src/menu/components/table/edit-table/columns/index.jsx index 25bd842..319b9af 100644 --- a/src/menu/components/table/edit-table/columns/index.jsx +++ b/src/menu/components/table/edit-table/columns/index.jsx @@ -75,7 +75,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} {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} + {column.type === 'custom' || column.type === 'action' ? <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={() => this.props.changeStyle(column)}/> : null} <DeleteOutlined className="close" title="鍒犻櫎" onClick={this.deleteCol} /> {['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } </div> @@ -148,7 +148,7 @@ ) } else if (column && column.type === 'action') { return ( - <td style={{padding: '0 5px', textAlign: column.Align}} className={'action-column ' + className}> + <td style={{padding: 0, textAlign: column.Align, ...(column.style || {})}} className={'action-column ' + className}> <CardCellComponent cards={config} cardCell={column} elements={column.elements} updateElement={this.updateCard}/> </td> ) @@ -359,8 +359,10 @@ const { card } = this.state if (col.type === 'custom') { + col.style = card.style || {} col.elements = card.type === 'custom' ? (card.elements || []) : [] } else if (col.type === 'action') { + col.style = card.style || {} col.elements = card.type === 'action' ? (card.elements || []) : [] } @@ -592,7 +594,7 @@ }) return ( - <div className={`edit-table-columns ${config.setting.laypage} ${config.wrap.mode || ''}`} id={tableId}> + <div className={`edit-table-columns ${config.setting.laypage} ${config.wrap.mode || ''} table-vertical-${config.wrap.vertical || ''}`} id={tableId}> <div className="col-control"> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> diff --git a/src/menu/components/table/edit-table/options.jsx b/src/menu/components/table/edit-table/options.jsx index 977367f..565be7f 100644 --- a/src/menu/components/table/edit-table/options.jsx +++ b/src/menu/components/table/edit-table/options.jsx @@ -225,6 +225,19 @@ tooltip: '榛樿鍊� #e8e8e8銆�', required: false }, + { + type: 'radio', + field: 'vertical', + label: '鍨傜洿瀵归綈', + initval: wrap.vertical || 'middle', + tooltip: '鍗曞厓鏍肩殑鍨傜洿瀵归綈鏂瑰紡銆�', + required: false, + options: [ + {value: 'top', label: '鍚戜笂'}, + {value: 'middle', label: '灞呬腑'}, + {value: 'bottom', label: '鍚戜笅'}, + ] + }, // { // type: 'color', // field: 'color', diff --git a/src/menu/components/table/normal-table/columns/index.jsx b/src/menu/components/table/normal-table/columns/index.jsx index e976c72..1097ef5 100644 --- a/src/menu/components/table/normal-table/columns/index.jsx +++ b/src/menu/components/table/normal-table/columns/index.jsx @@ -70,7 +70,7 @@ <EditOutlined className="edit" title="缂栬緫" onClick={() => this.props.editColumn(column)} /> {column && column.type === 'custom' ? <PasteComponent options={['customCardElement']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} {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} + {column && (column.type === 'custom' || column.type === 'action') ? <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 field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } </div> @@ -170,7 +170,7 @@ ) } else if (column && column.type === 'action') { return ( - <td style={{padding: '0 5px', textAlign: column.Align}} className={'action-column ' + className}> + <td style={{padding: 0, textAlign: column.Align, ...(column.style || {})}} className={'action-column ' + className}> <CardCellComponent cards={config} cardCell={column} elements={column.elements} updateElement={this.updateCard}/> </td> ) @@ -400,8 +400,10 @@ if (col.type === 'colspan') { col.subcols = card.subcols || [] } else if (col.type === 'custom') { + col.style = card.style || {} col.elements = card.type === 'custom' ? (card.elements || []) : [] } else if (col.type === 'action') { + col.style = card.style || {} col.elements = card.type === 'action' ? (card.elements || []) : [] } @@ -605,7 +607,7 @@ const columns = this.handlecolumns(this.state.columns, fields, config) return ( - <div className={`normal-table-columns ${config.setting.laypage} ${config.wrap.tableType} ${config.wrap.mode || ''}`} id={tableId}> + <div className={`normal-table-columns ${config.setting.laypage} ${config.wrap.tableType} ${config.wrap.mode || ''} table-vertical-${config.wrap.vertical || ''}`} id={tableId}> <div className="col-control"> <CopyOutlined title="澶嶅埗鏄剧ず鍒�" onClick={this.copycolumn} /> <MarkColumn columns={fields} type="line" marks={lineMarks} onSubmit={this.updateLineMarks} /> diff --git a/src/menu/components/table/normal-table/options.jsx b/src/menu/components/table/normal-table/options.jsx index 594af13..70cf580 100644 --- a/src/menu/components/table/normal-table/options.jsx +++ b/src/menu/components/table/normal-table/options.jsx @@ -161,6 +161,19 @@ tooltip: '榛樿鍊� #e8e8e8銆�', required: false }, + { + type: 'radio', + field: 'vertical', + label: '鍨傜洿瀵归綈', + initval: wrap.vertical || 'middle', + tooltip: '鍗曞厓鏍肩殑鍨傜洿瀵归綈鏂瑰紡銆�', + required: false, + options: [ + {value: 'top', label: '鍚戜笂'}, + {value: 'middle', label: '灞呬腑'}, + {value: 'bottom', label: '鍚戜笅'}, + ] + }, // { // type: 'color', // field: 'color', diff --git a/src/menu/menushell/card.jsx b/src/menu/menushell/card.jsx index 3af7dc8..0226f8f 100644 --- a/src/menu/menushell/card.jsx +++ b/src/menu/menushell/card.jsx @@ -28,6 +28,7 @@ const CustomChart = asyncComponent(() => import('@/menu/components/chart/chart-custom')) const Timeline = asyncComponent(() => import('@/menu/components/timeline/normal-timeline')) const Voucher = asyncComponent(() => import('@/menu/components/module/voucher')) +const Account = asyncComponent(() => import('@/menu/components/module/account')) const Iframe = asyncComponent(() => import('@/menu/components/iframe')) const AntvG6 = asyncComponent(() => import('@/menu/components/chart/antv-G6')) @@ -121,6 +122,8 @@ return (<AntvG6 card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) } else if (card.type === 'module' && card.subtype === 'voucher') { return (<Voucher card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) + } else if (card.type === 'module' && card.subtype === 'account') { + return (<Account card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) } } return ( diff --git a/src/menu/menushell/index.jsx b/src/menu/menushell/index.jsx index ecef5dc..9024341 100644 --- a/src/menu/menushell/index.jsx +++ b/src/menu/menushell/index.jsx @@ -100,6 +100,7 @@ timeline: '鏃堕棿杞�', antvG6: '鏍戝浘', iframe: 'iframe', + module: '妯″潡', card: '鍗$墖' } let i = 1 diff --git a/src/menu/modulesource/option.jsx b/src/menu/modulesource/option.jsx index ad80395..08ea221 100644 --- a/src/menu/modulesource/option.jsx +++ b/src/menu/modulesource/option.jsx @@ -30,7 +30,7 @@ import mindmap from '@/assets/mobimg/mindmap.png' import indent from '@/assets/mobimg/indent.jfif' import kapmap from '@/assets/mobimg/kapmap.jfif' -import Voucher from '@/assets/mobimg/voucher.jpg' +// import Voucher from '@/assets/mobimg/voucher.jpg' // 缁勪欢閰嶇疆淇℃伅 export const menuOptions = [ @@ -68,5 +68,6 @@ { type: 'menu', url: SandBox, component: 'code', subtype: 'sandbox', title: '鑷畾涔�', width: 24 }, { type: 'menu', url: group, component: 'group', subtype: 'normalgroup', title: '鍒嗙粍', width: 24, forbid: ['billPrint'] }, { type: 'menu', url: Iframe, component: 'iframe', subtype: 'iframe', title: 'iframe', width: 24, forbid: ['billPrint'] }, - { type: 'menu', url: Voucher, component: 'module', subtype: 'voucher', title: '鍑瘉', width: 24, forbid: ['billPrint'] }, + // { type: 'menu', url: Voucher, component: 'module', subtype: 'account', title: '璐﹀', width: 24, forbid: ['billPrint'] }, + // { type: 'menu', url: Voucher, component: 'module', subtype: 'voucher', title: '鍑瘉', width: 24, forbid: ['billPrint'] }, ] diff --git a/src/tabviews/custom/components/module/account/index.jsx b/src/tabviews/custom/components/module/account/index.jsx new file mode 100644 index 0000000..8438606 --- /dev/null +++ b/src/tabviews/custom/components/module/account/index.jsx @@ -0,0 +1,86 @@ +import React, {Component} from 'react' +import PropTypes from 'prop-types' +import { is, fromJS } from 'immutable' +// import { Button, Select, Input, DatePicker } from 'antd' +// import { EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined } from '@ant-design/icons' + +import Api from '@/api' +// import MKEmitter from '@/utils/events.js' +import './index.scss' + +class AccountModule extends Component { + static propTpyes = { + config: PropTypes.object + } + + state = { + BID: '', + type: '', + config: null + } + + UNSAFE_componentWillMount () { + const { config } = this.props + + let BID = '' + let BData = '' + + if (config.wrap.supModule) { + BData = window.GLOB.CacheData.get(config.wrap.supModule) + } else { + BData = window.GLOB.CacheData.get(config.$pageId) + } + if (BData) { + BID = BData.$BID || '' + } + + this.setState({ + config: fromJS(config).toJS(), + BID: BID || '', + type: config.wrap.type + }, () => { + this.loadData() + }) + } + + componentDidMount () { + + } + + shouldComponentUpdate (nextProps, nextState) { + return !is(fromJS(this.state), fromJS(nextState)) + } + + /** + * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊锛屾竻闄ゅ揩鎹烽敭璁剧疆 + */ + componentWillUnmount () { + this.setState = () => { + return + } + } + + loadData = () => { + let param = { + func: 's_get_fcc_account_data' + } + Api.genericInterface(param) + + let _param = { + func: 's_get_fcc_book_data' + } + Api.genericInterface(_param) + } + + render() { + const { config } = this.state + + return ( + <div className="menu-account-wrap" style={config.style}> + + </div> + ) + } +} + +export default AccountModule \ No newline at end of file diff --git a/src/tabviews/custom/components/module/account/index.scss b/src/tabviews/custom/components/module/account/index.scss new file mode 100644 index 0000000..13b76cb --- /dev/null +++ b/src/tabviews/custom/components/module/account/index.scss @@ -0,0 +1,14 @@ +.menu-account-wrap { + position: relative; + box-sizing: border-box; + background: #ffffff; + background-position: center center; + background-repeat: no-repeat; + background-size: cover; + min-height: 150px; + overflow-y: auto; + color: #000000; + +} + + diff --git a/src/tabviews/custom/components/module/voucher/index.jsx b/src/tabviews/custom/components/module/voucher/index.jsx index 2fafcd4..309b255 100644 --- a/src/tabviews/custom/components/module/voucher/index.jsx +++ b/src/tabviews/custom/components/module/voucher/index.jsx @@ -74,6 +74,11 @@ func: 's_get_fcc_account_data' } Api.genericInterface(param) + + let _param = { + func: 's_get_fcc_book_data' + } + Api.genericInterface(_param) } triggeradd = () => { diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx index 34e9aad..7cb3013 100644 --- a/src/tabviews/custom/components/share/normalTable/index.jsx +++ b/src/tabviews/custom/components/share/normalTable/index.jsx @@ -385,7 +385,10 @@ <CardCellComponent data={record} cards={config} elements={col.elements}/> ) } else if (col.type === 'action') { - style.padding = '0px 5px' + style.padding = '0px' + if (col.style) { + style = {...style, ...col.style} + } resProps.children = ( <CardCellComponent data={record} cards={config} elements={col.elements}/> ) @@ -960,7 +963,7 @@ let height = setting.height || false return ( - <div className={`normal-custom-table ${setting.tableHeader || ''} ${height ? 'fixed-height' : ''} ${setting.mode || ''}`} id={tableId}> + <div className={`normal-custom-table ${setting.tableHeader || ''} ${height ? 'fixed-height' : ''} ${setting.mode || ''} table-vertical-${setting.vertical || ''}`} id={tableId}> {(setting.tableType === 'radio' || setting.tableType === 'checkbox') && data && data.length > 0 ? <Switch title="鏀惰捣" className="main-pickup" checkedChildren="寮�" unCheckedChildren="鍏�" checked={pickup} onChange={this.pickupChange} /> : null } diff --git a/src/tabviews/custom/components/share/normalTable/index.scss b/src/tabviews/custom/components/share/normalTable/index.scss index a339616..bcd3880 100644 --- a/src/tabviews/custom/components/share/normalTable/index.scss +++ b/src/tabviews/custom/components/share/normalTable/index.scss @@ -94,7 +94,7 @@ // vertical-align: top; .card-cell-list { - color: rgba(0, 0, 0, 0.85); + color: var(--mk-table-color); } .ant-mk-picture { position: relative; diff --git a/src/tabviews/custom/components/table/base-table/index.scss b/src/tabviews/custom/components/table/base-table/index.scss index dd90bb5..34f97b7 100644 --- a/src/tabviews/custom/components/table/base-table/index.scss +++ b/src/tabviews/custom/components/table/base-table/index.scss @@ -7,6 +7,7 @@ } .top-search { border-bottom: 1px solid #efefef; + padding-top: 10px; } >.button-list.toolbar-button { min-height: 60px; diff --git a/src/tabviews/custom/components/table/edit-table/index.scss b/src/tabviews/custom/components/table/edit-table/index.scss index 686b44b..16ea698 100644 --- a/src/tabviews/custom/components/table/edit-table/index.scss +++ b/src/tabviews/custom/components/table/edit-table/index.scss @@ -7,6 +7,7 @@ } .top-search { border-bottom: 1px solid #efefef; + padding-top: 10px; } >.button-list.toolbar-button { padding: 0; 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 19bf7e3..b2fdec6 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -507,7 +507,10 @@ <CardCellComponent data={record} cards={config} elements={col.elements}/> ) } else if (col.type === 'action') { - style.padding = '0px 5px' + style.padding = '0px' + if (col.style) { + style = {...style, ...col.style} + } children = ( <CardCellComponent data={record} cards={config} elements={col.elements}/> ) @@ -1988,7 +1991,7 @@ {!submit.hasAction && pickup ? <Button style={submit.style} onClick={() => setTimeout(() => {this.checkData()}, 10)} loading={loading} className="submit-table" type="link">鎻愪氦</Button> : null} <Switch title="缂栬緫" className="main-pickup" checkedChildren="寮�" unCheckedChildren="鍏�" disabled={loading || this.props.loading} checked={pickup} onChange={this.pickupChange} /> </div> - <div className={`edit-custom-table ${pickup ? 'editable' : ''} ${setting.tableHeader || ''} ${setting.operType || ''} ${height ? 'fixed-height' : ''} ${setting.mode || ''}`} id={tableId}> + <div className={`edit-custom-table ${pickup ? 'editable' : ''} ${setting.tableHeader || ''} ${setting.operType || ''} ${height ? 'fixed-height' : ''} ${setting.mode || ''} table-vertical-${setting.vertical || ''}`} id={tableId}> <Table rowKey="$$uuid" components={components} diff --git a/src/tabviews/custom/components/table/normal-table/index.scss b/src/tabviews/custom/components/table/normal-table/index.scss index c628e76..22eb16b 100644 --- a/src/tabviews/custom/components/table/normal-table/index.scss +++ b/src/tabviews/custom/components/table/normal-table/index.scss @@ -7,6 +7,7 @@ } .top-search { border-bottom: 1px solid #efefef; + padding-top: 10px; } >.button-list.toolbar-button { min-height: 60px; diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index b35c3c2..453c221 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -40,6 +40,7 @@ const TimeLine = asyncComponent(() => import('./components/timeline/normal-timeline')) const AntvG6 = asyncComponent(() => import('./components/chart/antv-G6')) const Voucher = asyncComponent(() => import('./components/module/voucher')) +const Account = asyncComponent(() => import('./components/module/account')) const Iframe = asyncComponent(() => import('./components/iframe')) const DebugTable = asyncComponent(() => import('@/tabviews/debugtable')) const TableNodes = asyncComponent(() => import('@/tabviews/zshare/tablenodes')) @@ -1276,6 +1277,12 @@ <Voucher config={item}/> </Col> ) + } else if (item.type === 'module' && item.subtype === 'account') { + return ( + <Col span={item.width} style={style} key={item.uuid}> + <Account config={item}/> + </Col> + ) } else if (item.type === 'iframe') { return ( <Col span={item.width} style={style} key={item.uuid}> diff --git a/src/templates/comtableconfig/updatetable/index.jsx b/src/templates/comtableconfig/updatetable/index.jsx index d947713..8aaf83b 100644 --- a/src/templates/comtableconfig/updatetable/index.jsx +++ b/src/templates/comtableconfig/updatetable/index.jsx @@ -897,10 +897,12 @@ datatype: 'dynamic', eleType: _cols[sub].type !== 'number' ? 'text' : 'number', field: sub, - height: 1, - innerHeight: 21, + height: '', + innerHeight: 'auto', marks: _cols[sub].marks || null, noValue: 'show', + prefix: _cols[sub].prefix || '', + postfix: _cols[sub].postfix || '', style: {}, width: 24, uuid: Utils.getuuid() diff --git a/src/templates/sharecomponent/searchcomponent/index.scss b/src/templates/sharecomponent/searchcomponent/index.scss index 4a4a374..9ba3f42 100644 --- a/src/templates/sharecomponent/searchcomponent/index.scss +++ b/src/templates/sharecomponent/searchcomponent/index.scss @@ -26,6 +26,9 @@ vertical-align: top; } .mk-search-item-wrap.action { + .ant-form-item { + white-space: nowrap; + } .ant-form-item-label, .ant-form-item-control-wrapper { display: inline-block; } -- Gitblit v1.8.0