<template>
  <div class="content-main-manage">
    <div class="search-list">
      <div class="search-left">
        <Form class="common-form common-form-list" ref="tableParams" :model="tableParams" inline>
          <!-- <FormItem label="" prop="lineId">
            <Select v-model="tableParams.lineId" placeholder="来源应用" @on-select="selectLine">
              <Option v-for="item in lineTypeData" :value="String(item.id)" :key="item.id">{{ item.lineName }}</Option>
            </Select>
          </FormItem>
          <FormItem label="" prop="stationId">
            <Select v-model="tableParams.stationId" placeholder="设备类型">
              <Option v-for="item in stationTypeData" :value="String(item.id)" :key="item.id">{{ item.stationName }}</Option>
            </Select>
          </FormItem> -->
          <FormItem label="" prop="coverRankCount">
            <Select v-model="tableParams.coverRankCount" placeholder="策略覆盖告警等级数量">
                <Option v-for="item in coverLevelNum" :value="item.value" :key="item.value">{{ item.label }}</Option>
            </Select>
          </FormItem>
          <!-- <FormItem label="" prop="equipmentType">
             <Select v-model="tableParams.equipmentType" placeholder="设备类型">
              <Option v-for="item in equipTypeData" :value="(item.id)" :key="item.id">{{ item.name }}</Option>
            </Select>
          </FormItem> -->
          <FormItem label="" prop="name">
            <Input placeholder="输入关键字查询" clearable search v-model="tableParams.name" />
          </FormItem>
          <FormItem label="" >
            <Button type="primary" class="common-btn-search" @click="searchClick">
              <Icon type="ios-search" style="margin-right:4px;font-size: 16px"/> 筛选
            </Button> 
            <Button type="primary" class="common-btn-search" style="margin-left:10px" @click="resetClick('tableParams')">
              <Icon type="ios-search" style="margin-right:4px;font-size: 16px"/> 重置
            </Button>   
          </FormItem>
        </Form>
      </div>
    </div>
     <div class="btn-container">
      <Button icon="ios-add" class="common-add-btn" @click="addClick">新增策略</Button>
    </div>
    <div class="manage-main-center">
      <Table :columns="columns" :data="tableData" class="common-table app-table" no-data-text="" :row-class-name="rowClassName" :loading="loading">
        <template slot="loading">
            <Loading-animation></Loading-animation>
        </template>
         <template slot-scope="{ row }" slot="action">
           <Tooltip content="详情" placement="top">
              <i class="iconfont icon-xiangqingmingxi" style="cursor:pointer;color:#B8B532;fontSize:20px;marginRight:6px" @click="detailClick(row)"></i>
           </Tooltip>
           <Tooltip content="编辑" placement="top">
              <i class="iconfont icon-bianji" style="cursor:pointer;color:#64ACFE;fontSize:20px;marginRight:6px" @click="editClick(row)"></i>
           </Tooltip>
           <Tooltip content="删除" placement="top">
              <i class="iconfont icon-shanchu" style="cursor:pointer;color:#E92E2E;fontSize:20px;marginRight:6px" @click="delClick(row)"></i>
           </Tooltip>
        </template>
      </Table>
    </div>
    <div class="common-page">
      <div class="common-page-total">
        共<span>{{tablePage}}</span>页 / <span>{{tableTotal}}</span>条数据
      </div>
      <Page :total="tableTotal" :current="tableParams.pageNum" :page-size="tableParams.pageSize" @on-change="changePage" @on-page-size-change="sizeChange" show-elevator />
    </div>
    <Modal
      v-model="showModal"
      :title="title"
      width="40"
      ref="modalGrag"
      draggable
      reset-drag-position
      @on-visible-change="modalChange"
      :mask-closable="false"
      class-name="common-modal">
      <div class="common-modal-top">
        <span class="common-modal-top-text">基础信息</span>
      </div>
      <Form class="common-form" ref="formOption" :model="formOption" :rules="ruleValidate" :label-width="95" label-position="left">
        <FormItem label="策略名称：" prop="strategyName" style="width:100%">
          <Input v-model.trim="formOption.strategyName" maxlength="20" show-word-limit /> 
        </FormItem>
        <FormItem label="来源应用：" prop="appId" style="width:100%">
          <Select v-model="formOption.appId" placeholder="来源应用" @on-change="selectModalApp">
             <Option v-for="item in appModalData" :value="item.id" :key="item.id">{{ item.appName }}</Option>
          </Select>
        </FormItem>
        <FormItem label="设备类型：" prop="equipmentTypeId" style="width:100%">
          <Select v-model="formOption.equipmentTypeId" placeholder="设备类型">
             <Option v-for="item in equipTypeModalData" :value="item.equipmentTypeId" :key="item.equipmentTypeId">{{ item.equipmentName }}</Option>
          </Select>
        </FormItem>
			</Form>
      <div class="common-modal-top">
        <span class="common-modal-top-text">处理策略</span>
      </div>
      <div class="strategy-form-scroll common-scroll" v-if="showModal">
        <Form ref="formDynamic" :model="formCustom" :label-width="0" class="strategy-form">
          <Row v-for="(item, index) in formCustom.alertStrategyAutoConfirmDTOList" :key="index">
          <Col span="4" :class="{'row-first': index == 0}" class="row-first-es">策略{{index + 1}}</Col>
          <Col span="4" :class="{'row-first': index == 0}" class="row-first-es row-second-es">告警等级</Col>
          <Col span="5" :class="{'row-first': index == 0}" class="row-select">
            <FormItem
              :prop="'alertStrategyAutoConfirmDTOList.'+index+'.rankId'" :rules="{required: clickbtn==1 ? true: false,type: 'number',message: '请选择告警等级',trigger: 'change'}">
              <Select v-model="item.rankId" style="width: 100%" placeholder="告警等级" transfer @on-change="selectRank(item.rankId,index)" ref="rank">
                <Option v-for="firstitem in alarmLevelModalData" :value="firstitem.id" :key="firstitem.id">{{ firstitem.name }}</Option>
              </Select>
            </FormItem>
          </Col>
          <Col span="4" :class="{'row-first': index == 0}" class="row-first-es">自动确认为</Col>
          <Col span="5" :class="{'row-first': index == 0}" class="row-select row-es-last">
            <FormItem
              :prop="'alertStrategyAutoConfirmDTOList.'+index+'.autoStatus'" :rules="{required: clickbtn==1 ? true: false,message: '请选择确认动作',trigger: 'change'}">
              <Select v-model="item.autoStatus" style="width: 100%" placeholder="确认动作" ref="rank" transfer>
                <Option v-for="firstitem in confirmActionModalData" :value="firstitem.value" :key="firstitem.value">{{ firstitem.label }}</Option>
              </Select>
            </FormItem>
          </Col>
          <Col span="2" class="ivu-col-btn">
            <i class="iconfont icon-tianjia" style="cursor:pointer;color:#2DA0F8;padding-left:10px" @click="handleAdd('formDynamic')" v-if="index == formCustom.alertStrategyAutoConfirmDTOList.length - 1 &&title=='新增策略'"></i>
            <i class="iconfont icon-shanchu ivu-col-del" style="cursor:pointer; color:#BC2020;padding-left:6px" @click="handleRemove(index)"></i>
          </Col>
        </Row>
      </Form>
      </div> 
      <div slot="footer">
          <Button @click="modalCancel">取消</Button>
          <Button type="primary" @click="modalOk">确定</Button>
        </div>
    </Modal>
    <Modal
      v-model="modalStatus"
      :title="commonTitle"
      width="30"
      ref="modalGrag"
      draggable
      reset-drag-position
      :mask-closable="false"
      class-name="common-modal">
      <Icon type="ios-information-circle" :style="{ color: activeColor}" class="modal-icon"></Icon>
      <span class="modal-text">{{modalTitle}}</span>
      <div slot="footer">
          <Button @click="commonCancel">取消</Button>
          <Button type="primary" @click="commonOk">确定</Button>
        </div>
    </Modal>
    <Modal
      v-model="detailStatus"
      title="自动确认策略详情"
      width="45"
      ref="modalGrag"
      draggable
      reset-drag-position
      footer-hide
      :mask-closable="false"
      class-name="common-modal">
      <div v-for="(item,index) in detailLabel" :key="index">
        <div class="common-modal-top">
         <span class="common-modal-top-text">{{item.name}}</span>
        </div>
        <div class="common-modal-content">
          <div class="modal-content-item" v-for="(val,i) in item.arr" :key="i" :class="{'item-especial': val.name == '策略名称' && item.arr.length%2!=0,'item-especial-bot':(i==item.arr.length-1 || i==item.arr.length-2)}">
            <span class="modal-content-item-name">
            {{val.name}}
            </span>
            <div class="modal-content-item-value">
                <Tooltip placement="top-start" transfer max-width="350" v-if="val.value || val.value===0">
                  <span>{{val.value}}</span>
                  <div slot="content">
                    <span>{{val.value}}</span>
                  </div>
                </Tooltip>
                <span v-else>{{val.value}}</span>
            </div>
          </div>
        </div>
      </div>
      <div>
        <div class="common-modal-top">
         <span class="common-modal-top-text">等级判定策略</span>
        </div>
        <div class="strategy-form strategy-form-detail common-scroll" v-if="detailStatus">
          <Row v-for="(item, index) in formCustom.alertStrategyAutoConfirmDTOList" :key="index">
            <Col span="4" :class="{'row-first': index == 0}" class="row-first-es row-first-es-detail">
              <Tooltip placement="top-start" transfer max-width="350">
                <span>策略{{index + 1}}</span>
                <div slot="content">
                  <span>策略{{index + 1}}</span>
                </div>
              </Tooltip>
            </Col>
             <Col span="4" :class="{'row-first': index == 0}" class="row-first-es row-first-es-detail row-first-es-border">
              <Tooltip placement="top-start" transfer max-width="350">
                <span>告警等级</span>
                <div slot="content">
                  <span>告警等级</span>
                </div>
              </Tooltip>
            </Col>
             <Col span="6" :class="{'row-first': index == 0}" class="row-first-es row-first-es-border row-no-bg">
              <Tooltip placement="top-start" transfer max-width="350">
                <span>{{item.rankName}}</span>
                <div slot="content">
                  <span>{{item.rankName}}</span>
                </div>
              </Tooltip>
            </Col>
            <Col span="5" :class="{'row-first': index == 0}" class="row-first-es row-first-es-detail row-first-es-border">
              <Tooltip placement="top-start" transfer max-width="350">
                <span>自动确认为</span>
                <div slot="content">
                  <span>自动确认为</span>
                </div>
              </Tooltip>
            </Col>
            <Col span="5" :class="{'row-first': index == 0}" class="row-first-es row-es-last row-no-bg">
            <Tooltip placement="top-start" transfer max-width="350">
              <span>{{item.autoStatus}}</span>
              <div slot="content">
                <span>{{item.autoStatus}}</span>
              </div>
            </Tooltip>
            </Col>
          </Row>
        </div>
      </div>
    </Modal>
  </div>
