paramlist.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <div id="paramList" style="height: 100%;" >
  3. <div v-for="item in links">
  4. <a href="#" @click="myLink(item.param)">{{item.name}}</a><br>
  5. </div>
  6. </div>
  7. </template>
  8. <script>
  9. import $dialog from '@/utils/dialog'
  10. import store from '@/store'
  11. import { mapState, mapGetters, mapActions } from 'vuex'
  12. import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
  13. export default {
  14. name: "paramList",
  15. props: {
  16. form: {
  17. type: Object,
  18. default () {
  19. return {}
  20. }
  21. },
  22. formData: {
  23. type: Object,
  24. default () {
  25. return {}
  26. }
  27. },
  28. },
  29. computed: {
  30. ...mapState('ibps/param', {
  31. jianCeDuiXiangId: state => state.jianCeDuiXiangId,
  32. myform: state => state.myform,
  33. jianCeCanShuId: state => state.jianCeCanShuId
  34. }),
  35. },
  36. methods: {
  37. closePopo(){
  38. this.visible = false
  39. this.myform.dialogTemplate = null
  40. },
  41. openDataTemplateParamDialog(form, { type }) {
  42. $dialog({
  43. components:{
  44. // templateList: () => import ('@/views/detection/jtsjpz/view.vue'),
  45. },
  46. data() {
  47. return {
  48. type:type
  49. }
  50. },
  51. template: `<div style="height:600px;">
  52. <template-list location="absolute" />
  53. </div>`
  54. }, {
  55. dialog: {
  56. appendToBody: true,
  57. width: '60%'
  58. }
  59. }, (tpl) => {
  60. form.dialogTemplate = tpl
  61. }).catch((_this) => {
  62. _this.visible = false
  63. // 关掉弹窗
  64. form.dialogTemplate = null
  65. })
  66. },
  67. myLink(val) {
  68. this.$store.commit('ibps/param/jianCeCanShuIdSet', { jianCeCanShuId:val })
  69. this.openDataTemplateParamDialog(this.myform, {
  70. type:'param'
  71. })
  72. },
  73. display(){
  74. let that = this
  75. let weiTuoDanHao = that.formData.weiTuoDanHao
  76. let sql = "select jian_ce_dui_x_id_ FROM t_gdyrqcwt a1 WHERE wei_tuo_dan_hao_='"+weiTuoDanHao+"'"
  77. curdPost('sql',sql).then(response => {
  78. let dbData = response.variables.data
  79. if(dbData[0].jian_ce_dui_x_id_){
  80. let ids = dbData[0].jian_ce_dui_x_id_.split(",")
  81. let idsVal = "'"+ids[0]+"'"
  82. ids.forEach(function(e,ind){
  83. if(ind>0){
  84. idsVal += ",'"+e+"'"
  85. }
  86. })
  87. sql = "select id_,xiang_mu_can_shu_ FROM t_sysjtsjpz a1 WHERE id_ in("+idsVal+")"
  88. curdPost('sql',sql).then(response => {
  89. let dbData = response.variables.data
  90. that.links=[]
  91. if(dbData){
  92. dbData.forEach(function(e){
  93. that.links.push({name:e.xiang_mu_can_shu_,param:e.id_})
  94. })
  95. }
  96. })
  97. }
  98. })
  99. }
  100. },
  101. mounted() {
  102. this.$nextTick(() => {
  103. setTimeout(() => {
  104. this.display();
  105. }, 0)
  106. })
  107. },
  108. data(){
  109. return {
  110. links:[]
  111. }
  112. },
  113. created() {
  114. },
  115. }
  116. </script>
  117. <style scoped>
  118. #paramList {
  119. width: 300px;
  120. height: 30px;
  121. }
  122. </style>