<template>
  <div>
    <a-modal
      :title=" $t('global-btn.apply-for-changes')"
      :visible="applyFlag"
      :width="1000"
      :maskClosable="false"
      @ok="save"
      @cancel="closeModal"
      :footer="null"
    >
      <div>
        <a-table
          ref="tableRefs"
          :columns='tableColumns'
          :dataSource='tableData'
          :pagination='false'
          :rowKey='(record, index) => { return index; }'
          :scroll='{ x: tableWidth, y: tableHeightValue }'
          size="small"
          bordered
          :components='components'
        >
          <!-- 零部件DVP 变更后描述-->
          <template slot='changeDesc' slot-scope='text, record, index'>
            <!--试验项目-->
            <a-input
              v-if="index === 0"
              v-model.trim="record.changeDesc"
              :disabled="dataSource && dataSource !== '0'"
              :maxLength='100'
              allowClear
              :placeholder="$t('global-btn.please-enter') + $t('plan.dvp.test-project')"/>
            <!--开发目标要求-->
            <a-input
              v-else-if="index === 1"
              v-model.trim="record.changeDesc"
              :disabled="dataSource && dataSource !== '0'"
              :maxLength='100'
              allowClear
              :placeholder="$t('global-btn.please-enter') + $t('base.info.development-objective-requirements')"/>
            <!--试验标准-->
            <a-input
              v-else-if="index === 2"
              v-model.trim="record.changeDesc"
              :disabled="dataSource && dataSource !== '0'"
              :maxLength='500'
              allowClear
              :placeholder="$t('global-btn.please-enter') + $t('base.info.Test-standards')"/>
            <!--试验类型-->
            <a-select
              v-else-if="index === 3"
              v-model="record.changeDesc"
              :options="testTypeList"
              :filter-option="handleFilterDataList"
              allowClear
              :placeholder="$t('plan.dvp.please_select-test-type')"
              style="width: 100%">
            </a-select>
            <!--试验来源-->
            <a-select
              v-else-if="index === 4"
              v-model="record.changeDesc"
              :options="testSourceList"
              :filter-option="handleFilterDataList"
              allowClear
              :placeholder="$t('global-btn.please-select') + $t('plan.dvp.test-source')"
              style="width: 100%">
            </a-select>
            <!-- 是否开展试验 -->
            <a-select
              v-else-if="index === 5"
              v-model="record.changeDesc"
              style="width: 100%"
              @change="handleCarryOut"
              allowClear
              :placeholder="$t('base.info.please-enter-whether-to-develop-experimental-projects')">
              <a-select-option :value="1">{{ $t('global-btn.yes') }}</a-select-option>
              <a-select-option :value="0">{{ $t('global-btn.no') }}</a-select-option>
            </a-select>
            <!--是否等效-->
            <a-select
              v-else-if="index === 6"
              :disabled="notCarryOutDisabled"
              v-model="record.changeDesc"
              style="width: 100%"
              @change="handleEquivalent"
              allowClear
              :placeholder="$t('global-btn.please-select') + $t('plan.dvp.is-it-an-equivalent-test')">
              <a-select-option :value="1">{{ $t('plan.dvp.equivalent-experiment') }}</a-select-option>
              <a-select-option :value="0">{{ $t('plan.dvp.non-equivalent-experiment') }}</a-select-option>
            </a-select>
            <!--等效实验报告编号-->
            <a-select
              v-else-if="index === 7"
              :disabled="notCarryOutDisabled || !isEquivalentDisabled"
              v-model="record.changeDesc"
              :options="equivalentList"
              :filter-option="handleFilterDataList"
              allowClear
              :placeholder="$t('global-btn.please-select') + $t('plan.dvp.equivalent-experiment-report-number')"
              style="width: 100%">
            </a-select>
            <!--测试地点-->
            <a-input
              v-else-if="index === 8"
              :disabled="notCarryOutDisabled || isEquivalentDisabled"
              v-model.trim="record.changeDesc"
              :maxLength='50'
              allowClear
              :placeholder="$t('global-btn.please-enter') + $t('plan.dvp.test-site')"/>
            <!--测试负责人 -->
            <a-select
              v-if="index === 9"
              :disabled="notCarryOutDisabled || isEquivalentDisabled"
              v-model="record.changeDesc"
              :options="testOwnerList"
              allowClear style="width: 100%"
              :placeholder="$t('global-btn.please-select') + $t('plan.dvp.test-user')" >
            </a-select>
            <!--计划开始时间 -->
            <a-date-picker
              v-else-if="index === 10"
              :disabled="notCarryOutDisabled || isEquivalentDisabled"
              :disabled-date="disabledStartDate"
              @change='handleStartTime'
              v-model="record.changeDesc"
              :placeholder="$t('plan.dvp.please_select-scheduled-start-time')"
              style="width: 100%"
              valueFormat="YYYY/MM/DD"/>
            <!--计划结束时间 -->
            <a-date-picker
              v-else-if="index === 11"
              :disabled="(dataSource && dataSource === '2') || isEquivalentDisabled"
              :disabled-date="disabledEndDate"
              @change='handleEndTime'
              v-model="record.changeDesc"
              :placeholder="$t('plan.dvp.please_select-scheduled-end-time')"
              style="width: 100%"
              valueFormat="YYYY/MM/DD"/>
            <!--测试阶段-->
            <a-input
              v-else-if="index === 12"
              :disabled="notCarryOutDisabled || isEquivalentDisabled"
              v-model.trim="record.changeDesc"
              :maxLength='50'
              allowClear
              :placeholder="$t('global-btn.please-enter') + $t('plan.dvp.test-step')"/>
            <!--测试次数-->
            <a-input-number
              v-else-if="index === 13"
              :disabled="notCarryOutDisabled || isEquivalentDisabled"
              v-model.number="record.changeDesc"
              :defaultValue="0"
              :min="1"
              :max="999"
              :placeholder="$t('global-btn.please-enter') + $t('plan.dvp.test-count')"
              style="width: 100%">
            </a-input-number>
            <!--样件类型-->
            <a-input
              v-else-if="index === 14"
              :disabled="notCarryOutDisabled || isEquivalentDisabled"
              v-model.trim="record.changeDesc"
              :maxLength='50'
              allowClear
              :placeholder="$t('global-btn.please-enter') + $t('plan.dvp.sample-type')"/>
            <!--样本数量-->
            <a-input-number
              v-else-if="index === 15"
              :disabled="notCarryOutDisabled || isEquivalentDisabled"
              v-model.number="record.changeDesc"
              :defaultValue="0"
              :min="1"
              :max="999"
              :placeholder="$t('global-btn.please-enter') + $t('plan.dvp.number-of-samples')"
              style="width: 100%">
            </a-input-number>
            <!-- 不开展试验原因 -->
            <a-textarea
              v-else-if="index === 16"
              autoSize
              v-model.trim="record.changeDesc"
              :disabled="causeShowFlag || !notCarryOutDisabled"
              :maxLength="500"
              :placeholder="$t('base.info.please-enter-reason-for-not-conducting-the-experiment')">
            </a-textarea>
          </template>

          <!-- 变更原因 -->
          <template slot='changeReason' slot-scope='text, record, index'>
            <a-textarea
              autoSize
              v-model.trim="record.changeReason"
              :disabled="index < 3 && dataSource && dataSource !== '0'"
              :maxLength="500"
              :placeholder="$t('base.info.please-enter-change-reason')">
            </a-textarea>
          </template>

          <!-- 操作列 -->
          <template slot="action" slot-scope="text, record">
            <span>
              <!-- 取消 -->
              <a class="ml10 operate-btn" @click="reset(record)">
                <a-tooltip :title="$t('global-btn.reset')">
                  <a-icon type="undo"/>
                </a-tooltip>
              </a>
            </span>
          </template>
        </a-table>
        <!-- 弹窗footer -->
        <div slot="footer" class="mt10 text-right">
          <a-button @click="closeModal">
            {{ $t('global-btn.cancel') }}
          </a-button>
          <a-button class="ml10" type="primary" @click="save()">
            {{ $t('global-btn.confirm') }}
          </a-button>
        </div>
      </div>
    </a-modal>
    <!-- 提交审批 -->
    <submit-approval
      ref='submitApproval'
      :title='submitApprovalTitle'
      :visible='submitApprovalVisible'
      :rfmeaType="'D'"
      @close='submitApprovalVisible = false'
    />
  </div>
