tplus-components-touch 3.28.17 → 3.30.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.
- package/dist/components/billSearch/index.js +18 -156
- package/dist/components/billSearch/index.js.map +1 -1
- package/dist/components/billSearch/index.less +3 -6
- package/dist/components/cloudPrint/api.js +43 -85
- package/dist/components/cloudPrint/api.js.map +1 -1
- package/dist/components/cloudPrint/printDispatch.js +108 -213
- package/dist/components/cloudPrint/printDispatch.js.map +1 -1
- package/dist/components/inventorySearch/tab.js +67 -77
- package/dist/components/inventorySearch/tab.js.map +1 -1
- package/dist/components/keyboard/numberButton_input.js +2 -4
- package/dist/components/keyboard/numberButton_input.js.map +1 -1
- package/dist/components/keyboard/onlyLetterButton2.less +40 -35
- package/dist/components/progressState/EmptyAndErrorView.js +3 -4
- package/dist/components/progressState/EmptyAndErrorView.js.map +1 -1
- package/dist/components/progressState/ProgressState.js +1 -2
- package/dist/components/progressState/ProgressState.js.map +1 -1
- package/dist/components/settlement/settlement.js +6 -10
- package/dist/components/settlement/settlement.js.map +1 -1
- package/dist/components/settlement/settlement.less +2 -2
- package/dist/components/settlement/settlementStore.js +37 -44
- package/dist/components/settlement/settlementStore.js.map +1 -1
- package/dist/components/touchTable/index.js +3 -4
- package/dist/components/touchTable/index.js.map +1 -1
- package/dist/components/touchTable/index.less +13 -20
- package/dist/index.js +2 -14
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -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","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,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,KAnCkB;;AAAA,WAqCnBC,QArCmB,GAqCR,YAAM;AACf,aAAKJ,QAAL,CAAc;AACZG,oBAAY,OAAKE,KAAL,CAAWF,UAAX,GAAwB;AADxB,OAAd,EAEG,YAAM;AACP,eAAKR,KAAL,CAAWW,KAAX,CAAiBC,UAAjB,CAA4B,OAAKZ,KAAL,CAAWa,WAAvC,EAAoD,OAAKH,KAAL,CAAWF,UAA/D,EAA2E,EAA3E,EAA+E,OAAKR,KAAL,CAAWI,IAA1F;AACD,OAJD;AAKD,KA3CkB;;AAAA,WA6CnBU,IA7CmB,GA6CZ,YAAM;AACX,aAAKT,QAAL,CAAc;AACZG,oBAAY,OAAKE,KAAL,CAAWF,UAAX,GAAwB;AADxB,OAAd,EAEG,YAAM;AACP,eAAKR,KAAL,CAAWW,KAAX,CAAiBC,UAAjB,CAA4B,OAAKZ,KAAL,CAAWa,WAAvC,EAAoD,OAAKH,KAAL,CAAWF,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W,KAAK1B,WAAL;AAFJ,WAJX;AAQE,sBAAY,KARd;AASE,wBAAc,KAAKxB,eATrB;AAUE,iBAAO,eAACb,MAAD,EAASC,KAAT,EAAmB;AACxB,mBAAO;AACL+D,uBAAS;AAAA,uBAAM,OAAKjE,UAAL,CAAgBC,MAAhB,EAAwBC,KAAxB,CAAN;AAAA;AADJ,aAAP;AAGD,WAdH,GADF,GAiBE,8BAAC,oBAAD;AACE,iBAAOyD,UAAS,MAAT,GAAiB,OAD1B;AAEE,4BAAkB,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';\nimport { Table } from 'antd';\nimport { observer } from 'mutants-microfx';\nimport { localStore } from 'mutants-util';\nimport { Page, ProgressState } from '../../index';\nimport InventorySearchApi from './api';\nimport tools from '../../util/tools';\n@observer\nexport default class Tab extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n activePage: 1,\n emptyHeight: 200,\n selectedRowIndex: -1\n };\n }\n componentDidMount() {\n this.setTableHeight();\n this.windowEvent = this.setTableHeight.bind(this);\n window.addEventListener('resize', this.windowEvent);\n }\n\n componentWillUnmount() {\n window.removeEventListener('resize', this.windowEvent);\n }\n\n setTableHeight() {\n let _this = this;\n setTimeout(() => {\n let height = Number(_this.tabDom.clientHeight - 200);\n _this.setState({ tableHeight: height })\n }, 0)\n }\n\n onRowClick = (record, index) => {\n this.props.onRowClick && this.props.onRowClick(record, this.props.type)\n this.setState({ selectedRowIndex: index })\n }\n\n resetPageNo = () => {\n this.setState({\n activePage: 1\n })\n }\n\n previous = () => {\n this.setState({\n activePage: this.state.activePage - 1\n }, () => {\n this.props.store.searchMore(this.props.searchValue, this.state.activePage, 15, this.props.type)\n })\n }\n\n next = () => {\n this.setState({\n activePage: this.state.activePage + 1\n }, () => {\n this.props.store.searchMore(this.props.searchValue, this.state.activePage, 15, this.props.type)\n })\n }\n getRowClassName = (record, index) => {\n const { selectedRowIndex } = this.state;\n if (selectedRowIndex == index) {\n return 'row-selected'\n } else {\n return '';\n }\n }\n\n // 获取列字段集合\n getNewColumnsList = (type, searchDesigns) => {\n let columns = [];\n //周边门店要显示门店名称\n if (type == '2') {\n columns.push({\n title: '门店名称',\n width: 120,\n dataIndex: 'WarehouseName',\n key: 'WarehouseName',\n // fixed: 'left', 注释掉,否则鼠标悬浮无效\n ellipsis: true, // 加上,否则鼠标悬浮无效\n render: (text, record, index) => {\n return <div className='text-2line-overflow'>{text}</div>\n }\n })\n }\n searchDesigns.map(item => {\n let { OriginalTitle, FieldName, Precision, IsFormat } = item || {};\n let newItem = {\n title: OriginalTitle,\n width: 100,\n dataIndex: FieldName,\n key: FieldName,\n Precision: Precision,\n IsFormat: IsFormat,\n ellipsis: true,\n }\n switch (FieldName) {\n case 'InventoryName':\n newItem.width = 160;\n newItem.render = (text, record, index) => {\n return <div className='text-2line-overflow'>{text}</div>\n }\n break;\n case 'InventoryCode': newItem.width = 160; break;\n case 'ExistingBaseQuantity': newItem.width = 80; break;\n }\n if ((Precision || Precision == 0) && IsFormat) {\n newItem.render = (text, record, index) => {\n let renderText = InventorySearchApi.formatNumber(text, Precision);\n return <span>{renderText}</span>\n }\n }\n if (FieldName == 'ProductionDate' || FieldName == 'ExpiryDate') {\n newItem.render = (text, record, index) => {\n let renderText = tools.dateFormat(text);\n return <span>{renderText}</span>\n }\n }\n columns.push(newItem);\n });\n return columns;\n }\n loadingIcon = () => {\n const theme = localStore.get('theme');\n const img = `https://newretail.static.chanjet.com/bc_pos/loading${(theme == 'blue' || theme == 'dark') ? '2' : ''}.gif`;\n return (\n <img src={img} style={{ width: '90px', height: '90px' }} />\n )\n }\n\n render() {\n let { activePage } = this.state;\n let { dataSource, TotalPage, loading, type, searchDesigns } = this.props;\n let columns = this.getNewColumnsList(type, searchDesigns);\n return (\n <div ref={(dom) => { this.tabDom = dom }}\n className={`${dataSource && dataSource.length > 0 ? 'inventoryTable' : ''} inventory-tab ${type == '2' ? 'table2' : 'table1'}`}>\n {\n dataSource && dataSource.length > 0 ?\n <Table\n columns={columns}\n dataSource={dataSource}\n scroll={{ y: \"calc(~'100% - 43px')\" }}\n loading={{\n spinning: loading,\n indicator: this.loadingIcon()\n }}\n pagination={false}\n rowClassName={this.getRowClassName}\n onRow={(record, index) => {\n return {\n onClick: () => this.onRowClick(record, index)\n }\n }} />\n :\n <ProgressState\n state={loading? 'load': \"empty\"}\n stateCommonStyle={{ height: \"100%\" }}\n empty={{ info: '暂无数据~~', buttonVisible: false }} />\n }\n {!(TotalPage == 0 || !TotalPage) && <div className=\"primary-color\" style={{ fontSize: '13px'}}>温馨提示:点击选中该行商品可直接带入至开单页</div>}\n <Page\n total={TotalPage}\n currentIndex={activePage}\n previous={this.previous}\n next={this.next}\n className='inventory-page'\n />\n </div>\n )\n }\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","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,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,KAnCkB;;AAAA,WAqCnBC,QArCmB,GAqCR,YAAM;AACf,aAAKJ,QAAL,CAAc;AACZG,oBAAY,OAAKE,KAAL,CAAWF,UAAX,GAAwB;AADxB,OAAd,EAEG,YAAM;AACP,eAAKR,KAAL,CAAWW,KAAX,CAAiBC,UAAjB,CAA4B,OAAKZ,KAAL,CAAWa,WAAvC,EAAoD,OAAKH,KAAL,CAAWF,UAA/D,EAA2E,EAA3E,EAA+E,OAAKR,KAAL,CAAWI,IAA1F;AACD,OAJD;AAKD,KA3CkB;;AAAA,WA6CnBU,IA7CmB,GA6CZ,YAAM;AACX,aAAKT,QAAL,CAAc;AACZG,oBAAY,OAAKE,KAAL,CAAWF,UAAX,GAAwB;AADxB,OAAd,EAEG,YAAM;AACP,eAAKR,KAAL,CAAWW,KAAX,CAAiBC,UAAjB,CAA4B,OAAKZ,KAAL,CAAWa,WAAvC,EAAoD,OAAKH,KAAL,CAAWF,UAA/D,EAA2E,EAA3E,EAA+E,OAAKR,KAAL,CAAWI,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GAiBE,8BAAC,oBAAD;AACE,iBAAOmC,UAAS,MAAT,GAAiB,OAD1B;AAEE,4BAAkB,EAAEhB,QAAQ,MAAV,EAFpB;AAGE,iBAAO,EAAE6C,MAAM,QAAR,EAAkBC,eAAe,KAAjC,EAHT,GApBN;AAyBG,UAAE/B,aAAa,CAAb,IAAkB,CAACA,SAArB,KAAmC;AAAA;AAAA,YAAK,WAAU,eAAf,EAA+B,OAAO,EAAEgC,UAAU,MAAZ,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';\nimport { Table } from 'antd';\nimport { observer } from 'mutants-microfx';\nimport { localStore } from 'mutants-util';\nimport { Page, ProgressState } from '../../index';\nimport InventorySearchApi from './api';\nimport tools from '../../util/tools';\n\n@observer\nexport default class Tab extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n activePage: 1,\n emptyHeight: 200,\n selectedRowIndex: -1\n };\n }\n componentDidMount() {\n this.setTableHeight();\n this.windowEvent = this.setTableHeight.bind(this);\n window.addEventListener('resize', this.windowEvent);\n }\n\n componentWillUnmount() {\n window.removeEventListener('resize', this.windowEvent);\n }\n\n setTableHeight() {\n let _this = this;\n setTimeout(() => {\n let height = Number(_this.tabDom.clientHeight - 200);\n _this.setState({ tableHeight: height })\n }, 0)\n }\n\n onRowClick = (record, index) => {\n this.props.onRowClick && this.props.onRowClick(record, this.props.type)\n this.setState({ selectedRowIndex: index })\n }\n\n resetPageNo = () => {\n this.setState({\n activePage: 1\n })\n }\n\n previous = () => {\n this.setState({\n activePage: this.state.activePage - 1\n }, () => {\n this.props.store.searchMore(this.props.searchValue, this.state.activePage, 15, this.props.type)\n })\n }\n\n next = () => {\n this.setState({\n activePage: this.state.activePage + 1\n }, () => {\n this.props.store.searchMore(this.props.searchValue, this.state.activePage, 15, this.props.type)\n })\n }\n getRowClassName = (record, index) => {\n const { selectedRowIndex } = this.state;\n if (selectedRowIndex == index) {\n return 'row-selected'\n } else {\n return '';\n }\n }\n\n loadingIcon = () => {\n const theme = localStore.get('theme');\n const img = `https://newretail.static.chanjet.com/bc_pos/loading${(theme == 'blue' || theme == 'dark') ? '2' : ''}.gif`;\n return (\n <img src={img} style={{ width: '90px', height: '90px' }} />\n )\n }\n\n render() {\n let { activePage } = this.state;\n let { dataSource, TotalPage, loading, type,searchDesigns } = this.props;\n const columns = searchDesigns.map(item => {\n let { OriginalTitle, FieldName, Precision, IsFormat } = item || {};\n let newItem = {\n title: OriginalTitle,\n width: 100,\n dataIndex: FieldName,\n key: FieldName,\n Precision: Precision,\n IsFormat: IsFormat,\n ellipsis: true,\n }\n switch (FieldName) {\n case 'InventoryName':\n newItem.width = 160;\n newItem.render = (text, record, index) => {\n return <div className='text-2line-overflow'>{text}</div>\n }\n break;\n case 'InventoryCode': newItem.width = 160; break;\n case 'ExistingBaseQuantity': newItem.width = 80; break;\n }\n if ((Precision || Precision == 0) && IsFormat) {\n newItem.render = (text, record, index) => {\n let renderText = InventorySearchApi.formatNumber(text, Precision);\n return <span>{renderText}</span>\n }\n }\n if (FieldName == 'ProductionDate' || FieldName == 'ExpiryDate') {\n newItem.render = (text, record, index) => {\n let renderText = tools.dateFormat(text);\n return <span>{renderText}</span>\n }\n }\n return newItem;\n })\n // 周边门店 要显示门店名称\n if (type == '2') {\n columns.unshift({\n title: '门店名称',\n width: 120,\n dataIndex: 'WarehouseName',\n key: 'WarehouseName',\n fixed: 'left',\n render: (text, record, index) => {\n return <div className='text-2line-overflow'>{text}</div>\n }\n })\n }\n return (\n <div ref={(dom) => { this.tabDom = dom }}\n className={`${dataSource && dataSource.length > 0 ? 'inventoryTable' : ''} inventory-tab ${type == '2' ? 'table2' : 'table1'}`}>\n {\n dataSource && dataSource.length > 0 ?\n <Table\n columns={columns}\n dataSource={dataSource}\n scroll={{ y: \"calc(~'100% - 43px')\" }}\n loading={{\n spinning: loading,\n indicator: this.loadingIcon()\n }}\n pagination={false}\n rowClassName={this.getRowClassName}\n onRow={(record, index) => {\n return {\n onClick: () => this.onRowClick(record, index)\n }\n }} />\n :\n <ProgressState\n state={loading? 'load': \"empty\"}\n stateCommonStyle={{ height: \"100%\" }}\n empty={{ info: '暂无数据~~', buttonVisible: false }} />\n }\n {!(TotalPage == 0 || !TotalPage) && <div className=\"primary-color\" style={{ fontSize: '13px'}}>温馨提示:点击选中该行商品可直接带入至开单页</div>}\n <Page\n total={TotalPage}\n currentIndex={activePage}\n previous={this.previous}\n next={this.next}\n className='inventory-page'\n />\n </div>\n )\n }\n}"]}
|
|
@@ -281,13 +281,11 @@ var KeyboardInput = (_temp = _class = function (_Component) {
|
|
|
281
281
|
onSelect: this.handleMobileKeyboard,
|
|
282
282
|
ref: function ref(input) {
|
|
283
283
|
return _this2.input = input;
|
|
284
|
-
}
|
|
285
|
-
}),
|
|
284
|
+
} }),
|
|
286
285
|
_react2.default.createElement(_index.Keyboard, {
|
|
287
286
|
type: 'number2',
|
|
288
287
|
positive: this.props.type,
|
|
289
|
-
onChange: this.onChange
|
|
290
|
-
})
|
|
288
|
+
onChange: this.onChange })
|
|
291
289
|
);
|
|
292
290
|
}
|
|
293
291
|
}]);
|
|
@@ -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,EAAmB;AACjB,gBAAI,CAACF,gBAAMC,MAAN,CAAaL,IAAIO,GAAjB,CAAL,EAA4BC,gBAAQC,IAAR,CAAaT,IAAIO,GAAjB;AAC5B;AACD;AACF;;AAED,YAAIX,EAAEc,KAAF,CAAQ,KAAR,KAAkBd,EAAEc,KAAF,CAAQ,KAAR,EAAeC,MAAf,GA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DA,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":["/**\n * input + 数字键盘\n * @props {boolean} type \"positive\" 只支持正数,不传正负都可以\n * @props {number} max 最大值\n * @props {number} min 最小值\n */\n\nimport React, { Component } from 'react';\nimport { Input } from 'antd';\nimport { platform } from 'mutants-util';\nimport { env } from 'mutants-microfx';\nimport { Keyboard } from '../../index';\nimport PropTypes from 'prop-types';\nimport tools from '../../util/tools'\nimport Message from '../message/index'\nimport hotKey from '../hotKey'\n\nexport default class KeyboardInput extends Component {\n\n static propTypes = {\n onChange: PropTypes.func.isRequired,\n placeholder: PropTypes.string,\n type: PropTypes.string,\n maxLength: PropTypes.number, // 总长度\n precisionLength: PropTypes.number, // 小数总长\n max: PropTypes.number,\n min: PropTypes.number,\n }\n\n constructor(props) {\n super(props);\n this.props.onRef && this.props.onRef(this);\n this.state = {\n value: props.value || '',\n visible: false\n }\n const { isHorizontalPad } = platform || {};\n this.isMobileEnvironment = !!isHorizontalPad;\n this.setTimer = null;\n }\n\n componentDidMount() {\n this.setState({ value: this.props.value || '' })\n }\n\n componentDidUpdate(props_old, b) {\n if (props_old.visible != this.props.visible && this.props.visible == true) {\n this.setState({ value: this.props.value || '' })\n }\n }\n\n inputChange = (v) => {\n //对移动端键盘处理。\n this.handleMobileKeyboard();\n let newValue;\n if (v === '') {\n newValue = '';\n } else {\n //键盘大小控制\n const { max = {}, min = {}, type, maxLength, precisionLength } = this.props;\n if (!tools.isNull(max.value)) {\n if (v > max.value) {\n if (!tools.isNull(max.tip)) Message.info(max.tip);\n return;\n }\n }\n if (!tools.isNull(min.value)) {\n if (v < min.value) {\n if (!tools.isNull(min.tip)) Message.info(min.tip);\n return\n };\n }\n \n if (v.match(/\\./g) && v.match(/\\./g).length > 1) {\n return;\n }\n if (type == \"positive\") { // 只允许输入正数\n newValue = (v + '').match(/\\d+\\.?\\d*/);\n } else {\n newValue = (v + '').match(/^(\\-)?[(\\d*)|(\\d+\\.?\\d*)]*$/);\n }\n let length1 = maxLength ? parseInt(maxLength) : -1;\n let length2 = parseInt(precisionLength);\n if (length1 >= 0 && length2 >= 0) {\n let v = newValue[0] + '', v1, v2;\n if (v.indexOf('-') != -1) {\n v = v.slice(1, v.length);\n }\n v1 = v.split('.')[0];\n v2 = v.split('.')[1];\n if ((v1 && v1.length > (length1 - length2)) || (v2 && v2.length > length2) || (v1 && v1.length > (length1 - length2))) {\n return;\n }\n if (length2 == 0 && v.indexOf('.') > 0) { // 不允许小数的时候,也不允许小数点\n return;\n }\n }\n }\n this.setState({\n value: newValue && newValue[0] || ''\n }, () => {\n this.props.onChange && this.props.onChange(this.state.value);\n })\n }\n\n onChange = (key) => {\n //对移动端键盘处理。\n this.handleMobileKeyboard();\n const { max = {}, min = {}, handleOk, onChange, maxLength, precisionLength } = this.props;\n if (key == 'sure') {\n handleOk && handleOk(this.state.value);\n return;\n }\n let length1 = maxLength ? parseInt(maxLength) : -1;\n let length2 = parseInt(precisionLength);\n if (length2 == 0 && key == '.') {\n return;\n }\n let value = this.state.value + '';\n if (value == '' && key == '.') { // 不允许小数的时候,也不允许小数点\n return;\n }\n\n if ((value + '').indexOf('.') > 0 && key == '.') {\n return;\n }\n let newValue = Keyboard.getNewValue(this.input.input, value, key, true);\n //键盘大小控制\n if (!tools.isNull(max.value)) {\n if (newValue > max.value) {\n if (!tools.isNull(max.tip)) Message.info(max.tip);\n return;\n }\n }\n if (!tools.isNull(min.value)) {\n if (newValue < min.value) {\n if (!tools.isNull(min.tip)) Message.info(min.tip);\n return\n };\n }\n\n if (length1 && length2) {\n let v = newValue, v1, v2;\n if (newValue.indexOf('-') != -1) {\n v = newValue.slice(1, newValue.length);\n }\n v1 = v.split('.')[0];\n v2 = v.split('.')[1];\n if ((v1 && v1.length > (length1 - length2)) || (v2 && v2.length > length2) || (v1 && v1.length > (length1 - length2))) {\n return;\n }\n }\n this.setState({\n value: newValue\n }, () => {\n onChange && onChange(this.state.value);\n })\n }\n\n getValue = () => {\n return this.state.value;\n }\n\n //针对在移动端环境下,不需要系统键盘时的处理。\n handleMobileKeyboard = () => {\n let el = this.input && this.input.input;\n if (el && this.isMobileEnvironment && env.os !== env.constant.os.ios) {\n console.log('执行方法handleMobileKeyboard', el);\n if (!el.setAttribute || !el.removeAttribute) return;\n el.setAttribute('readonly', 'readonly');\n if (this.setTimer) window.clearTimeout(this.setTimer);\n this.setTimer = setTimeout(() => { el.removeAttribute('readonly') }, 200);\n }\n }\n\n onFocus = (e) => {\n this.handleMobileKeyboard()\n }\n\n render() {\n let { visible, value } = this.state;\n return (\n <div className='number-keyboard-input'>\n <Input\n className={hotKey.hotKeyNotFilter('keyboard-input')}\n style={{ marginBottom: '24px' }}\n placeholder={this.props.placeholder || ''}\n value={value}\n onChange={(e) => this.inputChange(e.target.value)}\n onFocus={this.onFocus}\n onClick={this.handleMobileKeyboard}\n onSelect={this.handleMobileKeyboard}\n ref={input => this.input = input} \n />\n <Keyboard\n type='number2'\n positive={this.props.type}\n onChange={this.onChange}\n />\n </div>\n )\n }\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,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WO,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":["/**\n * input + 数字键盘\n * @props {boolean} type \"positive\" 只支持正数,不传正负都可以\n * @props {number} max 最大值\n * @props {number} min 最小值\n */\n\nimport React, { Component } from 'react';\nimport { Input } from 'antd';\nimport { platform } from 'mutants-util';\nimport { env } from 'mutants-microfx';\nimport { Keyboard } from '../../index';\nimport PropTypes from 'prop-types';\nimport tools from '../../util/tools'\nimport Message from '../message/index'\nimport hotKey from '../hotKey'\n\nexport default class KeyboardInput extends Component {\n\n static propTypes = {\n onChange: PropTypes.func.isRequired,\n placeholder: PropTypes.string,\n type: PropTypes.string,\n maxLength: PropTypes.number, // 总长度\n precisionLength: PropTypes.number, // 小数总长\n max: PropTypes.number,\n min: PropTypes.number,\n }\n\n constructor(props) {\n super(props);\n this.props.onRef && this.props.onRef(this);\n this.state = {\n value: props.value || '',\n visible: false\n }\n const { isHorizontalPad } = platform || {};\n this.isMobileEnvironment = !!isHorizontalPad;\n this.setTimer = null;\n }\n\n componentDidMount() {\n this.setState({ value: this.props.value || '' })\n }\n\n componentDidUpdate(props_old, b) {\n if (props_old.visible != this.props.visible && this.props.visible == true) {\n this.setState({ value: this.props.value || '' })\n }\n }\n\n inputChange = (v) => {\n //对移动端键盘处理。\n this.handleMobileKeyboard();\n let newValue;\n if (v === '') {\n newValue = '';\n } else {\n //键盘大小控制\n const { max = {}, min = {}, type, maxLength, precisionLength } = this.props;\n if (!tools.isNull(max.value)) {\n if (v > max.value) {\n if (!tools.isNull(max.tip)) Message.info(max.tip);\n return;\n }\n }\n if (!tools.isNull(min.value)) {\n if (v < min.value) {\n if (!tools.isNull(min.tip)) Message.info(min.tip);\n return\n };\n }\n \n if (v.match(/\\./g) && v.match(/\\./g).length > 1) {\n return;\n }\n if (type == \"positive\") { // 只允许输入正数\n newValue = (v + '').match(/\\d+\\.?\\d*/);\n } else {\n newValue = (v + '').match(/^(\\-)?[(\\d*)|(\\d+\\.?\\d*)]*$/);\n }\n let length1 = maxLength ? parseInt(maxLength) : -1;\n let length2 = parseInt(precisionLength);\n if (length1 >= 0 && length2 >= 0) {\n let v = newValue[0] + '', v1, v2;\n if (v.indexOf('-') != -1) {\n v = v.slice(1, v.length);\n }\n v1 = v.split('.')[0];\n v2 = v.split('.')[1];\n if ((v1 && v1.length > (length1 - length2)) || (v2 && v2.length > length2) || (v1 && v1.length > (length1 - length2))) {\n return;\n }\n if (length2 == 0 && v.indexOf('.') > 0) { // 不允许小数的时候,也不允许小数点\n return;\n }\n }\n }\n this.setState({\n value: newValue && newValue[0] || ''\n }, () => {\n this.props.onChange && this.props.onChange(this.state.value);\n })\n }\n\n onChange = (key) => {\n //对移动端键盘处理。\n this.handleMobileKeyboard();\n const { max = {}, min = {}, handleOk, onChange, maxLength, precisionLength } = this.props;\n if (key == 'sure') {\n handleOk && handleOk(this.state.value);\n return;\n }\n let length1 = maxLength ? parseInt(maxLength) : -1;\n let length2 = parseInt(precisionLength);\n if (length2 == 0 && key == '.') {\n return;\n }\n let value = this.state.value + '';\n if (value == '' && key == '.') { // 不允许小数的时候,也不允许小数点\n return;\n }\n\n if ((value + '').indexOf('.') > 0 && key == '.') {\n return;\n }\n let newValue = Keyboard.getNewValue(this.input.input, value, key, true);\n //键盘大小控制\n if (!tools.isNull(max.value)) {\n if (newValue > max.value) {\n if (!tools.isNull(max.tip)) Message.info(max.tip);\n return;\n }\n }\n if (!tools.isNull(min.value)) {\n if (newValue < min.value) {\n if (!tools.isNull(min.tip)) Message.info(min.tip);\n return\n };\n }\n\n if (length1 && length2) {\n let v = newValue, v1, v2;\n if (newValue.indexOf('-') != -1) {\n v = newValue.slice(1, newValue.length);\n }\n v1 = v.split('.')[0];\n v2 = v.split('.')[1];\n if ((v1 && v1.length > (length1 - length2)) || (v2 && v2.length > length2) || (v1 && v1.length > (length1 - length2))) {\n return;\n }\n }\n this.setState({\n value: newValue\n }, () => {\n onChange && onChange(this.state.value);\n })\n }\n\n getValue = () => {\n return this.state.value;\n }\n\n //针对在移动端环境下,不需要系统键盘时的处理。\n handleMobileKeyboard = () => {\n let el = this.input && this.input.input;\n if (el && this.isMobileEnvironment && env.os !== env.constant.os.ios) {\n console.log('执行方法handleMobileKeyboard', el);\n if (!el.setAttribute || !el.removeAttribute) return;\n el.setAttribute('readonly', 'readonly');\n if (this.setTimer) window.clearTimeout(this.setTimer);\n this.setTimer = setTimeout(() => { el.removeAttribute('readonly') }, 200);\n }\n }\n\n onFocus = (e) => {\n this.handleMobileKeyboard()\n }\n\n render() {\n let { visible, value } = this.state;\n return (\n <div className='number-keyboard-input'>\n <Input\n className={hotKey.hotKeyNotFilter('keyboard-input')}\n style={{ marginBottom: '24px' }}\n placeholder={this.props.placeholder || ''}\n value={value}\n onChange={(e) => this.inputChange(e.target.value)}\n onFocus={this.onFocus}\n onClick={this.handleMobileKeyboard}\n onSelect={this.handleMobileKeyboard}\n ref={input => this.input = input} />\n\n <Keyboard\n type='number2'\n positive={this.props.type}\n onChange={this.onChange} />\n </div>\n )\n }\n}"]}
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
@keyboard-font-color: #333;
|
|
3
3
|
@themeColor: #FF8C25;
|
|
4
4
|
.product-keyboarde-botton.letters-box {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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);
|
|
12
12
|
.letters {
|
|
13
13
|
max-width: 680px;
|
|
14
14
|
width:81%;
|
|
15
15
|
|
|
16
16
|
.letters-line {
|
|
17
|
-
|
|
17
|
+
height: 70px;
|
|
18
18
|
width: 100%;
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
overflow: hidden;
|
|
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:
|
|
39
|
+
font-size: 18px;
|
|
40
40
|
border-radius: 6px;
|
|
41
41
|
flex-direction: column;
|
|
42
42
|
justify-content: center;
|
|
@@ -57,16 +57,12 @@
|
|
|
57
57
|
width: 100%;
|
|
58
58
|
|
|
59
59
|
.num {
|
|
60
|
-
height:
|
|
61
|
-
line-height: 58px;
|
|
62
|
-
max-width: 164px;
|
|
63
|
-
min-width: 33%;
|
|
60
|
+
height: 40px;
|
|
64
61
|
margin: 0 0px 8px 0;
|
|
62
|
+
max-width: 164px;
|
|
65
63
|
padding: 0 12px;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
font-size: 25px;
|
|
69
|
-
}
|
|
64
|
+
line-height: 40px;
|
|
65
|
+
min-width: 33%;
|
|
70
66
|
}
|
|
71
67
|
}
|
|
72
68
|
|
|
@@ -77,6 +73,7 @@
|
|
|
77
73
|
.del {
|
|
78
74
|
height: 35px;
|
|
79
75
|
margin: 0 8px 8px 0;
|
|
76
|
+
|
|
80
77
|
}
|
|
81
78
|
|
|
82
79
|
.sure {
|
|
@@ -86,37 +83,41 @@
|
|
|
86
83
|
}
|
|
87
84
|
|
|
88
85
|
.key {
|
|
89
|
-
width: 9%;
|
|
90
86
|
max-width: 62px;
|
|
91
|
-
|
|
87
|
+
width: 9%;
|
|
88
|
+
height: 52px;
|
|
92
89
|
box-sizing: border-box;
|
|
93
90
|
float: left;
|
|
91
|
+
padding: 0 4px;
|
|
94
92
|
text-align: center;
|
|
95
93
|
cursor: pointer;
|
|
96
94
|
user-select: none;
|
|
95
|
+
// border: 1px solid #FF8C25;
|
|
96
|
+
// box-shadow: 0 2px 4px 0 rgba(242, 157, 14, 0.30);
|
|
97
|
+
;
|
|
97
98
|
border-radius: 6px;
|
|
98
|
-
padding: 0 4px;
|
|
99
99
|
span {
|
|
100
|
-
height: 100%;
|
|
101
100
|
display: flex;
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
height: 100%;
|
|
102
|
+
font-size: 18px;
|
|
104
103
|
border-radius: 6px;
|
|
105
|
-
|
|
104
|
+
flex-direction: column;
|
|
105
|
+
justify-content: center;
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
.handle {
|
|
110
110
|
width: 54px;
|
|
111
|
-
font-size: 20px;
|
|
112
111
|
.del {
|
|
112
|
+
float: none;
|
|
113
113
|
width: 54px;
|
|
114
|
-
height:
|
|
115
|
-
line-height: 72px;
|
|
114
|
+
height: 52px;
|
|
116
115
|
box-sizing: border-box;
|
|
117
116
|
float: left;
|
|
118
117
|
margin: 0 8px 18px 0;
|
|
119
118
|
text-align: center;
|
|
119
|
+
line-height: 52px;
|
|
120
|
+
font-size: 18px;
|
|
120
121
|
border-radius: 6px;
|
|
121
122
|
cursor: pointer;
|
|
122
123
|
user-select: none;
|
|
@@ -125,22 +126,26 @@
|
|
|
125
126
|
justify-content: center;
|
|
126
127
|
border-radius: 6px;
|
|
127
128
|
}
|
|
129
|
+
.clear {
|
|
130
|
+
font-size: 16px;
|
|
131
|
+
}
|
|
128
132
|
}
|
|
129
133
|
.is-number {
|
|
130
134
|
.delete {
|
|
131
|
-
height:
|
|
132
|
-
line-height:
|
|
135
|
+
height: 40px;
|
|
136
|
+
line-height: 40px;
|
|
133
137
|
margin: 0 8px 8px 0;
|
|
134
138
|
}
|
|
135
139
|
.clear {
|
|
136
|
-
height:
|
|
137
|
-
line-height:
|
|
140
|
+
height: 40px;
|
|
141
|
+
line-height: 40px;
|
|
138
142
|
margin: 0 8px 8px 0;
|
|
139
143
|
}
|
|
140
144
|
.sure {
|
|
141
|
-
height:
|
|
142
|
-
line-height:
|
|
145
|
+
height: 90px;
|
|
146
|
+
line-height: 90px;
|
|
143
147
|
}
|
|
148
|
+
|
|
144
149
|
}
|
|
145
150
|
.bold {
|
|
146
151
|
font-weight: 700;
|
|
@@ -80,11 +80,10 @@ 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
|
|
84
|
-
_props$imgStyle = _props.imgStyle,
|
|
85
|
-
imgStyle = _props$imgStyle === undefined ? {} : _props$imgStyle;
|
|
83
|
+
type = _props$type === undefined ? 'error' : _props$type;
|
|
86
84
|
|
|
87
85
|
var imgURL = imgRef[type];
|
|
86
|
+
|
|
88
87
|
return _react2.default.createElement(
|
|
89
88
|
'div',
|
|
90
89
|
{ className: 'progressState', style: style },
|
|
@@ -94,7 +93,7 @@ var EmptyAndErrorView = (_temp2 = _class = function (_Component) {
|
|
|
94
93
|
iconVisible && _react2.default.createElement(
|
|
95
94
|
'div',
|
|
96
95
|
{ className: 'icon' },
|
|
97
|
-
_react2.default.createElement('img', {
|
|
96
|
+
_react2.default.createElement('img', { src: imgURL })
|
|
98
97
|
),
|
|
99
98
|
info && _react2.default.createElement(
|
|
100
99
|
'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","
|
|
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;;;;;;;;;;;;;;sOAgDFC,a,GAAgB,UAACC,CAAD,EAAK;AAAA,gBACVC,OADU,GACC,MAAKC,KADN,CACVD,OADU;;AAEjBA,uBAAWA,QAAQD,CAAR,CAAX;AACH,S;;;;;iCAtCQ;AAAA,yBAEsF,KAAKE,KAF3F;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;;AAGL,gBAAMC,SAASf,OAAOc,IAAP,CAAf;;AAEA,mBACI;AAAA;AAAA,kBAAK,WAAU,eAAf,EAA+B,OAAOD,KAAtC;AACI;AAAA;AAAA;AACKL,mCACD;AAAA;AAAA,0BAAK,WAAU,MAAf;AACI,+DAAK,KAAKO,MAAV;AADJ,qBAFJ;AAMKN,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;;;EA9C2BI,gB,UAErBC,S,GAAY;AACfT,iBAAaU,oBAAUC,IADR;AAEfV,UAAMS,oBAAUE,MAFD;AAGfV,mBAAeQ,oBAAUC,IAHV;AAIfR,iBAAaO,oBAAUE,MAJR;AAKfR,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';\nimport { Button } from 'antd';\nimport PropTypes from 'prop-types';\n\n\nconst imgRef = {\n empty:'https://newretail.static.chanjet.com/empty.png',\n error:'https://newretail.static.chanjet.com/operation_error.png'\n}\n\nclass EmptyAndErrorView extends Component{\n\n static propTypes = {\n iconVisible: PropTypes.bool,\n info: PropTypes.string,\n buttonVisible: PropTypes.bool,\n buttonTitle: PropTypes.string,\n secondaryTip: PropTypes.string,\n onClick: PropTypes.func,\n style: PropTypes.object,\n type: PropTypes.string\n };\n\n render() {\n\n const {iconVisible, info, buttonVisible, buttonTitle,secondaryTip,style={},type='error'} = this.props;\n const imgURL = imgRef[type];\n\n return (\n <div className=\"progressState\" style={style}>\n <div>\n {iconVisible &&\n <div className=\"icon\">\n <img src={imgURL}/>\n </div>\n }\n {info &&\n <div className=\"text\">{info}</div>\n }\n {buttonVisible &&\n <div className=\"addBtn\">\n <Button type=\"primary\" onClick={this.onButtonClick}>\n {buttonTitle}\n </Button>\n </div>\n }\n </div>\n {secondaryTip &&\n <div className=\"secondaryTip\">\n <span className=\"tipLabel\">提示 :</span>\n <div className=\"tipContent\"> {secondaryTip}</div>\n </div>\n }\n\n </div>\n );\n }\n\n onButtonClick = (e)=>{\n const {onClick} = this.props;\n onClick && onClick(e);\n }\n\n}\n\nexport default EmptyAndErrorView;"]}
|
|
@@ -139,8 +139,7 @@ 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
|
|
143
|
-
imgStyle: _propTypes2.default.object
|
|
142
|
+
style: _propTypes2.default.object
|
|
144
143
|
}),
|
|
145
144
|
error: _propTypes2.default.shape({
|
|
146
145
|
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","
|
|
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,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ingContent';\nimport EmptyAndErrorView from './EmptyAndErrorView';\nimport './style.less';\nimport PropTypes from 'prop-types';\n\nclass ProgressState extends React.Component {\n static defaultProps = {\n state: 'show',\n error: {iconVisible:true, buttonTitle: '重试', buttonVisible: true},\n empty: {iconVisible:true, info: '哎呀, 这里空空的什么都没有', buttonTitle: '刷新', buttonVisible: true},\n };\n\n static defaultLoadProps = {\n style:{position:'relative'}\n }\n\n /**\n * 返回 ProgressState, 规则如下:\n * 1. error 优先,如果有error, 则状态为 error\n * 2. 否则如果 loading, 则状态为 load\n * 3. 否则如果 notEmpty, 则状态为 show\n * 4. 否则为 empty\n * @param loading\n * @param notEmptu\n * @param error\n * @returns {*}\n */\n static gotProgressState = (loading, notEmpty, error) => {\n let progressState;\n\n if (error) {\n progressState = 'error';\n }\n else if (loading) {\n progressState = 'load';\n }\n else if (notEmpty) {\n progressState = 'show';\n }\n else {\n progressState = 'empty';\n }\n\n return progressState;\n };\n\n static propTypes = {\n state: PropTypes.oneOf(['wait', 'load', 'show', 'error', 'empty']),\n load: PropTypes.shape({\n text: PropTypes.string,\n className: PropTypes.string,\n style: PropTypes.object,\n }),\n empty: PropTypes.shape({\n iconVisible:PropTypes.bool,\n info: PropTypes.string,\n buttonTitle: PropTypes.string,\n onClick: PropTypes.func,\n buttonVisible: PropTypes.bool,\n style: PropTypes.object\n }),\n error: PropTypes.shape({\n iconVisible:PropTypes.bool,\n info: PropTypes.string,\n buttonTitle: PropTypes.string,\n onClick: PropTypes.func,\n buttonVisible: PropTypes.bool\n }),\n children: PropTypes.node,\n className: PropTypes.string,\n style: PropTypes.object,\n stateCommonStyle: PropTypes.object\n };\n\n render() {\n const {\n state,\n load = {style:{}},\n empty = {style:{}},\n error = {style:{}},\n children,\n style,\n stateCommonStyle = {},\n className,\n } = this.props;\n const baseStyle = className ? {} : {height: '100%'};\n empty.style = {...stateCommonStyle,...empty.style};\n error.style = {...stateCommonStyle,...error.style};\n load.style ={...stateCommonStyle,...load.style};\n return (\n <div className={className} style={Object.assign(baseStyle,style)}>\n {children}\n {state === 'load' &&\n <LoadingView {...load}/>\n }\n {state === 'empty' && empty &&\n <EmptyAndErrorView type={'empty'} {...ProgressState.defaultProps.empty} {...empty} />\n }\n {state === 'error' && error &&\n <EmptyAndErrorView type={'error'} {...ProgressState.defaultProps.error} {...error} />\n }\n </div>\n );\n }\n}\n\nexport default ProgressState;\n"]}
|
|
@@ -208,8 +208,6 @@ var _index2 = require('./prototypeTable/index');
|
|
|
208
208
|
|
|
209
209
|
var _index3 = _interopRequireDefault(_index2);
|
|
210
210
|
|
|
211
|
-
var _tplusComponentsTouch = require('tplus-components-touch');
|
|
212
|
-
|
|
213
211
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
214
212
|
|
|
215
213
|
var hasElectron = _mutantsMicrofx.env.platform === _mutantsMicrofx.env.constant.platform.electron;
|
|
@@ -327,7 +325,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
|
327
325
|
var _enumController$getEn = _mutantsUtil.enumController.getEnumOj(),
|
|
328
326
|
PayStyle = _enumController$getEn.PayStyle;
|
|
329
327
|
|
|
330
|
-
_this2.store.init(_this2.props.type == 1 ? null : _this2.context, _this2.props.onHandleAmount, _this2.props.dataSource.Code_02, _this2.props.storeInfo, true, _this2.props.amount, _this2.props.type, _this2.props.dto
|
|
328
|
+
_this2.store.init(_this2.props.type == 1 ? null : _this2.context, _this2.props.onHandleAmount, _this2.props.dataSource.Code_02, _this2.props.storeInfo, true, _this2.props.amount, _this2.props.type, _this2.props.dto);
|
|
331
329
|
var amount = _this2.store.paymode.amount;
|
|
332
330
|
if (amount == 0) {
|
|
333
331
|
_this2.settleZero();
|
|
@@ -452,7 +450,8 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
|
452
450
|
}
|
|
453
451
|
item.InventoryName = item.Inventory.Name;
|
|
454
452
|
item.Discount = (0, _utils.getRoundValue)(item.RetailPrice - item.TaxPrice, pricePrecision);
|
|
455
|
-
item.TotalDiscount =
|
|
453
|
+
//item.TotalDiscount = getFixedNumber(item.Discount * item.Quantity);
|
|
454
|
+
item.TotalDiscount = item.DetailDiscountAmount;
|
|
456
455
|
item.nAmount = (0, _utils.getFixedNumber)(item.TaxAmount);
|
|
457
456
|
item.UnitName = item.Unit.Name;
|
|
458
457
|
item.nQuantity = (0, _utils.getRoundValue)(item.Quantity, quantityPrecision);
|
|
@@ -2892,7 +2891,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
|
2892
2891
|
settleDisabled: false
|
|
2893
2892
|
});
|
|
2894
2893
|
that.store.bquick && that.props.onCancelSettle && that.props.onCancelSettle();
|
|
2895
|
-
that.store.
|
|
2894
|
+
that.store.delPay(paymode.paymethodId);
|
|
2896
2895
|
reject('\u652F\u4ED8\u65B9\u5F0F: ' + paymode.name + '\u5931\u8D25');
|
|
2897
2896
|
} },
|
|
2898
2897
|
'\u53D6\u6D88'
|
|
@@ -5072,7 +5071,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
|
5072
5071
|
_react2.default.createElement(
|
|
5073
5072
|
'div',
|
|
5074
5073
|
{ className: 'djq2' },
|
|
5075
|
-
|
|
5074
|
+
(0, _map3.default)(currentMode && currentMode.djqs || [], function (q, index) {
|
|
5076
5075
|
if (!_this8.state.couponLight && !q.count) {
|
|
5077
5076
|
return;
|
|
5078
5077
|
}
|
|
@@ -5182,10 +5181,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
|
5182
5181
|
_react2.default.createElement('div', { className: 'point_top' }),
|
|
5183
5182
|
_react2.default.createElement('div', { className: 'point_bottom' })
|
|
5184
5183
|
);
|
|
5185
|
-
})
|
|
5186
|
-
state: "empty",
|
|
5187
|
-
stateCommonStyle: { 'paddingTop': "30px", backgroundColor: 'transparent' },
|
|
5188
|
-
empty: { buttonVisible: false, imgStyle: { width: '120px', height: '120px' } } })
|
|
5184
|
+
})
|
|
5189
5185
|
)
|
|
5190
5186
|
),
|
|
5191
5187
|
currentMode && !currentMode.boriginReturn && _react2.default.createElement(
|