<template>
  <div class="mall-section-container">
    <div class="mall-content-section">
      <!-- <div class="mall-content-title">
        <el-breadcrumb separator="/">
          <el-breadcrumb-item :to="{ path: '' }">
            <a href="/report/#/memberSummary">首页</a>
          </el-breadcrumb-item>
          <el-breadcrumb-item>积分商城</el-breadcrumb-item>
          <el-breadcrumb-item>活动</el-breadcrumb-item>
          <el-breadcrumb-item :to="{ path: '/flashSale' }">
            秒杀
          </el-breadcrumb-item>
          <el-breadcrumb-item>{{ isEdit ? '编辑' : '新建' }}秒杀</el-breadcrumb-item>
        </el-breadcrumb>
        <h3>
          <span>{{ isEdit ? '编辑' : '新建' }}秒杀</span>
        </h3>
      </div> -->
      <div class="section" v-loading="loading">
        <el-form
          :model="flashSaleForm"
          :rules="flashSaleRules"
          ref="flashSaleForm"
          label-width="110px"
          class="demo-ruleForm"
          label-position="right"
        >
          <el-form-item label="活动名称" prop="activityName">
            <el-input
              v-model.trim="flashSaleForm.activityName"
              :disabled="isEdit"
              class="w-300"
              type="text"
              placeholder="活动名称将会在小程序秒杀组件中展示"
              @input="value => goodsLimit(value)"
            >
              <span slot="suffix">{{ proNameLen }}/9</span>
            </el-input>
          </el-form-item>
          <!-- 数据对话厅现在不接入，统一传值为空 -->
          <!-- <el-form-item label="数据对话">
            <dm-activity-select :repProjectName="projectName" width="300" :actId.sync="flashSaleForm.dataTalkId" :showAdd="false"></dm-activity-select>
          </el-form-item> -->
          <el-form-item label="时间范围" required>
            <el-date-picker
              :default-time="['00:00:00', '23:59:59']"
              :picker-options="pickerOptions"
              :disabled="isEdit"
              class="date-picker"
              style="width:400px"
              v-model="dateValue"
              type="datetimerange"
              range-separator="~"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            />
          </el-form-item>
          <el-form-item
            label="适用对象"
            label-width="120px"
            class="label-icons"
            prop="memberSearchType"
          >
            <el-tooltip
              class="tips-content"
              popper-class="store-tips"
              effect="dark"
              content="秒杀活动将忽略商品设置的会员等级，以活动适用对象为主"
              placement="top-start"
            >
              <i class="iconfont icon-xinxixianshi" style="color:#909399" />
            </el-tooltip>
            <el-radio
              style="margin-right:0px"
              v-model="flashSaleForm.memberSearchType"
              :disabled="isEdit"
              :label="1"
            >
              全部客户
            </el-radio>
            <el-radio
              style="margin-right:0px"
              v-model="flashSaleForm.memberSearchType"
              :disabled="isEdit"
              :label="2"
            >
              会员分组
            </el-radio>
            <el-radio
              style="margin-right:0px"
              v-model="flashSaleForm.memberSearchType"
              :disabled="isEdit"
              :label="3"
            >
              人群筛选
            </el-radio>
          </el-form-item>
          <el-form-item v-if="flashSaleForm.memberSearchType === 2">
            <vue-gic-member-group
              style="padding-left:0"
              :readonly="readonly"
              :defaltSelected="defaltSelected"
              :height="height"
              :projectName="projectName"
              :headerList="headerList"
              :effectiveStatus="effectiveStatus"
              @handleDataTransferred="handleDataTransferred"
              @handleDataLeft="handleDataLeft"
            />
          </el-form-item>
          <el-form-item v-if="flashSaleForm.memberSearchType === 3">
            <div v-if="channel === 0" :class="[isEdit ? 'disabled' : '']">
              <vue-gic-people
                :projectName="projectName"
                :isAdd="isAdd"
                :searchBackTxt.sync="searchBackTxt"
                :conditionList.sync="conditionList"
                :triggerReset="true"
                :useId="useId"
                :hasSearchData="hasSearchData"
                :sceneValue="sceneValue"
                ref="peopleFilter"
                @findFilter="findFilter"
                @getBackData="getBackData"
                @editHide="editHide"
                @editShow="editShow"
                @hideBtn="hideBtn"
              />
              <div class="gic-people--button" v-show="toggleTag">
                <el-button size="small" type="primary" @click="getData">
                  确 定
                </el-button>
                <el-button size="small" @click="cancelFilter">
                  取 消
                </el-button>
              </div>
            </div>
            <!-- <div v-if="channel === 1">{{ peopleFilterInfo }}</div>
              -->
            <el-popover
              placement="top-start"
              width="400"
              trigger="hover"
              :content="searchParams"
            >
              <el-button slot="reference" type="text">
                {{ peopleFilterInfo }}
              </el-button>
            </el-popover>
          </el-form-item>
          <!-- <el-form-item label="购买限制">
            <el-checkbox-group v-model="flashSaleForm.limit" @change="changeLimit">
              <el-checkbox label="1" :disabled="isEdit">忽略商品&nbsp;(仅对礼品生效)&nbsp;的限购</el-checkbox>
            </el-checkbox-group>
          </el-form-item> -->
          <!-- <el-form-item label="活动列表背景色">
            <el-radio-group v-model="flashSaleForm.activityBackGround">
              <el-radio :label="0">白色</el-radio>
              <el-radio :label="1">灰色</el-radio>
            </el-radio-group>
          </el-form-item> -->
          <el-form-item label="活动列表顶图">
            <el-upload
              class="avatar-uploader"
              with-credentials
              :action="uploadAction"
              :headers="headersUpload"
              :show-file-list="false"
              :on-success="handleSuccess"
              :before-upload="beforeUpload"
            >
              <div class="preview-picture" v-if="flashSaleForm.activityImageUrl">
                <i class="el-icon-zoom-in" @click.stop="previewPicture" />
                <i class="el-icon-delete" style="margin-left:6px" @click.stop="deletePicture" />
              </div>
              <img
                v-if="flashSaleForm.activityImageUrl"
                :src="flashSaleForm.activityImageUrl"
                class="avatar"
                style="width:100px;height:100px"
              >
              <div v-else class="avatar-icon">
                <i class="el-icon-plus avatar-uploader-icon" />
                <span style="display:block;font-size:12px;color:#606266;line-height: 17px;">上传图片</span>
              </div>
            </el-upload>
            <p class="avatar-text">
              图片宽度≥700px，高度≤1500px，大小不超过 2 MB，未上传展示默认图
            </p>
            <el-dialog :visible.sync="dialogVisibleImg">
              <img width="100%" :src="flashSaleForm.activityImageUrl" alt>
            </el-dialog>
          </el-form-item>
          <el-form-item label="活动商品设置">
            <div class="add-sku-content">
              <div class="add-table" v-if="selectList.length">
                <el-table
                  :data="selectList"
                  ref="multipleTable"
                  style="width: 100%"
                  :row-key="getRowKeys"
                  default-expand-all
                  :tree-props="{ children: 'children' }"
                >
                  <el-table-column label="商品信息" min-width="200px">
                    <template slot-scope="{ row }">
                      <div style="display: flex">
                        <!-- 保持第一级节点的排序框左对齐 -->
                        <div style="padding-left: 20px;" v-if="row.level == 1" />
                        <div class="gift-info" style="display: flex" v-if="row.giftType">
                          <img :src="row.mainImageUrl" alt>
                          <div class="info-name">
                            <div style="display:flex;flex-direction:column;justify-content:center;margin-top:7px">
                              <p :class="[row.giftType ? 'pro-ellipsis2' : '']">
                                {{ row.proName }}
                              </p>
                              <!-- <p class="pro-ellipsis" :class="[row.giftType ? 'height40' : '']">{{ row.proName }}</p> -->
                              <p class="category-ellipsis">
                                礼品编码：{{ row.proCode }}
                              </p>
                            </div>
                          </div>
                        </div>
                        <div class="gift-info" style="display: flex" v-else>
                          <img v-if="row.mainImageUrl" :src="row.mainImageUrl" alt>
                          <img v-if="!isEdit && row.cardType === 2 && !row.mainImageUrl" src="../../../../static/img/quan02.png" alt>
                          <img v-if="!isEdit && row.cardType === 0 && !row.mainImageUrl" src="../../../../static/img/quan01.png" alt>
                          <img v-if="!isEdit && row.cardType === 1 && !row.mainImageUrl" src="../../../../static/img/quan03.png" alt>
                          <img v-if="isEdit && row.giftProType === 2 && !row.mainImageUrl" src="../../../../static/img/quan02.png" alt>
                          <img v-if="isEdit && row.giftProType === 0 && !row.mainImageUrl" src="../../../../static/img/quan01.png" alt>
                          <img v-if="isEdit && row.giftProType === 1 && !row.mainImageUrl" src="../../../../static/img/quan03.png" alt>
                          <div class="info-name">
                            <p class="pro-ellipsis">
                              {{ row.proTitle }}
                            </p>
                            <p class="category-ellipsis" v-if="row.proReferId.split(',').length > 1">
                              --
                            </p>
                            <p class="category-ellipsis" v-else>
                              {{ row.remarks || '--' }}
                            </p>
                            <p class="category-ellipsis" v-if="row.proReferId.split(',').length === 1 && row.exchangeFixDateBegin && row.exchangeFixDateEnd">
                              {{ getTimeAll(row.exchangeFixDateBegin) }}至{{ getTimeAll(row.exchangeFixDateEnd) }}
                            </p>
                            <p class="category-ellipsis" v-if="row.proReferId.split(',').length === 1 && !row.exchangeFixDateBegin && !row.exchangeFixDateEnd">
                              长期有效
                            </p>
                            <p class="category-ellipsis" v-if="row.proReferId.split(',').length !== 1">
                              --
                            </p>
                          </div>
                        </div>
                      </div>
                    </template>
                  </el-table-column>
                  <el-table-column label="原价" v-if="!isEdit">
                    <template slot-scope="{ row }">
                      {{ row.integralCost }}积分+{{ row.cashCost }}元
                    </template>
                  </el-table-column>
                  <el-table-column label="当前库存" v-if="!isEdit">
                    <template slot-scope="{ row }">
                      {{ row.virtualStock }}
                    </template>
                  </el-table-column>
                  <el-table-column label="活动价格" min-width="100px">
                    <template slot-scope="{ row }">
                      <div v-if="!(row.giftType && row.children && row.children.length) && !isEdit">
                        <el-input
                          v-model.trim="row.activityIntegral"
                          :disabled="!row.activityProStatus"
                          placeholder="输入积分"
                          size="small"
                          class="w-110"
                        />
                      </div>
                      <div v-if="!(row.giftType && row.children && row.children.length) && !isEdit" class="mt10">
                        <el-input
                          v-model.trim="row.activityPrice"
                          :disabled="!row.activityProStatus"
                          placeholder="输入现金"
                          size="small"
                          class="w-110"
                        />
                      </div>
                      <span v-if="isEdit">{{ row.activityIntegral ? row.activityIntegral : '0' }}积分+{{ row.activityPrice ? row.activityPrice : '0' }}元</span>
                    </template>
                  </el-table-column>
                  <el-table-column label="活动库存" min-width="100px">
                    <template #header>
                      <span style="font-weight:500">活动库存</span>
                      <el-tooltip effect="dark" placement="top">
                        <div slot="content" v-if="!isEdit" style="width:300px;line-height:16px">
                          <p>1. 设置后将会从礼品本身的库存中扣除相应的库存作为活动库存;</p>
                          <p>2. 限兑数量为0或空时表示不限兑;</p>
                          <p>3. 将忽略商品（仅对礼品生效）的限购</p>
                        </div>
                        <div slot="content" v-else style="width:200px;line-height:16px">
                          <p>1. 活动剩余库存/活动总库存</p>
                          <p>2. 将忽略商品（仅对礼品生效）的限购</p>
                        </div>
                        <i class="iconfont icon-xinxixianshi" style="margin-left:6px" />
                      </el-tooltip>
                    </template>
                    <template slot-scope="{ row }">
                      <div v-if="!(row.giftType && row.children && row.children.length) && !isEdit">
                        <el-input
                          v-model.trim="row.activityStock"
                          :disabled="!row.activityProStatus"
                          placeholder="输入库存"
                          size="small"
                          class="w-110"
                          @blur="limitStock(row.activityStock, row.virtualStock, row)"
                        />
                      </div>
                      <div v-if="!(row.giftType && row.children && row.children.length) && !isEdit" class="mt10">
                        <el-input
                          v-model.trim="row.activityExchangeLimit"
                          :disabled="!row.activityProStatus"
                          placeholder="输入限兑数量"
                          size="small"
                          class="w-110"
                        />
                      </div>
                      <span v-if="isEdit">{{ row.activityStock }}/{{ row.activityTotalStock }}</span>
                    </template>
                  </el-table-column>
                  <el-table-column label="限兑数量" v-if="isEdit">
                    <template slot-scope="{ row }">
                      {{ row.activityExchangeLimit }}
                    </template>
                  </el-table-column>
                  <el-table-column label="参与活动">
                    <template slot-scope="{ row }">
                      <el-switch v-if="!isEdit && row.isShow" v-model="row.activityProStatus" @change="changeActivityStatus" />
                      <el-switch v-if="row.isShow && isEdit" v-model="row.activityProStatus" disabled />
                    </template>
                  </el-table-column>
                  <el-table-column label="操作" min-width="130px">
                    <template slot-scope="{ row }">
                      <div style="font-size:0px">
                        <el-button
                          type="text"
                          v-if="row.giftType && row.children && row.children.length && !row.isShow && isEdit && !overStatus"
                          class="mr20"
                          @click="updateSkuStock(row)"
                        >
                          调整库存
                        </el-button>
                        <el-popover
                          placement="top"
                          trigger="click"
                          :ref="row.integralMallProId"
                          @show="getStockDetail(row.activityProId, row.commonStock)"
                        >
                          <div>
                            <el-select v-model="stockType" style="width:100px;">
                              <el-option label="增加" :value="1" />
                              <!-- <el-option label="减少" :value="0"></el-option> -->
                            </el-select>
                            <el-input-number
                              v-model="testStock"
                              style="margin-left:-6px;width:140px"
                              controls-position="right"
                              :min="0"
                              :max="maxStock"
                            />
                          </div>
                          <p style="color:#606266;font-size:12px;line-height:17px;font-weight:400;margin-top:10px">
                            当前商品库存：{{ row.commonStock }}
                          </p>
                          <div class="popver-button" style="margin-top:18px;text-align:right">
                            <!-- <el-button type="dafault" size="small" @click="$refs.popover2.showPopper = false">取消</el-button> -->
                            <el-button type="dafault" size="small" @click="onCancel(row.integralMallProId)">
                              取消
                            </el-button>
                            <el-button
                              type="primary"
                              size="small"
                              class="ml10 ml10"
                              @click="handleStock(row.integralMallProId, row)"
                            >
                              确认
                            </el-button>
                          </div>
                          <el-button
                            slot="reference"
                            type="text"
                            v-if="!row.giftType && isEdit && !overStatus"
                            class="mr20"
                          >
                            调整库存
                          </el-button>
                        </el-popover>
                        <el-popover
                          placement="top"
                          trigger="click"
                          :ref="row.activityProId"
                          @show="getStockDetail(row.activityProId, row.commonStock)"
                        >
                          <div>
                            <el-select v-model="stockType" style="width:100px;">
                              <el-option label="增加" :value="1" />
                              <!-- <el-option label="减少" :value="0"></el-option> -->
                            </el-select>
                            <el-input-number
                              v-model="testStock"
                              style="margin-left:-6px;;width:140px"
                              controls-position="right"
                              :min="0"
                              :max="maxStock"
                            />
                          </div>
                          <p style="color:#606266;font-size:12px;line-height:17px;font-weight:400;margin-top:10px">
                            当前商品库存：{{ row.commonStock }}
                          </p>
                          <div class="popver-button" style="margin-top:18px;text-align:right">
                            <el-button type="dafault" size="small" @click="onCancel(row.activityProId)">
                              取消
                            </el-button>
                            <el-button
                              type="primary"
                              size="small"
                              class="ml10 ml10"
                              @click="handleStock(row.activityProId, row)"
                            >
                              确认
                            </el-button>
                          </div>
                          <el-button
                            slot="reference"
                            type="text"
                            v-if="row.giftType && row.children && !row.children.length && !row.isShow && isEdit && !overStatus"
                            class="mr20"
                          >
                            调整库存
                          </el-button>
                        </el-popover>
                        <el-button type="text" v-if="!row.giftType && !overStatus" @click="deleteSelectList(row)">
                          删除
                        </el-button>
                        <el-button
                          type="text"
                          v-if="row.giftType && !row.isShow && !overStatus"
                          class="mr12"
                          @click="deleteSelectList(row)"
                        >
                          删除
                        </el-button>
                        <el-button type="text" v-if="row.giftType && row.children && row.children.length && row.isExpand" @click="changeExpand(row)">
                          收起
                        </el-button>
                        <el-button type="text" v-if="row.giftType && row.children && row.children.length && !row.isExpand" @click="changeExpand(row)">
                          展开
                        </el-button>
                      </div>
                    </template>
                  </el-table-column>
                </el-table>
              </div>
              <div class="add-sku" v-if="!isEdit">
                <div class="add-sku-button">
                  <el-button @click="addGoods" type="text" :disabled="isEdit || selectList.length === 20">
                    添加商品&nbsp;({{ selectList.length }}/20)
                  </el-button>
                </div>
              </div>
            </div>
          </el-form-item>
          <!-- <div class="confim-btn" :style="{ width: fixedWidth + 'px' }">
            <el-form-item class="fix-btn">
              <el-button
                type="primary"
                size="small"
                v-if="!isEdit"
                @click="submitForm('flashSaleForm')"
              >
                确认新建
              </el-button>
              <el-button
                type="primary"
                size="small"
                v-else
                @click="submitForm('flashSaleForm')"
              >
                保存
              </el-button>
            </el-form-item>
          </div> -->
        </el-form>
      </div>
      <goods-select
        v-if="goodsDialog"
        :selectListMore="selectListMore"
        @closeGoodsSelect="closeGoodsSelect"
        @getSelectList="getSelectList"
      />
      <update-sku-stock v-if="skuStockDialog" :skuStockData="skuStockData" @closeSkuStock="closeSkuStock" />
    </div>
    <dm-form-bottom>
      <el-button
        type="primary"
        size="small"
        v-if="!isEdit"
        @click="submitForm('flashSaleForm')"
      >
        确认新建
      </el-button>
      <el-button
        type="primary"
        size="small"
        v-else
        @click="submitForm('flashSaleForm')"
      >
        保存
      </el-button>
    </dm-form-bottom>
  </div>
