tplus-components-touch 3.36.1 → 3.36.2

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.
Files changed (51) hide show
  1. package/dist/components/billSearch/index.js +157 -19
  2. package/dist/components/billSearch/index.js.map +1 -1
  3. package/dist/components/billSearch/index.less +6 -3
  4. package/dist/components/cloudPrint/api.js +85 -43
  5. package/dist/components/cloudPrint/api.js.map +1 -1
  6. package/dist/components/cloudPrint/printDispatch.js +211 -108
  7. package/dist/components/cloudPrint/printDispatch.js.map +1 -1
  8. package/dist/components/deliverySearch/index.js +1 -1
  9. package/dist/components/deliverySearch/index.js.map +1 -1
  10. package/dist/components/hotKey/localConfig.js +133 -14
  11. package/dist/components/hotKey/localConfig.js.map +1 -1
  12. package/dist/components/inventorySearch/tab.js +77 -67
  13. package/dist/components/inventorySearch/tab.js.map +1 -1
  14. package/dist/components/keyboard/numberButton_input.js +4 -2
  15. package/dist/components/keyboard/numberButton_input.js.map +1 -1
  16. package/dist/components/keyboard/onlyLetterButton2.less +35 -40
  17. package/dist/components/loading/loadingContent.js +1 -1
  18. package/dist/components/loading/loadingContent.js.map +1 -1
  19. package/dist/components/loading/style.less +7 -7
  20. package/dist/components/modalWraper/index.js +1 -1
  21. package/dist/components/modalWraper/index.js.map +1 -1
  22. package/dist/components/progressState/EmptyAndErrorView.js +4 -3
  23. package/dist/components/progressState/EmptyAndErrorView.js.map +1 -1
  24. package/dist/components/progressState/ProgressState.js +2 -1
  25. package/dist/components/progressState/ProgressState.js.map +1 -1
  26. package/dist/components/settlement/index.js +9 -0
  27. package/dist/components/settlement/index.js.map +1 -1
  28. package/dist/components/settlement/moreCzkTable/index.js +156 -0
  29. package/dist/components/settlement/moreCzkTable/index.js.map +1 -0
  30. package/dist/components/settlement/moreCzkTable/style.less +7 -0
  31. package/dist/components/settlement/settlement.js +749 -501
  32. package/dist/components/settlement/settlement.js.map +1 -1
  33. package/dist/components/settlement/settlement.less +101 -10
  34. package/dist/components/settlement/settlementStore.js +1072 -463
  35. package/dist/components/settlement/settlementStore.js.map +1 -1
  36. package/dist/components/ticon/iconfont/demo_index.html +49 -3
  37. package/dist/components/ticon/iconfont/iconfont.css +11 -3
  38. package/dist/components/ticon/iconfont/iconfont.js +6 -6
  39. package/dist/components/ticon/iconfont/iconfont.js.map +1 -1
  40. package/dist/components/ticon/iconfont/iconfont.json +14 -0
  41. package/dist/components/ticon/iconfont/iconfont.ttf +0 -0
  42. package/dist/components/ticon/iconfont/iconfont.woff +0 -0
  43. package/dist/components/ticon/iconfont/iconfont.woff2 +0 -0
  44. package/dist/components/touchScroll/index.js +6 -2
  45. package/dist/components/touchScroll/index.js.map +1 -1
  46. package/dist/components/touchTable/index.js +5 -4
  47. package/dist/components/touchTable/index.js.map +1 -1
  48. package/dist/components/touchTable/index.less +20 -13
  49. package/dist/index.js +14 -2
  50. package/dist/index.js.map +1 -1
  51. package/package.json +35 -35
