Unverified Commit c77a59b4 authored by hymzcn's avatar hymzcn Committed by GitHub
Browse files

Merge pull request #518 from hymzcn/dev-1.1.0

 startup parameters
parents c3a0dcc4 db0d7885
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -28,6 +28,17 @@
                  @click="_toggleView"
                  icon="fa fa-code">
          </x-button>
          <x-button
            style="vertical-align: middle;"
            data-toggle="tooltip"
            :title="$t('Startup parameter')"
            data-container="body"
            type="primary"
            size="xsmall"
            :disabled="$route.name !== 'projects-instance-details'"
            @click="_toggleParam"
            icon="fa fa-chevron-circle-right">
          </x-button>
          <span class="name">{{name}}</span>
          &nbsp;
          <span v-if="name"  class="copy-name" @click="_copyName" :data-clipboard-text="name"><i class="iconfont" data-container="body"  data-toggle="tooltip" title="复制名称" >&#xe61e;</i></span>
@@ -383,6 +394,13 @@
      _toggleView () {
        findComponentDownward(this.$root, `assist-dag-index`)._toggleView()
      },

      /**
       * Starting parameters
       */
      _toggleParam () {
        findComponentDownward(this.$root, `starting-params-dag-index`)._toggleParam()
      },
      /**
       * Create a node popup layer
       * @param Object id
+116 −0
Original line number Diff line number Diff line
<template>
  <div class="starting-params-dag-index">
    <template v-if="isView && isActive">
       <div class="box">
         <p class="box-hd"><i class="fa fa-chevron-circle-right"></i><b>{{$t('Startup parameter')}}</b></p>
         <ul class="box-bd">
           <li><span>{{$t('Startup type')}}</span><span>{{_rtRunningType(startupParam.commandType)}}</span></li>
           <li><span>{{$t('Complement range')}}</span><span v-if="startupParam.commandParam && startupParam.commandParam.complementStartDate">{{startupParam.commandParam.complementStartDate}}-{{startupParam.commandParam.complementEndDate}}</span><span v-else>-</span></li>
           <li><span>{{$t('Failure Strategy')}}</span><span>{{startupParam.failureStrategy === 'END' ? $t('End') : $t('Continue')}}</span></li>
           <li><span>{{$t('Process priority')}}</span><span>{{startupParam.processInstancePriority}}</span></li>
           <li><span>{{$t('Worker group')}}</span><span v-if="workerGroupList.length">{{_rtWorkerGroupName(startupParam.workerGroupId)}}</span></li>
           <li><span>{{$t('Notification strategy')}}</span><span>{{_rtWarningType(startupParam.warningType)}}</span></li>
           <li><span>{{$t('Notification group')}}</span><span v-if="notifyGroupList.length">{{_rtNotifyGroupName(startupParam.warningGroupId)}}</span></li>
           <li><span>{{$t('Recipient')}}</span><span>{{startupParam.receivers || '-'}}</span></li>
           <li><span>{{$t('Cc')}}</span><span>{{startupParam.receiversCc || '-'}}</span></li>
         </ul>
       </div>
    </template>
  </div>
</template>
<script>
  import store from '@/conf/home/store'
  import { runningType } from '@/conf/home/pages/dag/_source/config'
  import { warningTypeList } from '@/conf/home/pages/projects/pages/definition/pages/list/_source/util'

  export default {
    name: 'starting-params-dag-index',
    data () {
      return {
        store,
        startupParam: store.state.dag.startup,
        isView: false,
        isActive: true,
        notifyGroupList: null,
        workerGroupList: null
      }
    },
    methods: {
      _toggleParam () {
        this.isView = !this.isView
      },
      _rtRunningType (code) {
        return _.filter(runningType, v => v.code === code)[0].desc
      },
      _rtWarningType (id) {
        return _.filter(warningTypeList, v => v.id === id)[0].code
      },
      _rtNotifyGroupName (id) {
        let o = _.filter(this.notifyGroupList, v => v.id === id)
        if (o && o.length) {
          return o[0].code
        }
        return '-'
      },
      _rtWorkerGroupName (id) {
        let o =  _.filter(this.workerGroupList, v => v.id === id)
        if (o && o.length) {
          return o[0].name
        }
        return '-'
      },
      _getNotifyGroupList () {
        let notifyGroupListS = _.cloneDeep(this.store.state.dag.notifyGroupListS) || []
        if (!notifyGroupListS.length) {
          this.store.dispatch('dag/getNotifyGroupList').then(res => {
            this.notifyGroupList = res
          })
        } else {
          this.notifyGroupList = notifyGroupListS
        }
      },
      _getWorkerGroupList () {
        let stateWorkerGroupsList = this.store.state.security.workerGroupsListAll || []
        if (!stateWorkerGroupsList.length) {
          this.store.dispatch('security/getWorkerGroupsAll').then(res => {
            this.workerGroupList = res
          })
        } else {
          this.workerGroupList = stateWorkerGroupsList
        }
      }
    },
    watch: {
      '$route': {
        deep: true,
        handler () {
          this.isActive = false
          this.notifyGroupList = null
          this.workerGroupList = null
          this.$nextTick(() => (this.isActive = true))
        }
      }
    },
    mounted () {
      this._getNotifyGroupList()
      this._getWorkerGroupList()
    }
  }
</script>
<style lang="scss">
  .starting-params-dag-index {
    .box {
      padding: 5px 10px 10px;
      .box-hd {
        .fa {
          color: #0097e0;
          margin-right: 4px;
        }
        font-size: 16px;
      }
      .box-bd {
        margin-left: 20px;
      }
    }
  }
</style>
+3 −1
Original line number Diff line number Diff line
<template>
  <div class="home-main index-model">
    <m-variable></m-variable>
    <m-starting-param></m-starting-param>
    <m-dag v-if="!isLoading" :type="'instance'"></m-dag>
    <m-spin :is-spin="isLoading"></m-spin>
  </div>
@@ -10,6 +11,7 @@
  import { mapActions, mapMutations } from 'vuex'
  import mSpin from '@/module/components/spin/spin'
  import mVariable from './_source/variable'
  import mStartingParam from './_source/startingParam'
  import Affirm from './_source/jumpAffirm'
  import disabledState from '@/module/mixin/disabledState'

@@ -91,6 +93,6 @@
    },
    mounted () {
    },
    components: { mDag, mSpin, mVariable }
    components: { mDag, mSpin, mVariable, mStartingParam }
  }
</script>
+4 −0
Original line number Diff line number Diff line
@@ -149,6 +149,10 @@ export default {

        state.tenantId = processInstanceJson.tenantId

        //startup parameters
        state.startup = _.assign(state.startup, _.pick(res.data, ['commandType', 'failureStrategy', 'processInstancePriority', 'workerGroupId', 'warningType', 'warningGroupId', 'receivers', 'receiversCc']))
        state.startup.commandParam = JSON.parse(res.data.commandParam)

        resolve(res.data)
      }).catch(res => {
        reject(res)
+4 −1
Original line number Diff line number Diff line
@@ -92,5 +92,8 @@ export default {
  // Process instance list{ view a single record }
  instanceListS: [],
  // Operating state
  isDetails: false
  isDetails: false,
  startup: {

  }
}
Loading