"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.saveUserTableHeader = exports.getUserTableHeader = void 0;
var _message = _interopRequireDefault(require("@alifd/next/lib/message"));
var _request = _interopRequireDefault(require("../../utils/request"));
var saveUserTableHeader = function saveUserTableHeader(_ref) {
  var tableId = _ref.tableId,
    jsonData = _ref.jsonData,
    pageCode = _ref.pageCode;
  return new Promise(function (resolve, reject) {
    (0, _request["default"])({
      url: '/api/gzmpc-lowcode/pageUserTitle/save',
      method: 'post',
      data: {
        gridId: tableId,
        jsonData: jsonData,
        pageCode: pageCode
      }
    }).then(function (res) {
      _message["default"].success('保存成功');
      resolve(res);
    })["catch"](function (err) {
      // Message.success('保存成功')
      reject(err);
    });
  });
};
exports.saveUserTableHeader = saveUserTableHeader;
var getUserTableHeader = function getUserTableHeader(tableId, pageCode) {
  return new Promise(function (resolve, reject) {
    (0, _request["default"])({
      url: "/api/gzmpc-lowcode/pageUserTitle/getPageUserTitle?gridId=" + tableId + "&pageCode=" + pageCode,
      method: 'get'
    }).then(function (res) {
      //    console.log(res)
      resolve(res.data);
    })["catch"](function (err) {
      reject(err);
    });
  });
};
exports.getUserTableHeader = getUserTableHeader;