From bde2916433c7830e2879e6524e32b9f6c8bd0bab Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 02 一月 2022 16:31:32 +0800 Subject: [PATCH] 2022-01-02 --- src/assets/css/viewstyle.scss | 56 ++-- src/menu/components/table/normal-table/options.jsx | 37 ++ src/tabviews/zshare/actionList/popupbutton/index.jsx | 18 + src/tabviews/zshare/normalTable/index.jsx | 20 + src/tabviews/scriptmanage/config.jsx | 4 src/templates/comtableconfig/index.jsx | 5 src/tabviews/custom/components/share/normalTable/index.scss | 24 + src/tabviews/zshare/actionList/excelInbutton/index.jsx | 16 + src/tabviews/zshare/actionList/exceloutbutton/index.jsx | 24 + src/tabviews/zshare/automatic/index.jsx | 9 src/tabviews/custom/components/share/normalTable/index.jsx | 19 + src/tabviews/zshare/actionList/newpagebutton/index.jsx | 18 + src/tabviews/subtable/index.jsx | 14 + src/tabviews/subtabtable/index.jsx | 14 + src/tabviews/commontable/index.jsx | 14 + src/tabviews/zshare/actionList/normalbutton/index.jsx | 17 + src/tabviews/custom/components/card/data-card/index.scss | 56 +-- src/views/mobdesign/index.jsx | 7 src/tabviews/zshare/actionList/changeuserbutton/index.jsx | 16 + src/views/menudesign/index.jsx | 4 src/tabviews/custom/components/card/data-card/index.jsx | 59 ++++ src/mob/components/navbar/normal-navbar/menus/menuform/index.jsx | 18 - src/tabviews/custom/components/card/prop-card/index.scss | 23 - src/tabviews/custom/components/card/cardcellList/index.jsx | 8 src/tabviews/custom/components/card/prop-card/index.jsx | 25 + src/tabviews/zshare/actionList/tabbutton/index.jsx | 18 + src/components/normalform/modalform/index.jsx | 4 src/menu/components/card/data-card/options.jsx | 33 ++ src/views/pcdesign/index.jsx | 4 src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx | 36 ++ src/tabviews/custom/components/table/normal-table/index.jsx | 43 +++ src/mob/components/menubar/normal-menubar/menucomponent/options.jsx | 22 - src/templates/subtableconfig/index.jsx | 4 src/menu/components/card/data-card/index.jsx | 2 src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 2 src/tabviews/zshare/actionList/printbutton/index.jsx | 16 + src/menu/components/table/normal-table/index.jsx | 4 src/tabviews/zshare/actionList/popupbutton/index.scss | 13 + src/menu/components/card/cardcomponent/options.jsx | 5 src/tabviews/zshare/normalTable/index.scss | 24 + 40 files changed, 572 insertions(+), 183 deletions(-) diff --git a/src/assets/css/viewstyle.scss b/src/assets/css/viewstyle.scss index bb53c91..feace16 100644 --- a/src/assets/css/viewstyle.scss +++ b/src/assets/css/viewstyle.scss @@ -186,41 +186,45 @@ } } .custom-data-card-box, .custom-prop-card-box { - .data-zoom.radio, .data-zoom.checkbox { - .card-row-list > .ant-col:not(.active):not(.backFont):not(.font):not(.selected):not(.extend-card):hover > .card-item-box { - border-color: $color4 !important; - box-shadow: 0 0 4px $color4 !important; + .data-zoom.radio.active, .data-zoom.checkbox.active { + .mk-card:not(.active):not(.selected):hover { + > .card-item-box { + border-color: $color4 !important; + box-shadow: 0 0 4px $color4 !important; + } } - } - .card-row-list.radio, .card-row-list.checkbox { - >.ant-col:not(.active):not(.backFont):not(.font):not(.selected):hover { - >.card-item-box { + .mk-card.active { + > .card-item-box { + border-color: $color6!important; + box-shadow: 0 0 4px $color6!important; + } + } + .mk-card.selected { + > .card-item-box { border-color: $color4!important; box-shadow: 0 0 4px $color4!important; } } } - .card-row-list { - >.active >.card-item-box { - border-color: $color6!important; - box-shadow: 0 0 4px $color6!important; - } - >.backFont >.card-item-box { - border-color: $color6!important; - background-color: $color1!important; - .ant-mk-text { - color: $color6; + .data-zoom.radio.backFont, .data-zoom.checkbox.backFont { + .mk-card:hover, .mk-card.active, .mk-card.selected { + > .card-item-box { + border-color: $color6!important; + background-color: $color1!important; + .ant-mk-text, .ant-mk-date { + color: $color6; + } } } - >.font >.card-item-box { - border-color: $color6!important; - .ant-mk-text { - color: $color6; + } + .data-zoom.radio.font, .data-zoom.checkbox.font { + .mk-card:hover, .mk-card.active, .mk-card.selected { + > .card-item-box { + border-color: $color6!important; + .ant-mk-text, .ant-mk-date { + color: $color6; + } } - } - >.selected >.card-item-box { - border-color: $color4!important; - box-shadow: 0 0 4px $color4!important; } } } diff --git a/src/components/normalform/modalform/index.jsx b/src/components/normalform/modalform/index.jsx index 010160f..72df176 100644 --- a/src/components/normalform/modalform/index.jsx +++ b/src/components/normalform/modalform/index.jsx @@ -109,6 +109,8 @@ if (vals.length === new Set(vals).size) { cell.hidden = true } + } else if (item.notNull) { + cell.hidden = !supItem.initval } else if (!item.values.includes(supItem.initval)) { cell.hidden = true } @@ -177,6 +179,8 @@ } else { m.hidden = true } + } else if (cell.notNull) { + m.hidden = !val } else { m.hidden = !cell.values.includes(val) } diff --git a/src/menu/components/card/cardcomponent/options.jsx b/src/menu/components/card/cardcomponent/options.jsx index 5065bf0..ab83bf7 100644 --- a/src/menu/components/card/cardcomponent/options.jsx +++ b/src/menu/components/card/cardcomponent/options.jsx @@ -19,6 +19,11 @@ } else { appmenulist = [] } + if (appType === 'mob' && hasMenus) { // 鏁版嵁鍗″彲鎵撳紑鍗虫椂閫氫俊 + appmenulist.push({ + value: 'IM', label: '鍗虫椂閫氫俊锛堢郴缁熼〉锛�' + }) + } } else { menulist = sessionStorage.getItem('fstMenuList') if (menulist) { diff --git a/src/menu/components/card/data-card/index.jsx b/src/menu/components/card/data-card/index.jsx index 738e3c1..7692420 100644 --- a/src/menu/components/card/data-card/index.jsx +++ b/src/menu/components/card/data-card/index.jsx @@ -479,7 +479,7 @@ getWrapForms = () => { const { card } = this.state - return getWrapForm(card.wrap, card.subtype) + return getWrapForm(card.wrap, card.subtype, card.columns) } updateWrap = (res) => { diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx index 1c71ab8..6288dce 100644 --- a/src/menu/components/card/data-card/options.jsx +++ b/src/menu/components/card/data-card/options.jsx @@ -4,7 +4,7 @@ /** * @description Wrap琛ㄥ崟閰嶇疆淇℃伅 */ -export default function (wrap, subtype, columns, id) { +export default function (wrap, subtype, columns = [], id = '') { let appType = sessionStorage.getItem('appType') let MenuType = '' let menu = fromJS(window.GLOB.customMenu).toJS() @@ -149,20 +149,18 @@ ] }, { - type: subtype === 'propcard' ? 'select' : 'radio', + type: 'select', field: 'selStyle', label: '閫変腑椋庢牸', initval: wrap.selStyle || 'active', tooltip: '瀛樺湪杈规鏃讹紝杈规浼氫娇鐢ㄧ郴缁熻壊銆�', required: false, - options: subtype === 'propcard' ? [ + options: [ {value: 'none', label: '鏃�'}, {value: 'active', label: '澶栭槾褰�'}, {value: 'backFont', label: '鑳屾櫙+鏂囧瓧'}, {value: 'font', label: '鏂囧瓧'}, - ] : [ - {value: 'none', label: '鏃�'}, - {value: 'active', label: '澶栭槾褰�'}, + ...(subtype === 'datacard' && appType === 'mob' ? [{value: 'check', label: '鍕鹃��'}] : []) ] // forbid: subtype !== 'propcard' }, @@ -265,6 +263,29 @@ forbid: subtype !== 'propcard' }, { + type: 'select', + field: 'controlField', + label: '绂佺敤瀛楁', + initval: wrap.controlField || '', + tooltip: '鐢ㄤ簬鎺у埗琛屾暟鎹槸鍚﹀彲閫夋嫨銆�', + required: false, + allowClear: true, + options: columns, + controlFields: [ + {field: 'controlVal', notNull: true}, + ], + forbid: subtype !== 'datacard' + }, + { + type: 'text', + field: 'controlVal', + label: '鎺у埗鍊�', + initval: wrap.controlVal || '', + tooltip: '褰撳瓧娈靛�间笌鎺у埗鍊肩浉绛夋椂锛岃鏁版嵁浼氱鐢紝澶氫釜鍊肩敤閫楀彿鍒嗛殧銆�', + required: false, + forbid: subtype !== 'datacard' + }, + { type: 'multiselect', field: 'blacklist', label: '榛戝悕鍗�', diff --git a/src/menu/components/table/normal-table/index.jsx b/src/menu/components/table/normal-table/index.jsx index c6a7e35..f57cc32 100644 --- a/src/menu/components/table/normal-table/index.jsx +++ b/src/menu/components/table/normal-table/index.jsx @@ -387,9 +387,9 @@ } getWrapForms = () => { - const { wrap, action } = this.state.card + const { wrap, action, columns } = this.state.card - return getWrapForm(wrap, action) + return getWrapForm(wrap, action, columns) } updateWrap = (res) => { diff --git a/src/menu/components/table/normal-table/options.jsx b/src/menu/components/table/normal-table/options.jsx index 5ce6944..b0a34fe 100644 --- a/src/menu/components/table/normal-table/options.jsx +++ b/src/menu/components/table/normal-table/options.jsx @@ -1,7 +1,7 @@ /** * @description Wrap琛ㄥ崟閰嶇疆淇℃伅 */ -export default function (wrap, action = []) { +export default function (wrap, action = [], columns = []) { let roleList = sessionStorage.getItem('sysRoles') let appType = sessionStorage.getItem('appType') @@ -101,7 +101,7 @@ {value: 'true', label: '鏄�'}, {value: 'false', label: '鍚�'}, ], - forbid: appType === 'mob' + forbid: appType === 'mob' || appType === 'pc' }, { type: 'radio', @@ -202,6 +202,39 @@ forbid: appType === 'mob' }, { + type: 'select', + field: 'controlField', + label: '绂佺敤瀛楁', + initval: wrap.controlField || '', + tooltip: '鐢ㄤ簬鎺у埗琛屾暟鎹槸鍚﹀彲閫夋嫨銆�', + required: false, + allowClear: true, + options: columns, + controlFields: [ + {field: 'controlVal', notNull: true}, + ] + }, + { + type: 'text', + field: 'controlVal', + label: '鎺у埗鍊�', + initval: wrap.controlVal || '', + tooltip: '褰撳瓧娈靛�间笌鎺у埗鍊肩浉绛夋椂锛岃鏁版嵁浼氱鐢紝澶氫釜鍊肩敤閫楀彿鍒嗛殧銆�', + required: false + }, + { + type: 'radio', + field: 'empty', + label: '绌哄�奸殣钘�', + initval: wrap.empty || 'show', + tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�', + required: false, + options: [ + {value: 'show', label: '鍚�'}, + {value: 'hidden', label: '鏄�'}, + ], + }, + { type: 'multiselect', field: 'blacklist', label: '榛戝悕鍗�', diff --git a/src/mob/components/menubar/normal-menubar/menucomponent/options.jsx b/src/mob/components/menubar/normal-menubar/menucomponent/options.jsx index 00a1b26..fd5ce24 100644 --- a/src/mob/components/menubar/normal-menubar/menucomponent/options.jsx +++ b/src/mob/components/menubar/normal-menubar/menucomponent/options.jsx @@ -41,7 +41,7 @@ required: true }, { - type: 'select', + type: 'radio', field: 'type', label: '鑿滃崟灞炴��', initval: setting.type || 'menu', @@ -49,11 +49,9 @@ options: [ {value: 'menu', label: '鑿滃崟'}, {value: 'linkmenu', label: '鍏宠仈鑿滃崟'}, - {value: 'sysmenu', label: '绯荤粺椤�'}, {value: 'link', label: '閾炬帴'}, ], controlFields: [ - {field: 'sysmenu', values: ['sysmenu']}, {field: 'copyMenuId', values: ['menu']}, {field: 'linkMenuId', values: ['linkmenu']}, {field: 'linkurl', values: ['link']}, @@ -61,20 +59,10 @@ }, { type: 'select', - field: 'sysmenu', - label: '绯荤粺椤甸潰', - initval: setting.sysmenu || '', - required: true, - options: [ - {value: 'AIService', label: '鏅鸿兘瀹㈡湇'}, - ] - }, - { - type: 'select', field: 'copyMenuId', label: '澶嶅埗鑿滃崟', initval: setting.copyMenuId || '', - tooltip: '澶嶅埗鑿滃崟浠呭湪褰撳墠鑿滃崟鍒濆鍖栨椂鏈夋晥銆�', + tooltip: '澶嶅埗鑿滃崟浠呭湪褰撳墠鑿滃崟鍒涘缓鏃舵湁鏁堛��', required: false, options: menulist }, @@ -84,7 +72,11 @@ label: '鍏宠仈鑿滃崟', initval: setting.linkMenuId || '', required: true, - options: menulist + options: [ + ...menulist, + // {value: 'IM', label: '鍗虫椂閫氫俊锛堢郴缁熼〉锛�'}, + {value: 'AIService', label: '鏅鸿兘瀹㈡湇锛堢郴缁熼〉锛�'} + ] }, { type: 'textarea', diff --git a/src/mob/components/navbar/normal-navbar/menus/menuform/index.jsx b/src/mob/components/navbar/normal-navbar/menus/menuform/index.jsx index 30d3282..441de0a 100644 --- a/src/mob/components/navbar/normal-navbar/menus/menuform/index.jsx +++ b/src/mob/components/navbar/normal-navbar/menus/menuform/index.jsx @@ -150,7 +150,6 @@ <Radio.Group onChange={this.changeProperty} className="over"> <Radio value="menu">鑿滃崟</Radio> <Radio value="linkmenu">鍏宠仈鑿滃崟</Radio> - <Radio value="sysmenu">绯荤粺椤�</Radio> <Radio value="link">閾炬帴</Radio> </Radio.Group> )} @@ -168,21 +167,6 @@ )} </Form.Item> </Col> - {property === 'sysmenu' ? <Col span={12}> - <Form.Item label="绯荤粺椤甸潰"> - {getFieldDecorator('sysmenu', { - initialValue: menu.sysmenu || '', - rules: [{ - required: true, - message: '璇烽�夋嫨绯荤粺椤甸潰!' - }] - })( - <Select> - <Select.Option value="AIService">鏅鸿兘瀹㈡湇</Select.Option> - </Select> - )} - </Form.Item> - </Col> : null} {property === 'link' ? <Col span={24}> <Form.Item label="閾炬帴鍦板潃" className="textarea"> {getFieldDecorator('link', { @@ -210,6 +194,8 @@ })( <Select> {appMenus.map(item => (<Select.Option key={item.MenuID} value={item.MenuID}>{item.MenuName}</Select.Option>))} + {/* <Select.Option key="IM" value="IM">鍗虫椂閫氫俊锛堢郴缁熼〉锛�</Select.Option> */} + <Select.Option key="AIService" value="AIService">鏅鸿兘瀹㈡湇锛堢郴缁熼〉锛�</Select.Option> </Select> )} </Form.Item> diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index 831a435..7a8fb75 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -400,6 +400,14 @@ }) } + if (config.setting.controlField) { + if (config.setting.controlVal) { + config.setting.controlVal = config.setting.controlVal.split(',') + } else { + config.setting.controlVal = [''] + } + } + this.setState({ pageSize: config.setting.pageSize || 10, loadingview: false, @@ -735,6 +743,12 @@ item.$$BID = BID || '' item.$Index = start + index + '' + if (setting.controlField) { + if (setting.controlVal.includes(item[setting.controlField])) { + item.$disabled = true + } + } + return item }), total: result.total, diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index 4220446..3798bd6 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -671,6 +671,7 @@ <NormalButton BID={data.$$BID} BData={data.$$BData || ''} + disabled={data.$disabled} btn={card} show={card.show} style={card.style} @@ -686,6 +687,7 @@ <ExcelInButton BID={data.$$BID} BData={data.$$BData || ''} + disabled={data.$disabled} btn={card} show={card.show} style={card.style} @@ -700,6 +702,7 @@ <ExcelOutButton BID={data.$$BID} BData={data.$$BData || ''} + disabled={data.$disabled} btn={card} show={card.show} style={card.style} @@ -713,6 +716,7 @@ <PopupButton BID={data.$$BID} BData={data.$$BData || ''} + disabled={data.$disabled} btn={card} show={card.show} style={card.style} @@ -726,6 +730,7 @@ <Col key={card.uuid} className="mk-cell-btn" span={card.width}> <TabButton BData={data.$$BData || ''} + disabled={data.$disabled} btn={card} show={card.show} style={card.style} @@ -739,6 +744,7 @@ <Col key={card.uuid} className="mk-cell-btn" span={card.width}> <NewPageButton BData={data.$$BData || ''} + disabled={data.$disabled} btn={card} show={card.show} style={card.style} @@ -754,6 +760,7 @@ <ChangeUserButton BID={data.$$BID} BData={data.$$BData || ''} + disabled={data.$disabled} btn={card} show={card.show} style={card.style} @@ -768,6 +775,7 @@ <PrintButton BID={data.$$BID} BData={data.$$BData || ''} + disabled={data.$disabled} btn={card} show={card.show} style={card.style} diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index ee17718..3a75334 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -54,6 +54,14 @@ let precards = [] let nextcards = [] + if (_config.wrap.controlField) { + if (_config.wrap.controlVal) { + _config.wrap.controlVal = _config.wrap.controlVal.split(',') + } else { + _config.wrap.controlVal = [''] + } + } + _config.subcards.forEach(item => { if (item.setting.click === 'button' && !item.setting.linkbtn) { item.elements.forEach(ele => { @@ -116,6 +124,12 @@ item.$$BID = BID || '' item.$$BData = BData || '' item.$Index = index + 1 + '' + + if (_config.wrap.controlField) { + if (_config.wrap.controlVal.includes(item[_config.wrap.controlField])) { + item.$disabled = true + } + } return item }) @@ -150,6 +164,11 @@ if (_config.wrap.supType === 'multi') { supComs = _config.supNodes.map(item => item.componentId) } + + _config.wrap.selStyle = _config.wrap.selStyle || 'active' + _config.wrap.scale = _config.wrap.scale === 'true' ? 'scale' : '' + + _config.wrap.wrapClass = `${_config.wrap.selStyle} ${_config.wrap.cardType || ''} ${_config.wrap.scale}` this.setState({ supComs, @@ -196,6 +215,13 @@ item.$$BID = BID || '' item.$$BData = BData || '' item.$Index = index + 1 + '' + + if (config.wrap.controlField) { + if (config.wrap.controlVal.includes(item[config.wrap.controlField])) { + item.$disabled = true + } + } + return item }) @@ -289,7 +315,7 @@ checkTopLine = () => { const { config, data } = this.state - if (!data || data.length === 0) { + if (!data || data.length === 0 || data[0].$disabled) { this.setState({ activeKey: '', selectKeys: [], @@ -500,6 +526,13 @@ item.$$BID = BID || '' item.$$BData = BData || '' item.$Index = index + start + '' + + if (config.wrap.controlField) { + if (config.wrap.controlVal.includes(item[config.wrap.controlField])) { + item.$disabled = true + } + } + return item }), total: result.total, @@ -627,6 +660,7 @@ const { config, selectKeys, selectedData, activeKey, data } = this.state if (!config.wrap.cardType) return + if (item.$disabled) return let _selectKeys = [] let _selectedData = [] @@ -709,7 +743,7 @@ selectedData={selectedData} /> : null } - <div className={`data-zoom ${config.wrap.selStyle !== 'none' ? (config.wrap.cardType || '') : ''} ${config.wrap.scale || ''}`}> + <div className={`data-zoom ${config.wrap.wrapClass}`}> {switchable ? <div className={'prev-page ' + (pageIndex === 1 ? 'disabled' : '')} onClick={this.prevPage}><div><div><img src={preImg} alt=""/></div></div></div> : null} <Row className="card-row-list"> {offset ? <Col span={offset} style={{height: '10px'}}> </Col> : null} @@ -718,11 +752,22 @@ <CardItem card={item} cards={config} data={{$$BID: BID, $$BData: BData, $$selectedData: selectedData, $$type: 'extendCard'}}/> </Col> ))} - {data && data.map((item, index) => ( - <Col className={(config.wrap.selStyle !== 'none' ? (activeKey === index ? ' active' : (selectKeys.indexOf(index) > -1 ? ' selected' : '')) : '') + (card.setting.click ? ' pointer' : '')} key={index} span={card.setting.width} onClick={() => {this.changeCard(index, item)}}> - <CardItem card={card} cards={config} data={item}/> - </Col> - ))} + {data && data.map((item, index) => { + let className = card.setting.click ? 'mk-card pointer ' : 'mk-card ' + if (item.$disabled) { + className = 'mk-disabled' + } else if (activeKey === index) { + className += 'active' + } else if (selectKeys.indexOf(index) > -1) { + className += 'selected' + } + + return ( + <Col className={className} key={index} span={card.setting.width} onClick={() => {this.changeCard(index, item)}}> + <CardItem card={card} cards={config} data={item}/> + </Col> + ) + })} {nextcards.map((item, index) => ( <Col key={'next' + index} className="extend-card" span={item.setting.width || 6}> <CardItem card={item} cards={config} data={{$$BID: BID, $$BData: BData, $$selectedData: selectedData, $$type: 'extendCard'}}/> diff --git a/src/tabviews/custom/components/card/data-card/index.scss b/src/tabviews/custom/components/card/data-card/index.scss index 580c5b8..3cfc493 100644 --- a/src/tabviews/custom/components/card/data-card/index.scss +++ b/src/tabviews/custom/components/card/data-card/index.scss @@ -20,26 +20,39 @@ .data-zoom { display: flex; position: relative; - } - .data-zoom.radio, .data-zoom.checkbox { - .card-row-list { - >.ant-col:not(.active):not(.selected):not(.extend-card):hover { - >.card-item-box { - border-color: #69c0ff!important; - box-shadow: 0 0 4px #69c0ff!important; + .mk-disabled { + >.card-item-box { + cursor: not-allowed; + color: #bcbcbc; + .ant-mk-text, .ant-mk-date, .anticon { + color: #bcbcbc!important; } } } } - .data-zoom.true { + .data-zoom.scale { .card-row-list { - >.ant-col:not(.extend-card):hover { + .mk-card:hover { >.card-item-box { z-index: 1; transform: scale(1.05); } } } + } + .card-row-list { + flex: 10; + .mk-card.pointer { + cursor: pointer; + } + } + .card-item-box { + position: relative; + background-color: #ffffff; + transition: all 0.3s; + background-position: center center; + background-repeat: no-repeat; + background-size: cover; } .prev-page { width: 20px; @@ -68,31 +81,6 @@ content: ' '; display: block; clear: both; - } - .card-row-list { - flex: 10; - - .card-item-box { - position: relative; - background-color: #ffffff; - transition: all 0.3s; - } - >.pointer { - cursor: pointer; - } - >.active >.card-item-box { - border-color: #1890ff!important; - box-shadow: 0 0 4px #1890ff; - } - >.selected >.card-item-box { - border-color: #69c0ff!important; - box-shadow: 0 0 4px #69c0ff; - } - } - .card-item-box { - background-position: center center; - background-repeat: no-repeat; - background-size: cover; } .ant-empty { diff --git a/src/tabviews/custom/components/card/prop-card/index.jsx b/src/tabviews/custom/components/card/prop-card/index.jsx index 8be4cc6..a347b8e 100644 --- a/src/tabviews/custom/components/card/prop-card/index.jsx +++ b/src/tabviews/custom/components/card/prop-card/index.jsx @@ -109,9 +109,13 @@ _config.subcards[0].offset = offset } + let selected = _config.wrap.selected || 'false' + _config.wrap.selStyle = _config.wrap.selStyle || 'active' _config.wrap.priKeyType = _config.wrap.priKeyType || 'static' - let selected = _config.wrap.selected || 'false' + _config.wrap.scale = _config.wrap.scale === 'true' ? 'scale' : '' + + _config.wrap.wrapClass = `${_config.wrap.selStyle} ${_config.wrap.cardType || ''} ${_config.wrap.scale || ''}` this.setState({ selected, @@ -405,12 +409,19 @@ </div> : null } <NormalHeader config={config}/> - <Row className={`card-row-list ${config.wrap.cardType || ''} ${config.wrap.scale || ''}`}> - {config.subcards.map((item, index) => ( - <Col className={(activeKey === index ? config.wrap.selStyle : '') + (item.setting.click ? ' pointer' : '')} key={index} span={item.setting.width || 6} offset={item.offset || 0} onClick={() => {this.changeCard(index, item)}}> - <CardItem card={item} cards={config} data={data}/> - </Col> - ))} + <Row className={`card-row-list data-zoom ${config.wrap.wrapClass}`}> + {config.subcards.map((item, index) => { + let className = item.setting.click ? 'mk-card pointer ' : 'mk-card ' + if (activeKey === index) { + className += 'active' + } + + return ( + <Col className={className} key={index} span={item.setting.width || 6} offset={item.offset || 0} onClick={() => {this.changeCard(index, item)}}> + <CardItem card={item} cards={config} data={data}/> + </Col> + ) + })} </Row> </div> ) diff --git a/src/tabviews/custom/components/card/prop-card/index.scss b/src/tabviews/custom/components/card/prop-card/index.scss index 12c5e88..7d7e25b 100644 --- a/src/tabviews/custom/components/card/prop-card/index.scss +++ b/src/tabviews/custom/components/card/prop-card/index.scss @@ -13,28 +13,12 @@ } .card-row-list { - .card-item-box { - background-color: #ffffff; - transition: all 0.3s; - } - >.pointer { + .mk-card.pointer { cursor: pointer; } - >.active >.card-item-box { - border-color: #1890ff!important; - box-shadow: 0 0 4px #1890ff; - } } - .card-row-list.radio, .card-row-list.checkbox { - >.ant-col:not(.active):not(.selected):hover { - >.card-item-box { - border-color: #69c0ff!important; - box-shadow: 0 0 4px #69c0ff!important; - } - } - } - .card-row-list.true { - >.ant-col:hover { + .card-row-list.scale { + .mk-card:hover { >.card-item-box { z-index: 1; transform: scale(1.05); @@ -44,6 +28,7 @@ .card-item-box { position: relative; + background-color: #ffffff; background-position: center center; background-repeat: no-repeat; background-size: cover; diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx index 15d0d33..6ff2056 100644 --- a/src/tabviews/custom/components/share/normalTable/index.jsx +++ b/src/tabviews/custom/components/share/normalTable/index.jsx @@ -30,6 +30,10 @@ let { lineMarks, onDoubleClick, data, className, ...resProps } = this.props let style = {} + if (data && data.$disabled) { + className = className + ' mk-disabled ' + } + if (lineMarks && lineMarks.length > 0) { lineMarks.some(mark => { let originVal = data[mark.field[0]] + '' @@ -80,7 +84,7 @@ if (mark.fontColor) { style.color = mark.fontColor } - className += className + ' background' + className = className + ' background' } else if (mark.signType[0] === 'underline') { style.textDecoration = 'underline' style.color = mark.color @@ -145,7 +149,7 @@ resProps.rowSpan = record['$$' + col.field] } - if (col.linkThdMenu || col.linkurl) { + if (!record.$disabled && (col.linkThdMenu || col.linkurl)) { content = ( <div> <div className="link-menu" onDoubleClick={(e) => triggerLink(e, col, record)}></div> @@ -204,7 +208,7 @@ resProps.rowSpan = record['$$' + col.field] } - if (col.linkThdMenu || col.linkurl) { + if (!record.$disabled && (col.linkThdMenu || col.linkurl)) { content = ( <div> <div className="link-menu" onDoubleClick={(e) => triggerLink(e, col, record)}></div> @@ -526,6 +530,7 @@ const { MenuID, data, setting } = this.props if (MenuID !== menuId || !data || data.length === 0) return + if (data[0].$disabled) return this.changedata(0) this.setState({ selectedRowKeys: [0], activeIndex: 0 }) @@ -649,7 +654,7 @@ this.setState({ selectedRowKeys, activeIndex: _activeIndex }) - let selects = this.props.data.filter((item, _index) => selectedRowKeys.includes(_index)) + let selects = this.props.data.filter((item, _index) => selectedRowKeys.includes(_index) && !item.$disabled) this.props.chgSelectData(selects) if (setting.$hasSyncModule) { @@ -664,6 +669,7 @@ const { setting, MenuID, data } = this.props if (!setting.tableType || this.state.pickup) return + if (record.$disabled) return let newkeys = fromJS(this.state.selectedRowKeys).toJS() @@ -688,7 +694,7 @@ this.setState({ selectedRowKeys: newkeys, activeIndex: _index !== '' ? _index : null }) } - let selects = this.props.data.filter((item, _index) => newkeys.includes(_index)) + let selects = this.props.data.filter((item, _index) => newkeys.includes(_index) && !item.$disabled) this.props.chgSelectData(selects) @@ -723,6 +729,8 @@ _id = data[index][setting.primaryKey] || '' _data = data[index] || '' } + + if (_data && _data.$disabled) return MKEmitter.emit('resetSelectLine', MenuID, _id, _data) } @@ -812,6 +820,7 @@ const { setting } = this.props if (!setting.doubleClick) return + if (record.$disabled) return MKEmitter.emit('triggerBtnId', setting.doubleClick, [record]) } diff --git a/src/tabviews/custom/components/share/normalTable/index.scss b/src/tabviews/custom/components/share/normalTable/index.scss index 1ded89d..b6e48cb 100644 --- a/src/tabviews/custom/components/share/normalTable/index.scss +++ b/src/tabviews/custom/components/share/normalTable/index.scss @@ -19,6 +19,30 @@ font-size: inherit; } + .mk-disabled { + color: #bcbcbc; + cursor: not-allowed; + .ant-btn { + cursor: not-allowed; + } + .ant-table-selection-column { + > span::after { + content: ' '; + display: block; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + z-index: 1; + } + } + .ant-checkbox-checked .ant-checkbox-inner { + background-color: #fff!important; + border-color: #d9d9d9!important; + } + } + table { max-width: 100%; width: 100%; 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 eda2395..21c8d6d 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -472,7 +472,7 @@ _copy.sorter = false if (item.editable === 'true') { - _copy.title = <span>{item.label}<EditOutlined className="system-color" style={{position: 'absolute', bottom: 0, right: 0}}/></span> + _copy.title = <span>{item.label}<EditOutlined className="system-color" style={{position: 'absolute', bottom: '2px', right: '5px'}}/></span> } edColumns.push(_copy) } diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx index 63af99d..9e5dac6 100644 --- a/src/tabviews/custom/components/table/normal-table/index.jsx +++ b/src/tabviews/custom/components/table/normal-table/index.jsx @@ -58,6 +58,15 @@ let _cols = new Map() let _data = null let _sync = _config.setting.sync === 'true' + + if (_config.wrap.controlField) { + if (_config.wrap.controlVal) { + _config.wrap.controlVal = _config.wrap.controlVal.split(',') + } else { + _config.wrap.controlVal = [''] + } + } + let setting = {..._config.setting, ..._config.wrap, style: {}} if (setting.selected !== 'always' && setting.selected !== 'init') { @@ -79,6 +88,13 @@ item.$$BID = BID || '' item.$$BData = BData || '' item.$Index = index + 1 + '' + + if (setting.controlField) { + if (setting.controlVal.includes(item[setting.controlField])) { + item.$disabled = true + } + } + return item }) @@ -119,6 +135,8 @@ if (_config.wrap.collapse === 'true') { _config.wrap.title = _config.wrap.title || ' ' } + + _config.style = _config.style || {} this.setState({ pageSize: setting.pageSize || 10, @@ -219,6 +237,13 @@ item.$$BID = BID || '' item.$$BData = BData || '' item.$Index = start + index + '' + + if (setting.controlField) { + if (setting.controlVal.includes(item[setting.controlField])) { + item.$disabled = true + } + } + return item }), selectedData: [], @@ -537,6 +562,13 @@ item.$$BID = BID || '' item.$$BData = BData || '' item.$Index = index + 1 + '' + + if (setting.controlField) { + if (setting.controlVal.includes(item[setting.controlField])) { + item.$disabled = true + } + } + return item }) @@ -583,10 +615,15 @@ } render() { - const { BID, setting, searchlist, actions, config, columns, selectedData, BData } = this.state + const { BID, setting, searchlist, actions, config, columns, selectedData, BData, data } = this.state + + let style = {...config.style} + if (config.wrap.empty === 'hidden' && (!data || data.length === 0)) { + style.display = 'none' + } return ( - <div className="custom-normal-table" style={config.style}> + <div className="custom-normal-table" style={style}> {config.wrap.collapse === 'true' ? <Collapse bordered={false} defaultActiveKey="1" expandIconPosition="right"> <Panel forceRender={true} header={<NormalHeader config={config}/>} key="1"> {searchlist && searchlist.length ? @@ -605,7 +642,7 @@ setting={setting} columns={columns} MenuID={config.uuid} - data={this.state.data} + data={data} fields={config.columns} total={this.state.total} lineMarks={config.lineMarks} diff --git a/src/tabviews/scriptmanage/config.jsx b/src/tabviews/scriptmanage/config.jsx index 493937d..ec8e807 100644 --- a/src/tabviews/scriptmanage/config.jsx +++ b/src/tabviews/scriptmanage/config.jsx @@ -47,7 +47,7 @@ type: "Modal", setting: { "title":"娣诲姞", - "width":60, + "width": 80, "focus":"func", "cols":"2", "finish":"close", @@ -69,7 +69,7 @@ type: "Modal", setting: { "title":"淇敼", - "width":60, + "width": 80, "focus":"func", "cols":"2", "finish":"close", diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index b369753..31c67cd 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -321,6 +321,14 @@ config.setting.selected = 'false' } + if (config.setting.controlField) { + if (config.setting.controlVal) { + config.setting.controlVal = config.setting.controlVal.split(',') + } else { + config.setting.controlVal = [''] + } + } + this.setState({ pageSize: config.setting.pageSize || 10, BID: this.props.BID || '', @@ -633,6 +641,12 @@ item.$$BID = BID || '' item.$Index = start + index + '' + if (setting.controlField) { + if (setting.controlVal.includes(item[setting.controlField])) { + item.$disabled = true + } + } + return item }), total: result.total, diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx index c3d2df2..63ebd78 100644 --- a/src/tabviews/subtabtable/index.jsx +++ b/src/tabviews/subtabtable/index.jsx @@ -282,6 +282,14 @@ config.setting.selected = 'false' } + if (config.setting.controlField) { + if (config.setting.controlVal) { + config.setting.controlVal = config.setting.controlVal.split(',') + } else { + config.setting.controlVal = [''] + } + } + this.setState({ pageSize: config.setting.pageSize || 10, loadingview: false, @@ -573,6 +581,12 @@ item.$$BID = BID || '' item.$Index = start + index + '' + if (setting.controlField) { + if (setting.controlVal.includes(item[setting.controlField])) { + item.$disabled = true + } + } + return item }), total: result.total, diff --git a/src/tabviews/zshare/actionList/changeuserbutton/index.jsx b/src/tabviews/zshare/actionList/changeuserbutton/index.jsx index 21c1835..4997a05 100644 --- a/src/tabviews/zshare/actionList/changeuserbutton/index.jsx +++ b/src/tabviews/zshare/actionList/changeuserbutton/index.jsx @@ -21,6 +21,7 @@ btn: PropTypes.object, // 鎸夐挳 selectedData: PropTypes.any, // 瀛愯〃涓�夋嫨鏁版嵁 setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 + disabled: PropTypes.any, // 琛屾寜閽鐢� } state = { @@ -41,7 +42,7 @@ disabled = true } }) - this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) + this.setState({hidden: disabled && btn.control === 'hidden'}) } else if (btn.control === 'parent') { if (!BData || !BData.hasOwnProperty(btn.controlField)) { this.setState({hidden: true}) @@ -53,6 +54,10 @@ this.setState({hidden: false}) } } + } + + if (this.props.disabled || disabled) { + this.setState({disabled: true}) } } @@ -67,9 +72,8 @@ UNSAFE_componentWillReceiveProps (nextProps) { const { btn, selectedData, BData } = this.props + let disabled = false if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) { - let disabled = false - if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 琛ㄦ牸涓寜閽殣钘忔帶鍒� nextProps.selectedData.forEach(item => { let s = item[btn.controlField] + '' @@ -91,6 +95,12 @@ } } } + + if (nextProps.disabled || disabled) { + this.setState({disabled: true}) + } else { + this.setState({disabled: false}) + } } componentWillUnmount () { diff --git a/src/tabviews/zshare/actionList/excelInbutton/index.jsx b/src/tabviews/zshare/actionList/excelInbutton/index.jsx index c146924..56d2659 100644 --- a/src/tabviews/zshare/actionList/excelInbutton/index.jsx +++ b/src/tabviews/zshare/actionList/excelInbutton/index.jsx @@ -24,6 +24,7 @@ Tab: PropTypes.any, // 濡傛灉褰撳墠鍏冪礌涓烘爣绛炬椂锛宼ab涓烘爣绛句俊鎭� btn: PropTypes.object, // 鎸夐挳 setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 + disabled: PropTypes.any, // 琛屾寜閽鐢� } state = { @@ -46,7 +47,7 @@ disabled = true } }) - this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) + this.setState({hidden: disabled && btn.control === 'hidden'}) } else if (btn.control === 'parent') { if (!BData || !BData.hasOwnProperty(btn.controlField)) { this.setState({hidden: true}) @@ -58,6 +59,10 @@ this.setState({hidden: false}) } } + } + + if (this.props.disabled || disabled) { + this.setState({disabled: true}) } } @@ -72,9 +77,8 @@ UNSAFE_componentWillReceiveProps (nextProps) { const { btn, selectedData, BData } = this.props + let disabled = false if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) { - let disabled = false - if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 琛ㄦ牸涓寜閽殣钘忔帶鍒� nextProps.selectedData.forEach(item => { let s = item[btn.controlField] + '' @@ -96,6 +100,12 @@ } } } + + if (nextProps.disabled || disabled) { + this.setState({disabled: true}) + } else { + this.setState({disabled: false}) + } } componentWillUnmount () { diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx index b8be25b..66b4f90 100644 --- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx +++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx @@ -24,6 +24,7 @@ btn: PropTypes.object, // 鎸夐挳 setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 updateStatus: PropTypes.func, // 鎸夐挳鐘舵�佹洿鏂� + disabled: PropTypes.any, // 琛屾寜閽鐢� } state = { @@ -31,11 +32,12 @@ excelName: '', // 鏂囦欢鍚� search: '', // 鎼滅储鏉′欢 loading: false, // 瀵煎嚭涓� - hidden: false + hidden: false, + disabled: false } UNSAFE_componentWillMount () { - const { btn, BData } = this.props + const { btn, BData, disabled } = this.props if (btn.control === 'parent') { if (!BData || !BData.hasOwnProperty(btn.controlField)) { @@ -48,6 +50,10 @@ this.setState({hidden: false}) } } + } + + if (disabled) { + this.setState({disabled: true}) } } @@ -74,6 +80,12 @@ this.setState({hidden: false}) } } + } + + if (nextProps.disabled) { + this.setState({disabled: true}) + } else { + this.setState({disabled: false}) } } @@ -106,9 +118,9 @@ */ actionTrigger = (triggerId) => { const { setting, Tab, BID, btn } = this.props - const { loading } = this.state + const { loading, disabled } = this.state - if ((triggerId && btn.uuid !== triggerId) || loading) return + if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return if (((Tab && Tab.supMenu) || setting.supModule) && !BID) { notification.warning({ @@ -910,7 +922,7 @@ render() { const { btn, show } = this.props - const { loading, hidden } = this.state + const { loading, hidden, disabled } = this.state if (hidden) return null @@ -919,6 +931,7 @@ <Button className={'mk-btn mk-' + btn.class} icon={btn.icon} + disabled={disabled} onClick={(e) => {e.stopPropagation(); this.actionTrigger()}} loading={loading} >{btn.label}</Button> @@ -945,6 +958,7 @@ type="link" title={show === 'icon' ? btn.label : ''} loading={loading} + disabled={disabled} style={btn.style} icon={icon} onClick={(e) => {e.stopPropagation(); this.actionTrigger()}} diff --git a/src/tabviews/zshare/actionList/newpagebutton/index.jsx b/src/tabviews/zshare/actionList/newpagebutton/index.jsx index 3038569..dc49137 100644 --- a/src/tabviews/zshare/actionList/newpagebutton/index.jsx +++ b/src/tabviews/zshare/actionList/newpagebutton/index.jsx @@ -18,6 +18,7 @@ btn: PropTypes.object, // 鎸夐挳 selectedData: PropTypes.any, // 瀛愯〃涓�夋嫨鏁版嵁 setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 + disabled: PropTypes.any, // 琛屾寜閽鐢� } state = { @@ -38,7 +39,7 @@ disabled = true } }) - this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) + this.setState({hidden: disabled && btn.control === 'hidden'}) } else if (btn.control === 'parent') { if (!BData || !BData.hasOwnProperty(btn.controlField)) { this.setState({hidden: true}) @@ -50,6 +51,10 @@ this.setState({hidden: false}) } } + } + + if (this.props.disabled || disabled) { + this.setState({disabled: true}) } } @@ -64,9 +69,8 @@ UNSAFE_componentWillReceiveProps (nextProps) { const { btn, selectedData, BData } = this.props + let disabled = false if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) { - let disabled = false - if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 琛ㄦ牸涓寜閽殣钘忔帶鍒� nextProps.selectedData.forEach(item => { let s = item[btn.controlField] + '' @@ -75,7 +79,7 @@ } }) } - this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) + this.setState({hidden: disabled && btn.control === 'hidden'}) } else if (btn.control === 'parent' && !is(fromJS(nextProps.BData || {}), fromJS(BData || {}))) { if (!nextProps.BData || !nextProps.BData.hasOwnProperty(btn.controlField)) { this.setState({hidden: true}) @@ -88,6 +92,12 @@ } } } + + if (nextProps.disabled || disabled) { + this.setState({disabled: true}) + } else { + this.setState({disabled: false}) + } } componentWillUnmount () { diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index c29c578..c28aaa3 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -32,6 +32,7 @@ columns: PropTypes.any, // 瀛楁鍒� setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 ContainerId: PropTypes.any, // tab椤甸潰ID锛岀敤浜庡脊绐楁帶鍒� + disabled: PropTypes.any, // 琛屾寜閽鐢� } state = { @@ -62,7 +63,7 @@ disabled = true } }) - this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) + this.setState({hidden: disabled && btn.control === 'hidden'}) } else if (btn.control === 'parent') { if (!BData || !BData.hasOwnProperty(btn.controlField)) { this.setState({hidden: true}) @@ -74,6 +75,9 @@ this.setState({hidden: false}) } } + } + if (this.props.disabled || disabled) { + this.setState({disabled: true}) } } @@ -98,9 +102,8 @@ UNSAFE_componentWillReceiveProps (nextProps) { const { btn, selectedData, BData } = this.props + let disabled = false if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) { - let disabled = false - if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 琛ㄦ牸涓寜閽殣钘忔帶鍒� nextProps.selectedData.forEach(item => { let s = item[btn.controlField] + '' @@ -109,7 +112,7 @@ } }) } - this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) + this.setState({hidden: disabled && btn.control === 'hidden'}) } else if (btn.control === 'parent' && !is(fromJS(nextProps.BData || {}), fromJS(BData || {}))) { if (!nextProps.BData || !nextProps.BData.hasOwnProperty(btn.controlField)) { this.setState({hidden: true}) @@ -122,6 +125,12 @@ } } } + + if (nextProps.disabled || disabled) { + this.setState({disabled: true}) + } else { + this.setState({disabled: false}) + } } componentWillUnmount () { diff --git a/src/tabviews/zshare/actionList/popupbutton/index.jsx b/src/tabviews/zshare/actionList/popupbutton/index.jsx index bf0e1e3..19e2982 100644 --- a/src/tabviews/zshare/actionList/popupbutton/index.jsx +++ b/src/tabviews/zshare/actionList/popupbutton/index.jsx @@ -23,6 +23,7 @@ MenuID: PropTypes.string, // 鑿滃崟ID btn: PropTypes.object, // 鎸夐挳 setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 + disabled: PropTypes.any, // 琛屾寜閽鐢� } state = { @@ -59,6 +60,10 @@ } } } + + if (this.props.disabled || disabled) { + this.setState({disabled: true}) + } } shouldComponentUpdate (nextProps, nextState) { @@ -75,9 +80,8 @@ UNSAFE_componentWillReceiveProps (nextProps) { const { btn, selectedData, BData } = this.props + let disabled = false if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) { - let disabled = false - if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 琛ㄦ牸涓寜閽殣钘忔帶鍒� nextProps.selectedData.forEach(item => { let s = item[btn.controlField] + '' @@ -86,7 +90,7 @@ } }) } - this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) + this.setState({hidden: disabled && btn.control === 'hidden'}) } else if (btn.control === 'parent' && !is(fromJS(nextProps.BData || {}), fromJS(BData || {}))) { if (!nextProps.BData || !nextProps.BData.hasOwnProperty(btn.controlField)) { this.setState({hidden: true}) @@ -98,6 +102,12 @@ this.setState({hidden: false}) } } + } + + if (nextProps.disabled || disabled) { + this.setState({disabled: true}) + } else { + this.setState({disabled: false}) } } @@ -279,7 +289,7 @@ return ( <Drawer title={btn.label} - className={btn.$view === 'CustomPage' ? 'custom-drawer-popview' : ''} + className={btn.$view === 'CustomPage' ? 'custom-drawer-popview' : 'table-drawer-popview'} width={width} height={height} maskClosable={btn.clickouter === 'close'} diff --git a/src/tabviews/zshare/actionList/popupbutton/index.scss b/src/tabviews/zshare/actionList/popupbutton/index.scss index e115405..23b691d 100644 --- a/src/tabviews/zshare/actionList/popupbutton/index.scss +++ b/src/tabviews/zshare/actionList/popupbutton/index.scss @@ -6,6 +6,19 @@ } } } +.table-drawer-popview { + .close-drawer { + position: absolute; + z-index: 3; + right: 0; + bottom: 0; + width: 100%; + padding: 8px 16px; + background: #fff; + text-align: right; + box-shadow: 0 0 3px #cbcbcb; + } +} .custom-drawer-popview { .ant-drawer-content { .ant-drawer-header { diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx index bdd11c0..0e0ceb7 100644 --- a/src/tabviews/zshare/actionList/printbutton/index.jsx +++ b/src/tabviews/zshare/actionList/printbutton/index.jsx @@ -31,6 +31,7 @@ btn: PropTypes.object, // 鎸夐挳 setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 ContainerId: PropTypes.any, // tab椤甸潰ID锛岀敤浜庡脊绐楁帶鍒� + disabled: PropTypes.any, // 琛屾寜閽鐢� } state = { @@ -57,7 +58,7 @@ disabled = true } }) - this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) + this.setState({hidden: disabled && btn.control === 'hidden'}) } else if (btn.control === 'parent') { if (!BData || !BData.hasOwnProperty(btn.controlField)) { this.setState({hidden: true}) @@ -69,6 +70,10 @@ this.setState({hidden: false}) } } + } + + if (this.props.disabled || disabled) { + this.setState({disabled: true}) } } @@ -89,9 +94,8 @@ UNSAFE_componentWillReceiveProps (nextProps) { const { btn, selectedData, BData } = this.props + let disabled = false if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) { - let disabled = false - if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 琛ㄦ牸涓寜閽殣钘忔帶鍒� nextProps.selectedData.forEach(item => { let s = item[btn.controlField] + '' @@ -113,6 +117,12 @@ } } } + + if (nextProps.disabled || disabled) { + this.setState({disabled: true}) + } else { + this.setState({disabled: false}) + } } componentWillUnmount () { diff --git a/src/tabviews/zshare/actionList/tabbutton/index.jsx b/src/tabviews/zshare/actionList/tabbutton/index.jsx index ae74881..94d5724 100644 --- a/src/tabviews/zshare/actionList/tabbutton/index.jsx +++ b/src/tabviews/zshare/actionList/tabbutton/index.jsx @@ -18,6 +18,7 @@ btn: PropTypes.object, // 鎸夐挳 selectedData: PropTypes.any, // 瀛愯〃涓�夋嫨鏁版嵁 setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 + disabled: PropTypes.any, // 琛屾寜閽鐢� } state = { @@ -38,7 +39,7 @@ disabled = true } }) - this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) + this.setState({hidden: disabled && btn.control === 'hidden'}) } else if (btn.control === 'parent') { if (!BData || !BData.hasOwnProperty(btn.controlField)) { this.setState({hidden: true}) @@ -50,6 +51,10 @@ this.setState({hidden: false}) } } + } + + if (this.props.disabled || disabled) { + this.setState({disabled: true}) } } @@ -64,9 +69,8 @@ UNSAFE_componentWillReceiveProps (nextProps) { const { btn, selectedData, BData } = this.props + let disabled = false if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) { - let disabled = false - if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 琛ㄦ牸涓寜閽殣钘忔帶鍒� nextProps.selectedData.forEach(item => { let s = item[btn.controlField] + '' @@ -75,7 +79,7 @@ } }) } - this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) + this.setState({hidden: disabled && btn.control === 'hidden'}) } else if (btn.control === 'parent' && !is(fromJS(nextProps.BData || {}), fromJS(BData || {}))) { if (!nextProps.BData || !nextProps.BData.hasOwnProperty(btn.controlField)) { this.setState({hidden: true}) @@ -88,6 +92,12 @@ } } } + + if (nextProps.disabled || disabled) { + this.setState({disabled: true}) + } else { + this.setState({disabled: false}) + } } componentWillUnmount () { diff --git a/src/tabviews/zshare/automatic/index.jsx b/src/tabviews/zshare/automatic/index.jsx index 1ebc33a..6644e5e 100644 --- a/src/tabviews/zshare/automatic/index.jsx +++ b/src/tabviews/zshare/automatic/index.jsx @@ -110,6 +110,15 @@ if (!this.state.running || MenuID !== config.MenuID) return + if (data.$disabled) { + this.setState({line: this.state.line + 1}, () => { + setTimeout(() => { + MKEmitter.emit('autoQueryData', config.MenuID, this.state.line) + }, 100) + }) + return + } + setTimeout(() => { MKEmitter.emit('triggerBtnId', autoMatic.action, [data], 'autoMatic') if (['prompt', 'pop'].includes(autoMatic.OpenType)) { diff --git a/src/tabviews/zshare/normalTable/index.jsx b/src/tabviews/zshare/normalTable/index.jsx index 41e586a..88e69c8 100644 --- a/src/tabviews/zshare/normalTable/index.jsx +++ b/src/tabviews/zshare/normalTable/index.jsx @@ -269,7 +269,7 @@ if (id !== this.props.MenuID) return if (this.props.data.length > 0) { - this.changeRow(null, 0) + this.changeRow(this.props.data[0], 0) } } @@ -281,7 +281,7 @@ let i = index - (pageIndex - 1) * pageSize - 1 if (this.props.data[i]) { - this.changeRow(null, i) + this.changeRow(this.props.data[i], i) MKEmitter.emit('autoTransSelectData', this.props.MenuID, this.props.data[i]) } else { MKEmitter.emit('autoMaticOver', this.props.MenuID) @@ -481,7 +481,7 @@ content = md5(content) } - if (item.linkThdMenu || item.linkurl) { + if (!record.$disabled && (item.linkThdMenu || item.linkurl)) { if (item.rowspan === 'true') { return { children: ( @@ -580,7 +580,7 @@ content = md5(content) } - if (item.linkThdMenu || item.linkurl) { + if (!record.$disabled && (item.linkThdMenu || item.linkurl)) { if (item.rowspan === 'true') { return { children: ( @@ -725,6 +725,7 @@ key={btn.uuid} btn={btn} BID={record.$$BID} + disabled={record.$disabled} selectedData={[record]} BData={this.props.BData} setting={this.props.setting} @@ -738,6 +739,7 @@ key={btn.uuid} btn={btn} BID={record.$$BID} + disabled={record.$disabled} selectedData={[record]} BData={this.props.BData} setting={this.props.setting} @@ -748,6 +750,7 @@ <TabButton key={btn.uuid} btn={btn} + disabled={record.$disabled} selectedData={[record]} BData={this.props.BData} MenuID={this.props.MenuID} @@ -759,6 +762,7 @@ <NewPageButton key={btn.uuid} btn={btn} + disabled={record.$disabled} selectedData={[record]} BData={this.props.BData} setting={this.props.setting} @@ -1029,7 +1033,7 @@ this.setState({ selectedRowKeys, activeIndex: _activeIndex }) - let selects = this.props.data.filter((item, _index) => selectedRowKeys.includes(_index)) + let selects = this.props.data.filter((item, _index) => selectedRowKeys.includes(_index) && !item.$disabled) this.props.chgSelectData(selects) } @@ -1039,6 +1043,7 @@ */ changeRow = (record, index) => { if (!this.props.setting.tableType || this.props.pickup) return + if (record.$disabled) return let newkeys = fromJS(this.state.selectedRowKeys).toJS() @@ -1171,6 +1176,7 @@ const { setting } = this.props if (!setting.doubleClick) return + if (record.$disabled) return MKEmitter.emit('triggerBtnId', setting.doubleClick, [record]) } @@ -1281,7 +1287,9 @@ dataSource={_data} rowClassName={(record) => { let className = '' - if ((setting.tableType === 'checkbox' || setting.tableType === 'radio') && record.key === activeIndex) { + if (record.$disabled) { + className = 'mk-disabled ' + } else if ((setting.tableType === 'checkbox' || setting.tableType === 'radio') && record.key === activeIndex) { className = 'mk-row-active ' } diff --git a/src/tabviews/zshare/normalTable/index.scss b/src/tabviews/zshare/normalTable/index.scss index abfca41..ebc746e 100644 --- a/src/tabviews/zshare/normalTable/index.scss +++ b/src/tabviews/zshare/normalTable/index.scss @@ -23,6 +23,30 @@ } } + .mk-disabled { + color: #bcbcbc; + cursor: not-allowed; + .ant-btn { + cursor: not-allowed; + } + .ant-table-selection-column { + > span::after { + content: ' '; + display: block; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + z-index: 1; + } + } + .ant-checkbox-checked .ant-checkbox-inner { + background-color: #fff!important; + border-color: #d9d9d9!important; + } + } + table { max-width: 100%; width: 100%; diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index 61cdcf5..c7666fd 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/index.jsx @@ -292,6 +292,11 @@ }) } + // 鎸夐挳涓嶅瓨鍦ㄦ椂锛屽幓鎺夌粦瀹氱殑鍙屽嚮鎸夐挳 + if (_config.setting.doubleClick && _config.action.findIndex((item) => item.uuid === _config.setting.doubleClick) === -1) { + _config.setting.doubleClick = '' + } + // 鏈缃暟鎹簮鎴栨爣绛句笉鍚堟硶鏃讹紝鍚敤鐘舵�佷负false let vresult = this.verifyconfig(_config) if (vresult !== true) { diff --git a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx index 1ad7820..e853a54 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx @@ -29,6 +29,7 @@ interType: 'system', procMode: 'script', requestMode: 'system', + controlField: '', tableType: '', funcTooltip: '', funcRules: [] @@ -66,6 +67,7 @@ interType: setting.interType || 'system', procMode: setting.procMode || 'script', requestMode: setting.requestMode || 'system', + controlField: setting.controlField || '', tableType: setting.tableType, funcTooltip: tooltip, funcRules: rules @@ -195,7 +197,7 @@ render() { const { setting, dict, menu, config, columns } = this.props const { getFieldDecorator } = this.props.form - const { interType, funcRules, funcTooltip, procMode, requestMode, tableType } = this.state + const { interType, funcRules, funcTooltip, procMode, requestMode, tableType, controlField } = this.state const formItemLayout = { labelCol: { @@ -786,6 +788,38 @@ })(<InputNumber min={12} max={50} precision={0}/>)} </Form.Item> </Col> + <Col span={12}> + <Form.Item label={ + <Tooltip placement="topLeft" title="鐢ㄤ簬鎺у埗琛屾暟鎹槸鍚﹀彲閫夋嫨銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 绂佺敤瀛楁 + </Tooltip> + }> + {getFieldDecorator('controlField', { + initialValue: setting.controlField || '' + })( + <Select allowClear onChange={(val) => this.setState({controlField: val})}> + {columns.map((option, i) => + <Select.Option key={i} value={option.value}> + {option.text} + </Select.Option> + )} + </Select> + )} + </Form.Item> + </Col> + {controlField ? <Col span={12}> + <Form.Item label={ + <Tooltip placement="topLeft" title="褰撳瓧娈靛�间笌鎺у埗鍊肩浉绛夋椂锛岃鏁版嵁浼氱鐢紝澶氫釜鍊肩敤閫楀彿鍒嗛殧銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 鎺у埗鍊� + </Tooltip> + }> + {getFieldDecorator('controlVal', { + initialValue: setting.controlVal || '' + })(<Input autoComplete="off" />)} + </Form.Item> + </Col> : null} </Row> </Form> </div> diff --git a/src/templates/subtableconfig/index.jsx b/src/templates/subtableconfig/index.jsx index 522d60c..46d85c0 100644 --- a/src/templates/subtableconfig/index.jsx +++ b/src/templates/subtableconfig/index.jsx @@ -276,6 +276,10 @@ } } + if (_config.setting.doubleClick && _config.action.findIndex((item) => item.uuid === _config.setting.doubleClick) === -1) { + _config.setting.doubleClick = '' + } + // 鏈缃暟鎹簮鎴栦富閿椂锛屽惎鐢ㄧ姸鎬佷负false let result = this.verifyconfig(_config) diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx index 6fd7783..24b2971 100644 --- a/src/views/menudesign/index.jsx +++ b/src/views/menudesign/index.jsx @@ -922,6 +922,10 @@ error = `缁勪欢銆�${item.name}銆嬪潗鏍囪酱灏氭湭璁剧疆锛乣 } else if (item.type === 'tree' && (!item.wrap.valueField || !item.wrap.labelField || !item.wrap.parentField)) { error = `缁勪欢銆�${item.name}銆嬪熀鏈俊鎭皻鏈缃紒` + } else if (item.type === 'table' && item.wrap.doubleClick) { + if (item.action.findIndex((m) => m.uuid === item.wrap.doubleClick) === -1) { + error = `缁勪欢銆�${item.name}銆嬬粦瀹氱殑鍙屽嚮鎸夐挳宸插垹闄わ紒` + } } }) } diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx index f6106f5..9a46fc7 100644 --- a/src/views/mobdesign/index.jsx +++ b/src/views/mobdesign/index.jsx @@ -214,6 +214,13 @@ duration: 5 }) return + } else if (['AIService'].includes(menu.MenuID)) { + notification.warning({ + top: 92, + message: '绯荤粺椤甸潰涓嶅彲缂栬緫锛�', + duration: 5 + }) + return } let param = { diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx index a90dd49..d6dcce1 100644 --- a/src/views/pcdesign/index.jsx +++ b/src/views/pcdesign/index.jsx @@ -1467,6 +1467,10 @@ error = `缁勪欢銆�${item.name}銆嬪潗鏍囪酱灏氭湭璁剧疆锛乣 } else if (item.type === 'tree' && (!item.wrap.valueField || !item.wrap.labelField || !item.wrap.parentField)) { error = `缁勪欢銆�${item.name}銆嬪熀鏈俊鎭皻鏈缃紒` + } else if (item.type === 'table' && item.wrap.doubleClick) { + if (item.action.findIndex((m) => m.uuid === item.wrap.doubleClick) === -1) { + error = `缁勪欢銆�${item.name}銆嬬粦瀹氱殑鍙屽嚮鎸夐挳宸插垹闄わ紒` + } } }) } -- Gitblit v1.8.0