Unverified Commit c9022540 authored by millionfor's avatar millionfor Committed by GitHub
Browse files

Merge pull request #88 from millionfor/dev-20190415

Dev 20190415
parents 7692b062 d5784cf0
Loading
Loading
Loading
Loading
+46 −27
Original line number Diff line number Diff line
@@ -11,13 +11,14 @@
              :placeholder="$t('prop(required)')"
              maxlength="64"
              @on-blur="_verifProp()"
              style="width: 164px;">
              :style="inputStyle">
      </x-input>
      <template v-if="hide">
        <x-select
                style="width: 80px;"
                @change="_handleDirectChanged"
                v-model="localParamsList[$index].direct"
              :disabled="isDetails || !hide">
                :disabled="isDetails">
          <x-option
                  v-for="city in directList"
                  :key="city.code"
@@ -29,7 +30,7 @@
                style="width: 118px;"
                @change="_handleTypeChanged"
                v-model="localParamsList[$index].type"
              :disabled="isDetails || !hide">
                :disabled="isDetails">
          <x-option
                  v-for="city in typeList"
                  :key="city.code"
@@ -37,6 +38,7 @@
                  :label="city.code">
          </x-option>
        </x-select>
      </template>
      <x-input
              :disabled="isDetails"
              type="text"
@@ -44,7 +46,7 @@
              :placeholder="$t('value(optional)')"
              maxlength="64"
              @on-blur="_handleValue()"
              style="width: 150px;position: relative;margin-bottom: -2px;">
              :style="inputStyle">
      </x-input>
      <span class="lt-add">
        <a href="javascript:" style="color:red;" @click="!isDetails && _removeUdp($index)" >
@@ -57,7 +59,7 @@
        </a>
      </span>
    </div>
    <span class="add" v-if="!localParamsList.length">
    <span class="add-dp" v-if="!localParamsList.length">
      <a href="javascript:" @click="!isDetails && _addUdp()" >
        <i class="iconfont" :class="_isDetails" data-toggle="tooltip" :title="$t('Add')">&#xe636;</i>
      </a>
@@ -173,6 +175,11 @@
    created () {
      this.localParamsList = this.udpList
    },
    computed: {
      inputStyle () {
        return `width:${this.hide ? 160 : 262}px`
      }
    },
    mounted () {
    },
    components: { }
@@ -197,6 +204,7 @@
    }
    .add {
      a {
        color: #000;
        .iconfont {
          font-size: 18px;
          vertical-align: middle;
@@ -205,5 +213,16 @@
        }
      }
    }
    .add-dp{
      a {
        color: #0097e0;
        .iconfont {
          font-size: 18px;
          vertical-align: middle;
          display: inline-block;
          margin-top: 2px;
        }
      }
    }
  }
