@ttk/component
Version:
ttk组件库
145 lines (127 loc) • 5.33 kB
JavaScript
import { _ as _inherits, a as _getPrototypeOf, b as _possibleConstructorReturn, c as _classCallCheck, e as _assertThisInitialized, d as _createClass } from '../getPrototypeOf-b95655c5.js';
import React__default, { PureComponent } from 'react';
import { Checkbox, Button } from 'antd';
import '../_commonjsHelpers-471920d6.js';
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
var exportOptionComponent = /*#__PURE__*/function (_PureComponent) {
_inherits(exportOptionComponent, _PureComponent);
var _super = _createSuper(exportOptionComponent);
function exportOptionComponent(props) {
var _this;
_classCallCheck(this, exportOptionComponent);
_this = _super.call(this, props);
_this.changeAccount = function (e, checkType) {
if (checkType == 'printAccountChecked') {
_this.setState({
printAccountChecked: e.target.checked
});
} else if (checkType == 'printQuantityChecked') {
_this.setState({
printQuantityChecked: e.target.checked
});
} else if (checkType == 'printMultiChecked') {
_this.setState({
printMultiChecked: e.target.checked
});
}
};
_this.confirm = function () {
_this.props.closeModal();
_this.props.callBack(_assertThisInitialized(_this));
};
_this.cancel = function () {
_this.props.closeModal();
};
var printAuxAccCalc = props.printAuxAccCalc,
isPrintQuantity = props.isPrintQuantity,
isPrintMulti = props.isPrintMulti;
props.type;
props.maxLineNum;
props.width;
props.height;
_this.state = {
printAccountChecked: printAuxAccCalc == 1 ? true : false,
printQuantityChecked: isPrintQuantity == 1 ? true : false,
printMultiChecked: isPrintMulti == 1 ? true : false
};
return _this;
}
_createClass(exportOptionComponent, [{
key: "handleCancelClick",
value: function handleCancelClick() {
this.closeModal();
}
}, {
key: "handleConfirmClick",
value: function handleConfirmClick() {
this.state.data;
var printAccountChecked = this.state.printAccountChecked,
printQuantityChecked = this.state.printQuantityChecked,
printMultiChecked = this.state.printMultiChecked,
exportOption = {
printAccountChecked: printAccountChecked,
printQuantityChecked: printQuantityChecked,
printMultiChecked: printMultiChecked
};
sessionStorage.setItem('exportOption', JSON.stringify(exportOption));
var confirmBtn = document.getElementsByClassName('ant-btn ant-btn-primary');
for (var i = 0; i < confirmBtn.length; i++) {
if (confirmBtn[i].innerHTML == '<span>确 定</span>') {
confirmBtn[i].click();
}
}
}
}, {
key: "render",
value: function render() {
var _this2 = this;
var buttonStyle = {
marginTop: '37px',
display: 'flex',
justifyContent: 'center',
borderTop: 'solid 1px #e7e6e6',
paddingBottom: '12px'
};
return /*#__PURE__*/React__default.createElement("div", {
style: {
width: '100%',
textAlign: 'center',
marginTop: '26px',
fontSize: '13px'
}
}, /*#__PURE__*/React__default.createElement(Checkbox, {
checked: this.state.printAccountChecked,
onChange: function onChange(e) {
_this2.changeAccount(e, 'printAccountChecked');
}
}, "\u8F85\u52A9\u6838\u7B97"), /*#__PURE__*/React__default.createElement(Checkbox, {
checked: this.state.printQuantityChecked,
onChange: function onChange(e) {
_this2.changeAccount(e, 'printQuantityChecked');
}
}, "\u6570\u91CF\u6838\u7B97"), /*#__PURE__*/React__default.createElement(Checkbox, {
checked: this.state.printMultiChecked,
onChange: function onChange(e) {
_this2.changeAccount(e, 'printMultiChecked');
}
}, "\u5916\u5E01\u6838\u7B97"), /*#__PURE__*/React__default.createElement("div", {
style: buttonStyle
}, /*#__PURE__*/React__default.createElement(Button, {
style: {
marginTop: '12px'
},
onClick: this.cancel
}, "\u53D6\u6D88"), /*#__PURE__*/React__default.createElement(Button, {
style: {
marginLeft: '8px',
marginTop: '12px'
},
type: "primary",
onClick: this.confirm
}, "\u786E\u5B9A")));
}
}]);
return exportOptionComponent;
}(PureComponent);
export { exportOptionComponent as default };