tplus-components-touch 3.28.4 → 3.28.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -171,6 +171,7 @@ var Tab = (0, _mutantsMicrofx.observer)(_class = function (_React$Component) {
171
171
  }
172
172
  columns.push(newItem);
173
173
  });
174
+ return columns;
174
175
  };
175
176
 
176
177
  _this2.loadingIcon = function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["tplus-components-touch/components/inventorySearch/tab.js"],"names":["Tab","observer","props","onRowClick","record","index","type","setState","selectedRowIndex","resetPageNo","activePage","previous","state","store","searchMore","searchValue","next","getRowClassName","getNewColumnsList","searchDesigns","columns","push","title","width","dataIndex","key","fixed","render","text","map","item","OriginalTitle","FieldName","Precision","IsFormat","newItem","ellipsis","renderText","InventorySearchApi","formatNumber","tools","dateFormat","loadingIcon","theme","localStore","get","img","height","emptyHeight","setTableHeight","windowEvent","bind","window","addEventListener","removeEventListener","_this","setTimeout","Number","tabDom","clientHeight","tableHeight","dataSource","TotalPage","loading","dom","length","y","spinning","indicator","onClick","info","buttonVisible","fontSize","React","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;AAEA;;AACA;;AACA;;AACA;;;;AACA;;;;;;IAEqBA,G,OADpBC,wB;;;AAEC,eAAYC,KAAZ,EAAmB;AAAA;;AAAA,iIACXA,KADW;;AAAA,WA0BnBC,UA1BmB,GA0BN,UAACC,MAAD,EAASC,KAAT,EAAmB;AAC9B,aAAKH,KAAL,CAAWC,UAAX,IAAyB,OAAKD,KAAL,CAAWC,UAAX,CAAsBC,MAAtB,EAA8B,OAAKF,KAAL,CAAWI,IAAzC,CAAzB;AACA,aAAKC,QAAL,CAAc,EAAEC,kBAAkBH,KAApB,EAAd;AACD,KA7BkB;;AAAA,WA+BnBI,WA/BmB,GA+BL,YAAM;AAClB,aAAKF,QAAL,CAAc;AACZG,oBAAY;AADA,OAAd;AAGD,KAnCk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;AALZ;AA1BF,OADF;AAoCD;;;EAlK8ByD,gBAAMC,S;;kBAAlB1E,G","file":"tab.js","sourcesContent":["import React from 'react';\r\nimport { Table } from 'antd';\r\nimport { observer } from 'mutants-microfx';\r\nimport { localStore } from 'mutants-util';\r\nimport { Page, ProgressState } from '../../index';\r\nimport InventorySearchApi from './api';\r\nimport tools from '../../util/tools';\r\n@observer\r\nexport default class Tab extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n activePage: 1,\r\n emptyHeight: 200,\r\n selectedRowIndex: -1\r\n };\r\n }\r\n componentDidMount() {\r\n this.setTableHeight();\r\n this.windowEvent = this.setTableHeight.bind(this);\r\n window.addEventListener('resize', this.windowEvent);\r\n }\r\n\r\n componentWillUnmount() {\r\n window.removeEventListener('resize', this.windowEvent);\r\n }\r\n\r\n setTableHeight() {\r\n let _this = this;\r\n setTimeout(() => {\r\n let height = Number(_this.tabDom.clientHeight - 200);\r\n _this.setState({ tableHeight: height })\r\n }, 0)\r\n }\r\n\r\n onRowClick = (record, index) => {\r\n this.props.onRowClick && this.props.onRowClick(record, this.props.type)\r\n this.setState({ selectedRowIndex: index })\r\n }\r\n\r\n resetPageNo = () => {\r\n this.setState({\r\n activePage: 1\r\n })\r\n }\r\n\r\n previous = () => {\r\n this.setState({\r\n activePage: this.state.activePage - 1\r\n }, () => {\r\n this.props.store.searchMore(this.props.searchValue, this.state.activePage, 15, this.props.type)\r\n })\r\n }\r\n\r\n next = () => {\r\n this.setState({\r\n activePage: this.state.activePage + 1\r\n }, () => {\r\n this.props.store.searchMore(this.props.searchValue, this.state.activePage, 15, this.props.type)\r\n })\r\n }\r\n getRowClassName = (record, index) => {\r\n const { selectedRowIndex } = this.state;\r\n if (selectedRowIndex == index) {\r\n return 'row-selected'\r\n } else {\r\n return '';\r\n }\r\n }\r\n\r\n // 获取列字段集合\r\n getNewColumnsList = (type, searchDesigns) => {\r\n let columns = [];\r\n //周边门店要显示门店名称\r\n if (type == '2') {\r\n columns.push({\r\n title: '门店名称',\r\n width: 120,\r\n dataIndex: 'WarehouseName',\r\n key: 'WarehouseName',\r\n fixed: 'left',\r\n render: (text, record, index) => {\r\n return <div className='text-2line-overflow'>{text}</div>\r\n }\r\n })\r\n }\r\n searchDesigns.map(item => {\r\n let { OriginalTitle, FieldName, Precision, IsFormat } = item || {};\r\n let newItem = {\r\n title: OriginalTitle,\r\n width: 100,\r\n dataIndex: FieldName,\r\n key: FieldName,\r\n Precision: Precision,\r\n IsFormat: IsFormat,\r\n ellipsis: true,\r\n }\r\n switch (FieldName) {\r\n case 'InventoryName':\r\n newItem.width = 160;\r\n newItem.render = (text, record, index) => {\r\n return <div className='text-2line-overflow'>{text}</div>\r\n }\r\n break;\r\n case 'InventoryCode': newItem.width = 160; break;\r\n case 'ExistingBaseQuantity': newItem.width = 80; break;\r\n }\r\n if ((Precision || Precision == 0) && IsFormat) {\r\n newItem.render = (text, record, index) => {\r\n let renderText = InventorySearchApi.formatNumber(text, Precision);\r\n return <span>{renderText}</span>\r\n }\r\n }\r\n if (FieldName == 'ProductionDate' || FieldName == 'ExpiryDate') {\r\n newItem.render = (text, record, index) => {\r\n let renderText = tools.dateFormat(text);\r\n return <span>{renderText}</span>\r\n }\r\n }\r\n columns.push(newItem);\r\n })\r\n }\r\n loadingIcon = () => {\r\n const theme = localStore.get('theme');\r\n const img = `https://newretail.static.chanjet.com/bc_pos/loading${(theme == 'blue' || theme == 'dark') ? '2' : ''}.gif`;\r\n return (\r\n <img src={img} style={{ width: '90px', height: '90px' }} />\r\n )\r\n }\r\n\r\n render() {\r\n let { activePage } = this.state;\r\n let { dataSource, TotalPage, loading, type, searchDesigns } = this.props;\r\n let columns = this.getNewColumnsList(type, searchDesigns);\r\n return (\r\n <div ref={(dom) => { this.tabDom = dom }}\r\n className={`${dataSource && dataSource.length > 0 ? 'inventoryTable' : ''} inventory-tab ${type == '2' ? 'table2' : 'table1'}`}>\r\n {\r\n dataSource && dataSource.length > 0 ?\r\n <Table\r\n columns={columns}\r\n dataSource={dataSource}\r\n scroll={{ y: \"calc(~'100% - 43px')\" }}\r\n loading={{\r\n spinning: loading,\r\n indicator: this.loadingIcon()\r\n }}\r\n pagination={false}\r\n rowClassName={this.getRowClassName}\r\n onRow={(record, index) => {\r\n return {\r\n onClick: () => this.onRowClick(record, index)\r\n }\r\n }} />\r\n :\r\n <ProgressState\r\n state={loading? 'load': \"empty\"}\r\n stateCommonStyle={{ height: \"100%\" }}\r\n empty={{ info: '暂无数据~~', buttonVisible: false }} />\r\n }\r\n {!(TotalPage == 0 || !TotalPage) && <div className=\"primary-color\" style={{ fontSize: '13px'}}>温馨提示:点击选中该行商品可直接带入至开单页</div>}\r\n <Page\r\n total={TotalPage}\r\n currentIndex={activePage}\r\n previous={this.previous}\r\n next={this.next}\r\n className='inventory-page'\r\n />\r\n </div>\r\n )\r\n }\r\n}"]}
