sequence.vue 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <!--
  2. * @Author: zzy6937@qq.com
  3. * @Date: 2019-07-11 14:25:43
  4. * @LastEditors: zwy
  5. * @LastEditTime: 2021-03-09 14:59:56
  6. * @Description: 节点之间连线的配置页
  7. -->
  8. <template>
  9. <div class="bppmn">
  10. <ul class="bpmn-user_select">
  11. <div class="bpmn-title">节点动作</div>
  12. <div class="bpmn-content">
  13. <li>
  14. <label>等于</label>
  15. <el-select v-model="result" placeholder="请选择节点动作" clearable @change="resultChange">
  16. <el-option
  17. v-for="opt in resultList"
  18. :key="opt.actionValue"
  19. :value="opt.actionValue"
  20. :label="opt.actionName"
  21. ></el-option>
  22. </el-select>
  23. </li>
  24. </div>
  25. </ul>
  26. </div>
  27. </template>
  28. <script>
  29. export default {
  30. props: ['formKey', 'channelId', 'values'],
  31. data() {
  32. return {
  33. resultList: [],
  34. result: ''
  35. };
  36. },
  37. methods: {
  38. // 根据表单获取处理结果
  39. getFormResult() {
  40. this.$http.get('/workflow/form/' + this.formKey, { channelId: this.channelId }).then(({ data }) => {
  41. let actList = data ? data.userActionList || [] : [],
  42. j = actList.length,
  43. arr = [];
  44. while (j--) {
  45. if ('指派' != actList[j].actionName) {
  46. arr = arr.concat({
  47. actionName: actList[j].actionName,
  48. actionValue: actList[j].actionValue
  49. });
  50. }
  51. }
  52. this.resultList = arr;
  53. // 设置初始值
  54. if (this.values) {
  55. this.result = this.values.substr(11).replace('"}', '');
  56. }
  57. });
  58. },
  59. resultChange(val) {
  60. this.$emit('change', val);
  61. }
  62. },
  63. created() {
  64. this.getFormResult();
  65. }
  66. };
  67. </script>
  68. <style lang="scss" scoped>
  69. .bppmn {
  70. border: 1px solid #d8d8d8;
  71. .bpmn-title {
  72. line-height: 30px;
  73. border-bottom: 1px solid #d8d8d8;
  74. padding: 0 20px;
  75. }
  76. .bpmn-content {
  77. padding: 20px;
  78. li {
  79. margin: 10px 0;
  80. label {
  81. margin-right: 10px;
  82. }
  83. .el-select {
  84. width: 80%;
  85. }
  86. }
  87. }
  88. }
  89. </style>