<template>
    <div class='basBox'>
      <div class="right-button" @click="showDialog"></div>
      <BasModulesProcessModelCenterProcessPropsSetDialog
        v-model="isDialogsVisible"
        :version="dialogParams.version"
        :modelid="dialogParams.modelid"
        :bpmid="dialogParams.bpmid"
        :treeId="dialogParams.treeId"
        :processcode="dialogParams.processcode"
        :modules="modules"
        @close="close"
      />
    </div>
</template>

<script>
import {
  getParam,
} from '../../utils/utils'
export default {

  data() {
    return {
      isDialogsVisible: false,
      dialogParams: {
        version: "V0.0",
        modelid: "",
        bpmid: "",
        treeId: '',
        processcode: "",
      },
      modules: "",
    };
  },
  methods: {
    close() {
      // this.isDialogsVisible = false
    },
    showDialog(){
      const id = JSON.parse(sessionStorage.getItem('processInfo'))?.id
      if(id){
      // this.isDialogsVisible = true
        console.log('window.location.href',window.location.href)
        console.log('setTimeout',getParam('id'))
        this.dialogParams = {
          ...this.dialogParams,
          modelid: getParam('listid'),
          bpmid: getParam('id'),
          treeId: getParam('id')
        }
        console.log(this.dialogParams)
        this.isDialogsVisible = true
        console.log('setTimeout2',this.isDialogsVisible)
      }else{
          this.$confirm('请先保存流程图')
          .then(_ => {
            done();
          })
          .catch(_ => {});
      }
    },
    // getParam(paramName) {
    // let paramValue = "";
    // let isFound = false;
    // if (location.search.indexOf("?") == 0 && location.search.indexOf("=") > 1) {
    //     let arrSource = decodeURI(location.search).substring(1, location.search.length).split("&"), i = 0;
    //     while (i < arrSource.length && !isFound) arrSource[i].indexOf("=") > 0 && arrSource[i].split("=")[0].toLowerCase() == paramName.toLowerCase() && (paramValue = arrSource[i].split("=")[1], isFound = !0), i++
    // }
    // return paramValue == "" && (paramValue = null), paramValue
    // }
  },
  computed: {},
  mounted() {


  }

};
</script>
<style scoped lang="scss">
.basBox {
  height: 0;
  overflow: hidden;
}
.right-button{ position: absolute;
 right: 15px;
    top: 90px;
    width: 30px;
    height: 60px;
    cursor: pointer;
    z-index: 99999;
}
// /deep/.el-tree{ display: none;}
/deep/.el-tabs--border-card{
    box-shadow: none;
    border: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}
/deep/.el-dialog__headerbtn{
  z-index: 2002;
}
/deep/.showFiles span{
  line-height: 18px;
    padding: 3px 20px 3px 8px;
    background-color: var(--activeColor,#2d42af);
    color: #fff;
    display: inline-block;
    vertical-align: top;
    max-width: 130px;
    border-radius: 3px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    border: none;

}

/deep/.showFiles span .el-icon-close{color:#ffffff}
/deep/.showFiles span a{color:#ffffff}
/deep/.icon-sousuo2{ content:'搜索'}
/deep/#pane-0 .text-right .el-button:first-child{display: none;}
/deep/.section {
  font-weight: 700;
    font-size: 16px;
    line-height: 28px;
    text-indent: inherit;
}
/deep/.letter {
    word-break: break-all;
}
/deep/.el-upload__input {
    display: none!important;
}
/deep/.el-tabs__nav-wrap {
    width: calc(100% - 40px) !important;
}
/deep/.el-tabs__nav-next, /deep/.el-tabs__nav-prev {
    font-size: 22px!important;
    color: #ccc;
}
/deep/.el-tabs__nav-next:hover i, /deep/.el-tabs__nav-prev:hover i {
    color: #1e91d2;
}
/deep/ .el-dialog__headerbtn {
  top: 8px !important;
  right: 6px !important;
  font-size: 20px!important;
}
/deep/ .main_tab .el-table__body-wrapper tbody tr td .cell a {
  color: #409EFF;
}
/deep/ .el-button--primary {
    background-color: #2d42af!important;
    border-color: #2d42af!important;
}
</style>
<style lang='scss'>
.el-dialog input[type=file] {
  display: none!important;
}
/*附件部分*/
.showFiles {
  color: #409eff !important;
  span {
    line-height: 18px;
    // padding: 3px 20px 3px 8px;
    // background-color: $active-color;
    // color: #ffffff;
    color: #409eff !important;
    background-color: #ffffff!important;
    display: inline-block;
    vertical-align: top;
    max-width: 200px;
    border-radius: 3px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    border: none;
    // color: #409eff;
    border: 1px solid #2d42af!important;
    border-radius: 4px;
    line-height: 24px;
    height: 24px;
    padding: 0px 20px 0px 4px;
    a,
    i {
        color: #409eff !important;
    }
  }
  &.alink span {
    padding-right: 24px;
    margin-top: 6px;
  }
  &.commonpadding span {
    padding: 3px 8px;
  }
  &.commonpadding.alink span {
    padding-right: 20px;
  }
  a:nth-of-type(2) {
    position: absolute;
    right: 6px;
    top: 2px;
  }
  &.commonpadding.alink a:nth-of-type(2) {
    position: absolute;
    right: 5px;
    top: 3px;
  }
  i {
    position: absolute;
    right: 3px;
    top: 5px;
    color: #959599;
  }
  &.processCommon i {
    top: 6px;
  }
}
#organizationDialog {
  .el-dialog__body {
    padding: 10px 20px;
  }
  .el-transfer-panel__item {
    display: block;
  }
  .el-button--primary.is-disabled,
  .el-button--primary.is-disabled:hover,
  .el-button--primary.is-disabled:focus,
  .el-button--primary.is-disabled:active {
    display: block;
  }
  .el-radio {
    margin-right: 14px;
  }
  .el-transfer {
    .el-button + .el-button {
      margin-left: 0;
    }

    .el-transfer__buttons {
      position: relative;
      .el-button {
        display: block;
      }
      .el-transfer__button:first-child {
        position: absolute;
        top: 40px;
      }
    }
  }
  .el-transfer-panel__list.is-filterable {
    height: 385px;
  }
  .el-transfer-panel__list {
    height: 385px;
  }
  .el-transfer-panel__body {
    height: 400px;
  }
  .el-dialog {
    min-width: 1080px;
  }
  .el-transfer-panel {
    width: 282px;
    height: 100%;
  }
  .el-transfer-panel__footer {
    height: auto;
  }

}
</style>