"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _tab = _interopRequireDefault(require("@alifd/next/lib/tab"));
var _button = _interopRequireDefault(require("@alifd/next/lib/button"));
var _icon = _interopRequireDefault(require("@alifd/next/lib/icon"));
var _loading = _interopRequireDefault(require("@alifd/next/lib/loading"));
var _dialog = _interopRequireDefault(require("@alifd/next/lib/dialog"));
var _upload = _interopRequireDefault(require("@alifd/next/lib/upload"));
var _table = _interopRequireDefault(require("@alifd/next/lib/table"));
var _datePicker = _interopRequireDefault(require("@alifd/next/lib/date-picker"));
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _input = _interopRequireDefault(require("@alifd/next/lib/input"));
var _message = _interopRequireDefault(require("@alifd/next/lib/message"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _field = _interopRequireDefault(require("@alifd/next/lib/field"));
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
var _select = _interopRequireDefault(require("@alifd/next/lib/select"));
var _form = _interopRequireDefault(require("@alifd/next/lib/form"));
var React = _interopRequireWildcard(require("react"));
require("./index.scss");
var _utils = require("../../../utils/utils");
var _editor = _interopRequireDefault(require("./editor"));
var _view = _interopRequireDefault(require("./input-select/view1"));
var _base = require("../../../api/base");
var _global = _interopRequireDefault(require("../../../utils/global"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
// import { prizeMessage,byIdEchoMessage } from '../../../api/base'

var activityId = _utils.$_GET.activityId;

// import { imgUpload } from '../../../api/base'
var FormItem = _form["default"].Item;
var Option = _select["default"].Option;
// const dataSource = () => {
//   const result = [];
//   for (let i = 0; i < 6; i++) {
//     result.push({
//       id: 100306660940 + i,
//       num: i,
//       putAway: true,
//       product: [
//         {
//           title: '电饭锅',
//           avatar:
//             'https://sc02.alicdn.com/kf/HTB1efnNLVXXXXbtXpXXq6xXFXXXN/Light-100-acrylic-fashionabe-snood-shawl-weight.jpg_220x220.jpg',
//           brand: '松下',
//           price: '199',
//         },
//       ],
//     });
//   }
//   return result;
// };
var ActivityForm = /*#__PURE__*/function (_Component) {
  (0, _inheritsLoose2["default"])(ActivityForm, _Component);
  function ActivityForm(props, context) {
    var _this;
    _this = _Component.call(this, props, context) || this;
    _this.field = new _field["default"]((0, _assertThisInitialized2["default"])(_this));
    _this.getSelectList = /*#__PURE__*/function () {
      var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(array) {
        var renderArray;
        return _regenerator["default"].wrap(function _callee$(_context) {
          while (1) {
            switch (_context.prev = _context.next) {
              case 0:
                // console.log("这个数组array",array)
                renderArray = [];
                array.map(function (item) {
                  var product = [{
                    title: item.label,
                    avatar: item.shopImg,
                    price: item.price1,
                    id: item.value
                    // shopID:item.shopID
                  }];

                  renderArray.push({
                    // 概率
                    winProbility: item.winProbility,
                    // 数量
                    num: item.num,
                    product: product
                  });
                  return renderArray;
                });
                setTimeout(function () {
                  _this.setState({
                    dataSource: renderArray
                  });
                  _this.writeGlobalShop(renderArray);
                }, 0);
              case 3:
              case "end":
                return _context.stop();
            }
          }
        }, _callee);
      }));
      return function (_x) {
        return _ref.apply(this, arguments);
      };
    }();
    _this.handleSubmit = function () {
      _this.setState({
        LoadingVisible: true
      });
      setTimeout(function () {
        _this.setState({
          LoadingVisible: false
        });
        _this.handleSubmit1();
        // this.props.value.visible =false
        _this.sendData();
      }, 2000);
    };
    _this.onChangeUploadImg = function () {
      // console.log('onChange callback : ', info);
    };
    _this.onSuccessUploadImg = function () {
      // this.setState({
      //   UploadImg: res.data.url,
      // });
      // console.log('onSuccess callback : ', res, file);
    };
    _this.handleSubmit1 = function () {
      var obj = {
        lotteryCount: _this.field.getValue('lotteryCount'),
        prizeAccess: _this.field.getValue('prizeAccess'),
        share: _this.field.getValue('share'),
        startTime: _this.field.getValue('startTime'),
        endTime: _this.field.getValue('endTime')
      };
      _this.setState({
        myEditor: obj
      });
      _this.writeGlobalorrelation(obj);
      setTimeout(function () {
        _message["default"].notice('保存成功');
      }, 1000);
      // console.log('value & errors', values, errors);
    };
    _this.productRender = function (product) {
      return /*#__PURE__*/React.createElement("div", {
        className: "media"
      }, /*#__PURE__*/React.createElement("img", {
        src: product[0].avatar,
        className: "media-side"
      }), /*#__PURE__*/React.createElement("div", {
        className: "media-content"
      }, product[0].title), /*#__PURE__*/React.createElement("div", {
        className: "media-bottom"
      }, /*#__PURE__*/React.createElement("div", null, product[0].price)));
    };
    _this.onAdd = function () {
      // this.setState({
      //   changePanel: 1,
      // });
      _this.onOpen();
    };
    _this.onRemove = function (id) {
      // eslint-disable-next-line @typescript-eslint/no-shadow
      var dataSource = _this.state.dataSource;
      var index = -1;
      dataSource.forEach(function (item, i) {
        if (item.id === id) {
          index = i;
        }
      });
      if (index !== -1) {
        dataSource.splice(index, 1);
        _this.setState({
          dataSource: dataSource
        });
      }
    };
    _this.onEditor = function (id) {
      // eslint-disable-next-line @typescript-eslint/no-shadow
      var dataSource = _this.state.dataSource;
      // this.setState({
      //   setPanelData: id,
      // });
      dataSource.forEach(function (item) {
        if (item.id === id) {
          _this.field.setValue('PrizeName', item.product[0].title);
          _this.field.setValue('CountNum', item.num);
          _this.field.setValue('MarkPrice', item.product[0].price);
          _this.field.setValue('PrizeBrand', item.product[0].brand);
        }
      });
      _this.setState({
        dataSource: dataSource
      });
      // this.setState({
      //   changePanel: 2,
      // });
      _this.onOpen();
    };
    _this.putAway = function (id) {
      // eslint-disable-next-line @typescript-eslint/no-shadow
      var dataSource = _this.state.dataSource;
      dataSource.forEach(function (item) {
        if (item.id === id) {
          item.putAway = !item.putAway;
        }
      });
      _this.setState({
        dataSource: dataSource
      });
    };
    _this.onOpen = function () {
      _this.setState({
        panel: true
      });
    };
    _this.onSenDate = function () {
      // eslint-disable-next-line @typescript-eslint/no-shadow
      var dataSource = _this.state.dataSource;
      _this.setState({
        dataSource: dataSource
      });
    };
    _this.sendData = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
      var _dataSource$;
      var dataSource, PrizeArray, obj;
      return _regenerator["default"].wrap(function _callee2$(_context2) {
        while (1) {
          switch (_context2.prev = _context2.next) {
            case 0:
              dataSource = _this.state.dataSource;
              if (!(activityId && (_dataSource$ = dataSource[0]) !== null && _dataSource$ !== void 0 && _dataSource$.product)) {
                _context2.next = 6;
                break;
              }
              _context2.next = 4;
              return (0, _base.byIdEchoMessage)(activityId);
            case 4:
              PrizeArray = _context2.sent;
              PrizeArray.data.xa.forEach(function (item, index) {
                dataSource[index].product[0].shopID = item === null || item === void 0 ? void 0 : item.a;
              });
            case 6:
              obj = {
                myEditor: _this.state.myEditor,
                myPrize: dataSource,
                baseProbability: _this.state.baseProbability,
                type: 1
              };
              console.log("obj", obj);
              _this.props.change(obj);
              return _context2.abrupt("return", obj);
            case 10:
            case "end":
              return _context2.stop();
          }
        }
      }, _callee2);
    }));
    _this.onChange = function () {
      _this.setState({
        // loading: true
      });
      setTimeout(function () {
        _this.setState({
          dataSource: dataSource()
          // loading: false
        });
      }, 200);
    };
    _this.inputBaseProbability = function (v) {
      // 设置到概率基数
      _this.setState({
        baseProbability: v
      });
      _this.writeGlobalProbality(v);
    };
    _this.echoData = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
      var PrizeArray, _PrizeArray$data, d, h, i, j, k, c, echoDataList, _global$Prize$shop, _echoDataList;
      return _regenerator["default"].wrap(function _callee3$(_context3) {
        while (1) {
          switch (_context3.prev = _context3.next) {
            case 0:
              if (!activityId) {
                _context3.next = 16;
                break;
              }
              _context3.next = 3;
              return (0, _base.byIdEchoMessage)(activityId);
            case 3:
              PrizeArray = _context3.sent;
              //     抽奖次数/每ID    d
              //     获奖方式               h
              //     分享与推广             i
              //     抽奖开始时间           j   
              //     抽奖结束时间           k   
              //     奖品列表   
              //     概率基数    c
              //     奖品    奖品数量   h
              //     奖品名称   xa.e
              //     奖品图片   xc.c
              _PrizeArray$data = PrizeArray.data, d = _PrizeArray$data.d, h = _PrizeArray$data.h, i = _PrizeArray$data.i, j = _PrizeArray$data.j, k = _PrizeArray$data.k, c = _PrizeArray$data.c; // 基数
              _this.inputBaseProbability(c);
              // 抽奖次数
              _this.field.setValue('lotteryCount', d);
              // 获奖方式
              _this.field.setValue('prizeAccess', h);
              // 分享与推广
              _this.field.setValue('share', i);
              // 开始时间
              _this.field.setValue('startTime', j);
              // 结束时间
              _this.field.setValue('endTime', k);
              echoDataList = [];
              PrizeArray.data.xa.map(function (item) {
                var _item$xc$;
                echoDataList.push({
                  label: item.e,
                  num: item.h,
                  price1: 0,
                  shopImg: (_item$xc$ = item.xc[0]) === null || _item$xc$ === void 0 ? void 0 : _item$xc$.c,
                  shopID: item === null || item === void 0 ? void 0 : item.a,
                  value: item.d,
                  winProbility: 0
                });
                return echoDataList;
              });
              _this.setState({
                sendChildData: echoDataList
              });
              // console.log("echoDataList123",echoDataList)
              _context3.next = 25;
              break;
            case 16:
              _echoDataList = []; // 基数
              _this.inputBaseProbability(_global["default"].Prize.Probability);
              // 抽奖次数
              _this.field.setValue('lotteryCount', _global["default"].Prize.lotteryCount);
              // 获奖方式
              _this.field.setValue('prizeAccess', _global["default"].Prize.prizeAccess);
              // 分享与推广
              _this.field.setValue('share', _global["default"].Prize.share);
              // 开始时间
              _this.field.setValue('startTime', _global["default"].Prize.startTime);
              // 结束时间
              _this.field.setValue('endTime', _global["default"].Prize.endTime);
              (_global$Prize$shop = _global["default"].Prize.shop) === null || _global$Prize$shop === void 0 ? void 0 : _global$Prize$shop.map(function (item) {
                _echoDataList.push({
                  label: item.product[0].title,
                  num: item.product[0].num,
                  price1: item.product[0].price,
                  shopImg: item.product[0].avatar,
                  value: item.product[0].id,
                  // 奖品里面每个奖项的ID
                  // shopID: item.product[0].shopID,      
                  winProbility: 0
                });
                return _echoDataList;
              });
              _this.setState({
                sendChildData: _echoDataList
              });
            case 25:
            case "end":
              return _context3.stop();
          }
        }
      }, _callee3);
    }));
    _this.byIdEchoFun = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
      var PrizeArray, _PrizeArray$data2, d, h, i, j, k, c, echoDataList;
      return _regenerator["default"].wrap(function _callee4$(_context4) {
        while (1) {
          switch (_context4.prev = _context4.next) {
            case 0:
              if (!activityId) {
                _context4.next = 14;
                break;
              }
              _context4.next = 3;
              return (0, _base.byIdEchoMessage)(activityId);
            case 3:
              PrizeArray = _context4.sent;
              //     抽奖次数/每ID    d
              //     获奖方式               h
              //     分享与推广             i
              //     抽奖开始时间           j   
              //     抽奖结束时间           k   
              //     奖品列表   
              //     概率基数    c
              //     奖品    奖品数量   h
              //     奖品名称   xa.e
              //     奖品图片   xc.c
              _PrizeArray$data2 = PrizeArray.data, d = _PrizeArray$data2.d, h = _PrizeArray$data2.h, i = _PrizeArray$data2.i, j = _PrizeArray$data2.j, k = _PrizeArray$data2.k, c = _PrizeArray$data2.c; // 基数
              _this.inputBaseProbability(c);
              // 抽奖次数
              _this.field.setValue('lotteryCount', d);
              // 获奖方式
              _this.field.setValue('prizeAccess', h);
              // 分享与推广
              _this.field.setValue('share', i);
              // 开始时间
              _this.field.setValue('startTime', j);
              // 结束时间
              _this.field.setValue('endTime', k);
              echoDataList = [];
              PrizeArray.data.xa.map(function (item) {
                var _item$xc$2;
                echoDataList.push({
                  label: item.e,
                  num: item.h,
                  price1: 0,
                  shopImg: (_item$xc$2 = item.xc[0]) === null || _item$xc$2 === void 0 ? void 0 : _item$xc$2.c,
                  shopID: item === null || item === void 0 ? void 0 : item.a,
                  value: item.d,
                  winProbility: 0
                });
                return echoDataList;
              });
              _this.setState({
                sendChildData: echoDataList
              });
              // console.log("echoDataList123",echoDataList)
            case 14:
            case "end":
              return _context4.stop();
          }
        }
      }, _callee4);
    }));
    _this.writeGlobalProbality = function (x) {
      _global["default"].Prize.Probability = x;
    };
    _this.writeGlobalorrelation = function (obj) {
      // 抽奖次数/每ID
      _global["default"].Prize.lotteryCount = obj.lotteryCount;
      // 获奖方式
      _global["default"].Prize.prizeAccess = obj.prizeAccess;
      // 分享与推广
      _global["default"].Prize.share = obj.share;
      // 开始时间
      _global["default"].Prize.startTime = obj.startTime;
      // 结束时间
      _global["default"].Prize.endTime = obj.endTime;
    };
    _this.writeGlobalShop = function (obj) {
      _global["default"].Prize.shop = obj;
    };
    _this.state = {
      LoadingVisible: false,
      panel: false,
      // changePanel: 1,
      // setPanelData: null,
      dataSource: [],
      // 参数设置
      myEditor: {},
      // 奖品设置
      // myPrize: {},
      // UploadImg: '',
      // 传递给子组件的东西
      sendChildData: []
    };
    return _this;
  }

  // 点击确定按钮 添加的奖品   (**********************************************)
  var _proto = ActivityForm.prototype;
  // 一进来就调用回显接口
  _proto.componentDidMount = function componentDidMount() {
    // this.byIdEchoFun()
    this.echoData();
  }
  // 回显数据（单纯的，点击打开关闭，保留在浏览器里面。下次进来不会有）
  ;
  _proto.render = function render() {
    var _this2 = this;
    var tabs = [{
      tab: '参数设置',
      key: 0,
      formItemLayout: {
        labelCol: {
          span: 6
        },
        wrapperCol: {
          span: 6
        }
      },
      message: true
    }, {
      tab: '奖品设置',
      key: 1,
      formItemLayout: {
        labelCol: {
          span: 6
        },
        wrapperCol: {
          span: 18
        }
      }
    }];
    var formStyle = {
      style: {
        padding: '18px 32px'
      }
    };
    var formItemLayout = {
      labelCol: {
        fixedSpan: 8
      },
      wrapperCol: {
        span: 14
      }
    };
    // const tipLoading = {
    //   style: {
    //     margin:'0 auto'
    //   }
    // }
    // const notice = () => {
    //   Message.notice('This is a Toast Message Notice');
    // };
    var renderPage = function renderPage(e) {
      var init = _this2.field.init;
      if (e === 0) {
        return /*#__PURE__*/React.createElement("div", formStyle, /*#__PURE__*/React.createElement(_form["default"], (0, _extends2["default"])({
          style: {
            width: '60%'
          }
        }, formItemLayout, {
          colon: true
        }), /*#__PURE__*/React.createElement(FormItem, {
          name: "lotteryCount",
          label: "\u62BD\u5956\u6B21\u6570/\u6BCFID",
          required: true
        }, /*#__PURE__*/React.createElement(_input["default"], init('lotteryCount'))), /*#__PURE__*/React.createElement(FormItem, {
          label: "\u83B7\u5956\u65B9\u5F0F",
          name: "prizeAccess"
        }, /*#__PURE__*/React.createElement(_select["default"], init('prizeAccess'), /*#__PURE__*/React.createElement(Option, {
          value: "1"
        }, "\u4E2D\u5956\u8005\u8054\u7CFB\u6211"))), /*#__PURE__*/React.createElement(FormItem, {
          label: "\u5206\u4EAB\u4E0E\u63A8\u5E7F",
          name: "share"
        }, /*#__PURE__*/React.createElement(_select["default"], init('share'), /*#__PURE__*/React.createElement(Option, {
          value: "1"
        }, "\u5206\u4EAB\u6210\u529F\u8D60\u9001\u62BD\u5956\u6B21\u6570"))), /*#__PURE__*/React.createElement(FormItem, {
          label: "\u62BD\u5956\u5F00\u59CB\u65F6\u95F4",
          name: "startTime"
        }, /*#__PURE__*/React.createElement(_datePicker["default"], (0, _extends2["default"])({
          format: "YYYY-MM-DD"
        }, init('startTime')))), /*#__PURE__*/React.createElement(FormItem, {
          label: "\u62BD\u5956\u7ED3\u675F\u65F6\u95F4",
          name: "endTime"
        }, /*#__PURE__*/React.createElement(_datePicker["default"], (0, _extends2["default"])({
          format: "YYYY-MM-DD"
        }, init('endTime')))), /*#__PURE__*/React.createElement(FormItem, {
          label: " ",
          colon: false,
          size: "large"
        })), /*#__PURE__*/React.createElement("div", {
          className: "tipMessage"
        }, "\u5907\u6CE8\uFF1A\u8F93\u5165 0 \u4E3A\u4E0D\u9650\u5236"));
      } else if (e === 1) {
        var _getCookieData;
        var renderOper = function renderOper(value, index, record) {
          return /*#__PURE__*/React.createElement("div", {
            className: "renderOperStyle"
          }, /*#__PURE__*/React.createElement("div", {
            onClick: _this2.onRemove.bind(_this2, record.id)
          }, "\u5220\u9664"));
        };
        var style = {
          style: {
            width: '30%',
            borderRadius: '12px',
            boxShadow: '0 9px 29px 0 rgba(0, 0, 0, 0.2)'
          }
        };
        var disStyle = {
          style: {
            display: 'flex',
            alignItems: 'center',
            paddingBottom: '8px'
          }
        };
        var selecInputStyle = {
          style: {
            "with": "40%",
            padding: "0 20px"
          }
        };
        var BaseProbabilityStyle = {
          style: {
            display: 'flex',
            alignItems: 'center',
            paddingBottom: '8px'
          }
        };

        // 可编辑数量
        var renderNum = function renderNum(value, index) {
          // let args = '';
          var dataSource = _this2.state.dataSource;
          var fn = function fn(arg) {
            // args = arg
            dataSource[index].product[0].num = Number(arg);
            return dataSource;
            // return (
            //   dataSource[index].product[0].num = Number(arg)
            // )
          };
          // const _data = Object.assign({}, this.state.dataSource[index].product[index], { num: Number(args) })
          //   const data = JSON.parse(JSON.stringify(_data))
          //   this.setState({
          //     dataSource: data
          //   })
          return /*#__PURE__*/React.createElement(_editor["default"], {
            defaultTitle: value,
            fn: fn,
            kinds: "1"
          });
        };
        // 可编辑中奖概率
        // const renderWin = (value) => {
        //   // console.log("value2", value)
        //   // console.log("index2", index)
        //   // console.log("record2", record)
        //   return <EditablePane defaultTitle={value} kinds="2" />;
        // }

        return /*#__PURE__*/React.createElement("div", formStyle, /*#__PURE__*/React.createElement("div", disStyle, /*#__PURE__*/React.createElement("div", {
          style: {
            whiteSpace: 'nowrap'
          }
        }, "\u5956\u54C1\u5217\u8868"), /*#__PURE__*/React.createElement("div", selecInputStyle, /*#__PURE__*/React.createElement(_view["default"], {
          getSelectList: function getSelectList(x) {
            return _this2.getSelectList(x);
          },
          sendData: _this2.state.sendChildData
        }))), /*#__PURE__*/React.createElement("div", BaseProbabilityStyle, /*#__PURE__*/React.createElement("div", {
          style: {
            paddingRight: '100px'
          }
        }, "\u6982\u7387\u57FA\u6570"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_input["default"], {
          placeholder: "\u8BF7\u8F93\u5165\u6982\u7387\u57FA\u6570",
          onChange: _this2.inputBaseProbability,
          value: _this2.state.baseProbability
        }))), /*#__PURE__*/React.createElement(_table["default"], {
          maxBodyHeight: 400,
          dataSource: _this2.state.dataSource
        }, /*#__PURE__*/React.createElement(_table["default"].Column, {
          cell: _this2.productRender,
          title: "\u5546\u54C1",
          dataIndex: "product",
          width: "50%"
        }), /*#__PURE__*/React.createElement(_table["default"].Column, {
          title: "\u6570\u91CF",
          dataIndex: "num",
          cell: renderNum,
          width: "20%"
        }), /*#__PURE__*/React.createElement(_table["default"].Column, {
          title: "\u64CD\u4F5C",
          dataIndex: "putAway",
          cell: renderOper,
          width: "20%"
        })), /*#__PURE__*/React.createElement(_dialog["default"], (0, _extends2["default"])({
          height: "60%",
          title: "\u5546\u54C1\u5217\u8868",
          visible: _this2.state.panel
          // onOk={this.onOK}
          ,
          onClose: _this2.onClose,
          footerActions: ['ok']
        }, style), /*#__PURE__*/React.createElement("div", formStyle, /*#__PURE__*/React.createElement(_form["default"], (0, _extends2["default"])({
          style: {
            width: '60%'
          }
        }, formItemLayout, {
          colon: true
        }), /*#__PURE__*/React.createElement(FormItem, {
          name: "PrizeName",
          label: "\u5956\u54C1\u540D\u79F0",
          required: true
        }, /*#__PURE__*/React.createElement(_input["default"], init('PrizeName'))), /*#__PURE__*/React.createElement(FormItem, {
          name: "CountNum",
          label: "\u5E93\u5B58\u6570\u91CF",
          required: true
        }, /*#__PURE__*/React.createElement(_input["default"], init('CountNum'))), /*#__PURE__*/React.createElement(FormItem, {
          name: "MarkPrice",
          label: "\u5E02\u573A\u4EF7\u503C",
          required: true
        }, /*#__PURE__*/React.createElement(_input["default"], init('MarkPrice'))), /*#__PURE__*/React.createElement(FormItem, {
          name: "PrizeBrand",
          label: "\u5956\u54C1\u54C1\u724C",
          required: true
        }, /*#__PURE__*/React.createElement(_input["default"], init('PrizeBrand'))), /*#__PURE__*/React.createElement(FormItem, {
          label: "\u4E0A\u4F20\u56FE\u7247:",
          name: "a11yUpload"
        }, /*#__PURE__*/React.createElement(_upload["default"].Card, (0, _extends2["default"])({
          listType: "card",
          action: "/api/fa",
          accept: "image/png, image/jpg, image/jpeg, image/gif, image/bmp",
          defaultValue: [],
          limit: 1,
          headers: {
            'X-Requested-With': null,
            'Authorization': ((_getCookieData = (0, _utils.getCookieData)()) === null || _getCookieData === void 0 ? void 0 : _getCookieData.token) || (_utils.$_GET === null || _utils.$_GET === void 0 ? void 0 : _utils.$_GET.token) || ''
          },
          onChange: _this2.onChangeUploadImg,
          onSuccess: _this2.onSuccessUploadImg
        }, init('a11yUpload'))))))));
      }
    };
    return /*#__PURE__*/React.createElement("div", {
      className: "activity-form"
    }, /*#__PURE__*/React.createElement(_loading["default"], {
      tip: "\u6B63\u5728\u4FDD\u5B58\u4E2D \xB7 \xB7 \xB7 \xB7 \xB7",
      visible: this.state.LoadingVisible,
      fullScreen: true
    }), /*#__PURE__*/React.createElement(_tab["default"], {
      shape: "wrapped",
      tabPosition: "left",
      contentClassName: "tab-content"
    }, tabs.map(function (item) {
      return /*#__PURE__*/React.createElement(_tab["default"].Item, {
        key: item.key,
        title: item.tab
      }, /*#__PURE__*/React.createElement("div", {
        className: "tabContent"
      }, /*#__PURE__*/React.createElement("div", {
        className: "form"
      }, renderPage(item.key)), /*#__PURE__*/React.createElement("div", {
        className: "item-btn"
      }, item.key === 1 ? /*#__PURE__*/React.createElement(_button["default"], {
        type: "primary",
        onClick: _this2.handleSubmit
      }, /*#__PURE__*/React.createElement(_icon["default"], {
        type: "detail",
        size: "xxl"
      }), "\u4FDD\u5B58") : '')));
    })));
  };
  return ActivityForm;
}(React.Component);
exports["default"] = ActivityForm;
ActivityForm.displayName = 'ActivityForm';