@@ -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","loadingIcon","theme","localStore","get","img","width","height","emptyHeight","setTableHeight","windowEvent","bind","window","addEventListener","removeEventListener","_this","setTimeout","Number","tabDom","clientHeight","tableHeight","dataSource","TotalPage","loading","searchDesigns","columns","map","item","OriginalTitle","FieldName","Precision","IsFormat","newItem","title","dataIndex","key","ellipsis","render","text","renderText","InventorySearchApi","formatNumber","tools","dateFormat","unshift","fixed","dom","length","y","spinning","indicator","onClick","info","buttonVisible","fontSize","React","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;AAEA;;AACA;;AACA;;AACA;;;;AACA;;;;;;IAGqBA,G,OADpBC,wB;;;AAEC,eAAYC,KAAZ,EAAmB;AAAA;;AAAA,iIACXA,KADW;;AAAA,WA0BnBC,UA1BmB,GA0BN,UAACC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,EAAtC;AAAA;AAAA,SAzBtC;AA0BE,sCAAC,WAAD;AACE,iBAAOhC,SADT;AAEE,wBAAc7B,UAFhB;AAGE,oBAAU,KAAKC,QAHjB;AAIE,gBAAM,KAAKK,IAJb;AAKE,qBAAU;AALZ;AA1BF,OADF;AAoCD;;;EA7J8BwD,gBAAMC,S;;kBAAlBzE,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\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 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 const columns = 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 return newItem;\r\n })\r\n // 周边门店 要显示门店名称\r\n if (type == '2') {\r\n columns.unshift({\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 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","ellipsis","render","text","map","item","OriginalTitle","FieldName","Precision","IsFormat","newItem","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,UA1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EAAEhB,QAAQ,MAAV,EAFpB;AAGE,iBAAO,EAAEuB,MAAM,QAAR,EAAkBC,eAAe,KAAjC,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,wBAAcnD,UAFhB;AAGE,oBAAU,KAAKC,QAHjB;AAIE,gBAAM,KAAKK,IAJb;AAKE,qBAAU;AALZ;AA1BF,OADF;AAoCD;;;EApK8BwD,gBAAMC,S;;kBAAlBzE,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 ellipsis: true, // 加上,否则鼠标悬浮无效\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') ? '4' : '3'}.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,I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AAUI,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,cAAI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olean} 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;
@@ -96,7 +96,7 @@ var LoaingContent = (_temp2 = _class = function (_Component) {
96
96
  _this.setState({ percent: percent, title: title });
97
97
  }, _this.getLoadingIcon = function () {
98
98
  var theme = _mutantsUtil.localStore.get('theme');
99
- var img = 'https://newretail.static.chanjet.com/bc_pos/loading' + (theme == 'blue' || theme == 'dark' ? '2' : '') + '.gif';
99
+ var img = 'https://newretail.static.chanjet.com/bc_pos/loading' + (theme == 'blue' || theme == 'dark' ? '4' : '3') + '.gif';
100
100
  return img;
101
101
  }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
102
102
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["tplus-components-touch/components/loading/loadingContent.js"],"names":["LoaingContent","state","closeAnimate","percent","title","readyClose","e","setState","setTimeout","close","stopPropagation","clearCloseTimer","props","onClose","startLoadingTimer","closeTimer","duration","clearTimeout","setPercent","params","getLoadingIcon","theme","localStore","get","img","style","text","node","className","target","delay","opacity","showProgress","showTip","tip","loadingNode","containerClass","trim","targetStyle","position","delayDuration","animation","WebkitAnimation","style2","Component","propTypes","PropTypes","string","object","element","func","number","defaultProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;AAEA;;AACA;;;;AACA;;;;IAEMA,a;;;;;;;;;;;;;;0NAkBJC,K,GAAQ;AACNC,oBAAc,KADR;AAENC,eAAS,CAFH;AAGNC,aAAO;AAHD,K,QAgBRC,U,GAAa,UAACC,CAAD,EAAO;AAClB,YAAKC,QAAL,CAAc,EAACL,cAAc,IAAf,EAAd,EAAoC,YAAM;AACxCM,mBAAW,YAAM;AACf,gBAAKC,KAAL;AACD,SAFD,EAEG,GAFH;AAGD,OAJD;AAKD,K,QAEDA,K,GAAQ,UAACH,CAAD,EAAO;AACb,UAAIA,CAAJ,EAAO;AACLA,UAAEI,eAAF;AACD;AACD,YAAKC,eAAL;AACA,YAAKC,KAAL,CAAWC,OAAX;AACD,K,QAEDC,iB,GAAoB,YAAM;AACxB,YAAKC,UAAL,GAAkBP,WAAW,YAAM;AACjC,cAAKH,UAAL;AACD,OAFiB,EAEf,MAAKO,KAAL,CAAWI,QAFI,CAAlB;AAGD,K,QAEDL,e,GAAkB,YAAM;AACtB,UAAI,MAAKI,UAAT,EAAqB;AACnBE,qBAAa,MAAKF,UAAlB;AACA,cAAKA,UAAL,GAAkB,IAAlB;AACD;AACF,K,QAEDG,U,GAAa,UAACC,MAAD,EAAY;AAAA,UACfhB,OADe,GACIgB,MADJ,CACfhB,OADe;AAAA,UACNC,KADM,GACIe,MADJ,CACNf,KADM;;AAEvB,YAAKG,QAAL,CAAc,EAAEJ,gBAAF,EAAWC,YAAX,EAAd;AACD,K,QAEDgB,c,GAAiB,YAAM;AACrB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lC,eAAe,uBAAf,GAAyC,EAA1D,UAAgE0B,SAAhE,EAA4ES,IAA5E,EAAvB;AACA,UAAMC,cAAcT,SAAS,EAACU,UAAU,UAAX,EAAT,GAAkC,EAAtD;AACA,UAAMC,gBAAgBV,QAAQ,EAACW,wCAAsCX,KAAtC,OAAD,EAAkDY,8CAA4CZ,KAA5C,OAAlD,EAAR,GAAmH,EAAzI;AACA,UAAMa,SAASZ,UAAU,EAAE,8CAA4CA,OAA5C,MAAF,EAAV,GAAuE,EAAtF;AACA,aACE;AAAA;AAAA,UAAK,WAAWK,cAAhB,EAAgC,OAAO,sBAAcE,WAAd,EAA2BE,aAA3B,EAA0Cf,KAA1C,EAAiDkB,MAAjD,CAAvC;AACE;AAAA;AAAA,YAAK,sCAAmCX,iBAAiB,IAAjB,GAAwB,yBAAxB,GAAoD,EAAvF,CAAL;AACG,qCAAeL,IAAf,IAAuBA,IAAvB,GAA8BQ;AADjC;AADF,OADF;AAOD;;;EA3GyBS,gB,UACnBC,S,GAAY;AACjBnB,QAAMoB,oBAAUC,MADC;AAEjBnB,aAAWkB,oBAAUC,MAFJ;AAGjBtB,SAAOqB,oBAAUE,MAHA;AAIjBrB,QAAMmB,oBAAUG,OAJC;AAKjBpC,WAASiC,oBAAUI,IALF;AAMjBlC,YAAU8B,oBAAUK,MANH;AAOjBtB,UAAQiB,oBAAUC;AAPD,C,SAUZK,Y,GAAe;AACpBvC,SADoB,qBACV,CAAE,CADQ;;AAEpBe,aAAW,EAFS;AAGpBH,SAAO,EAHa;AAIpBC,QAAM;AAJc,C;kBAmGT1B,a","file":"loadingContent.js","sourcesContent":["import React, {Component, Fragment, isValidElement} from 'react';\r\nimport { Progress } from 'antd';\r\nimport { localStore } from 'mutants-util';\r\nimport PropTypes from 'prop-types';\r\nimport './style.less';\r\n\r\nclass LoaingContent extends Component {\r\n static propTypes = {\r\n text: PropTypes.string,\r\n className: PropTypes.string,\r\n style: PropTypes.object,\r\n node: PropTypes.element,\r\n onClose: PropTypes.func,\r\n duration: PropTypes.number,\r\n target: PropTypes.string\r\n };\r\n\r\n static defaultProps = {\r\n onClose() {},\r\n className: '',\r\n style: {},\r\n text: '加载中,请稍后...',\r\n };\r\n\r\n state = {\r\n closeAnimate: false,\r\n percent: 0,\r\n title: ''\r\n };\r\n\r\n componentDidMount() {\r\n if (typeof this.props.duration === 'number') {\r\n this.startLoadingTimer();\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n this.clearCloseTimer();\r\n }\r\n\r\n readyClose = (e) => {\r\n this.setState({closeAnimate: true}, () => {\r\n setTimeout(() => {\r\n this.close();\r\n }, 250)\r\n })\r\n }\r\n\r\n close = (e) => {\r\n if (e) {\r\n e.stopPropagation();\r\n }\r\n this.clearCloseTimer();\r\n this.props.onClose();\r\n }\r\n\r\n startLoadingTimer = () => {\r\n this.closeTimer = setTimeout(() => {\r\n this.readyClose();\r\n }, this.props.duration);\r\n }\r\n\r\n clearCloseTimer = () => {\r\n if (this.closeTimer) {\r\n clearTimeout(this.closeTimer);\r\n this.closeTimer = null;\r\n }\r\n }\r\n\r\n setPercent = (params) => {\r\n const { percent, title } = params\r\n this.setState({ percent, title })\r\n }\r\n\r\n getLoadingIcon = () => {\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 img;\r\n }\r\n\r\n render() {\r\n const { style, text, node, className, target, delay, opacity, showProgress } = this.props;\r\n const { closeAnimate, percent, title } = this.state;\r\n const showTip = text !== false;\r\n const tip = opacity ? 'tplus-loading-tip-color' : '';\r\n const loadingNode = (\r\n <Fragment>\r\n <div className='tplus-loading-spinner'>\r\n {\r\n showProgress === true ?\r\n <Progress strokeLinecap=\"square\" percent={percent} />\r\n :\r\n <div className='shadows'>\r\n <img src={this.getLoadingIcon()} className='default-spinner-gif' />\r\n </div>\r\n }\r\n </div>\r\n {\r\n showTip && <p className={`tplus-loading-tip ${tip}`}>{showProgress === true ? `档案数据【${title}】下载中` : text}</p>\r\n }\r\n </Fragment>\r\n );\r\n const containerClass = `tplus-loading ${closeAnimate ? 'loading-close-animate' : ''} ${className}`.trim();\r\n const targetStyle = target ? {position: 'absolute'} : {};\r\n const delayDuration = delay ? {animation: `loading-delay-animation ${delay}ms`, WebkitAnimation: `loading-delay-animation ${delay}ms`} : {};\r\n const style2 = opacity ? { 'background-color': `rgba(2555, 255, 255, ${opacity})` } : {};\r\n return (\r\n <div className={containerClass} style={Object.assign(targetStyle, delayDuration, style, style2)}>\r\n <div className={`tplus-loading-content${showProgress === true ? ' tplus-loading-progress' : ''}`}>\r\n {isValidElement(node) ? node : loadingNode}\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n\r\nexport default LoaingContent;\r\n"]}
1
+ {"version":3,"sources":["tplus-components-touch/components/loading/loadingContent.js"],"names":["LoaingContent","state","closeAnimate","percent","title","readyClose","e","setState","setTimeout","close","stopPropagation","clearCloseTimer","props","onClose","startLoadingTimer","closeTimer","duration","clearTimeout","setPercent","params","getLoadingIcon","theme","localStore","get","img","style","text","node","className","target","delay","opacity","showProgress","showTip","tip","loadingNode","containerClass","trim","targetStyle","position","delayDuration","animation","WebkitAnimation","style2","Component","propTypes","PropTypes","string","object","element","func","number","defaultProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;AAEA;;AACA;;;;AACA;;;;IAEMA,a;;;;;;;;;;;;;;0NAkBJC,K,GAAQ;AACNC,oBAAc,KADR;AAENC,eAAS,CAFH;AAGNC,aAAO;AAHD,K,QAgBRC,U,GAAa,UAACC,CAAD,EAAO;AAClB,YAAKC,QAAL,CAAc,EAACL,cAAc,IAAf,EAAd,EAAoC,YAAM;AACxCM,mBAAW,YAAM;AACf,gBAAKC,KAAL;AACD,SAFD,EAEG,GAFH;AAGD,OAJD;AAKD,K,QAEDA,K,GAAQ,UAACH,CAAD,EAAO;AACb,UAAIA,CAAJ,EAAO;AACLA,UAAE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B,oBAAUC,MAFJ;AAGjBtB,SAAOqB,oBAAUE,MAHA;AAIjBrB,QAAMmB,oBAAUG,OAJC;AAKjBpC,WAASiC,oBAAUI,IALF;AAMjBlC,YAAU8B,oBAAUK,MANH;AAOjBtB,UAAQiB,oBAAUC;AAPD,C,SAUZK,Y,GAAe;AACpBvC,SADoB,qBACV,CAAE,CADQ;;AAEpBe,aAAW,EAFS;AAGpBH,SAAO,EAHa;AAIpBC,QAAM;AAJc,C;kBAmGT1B,a","file":"loadingContent.js","sourcesContent":["import React, {Component, Fragment, isValidElement} from 'react';\r\nimport { Progress } from 'antd';\r\nimport { localStore } from 'mutants-util';\r\nimport PropTypes from 'prop-types';\r\nimport './style.less';\r\n\r\nclass LoaingContent extends Component {\r\n static propTypes = {\r\n text: PropTypes.string,\r\n className: PropTypes.string,\r\n style: PropTypes.object,\r\n node: PropTypes.element,\r\n onClose: PropTypes.func,\r\n duration: PropTypes.number,\r\n target: PropTypes.string\r\n };\r\n\r\n static defaultProps = {\r\n onClose() {},\r\n className: '',\r\n style: {},\r\n text: '加载中,请稍后...',\r\n };\r\n\r\n state = {\r\n closeAnimate: false,\r\n percent: 0,\r\n title: ''\r\n };\r\n\r\n componentDidMount() {\r\n if (typeof this.props.duration === 'number') {\r\n this.startLoadingTimer();\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n this.clearCloseTimer();\r\n }\r\n\r\n readyClose = (e) => {\r\n this.setState({closeAnimate: true}, () => {\r\n setTimeout(() => {\r\n this.close();\r\n }, 250)\r\n })\r\n }\r\n\r\n close = (e) => {\r\n if (e) {\r\n e.stopPropagation();\r\n }\r\n this.clearCloseTimer();\r\n this.props.onClose();\r\n }\r\n\r\n startLoadingTimer = () => {\r\n this.closeTimer = setTimeout(() => {\r\n this.readyClose();\r\n }, this.props.duration);\r\n }\r\n\r\n clearCloseTimer = () => {\r\n if (this.closeTimer) {\r\n clearTimeout(this.closeTimer);\r\n this.closeTimer = null;\r\n }\r\n }\r\n\r\n setPercent = (params) => {\r\n const { percent, title } = params\r\n this.setState({ percent, title })\r\n }\r\n\r\n getLoadingIcon = () => {\r\n const theme = localStore.get('theme');\r\n const img = `https://newretail.static.chanjet.com/bc_pos/loading${(theme == 'blue' || theme == 'dark') ? '4' : '3'}.gif`;\r\n return img;\r\n }\r\n\r\n render() {\r\n const { style, text, node, className, target, delay, opacity, showProgress } = this.props;\r\n const { closeAnimate, percent, title } = this.state;\r\n const showTip = text !== false;\r\n const tip = opacity ? 'tplus-loading-tip-color' : '';\r\n const loadingNode = (\r\n <Fragment>\r\n <div className='tplus-loading-spinner'>\r\n {\r\n showProgress === true ?\r\n <Progress strokeLinecap=\"square\" percent={percent} />\r\n :\r\n <div className='shadows'>\r\n <img src={this.getLoadingIcon()} className='default-spinner-gif' />\r\n </div>\r\n }\r\n </div>\r\n {\r\n showTip && <p className={`tplus-loading-tip ${tip}`}>{showProgress === true ? `档案数据【${title}】下载中` : text}</p>\r\n }\r\n </Fragment>\r\n );\r\n const containerClass = `tplus-loading ${closeAnimate ? 'loading-close-animate' : ''} ${className}`.trim();\r\n const targetStyle = target ? {position: 'absolute'} : {};\r\n const delayDuration = delay ? {animation: `loading-delay-animation ${delay}ms`, WebkitAnimation: `loading-delay-animation ${delay}ms`} : {};\r\n const style2 = opacity ? { 'background-color': `rgba(2555, 255, 255, ${opacity})` } : {};\r\n return (\r\n <div className={containerClass} style={Object.assign(targetStyle, delayDuration, style, style2)}>\r\n <div className={`tplus-loading-content${showProgress === true ? ' tplus-loading-progress' : ''}`}>\r\n {isValidElement(node) ? node : loadingNode}\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n\r\nexport default LoaingContent;\r\n"]}
@@ -26,13 +26,13 @@
26
26
  height: 90px;
27
27
  }
28
28
  .shadows{
29
- width: 90px;
30
- height: 90px;
31
- border-radius: 50%;
32
- display: flex;
33
- align-items: center;
34
- justify-content: center;
35
- box-shadow: 0px 0px 15px 5px rgba(51, 51, 51, 0.08);
29
+ // width: 90px;
30
+ // height: 90px;
31
+ // border-radius: 50%;
32
+ // display: flex;
33
+ // align-items: center;
34
+ // justify-content: center;
35
+ // box-shadow: 0px 0px 15px 5px rgba(51, 51, 51, 0.08);
36
36
  }
37
37
  }