</template>

<script>
import qs from 'qs';
import request from '../../../service/request.js';
import getInputVal from '../../../utils/common.js';
import goodsSelect from '../../../components/goodsSelect';
import copy from '../../../utils/clone.js';
import updateSkuStock from '../../../components/updateSkuStock';
export default {
  components: {
    goodsSelect,
    updateSkuStock,
  },
  data () {
    return {
      pickerOptions: {
        disabledDate (time) {
          // disabledDate 文档上：设置禁用状态，参数为当前日期，要求返回 Boolean
          // return time.getTime() > Date.now()//选当前时间之前的时间
          // 如果没有后面的-8.64e7就是不可以选择今天的
          return time.getTime() < Date.now() - 8.64e7 || time.getTime() > Date.now() + 31 * 24 * 3600 * 1000; // 选当前时间之后的时间,最长一个月31天
        },
      },
      dialogVisibleImg: false,
      stockType: 1,
      stock: 0,
      testStock: 0,
      maxStock: '',
      isEdit: false,
      loading: false,
      getTimeAll: getInputVal.formatDate,
      getTime: getInputVal.getTime,
      getTime2: getInputVal.getTime2,
      getHours: getInputVal.getHours,
      proNameLen: 0,
      fixedWidth: document.documentElement.clientWidth - 200,
      flashSaleForm: {
        activityName: '',
        dataTalkId: '', // 数据对话id
        beginTime: '',
        endTime: '',
        memberSearchType: 1, // 会员类型
        limit: [], // 购买限制
        ignoreLimitFlag: 0,
        activityBackGround: '',
        activityImageUrl: 'https://pic01-10001430.image.myqcloud.com/a6f506c1-59d4-4776-b995-78a9d4c3c565', // 活动列表顶图
      },
      flashSaleRules: {
        activityName: [{ required: true, message: '请输入活动名称', trigger: 'blur' }],
        // activityTime: [{ required: true, message: '请选择时间范围', trigger: 'change' }],
        memberSearchType: [{ required: true, trigger: 'change' }],
      },
      projectName: 'integral-mall',
      defaltSelected: [], //  默认穿梭窗已选入数据
      memberLabelId: [],
      readonly: false,
      height: 543, // 穿梭窗高度， 默认是543
      // projectName: 'mall', // 默认是memberTag
      headerList: ['isRealTime', 'latestUpdateTime', 'updateType', 'effectiveStatus', 'effectiveDate'], // 表头配置，默认全部，分组名称默认显示不可配置
      effectiveStatus: 1,
      // 人群筛选器
      // projectName: 'mall', // 当前项目名
      searchBackTxt: '', // 保存选中的筛选条件用来不走接口查缩略信息
      getSaveData: '',
      conditionList: [],
      usePeopleFilter: false,
      sceneValue: 'member', // 场景值
      useId: '', // 模板id
      hasSearchData: '', // 当前页回显的数据(接口返回)
      operateType: true, // 编辑的时候是false 新增是true 例如列表筛选是开始true 编辑改成false
      toggleTag: false, // 控制(确认取消)按钮显示的参数,仅供参考,可自行修改
      saveTag: false, // 控制(保存)按钮显示的参数,仅供参考,可自行修改
      searchParams: {}, // 查询数据数据
      responseParams: [], // 回显的数据
      channel: 0,
      uploadAction: window.location.origin + '/api-plug/upload-img?requestProject=integral-mall',
      // uploadAction: 'http://gicdev.demogic.com/api-plug/upload-img?requestProject=integral-mall',
      headersUpload: {
        sign: '',
      },
      goodsDialog: false, // 选择商品弹窗
      selectList: [], // 选中的商品
      selectListCopy: [],
      selectListMore: [],
      isExpand: true, // 收起与展开的显示
      skuStockDialog: false, // 开启和关闭修改实物礼品多规格sku
      skuStockData: [], // 修改实物礼品过规格数据
      activityProList: [],
      activityId: '',
      overStatus: false, // 编辑时判断活动是否已结束，true为结束，false为未结束
      activityProId: '', // 调整库存卡券或无sku库存时id，
      isCorrect: true,
      submitLoading: false,
    };
  },
  computed: {
    dateValue: {
      get () {
        return [this.flashSaleForm.beginTime, this.flashSaleForm.endTime];
      },
      set (val) {
        // [this.flashSaleForm.beginTime, this.flashSaleForm.endTime] = val ? [this.getTimeAll(val[0]), this.getTimeAll(val[1])] : ['', ''];
        [this.flashSaleForm.beginTime, this.flashSaleForm.endTime] = val || ['', ''];
      },
    },
  },
  created () {
    // this.isEdit = this.$route.query.edit;
    this.isEdit = !!this.$route.query.activityId;
    this.activityId = this.$route.query.activityId;
    if (this.$route.query.activityId) {
      this.getMess();
    }
  },
  methods: {
    onCancel (row) {
      this.$refs[row].doClose();
    },
    // 获取详情
    getMess () {
      // get-activity-detail
      const params = {
        activityId: this.activityId,
      };
      this.loading = true;
      request.post('/api-integral-mall/get-activity-detail', qs.stringify(params)).then(res => {
        if (res.data.errorCode === 0) {
          const resResult = res.data.result;
          this.flashSaleForm.activityName = resResult.activityName;
          this.goodsLimit(this.flashSaleForm.activityName);
          // this.flashSaleForm.dataTalkId = resResult.dataTalkId;
          this.flashSaleForm.dataTalkId = '';
          this.flashSaleForm.memberSearchType = resResult.memberSearchType;
          this.flashSaleForm.limit = resResult.ignoreLimitFlag ? ['1'] : [];
          this.flashSaleForm.activityBackGround = resResult.activityBackGround;
          this.flashSaleForm.activityImageUrl = resResult.activityImageUrl;
          this.flashSaleForm.beginTime = resResult.beginTime;
          this.flashSaleForm.endTime = resResult.endTime;
          // 编辑时根据活动结束时间与当前时间做对比，判断是否已结束，已结束活动编辑时只能查看，不能进行调整库存及删除操作
          const time = new Date();
          if (this.flashSaleForm.endTime < time.getTime()) {
            this.overStatus = true;
          } else {
            this.overStatus = false;
          }
          // this.flashSaleForm.activityName = resResult.memberSearchType ,
          if (resResult.memberSearchType === 2) {
            // this.defaltSelected = resResult.memberSearchParams;
            this.defaltSelected = JSON.parse(resResult.tagGroupJson);
            this.readonly = true;
          } else if (resResult.memberSearchType === 3) {
            this.searchParams = resResult.memberSearchParams;
            this.useId = resResult.activityId;
            // this.searchParams = res.data.result.searchParams;
            // this.responseParams = resResult.responseParams;
            this.hasSearchData = resResult.memberSearchParams;
            this.searchBackTxt = JSON.parse(resResult.memberSearchParams);
            // this.operateType = false;
          }
          if (resResult.activityProList) {
            this.selectList = [];
            resResult.activityProList.forEach((item, index) => {
              if (item.giftProType === 3) {
                this.selectList.push({
                  isShow: false,
                  activityProStatus: true,
                  isExpand: true,
                  activityExchangeLimit: item.activityExchangeLimit,
                  activityIntegral: item.activityIntegral,
                  activityPrice: item.activityPrice,
                  activityStock: resResult.activityStatus === 2 ? item.activityTotalSurplusStock : item.activityStock,
                  activityTotalStock: resResult.activityStatus === 2 ? item.activityTotalSumStock : item.activityTotalStock,
                  commonStock: item.commonStock,
                  integralMallProId: item.giftProId,
                  giftProType: item.giftProType,
                  giftType: 1,
                  mainImageUrl: item.giftImageUrl,
                  proCode: item.giftCode,
                  proName: item.proName,
                  activityProId: item.activityProId,
                  children: [],
                });
                if (item.activityProSkuList && item.activityProSkuList.length) {
                  item.activityProSkuList.forEach(it => {
                    const giftPropValues = JSON.parse(it.proName);
                    const skuName = [];
                    giftPropValues.forEach(it2 => {
                      skuName.push(it2.valueName);
                    });
                    this.selectList[index].children.push({
                      isShow: true,
                      activityProStatus: !!it.activityProStatus,
                      activityExchangeLimit: it.activityExchangeLimit,
                      activityIntegral: it.activityIntegral,
                      activityPrice: it.activityPrice,
                      activityStock: resResult.activityStatus === 2 ? it.activityTotalSurplusStock : it.activityStock,
                      activityTotalStock: resResult.activityStatus === 2 ? it.activityTotalSumStock : it.activityTotalStock,
                      commonStock: it.commonStock,
                      integralMallProId: it.giftProSkuId,
                      // giftProType: item.giftProType,
                      giftType: 1,
                      level: 1,
                      mainImageUrl: item.giftImageUrl,
                      proCode: item.giftCode,
                      activitySkuList: JSON.parse(it.proName),
                      proName: skuName.join(','),
                      activityProId: it.activityProId,
                    });
                  });
                }
              } else {
                this.selectList.push({
                  isShow: false,
                  activityProStatus: true,
                  isExpand: true,
                  activityExchangeLimit: item.activityExchangeLimit,
                  activityIntegral: item.activityIntegral,
                  activityPrice: item.activityPrice,
                  activityStock: item.activityStock,
                  activityTotalStock: item.activityTotalStock,
                  commonStock: item.commonStock,
                  integralMallProId: item.giftProId,
                  giftType: 0,
                  giftProType: item.giftProType,
                  mainImageUrl: item.giftImageUrl,
                  proCode: item.giftCode,
                  putEffectiveMode: item.putEffectiveMode,
                  proReferId: item.proReferId,
                  exchangeFixDateBegin: item.putBeginDate,
                  exchangeFixDateEnd: item.putEndDate,
                  proTitle: item.proName,
                  activityProId: item.activityProId,
                  // remarks: item.remarks
                  // proName: item.giftName
                });
              }
            });
            console.log('data', this.selectList);
          }
          // console.log(this.selectList);
          this.loading = false;
        } else {
          this.$message.error(res.data.message);
          this.loading = false;
        }
      });
    },
    // 选中活动商品
    getSelectList (val) {
      if (val) {
        // this.isExpand = true;
        this.selectListCopy = val;
        this.selectListCopy.forEach(item => {
          item.giftType = item.type;
          item.isShow = false;
          item.activityProStatus = true;
          item.activityExchangeLimit = ''; // 限兑
          item.activityIntegral = ''; // 活动积分
          item.activityPrice = ''; // 活动价格
          item.activityStock = ''; // 活动库存
          item.isExpand = true;
          const giftProStandardJson = item.giftProStandardJson ? JSON.parse(item.giftProStandardJson) : [];
          if (giftProStandardJson.length) {
            item.children = JSON.parse(item.skuJson);
            item.children.forEach(it => {
              it.mainImageUrl = item.mainImageUrl;
              const giftPropValues = JSON.parse(it.giftPropValues);
              const skuName = [];
              giftPropValues.forEach(it2 => {
                skuName.push(it2.valueName);
              });
              it.proName = skuName.join(',');
              it.proCode = it.giftProSkuStandCode;
              it.integralCost = it.giftProSkuIntegral;
              it.cashCost = it.giftProSkuCash;
              it.virtualStock = it.stock;
              it.level = 1;
              it.giftType = item.giftType;
              it.integralMallProId = it.giftProSkuId;
              it.activityProStatus = true;
              it.isShow = true;
              it.activityExchangeLimit = ''; // 限兑
              it.activityIntegral = ''; // 活动积分
              it.activityPrice = ''; // 活动价格
              it.activityStock = ''; // 活动库存
            });
          }
        });
        if (this.selectList.length) {
          this.selectList.forEach(item => {
            this.selectListCopy.forEach(it => {
              if (item.integralMallProId === it.integralMallProId) {
                if (item.children && item.children.length) {
                  item.children.forEach((item2, index) => {
                    it.children[index].activityExchangeLimit = item2.activityExchangeLimit;
                    it.children[index].activityIntegral = item2.activityIntegral;
                    it.children[index].activityPrice = item2.activityPrice;
                    it.children[index].activityStock = item2.activityStock;
                    it.children[index].activityProStatus = item2.activityProStatus;
                  });
                } else {
                  it.activityExchangeLimit = item.activityExchangeLimit;
                  it.activityIntegral = item.activityIntegral;
                  it.activityPrice = item.activityPrice;
                  it.activityStock = item.activityStock;
                  it.activityProStatus = item.activityProStatus;
                }
              }
            });
          });
        }
        this.selectList = copy(this.selectListCopy);
        // console.log(this.selectList);
      }
    },
    getRowKeys (row) {
      // 唯一值，一般都未id
      return row.integralMallProId;
    },
    changeExpand (row) {
      row.isExpand = !row.isExpand;
      this.$refs.multipleTable.toggleRowExpansion(row);
    },
    // 删除选择的数据
    deleteSelectList (item, index) {
      this.selectList.forEach((it, index) => {
        if (it.integralMallProId === item.integralMallProId) {
          this.selectList.splice(index, 1);
        }
      });
    },
    // sku商品不可全部关闭
    changeActivityStatus () {
      this.selectList.forEach(item => {
        if (item.children && item.children.length) {
          let num = 0;
          item.children.forEach(it => {
            if (!it.activityProStatus) {
              num++;
            }
          });
          if (num === item.children.length) {
            item.children[num - 1].activityProStatus = true;
            this.$message.error('至少开启一个SKU参加活动');
          }
        }
      });
    },
    // 开启和关闭选择商品弹窗
    addGoods () {
      this.selectListMore = this.selectList;
      this.goodsDialog = true;
    },
    closeGoodsSelect (val) {
      this.goodsDialog = false;
    },
    // 开启和关闭修改实物礼品多规格sku
    updateSkuStock (item) {
      // console.log(item);
      this.skuStockDialog = true;
      this.skuStockData = item;
    },
    closeSkuStock () {
      this.skuStockDialog = false;
      this.getMess();
    },
    changeLimit (value) {
      if (value.length) {
        this.flashSaleForm.ignoreLimitFlag = 1;
      } else {
        this.flashSaleForm.ignoreLimitFlag = 0;
      }
    },
    // 秒杀活动名称字数限制
    goodsLimit (value) {
      this.$nextTick(() => {
        this.flashSaleForm.activityName = getInputVal.getInputVal(value, 9);
        this.proNameLen = getInputVal.getZhLen(this.flashSaleForm.activityName);
      });
    },
    // 无sku或卡券修改库存
    getStockDetail (id, stock) {
      this.testStock = 0;
      this.activityProId = id;
      this.maxStock = stock;
    },
    handleStock (id, item) {
      const list = [];
      list.push({
        activityProId: this.activityProId,
        stockChange: this.testStock,
        changeType: 1,
      });
      const params = {
        data: JSON.stringify(list),
      };
      request.post('/api-integral-mall/update-activity-stock', qs.stringify(params)).then(res => {
        if (res.data.errorCode === 0) {
          this.$message.success('库存修改成功');
          this.stock = '';
          this.getMess();
          this.onCancel(id);
        } else if (res.data.errorCode === 2500) {
          // commonStock
          const errorMessage = res.data.result;
          item.commonStock = errorMessage[0].currValue;
          this.stock = '';
          this.$message.error('商品库存不足，现已更新库存数据，请重新修改活动库存');
        } else {
          this.$message.error(res.data.message);
        }
      });
    },
    handleDataTransferred (data) {
      this.defaltSelected = data;
    },
    handleDataLeft (selectedData, selectionToRemove) {
      this.defaltSelected = selectedData;
    },
    // 人群筛选器使用的方法
    // 父组件调用子组件方法,触发父组件事件
    getData () {
      const that = this;
      that.$refs.peopleFilter.confirmSet();
      that.usePeopleFilter = true;
    },
    // 子组件触发父组件事件,返回过滤条件数据
    findFilter (value) {
      // var that = this;
      this.searchParams = value;
    },
    // 取消
    cancelFilter () {
      const that = this;
      that.$refs.peopleFilter.cancelSet();
    },
    // 获取需要回显的数据, 供保存时候使用
    getBackData (val) {
      const that = this;
      that.responseParams = val;
      this.getSaveData = val;
    },
    // 显示编辑,保存按钮隐藏,确认按钮显示 (子组件会调用)
    editShow () {
      const that = this;
      that.toggleTag = true;
      that.saveTag = false;
    },
    // 显示保存按钮,隐藏确认按钮显示  (子组件会调用)
    editHide () {
      const that = this;
      that.toggleTag = false;
      that.saveTag = true;
    },
    // 隐藏保存按钮和确认按钮  (子组件会调用)
    // 传个参数给父组件 来查数据
    hideBtn (refresh) {
      if (refresh === 0) {
        this.memberSearchStr = -1;
        this.toggleTag = false;
        // 查数据的方法
        // this.getList();
      }
    },
    // 保存当前模板,对接保存接口
    limitStock (stock, all, item) {
      if (item.activityProStatus) {
        if (!Number(stock)) {
          item.activityStock = '';
          this.$message.error('库存为必填项');
        } else if (Number(stock) && Number(stock) > Number(all)) {
          item.activityStock = '';
          this.$message.error('活动库存不得大于当前库存');
        }
      }
    },
    // 预览
    previewPicture () {
      this.dialogVisibleImg = true;
    },
    deletePicture () {
      this.flashSaleForm.activityImageUrl = '';
    },
    beforeUpload (file) {
      if (file.size > 2 * 1024 * 1024) {
        this.$message.error('请上传小于2MB的图片');
        return false;
      }
      if (file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/jpg' && file.type !== 'image/gif') {
        this.$message.error('请上传jpg，png，gif格式的图片');
        return false;
      }
      if (localStorage.getItem('sign')) {
        this.headersUpload.sign = localStorage.getItem('sign');
      } else {
        this.headersUpload.sign = '';
      }
      const that = this;
      return new Promise(function (resolve, reject) {
        const reader = new FileReader();
        reader.onload = function (event) {
          const image = new Image();
          image.onload = function () {
            const width = this.width;
            // let height = this.height;
            if (width < 700 || width > 1500) {
              that.$message.error('请上传正确的图片尺寸');
              reject();
            }
            resolve();
          };
          image.src = event.target.result;
        };
        reader.readAsDataURL(file);
      });
    },
    handleSuccess (response, file, fileList) {
      if (response.errorCode === 0) {
        this.$message.success('上传成功');
        this.flashSaleForm.activityImageUrl = response.result[0].qcloudImageUrl;
      } else {
        this.$message.error(response.message);
      }
    },
    // 保存
    submitForm (flashSaleForm) {
      if (this.selectList.length) {
        if (!this.isEdit) {
          this.isCorrect = true;
          for (let i = 0; i < this.selectList.length; i++) {
            const arr = this.selectList[i];
            if (this.isCorrect) {
              if (arr.children && arr.children.length) {
                for (let j = 0; j < arr.children.length; j++) {
                  if (arr.children[j].activityProStatus) {
                    if (!arr.children[j].activityIntegral && !arr.children[j].activityPrice) {
                      this.isCorrect = false;
                      this.$message.error('积分和现金必填一个');
                      break;
                    }
                    if (!arr.children[j].activityStock) {
                      this.isCorrect = false;
                      this.$message.error('库存为必填项');
                      break;
                    }
                    if (arr.children[j].activityStock > arr.children[j].virtualStock) {
                      this.isCorrect = false;
                      this.$message.error('活动库存不得大于当前库存');
                      break;
                    }
                  }
                }
              } else {
                if (!arr.activityIntegral && !arr.activityPrice) {
                  this.isCorrect = false;
                  this.$message.error('积分和现金必填一个');
                  break;
                }
                if (!arr.activityStock) {
                  this.isCorrect = false;
                  this.$message.error('库存为必填项');
                  break;
                }
                if (arr.activityStock > arr.virtualStock) {
                  this.isCorrect = false;
                  this.$message.error('活动库存不得大于当前库存');
                  break;
                }
              }
            } else {
              break;
            }
          }
        }
        if (!this.isEdit) {
          this.activityProList = [];
          this.selectList.forEach((item, index) => {
            this.activityProList.push({
              activityExchangeLimit: item.activityExchangeLimit,
              activityIntegral: item.activityIntegral,
              activityPrice: item.activityPrice,
              activityProStatus: 1,
              activityStock: item.activityStock,
              giftProId: item.integralMallProId,
              activityProSkuList: [],
            });
            if (item.children && item.children.length) {
              item.children.forEach(it => {
                this.activityProList[index].activityProSkuList.push({
                  activityExchangeLimit: it.activityExchangeLimit,
                  activityIntegral: it.activityIntegral,
                  activityPrice: it.activityPrice,
                  activityProStatus: it.activityProStatus ? '1' : '0',
                  activityStock: it.activityStock,
                  giftProId: item.integralMallProId,
                  giftProSkuId: it.integralMallProId,
                });
              });
            }
          });
        } else {
          this.activityProList = [];
          this.selectList.forEach((item, index) => {
            this.activityProList.push({
              activityExchangeLimit: item.activityExchangeLimit,
              activityIntegral: item.activityIntegral,
              activityPrice: item.activityPrice,
              activityProStatus: 1,
              activityStock: item.activityStock ? item.activityStock : 0,
              giftProId: item.integralMallProId,
              activityProSkuList: [],
              activityProId: item.activityProId,
            });
            if (item.children && item.children.length) {
              item.children.forEach(it => {
                this.activityProList[index].activityProSkuList.push({
                  activityExchangeLimit: it.activityExchangeLimit,
                  activityIntegral: it.activityIntegral,
                  activityPrice: it.activityPrice,
                  activityProStatus: it.activityProStatus ? '1' : '0',
                  activityStock: it.activityStock ? it.activityStock : 0,
                  giftProId: item.integralMallProId,
                  giftProSkuId: it.integralMallProId,
                  activityProId: it.activityProId,
                });
              });
            }
          });
        }
      } else {
        this.$message.error('请选择参加活动的商品');
        return false;
      }
      console.log(this.isCorrect);
      // if (!this.flashSaleForm.activityImageUrl) {
      //   this.$message.error('请上传活动列表顶图');
      //   return false;
      // }
      if (this.defaltSelected.length < 1 && this.flashSaleForm.memberSearchType === 2) {
        // 没有选择会员分组
        this.$message.error('请选择会员分组');
        return false;
      }
      if (this.flashSaleForm.memberSearchType === 3) {
        if (this.toggleTag && !this.getSaveData) {
          this.$message.error('请选中人群筛选器的数据');
          return false;
        }
      }
      // if (this.flashSaleForm.memberLabelType === 1) {
      //   memberLabelId = '';
      //   this.searchParams = '';
      //   this.responseParams = '';
      // } else if (this.flashSaleForm.memberLabelType === 2) {
      //   memberLabelId = [];
      //   // 处理会员分组的数据
      //   for (let item of this.defaltSelected) {
      //     memberLabelId.push(item.memberTagGroupId);
      //   }
      //   memberLabelId = memberLabelId.join(',');
      //   this.searchParams = '';
      //   // this.responseParams = '';
      // } else if (this.flashSaleForm.memberLabelType === 3) {
      //   memberLabelId = '';
      // }
      if (this.flashSaleForm.memberSearchType === 2) {
        const memberLabelIds = [];
        for (const item of this.defaltSelected) {
          memberLabelIds.push(item.memberTagGroupId);
        }
        this.memberLabelId = memberLabelIds.join(',');
      }
      if (!this.flashSaleForm.beginTime && !this.flashSaleForm.endTime) {
        this.$message.error('请选择活动时间');
        return false;
      }
      this.$refs[flashSaleForm].validate(valid => {
        if (valid) {
          if (this.submitLoading) return;
          this.submitLoading = true;
          const params = {
            activityName: this.flashSaleForm.activityName,
            // dataTalkId: this.flashSaleForm.dataTalkId, // 数据对话id
            dataTalkId: '', // 数据对话id
            beginTime: this.flashSaleForm.beginTime,
            endTime: this.flashSaleForm.endTime,
            memberSearchType: this.flashSaleForm.memberSearchType, // 会员类型
            // ignoreLimitFlag: this.flashSaleForm.ignoreLimitFlag,
            ignoreLimitFlag: 1,
            activityBackGround: this.flashSaleForm.activityBackGround,
            activityImageUrl: this.flashSaleForm.activityImageUrl, // 活动列表顶图
            memberSearchParams: this.flashSaleForm.memberSearchType === 1 ? '' : this.flashSaleForm.memberSearchType === 2 ? this.memberLabelId : this.flashSaleForm.memberSearchType === 3 ? this.searchParams : '', // 人群筛选器或会员分组数据
            activityProList: this.activityProList,
          };
          if (!this.isEdit) {
            if (this.isCorrect) {
              console.log(1111);
              const data = JSON.stringify(params);
              const params2 = {
                data: data,
              };
              this.loading = true;
              request.post('/api-integral-mall/create-activity', qs.stringify(params2)).then(res => {
                if (res.data.errorCode === 0) {
                  this.$message.success('新建成功');
                  this.$router.push({
                    name: 'flashSale',
                  });
                  this.loading = false;
                  this.submitLoading = false;
                } else if (res.data.errorCode === 2500) {
                  const errorMessage = res.data.result;
                  errorMessage.forEach(item => {
                    if (item.isSku) {
                      this.selectList.forEach(itt1 => {
                        if (itt1.children && itt1.children.length) {
                          itt1.children.forEach(itt2 => {
                            if (itt2.integralMallProId === item.rowId) {
                              itt2.virtualStock = item.currValue;
                              itt2.activityStock = '';
                            }
                          });
                        }
                      });
                    } else {
                      this.selectList.forEach(itt3 => {
                        itt3.virtualStock = item.currValue;
                        itt3.activityStock = '';
                      });
                    }
                  });
                  this.loading = false;
                  this.submitLoading = false;
                  this.$message.error('部分商品库存不足，现已更新库存数据，请重新修改活动库存');
                } else {
                  this.$message.error(res.data.message);
                  this.loading = false;
                  this.submitLoading = false;
                }
              });
            } else {
              this.submitLoading = false;
            }
          }
          if (this.isEdit) {
            if (this.isCorrect) {
              params.activityId = this.activityId;
              const data = JSON.stringify(params);
              const params2 = {
                data: data,
              };
              this.loading = true;
              request.post('/api-integral-mall/update-activity', qs.stringify(params2)).then(res => {
                if (res.data.errorCode === 0) {
                  this.$message.success('保存成功');
                  this.$router.push({
                    name: 'flashSale',
                  });
                  this.loading = false;
                  this.submitLoading = false;
                } else if (res.data.errorCode === 2500) {
                  const errorMessage = res.data.result;
                  errorMessage.forEach(item => {
                    if (item.isSku) {
                      this.selectList.forEach(itt1 => {
                        if (itt1.children && itt1.children.length) {
                          itt1.children.forEach(itt2 => {
                            if (itt2.integralMallProId === item.rowId) {
                              itt2.virtualStock = item.currValue;
                              itt2.activityStock = '';
                            }
                          });
                        }
                      });
                    } else {
                      this.selectList.forEach(itt3 => {
                        itt3.virtualStock = item.currValue;
                        itt3.activityStock = '';
                      });
                    }
                  });
                  this.loading = false;
                  this.submitLoading = false;
                  this.$message.error('部分商品库存不足，现已更新库存数据，请重新修改活动库存');
                } else {
                  this.$message.error(res.data.message);
                  this.loading = false;
                  this.submitLoading = false;
                }
              });
            } else {
              this.submitLoading = false;
            }
          }
        }
      });
    },
  },
};
</script>
<style scoped>
.disabled {
  pointer-events: none;
}

