public.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // +----------------------------------------------------------------------
  2. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  3. // +----------------------------------------------------------------------
  4. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
  5. // +----------------------------------------------------------------------
  6. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  7. // +----------------------------------------------------------------------
  8. // | Author: CRMEB Team <admin@crmeb.com>
  9. // +----------------------------------------------------------------------
  10. import { tableDelApi } from '@/api/common';
  11. export function modalSure(delfromData) {
  12. return new Promise((resolve, reject) => {
  13. let content = `<p>确定要${delfromData.title}吗?</p>`;
  14. if (!delfromData.info) {
  15. delfromData.info = '';
  16. }
  17. const h = this.$createElement
  18. this.$msgbox({
  19. title: '提示',
  20. message: h('p', null, [
  21. h('div', null, `确定要${delfromData.title}吗?`),
  22. h('div', null, `${delfromData.info}`)
  23. ]),
  24. showCancelButton: true,
  25. cancelButtonText: '取消',
  26. confirmButtonText: '确定',
  27. iconClass: 'el-icon-warning',
  28. confirmButtonClass: 'btn-custom-cancel'
  29. }).then(() => {
  30. if (delfromData.success) {
  31. delfromData.success
  32. .then(async (res) => {
  33. resolve(res);
  34. })
  35. .catch((res) => {
  36. reject(res);
  37. });
  38. } else {
  39. tableDelApi(delfromData)
  40. .then(async (res) => {
  41. resolve(res);
  42. })
  43. .catch((res) => {
  44. reject(res);
  45. });
  46. }
  47. }).catch(() => {
  48. })
  49. });
  50. }