38
38
  .tplus-loading-tip{
@@ -108,7 +108,7 @@ var ModalWraper = (_temp = _class = function (_React$Component) {
108
108
  if (_this.isHorizontalPad) return;
109
109
  // let doms = document.getElementsByClassName('app hot-key-focus-container')
110
110
  var input = document.getElementById('productPoint');
111
- if (input) setTimeout(function () {
111
+ if (!_this.props.isNotAutoFocus && input) setTimeout(function () {
112
112
  {
113
113
  console.log('ModalWraper--商品焦点==Focus==');input.focus();
114
114
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["tplus-components-touch/components/modalWraper/index.js"],"names":["map","ModalWraper","props","context","state","modalIndex","hasShow","setInventoryFocus","isHorizontalPad","input","document","getElementById","setTimeout","console","log","focus","onHide","cancel","onExited","platform","modalCount","setState","modalType","className","title","memberClass","footer","ok","position","closeButton","okText","show","check","header","reqfooter","backdropStyle","cancelable","okable","exclueBoard","centered","vertical","isShowCheck","isChecked","checkedCount","checkBoxEvent","pickupChecked","maskClosable","backdropClosable","typeClass","alignClass","backgroundColor","event","target","checked","btnDissabled","children","content","onOk","once","onCancel","icon","wrapperControl","rest","controls","mask","backdrop","modal","confirm","warning","success","error","info","zIndex","React","Component","propTypes","PropTypes","string","oneOfType","element","array","bool","func","defaultProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAA;;;;;;;;;;;;;;;;;;;;AAYA;;;;AACA;;;;AACA;;;;AAEA;;AACA;;AACA;;;;AACA,IAAMA,MAAM;AACV,SAAO,WADG;AAEV,SAAO,WAFG;AAGV,WAAS,UAHC;AAIV,YAAU;AAJA,CAAZ;IAMqBC,W;;;AACnB,uBAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,gJACpBD,KADoB,EACbC,OADa;;AAAA,U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CAJS;AAKjBjD,QAAM6C,oBAAUK,IALC;AAMjBhE,UAAQ2D,oBAAUM,IAND;AAOjBlE,UAAQ4D,oBAAUM,IAPD;AAQjBvD,MAAIiD,oBAAUM,IARG;AASjBtD,YAAUgD,oBAAUC,MATH;AAUjB/C,UAAQ8C,oBAAUC,MAVD;AAWjBtB,YAAUqB,oBAAUG,OAXH;AAYjB7C,aAAW0C,oBAAUK,IAZJ;AAajB7C,cAAYwC,oBAAUK,IAbL;AAcjB5C,UAAQuC,oBAAUK,IAdD;AAejB3C,eAAasC,oBAAUK,IAfN;AAgBjBzC,YAAUoC,oBAAUK;AAhBH,C,SAmBZE,Y,GAAe;AACpB7D,aAAW,OADS;AAEpBC,aAAW,EAFS;AAGpBC,SAAO,EAHa;AAIpBI,YAAU,EAJU;AAKpBC,eAAa,IALO;AAMpBC,UAAQ,IANY;AAOpBI,aAAW,IAPS;AAQpBE,cAAY,IARQ;AASpBC,UAAQ;AATY,C,SA0GfjB,U,GAAa,C;kBApIDnB,W","file":"index.js","sourcesContent":["/*\r\nclassName :添加类名\r\n modalType: 大 中 小 最大(map)\r\n title :\r\n footer:底部按钮\r\n ok:确定方法\r\n cancel:取消方法\r\n exclueBoard: boolean 去除键盘居中\r\n vertical: boolean 是否为竖屏\r\n wrapperControl: 启用外部控制,控制用法如下 confirm 描述\r\n 在 confirm 类型的模态框中的 onOk 事件返回false时不会关闭弹窗,如果为异步时返回一个promise,通过resolve状态关闭控制(暂时只在vertical为true时生效)\r\n*/\r\nimport Ticon from '../ticon'\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Checkbox, Button, Modal } from 'antd';\r\nimport { platform } from 'mutants-util';\r\nimport { verticalContainer, handleOnOk, handleOnCancel } from './utils';\r\nimport './style.less'\r\nconst map = {\r\n 'big': 'big-modal',\r\n 'mid': 'mid-modal',\r\n 'small': 'sm-modal',\r\n 'bigger': 'bigger-modal'\r\n}\r\nexport default class ModalWraper extends React.Component {\r\n constructor(props, context) {\r\n super(props, context)\r\n const { isHorizontalPad } = platform || {};\r\n this.isHorizontalPad = !!isHorizontalPad;\r\n }\r\n\r\n static propTypes = {\r\n modalType: PropTypes.string,\r\n className: PropTypes.string,\r\n title: PropTypes.string,\r\n footer: PropTypes.oneOfType([PropTypes.element, PropTypes.array]),\r\n show: PropTypes.bool,\r\n cancel: PropTypes.func,\r\n onHide: PropTypes.func,\r\n ok: PropTypes.func,\r\n position: PropTypes.string,\r\n okText: PropTypes.string,\r\n children: PropTypes.element,\r\n reqfooter: PropTypes.bool,\r\n cancelable: PropTypes.bool,\r\n okable: PropTypes.bool,\r\n exclueBoard: PropTypes.bool,\r\n vertical: PropTypes.bool,\r\n }\r\n\r\n static defaultProps = {\r\n modalType: 'small',\r\n className: '',\r\n title: '',\r\n position: '',\r\n closeButton: true,\r\n okText: '确定',\r\n reqfooter: true,\r\n cancelable: true,\r\n okable: true\r\n }\r\n\r\n static confirm(props) {\r\n const { content, className, onOk, once, onCancel, icon, wrapperControl, ...rest } = props;\r\n const controls = wrapperControl ? {} : { onOk, onCancel };\r\n rest.mask = rest.backdrop || false;\r\n const modal = Modal.confirm({\r\n ...rest,\r\n ...controls,\r\n mask: true,\r\n icon: null,\r\n className: `method-modal1 vertical-modal-wrapper ${className} ${verticalContainer(props)}`,\r\n content: (<div className='content1'>\r\n <div className='content-box'>\r\n {(typeof icon === 'boolean' && !icon) ? null :\r\n <Ticon type='jingshishang' className='method-modal-ticon ticon-confirm' />\r\n }\r\n {content}\r\n </div>\r\n {wrapperControl && <div className=\"modal-footer-container\">\r\n <Button\r\n onClick={() => handleOnCancel(onCancel, modal)}\r\n >取消</Button>\r\n <Button\r\n type='primary'\r\n onClick={() => handleOnOk(onOk, modal, once)}\r\n >确定</Button>\r\n </div>}\r\n </div>)\r\n });\r\n\r\n return modal;\r\n }\r\n\r\n static warning(props) {\r\n const { content, className, ...rest } = props;\r\n rest.mask = rest.backdrop || false;\r\n Modal.warning({\r\n ...rest,\r\n icon: null,\r\n className: `method-modal1 vertical-modal-wrapper ${className} ${verticalContainer(props)}`,\r\n content: (<div className='content1'>\r\n <Ticon type='zhongxingxia' className='method-modal-ticon ticon-info' />\r\n {content}\r\n </div>)\r\n })\r\n }\r\n\r\n static success(props) {\r\n const { content, className, ...rest } = props;\r\n rest.mask = rest.backdrop || false;\r\n Modal.success({\r\n ...rest,\r\n icon: null,\r\n className: `method-modal1 vertical-modal-wrapper ${className} ${verticalContainer(props)}`,\r\n content: (<div className='content1'>\r\n <Ticon type='zhongxingxia' className='method-modal-ticon ticon-info' />\r\n {content}\r\n </div>)\r\n })\r\n }\r\n\r\n static error(props) {\r\n const { content, className, ...rest } = props;\r\n rest.mask = rest.backdrop || false;\r\n Modal.error({\r\n ...rest,\r\n icon: null,\r\n className: `method-modal1 vertical-modal-wrapper ${className} ${verticalContainer(props)}`,\r\n content: (<div className='content1'>\r\n <Ticon type='zhongxingxia' className='method-modal-ticon ticon-info' />\r\n {content}\r\n </div>)\r\n })\r\n }\r\n\r\n static info(props) {\r\n const { content, className, ...rest } = props;\r\n rest.mask = rest.backdrop || false;\r\n Modal.info({\r\n ...rest,\r\n icon: null,\r\n zIndex: 1010,\r\n className: `method-modal1 vertical-modal-wrapper ${className} ${verticalContainer(props)}`,\r\n content: (<div className='content1'>\r\n <Ticon type='zhongxingxia' className='method-modal-ticon ticon-info' />\r\n {content}\r\n </div>)\r\n })\r\n }\r\n\r\n state = {\r\n modalIndex: 0,\r\n hasShow: false\r\n }\r\n\r\n static modalCount = 0;\r\n\r\n static getDerivedStateFromProps(props, state) {\r\n if (props.show && !state.hasShow) {\r\n return {\r\n hasShow: true,\r\n modalIndex: (ModalWraper.modalCount++)\r\n }\r\n }\r\n if (!props.show && state.hasShow) {\r\n return {\r\n hasShow: false,\r\n modalIndex: (ModalWraper.modalCount--)\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n // componentDidMount() {\r\n // console.log('modalWraper-compontentDidMount==Focus==',this.state.hasShow)\r\n // if (!this.state.hasShow) return\r\n // setTimeout(() => { this.handleLaterRender() }, 300)\r\n // }\r\n\r\n componentWillUnmount() {\r\n if (ModalWraper.modalCount > 0 && this.state.hasShow) {\r\n this.setState({ hasShow: false, modalIndex: (ModalWraper.modalCount--) });\r\n this.setInventoryFocus();\r\n }\r\n }\r\n\r\n /**\r\n * 模态框关闭时,强制设定商品录入框焦点\r\n */\r\n setInventoryFocus = () => {\r\n if (this.isHorizontalPad) return;\r\n // let doms = document.getElementsByClassName('app hot-key-focus-container')\r\n let input = document.getElementById('productPoint');\r\n if (input) setTimeout(() => { {console.log('ModalWraper--商品焦点==Focus=='); input.focus() } }, 300)\r\n }\r\n\r\n /**\r\n * 页面渲染结束之后,焦点给到第一个input框。并绑定input事件,支持回车切换焦点。\r\n */\r\n // handleLaterRender = () => {\r\n // if (this.isHorizontalPad) return;\r\n // let list = $.find_element('input textarea');\r\n // if (list && list.length > 0) {\r\n // let input = list.find(v => v.type == 'text' || v.type == 'textarea')\r\n // if (input && input != document.activeElement) {\r\n // let val = input.value;\r\n // console.log('modalWraper--input==Focus==');\r\n // input.value = ''; input.focus(); input.click(); input.value = val;\r\n // }\r\n // }\r\n // }\r\n\r\n onHide = () => {\r\n let { onHide, cancel } = this.props;\r\n if (onHide) {\r\n onHide();\r\n } else {\r\n cancel && cancel()\r\n }\r\n this.setInventoryFocus();\r\n }\r\n\r\n // onEntered = () => {\r\n // setTimeout(() => { this.handleLaterRender() }, 300)\r\n // }\r\n\r\n onExited = () => {\r\n this.setInventoryFocus();\r\n }\r\n\r\n render() {\r\n let {\r\n modalType,\r\n className,\r\n title,\r\n memberClass,\r\n footer,\r\n cancel,\r\n ok,\r\n position,\r\n closeButton,\r\n okText,\r\n show,\r\n check,\r\n header,\r\n reqfooter,\r\n backdropStyle = {},\r\n onHide,\r\n cancelable,\r\n okable,\r\n exclueBoard = false,\r\n centered = true,\r\n vertical,\r\n ...props\r\n } = this.props;\r\n const { modalIndex, hasShow } = this.state;\r\n //针对Pad移动端\r\n centered = !this.isHorizontalPad;\r\n //针对全选的处理。\r\n let { isShowCheck, isChecked, checkedCount, checkBoxEvent,pickupChecked } = check || {};\r\n props.maskClosable = props.backdropClosable || false;\r\n let typeClass = map[modalType] ? map[modalType] : map['small'];\r\n let alignClass = exclueBoard ? 'modal-centre' : '';\r\n alignClass = this.isHorizontalPad ? '' : alignClass;\r\n if (modalIndex > 0) {\r\n backdropStyle = {\r\n ...backdropStyle,\r\n backgroundColor: 'rgba(0,0,0, 0)'\r\n };\r\n }\r\n return (\r\n <Modal\r\n wrapClassName={`modal-formated ${alignClass} ${className} ${position} ${typeClass} ${verticalContainer(this.props)} ${memberClass && memberClass}`}\r\n onCancel={this.onHide}\r\n // onEntered={this.onEntered}\r\n afterClose={this.onExited}\r\n visible={hasShow}\r\n maskStyle={backdropStyle}\r\n centered={centered}\r\n {...props}\r\n title={header ? header: title}\r\n closable={closeButton}\r\n destroyOnClose={true}\r\n footer={reqfooter ? footer ? footer :\r\n <div className='footer'>\r\n <div className='check'>\r\n {isShowCheck && <Checkbox checked={pickupChecked ? pickupChecked : isChecked} onChange={pickupChecked ? null : event => checkBoxEvent(0, event.target.checked)}>全选({checkedCount})</Checkbox>}\r\n </div>\r\n <div className='btn'>\r\n {cancelable && <Button onClick={() => { cancel && cancel() }}>取消</Button>}\r\n {okable && <Button disabled={this.props.btnDissabled} type='primary' onClick={() => { ok && ok() }}>{okText}</Button>}\r\n </div>\r\n </div> : null}\r\n >\r\n {this.props.children}\r\n </Modal>\r\n )\r\n }\r\n}"]}
1
+ {"version":3,"sources":["tplus-components-touch/components/modalWraper/index.js"],"names":["map","ModalWraper","props","context","state","modalIndex","hasShow","setInventoryFocus","isHorizontalPad","input","document","getElementById","isNotAutoFocus","setTimeout","console","log","focus","onHide","cancel","onExited","platform","modalCount","setState","modalType","className","title","memberClass","footer","ok","position","closeButton","okText","show","check","header","reqfooter","backdropStyle","cancelable","okable","exclueBoard","centered","vertical","isShowCheck","isChecked","checkedCount","checkBoxEvent","pickupChecked","maskClosable","backdropClosable","typeClass","alignClass","backgroundColor","event","target","checked","btnDissabled","children","content","onOk","once","onCancel","icon","wrapperControl","rest","controls","mask","backdrop","modal","confirm","warning","success","error","info","zIndex","React","Component","propTypes","PropTypes","string","oneOfType","element","array","bool","func","defaultProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAA;;;;;;;;;;;;;;;;;;;;AAYA;;;;AACA;;;;AACA;;;;AAEA;;AACA;;AACA;;;;AACA,IAAMA,MAAM;AACV,SAAO,WADG;AAEV,SAAO,WAFG;AAGV,WAAS,UAHC;AAIV,YAAU;AAJA,CAAZ;IAMqBC,W;;;AACnB,uBAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,gJACpBD,KADoB,EACbC,OADa;;AAAA,UA8H5BC,KA9H4B,GA8HpB;AACNC,kBAAY,CADN;AAENC,eAAS;AAFH,KA9HoB;;AAAA,UAqK5BC,iBArK4B,GAqKR,YAAM;AACxB,UAAI,MAAKC,eAAT,EAA0B;AAC1B;AACA,UAAIC,QAAQC,SAASC,cAAT,CAAwB,cAAxB,CAAZ;AACA,UAAI,CAAC,MAAKT,KAAL,CAAWU,cAAZ,IAA8BH,KAAlC,EAAyCI,WAAW,YAAM;AAAE;AAACC,kBAAQC,GAAR,CAAY,4BAAZ,EAA2CN,MAAMO,KAAN;AAAe;AAAE,OAAhF,EAAkF,GAAlF;AAC1C,KA1K2B;;AAAA,UA4L5BC,MA5L4B,GA4LnB,YAAM;AAAA,wBACY,MAAKf,KADjB;AAAA,UACPe,MADO,eACPA,MADO;AAAA,UACCC,MADD,eACCA,MADD;;AAEb,UAAID,MAAJ,EAAY;AACVA;AACD,OAFD,MAEO;AACLC,kBAAUA,QAAV;AACD;AACD,YAAKX,iBAAL;AACD,KApM2B;;AAAA,UA0M5BY,QA1M4B,GA0MjB,YAAM;AACf,YAAKZ,iBAAL;AACD,KA5M2B;;AAAA,eAEEa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assName :添加类名\r\n modalType: 大 中 小 最大(map)\r\n title :\r\n footer:底部按钮\r\n ok:确定方法\r\n cancel:取消方法\r\n exclueBoard: boolean 去除键盘居中\r\n vertical: boolean 是否为竖屏\r\n wrapperControl: 启用外部控制,控制用法如下 confirm 描述\r\n 在 confirm 类型的模态框中的 onOk 事件返回false时不会关闭弹窗,如果为异步时返回一个promise,通过resolve状态关闭控制(暂时只在vertical为true时生效)\r\n*/\r\nimport Ticon from '../ticon'\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Checkbox, Button, Modal } from 'antd';\r\nimport { platform } from 'mutants-util';\r\nimport { verticalContainer, handleOnOk, handleOnCancel } from './utils';\r\nimport './style.less'\r\nconst map = {\r\n 'big': 'big-modal',\r\n 'mid': 'mid-modal',\r\n 'small': 'sm-modal',\r\n 'bigger': 'bigger-modal'\r\n}\r\nexport default class ModalWraper extends React.Component {\r\n constructor(props, context) {\r\n super(props, context)\r\n const { isHorizontalPad } = platform || {};\r\n this.isHorizontalPad = !!isHorizontalPad;\r\n }\r\n\r\n static propTypes = {\r\n modalType: PropTypes.string,\r\n className: PropTypes.string,\r\n title: PropTypes.string,\r\n footer: PropTypes.oneOfType([PropTypes.element, PropTypes.array]),\r\n show: PropTypes.bool,\r\n cancel: PropTypes.func,\r\n onHide: PropTypes.func,\r\n ok: PropTypes.func,\r\n position: PropTypes.string,\r\n okText: PropTypes.string,\r\n children: PropTypes.element,\r\n reqfooter: PropTypes.bool,\r\n cancelable: PropTypes.bool,\r\n okable: PropTypes.bool,\r\n exclueBoard: PropTypes.bool,\r\n vertical: PropTypes.bool,\r\n }\r\n\r\n static defaultProps = {\r\n modalType: 'small',\r\n className: '',\r\n title: '',\r\n position: '',\r\n closeButton: true,\r\n okText: '确定',\r\n reqfooter: true,\r\n cancelable: true,\r\n okable: true\r\n }\r\n\r\n static confirm(props) {\r\n const { content, className, onOk, once, onCancel, icon, wrapperControl, ...rest } = props;\r\n const controls = wrapperControl ? {} : { onOk, onCancel };\r\n rest.mask = rest.backdrop || false;\r\n const modal = Modal.confirm({\r\n ...rest,\r\n ...controls,\r\n mask: true,\r\n icon: null,\r\n className: `method-modal1 vertical-modal-wrapper ${className} ${verticalContainer(props)}`,\r\n content: (<div className='content1'>\r\n <div className='content-box'>\r\n {(typeof icon === 'boolean' && !icon) ? null :\r\n <Ticon type='jingshishang' className='method-modal-ticon ticon-confirm' />\r\n }\r\n {content}\r\n </div>\r\n {wrapperControl && <div className=\"modal-footer-container\">\r\n <Button\r\n onClick={() => handleOnCancel(onCancel, modal)}\r\n >取消</Button>\r\n <Button\r\n type='primary'\r\n onClick={() => handleOnOk(onOk, modal, once)}\r\n >确定</Button>\r\n </div>}\r\n </div>)\r\n });\r\n\r\n return modal;\r\n }\r\n\r\n static warning(props) {\r\n const { content, className, ...rest } = props;\r\n rest.mask = rest.backdrop || false;\r\n Modal.warning({\r\n ...rest,\r\n icon: null,\r\n className: `method-modal1 vertical-modal-wrapper ${className} ${verticalContainer(props)}`,\r\n content: (<div className='content1'>\r\n <Ticon type='zhongxingxia' className='method-modal-ticon ticon-info' />\r\n {content}\r\n </div>)\r\n })\r\n }\r\n\r\n static success(props) {\r\n const { content, className, ...rest } = props;\r\n rest.mask = rest.backdrop || false;\r\n Modal.success({\r\n ...rest,\r\n icon: null,\r\n className: `method-modal1 vertical-modal-wrapper ${className} ${verticalContainer(props)}`,\r\n content: (<div className='content1'>\r\n <Ticon type='zhongxingxia' className='method-modal-ticon ticon-info' />\r\n {content}\r\n </div>)\r\n })\r\n }\r\n\r\n static error(props) {\r\n const { content, className, ...rest } = props;\r\n rest.mask = rest.backdrop || false;\r\n Modal.error({\r\n ...rest,\r\n icon: null,\r\n className: `method-modal1 vertical-modal-wrapper ${className} ${verticalContainer(props)}`,\r\n content: (<div className='content1'>\r\n <Ticon type='zhongxingxia' className='method-modal-ticon ticon-info' />\r\n {content}\r\n </div>)\r\n })\r\n }\r\n\r\n static info(props) {\r\n const { content, className, ...rest } = props;\r\n rest.mask = rest.backdrop || false;\r\n Modal.info({\r\n ...rest,\r\n icon: null,\r\n zIndex: 1010,\r\n className: `method-modal1 vertical-modal-wrapper ${className} ${verticalContainer(props)}`,\r\n content: (<div className='content1'>\r\n <Ticon type='zhongxingxia' className='method-modal-ticon ticon-info' />\r\n {content}\r\n </div>)\r\n })\r\n }\r\n\r\n state = {\r\n modalIndex: 0,\r\n hasShow: false\r\n }\r\n\r\n static modalCount = 0;\r\n\r\n static getDerivedStateFromProps(props, state) {\r\n if (props.show && !state.hasShow) {\r\n return {\r\n hasShow: true,\r\n modalIndex: (ModalWraper.modalCount++)\r\n }\r\n }\r\n if (!props.show && state.hasShow) {\r\n return {\r\n hasShow: false,\r\n modalIndex: (ModalWraper.modalCount--)\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n // componentDidMount() {\r\n // console.log('modalWraper-compontentDidMount==Focus==',this.state.hasShow)\r\n // if (!this.state.hasShow) return\r\n // setTimeout(() => { this.handleLaterRender() }, 300)\r\n // }\r\n\r\n componentWillUnmount() {\r\n if (ModalWraper.modalCount > 0 && this.state.hasShow) {\r\n this.setState({ hasShow: false, modalIndex: (ModalWraper.modalCount--) });\r\n this.setInventoryFocus();\r\n }\r\n }\r\n\r\n /**\r\n * 模态框关闭时,强制设定商品录入框焦点\r\n */\r\n setInventoryFocus = () => {\r\n if (this.isHorizontalPad) return;\r\n // let doms = document.getElementsByClassName('app hot-key-focus-container')\r\n let input = document.getElementById('productPoint');\r\n if (!this.props.isNotAutoFocus && input) setTimeout(() => { {console.log('ModalWraper--商品焦点==Focus=='); input.focus() } }, 300)\r\n }\r\n\r\n /**\r\n * 页面渲染结束之后,焦点给到第一个input框。并绑定input事件,支持回车切换焦点。\r\n */\r\n // handleLaterRender = () => {\r\n // if (this.isHorizontalPad) return;\r\n // let list = $.find_element('input textarea');\r\n // if (list && list.length > 0) {\r\n // let input = list.find(v => v.type == 'text' || v.type == 'textarea')\r\n // if (input && input != document.activeElement) {\r\n // let val = input.value;\r\n // console.log('modalWraper--input==Focus==');\r\n // input.value = ''; input.focus(); input.click(); input.value = val;\r\n // }\r\n // }\r\n // }\r\n\r\n onHide = () => {\r\n let { onHide, cancel } = this.props;\r\n if (onHide) {\r\n onHide();\r\n } else {\r\n cancel && cancel()\r\n }\r\n this.setInventoryFocus();\r\n }\r\n\r\n // onEntered = () => {\r\n // setTimeout(() => { this.handleLaterRender() }, 300)\r\n // }\r\n\r\n onExited = () => {\r\n this.setInventoryFocus();\r\n }\r\n\r\n render() {\r\n let {\r\n modalType,\r\n className,\r\n title,\r\n memberClass,\r\n footer,\r\n cancel,\r\n ok,\r\n position,\r\n closeButton,\r\n okText,\r\n show,\r\n check,\r\n header,\r\n reqfooter,\r\n backdropStyle = {},\r\n onHide,\r\n cancelable,\r\n okable,\r\n exclueBoard = false,\r\n centered = true,\r\n vertical,\r\n ...props\r\n } = this.props;\r\n const { modalIndex, hasShow } = this.state;\r\n //针对Pad移动端\r\n centered = !this.isHorizontalPad;\r\n //针对全选的处理。\r\n let { isShowCheck, isChecked, checkedCount, checkBoxEvent,pickupChecked } = check || {};\r\n props.maskClosable = props.backdropClosable || false;\r\n let typeClass = map[modalType] ? map[modalType] : map['small'];\r\n let alignClass = exclueBoard ? 'modal-centre' : '';\r\n alignClass = this.isHorizontalPad ? '' : alignClass;\r\n if (modalIndex > 0) {\r\n backdropStyle = {\r\n ...backdropStyle,\r\n backgroundColor: 'rgba(0,0,0, 0)'\r\n };\r\n }\r\n return (\r\n <Modal\r\n wrapClassName={`modal-formated ${alignClass} ${className} ${position} ${typeClass} ${verticalContainer(this.props)} ${memberClass && memberClass}`}\r\n onCancel={this.onHide}\r\n // onEntered={this.onEntered}\r\n afterClose={this.onExited}\r\n visible={hasShow}\r\n maskStyle={backdropStyle}\r\n centered={centered}\r\n {...props}\r\n title={header ? header: title}\r\n closable={closeButton}\r\n destroyOnClose={true}\r\n footer={reqfooter ? footer ? footer :\r\n <div className='footer'>\r\n <div className='check'>\r\n {isShowCheck && <Checkbox checked={pickupChecked ? pickupChecked : isChecked} onChange={pickupChecked ? null : event => checkBoxEvent(0, event.target.checked)}>全选({checkedCount})</Checkbox>}\r\n </div>\r\n <div className='btn'>\r\n {cancelable && <Button onClick={() => { cancel && cancel() }}>取消</Button>}\r\n {okable && <Button disabled={this.props.btnDissabled} type='primary' onClick={() => { ok && ok() }}>{okText}</Button>}\r\n </div>\r\n </div> : null}\r\n >\r\n {this.props.children}\r\n </Modal>\r\n )\r\n }\r\n}"]}
@@ -80,10 +80,11 @@ var EmptyAndErrorView = (_temp2 = _class = function (_Component) {
80
80
  _props$style = _props.style,
81
81
  style = _props$style === undefined ? {} : _props$style,
82
82
  _props$type = _props.type,
83
- type = _props$type === undefined ? 'error' : _props$type;
83
+ type = _props$type === undefined ? 'error' : _props$type,
84
+ _props$imgStyle = _props.imgStyle,
85
+ imgStyle = _props$imgStyle === undefined ? {} : _props$imgStyle;
84
86
 
85
87
  var imgURL = imgRef[type];
86
-
87
88
  return _react2.default.createElement(
88
89
  'div',
89
90
  { className: 'progressState', style: style },
@@ -93,7 +94,7 @@ var EmptyAndErrorView = (_temp2 = _class = function (_Component) {
93
94
  iconVisible && _react2.default.createElement(
94
95
  'div',
95
96
  { className: 'icon' },
96
- _react2.default.createElement('img', { src: imgURL })
97
+ _react2.default.createElement('img', { style: imgStyle, src: imgURL })
97
98
  ),
98
99
  info && _react2.default.createElement(
99
100
  'div',
@@ -1 +1 @@
1
- {"version":3,"sources":["tplus-components-touch/components/progressState/EmptyAndErrorView.js"],"names":["imgRef","empty","error","EmptyAndErrorView","onButtonClick","e","onClick","props","iconVisible","info","buttonVisible","buttonTitle","secondaryTip","style","type","imgURL","Component","propTypes","PropTypes","bool","string","func","object"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;AAEA;;;;;;AAGA,IAAMA,SAAS;AACXC,WAAM,gDADK;AAEXC,WAAM;AAFK,CAAf;;IAKMC,iB;;;;;;;;;;;;;;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fR,kBAAcM,oBAAUE,MALT;AAMfd,aAASY,oBAAUG,IANJ;AAOfR,WAAOK,oBAAUI,MAPF;AAQfR,UAAMI,oBAAUE;AARD,C;kBAqDRjB,iB","file":"EmptyAndErrorView.js","sourcesContent":["import React, {Component} from 'react';\r\nimport { Button } from 'antd';\r\nimport PropTypes from 'prop-types';\r\n\r\n\r\nconst imgRef = {\r\n empty:'https://newretail.static.chanjet.com/empty.png',\r\n error:'https://newretail.static.chanjet.com/operation_error.png'\r\n}\r\n\r\nclass EmptyAndErrorView extends Component{\r\n\r\n static propTypes = {\r\n iconVisible: PropTypes.bool,\r\n info: PropTypes.string,\r\n buttonVisible: PropTypes.bool,\r\n buttonTitle: PropTypes.string,\r\n secondaryTip: PropTypes.string,\r\n onClick: PropTypes.func,\r\n style: PropTypes.object,\r\n type: PropTypes.string\r\n };\r\n\r\n render() {\r\n\r\n const {iconVisible, info, buttonVisible, buttonTitle,secondaryTip,style={},type='error'} = this.props;\r\n const imgURL = imgRef[type];\r\n\r\n return (\r\n <div className=\"progressState\" style={style}>\r\n <div>\r\n {iconVisible &&\r\n <div className=\"icon\">\r\n <img src={imgURL}/>\r\n </div>\r\n }\r\n {info &&\r\n <div className=\"text\">{info}</div>\r\n }\r\n {buttonVisible &&\r\n <div className=\"addBtn\">\r\n <Button type=\"primary\" onClick={this.onButtonClick}>\r\n {buttonTitle}\r\n </Button>\r\n </div>\r\n }\r\n </div>\r\n {secondaryTip &&\r\n <div className=\"secondaryTip\">\r\n <span className=\"tipLabel\">提示 :</span>\r\n <div className=\"tipContent\"> {secondaryTip}</div>\r\n </div>\r\n }\r\n\r\n </div>\r\n );\r\n }\r\n\r\n onButtonClick = (e)=>{\r\n const {onClick} = this.props;\r\n onClick && onClick(e);\r\n }\r\n\r\n}\r\n\r\nexport default EmptyAndErrorView;"]}
1
+ {"version":3,"sources":["tplus-components-touch/components/progressState/EmptyAndErrorView.js"],"names":["imgRef","empty","error","EmptyAndErrorView","onButtonClick","e","onClick","props","iconVisible","info","buttonVisible","buttonTitle","secondaryTip","style","type","imgStyle","imgURL","Component","propTypes","PropTypes","bool","string","func","object"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;AAEA;;;;;;AAGA,IAAMA,SAAS;AACXC,WAAM,gDADK;AAEXC,WAAM;AAFK,CAAf;;IAKMC,iB;;;;;;;;;;;;;;sOA+CFC,a,GAAgB,UAACC,CAAD,EAAK;AAAA,gBACVC,OADU,GACC,MAAKC,KADN,CACVD,OADU;;AAEjBA,uBAAWA,QAAQD,CAAR,CAAX;AACH,S;;;;;iCArCQ;AAAA,yBAEoG,KAAKE,KAFzG;AAAA,gBAEEC,WAFF,UAEEA,WAFF;AAAA,gBAEeC,IAFf,UAEeA,IAFf;AAAA,gBAEqBC,aAFrB,UAEqBA,aAFrB;AAAA,gBAEoCC,WAFpC,UAEoCA,WAFpC;AAAA,gBAEgDC,YAFhD,UAEgDA,YAFhD;AAAA,sCAE6DC,KAF7D;AAAA,gBAE6DA,KAF7D,gCAEmE,EAFnE;AAAA,qCAEsEC,IAFtE;AAAA,gBAEsEA,IAFtE,+BAE2E,OAF3E;AAAA,yCAEmFC,QAFnF;AAAA,gBAEmFA,QAFnF,mCAE8F,EAF9F;;AAGL,gBAAMC,SAAShB,OAAOc,IAAP,CAAf;AACA,mBACI;AAAA;AAAA,kBAAK,WAAU,eAAf,EAA+B,OAAOD,KAAtC;AACI;AAAA;AAAA;AACKL,mCACD;AAAA;AAAA,0BAAK,WAAU,MAAf;AACI,+DAAK,OAAOO,QAAZ,EAAsB,KAAKC,MAA3B;AADJ,qBAFJ;AAMKP,4BACD;AAAA;AAAA,0BAAK,WAAU,MAAf;AAAuBA;AAAvB,qBAPJ;AASKC,qCACD;AAAA;AAAA,0BAAK,WAAU,QAAf;AACI;AAAA;AAAA,8BAAQ,MAAK,SAAb,EAAuB,SAAS,KAAKN,aAArC;AACMO;AADN;AADJ;AAVJ,iBADJ;AAkBKC,gCACG;AAAA;AAAA,sBAAK,WAAU,cAAf;AACI;AAAA;AAAA,0BAAM,WAAU,UAAhB;AAAA;AAAA,qBADJ;AAEI;AAAA;AAAA,0BAAK,WAAU,YAAf;AAAA;AAA+BA;AAA/B;AAFJ;AAnBR,aADJ;AA4BH;;;EA7C2BK,gB,UAErBC,S,GAAY;AACfV,iBAAaW,oBAAUC,IADR;AAEfX,UAAMU,oBAAUE,MAFD;AAGfX,mBAAeS,oBAAUC,IAHV;AAIfT,iBAAaQ,oBAAUE,MAJR;AAKfT,kBAAcO,oBAAUE,MALT;AAMff,aAASa,oBAAUG,IANJ;AAOfT,WAAOM,oBAAUI,MAPF;AAQfT,UAAMK,oBAAUE;AARD,C;kBAoDRlB,iB","file":"EmptyAndErrorView.js","sourcesContent":["import React, {Component} from 'react';\r\nimport { Button } from 'antd';\r\nimport PropTypes from 'prop-types';\r\n\r\n\r\nconst imgRef = {\r\n empty:'https://newretail.static.chanjet.com/empty.png',\r\n error:'https://newretail.static.chanjet.com/operation_error.png'\r\n}\r\n\r\nclass EmptyAndErrorView extends Component{\r\n\r\n static propTypes = {\r\n iconVisible: PropTypes.bool,\r\n info: PropTypes.string,\r\n buttonVisible: PropTypes.bool,\r\n buttonTitle: PropTypes.string,\r\n secondaryTip: PropTypes.string,\r\n onClick: PropTypes.func,\r\n style: PropTypes.object,\r\n type: PropTypes.string\r\n };\r\n\r\n render() {\r\n\r\n const {iconVisible, info, buttonVisible, buttonTitle,secondaryTip,style={},type='error',imgStyle = {}} = this.props;\r\n const imgURL = imgRef[type];\r\n return (\r\n <div className=\"progressState\" style={style}>\r\n <div>\r\n {iconVisible &&\r\n <div className=\"icon\">\r\n <img style={imgStyle} src={imgURL}/>\r\n </div>\r\n }\r\n {info &&\r\n <div className=\"text\">{info}</div>\r\n }\r\n {buttonVisible &&\r\n <div className=\"addBtn\">\r\n <Button type=\"primary\" onClick={this.onButtonClick}>\r\n {buttonTitle}\r\n </Button>\r\n </div>\r\n }\r\n </div>\r\n {secondaryTip &&\r\n <div className=\"secondaryTip\">\r\n <span className=\"tipLabel\">提示 :</span>\r\n <div className=\"tipContent\"> {secondaryTip}</div>\r\n </div>\r\n }\r\n\r\n </div>\r\n );\r\n }\r\n\r\n onButtonClick = (e)=>{\r\n const {onClick} = this.props;\r\n onClick && onClick(e);\r\n }\r\n\r\n}\r\n\r\nexport default EmptyAndErrorView;"]}
@@ -139,7 +139,8 @@ var ProgressState = (_temp = _class = function (_React$Component) {
139
139
  buttonTitle: _propTypes2.default.string,
140
140
  onClick: _propTypes2.default.func,
141
141
  buttonVisible: _propTypes2.default.bool,
142
- style: _propTypes2.default.object
142
+ style: _propTypes2.default.object,
143
+ imgStyle: _propTypes2.default.object
143
144
  }),
144
145
  error: _propTypes2.default.shape({
145
146
  iconVisible: _propTypes2.default.bool,
@@ -1 +1 @@
1
- {"version":3,"sources":["tplus-components-touch/components/progressState/ProgressState.js"],"names":["ProgressState","props","state","load","style","empty","error","children","stateCommonStyle","className","baseStyle","height","defaultProps","React","Component","iconVisible","buttonTitle","buttonVisible","info","defaultLoadProps","position","gotProgressState","loading","notEmpty","progressState","propTypes","PropTypes","oneOf","shape","text","string","object","bool","onClick","func","node"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;;;IAEMA,a;;;;;;;;;;;;AAWF;;;;;;;;;;;iCA0DS;AAAA,yBAUD,KAAKC,KAVJ;AAAA,gBAEDC,KAFC,UAEDA,KAFC;AAAA,qCAGDC,IAHC;AAAA,gBAGDA,IAHC,+BAGM,EAACC,OAAM,EAAP,EAHN;AAAA,sCAIDC,KAJC;AAAA,gBAIDA,KAJC,gCAIO,EAACD,OAAM,EAAP,EAJP;AAAA,sCAKDE,KALC;AAAA,gBAKDA,KALC,gCAKO,EAACF,OAAM,EAAP,EALP;AAAA,gBAMDG,QANC,UAMDA,QANC;AAAA,gBAODH,KAPC,UAODA,KAPC;AAAA,+CAQDI,gB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K,IAAIF,OAAJ,EAAa;AACdE,wBAAgB,MAAhB;AACH,KAFI,MAGA,IAAID,QAAJ,EAAc;AACfC,wBAAgB,MAAhB;AACH,KAFI,MAGA;AACDA,wBAAgB,OAAhB;AACH;;AAED,WAAOA,aAAP;AACH,C,SAEMC,S,GAAY;AACfvB,WAAOwB,oBAAUC,KAAV,CAAgB,CAAC,MAAD,EAAS,MAAT,EAAiB,MAAjB,EAAyB,OAAzB,EAAkC,OAAlC,CAAhB,CADQ;AAEfxB,UAAMuB,oBAAUE,KAAV,CAAgB;AAClBC,cAAMH,oBAAUI,MADE;AAElBrB,mBAAWiB,oBAAUI,MAFH;AAGlB1B,eAAOsB,oBAAUK;AAHC,KAAhB,CAFS;AAOf1B,WAAOqB,oBAAUE,KAAV,CAAgB;AACnBb,qBAAYW,oBAAUM,IADH;AAEnBd,cAAMQ,oBAAUI,MAFG;AAGnBd,qBAAaU,oBAAUI,MAHJ;AAInBG,iBAASP,oBAAUQ,IAJA;AAKnBjB,uBAAeS,oBAAUM,IALN;AAMnB5B,eAAOsB,oBAAUK;AANE,KAAhB,CAPQ;AAefzB,WAAOoB,oBAAUE,KAAV,CAAgB;AACnBb,qBAAYW,oBAAUM,IADH;AAEnBd,cAAMQ,oBAAUI,MAFG;AAGnBd,qBAAaU,oBAAUI,MAHJ;AAInBG,iBAASP,oBAAUQ,IAJA;AAKnBjB,uBAAeS,oBAAUM;AALN,KAAhB,CAfQ;AAsBfzB,cAAUmB,oBAAUS,IAtBL;AAuBf1B,eAAWiB,oBAAUI,MAvBN;AAwBf1B,WAAOsB,oBAAUK,MAxBF;AAyBfvB,sBAAkBkB,oBAAUK;AAzBb,C;kBA4DR/B,a","file":"ProgressState.js","sourcesContent":["import React from 'react';\r\nimport LoadingView from '../loading/loadingContent';\r\nimport EmptyAndErrorView from './EmptyAndErrorView';\r\nimport './style.less';\r\nimport PropTypes from 'prop-types';\r\n\r\nclass ProgressState extends React.Component {\r\n static defaultProps = {\r\n state: 'show',\r\n error: {iconVisible:true, buttonTitle: '重试', buttonVisible: true},\r\n empty: {iconVisible:true, info: '哎呀, 这里空空的什么都没有', buttonTitle: '刷新', buttonVisible: true},\r\n };\r\n\r\n static defaultLoadProps = {\r\n style:{position:'relative'}\r\n }\r\n\r\n /**\r\n * 返回 ProgressState, 规则如下:\r\n * 1. error 优先,如果有error, 则状态为 error\r\n * 2. 否则如果 loading, 则状态为 load\r\n * 3. 否则如果 notEmpty, 则状态为 show\r\n * 4. 否则为 empty\r\n * @param loading\r\n * @param notEmptu\r\n * @param error\r\n * @returns {*}\r\n */\r\n static gotProgressState = (loading, notEmpty, error) => {\r\n let progressState;\r\n\r\n if (error) {\r\n progressState = 'error';\r\n }\r\n else if (loading) {\r\n progressState = 'load';\r\n }\r\n else if (notEmpty) {\r\n progressState = 'show';\r\n }\r\n else {\r\n progressState = 'empty';\r\n }\r\n\r\n return progressState;\r\n };\r\n\r\n static propTypes = {\r\n state: PropTypes.oneOf(['wait', 'load', 'show', 'error', 'empty']),\r\n load: PropTypes.shape({\r\n text: PropTypes.string,\r\n className: PropTypes.string,\r\n style: PropTypes.object,\r\n }),\r\n empty: PropTypes.shape({\r\n iconVisible:PropTypes.bool,\r\n info: PropTypes.string,\r\n buttonTitle: PropTypes.string,\r\n onClick: PropTypes.func,\r\n buttonVisible: PropTypes.bool,\r\n style: PropTypes.object\r\n }),\r\n error: PropTypes.shape({\r\n iconVisible:PropTypes.bool,\r\n info: PropTypes.string,\r\n buttonTitle: PropTypes.string,\r\n onClick: PropTypes.func,\r\n buttonVisible: PropTypes.bool\r\n }),\r\n children: PropTypes.node,\r\n className: PropTypes.string,\r\n style: PropTypes.object,\r\n stateCommonStyle: PropTypes.object\r\n };\r\n\r\n render() {\r\n const {\r\n state,\r\n load = {style:{}},\r\n empty = {style:{}},\r\n error = {style:{}},\r\n children,\r\n style,\r\n stateCommonStyle = {},\r\n className,\r\n } = this.props;\r\n const baseStyle = className ? {} : {height: '100%'};\r\n empty.style = {...stateCommonStyle,...empty.style};\r\n error.style = {...stateCommonStyle,...error.style};\r\n load.style ={...stateCommonStyle,...load.style};\r\n return (\r\n <div className={className} style={Object.assign(baseStyle,style)}>\r\n {children}\r\n {state === 'load' &&\r\n <LoadingView {...load}/>\r\n }\r\n {state === 'empty' && empty &&\r\n <EmptyAndErrorView type={'empty'} {...ProgressState.defaultProps.empty} {...empty} />\r\n }\r\n {state === 'error' && error &&\r\n <EmptyAndErrorView type={'error'} {...ProgressState.defaultProps.error} {...error} />\r\n }\r\n </div>\r\n );\r\n }\r\n}\r\n\r\nexport default ProgressState;\r\n"]}
1
+ {"version":3,"sources":["tplus-components-touch/components/progressState/ProgressState.js"],"names":["ProgressState","props","state","load","style","empty","error","children","stateCommonStyle","className","baseStyle","height","defaultProps","React","Component","iconVisible","buttonTitle","buttonVisible","info","defaultLoadProps","position","gotProgressState","loading","notEmpty","progressState","propTypes","PropTypes","oneOf","shape","text","string","object","bool","onClick","func","imgStyle","node"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;;;IAEMA,a;;;;;;;;;;;;AAWF;;;;;;;;;;;iCA2DS;AAAA,yBAUD,KAAKC,KAVJ;AAAA,gBAEDC,KAFC,UAEDA,KAFC;AAAA,qCAGDC,IAHC;AAAA,gBAGDA,IAHC,+BAGM,EAACC,OAAM,EAAP,EAHN;AAAA,sCAIDC,KAJC;AAAA,gBAIDA,KAJC,gCAIO,EAACD,OAAM,EAAP,EAJP;AAAA,sCAKDE,KALC;AAAA,gBAKDA,KALC,gCAKO,EAACF,OAAM,EAAP,EALP;AAAA,gBAMDG,QANC,UAMDA,QANC;AAAA,gBAODH,KAPC,UAODA,KAPC;AAAA,+CAQDI,gBARC;AAAA,gBAQDA,gBARC,yCAQkB,EARlB;AAAA,gBASDC,SATC,UASDA,SATC;;AAWL,gBAAMC,YAAYD,YAAY,EAAZ,GAAiB,EAACE,QAAQ,MAAT,EAAn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AAhB;AACH;;AAED,WAAOA,aAAP;AACH,C,SAEMC,S,GAAY;AACfvB,WAAOwB,oBAAUC,KAAV,CAAgB,CAAC,MAAD,EAAS,MAAT,EAAiB,MAAjB,EAAyB,OAAzB,EAAkC,OAAlC,CAAhB,CADQ;AAEfxB,UAAMuB,oBAAUE,KAAV,CAAgB;AAClBC,cAAMH,oBAAUI,MADE;AAElBrB,mBAAWiB,oBAAUI,MAFH;AAGlB1B,eAAOsB,oBAAUK;AAHC,KAAhB,CAFS;AAOf1B,WAAOqB,oBAAUE,KAAV,CAAgB;AACnBb,qBAAYW,oBAAUM,IADH;AAEnBd,cAAMQ,oBAAUI,MAFG;AAGnBd,qBAAaU,oBAAUI,MAHJ;AAInBG,iBAASP,oBAAUQ,IAJA;AAKnBjB,uBAAeS,oBAAUM,IALN;AAMnB5B,eAAOsB,oBAAUK,MANE;AAOnBI,kBAAUT,oBAAUK;AAPD,KAAhB,CAPQ;AAgBfzB,WAAOoB,oBAAUE,KAAV,CAAgB;AACnBb,qBAAYW,oBAAUM,IADH;AAEnBd,cAAMQ,oBAAUI,MAFG;AAGnBd,qBAAaU,oBAAUI,MAHJ;AAInBG,iBAASP,oBAAUQ,IAJA;AAKnBjB,uBAAeS,oBAAUM;AALN,KAAhB,CAhBQ;AAuBfzB,cAAUmB,oBAAUU,IAvBL;AAwBf3B,eAAWiB,oBAAUI,MAxBN;AAyBf1B,WAAOsB,oBAAUK,MAzBF;AA0BfvB,sBAAkBkB,oBAAUK;AA1Bb,C;kBA6DR/B,a","file":"ProgressState.js","sourcesContent":["import React from 'react';\r\nimport LoadingView from '../loading/loadingContent';\r\nimport EmptyAndErrorView from './EmptyAndErrorView';\r\nimport './style.less';\r\nimport PropTypes from 'prop-types';\r\n\r\nclass ProgressState extends React.Component {\r\n static defaultProps = {\r\n state: 'show',\r\n error: {iconVisible:true, buttonTitle: '重试', buttonVisible: true},\r\n empty: {iconVisible:true, info: '哎呀, 这里空空的什么都没有', buttonTitle: '刷新', buttonVisible: true},\r\n };\r\n\r\n static defaultLoadProps = {\r\n style:{position:'relative'}\r\n }\r\n\r\n /**\r\n * 返回 ProgressState, 规则如下:\r\n * 1. error 优先,如果有error, 则状态为 error\r\n * 2. 否则如果 loading, 则状态为 load\r\n * 3. 否则如果 notEmpty, 则状态为 show\r\n * 4. 否则为 empty\r\n * @param loading\r\n * @param notEmptu\r\n * @param error\r\n * @returns {*}\r\n */\r\n static gotProgressState = (loading, notEmpty, error) => {\r\n let progressState;\r\n\r\n if (error) {\r\n progressState = 'error';\r\n }\r\n else if (loading) {\r\n progressState = 'load';\r\n }\r\n else if (notEmpty) {\r\n progressState = 'show';\r\n }\r\n else {\r\n progressState = 'empty';\r\n }\r\n\r\n return progressState;\r\n };\r\n\r\n static propTypes = {\r\n state: PropTypes.oneOf(['wait', 'load', 'show', 'error', 'empty']),\r\n load: PropTypes.shape({\r\n text: PropTypes.string,\r\n className: PropTypes.string,\r\n style: PropTypes.object,\r\n }),\r\n empty: PropTypes.shape({\r\n iconVisible:PropTypes.bool,\r\n info: PropTypes.string,\r\n buttonTitle: PropTypes.string,\r\n onClick: PropTypes.func,\r\n buttonVisible: PropTypes.bool,\r\n style: PropTypes.object,\r\n imgStyle: PropTypes.object\r\n }),\r\n error: PropTypes.shape({\r\n iconVisible:PropTypes.bool,\r\n info: PropTypes.string,\r\n buttonTitle: PropTypes.string,\r\n onClick: PropTypes.func,\r\n buttonVisible: PropTypes.bool\r\n }),\r\n children: PropTypes.node,\r\n className: PropTypes.string,\r\n style: PropTypes.object,\r\n stateCommonStyle: PropTypes.object\r\n };\r\n\r\n render() {\r\n const {\r\n state,\r\n load = {style:{}},\r\n empty = {style:{}},\r\n error = {style:{}},\r\n children,\r\n style,\r\n stateCommonStyle = {},\r\n className,\r\n } = this.props;\r\n const baseStyle = className ? {} : {height: '100%'};\r\n empty.style = {...stateCommonStyle,...empty.style};\r\n error.style = {...stateCommonStyle,...error.style};\r\n load.style ={...stateCommonStyle,...load.style};\r\n return (\r\n <div className={className} style={Object.assign(baseStyle,style)}>\r\n {children}\r\n {state === 'load' &&\r\n <LoadingView {...load}/>\r\n }\r\n {state === 'empty' && empty &&\r\n <EmptyAndErrorView type={'empty'} {...ProgressState.defaultProps.empty} {...empty} />\r\n }\r\n {state === 'error' && error &&\r\n <EmptyAndErrorView type={'error'} {...ProgressState.defaultProps.error} {...error} />\r\n }\r\n </div>\r\n );\r\n }\r\n}\r\n\r\nexport default ProgressState;\r\n"]}
@@ -4,13 +4,22 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
+ var _mutantsMicrofx = require('mutants-microfx');
8
+
7
9
  var _settlement = require('./settlement');
8
10
 
9
11
  var _settlement2 = _interopRequireDefault(_settlement);
10
12
 
13
+ var _settlementStore = require('./settlementStore');
14
+
15
+ var _settlementStore2 = _interopRequireDefault(_settlementStore);
16
+
11
17
  require('./settlement.less');
12
18
 
13
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
20
 
15
21
  exports.default = _settlement2.default;
22
+
23
+
24
+ (0, _mutantsMicrofx.registerStores)({ settlementStore: new _settlementStore2.default() });
16
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["tplus-components-touch/components/settlement/index.js"],"names":["Settlement"],"mappings":";;;;;;AAAA;;;;AACA;;;;kBAEeA,oB","file":"index.js","sourcesContent":["import Settlement from './settlement'\r\nimport './settlement.less'\r\n\r\nexport default Settlement;"]}
1
+ {"version":3,"sources":["tplus-components-touch/components/settlement/index.js"],"names":["Settlement","settlementStore","SettlementStore"],"mappings":";;;;;;AAAA;;AACA;;;;AACA;;;;AACA;;;;kBAEeA,oB;;;AAEf,oCAAe,EAAEC,iBAAiB,IAAIC,yBAAJ,EAAnB,EAAf","file":"index.js","sourcesContent":["import { registerStores } from 'mutants-microfx';\r\nimport Settlement from './settlement';\r\nimport SettlementStore from './settlementStore';\r\nimport './settlement.less';\r\n\r\nexport default Settlement;\r\n\r\nregisterStores({ settlementStore: new SettlementStore() })"]}