import axios from '@/common/services/axios-instance'
import { Modal } from 'ant-design-vue'
export default function({ button }) {
  Modal.confirm({
    title: '沟通反馈撤回',
    content: '请确认是否进行沟通反馈撤回?',
    onOk: () => {
      var { activeStepId, instId, lockId = 0, inputs } = this.FlowData
      var { formId } = this.FlowData.processFormData
      var url = 'api/flow-mobile/v1/communicatecontroller/communicate/recallFeedback'
      return axios
        .post(
          url,
          {
            activeStepId,
            instId,
            lockId,
            formId,
            commId: this.FlowData.attrs.commId,
            beanIdProperty: 'id',
            beanIdType: 'long',
            beanTitleProperty: 'title',
            bean: {
              id: this.FlowData.processFormData.beanId,
              title: this.FlowData.processFormData.processFormPropertyValues.find(
                (item) => item.dataType === 'title'
              ).value,
            },
            inputs,
          },
          {
            headers: {
              'Content-Type': 'application/json',
            },
          }
        )
        .then((_) => {
          this.updateFlow()
        })
    },
  })
}