</template>
<script>
const defaultFrom = {strategyName:'',appId:'',equipmentTypeId: '',enabled: 0}
export default {
  name: "AlarmAcknowledgConfig",
  components:{
  },
  data() {
    return {
      alarmParams: {
        keywords: '',
        enabled: 1,
        beginDate: '',
        endDate: '',
        pageNum: 1,
        pageSize: 10
      },
      applicationParams: {
        level: '',
        lineId: '',
        stationId: '',
        equipmentCheck: '',
        instrumentCheck: '',
        pageNum: 1,
        pageSize: 9999
      },
      appParams: {
        applicationId: '',
        equipmentTypeId: '',
        keywords: '',
        pageNum: 1,
        pageSize: 9999
      },
      loading: true,
      tableParams: {
        keywords: '',
        applicationId:'',
        equipmentTypeId: '', 
        coverRankCount: '',   
        name: '',
        pageNum: 1,
        pageSize: 10
      },
      tableData: [],
      tableTotal: 0,
      tablePage: 0,
      rowObj: {},
      coverLevelNum: [
         {
          value: '-1',
          label: '策略覆盖告警等级数量'
        },
        {
          value: '0-2',
          label: '0-2'
        },
        {
          value: '3-5',
          label: '3-5'
        },
        {
          value: '6-7',
          label: '6-7'
        }
      ],
      equipTypeModalData: [],
      appModalData: [],
      alarmLevelModalData: [],
      confirmActionModalData: [ 
        {
          value: '确认',
          label: '确认'
        },
        {
          value: '清除',
          label: '清除'
        },],
      columns: [
          {
            title: '自动确认策略名称',
            key: 'strategyName',
            align: 'center',
            ellipsis: true,
            tooltip: true
          },
          {
            title: '来源应用',
            key: 'appName',
            align: 'center',
            ellipsis: true,
            tooltip: true
          },
          {
            title: '设备类型',
            key: 'equipmentTypeName',
            align: 'center',
            ellipsis: true,
            tooltip: true
          },
          {
            title: '覆盖告警等级',
            key: 'coverRankCount',
            align: 'center'
          },
          {
          title: '是否启用',
          key: 'enabled',
          align: 'center',
          width: 120,
          render: (h, params) => {
            return h('div', [                             
              h('i-switch', {
                props: { value: params.row.enabled,'true-color': '#57C44F', trueValue:1,falseValue: 0
                },
                nativeOn:{
                    "mousedown":(event)=>{ // 监听组件原生事件mousedown,此事件在click之前触发
                      this.rowObj =  params.row
                      if (params.row.enabled == 1) {
                        this.commonTitle = '确认关闭'
                        this.activeColor = '#E92E2E'
                        this.activeClass = 'icon-guanbi'
                        this.modalTitle = '可能影响新数据判断结果。'
                        this.modalStatus = true
                      } else {
                        this.commonTitle = '确认启用'
                        this.activeColor = '#57C44F'
                        this.activeClass = 'icon-qiyong'
                        this.modalTitle = '当前时间点后所有告警信息，将使用策略自动判定。'
                        this.modalStatus = true
                      }
                    },
                  }
                }),
              ])
            }
          },
          {
          title: '操作',
          align: 'center',
          slot: 'action',
          width: 120,
        }
      ],
      showModal: false,
      detailStatus: false, 
      modalStatus: false,
      title: '新增策略',
      commonTitle: "确认删除",
      activeColor: '#E92E2E',
      activeClass: '',
      modalTitle: '',
      formOption: {strategyName:'',appId:'',equipmentTypeId: '',enabled: 0},
      ruleValidate: {
        strategyName: [{
          required: true,
          message: '请输入策略名称',
          trigger: 'blur'
        }],
        appId: [{
          required: true,
          type: 'number',
          message: '请选择来源应用',
          trigger: 'change'
        }],
        equipmentTypeId: [{
          required: true,
          type: 'number',
          message: '请输入设备名称',
          trigger: 'change'
        }],
      }, 
      detailLabel: [],
      formCustom: {
        alertStrategyAutoConfirmDTOList: [
          {
            rankId: '',
            autoStatus: ''
          },
        ],
      },
      clickbtn: 1, // 1点击策略保存按钮 2点击子策略删除按钮
    };
  },
  mounted() {
    this.getType()
  },
  methods: {
    go (){
      // this.$router.push({path:'//ApplicationManage'})
      // this.$router.push({path:'/MainPage/ApplicationManage/2'})
      this.$router.push({ name: 'ApplicationManage', params: { type:2 }}) // -> /home/123
    },
    rowClassName(row, index) {
      if (index % 2 == 0) {
        return "ivu-table-stripe-even";
      } else {
        return "ivu-table-stripe-odd";
      }
    },
    // 分页
    changePage (val) {
      this.tableParams.pageNum = val
      this.getTableData()
    },
    //跳转
    sizeChange (val) {
      this.tableParams.pageSize = val
      this.getTableData()
    },
    getType  () {
      // 获取来源应用
      this.$get('metroapi/application/info/list', this.applicationParams).then(res=>{
        if (res.httpCode == 1 ){
          this.appModalData = res.data.data
        } else {
          this.appModalData = []
        }
      })
      // 告警等级
      this.$get('metroapi/alert/rank/list', this.alarmParams).then(res=>{
        if (res.httpCode == 1 ){
          this.alarmLevelModalData = res.data.data
        } else {
          this.alarmLevelModalData = []
        }
      })
    },
    // 获取表格数据
    getTableData () {
      let params = JSON.parse(JSON.stringify(this.tableParams))
      params.coverRankCount = params.coverRankCount == '-1' ? '':params.coverRankCount
      this.loading = true
      this.$get('metroapi/alertauto/queryStrategyAutoConfirmPage', params).then(res=>{
        this.loading = false
          if (res.httpCode == 1 ){
            this.tableData = res.data.data
            this.tableTotal = res.data.count
            if (res.data.data.length==0) {
              this.tablePage = 0
            } else {
              this.tablePage = res.data.count<= 10 ? 1: Math.ceil(res.data.count/this.tableParams.pageSize)
            }
            if (res.data.data.length==0 && this.tableParams.pageNum>1) {
              this.tableParams.pageNum--
              return this.getTableData()
            }
          } else {
            this.tableData = []
            this.tableTotal = 0
          }
        })
    },
    selectModalApp (val) {
      this.appParams.applicationId = val
      this.formOption.equipmentTypeId = ''
      if (val) {
        this.getAddEquipType( this.appParams)
      }
    },
    // 获取新增设备类型 
    getAddEquipType (params) {
      this.$get('metroapi/application/equipmentTypeInfo', params).then(res=>{
        if (res.httpCode == 1 ){
          this.equipTypeModalData = res.data.data
        } else {
          this.equipTypeModalData = []
        }
      })
    },
    searchClick () {
      this.tableParams.pageNum = 1
      this.getTableData()
      // this.$router.push({ path: '/MainPage/ApplicationManage',  query: {deptName: "2"}})
    },
    resetClick (name) {
     this.$refs[name].resetFields()
     this.tableParams.pageNum = 1
     this.getTableData()
    },   
    addClick () {
      this.clickbtn = 1
      this.formOption = JSON.parse(JSON.stringify(defaultFrom))
      this.formCustom.alertStrategyAutoConfirmDTOList = [{
        rankId: '',
        autoStatus: ''
      }];
      this.title = '新增策略'
      this.showModal = true
    },
    detailClick (row) {
      this.getstrategyData(row.id)
      this.rowObj = row
      this.$nextTick(()=> {
         this.detailStatus = true
      })
    },
    editClick (row) {
      this.clickbtn = 1
      this.getstrategyData(row.id)
      this.rowObj = row
      this.formOption = JSON.parse(JSON.stringify(row));
      this.appParams.applicationId = this.formOption.appId
      this.getAddEquipType(this.appParams)
      this.title = '编辑策略'
      this.$nextTick(()=> {
        this.showModal = true
      })
    },
    getstrategyData (id) {
      this.$get('metroapi/alertauto/getStrategyAutoConfirm', {strategyId:id}).then(res=>{
        if ( res.httpCode == 1 ){
          this.detailLabel = [{name:'基础信息',arr:[{name:'策略名称',value:res.data.strategyName},{name:'设备类型',value:res.data.equipmentTypeName},{name:'来源应用',value:res.data.appName}]}]
          this.formCustom.alertStrategyAutoConfirmDTOList = res.data.alertStrategyAutoConfirmDTOList
        } else {
          this.$Message.info(res.msg)
        }
      })
    },
    delClick (row) {
      this.rowObj = row
      this.commonTitle = '确认删除'
      this.activeColor = '#E92E2E'
      this.activeClass = ''
      this.modalTitle = '删除的同时将解绑所有运营数据，且数据不可恢复，请慎重操作。'
      this.modalStatus = true
    },
    modalChange (modalStatus) {
     if (!modalStatus) {
      this.$refs.formOption.resetFields();
      this.$refs.formDynamic.resetFields();
      this.equipTypeModalData = []
     }
    },
    modalOk () {
      this.clickbtn = 1
      var params = Object.assign({}, this.formOption, this.formCustom); // 合并对象 注意目标对象自身也会改变。假设目标对象{}是之前里的对象，他的值跟obj一样
      this.$nextTick(()=> {
        // 多个form表单验证
        const p1 = new Promise((resolve,reject)=>{
        this.$refs['formOption'].validate(valid=>{
                if(valid) resolve()
            })
        })
        const p2 = new Promise((resolve,reject)=>{
            this.$refs['formDynamic'].validate(valid=>{
                if(valid) resolve()
            })
        })
        Promise.all([p1,p2]).then(()=>{
          let canSave = true;
          let arr = this.formCustom.alertStrategyAutoConfirmDTOList
          for (var i = 0; i < arr.length; i++) {
              for (var j = i + 1; j < arr.length; j++) {
                  if (arr[i].rankId == arr[j].rankId) 
                  { 
                    canSave = false; 
                    break;
                  }
              }
          }
          if(canSave) {
            this.saveStrategyData(params)
          } else {
            this.$Message['error']({
              background: true,
              content: '同一个等级不能存在两条策略'
           });
          }
        })
      })
    },
    saveStrategyData (params) {
      let url = ''
      if (this.title == '新增策略') {
        url = 'metroapi/alertauto/addStrategyAutoConfirm'  
      } else {
        url = 'metroapi/alertauto/editStrategyAutoConfirm'
      }
      this.$post(url, params).then(res=>{
        if ( res.httpCode == 1 ){
            this.showModal = false
            this.$Message.info(res.msg)
            this.getTableData()
          } else {
            this.$Message.info(res.msg)
          }
        })
    },
    modalCancel () {
      this.showModal = false
    },
    commonOk () {
      if (this.commonTitle == '确认启用') {
        let params = {
          strategyId: this.rowObj.id,
          enabled: 1
        }
        this.getSwitchStatus(params)
      } else if (this.commonTitle == '确认关闭') {
        let params = {
          strategyId: this.rowObj.id,
          enabled:0
        }
        this.getSwitchStatus(params)
      } else {
        let params = {
          strategyId: this.rowObj.id
        }
        this.delData(params)
      }
    },
    // 启用 关闭/接口
    getSwitchStatus (params) {
      this.$get('metroapi/alertauto/enableStrategyAutoConfirm',params).then(res=>{
        if (res.httpCode == 1 ){
          if (params.enabled == 0) {
            this.rowObj.enabled = 0
          } else {
            this.rowObj.enabled = 1
          }
          this.modalStatus = false
        } else {
          this.rowObj.enabled = 0
          this.$Message.info(res.msg)
        }
      })
    },    
    commonCancel () {
      this.modalStatus = false
    },
    // 删除接口
    delData (params) {
      this.$get('metroapi/alertauto/delStrategyAutoConfirm',params).then(res=>{
        if (res.httpCode == 1 ){
          this.modalStatus = false
          this.$Message.info(res.msg)
          this.getTableData()
        } else {
          this.$Message.info(res.msg)
        }
      })
    },
    handleAdd(name) {
      this.clickbtn = 1
      this.$nextTick(()=> {
        this.$refs[name].validate((valid) => {
        if (valid) { 
          this.formCustom.alertStrategyAutoConfirmDTOList.push({
                rankId: '',
                autoStatus: ''
          });
        }
       });
      }) 
    },
    handleRemove(i) {
      this.clickbtn = 2
      if (this.formCustom.alertStrategyAutoConfirmDTOList.length == 1) {
        this.$Message['error']({
            background: true,
            content: '请至少保留一条非空策略'
        });
      } else {
        this.formCustom.alertStrategyAutoConfirmDTOList.splice(i,1)
      }
    },
   selectRank (val,index) {
      this.formCustom.alertStrategyAutoConfirmDTOList[index].rankId = val
      let rankName = ''
      this.alarmLevelModalData.forEach((item)=> {
        if (val == item.id) {
         rankName = item.name
        }
      })
      this.formCustom.alertStrategyAutoConfirmDTOList[index].rankName = rankName
    }
  }
};
</script>
<style scoped lang="stylus">
.content-main-manage {
  position: relative;
  height: 100%;
}
.search-list {
  display: flex;
  padding: 10px 0 0;
}
.search-left {
  display: flex;
  align-items: center;
   .ivu-select {
     width: 200px;
     height: 32px;
   }
   .ivu-select-single .ivu-select-selection {
     height: 100%;
   }
   >>> .ivu-input {
     width: 160px;
     height: 32px;
   }
   >>> .ivu-input-prefix, >>> .ivu-input-suffix {
     height: 32px;
     line-height: 32px;
   }
   >>> .ivu-input-icon {
     height: 32px;
     line-height: 32px;
   }
   >>> .date-picker-main .ivu-date-picker-header {
    border-bottom: 0.0052083333rem solid #204384;
 }
}
.btn-container {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 10px;
}
.common-form {
  display: flex;
  flex-wrap: wrap;
}
>>> .common-form-list .ivu-form-item {
  margin-bottom: 10px;
}
.manage-main-center {
  width: 100%;
  height: calc(100% - 150px);
}
.common-table {
  height: 100%;
  // max-height: 100%;
}
>>> .common-table .ivu-table-body{
  height: calc(100% - 49px);
  overflow: hidden;
  overflow-y: auto;
}
>>> .common-table .ivu-table th {
  height: 49px;
 }
 >>> .common-table .ivu-table td {
  height: 48.5px;
 }
  >>> .common-table .ivu-spin-fix {
   top: 49px;
 }
  >>> .app-table .ivu-spin-fix {
   height: calc(100vh - 375px);
 }
 >>> .ivu-table-tip {
  background: url('../../../assets/images/noData.png') no-repeat center;
}
>>> .app-table .ivu-table-tip {
  height: calc(100vh - 375px);
 }
 >>> .common-table .ivu-table-tip table {
 display: none;
}
 >>> .modal-table {
   overflow: auto !important;
 }
 >>> .modal-table .ivu-spin-fix {
   height: 200px;
 }
  >>> .modal-table .ivu-table-tip {
   height: 200px;
 }
