From 95afd40fc2741ac0ce59c2091f6cfce1f98877d4 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 24 六月 2021 09:15:45 +0800 Subject: [PATCH] 2021-06-24 --- src/templates/sharecomponent/searchcomponent/searcheditable/index.jsx | 10 src/templates/zshare/modalform/index.jsx | 4 src/templates/subtableconfig/source.jsx | 6 src/tabviews/zshare/topSearch/index.jsx | 131 ++++----- src/menu/components/share/searchcomponent/index.jsx | 2 src/templates/sharecomponent/searchcomponent/dragsearch/card.jsx | 51 ++- src/templates/sharecomponent/searchcomponent/index.jsx | 2 src/menu/components/share/searchcomponent/dragsearch/card.jsx | 2 src/pc/quotecomponent/index.jsx | 2 src/templates/modalconfig/checkCard/index.jsx | 9 src/templates/zshare/editcomponent/index.jsx | 2 src/templates/sharecomponent/searchcomponent/searchform/index.scss | 15 + src/tabviews/zshare/topSearch/index.scss | 3 src/tabviews/commontable/index.jsx | 4 src/templates/calendarconfig/source.jsx | 6 src/views/mobdesign/index.jsx | 2 src/menu/components/search/main-search/index.scss | 13 + src/utils/utils.js | 3 src/index.js | 2 src/menu/components/share/pastecomponent/index.jsx | 2 src/menu/components/card/cardcellcomponent/index.jsx | 2 src/views/pcdesign/index.jsx | 2 src/templates/zshare/formconfig.jsx | 181 +++++++++++-- src/menu/components/share/actioncomponent/formconfig.jsx | 2 src/templates/comtableconfig/source.jsx | 6 src/menu/components/search/main-search/dragsearch/card.jsx | 51 ++- src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx | 2 src/menu/components/search/main-search/index.jsx | 3 /dev/null | 38 -- package.json | 2 src/tabviews/zshare/topSearch/advanceform/index.scss | 3 src/tabviews/zshare/topSearch/advanceform/index.jsx | 20 + src/templates/sharecomponent/searchcomponent/index.scss | 3 src/menu/components/share/searchcomponent/dragsearch/index.scss | 6 src/templates/sharecomponent/searchcomponent/searchform/index.jsx | 142 +++++++++- 35 files changed, 497 insertions(+), 237 deletions(-) diff --git a/package.json b/package.json index e9d796b..aaef24f 100644 --- a/package.json +++ b/package.json @@ -192,7 +192,7 @@ ] ] }, - "homepage": "./build", + "homepage": ".", "devDependencies": { "typescript": "^4.0.2" } diff --git a/src/index.js b/src/index.js index fcc809d..3882a86 100644 --- a/src/index.js +++ b/src/index.js @@ -59,7 +59,7 @@ // 鏂扮郴缁熸枃浠剁疆浜巃dmin涓� ../options.json -fetch('./options.json') +fetch('../options.json') .then(response => response.json()) .catch(() => { document.getElementById('root').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh;">绯荤粺閰嶇疆淇℃伅鑾峰彇澶辫触锛岃鑱旂郴绠$悊鍛橈紒</div>' diff --git a/src/menu/components/card/cardcellcomponent/index.jsx b/src/menu/components/card/cardcellcomponent/index.jsx index ea7caee..3f1b073 100644 --- a/src/menu/components/card/cardcellcomponent/index.jsx +++ b/src/menu/components/card/cardcellcomponent/index.jsx @@ -138,7 +138,7 @@ let options = ['font', 'border', 'padding', 'margin', 'backgroundColor'] if (element.eleType === 'button') { - + options.push('width') } else if (element.eleType === 'picture') { options = ['border', 'margin'] } else if (element.eleType === 'slider') { diff --git a/src/menu/components/search/main-search/dragsearch/card.jsx b/src/menu/components/search/main-search/dragsearch/card.jsx index c5694d6..c858b2e 100644 --- a/src/menu/components/search/main-search/dragsearch/card.jsx +++ b/src/menu/components/search/main-search/dragsearch/card.jsx @@ -3,10 +3,12 @@ import { Icon, Select, DatePicker, Input, Popover, Form } from 'antd' import moment from 'moment' +import asyncComponent from '@/utils/asyncComponent' import DateGroup from '../dategroup' import './index.scss' const { MonthPicker, WeekPicker, RangePicker } = DatePicker +const CheckCard = asyncComponent(() => import('@/templates/modalconfig/checkCard')) const Card = ({ id, card, showField, moveCard, copyCard, findCard, editCard, delCard }) => { const originalIndex = findCard(id).index @@ -55,6 +57,30 @@ } } + let formItem = null + if (card.type === 'text') { + formItem = (<Input style={{marginTop: '4px'}} placeholder={card.labelShow === 'false' ? card.label : ''} value={card.initval} />) + } else if (card.type === 'multiselect' || card.type === 'select' || card.type === 'link') { + formItem = (<Select value={_defaultValue}></Select>) + } else if (card.type === 'date') { + formItem = (<DatePicker value={card.initval ? moment().subtract(card.initval, 'days') : null} />) + } else if (card.type === 'dateweek') { + formItem = (<WeekPicker value={card.initval ? moment().subtract(card.initval * 7, 'days') : null} />) + } else if (card.type === 'datemonth') { + formItem = (<MonthPicker value={card.initval ? moment().subtract(card.initval, 'month') : null} />) + } else if (card.type === 'daterange') { + formItem = (<RangePicker + className="data-range" + placeholder={['BeginTime', 'EndTime']} + renderExtraFooter={() => 'extra footer'} + value={_defaultValue} + />) + } else if (card.type === 'group') { + formItem = (<DateGroup card={card} />) + } else if (card.type === 'checkcard') { + formItem = <CheckCard config={card} /> + } + return ( <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> @@ -72,30 +98,7 @@ required={card.required === 'true'} help={showField ? card.field + (card.datefield ? ', ' + card.datefield : '') : ''} > - {card.type === 'text' ? - <Input style={{marginTop: '4px'}} placeholder={card.labelShow === 'false' ? card.label : ''} value={card.initval} /> : null - } - {(card.type === 'multiselect' || card.type === 'select' || card.type === 'link') ? - <Select value={_defaultValue}></Select> : null - } - {card.type === 'date' ? - <DatePicker value={card.initval ? moment().subtract(card.initval, 'days') : null} /> : null - } - {card.type === 'dateweek' ? - <WeekPicker value={card.initval ? moment().subtract(card.initval * 7, 'days') : null} /> : null - } - {card.type === 'datemonth' ? - <MonthPicker value={card.initval ? moment().subtract(card.initval, 'month') : null} /> : null - } - {card.type === 'daterange' ? - <RangePicker - className="data-range" - placeholder={['BeginTime', 'EndTime']} - renderExtraFooter={() => 'extra footer'} - value={_defaultValue} - /> : null - } - {card.type === 'group' ? <DateGroup card={card} /> : null } + {formItem} </Form.Item> </div> </div> diff --git a/src/menu/components/search/main-search/index.jsx b/src/menu/components/search/main-search/index.jsx index e56dafa..0531cbe 100644 --- a/src/menu/components/search/main-search/index.jsx +++ b/src/menu/components/search/main-search/index.jsx @@ -31,6 +31,7 @@ state = { dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, + appType: sessionStorage.getItem('appType'), searchlist: null, // 鎼滅储鏉′欢闆� sqlVerifing: false, // sql楠岃瘉涓� visible: false, // 妯℃�佹鎺у埗 @@ -263,7 +264,7 @@ return } - if (['select', 'multiselect', 'link'].includes(res.type) && res.resourceType === '1' && /\s/.test(res.dataSource)) { + if (['select', 'multiselect', 'link', 'checkcard'].includes(res.type) && res.resourceType === '1' && /\s/.test(res.dataSource)) { this.setState({ sqlVerifing: true }) diff --git a/src/menu/components/search/main-search/index.scss b/src/menu/components/search/main-search/index.scss index be3d2e8..55775f4 100644 --- a/src/menu/components/search/main-search/index.scss +++ b/src/menu/components/search/main-search/index.scss @@ -4,6 +4,9 @@ background: #ffffff; padding-bottom: 15px; + .ant-form-item-control { + line-height: 1.5; + } >.ant-switch { position: absolute; z-index: 3; @@ -24,6 +27,13 @@ min-height: 65px; > .ant-col { padding: 0 12px!important; + } + } + >.ant-row:not(.ant-form-item) { + > .ant-col { + display: inline-block; + float: none; + vertical-align: top; } } .ant-row.ant-form-item .ant-col { @@ -80,6 +90,9 @@ min-width: 100px!important; width: 100%; } + .check-card-edit-box { + margin-top: 5px!important; + } } .main-search-edit-list.right { >.ant-row { diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index b4a2e38..16301bc 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -198,7 +198,7 @@ label: '閾炬帴鏂瑰紡', initVal: card.open || 'blank', required: true, - forbid: sessionStorage.getItem('appType') === 'pc', + forbid: sessionStorage.getItem('appType') !== 'pc', options: [{ value: 'blank', text: '鏂扮獥鍙�' diff --git a/src/menu/components/share/pastecomponent/index.jsx b/src/menu/components/share/pastecomponent/index.jsx index 73de275..553d24d 100644 --- a/src/menu/components/share/pastecomponent/index.jsx +++ b/src/menu/components/share/pastecomponent/index.jsx @@ -168,7 +168,7 @@ let keys = config.search.map(item => item.field.toLowerCase()) if (type === 'form') { - if (['number', 'switch', 'textarea', 'checkcard', 'fileupload', 'hint', 'color', 'funcvar'].includes(res.type)) { + if (['number', 'switch', 'textarea', 'fileupload', 'hint', 'color', 'funcvar'].includes(res.type)) { res.type = 'text' } else if (res.type === 'radio') { res.type = 'select' diff --git a/src/menu/components/share/searchcomponent/dategroup/index.jsx b/src/menu/components/share/searchcomponent/dategroup/index.jsx deleted file mode 100644 index 37b8769..0000000 --- a/src/menu/components/share/searchcomponent/dategroup/index.jsx +++ /dev/null @@ -1,32 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { Tag } from 'antd' -import './index.scss' - -const { CheckableTag } = Tag - -class DateGroup extends Component { - static propTpyes = { - card: PropTypes.object // 瀛楀吀椤� - } - - render() { - const { card } = this.props - let tabs = {day: '鏃�', week: '鍛�', month: '鏈�', quarter: '瀛�', year: '骞�', customized: '鑷畾涔�'} - - return ( - <div className="model-date-group"> - {card.items.map(tab => ( - <CheckableTag - key={tab} - checked={card.initval && card.initval.includes(tab)} - > - {tabs[tab]} - </CheckableTag> - ))} - </div> - ) - } -} - -export default DateGroup \ No newline at end of file diff --git a/src/menu/components/share/searchcomponent/dategroup/index.scss b/src/menu/components/share/searchcomponent/dategroup/index.scss deleted file mode 100644 index 6782732..0000000 --- a/src/menu/components/share/searchcomponent/dategroup/index.scss +++ /dev/null @@ -1,38 +0,0 @@ -.model-date-group { - white-space: nowrap; - line-height: 40px; - position: relative; - z-index: 1; - - .ant-tag-checkable { - border-color: #d1d5d9; - border-radius: 2px; - margin-right: 2px; - padding: 2px 6px; - } - .ant-tag-checkable-checked { - border-color: #1890ff; - } -} - -@media screen and (min-width: 1440px) { - .model-date-group { - .ant-tag-checkable { - padding: 2px 7px; - } - } -} -@media screen and (min-width: 1600px) { - .model-date-group { - .ant-tag-checkable { - padding: 2px 9px; - } - } -} -@media screen and (min-width: 1920px) { - .model-date-group { - .ant-tag-checkable { - padding: 2px 11px; - } - } -} \ No newline at end of file diff --git a/src/menu/components/share/searchcomponent/dragsearch/card.jsx b/src/menu/components/share/searchcomponent/dragsearch/card.jsx index ad010e7..d0d41c2 100644 --- a/src/menu/components/share/searchcomponent/dragsearch/card.jsx +++ b/src/menu/components/share/searchcomponent/dragsearch/card.jsx @@ -3,7 +3,7 @@ import { Icon, Select, DatePicker, Input, Popover, Form } from 'antd' import moment from 'moment' -import DateGroup from '../dategroup' +import DateGroup from '@/menu/components/search/main-search/dategroup' import './index.scss' const { MonthPicker, WeekPicker, RangePicker } = DatePicker diff --git a/src/menu/components/share/searchcomponent/dragsearch/index.scss b/src/menu/components/share/searchcomponent/dragsearch/index.scss index 369ae98..e69de29 100644 --- a/src/menu/components/share/searchcomponent/dragsearch/index.scss +++ b/src/menu/components/share/searchcomponent/dragsearch/index.scss @@ -1,6 +0,0 @@ -.common-drawarea-placeholder { - width: 100%; - line-height: 65px; - text-align: center; - color: #bcbcbc; -} \ No newline at end of file diff --git a/src/menu/components/share/searchcomponent/index.jsx b/src/menu/components/share/searchcomponent/index.jsx index c123995..5aa9876 100644 --- a/src/menu/components/share/searchcomponent/index.jsx +++ b/src/menu/components/share/searchcomponent/index.jsx @@ -210,7 +210,7 @@ return } - if ((res.type === 'select' || res.type === 'multiselect' || res.type === 'link') && res.resourceType === '1' && /\s/.test(res.dataSource)) { + if (['select', 'multiselect', 'link', 'checkcard'].includes(res.type) && res.resourceType === '1' && /\s/.test(res.dataSource)) { this.setState({ sqlVerifing: true }) diff --git a/src/pc/quotecomponent/index.jsx b/src/pc/quotecomponent/index.jsx index 36d5469..a0bb263 100644 --- a/src/pc/quotecomponent/index.jsx +++ b/src/pc/quotecomponent/index.jsx @@ -51,7 +51,7 @@ Api.getSystemConfig({ func: 'sPC_Get_LongParam', TypeCharOne: sessionStorage.getItem('kei_no'), - typename: sessionStorage.getItem('appType') || 'pc', + typename: sessionStorage.getItem('typename') || 'pc', MenuID: res.keys_id }).then(result => { if (!result.status) { diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index 34aa1e7..7980e0c 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -540,12 +540,12 @@ let mkey = result.mk_api_key || '' - delete result.mk_ex_invoke + delete result.mk_ex_invoke // 鏄惁缁х画鎵ц delete result.status delete result.message delete result.ErrCode delete result.ErrMesg - delete result.mk_api_key + delete result.mk_api_key // 褰撳墠璇锋眰鐨刱ey鍊硷紝鐢ㄤ簬鍥炶皟 let param = {} diff --git a/src/tabviews/zshare/topSearch/advanceform/index.jsx b/src/tabviews/zshare/topSearch/advanceform/index.jsx index cd54444..8c47589 100644 --- a/src/tabviews/zshare/topSearch/advanceform/index.jsx +++ b/src/tabviews/zshare/topSearch/advanceform/index.jsx @@ -3,10 +3,12 @@ import { fromJS } from 'immutable' import { Form, Row, Col, Input, Select, DatePicker } from 'antd' +import asyncComponent from '@/utils/asyncComponent' import Utils from '@/utils/utils.js' import './index.scss' const { MonthPicker, WeekPicker, RangePicker } = DatePicker +const CheckCard = asyncComponent(() => import('@/tabviews/zshare/mutilform/checkCard')) class AdvanceSearch extends Component { static propTpyes = { @@ -246,6 +248,24 @@ </Form.Item> </Col> ) + } else if (item.type === 'checkcard') { // 澶氶�夋 + fields.push( + <Col span={item.ratio || 6} key={index}> + <Form.Item label={item.labelShow !== 'false' ? item.label : ''}> + {getFieldDecorator(item.field, { + initialValue: item.initval, + rules: [ + { + required: item.required, + message: dict['form.required.select'] + item.label + '!' + } + ] + })( + <CheckCard card={item} /> + )} + </Form.Item> + </Col> + ) } }) diff --git a/src/tabviews/zshare/topSearch/advanceform/index.scss b/src/tabviews/zshare/topSearch/advanceform/index.scss index 141283d..4cde22e 100644 --- a/src/tabviews/zshare/topSearch/advanceform/index.scss +++ b/src/tabviews/zshare/topSearch/advanceform/index.scss @@ -25,4 +25,7 @@ .ant-calendar-picker-container { z-index: 10 !important; } + .check-card-form-box { + margin-top: 5px; + } } \ No newline at end of file diff --git a/src/tabviews/zshare/topSearch/index.jsx b/src/tabviews/zshare/topSearch/index.jsx index be6e6fe..0401534 100644 --- a/src/tabviews/zshare/topSearch/index.jsx +++ b/src/tabviews/zshare/topSearch/index.jsx @@ -7,6 +7,7 @@ import Api from '@/api' import options from '@/store/options.js' import DateGroup from '@/tabviews/zshare/dategroup' +import asyncComponent from '@/utils/asyncComponent' import asyncSpinComponent from '@/utils/asyncSpinComponent' import Utils from '@/utils/utils.js' import zhCN from '@/locales/zh-CN/main.js' @@ -16,6 +17,7 @@ const { MonthPicker, WeekPicker, RangePicker } = DatePicker const MutilForm = asyncSpinComponent(() => import('./advanceform')) +const CheckCard = asyncComponent(() => import('@/tabviews/zshare/mutilform/checkCard')) class MainSearch extends Component { static propTpyes = { @@ -96,7 +98,7 @@ item.required = item.required === 'true' - if (['select', 'link', 'multiselect'].includes(item.type)) { + if (['select', 'link', 'multiselect', 'checkcard'].includes(item.type)) { if (item.setAll === 'true' && item.type !== 'multiselect') { item.options.unshift({ key: Utils.getuuid(), @@ -382,41 +384,51 @@ delete result.message delete result.status - let _searchlist = this.state.searchlist.map(item => { - if (['select', 'link', 'multiselect'].includes(item.type) && result[item.field] && result[item.field].length > 0) { - let options = result[item.field].map(cell => { - let _item = { - key: Utils.getuuid(), - Value: cell[item.valueField], - Text: cell[item.valueText] - } + this.resetSearch(result) + }) + } - if (item.type === 'link') { - _item.ParentID = cell[item.linkField] - } - - return _item - }) - - item.oriOptions = [...item.oriOptions, ...options] - } - return item - }) - - this.setState({ - searchlist: _searchlist.map(item => { - if (item.type === 'link') { - if (item.supInitVal) { - item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal || option.Value === '') - } else { - item.options = item.oriOptions - } - } else if (item.type === 'select' || item.type === 'multiselect') { - item.options = item.oriOptions + resetSearch = (result) => { + let _searchlist = this.state.searchlist.map(item => { + if (['select', 'link', 'multiselect', 'checkcard'].includes(item.type) && result[item.field] && result[item.field].length > 0) { + let options = result[item.field].map(cell => { + let _item = { + key: Utils.getuuid() } - return item + if (item.type !== 'checkcard') { + _item.Value = cell[item.valueField] + _item.Text = cell[item.valueText] + } else { + _item.$value = cell[item.cardValField] + _item = {..._item, ...cell} + } + + if (item.type === 'link') { + _item.ParentID = cell[item.linkField] + } + + return _item }) + + item.oriOptions = [...item.oriOptions, ...options] + } + return item + }) + + this.setState({ + searchlist: _searchlist.map(item => { + if (item.type === 'link') { + if (item.supInitVal) { + item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal || option.Value === '') + } else { + item.options = item.oriOptions + } + } else if (item.type === 'select' || item.type === 'multiselect' || item.type === 'checkcard') { + item.options = item.oriOptions + } + + return item }) }) } @@ -468,42 +480,7 @@ delete result.message delete result.status - let _searchlist = this.state.searchlist.map(item => { - if (['select', 'link', 'multiselect'].includes(item.type) && result[item.field] && result[item.field].length > 0) { - let options = result[item.field].map(cell => { - let _item = { - key: Utils.getuuid(), - Value: cell[item.valueField], - Text: cell[item.valueText] - } - - if (item.type === 'link') { - _item.ParentID = cell[item.linkField] - } - - return _item - }) - - item.oriOptions = [...item.oriOptions, ...options] - } - return item - }) - - this.setState({ - searchlist: _searchlist.map(item => { - if (item.type === 'link') { - if (item.supInitVal) { - item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal || option.Value === '') - } else { - item.options = item.oriOptions - } - } else if (item.type === 'select' || item.type === 'multiselect') { - item.options = item.oriOptions - } - - return item - }) - }) + this.resetSearch(result) }) } @@ -748,6 +725,24 @@ </Form.Item> </Col> ) + } else if (item.type === 'checkcard') { // 澶氶�夋 + fields.push( + <Col span={item.ratio || 6} key={index}> + <Form.Item label={item.labelShow !== 'false' ? item.label : ''}> + {getFieldDecorator(item.field, { + initialValue: item.initval, + rules: [ + { + required: item.required, + message: dict['form.required.select'] + item.label + '!' + } + ] + })( + <CheckCard card={item} onChange={this.searchChange} /> + )} + </Form.Item> + </Col> + ) } }) diff --git a/src/tabviews/zshare/topSearch/index.scss b/src/tabviews/zshare/topSearch/index.scss index 449f40b..40b4ede 100644 --- a/src/tabviews/zshare/topSearch/index.scss +++ b/src/tabviews/zshare/topSearch/index.scss @@ -63,6 +63,9 @@ } } } + .check-card-form-box { + margin-top: 5px; + } } .top-search.right { >.ant-row { diff --git a/src/templates/calendarconfig/source.jsx b/src/templates/calendarconfig/source.jsx index 061fc0c..9ed369e 100644 --- a/src/templates/calendarconfig/source.jsx +++ b/src/templates/calendarconfig/source.jsx @@ -106,6 +106,12 @@ }, { type: 'search', + label: '閫夐」鍗�', + subType: 'checkcard', + url: '' + }, + { + type: 'search', label: CommonDict['model.form.dateday'], subType: 'date', url: '' diff --git a/src/templates/comtableconfig/source.jsx b/src/templates/comtableconfig/source.jsx index 47c8a55..d5297f9 100644 --- a/src/templates/comtableconfig/source.jsx +++ b/src/templates/comtableconfig/source.jsx @@ -228,6 +228,12 @@ }, { type: 'search', + label: '閫夐」鍗�', + subType: 'checkcard', + url: '' + }, + { + type: 'search', label: CommonDict['model.form.dateday'], subType: 'date', url: '' diff --git a/src/templates/modalconfig/checkCard/index.jsx b/src/templates/modalconfig/checkCard/index.jsx index 60a6e3e..7357c63 100644 --- a/src/templates/modalconfig/checkCard/index.jsx +++ b/src/templates/modalconfig/checkCard/index.jsx @@ -13,14 +13,15 @@ state = {} getCards = () => { - const { display, width, options, fields, ratio, backgroundColor, borderColor } = this.props.config + const { display, width, options, fields, ratio, picratio, backgroundColor, borderColor } = this.props.config + let _ratio = picratio || ratio let paddingTop = '100%' - if (ratio === '4:3') { + if (_ratio === '4:3') { paddingTop = '75%' - } else if (ratio === '3:2') { + } else if (_ratio === '3:2') { paddingTop = '66.7%' - } else if (ratio === '16:9') { + } else if (_ratio === '16:9') { paddingTop = '56.25%' } diff --git a/src/templates/sharecomponent/searchcomponent/dragsearch/card.jsx b/src/templates/sharecomponent/searchcomponent/dragsearch/card.jsx index 0c1cd30..1981f06 100644 --- a/src/templates/sharecomponent/searchcomponent/dragsearch/card.jsx +++ b/src/templates/sharecomponent/searchcomponent/dragsearch/card.jsx @@ -4,9 +4,11 @@ import moment from 'moment' import DateGroup from '../dategroup' +import asyncComponent from '@/utils/asyncComponent' import './index.scss' const { MonthPicker, WeekPicker, RangePicker } = DatePicker +const CheckCard = asyncComponent(() => import('@/templates/modalconfig/checkCard')) const Card = ({ id, card, showField, moveCard, copyCard, findCard, editCard, delCard }) => { const originalIndex = findCard(id).index @@ -57,6 +59,30 @@ } } + let formItem = null + if (card.type === 'text') { + formItem = (<Input style={{marginTop: '4px'}} placeholder={card.labelShow === 'false' ? card.label : ''} value={card.initval} />) + } else if (card.type === 'multiselect' || card.type === 'select' || card.type === 'link') { + formItem = (<Select value={_defaultValue}></Select>) + } else if (card.type === 'date') { + formItem = (<DatePicker value={card.initval ? moment().subtract(card.initval, 'days') : null} />) + } else if (card.type === 'dateweek') { + formItem = (<WeekPicker value={card.initval ? moment().subtract(card.initval * 7, 'days') : null} />) + } else if (card.type === 'datemonth') { + formItem = (<MonthPicker value={card.initval ? moment().subtract(card.initval, 'month') : null} />) + } else if (card.type === 'daterange') { + formItem = (<RangePicker + className="data-range" + placeholder={['BeginTime', 'EndTime']} + renderExtraFooter={() => 'extra footer'} + value={_defaultValue} + />) + } else if (card.type === 'group') { + formItem = (<DateGroup card={card} />) + } else if (card.type === 'checkcard') { + formItem = <CheckCard config={card} /> + } + return ( <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> @@ -74,30 +100,7 @@ required={card.required === 'true'} help={showField ? card.field + (card.datefield ? ', ' + card.datefield : '') : ''} > - {card.type === 'text' ? - <Input style={{marginTop: '4px'}} value={card.initval} /> : null - } - {(card.type === 'multiselect' || card.type === 'select' || card.type === 'link') ? - <Select value={_defaultValue}></Select> : null - } - {card.type === 'date' ? - <DatePicker value={card.initval ? moment().subtract(card.initval, 'days') : null} /> : null - } - {card.type === 'dateweek' ? - <WeekPicker value={card.initval ? moment().subtract(card.initval * 7, 'days') : null} /> : null - } - {card.type === 'datemonth' ? - <MonthPicker value={card.initval ? moment().subtract(card.initval, 'month') : null} /> : null - } - {card.type === 'daterange' ? - <RangePicker - className="data-range" - placeholder={['BeginTime', 'EndTime']} - renderExtraFooter={() => 'extra footer'} - value={_defaultValue} - /> : null - } - {card.type === 'group' ? <DateGroup card={card} /> : null } + {formItem} </Form.Item> </div> </div> diff --git a/src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx b/src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx index fa82c21..d65fdec 100644 --- a/src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx @@ -94,7 +94,7 @@ newcard.display = 'dropdown' let _match = 'like' - if (item.subType === 'select' || item.subType === 'link') { + if (item.subType === 'select' || item.subType === 'link' || item.subType === 'checkcard') { _match = '=' } else if (item.subType === 'date' || item.subType === 'datemonth') { _match = '>=' diff --git a/src/templates/sharecomponent/searchcomponent/index.jsx b/src/templates/sharecomponent/searchcomponent/index.jsx index 5a65794..2352d66 100644 --- a/src/templates/sharecomponent/searchcomponent/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/index.jsx @@ -188,7 +188,7 @@ return } - if ((res.type === 'select' || res.type === 'multiselect' || res.type === 'link') && res.resourceType === '1' && /\s/.test(res.dataSource)) { + if (['checkcard', 'select', 'multiselect', 'link'].includes() && res.resourceType === '1' && /\s/.test(res.dataSource)) { this.setState({ sqlVerifing: true }) diff --git a/src/templates/sharecomponent/searchcomponent/index.scss b/src/templates/sharecomponent/searchcomponent/index.scss index 4e1549a..2b8857c 100644 --- a/src/templates/sharecomponent/searchcomponent/index.scss +++ b/src/templates/sharecomponent/searchcomponent/index.scss @@ -75,4 +75,7 @@ min-width: 100px!important; width: 100%; } + .check-card-edit-box { + margin-top: 5px!important; + } } \ No newline at end of file diff --git a/src/templates/sharecomponent/searchcomponent/searcheditable/index.jsx b/src/templates/sharecomponent/searchcomponent/searcheditable/index.jsx index 7465a79..101f3ab 100644 --- a/src/templates/sharecomponent/searchcomponent/searcheditable/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/searcheditable/index.jsx @@ -171,8 +171,9 @@ } handleDelete = key => { - const dataSource = [...this.state.dataSource] - this.setState({ dataSource: dataSource.filter(item => item.key !== key) }) + const dataSource = this.state.dataSource.filter(item => item.key !== key) + this.setState({ dataSource }) + this.props.onChange && this.props.onChange(dataSource) } handleAdd = () => { @@ -185,10 +186,12 @@ if (type === 'link') { newData.ParentID = `${count}` } + let data = [...dataSource, newData] this.setState({ - dataSource: [...dataSource, newData], + dataSource: data, count: count + 1 }) + this.props.onChange && this.props.onChange(data) } handleSave = row => { @@ -200,6 +203,7 @@ ...row }) this.setState({ dataSource: newData }) + this.props.onChange && this.props.onChange(newData) } resetColumn = (type) => { diff --git a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx index 9918283..8a4b9f2 100644 --- a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx @@ -6,7 +6,12 @@ import EditTable from '../searcheditable' import Utils from '@/utils/utils.js' import CodeMirror from '@/templates/zshare/codemirror' +import asyncComponent from '@/utils/asyncComponent' import './index.scss' + +const ColorSketch = asyncComponent(() => import('@/mob/colorsketch')) +const FieldsTable = asyncComponent(() => import('@/templates/zshare/modalform/fieldtable')) +const DataTable = asyncComponent(() => import('@/templates/zshare/modalform/datatable')) const groupOptions = [ { @@ -87,6 +92,7 @@ multiselect: ['label', 'field', 'resourceType', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced'], link: ['label', 'field', 'resourceType', 'initval', 'type', 'linkField', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'setAll'], date: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced'], + checkcard: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'resourceType', 'display', 'width', 'multiple', 'borderColor', 'required', 'Hide', 'labelShow', 'advanced'], dateweek: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced'], datemonth: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced'], daterange: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced'], @@ -105,6 +111,8 @@ openType: null, // 鎼滅储鏉′欢鏄剧ず绫诲瀷 resourceType: null, // 涓嬫媺鎼滅储鏃讹紝閫夐」鏉ユ簮绫诲瀷 formlist: null, // 琛ㄥ崟 + display: null, + cFields: [], textTooltip: '瀛楁鍚嶅彲浠ヤ娇鐢ㄩ�楀彿鍒嗛殧锛岃繘琛岀患鍚堟悳绱�', } @@ -116,16 +124,34 @@ UNSAFE_componentWillMount () { const { formlist, dict } = this.props - let type = formlist.filter(cell => cell.key === 'type')[0].initVal - let _items = formlist.filter(cell => cell.key === 'items')[0].initVal - let resourceType = formlist.filter(cell => cell.key === 'resourceType')[0].initVal + let type = '' + let _items = [] + let resourceType = '' + let display = '' + let cFields = [] - let _options = this.getOptions(type, resourceType) + formlist.forEach(cell => { + if (cell.key === 'type') { + type = cell.initVal + } else if (cell.key === 'items') { + _items = cell.initVal + } else if (cell.key === 'display') { + display = cell.initVal + } else if (cell.key === 'resourceType') { + resourceType = cell.initVal + } else if (cell.key === 'fields') { + cFields = cell.initVal + } + }) + + let _options = this.getOptions(type, resourceType, display) this.setState({ + display, + cFields, openType: type, items: _items, - resourceType: resourceType, + resourceType, formlist: formlist.map(form => { // 琛ㄥ崟涓哄垵濮嬪�煎瓧娈碉紝涓旀暟鎹被鍨嬪睘浜庢椂闂寸被鍨嬫椂锛岃缃垵濮嬪�间负涓嬫媺閫夋嫨锛屽苟閲嶇疆閫夋嫨椤� if (form.key === 'initval' && dateOptions.hasOwnProperty(type)) { @@ -139,7 +165,7 @@ form.options = matchReg.text } else if (type === 'multiselect') { form.options = matchReg.multiselect - } else if (type === 'select' || type === 'link') { + } else if (type === 'select' || type === 'link' || type === 'checkcard') { form.options = matchReg.select } else if (type === 'date') { form.options = matchReg.date @@ -172,13 +198,27 @@ } } - getOptions = (type, resourceType) => { + getOptions = (type, resourceType, display) => { let _options = fromJS(searchTypeOptions[type]).toJS() // 閫夐」鍒楄〃 if (['multiselect', 'select', 'link'].includes(type) && resourceType === '0') { // 涓嬫媺閫夋嫨绫诲瀷銆侀�夐」涓鸿嚜瀹氫箟璧勬簮 _options.push('options') } else if (['multiselect', 'select', 'link'].includes(type) && resourceType === '1') { // 涓嬫媺閫夋嫨绫诲瀷銆侀�夐」涓哄悗鍙版暟鎹簮涓幏鍙� _options.push('dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'database') + } else if (type === 'checkcard') { + if (display === 'picture') { + if (resourceType === '0') { // 鑷畾涔夎祫婧� + _options.push('options', 'picratio') + } else if (resourceType === '1') { // 鏁版嵁婧� + _options.push('dataSource', 'cardValField', 'urlField', 'orderBy', 'orderType', 'database', 'picratio') + } + } else { + if (resourceType === '0') { // 鑷畾涔夎祫婧� + _options.push('options', 'fields', 'backgroundColor') + } else if (resourceType === '1') { // 鏁版嵁婧� + _options.push('dataSource', 'cardValField', 'fields', 'orderBy', 'orderType', 'database', 'backgroundColor') + } + } } return _options @@ -189,10 +229,10 @@ */ openTypeChange = (key, value) => { const { dict } = this.props - const { resourceType, items } = this.state + const { resourceType, items, display } = this.state if (key === 'type') { - let _options = this.getOptions(value, resourceType) + let _options = this.getOptions(value, resourceType, display) let matchs = [] this.setState({ @@ -215,7 +255,7 @@ form.options = matchReg.text } else if (value === 'multiselect') { form.options = matchReg.multiselect - } else if (value === 'select' || value === 'link') { + } else if (value === 'select' || value === 'link' || value === 'checkcard') { form.options = matchReg.select } else if (value === 'date') { form.options = matchReg.date @@ -252,11 +292,11 @@ * @description 鏁版嵁婧愮被鍨嬪垏鎹� */ onChange = (e, key) => { - const { openType } = this.state + const { openType, display, resourceType } = this.state let value = e.target.value if (key === 'resourceType') { - let _options = this.getOptions(openType, value) + let _options = this.getOptions(openType, value, display) this.setState({ resourceType: value, @@ -265,7 +305,29 @@ return form }) }) + } else if (key === 'display') { + let _options = this.getOptions(openType, resourceType, value) + + this.setState({ + display: value, + formlist: this.state.formlist.map(form => { + form.hidden = !_options.includes(form.key) + return form + }) + }) } + } + + changeField = (data) => { + this.setState({ + cFields: data, + formlist: this.state.formlist.map(form => { + if (form.key === 'fields') { + form.initVal = data + } + return form + }) + }) } checkChange = (values, key) => { @@ -426,8 +488,8 @@ ) } else if (item.type === 'textarea') { fields.push( - <Col span={20} offset={4} key={index}> - <Form.Item className="text-area"> + <Col span={24} key={index}> + <Form.Item className="text-area" label={item.label}> {getFieldDecorator(item.key, { initialValue: item.initVal, rules: [ @@ -441,9 +503,35 @@ </Col> ) } else if (item.type === 'options') { + if (openType !== 'checkcard') { + fields.push( + <Col span={24} key={index}> + <Form.Item label={item.label} className="text-area"> + {getFieldDecorator(item.key, { + initialValue: item.initVal + })(<EditTable dict={this.props.dict} type={this.state.openType} data={item.initVal}/>)} + </Form.Item> + </Col> + ) + } else { + fields.push( + <Col span={24} key={index}> + <Form.Item label={item.label} className="text-area"> + {getFieldDecorator(item.key, { + initialValue: item.initVal + })(<DataTable dict={this.props.dict} type={this.state.display} fields={this.state.cFields}/>)} + </Form.Item> + </Col> + ) + } + } else if (item.type === 'fields') { fields.push( - <Col span={20} offset={4} key={index}> - <EditTable data={item.initVal} type={this.state.openType} dict={this.props.dict} ref="editTable"/> + <Col span={24} key={index}> + <Form.Item label={item.label} className="text-area"> + {getFieldDecorator(item.key, { + initialValue: item.initVal + })(<FieldsTable dict={this.props.dict} onChange={this.changeField}/>)} + </Form.Item> </Col> ) } else if (item.type === 'checkbox') { @@ -496,6 +584,16 @@ </Form.Item> </Col> ) + } else if (item.type === 'color') { + fields.push( + <Col span={12} key={index}> + <Form.Item label={item.label} className="color-form-item"> + {getFieldDecorator(item.key, { + initialValue: item.initVal + })(<ColorSketch allowClear={true}/>)} + </Form.Item> + </Col> + ) } }) @@ -510,22 +608,24 @@ let isvalid = true values.uuid = this.props.card.uuid // 涓嬫媺鑿滃崟鎴栬仈鍔ㄨ彍鍗� - if ((values.type === 'multiselect' || values.type === 'select' || values.type === 'link') && values.resourceType === '0') { - values.options = this.refs.editTable.state.dataSource + if (['multiselect', 'select', 'link', 'checkcard'].includes(values.type) && values.resourceType === '0') { + values.options = values.options || [] values.dataSource = '' let emptys = [] - if (values.type === 'multiselect' || values.type === 'select') { + if (['multiselect', 'select'].includes(values.type)) { emptys = values.options.filter(op => !(op.Value && op.Text)) - } else { + } else if (values.type === 'link') { emptys = values.options.filter(op => !(op.Value && op.Text && op.ParentID)) } if (emptys.length > 0) { isvalid = false } - } else if ((values.type === 'multiselect' || values.type === 'select' || values.type === 'link') && values.resourceType === '1') { + } else if (['multiselect', 'select', 'link', 'checkcard'].includes(values.type) && values.resourceType === '1') { values.options = [] } + console.log(values) + if (isvalid) { ['linkField', 'valueField', 'valueText', 'orderBy'].forEach(item => { if (values[item]) { diff --git a/src/templates/sharecomponent/searchcomponent/searchform/index.scss b/src/templates/sharecomponent/searchcomponent/searchform/index.scss index cc9c99c..56d3f89 100644 --- a/src/templates/sharecomponent/searchcomponent/searchform/index.scss +++ b/src/templates/sharecomponent/searchcomponent/searchform/index.scss @@ -5,9 +5,12 @@ padding-bottom: 20px; } .ant-form-item.text-area { - margin-bottom: 0px; + // margin-bottom: 0px; .ant-form-item-control-wrapper { - width: 100%; + width: 84%; + } + .ant-form-item-label { + width: 16%; } .CodeMirror { height: 150px; @@ -29,4 +32,12 @@ } } } + .color-form-item { + .ant-form-item-control { + height: 40px; + .color-sketch-block { + margin-top: 7px; + } + } + } } \ No newline at end of file diff --git a/src/templates/subtableconfig/source.jsx b/src/templates/subtableconfig/source.jsx index 963efc1..4ccd3bf 100644 --- a/src/templates/subtableconfig/source.jsx +++ b/src/templates/subtableconfig/source.jsx @@ -206,6 +206,12 @@ }, { type: 'search', + label: '閫夐」鍗�', + subType: 'checkcard', + url: '' + }, + { + type: 'search', label: CommonDict['model.form.dateday'], subType: 'date', url: '' diff --git a/src/templates/zshare/editcomponent/index.jsx b/src/templates/zshare/editcomponent/index.jsx index 80f2599..9ed56dc 100644 --- a/src/templates/zshare/editcomponent/index.jsx +++ b/src/templates/zshare/editcomponent/index.jsx @@ -150,7 +150,7 @@ // form锛� text number select multiselect link switch checkbox radio checkcard // fileupload date datemonth datetime textarea hint color funcvar if (res.copyType === 'form') { - if (['number', 'switch', 'textarea', 'checkcard', 'fileupload', 'hint', 'color', 'funcvar'].includes(res.type)) { + if (['number', 'switch', 'textarea', 'fileupload', 'hint', 'color', 'funcvar'].includes(res.type)) { res.type = 'text' } else if (res.type === 'radio') { res.type = 'select' diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index 1dd0495..c5e049c 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -298,6 +298,59 @@ roleList = [] } + let typeOptions = [] + + if (sessionStorage.getItem('appType') === 'mob') { + typeOptions = [{ + value: 'text', + text: Formdict['model.form.text'] + }, { + value: 'checkcard', + text: '閫夐」鍗�' + }, { + value: 'date', + text: Formdict['model.form.dateday'] + }, { + value: 'datemonth', + text: Formdict['model.form.datemonth'] + }] + if (!['text', 'checkcard', 'date', 'datemonth'].includes(card.type)) { + card.type = 'text' + } + } else { + typeOptions = [{ + value: 'text', + text: Formdict['model.form.text'] + }, { + value: 'select', + text: Formdict['model.form.select'] + }, { + value: 'multiselect', + text: Formdict['model.form.multiselect'] + }, { + value: 'link', + text: Formdict['model.form.link'] + }, { + value: 'checkcard', + text: '閫夐」鍗�' + }, { + value: 'date', + text: Formdict['model.form.dateday'] + }, { + value: 'dateweek', + text: Formdict['model.form.dateweek'] + }, { + value: 'datemonth', + text: Formdict['model.form.datemonth'] + }, { + value: 'daterange', + text: Formdict['model.form.daterange'] + }, { + value: 'group', + text: Formdict['model.form.dategroup'] + }] + } + return [ { type: 'text', @@ -322,34 +375,7 @@ label: Formdict['model.form.type'], initVal: card.type, required: true, - options: [{ - value: 'text', - text: Formdict['model.form.text'] - }, { - value: 'select', - text: Formdict['model.form.select'] - }, { - value: 'multiselect', - text: Formdict['model.form.multiselect'] - }, { - value: 'link', - text: Formdict['model.form.link'] - }, { - value: 'date', - text: Formdict['model.form.dateday'] - }, { - value: 'dateweek', - text: Formdict['model.form.dateweek'] - }, { - value: 'datemonth', - text: Formdict['model.form.datemonth'] - }, { - value: 'daterange', - text: Formdict['model.form.daterange'] - }, { - value: 'group', - text: Formdict['model.form.dategroup'] - }] + options: typeOptions }, { type: 'text', @@ -395,6 +421,75 @@ }] }, { + type: 'radio', + key: 'display', + label: '鏄剧ず', + initVal: card.display || 'text', + required: true, + options: [{ + value: 'text', + text: '鏂囨湰' + }, { + value: 'picture', + text: '鍥剧墖' + }] + }, + { + type: 'number', + key: 'width', + min: 1, + max: 24, + precision: 0, + label: '鍗$墖瀹藉害', + initVal: card.width || 4, + tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��', + required: true + }, + { + type: 'text', + key: 'cardValField', + label: Formdict['header.form.valueField'], + initVal: card.cardValField || 'Value', + required: true, + readonly: false + }, + { + type: 'text', + key: 'urlField', + label: '鍦板潃瀛楁', + initVal: card.urlField || '', + required: true, + readonly: false + }, + { + type: 'radio', + key: 'picratio', + label: '鍥剧墖姣斾緥', + initVal: card.picratio || '1:1', + required: true, + options: [{ + value: '1:1', + text: '1:1' + }, { + value: '3:2', + text: '3:2' + }, { + value: '4:3', + text: '4:3' + }, { + value: '16:9', + text: '16:9' + }] + }, + { + type: 'fields', + key: 'fields', + label: '瀛楁闆�', + initVal: card.fields || [], + required: true, + readonly: false + }, + { type: 'textarea', key: 'dataSource', label: Formdict['header.form.datasource'], @@ -405,7 +500,7 @@ { type: 'options', key: 'options', - label: '', + label: '閫夐」', initVal: card.options || [], required: true, readonly: false @@ -531,6 +626,20 @@ }, { type: 'radio', + key: 'multiple', + label: '鍙閫�', + initVal: card.multiple || 'false', + required: true, + options: [{ + value: 'true', + text: '鏄�' + }, { + value: 'false', + text: '鍚�' + }] + }, + { + type: 'radio', key: 'required', label: Formdict['model.required'], initVal: card.required || 'false', @@ -596,6 +705,20 @@ }] }, { + type: 'color', + key: 'backgroundColor', + label: '鑳屾櫙鑹�', + initVal: card.backgroundColor || '', + required: false + }, + { + type: 'color', + key: 'borderColor', + label: '杈规棰滆壊', + initVal: card.borderColor || '', + required: false + }, + { type: 'multiselect', key: 'blacklist', label: Formdict['header.form.blacklist'], diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index fbe3588..2c30977 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -6,14 +6,14 @@ import { dateOptions } from '@/utils/option.js' import Utils from '@/utils/utils.js' import EditTable from './modaleditable' -import DataTable from './datatable' -import FieldsTable from './fieldtable' import asyncComponent from '@/utils/asyncComponent' import CodeMirror from '@/templates/zshare/codemirror' import './index.scss' const { TextArea } = Input const ColorSketch = asyncComponent(() => import('@/mob/colorsketch')) +const FieldsTable = asyncComponent(() => import('./fieldtable')) +const DataTable = asyncComponent(() => import('./datatable')) const modalTypeOptions = { text: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'regular', 'interception', 'span', 'labelwidth', 'tooltip', 'extra', 'enter', 'cursor', 'scan'], diff --git a/src/utils/utils.js b/src/utils/utils.js index acc7f97..2687da4 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -703,6 +703,9 @@ } else if (item.type === 'checkcard') { arrfield = item.fields.map(f => f.field) arrfield.push(item.cardValField) + if (item.urlField) { + arrfield.push(item.urlField) + } } arrfield = Array.from(new Set(arrfield)) diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx index 655e4f9..7465b84 100644 --- a/src/views/mobdesign/index.jsx +++ b/src/views/mobdesign/index.jsx @@ -888,7 +888,7 @@ SndID: parMenuId, ParentID: parMenuId, MenuID: item.uuid, - MenuNo: item.wrap.MenuNo || '', + MenuNo: item.wrap.MenuNo || Utils.getuuid(), EasyCode: '', Template: item.type, TypeCharOne: sessionStorage.getItem('kei_no'), diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx index 6528b49..584f7b0 100644 --- a/src/views/pcdesign/index.jsx +++ b/src/views/pcdesign/index.jsx @@ -917,7 +917,7 @@ SndID: parMenuId, ParentID: parMenuId, MenuID: item.uuid, - MenuNo: item.wrap.MenuNo || '', + MenuNo: item.wrap.MenuNo || Utils.getuuid(), EasyCode: '', Template: item.type, TypeCharOne: sessionStorage.getItem('kei_no'), -- Gitblit v1.8.0