</template>

<script>

import SubmitApproval from '@/components/SubmitApprovalModal';
import moment from "moment";
import VueDraggableResizable from 'vue-draggable-resizable';

export default {
  name: "AddDvpTest",
  components: {
    SubmitApproval,
    VueDraggableResizable
  },
  props: {

    applyFlag: {
      type: Boolean,
      default: false
    },

    applyTableData: {
      type: Array,
      default: []
    },

    dvpType: {
      type: String,
      default: undefined
    }

  },

  data() {
    this.components = {
			header: {
				cell: (h, props, children) => {
					const { key, ...restProps } = props;
					// 此处的this.columns 是定义的table的表头属性变量
					const col = this.tableColumns.find((col) => {
						const k = col.dataIndex || col.key;
						return k === key;
					});
					if (!col || !col.width) {
						return h('th', { ...restProps }, [...children]);
					}
					const dragProps = {
						key: col.dataIndex || col.key,
						class: 'table-draggable-handle',
						attrs: {
							w: 10,
							x: col.width,
							z: 1,
							axis: 'x',
							draggable: true,
							resizable: false
						},
						on: {
							dragging: (x, y) => {
								col.width = Math.max(x, 90);
							}
						}
					};
					const drag = h('vue-draggable-resizable', { ...dragProps });
					return h('th', { ...restProps, class: 'resize-table-th' }, [...children, drag]);
				}
			}
		};
    return {
      // 表格总宽度
      tableWidth: 0,
      //表格各列宽度总和
      columnsWidth: 0,
      /**试验负责人*/
      testOwnerList: [],
      tableColumns: [
        // 变更内容
        {
          title: this.$t('base.info.change-content'),
          dataIndex: 'changeContent',
          width: 100,
          align: 'center',
          ellipsis: true
        },
        // 当前描述
        {
          title: this.$t('base.info.current-description'),
          dataIndex: 'currentDesc',
          width: 100,
          align: 'center',
          ellipsis: true
        },
        // 变更后描述
        {
          title: this.$t('base.info.description-after-change'),
          dataIndex: 'changeDesc',
          width: 100,
          align: 'center',
          ellipsis: true,
          scopedSlots: {
            customRender: 'changeDesc'
          }
        },
        // 变更原因
        {
          title: this.$t('base.info.change-reason'),
          dataIndex: 'changeReason',
          width: 100,
          align: 'center',
          ellipsis: true,
          scopedSlots: {
            customRender: 'changeReason'
          }
        },
        // 操作
        {
          title: this.$t('global-constant.operation'),
          dataIndex: 'action',
          align: 'center',
          width: 100,
          scopedSlots: { customRender: 'action'},
          ellipsis: true
        }
      ],
      tableData: [],
      tableDataLength: 0,
      tableHeight: window.innerHeight - 360 + 'px',
      tableHeightValue: window.innerHeight - 418,
      testId: undefined,
      /** 提交审批：标题 */
      submitApprovalTitle: '',
      /** 提交审批：开关 */
      submitApprovalVisible: false,
      // 部门id
      departmentId: undefined,
      // 是否显示不展开试验原因
      causeShowFlag: false,
      /** 试验类型下拉选项 */
      testTypeList: [
        {
          value: '1',
          label: this.$t('dvp.appearance')
        },
        {
          value: '2',
          label: this.$t('dvp.size')
        },
        {
          value: '3',
          label: this.$t('dvp.material-regulations')
        },
        {
          value: '4',
          label: this.$t('dvp.performance-and-functionality')
        }
      ],
      /** 试验来源下拉选项 */
      testSourceList: [
        {
          value: '1',
          label: this.$t('dvp.drawing')
        },
        {
          value:  '2',
          label: this.$t('dvp.KPC')
        },
        {
          value: '3',
          label: this.$t('dvp.web-require')
        },
        {
          value: '4',
          label: this.$t('dvp.standard')
        },
        {
          value: '5',
          label: this.$t('dvp.laws-and-regulations')
        }
      ],
      /** 等效实验报告编号下拉选项 */
      equivalentList: [],
      /**数据来源 0-新建1-模板2-FMEA3-历史DVP */
      dataSource: undefined,
      /** 不开展试验 插槽disabled */
      notCarryOutDisabled: false,
      /** 等效试验 插槽disabled */
      isEquivalentDisabled: false
    };
  },
  watch: {
    tableColumns: {
      handler() {
        this.$nextTick(() => {
          // 获取表格的总宽度
          this.handleResize();
          // 计算 width 属性的总和
          this.getColumnWidthTotal();
          // 动态修改fixe属性
          this.changeFixed();
          // 修改table表格表头外边盒子的背景颜色以及外边距，以适应表格动态变化
          this.getTableDivCss();
        });
      },
      deep: true,
      immediate: true
    },
    tableWidth:{
      handler() {
        this.$nextTick(() => {
          // 获取表格的总宽度
          this.handleResize();
          // 计算 width 属性的总和
          this.getColumnWidthTotal();
          // 动态修改fixe属性
          this.changeFixed();
          // 修改table表格表头外边盒子的背景颜色以及外边距，以适应表格动态变化
          this.getTableDivCss();
        });

      },
      deep: true,
      immediate: true
    }
  },

  mounted() {
    this.getTestOwner();
    this.getReportCodeList();
    window.onresize = () => {
      this.tableHeight = window.innerHeight - 360 + 'px';
      this.tableHeightValue = window.innerHeight - 418;
    };
    // 监听页面窗体大小变化
    window.addEventListener('resize', this.handleResize);
    // 修改table表格表头外边盒子的背景颜色以及外边距，以适应表格动态变化
    this.getTableDivCss();
  },
  //剔除页面窗体大小变化得监听事件
  beforeDestroy() {
    window.removeEventListener('resize', this.handleResize);
  },
  methods: {
    // 修改table表格表头外边盒子的背景颜色以及外边距，以适应表格动态变化
    getTableDivCss(){
      // 选中包裹表格的 div 元素
      let tableHeaderDiv = document.querySelector('.ant-table-header.ant-table-hide-scrollbar');
      let tableHeaderReal = document.querySelector('.resize-table-th');
      // 检查是否成功选中
      if (tableHeaderDiv) {
        // 设置背景颜色为灰色
        tableHeaderDiv.style.backgroundColor = 'rgb(245, 246, 247)';
        // 表头外层盒子的的实际样式
        let computedDivStyle = window.getComputedStyle(tableHeaderDiv);
        // 表头外层盒子的的实际高度
        let tableDivHeight = parseFloat(computedDivStyle.getPropertyValue('height'));
        // 表头的实际样式
        let computedTableStyle = window.getComputedStyle(tableHeaderReal);
        // 表头的实际高度
        let tableHeight = parseFloat(computedTableStyle.getPropertyValue('height'));
        // 设置底部外边距，一下会是负值，用于将表头下的数据单元格纵向对齐
        tableHeaderDiv.style.marginBottom = (tableHeight-tableDivHeight)+'px';
      }
    },
    // 获取表格的总宽度
    handleResize() {
      this.tableWidth = this.causeShowFlag ? this.$refs.tableRefs.$el.offsetWidth : 0;
    },
    // 计算表格各列宽度总和
    getColumnWidthTotal(){
      this.columnsWidth = this.tableColumns.reduce((sum, column) => sum + column.width, 0);
    },
    // 动态修改fixe的属性以便表格样式不出现空白列,并平和各列与表格的总宽度
    changeFixed(){
      if (this.columnsWidth <= this.tableWidth) {
        // 遍历 tableColumns 数组，将有 fixed 属性的元素的 fixed 值设置为 false（当有固定列时，列宽总和小于表格总宽度时会串行）
        this.tableColumns.forEach((column) => {
          if (column.fixed) {
            column.fixed = false;
          }
        });
        // 获取除最后一列以外其他列的宽度总和
        let otherColumnsWidth = this.tableColumns.slice(0, -1).reduce((total, column) => {
          return total + column.width;
        }, 0);
        // 将最后一列的宽度设置为剩余宽度，避免页面表头与内容显示串行
        this.tableColumns[this.tableColumns.length - 1].width = this.tableWidth - otherColumnsWidth;
      }else {
        // 恢复最后一列原始宽度
        this.tableColumns[this.tableColumns.length - 1].width = 150;
      }
    },
    /**
     * 初始化表格数据
     * @param val
     */
    initTableData(val) {
      this.tableData = val;
      this.tableDataLength = val.length - 1;
    },

    /**
     * 获取等效试验报告下拉选
     */
    getReportCodeList() {
      // 获取等效报告下拉选
      let data = {
        dvpId: this.$store.getters.dvpId
      };
      this.$api.getPartList(data).then( res => {
        if (res.flag) {
          // 等效报告 下拉选项
          let reportList = res.data.equivalentTestList;
          reportList.forEach(item => {
            let reportOptions = {
              label: item.reportCode,
              value: item.id
            }
            this.equivalentList.push(reportOptions);
          });
        }
      });
    },

    /**
     * 获取试验负责人下拉选项
     */
    getTestOwner() {
      let data = {
        dvpId: this.$store.getters.dvpId,
        dvpType: this.$store.getters.dvpType
      }
      // 获取DVP团队成员中有编辑权限的用户
      this.$api.getDvpTeamMember(data).then(res =>{
        if (res.flag){
          let userList = res.data.teamMemberModels;
          let engineerList = res.data.engineerModels;
          userList.forEach(item =>{
            if (item.permission === 1){
              let options = {
                label: item.name,
                value: item.userId
              };
              this.testOwnerList.push(options);
            }
          });
          // 工程师数据处理
          engineerList.forEach(data => {
            let index = this.testOwnerList.findIndex(item => item.value === data.userId);
            if (index === -1) {
              let tempData = {
                label: data.name,
                value: data.userId
              };
              this.testOwnerList.push(tempData);
            }
          });
          // 是否包含Owner
          let ownerFlag = this.testOwnerList.find(item => item.value === this.$store.getters.dvpOwnerId);
          if (!ownerFlag) {
            // 测试负责人要包括DVP的Owner
            let owner = {
              label: this.$store.getters.dvpOwnerName,
              value: this.$store.getters.dvpOwnerId
            }
            this.testOwnerList.push(owner);
          }
        }
      });
    },

    /**
     * 关闭模态框
     */
    closeModal() {
      this.$emit("closeModal");
    },

    /**
     * 清空单行编辑数据
     */
    reset(val) {
      val.changeDesc = undefined;
      val.changeReason = undefined;
    },

    /**
     * 整理数据 如果无变更后描述，但有变更原因，需要清除变更原因
     */
    buildData() {
      let _that = this;
      let message = [];
      for (let i = 0; i < _that.tableDataLength; i++) {
        if (_that.tableData[i].changeDesc && !_that.tableData[i].changeReason) {
          _that.tableData[i].changeReason = "";
        }
      }
      // 是否开展实验
      if (_that.tableData[5].changeDesc === undefined) {
        message.push(_that.$t('base.info.please-enter-whether-to-develop-experimental-projects'));
      }
      // 选择了不开展试验，校验不开展原因
      if (_that.tableData[5].changeDesc === 0) {
        if (!_that.tableData[16].changeDesc) {
          message.push(_that.$t('base.info.please-enter-reason-for-not-conducting-the-experiment'));
        }
      }
      // 选择了等效试验，校验等效实验报告不能为空
      if (_that.tableData[6].changeDesc === 1) {
        if (!_that.tableData[7].changeDesc) {
          message.push(_that.$t('global-btn.please-select') + _that.$t('plan.dvp.equivalent-experiment-report-number'));
        }
      }
      if (message && message.length > 0) {
        for (let i = 0; i < message.length; i++) {
          _that.$notification.warning({message: message[i]});
        }
        return false;
      }
      return true;
    },

    /**
     * 等效/非等效
     * @param e
     */
    handleEquivalent(e) {
      this.tableData[6].changeDesc = e;
      // 0: 非等效, 1: 等效
      if (e === 0) {
        this.isEquivalentDisabled = false;
        this.tableData[7].changeDesc = undefined;
        this.tableData[7].changeReason = undefined;
      } else {
        this.isEquivalentDisabled = true;
      }
    },

    /**
     *  保存
     * @returns {boolean}
     */
    save() {
      let _that = this;
      // 非空校验
      if (!_that.buildData()) {
        return false;
      }
      // 请求参数整理
      let data = {
        dvpId: _that.$store.getters.dvpId,
        testId: _that.testId,
        isCarryOut: _that.tableData[5].changeDesc,
        isCarryOutCause: _that.tableData[5].changeReason,
        testType: _that.tableData[3].changeDesc,
        testTypeCause: _that.tableData[3].changeReason,
        testSource: _that.tableData[4].changeDesc,
        testSourceCause: _that.tableData[4].changeReason,
        equivalentId: _that.tableData[7].changeDesc,
        equivalentIdCause: _that.tableData[7].changeReason,
        testProject: _that.tableData[0].changeDesc,
        testProjectCause: _that.tableData[0].changeReason,
        targetRequire: _that.tableData[1].changeDesc,
        targetRequireCause: _that.tableData[1].changeReason,
        testStandard: _that.tableData[2].changeDesc,
        testStandardCause: _that.tableData[2].changeReason,
        testSite: _that.tableData[8].changeDesc,
        testSiteCause: _that.tableData[8].changeReason,
        testUserId: _that.tableData[9].changeDesc,
        testUserIdCause: _that.tableData[9].changeReason,
        testStep: _that.tableData[12].changeDesc,
        testStepCause: _that.tableData[12].changeReason,
        testFrequency: _that.tableData[13].changeDesc,
        testFrequencyCause: _that.tableData[13].changeReason,
        sampleNumber: _that.tableData[15].changeDesc,
        sampleNumberCause: _that.tableData[15].changeReason,
        sampleType: _that.tableData[14].changeDesc,
        sampleTypeCause: _that.tableData[14].changeReason,
        planStartTime: _that.tableData[10].changeDesc,
        planStartTimeCause: _that.tableData[10].changeReason,
        planEndTime: _that.tableData[11].changeDesc,
        planEndTimeCause: _that.tableData[11].changeReason,
        notCarryOutCause: _that.tableData[16].changeDesc,
        notCarryOutCauseChange: _that.tableData[16].changeReason
      };
      // 打开审批弹框
      _that.submitApprovalTitle = _that.$t('global-btn.apply-for-changes') + _that.$t("global-btn.submit-approval");
      _that.$refs.submitApproval.inputArgs.dvpId = _that.$store.getters.dvpId;
      _that.$refs.submitApproval.inputArgs.dvpType = '2';
      _that.$refs.submitApproval.inputArgs.departmentId = _that.$store.getters.ownerDepartmentId;
      _that.$refs.submitApproval.inputArgs.testId = _that.testId;
      _that.$refs.submitApproval.inputArgs.approveType = '61';
      _that.$refs.submitApproval.inputArgs.data = data;
      _that.$refs.submitApproval.inputArgs.delayFlag = false;
      _that.submitApprovalVisible = true;
    },

    /**
     * 是否开展实验项目 编辑
     * @param val
     */
    handleCarryOut(val){
      this.tableData[5].changeDesc = val;
      // 当是否展开试验选择“否”时,其他输入和选择都置灰
      if (val === 0) {
        this.causeShowFlag = false;
        this.notCarryOutDisabled = true;
        this.tableData[7].changeDesc = undefined;
        this.tableData[7].changeReason = undefined;
        this.tableData[6].changeDesc = undefined;
        this.tableData[6].changeDesc = undefined;
      } else {
        this.causeShowFlag = true;
        this.notCarryOutDisabled = false;
      }
    },

    /**
     * 开始时间不能选择当天
     * @param current
     * @returns {boolean}
     */
    disabledStartDate(current) {
      return current && current < moment().subtract(1,"day").endOf('day');
    },

    /**
     * 结束时间不能选择开始时间前的时间
     * @param current
     * @returns {boolean}
     */
    disabledEndDate(current) {
      // 有开始时间，则返回不能选择日期为开始时间之前的日期
      if (this.tableData[8].changeDesc) {
        return current && current < moment(this.tableData[8].changeDesc).endOf('day');
      } else { // 无开始时间，则返回不能选择日期为当前时间之前的日期
        return current && current < moment().subtract(1,"day").endOf('day');
      }
    },

    /**
     * 计划开始时间 时间选择器Change方法
     */
    handleStartTime(date, dateString) {
      if (!dateString) {
        this.tableData[8].changeDesc = "";
        return;
      }
      this.tableData[8].changeDesc = dateString;
      // 当选择的开始时间大于结束时间时，清空结束时间，让用户重新选择结束时间
      // if (Date.parse(this.tableData[8].changeDesc) > Date.parse(this.tableData[9].changeDesc)) {
      //   this.tableData[9].changeDesc = undefined;
      // }
    },
    /**
     * 计划结束时间 时间选择器Change方法
     */
    handleEndTime(date, dateString) {
      if (!dateString) {
        this.tableData[9].changeDesc = "";
        return;
      }
      //新建时，无开始时间无需作比较
      this.tableData[9].changeDesc = dateString;
    },

    /**
     * 下拉选模糊查询
     * @param input
     * @param option
     * @returns {boolean}
     */
    handleFilterDataList(input,option) {
      return option.componentOptions.children[0].text.toLowerCase().includes(input.toLowerCase());
    },
  }
};
</script>
<style lang='less' scoped>
.text-right {
  text-align: right;
}
/deep/ .ant-table-fixed-header .ant-table-scroll .ant-table-header {
  overflow: hidden!important;
  margin-bottom: 0!important;
  padding-right: 8px;
  background: rgb(250, 250, 250);
}
</style>