.common-page {
  margin-top: 15px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: absolute;
  bottom: 0;
  right: 0;
}
.common-page-total {
  color: #fff;
  padding-right: 10px;
  font-size: 14px;
  span {
    color #409EFF;
  }
}
>>> .modal-tabs-item {
  margin-top: 10px;
}
>>> .common-modal-top-text {
  font-size: 14px;
  font-weight: bold;
  color: #29A0FF;
  line-height: 42px;
  border-left: 3px solid #1590F1;
  padding-left: 12px;
}
>>> .common-modal-content {
  display: flex;
  width: 100%;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 15px;
  border-right: 1px solid #21437B;
}
>>> .modal-content-item {
  width: 50%;
  display: flex;
}
>>> .item-especial {
  width: 100%;
}
>>> .modal-content-item-name {
  width: 50%;
  height: 45px;
  line-height: 45px;
  background: #13305F;
  border-top: 1px solid #21437B;
  border-left: 1px solid #21437B;
  font-size: 14px;
  color: #F5F5F5;
  padding-left: 20px;
}
>>> .modal-content-item-value {
  width: 50%;
  height: 45px;
  line-height: 45px;
  background: #06214D;
  border-top: 1px solid #21437B;
  border-left: 1px solid #21437B;
  font-size: 14px;
  color: #F5F5F5;
  padding-left: 20px;
}
>>> .item-especial .modal-content-item-name{
  width: 25%;
  height: 45px;
  line-height: 45px;
}
>>> .item-especial .modal-content-item-value{
  width: 75%;
  height: 45px;
  line-height: 45px;
}
>>> .item-especial-bot .modal-content-item-name {
  border-bottom: 1px solid #21437B;
}
>>> .item-especial-bot .modal-content-item-value {
  border-bottom: 1px solid #21437B;
}
>>> .modal-content-item-value .ivu-tooltip {
  width: 100%;
}
>>> .modal-content-item-value .ivu-tooltip-rel {
  overflow: hidden;
  text-overflow:ellipsis; 
  white-space: nowrap;
}
>>> .strategy-form-scroll {
  max-height: 360px;
  overflow: hidden;
  overflow-y: auto;  
}
>>> .strategy-form {
margin-bottom: 25px;
}
>>> .strategy-form .ivu-col{
  position: initial;
  color: #2B8EE2;
  font-size: 14PX;
}
>>> .row-first-es {
  border-left: 1px solid #21437B;
  border-bottom: 1px solid #21437B;
  border-right: 1px solid #21437B;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #13305F;
}
>>> .strategy-form .row-first{
  border-top: 1px solid #21437B;
}
>>> .strategy-form .row-second-es {
  border-left: none;
}
>>> .strategy-form .ivu-form-item{
  height: 100%;
  margin-bottom: 0;
}

