linkShowDetail.vue 1.72 KB
Newer Older
wangcong committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
<template>
    <div>
       <Input  v-if="!value"  :disabled="true" style="width: 100%" />
       <div  v-else  class="link">
          <a type="text" @click="jumpToDetail" class="aClass">{{value}}</a>
       </div>
    </div>
</template>

<script>
import input from './util/bc_input.js'
export default {
  name: "超链接",
  mixins: [input],
  data() {
    return {
      id:null,
      queryData:[]
    }
  },
  watch: {
    value: function (nv, ov) {
       
    },
  },
  methods: {
    jumpToDetail(){
      let configId = 'SHLLID';
      let configDefineName = 'SHLLDEFINE';
      if(this.define.config.defineId && this.define.config.defineId.split('.').length>1){
        configId =  this.define.config.defineId.split('.')[1];
      }
      if(this.define.config.defineName && this.define.config.defineName.split('.').length>1){
        configDefineName =  this.define.config.defineName.split('.')[1];
      }
      let defineName = this.context.dataObject.getValue(configDefineName);
      let id = this.context.dataObject.getValue(configId);
      let a = "/showBillForm/" + defineName + '_R/' + id;
      let routeData = GMS.routerManager.getRouter().resolve({
        path: a
      }); 
      window.open(routeData.href, "_blank"); 
    }
  },
  mounted() {
    GMS.vbus.$on('onSelectionChange', (selection) => {
      this.queryData = [...selection]
    })
    GMS.vbus.$on('onCurrentChange', (currentRow) => {
      this.queryData = [currentRow]
    })
  }
}
</script>

<style scoped>
.link{
  border-radius:4px;
  border: 1px solid #ddd;
  width: 100%;
  display: inline-block;
  height: 32px;
  line-height: 32px;
}
.aClass{
  color:#3379A7;
  margin-left:8px;
}
.aClass:hover{
  text-decoration:underline;
  color: #3379A7;
}
</style>