1
+ {"version":3,"sources":["tplus-components-touch/components/inventorySearch/tab.js"],"names":["Tab","observer","props","onRowClick","record","index","type","setState","selectedRowIndex","resetPageNo","activePage","previous","state","store","searchMore","searchValue","next","getRowClassName","getNewColumnsList","searchDesigns","columns","push","title","width","dataIndex","key","fixed","render","text","map","item","OriginalTitle","FieldName","Precision","IsFormat","newItem","ellipsis","renderText","InventorySearchApi","formatNumber","tools","dateFormat","loadingIcon","theme","localStore","get","img","height","emptyHeight","setTableHeight","windowEvent","bind","window","addEventListener","removeEventListener","_this","setTimeout","Number","tabDom","clientHeight","tableHeight","dataSource","TotalPage","loading","dom","length","y","spinning","indicator","onClick","info","buttonVisible","fontSize","React","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;AAEA;;AACA;;AACA;;AACA;;;;AACA;;;;;;IAEqBA,G,OADpBC,wB;;;AAEC,eAAYC,KAAZ,EAAmB;AAAA;;AAAA,iIACXA,KADW;;AAAA,WA0BnBC,UA1BmB,GA0BN,UAACC,MAAD,EAASC,KAAT,EAAmB;AAC9B,aAAKH,KAAL,C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AAjC,EAHT,GApBN;AAyBG,UAAET,aAAa,CAAb,IAAkB,CAACA,SAArB,KAAmC;AAAA;AAAA,YAAK,WAAU,eAAf,EAA+B,OAAO,EAAEU,UAAU,MAAZ,EAAtC;AAAA;AAAA,SAzBtC;AA0BE,sCAAC,WAAD;AACE,iBAAOV,SADT;AAEE,wBAAcpD,UAFhB;AAGE,oBAAU,KAAKC,QAHjB;AAIE,gBAAM,KAAKK,IAJb;AAKE,qBAAU;AALZ;AA1BF,OADF;AAoCD;;;EAnK8ByD,gBAAMC,S;;kBAAlB1E,G","file":"tab.js","sourcesContent":["import React from 'react';\r\nimport { Table } from 'antd';\r\nimport { observer } from 'mutants-microfx';\r\nimport { localStore } from 'mutants-util';\r\nimport { Page, ProgressState } from '../../index';\r\nimport InventorySearchApi from './api';\r\nimport tools from '../../util/tools';\r\n@observer\r\nexport default class Tab extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n activePage: 1,\r\n emptyHeight: 200,\r\n selectedRowIndex: -1\r\n };\r\n }\r\n componentDidMount() {\r\n this.setTableHeight();\r\n this.windowEvent = this.setTableHeight.bind(this);\r\n window.addEventListener('resize', this.windowEvent);\r\n }\r\n\r\n componentWillUnmount() {\r\n window.removeEventListener('resize', this.windowEvent);\r\n }\r\n\r\n setTableHeight() {\r\n let _this = this;\r\n setTimeout(() => {\r\n let height = Number(_this.tabDom.clientHeight - 200);\r\n _this.setState({ tableHeight: height })\r\n }, 0)\r\n }\r\n\r\n onRowClick = (record, index) => {\r\n this.props.onRowClick && this.props.onRowClick(record, this.props.type)\r\n this.setState({ selectedRowIndex: index })\r\n }\r\n\r\n resetPageNo = () => {\r\n this.setState({\r\n activePage: 1\r\n })\r\n }\r\n\r\n previous = () => {\r\n this.setState({\r\n activePage: this.state.activePage - 1\r\n }, () => {\r\n this.props.store.searchMore(this.props.searchValue, this.state.activePage, 15, this.props.type)\r\n })\r\n }\r\n\r\n next = () => {\r\n this.setState({\r\n activePage: this.state.activePage + 1\r\n }, () => {\r\n this.props.store.searchMore(this.props.searchValue, this.state.activePage, 15, this.props.type)\r\n })\r\n }\r\n getRowClassName = (record, index) => {\r\n const { selectedRowIndex } = this.state;\r\n if (selectedRowIndex == index) {\r\n return 'row-selected'\r\n } else {\r\n return '';\r\n }\r\n }\r\n\r\n // 获取列字段集合\r\n getNewColumnsList = (type, searchDesigns) => {\r\n let columns = [];\r\n //周边门店要显示门店名称\r\n if (type == '2') {\r\n columns.push({\r\n title: '门店名称',\r\n width: 120,\r\n dataIndex: 'WarehouseName',\r\n key: 'WarehouseName',\r\n fixed: 'left',\r\n render: (text, record, index) => {\r\n return <div className='text-2line-overflow'>{text}</div>\r\n }\r\n })\r\n }\r\n searchDesigns.map(item => {\r\n let { OriginalTitle, FieldName, Precision, IsFormat } = item || {};\r\n let newItem = {\r\n title: OriginalTitle,\r\n width: 100,\r\n dataIndex: FieldName,\r\n key: FieldName,\r\n Precision: Precision,\r\n IsFormat: IsFormat,\r\n ellipsis: true,\r\n }\r\n switch (FieldName) {\r\n case 'InventoryName':\r\n newItem.width = 160;\r\n newItem.render = (text, record, index) => {\r\n return <div className='text-2line-overflow'>{text}</div>\r\n }\r\n break;\r\n case 'InventoryCode': newItem.width = 160; break;\r\n case 'ExistingBaseQuantity': newItem.width = 80; break;\r\n }\r\n if ((Precision || Precision == 0) && IsFormat) {\r\n newItem.render = (text, record, index) => {\r\n let renderText = InventorySearchApi.formatNumber(text, Precision);\r\n return <span>{renderText}</span>\r\n }\r\n }\r\n if (FieldName == 'ProductionDate' || FieldName == 'ExpiryDate') {\r\n newItem.render = (text, record, index) => {\r\n let renderText = tools.dateFormat(text);\r\n return <span>{renderText}</span>\r\n }\r\n }\r\n columns.push(newItem);\r\n });\r\n return columns;\r\n }\r\n loadingIcon = () => {\r\n const theme = localStore.get('theme');\r\n const img = `https://newretail.static.chanjet.com/bc_pos/loading${(theme == 'blue' || theme == 'dark') ? '2' : ''}.gif`;\r\n return (\r\n <img src={img} style={{ width: '90px', height: '90px' }} />\r\n )\r\n }\r\n\r\n render() {\r\n let { activePage } = this.state;\r\n let { dataSource, TotalPage, loading, type, searchDesigns } = this.props;\r\n let columns = this.getNewColumnsList(type, searchDesigns);\r\n return (\r\n <div ref={(dom) => { this.tabDom = dom }}\r\n className={`${dataSource && dataSource.length > 0 ? 'inventoryTable' : ''} inventory-tab ${type == '2' ? 'table2' : 'table1'}`}>\r\n {\r\n dataSource && dataSource.length > 0 ?\r\n <Table\r\n columns={columns}\r\n dataSource={dataSource}\r\n scroll={{ y: \"calc(~'100% - 43px')\" }}\r\n loading={{\r\n spinning: loading,\r\n indicator: this.loadingIcon()\r\n }}\r\n pagination={false}\r\n rowClassName={this.getRowClassName}\r\n onRow={(record, index) => {\r\n return {\r\n onClick: () => this.onRowClick(record, index)\r\n }\r\n }} />\r\n :\r\n <ProgressState\r\n state={loading? 'load': \"empty\"}\r\n stateCommonStyle={{ height: \"100%\" }}\r\n empty={{ info: '暂无数据~~', buttonVisible: false }} />\r\n }\r\n {!(TotalPage == 0 || !TotalPage) && <div className=\"primary-color\" style={{ fontSize: '13px'}}>温馨提示:点击选中该行商品可直接带入至开单页</div>}\r\n <Page\r\n total={TotalPage}\r\n currentIndex={activePage}\r\n previous={this.previous}\r\n next={this.next}\r\n className='inventory-page'\r\n />\r\n </div>\r\n )\r\n }\r\n}"]}
@@ -281,11 +281,13 @@ var KeyboardInput = (_temp = _class = function (_Component) {
281
281
  onSelect: this.handleMobileKeyboard,
282
282
  ref: function ref(input) {
283
283
  return _this2.input = input;
284
- } }),
284
+ }
285
+ }),
285
286
  _react2.default.createElement(_index.Keyboard, {
286
287
  type: 'number2',
287
288
  positive: this.props.type,
288
- onChange: this.onChange })
289
+ onChange: this.onChange
290
+ })
289
291
  );
