<template>
  <div>
    <Modal
      v-model="modalVisible"
      :title="completeTitle"
      :mask="true"
      :closable="true"
      :mask-closable="false"
      :width="width"
      class="importDialog"
      @on-cancel="closeDialog"
    >
      <div>
        <slot name="header" />
        <div
          v-if="showIcon"
          class="importICon"
        >
          <span class="icon-span">
            <i class="iconfont iconbj_import" />
          </span>
        </div>
        <div class="import-panel">
          <div class="el-upload__tip">
            有效数据起始行:<input
              :value="inpNum"
              class="inputValue"
              type="text"
              placeholder="只能输入正整数"
              @input="handleInput"
              @change="handleInput"
            >;
            <template v-if="showCheckBox">
              <Checkbox
                v-model="singleValue"
                class="singleValue"
              />
              AK重复是否更新已有记录;
              <span v-if="showAkColumn" style="padding-left: 10px;"><b>AK</b>:[{{ akColumn }}]</span> 
            </template>
          </div>
          <div class="el-upload__tip">
            {{ ChineseDictionary.IMPORTTITLE }}
            <a
              @click.stop="downloadTemplate"
            >{{ ChineseDictionary.DOWNTEMPLATE }}</a>
          </div>
          <div v-if="showTip" class="el-upload__tip ak-tip">
            <span class="'ak-label'">AK重复是否更新已有记录：</span> <span class="ak-desc">若列表中已有数据且再次导入相同数据时，勾选该字段表示新导入的数据替换列表中重复的数据；不勾选该字段，表示不更新列表中重复的数据</span>
          </div>
          <slot name="msg" />

          <div class="upload-panel">
            <Button
              type="posdefault"
              :size="buttonSize"
            >
              选择文件
            </Button>
            <!-- name -->
            <input
              id="file"
              class="fileInput"
              type="file"
              accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
              @change="fileChange($event)"
              @click="clearFile"
            >
            <!-- <label for="选择文件上传" /> -->
            <div
              class="tip"
            >
              {{ ChineseDictionary.FILEMAX }}{{ fileSizeNumber }}
            </div>
            <div class="fileName">
              {{ fileName }}
            </div>
          </div>
          <transition name="fade">
            <span v-if="loading">数据正在导入中，请稍候</span>
          </transition>
        </div>
      </div>
      <div slot="footer">
        <div>
          <Button
            type="fcdefault"
            :disabled="loading"
            :size="buttonSize"
            @click="submitUpload()"
          >
            {{ ChineseDictionary.IMPORT }}
          </Button>

          <Button
            type="fcdefault"
            :size="buttonSize"
            @click.stop="closeDialog(false)"
          >
            {{ ChineseDictionary.CANCEL }}
          </Button>
        </div>
        <div
          v-if="errorMsg.errorList.length>0"
          class="error-content"
        >
          <div class="error-message">
            <div class="left-icon">
              <i class="iconfont">&#xecd0;</i>
            </div>
            <div class="right-content">
              <p
                v-if="errorMsg.errorUrl.length > 0"
                class="link"
              >
                <a :href="errorMsg.errorUrl">（下载报错信息）</a>
              </p>
              <div class="content-message">
                <p class="title">
                  {{ errorMsg.message }}
                </p>
                <p
                  v-for="(msg,index) in errorMsg.errorList"
                  :key="index"
                >
                  <span v-if="msg.rowIndex&&!(tablename=='V_IES_PRODUCT'||tablename=='T_IESSkuGroupDetail')">第{{ msg.rowIndex }}条记录报错:</span>
                  {{ msg.message }}
                </p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </Modal>
  </div>
</template>

