service.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <!--
  2. * @Author: zwy
  3. * @Date: 2021-02-21 14:18:08
  4. * @LastEditors: Please set LastEditors
  5. * @LastEditTime: 2021-03-03 11:26:14
  6. * @Descripttion: 服务任务
  7. -->
  8. <template>
  9. <div>
  10. <div class="bpmn-service">
  11. <div class="bpmn-user">服务任务</div>
  12. <div class="sys-pop-bpmn-service_row">
  13. <el-select v-model="channel" placeholder="请选择服务任务类型" class="sys-pop-bpmn-service_select" @change="change">
  14. <el-option v-for="item in options5" :key="item.value" :label="item.label" :value="item.value"> </el-option>
  15. </el-select>
  16. </div>
  17. </div>
  18. <user :channelId="channelId" :values="userValues" @change="userChange" :prevTask="prevTask" ref="user"></user>
  19. </div>
  20. </template>
  21. <script>
  22. import user from './user.vue';
  23. export default {
  24. props: ['values', 'channelId', 'prevTask'],
  25. components: { user },
  26. data() {
  27. return {
  28. channel: '',
  29. options5: [
  30. {
  31. label: 'pc消息推送',
  32. value: '0'
  33. },
  34. {
  35. label: 'app消息推送',
  36. value: '1'
  37. }
  38. ],
  39. userValues: '',
  40. userSelect: { orgIds: [], userFormFlag: 0, userIds: [], channel: '' }
  41. };
  42. },
  43. methods: {
  44. userChange(obj) {
  45. this.userSelect = obj;
  46. this.change();
  47. },
  48. init() {
  49. if (this.values) {
  50. let data = this.values;
  51. this.channel = data.channel;
  52. this.userValues = JSON.stringify({
  53. orgIds: data.orgIds,
  54. userFormFlag: data.userFormFlag,
  55. userIds: data.userIds
  56. });
  57. }
  58. },
  59. change() {
  60. let arr = this.userSelect;
  61. arr['channel'] = this.channel;
  62. this.$emit('change', arr);
  63. }
  64. },
  65. created() {
  66. this.init();
  67. },
  68. mounted() {
  69. let $el = this.$refs.user.$el,
  70. $user = $el.querySelector('.bpmn-user');
  71. $el.removeChild($user);
  72. },
  73. watch: {
  74. values(n) {
  75. this.init();
  76. }
  77. }
  78. };
  79. </script>
  80. <style lang="scss" scoped>
  81. .bpmn-service {
  82. padding: 0 20px 20px 20px;
  83. border: 1px solid #d8d8d8;
  84. .bpmn-user {
  85. line-height: 30px;
  86. }
  87. }
  88. </style>