290
292
  }
291
293
  }]);
@@ -1 +1 @@
1
- {"version":3,"sources":["tplus-components-touch/components/keyboard/numberButton_input.js"],"names":["KeyboardInput","props","inputChange","v","handleMobileKeyboard","newValue","max","min","type","maxLength","precisionLength","tools","isNull","value","tip","Message","info","match","length","length1","parseInt","length2","v1","v2","indexOf","slice","split","setState","onChange","state","key","handleOk","Keyboard","getNewValue","input","getValue","el","isMobileEnvironment","env","os","constant","ios","console","log","setAttribute","removeAttribute","setTimer","window","clearTimeout","setTimeout","onFocus","e","onRef","visible","platform","isHorizontalPad","props_old","b","hotKey","hotKeyNotFilter","marginBottom","placeholder","target","Component","propTypes","PropTypes","func","isRequired","string","number"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAA;;;;;;;;;AAOA;;;;AAEA;;AACA;;AACA;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;IAEqBA,a;;;AAYnB,yBAAYC,KAAZ,EAAmB;AAAA;;AAAA,oJACXA,KADW;;AAAA,UAsBnBC,WAtBmB,GAsBL,UAACC,CAAD,EAAO;AACnB;AACA,YAAKC,oBAAL;AACA,UAAIC,iBAAJ;AACA,UAAIF,MAAM,EAAV,EAAc;AACZE,mBAAW,EAAX;AACD,OAFD,MAEO;AACL;AADK,0BAE4D,MAAKJ,KAFjE;AAAA,0CAEGK,GAFH;AAAA,YAEGA,GAFH,mCAES,EAFT;AAAA,0CAEaC,GAFb;AAAA,YAEaA,GAFb,mCAEmB,EAFnB;AAAA,YAEuBC,IAFvB,eAEuBA,IAFvB;AAAA,YAE6BC,SAF7B,eAE6BA,SAF7B;AAAA,YAEwCC,eAFxC,eAEwCA,eAFxC;;AAGL,YAAI,CAACC,gBAAMC,MAAN,CAAaN,IAAIO,KAAjB,CAAL,EAA8B;AAC5B,cAAIV,IAAIG,IAAIO,KAAZ,EAAmB;AACjB,gBAAI,CAACF,gBAAMC,MAAN,CAAaN,IAAIQ,GAAjB,CAAL,EAA4BC,gBAAQC,IAAR,CAAaV,IAAIQ,GAAjB;AAC5B;AACD;AACF;AACD,YAAI,CAACH,gBAAMC,MAAN,CAAaL,IAAIM,KAAjB,CAAL,EAA8B;AAC5B,cAAIV,IAAII,IAAIM,KAAZ,EAA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D,KAAL,CAAWoD,OAAX,IAAsB,IAArE,EAA2E;AACzE,aAAK1B,QAAL,CAAc,EAAEd,OAAO,KAAKZ,KAAL,CAAWY,KAAX,IAAoB,EAA7B,EAAd;AACD;AACF;;AAkHD;;;;6BAgBS;AAAA;;AAAA,mBACkB,KAAKgB,KADvB;AAAA,UACDwB,OADC,UACDA,OADC;AAAA,UACQxC,KADR,UACQA,KADR;;AAEP,aACE;AAAA;AAAA,UAAK,WAAU,uBAAf;AACE;AACE,qBAAW6C,iBAAOC,eAAP,CAAuB,gBAAvB,CADb;AAEE,iBAAO,EAAEC,cAAc,MAAhB,EAFT;AAGE,uBAAa,KAAK3D,KAAL,CAAW4D,WAAX,IAA0B,EAHzC;AAIE,iBAAOhD,KAJT;AAKE,oBAAU,kBAACsC,CAAD;AAAA,mBAAO,OAAKjD,WAAL,CAAiBiD,EAAEW,MAAF,CAASjD,KAA1B,CAAP;AAAA,WALZ;AAME,mBAAS,KAAKqC,OANhB;AAOE,mBAAS,KAAK9C,oBAPhB;AAQE,oBAAU,KAAKA,oBARjB;AASE,eAAK;AAAA,mBAAS,OAAK8B,KAAL,GAAaA,KAAtB;AAAA,WATP,GADF;AAYE,sCAAC,eAAD;AACE,gBAAK,SADP;AAEE,oBAAU,KAAKjC,KAAL,CAAWO,IAFvB;AAGE,oBAAU,KAAKoB,QAHjB;AAZF,OADF;AAmBD;;;EAvLwCmC,gB,UAElCC,S,GAAY;AACjBpC,YAAUqC,oBAAUC,IAAV,CAAeC,UADR;AAEjBN,eAAaI,oBAAUG,MAFN;AAGjB5D,QAAMyD,oBAAUG,MAHC;AAIjB3D,aAAWwD,oBAAUI,MAJJ,EAIY;AAC7B3D,mBAAiBuD,oBAAUI,MALV,EAKkB;AACnC/D,OAAK2D,oBAAUI,MANE;AAOjB9D,OAAK0D,oBAAUI;AAPE,C;kBAFArE,a","file":"numberButton_input.js","sourcesContent":["/**\r\n * input + 数字键盘\r\n * @props {boolean} type \"positive\" 只支持正数,不传正负都可以\r\n * @props {number} max 最大值\r\n * @props {number} min 最小值\r\n */\r\n\r\nimport React, { Component } from 'react';\r\nimport { Input } from 'antd';\r\nimport { platform } from 'mutants-util';\r\nimport { env } from 'mutants-microfx';\r\nimport { Keyboard } from '../../index';\r\nimport PropTypes from 'prop-types';\r\nimport tools from '../../util/tools'\r\nimport Message from '../message/index'\r\nimport hotKey from '../hotKey'\r\n\r\nexport default class KeyboardInput extends Component {\r\n\r\n static propTypes = {\r\n onChange: PropTypes.func.isRequired,\r\n placeholder: PropTypes.string,\r\n type: PropTypes.string,\r\n maxLength: PropTypes.number, // 总长度\r\n precisionLength: PropTypes.number, // 小数总长\r\n max: PropTypes.number,\r\n min: PropTypes.number,\r\n }\r\n\r\n constructor(props) {\r\n super(props);\r\n this.props.onRef && this.props.onRef(this);\r\n this.state = {\r\n value: props.value || '',\r\n visible: false\r\n }\r\n const { isHorizontalPad } = platform || {};\r\n this.isMobileEnvironment = !!isHorizontalPad;\r\n this.setTimer = null;\r\n }\r\n\r\n componentDidMount() {\r\n this.setState({ value: this.props.value || '' })\r\n }\r\n\r\n componentDidUpdate(props_old, b) {\r\n if (props_old.visible != this.props.visible && this.props.visible == true) {\r\n this.setState({ value: this.props.value || '' })\r\n }\r\n }\r\n\r\n inputChange = (v) => {\r\n //对移动端键盘处理。\r\n this.handleMobileKeyboard();\r\n let newValue;\r\n if (v === '') {\r\n newValue = '';\r\n } else {\r\n //键盘大小控制\r\n const { max = {}, min = {}, type, maxLength, precisionLength } = this.props;\r\n if (!tools.isNull(max.value)) {\r\n if (v > max.value) {\r\n if (!tools.isNull(max.tip)) Message.info(max.tip);\r\n return;\r\n }\r\n }\r\n if (!tools.isNull(min.value)) {\r\n if (v < min.value) {\r\n if (!tools.isNull(min.tip)) Message.info(min.tip);\r\n return\r\n };\r\n }\r\n \r\n if (v.match(/\\./g) && v.match(/\\./g).length > 1) {\r\n return;\r\n }\r\n if (type == \"positive\") { // 只允许输入正数\r\n newValue = (v + '').match(/\\d+\\.?\\d*/);\r\n } else {\r\n newValue = (v + '').match(/^(\\-)?[(\\d*)|(\\d+\\.?\\d*)]*$/);\r\n }\r\n let length1 = maxLength ? parseInt(maxLength) : -1;\r\n let length2 = parseInt(precisionLength);\r\n if (length1 >= 0 && length2 >= 0) {\r\n let v = newValue[0] + '', v1, v2;\r\n if (v.indexOf('-') != -1) {\r\n v = v.slice(1, v.length);\r\n }\r\n v1 = v.split('.')[0];\r\n v2 = v.split('.')[1];\r\n if ((v1 && v1.length > (length1 - length2)) || (v2 && v2.length > length2) || (v1 && v1.length > (length1 - length2))) {\r\n return;\r\n }\r\n if (length2 == 0 && v.indexOf('.') > 0) { // 不允许小数的时候,也不允许小数点\r\n return;\r\n }\r\n }\r\n }\r\n this.setState({\r\n value: newValue && newValue[0] || ''\r\n }, () => {\r\n this.props.onChange && this.props.onChange(this.state.value);\r\n })\r\n }\r\n\r\n onChange = (key) => {\r\n //对移动端键盘处理。\r\n this.handleMobileKeyboard();\r\n const { max = {}, min = {}, handleOk, onChange, maxLength, precisionLength } = this.props;\r\n if (key == 'sure') {\r\n handleOk && handleOk(this.state.value);\r\n return;\r\n }\r\n let length1 = maxLength ? parseInt(maxLength) : -1;\r\n let length2 = parseInt(precisionLength);\r\n if (length2 == 0 && key == '.') {\r\n return;\r\n }\r\n let value = this.state.value + '';\r\n if (value == '' && key == '.') { // 不允许小数的时候,也不允许小数点\r\n return;\r\n }\r\n\r\n if ((value + '').indexOf('.') > 0 && key == '.') {\r\n return;\r\n }\r\n let newValue = Keyboard.getNewValue(this.input.input, value, key, true);\r\n //键盘大小控制\r\n if (!tools.isNull(max.value)) {\r\n if (newValue > max.value) {\r\n if (!tools.isNull(max.tip)) Message.info(max.tip);\r\n return;\r\n }\r\n }\r\n if (!tools.isNull(min.value)) {\r\n if (newValue < min.value) {\r\n if (!tools.isNull(min.tip)) Message.info(min.tip);\r\n return\r\n };\r\n }\r\n\r\n if (length1 && length2) {\r\n let v = newValue, v1, v2;\r\n if (newValue.indexOf('-') != -1) {\r\n v = newValue.slice(1, newValue.length);\r\n }\r\n v1 = v.split('.')[0];\r\n v2 = v.split('.')[1];\r\n if ((v1 && v1.length > (length1 - length2)) || (v2 && v2.length > length2) || (v1 && v1.length > (length1 - length2))) {\r\n return;\r\n }\r\n }\r\n this.setState({\r\n value: newValue\r\n }, () => {\r\n onChange && onChange(this.state.value);\r\n })\r\n }\r\n\r\n getValue = () => {\r\n return this.state.value;\r\n }\r\n\r\n //针对在移动端环境下,不需要系统键盘时的处理。\r\n handleMobileKeyboard = () => {\r\n let el = this.input && this.input.input;\r\n if (el && this.isMobileEnvironment && env.os !== env.constant.os.ios) {\r\n console.log('执行方法handleMobileKeyboard', el);\r\n if (!el.setAttribute || !el.removeAttribute) return;\r\n el.setAttribute('readonly', 'readonly');\r\n if (this.setTimer) window.clearTimeout(this.setTimer);\r\n this.setTimer = setTimeout(() => { el.removeAttribute('readonly') }, 200);\r\n }\r\n }\r\n\r\n onFocus = (e) => {\r\n this.handleMobileKeyboard()\r\n }\r\n\r\n render() {\r\n let { visible, value } = this.state;\r\n return (\r\n <div className='number-keyboard-input'>\r\n <Input\r\n className={hotKey.hotKeyNotFilter('keyboard-input')}\r\n style={{ marginBottom: '24px' }}\r\n placeholder={this.props.placeholder || ''}\r\n value={value}\r\n onChange={(e) => this.inputChange(e.target.value)}\r\n onFocus={this.onFocus}\r\n onClick={this.handleMobileKeyboard}\r\n onSelect={this.handleMobileKeyboard}\r\n ref={input => this.input = input} />\r\n\r\n <Keyboard\r\n type='number2'\r\n positive={this.props.type}\r\n onChange={this.onChange} />\r\n </div>\r\n )\r\n }\r\n}"]}
1
+ {"version":3,"sources":["tplus-components-touch/components/keyboard/numberButton_input.js"],"names":["KeyboardInput","props","inputChange","v","handleMobileKeyboard","newValue","max","min","type","maxLength","precisionLength","tools","isNull","value","tip","Message","info","match","length","length1","parseInt","length2","v1","v2","indexOf","slice","split","setState","onChange","state","key","handleOk","Keyboard","getNewValue","input","getValue","el","isMobileEnvironment","env","os","constant","ios","console","log","setAttribute","removeAttribute","setTimer","window","clearTimeout","setTimeout","onFocus","e","onRef","visible","platform","isHorizontalPad","props_old","b","hotKey","hotKeyNotFilter","marginBottom","placeholder","target","Component","propTypes","PropTypes","func","isRequired","string","number"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAA;;;;;;;;;AAOA;;;;AAEA;;AACA;;AACA;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;IAEqBA,a;;;AAYnB,yBAAYC,KAAZ,EAAmB;AAAA;;AAAA,oJACXA,KADW;;AAAA,UAsBnBC,WAtBmB,GAsBL,UAACC,CAAD,EAAO;AACnB;AACA,YAAKC,oBAAL;AACA,UAAIC,iBAAJ;AACA,UAAIF,MAAM,EAAV,EAAc;AACZE,mBAAW,EAAX;AACD,OAFD,MAEO;AACL;AADK,0BAE4D,MAAKJ,KAFjE;AAAA,0CAEGK,GAFH;AAAA,YAEGA,GAFH,mCAES,EAFT;AAAA,0CAEaC,GAFb;AAAA,YAEaA,GAFb,mCAEmB,EAFnB;AAAA,YAEuBC,IAFvB,eAEuBA,IAFvB;AAAA,YAE6BC,SAF7B,eAE6BA,SAF7B;AAAA,YAEwCC,eAFxC,eAEwCA,eAFxC;;AAGL,YAAI,CAACC,gBAAMC,MAAN,CAAaN,IAAIO,KAAjB,CAAL,EAA8B;AAC5B,cAAIV,IAAIG,IAAIO,KAAZ,EAAmB;AACjB,gBAAI,CAACF,gBAAMC,MAAN,CAAaN,IAAIQ,GAAjB,CAAL,EAA4BC,gBAAQC,IAAR,CAAaV,IAAIQ,GAAjB;AAC5B;AACD;AACF;AACD,YAAI,CAACH,gBAAMC,MAAN,CAAaL,IAAIM,KAAjB,CAAL,EAA8B;AAC5B,cAAIV,IAAII,IAAIM,KAAZ,EAAmB;AACjB,gBAAI,CAACF,gBAAMC,MAAN,CAAaL,IAAIO,GAAjB,CAAL,EAA4BC,gBAAQC,IAAR,CAAaT,IAAIO,GAAjB;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,IAAoB,EAA7B,EAAd;AACD;AACF;;AAkHD;;;;6BAgBS;AAAA;;AAAA,mBACkB,KAAKgB,KADvB;AAAA,UACDwB,OADC,UACDA,OADC;AAAA,UACQxC,KADR,UACQA,KADR;;AAEP,aACE;AAAA;AAAA,UAAK,WAAU,uBAAf;AACE;AACE,qBAAW6C,iBAAOC,eAAP,CAAuB,gBAAvB,CADb;AAEE,iBAAO,EAAEC,cAAc,MAAhB,EAFT;AAGE,uBAAa,KAAK3D,KAAL,CAAW4D,WAAX,IAA0B,EAHzC;AAIE,iBAAOhD,KAJT;AAKE,oBAAU,kBAACsC,CAAD;AAAA,mBAAO,OAAKjD,WAAL,CAAiBiD,EAAEW,MAAF,CAASjD,KAA1B,CAAP;AAAA,WALZ;AAME,mBAAS,KAAKqC,OANhB;AAOE,mBAAS,KAAK9C,oBAPhB;AAQE,oBAAU,KAAKA,oBARjB;AASE,eAAK;AAAA,mBAAS,OAAK8B,KAAL,GAAaA,KAAtB;AAAA;AATP,UADF;AAYE,sCAAC,eAAD;AACE,gBAAK,SADP;AAEE,oBAAU,KAAKjC,KAAL,CAAWO,IAFvB;AAGE,oBAAU,KAAKoB;AAHjB;AAZF,OADF;AAoBD;;;EAxLwCmC,gB,UAElCC,S,GAAY;AACjBpC,YAAUqC,oBAAUC,IAAV,CAAeC,UADR;AAEjBN,eAAaI,oBAAUG,MAFN;AAGjB5D,QAAMyD,oBAAUG,MAHC;AAIjB3D,aAAWwD,oBAAUI,MAJJ,EAIY;AAC7B3D,mBAAiBuD,oBAAUI,MALV,EAKkB;AACnC/D,OAAK2D,oBAAUI,MANE;AAOjB9D,OAAK0D,oBAAUI;AAPE,C;kBAFArE,a","file":"numberButton_input.js","sourcesContent":["/**\r\n * input + 数字键盘\r\n * @props {boolean} type \"positive\" 只支持正数,不传正负都可以\r\n * @props {number} max 最大值\r\n * @props {number} min 最小值\r\n */\r\n\r\nimport React, { Component } from 'react';\r\nimport { Input } from 'antd';\r\nimport { platform } from 'mutants-util';\r\nimport { env } from 'mutants-microfx';\r\nimport { Keyboard } from '../../index';\r\nimport PropTypes from 'prop-types';\r\nimport tools from '../../util/tools'\r\nimport Message from '../message/index'\r\nimport hotKey from '../hotKey'\r\n\r\nexport default class KeyboardInput extends Component {\r\n\r\n static propTypes = {\r\n onChange: PropTypes.func.isRequired,\r\n placeholder: PropTypes.string,\r\n type: PropTypes.string,\r\n maxLength: PropTypes.number, // 总长度\r\n precisionLength: PropTypes.number, // 小数总长\r\n max: PropTypes.number,\r\n min: PropTypes.number,\r\n }\r\n\r\n constructor(props) {\r\n super(props);\r\n this.props.onRef && this.props.onRef(this);\r\n this.state = {\r\n value: props.value || '',\r\n visible: false\r\n }\r\n const { isHorizontalPad } = platform || {};\r\n this.isMobileEnvironment = !!isHorizontalPad;\r\n this.setTimer = null;\r\n }\r\n\r\n componentDidMount() {\r\n this.setState({ value: this.props.value || '' })\r\n }\r\n\r\n componentDidUpdate(props_old, b) {\r\n if (props_old.visible != this.props.visible && this.props.visible == true) {\r\n this.setState({ value: this.props.value || '' })\r\n }\r\n }\r\n\r\n inputChange = (v) => {\r\n //对移动端键盘处理。\r\n this.handleMobileKeyboard();\r\n let newValue;\r\n if (v === '') {\r\n newValue = '';\r\n } else {\r\n //键盘大小控制\r\n const { max = {}, min = {}, type, maxLength, precisionLength } = this.props;\r\n if (!tools.isNull(max.value)) {\r\n if (v > max.value) {\r\n if (!tools.isNull(max.tip)) Message.info(max.tip);\r\n return;\r\n }\r\n }\r\n if (!tools.isNull(min.value)) {\r\n if (v < min.value) {\r\n if (!tools.isNull(min.tip)) Message.info(min.tip);\r\n return\r\n };\r\n }\r\n \r\n if (v.match(/\\./g) && v.match(/\\./g).length > 1) {\r\n return;\r\n }\r\n if (type == \"positive\") { // 只允许输入正数\r\n newValue = (v + '').match(/\\d+\\.?\\d*/);\r\n } else {\r\n newValue = (v + '').match(/^(\\-)?[(\\d*)|(\\d+\\.?\\d*)]*$/);\r\n }\r\n let length1 = maxLength ? parseInt(maxLength) : -1;\r\n let length2 = parseInt(precisionLength);\r\n if (length1 >= 0 && length2 >= 0) {\r\n let v = newValue[0] + '', v1, v2;\r\n if (v.indexOf('-') != -1) {\r\n v = v.slice(1, v.length);\r\n }\r\n v1 = v.split('.')[0];\r\n v2 = v.split('.')[1];\r\n if ((v1 && v1.length > (length1 - length2)) || (v2 && v2.length > length2) || (v1 && v1.length > (length1 - length2))) {\r\n return;\r\n }\r\n if (length2 == 0 && v.indexOf('.') > 0) { // 不允许小数的时候,也不允许小数点\r\n return;\r\n }\r\n }\r\n }\r\n this.setState({\r\n value: newValue && newValue[0] || ''\r\n }, () => {\r\n this.props.onChange && this.props.onChange(this.state.value);\r\n })\r\n }\r\n\r\n onChange = (key) => {\r\n //对移动端键盘处理。\r\n this.handleMobileKeyboard();\r\n const { max = {}, min = {}, handleOk, onChange, maxLength, precisionLength } = this.props;\r\n if (key == 'sure') {\r\n handleOk && handleOk(this.state.value);\r\n return;\r\n }\r\n let length1 = maxLength ? parseInt(maxLength) : -1;\r\n let length2 = parseInt(precisionLength);\r\n if (length2 == 0 && key == '.') {\r\n return;\r\n }\r\n let value = this.state.value + '';\r\n if (value == '' && key == '.') { // 不允许小数的时候,也不允许小数点\r\n return;\r\n }\r\n\r\n if ((value + '').indexOf('.') > 0 && key == '.') {\r\n return;\r\n }\r\n let newValue = Keyboard.getNewValue(this.input.input, value, key, true);\r\n //键盘大小控制\r\n if (!tools.isNull(max.value)) {\r\n if (newValue > max.value) {\r\n if (!tools.isNull(max.tip)) Message.info(max.tip);\r\n return;\r\n }\r\n }\r\n if (!tools.isNull(min.value)) {\r\n if (newValue < min.value) {\r\n if (!tools.isNull(min.tip)) Message.info(min.tip);\r\n return\r\n };\r\n }\r\n\r\n if (length1 && length2) {\r\n let v = newValue, v1, v2;\r\n if (newValue.indexOf('-') != -1) {\r\n v = newValue.slice(1, newValue.length);\r\n }\r\n v1 = v.split('.')[0];\r\n v2 = v.split('.')[1];\r\n if ((v1 && v1.length > (length1 - length2)) || (v2 && v2.length > length2) || (v1 && v1.length > (length1 - length2))) {\r\n return;\r\n }\r\n }\r\n this.setState({\r\n value: newValue\r\n }, () => {\r\n onChange && onChange(this.state.value);\r\n })\r\n }\r\n\r\n getValue = () => {\r\n return this.state.value;\r\n }\r\n\r\n //针对在移动端环境下,不需要系统键盘时的处理。\r\n handleMobileKeyboard = () => {\r\n let el = this.input && this.input.input;\r\n if (el && this.isMobileEnvironment && env.os !== env.constant.os.ios) {\r\n console.log('执行方法handleMobileKeyboard', el);\r\n if (!el.setAttribute || !el.removeAttribute) return;\r\n el.setAttribute('readonly', 'readonly');\r\n if (this.setTimer) window.clearTimeout(this.setTimer);\r\n this.setTimer = setTimeout(() => { el.removeAttribute('readonly') }, 200);\r\n }\r\n }\r\n\r\n onFocus = (e) => {\r\n this.handleMobileKeyboard()\r\n }\r\n\r\n render() {\r\n let { visible, value } = this.state;\r\n return (\r\n <div className='number-keyboard-input'>\r\n <Input\r\n className={hotKey.hotKeyNotFilter('keyboard-input')}\r\n style={{ marginBottom: '24px' }}\r\n placeholder={this.props.placeholder || ''}\r\n value={value}\r\n onChange={(e) => this.inputChange(e.target.value)}\r\n onFocus={this.onFocus}\r\n onClick={this.handleMobileKeyboard}\r\n onSelect={this.handleMobileKeyboard}\r\n ref={input => this.input = input} \r\n />\r\n <Keyboard\r\n type='number2'\r\n positive={this.props.type}\r\n onChange={this.onChange}\r\n />\r\n </div>\r\n )\r\n }\r\n}"]}
@@ -2,22 +2,22 @@
2
2
  @keyboard-font-color: #333;
3
3
  @themeColor: #FF8C25;
4
4
  .product-keyboarde-botton.letters-box {
5
-
6
- display: flex;
7
- justify-content: space-around;
8
- // min-width: 766px;
9
- position: relative;
10
- padding-top: 19px;
11
- background: rgba(0, 0, 0, .6);
5
+ height: 100%;
6
+ display: flex;
7
+ justify-content: space-around;
8
+ min-width: 766px;
9
+ position: relative;
10
+ padding-top: 19px;
11
+ background: rgba(0, 0, 0, .6);
12
12
  .letters {
13
13
  max-width: 680px;
14
14
  width:81%;
15
15
 
16
16
  .letters-line {
17
- height: 70px;
18
- width: 100%;
19
17
  overflow: hidden;
20
-
18
+ width: 100%;
19
+ height: 90px;
20
+
21
21
  .disabled {
22
22
  background: #999;
23
23
  }
@@ -36,7 +36,7 @@
36
36
  span {
37
37
  display: flex;
38
38
  height: 100%;
39
- font-size: 18px;
39
+ font-size: 20px !important;
40
40
  border-radius: 6px;
41
41
  flex-direction: column;
42
42
  justify-content: center;
@@ -57,12 +57,16 @@
57
57
  width: 100%;
58
58
 
59
59
  .num {
60
- height: 40px;
61
- margin: 0 0px 8px 0;
60
+ height: 58px;
61
+ line-height: 58px;
62
62
  max-width: 164px;
63
- padding: 0 12px;
64
- line-height: 40px;
65
63
  min-width: 33%;
64
+ margin: 0 0px 8px 0;
65
+ padding: 0 12px;
66
+
67
+ span{
68
+ font-size: 25px;
69
+ }
66
70
  }
67
71
  }
68
72
 
@@ -73,7 +77,6 @@
73
77
  .del {
74
78
  height: 35px;
75
79
  margin: 0 8px 8px 0;
76
-
77
80
  }
78
81
 
79
82
  .sure {
@@ -83,41 +86,37 @@
83
86
  }
84
87
 
85
88
  .key {
86
- max-width: 62px;
87
89
  width: 9%;
88
- height: 52px;
90
+ max-width: 62px;
91
+ height: 72px;
89
92
  box-sizing: border-box;
90
93
  float: left;
91
- padding: 0 4px;
92
94
  text-align: center;
93
95
  cursor: pointer;
94
96
  user-select: none;
95
- // border: 1px solid #FF8C25;
96
- // box-shadow: 0 2px 4px 0 rgba(242, 157, 14, 0.30);
97
- ;
98
97
  border-radius: 6px;
98
+ padding: 0 4px;
99
99
  span {
100
- display: flex;
101
100
  height: 100%;
102
- font-size: 18px;
103
- border-radius: 6px;
104
- flex-direction: column;
101
+ display: flex;
105
102
  justify-content: center;
103
+ flex-direction: column;
104
+ border-radius: 6px;
105
+ font-size: 25px;
106
106
  }
107
107
  }
108
108
 
109
109
  .handle {
110
110
  width: 54px;
111
+ font-size: 20px;
111
112
  .del {
112
- float: none;
113
113
  width: 54px;
114
- height: 52px;
114
+ height: 72px;
115
+ line-height: 72px;
115
116
  box-sizing: border-box;
116
117
  float: left;
117
118
  margin: 0 8px 18px 0;
118
119
  text-align: center;
119
- line-height: 52px;
120
- font-size: 18px;
121
120
  border-radius: 6px;
122
121
  cursor: pointer;
123
122
  user-select: none;
@@ -126,26 +125,22 @@
126
125
  justify-content: center;
127
126
  border-radius: 6px;
128
127
  }
129
- .clear {
130
- font-size: 16px;
131
- }
132
128
  }
133
129
  .is-number {
134
130
  .delete {
135
- height: 40px;
136
- line-height: 40px;
131
+ height: 62px;
132
+ line-height: 62px;
137
133
  margin: 0 8px 8px 0;
138
134
  }
139
135
  .clear {
140
- height: 40px;
141
- line-height: 40px;
136
+ height: 62px;
137
+ line-height: 62px;
142
138
  margin: 0 8px 8px 0;
143
139
  }
144
140
  .sure {
145
- height: 90px;
146
- line-height: 90px;
141
+ height: 116px;
142
+ line-height: 116px;
147
143
  }
148
-
149
144
  }
150
145
  .bold {
151
146
  font-weight: 700;
@@ -208,6 +208,8 @@ var _index2 = require('./prototypeTable/index');
208
208
 
209
209
  var _index3 = _interopRequireDefault(_index2);
210
210
 
211
+ var _tplusComponentsTouch = require('tplus-components-touch');
212
+
211
213
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
212
214
 
213
215
  var hasElectron = _mutantsMicrofx.env.platform === _mutantsMicrofx.env.constant.platform.electron;
@@ -5070,7 +5072,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
5070
5072
  _react2.default.createElement(
5071
5073
  'div',
5072
5074
  { className: 'djq2' },
5073
- (0, _map3.default)(currentMode && currentMode.djqs || [], function (q, index) {
5075
+ currentMode && currentMode.djqs && currentMode.djqs.length > 0 ? (0, _map3.default)(currentMode.djqs || [], function (q, index) {
5074
5076
  if (!_this8.state.couponLight && !q.count) {
5075
5077
  return;
5076
5078
  }
@@ -5180,7 +5182,10 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
5180
5182
  _react2.default.createElement('div', { className: 'point_top' }),
5181
5183
  _react2.default.createElement('div', { className: 'point_bottom' })
5182
5184
  );
5183
- })
5185
+ }) : _react2.default.createElement(_tplusComponentsTouch.ProgressState, {
5186
+ state: "empty"
5187
+ // stateCommonStyle={{ 'marginTop': "36px" }}
5188
+ , empty: { buttonVisible: false } })
5184
5189
  )
5185
5190
  ),
5186
5191
  currentMode && !currentMode.boriginReturn && _react2.default.createElement(