<script>
  import axios from 'axios';
  // import ChineseDictionary from '../assets/js/ChineseDictionary';
  // import network, { urlSearchParams, getGateway } from '../__utils__/network';
  import Upload from '../../assets/js/upload';

  import { DispatchEvent, R3_IMPORT } from '../../assets/js/__utils__/dispatchEvent';

  const R3 = window.R3;

  const { network, urlSearchParams } = R3;

  export default {
    name: 'ImportDialog',
    props: {
      // name: {
      //   type: Boolean,
      //   default: false
      // },
      // 区分同一个主表，不同导入按钮
      importType: {
        type: [Number, String],
        default: '',
      },
      customImport: {
        type: Boolean,
        default: false
      }, // 自定义导入接口
      fatherMethod: {
        type: Function,
        default: null
      },
      visible: {// 是否打开弹框
        // 显示
        type: Boolean,
        default: false
      },
      title: {// 弹框title
        // 标题
        type: String,
        default: ''
      },
      combinedCommoditySku: {// 福袋商品对应虚拟条码
        type: String,
        default: ''
      },
      tablename: {// /p/cs/downloadImportTemplate 用于下载模版,上传文件参数
        // 子表名
        type: String,
        default: ''
      },
      mainTable: {// 用于/p/cs/import参数上传文件
        // 主表名
        type: String,
        default: ''
      },
      mainId: {// 用于/p/cs/import参数上传文件
        // 主表id
        type: [Number, String],
        default: -1
      },
      width: {// 当前弹框参数
        // 宽度
        type: String,
        default: '630'
      },
      giftType: { // 促销活动赠送商品方式
        type: String,
        default: ''
      },
      joinType: { // 促销活动赠送商品方式
        type: String,
        default: ''
      },
      isGroup: { // 促销活动赠送商品方式
        type: Boolean,
        default: false
      },
      payload: { // 其他请求参数
        type: [Object, Array, Number, String],
        default: () => ({})
      },
      // 是否显示导入图标
      showIcon: {
        type: Boolean,
        default: true
      },
      showCheckBox: {
        type: Boolean,
        default: true
      },
      showAkColumn: {
        type: Boolean,
        default: false
      },
      akColumn: {
        type: String,
        default: ''
      },
      showTip: {
        type: Boolean,
        default: false
      }
    },
    components: {},
    data() {
      return {
        inputValue: '2', // 有效起始行
        inputValueOne: '3', // 有效起始行（订单管理主子表导入)
        singleValue: false, // 更新记录
        modalVisible: false,
        showFlag: false,
        loading: false, // 是否加载
        ChineseDictionary: {
          IMPORTTITLE: '注意：上传文件中，不要放置宏或图标，不要更改列的顺序，数据中不要使用公式。',
          IMPORT: '导入',
          CANCEL: '取消',
          DOWNTEMPLATE: '(下载模版)',
          FILEMAX: '文件最大'
        },
        fileSizeNumber: '',
        fileSize: '', // 文件尺寸
        importFlies: [], // 导入文件列表
        errorMsg: {
          // 错误信息
          errorUrl: '',
          message: '',
          errorList: []
        },
        files: [],
        buttonSize: 'small',
        fileName: ''
      };
    },
    watch: {
      modalVisible: {
        handler(val) {
          if (!val) {
            this.$emit('closeDialog');
          }
        }
      },
      visible: {
        handler(val) {
          if (val) {
            this.modalVisible = true;
          } else {
            this.modalVisible = false;
          }
        }
      }
    },
    mounted() {
      // this.ChineseDictionary = {};
      if (this.visible) this.modalVisible = true;
      else this.modalVisible = false;
      this.axiosSetting();
    },

    computed: {
      completeTitle() {
        let name = '';
        if (this.tablename == 'T_V_OMSPRINTORDER') { // 出库单打印导入名称
          name = `${this.title}发货`;
        } else if (this.tablename == 'V_OMSSTORAGEIN') {
          name = '三无包裹批量匹配退单';
        } else {
          name = `${this.title}导入`;
        }
        return name;
      },
      inpNum() {
        if(this.tablename == 'T_V_OMSONLINEORDER_V2' || this.tablename == 'T_IESKUSTOCKSCALE' || this.tablename == 'T_V_OMSONLINEORDER' || this.tablename == 'T_V_OMSINCIDENTALSRECORD' || this.tablename == 'T_OMSREFUNDORDER' || this.tablename == 'T_OMSREFUNDORDER_V2') {
          return this.inputValueOne;
        }
        return this.inputValue;
      }
    },

    methods: {
      getGateway(str) {
        return `${str}`;
      },
      handleInput(event) {
        const val = event.target.value.trim();
        // 只能是正整数或空,可根据需求修改正则
        if (/^[1-9]\d*$|^$/.test(val)) {
          this.inputValue = val;
        } else {
          event.target.value = this.inputValue;
        }
      },
      clearFile() {
        this.fileName = '';
        this.loading = false;
        this.files = [];
        const fileDom = document.getElementById('file');
        fileDom.value = '';
      },
      fileChange(e) {
        this.errorMsg = {
          // 错误信息
          errorUrl: '',
          message: '',
          errorList: []
        };
        this.files = e.target.files[0];
        this.fileName = e.target.files[0].name;
        this.fileSize = e.target.files[0].size;
      },
      // 发送请求, 获取上传参数
      axiosSetting() {
        network.post('/p/cs/settings',
                     urlSearchParams({
                       configNames: JSON.stringify(['upload.import.max-file-size'])
                     })).then((res) => {
          if (res.data.code === 0) {
            this.fileSizeNumber = res.data.data['upload.import.max-file-size'];
          } else this.fileSizeNumber = '0M';
        })
          .catch((error) => {
            if (error.response && error.response.status && error.response.status === 403) {
              this.closeDialog();
            }
            this.fileSizeNumber = '0M';
          });
      },
      // 发送请求, 下载模板
      downloadTemplate() {
        if (this.customImport) {
          if (this.tablename == 'T_V_OMSPRINTORDER') { // 出库单打印
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/已发货订单.xlsx';
            link.setAttribute('download', '已发货订单.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'V_IES_PRODUCT') { // 组合商品
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/组合商品导入模板.xlsx';
            link.setAttribute('download', '组合商品导入模板.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_IESSkuGroupDetail') { // 福袋商品明细
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/福袋商品明细导入.xlsx';
            link.setAttribute('download', '福袋商品明细导入.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_IESALIZHIYINGITEM') { // 阿里直营商品
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/阿里直营商品导入.xlsx';
            link.setAttribute('download', '阿里直营商品导入模板.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_IESJDCZITEM') { // 阿里直营商品
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/京东厂直商品导入.xlsx';
            link.setAttribute('download', '京东厂直商品导入模板.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_IESSKUPRICESTRATEGYITEM') { // 商品价格异常监控策略明细1234
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/商品价格异常监控策略明细导入模板.xlsx';
            link.setAttribute('download', '商品价格异常监控策略明细导入模板.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_IESSHOPSKUSTOCKLOCKITEM') { // 锁库存策略明细
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/锁库存商品导入模板.xlsx';
            link.setAttribute('download', '锁库存商品导入模板.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_IESSKUPRICESTRATEGY') { // 商品价格异常监控策略主表导入
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/商品价格异常监控策略模板.xlsx';
            link.setAttribute('download', '商品价格异常监控策略导入模板.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'V_OMSSTORAGEIN') { // 三无包裹批量匹配退单
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/三无包裹匹配退单.xls';
            link.setAttribute('download', '三无包裹匹配退单模板.xls');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_IESSTOCKFREEZEDETAIL') { // 冻结单子表导入
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/库存冻结明细导入模板.xlsx';
            link.setAttribute('download', '库存冻结明细导入模板.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_IESSTOCKFREEZE') { // 冻结单主表导入
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/库存冻结单导入模板.xlsx';
            link.setAttribute('download', '库存冻结单导入模板.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_IESSTOCKTHAWDETAIL') { // 解冻单子表导入
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/库存解冻明细导入模板.xlsx';
            link.setAttribute('download', '库存解冻明细导入模板.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_IESSTOCKTHAW') { // 解冻单主表导入
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/库存解冻单导入模板.xlsx';
            link.setAttribute('download', '库存解冻单导入模板.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_OMSJITAUTOPOLICYITEM') { // JIT自动化策略明细导入
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/JIT自动化策略明细导入模板.xlsx';
            link.setAttribute('download', 'JIT自动化策略明细导入模板.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_V_OMSINCIDENTALSRECORD') { // 仅退款单主表导入
            // 下载模版
            if (this.importType === 'IMPORT_ADD') {
              const path = this.getGateway('/p/cs/downloadImportTemplate');
              axios({
                url: path,
                method: 'get',
                params: {
                  searchdata: {
                    table: this.tablename
                  }
                },
                headers: { RDB: 'OMS'}
              }).then((res) => {
                if (res.data.code === 0) {
                  const url = `${this.getGateway('/p/cs/download')}?filename=${
                    res.data.data
                  }`;
                  console.log(url, 'url_009');
                  window.location = url;
                }
              });
            } else if (this.importType === 'IMPORT_ADD_NO_ORDER') {
              const link = document.createElement('a');
              link.style.display = 'none';
              link.href = '../../../static/importExcel/仅退款单(无原单)导入模板.xlsx';
              link.setAttribute('download', '仅退款单(无原单)导入模板.xlsx');
              document.body.appendChild(link);
              link.click();
            }
          } else if (this.tablename == 'SETLOGISTICSAREAALL') { // 物流配送区域（全国）导入
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/物流配送区域（全国）导入模板.xlsx';
            link.setAttribute('download', '物流配送区域（全国）导入模板.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'SETLOGISTICSAREACUSTOM') { // 物流配送区域（自定义）导入
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/物流配送区域（自定义）导入模板.xlsx';
            link.setAttribute('download', '物流配送区域（自定义）导入模板.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'ad_data_permission') { // 数据权限导入
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/数据权限导入模板.xlsx';
            link.setAttribute('download', '数据权限导入模板.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_OMSACTIVESKU') { // 促销活动赠送商品导入
            const link = document.createElement('a');
            link.style.display = 'none';
            if (this.giftType == 1 || this.giftType == 6 || this.giftType == 7) {
              link.href = '../../../static/importExcel/普通赠送导入模板.xlsx';
              link.setAttribute('download', '普通赠送导入模板.xlsx');
            } else if (this.giftType == 2) {
              link.href = '../../../static/importExcel/满金额件数赠送导入模板.xlsx';
              link.setAttribute('download', '满金额件数赠送导入模板.xlsx');
            } else if (this.giftType == 3) {
              link.href = '../../../static/importExcel/按排名分组赠送导入模板.xlsx';
              link.setAttribute('download', '按排名分组赠送导入模板.xlsx');
            } else if (this.giftType == 4) {
              link.href = '../../../static/importExcel/随机分组赠送导入模板.xlsx';
              link.setAttribute('download', '随机分组赠送导入模板.xlsx');
            } else if (this.giftType == 5) {
              link.href = '../../../static/importExcel/按尺码对应赠送导入模板.xlsx';
              link.setAttribute('download', '按尺码对应赠送导入模板.xlsx');
            } else if (this.giftType == 8) {
              link.href = '../../../static/importExcel/按金额阶梯赠送导入模板.xlsx';
              link.setAttribute('download', '按金额阶梯赠送导入模板.xlsx');
            } else if (this.giftType == 9) {
              link.href = '../../../static/importExcel/按数量阶梯赠送导入模板.xlsx';
              link.setAttribute('download', '按数量阶梯赠送导入模板.xlsx');
            }
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_OMSSTANDITEM') { // 通用商品
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = `../../../static/importExcel/${this.payload.templateName}.xlsx`;
            link.setAttribute('download', `${this.payload.templateName}.xlsx`);
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_PRODUCT_UPLOAD') { // 商品上传
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/商品上传导入模板.xlsx';
            link.setAttribute('download', '商品上传导入模板.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_IESPOLICYPRODETAIL') { // 订单商品转换策略
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '/static/importExcel/订单商品转换策略商品明细.xlsx';
            link.setAttribute('download', '订单商品转换策略商品明细.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'V_OMSSTORAGEIN_IMPORT') { // 退货入库单
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '/static/importExcel/退货入库单.xlsx';
            link.setAttribute('download', '退货入库单.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_OMSPRESALEGOODSQTY') { // 商品预售库存设置
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '/static/importExcel/商品预售库存设置模板.xlsx';
            link.setAttribute('download', '商品预售库存设置模板.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_V_OMSONLINEORDER_REPLACE_GOOD') { // 订单管理-商品替换
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '/static/importExcel/商品导入替换模板.xlsx';
            link.setAttribute('download', '商品导入替换模板.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_V_OMSSIGNPACKAGE') { // 包裹签收
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/包裹签收导入模板.xlsx';
            link.setAttribute('download', '包裹签收导入模板.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_V_OMS_ORDER_TODO') { // 订单待办
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/订单待办导入模版.xlsx';
            link.setAttribute('download', '订单待办导入模版.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if(this.tablename == 'T_V_IESBTSETPLATSTOCK'){
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '/static/importExcel/批量设置平台库存.xlsx';
            link.setAttribute('download', '批量设置平台库存.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_IESBTSETPLATSTOCKITEM') { // 批量设置平台库存导入，平台库存明细导入
            // 下载模版
            const path = this.getGateway('/p/cs/downloadImportTemplate');
            axios({
              url: path,
              method: 'get',
              params: {
                searchdata: {
                  table: this.tablename
                }
              },
              headers: { RDB: 'OMS'}
            }).then((res) => {
              if (res.data.code === 0) {
                const url = `${this.getGateway('/p/cs/download')}?filename=${
                  res.data.data
                }`;
                window.location = url;
              }
            });
          } else if (this.tablename == 'T_V_OMSONLINEORDER_V2') { // 订单管理-导入新增(主子表)
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/订单管理(主子表).xlsx'
            link.setAttribute('download', '订单管理(主子表).xlsx');
            document.body.appendChild(link);
            console.log(link)
            link.click();
          } else if (this.tablename == 'T_V_IESSHOPSTORE') { // 店铺仓库策略
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/店铺仓库策略导入模板.xlsx';
            link.setAttribute('download', '店铺仓库策略导入模板.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_OMSACTIVEJOINGOODS' && this.mainId=='3139') { // 促销活动新增-(指定商品、排除商品)
            const link = document.createElement('a');
            link.style.display = 'none';
            // link.href = '/static/importExcel/促销商品导入.xlsx';
            link.href = '/static/importExcel/活动参与商品.xlsx';
            if(this.joinType == 'name2'){
              link.setAttribute('download', '促销指定商品导入模板.xlsx');
            }else if(this.joinType == 'name3') {
              link.setAttribute('download', '促销排除商品导入模板.xlsx');
            }
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_OMSSALESINKINGDETAIL') { // 预售下沉策略商品明细
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '/static/importExcel/预售下沉策略商品明细导入模板.xlsx';
            link.setAttribute('download', '预售下沉策略商品明细.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_IES_PACKAGING_MATERIAL_RULE') { // 包材设置规则-导入
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '/static/importExcel/包材设置规则.xlsx';
            link.setAttribute('download', '包材设置规则.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_OMSORDERCVTPOLICY') { // 订单转换策略-导入
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '/static/importExcel/订单转换策略.xlsx';
            link.setAttribute('download', '订单转换策略.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_V_OMSPRINTORDER_CUSTOMERAUDIT') { // 补偿单-批量导入客审
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '/static/importExcel/补偿单批量导入客审.xlsx';
            link.setAttribute('download', '补偿单批量导入客审.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_V_OMSPRINTORDER_FINANCEAUDIT') { // 补偿单-批量导入财审
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '/static/importExcel/补偿单批量导入财审.xlsx';
            link.setAttribute('download', '补偿单批量导入财审.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_V_OMSCOMPENSATEORDER_CANCEL') { // 补偿单-批量导入驳回
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '/static/importExcel/批量导入驳回.xlsx';
            link.setAttribute('download', '批量导入驳回.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_V_OMSCOMPENSATEORDER_DISABLE') { // 补偿单-批量导入作废
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '/static/importExcel/批量导入作废.xlsx';
            link.setAttribute('download', '批量导入作废.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_IESKUSTOCKSCALE') { // 按SKU设置供货比例策略-导入
            const path = this.getGateway('/p/cs/shop/stock/scale/excel/template');
            axios({
              url: path,
              method: 'post',
              headers: { RDB: 'OMS'}
            }).then((res) => {
              if (res.data.code === 0) {
                const url = `${this.getGateway('/p/cs/download')}?filename=${
                  res.data.data.uploadId
                }`;
                // window.location = url;
                  const link = document.createElement('a');
                  link.style.display = 'none';
                  link.href = res.data.data.url;
                  link.setAttribute('download', '按SKU设置供货比例策略导入.xlsx');
                  document.body.appendChild(link);
                  link.click();
                // return window.location = res.data.data.url;
              }
            });
          } else if (this.tablename == 'T_OMSREFUNDORDER_V2') { // 退换货单无原单导入
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/导入新增无原单.xlsx';
            link.setAttribute('download', '导入新增无原单.xlsx');
            document.body.appendChild(link);
            link.click();
          } else if (this.tablename == 'T_GOODSPRICERANGESTRATEGY_ITEMS') { // 商品价格范围监控策略明细1234
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/商品价格浮动监控-商品明细导入模板.xlsx';
            link.setAttribute('download', '商品价格浮动监控-商品明细导入模板.xlsx');
            document.body.appendChild(link);
            link.click(); 
          } else if (this.tablename == 'T_GOODSPRICERANGESTRATEGY_SCOPE') { // 商品价格范围监控策略范围1234
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/商品价格浮动监控-商品范围导入模板.xlsx';
            link.setAttribute('download', '商品价格浮动监控-商品范围导入模板.xlsx');
            document.body.appendChild(link);
            link.click(); 
          }
        } else if (this.tablename == 'T_IESSKUPRICESTRATEGYSCOPE') { // 商品价格异常监控策略监控范围
            const link = document.createElement('a');
            link.style.display = 'none';
            link.href = '../../../static/importExcel/商品价格异常监控策略监控范围.xlsx';
            link.setAttribute('download', '商品价格异常监控策略监控范围.xlsx');
            document.body.appendChild(link);
            link.click();
        } else if (this.tablename == 'T_OMSACTIVEJOINGOODS' && this.mainId!='3139') { // 促销活动编辑-(指定商品、排除商品)
          const link = document.createElement('a');
          link.style.display = 'none';
          link.href = '/static/importExcel/活动参与商品.xlsx';
          link.setAttribute('download', '活动参与商品.xlsx');
          document.body.appendChild(link);
          link.click();
        }else {
          // 下载模版
          const path = this.getGateway('/p/cs/downloadImportTemplate');
          axios({
            url: path,
            method: 'get',
            params: {
              searchdata: {
                table: this.tablename
              }
            },
            headers: { RDB: 'OMS'}
          }).then((res) => {
            if (res.data.code === 0) {
              const url = `${this.getGateway('/p/cs/download')}?filename=${
                res.data.data
              }`;
              window.location = url;
            }
          });
        }
        // else if (this.tablename == 'T_V_OMSONLINEORDER') { // 订单管理-导入新增
        //   const link = document.createElement('a');
        //   link.style.display = 'none';
        //   link.href = '/static/importExcel/订单管理导入.xlsx';
        //   link.setAttribute('download', '订单管理.xlsx');
        //   document.body.appendChild(link);
        //   link.click();
        // } 
      },
      // 提交上传文件请求
      submitUpload() {
        if (this.files.length === 0) {
          this.$Modal.fcWarning({
            title: '警告',
            mask: true,
            content: '请先选择要导入的文件！'
          });
          return;
        }
        this.uploadFileChange();
      },
      uploadFileChange() {
        this.errorMsg = {
          // 错误信息
          errorUrl: '',
          message: '',
          errorList: []
        };
        this.loading = true;
        // 上传文件
        const fileInformationUploaded = this.files;
        // this.$R3loading.show();
        // debugger;
        let url = '';
        let aUploadParame;
        let sendData;
        if (this.customImport) {
          if (this.tablename == 'T_V_OMSPRINTORDER') { // 出库单打印导入
            url = `${this.getGateway('/p/cs/order/batch/ship/file')}`;
          } else if (this.tablename == 'V_IES_PRODUCT') { // 组合商品导入
            url = `${this.getGateway('/p/cs/combinedCommodity/batch/common')}`;
          } else if (this.tablename == 'T_IESSkuGroupDetail') { // 福袋商品明细导入
            url = `${this.getGateway('/p/cs/combinedCommodity/batch/luckyBag/detail')}`;
            sendData = {
              combinedCommoditySku: this.combinedCommoditySku
            };
          } else if (this.tablename == 'T_IESALIZHIYINGITEM') { // 阿里直营商品导入
            url = `${this.getGateway('/p/cs/ali/importitem')}`;
          } else if (this.tablename == 'T_IESJDCZITEM') { // 京东厂直商品导入
            url = `${this.getGateway('/p/cs/jdcz/importitem')}`;
          } else if (this.tablename == 'T_PRODUCT_UPLOAD') { // 商品上传里的导入
            if (this.payload.includes('247')) {
              sendData = {
                platform: '247',
                isUpdate: this.singleValue,
              };
            } else {
              sendData = {
                platform: '',
                isUpdate: this.singleValue,
              };
            }

            url = `${this.getGateway('/p/cs/mjproduct/import')}`;
          } else if (this.tablename == 'T_IESSKUPRICESTRATEGYITEM') {
            url = `${this.getGateway('/p/cs/strategy/skuprice/item/import')}`; // 商品价格异常监控策略明细导入
            sendData = {
              skuPriceStrategyId: this.mainId
            };
          } else if (this.tablename == 'T_IESSHOPSKUSTOCKLOCKITEM') {
            url = `${this.getGateway('/p/cs/importBarCodeLockItem')}`; // 锁库存策略明细导入
            sendData = {
              id: this.mainId
            };
          } else if (this.tablename == 'T_IESSKUPRICESTRATEGY') {
            url = `${this.getGateway('/p/cs/strategy/skuprice/import')}`; // 商品价格异常监控策略主表导入
          } else if (this.tablename == 'V_OMSSTORAGEIN') {
            url = `${this.getGateway('/p/cs/refund/batch/matching/importitem')}`; // 三无包裹匹配退单导入
          } else if (this.tablename == 'T_IESSTOCKFREEZEDETAIL') {
            url = `${this.getGateway('/p/cs/freeze/import')}`; // 冻结单子表明细导入
            sendData = {
              id: this.mainId
            };
          } else if (this.tablename == 'T_IESSTOCKFREEZE') {
            url = `${this.getGateway('/p/cs/freeze/allimport')}`; // 库存冻结单主表导入
          } else if (this.tablename == 'T_IESSTOCKTHAWDETAIL') {
            url = `${this.getGateway('/p/cs/thaw/import')}`; // 解冻单子表明细导入
            sendData = {
              id: this.mainId
            };
          } else if (this.tablename == 'T_IESSTOCKTHAW') {
            url = `${this.getGateway('/p/cs/thaw/allimport')}`; // 库存解冻单主表导入
          } else if (this.tablename == 'T_OMSJITAUTOPOLICYITEM') {
            url = `${this.getGateway('/p/cs/jit/autopolicy/item/import')}`; // JIT自动化策略明细导入
            sendData = {
              policyId: this.mainId
            };
          } else if (this.tablename == 'T_V_OMSINCIDENTALSRECORD') {
            // 仅退款单主表导入
            // url = `${this.getGateway('/p/cs/import')}`;
            const urls = {
              IMPORT_ADD: "/p/cs/import",// 原本的导入
              IMPORT_ADD_NO_ORDER: "/p/cs/returnmoney/create/no_original_order/import",// 新加的无原单导入
            }
            url = urls[this.importType];
            const updataValue = this.singleValue ? 'Y' : 'N';
            sendData = {
              table: this.tablename,
              mainTable: this.mainTable,
              mainId: this.mainId,
              menu: this.title,
              isUpdate: updataValue,
              startRow: this.inpNum
            };
          } else if (this.tablename == 'SETLOGISTICSAREAALL') { // 物流配送区域全国导入
            url = `${this.getGateway('/p/cs/deliveryregion/import')}`;
            sendData = {
              id: this.mainId
            };
          } else if (this.tablename == 'SETLOGISTICSAREACUSTOM') { // 物流配送区域自定义导入
            url = `${this.getGateway('/p/cs/customdeliveryregion/import')}`;
            sendData = {
              id: this.mainId
            };
          } else if (this.tablename == 'ad_data_permission') { // 数据权限导入
            url = `${this.getGateway('/p/cs/dataPermissionUpload')}`;
          } else if (this.tablename == 'T_OMSACTIVESKU') { // 促销活动赠送商品导入
            url = `${this.getGateway('/p/cs/giftActive/import')}`;
            sendData = {
              isGroup: this.isGroup?2:1,
              giftType: this.giftType,
              id: this.mainId
            };
          } else if (this.tablename == 'T_OMSSTANDITEM') { // 通用商品
            url = `${this.getGateway(`/p/cs/standitem/import?platform=${this.payload.platForm}`)}`;
          } else if (this.tablename == 'T_IESPOLICYPRODETAIL') { // 订单商品转换策略
            url = `${this.getGateway('/p/cs/policy/protransform/item/import')}`;
            sendData = {
              id: this.mainId
            };
          } else if (this.tablename == 'V_OMSSTORAGEIN_IMPORT') { // 【退货入库单】列表页【导入】
            url = `${this.getGateway('/p/cs/returnInStore/import')}`;
          } else if (this.tablename == 'T_OMSPRESALEGOODSQTY') { // 【商品预售库存设置】
            url = `${this.getGateway('/p/cs/presale/qty/import')}`;
            sendData = {
              // isUpdate: this.singleValue // 暂时用不到这个参数
              startNum: this.inpNum
            };
          } else if (this.tablename == 'T_V_OMSONLINEORDER_REPLACE_GOOD') { // 【订单管理】商品替换
            sendData = {
              ids: this.payload
            };
            url = `${this.getGateway('/p/cs/order/item/sku/import/replace')}`;
          } else if (this.tablename == 'T_V_OMSSIGNPACKAGE') { // 包裹签收
            url = `${this.getGateway('/p/cs/signpackage/import')}`; // 包裹签收导入
          } else if (this.tablename == 'T_V_OMS_ORDER_TODO') { // 订单待办
            url = `${this.getGateway('/p/cs/order_todo/import')}`; // 订单待办导入
            sendData = {
              type: this.singleValue?1:0
            };
          } else if (this.tablename == 'T_V_IESBTSETPLATSTOCK') { // 批量设置平台库存导入
            url = `${this.getGateway('/p/cs/stock/import')}`;
          } else if (this.tablename == 'T_IESBTSETPLATSTOCKITEM') { // 平台库存明细导入
            url = `${this.getGateway('/p/cs/stockitem/import')}`;
            sendData = {
              id: this.mainId
            };
          } else if (this.tablename == 'T_V_OMSONLINEORDER_V2') { // 订单管理导入（主子表）
            url = `${this.getGateway('/p/cs/order/create/import/v2')}`;
            sendData = {
              startNum: this.inpNum
            };
          } else if (this.tablename == 'T_V_IESSHOPSTORE') { // 店铺仓库策略导入
            url = `${this.getGateway('/p/cs/shopstore/import')}`;
          } else if (this.tablename == 'T_IES_PACKAGING_MATERIAL_RULE') { //包材规则设置导入
            url = `${this.getGateway('/p/cs/packaging_material_rule/import')}`;
          } else if (this.tablename == 'T_OMSACTIVEJOINGOODS' && this.mainId=='3139') {
            url = `${this.getGateway('/p/cs/active/joingoods/analysis')}`;
          } else if (this.tablename == 'T_OMSSALESINKINGDETAIL') { // 预售下沉策略商品导入
            url = `${this.getGateway('/p/cs/policy/salesinking/item/import')}`;
            sendData = {
              id: this.mainId
            };
          } else if (this.tablename == 'T_OMSORDERCVTPOLICY') { // 订单转换策略-导入
            url = `${this.getGateway('/p/cs/ordercvt/policy/import')}`;
          } else if (this.tablename == 'T_V_OMSPRINTORDER_CUSTOMERAUDIT') { // 补偿单-批量导入客审
            url = `${this.getGateway('/p/cs/compensateorder/customerAudit/import')}`;
          } else if (this.tablename == 'T_V_OMSPRINTORDER_FINANCEAUDIT') { // 补偿单-批量导入财审
            url = `${this.getGateway('/p/cs/compensateorder/finance_audit/import')}`;
          } else if (this.tablename == 'T_V_OMSCOMPENSATEORDER_CANCEL') { // 补偿单-批量导入驳回
            url = `${this.getGateway('/p/cs/compensateorder/cancel_audit/import')}`;
          } else if (this.tablename == 'T_V_OMSCOMPENSATEORDER_DISABLE') { // 补偿单-批量导入作废
            url = `${this.getGateway('/p/cs/compensateorder/disable/import')}`;
          } else if (this.tablename == 'T_IESKUSTOCKSCALE') { // 按SKU设置供货比例策略导入
            url = `${this.getGateway('/p/cs/shop/stock/scale/upload')}`;
          } else if (this.tablename == 'T_OMSREFUNDORDER_V2') { // 退换货单无原单导入
            url = `${this.getGateway('/p/cs/refund/no/order/import')}`;
          } else if (this.tablename == 'T_GOODSPRICERANGESTRATEGY_ITEMS') {
            url = `${this.getGateway('/p/cs/strategy/skupricerange/item/import')}`; // 商品价格异常监控策略明细导入
            sendData = {
              skuPriceRangeStrategyId: this.mainId
            };
          } else if (this.tablename == 'T_GOODSPRICERANGESTRATEGY_SCOPE') {
            url = `${this.getGateway('/p/cs/strategy/skupricerange/scope/import')}`; // 商品价格异常监控策略范围导入
            sendData = {
              skuPriceRangeStrategyId: this.mainId
            };
          }
        } else {
          url = `${this.getGateway('/p/cs/import')}`;
          const updataValue = this.singleValue ? 'Y' : 'N';
          sendData = {
            table: this.tablename,
            mainTable: this.mainTable,
            mainId: this.mainId,
            menu: this.title,
            isUpdate: updataValue,
            startRow: this.inpNum
          };
        }
        aUploadParame = Object.assign(
          {},
          {
            target: fileInformationUploaded,
            url,
            sendData,
            imgSize: this.fileSize,
            success: this.handleSuccess,
            onerror: this.handleError,
            onloadstart: this.onloadstart,
            type: 'file'

          }
        );
        const article = new Upload(aUploadParame);
      },
      // else if(this.tablename == 'T_OMSREFUNDORDER') { // 【退换货单】导入
      //     const updataValue = this.singleValue ? 'Y' : 'N';
      //     sendData = {
      //       table: this.tablename,
      //       mainTable: this.mainTable,
      //       mainId: this.mainId,
      //       menu: this.title,
      //       isUpdate: updataValue,
      //       startRow: this.inpNum
      //     };
      //     url = `${this.getGateway('/p/cs/refund/order/import')}`;
      //   } 
      // 上传成功
      handleSuccess(response) {
        console.log(222,response)
        let tableName = '';
        if (!this.$route) {
          tableName = '';
        } else {
          tableName = this.$route.params.tableName;
        }
        // const { tableName } = this.$route.params;
        if (response.code === 0) {
          this.$R3loading.hide(tableName);
          this.closeDialog();
          this.fileName = '';

          if (this.tablename == 'T_OMSACTIVEJOINGOODS' && this.mainId!='3139') {
            this.$Modal.fcSuccess({
              title: '警告',
              mask: true,
              content: '导入已进入任务列表，可在“我的任务”中查看进度。如果导入成功，请重新进入此编辑页面查看导入商品信息；注意在导入成功之前不可点击保存按钮，会导致导入的数据被覆盖!!!',
              onOk: ()=>{
                this.$parent.$parent.getOMSACTIVEJOINGOODS();
              }
            });
          } else if (this.tablename == 'T_IESSKUPRICESTRATEGYITEM' || this.tablename == 'T_IESSTOCKFREEZEDETAIL' || this.tablename == 'T_IESSTOCKTHAWDETAIL' || this.tablename == 'T_IESSHOPSKUSTOCKLOCKITEM' || this.tablename == 'T_OMSJITAUTOPOLICYITEM' || this.tablename == 'SETLOGISTICSAREAALL' || this.tablename == 'SETLOGISTICSAREACUSTOM' || this.tablename == 'T_GOODSPRICERANGESTRATEGY_ITEMS') {
            this.$Modal.fcSuccess({
              title: '警告',
              mask: true,
              content: '导入已进入任务列表，可在“我的任务”中查看进度。如果导入成功，请重新进入此编辑页面查看导入信息',
              onOk: ()=>{
                this.$parent.$parent.getpageDetailList();
              }
            });
          } else if (this.tablename == 'T_GOODSPRICERANGESTRATEGY_SCOPE') {
            this.$Modal.fcSuccess({
              title: '警告',
              mask: true,
              content: '导入已进入任务列表，可在“我的任务”中查看进度。如果导入成功，请重新进入此编辑页面查看导入信息',
              onOk: ()=>{
                this.$parent.$parent.getMonitorList();
              }
            });
          } else if (this.tablename == 'V_OMSSTORAGEIN') {
            this.$Modal.fcSuccess({
              title: '成功',
              mask: true,
              content: response.message
            });
          } else if (this.tablename == 'ad_data_permission') {
            document.getElementsByClassName('buttonGroup')[0].children[0].click();
            document.getElementsByClassName('buttonGroup')[1].children[1].click();
            this.$Modal.fcSuccess({
              title: '成功',
              mask: true,
              width: '600px',
              content: response.message
            });
          } else if (this.tablename == 'T_OMSACTIVESKU') {
            if (response.data.length > 0) {
              this.$emit('changeGiftGoods', response.data);
            }
          } else if (this.tablename == 'T_OMSACTIVEJOINGOODS' && this.mainId=='3139') {
            if (response.data.length > 0) {
              this.$emit('changeJoinGoods', response.data);
            }
          } else {
            this.$Modal.fcSuccess({
              title: '成功',
              mask: true,
              content: response.message
            });
          }

          this.$emit('importantSuccess');
          if (this.tablename == 'T_IESSkuGroupDetail') {
            this.$emit('jumpPage'); // 福袋商品导入成功跳转编辑页面
          }
          this.clearFile();
          const asyncTaskScheme = () => (window.ProjectConfig && window.ProjectConfig.asyncTaskScheme ? window.ProjectConfig.asyncTaskScheme : ''); // 异步导出设计方案
          if(asyncTaskScheme() === 'skq') {
            const params = {
              detail: {
                type: 'notice'
              }
            }
            DispatchEvent(R3_IMPORT, params)
            this.$R3loading.hide(this.loadingName);
            this.closeDialog()
            return
          }
        } else {
          this.$R3loading.hide(tableName);
          if (response.data) {
            if (response.data.path) {
              if (response.data.path === 'undefined ===') {
                this.errorMsg.errorUrl = '';
              } else {
                const gatewayth = this.getGateway('/p/cs/download?filename');
                this.errorMsg.errorUrl = this.urlChange(`${gatewayth}=${
                  response.data.path
                }`);
              }
            }
            this.errorMsg.errorList = response.data.error || [
              { rowIndex: 0, message: '' }
            ];
          } else {
            this.errorMsg.errorList = response.error || [
              { rowIndex: 0, message: '' }
            ];
          }
          this.errorMsg.message = response.message;
          // this.$Modal.fcWarning({
          //   title: '警告',
          //   mask: true,
          //   content: response.message
          // });
          this.clearFile();
        }
        this.$emit('confirmImport');
      },
      urlChange(url) { // 对下载的url地址进行转换，处理特殊字符
        const arr = url.split('/');
        let [last] = [...arr].reverse();
        last = encodeURIComponent(last);
        arr[arr.length - 1] = last;
        return arr.join('/');
      },
      // 上传失败
      handleError(e) {
        let tableName = '';
        if (!this.$route) {
          tableName = '';
        } else {
          tableName = this.$route.params.tableName;
        }
        // const { tableName } = this.$route.params;
        this.$R3loading.hide(tableName);
        const emg = e;
        let formatJsonEmg = null;
        try {
          formatJsonEmg = JSON.stringify(JSON.parse(emg), null, 4);
        } catch (v) {
          if (typeof emg === 'string') {
            formatJsonEmg = emg.replace(/<br\/>/g, '\r\n');
          }
        }

        window.vm.$Modal.fcError({
          mask: true,
          titleAlign: 'center',
          title: '错误',
          render: h => h('div', {
            style: {
              padding: '10px 20px 0',
              display: 'flex',
              lineHeight: '16px'
            }
          }, [

            h('i', {
              props: {
              },
              style: {
                marginRight: '5px',
                display: 'inline-block',
                'font-size': '28px',
                'margin-right': ' 10px',
                'line-height': ' 1',
                padding: ' 10px 0',
                color: 'red'
              },
              class: 'iconfont iconbj_error fcError '
            }),
            h('div', {
              style: `width: 80%;
                  margin: 1px;
                  margin-bottom: -8px;
                  box-sizing: border-box;
                  padding: 5px;
                  resize: none;
                  max-height: 100px;
                  max-width: 300px;
                  overflow: auto;
                  `
            }, formatJsonEmg)
          ])
        });
        this.clearFile();
        this.closeDialog();
      },
      closeDialog() {
        this.modalVisible = false;
        this.fatherMethod();
        if (this.tablename == 'T_IESSkuGroupDetail') {
          this.clearFile();
          this.errorMsg = {
            // 错误信息
            errorUrl: '',
            message: '',
            errorList: []
          };
        }
      }
    }
  };
</script>
<style lang="less">
.importDialog {
  .importICon {
    margin: 0;
    text-align: center;
    .icon-span {
      display: inline-block;
      height: 28px;
      width: 28px;
      i {
        color: #09a155;
        font-size: 28px;
      }
    }
  }
  .import-panel {
    padding: 0 40px;
    position: relative;
    .el-upload__tip {
      margin-top: 10px;
      font-size: 12px;
      color: #575757;
      .inputValue{
        border: none;
        border-bottom: 1px solid #b8b8b8;
        text-align: center;
        width: 100px;
      }
      .singleValue{
        margin-left:10px;
      }
    }
    .upload-panel {
      height: 50px;
      margin-top: 10px;
    }
    .fileName {
      height: 21px;
      line-height: 21px;
      color: #606266;
    }
  }
  .fileInput {
    position: relative;
    left: -67px;
    opacity: 0;
    width: 62px;
  }
  .tip {
    font-size: 12px;
    display: inline-block;
    margin-left: -61px;
    color: #b8b8b8;
  }
  .error-content {
    border-top: solid 1px #bcbcbc;
    text-align: left;
    position: relative;
    font-size: 12px;
    margin-top: 10px;
    .error-message {
      height: auto;
      margin: 10px 0px;
      max-height: 240px;
      position: relative;
      width: 550px;
      .left-icon {
        height: 28px;
        width: 28px;
        position: absolute;
        left: 0;
        top: 0;
        i {
          font-size: 28px;
          color: #e80000;
        }
      }
      .right-content {
        position: relative;
        margin-left: 38px;
        .link {
          line-height: 16px;
          a {
            color: #0f8ee9;
            cursor: pointer;
            display: inline-block;
            padding-top: 6px;
            text-decoration: none;
          }
        }
        .content-message {
          max-height: 220px;
          min-height: 28px;
          overflow: auto;
          p {
            word-break: break-word;
            line-height: 16px;
            margin: 6px 0;
          }
        }
      }
    }
  }
  // .ark-modal-header {
  //   height: 30px !important;
  //   line-height: 30px !important;
  //   background: #f8f8f8 !important;
  //   border-top-right-radius: 10px !important;
  //   border-top-left-radius: 10px !important;
  //   .modal-header-inner {
  //     padding: 0;
  //     height: 30px !important;
  //     line-height: 30px !important;
  //     text-align: center !important;
  //     background: #f8f8f8 !important;
  //     border-bottom: solid 1px #ddd !important;
  //     border-top-right-radius: 10px !important;
  //     border-top-left-radius: 10px !important;
  //     cursor: move !important;
  //   }
  //   .ark-modal-header-inner {
  //     line-height: 31px !important;
  //     font-size: 13px !important;
  //     color: #303133 !important;
  //     font-weight: normal;
  //   }
  // }
  .ark-modal-body {
    padding: 20px !important;
  }
  .iconios-close {
    color: #999 !important;
  }
  .ark-modal-footer {
    border-top: none !important;
    padding: 0 20px 20px;
    margin: 10px 40px;
  }
  .ark-btn-fcdefault {
    height: 24px !important;
    font-size: 12px !important;
    width: 66px !important;
    padding: 0 !important;
  }
  .ark-modal-footer button > span {
    font-size: 12px;
  }
}
</style>