</style>
+3 −9
Original line number Diff line number Diff line
@@ -668,26 +668,21 @@ JSP.prototype.saveStore = function () {
/**
 * Event processing
 */

JSP.prototype.handleEvent = function () {
  this.JspInstance.bind('beforeDrop', function (info) {
    let sourceId = info['sourceId']// 出
    let targetId = info['targetId']// 入

    /**
     * Recursive search for nodes
     */
    let recursiveVal
    const recursiveTargetarr = (arr, targetId) => {
      for (var i in arr) {
      for (let i in arr) {
        if (arr[i] === targetId) {
          recursiveVal = targetId
        } else {
          let recTargetarrArr = rtTargetarrArr(arr[i])
          if (recTargetarrArr.length) {
            recursiveTargetarr(recTargetarrArr, targetId)
          } else {
            return recursiveTargetarr(targetId)
          }
          recursiveTargetarr(rtTargetarrArr(arr[i]), targetId)
        }
      }
      return recursiveVal
@@ -700,7 +695,6 @@ JSP.prototype.handleEvent = function () {

    // Recursive form to find if the target Targetarr has a sourceId
    if (recursiveTargetarr(rtTargetarrArr(sourceId), targetId)) {
      // setRecursiveVal(null)
      return false
    }

+2 −2
Original line number Diff line number Diff line
@@ -24,8 +24,8 @@ import store from '@/conf/home/store'
 * Node, to array
 */
const rtTargetarrArr = (id) => {
  let a = $(`#${id}`).attr('data-targetarr')
  return a ? a.split(',') : []
  let ids = $(`#${id}`).attr('data-targetarr')
  return ids ? ids.split(',') : []
}

/**
+10 −2
Original line number Diff line number Diff line
@@ -138,8 +138,8 @@

<style lang="scss" rel="stylesheet/scss">
  .udp-model {
    width: 616px;
    min-height: 326px;
    width: 624px;
    min-height: 420px;
    background: #fff;
    border-radius: 3px;
    padding:20px 0 ;
@@ -182,6 +182,14 @@
    }
    .content {
      padding-bottom: 50px;
      .user-def-params-model {
        .add {
          a {
            color: #0097e0;
          }
        }
      }
    }

  }
</style>
+34 −8
Original line number Diff line number Diff line
<template>
  <div class="variable-model">
    <template v-if="list">
      <div class="list">
        <div class="name"><i class="fa fa-code"></i><b style="padding-top: 3px;display: inline-block">{{$t('Global parameters')}}</b></div>
        <div class="var-cont">
          <x-button size="xsmall" type="ghost" v-for="(item,$index) in list.globalParams"  @click="_copy('gbudp-' + $index)" :data-clipboard-text="item.prop + ' = ' +item.value" :class="'gbudp-' + $index"><b style="color: #2A455B;">{{item.prop}}</b> = {{item.value}}</x-button>
          <template v-for="(item,$index) in list.globalParams">
            <x-button
                    size="xsmall"
                    type="ghost"
                    @click="_copy('gbudp-' + $index)"
                    :data-clipboard-text="item.prop + ' = ' +item.value"
                    :class="'gbudp-' + $index">
              <b style="color: #2A455B;">{{item.prop}}</b> = {{item.value}}
            </x-button>
          </template>
        </div>
      </div>
      <div class="list" style="height: 30px;">
@@ -14,14 +24,24 @@
      </div>
      <div class="list list-t" v-for="(item,key,$index) in list.localParams">
        <div class="task-name">Task({{$index}}):{{key}}</div>
        <div class="var-cont" v-if="item.length">
          <template v-for="(el,index) in item">
            <x-button size="xsmall" type="ghost" @click="_copy('copy-part-' + index)" :data-clipboard-text="_rtClipboard(el)" :class="'copy-part-' + index">
              <span v-for="(e,k,i) in el"><b style="color: #2A455B;">{{k}}</b> = {{e}} </span>
        <div class="var-cont" v-if="item.localParamsList.length">
          <template v-for="(el,index) in item.localParamsList">
            <x-button size="xsmall" type="ghost" @click="_copy('copy-part-' + index)" :data-clipboard-text="_rtClipboard(el,item.taskType)" :class="'copy-part-' + index">
              <span v-for="(e,k,i) in el">
                <template v-if="item.taskType === 'SQL' || item.taskType === 'PROCEDURE'">
                  <template v-if="(k !== 'direct' && k !== 'type')">
                    <b style="color: #2A455B;">{{k}}</b> = {{e}}
                  </template>
                </template>
                <template v-else>
                  <b style="color: #2A455B;">{{k}}</b> = {{e}}
                </template>
              </span>
            </x-button>
          </template>
        </div>
      </div>
    </template>
  </div>
</template>
<script>
@@ -71,10 +91,16 @@
      /**
       * Copyed text processing
       */
      _rtClipboard (el) {
      _rtClipboard (el, taskType) {
        let arr = []
        Object.keys(el).forEach((key) => {
          if (taskType === 'SQL' || taskType === 'PROCEDURE') {
            if (key !== 'direct' && key !== 'type') {
              arr.push(`${key}=${el[key]}`)
            }
          } else {
            arr.push(`${key}=${el[key]}`)
          }
        })
        return arr.join(' ')
      }
Loading