.w-300 {
  width: 300px;
}
.w-280 {
  width: 280px;
}
.w-140 {
  width: 140px;
}
.w-110 {
  width: 110px;
}
.mt10 {
  margin-top: 10px;
}
.mr20 {
  margin-right: 20px;
}
.mr12 {
  margin-right: 12px;
}
.height40 {
  height: 40px;
}
.tips-content {
  position: absolute;
  left: -40px;
}
/* .avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9 !important;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
} */
/* 固定按钮 */
.confim-btn {
  height: 32px;
  padding: 12px 0;
  position: fixed;
  bottom: 0px;
  left: 200px;
  background: #fff;
  z-index: 2;
  text-align: center;
  border-top: 1px solid #dcdfe6;
}
.fix-btn {
  margin-left: -100px;
}
.mb8 {
  margin-bottom: 8px;
}
/* 图片上传 */
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-icon {
  width: 100px;
  height: 100px;
  line-height: 100px;
  text-align: center;
}
.avatar-uploader-icon {
  width: 20px;
  height: 20px;
  font-size: 20px;
  color: #c0c4cc;
  display: block;
  margin: auto;
  margin-top: 26px;
  margin-bottom: 11px;
}
.avatar-uploader {
  width: 100px;
  height: 100px;
  display: block;
  background: #f5f7fa;
  border: 1px dashed #c4c6cf;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.preview-picture {
  position: absolute;
  width: 100px;
  height: 100px;
  color: #fff;
  line-height: 100px;
  vertical-align: middle;
  display: none;
  font-size: 20px;
  background: rgba(0, 0, 0, 0.5);
  z-index: 30;
}
.avatar-uploader:hover .preview-picture {
  display: block;
}
.avatar-text {
  font-size: 12px;
  font-weight: 400;
  color: #909399;
  line-height: 17px;
  margin-top: 8px;
}
/* 添加商品 */

