From cc836600db6b4adecaaeb383a09e6ff89a2f0553 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 16 八月 2022 14:37:57 +0800 Subject: [PATCH] 2022-08-16 --- public/options.json | 10 +- src/menu/components/card/table-card/index.scss | 7 ++ src/tabviews/custom/components/card/table-card/index.jsx | 44 +++++++++++++- src/menu/components/card/data-card/index.scss | 7 ++ src/menu/components/card/data-card/options.jsx | 7 +- src/menu/components/card/table-card/index.jsx | 7 +- src/tabviews/custom/components/card/data-card/index.scss | 12 ++++ src/tabviews/custom/components/timeline/normal-timeline/index.jsx | 12 ++-- src/tabviews/custom/components/card/data-card/index.jsx | 56 +++++++++++++++--- src/menu/components/card/data-card/index.jsx | 3 src/tabviews/custom/components/card/table-card/index.scss | 12 ++++ 11 files changed, 145 insertions(+), 32 deletions(-) diff --git a/public/options.json b/public/options.json index 523da64..fbdb8bf 100644 --- a/public/options.json +++ b/public/options.json @@ -1,12 +1,12 @@ { - "appId": "201912040924165801464FF1788654BC5AC73", - "appkey": "20191106103859640976D6E924E464D029CF0", + "appId": "202108312122504607B107A83F55B40C98CCF", + "appkey": "20210831212235413F287EC3BF489424496C8", "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", "systemType": "", "externalDatabase": "false", "lineColor": "", "filter": "false", - "defaultApp": "mk", + "defaultApp": "mkindustry", "defaultLang": "zh-CN", "WXAppID": "", "WXminiAppID": "", @@ -15,6 +15,6 @@ "probation": "", "keepPassword": "true", "platforms": ["H5", "wechat", "android", "ios", "wxMiniProgram"], - "host": "http://qingqiumarket.cn", - "service": "MKWMS/" + "host": "http://demo.mk9h.cn", + "service": "erp_new/" } \ No newline at end of file diff --git a/src/menu/components/card/data-card/index.jsx b/src/menu/components/card/data-card/index.jsx index aa49ada..5220e69 100644 --- a/src/menu/components/card/data-card/index.jsx +++ b/src/menu/components/card/data-card/index.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' import { Popover, Modal, Pagination } from 'antd' -import { PlusOutlined, PlusCircleOutlined, PlusSquareOutlined, EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined } from '@ant-design/icons' +import { PlusOutlined, PlusCircleOutlined, PlusSquareOutlined, EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined, DownOutlined } from '@ant-design/icons' import asyncComponent from '@/utils/asyncComponent' import asyncIconComponent from '@/utils/asyncIconComponent' @@ -799,6 +799,7 @@ <div style={{clear: 'both'}}></div> {card.wrap.pagestyle === 'page' && card.setting.laypage === 'true' && appType !== 'mob' ? <Pagination total={85} size="small" showTotal={total => `鍏� ${total} 鏉} pageSize={20} defaultCurrent={1}/> : null} {card.wrap.pagestyle === 'page' && card.setting.laypage === 'true' && appType === 'mob' ? <MobPagination /> : null} + {card.wrap.pagestyle === 'more' && card.setting.laypage === 'true' ? <div className="mk-more">鏌ョ湅鏇村<DownOutlined/></div> : null} <div className="component-name"> <div className="center"> <div className="title">{card.name}</div> diff --git a/src/menu/components/card/data-card/index.scss b/src/menu/components/card/data-card/index.scss index ed54cb3..baf9613 100644 --- a/src/menu/components/card/data-card/index.scss +++ b/src/menu/components/card/data-card/index.scss @@ -118,6 +118,13 @@ border-bottom: 2px solid transparent!important; } } + .mk-more { + text-align: center; + line-height: 40px; + .anticon-down { + margin-left: 2px; + } + } } .menu-data-card-edit-box::-webkit-scrollbar { diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx index ba3b1f6..7db4e04 100644 --- a/src/menu/components/card/data-card/options.jsx +++ b/src/menu/components/card/data-card/options.jsx @@ -114,18 +114,19 @@ field: 'pagestyle', label: '鍒嗛〉椋庢牸', initval: wrap.pagestyle || 'page', - tooltip: '鏁版嵁婧愰�夋嫨鍒嗛〉鏃舵湁鏁堛�傛敞锛氭粦鍔ㄥ姞杞藉彧鏈夌涓�涓湁鏁�', + tooltip: '鏁版嵁婧愰�夋嫨鍒嗛〉鏃舵湁鏁堛�傛敞锛氬脊鎬у竷灞�鏃跺浐瀹氫负椤电爜銆�', required: false, disabled: !laypage, options: [ {value: 'page', label: '椤电爜'}, - {value: 'switch', label: '宸﹀彸鍒囨崲', forbid: appType === 'mob'}, + {value: 'switch', label: '宸﹀彸鍒囨崲', forbid: appType === 'mob' || subtype === 'tablecard'}, {value: 'slide', label: '婊戝姩鍔犺浇', forbid: appType !== 'mob'}, + {value: 'more', label: '鏌ョ湅鏇村'}, ], controlFields: [ {field: 'slidetip', values: ['slide']}, ], - forbid: !(subtype === 'datacard' || (subtype === 'tablecard' && appType === 'mob')) + forbid: subtype === 'propcard' }, { type: 'radio', diff --git a/src/menu/components/card/table-card/index.jsx b/src/menu/components/card/table-card/index.jsx index 68546c1..d71c70b 100644 --- a/src/menu/components/card/table-card/index.jsx +++ b/src/menu/components/card/table-card/index.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' import { Popover, Modal, Pagination } from 'antd' -import { PlusOutlined, PlusCircleOutlined, PlusSquareOutlined, EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined } from '@ant-design/icons' +import { PlusOutlined, PlusCircleOutlined, PlusSquareOutlined, EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined, DownOutlined } from '@ant-design/icons' import asyncComponent from '@/utils/asyncComponent' import asyncIconComponent from '@/utils/asyncIconComponent' @@ -611,8 +611,9 @@ <div style={{minHeight: 'calc(100% - 90px)'}}> {card.subcards.map(subcard => (<CardSimpleComponent key={subcard.uuid} cards={card} card={subcard} updateElement={this.updateCard} move={this.move} deleteElement={this.deleteCard}/>))} </div> - {card.setting.laypage === 'true' && card.wrap.pagestyle !== 'slide' && appType !== 'mob' ? <Pagination size="small" total={50} /> : null} - {card.setting.laypage === 'true' && card.wrap.pagestyle !== 'slide' && appType === 'mob' ? <MobPagination /> : null} + {card.setting.laypage === 'true' && card.wrap.pagestyle === 'page' && appType !== 'mob' ? <Pagination size="small" total={50} /> : null} + {card.setting.laypage === 'true' && card.wrap.pagestyle === 'page' && appType === 'mob' ? <MobPagination /> : null} + {card.setting.laypage === 'true' && card.wrap.pagestyle === 'more' ? <div className="mk-more">鏌ョ湅鏇村<DownOutlined/></div> : null} <div className="component-name"> <div className="center"> <div className="title">{card.name}</div> diff --git a/src/menu/components/card/table-card/index.scss b/src/menu/components/card/table-card/index.scss index 03e950e..c03d640 100644 --- a/src/menu/components/card/table-card/index.scss +++ b/src/menu/components/card/table-card/index.scss @@ -84,6 +84,13 @@ .ant-pagination { text-align: right; } + .mk-more { + text-align: center; + line-height: 40px; + .anticon-down { + margin-left: 2px; + } + } } .menu-table-card-edit-box::after { display: block; diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index 5859198..fc72f5a 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -2,6 +2,7 @@ import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' import { Spin, Empty, notification, message, Row, Col, Pagination } from 'antd' +import { DownOutlined } from '@ant-design/icons' import Api from '@/api' import Utils from '@/utils/utils.js' @@ -165,6 +166,7 @@ } _config.wrap.selStyle = _config.wrap.selStyle || 'active' + _config.wrap.pagestyle = _config.wrap.pagestyle || 'page' _config.wrap.scale = _config.wrap.scale === 'true' ? 'scale' : '' _config.wrap.layout = (_config.wrap.layout || 'grid') + '-layout float-' + (_config.wrap.cardFloat || 'left') @@ -462,7 +464,7 @@ }) } - async loadData (id) { + async loadData (id, type) { const { mainSearch } = this.props const { config, arr_field, pageIndex, search, BID, BData, selected } = this.state @@ -536,11 +538,26 @@ } } - this.setState({ - activeKey: '', - selectKeys: [], - selectedData: [], - data: result.data.map((item, index) => { + let data = [] + + if (type === 'plus') { + let _data = (this.state.data || []).concat(result.data || []) + data = _data.map((item, index) => { + item.key = index + item.$$uuid = item[config.setting.primaryKey] || '' + 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 + }) + } else { + data = result.data.map((item, index) => { item.key = index item.$$uuid = item[config.setting.primaryKey] || '' item.$$BID = BID || '' @@ -552,9 +569,15 @@ item.$disabled = true } } - return item - }), + }) + } + + this.setState({ + activeKey: '', + selectKeys: [], + selectedData: [], + data: data, total: result.total, loading: false }) @@ -634,6 +657,20 @@ duration: 10 }) } + } + + loadMore = () => { + const { total, pageIndex, loading, config } = this.state + + if (loading || config.setting.pageSize * pageIndex >= total) { + return + } + + this.setState({ + pageIndex: pageIndex + 1 + }, () => { + this.loadData('', 'plus') + }) } prevPage = () => { @@ -793,7 +830,8 @@ {switchable ? <div className={'prev-page ' + (total <= _total ? 'disabled' : '')} onClick={this.nextPage}><div><div><img src={nextImg} alt=""/></div></div></div> : null} {precards.length === 0 && nextcards.length === 0 && (!data || data.length === 0) ? <Empty description={false}/> : null} </div> - {config.wrap.pagestyle !== 'switch' && config.setting.laypage && data ? <Pagination size="small" total={total} showTotal={t => `鍏� ${t} 鏉} pageSize={config.setting.pageSize} onChange={this.changePageIndex} current={pageIndex}/> : null} + {config.wrap.pagestyle === 'page' && config.setting.laypage && data ? <Pagination size="small" total={total} showTotal={t => `鍏� ${t} 鏉} pageSize={config.setting.pageSize} onChange={this.changePageIndex} current={pageIndex}/> : null} + {config.wrap.pagestyle === 'more' && config.setting.laypage && data && data.length > 0 ? <div className={'mk-more' + (config.setting.pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>鏌ョ湅鏇村<DownOutlined/></div> : null} </div> ) } diff --git a/src/tabviews/custom/components/card/data-card/index.scss b/src/tabviews/custom/components/card/data-card/index.scss index a9d15b4..1b7e271 100644 --- a/src/tabviews/custom/components/card/data-card/index.scss +++ b/src/tabviews/custom/components/card/data-card/index.scss @@ -145,6 +145,18 @@ padding: 10px; text-align: right; } + .mk-more { + text-align: center; + line-height: 40px; + cursor: pointer; + .anticon-down { + margin-left: 2px; + } + } + .mk-more.disabled { + cursor: not-allowed; + color: #bcbcbc; + } } .custom-data-card-box::-webkit-scrollbar { width: 7px; diff --git a/src/tabviews/custom/components/card/table-card/index.jsx b/src/tabviews/custom/components/card/table-card/index.jsx index a4a9de0..1325526 100644 --- a/src/tabviews/custom/components/card/table-card/index.jsx +++ b/src/tabviews/custom/components/card/table-card/index.jsx @@ -3,6 +3,7 @@ import { connect } from 'react-redux' import { is, fromJS } from 'immutable' import { Spin, notification, Row, Col, Empty, Pagination } from 'antd' +import { DownOutlined } from '@ant-design/icons' import Api from '@/api' import Utils from '@/utils/utils.js' @@ -100,6 +101,8 @@ return item }) }) + + _config.wrap.pagestyle = _config.wrap.pagestyle || 'page' this.setState({ sync: _sync, @@ -236,7 +239,7 @@ }) } - async loadData () { + async loadData (type) { const { mainSearch } = this.props const { config, arr_field, pageIndex, search, BID, BData } = this.state @@ -277,15 +280,31 @@ start = config.setting.pageSize * (pageIndex - 1) + 1 } - this.setState({ - data: result.data.map((item, index) => { + let data = [] + + if (type === 'plus') { + let _data = (this.state.data || []).concat(result.data || []) + data = _data.map((item, index) => { + item.key = index + item.$$uuid = item[config.setting.primaryKey] || '' + item.$$BID = BID || '' + item.$$BData = BData || '' + item.$Index = index + 1 + '' + return item + }) + } else { + data = result.data.map((item, index) => { item.key = index item.$$uuid = item[config.setting.primaryKey] || '' item.$$BID = BID || '' item.$$BData = BData || '' item.$Index = index + start + '' return item - }), + }) + } + + this.setState({ + data: data, total: result.total, loading: false }) @@ -416,6 +435,20 @@ }) } + loadMore = () => { + const { total, pageIndex, loading, config } = this.state + + if (loading || config.setting.pageSize * pageIndex >= total) { + return + } + + this.setState({ + pageIndex: pageIndex + 1 + }, () => { + this.loadData('plus') + }) + } + render() { const { config, loading, data, BID, pageIndex, total } = this.state @@ -436,7 +469,8 @@ {data && data.length === 0 ? <div className="card-row-list" style={{height: config.wrap.contentHeight}}> <Empty description={false}/> </div> : null} - {config.setting.laypage ? <Pagination size="small" current={pageIndex} total={total} onChange={this.changePageIndex} /> : null} + {config.setting.laypage && config.wrap.pagestyle === 'page' ? <Pagination size="small" current={pageIndex} total={total} onChange={this.changePageIndex} /> : null} + {config.setting.laypage && config.wrap.pagestyle === 'more' && data && data.length > 0 ? <div className={'mk-more' + (config.setting.pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>鏌ョ湅鏇村<DownOutlined/></div> : null} </div> ) } diff --git a/src/tabviews/custom/components/card/table-card/index.scss b/src/tabviews/custom/components/card/table-card/index.scss index 84afeee..0ef56cb 100644 --- a/src/tabviews/custom/components/card/table-card/index.scss +++ b/src/tabviews/custom/components/card/table-card/index.scss @@ -86,6 +86,18 @@ background: #ffffff; } } + .mk-more { + text-align: center; + line-height: 40px; + cursor: pointer; + .anticon-down { + margin-left: 2px; + } + } + .mk-more.disabled { + cursor: not-allowed; + color: #bcbcbc; + } } .custom-card-box::after { diff --git a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx index 2cd51ef..1a14e69 100644 --- a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx +++ b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx @@ -229,11 +229,16 @@ async loadData () { const { mainSearch } = this.props const { config, arr_field, BID, BData } = this.state - + if (config.setting.supModule && !BID) { // BID 涓嶅瓨鍦ㄦ椂锛屼笉鍋氭煡璇� this.setState({ data: [], }) + return + } + + if (config.setting.interType === 'inner' && config.setting.innerFunc === 'z_mk_express') { + this.getExpress() return } @@ -249,11 +254,6 @@ let requireFields = searches.filter(item => item.required && item.value === '') if (requireFields.length > 0) { - return - } - - if (config.setting.interType === 'inner' && config.setting.innerFunc === 'z_mk_express') { - this.getExpress() return } -- Gitblit v1.8.0