import _Message from "@alifd/next/es/message";
import request from "../../utils/request";
export var saveUserTableHeader = function saveUserTableHeader(_ref) {
  var tableId = _ref.tableId,
    jsonData = _ref.jsonData,
    pageCode = _ref.pageCode;
  return new Promise(function (resolve, reject) {
    request({
      url: '/api/gzmpc-lowcode/pageUserTitle/save',
      method: 'post',
      data: {
        gridId: tableId,
        jsonData: jsonData,
        pageCode: pageCode
      }
    }).then(function (res) {
      _Message.success('保存成功');
      resolve(res);
    })["catch"](function (err) {
      // Message.success('保存成功')
      reject(err);
    });
  });
};
export var getUserTableHeader = function getUserTableHeader(tableId, pageCode) {
  return new Promise(function (resolve, reject) {
    request({
      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);
    });
  });
};
export var batchDelete = function batchDelete(entityId, pageCode, ids) {
  var data = {
    entityId: entityId,
    pageCode: pageCode,
    deleteIds: ids
  };
  return new Promise(function (resolve, reject) {
    request({
      url: "/api/gzmpc-lowcode/uniForm/batchDelete",
      method: 'post',
      data: data
    }).then(function (res) {
      resolve(res.data);
    })["catch"](function (err) {
      reject(err);
    });
  });
};