<template>
  <div v-if="!$baseEventBus.isMobile">
    <el-dialog
      :title="title"
      :visible.sync="showWrap"
      v-if="showWrap"
      :close-on-click-modal="false"
      width="501px"
      custom-class="dialog-style tips-dialog error"
      :append-to-body="true"
      :modal="false"
      @close="closeDialog"
      v-el-drag-dialog
    >
      <div class="cont">
        <p v-if="!rmid">Error：</p>
        <p v-if="rmid">Error（{{ rmid }}）：</p>
        <template v-if="!showTextFlag">
          <p v-html="text1"></p>
        </template>
        <p v-if="showTextFlag" v-html="text2"></p>
        <a href="javascript:void(0);" @click="showTextFlag = !showTextFlag">{{
          !showTextFlag
            ? $t2("详情", "components.errorMsg.detail")
            : $t2("收起", "components.errorMsg.collapse")
        }}</a>
      </div>
      <span slot="footer" class="dialog-footer">
        <input
          type="text"
          ref="hbtn"
          style="position: absolute; left: -999px; top: -999px"
        />
        <el-button type="primary" @click="closeDialog" class="button-sty"
          ><i class="el-icon-check el-icon"></i
          >{{ $t2("确 定", "system.button.confirm2") }}</el-button
        >
      </span>
    </el-dialog>
  </div>
  <div v-else-if="showWrap">
    <div class="pop-tipsBox error" :style="'display: block;z-index:' + zIndex">
      <div>
        <i class="icon"></i>
        <div class="cont">
          <p class="name">{{ title }}</p>
          <p class="txt" v-if="!rmid">Error：</p>
          <p class="txt" v-if="rmid">Error（{{ rmid }}）：</p>
          <template v-if="!showTextFlag">
            <p class="txt">{{ text1 }}</p>
          </template>
          <p class="txt" v-if="showTextFlag" v-html="text2"></p>
          <a href="javascript:void(0);" @click="showTextFlag = !showTextFlag">{{
            !showTextFlag
              ? $t2("详情", "components.errorMsg.detail")
              : $t2("收起", "components.errorMsg.collapse")
          }}</a>
        </div>
        <div class="btns">
          <el-button type="primary" class="btn" @click="closeDialog">{{
            $t2("确 定", "system.button.confirm2")
          }}</el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mixins } from "./mixins";

export default {
  // name: 'errorMsg',
  mixins: [mixins],
};
</script>

<style></style>
