TaskBackNodes.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <view>
  3. <view class="cu-modal bottom-modal" style="min-height: 200upx;" :class="modalName=='bottomModal'?'show':''">
  4. <view class="cu-dialog">
  5. <view class="cu-bar bg-white">
  6. <view class="action text-blue" @tap="hideModal">取消</view>
  7. <view class="action text-green" @tap="doConfirm">确定</view>
  8. </view>
  9. <view>
  10. <ly-tree :tree-data="backNodes"
  11. :props="props"
  12. node-key="taskDefKey"
  13. :checkOnClickNode ="true"
  14. :showRadio="true"
  15. :show-checkbox ="false"
  16. ref="userTree" />
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import taskService from "@/api/flowable/taskService"
  24. export default {
  25. data() {
  26. return {
  27. modalName: null,
  28. backNodes: []
  29. };
  30. },
  31. props: {
  32. props: {
  33. type: Object,
  34. default: () => {
  35. return {
  36. children: 'children',
  37. label: 'taskName'
  38. }
  39. }
  40. }
  41. },
  42. mounted() {
  43. },
  44. methods:{
  45. init (taskId) {
  46. this.showModal()
  47. taskService.backNodes(taskId).then((data) => {
  48. this.backNodes = data
  49. })
  50. },
  51. doConfirm () {
  52. let taskDefKey = this.$refs.userTree.getCheckedNodes().map((item)=>{
  53. return item.taskDefKey
  54. }).join(",");
  55. this.$emit('getBackTaskDefKey', taskDefKey)
  56. this.hideModal()
  57. },
  58. showModal() {
  59. this.modalName = "bottomModal"
  60. },
  61. hideModal() {
  62. this.modalName = null
  63. }
  64. }
  65. }
  66. </script>