export const cols = [
  {
    dataIndex: "id",
    title: "ID",
    width: 150,
    key: "id"
  },
  {
    dataIndex: "keyWord",
    title: "关键字",
    width: 70,
  },
  {
    dataIndex: "EditFunName",
    title: "工艺代码",
    width: 80,
    key: "keyWord"
  },
  {
    dataIndex: "EditMatName",
    title: "物料名称",
    width: 100,
    key: "keyWord"
  },
  {
    dataIndex: "Status",
    title: "状态",
    width: 80,
    key: "keyWord"
  },
  {
    dataIndex: "value",
    title: "显示值",
    width: 100,
    key: "keyWord"
  },
  {
    dataIndex: "cellType",
    title: "类别",
    width: 100,
    key: "keyWord",
    customRender: function (record) {
      const curCols = record.column;
      const cueRecord = record.record;
      let text = cueRecord[curCols.dataIndex];
      if (curCols.dataIndex == "cellType") {
        switch (cueRecord.cellType) {
          case "Channel": {
            text = "投料位置";
            break;
          }
          case "Layer": {
            text = "工艺组";
            break;
          }
          case "Common": {
            text = "工艺";
            break;
          }
          case "AndLogic": {
            text = "逻辑与";
            break;
          }
          case "OrLogic": {
            text = "逻辑或";
            break;
          }
          case "Condition": {
            text = "条件";
            break;
          }
          case "ComplexCondition": {
            text = "条件";
            break;
          }
          case "Sub": {
            text = "子过程";
            break;
          }
          case "Return": {
            text = "子过程返回";
            break;
          }
          case "End": {
            text = "生产结束";
            break;
          }
          case "NULL": {
            text = "空工艺";
            break;
          }
          case "Allot": {
            text = "调拨工艺";
            break;
          }
          case "Qc": {
            text = "QC检验";
            break;
          }
          case "Bus": {
            text = "BUS";
            break;
          }
          case "keyWords": {
            text = "关键字";
            break;
          }
          case "Line": {
            text = "连接线";
            break;
          }
          case "Table": {
            text = "投料工艺组";
            break;
          }
          default: {
            break;
          }
        }
      }
      return <span>{text}</span>;
    },
  },
  {
    dataIndex: "geometry",
    title: "坐标",
    width: 200,
    key: "keyWord",
    customRender: function (record) {
      const curCols = record.column;
      const cueRecord = record.record;
      let text = cueRecord[curCols.dataIndex];
      if (cueRecord.geometry != undefined || cueRecord.geometry != null) {
        var x =
          typeof cueRecord.geometry.x == "undefined"
            ? ""
            : cueRecord.geometry.x;
        var y =
          typeof cueRecord.geometry.y == "undefined"
            ? ""
            : cueRecord.geometry.y;
        var width =
          typeof cueRecord.geometry.width == "undefined"
            ? ""
            : cueRecord.geometry.width;
        var height =
          typeof cueRecord.geometry.height == "undefined"
            ? ""
            : cueRecord.geometry.height;
        text =
          "x:" + x + " ,y:" + y + " ,width:" + width + " ,height:" + height;
      }
      if (curCols.dataIndex == "cellType") {
        switch (cueRecord.cellType) {
          case "Channel": {
            text = "投料位置";
            break;
          }
          case "Layer": {
            text = "工艺组";
            break;
          }
          case "Common": {
            text = "工艺";
            break;
          }
          case "AndLogic": {
            text = "逻辑与";
            break;
          }
          case "OrLogic": {
            text = "逻辑或";
            break;
          }
          case "Condition": {
            text = "条件";
            break;
          }
          case "ComplexCondition": {
            text = "条件";
            break;
          }
          case "Sub": {
            text = "子过程";
            break;
          }
          case "Return": {
            text = "子过程返回";
            break;
          }
          case "End": {
            text = "生产结束";
            break;
          }
          case "NULL": {
            text = "空工艺";
            break;
          }
          case "Allot": {
            text = "调拨工艺";
            break;
          }
          case "Qc": {
            text = "QC检验";
            break;
          }
          case "Bus": {
            text = "BUS";
            break;
          }
          case "keyWords": {
            text = "关键字";
            break;
          }
          case "Line": {
            text = "连接线";
            break;
          }
          case "Table": {
            text = "投料工艺组";
            break;
          }
          default: {
            break;
          }
        }
      }

      return <span>{text}</span>;
    },
  },

  {
    dataIndex: "defaultHeight",
    title: "默认高度",
    width: 100,
    key: "keyWord"
  },
  {
    dataIndex: "defaultwidth",
    title: "默认宽度",
    width: 100,
    key: "keyWord"
  },
  {
    dataIndex: "source.id",
    title: "源",
    width: 100,
    key: "keyWord"
  },
  {
    dataIndex: "target.id",
    title: "目标",
    width: 100,
    key: "keyWord"
  },
  {
    dataIndex: "parent.id",
    title: "父节点",
    width: 100,
    key: "keyWord"
  }
];