>>> .strategy-form .row-es-text {
  border-left: none;
  border-bottom: 1px solid #21437B;
  border-right: 1px solid #21437B;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #13305F;
}
>>> .row-select .ivu-form-item {
  height: 100%;
  width: 100%;
  border-bottom: 1px solid #21437B;
  display: flex;
  align-items: center;
  // background: none;
  justify-content: center;
   .ivu-form-item-content {
    width: 100%;
    height: 100%;
    .ivu-select {
        padding: 10px 5px;
        height: 100%;
        width: 100%;
      }
  }
}
>>> .strategy-form .row-es-last {
  border-right: 1px solid #21437B;
}
>>> .ivu-col-del {
  cursor:pointer;
  color:#BC2020;
  padding-left:10px;
}
>>> .strategy-form .ivu-col-btn {
  display: flex;
  align-items: center;
  border-top: none;
  border-bottom: none;
}
>>> .strategy-form .ivu-form-item-error-tip {
 padding-left: 6px;
}

.strategy-form-detail {
  max-height: 350px;
  overflow: hidden;
  overflow-y: auto;
}
.strategy-form-detail .ivu-col{
  text-align: center;
  color: #fff;
  height: 45px;
  line-height: 45px
}
>>> .strategy-form-detail .row-first-es-detail {
  color: #2b8ee2;
}
>>> .strategy-form-detail .row-first-es-border {
  border-left: none;
}
>>> .strategy-form-detail .row-es-last {
  border-left: none;
}
>>> .strategy-form-detail .row-no-bg {
  background: none;
}
>>> .strategy-form-detail .strategy-form-row .ivu-col {
  height: 100%;
}
>>> .strategy-form-detail .ivu-col{
  .ivu-tooltip {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
  }
  .ivu-tooltip-rel {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-left: 4px;
  }
}
/deep/ .ivu-input::-webkit-input-placeholder{
  color: #718EBD;
}
/deep/ .ivu-input::-moz-placeholder{   /* Mozilla Firefox 19+ */
  color: #718EBD;
}
/deep/ .ivu-input::-moz-placeholder{    /* Mozilla Firefox 4 to 18 */
  color: #718EBD;
}
/deep/ .ivu-input::-ms-input-placeholder{  /* Internet Explorer 10-11 */
  color: #718EBD;
}
</style>