import { inject, observer } from "mobx-react";
import { toJS } from "mobx";
import { Button } from "antd";
import { WeaLocaleProvider, WeaRightMenu, WeaButtonIcon, WeaTableEditable, WeaTab, WeaTop, WeaPopoverHrm } from "ecCom";
import { WeaForm, WeaLogView, WeaTableNew } from "comsMobx";
import isEmpty from 'lodash/isEmpty';
import NoRight from "../../public/NoRight";
import NonStand from "../../public/NonStand";
import {
  GeneralTitleColor,
  onCheck,
  getAdvancedItem,
  getSearchBtns,
  doConfirm,
  getForm,
} from "../../util/IntegrationUtil";
import WorkflowViewFormDialog from "./WorkflowViewFormDialog";
import OfsInfoAddFormDialog from "./OfsInfoAddFormDialog";
import OfsInfoEditDetailDialog from "./OfsInfoEditDetailDialog";
import SMSTemplate from './SMSTemplate';
const { WeaTable } = WeaTableNew;
const getLabel = WeaLocaleProvider.getLabel;
const WeaLogViewComp = WeaLogView.Component;

@inject("todoCenterStore")
@observer
export default class TodoCenter extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      collectParams: {
        favname: `${getLabel('127357', '统一待办中心集成')}`,
        favouritetype: 1,
        objid: 0,
        link: "wui/engine.html#/integration/TodoCenter",
        importantlevel: 1
      },
      targetId: "",
      showSearchAd: false,
      logOfsInfoVisible: false,
      topTab: this.getTabDatas()
    };
  }

  componentDidMount () {
    const { todoCenterStore } = this.props;
    todoCenterStore.doInit();
  }

  componentWillReceiveProps (nextProps) {
    const { todoCenterStore } = this.props;
    if (this.props.location.key !== nextProps.location.key) {
      this.setState({ selectedKey: 0 });
      todoCenterStore.doInit();
    }
  }

  /**获取首页面的tab */
  getTabDatas = () => {
    return [
      {
        color: "#000000",
        groupid: "flowAll",
        showcount: true,
        title: `${getLabel(31694, "异构系统")}`,
        viewcondition: 0
      }, {
        color: "#000000",
        groupid: "flowAll",
        showcount: true,
        title: `${getLabel(126871, "流程数据")}`,
        viewcondition: 1
      }, {
        color: "#000000",
        groupid: "flowAll",
        showcount: true,
        title: `${getLabel(31695, "集成日志")}`,
        viewcondition: 2
      }, {
        color: "#000000",
        groupid: "flowAll",
        showcount: true,
        title: `${getLabel(387030, "集成参数")}`,
        viewcondition: 3
      }, {
        color: "#000000",
        groupid: "flowAll",
        showcount: true,
        title: getLabel('17037', '自定义字段'),
        viewcondition: 4
      }
    ]
  }

  /**
   * 获取右键菜单
   * @returns {Array}
   */
  getRightMenu = () => {
    const { status: { selectedKey, rightMenus = [] }, tableStore } = this.props.todoCenterStore;
    let btnArr = [];
    if ([0, 1].includes(Number(selectedKey))) {
      btnArr = rightMenus && rightMenus.map(m => {
        return {
          key: m.type,
          icon: <i className={m.menuIcon} />,
          content: m.menuName,
          onClick: () => this.onRightMenuClick(m.type),
          disabled: (m.menuIcon === 'icon-coms-delete' && toJS(tableStore.selectedRowKeys).length === 0)
        }
      });
    } else if (selectedKey == 3) {
      btnArr.push({
        key: "BTN_BASE_SAVE",
        icon: <i className="icon-coms-Preservation" />,
        content: `${getLabel(86, '保存')}`,
        onClick: () => this.onRightMenuClick("BTN_BASE_SAVE")
      });
      btnArr.push({
        key: "rb_3",
        icon: <i className="icon-coms-Print-log" />,
        content: `${getLabel(83, '日志')}`,
        onClick: () => this.onRightMenuClick("rb_3")
      });
    } else if (selectedKey == 4) {
      btnArr.push({
        key: "BTN_BASE_SAVE",
        icon: <i className="icon-coms-Preservation" />,
        content: `${getLabel(86, '保存')}`,
        onClick: () => this.onRightMenuClick("BTN_BASE_SAVE")
      });
    }
    if (![3, 4].includes(Number(selectedKey))) {
      //显示列定制
      btnArr.push({
        key: "BTN_COLUMN",
        icon: <i className="icon-coms-Custom" />,
        content: `${getLabel(32535, "显示列定制")}`,
        onClick: () => this.onRightMenuClick("BTN_COLUMN")
      });
    }
    return btnArr;
  }

  getBtns = () => {
    const { status: { selectedKey, rightMenus = [] }, tableStore } = this.props.todoCenterStore;
    if ([0, 1].includes(Number(selectedKey))) {
      let btnArr = [];
      rightMenus && rightMenus.forEach(m => {
        if (m.type != "rb_3") {
          btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@q3p53e@integrationTodoCenterButton${m.type}`} type="primary" disabled={m.menuIcon === 'icon-coms-delete' && toJS(tableStore.selectedRowKeys).length === 0} onClick={() => this.onRightMenuClick(m.type)}>{m.menuName}</Button>)
        }
      })
      return btnArr;
    } else if (selectedKey == 3) {
      return [<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@76bklf@integrationTodoCenterButtonBTNBASESAVE${selectedKey}`} type="primary" onClick={() => this.onRightMenuClick('BTN_BASE_SAVE')}>{getLabel(86, '保存')}</Button>];
    } else if (selectedKey == 4) {
      return [<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@uk53l3@integrationTodoCenterButtonBTNBASESAVE${selectedKey}`} type="primary" onClick={() => this.onRightMenuClick('BTN_BASE_SAVE')}>{getLabel(86, '保存')}</Button>];
    }
  };

  doEditDetailById = (record) => {
    const { todoCenterStore } = this.props;
    todoCenterStore.setOperateRecordIndex(record.id);
    todoCenterStore.getOfsInfoAddForm({ sysid: record.id });
    todoCenterStore.setState({ ofsInfoEditDetailDialogVisible: true });
  }

  /**
   * 右键菜单点击事件
   * @param type
   */
  onRightMenuClick = (type, record) => {
    const {
      todoCenterStore,
    } = this.props, {
      newForm,
      tableStore,
      saveOfsCustomDefinition,
      getWorkflowViewFormEdit,
      status: {
        inteParamsSelectedKey,
        selectedKey,
        customDefinitionDatas = [],
        newFormCondition = []
      } } = todoCenterStore;
    const rowSelectIds = tableStore.selectedRowKeys;

    if (type == "BTN_COLUMN") {
      tableStore.setColSetVisible(true);
      tableStore.tableColSet(true);
    } else {
      if (selectedKey == 0) {
        if (type == "rb_1") {
          todoCenterStore.getOfsInfoAddForm({});
          todoCenterStore.setState({ ofsInfoAddFormDialogVisible: true });
        } else if (type == "0") {
          this.doEditDetailById({ id: record.randomField0 });
        } else if (type == "rb_2") {
          doConfirm(getLabel(385625, '确定要删除选择的记录吗？'), todoCenterStore.getOfsInfoOperation, { operation: 'delete', id: rowSelectIds });
        } else if (type == "1") {
          doConfirm(getLabel(15097, '确定要删除吗？'), todoCenterStore.getOfsInfoOperation, { operation: 'delete', id: record.randomField0 });
        } else if (["rb_3", "2"].indexOf(type) != -1) {
          this.setState({ logOfsInfoVisible: true, targetId: record ? record.id : "" });
        }
      } else if (selectedKey == 1) {
        if (type == "0") {
          todoCenterStore.getWorkflowViewForm({ id: record.randomField0, isremark: record.isremark });
        } else if (type == "rb_1" || type === "2") {
          let id = "";
          let isremark = '';
          if (record) {
            id = record.randomField0;
            isremark = record.isremark;
          }
          getWorkflowViewFormEdit({ id, isremark });
          todoCenterStore.setState({ WorkflowViewFormDialogVisible: true, onlyRead: false, operateIndex: id });
        } else if (type == "rb_2") {
          doConfirm(getLabel(385625, '确定要删除选择的记录吗？'), todoCenterStore.getWorkflowOperation, { operation: 'delete', id: rowSelectIds });
        } else if (type == "1") {
          doConfirm(getLabel(15097, '确定要删除吗？'), todoCenterStore.getWorkflowOperation, { operation: 'delete', id: `${record.randomField0}_${record.isremark}` });
        } else if (type == "rb_3") {
          this.setState({ logOfsInfoVisible: true, targetId: '' });
        }
      } else if (selectedKey == 3) {
        if (type == "BTN_BASE_SAVE") {
          let hideFormFields = [], type = "";
          if (newFormCondition && newFormCondition.length > Number(inteParamsSelectedKey)) {
            newFormCondition && newFormCondition.forEach((data, index) => {
              if (index == Number(inteParamsSelectedKey)) {
                type = data.type || "";
              } else {
                data && data.items && data.items.forEach(item => {
                  if (item && item.domkey) {
                    hideFormFields.push(item.domkey[0]);
                  }
                })
              }
            })
          }
          window.e9HideFormFieldKeys = hideFormFields;
          onCheck(newForm, () => {
            todoCenterStore.getOfsSettingOperation({ ...newForm.getFormParams(), type });
          });
        } else if (type == "rb_3") {
          this.setState({ logOfsInfoVisible: true, targetId: '' });
        }
      } else if (selectedKey == 4) {
        if (type === "BTN_BASE_SAVE") {
          if (this.table) {
            let result = this.table.doValidate();
            if (result.pass) {
              saveOfsCustomDefinition({ operate: "save", datas: JSON.stringify(toJS(customDefinitionDatas)) });
            }
          }
        }
      }
    }
  };

  handleOnSearch = () => {
    const { todoCenterStore } = this.props;
    const { status: { selectedKey }, getOfsInfoList, getWorkflowList, getOfsLogList } = todoCenterStore;
    if (selectedKey == 0) {
      getOfsInfoList();
    } else if (selectedKey == 1) {
      getWorkflowList();
    } else if (selectedKey == 2) {
      getOfsLogList();
    }
  }

  /**
   * 获取高级查询
   * @returns {Array}
   */
  getAdvancedSearch = () => {
    const {
      todoCenterStore
    } = this.props, {
      searchForm,

      status
    } = todoCenterStore, {
      condition
    } = toJS(status);
    return getAdvancedItem(searchForm, condition, this.handleSearchFun, false, this && this.props && this.props.ecId || '', "integrationTodoCenter");
  };

  handleSearchFun = () => {
    const { todoCenterStore } = this.props;
    const { selectedKey } = toJS(todoCenterStore.status);
    if (selectedKey == 0) {
      todoCenterStore.getOfsInfoList();
    } else if (selectedKey == 1) {
      // todoCenterStore.changeCondtion('search')
      todoCenterStore.getWorkflowList();
    } else if (selectedKey == 2) {
      todoCenterStore.getOfsLogList();
    }
    this.setState({ showSearchAd: false });
  }

  getTabButtonsAd () {
    const { todoCenterStore } = this.props;
    return getSearchBtns(
      this.handleSearchFun,
      this.reset,
      () => this.setState({ showSearchAd: false }),
      this && this.props && this.props.ecId || '',
      "integrationTodoCenter"
    )
  }

  reset = () => {
    const { todoCenterStore } = this.props;
    const { selectedKey } = toJS(todoCenterStore.status);
    const { getWorkflowCondition, getOfsInfoCondition, getOfsLogCondition } = todoCenterStore;
    if (selectedKey == '0') {
      getOfsInfoCondition()
    } else if (selectedKey == '1') {
      getWorkflowCondition()
    } else {
      getOfsLogCondition()
    }

  }

  /**
   * tab页切换
   */
  handleTabChange = (selectedKey) => {
    const { todoCenterStore } = this.props;
    const {
      getOfsInfoList,
      getOfsInfoRightMenu,
      getOfsInfoCondition,
      getWorkflowList,
      getWorkflowRightMenu,
      getWorkflowCondition,
      getOfsLogList,
      getOfsLogCondition,
      getOfsSettingForm,
      getOfsCustomDefinition
    } = todoCenterStore;

    todoCenterStore.searchForm = new WeaForm();
    todoCenterStore.setState({
      selectedKey,
      searchType: [3, 4].includes(Number(selectedKey)) ? [] : selectedKey == 2 ? ['advanced'] : ['base', 'advanced'],
      advanceHeight: selectedKey == 2 ? 186 : selectedKey == 1 ? 248 : 124
    });
    if (selectedKey == 0) {
      getOfsInfoCondition();
      getOfsInfoRightMenu();
      getOfsInfoList();
    } else if (selectedKey == 1) {
      getWorkflowCondition();
      getWorkflowRightMenu();
      getWorkflowList();
    } else if (selectedKey == 2) {
      getOfsLogCondition();
      getOfsLogList();
    } else if (selectedKey == 3) {
      getOfsSettingForm();
    } else if (selectedKey == 4) {
      getOfsCustomDefinition();
    }
  }

  handleInteParamsTabChange = (v) => {
    const { todoCenterStore } = this.props;
    const { status: { newFormCondition }, getOfsSettingForm } = todoCenterStore;
    getOfsSettingForm({}, true, () => {
      todoCenterStore.setState({
        inteParamsSelectedKey: v,
        newFormConditionItem: newFormCondition.length > v ? [newFormCondition[v]] : []
      });
    })
  }

  /**
   * weatable列配置
   */
  getColumnsInfo = (data) => {
    const { todoCenterStore } = this.props;
    const { status: { selectedKey } } = todoCenterStore;
    if (!isEmpty(data)) {
      for (let index = 0; index < data.length; index++) {
        if (selectedKey == 0 && ["syscode", "SysShortName", "SysFullName"].includes(data[index].dbField)) {
          data[index].render = (text, record, index) => {
            record.id = record.randomField0;
            return (<a onClick={() => this.doEditDetailById(record)}>{text}</a>);
          }
        } else if (selectedKey == 1 && data[index].dbField == "requestname") {
          data[index].render = (text, record, index) => {
            return (<a onClick={() => todoCenterStore.getWorkflowViewForm({ id: record.randomField0, isremark: record.isremark, syscode: record.syscode, receiver: record.receiver, flowid: record.flowid })}>{record.requestname}</a>);
          }
        } else if (selectedKey == 2) {
          if (data[index].dbField == 'userid') {
            data[index].render = (text, record, index) => {
              return (<div style={{ display: 'inline' }}><WeaPopoverHrm ecId={`${this && this.props && this.props.ecId || ''}_WeaPopoverHrm@vzavjf`} /><div dangerouslySetInnerHTML={{ __html: record.useridspan }}></div></div>)
            }
          } else if (data[index].dbField === "requestname") {
            data[index].render = (text, record, index) => {
              if (record.operResult == 1 && record.dataType == "WfData") {
                return <a onClick={() => todoCenterStore.getWorkflowViewForm({ id: record.wfdataid, syscode: record.syscode, receiver: record.receiver, flowid: record.flowid }, record.requestname)}>{record.requestname}</a>;
              } else {
                return record.requestname;
              }
            }
          }
        }
      }
    }
  }

  /**
   * 短信提醒
   */
  handleMessageTemplate = () => {
    const { todoCenterStore } = this.props;
    todoCenterStore.getSmstemplate();
    todoCenterStore.setState({ smsTemplateVisible: true });
  }

  otherCom = (form, field) => {
    let key = field.domkey[0];
    if (key === "remindshortmessage") {
      if (form.getFormParams().remindshortmessage == 1) {
        return <span style={{ marginLeft: 20, color: "#2db7f5", cursor: "pointer" }} onClick={this.handleMessageTemplate}>{getLabel('514719', '短信提醒模板')}</span>
      }
    }
    return "";
  }

  hideFields = (allParams, fields) => {
    let bool = false, key = fields.domkey[0];
    key === 'messagetypeid' && allParams.remindapp != '1' && (bool = true);
    key === 'remindebridgetemplate' && allParams.remindebridge != '1' && (bool = true);
    key === 'customreminderclass' && allParams.customreminders != '1' && (bool = true);
    key === 'remaininvokelogdays' && allParams.clearinvokelog != '1' && (bool = true);
    return bool;
  }

  getTabButtons = () => {
    const {
      todoCenterStore
    } = this.props, {
      saveOfsCustomDefinition,
      status: {
        selectedKey,
        rowSelect,
        customDefinitionDatas
      }
    } = todoCenterStore;
    if (selectedKey == 4) {
      return [
        <WeaButtonIcon ecId={`${this && this.props && this.props.ecId || ''}_WeaButtonIcon@m47sqk@integrationTodoCenterButtonadd${selectedKey}`} onClick={() => {
          if (this.table) {
            this.table.doAdd();
          }
        }} buttonType='add' type="primary" />,
        <WeaButtonIcon ecId={`${this && this.props && this.props.ecId || ''}_WeaButtonIcon@sw8sqh@integrationTodoCenterButtondel${selectedKey}`} disabled={toJS(rowSelect).length === 0} onClick={() => {
          doConfirm(getLabel(385625, '确定要删除选择的记录吗？'), () => {
            saveOfsCustomDefinition({ operate: "delete", id: toJS(rowSelect) }, () => {
              let orgDatas = toJS(customDefinitionDatas), datas = [];
              orgDatas && orgDatas.forEach(v => {
                if (!toJS(rowSelect).includes(v.id)) {
                  datas.push(v);
                }
              })
              todoCenterStore.setState({
                rowSelect: [],
                customDefinitionDatas: datas
              })
            });
          });
        }} buttonType='del' type="primary" />
      ]
    } else {
      return [];
    }
  }

  getRowSelection = rowSelection => {
    const sel = { ...rowSelection };
    sel.getCheckboxProps = record => {
      return { disabled: record.isdelete == "-1" };
    };
    return sel;
  };

  // 自定义字段cells设置
  getCells = (datas = []) => {
    const {
      dbnameCells
    } = toJS(this.props.todoCenterStore.status);
    let cells = [];

    datas && datas.forEach(data => {
      if (data.isEdit) {
        cells.push({
          id: data.id,
          ...dbnameCells
        })
      }
    })
    return cells;
  }

  willEdit = (datas = [], editData = {}) => {
    let {
      key,
      value,
      index,
    } = editData;
    const {setState}=this.props.todoCenterStore;
    const {customDefinitionDatas}=this.props.todoCenterStore.status;
    if ("dbname" === key) {
      if (value && value.trim()) {
        value = value.toLocaleUpperCase();
        setState({changeDBValue:value});
      }
    }
    if("displayname"==key){    
      let dbnames = customDefinitionDatas && toJS(customDefinitionDatas).map(data => data.dbname ? data.dbname.toLocaleUpperCase() : "");
      dbnames.splice(editData.index,1)
     setState({changeValue:value});
     setState({checkDifdbnames:dbnames})
    }
    datas[index] = {
      ...datas[index],
      [key]: value,
    }

    return datas;
  }

  onOperatesClick = (record, index, operate) => this.onRightMenuClick(operate.index, record);

  closeLogDialog = () => this.setState({ logOfsInfoVisible: false, targetId: "" });

  getRowKeyHandel = (record) => {//设置流程数据行数据的唯一key值
    const { todoCenterStore } = this.props;
    const { status } = todoCenterStore;
    const { selectedKey } = toJS(status)
    if (selectedKey == 1) {
      return `${record.randomFieldId}_${record.isremark}`
    } else {
      return record.randomField0
    }
  }

  render () {
    const { todoCenterStore } = this.props;
    const { searchForm, tableStore, status, hasRight, rightLoading, logStore, newForm } = todoCenterStore;
    const {
      hasNonStandard,
      nonStandLoading,
      selectedKey,
      searchType,
      validator,
      advanceHeight,
      inteParamsTabDatas,
      inteParamsSelectedKey,
      newFormConditionItem,
      smsTemplateVisible,
      customDefinitionDatas,
      customDefinitionColumns,
      ofsInfoEditDetailDialogVisible
    } = toJS(status), {
      topTab,
      collectParams,
      showSearchAd,
      logOfsInfoVisible,
      targetId,
    } = this.state;

    return (nonStandLoading
      ? null
      : hasNonStandard
        ? rightLoading
          ? null
          : hasRight
            ? <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@hj1e7r`}
              datas={this.getRightMenu()}
              collectParams={collectParams}
            >
              <WeaPopoverHrm ecId={`${this && this.props && this.props.ecId || ''}_WeaPopoverHrm@nsyx23`} />
              <WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@w74zoz`}
                title={getLabel('127357', '统一待办中心集成')}
                icon={GeneralTitleColor.iconDom}
                iconBgcolor={GeneralTitleColor.iconBgcolor}
                buttons={this.getBtns()}
                showDropIcon={true}
                dropMenuDatas={this.getRightMenu()}
                dropMenuProps={{ collectParams }}
              >
                <WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@n8e4uz`}
                  datas={topTab}
                  keyParam="viewcondition" //主键
                  selectedKey={selectedKey}
                  searchType={searchType}
                  advanceHeight={advanceHeight}
                  buttons={this.getTabButtons()}
                  searchsAd={this.getAdvancedSearch()}
                  buttonsAd={this.getTabButtonsAd()}
                  onSearch={this.handleOnSearch}
                  searchsBaseValue={[0, 1].includes(Number(selectedKey)) ? searchForm.getFormParams()[selectedKey == 0 ? "SysShortName" : "requestname"] : ""}
                  onSearchChange={value => [0, 1].includes(Number(selectedKey)) ? searchForm.updateFields({ [selectedKey == 0 ? "SysShortName" : "requestname"]: value }) : ""}
                  showSearchAd={showSearchAd}
                  setShowSearchAd={(bool) => this.setState({ showSearchAd: bool })}
                  hideSearchAd={() => this.setState({ showSearchAd: false })}
                  onChange={this.handleTabChange}
                />
                {
                  selectedKey == 4
                    ? <WeaTableEditable ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEditable@5ekkai`}
                      ref={el => this.table = el}
                      showAdd={false}
                      showDelete={false}
                      showTitle={false}
                      showCollapse={true}
                      cells={this.getCells(customDefinitionDatas)}
                      columns={customDefinitionColumns}
                      getRowSelection={this.getRowSelection}
                      onRowSelect={(rowSelect) => todoCenterStore.setState({ rowSelect })}
                      datas={customDefinitionDatas}
                      validator={validator}
                      willEdit={this.willEdit}
                      onChange={(datas) => todoCenterStore.setState({ customDefinitionDatas: datas })}
                    />
                    : selectedKey == 3
                      ? <div>
                        <WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@k2fsz3`}
                          datas={inteParamsTabDatas}
                          keyParam="viewcondition"
                          type="card"
                          selectedKey={inteParamsSelectedKey}
                          searchType={[]}
                          onChange={v => this.handleInteParamsTabChange(v)}
                        />
                        {getForm(newForm, newFormConditionItem, true, null, inteParamsSelectedKey == 1 ? this.otherCom : null, inteParamsSelectedKey == 0 ? null : this.hideFields)}
                      </div>
                      : <WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@3knnau`}
                        rowKey={this.getRowKeyHandel}
                        key={selectedKey}
                        getColumns={this.getColumnsInfo}
                        comsWeaTableStore={tableStore}
                        onOperatesClick={this.onOperatesClick}
                        hasOrder={true}
                        needScroll={true}
                      />
                }
              </WeaTop>
              {(!ofsInfoEditDetailDialogVisible) && <WorkflowViewFormDialog ecId={`${this && this.props && this.props.ecId || ''}_WorkflowViewFormDialog@mdzcjl`} />}
              <OfsInfoAddFormDialog ecId={`${this && this.props && this.props.ecId || ''}_OfsInfoAddFormDialog@g73st6`} />
              <OfsInfoEditDetailDialog ecId={`${this && this.props && this.props.ecId || ''}_OfsInfoEditDetailDialog@i0dbvn`} />
              {smsTemplateVisible && <SMSTemplate ecId={`${this && this.props && this.props.ecId || ''}_SMSTemplate@ntast7`} />}
              <WeaLogViewComp ecId={`${this && this.props && this.props.ecId || ''}_WeaLogViewComp@ygeir3`} key={selectedKey} visible={logOfsInfoVisible} onCancel={this.closeLogDialog} logStore={logStore} logType="15" logSmallType={selectedKey == 0 ? "89" : selectedKey == 1 ? "90" : selectedKey == 3 ? "91" : ""} targetId={targetId} />
            </WeaRightMenu>
            : <NoRight ecId={`${this && this.props && this.props.ecId || ''}_NoRight@tj35pw`} />
        : <NonStand ecId={`${this && this.props && this.props.ecId || ''}_NonStand@9r61lp`} />
    );
  }
}