.add-sku-content {
  border: 1px solid #e4e7ed;
}
.add-table {
  margin: 10px 13px;
  background: #f7f8fa;
}
.add-sku {
  margin: 10px 13px;
  padding-top: 7px;
  padding-left: 8px;
  padding-bottom: 7px;
  background: #f7f8fa;
}
.add-sku-button {
  width: 130px;
  height: 32px;
  background: #ffffff;
  border-radius: 2px;
  border: 1px dashed #c4c6cf;
  text-align: center;
}
.add-sku-button .el-button {
  color: #606266;
}
.add-sku-button:hover {
  border: 1px dashed #1890ff;
}
.add-sku-button:hover .el-button {
  color: #1890ff;
}

.gift-info img {
  width: 60px;
  height: 60px;
  background: #ffffff;
  border: 1px solid #dcdfe6;
  margin-right: 10px;
  vertical-align: middle;
  /* border-radius: 4px; */
  /* padding: 4px; */
  /* border: 1px solid #dcdfe6; */
}
.info-name {
  display: inline-block;
  vertical-align: top;
  width: 80%;
}
.pro-ellipsis {
  color: #606266;
  /* height: 45px; */
  line-height: 22px;
  /* width: 230px; */
  font-size: 14px;
}
.pro-ellipsis2 {
  color: #606266;
  line-height: 22px;
  font-size: 14px;
  margin-bottom: 8px;
}
.category-ellipsis {
  color: #909399;
  font-size: 12px;
  line-height: 17px;
}
.el-icon-edit {
  margin-left: 5px;
  cursor: pointer;
}
.operate-span {
  font-size: 13px;
  cursor: pointer;
}
.intergral-edit .el-icon-edit {
  display: none;
}
.intergral-edit:hover .el-icon-edit {
  display: inline-block;
}
.icon-xinxixianshi {
  margin-left: 5px;
  color: #909399;
  font-size: 14px;
  cursor: pointer;
}
.page-info {
  padding: 8px 16px;
  box-sizing: border-box;
  border-radius: 4px;
  background: #f4f4f5;
  color: #606266;
  margin-bottom: 22px;
  line-height: 1.5;
}
.page-info h3 {
  font-size: 13px;
  color: #606266;
  margin-bottom: 4px;
}
.page-info .el-icon-info {
  color: #1890ff;
  margin-right: 10px;
  font-size: 14px;
}
</style>
<style>
.add-table .el-table [class*='el-table__row--level'] .el-table__expand-icon {
  display: none !important;
}
.store-tips {
  width: 200px;
  position: absolute;
  left: -10px;
}
.label-icons .el-form-item__label {
  padding-right: 40px !important;
}
.add-table .el-table__row--level-1 .el-table__indent {
  display: none;
}
.add-table .el-table__row--level-1 .el-table__placeholder {
  display: none;
}
</style>
