nodeForm.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <div class="nodeForm">
  3. <el-form ref="ruleForm" :model="tableForm" label-width="100px">
  4. <el-row :gutter="20">
  5. <el-col :span="24">
  6. <el-form-item prop="algorithmname" label="算法名称">
  7. <el-input size="small" v-model="tableForm.algorithmname" placeholder="请输入" />
  8. </el-form-item>
  9. </el-col>
  10. <el-col v-if="formatData(algorithmtype) == 'java' || formatData(algorithmtype) == 'db' || formatData(algorithmtype) == 'kafka'" :span="24">
  11. <el-form-item prop="datasourceid" label="数据源">
  12. <el-select size="small" v-model="tableForm.datasourceid" placeholder="请选择">
  13. <el-option v-for="(item,index) in selectSource" :key="index" :label="item.datasourcedescribe" :value="item.datasourceid"></el-option>
  14. </el-select>
  15. </el-form-item>
  16. </el-col>
  17. <el-col v-if="formatData(algorithmtype) != 'js'" :span="24">
  18. <el-form-item prop="targetsource" label="数据源目标">
  19. <el-input size="small" v-model="tableForm.targetsource"></el-input>
  20. </el-form-item>
  21. </el-col>
  22. <el-col :span="24">
  23. <el-form-item prop="executionorder" label="执行排序">
  24. <el-input size="small" v-model="tableForm.executionorder"></el-input>
  25. </el-form-item>
  26. </el-col>
  27. <el-col :span="24">
  28. <el-form-item prop="algorithmdescription" label="算法说明">
  29. <el-input size="small" v-model="tableForm.algorithmdescription"></el-input>
  30. </el-form-item>
  31. </el-col>
  32. <el-col :span="24">
  33. <el-form-item prop="computingexpression" label="计算表达式">
  34. <el-input size="small" type="textarea" v-model="tableForm.computingexpression"></el-input>
  35. </el-form-item>
  36. </el-col>
  37. <el-col :span="24">
  38. <el-form-item prop="preconditions" label="执行条件">
  39. <el-input size="small" type="textarea" v-model="tableForm.preconditions"></el-input>
  40. </el-form-item>
  41. </el-col>
  42. <el-col :span="24">
  43. <el-form-item prop="preparameterset" label="前置条件参数">
  44. <el-input size="small" type="textarea" v-model="tableForm.preparameterset"></el-input>
  45. </el-form-item>
  46. </el-col>
  47. </el-row>
  48. </el-form>
  49. </div>
  50. </template>
  51. <script>
  52. export default {
  53. name: 'NodeForm',
  54. props: {
  55. algorithmtype: {
  56. type: String,
  57. default: ''
  58. },
  59. nodeForm: {
  60. type: Object,
  61. default: () => new Object()
  62. }
  63. },
  64. data () {
  65. return {
  66. tableForm: {
  67. serviceid: '',
  68. preconditions: '',
  69. algorithmtype: '',
  70. algorithmname: '',
  71. algorithmsourcelibraryid: '',
  72. executionorder: '',
  73. targetsource: '',
  74. datasourceid: '',
  75. computingexpression: '',
  76. algorithmdescription: '',
  77. preparameterset: ''
  78. },
  79. selectSource: JSON.parse(sessionStorage.getItem('nodeDatasource')) || []
  80. }
  81. },
  82. watch: {
  83. nodeForm: {
  84. handler (obj) {
  85. if (Object.keys(obj).length) {
  86. this.tableForm = _.cloneDeep(obj)
  87. }
  88. },
  89. deep: true,
  90. immediate: true
  91. }
  92. },
  93. methods: {
  94. formatData (name) {
  95. return typeof name == 'string' ? name.toLocaleLowerCase() : name
  96. },
  97. }
  98. }
  99. </script>
  100. <style>
  101. </style>